27.06.2013, 15:34
Hello i have made this for my admin script, so say if i have 50 health and i /aduty i get maximum health and when i become off duty my previous health (50) will be restored but actually when i become off duty my health set to 0 but i dont die..
here is my script, please describe what is problem,Thanks
here is my script, please describe what is problem,Thanks

pawn Код:
CMD:aduty(playerid, params[])
{
if(pInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
if(aduty[playerid] == 0)
{
new Float:health;
new Float:armour;
SetPVarInt(playerid, "LastHealth", GetPlayerHealth(playerid, health));
SetPVarInt(playerid, "LastArmour", GetPlayerArmour(playerid, armour));
SCM(playerid, COLOR_HOTPINK,"* You Have Gone On Duty.");
SetPlayerArmour(playerid, 9999999999999);
SetPlayerHealth(playerid,0x7FB00000);
aduty[playerid] =1;
}
else
{
SCM(playerid, COLOR_HOTPINK,"* You Have Gone Off Duty.");
SetPlayerHealth(playerid, GetPVarInt(playerid, "LastHealth"));
SetPlayerArmour(playerid, GetPVarInt(playerid, "LastArmour"));
aduty[playerid] =0;
}
return 1;
}