Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.76 KB | None | 0 0
  1. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  2. {
  3. if(!ispassenger)
  4. {
  5. if(SAMD_Vehicle(vehicleid))
  6. {
  7. if(PlayerInfo[playerid][pTrabajo] != 1 || PlayerInfo[playerid][pTrabajo2] != 1)
  8. {
  9. RemovePlayerFromVehicle(playerid);
  10. new Float:slx, Float:sly, Float:slz;
  11. GetPlayerPos(playerid, slx, sly, slz);
  12. SetPlayerPos(playerid, slx, sly, slz);
  13. SendClientMessage(playerid, COLOR_WHITE, "Necesitas conseguir el trabajo de médico para conducir ambulancias.");
  14. SendClientMessage(playerid, COLOR_WHITE, "Usa "#Amarillo1"/ayuda trabajos "#Blanco"para obtener más información.");
  15. return 1;
  16. }
  17. }
  18. else if(LSPD_IsACopCar(vehicleid))
  19. {
  20. if(PlayerInfo[playerid][pPolicia] != 1 || PlayerInfo[playerid][pFaccion] != 1)
  21. {
  22. RemovePlayerFromVehicle(playerid);
  23. new Float:slx, Float:sly, Float:slz;
  24. GetPlayerPos(playerid, slx, sly, slz);
  25. SetPlayerPos(playerid, slx, sly, slz);
  26.  
  27. SendClientMessage(playerid, COLOR_WHITE, "Necesitar ser policia y estar con el uniforme para conducir este vehículo.");
  28. return 1;
  29. }
  30. }
  31. else if(TRUCK_IsATrashMaster(vehicleid))
  32. {
  33. if(PlayerInfo[playerid][pTrabajo] != 5 || PlayerInfo[playerid][pTrabajo2] != 5)
  34. {
  35. RemovePlayerFromVehicle(playerid);
  36. new Float:slx, Float:sly, Float:slz;
  37. GetPlayerPos(playerid, slx, sly, slz);
  38. SetPlayerPos(playerid, slx, sly, slz);
  39.  
  40. SendClientMessage(playerid, COLOR_WHITE, "Necesitar ser basurero para conducir camiones de basura.");
  41. SendClientMessage(playerid, COLOR_WHITE, "Escribe "#Amarillo1"/ayuda trabajos "#Blanco"para obtener más información.");
  42. return 1;
  43. }
  44. }
  45. else if(IsATruckerCar(vehicleid))
  46. {
  47. if(PlayerInfo[playerid][pTrabajo] != 4 || PlayerInfo[playerid][pTrabajo2] != 4)
  48. {
  49. RemovePlayerFromVehicle(playerid);
  50. new Float:slx, Float:sly, Float:slz;
  51. GetPlayerPos(playerid, slx, sly, slz);
  52. SetPlayerPos(playerid, slx, sly, slz);
  53. SendClientMessage(playerid, COLOR_WHITE, "Necesitar conseguir el trabajo de camionero para usar este vehículo.");
  54. SendClientMessage(playerid, COLOR_WHITE, "Escribe "#Amarillo1"/ayuda trabajos "#Blanco"para obtener más información.");
  55. return 1;
  56. }
  57. }
  58. else if(IsATruckerVipCar(vehicleid))
  59. {
  60. if(PlayerInfo[playerid][pTrabajo] != 4 || PlayerInfo[playerid][pTrabajo2] != 4 && PlayerInfo[playerid][pVIP] < 2)
  61. {
  62. RemovePlayerFromVehicle(playerid);
  63. new Float:slx, Float:sly, Float:slz;
  64. GetPlayerPos(playerid, slx, sly, slz);
  65. SetPlayerPos(playerid, slx, sly, slz);
  66. SendClientMessage(playerid, COLOR_WHITE, "Necesitar conseguir el trabajo de camionero y memebresía VIP2 para conducir este vehículo.");
  67. return 1;
  68. }
  69. }
  70.  
  71.  
  72. else if(!IsPlayerInRangeOfVehicle(playerid, vehicleid, 7.5) || LockStatus[vehicleid] >= 1){ // G-bugging fix
  73. ClearAnimations(playerid);
  74. }
  75. }
  76.  
  77. if(!ispassenger && cocheocupado(vehicleid))
  78. {
  79. new Float:cjx, Float:cjy, Float:cjz;
  80. PlayerInfo[playerid][pMundoVirtual] = GetPlayerVirtualWorld(playerid);
  81. GetPlayerPos(playerid, cjx, cjy, cjz);
  82. SetPlayerPos(playerid, cjx, cjy, cjz);
  83. SendClientMessage(playerid, COLOR_WHITE, "No intentes robar coches sin rol, quedas congelado por 2 segundos.");
  84. TogglePlayerControllable(playerid, 0);
  85. TimerCongelado[playerid] = 3;
  86. ClearAnimations(playerid);
  87. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
  88. ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
  89. ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
  90. SetPlayerVirtualWorld(playerid, random(999));
  91. }
  92.  
  93. if(ispassenger)
  94. {
  95. for(new v = 0; v < MAX_PLAYERVEHICLES; v++)
  96. {
  97. for(new i = 0; i < MAX_PLAYERS; i++)
  98. {
  99. if(IsPlayerConnected(i))
  100. {
  101. new Float: Pos[3];
  102. GetVehiclePos(PlayerVehicleInfo[i][v][pvId], Pos[0],Pos[1],Pos[2]);
  103. if(IsPlayerInRangeOfPoint(playerid, 7.0, Pos[0],Pos[1],Pos[2]))
  104. {
  105. if(PlayerVehicleInfo[i][v][pvLocked] == 1)
  106. {
  107. SendClientMessage(playerid, COLOR_WHITE, "El vehículo está cerrado, para destrabar las puertas el dueño tiene que "#Amarillo1"/abrir");
  108. }
  109. }
  110. }
  111. }
  112. }
  113. }
  114.  
  115. if(!ispassenger)
  116. {
  117. for(new v = 0; v < MAX_PLAYERVEHICLES; v++)
  118. {
  119. for(new i = 0; i < MAX_PLAYERS; i++)
  120. {
  121. if(IsPlayerConnected(i))
  122. {
  123. new Float: Pos[3];
  124. GetVehiclePos(PlayerVehicleInfo[i][v][pvId], Pos[0],Pos[1],Pos[2]);
  125. if(IsPlayerInRangeOfPoint(playerid, 7.0, Pos[0],Pos[1],Pos[2]))
  126. {
  127. if(PlayerVehicleInfo[i][v][pvLocked] == 1)
  128. {
  129. SendClientMessage(playerid, COLOR_WHITE, "El vehículo está cerrado, para destrabar las puertas el dueño tiene que "#Amarillo1"/abrir");
  130. }
  131. }
  132. }
  133. }
  134. }
  135. }
  136.  
  137. return 1;
  138.  
  139. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement