[Pomoc] Maska

Započeo ZC_Bob, Septembar 17, 2013, 14:33:48 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: S.E
Detaljan opis problema: Ne znam kako da napravim da kad igrac stavi masku, da mu se promeni ime u [Masked](ID), posto imam komandu /masked da vidim ko su maskirani na serveru, ali ona kao da nicemu ni ne sluzi kad ni ja sam ne vidim ID tog igraca :D, npr igrac kuca /maskon i postavi mu se ime na [Masked](ID), i kad kuca /maskoff da mu se ime vrati na staro, video sam ovo na nekim serverima pa me zanima kako napraviti ovo? Znam da treba koristi SetPlayerName, ali ocu da se vidi health, armor, i ID tog igraca, i naravno da se ime vrati na staro kad kuca /maskoff :)
Dio skripte: evo komande /maskon i /maskoff:
if(strcmp(cmd, "/maskon", true) == 0) // by Ellis
{
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pMask] == 0)
    {
         SendClientMessage(playerid, COLOR_GRAD1, "   Nemate masku");
         return 1;
    }
    if(PlayerInfo[playerid][pLevel] < 5)
    {
        SendClientMessage(playerid, COLOR_GRAD1, "  Niste u mogucnosti da je koristite.");
        return 1;
    }
foreach (Player, i)
{
    ShowPlayerNameTagForPlayer(i, playerid, 0);
}
PlayerInfo[playerid][pMaskuse] = 1;
SendClientMessage(playerid, COLOR_WHITE, "Stavili ste vasu masku [/maskoff da je skinete].");
GetPlayerName(playerid, sendername, sizeof(sendername));
      format(string, sizeof(string), "* %s stavlja masku.", sendername);
      ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}

if(strcmp(cmd, "/maskoff", true) == 0) // by Ellis
{
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pMask] == 0)
    {
        SendClientMessage(playerid, COLOR_GRAD1, "   Nemate masku");
        return 1;
    }
    if(PlayerInfo[playerid][pLevel] < 5)
    {
        SendClientMessage(playerid, COLOR_GRAD1, "   Niste u mogucnosti da je koristite.");
        return 1;
    }
foreach (Player, i)
{
    ShowPlayerNameTagForPlayer(i, playerid, 1);
}
PlayerInfo[playerid][pMaskuse] = 0;
SendClientMessage(playerid, COLOR_WHITE, "Skinuli ste masku [/maskon da je opet stavite].");
GetPlayerName(playerid, sendername, sizeof(sendername));
      format(string, sizeof(string), "* %s skida masku.", sendername);
      ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}

i komanda /masked
if (strcmp(cmd, "/masked", true) == 0)
{
        if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pGm] < 1)
        {
            SendClientMessage(playerid, COLOR_GREY, "  Niste ovlasteni da koristite tu komandu . ");
            return 1;
        }
SendClientMessage(playerid, COLOR_GRAD1, "[ Igraci sa maskama ]:");
foreach (Player, i)
{
    if(PlayerInfo[i][pMaskuse] == 1)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "[ID: %d] %s", i, sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
}
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): //

Ewo ti FS ako znas ubaciti u G mod ubaci



#define FILTERSCRIPT

#include <a_samp>
#include <sscanf2>
#include <zcmd>


new OldUsername[MAX_PLAYER_NAME][MAX_PLAYERS]; // This is to get your username back!
new bool:Masked[MAX_PLAYERS] = false;
new isStranged[MAX_PLAYER_NAME] = 0;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("------------------------------");
print("| Simple Mask System Loaded! |");
print("|         Version v1.0!      |");
print("------------------------------");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

#else

main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}

public OnPlayerConnect(playerid)
{
isStranged[playerid] = 0;
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
isStranged[playerid] = 0;
return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
if(Masked[playerid])
    {
        new string[128];
        format(string, sizeof(string), ": %s", text);
        ProxDetector(30.0, playerid, text, -1);
        return 0;
    }
return 1;
}

CMD:mask(playerid, params[])
{
    //if(pInfo[playerid][pLevel] == 0)  //If you don't want all players to use the /mask command, Change this line.
    if(isStranged[playerid] == 0)
    {
        new randomID = random(200);
        new string[35];
        isStranged[playerid] = true;
        GetPlayerName(playerid, string, sizeof(string));
        strmid(OldUsername[playerid], string, 0, strlen(string), 64);
        format(string,sizeof(string), "Stranger", randomID);
        SetPlayerName(playerid, string);
        SetPlayerAttachedObject(playerid, 1, 19037, 2, 10, 4.7, 0.0, 90, 90, 0);
        SendClientMessage(playerid, -1, "You have put on a mask! (/mask to romove it)");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            ShowPlayerNameTagForPlayer(i, playerid, 0);
        }
    }
    else
    {
        SetPlayerName(playerid, OldUsername[playerid]);
        isStranged[playerid] = false;
        SendClientMessage(playerid, -1, "You have removed your mask!");
        if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) RemovePlayerAttachedObject(playerid, 1);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            ShowPlayerNameTagForPlayer(i, playerid, 1);
        }
    }
    return 1;
}

stock ProxDetector(Float:radi, playerid, string[],color)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
        {
            SendClientMessage(i,color,string);
        }
    }
}

Moze li nekako jednostavnije ovo da se uradi/pojasni? :D

Pa jednostavnije ti nisam mogao dati to ti je Filter skripta kopiraj ono sto sam ti poslo otvori pawn zalepi u pawn spremi u svoj gm u datoteku filterskripts pod nekim nazivom npr (maska) onda otoris server cfg file i pod linijom filterscripts stavis naziv koji si spremio (maska) i to je to ew ti primer


echo Executing Server Config...
lanmode 0
rcon_password 123
maxplayers 50
port 7777
hostname ime tvog servra
gamemode0 gamemode
filterscripts maska
plugins streamer sscanf
announce 0
query 1
chatlogging 0
weburl www.uskoro.com
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 0
logtimeformat [%H:%M:%S]