15.03.2011, 20:45
How to make a admin names red. through a toggle like /togredname
if(strcmp("/togredname",cmdtext,true))
{
if(IsPlayerAdmin(playerid))
{
SetPlayerColor(playerid, COLOR_RED);
}
return 1;
}
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;
}