VC:MP 0.4 (Beta) > Resolved Bug Reports

[Duplicate] NewTimer

(1/1)

KraTO$:
In 0.4 Server,
I think everyone has this problem.
The Server Crashes when it meets a NewTimer.
Like in Heal Command :
When I remove the timer It works perfectly.

I Discussed with Seby about this problem  and he told that It is a Bug.
So I am here to Report

Honey.:
Do you mean a timer like this :

NewTimer( "function", 5000, 1,player ); ?

Well if you do then I know how to get rid of this bug.We have to use player.ID and maybe player.Name as well.Look at this :

--- Code: ---NewTimer( "OpenLift2", 10000, 1, player.ID, player.Name );

function OpenLift2( playerid, playername )
{
local plr = FindPlayer( playerid );
if ( plr )
{
if ( plr.Name == playername ) // To get rid of the crash we first validate the player
{
  plr.Pos = Vector( -557.44, 781.79, 22.8768 );
  l2.MoveBy(Vector(0,2,0), 2800 ); // l1 and l2 are objects, Lift doors to be exact
  l1.MoveBy(Vector(0,-2,0), 2800);
  }
  }
}

--- End code ---

This is an example which can help you the use of Timers in 0.4

stormeus:
This is a known issue that has been documented on the Squirrel issue list on Bitbucket.

KraTO$:
So it will be fixed?

BTW when i use NewTimer("blabla",1000,1,player.Name);

It Works fine.......

Navigation

[0] Message Index

Go to full version