SA-MP Forums Archive
/engine error - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /engine error (/showthread.php?tid=274254)



/engine error - Horrible - 05.08.2011

pawn Код:
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;
}
when i try to compile it say
Код:
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"
line 83
pawn Код:
EngineStatus[vehicleid] = 1;
line 97
pawn Код:
EngineStatus[vehicleid] = 1;
help me...


Re: /engine error - Toreno - 05.08.2011

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.


Re: /engine error - Horrible - 05.08.2011

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
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.
emhhh can u give me new code?
i confuse too i get this from
http://forum.sa-mp.com/showthread.ph...ight=%2Fengine


Re: /engine error - Kitten - 05.08.2011

on the tutorial it shows

forward SetEngine(vehicleid); ?? you added playerid instead


Re: /engine error - Horrible - 05.08.2011

Quote:
Originally Posted by Kitten
Посмотреть сообщение
on the tutorial it shows

forward SetEngine(vehicleid); ?? you added playerid instead
change vehicleid with playerid?


Re: /engine error - Toreno - 05.08.2011

Try this, I changed into a stock, so delete forward SetEngine(vehicleid);
pawn Код:
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;
}



Re: /engine error - CaHbKo - 05.08.2011

And it sets the engine to 0 every time.
pawn Код:
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;
}
This doesn't.