Problem - 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: Problem (
/showthread.php?tid=425089)
Problem -
Akcent_Voltaj - 24.03.2013
i put at ongamemodeinit and dosent work..
PHP код:
kmtimer = SetTimer("KilometriParcursi", 1000, 1); // this i think works for id 0..
i had this at onplayerconnect and itwas fine when i starts svr..then it went faster...
PHP код:
SetTimerEx("KilometriParcursi", 1000, true, "i", playerid);
...what can i do?
Re: Problem -
thefatshizms - 24.03.2013
pawn Код:
// top of script
new Timer[MAX_PLAYERS];//global variable
forward KilometriParcursi(playerid);//forward it
public KilometriParcursi(playerid) {
//do what you want here
return 1;
}
public OnPlayerConnect(playerid) {
Timer[playerid] = SetTimerEx("KilometriParcursi", 1000, true, "i", playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason) {
KillTimer(Timer[playerid]);
}