Advertisement
Guest User

Untitled

a guest
May 24th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {
  2. if(!ispassenger) {
  3. new vehicle = GetVehicleID(vehicleid), string[128];
  4. if(ServerVehicles[vehicle][vID] != 0 && JobWorking[playerid] == 0) {
  5. if(vehicle >= 130 && vehicle <= 135) {
  6. if(GetPVarInt(playerid, "InLesson") == -1) return SCM(playerid, COLOR_GREY, "Nu ai o lectie activa!"), SlapPlayer(playerid);
  7. }
  8. else if(ServerVehicles[vehicle][vFaction] == 1 || ServerVehicles[vehicle][vFaction] == 2 || ServerVehicles[vehicle][vFaction] == 3) {
  9. if(ServerVehicles[vehicle][vRank] > PlayerInfo[playerid][pRank]) {
  10. format(string, sizeof(string), "Ai nevoie de rank %d pentru a lua acest vehicul.", ServerVehicles[vehicle][vRank]);
  11. SCM(playerid, COLOR_GREY, string);
  12. SlapPlayer(playerid);
  13. }
  14. else if(OnDuty[playerid] == 0 && IsACop(playerid)) {
  15. SCM(playerid, COLOR_LGREEN, "Nu poti folosi vehiculele factiunii daca nu esti la datorie!");
  16. SlapPlayer(playerid);
  17. return 1;
  18. }
  19. else if(!IsACop(playerid)) {
  20. format(string, sizeof(string), "Nu faci parte din factiunea %s.", FactionName(ServerVehicles[vehicle][vFaction]));
  21. SCM(playerid, COLOR_GREY, string);
  22. SlapPlayer(playerid);
  23. }
  24. }
  25. else if(ServerVehicles[vehicle][vFaction] != PlayerInfo[playerid][pMember] && ServerVehicles[vehicle][vFaction] != 0) {
  26. format(string, sizeof(string), "Nu faci parte din factiunea %s.", FactionName(ServerVehicles[vehicle][vFaction]));
  27. SCM(playerid, COLOR_GREY, string);
  28. SlapPlayer(playerid);
  29. }
  30. else {
  31. if(OnDuty[playerid] == 0 && IsACop(playerid) && Copcar2(vehicle)) {
  32. SCM(playerid, COLOR_LGREEN, "Nu poti folosi vehiculele factiunii daca nu esti la datorie!");
  33. SlapPlayer(playerid);
  34. return 1;
  35. }
  36. }
  37. }
  38. if(IsABoat(vehicleid) && GetPVarInt(playerid, "InLesson") == -1) {
  39. if(PlayerInfo[playerid][pBoatLic] < 1 && InDealer[playerid] == 0) {
  40. SCM(playerid,COLOR_GREY, "Nu ai licenta de navigatie.");
  41. SlapPlayer(playerid);
  42. TogglePlayerControllable(playerid, 1);
  43. }
  44. }
  45. else if(IsAPlane(vehicleid) && GetPVarInt(playerid, "InLesson") == -1) {
  46. if(PlayerInfo[playerid][pFlyLic] < 1 && InDealer[playerid] == 0) {
  47. SCM(playerid, COLOR_GREY, "Nu ai licenta de zbor.");
  48. SlapPlayer(playerid);
  49. TogglePlayerControllable(playerid, 1);
  50. }
  51. }
  52. else {
  53. if(PlayerInfo[playerid][pCarLic] < 1) {
  54. if(!IsAPlane(vehicleid) || IsABike2(vehicleid) || InExamen[playerid] == 1 || GetVehicleModel(vehicleid) == 471 || InDealer[playerid] > 0) { }
  55. else {
  56. SCM(playerid,COLOR_GREY, "Nu ai licenta de condus.");
  57. SlapPlayer(playerid);
  58. TogglePlayerControllable(playerid, 1);
  59. SetTimerEx("UnFreezeStation", 500, 0, "i", playerid);
  60. }
  61. }
  62. }
  63. }
  64. return 1;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement