SA-MP Forums Archive
Can u edit this? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can u edit this? (/showthread.php?tid=406047)



Help Please. - Antonioh - 08.01.2013

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
try this
pawn Код:
new GiveMask[MAX_PLAYERS]; // Top of script
new MaskOn[MAX_PLAYERS]; // Top of script

//Commands can be anywhere except not in call backs like OnPlayerCommandText, or OnPlayerSpawn.

CMD:givemask(playerid, params[])
{
    new targetid;
    if(IsPlayerAdmin(playerid))
    {
        if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "USAGE: /givemask [playerid]");
        else if(targetid == INVALID_PLAYER_ID) SendClientMessage(playerid, -1, "Player not online !");
        else
        {
            if(GiveMask[targetid] == 1)
            {
                SendClientMessage(playerid, -1, "Player already has a mask!");
            }
            else
            {
                GiveMask[targetid] = 1;
            }
        }
    }
    else return SendClientMessage(playerid, -1, "You're not authorized to use this command !");
    return 1;
}

CMD:mask(playerid, params[])
{
    if(GiveMask[playerid] == 1)
    {
        if(MaskOn[playerid] == 0)
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    ShowPlayerNameTagForPlayer(i, playerid, 0);
                }
            }
            MaskOn[playerid] = 1;
            SendClientMessage(playerid, 1, "* You've put your mask on!");
        }
        else if(MaskOn[playerid] == 1)
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    ShowPlayerNameTagForPlayer(i, playerid, 1);
                }
            }
            SendClientMessage(playerid, 1, "* You've put your mask off!");
            MaskOn[playerid] = 0;
        }
    }
    return 1;
}
When people talk in /b or /s or /l or anything their name still, it's not changed to Stranger..
Can you edit it?


Re: Can u edit this? - RedCrossER - 08.01.2013

What To edit?


Re: Can u edit this? - Antonioh - 08.01.2013

When people use /mask their name didn't change to Stranger