Author Topic: [Duplicate] NewTimer  (Read 2964 times)

0 Members and 1 Guest are viewing this topic.

Offline KraTO$

  • Street Thug
  • *
  • Posts: 2
    • View Profile
[Duplicate] NewTimer
« 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
« Last Edit: November 29, 2014, 02:43:34 am by stormeus »

Offline Honey.

  • Made Man
  • ***
  • Posts: 111
    • View Profile
Re: [ Crash ] NewTimer
« Reply #1 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
« Last Edit: October 07, 2014, 03:04:22 pm by Honey. »

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: [ Crash ] NewTimer
« Reply #2 on: October 07, 2014, 05:43:56 pm »
This is a known issue that has been documented on the Squirrel issue list on Bitbucket.
Do not PM me for support.




Offline KraTO$

  • Street Thug
  • *
  • Posts: 2
    • View Profile
Re: [ Crash ] NewTimer
« Reply #3 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.......