Advertisement
Private200

Untitled

Nov 21st, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  2. {
  3. if(PRESSED(KEY_SUBMISSION))//If the player pressed KEY_SUBMISSION (2)
  4. {
  5. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)//Checks if the player is the driver
  6. {
  7. new engine,lights,alarm,doors,bonnet,boot,objective;//The vehicle params
  8. GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);//Getting the vehicle params
  9. {
  10. if(engine == 0)//If the engine is off
  11. {
  12. SetVehicleParamsEx(vehicle,1,1,alarm,doors,bonnet,boot,objective);//We turn on the engine and lights
  13. }
  14. else//Else is the engine is on
  15. {
  16. SetVehicleParamsEx(vehicle,0,0,alarm,doors,bonnet,boot,objective);//We turn off the engine and lights
  17. }
  18. }
  19. }
  20. new string[25];
  21. format(string,sizeof(string),"~g~ %s",GetVehicleName(vehicleid));
  22. GameTextForPlayer(playerid,string,3000,1);
  23. if(IsPlayerInMission[playerid] == 1 && vehicleid == workingvehicle[playerid])
  24. {
  25. KillTimer(Checkveh[playerid]);
  26. }
  27. return 1;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement