04.04.2012, 00:53
pawn Код:
new gAdminSkin[MAX_PLAYERS]; // add at top of script, and remember when the player disconnects set this to 0.
CMD:adminduty(playerid, params[])
{
if(PlayerData[ID][AdminLevel] >= 1)
{
if(AdminDuty[playerid])
{
AdminDuty[playerid] = false;
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,0);
SetPlayerColor(playerid, 0xFFFFFFFF);
SetPlayerSkin(playerid, gAdminSkin[playerid]); // sets the old skin back
gAdminSkin[playerid] = 0; // clears the old skin variable(need to have this)
SendClientMessage(playerid, -1, "Admin duty set {FF0000}OFF!");
}
else
{
AdminDuty[playerid] = true;
SetPlayerHealth(playerid,99999);
SetPlayerArmour(playerid,99999);
SetPlayerSkin(playerid,82);
SetPlayerColor(playerid, 0xFF0000FF);
gAdminSkin[playerid] = GetPlayerSkin(playerid); // stores the skin id in the variable so you can use it later on.
SendClientMessage(playerid, -1, "Admin duty set {00FF00}ON!");
}
}
else return SendClientMessage(playerid, COLOR_RED, "You have to be level 1 to use this command!"); //if he isn't allowed to use this command, send him this message
return 1;
}

