Den Wert speichern und dann wieder setzen.
C
ocmd:aduty(playerid)
{
new string[128],Float:health;
if(AccountInfo[playerid][account_Admin] < CommandInfo[4][command_Admin] && AccountInfo[playerid][account_Mapper] != CommandInfo[4][command_Mapper] && AccountInfo[playerid][account_Scripter] != CommandInfo[4][command_Scripter])return SendErrorMessage_noRights(playerid);
if(GetPVarInt(playerid,"aduty") == 0)
{
format(string,sizeof(string),"Server: {FFFFFF}%s ist nun als %s im Einsatz",AccountInfo[playerid][account_Name],GetAdminRang(AccountInfo[playerid][account_Admin],true));
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid,10000);
SetPVarInt(playerid,"aduty",1);
SetPvarInt(playerid, "aduty_health", health);
}
else
{
format(string,sizeof(string),"Server: {FFFFFF}%s ist nun nicht mehr als %s im Einsatz",AccountInfo[playerid][account_Name],GetAdminRang(AccountInfo[playerid][account_Admin],true));
SetPlayerHealth(playerid,GetPVarInt(playerid, "aduty_health"));
SetPVarInt(playerid,"aduty",0);
}
Log(playerid,LOG_TYPE_ADMIN,"/aduty");
SendClientMessageToAll(COLOR_ORANGE,string);
return 1;
}
Alles anzeigen
