Help with this problem -
RyanPetersons - 27.05.2012
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
Re: Help with this problem -
RyanPetersons - 27.05.2012
A warning now symbol is never used: "gLastCar"
Re: Help with this problem -
Faisal_khan - 27.05.2012
pawn Код:
#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]
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, ;
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,51 0: 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 Floatosx, Floatosy, Floatosz;
new Floatldposx, Floatldposy, Floatldposz;
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/ && (tempposx > -radi/) && ((tempposy < radi/ && (tempposy > -radi/) && ((tempposz < radi/ && (tempposz > -radi/))
{
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),VE HICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,obj ective);
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_PURPL E,COLOR_PURPLE);
return 1;
}
else
{
engine = 0;
SetVehicleParamsEx(GetPlayerVehicleID(playerid),VE HICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,ob jective);
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_PURPL E,COLOR_PURPLE);
return 1;
}
}
return engine;
}
CMDbjective(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),en gine,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),en gine,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),en gine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,obj ective);
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_PURPL E,COLOR_PURPLE);
return 1;
}
else
{
lights = 0;
SetVehicleParamsEx(GetPlayerVehicleID(playerid),en gine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,ob jective);
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_PURPL E,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,door s,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_PURPL E,COLOR_PURPLE);
return 1;
}
else
{
bonnet = 0;
SetVehicleParamsEx(oldcar,engine,lights,alarm,door s,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_PURPL E,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,door s,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_PURPL E,COLOR_PURPLE);
return 1;
}
else
{
boot = 0;
SetVehicleParamsEx(oldcar,engine,lights,alarm,door s,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_PURPL E,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,VEHI CLE_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_PURPL E,COLOR_PURPLE);
return 1;
}
else
{
doors = 0;
SetVehicleParamsEx(oldcar,engine,lights,alarm,VEHI CLE_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_PURPL E,COLOR_PURPLE);
return 1;
}
}
return doors;
}
Re: Help with this problem -
RyanPetersons - 27.05.2012
omg
Код:
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(9) : error 001: expected token: ";", but found "public"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(82) : error 029: invalid expression, assumed zero
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(187) : error 001: expected token: ":", but found "-integer value-"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(187) : warning 215: expression has no effect
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(187) : error 001: expected token: ";", but found ":"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(189) : error 010: invalid function or declaration
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(215) : error 017: undefined symbol "oldposx"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(219) : error 017: undefined symbol "oldposx"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(242) : error 017: undefined symbol "posx"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(244) : error 017: undefined symbol "posx"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(246) : error 017: undefined symbol "oldposx"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(247) : error 017: undefined symbol "oldposy"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(248) : error 017: undefined symbol "oldposz"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(253) : error 029: invalid expression, assumed zero
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(206) : warning 203: symbol is never used: "Floatldposz"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(206) : warning 203: symbol is never used: "Floatldposy"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(206) : warning 203: symbol is never used: "Floatldposx"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(205) : warning 203: symbol is never used: "Floatosz"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(205) : warning 203: symbol is never used: "Floatosy"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(205) : warning 203: symbol is never used: "Floatosx"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(302) : error 017: undefined symbol "VE"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(302) : error 017: undefined symbol "HICLE_PARAMS_ON"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(302) : error 017: undefined symbol "ective"
D:\New Folder\anim\samp03e_svr_win32\filterscripts\Untitled.pwn(302) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
17 Errors.
On Faisal Khans reply
Re: Help with this problem -
RyanPetersons - 27.05.2012
Sorry, for double post, Delete my post, Did it by mistake, I was editing my previous post
Re: Help with this problem -
Faisal_khan - 27.05.2012
First:
pawn Код:
new gLastCar[MAX_PLAYERS];
"," was missing.
Second:
pawn Код:
forward Score_Timer8(playerid);
public Score_Timer8(playerid)
{
SetPlayerScore(playerid, 1);//You are missing score here which i have placed 1
GameTextForPlayer(playerid,"~r~ Congratulations, You got the higher level then your previous level",5000,5);
return 1;
}
Third:
pawn Код:
stock IsABike(vehicleid)
{
switch(GetVehicleModel(vehicleid))
{
case 448,461,462,463,468,521,522,523,581,586,481,409,51: return 1;//0: was here
}
return 0;
}
Fourth:
pawn Код:
else if (((tempposx < radi/ && (tempposx > -radi/) && ((tempposy < radi/ && (tempposy > -radi/) && ((tempposz < radi/ && (tempposz > -radi/)) {//Here radius values missing
SendClientMessage(i, col2, string);
}
Rest of the fixed code:
pawn Код:
#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];
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, 1); //You are missing score here which i have placed 1
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; //Remove if you don't have manual control
SendClientMessage(playerid, -1, "Type /engine to start your vehicle!");
}
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,51: 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);
}
//Here radius values missing
else if (((tempposx < radi/ && (tempposx > -radi/) && ((tempposy < radi/ && (tempposy > -radi/) && ((tempposz < radi/ && (tempposz > -radi/)) {
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),VE HICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,obj ective);
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_PURPL E,COLOR_PURPLE);
return 1;
}
else {
engine = 0;
SetVehicleParamsEx(GetPlayerVehicleID(playerid),VE HICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,ob jective);
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_PURPL E,COLOR_PURPLE);
return 1;
}
}
return engine;
}
CMDbjective(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),en gine,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),en gine,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),en gine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,obj ective);
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_PURPL E,COLOR_PURPLE);
return 1;
}
else {
lights = 0;
SetVehicleParamsEx(GetPlayerVehicleID(playerid),en gine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,ob jective);
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_PURPL E,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,door s,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_PURPL E,COLOR_PURPLE);
return 1;
}
else {
bonnet = 0;
SetVehicleParamsEx(oldcar,engine,lights,alarm,door s,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_PURPL E,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,door s,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_PURPL E,COLOR_PURPLE);
return 1;
}
else {
boot = 0;
SetVehicleParamsEx(oldcar,engine,lights,alarm,door s,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_PURPL E,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,VEHI CLE_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_PURPL E,COLOR_PURPLE);
return 1;
}
else {
doors = 0;
SetVehicleParamsEx(oldcar,engine,lights,alarm,VEHI CLE_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_PURPL E,COLOR_PURPLE);
return 1;
}
}
return doors;
}
LOL many errors.
Re: Help with this problem -
Smokkr - 27.05.2012
First open the pawno.exe.Then open the .pwn file from gamemodes. Compile it and you are ready!This help to me but I dunno for you...
Re: Help with this problem -
RyanPetersons - 27.05.2012
Last error Failsal in this
else if (((tempposx < radi/ && (tempposx > -radi/) && ((tempposy < radi/ && (tempposy > -radi/) && ((tempposz < radi/ && (tempposz > -radi/)) {//Here radius values missing
SendClientMessage(i, col2, string);
}
Error name: error 029: invalid expression, assumed zero
Re: Help with this problem -
Faisal_khan - 27.05.2012
As I said in my above post, give some values after the radi/.
Re: Help with this problem -
RyanPetersons - 27.05.2012
Fixed, the AMX file Thanks