CMD:aduty(playerid,params[])
{
new string[128];
if( GetPVarInt(playerid, "Level" ) < 1) return SendClientMessage(playerid,COLOR_GRAY,"You're not an admin!");
if(adminduty[playerid] = 0)
{
format(string,sizeof(string),"%s has just went on Admin Duty");
GetPlayerName(playerid);
SendClientMessageToAll(COLOR_RED,string);
SetPlayerHealth(playerid,9999);
adminduty[playerid] = 1;
SetPlayerColor(playerid,COLOR_ORANGE);
new Text3D:label = Create3DTextLabel("Administrator on Duty!", COLOR_RED, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
}
else
{
format(string,sizeof(string),"%s has just went off Admin Duty",GetPlayerName(playerid));
SendClientMessageToAll(COLOR_RED,string);
adminduty[playerid] = 0;
SetPlayerColor(playerid,COLOR_WHITE);
SetPlayerHealth(playerid,100);
}
return 1;
}
|
You aren't using GetPlayerName and format correctly... Read https://sampwiki.blast.hk/
|
|
format(string,sizeof(string),"%s has just went on Admin Duty"); GetPlayerName(playerid); |
format(string,sizeof(string),"%s has just went on Admin Duty",
GetPlayerName(playerid));