Guest User

Rent Moto

a guest
Jan 24th, 2013
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.58 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6. forward RentVozila(carid);
  7. #if defined FILTERSCRIPT
  8. new Rent[8];
  9. new Rentano[MAX_PLAYERS];
  10. forward RentVozila(carid)
  11. public OnFilterScriptInit()
  12. {
  13.     print("\n--------------------------------------");
  14.     print(" Blank Filterscript by your name here");
  15.     print("--------------------------------------\n");
  16.     return 1;
  17. }
  18. forward RentVozila(carid);
  19. public OnFilterScriptExit()
  20. {
  21. Rent[0] = AddStaticVehicleEx(462,1698.6999500,-1873.3000500,13.2000000,92.0000000,132,4,15); //Faggio
  22. Rent[1] = AddStaticVehicleEx(462,1698.5999800,-1874.3000500,13.2000000,92.0000000,132,4,15); //Faggio
  23. Rent[2] = AddStaticVehicleEx(462,1698.5000000,-1875.1999500,13.2000000,92.0000000,132,4,15); //Faggio
  24. Rent[3] = AddStaticVehicleEx(462,1698.5000000,-1876.0999800,13.2000000,92.0000000,132,4,15); //Faggio
  25. Rent[4] = AddStaticVehicleEx(462,1698.5000000,-1877.0000000,13.2000000,92.0000000,132,4,15); //Faggio
  26. Rent[5] = AddStaticVehicleEx(462,1698.5999800,-1877.9000200,13.2000000,92.0000000,132,4,15); //Faggio
  27. Rent[6] = AddStaticVehicleEx(462,1698.5000000,-1878.8000500,13.2000000,92.0000000,132,4,15); //Faggio
  28. Rent[7] = AddStaticVehicleEx(462,1698.5000000,-1879.8000500,13.2000000,92.0000000,132,4,15); //Faggio
  29. return 1;
  30. }
  31.  
  32. #else
  33.  
  34. main()
  35. {
  36.     print("\n----------------------------------");
  37.     print(" Blank Gamemode by your name here");
  38.     print("----------------------------------\n");
  39. }
  40.  
  41. #endif
  42.  
  43. public RentVozila(carid)
  44. {
  45.     for(new i = 0; i < sizeof(Rent); i++)
  46.     {
  47.         if(carid == Rent[i])    return 1;
  48.     }
  49.     return 0;
  50. }
  51. forward RentVozila(carid);
  52. public OnGameModeInit()
  53. {
  54.     // Don't use these lines if it's a filterscript
  55.     SetGameModeText("Blank Script");
  56.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  57.     return 1;
  58. }
  59.  
  60. public OnGameModeExit()
  61. {
  62.     return 1;
  63. }
  64.  
  65. public OnPlayerRequestClass(playerid, classid)
  66. {
  67.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  68.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  69.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  70.     return 1;
  71. }
  72.  
  73. public OnPlayerConnect(playerid)
  74. {
  75.     return 1;
  76. }
  77.  
  78. public OnPlayerDisconnect(playerid, reason)
  79. {
  80.     return 1;
  81. }
  82.  
  83. public OnPlayerSpawn(playerid)
  84. {
  85.     return 1;
  86. }
  87.  
  88. public OnPlayerDeath(playerid, killerid, reason)
  89. {
  90.     return 1;
  91. }
  92.  
  93. public OnVehicleSpawn(vehicleid)
  94. {
  95.     return 1;
  96. }
  97.  
  98. public OnVehicleDeath(vehicleid, killerid)
  99. {
  100.     return 1;
  101. }
  102.  
  103. public OnPlayerText(playerid, text[])
  104. {
  105.     return 1;
  106. }
  107.  
  108. public OnPlayerCommandText(playerid, cmdtext[])
  109. {
  110. CMD:rentaj(playerid,params[])
  111. {
  112.     new string[128];
  113.     if (GetPlayerMoney(playerid) <  150)//Ako igrac nema 150 $, nece moci da renta.
  114.     {
  115.         SendClientMessage(playerid, COLOR_GRAD2, "Nemas dovoljno Novca!");
  116.         return 1;
  117.     }
  118.     if(Rentano[playerid] != 299)//Proverava da li vec imas rentano vozilo.
  119.     {
  120.         SendClientMessage(playerid, SIVA, "Moras prvo da vratis iznajmljeno vozilo.");
  121.         return 1;
  122.     }
  123.     for(new i=0; i<MAX_PLAYERS; i++)
  124.     {
  125.     if(Rentano[i] == GetPlayerVehicleID(playerid))//Ako je neko rentao vozilo, neces ga moci rentati
  126.     {
  127.         SendClientMessage(playerid, SIVA, "Neko je vec rentao ovo vozilo.");
  128.         return 1;
  129.     }
  130.     }
  131.         GivePlayerMoney(playerid,-150);//Oduzima igracu 150$
  132.         Rentano[playerid] = GetPlayerVehicleID(playerid);//Postavlja igracu rent vozilo(da drugi nmg rentati)
  133.         PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);// Pusta neke zvuke...
  134.         format(string, sizeof(string), "~r~/unrentcar~n~~g~/lock.");//Tekst koji ce biti u GameTextu
  135.         SendClientMessage(playerid, ZUTA, "Prijatan dan!");// ispisuje poruku igracu
  136.         TogglePlayerControllable(playerid, 1);//Odmrzava igraca - Omogucava mu da se krece
  137.         GameTextForPlayer(playerid, string, 5000, 3);// Prikazuje GameText
  138.         return 1;
  139.     }
  140.    
  141. CMD:unrentaj(playerid,params[])
  142. {
  143.     new idcar = GetPlayerVehicleID(playerid);
  144.     if(Rentano[playerid] != 299)
  145.     {
  146.     if(idcar == Rentano[playerid])
  147.     {
  148.         TogglePlayerControllable(playerid, 1);
  149.     }
  150.         SetVehicleToRespawn(Rentano[playerid]);
  151.         Rentano[playerid] = 299;
  152.         SendClientMessage(playerid,CRVENA,"Vratio si iznajmljeno vozilo!");
  153.     }
  154.     return 1;
  155. }
  156.  
  157.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  158.     {
  159.         // Do something here
  160.         return 1;
  161.     }
  162.     return 0;
  163. }
  164.  
  165. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  166. {
  167.     return 1;
  168. }
  169.  
  170. public OnPlayerExitVehicle(playerid, vehicleid)
  171. {
  172.     return 1;
  173. }
  174.  
  175. public OnPlayerStateChange(playerid, newstate, oldstate)
  176. {
  177.  
  178.     return 1;
  179. }
  180.  
  181. public OnPlayerEnterCheckpoint(playerid)
  182. {
  183. if(newstate == 2)
  184. {
  185.     if(RentVozila(newcar))
  186.     {
  187.     if (Rentano[playerid] != newcar)
  188.     {
  189.             SendClientMessage(playerid,ZELENA,"========== RENT VOZILO ==========");
  190.             SendClientMessage(playerid,LJUBICASTA,"Da rentas: /rentcar .");
  191.             SendClientMessage(playerid,LJUBICASTA,"Da izadjes: /exitcar .");
  192.             TogglePlayerControllable(playerid, 0);// Freeza igraca, da ne moze da pobegne
  193.             PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  194.     }
  195.     else
  196.     {
  197.     return 1;
  198.     }
  199.   }
  200. }
  201.  
  202. public OnPlayerLeaveCheckpoint(playerid)
  203. {
  204.     return 1;
  205. }
  206.  
  207. public OnPlayerEnterRaceCheckpoint(playerid)
  208. {
  209.     return 1;
  210. }
  211.  
  212. public OnPlayerLeaveRaceCheckpoint(playerid)
  213. {
  214.     return 1;
  215. }
  216.  
  217. public OnRconCommand(cmd[])
  218. {
  219.     return 1;
  220. }
  221.  
  222. public OnPlayerRequestSpawn(playerid)
  223. {
  224.     return 1;
  225. }
  226.  
  227. public OnObjectMoved(objectid)
  228. {
  229.     return 1;
  230. }
  231.  
  232. public OnPlayerObjectMoved(playerid, objectid)
  233. {
  234.     return 1;
  235. }
  236.  
  237. public OnPlayerPickUpPickup(playerid, pickupid)
  238. {
  239.     return 1;
  240. }
  241.  
  242. public OnVehicleMod(playerid, vehicleid, componentid)
  243. {
  244.     return 1;
  245. }
  246.  
  247. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  248. {
  249.     return 1;
  250. }
  251.  
  252. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  253. {
  254.     return 1;
  255. }
  256.  
  257. public OnPlayerSelectedMenuRow(playerid, row)
  258. {
  259.     return 1;
  260. }
  261.  
  262. public OnPlayerExitedMenu(playerid)
  263. {
  264.     return 1;
  265. }
  266.  
  267. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  268. {
  269.     return 1;
  270. }
  271.  
  272. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  273. {
  274.     return 1;
  275. }
  276.  
  277. public OnRconLoginAttempt(ip[], password[], success)
  278. {
  279.     return 1;
  280. }
  281.  
  282. public OnPlayerUpdate(playerid)
  283. {
  284.     return 1;
  285. }
  286.  
  287. public OnPlayerStreamIn(playerid, forplayerid)
  288. {
  289.     return 1;
  290. }
  291.  
  292. public OnPlayerStreamOut(playerid, forplayerid)
  293. {
  294.     return 1;
  295. }
  296.  
  297. public OnVehicleStreamIn(vehicleid, forplayerid)
  298. {
  299.     return 1;
  300. }
  301.  
  302. public OnVehicleStreamOut(vehicleid, forplayerid)
  303. {
  304.     return 1;
  305. }
  306.  
  307. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  308. {
  309.     return 1;
  310. }
  311.  
  312. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  313. {
  314.     return 1;
  315. }
Advertisement
Add Comment
Please, Sign In to add comment