Vice City Multiplayer

VC:MP 0.4 (Beta) => Bugs and Crashes => Resolved Bug Reports => Topic started by: KraTO$ on October 07, 2014, 02:18:57 pm

Title: [Duplicate] NewTimer
Post by: KraTO$ on October 07, 2014, 02:18:57 pm
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
Title: Re: [ Crash ] NewTimer
Post by: Honey. on October 07, 2014, 02:27:21 pm
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: [Select]
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);
  }
  }
}

This is an example which can help you the use of Timers in 0.4
Title: Re: [ Crash ] NewTimer
Post by: stormeus on October 07, 2014, 05:43:56 pm
This is a known issue that has been documented on the Squirrel issue list on Bitbucket.
Title: Re: [ Crash ] NewTimer
Post by: KraTO$ on October 16, 2014, 03:48:34 pm
So it will be fixed?

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

It Works fine.......