Id 0 bug
#1

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?
Reply
#2

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.
Reply
#3

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); 
Reply
#4

Yes, Kraeror is right it should be
PHP код:
SetTimerEx("aerolslvtimer"20000false"i"playerid); 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)