03.04.2012, 19:08
How would i make it so when i do a command like /adminduty my name would change and the colour of it would change
Please Help Please
Please Help Please
new
bool:IsOnAdminDuty [ MAX_PLAYERS ] = false;
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/adminduty", cmdtext, true, 10) == 0)
{
if( IsPlayerAdmin( playerid ) ) //Replace this with your admin variable (PlayerInfo [ playerid ] [ pAdmin])?
{
if( IsOnAdminDuty [ playerid ] == false )
{
IsOnAdminDuty [ playerid ] = true;
SetPlayerColor( playerid, 0xFF0000FF ); //Replace this with the administrator colour.
}
else
{
IsOnAdminDuty [ playerid ] = false;
SetPlayerColor( playerid, 0xFFFFFFFF ); //Reset them to their normal colour!
}
}
else return SendClientMessage( playerid, -1, "[ERROR] You're not an Administrator!" );
return 1;
}
return 0;
}