Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.32 KB | None | 0 0
  1. //
  2. // Trunk System FilterScript v.1.2 by JaST
  3. #pragma tabsize 0
  4. #include <a_samp>
  5. //--------------------//
  6. #define COLOR_WHITE 0xFFFFFFAA
  7. #define COLOR_YELLOW 0xFFFF00AA
  8. #define COLOR_GRAD 0xB4B5B7FF
  9. #define DIALOG_BPUT 5239
  10. #define DIALOG_BTAKE 5240
  11. // -- MedKit Mode -- //
  12. #define MedkitMode 1 // Set to 1 for ON medkit mode, Set to 0 for OFF medkit mode
  13. //---------------------//
  14.  
  15. new mkMode = MedkitMode;
  16.  
  17. //--------------------//
  18.  
  19. enum tInfo
  20. {
  21. tWeapon1,
  22. tWeapon2,
  23. tWeapon3,
  24. tWeapon4,
  25. tWeapon5,
  26. tWeapon6,
  27. tAmmo1,
  28. tAmmo2,
  29. tAmmo3,
  30. tAmmo4,
  31. tAmmo5,
  32. tAmmo6,
  33. tMedkit
  34. };
  35. new TrunkInfo[MAX_VEHICLES][tInfo];
  36. //--------------------//
  37. forward RemovePlayerWeapon(playerid, weaponid);
  38. forward strtok3(const string[], &index);
  39. //--------------------//
  40.  
  41. public OnFilterScriptInit()
  42. {
  43. print(" Trunk System FilterScript v.1.2 by JaST");
  44. if(mkMode == 1)
  45. {
  46. Create3DTextLabel(" MedKit for Vehicles (250$)\n /buymkit",0x33CCFFAA,-2673.8306,624.3801,14.4531,75.0,0,1);
  47. Create3DTextLabel(" MedKit for Vehicles (250$)\n /buymkit",0x33CCFFAA,1189.0936,-1372.4296,13.5343,75.0,0,1);
  48. }
  49. return 1;
  50. }
  51.  
  52. public OnPlayerCommandText(playerid, cmdtext[])
  53. {
  54. new cmdx[256];
  55. new string[128];
  56. new idx;
  57. new i = GetPlayerVehicleID(playerid);
  58. new model = GetVehicleModel(i);
  59. cmdx = strtok3(cmdtext, idx);
  60.  
  61. if(strcmp(cmdx, "/bput", true) == 0)
  62. {
  63. if(IsPlayerConnected(playerid))
  64. {
  65. if(!IsPlayerInAnyVehicle(playerid))
  66. {
  67. SendClientMessage(playerid, COLOR_YELLOW, " You must be in the car!");
  68. SendClientMessage(playerid, COLOR_GRAD, " Thoughts: Hmm .. to put a weapon to open the trunk, and the button opening located in the car.");
  69. return 1;
  70. }
  71. if(model!=448 && model!=461 && model!=462 && model!=463 && model!=468 && model!=471 && model!=481 && model!=509 && model!=510 && model!=521 && model!=522 && model!=523 && model!=581 && model!=586 && model!=481 && model!=509 && model!=510)
  72. {
  73. ShowPlayerDialog(playerid,DIALOG_BPUT,DIALOG_STYLE_LIST," Trunk","Weapon(Slot:1)\nWeapon(Slot:2)\nWeapon(Slot:3)\nWeapon(Slot:4)\nWeapon(Slot:5)\nWeapon(Slot:6)", "Put", "Close");
  74. }
  75. else
  76. {
  77. SendClientMessage(playerid, COLOR_YELLOW, " This is vehicle not have trunk!");
  78. }
  79. }
  80. return 1;
  81. }
  82. else if (strcmp(cmdx, "/btake", true) == 0)
  83. {
  84. if(IsPlayerConnected(playerid))
  85. {
  86. if(!IsPlayerInAnyVehicle(playerid))
  87. {
  88. SendClientMessage(playerid, COLOR_YELLOW, " You must be in the car!");
  89. SendClientMessage(playerid, COLOR_GRAD, " Thoughts: Hmm .. to take a weapon to open the trunk, and the button opening located in the car.");
  90. return 1;
  91. }
  92. if(model!=448 && model!=461 && model!=462 && model!=463 && model!=468 && model!=471 && model!=481 && model!=509 && model!=510 && model!=521 && model!=522 && model!=523 && model!=581 && model!=586 && model!=481 && model!=509 && model!=510)
  93. {
  94. if(mkMode == 1 && TrunkInfo[i][tMedkit] != 0)
  95. {
  96. ShowPlayerDialog(playerid,DIALOG_BTAKE,DIALOG_STYLE_LIST,"Trunk","Medkit\nWeapon(Slot:1)\nWeapon(Slot:2)\nWeapon(Slot:3)\nÎWeapon(Slot:4)\nWeapon(Slot:5)\nWeapon(Slot:6)", "Take", "Close");
  97. }
  98. else
  99. {
  100. ShowPlayerDialog(playerid,DIALOG_BTAKE,DIALOG_STYLE_LIST,"Trunk","Weapon(Slot:1)\nWeapon(Slot:2)\nWeapon(Slot:3)\nWeapon(Slot:4)\nWeapon(Slot:5)\nWeapon(Slot:6)", "Take", "Close");
  101. }
  102. }
  103. else
  104. {
  105. SendClientMessage(playerid, COLOR_YELLOW, " This is vehicle not have trunk!");
  106. }
  107. }
  108. return 1;
  109. }
  110. else if(strcmp(cmdx, "/binfo", true) == 0)
  111. {
  112. if(IsPlayerConnected(playerid))
  113. {
  114. new gunname[32];
  115. if(!IsPlayerInAnyVehicle(playerid))
  116. {
  117. SendClientMessage(playerid, COLOR_YELLOW, " You must be in the car!");
  118. return 1;
  119. }
  120. format(string,sizeof(string)," |_________ VEHICLE(%d)TRUNK _________| ",i);
  121. SendClientMessage(playerid,COLOR_WHITE,string);
  122. if(TrunkInfo[i][tWeapon1] != 0)
  123. {
  124. GetWeaponName(TrunkInfo[i][tWeapon1],gunname,sizeof(gunname));
  125. format(string,sizeof(string)," WEAPON(1): %s, ammo: %d", gunname,TrunkInfo[i][tAmmo1]);
  126. SendClientMessage(playerid,COLOR_GRAD,string);
  127. }
  128. if(TrunkInfo[i][tWeapon2] != 0)
  129. {
  130. GetWeaponName(TrunkInfo[i][tWeapon2],gunname,sizeof(gunname));
  131. format(string,sizeof(string)," WEAPON(2): %s, ammo: %d", gunname,TrunkInfo[i][tAmmo2]);
  132. SendClientMessage(playerid,COLOR_GRAD,string);
  133. }
  134. if(TrunkInfo[i][tWeapon3] != 0)
  135. {
  136. GetWeaponName(TrunkInfo[i][tWeapon3],gunname,sizeof(gunname));
  137. format(string,sizeof(string)," WEAPON(3): %s, ammo: %d", gunname,TrunkInfo[i][tAmmo3]);
  138. SendClientMessage(playerid,COLOR_GRAD,string);
  139. }
  140. if(TrunkInfo[i][tWeapon4] != 0)
  141. {
  142. GetWeaponName(TrunkInfo[i][tWeapon4],gunname,sizeof(gunname));
  143. format(string,sizeof(string)," WEAPON(4): %s, ammo: %d", gunname,TrunkInfo[i][tAmmo4]);
  144. SendClientMessage(playerid,COLOR_GRAD,string);
  145. }
  146. if(TrunkInfo[i][tWeapon5] != 0)
  147. {
  148. GetWeaponName(TrunkInfo[i][tWeapon5],gunname,sizeof(gunname));
  149. format(string,sizeof(string)," WEAPON(5): %s, ammo: %d", gunname,TrunkInfo[i][tAmmo5]);
  150. SendClientMessage(playerid,COLOR_GRAD,string);
  151. }
  152. if(TrunkInfo[i][tWeapon6] != 0)
  153. {
  154. GetWeaponName(TrunkInfo[i][tWeapon6],gunname,sizeof(gunname));
  155. format(string,sizeof(string)," WEAPON(6): %s, ammo: %d", gunname,TrunkInfo[i][tAmmo6]);
  156. SendClientMessage(playerid,COLOR_GRAD,string);
  157. }
  158. if(TrunkInfo[i][tMedkit] != 0 && mkMode == 1)
  159. {
  160. if(TrunkInfo[i][tMedkit] != 0)
  161. {
  162. format(string,sizeof(string)," MEDKIT: Medications Available: %d ", TrunkInfo[i][tMedkit]);
  163. SendClientMessage(playerid,COLOR_GRAD,string);
  164. }
  165. }
  166. }
  167. return 1;
  168. }
  169. else if(strcmp(cmdx, "/buymkit", true) == 0)
  170. {
  171. if(IsPlayerConnected(playerid))
  172. {
  173. if(mkMode != 1) return 1;
  174. if(!IsPlayerInAnyVehicle(playerid))
  175. {
  176. SendClientMessage(playerid, COLOR_YELLOW, " You must be in the car!");
  177. return 1;
  178. }
  179. else
  180. {
  181. if(IsPlayerInRangeOfPoint(playerid,25,-2673.8306,624.3801,14.4531) || IsPlayerInRangeOfPoint(playerid,25,1189.0936,-1372.4296,13.5343))
  182. {
  183. if(TrunkInfo[i][tMedkit] > 2) { return SendClientMessage(playerid, COLOR_YELLOW, " Use At least 3 doses of medicine to buy a new kit!"); }
  184. if(GetPlayerMoney(playerid) < 250) { return SendClientMessage(playerid, COLOR_YELLOW, " Not Enough money!"); }
  185. TrunkInfo[i][tMedkit] = 5;
  186. SendClientMessage(playerid, COLOR_YELLOW, " You are buying MedKit for 250$!");
  187. GivePlayerMoney(playerid,-250);
  188. }
  189. return 1;
  190. }
  191. }
  192. return 1;
  193. }
  194. else if(strcmp(cmdx, "/bfrisk", true) == 0)
  195. {
  196. new gunname[32];
  197. new pskin = GetPlayerSkin(playerid);
  198. new tmp[32];
  199. new Float:X,Float:Y,Float:Z;
  200. tmp = strtok3(cmdtext, idx);
  201. if(IsPlayerConnected(playerid))
  202. {
  203. if(pskin != 280 && pskin != 281 && pskin != 282 && pskin != 283 && pskin != 284 && pskin != 285 && pskin != 286 && pskin != 287 && pskin != 288) { return SendClientMessage(playerid, COLOR_GRAD, " Only Cops!"); }
  204. if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD, " Use: /bfrisk [playerid/Nick]");
  205. GetPlayerPos(strval(tmp),X,Y,Z);
  206. if(!IsPlayerInRangeOfPoint(playerid,15,X,Y,Z)) return SendClientMessage(playerid, COLOR_YELLOW, " Unable to check the trunk. Player away from you!");
  207. if(!IsPlayerInAnyVehicle(strval(tmp)))
  208. {
  209. SendClientMessage(playerid, COLOR_YELLOW, " Player must be in the car!");
  210. return 1;
  211. }
  212. new tmpcar = GetPlayerVehicleID(strval(tmp));
  213. format(string,sizeof(string)," |________Searched the car trunk(%d)________| ",tmpcar);
  214. SendClientMessage(playerid,COLOR_WHITE,string);
  215. if(TrunkInfo[tmpcar][tWeapon1] != 0)
  216. {
  217. GetWeaponName(TrunkInfo[tmpcar][tWeapon1],gunname,sizeof(gunname));
  218. format(string,sizeof(string)," FOUNDED WEAPON: %s, ammo: %d", gunname,TrunkInfo[i][tAmmo1]);
  219. SendClientMessage(playerid,COLOR_GRAD,string);
  220. }
  221. if(TrunkInfo[tmpcar][tWeapon2] != 0)
  222. {
  223. GetWeaponName(TrunkInfo[tmpcar][tWeapon2],gunname,sizeof(gunname));
  224. format(string,sizeof(string)," FOUNDED WEAPON: %s, ammo: %d", gunname,TrunkInfo[i][tAmmo2]);
  225. SendClientMessage(playerid,COLOR_GRAD,string);
  226. }
  227. if(TrunkInfo[tmpcar][tWeapon3] != 0)
  228. {
  229. GetWeaponName(TrunkInfo[tmpcar][tWeapon3],gunname,sizeof(gunname));
  230. format(string,sizeof(string)," FOUNDED WEAPON: %s, ammo: %d", gunname,TrunkInfo[i][tAmmo3]);
  231. SendClientMessage(playerid,COLOR_GRAD,string);
  232. }
  233. if(TrunkInfo[tmpcar][tWeapon4] != 0)
  234. {
  235. GetWeaponName(TrunkInfo[tmpcar][tWeapon4],gunname,sizeof(gunname));
  236. format(string,sizeof(string)," FOUNDED WEAPON: %s, ammo: %d", gunname,TrunkInfo[i][tAmmo4]);
  237. SendClientMessage(playerid,COLOR_GRAD,string);
  238. }
  239. if(TrunkInfo[tmpcar][tWeapon5] != 0)
  240. {
  241. GetWeaponName(TrunkInfo[tmpcar][tWeapon5],gunname,sizeof(gunname));
  242. format(string,sizeof(string)," FOUNDED WEAPON: %s, ammo: %d", gunname,TrunkInfo[i][tAmmo5]);
  243. SendClientMessage(playerid,COLOR_GRAD,string);
  244. }
  245. if(TrunkInfo[tmpcar][tWeapon6] != 0)
  246. {
  247. GetWeaponName(TrunkInfo[tmpcar][tWeapon6],gunname,sizeof(gunname));
  248. format(string,sizeof(string)," FOUNDED WEAPON: %s, ammo: %d", gunname,TrunkInfo[i][tAmmo6]);
  249. SendClientMessage(playerid,COLOR_GRAD,string);
  250. }
  251. if(TrunkInfo[tmpcar][tMedkit] != 0 && mkMode == 1)
  252. {
  253. if(TrunkInfo[tmpcar][tMedkit] != 0)
  254. {
  255. format(string,sizeof(string)," FOUNDED MEDKIT: Medications Available: %d ", TrunkInfo[i][tMedkit]);
  256. SendClientMessage(playerid,COLOR_GRAD,string);
  257. }
  258. }
  259. }
  260. return 1;
  261. }
  262. if(strcmp(cmdx, "/medkitmode", true) == 0)
  263. {
  264. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0x730000ff," You are not authorized to use this command!");
  265. if(mkMode == 0) { mkMode=1; SendClientMessage(playerid,0xcf6300ff," You are allowed to purchase MedKits"); }
  266. else { mkMode=0; SendClientMessage(playerid,0xcf6300ff," You are forbidden to purchase MedKits"); }
  267. return 1;
  268. }
  269. return 0;
  270. }
  271.  
  272. public RemovePlayerWeapon(playerid, weaponid)
  273. {
  274. new pWeapons[12] = 0;
  275. new pAmmo[12] = 0;
  276. for(new slot = 0; slot != 12; slot++)
  277. {
  278. new wep, ammo;
  279. GetPlayerWeaponData(playerid, slot, wep, ammo);
  280.  
  281. if(wep != weaponid && ammo != 0)
  282. {
  283. GetPlayerWeaponData(playerid, slot, pWeapons[slot], pAmmo[slot]);
  284. }
  285. }
  286. ResetPlayerWeapons(playerid);
  287. for(new slot = 0; slot != 12; slot++)
  288. {
  289. if(pAmmo[slot] != 0)
  290. {
  291. GivePlayerWeapon(playerid, pWeapons[slot], pAmmo[slot]);
  292. }
  293. }
  294. return 1;
  295. }
  296. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  297. {
  298. new gunid = GetPlayerWeapon(playerid);
  299. new ammo = GetPlayerAmmo(playerid);
  300. new i = GetPlayerVehicleID(playerid);
  301.  
  302. if(dialogid == DIALOG_BPUT)
  303. {
  304. if(response)
  305. {
  306. if (listitem == 0 && gunid != 0)
  307. {
  308. if(TrunkInfo[i][tWeapon1] != 0)
  309. {
  310. SendClientMessage(playerid,COLOR_GRAD," There are already guns!");
  311. return 1;
  312. }
  313. if(gunid == 0)
  314. {
  315. SendClientMessage(playerid,COLOR_GRAD," First choose which weapons you want to put in the trunk");
  316. return 1;
  317. }
  318. TrunkInfo[i][tWeapon1] = gunid;
  319. TrunkInfo[i][tAmmo1] = ammo;
  320. RemovePlayerWeapon(playerid,gunid);
  321. RemovePlayerFromVehicle(playerid);
  322. SendClientMessage(playerid,COLOR_GRAD," You have successfully put your weapon in the trunk");
  323. }
  324. if (listitem == 1 && gunid != 0)
  325. {
  326. if(TrunkInfo[i][tWeapon2] != 0)
  327. {
  328. SendClientMessage(playerid,COLOR_GRAD," There are already guns!");
  329. return 1;
  330. }
  331. if(gunid == 0)
  332. {
  333. SendClientMessage(playerid,COLOR_GRAD," First choose which weapons you want to put in the trunk");
  334. return 1;
  335. }
  336. TrunkInfo[i][tWeapon2] = gunid;
  337. TrunkInfo[i][tAmmo2] = ammo;
  338. RemovePlayerWeapon(playerid,gunid);
  339. RemovePlayerFromVehicle(playerid);
  340. SendClientMessage(playerid,COLOR_GRAD," You have successfully put your weapon in the trunk");
  341. }
  342. if (listitem == 2 && gunid != 0)
  343. {
  344. if(TrunkInfo[i][tWeapon3] != 0)
  345. {
  346. SendClientMessage(playerid,COLOR_GRAD," There are already guns!");
  347. return 1;
  348. }
  349. if(gunid == 0)
  350. {
  351. SendClientMessage(playerid,COLOR_GRAD," First choose which weapons you want to put in the trunk");
  352. return 1;
  353. }
  354. TrunkInfo[i][tWeapon3] = gunid;
  355. TrunkInfo[i][tAmmo3] = ammo;
  356. RemovePlayerWeapon(playerid,gunid);
  357. RemovePlayerFromVehicle(playerid);
  358. SendClientMessage(playerid,COLOR_GRAD," You have successfully put your weapon in the trunk");
  359. }
  360. if (listitem == 3 && gunid != 0)
  361. {
  362. if(TrunkInfo[i][tWeapon4] != 0)
  363. {
  364. SendClientMessage(playerid,COLOR_GRAD," There are already guns!");
  365. return 1;
  366. }
  367. if(gunid == 0)
  368. {
  369. SendClientMessage(playerid,COLOR_GRAD," First choose which weapons you want to put in the trunk");
  370. return 1;
  371. }
  372. TrunkInfo[i][tWeapon4] = gunid;
  373. TrunkInfo[i][tAmmo4] = ammo;
  374. RemovePlayerWeapon(playerid,gunid);
  375. RemovePlayerFromVehicle(playerid);
  376. SendClientMessage(playerid,COLOR_GRAD," You have successfully put your weapon in the trunk");
  377. }
  378. if (listitem == 4 && gunid != 0)
  379. {
  380. if(TrunkInfo[i][tWeapon5] != 0)
  381. {
  382. SendClientMessage(playerid,COLOR_GRAD," There are already guns!");
  383. return 1;
  384. }
  385. if(gunid == 0)
  386. {
  387. SendClientMessage(playerid,COLOR_GRAD," First choose which weapons you want to put in the trunk");
  388. return 1;
  389. }
  390. TrunkInfo[i][tWeapon5] = gunid;
  391. TrunkInfo[i][tAmmo5] = ammo;
  392. RemovePlayerWeapon(playerid,gunid);
  393. RemovePlayerFromVehicle(playerid);
  394. SendClientMessage(playerid,COLOR_GRAD," You have successfully put your weapon in the trunk");
  395. }
  396. if (listitem == 5 && gunid != 0)
  397. {
  398. if(TrunkInfo[i][tWeapon6] != 0)
  399. {
  400. SendClientMessage(playerid,COLOR_GRAD," There are already guns!");
  401. return 1;
  402. }
  403. if(gunid == 0)
  404. {
  405. SendClientMessage(playerid,COLOR_GRAD," First choose which weapons you want to put in the trunk");
  406. return 1;
  407. }
  408. TrunkInfo[i][tWeapon6] = gunid;
  409. TrunkInfo[i][tAmmo6] = ammo;
  410. RemovePlayerWeapon(playerid,gunid);
  411. RemovePlayerFromVehicle(playerid);
  412. SendClientMessage(playerid,COLOR_GRAD," You have successfully put your weapon in the trunk");
  413. }
  414. }
  415. else
  416. {
  417. SendClientMessage(playerid,COLOR_GRAD," You're close Trunk.");
  418. }
  419. }
  420. if(dialogid == DIALOG_BTAKE)
  421. {
  422. if(response)
  423. {
  424. if (listitem == 0)
  425. {
  426. if(TrunkInfo[i][tMedkit] == 1)
  427. {
  428. SetPlayerHealth(playerid, 100);
  429. TrunkInfo[i][tMedkit] = 0;
  430. SendClientMessage(playerid,COLOR_GRAD," You have spent the last dose of medication from a set of car-kits, go and buy a new.");
  431. return 1;
  432. }
  433. SetPlayerHealth(playerid, 100);
  434. TrunkInfo[i][tMedkit] -= 1;
  435. SendClientMessage(playerid,COLOR_YELLOW," You're cured (-1 dose of medication).");
  436.  
  437. }
  438. if (listitem == 1)
  439. {
  440. if(TrunkInfo[i][tWeapon1] == 0)
  441. {
  442. SendClientMessage(playerid,COLOR_GRAD," Empty!");
  443. return 1;
  444. }
  445. GivePlayerWeapon(playerid,TrunkInfo[i][tWeapon1],TrunkInfo[i][tAmmo1]);
  446. TrunkInfo[i][tWeapon1] = 0;
  447. TrunkInfo[i][tAmmo1] = 0;
  448. SendClientMessage(playerid,COLOR_GRAD," You take the weapon from the trunk");
  449. RemovePlayerFromVehicle(playerid);
  450. }
  451. if (listitem == 2)
  452. {
  453. if(TrunkInfo[i][tWeapon2] == 0)
  454. {
  455. SendClientMessage(playerid,COLOR_GRAD," Empty!");
  456. return 1;
  457. }
  458. GivePlayerWeapon(playerid,TrunkInfo[i][tWeapon2],TrunkInfo[i][tAmmo2]);
  459. TrunkInfo[i][tWeapon2] = 0;
  460. TrunkInfo[i][tAmmo2] = 0;
  461. SendClientMessage(playerid,COLOR_GRAD," You take the weapon from the trunk");
  462. RemovePlayerFromVehicle(playerid);
  463. }
  464. if (listitem == 3)
  465. {
  466. if(TrunkInfo[i][tWeapon3] == 0)
  467. {
  468. SendClientMessage(playerid,COLOR_GRAD," Empty!");
  469. return 1;
  470. }
  471. GivePlayerWeapon(playerid,TrunkInfo[i][tWeapon3],TrunkInfo[i][tAmmo3]);
  472. TrunkInfo[i][tWeapon3] = 0;
  473. TrunkInfo[i][tAmmo3] = 0;
  474. SendClientMessage(playerid,COLOR_GRAD," You take the weapon from the trunk");
  475. RemovePlayerFromVehicle(playerid);
  476. }
  477. if (listitem == 4)
  478. {
  479. if(TrunkInfo[i][tWeapon4] == 0)
  480. {
  481. SendClientMessage(playerid,COLOR_GRAD," Empty!");
  482. return 1;
  483. }
  484. GivePlayerWeapon(playerid,TrunkInfo[i][tWeapon4],TrunkInfo[i][tAmmo4]);
  485. TrunkInfo[i][tWeapon4] = 0;
  486. TrunkInfo[i][tAmmo4] = 0;
  487. SendClientMessage(playerid,COLOR_GRAD," You take the weapon from the trunk");
  488. RemovePlayerFromVehicle(playerid);
  489. }
  490. if (listitem == 5)
  491. {
  492. if(TrunkInfo[i][tWeapon5] == 0)
  493. {
  494. SendClientMessage(playerid,COLOR_GRAD," Empty!");
  495. return 1;
  496. }
  497. GivePlayerWeapon(playerid,TrunkInfo[i][tWeapon5],TrunkInfo[i][tAmmo5]);
  498. TrunkInfo[i][tWeapon5] = 0;
  499. TrunkInfo[i][tAmmo5] = 0;
  500. SendClientMessage(playerid,COLOR_GRAD," You take the weapon from the trunk");
  501. RemovePlayerFromVehicle(playerid);
  502. }
  503. if (listitem == 6)
  504. {
  505. if(TrunkInfo[i][tWeapon6] == 0)
  506. {
  507. SendClientMessage(playerid,COLOR_GRAD," Empty!");
  508. return 1;
  509. }
  510. GivePlayerWeapon(playerid,TrunkInfo[i][tWeapon6],TrunkInfo[i][tAmmo6]);
  511. TrunkInfo[i][tWeapon6] = 0;
  512. TrunkInfo[i][tAmmo6] = 0;
  513. SendClientMessage(playerid,COLOR_GRAD," You take the weapon from the trunk");
  514. RemovePlayerFromVehicle(playerid);
  515. }
  516. }
  517. else
  518. {
  519. SendClientMessage(playerid,COLOR_GRAD," You're Close Trunk.");
  520. }
  521. }
  522. return 0;
  523. }
  524. stock strtok3(const string[], &index)
  525. {
  526. new length = strlen(string);
  527. while ((index < length) && (string[index] <= ' '))
  528. {
  529. index++;
  530. }
  531.  
  532. new offset = index;
  533. new result[20];
  534. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  535. {
  536. result[index - offset] = string[index];
  537. index++;
  538. }
  539. result[index - offset] = EOS;
  540. return result;
  541. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement