Guest User

Untitled

a guest
Dec 22nd, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.66 KB | None | 0 0
  1. /*
  2.  
  3. Rent Car sistem by Eagle ( Pekic Luka )
  4. Nuklanjajte creditse
  5.  
  6. */
  7.  
  8. #include <a_samp>
  9. #include <zcmd>
  10.  
  11. #define FILTERSCRIPT
  12. #define Bela 0xFFFFFFFF
  13. #define Crvena 0xF00000FF
  14.  
  15. new RentCar[25];
  16. new RentBike[25];
  17. new Rentanov[MAX_PLAYERS]; // provera za iznajmljeni auto
  18. new Rentanob[MAX_PLAYERS]; // provera za iznajmljeni motor
  19.  
  20. //------------------------------------------------------------------------------
  21.  
  22. public OnFilterScriptInit()
  23. {
  24. print("\n--------------------------------------");
  25. print("RentCar sistem ucitan.");
  26. print("--------------------------------------\n");
  27. return 1;
  28. }
  29.  
  30. //------------------------------------------------------------------------------
  31.  
  32. public OnGameModeInit()
  33. {
  34. //-VOZILA ZA IZNAJMLJIVANJE
  35. RentCar[0] = AddStaticVehicleEx(411,1650.50000000,-1886.09997559,13.39999962,270.00000000,32,32,15); //Infernus
  36. RentCar[1] = AddStaticVehicleEx(411,1650.69995117,-1883.69995117,13.39999962,270.00000000,32,32,15); //Infernus
  37. RentCar[2] = AddStaticVehicleEx(589,1663.19995117,-1896.90002441,13.30000019,90.00000000,95,39,15); //Club
  38. RentCar[3] = AddStaticVehicleEx(589,1663.09997559,-1899.19995117,13.30000019,90.00000000,95,39,15); //Club
  39. RentCar[4] = AddStaticVehicleEx(589,1663.50000000,-1885.50000000,13.30000019,90.00000000,95,39,15); //Club
  40. RentCar[5] = AddStaticVehicleEx(589,1663.50000000,-1887.80004883,13.30000019,90.00000000,95,39,15); //Club
  41. RentCar[6] = AddStaticVehicleEx(589,1663.30004883,-1890.09997559,13.30000019,90.00000000,95,39,15); //Club
  42. RentCar[7] = AddStaticVehicleEx(589,1663.19995117,-1892.40002441,13.30000019,90.00000000,95,39,15); //Club
  43. RentCar[8] = AddStaticVehicleEx(589,1663.30004883,-1894.59997559,13.30000019,90.00000000,95,39,15); //Club
  44. RentCar[9] = AddStaticVehicleEx(411,1650.19995117,-1896.09997559,13.39999962,270.00000000,32,32,15); //Infernus
  45. RentCar[10] = AddStaticVehicleEx(411,1650.30004883,-1891.00000000,13.39999962,270.00000000,32,32,15); //Infernus
  46. RentCar[11] = AddStaticVehicleEx(411,1650.19995117,-1893.50000000,13.39999962,270.00000000,32,32,15); //Infernus
  47. RentCar[12] = AddStaticVehicleEx(411,1650.40002441,-1888.50000000,13.39999962,270.00000000,32,32,15); //Infernus
  48. RentCar[13] = AddStaticVehicleEx(411,1650.19995117,-1898.59997559,13.39999962,270.00000000,32,32,15); //Infernus
  49. //-MOTORI ZA IZNAJMLJIVANJE
  50. RentBike[0] = AddStaticVehicleEx(462,1698.09997559,-1873.09997559,13.19999981,90.00000000,42,119,15); //Faggio
  51. RentBike[1] = AddStaticVehicleEx(462,1698.09997559,-1874.30004883,13.19999981,90.00000000,42,119,15); //Faggio
  52. RentBike[2] = AddStaticVehicleEx(462,1698.00000000,-1875.30004883,13.19999981,90.00000000,42,119,15); //Faggio
  53. RentBike[3] = AddStaticVehicleEx(462,1698.00000000,-1876.30004883,13.19999981,90.00000000,42,119,15); //Faggio
  54. RentBike[4] = AddStaticVehicleEx(462,1697.90002441,-1877.40002441,13.19999981,90.00000000,42,119,15); //Faggio
  55. RentBike[5] = AddStaticVehicleEx(462,1698.00000000,-1878.50000000,13.19999981,90.00000000,42,119,15); //Faggio
  56. RentBike[6] = AddStaticVehicleEx(462,1697.90002441,-1879.69995117,13.19999981,90.00000000,42,119,15); //Faggio
  57. RentBike[7] = AddStaticVehicleEx(462,1697.90002441,-1881.00000000,13.19999981,90.00000000,42,119,15); //Faggio
  58. RentBike[8] = AddStaticVehicleEx(462,1697.90002441,-1882.40002441,13.19999981,90.00000000,42,119,15); //Faggio
  59. RentBike[9] = AddStaticVehicleEx(462,1698.00000000,-1883.80004883,13.19999981,90.00000000,42,119,15); //Faggio
  60. RentBike[10] = AddStaticVehicleEx(462,1698.00000000,-1885.09997559,13.19999981,90.00000000,42,119,15); //Faggio
  61. RentBike[11] = AddStaticVehicleEx(462,1697.90002441,-1886.30004883,13.19999981,90.00000000,42,119,15); //Faggio
  62. RentBike[12] = AddStaticVehicleEx(462,1698.00000000,-1887.40002441,13.19999981,90.00000000,42,119,15); //Faggio
  63. RentBike[13] = AddStaticVehicleEx(462,1702.90002441,-1875.40002441,13.19999981,260.00000000,132,4,15); //Faggio
  64. RentBike[14] = AddStaticVehicleEx(462,1702.80004883,-1876.40002441,13.19999981,260.00000000,132,4,15); //Faggio
  65. RentBike[15] = AddStaticVehicleEx(462,1702.80004883,-1877.40002441,13.19999981,259.99694824,132,4,15); //Faggio
  66. RentBike[16] = AddStaticVehicleEx(462,1702.90002441,-1878.40002441,13.19999981,259.99694824,132,4,15); //Faggio
  67. RentBike[17] = AddStaticVehicleEx(462,1702.80004883,-1879.50000000,13.19999981,259.99694824,132,4,15); //Faggio
  68. RentBike[18] = AddStaticVehicleEx(462,1702.80004883,-1880.80004883,13.19999981,259.99694824,132,4,15); //Faggio
  69. RentBike[19] = AddStaticVehicleEx(462,1702.80004883,-1882.09997559,13.19999981,259.99694824,132,4,15); //Faggio
  70. RentBike[20] = AddStaticVehicleEx(462,1702.80004883,-1883.30004883,13.19999981,259.99694824,132,4,15); //Faggio
  71. RentBike[21] = AddStaticVehicleEx(462,1702.80004883,-1884.40002441,13.19999981,259.99694824,132,4,15); //Faggio
  72. return 1;
  73. }
  74.  
  75. public OnPlayerStateChange(playerid, newstate, oldstate)
  76. {
  77. new newcar = GetPlayerVehicleID(playerid);
  78. if(newstate == 2)
  79. {
  80. if(RentVozila(newcar))
  81. {
  82. if(Rentanov[playerid] != newcar)
  83. {
  84. GameTextForPlayer(playerid, "Ovaj avtomobil e na rent da rentate pisete ~r~/rentavto", 5000, 3);
  85. TogglePlayerControllable(playerid, 0);
  86. }
  87. }
  88. if(RentMotori(newcar))
  89. {
  90. if(Rentanob[playerid] != newcar)
  91. {
  92. GameTextForPlayer(playerid, "Ovaj motor e na rent da go rentate pisete ~r~/rentmotor", 5000, 3);
  93. TogglePlayerControllable(playerid, 0);
  94. }
  95. }
  96. return 1;
  97. }
  98. return 1;
  99. }
  100.  
  101. //------------------------------------------------------------------------------
  102.  
  103. forward RentVozila(carid);
  104. public RentVozila(carid)
  105. {
  106. for(new i = 0; i < sizeof(RentCar); i++)
  107. {
  108. if(carid == RentCar[i]) return 1;
  109. }
  110. return 0;
  111. }
  112.  
  113. forward RentMotori(carid);
  114. public RentMotori(carid)
  115. {
  116. for(new i = 0; i < sizeof(RentBike); i++)
  117. {
  118. if(carid == RentBike[i]) return 1;
  119. }
  120. return 0;
  121. }
  122.  
  123. //------------------------------------------------------------------------------
  124.  
  125.  
  126. CMD:rentavto(playerid,params[])
  127. {
  128. if (GetPlayerMoney(playerid) < 350)
  129. {
  130. SendClientMessage(playerid, Crvena, "Nemate dovolno pari");
  131. RemovePlayerFromVehicle(playerid);
  132. return 1;
  133. }
  134.  
  135. GivePlayerMoney(playerid,-150);
  136. Rentanov[playerid] = GetPlayerVehicleID(playerid);
  137. TogglePlayerControllable(playerid, 1);
  138. GameTextForPlayer(playerid, "Iznajmivte avto da go vratite pisete ~r~/vratiavto.", 5000, 3);
  139. return 1;
  140. }
  141.  
  142. CMD:rentmotor(playerid,params[])
  143. {
  144. if(GetPlayerMoney(playerid) < 350)
  145. {
  146. SendClientMessage(playerid, Crvena, "Nemate dovolno pari");
  147. RemovePlayerFromVehicle(playerid);
  148. return 1;
  149. }
  150. GivePlayerMoney(playerid,-150);
  151. Rentanob[playerid] = GetPlayerVehicleID(playerid);
  152. TogglePlayerControllable(playerid, 1);
  153. GameTextForPlayer(playerid, "Go iznajmivte motorot za da go vratete pisete ~r~/vratimotor.", 5000, 3);
  154. return 1;
  155. }
  156.  
  157. //------------------------------------------------------------------------------
  158.  
  159. CMD:vratiavto(playerid,params[])
  160. {
  161. new idcar = GetPlayerVehicleID(playerid);
  162. if(Rentanov[playerid] != 299)
  163. {
  164. if(idcar == Rentanov[playerid])
  165. {
  166. TogglePlayerControllable(playerid, 1);
  167. }
  168. SetVehicleToRespawn(Rentanov[playerid]);
  169. Rentanov[playerid] = 299;
  170. SendClientMessage(playerid, Bela, "Go vrativte iznajmeniot avtomobil.");
  171. return 1;
  172. }
  173. return 1;
  174. }
  175.  
  176.  
  177. CMD:vratimotor(playerid,params[])
  178. {
  179. new idcar = GetPlayerVehicleID(playerid);
  180. if(Rentanob[playerid] != 299)
  181. {
  182. if(idcar == Rentanob[playerid])
  183. {
  184. TogglePlayerControllable(playerid, 1);
  185. }
  186. SetVehicleToRespawn(Rentanob[playerid]);
  187. Rentanob[playerid] = 299;
  188. SendClientMessage(playerid, Bela, "Go vrativte iznajmeniot motor.");
  189. return 1;
  190. }
  191. return 1;
  192. }
  193. //------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment