Car Lights
#1

Hello,
I don't know why the car lights are not turning on
I tried turning them on in all the "SetVahicleParamsEx" but they are not, idk why
for example in this command all of /car hood/trunk/engine work, but /car lights doesn't
pawn Код:
CMD:car(playerid, params[])
{
    new string[12];
    new vehicleid=GetPlayerVehicleID(playerid);
    new engine, lights, hood, trunk, a, d, o;
    GetVehicleParamsEx(vehicleid, engine, lights, a, d, hood, trunk, o);
    if (sscanf(params, "s[12]", string)) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /car [engine / lights / hood / trunk]");
    else if (!strcmp(string, "engine"))
    {
            if (engine == 0)
            SetVehicleParamsEx(vehicleid, 1, lights, a, d, hood, trunk, o);
            else
            SetVehicleParamsEx(vehicleid, 0, lights, a, d, hood, trunk, o);
    }
    else if (!strcmp(string, "lights"))
    {
            if (lights == 0)
            SetVehicleParamsEx(vehicleid, engine, 1, a, d, hood, trunk, o);
            else
            SetVehicleParamsEx(vehicleid, engine, 0, a, d, hood, trunk, o);
    }
    else if (!strcmp(string, "hood"))
    {
            if (hood == 0)
            SetVehicleParamsEx(vehicleid, engine, lights, a, d, 1, trunk, o);
            else
            SetVehicleParamsEx(vehicleid, engine, lights, a, d, 0, trunk, o);
    }
    else if (!strcmp(string, "trunk"))
    {
            if (trunk == 0)
            SetVehicleParamsEx(vehicleid, engine, lights, a, d, hood, 1, o);
            else
            SetVehicleParamsEx(vehicleid, engine, lights, a, d, hood, 0, o);
    }
    return 1;
}
also after vehicle respawn
pawn Код:
public OnVehicleSpawn(vehicleid)
{
    SendClientMessageToAll(0xFFFFFFFF, "Vehicle sent to its spawn location");
    SetVehicleParamsEx(vehicleid, 0, 1, 0, 0, 0, 0, 0);
    return 1;
}
also in the /createveh command, It should be turned on, weird!!
pawn Код:
CMD:createveh(playerid, params[])
{
    new
        vehid,vehicleid,colorid1,colorid2;
    new
        Float:x,Float:y,Float:z;
    if (sscanf(params, "iii", vehid, colorid1, colorid2)) SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /createveh [Vehicle ID] [Color 1 ID] [Color 2 ID]");
    else if (vehid== INVALID_VEHICLE_ID) SendClientMessage(playerid, 0xFF0000AA, "Invalid Vehicle ID");// needs Fix
    else
    {
        GetPlayerPos(playerid, x, y, z);
        vehicleid = CreateVehicle(vehid, x+3, y+3, z, 0, colorid1, colorid2, 1);
        SetVehicleParamsEx(vehicleid, 0, 1, 1, 1, 1, 1, 1);
    }
    return 1;
}
I never used SetVehicleParamsEx except in the 2 commands and in OnVehiclespawn callback
Reply


Messages In This Thread
Car Lights - by Sarra - 03.08.2014, 22:10
Re: Car Lights - by Sarra - 03.08.2014, 22:33
Re: Car Lights - by Vince - 03.08.2014, 22:37
Re: Car Lights - by Sarra - 03.08.2014, 22:47
Re: Car Lights - by alanhutch - 03.08.2014, 22:51
Re: Car Lights - by Sarra - 03.08.2014, 22:58
Re: Car Lights - by Diti1 - 03.08.2014, 23:14

Forum Jump:


Users browsing this thread: 1 Guest(s)