03.08.2014, 22:10
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
also after vehicle respawn
also in the /createveh command, It should be turned on, weird!!
I never used SetVehicleParamsEx except in the 2 commands and in OnVehiclespawn callback
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;
}
pawn Код:
public OnVehicleSpawn(vehicleid)
{
SendClientMessageToAll(0xFFFFFFFF, "Vehicle sent to its spawn location");
SetVehicleParamsEx(vehicleid, 0, 1, 0, 0, 0, 0, 0);
return 1;
}
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;
}