new EngineStatus[MAX_VEHICLES];
public SetEngine(vehicleid) {
new engine,lights,alarm,doors,bonnet,boot,objective;
if(EngineStatus[vehicle]) {
EngineStatus[vehicle] = 0;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
} else {
EngineStatus[vehicle] = 1;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
}
return 1;
}
CMD:engine(playerid, params[]) {
if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /car engine");
if(strcmp(params, "engine", true) == 0) {
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be inside of a vehicle to use this command.");
switch(EngineStatus[GetPlayerVehicleID(playerid)]) {
case 0: SendClientMessage(playerid, COLOR_WHITE, "You have turned on your engine.");
case 1: SendClientMessage(playerid, COLOR_WHITE, "You have turned off your engine.");
}
SetEngine(GetPlayerVehicleID(playerid));
}
return 1;
}
E:\Server SA-MP OPEN BETA(ary)1ab\filterscripts\h-rental.pwn(83) : error 017: undefined symbol "vehicleid" E:\Server SA-MP OPEN BETA(ary)1ab\filterscripts\h-rental.pwn(97) : error 017: undefined symbol "vehicleid"
EngineStatus[vehicleid] = 1;
EngineStatus[vehicleid] = 1;
That confuses me, since your errors are "vehicleid". However, your stock/public has wrong VARIABLE[].
They are vehicle, instead of vehicleid, change them to vehicleid. Otherwise, I can't see where these variables are at. |
on the tutorial it shows
forward SetEngine(vehicleid); ?? you added playerid instead |
stock SetEngine(vehicleid) {
new engine,lights,alarm,doors,bonnet,boot,objective;
if(EngineStatus[vehicleid]) {
EngineStatus[vehicleid] = 0;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
} else {
EngineStatus[vehicleid] = 1;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
}
return 1;
}
stock SetEngine(vehicleid) {
new engine,lights,alarm,doors,bonnet,boot,objective;
if(EngineStatus[vehicleid]) {
EngineStatus[vehicleid] = 0;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective); //ENGINE = 0
} else {
EngineStatus[vehicleid] = 1;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective); //ENGINE = 1
}
return 1;
}