11.01.2012, 07:57
Can you please help me with this?
I want that if an admin type /aduty it should GetPlayerHealth and GetPlayerArmour and should SetPlayerHelath and SetPlayerArmour to 100000.
And when they type /aduty while on duty, it should set there HP to which was before they were on duty.
Sorry for my bad English, I hope you will understand what I want
I want that if an admin type /aduty it should GetPlayerHealth and GetPlayerArmour and should SetPlayerHelath and SetPlayerArmour to 100000.
And when they type /aduty while on duty, it should set there HP to which was before they were on duty.
Код:
CMD:aduty(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { foreach(Player, i) { new Float:health, Float:armour; new string[128]; if(GetPVarInt(playerid, "AdminDuty") == 0) { format( string, sizeof( string ), "{AA3333}[Notice]{FFFF00}: %s (ID: %d) is now on Admin duty.", GetPlayerNameEx(i), i); BroadCast( COLOR_YELLOW, string); GetPlayerHealth(playerid, health); GetPlayerArmour(playerid, armour); SetPlayerHealth(playerid, 100000); SetPlayerArmour(playerid, 100000); SetPVarInt(playerid, "AdminDuty", 1); Admins += 1; } else { format( string, sizeof( string ), "{AA3333}{Notice]{FFFF00}: %s (ID: %d) is now off Admin duty.", GetPlayerNameEx(i), i); BroadCast( COLOR_YELLOW, string); SetPlayerHealth(playerid, health); SetPlayerArmour(playerid, armour); DeletePVar(playerid, "AdminDuty"); Admins -= 1; } } } else { SendClientMessageEx(playerid, COLOR_GRAD1, " You are not an Administrator."); } return 1; }