Guest User

Untitled

a guest
Oct 9th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  2. {
  3. new playername[64], count=0;
  4. GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  5.  
  6. new modelid = GetVehicleModel(vehicleid);
  7.  
  8. if(vehicleid == terrortank)
  9. {
  10. if(terrortanktimer != 0)
  11. {
  12. ClearAnimations(playerid);
  13. SendClientMessage(playerid, COLOR_SILVER, "Error: You must wait sometime to use this vehicle again.");
  14. return 1;
  15. }
  16. }
  17. if(vehicleid == armytank)
  18. {
  19. if(armytanktimer != 0)
  20. {
  21. ClearAnimations(playerid);
  22. SendClientMessage(playerid, COLOR_SILVER, "Error: You must wait sometime to use this vehicle again.");
  23. return 1;
  24. }
  25. }
  26. if(vehicleid == terrortank || vehicleid == armytank)
  27. {
  28.  
  29. if(GetPlayerScore(playerid) < 3000)
  30. {
  31. SendClientMessage(playerid,COLOR_RED,"You can't use this vehicle till 3000 score!");
  32. ClearAnimations(playerid);
  33. return 1;
  34. }
  35. for(new i = 0; i < PLAYERS; i++)
  36. {
  37. if(IsPlayerConnected(i))
  38. {
  39. count++;
  40. }
  41. }
  42. if(count < 8)
  43. {
  44. SendClientMessage(playerid,COLOR_WHITE,"{005E80}GF: {FFFFFF}There is no need to use the Tank now! (There must be atleast 8 people online)");
  45. ClearAnimations(playerid);
  46. return 1;
  47. }
  48. }
  49. if(modelid == 425)
  50. {
  51. if(dini_Int(AddDirFile(dir_userfiles, playername), "Airforce") == 0)
  52. {
  53. SendClientMessage(playerid,COLOR_RED,"You can't use this Hunter!");
  54. ClearAnimations(playerid);
  55. return 1;
  56. }
  57. for(new i = 0; i < PLAYERS; i++)
  58. {
  59. if(IsPlayerConnected(i))
  60. {
  61. count++;
  62. }
  63. }
  64. if(count < 8)
  65. {
  66. SendClientMessage(playerid,COLOR_WHITE,"{005E80}GF: {FFFFFF}There is no need to use the Hunter now! (There must be atleast 8 people online)");
  67. ClearAnimations(playerid);
  68. return 1;
  69. }
  70. }
  71. if(ispassenger == 0 || ispassenger == 1)
  72. {
  73. for(new i = 0 ; i < MAX_VEHICLES ; i++)
  74. {
  75. if(vehicleid == hitman[i])
  76. {
  77. if(gTeam[playerid] != Hitman)
  78. {
  79. ClearAnimations(playerid);
  80. RemovePlayerFromVehicle(playerid);
  81. SendClientMessage(playerid, COLOR_RED, "You are not member of Hitman and you are not allowed use Hitman vehicles!");
  82. return 1;
  83. }
  84. }
  85. if(vehicleid == alpha[i])
  86. {
  87. if(gTeam[playerid] != AlphaSquad)
  88. {
  89. ClearAnimations(playerid);
  90. RemovePlayerFromVehicle(playerid);
  91. SendClientMessage(playerid, COLOR_RED, "You are not member of Alpha Squad and you are not allowed use Alpha Squad vehicles!");
  92. return 1;
  93. }
  94. }
  95. if(vehicleid == saf[i])
  96. {
  97. if(dini_Int(AddDirFile(dir_userfiles, playername), "Airforce") == 0)
  98. {
  99. ClearAnimations(playerid);
  100. RemovePlayerFromVehicle(playerid);
  101. SendClientMessage(playerid, COLOR_RED, "You are not member of San Andreas Airforce and you are not allowed use San Andreas Airforce vehicles!");
  102. return 1;
  103. }
  104. }
  105. }
  106. }
  107. if (ispassenger == 0)
  108. {
  109. if (vehiclelocked[playerid][vehicleid])
  110. {
  111. ClearAnimations(playerid);
  112. return 1;
  113. }
  114. }
  115. return 1;
  116. }
Add Comment
Please, Sign In to add comment