stock StartVehicle(playerid)
{
new i = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
if(FOUR_TIRE(playerid) || FOUR_TIRE2(playerid))
{
if(vInfo[i][vehicleFuel] >= 1)
{
if(vInfo[i][vehicleTires] == 4)
{
if(vInfo[i][vehicleEngine] == 1)
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid),1,lights,alarm,doors,bonnet,boot,objective);
}
}
}
if(vInfo[i][vehicleTires] <= 3)
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid),0,lights,alarm,doors,bonnet,boot,objective);
}
}
}
CMD:engine(playerid, params[])
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You need to be the driver of the vehicle");
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(engine == 1)
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, -1, "You have turned the engine off");
}
else
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, -1, "You have turned the engine on");
}
return 1;
}
if(vInfo[i][vehicleFuel] >= 1)
if(vInfo[i][vehicleFuel] >= 0)
instead of
pawn Код:
pawn Код:
You said you only put 1 fuel when testing, but the script says the value must be greater than 1 |
if(vInfo[i][vehicleFuel] >= 1)
{
if(vInfo[i][vehicleTires] == 4)
{
if(vInfo[i][vehicleEngine] == 1)
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid),1,lights,alarm,doors,bonnet,boot,objective);
}
}
}