SA-MP Forums Archive
Health Check via IRCCMD. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Health Check via IRCCMD. (/showthread.php?tid=313611)



Health Check via IRCCMD. - Richie - 26.01.2012

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"?


Re: Health Check via IRCCMD. - henry jiggy - 26.01.2012

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...


Re: Health Check via IRCCMD. - fiki574 - 26.01.2012

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



Re: Health Check via IRCCMD. - Richie - 26.01.2012

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..