Help with this problem
#1

I'm having this error, error 001: expected token: ";", but found "-end of file-", Help me with it, My filterscript is with 500 lines, so thats why I'm posting it
Код:
#include <a_samp>

#include <zcmd>
#define red 0xAA3333AA //Change this to the error color you want.
#define COLOR_PURPLE 0xC2A2DAAA //prox detector color

new gLastCar[MAX_PLAYERS]

#if defined FILTERSCRIPT
public OnPlayerConnect(playerid)
{
    SetTimerEx("Score_Timer1", 1000, 0, "i", playerid);
    SetTimerEx("Score_Timer2", 300000*60, 0, "i", playerid);
    SetTimerEx("Score_Timer3", 900000*60, 0, "i", playerid);
    SetTimerEx("Score_Timer4", 1440000*60, 0, "i", playerid);
    SetTimerEx("Score_Timer5", 1800000*60, 0, "i", playerid);
    SetTimerEx("Score_Timer6", 2400000*60, 0, "i", playerid);
    SetTimerEx("Score_Timer7", 4200000*60, 0, "i", playerid);
    SetTimerEx("Score_Timer8", 6000000*60, 0, "i", playerid);
    SetTimerEx("Score_Timer9", 12000000*60, 0, "i", playerid);
    SetTimerEx("Score_Timer10", 18000000*60, 0, "i", playerid);
    SetTimerEx("Score_Timer11", 24000000*60, 0, "i", playerid);
    SetTimerEx("Score_Timer12", 30000000*60, 0, "i", playerid);
    SetTimerEx("Score_Timer13", 36000000*60,0, "i", playerid);
    SetTimerEx("Score_Timer14", 42000000*60,0, "i", playerid);
    SetTimerEx("Score_Timer15", 48000000*60, 0, "i", playerid);
	return 1;
}

forward Score_Timer1(playerid);
public Score_Timer1(playerid)
{
    SetPlayerScore(playerid, 1);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}

forward Score_Timer2(playerid);
public Score_Timer2(playerid)
{
    SetPlayerScore(playerid, 2);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}
forward Score_Timer3(playerid);
public Score_Timer3(playerid)
{
    SetPlayerScore(playerid, 3);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}
forward Score_Timer4(playerid);
public Score_Timer4(playerid)
{
    SetPlayerScore(playerid, 4);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}
forward Score_Timer5(playerid);
public Score_Timer5(playerid)
{
    SetPlayerScore(playerid, 5);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}
forward Score_Timer6(playerid);
public Score_Timer6(playerid)
{
    SetPlayerScore(playerid, 6);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}
forward Score_Timer7(playerid);
public Score_Timer7(playerid)
{
    SetPlayerScore(playerid, 7);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}
forward Score_Timer8(playerid);
public Score_Timer8(playerid)
{
    SetPlayerScore(playerid, 8);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}
forward Score_Timer9(playerid);
public Score_Timer9(playerid)
{
    SetPlayerScore(playerid, 9);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}
forward Score_Timer10(playerid);
public Score_Timer10(playerid)
{
    SetPlayerScore(playerid, 10);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}
forward Score_Timer11(playerid);
public Score_Timer11(playerid)
{
    SetPlayerScore(playerid, 11);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}
forward Score_Timer12(playerid);
public Score_Timer12(playerid)
{
    SetPlayerScore(playerid, 12);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}
forward Score_Timer13(playerid);
public Score_Timer13(playerid)
{
    SetPlayerScore(playerid, 13);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}
forward Score_Timer14(playerid);
public Score_Timer14(playerid)
{
    SetPlayerScore(playerid, 14);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}
forward Score_Timer15(playerid);
public Score_Timer15(playerid)
{
    SetPlayerScore(playerid, 15);
    GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
	{
	new newcar = GetPlayerVehicleID(playerid);
	gLastCar[playerid] = newcar;
	SendClientMessage(playerid, -1, "Type /engine to start your vehicle!"); //Remove if you don't have manual control
	}
return 1;
}

stock IsABoat(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 430,446,452,453,454,472,473,484,493,595: return 1;
    }
    return 0;
}

stock IsAPlane(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 460,464,476,511,512,513,519,520,553,577,592,593: return 1;
    }
    return 0;
}

stock IsAHelicopter(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 417,425,447,465,469,487,488,497,501,548,563: return 1;
    }
    return 0;
}

stock IsATrain(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 449,537,538,569,570,590: return 1;
    }
    return 0;
}

stock IsABike(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 448,461,462,463,468,521,522,523,581,586,481,409,510: return 1;
    }
    return 0;
}

stock IsPlayerDriver(playerid)
{
	if(IsPlayerConnected(playerid) && GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
	{
		return 1;
	}
	return 0;
}

stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
	if(IsPlayerConnected(playerid))
	{
		new Float:posx, Float:posy, Float:posz;
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		new invehicle[MAX_PLAYERS];
		new virtualworld = GetPlayerVirtualWorld(playerid);
		new interior = GetPlayerInterior(playerid);
		new vehicleid = GetPlayerVehicleID(playerid);
		new ivehicleid;
		if(vehicleid)
		{
			GetVehiclePos(vehicleid,oldposx,oldposy,oldposz);
		}
		else
		{
			GetPlayerPos(playerid, oldposx, oldposy, oldposz);
			vehicleid = GetPlayerVehicleID(playerid);
		}
		for(new i; i<MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
					if(GetPlayerVirtualWorld(i) == virtualworld)
					{
						if((GetPlayerInterior(i) == interior))
						{
						    if(vehicleid)
						    {
							    if(IsPlayerInVehicle(i,vehicleid))
							    {
	          						invehicle[i] = 1;
								}
							}
							if(!invehicle[i])
							{
							    if(IsPlayerInAnyVehicle(i))
								{
								    ivehicleid = GetPlayerVehicleID(i);
								    GetVehiclePos(ivehicleid,posx,posy,posz);
								} else {
					    			GetPlayerPos(i,posx,posy,posz);
								}
								tempposx = (oldposx -posx);
								tempposy = (oldposy -posy);
								tempposz = (oldposz -posz);
								if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
								{
									SendClientMessage(i, col1, string);
								}
								else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
								{
									SendClientMessage(i, col2, string);
								}
								else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
								{
									SendClientMessage(i, col3, string);
								}
								else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
								{
									SendClientMessage(i, col4, string);
								}
								else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
								{
									SendClientMessage(i, col5, string);
								}
							}
							else
							{
								SendClientMessage(i, col1, string);
							}
						}
					}
				} else {
					SendClientMessage(i, col1, string);
				}
			}
	}
	return 1;
}


CMD:engine(playerid, params[])
{
	new string[128];
	new sendername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, sendername, sizeof(sendername));
	new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
	if(!IsPlayerDriver(playerid))
	{
		SendClientMessage(playerid,red,"[Vehicle Control] You're not in a Vehicle with an engine!");
		return 1;
	}
		else if(IsPlayerDriver(playerid))
			{
    			if(engine != 1)
				{
				    engine = 1;
					SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's engine {2F991A}on!");
					format(string, sizeof(string), "* %s puts a key into their ignition and turns on their engine.", sendername);
				    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    return 1;
				}
				else
				{
				    engine = 0;
					SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's engine {E31919}off!");
					format(string, sizeof(string), "* %s switches the key in their engine turning it off.", sendername);
				    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    return 1;
				}
		}
  	return engine;
}

CMD:objective(playerid, params[])
{
	new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
	if(!IsPlayerDriver(playerid))
	{
		SendClientMessage(playerid,red,"[Vehicle Control] You're not in a Vehicle to control the lights!");
		return 1;
	}
		else if(IsPlayerDriver(playerid))
			{
    			if(objective != 1)
				{
				    objective = 1;
					SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,VEHICLE_PARAMS_ON);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's objective {2F991A}on!");
				    return 1;
				}
				else
				{
				    objective = 0;
					SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,VEHICLE_PARAMS_OFF);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's objective {E31919}off!");
				    return 1;
				}
		}
  	return objective;
} // Commented due to Non-RP on Roleplay Servers, feel free to un-comment if you wish to use it.

CMD:lights(playerid, params[])
{
	new string[128];
	new sendername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, sendername, sizeof(sendername));
	new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
	if(!IsPlayerDriver(playerid))
	{
		SendClientMessage(playerid,red,"[Vehicle Control] You're not in a Vehicle to control the lights!");
		return 1;
	}
		else if(IsPlayerDriver(playerid))
			{
    			if(lights != 1)
				{
				    lights = 1;
					SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's lights {2F991A}on!");
					format(string, sizeof(string), "* %s flicks a switch on the dashboard, switching on their lights.", sendername);
				    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    return 1;
				}
				else
				{
				    lights = 0;
					SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's lights {E31919}off!");
					format(string, sizeof(string), "* %s flicks a switch on the dashboard, switching off their lights.", sendername);
				    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    return 1;
				}
		}
  	return lights;
}

CMD:hood(playerid, params[])
{
	new string[128];
	new sendername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, sendername, sizeof(sendername));
	new engine,lights,alarm,doors,bonnet,boot,objective;
    new oldcar = gLastCar[playerid];
	new Float:cX, Float:cY, Float:cZ;
	GetVehicleParamsEx(oldcar, engine, lights, alarm, doors, bonnet, boot, objective);
	GetVehiclePos(oldcar, cX, cY, cZ);
	new vehicleid = GetPlayerVehicleID(playerid);
	if(!IsAPlane(vehicleid) || !IsAHelicopter(vehicleid) || !IsABike(vehicleid) || !IsATrain(vehicleid) || !IsABoat(vehicleid))
	{
		if(IsPlayerDriver(playerid) || IsPlayerInRangeOfPoint(playerid, 5, cX-2, cY, cZ))
			{
    			if(bonnet != 1)
				{
				    bonnet = 1;
					SetVehicleParamsEx(oldcar,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've opened the hood!");
					format(string, sizeof(string), "* %s opens up the hood of the car.", sendername);
				    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    return 1;
				}
				else
				{
				    bonnet = 0;
					SetVehicleParamsEx(oldcar,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've shut the hood!");
					format(string, sizeof(string), "* %s closes the hood of the car.", sendername);
				    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    return 1;
				}
		}
	}
  	return bonnet;
}

CMD:trunk(playerid, params[])
{
	new string[128];
	new sendername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, sendername, sizeof(sendername));
	new engine,lights,alarm,doors,bonnet,boot,objective;
    new oldcar = gLastCar[playerid];
	new Float:cX, Float:cY, Float:cZ;
	GetVehicleParamsEx(oldcar, engine, lights, alarm, doors, bonnet, boot, objective);
	GetVehiclePos(oldcar, cX, cY, cZ);
	new vehicleid = GetPlayerVehicleID(playerid);
	if(!IsAPlane(vehicleid) || !IsAHelicopter(vehicleid) || !IsABike(vehicleid) || !IsATrain(vehicleid) || !IsABoat(vehicleid))
	{
		if(IsPlayerDriver(playerid) || IsPlayerInRangeOfPoint(playerid, 5, cX+2, cY, cZ))
				{
    				if(boot != 1)
					{
				    	boot = 1;
						SetVehicleParamsEx(oldcar,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
						SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've opened the trunk!");
						format(string, sizeof(string), "* %s opens up the trunk of the car.", sendername);
				    	ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    	return 1;
					}
					else
					{
				    	boot = 0;
						SetVehicleParamsEx(oldcar,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
						SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've shut the trunk!");
						format(string, sizeof(string), "* %s closes the trunk of the car.", sendername);
				    	ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    	return 1;
					}
			}
		}
  	return boot;
}
CMD:lockv(playerid, params[])
{
    new oldcar = gLastCar[playerid];
	new Float:cX, Float:cY, Float:cZ;
	GetVehiclePos(oldcar, cX, cY, cZ);
	new string[128];
	new sendername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, sendername, sizeof(sendername));
	new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(oldcar, engine, lights, alarm, doors, bonnet, boot, objective);
	if(!IsPlayerInRangeOfPoint(playerid, 4, cX, cY, cZ))
	{
		SendClientMessage(playerid,red,"[Vehicle Control] You're not in range/in the Vehicle you last drove!");
		return 1;
	}
		else if(IsPlayerInRangeOfPoint(playerid, 4, cX, cY, cZ))
			{
    			if(doors != 1)
				{
				    doors = 1;
					SetVehicleParamsEx(oldcar,engine,lights,alarm,VEHICLE_PARAMS_ON,bonnet,boot,objective);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've locked the vehicle!");
					format(string, sizeof(string), "* %s locks their vehicle.", sendername);
				    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    return 1;
				}
				else
				{
				    doors = 0;
					SetVehicleParamsEx(oldcar,engine,lights,alarm,VEHICLE_PARAMS_OFF,bonnet,boot,objective);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've unlocked the vehicle!");
					format(string, sizeof(string), "* %s unlocks his vehicle.", sendername);
				    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    return 1;
				}
		}
  	return doors;
}
#endif
Reply


Messages In This Thread
Help with this problem - by RyanPetersons - 27.05.2012, 14:28
Re: Help with this problem - by RyanPetersons - 27.05.2012, 14:46
Re: Help with this problem - by Faisal_khan - 27.05.2012, 14:48
Re: Help with this problem - by RyanPetersons - 27.05.2012, 14:55
Re: Help with this problem - by RyanPetersons - 27.05.2012, 15:47
Re: Help with this problem - by Faisal_khan - 27.05.2012, 16:17
Re: Help with this problem - by Smokkr - 27.05.2012, 16:20
Re: Help with this problem - by RyanPetersons - 27.05.2012, 16:32
Re: Help with this problem - by Faisal_khan - 27.05.2012, 16:55
Re: Help with this problem - by RyanPetersons - 27.05.2012, 17:01

Forum Jump:


Users browsing this thread: 1 Guest(s)