Advertisement
Guest User

Untitled

a guest
Jul 18th, 2016
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.60 KB | None | 0 0
  1. /* ============================================================================
  2. // Gaudynių sistema
  3. // Kreditų prašau nekeisti, pakeitę kreditus šio fs kūrėju netapsite!
  4. // Sukurta pagal MantasPwn ( Mantas_Life )
  5. // Versija: v0.2
  6. =============================================================================*/
  7.  
  8. #define FILTERSCRIPT
  9.  
  10. #include <a_samp>
  11.  
  12. #define GREEN 0x33AA33AA
  13. #define RED 0xAA3333AA
  14. #define YELLOW 0xFFFF00AA
  15. #define CWHITE 0xFFFFFFAA
  16. #define BLUE 0x0000BBAA
  17. #define ORANGE 0xFF9900AA
  18. #define RED 0xAA3333AA
  19.  
  20. enum info{
  21. bool:Gaudytojas
  22. };
  23. new pInfo[MAX_PLAYERS][info];
  24.  
  25. new bool:Gaudo;
  26. new masina; // masina
  27.  
  28. //Los santos random spawnai
  29. new Float:RandomSpawn[][4] =
  30. {
  31. {1302.3599,-930.2845,39.0481,265.9452},
  32. {1302.3599,-930.2845,39.0481,265.9452},
  33. {1463.2319,-954.8225,35.7562,256.4555},
  34. {1849.1582,-1012.7867,35.7567,260.1097},
  35. {2151.7361,-1109.5553,25.0283,228.5781},
  36. {2165.5667,-1295.3243,23.4452,173.2844},
  37. {2110.2405,-1456.5002,23.4538,180.5320},
  38. {2091.1726,-1726.4398,13.1830,155.7466},
  39. {1912.8125,-1793.9650,13.0910,100.9598},
  40. {1696.0015,-1869.0270,13.1748,108.6290},
  41. {1346.2948,-1861.2217,13.0069,74.9321},
  42. {1009.1754,-1810.9103,13.6851,63.1777},
  43. {544.4791,-1717.0066,12.5298,83.1754},
  44. {155.3508,-1560.8696,10.8251,34.2408},
  45. {431.7661,-1323.6981,14.5209,301.8467},
  46. {681.0300,-1221.5962,15.7292,299.1794},
  47. {1052.2552,-1151.6973,23.3098,267.8715},
  48. {1207.9073,-1324.9266,13.0225,194.9511},
  49. {1248.9963,-1432.3840,13.1818,285.2023},
  50. {1318.2496,-1528.3755,13.0078,165.9852},
  51. {1511.9880,-1610.7473,13.6710,254.5193}
  52. };
  53. //************************
  54.  
  55. #if defined FILTERSCRIPT
  56.  
  57. public OnFilterScriptInit()
  58. {
  59. print("\n--------------------------------------");
  60. print(" Gaudynes by MantasPwn ( Mantas_Life )");
  61. print("--------------------------------------\n");
  62. masina = 415; //INJECTION
  63. return 1;
  64. }
  65.  
  66. public OnFilterScriptExit()
  67. {
  68. return 1;
  69. }
  70.  
  71. #else
  72.  
  73. main()
  74. {
  75. print("\n----------------------------------");
  76. print(" Gaudynes by MantasPwn ( Mantas_Life )");
  77. print("----------------------------------\n");
  78. }
  79.  
  80. #endif
  81.  
  82. public OnGameModeInit()
  83. {
  84. return 1;
  85. }
  86.  
  87. public OnGameModeExit()
  88. {
  89. return 1;
  90. }
  91.  
  92. public OnPlayerRequestClass(playerid, classid)
  93. {
  94. return 1;
  95. }
  96.  
  97. public OnPlayerConnect(playerid)
  98. {
  99. return 1;
  100. }
  101.  
  102. public OnPlayerDisconnect(playerid, reason)
  103. {
  104. return 1;
  105. }
  106.  
  107. public OnPlayerSpawn(playerid)
  108. {
  109. return 1;
  110. }
  111.  
  112. public OnPlayerDeath(playerid, killerid, reason)
  113. {
  114. return 1;
  115. }
  116.  
  117. public OnVehicleSpawn(vehicleid)
  118. {
  119. return 1;
  120. }
  121.  
  122. public OnVehicleDeath(vehicleid, killerid)
  123. {
  124. return 1;
  125. }
  126.  
  127. public OnPlayerText(playerid, text[])
  128. {
  129. return 1;
  130. }
  131.  
  132. public OnPlayerCommandText(playerid, cmdtext[])
  133. {
  134. if (strcmp("/kasgaudo", cmdtext, true, 10) == 0)
  135. {
  136. if(Gaudo == true){
  137. SendClientMessage(playerid,-1, "* Gaudoytojas jau yra!");
  138. }else{
  139. /*new string[120], Name[MAX_PLAYER_NAME];
  140. GetPlayerName(playerid, Name, sizeof(Name));
  141. pInfo[playerid][Gaudytojas] = true;
  142. format(string, sizeof(string), "* Zaidejas %s gaudo!", Name);
  143. SendClientMessageToAll(-1, string);
  144. for(new i; i < MAX_PLAYERS; i++){
  145. Gaudo = true;
  146. }*/
  147. new onlineids[MAX_PLAYERS]; // to store all online playerids
  148. new playersonline; // to store the amount of current online players
  149. new pname[80]; // to store the chosen player's name
  150.  
  151. for(new i=0; i<MAX_PLAYERS; i++) // loop through max amount of players (hopefully redefined from default!)
  152. {
  153. if(IsPlayerConnected(i)) // check to see if current id in the loop is connected
  154. {
  155. onlineids[playersonline] = i; // store the current id into the onlineids variable
  156. playersonline++; // increase the playersonline by 1
  157. Gaudo = true;
  158. pInfo[i][Gaudytojas] = true;
  159. }
  160. }
  161.  
  162. GetPlayerName(onlineids[random(playersonline)], pname, sizeof(pname)); // use the random function to randomly select a store online id
  163. format(pname, sizeof(pname), "* Pirmasis gaudytojas yra zaidejas %s", pname);
  164. SendClientMessageToAll(GREEN, pname);
  165.  
  166. }
  167. return 1;
  168. }
  169.  
  170. if (strcmp("/jungtis", cmdtext, true, 10) == 0)
  171. {
  172. SendClientMessage(playerid, GREEN, "* Prisijungei į žaidimą!");
  173. new rand = random(sizeof(RandomSpawn));
  174. SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
  175. new car = CreateVehicle(masina, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2],RandomSpawn[rand][3], -1, -1, false);
  176. PutPlayerInVehicle(playerid, car, 0);
  177. return 1;
  178. }
  179. return 0;
  180. }
  181.  
  182. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  183. {
  184. return 1;
  185. }
  186.  
  187. public OnPlayerExitVehicle(playerid, vehicleid)
  188. {
  189. return 1;
  190. }
  191.  
  192. public OnPlayerStateChange(playerid, newstate, oldstate)
  193. {
  194. return 1;
  195. }
  196.  
  197. public OnPlayerEnterCheckpoint(playerid)
  198. {
  199. return 1;
  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. if(Gaudo == true){
  285. if(pInfo[playerid][Gaudytojas] == true){
  286. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
  287. for(new i = 0; i < MAX_PLAYERS; i++){
  288. if(IsPlayerConnected(i) || IsPlayerConnected(playerid)){
  289. if(i == playerid)continue;
  290. new Float:Pos[3], string1[60], string2[60], Name1[24], Name2[24], msg[80];
  291. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  292. if(IsPlayerInRangeOfPoint(i, 5, Pos[0], Pos[1], Pos[2])){
  293. GetPlayerName(playerid, Name2, sizeof(Name2));
  294. GetPlayerName(i, Name1, sizeof(Name1));
  295. format(msg,sizeof(msg), "* Gaudytojas %s pagavo zaideja %s, dabar gaudo jis!", Name2, Name1);
  296. format(string1, sizeof(string1), "Pagavai zaideja %s, dabar gaudo jis!", Name1);
  297. SendClientMessage(playerid, YELLOW, string1);
  298. format(string2, sizeof(string2), "Tave pagavo zaidejas %s, dabar gaudai tu!", Name2);
  299. SendClientMessage(i, RED, string2);
  300. pInfo[playerid][Gaudytojas] = false;
  301. pInfo[i][Gaudytojas] = true;
  302. Gaudo = false;
  303. SetTimer("Gaudynes", 3000, false);
  304. SendClientMessageToAll(GREEN, msg);
  305. }
  306. }
  307. }
  308. }
  309. }
  310. }
  311.  
  312. new vehicle, Float:hp;
  313. vehicle = GetPlayerVehicleID(playerid);
  314. GetVehicleHealth(vehicle, hp);
  315. if(hp < 700){
  316. SetVehicleHealth(vehicle, 1000);
  317. }
  318. return 1;
  319. }
  320.  
  321. public OnPlayerStreamIn(playerid, forplayerid)
  322. {
  323. return 1;
  324. }
  325.  
  326. public OnPlayerStreamOut(playerid, forplayerid)
  327. {
  328. return 1;
  329. }
  330.  
  331. public OnVehicleStreamIn(vehicleid, forplayerid)
  332. {
  333. return 1;
  334. }
  335.  
  336. public OnVehicleStreamOut(vehicleid, forplayerid)
  337. {
  338. return 1;
  339. }
  340.  
  341. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  342. {
  343. return 1;
  344. }
  345.  
  346. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  347. {
  348. return 1;
  349. }
  350.  
  351. forward Gaudynes(playerid);
  352. public Gaudynes(playerid){
  353. Gaudo = true;
  354. return 1;
  355. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement