This is my speed code:
#4

I don't get why you need 3 timers, which have the exact same code inside them, and why they destroy the textdraw and recreate it again every second.

All you need is 1 timer which is started when the player enters a vehicle and gets killed when he exits the vehicle.
This timer runs every second with the flag set to true instead of false to make it repeatable, and you need to supply the timer with the playerid as parameter.
The code you posted won't work because of the lack of the playerid parameter. Your timer-functions accept it, but you don't supply it anywhere using SetTimer,
therefore it's always 0 and will only work for playerid 0.

Less timers = less code = less debug-time and less chance for errors in that code.

Create the textdraw when the player connects and destroy it when he disconnects.
Or better yet, use player textdraws instead of global textdraws.
Those get destroyed automatically when the player disconnects, that's even less code.
Reply


Messages In This Thread
This is my speed code: - by Osamakurdi - 08.02.2018, 17:26
Re: This is my speed code: - by Mugala - 08.02.2018, 17:47
Re: This is my speed code: - by Osamakurdi - 08.02.2018, 17:49
Re: This is my speed code: - by AmigaBlizzard - 08.02.2018, 20:00

Forum Jump:


Users browsing this thread: 1 Guest(s)