Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Slark__ on Oct 09, 2016, 09:23 AM

Title: Getting error moveto
Post by: Slark__ on Oct 09, 2016, 09:23 AM
gateStatus <- array( GetMaxPlayers(), null );

function onServerStart()
{
 gate <- array( GetMaxPlayers(), null );
 gateStatus = true;
 gate = CreateObject(1388, 1, -988.086, -821.651, 8.51289, 255).RotateTo( Quaternion(0, 0, -0.9, -0.866025), 0 ); // sunshine auto gate 1
}

if( key == M )
 {
 if ( InPoly( player.Pos.x, player.Pos.y, -978.048,-841.205,-977.334,-841.178,-976.197,-840.909,-974.864,-840.863,-973.86,-840.772,-972.724,-840.892,-973.484,-840.004,-975.647,-840.611,-977.421,-840.773) )
           {
    Gate( player );
   }
        }

Function :-

function Gate( player )
{
      if ( InPoly( player.Pos.x, player.Pos.y, -978.048,-841.205,-977.334,-841.178,-976.197,-840.909,-974.864,-840.863,-973.86,-840.772,-972.724,-840.892,-973.484,-840.004,-975.647,-840.611,-977.421,-840.773) )
    {
        gate.MoveTo(Vector(-988.086, -821.651, 12.51289), 2800 );
        gateStatus = false;
        }
        else
        {
        if ( gateStatus == false )
        {
            gate.MoveTo(Vector(-988.086, -821.651, 8.51289), 2800 );
            gateStatus = true;
        }
 }         
}

(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FfGvbgb8.png&hash=d575808c0028916289c68078c7ba6b467377b1c6)

Help me pls
 
Title: Re: Getting error moveto
Post by: Kewun on Oct 09, 2016, 09:32 AM
change all .MoveTo to .Pos
Title: Re: Getting error moveto
Post by: Slark__ on Oct 09, 2016, 09:34 AM
Quote from: Kewun on Oct 09, 2016, 09:32 AMchange all .MoveTo to .Pos

Same .Pos Dose not Exist
Title: Re: Getting error moveto
Post by: Kewun on Oct 09, 2016, 10:07 AM
lol, try gate <- CreateObject instead of gate = CreateObject

and gate.Pos = Vector(x,y,z ) ;
Title: Re: Getting error moveto
Post by: Slark__ on Oct 09, 2016, 10:47 AM
Quote from: Kewun on Oct 09, 2016, 10:07 AMlol, try gate <- CreateObject instead of gate = CreateObject

and gate.Pos = Vector(x,y,z ) ;

(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FwsjbTpP.png&hash=7ae2e6fb2a7bdcd87cd8802045befce469f45915)

Getting error
Title: Re: Getting error moveto
Post by: jWeb on Oct 09, 2016, 10:48 AM
RIP Documentation
RIP Debugging
RIP Common Sense
Title: Re: Getting error moveto
Post by: Slark__ on Oct 09, 2016, 11:32 AM
Quote from: jWeb on Oct 09, 2016, 10:48 AMRIP Documentation
RIP Debugging
RIP Common Sense

if you know how to fix then tell me ?
Title: Re: Getting error moveto
Post by: KAKAN on Oct 09, 2016, 12:25 PM
The object ain't created.
Well, that means, onServerStart is not called, that means, you've repeated the same function somewhere else in your script.
Title: Re: Getting error moveto
Post by: Shadow on Oct 09, 2016, 03:04 PM
gate <- array( GetMaxPlayers(), null );
 gateStatus = true;
 gate = CreateObject(1388, 1, -988.086, -821.651, 8.51289, 255).RotateTo( Quaternion(0, 0, -0.9, -0.866025), 0 ); // sunshine auto gate 1

gate is defined as two things. This might be part of the issue
Title: Re: Getting error moveto
Post by: Slark__ on Oct 09, 2016, 05:47 PM
Quote from: Shadow on Oct 09, 2016, 03:04 PM gate <- array( GetMaxPlayers(), null );
 gateStatus = true;
 gate = CreateObject(1388, 1, -988.086, -821.651, 8.51289, 255).RotateTo( Quaternion(0, 0, -0.9, -0.866025), 0 ); // sunshine auto gate 1

gate is defined as two things. This might be part of the issue

Anyhelp?
Title: Re: Getting error moveto
Post by: jWeb on Oct 09, 2016, 05:52 PM
Quote from: Slark__ on Oct 09, 2016, 05:47 PMAnyhelp?

Yes (https://cdn.meme.am/instances/500x/60656736.jpg).
Title: Re: Getting error moveto
Post by: Xmair on Oct 09, 2016, 05:55 PM
Change
gate = CreateObject(1388, 1, -988.086, -821.651, 8.51289, 255).RotateTo( Quaternion(0, 0, -0.9, -0.866025), 0 );
to
gate = CreateObject(1388, 1, -988.086, -821.651, 8.51289, 255);
gate.RotateTo( Quaternion(0, 0, -0.9, -0.866025), 0 );
Title: Re: Getting error moveto
Post by: Slark__ on Oct 09, 2016, 07:35 PM
Quote from: Xmair on Oct 09, 2016, 05:55 PMChange
gate = CreateObject(1388, 1, -988.086, -821.651, 8.51289, 255).RotateTo( Quaternion(0, 0, -0.9, -0.866025), 0 );
to
gate = CreateObject(1388, 1, -988.086, -821.651, 8.51289, 255);
gate.RotateTo( Quaternion(0, 0, -0.9, -0.866025), 0 );

ty @Xmair @Jack !