Health Check via IRCCMD.
#1

I have a health check function with IRCCMD. But i run into a little problem there with my function.

pawn Код:
SetTimerEx("HPCheckTimer",500,0,"iiff",INVALID_PLAYER_ID,Tplayerid,OldHealth, OldArmour);
Ive been using it like this, but it gives Array index out of bounds, ID 65535.
But is it possible to to solve this without changing HPCHeckTimer to "siff"?
Reply
#2

I don't get it, why are you trying to check for the HP of the INVALID_PLAYER_ID constant?

Or was that just an example?

If example just add if check...
Reply
#3

Ok, firstly why are you checking two players at time:
pawn Код:
"ii",INVALID_PLAYER_ID,Tplayerid
And whats that "T" doing before "playerid"??

Try this:
pawn Код:
new Float:Health;
new Float:Armour;
GetPlayerHealth(playerid,Health);
GetPlayerArmour(playerid,Armour);
SetTimerEx("HPCheckTimer",500,0,"iff",playerid,Health,Armour);
OR:
pawn Код:
new Float:Health;
new Float:Armour;
GetPlayerHealth(playerid,Health);
GetPlayerArmour(playerid,Armour);
SetPVarFloat(playerid,"PHealth",Health);
SetPVarFloat(playerid,"PArmor",Armour);
SetTimerEx("HPCheckTimer",500,0,"i",playerid); // and then check it with GetPVarFloat
Reply
#4

HPCheckTimer returns a message to AdminChat like this:
pawn Код:
"Health Hack test on %s was Positive! Did not lose armour. (By: %s)" pName(Tplayerid), pName(playerid) );
Thats why i use both playerid and ID of target.
In game the CMD works fine. But in IRC im not assigned a playerid.

Edit: ok, i just created public IRCHpCheckTimer, which uses 'siff'. Dont know if its the best way to solve this but..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)