SA-MP Forums Archive
It said "Undefined sysmbol" but its defined - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: It said "Undefined sysmbol" but its defined (/showthread.php?tid=507847)



It said "Undefined sysmbol" but its defined - ChristianIvann09 - 19.04.2014

Hello

Why this thing saying its not defined??

Код:
C:\Users\Cris\Desktop\0.3z Server\Philippines Roleplay (2014)\gamemodes\PHRP_1.1.pwn(29024) : error 017: undefined symbol "Vehicle"
C:\Users\Cris\Desktop\0.3z Server\Philippines Roleplay (2014)\gamemodes\PHRP_1.1.pwn(29034) : error 017: undefined symbol "Vehicle"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Код:
Line 29034: if(Engine[Vehicle] == 0)
Код:
as you can you see its defined: new Engine[MAX_VEHICLES];
FULL CODE:
Код:
else if(strcmp(params, "engine", true) == 0 && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid == PLAYER_STATE_DRIVER))
	{
		if(Engine[Vehicle] == 0)
		{
			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
				new Vehicle = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
				GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
				SendClientMessage(playerid, COLOR_YELLOW, "You have turned your engine >{FFFFFF} ON");
				Engine[Vehicle] = 1, SetVehicleParamsEx(Vehicle, 1, lights, alarm, doors, bonnet, boot, objective);
			}
		}
		else if(Engine[Vehicle] == 1)
		{
			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
				new Vehicle = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
				GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
				SendClientMessage(playerid, COLOR_YELLOW, "You have turned your engine >{FFFFFF} OFF");
				Engine[Vehicle] = 0, SetVehicleParamsEx(Vehicle, 0, lights, alarm, doors, bonnet, boot, objective);
			}
		}
	}



Re: It said "Undefined sysmbol" but its defined - Dignity - 19.04.2014

It doesn't work that way.

pawn Код:
new Vehicle = GetPlayerVehicleID(playerid);



Re: It said "Undefined sysmbol" but its defined - sony112502 - 19.04.2014

You try this...

Код:
else if(strcmp(params, "engine", true) == 0 && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid == PLAYER_STATE_DRIVER))
	{
                new Vehicle = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
		if(Engine[Vehicle] == 0)
		{
			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{			
				GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
				SendClientMessage(playerid, COLOR_YELLOW, "You have turned your engine >{FFFFFF} ON");
				Engine[Vehicle] = 1, SetVehicleParamsEx(Vehicle, 1, lights, alarm, doors, bonnet, boot, objective);
			}
		}
		else if(Engine[Vehicle] == 1)
		{
			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
				GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
				SendClientMessage(playerid, COLOR_YELLOW, "You have turned your engine >{FFFFFF} OFF");
				Engine[Vehicle] = 0, SetVehicleParamsEx(Vehicle, 0, lights, alarm, doors, bonnet, boot, objective);
			}
		}
	}



Re: It said "Undefined sysmbol" but its defined - ChristianIvann09 - 19.04.2014

Quote:
Originally Posted by Mionee
Посмотреть сообщение
It doesn't work that way.

pawn Код:
new Vehicle = GetPlayerVehicleID(playerid);
Thanks bro ++rep