Debug with spawn timer - 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: Debug with spawn timer (
/showthread.php?tid=66081)
Debug with spawn timer -
Hef - 19.02.2009
Hi,
I really need a Debug mode with a spawn timer. So, when someone spawns a vehicle, after that he/she has to wait for 1 min before spawning again.
But, i had this, with tickcount and it worked. But, now i bought a host with linux stuff and tickcount doesn't work anymore.
So i need a different option. Who has something for me?
Re: Debug with spawn timer -
kc - 19.02.2009
tried using GetTickCount ?
Re: Debug with spawn timer -
Hef - 19.02.2009
''But, i had this, with tickcount and it worked. But, now i bought a host with linux stuff and tickcount doesn't work anymore.''
Re: Debug with spawn timer -
kc - 19.02.2009
I assumed by "tickcount", you meant the function tickcount()
Whereas the function GetTickCount() does work on linux (mainly)
Re: Debug with spawn timer -
Hef - 19.02.2009
Seriously?
Can you please help me a little with it. Like, how would i code it?
Re: Debug with spawn timer -
kc - 19.02.2009
you would use GetTickCount in exactly the same way as tickcount()
Re: Debug with spawn timer -
Hef - 19.02.2009
Ok wait
If i got this
Код:
dcmd_v(playerid, params[])
{
static Count[MAX_PLAYERS], Time_To_Wait = 30; //in s
if(Time_To_Wait > (tickcount() - Count[playerid]) / 1000)
return SendClientMessage(playerid, COLOR_RED, "You need to wait a while till you can spawn a new vehicle");
Count[playerid] = tickcount();
return true;
}
What do i have to change? (im not really good at scripting yet.)