29.01.2015, 10:43
When i do off duty it's wont remove.
Код:
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"); } else { SendClientMessageEx(playerid, COLOR_WHITE, "You are now on a-duty."); new Text3D:label = Create3DTextLabel("Admin on duty", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7); 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); } } else { SendClientMessageEx(playerid, COLOR_GRAD1, " You are not a Administrator!"); } return 1; }