15.11.2013, 15:08
My Code:
Only ENGINE WORKS ;( Idk why but
If i do /veh Name its spawns a car when i go inside why is the engine on if i go inside only if i do
/vengine the engine starts.
pawn Код:
CMD:vehicle(playerid, params[])
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"TIP: Try /vengine, /vlights, /vtrunk, /vhood!");
return 1;
}
CMD:vengine(playerid, params[])
{
new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid;
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED,"Your not driving any vehicle!");
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(!engine)
{
SetVehicleParamsEx(vehicleid, true, lights, alarm, doors, bonnet, boot, objective);
}
else
{
SetVehicleParamsEx(vehicleid, false, lights, alarm, doors, bonnet, boot, objective);
}
return 1;
}
CMD:vlights(playerid, params[])
{
new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid;
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED,"Your not driving any vehicle!");
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(!lights)
{
SetVehicleParamsEx(vehicleid, engine, true, alarm, doors, bonnet, boot, objective);
}
else
{
SetVehicleParamsEx(vehicleid, engine, false, alarm, doors, bonnet, boot, objective);
}
return 1;
}
CMD:vtrunk(playerid, params[])
{
new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid;
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED,"Your not driving any vehicle!");
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(!boot)
{
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, true, objective);
}
else
{
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, false, objective);
}
return 1;
}
CMD:vhood(playerid, params[])
{
new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid;
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED,"Your not driving any vehicle!");
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(!bonnet)
{
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, true, boot, objective);
}
else
{
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, false, boot, objective);
}
return 1;
}
If i do /veh Name its spawns a car when i go inside why is the engine on if i go inside only if i do
/vengine the engine starts.