OnVehicleSpeed
#1

Hello,

where do i put some explosions when the vehicle speed is 30 KpH ??

thanks
Reply
#2

OnPlayerUpdate
Reply
#3

Quote:
Originally Posted by Yazzu
Посмотреть сообщение
OnPlayerUpdate
You don't know what you are talking about, OPU gets called a very large and unpredictable number of times per second, which is unnecessary for this. (Imagine calculating speed of vehicles 20 - 30 times per second)

You need to calculate the speed of the vehicle under a per second timer (I don't really see a 500ms timer required)
and then check if the speed is more than 30, if yes, get the position and create explosions where necessary. You can look at this thread for information about vehicle speeds.
Reply
#4

Quote:
Originally Posted by RajatPawar
Посмотреть сообщение
You don't know what you are talking about, OPU gets called a very large and unpredictable number of times per second, which is unnecessary for this. (Imagine calculating speed of vehicles 20 - 30 times per second)

You need to calculate the speed of the vehicle under a per second timer (I don't really see a 500ms timer required)
and then check if the speed is more than 30, if yes, get the position and create explosions where necessary. You can look at this thread for information about vehicle speeds.
Can you please elaborate?

I dont understand some of those variables,

I want the vehicle explode when it reach 30 KmPh
Reply
#5

I'm sure this will get you in the right way:
https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/GetVehicleVelocity
https://sampwiki.blast.hk/wiki/CreateExplosion
And this thread for getting the right speed
Reply
#6

Quote:
Originally Posted by EpicDutchie
Посмотреть сообщение
So, why to do i need timer?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)