SPeed o Meter

Started by Finch, Mar 19, 2015, 04:43 AM

Previous topic - Next topic

Finch

How can i add speedo meter in my server
Beztone is a scripter but he is too stupid

DizzasTeR

- A timer activated for a player when he enter the vehicle.
- On the function of the timer get the velocity of the vehicle.
- Manage your own speed measures by using sprite or any other way you want to implement. (Announce etc)
- Kill that timer when player exits the vehicle.

Simple as that.

Note: I think many scripters around here might follow me with this rule against you, and that is never provide code to you. Atleast you will look at wiki and try to write something yourself.

Kratos_


Specific timers for specific players will lag the server .  So , I would recommend to create a single timer & start tracking vehicle Speed .
Follow these steps :-



  • Create an empty array like I did here .
  • Whenever a player enters a vehicle , push his ID to this array .
  • Utilize for/foreach loop to get the IDs one by one & then find that specific player Instance to notify him the speed of his vehicle .
  • Create a timer which iterate the operation in step 3 .
  • On his exiting the vehicle , remove his ID from the array .

Although , I think that this would be atleast able to print the results . This could be done in even more better way . But , ok . Atleast we should try this first .
In the middle of chaos , lies opportunity.