Код:
dcmd_aduty(playerid, params[])
{
new string[128], name[MAX_PLAYER_NAME];
if (sscanf(params)) SendClientMessage(playerid, COLOR_GREY, "|| Usage: /aduty ||");
else
{
if(PlayerInfo[playerid][AdminLevel]>=g_Level[lsay])
{
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "|| Administrator %s is now on ADMIN DUTY - dont shoot him! ||", name); // You will probably want to re-format this.
SendClientMessageToAll(COLOR_ORANGE, string);
SetPlayerHealth(playerid,9999999999.9);
SetPlayerColor(playerid,COLOR_BLACK);
SetPlayerSkin(playerid,186);
adminduty = true;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "You're not the needed admin level");
}
}
return 1;
}
dcmd_saduty(playerid, params[])
{
new string[128], name[MAX_PLAYER_NAME];
if (sscanf(params)) SendClientMessage(playerid, COLOR_GREY, "|| Usage: /saduty ||");
else
{
if(PlayerInfo[playerid][AdminLevel]>=g_Level[lsay])
{
SetPlayerHealth(playerid,9999999999.9);
SetPlayerColor(playerid,COLOR_BLACK);
SetPlayerSkin(playerid,186);
adminduty = true;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "You're not the needed admin level");
}
}
return 1;
}
dcmd_adutyoff(playerid, params[])
{
new string[128], name[MAX_PLAYER_NAME];
if (sscanf(params)) SendClientMessage(playerid, COLOR_GREY, "|| Usage: /adutyoff ||");
else
{
if(PlayerInfo[playerid][AdminLevel]>=g_Level[lsay])
{
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "|| Administrator %s is now off admin duty enjoying the game. ||", name); // You will probably want to re-format this.
SendClientMessageToAll(COLOR_ORANGE, string);
SetPlayerHealth(playerid,100);
SetPlayerColor(playerid,COLOR_GREY);
SetPlayerSkin(playerid,283);
adminduty = false;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "You're not the needed admin level");
}
}
return 1;
}
You don't need to use sscanf nor params since your command is only '/a...' and not something with additional parameters like '/admin on'.