Engine CMD is not working... (you'd think it would be simple)
#4

EDIT: This may help you
Quote:
Originally Posted by PowerPC603
Посмотреть сообщение
pawn Код:
COMMAND:engine(playerid, params[])
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    new vid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);

    if(engine == 1)
    {
        SetVehicleParamsEx(vid, 0, lights, alarm, doors, bonnet, boot, objective);
        SCM(playerid, COLOR_GREEN, "You have turned off your vehicles engine.");
    }
    else if(engine == 0)
    {
        SetVehicleParamsEx(vid, 1, lights, alarm, doors, bonnet, boot, objective);
        SCM(playerid, COLOR_GREEN, "You have turned on your vehicles engine.");
    }
    return 1;
}
Your variable "engine" was always 0 when you entered the command, as you didn't get the engine-status first by using GetVehicleParamsEx.
Quote:
Originally Posted by LiamM
Посмотреть сообщение
I have allready tried this and when I re tried it, it returned nothing for the vehicles. I could not turn on any vehicles engine, therefore all vehicles were un-moveable. I have these definitions to, I will show you my entire cmd + defines

pawn Код:
#define VEHICLE_PARAMS_UNSET    -1
#define VEHICLE_PARAMS_OFF  0
#define VEHICLE_PARAMS_ON   1


COMMAND:engine(playerid, params[])
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    new vid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);

    if(engine == 1)
    {
        SetVehicleParamsEx(vid, 0, lights, alarm, doors, bonnet, boot, objective);
        SCM(playerid, COLOR_GREEN, "You have turned off your vehicles engine.");
    }
    else if(engine == 0)
    {
        SetVehicleParamsEx(vid, 1, lights, alarm, doors, bonnet, boot, objective);
        SCM(playerid, COLOR_GREEN, "You have turned on your vehicles engine.");
    }
    return 1;
}
Reply


Messages In This Thread
Engine CMD is not working... (you'd think it would be simple) - by Aerotactics - 29.01.2015, 14:30
Re: Engine CMD is not working... (you'd think it would be simple) - by Rabea - 29.01.2015, 14:33
Re: Engine CMD is not working... (you'd think it would be simple) - by Aerotactics - 29.01.2015, 14:36
Re: Engine CMD is not working... (you'd think it would be simple) - by KayJ - 29.01.2015, 14:37
Re: Engine CMD is not working... (you'd think it would be simple) - by Aerotactics - 29.01.2015, 14:48

Forum Jump:


Users browsing this thread: 2 Guest(s)