/engine command not working - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /engine command not working (
/showthread.php?tid=445712)
/engine command not working -
San1 - 22.06.2013
Its not turning it off or on? what is wrong, no errors upon compile
Код:
CMD:engine(playerid, params[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(playerid);
if(Engine[vehicle] == 0)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
Engine[vehicle] = 1;
SetVehicleParamsEx(vehicle, 1, lights, alarm, doors, bonnet, boot, 0);
}
if(Engine[vehicle] == 1)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
Engine[vehicle] = 0;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0);
}
}
return 1;
}
pawn Код:
Engine[vehicleid] = 0;
Lights[vehicleid] = 0;
Boot[vehicleid] = 0;
Bonnet[vehicleid] = 0;
Doors[vehicleid] = 0;
Re: /engine command not working -
Pottus - 22.06.2013
pawn Код:
CMD:engine(playerid, params[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(playerid);
if(Engine[vehicle] == 0)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
Engine[vehicle] = 1;
SetVehicleParamsEx(vehicle, 1, lights, alarm, doors, bonnet, boot, 0);
}
else if(Engine[vehicle] == 1)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
Engine[vehicle] = 0;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0);
}
}
return 1;
}