SA-MP Forums Archive
is player on foot - 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: is player on foot (/showthread.php?tid=83120)



is player on foot - hipy - 22.06.2009

hi i want to check every 10 seconds if a player is on foot and then do like strip weapons etc
how can i do this

on playerstate change does not work for this.
thanks


Re: is player on foot - kims - 22.06.2009

try this?
Код:
SetTimer("onfoot", 600, 0);
Код:
forward onfoot(playerid);
public onfoot(playerid)
{
 if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
 {
 ResetPlayerWeapons(playerid);
 return 1;
 }
}



Re: is player on foot - Correlli - 22.06.2009

@kims: 600 is not 10 minutes, 600000 is. You need to set interval in miliseconds.


Re: is player on foot - kims - 22.06.2009

Quote:
Originally Posted by Don Correlli
@kims: 600 is not 10 minutes, 600000 is. You need to set interval in miliseconds.
He needs
Quote:

10 seconds




Re: is player on foot - Correlli - 22.06.2009

Ah sorry, didn't saw he was talking about seconds. But still, 600 is not 10 seconds, 10000 is.


Re: is player on foot - Jefff - 22.06.2009

And not
Код:
SetTimer("onfoot", 600, 0);
but
Код:
SetTimerEx("onfoot", 10000, 1, "d", playerid);