Undefined symbol -
Dipto - 12.03.2014
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
Re: Undefined symbol -
HenrySunseri - 12.03.2014
post the whole command
Respuesta: Undefined symbol -
angelxeneize - 12.03.2014
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 522)
Re: Respuesta: Undefined symbol -
CuervO - 12.03.2014
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.
Respuesta: Re: Respuesta: Undefined symbol -
angelxeneize - 12.03.2014
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
Re: Respuesta: Undefined symbol -
Dipto - 12.03.2014
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
Respuesta: Re: Respuesta: Undefined symbol -
SickAttack - 12.03.2014
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;
}
Respuesta: Re: Respuesta: Undefined symbol -
angelxeneize - 12.03.2014
Код:
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
Re: Respuesta: Re: Respuesta: Undefined symbol -
Dipto - 12.03.2014
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
Re: Respuesta: Re: Respuesta: Undefined symbol -
Dipto - 12.03.2014
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