pawn Code:
new frozecar[MAX_VEHICLES]; // on top
frozecar[vehicleid] = 0; //OnVehicleSpawn lol
CMD:freezecar(playerid, params[])
{
if ( !IsPlayerInAnyVehicle( playerid ) )return SendClientMessage( playerid, -1, "You are not in any vehicle." );
new vid = GetPlayerVehicleID( playerid ), engine,lights,alarm,doors,bonnet,boot,objective;
if(frozecar[vid] == 0)
{
SendClientMessage(playerid, -1, "SERVER: The engine is now started.");
frozecar[vid] = 1;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective); // the second one is engine, 1 is on and 0 is off so you can do like this.
}
else
{
SendClientMessage(playerid, -1, "SERVER: The engine is now turned off.");
frozecar[vid] = 0;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective); // the second one is engine, 1 is on and 0 is off so you can do like this.
}
return 1;
}