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
change all .MoveTo to .Pos
Quote from: Kewun on Oct 09, 2016, 09:32 AMchange all .MoveTo to .Pos
Same .Pos Dose not Exist
lol, try gate <- CreateObject instead of gate = CreateObject
and gate.Pos = Vector(x,y,z ) ;
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
RIP Documentation
RIP Debugging
RIP Common Sense
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 ?
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.
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
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?
Quote from: Slark__ on Oct 09, 2016, 05:47 PMAnyhelp?
Yes (https://cdn.meme.am/instances/500x/60656736.jpg).
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 );
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 !