Id 0 bug - 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: Id 0 bug (
/showthread.php?tid=645655)
Id 0 bug -
AnoTek - 01.12.2017
I've made a airport system and when i am in airplane with a friend i am id 0 and he is 1 and i am the only one how get's to the destination becaouse i have id 0...
Code:
https://pastebin.com/U5wqEza2
How can i solve this?
Re: Id 0 bug -
PrestigeSteve - 01.12.2017
Change:
Код:
SetTimer("aerolslvtimer" ,20000 ,false);
To:
Код:
SetTimerEx("aerolslvtimer" ,20000 ,false, "i", playerid);
https://sampwiki.blast.hk/wiki/SetTimerEx
SetTimer doesn't accept any paramters. Your function 'aerolslvtimer' as a result wasn't passed any data. Therefore, it assumed playerid equaled 0. In order to fix this, we used SetTimerEx which accepts paramters and passed the playerid variable.
Re: Id 0 bug -
Kraeror - 01.12.2017
Quote:
Originally Posted by PrestigeSteve
Change: https://forum.sa-mp.com/images/editor/php.gif
Код:
SetTimer("aerolslvtimer" ,20000 ,false);
To:
Код:
SetTimerEx("aerolslvtimer" ,20000 ,false, playerid);
https://sampwiki.blast.hk/wiki/SetTimerEx
SetTimer doesn't accept any paramters. Your function 'aerolslvtimer' as a result wasn't passed any data. Therefore, it assumed playerid equaled 0. In order to fix this, we used SetTimerEx which accepts paramters and passed the playerid variable.
|
It's wrong!
Change this
PHP код:
SetTimer("aerolslvtimer" ,20000 ,false);
To:
PHP код:
SetTimerEx("aerolslvtimer" ,20000 ,false, "i", playerid);
Re: Id 0 bug -
rfr - 01.12.2017
Yes, Kraeror is right it should be
PHP код:
SetTimerEx("aerolslvtimer", 20000, false, "i", playerid);