12.12.2011, 06:00
Okay im adding these commands from a filterscript to the actual game mode itself, i put it in and get these errors:
Heres what im trying to add exactly how it is in the script:
Im using Vortex 2 game mode.
Код:
C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4342) : error 021: symbol already defined: "IsABoat" C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4351) : error 021: symbol already defined: "IsAPlane" C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4431) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4440) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4479) : error 021: symbol already defined: "RL_OnPlayerStateChange" C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4495) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4496) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4498) : error 017: undefined symbol "red" C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4506) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4509) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4515) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4518) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4560) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4561) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4563) : error 017: undefined symbol "red" C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4571) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4574) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4580) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4583) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4596) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4597) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4608) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4611) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4617) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4620) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4634) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4635) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4646) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4649) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4655) : warning 217: loose indentation C:\Users\Branden\Desktop\Linux-Server\Linux\gamemodes\vx-rp.pwn(4658) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
Код:
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; } 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; }*/