/engine command
#4

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


Messages In This Thread
/engine command - by LiamM - 19.02.2011, 21:05
Re: /engine command - by PowerPC603 - 19.02.2011, 21:50
Re: /engine command - by LiamM - 19.02.2011, 23:04
Re: /engine command - by PowerPC603 - 19.02.2011, 23:52
Re: /engine command - by LiamM - 20.02.2011, 00:47
Re: /engine command - by LiamM - 20.02.2011, 21:49
Re: /engine command - by Gertin - 21.02.2011, 16:36
Re: /engine command - by LiamM - 22.02.2011, 21:50
Re: /engine command - by Hashski - 22.02.2011, 23:40
Re: /engine command - by LiamM - 26.02.2011, 11:44

Forum Jump:


Users browsing this thread: 1 Guest(s)