Health Check - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Health Check (
/showthread.php?tid=109638)
Health Check -
Marc_307 - 21.11.2009
Hey, guys!
I'd like to have a testing on the player's health. I wrote a test code but there's a problem. After I spawned the tset mesage is sended but nothing more happens then. What could be wrong or what did I overlooked?
pawn Код:
new TST[MAX_PLAYERS];
new Float:OldHealth[MAX_PLAYERS];
forward TS();
public OnPlayerConnect(playerid){
OldHealth[playerid]=100.00;
return 1;
}
public OnPlayerSpawn(playerid){
TST[playerid]=SetTimer("TS",1000,1);
return 1;
}
public TS(){
for(new i=0;i<MAX_PLAYERS;i++)
{
new Float:NewHealth;
NewHealth=GetPlayerHealth(i,NewHealth);
if(OldHealth[i]>NewHealth){
OldHealth[i]=NewHealth;
SendClientMessage(i,RED,"Test Message!");
}
}
return 1;
}
Re: Health Check -
LarzI - 21.11.2009
TST[playerid]=SetTimer("TS",1000,1);
shouldn't that be
TeamSpeakTimer[playerid]=SetTimer("TS",1000,1);
?
Re: Health Check -
Marc_307 - 21.11.2009
Oops! Typo! xD
Re: Health Check -
Marc_307 - 21.11.2009
Nobody knows what might be wrong?