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; }
SetPlayerHealth(playerid, health + 100000);
SetPlayerArmour(playerid, armour + 100000);
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, health + 100000); SetPlayerArmour(playerid, armour + 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; }
//add this on the top of the code where the setplayerhealth(playerid, health + 100000); is at
SetPVarInt(playerid, "MyHealth", GetPlayerHealth(playerid));
SetPVarInt(playerid, "MyArmour", GetPlayerArmour(playerid));
//then below after they off duty
SetPlayerHealth(playerid, GetPVarInt(playerid, "MyHealth"));
SetPlayerArmour(playerid, GetPVarInt(playerid, "MyArmour"));
//add this on the top of the code where the setplayerhealth(playerid, health + 100000); is at
GetPlayerHealth(playerid, SetPVarFloat(playerid,"Heal"));
GetPlayerArmour(playerid, SetPVarFloat(playerid,"Armour");
//then below after they off duty
SetPlayerHealth(playerid, GetPVarFloat(playerid, "Heal"));
SetPlayerArmour(playerid, GetPVarFloat(playerid, "Armour"));
Originally Posted by ScriptJorkis
pawn Код:
|
D:\Game\Sa-mp\Server\Current\NG-RP\gamemodes\NG-RP.pwn(30654) : warning 202: number of arguments does not match definition D:\Game\Sa-mp\Server\Current\NG-RP\gamemodes\NG-RP.pwn(30655) : warning 202: number of arguments does not match definition Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings.
Originally Posted by sGarfield
pawn Код:
|
D:\Game\Sa-mp\Server\Current\NG-RP\gamemodes\NG-RP.pwn(30654) : warning 202: number of arguments does not match definition D:\Game\Sa-mp\Server\Current\NG-RP\gamemodes\NG-RP.pwn(30654) : error 035: argument type mismatch (argument 2) D:\Game\Sa-mp\Server\Current\NG-RP\gamemodes\NG-RP.pwn(30655) : warning 202: number of arguments does not match definition D:\Game\Sa-mp\Server\Current\NG-RP\gamemodes\NG-RP.pwn(30655) : error 035: argument type mismatch (argument 2) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
SetPVarInt(playerid, "MyHealth", GetPlayerHealth(playerid, health));
SetPVarInt(playerid, "MyArmour", GetPlayerArmour(playerid, armour));