Guest User

Untitled

a guest
Nov 8th, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  2. {
  3. Seatbelt[playerid] = 0;
  4. IsPlayerSteppingInVehicle[playerid] = vehicleid;
  5. if(PlayerCuffed[playerid] != 0) SetPVarInt( playerid, "ToBeEjected", 1 );
  6. if(GetPVarInt(playerid, "Injured") == 1) SetPVarInt(playerid, "ToBeEjected", 1);
  7. SetPVarInt(playerid, "LastWeapon", GetPlayerWeapon(playerid));
  8.  
  9. new engine,lights,alarm,doors,bonnet,boot,objective;
  10. GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
  11. if(engine == VEHICLE_PARAMS_UNSET) switch(GetVehicleModel(vehicleid)) {
  12. case 509, 481, 510: VehicleFuel[vehicleid] = 100, arr_Engine{vehicleid} = 1, SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
  13. default: SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective), arr_Engine{vehicleid} = 0;
  14. }
  15. if (ispassenger != 0)
  16. {
  17. if (GetVehicleModel(vehicleid) == 519)
  18. {
  19. if (ShamalExists(vehicleid) == 0)
  20. {
  21. if (get_available_objects() > (MAX_OBJECTS-objects_per_shamal)) return 1;
  22. CreateShamalInt(vehicleid, randomEx(3000), randomEx(3000), float(random(100)+800));
  23. }
  24. SetPlayerPosInShamal(playerid, vehicleid);
  25. }
  26. }
  27. /*if(GetPVarInt(playerid, "Pizza") != 0 && !(IsAPizzaCar(vehicleid)))
  28. {
  29. new Float:slx, Float:sly, Float:slz;
  30. GetPlayerPos(playerid, slx, sly, slz);
  31. SetPlayerPos(playerid, slx, sly, slz+1.3);
  32. PlayerPlaySound(playerid, 1130, slx, sly, slz+1.3);
  33. RemovePlayerFromVehicle(playerid);
  34. NOPCheck(playerid);
  35. SendClientMessageEx(playerid, COLOR_GRAD2, "You need to be in a PizzaBoy when delivering pizzas!");
  36. return 1;
  37. }*/
  38. if(!ispassenger)
  39. {
  40. SetPlayerArmedWeapon(playerid, 0);
  41. if(IsVIPcar(vehicleid))
  42. {
  43. if(PlayerInfo[playerid][pDonateRank] == 0)
  44. {
  45. new Float:slx, Float:sly, Float:slz;
  46. GetPlayerPos(playerid, slx, sly, slz);
  47. SetPlayerPos(playerid, slx, sly, slz+1.3);
  48. PlayerPlaySound(playerid, 1130, slx, sly, slz+1.3);
  49. RemovePlayerFromVehicle(playerid);
  50. NOPCheck(playerid);
  51. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a VIP, this is a vehicle from the VIP Garage!");
  52. }
  53. }
  54. /* else if(IsAPizzaCar(vehicleid))
  55. {
  56. if(PlayerInfo[playerid][pJob] != 21 && PlayerInfo[playerid][pJob2] != 21)
  57. {
  58. new Float:slx, Float:sly, Float:slz;
  59. GetPlayerPos(playerid, slx, sly, slz);
  60. SetPlayerPos(playerid, slx, sly, slz+1.3);
  61. PlayerPlaySound(playerid, 1130, slx, sly, slz+1.3);
  62. RemovePlayerFromVehicle(playerid);
  63. NOPCheck(playerid);
  64. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a Pizza Boy!");
  65. }
  66. }*/
Advertisement
Add Comment
Please, Sign In to add comment