Getting error moveto

Started by Slark__, Oct 09, 2016, 09:23 AM

Previous topic - Next topic

Slark__

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;
        }
 }         
}



Help me pls
 

Kewun

change all .MoveTo to .Pos

Slark__


Kewun

lol, try gate <- CreateObject instead of gate = CreateObject

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

Slark__

Quote from: Kewun on Oct 09, 2016, 10:07 AMlol, try gate <- CreateObject instead of gate = CreateObject

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



Getting error

jWeb

RIP Documentation
RIP Debugging
RIP Common Sense

Slark__

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 ?

KAKAN

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.
oh no

Shadow

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
QuotePS:is trash is ur home language??

Slark__

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?


Xmair

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 );

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Slark__

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 !