Undefined symbol
#1

Hi, problem is,
i added this \
Код:
if(GetVehicleModel(vehicleid) == 522)
and i got an error, Undefined symbol "vehicleid"

how to fix it, someone help please
Reply
#2

post the whole command
Reply
#3

if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 522)
Reply
#4

Quote:
Originally Posted by angelxeneize
Посмотреть сообщение
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 522)
While that would fix the issue you're not helping him at all explaining where the mistake is:

Your error happens because vehicleid was not defined (duh) before using it, something like this could have happened:

pawn Код:
if(GetVehicleModel(vehicleid) == 400)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    //code
}
The compiler and the whole scripting structure is an ordered sequence of events (in most of the cases), that means it will be read in order from top to bottom when executing.

If that's not the case then you forgot to create the variable vehicleid to store the vehicle ID on.
Reply
#5

Quote:
Originally Posted by CuervO
Посмотреть сообщение
While that would fix the issue you're not helping him at all explaining where the mistake is:

Your error happens because vehicleid was not defined (duh) before using it, something like this could have happened:

pawn Код:
if(GetVehicleModel(vehicleid) == 400)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    //code
}
The compiler and the whole scripting structure is an ordered sequence of events (in most of the cases), that means it will be read in order from top to bottom when executing.

If that's not the case then you forgot to create the variable vehicleid to store the vehicle ID on.
Ok, but i dont speak english very well. Only want help. If is a command or enter checkpoint my solution helping him
Reply
#6

Quote:
Originally Posted by CuervO
Посмотреть сообщение
While that would fix the issue you're not helping him at all explaining where the mistake is:

Your error happens because vehicleid was not defined (duh) before using it, something like this could have happened:

pawn Код:
if(GetVehicleModel(vehicleid) == 400)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    //code
}
The compiler and the whole scripting structure is an ordered sequence of events (in most of the cases), that means it will be read in order from top to bottom when executing.

If that's not the case then you forgot to create the variable vehicleid to store the vehicle ID on.

thakns but,

Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetVehicleModel(vehicleid) == 522)
    {
    new vehicleid = GetPlayerVehicleID(playerid);
    GivePlayerMoney(playerid, 5000);
    }
    else
    SendClientMessage(playerid, red, "You have to be on nrg-500!");
    return 1;
}
when i added this, its show me the error, undefined symbol "vehicleid"

what to do, please help
Reply
#7

You need to put the define on top because the first statement has vehicleid in it.
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(GetVehicleModel(vehicleid) == 522)
    {
    GivePlayerMoney(playerid, 5000);
    }
    else
    SendClientMessage(playerid, red, "You have to be on nrg-500!");
    return 1;
}
Reply
#8

Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 522)
    {
    GivePlayerMoney(playerid, 5000);
    }
    else
    SendClientMessage(playerid, red, "You have to be on nrg-500!");
    return 1;
}
or this
Reply
#9

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
You need to put the define on top because the first statement has vehicleid in it.
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(GetVehicleModel(vehicleid) == 522)
    {
    GivePlayerMoney(playerid, 5000);
    }
    else
    SendClientMessage(playerid, red, "You have to be on nrg-500!");
    return 1;
}
but not work fine

Reply
#10

Quote:
Originally Posted by angelxeneize
Посмотреть сообщение
Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 522)
    {
    GivePlayerMoney(playerid, 5000);
    }
    else
    SendClientMessage(playerid, red, "You have to be on nrg-500!");
    return 1;
}
or this
bro, the same problem, when i m on the bike, i got the same message
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)