Undefined symbol, Comile error..
#1

Hi!


I get a problem when I compile... :

Код:
C:\Users\Davve\Desktop\Bases\Base1\NY.pwn(288) : error 017: undefined symbol "Gate"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
I have this under game mode int:

pawn Код:
new Gate;
Gate = CreateObject(980,-967.79998779,2715.10009766,52.29999924,0.00000000,0.00000000,277.50000000); //object(airportgate) (1) //closed gate
.


And this under OnPlayerCommandText:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/open", cmdtext, true, 10) == 0)
    {

        CreateObject(980,-967.79998779,2715.10009766,52.29999924,0.00000000,0.00000000,277.50000000); //object(airportgate) (1)
        return 1;
    }   MoveObject(Gate,-967.79998779,2715.10009766,52.29999924,0.00000000,0.00000000,277.50000000);
    return 0;
}
Reply
#2

pawn Код:
#include < a_samp >

// Rest of includes

// Global
new Gate;
// Callbacks
public OnGameModeInit( )
{
    Gate = CreateObject(980,-967.79998779,2715.10009766,52.29999924,0.00000000,0.00000000,277.50000000); //object(airportgate) (1) //closed gate
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/open", cmdtext, true, 10) == 0)
    {
        CreateObject(980,-967.79998779,2715.10009766,52.29999924,0.00000000,0.00000000,277.50000000); //object(airportgate) (1)
        MoveObject(Gate,-967.79998779,2715.10009766,52.29999924,0.00000000,0.00000000,277.50000000);
        return 1;
    }
    return 0;
}
If you return a value the the MoveObject will not work. Also, Gate should be Global Variable.
Reply
#3

Still same errors...
Reply
#4

pawn Код:
#include < a_samp >

new Gate;

public OnGameModeInit( )
{
    Gate = CreateObject( 980, -967.79998779, 2715.10009766, 52.29999924, 0.00000000, 0.00000000, 277.50000000 ); //object(airportgate) (1) //closed gate
    return 1;
}

public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if( !strcmp( cmdtext, "/open", true ) )
    {
        MoveObject( Gate, -967.79998779, 2715.10009766, 52.29999924, 0.00000000, 0.00000000, 277.50000000 );
        return 1;
    }
    return 0;
}
pawn Код:
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
Reply
#5

pawn Код:
CreateObject(980,-967.79998779,2715.10009766,52.29999924,0.00000000,0.00000000,277.50000000); //object(airportgate) (1)
        return 1;
    }   MoveObject(Gate,-967.79998779,2715.10009766,52.29999924,0.00000000,0.00000000,277.50000000);
    return 0;
To explain what happened you are creating the gate twice. The gate is already created when the Gamemode Initialize so why will you create it again in your CMD?

So for your CMD Use this

pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if( !strcmp( cmdtext, "/open", true ) )
    {
        MoveObject( Gate, -967.79998779, 2715.10009766, 52.29999924, 0.00000000, 0.00000000, 277.50000000 );
        return 1;
    }
    return 0;
}
Reply
#6

just add it on top of your script, after all includes and defines
Reply
#7

Okay, Thanks alot!! .
Reply
#8

Quote:
Originally Posted by ViruZz
Посмотреть сообщение
pawn Код:
CreateObject(980,-967.79998779,2715.10009766,52.29999924,0.00000000,0.00000000,277.50000000); //object(airportgate) (1)
        return 1;
    }   MoveObject(Gate,-967.79998779,2715.10009766,52.29999924,0.00000000,0.00000000,277.50000000);
    return 0;
To explain what happened you are creating the gate twice. The gate is already created when the Gamemode Initialize so why will you create it again in your CMD?

So for your CMD Use this

pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if( !strcmp( cmdtext, "/open", true ) )
    {
        MoveObject( Gate, -967.79998779, 2715.10009766, 52.29999924, 0.00000000, 0.00000000, 277.50000000 );
        return 1;
    }
    return 0;
}
Because I need a command to open?
Reply
#9

@davve
You already created the object OnGameModeInit Callback. All you have to do is to MoveObject by a command and not create again the object
Reply
#10

Quote:
Originally Posted by Dwane
Посмотреть сообщение
@davve
You already created the object OnGameModeInit Callback. All you have to do is to MoveObject by a command and not create again the object
Ok! Thanks alot I see now! thanks!.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)