/engine error
#1

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...
Reply
#2

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.
Reply
#3

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
Reply
#4

on the tutorial it shows

forward SetEngine(vehicleid); ?? you added playerid instead
Reply
#5

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

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

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;
}
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)