Speedometer Update faster! - 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: Speedometer Update faster! (
/showthread.php?tid=566411)
Speedometer Update faster! -
kevannkw - 05.03.2015
So currently in my script i have a speedo that does not update fast, it updates the speed every 2-3 second. I wanted it to be like every 0.5-1 second. Where should i change this? Is it a timer or something?
Re: Speedometer Update faster! -
BeesSi - 05.03.2015
Can you show us some code so we can fix the trouble and then explain it to you ?
AW: Speedometer Update faster! -
Kaliber - 05.03.2015
Quote:
Originally Posted by kevannkw
Is it a timer or something?
|
Yes it is
Look after SetTimer or SetTimerEx and there you can do this:
PHP код:
SetTimer("tacho",1000,1);
//this 1000 = 1000ms = 1sec
Greekz
Respuesta: Speedometer Update faster! -
JuanStone - 05.03.2015
Remember that many timers could cause delays in your server, i would use y_timers to create all the timers in my script.
Quote:
Originally Posted by ******
Y_timers:
Not running a timer is always more efficient than running one.
|
The following code updated its speedometer each 4° of the second.
PHP код:
#include <YSI\y_timers>
task UpdateSpeedo[250]()
{
foreach(Player, i)
{
if(speedo[i] != 0) // change your var and code..
{
// bla bla.
}
}
return true;
}