Author Topic: Engine turning on/off system  (Read 7557 times)

0 Members and 1 Guest are viewing this topic.

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: Engine turning on/off system
« Reply #15 on: January 13, 2013, 12:26:51 pm »
let me take a shot


stock SetVehicleEngine(vehicleid, on=1)//0 is off _ 1 is on
{
   switch()
   {
       case 0:
           KillVehicleEngine(vehicleid);
       case 1:
           StartVehicleEngine(vehicleid);
   }
}
stock StartVehicleEngine(vehicleid)
{
    RemovePlayerFromVehicle(playerid);
    PutPlayerInVehicle(playerid,GetPlayerVehicleID(playerid));
}

 forgot playerid you add it

No no no you are wrong
First create a new var:

[pawn]pveh = GetPlayerVehicleID(playerid);[/pawn]

only after that u can do:

[pawn]RemovePlayerFromVehicle(playerid);
PutPlayerInVehicle(playerid, pveh);[/pawn]

Understand me?
« Last Edit: January 13, 2013, 12:28:30 pm by NeskWriter »


-Funniest quotes-

Quote from: asad3man
i cant able to understand