SA-MP Forums Archive
Red Admin Name - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Red Admin Name (/showthread.php?tid=240419)



Red Admin Name - slowride326 - 15.03.2011

How to make a admin names red. through a toggle like /togredname


Re: Red Admin Name - Michael@Belgium - 15.03.2011

Something like that :

pawn Код:
if(strcmp("/togredname",cmdtext,true))
{
      if(IsPlayerAdmin(playerid))
      {
          SetPlayerColor(playerid, COLOR_RED);
      }
      return 1;
}



Re: Red Admin Name - admantis - 15.03.2011

pawn Код:
new PreviousColor[MAX_PLAYERS];
CMD:togredname(playerid, params[])
{
    #define Msg SendClientMessage
    if (!IsPlayerAdmin(playerid))
    {
        return
            Msg(playerid, 0xFF0011FF, "This command is only for admins");
    }
    if (GetPVarInt(playerid, "RedNameOn") == 1)
    {
        PreviousColor[playerid] = GetPlayerColor(playerid);
        SetPlayerColor(playerid, 0xFF0000FF);
        SetPVarInt(playerid, "RedNameOn", 1);
        Msg(playerid, 0xFF0011FF, "Red name enabled");
    }
    else
    {
        SetPlayerColor(playerid, PreviousColor[playerid]);
        SetPVarInt(playerid, "RedNameOn", 0);
        Msg(playerid, 0xFF0011FF, "Red name enabled");
    }
    #undef Msg
    return true;
}