29.01.2015, 10:50
On top:
Command:
PHP код:
new Text3D:label[MAX_PLAYERS];
PHP код:
CMD:aduty(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new string[256];
if(GetPVarInt(playerid, "AdminDuty") == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You are now off a-duty.");
format(string, sizeof(string), "{FFFFFF}Administrator {FF0000}%s {FFFFFF}is now {FF0000}off{FFFFFF} a-duty.", GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_WHITE, string);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
RemovePlayerWeapon(playerid, 38);
DeletePVar(playerid, "AdminDuty");
Delete3DTextLabel(label[playerid]);
}
else
{
SendClientMessageEx(playerid, COLOR_WHITE, "You are now on a-duty.");
format(string, sizeof(string), "{FFFFFF}Administrator {00FF00}%s {FFFFFF}is now {00FF00}on{FFFFFF} a-duty.", GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_WHITE, string);
SetPlayerHealth(playerid, 100000);
SetPlayerArmour(playerid, 100000);
GivePlayerValidWeapon(playerid, 38, 66666);
SetPVarInt(playerid, "AdminDuty", 1);
label[playerid] = Create3DTextLabel("Admin on duty", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You are not a Administrator!");
}
return 1;
}