08.09.2014, 18:12
Well if you're sure about using strcmp....
Note that before using SetVehicleParamsEx function all values will be VEHICLE_PARAMS_UNSET(-1).
pawn Код:
if(!strcmp(cmdtext,"/engine",true,7))
{
new vehicleid = GetPlayerVehicleID(playerid);
if(!vehicleid) return SendClientMessage(playerid,0xFF0000FF,"You must be in a vehicle!");
// You might want to add an exception to vehicles without an engine, for example bikes.
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(engine != VEHICLE_PARAMS_ON)
{
SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid,0x00FF00FF,"The engine is now running");
}
else
{
SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid,0x00FF00FF,"The engine is stopped");
}
}