storage.pwn 168 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Storage System
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. #include <YSI\y_hooks>
  34. stock ShowStorageEquipDialog(playerid)
  35. {
  36. if(gPlayerLogged{playerid} != 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You are not logged in!");
  37. new dialogstring[256];
  38. new epstring[][] = { "Unequipped", "Equipped", "Not Owned" };
  39. for(new i = 0; i < 3; i++)
  40. {
  41. format(dialogstring, sizeof(dialogstring), "%s%s", dialogstring, storagetype[i+1]);
  42. if(StorageInfo[playerid][i][sStorage] != 1) format(dialogstring, sizeof(dialogstring), "%s (%s)\n", dialogstring, epstring[2]);
  43. else format(dialogstring, sizeof(dialogstring), "%s (%s)\n", dialogstring, epstring[StorageInfo[playerid][i][sAttached]]);
  44. }
  45. ShowPlayerDialogEx(playerid, STORAGEEQUIP, DIALOG_STYLE_LIST, "Storage - Equip/Unequip", dialogstring, "Select", "Exit");
  46. return 1;
  47. }
  48. /*stock ShowStorageDialog(playerid, fromplayerid, fromstorageid, itemid, amount, price, special)
  49. {
  50. new titlestring[128], dialogstring[512];
  51. SetPVarInt(playerid, "Storage_transaction", 1); // Prevent double transactions.
  52. SetPVarInt(playerid, "Storage_fromplayerid", fromplayerid);
  53. SetPVarInt(playerid, "Storage_fromstorageid", fromstorageid);
  54. SetPVarInt(playerid, "Storage_itemid", itemid);
  55. SetPVarInt(playerid, "Storage_amount", amount);
  56. SetPVarInt(playerid, "Storage_price", price);
  57. SetPVarInt(playerid, "Storage_special", special);
  58. if(price == -1) format(titlestring, sizeof(titlestring), "Where do you want to store %d %s?", amount, itemtype[itemid]);
  59. else format(titlestring, sizeof(titlestring), "You are buying %d %s for %d", amount, itemtype[itemid], price);
  60. switch(itemid)
  61. {
  62. case 1:
  63. {
  64. format(dialogstring, sizeof(dialogstring), "Hand/Pocket - ($%d)\n", PlayerInfo[playerid][pCash]);
  65. for(new i = 0; i < 3; i++)
  66. {
  67. if(StorageInfo[playerid][i][sAttached] == 1)
  68. {
  69. format(dialogstring, sizeof(dialogstring), "%s(%s) - ($%d/$%d)\n", dialogstring, storagetype[i+1], StorageInfo[playerid][i][sCash], limits[i+1][0]);
  70. }
  71. }
  72. //format(dialogstring, sizeof(dialogstring), "Hand/Pocket - ($%d)\nBag - ($%d/$%d)\nBackpack - ($%d/$%d)\nBriefcase - ($%d/$%d)",
  73. //PlayerInfo[playerid][pCash],
  74. //StorageInfo[playerid][0][sCash],
  75. //bbackpacklimit[itemid-1],
  76. //StorageInfo[playerid][1][sCash],
  77. //backpacklimit[itemid-1],
  78. //StorageInfo[playerid][2][sCash],
  79. //briefcaselimit[itemid-1]
  80. //);
  81. }
  82. case 2:
  83. {
  84. format(dialogstring, sizeof(dialogstring), "Hand/Pocket - (%d)\n", PlayerInfo[playerid][pPot]);
  85. for(new i = 0; i < 3; i++)
  86. {
  87. if(StorageInfo[playerid][i][sAttached] == 1)
  88. {
  89. format(dialogstring, sizeof(dialogstring), "%s(%s) - (%d/%d)\n", dialogstring, storagetype[i+1], StorageInfo[playerid][i][sPot], limits[i+1][0]);
  90. }
  91. }
  92. //format(dialogstring, sizeof(dialogstring), "Hand/Pocket - (%d/%d)\nBag - (%d/%d)\nBackpack - (%d/%d)\nBriefcase - (%d/%d)",
  93. //PlayerInfo[playerid][pPot],
  94. //onhandlimit[itemid-1],
  95. //StorageInfo[playerid][0][sPot],
  96. //bbackpacklimit[itemid-1],
  97. //StorageInfo[playerid][1][sPot],
  98. //backpacklimit[itemid-1],
  99. //StorageInfo[playerid][2][sPot],
  100. //briefcaselimit[itemid-1]
  101. //);
  102. }
  103. case 3:
  104. {
  105. format(dialogstring, sizeof(dialogstring), "Hand/Pocket - ($%d)\n", PlayerInfo[playerid][pCrack]);
  106. for(new i = 0; i < 3; i++)
  107. {
  108. if(StorageInfo[playerid][i][sAttached] == 1)
  109. {
  110. format(dialogstring, sizeof(dialogstring), "%s(%s) - (%d/%d)\n", dialogstring, storagetype[i+1], StorageInfo[playerid][i][sCrack], limits[i+1][0]);
  111. }
  112. }
  113. //format(dialogstring, sizeof(dialogstring), "Hand/Pocket - (%d/%d)\nBag - (%d/%d)\nBackpack - (%d/%d)\nBriefcase - (%d/%d)",
  114. //PlayerInfo[playerid][pCrack],
  115. //onhandlimit[itemid-1],
  116. //StorageInfo[playerid][0][sCrack],
  117. //bbackpacklimit[itemid-1],
  118. //StorageInfo[playerid][1][sCrack],
  119. //backpacklimit[itemid-1],
  120. //StorageInfo[playerid][2][sCrack],
  121. //briefcaselimit[itemid-1]
  122. //);
  123. }
  124. case 4:
  125. {
  126. format(dialogstring, sizeof(dialogstring), "Hand/Pocket - (%d)\n", PlayerInfo[playerid][pMats]);
  127. for(new i = 0; i < 3; i++)
  128. {
  129. if(StorageInfo[playerid][i][sAttached] == 1)
  130. {
  131. format(dialogstring, sizeof(dialogstring), "%s(%s) - (%d/%d)\n", dialogstring, storagetype[i+1], StorageInfo[playerid][i][sMats], limits[i+1][3]);
  132. }
  133. }
  134. //format(dialogstring, sizeof(dialogstring), "Hand/Pocket - (%d/%d)\nBag - (%d/%d)\nBackpack - (%d/%d)\nBriefcase - (%d/%d)",
  135. //PlayerInfo[playerid][pMats],
  136. //onhandlimit[itemid-1],
  137. //StorageInfo[playerid][0][sMats],
  138. //bbackpacklimit[itemid-1],
  139. //StorageInfo[playerid][1][sMats],
  140. //backpacklimit[itemid-1],
  141. //StorageInfo[playerid][2][sMats],
  142. //briefcaselimit[itemid-1]
  143. //);
  144. }
  145. }
  146. ShowPlayerDialogEx(playerid, STORAGESTORE, DIALOG_STYLE_LIST, titlestring, dialogstring, "Choose", "Cancel");
  147. }
  148. stock DeathDrop(playerid)
  149. {
  150. new storageid;
  151. new bool:itemEquipped = false;
  152. for(new i = 0; i < 3; i++)
  153. {
  154. if(StorageInfo[playerid][i][sAttached] == 1) {
  155. storageid = i;
  156. if(storageid != 0) itemEquipped = true; // Bag is exempted from death drops.
  157. }
  158. }
  159. if(itemEquipped == true)
  160. {
  161. new rand = random(101);
  162. switch (PlayerInfo[playerid][pDonateRank])
  163. {
  164. case 0: // Normal (50 Percent)
  165. {
  166. if(rand > 0 && rand <= 50) {
  167. StorageInfo[playerid][storageid][sCash] = 0;
  168. StorageInfo[playerid][storageid][sPot] = 0;
  169. StorageInfo[playerid][storageid][sCrack] = 0;
  170. StorageInfo[playerid][storageid][sMats] = 0;
  171. return SendClientMessageEx(playerid, COLOR_RED, "You have lost all items within your storage device.");
  172. }
  173. else return SendClientMessageEx(playerid, COLOR_YELLOW, "Luck is on your side today, you didn't lose any items within your storage device.");
  174. }
  175. case 1: // BVIP (40 Percent)
  176. {
  177. if(rand > 0 && rand <= 40) {
  178. StorageInfo[playerid][storageid][sCash] = 0;
  179. StorageInfo[playerid][storageid][sPot] = 0;
  180. StorageInfo[playerid][storageid][sCrack] = 0;
  181. StorageInfo[playerid][storageid][sMats] = 0;
  182. return SendClientMessageEx(playerid, COLOR_RED, "You have lost all items within your storage device.");
  183. }
  184. else return SendClientMessageEx(playerid, COLOR_YELLOW, "Luck is on your side today, you didn't lose any items within your storage device.");
  185. }
  186. case 2: // SVIP (30 Percent)
  187. {
  188. if(rand > 0 && rand <= 30) {
  189. StorageInfo[playerid][storageid][sCash] = 0;
  190. StorageInfo[playerid][storageid][sPot] = 0;
  191. StorageInfo[playerid][storageid][sCrack] = 0;
  192. StorageInfo[playerid][storageid][sMats] = 0;
  193. return SendClientMessageEx(playerid, COLOR_RED, "You have lost all items within your storage device.");
  194. }
  195. else return SendClientMessageEx(playerid, COLOR_YELLOW, "Luck is on your side today, you didn't lose any items within your storage device.");
  196. }
  197. case 3: // GVIP (20 Percent)
  198. {
  199. if(rand > 0 && rand <= 20) {
  200. StorageInfo[playerid][storageid][sCash] = 0;
  201. StorageInfo[playerid][storageid][sPot] = 0;
  202. StorageInfo[playerid][storageid][sCrack] = 0;
  203. StorageInfo[playerid][storageid][sMats] = 0;
  204. return SendClientMessageEx(playerid, COLOR_RED, "You have lost all items within your storage device.");
  205. }
  206. else return SendClientMessageEx(playerid, COLOR_YELLOW, "Luck is on your side today, you didn't lose any items within your storage device.");
  207. }
  208. case 4: // PVIP (No Chance)
  209. {
  210. return SendClientMessageEx(playerid, COLOR_YELLOW, "Since you are Platinum VIP, you lose nothing from storage device.");
  211. }
  212. case 5: // Moderator (No Chance)
  213. {
  214. return SendClientMessageEx(playerid, COLOR_YELLOW, "Since you are (Moderator) Platinum VIP, you lose nothing from storage device.");
  215. }
  216. }
  217. }
  218. return 1;
  219. }
  220. // Doc Usage:
  221. // playerid - Person Reciving the Item's Amount. (Who is storing the amount)
  222. // storageid - PlayerID's storage index. (Where to store sending amount)
  223. // fromplayerid - Person Giving the Item's Amount. (Notice: Use -1 if from a non-player, script-based etc.).
  224. // fromstorageid - FromStorageID's storage index. (Notice: Use -1 if from a non-player, script-based etc.)
  225. // itemid - ItemID index that is tradeing, used for both. (What is storing)
  226. // amount - The amount of ItemID that is tradeing, used for both. (What amount is storing)
  227. // price - The price of the transaction (in pCash), sent to playerid from sender. (Notice: Use -1 if no price is required)
  228. // special - Set this to 1 if function is being used by skills or other things. (Notice: Use -1 if no special is required)
  229. // ItemIDs:
  230. // 0 - Nothing
  231. // 1 - Cash
  232. // 2 - Pot
  233. // 3 - Crack
  234. // 4 - Materials
  235. // StorageIDs:
  236. // 0 - Pocket/OnHand
  237. // 1 - Bag
  238. // 2 - Backpack
  239. // 3 - Briefcase
  240. */
  241. stock TransferStorage(playerid, storageid, fromplayerid, fromstorageid, itemid, amount, price, special)
  242. {
  243. if(playerid == fromplayerid)
  244. {
  245. return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR! You cannot transfer from yourself to yourself");
  246. }
  247. storageid=0; fromstorageid=0; //temp
  248. //printf("TransferStorage(playerid=%d, storageid=%d, fromplayerid=%d, fromstorageid=%d, itemid=%d, amount=%d, price=%d, special=%d)", playerid, storageid, fromplayerid, fromstorageid, itemid, amount, price, special);
  249. if(GetPVarInt(playerid, "Storage_transaction") == 1)
  250. {
  251. if(fromplayerid != -1 && fromstorageid != -1) {
  252. SendClientMessageEx(fromplayerid, COLOR_WHITE, "Player is busy with an existing transaction.");
  253. }
  254. return 0;
  255. }
  256. new string[128];
  257. // Disable Prices for Cash Transfers
  258. if(price != -1 && itemid == 1) price = -1;
  259. // Ask the player where to store
  260. if(storageid == -1)
  261. {
  262. //UNCOMMENT WHEN RE RELEASE
  263. //ShowStorageDialog(playerid, fromplayerid, fromstorageid, itemid, amount, price, special);
  264. return 0;
  265. }
  266. // Check if such item is equipped.
  267. if(storageid > 0 && storageid < 4)
  268. {
  269. if(StorageInfo[playerid][storageid-1][sAttached] == 0)
  270. {
  271. format(string, sizeof(string), "You don't have the %s equipped!", storagetype[storageid]);
  272. SendClientMessageEx(playerid, COLOR_WHITE, string);
  273. return 0;
  274. }
  275. }
  276. if(fromplayerid != -1 && fromstorageid != -1)
  277. {
  278. if(!IsPlayerConnected(fromplayerid)) return 0;
  279. if(amount < 0) return 0;
  280. if(fromstorageid > 0 && fromstorageid < 4)
  281. {
  282. if(StorageInfo[fromplayerid][fromstorageid-1][sAttached] == 0)
  283. {
  284. format(string, sizeof(string), "You don't have the %s equipped!", storagetype[fromstorageid]);
  285. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  286. return 0;
  287. }
  288. }
  289. }
  290. if(special == 1 && itemid == 2) // Pot Special "Selling"
  291. {
  292. ExtortionTurfsWarsZone(PotOffer[playerid], 0, PotPrice[playerid]);
  293. GivePlayerCash(PotOffer[playerid], PotPrice[playerid]);
  294. GivePlayerCash(playerid, -PotPrice[playerid]);
  295. if(PlayerInfo[PotOffer[playerid]][pDoubleEXP] > 0)
  296. {
  297. format(string, sizeof(string), "You have gained 2 drug dealer skill points instead of 1. You have %d hours left on the Double EXP token.", PlayerInfo[PotOffer[playerid]][pDoubleEXP]);
  298. SendClientMessageEx(PotOffer[playerid], COLOR_YELLOW, string);
  299. PlayerInfo[PotOffer[playerid]][pDrugSmuggler] += 2;
  300. }
  301. else
  302. {
  303. PlayerInfo[PotOffer[playerid]][pDrugSmuggler] += 1;
  304. }
  305. if(PlayerInfo[PotOffer[playerid]][pDrugSmuggler] == 50)
  306. { SendClientMessageEx(PotOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 2, you can buy more Grams and Cheaper."); }
  307. else if(PlayerInfo[PotOffer[playerid]][pDrugSmuggler] == 100)
  308. { SendClientMessageEx(PotOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 3, you can buy more Grams and Cheaper."); }
  309. else if(PlayerInfo[PotOffer[playerid]][pDrugSmuggler] == 200)
  310. { SendClientMessageEx(PotOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 4, you can buy more Grams and Cheaper."); }
  311. else if(PlayerInfo[PotOffer[playerid]][pDrugSmuggler] == 400)
  312. { SendClientMessageEx(PotOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 5, you can buy more Grams and Cheaper."); }
  313. OnPlayerStatsUpdate(playerid);
  314. OnPlayerStatsUpdate(PotOffer[playerid]);
  315. PotOffer[playerid] = INVALID_PLAYER_ID;
  316. PotStorageID[playerid] = -1;
  317. PotPrice[playerid] = 0;
  318. PotGram[playerid] = 0;
  319. }
  320. if(special == 1 && itemid == 3) // Crack Special "Selling"
  321. {
  322. ExtortionTurfsWarsZone(CrackOffer[playerid], 0, CrackPrice[playerid]);
  323. GivePlayerCash(CrackOffer[playerid], CrackPrice[playerid]);
  324. GivePlayerCash(playerid, -CrackPrice[playerid]);
  325. if(PlayerInfo[CrackOffer[playerid]][pDoubleEXP] > 0)
  326. {
  327. format(string, sizeof(string), "You have gained 2 drug dealer skill points instead of 1. You have %d hours left on the Double EXP token.", PlayerInfo[CrackOffer[playerid]][pDoubleEXP]);
  328. SendClientMessageEx(CrackOffer[playerid], COLOR_YELLOW, string);
  329. PlayerInfo[CrackOffer[playerid]][pDrugSmuggler] += 2;
  330. }
  331. else
  332. {
  333. PlayerInfo[CrackOffer[playerid]][pDrugSmuggler] += 1;
  334. }
  335. PlayerInfo[playerid][pDrugs][2] += CrackGram[playerid];
  336. PlayerInfo[CrackOffer[playerid]][pDrugs][2] -= CrackGram[playerid];
  337. if(PlayerInfo[CrackOffer[playerid]][pDrugSmuggler] == 50)
  338. { SendClientMessageEx(CrackOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 2, you can buy more Grams and Cheaper."); }
  339. else if(PlayerInfo[CrackOffer[playerid]][pDrugSmuggler] == 100)
  340. { SendClientMessageEx(CrackOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 3, you can buy more Grams and Cheaper."); }
  341. else if(PlayerInfo[CrackOffer[playerid]][pDrugSmuggler] == 200)
  342. { SendClientMessageEx(CrackOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 4, you can buy more Grams and Cheaper."); }
  343. else if(PlayerInfo[CrackOffer[playerid]][pDrugSmuggler] == 400)
  344. { SendClientMessageEx(CrackOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 5, you can buy more Grams and Cheaper."); }
  345. OnPlayerStatsUpdate(playerid);
  346. OnPlayerStatsUpdate(CrackOffer[playerid]);
  347. CrackOffer[playerid] = INVALID_PLAYER_ID;
  348. CrackStorageID[playerid] = -1;
  349. CrackPrice[playerid] = 0;
  350. CrackGram[playerid] = 0;
  351. }
  352. if(special == 2 && itemid == 2) // Pot Special "Getting"
  353. {
  354. new mypoint = -1;
  355. for (new i=0; i<MAX_POINTS; i++)
  356. {
  357. if (IsPlayerInRangeOfPoint(playerid, 3.0, Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && Points[i][Type] == 3)
  358. {
  359. new myvw = GetPlayerVirtualWorld(playerid);
  360. if(myvw == Points[i][pointVW3])
  361. {
  362. mypoint = i;
  363. }
  364. }
  365. }
  366. if(PlayerInfo[playerid][pDonateRank] < 1)
  367. {
  368. Points[mypoint][Stock] -= amount;
  369. format(string, sizeof(string), " Pot/OPIUM AVAILABLE: %d/1000.", Points[mypoint][Stock]);
  370. UpdateDynamic3DTextLabelText(Points[mypoint][TextLabel], COLOR_YELLOW, string);
  371. }
  372. for(new i = 0; i < MAX_GROUPS; i++)
  373. {
  374. if(strcmp(Points[mypoint][Owner], arrGroupData[i][g_szGroupName], true) == 0)
  375. {
  376. arrGroupData[i][g_iBudget] += price/2;
  377. }
  378. }
  379. }
  380. if(special == 2 && itemid == 3) // Crack Special "Getting"
  381. {
  382. new mypoint = -1;
  383. for (new i=0; i<MAX_POINTS; i++)
  384. {
  385. if (IsPlayerInRangeOfPoint(playerid, 3.0, Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && Points[i][Type] == 4)
  386. {
  387. new myvw = GetPlayerVirtualWorld(playerid);
  388. if(myvw == Points[i][pointVW3])
  389. {
  390. mypoint = i;
  391. }
  392. }
  393. }
  394. if(PlayerInfo[playerid][pDonateRank] < 1)
  395. {
  396. Points[mypoint][Stock] -= amount;
  397. format(string, sizeof(string), " CRACK AVAILABLE: %d/500.", Points[mypoint][Stock]);
  398. UpdateDynamic3DTextLabelText(Points[mypoint][TextLabel], COLOR_YELLOW, string);
  399. }
  400. for(new i = 0; i < MAX_GROUPS; i++)
  401. {
  402. if(strcmp(Points[mypoint][Owner], arrGroupData[i][g_szGroupName], true) == 0)
  403. {
  404. arrGroupData[i][g_iBudget] += price/2;
  405. }
  406. }
  407. }
  408. if(special == 2 && itemid == 4) // Materials Special "Getting"
  409. {
  410. DeletePVar(playerid, "Packages");
  411. DeletePVar(playerid, "MatDeliver");
  412. DisablePlayerCheckpoint(playerid);
  413. }
  414. if(special == 4 && itemid == 1) // House Withdraw - Cash
  415. {
  416. new houseid = GetPVarInt(playerid, "Special_HouseID");
  417. DeletePVar(playerid, "Special_HouseID");
  418. HouseInfo[houseid][hSafeMoney] -= amount;
  419. }
  420. if(special == 4 && itemid == 2) // House Withdraw - Pot
  421. {
  422. new houseid = GetPVarInt(playerid, "Special_HouseID");
  423. DeletePVar(playerid, "Special_HouseID");
  424. HouseInfo[houseid][hPot] -= amount;
  425. }
  426. if(special == 4 && itemid == 3) // House Withdraw - Crack
  427. {
  428. new houseid = GetPVarInt(playerid, "Special_HouseID");
  429. DeletePVar(playerid, "Special_HouseID");
  430. HouseInfo[houseid][hCrack] -= amount;
  431. }
  432. if(special == 4 && itemid == 4) // House Withdraw - Mats
  433. {
  434. new houseid = GetPVarInt(playerid, "Special_HouseID");
  435. DeletePVar(playerid, "Special_HouseID");
  436. HouseInfo[houseid][hMaterials] -= amount;
  437. }
  438. switch(storageid)
  439. {
  440. case 0: // Pocket or On Hand
  441. {
  442. if(itemid == 1)
  443. {
  444. // Check if Sending Player has sufficient amount.
  445. if(fromplayerid != -1 && fromstorageid != -1)
  446. {
  447. if(fromstorageid == 0)
  448. {
  449. if(PlayerInfo[fromplayerid][pCash] < amount)
  450. {
  451. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  452. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  453. return 0;
  454. }
  455. }
  456. else
  457. {
  458. if(StorageInfo[fromplayerid][fromstorageid-1][sCash] < amount)
  459. {
  460. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  461. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  462. return 0;
  463. }
  464. }
  465. if(fromstorageid == 0) PlayerInfo[fromplayerid][pCash] -= amount;
  466. else StorageInfo[fromplayerid][fromstorageid-1][sCash] -= amount;
  467. }
  468. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  469. PlayerInfo[playerid][pCash] += amount;
  470. OnPlayerStatsUpdate(playerid);
  471. if(fromplayerid != -1) {
  472. OnPlayerStatsUpdate(fromplayerid);
  473. }
  474. format(string, sizeof(string), "$%d has been transfered to your Pocket ($%d).", amount, PlayerInfo[playerid][pCash]);
  475. SendClientMessage(playerid, COLOR_WHITE, string);
  476. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  477. format(string, sizeof(string), "$%d has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  478. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  479. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  480. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  481. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  482. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  483. {
  484. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given $%s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), GetPlayerIpEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid));
  485. Log("logs/adminpay.log", string);
  486. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given $%s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  487. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  488. ABroadCast(COLOR_YELLOW, string, 4);
  489. }
  490. else
  491. {
  492. format(string, sizeof(string), "%s(%d) (IP:%s) has given $%s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), GetPlayerIpEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid));
  493. Log("logs/pay.log", string);
  494. format(string, sizeof(string), "%s (IP:%s) has given $%s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerIpEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerIpEx(playerid));
  495. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  496. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  497. }
  498. }
  499. return 1;
  500. }
  501. if(itemid == 2 && (PlayerInfo[playerid][pDrugs][1] + amount <= onhandlimit[itemid-1]))
  502. {
  503. // Check if Sending Player has sufficient amount.
  504. if(fromplayerid != -1 && fromstorageid != -1)
  505. {
  506. if(fromstorageid == 0)
  507. {
  508. if(PlayerInfo[fromplayerid][pDrugs][1] < amount)
  509. {
  510. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  511. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  512. return 0;
  513. }
  514. }
  515. else
  516. {
  517. if(StorageInfo[fromplayerid][fromstorageid-1][sPot] < amount)
  518. {
  519. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  520. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  521. return 0;
  522. }
  523. }
  524. if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][1] -= amount;
  525. else StorageInfo[fromplayerid][fromstorageid-1][sPot] -= amount;
  526. }
  527. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  528. PlayerInfo[playerid][pDrugs][1] += amount;
  529. format(string, sizeof(string), "%d Pot has been transfered to your Pocket (%d).", amount, PlayerInfo[playerid][pDrugs][1]);
  530. SendClientMessage(playerid, COLOR_WHITE, string);
  531. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  532. format(string, sizeof(string), "%d Pot has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  533. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  534. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  535. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  536. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  537. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  538. {
  539. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), GetPlayerIpEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid));
  540. Log("logs/adminpay.log", string);
  541. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  542. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  543. ABroadCast(COLOR_YELLOW, string, 4);
  544. }
  545. else
  546. {
  547. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), GetPlayerIpEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid));
  548. Log("logs/pay.log", string);
  549. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerIpEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerIpEx(playerid));
  550. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  551. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  552. }
  553. }
  554. return 1;
  555. }
  556. if(itemid == 3 && (PlayerInfo[playerid][pDrugs][2] + amount <= onhandlimit[itemid-1]))
  557. {
  558. // Check if Sending Player has sufficient amount.
  559. if(fromplayerid != -1 && fromstorageid != -1)
  560. {
  561. if(fromstorageid == 0)
  562. {
  563. if(PlayerInfo[fromplayerid][pDrugs][2] < amount)
  564. {
  565. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  566. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  567. return 0;
  568. }
  569. }
  570. else
  571. {
  572. if(StorageInfo[fromplayerid][fromstorageid-1][sCrack] < amount)
  573. {
  574. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  575. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  576. return 0;
  577. }
  578. }
  579. if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][2] -= amount;
  580. else StorageInfo[fromplayerid][fromstorageid-1][sCrack] -= amount;
  581. }
  582. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  583. PlayerInfo[playerid][pDrugs][2] += amount;
  584. format(string, sizeof(string), "%d Crack has been transfered to your Pocket (%d).", amount, PlayerInfo[playerid][pDrugs][2]);
  585. SendClientMessage(playerid, COLOR_WHITE, string);
  586. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  587. format(string, sizeof(string), "%d Crack has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  588. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  589. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  590. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  591. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  592. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  593. {
  594. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), GetPlayerIpEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid));
  595. Log("logs/adminpay.log", string);
  596. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  597. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  598. ABroadCast(COLOR_YELLOW, string, 4);
  599. }
  600. else
  601. {
  602. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), GetPlayerIpEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid));
  603. Log("logs/pay.log", string);
  604. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerIpEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerIpEx(playerid));
  605. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  606. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  607. }
  608. }
  609. return 1;
  610. }
  611. if(itemid == 4 && (PlayerInfo[playerid][pMats] + amount <= onhandlimit[itemid-1]))
  612. {
  613. // Check if Sending Player has sufficient amount.
  614. if(fromplayerid != -1 && fromstorageid != -1)
  615. {
  616. if(fromstorageid == 0)
  617. {
  618. if(PlayerInfo[fromplayerid][pMats] < amount)
  619. {
  620. format(string, sizeof(string), "You do not have sufficient amount to give %d %s.", amount, itemtype[itemid]);
  621. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  622. return 0;
  623. }
  624. }
  625. else
  626. {
  627. if(StorageInfo[fromplayerid][fromstorageid-1][sMats] < amount)
  628. {
  629. format(string, sizeof(string), "You do not have sufficient amount to give %d %s.", amount, itemtype[itemid]);
  630. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  631. return 0;
  632. }
  633. }
  634. if(fromstorageid == 0) PlayerInfo[fromplayerid][pMats] -= amount;
  635. else StorageInfo[fromplayerid][fromstorageid-1][sMats] -= amount;
  636. }
  637. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  638. PlayerInfo[playerid][pMats] += amount;
  639. //format(string, sizeof(string), "%d Materials has been transfered to your Pocket (%d/%d).", amount, PlayerInfo[playerid][pMats], onhandlimit[itemid-1]);
  640. format(string, sizeof(string), "%s Materials has been transfered to your Pocket (%s).", number_format(amount), number_format(PlayerInfo[playerid][pMats]));
  641. SendClientMessage(playerid, COLOR_WHITE, string);
  642. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  643. format(string, sizeof(string), "%d Materials has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  644. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  645. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  646. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  647. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  648. new ipplayerid[16], ipfromplayerid[16];
  649. GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
  650. GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
  651. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  652. {
  653. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  654. Log("logs/adminpay.log", string);
  655. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  656. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  657. ABroadCast(COLOR_YELLOW, string, 4);
  658. }
  659. else
  660. {
  661. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  662. Log("logs/pay.log", string);
  663. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), ipplayerid);
  664. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  665. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  666. }
  667. }
  668. return 1;
  669. }
  670. /*if(itemid == 4)
  671. {
  672. SendClientMessageEx(playerid, COLOR_WHITE, "You need at least a Bag to be able to store Materials.");
  673. return 0;
  674. }*/
  675. if(itemid == 1) format(string, sizeof(string), "Unable to transfer $%d to %s ($%d).", amount, storagetype[storageid], PlayerInfo[playerid][pCash]);
  676. else if(itemid == 2) format(string, sizeof(string), "Unable to transfer %d %s to %s (%d/%d).", amount, itemtype[itemid], storagetype[storageid], PlayerInfo[playerid][pDrugs][1], onhandlimit[itemid-1]);
  677. else if(itemid == 3) format(string, sizeof(string), "Unable to transfer %d %s to %s (%d/%d).", amount, itemtype[itemid], storagetype[storageid], PlayerInfo[playerid][pDrugs][2], onhandlimit[itemid-1]);
  678. else if(itemid == 4) format(string, sizeof(string), "Unable to transfer %d %s to %s (%d/%d).", amount, itemtype[itemid], storagetype[storageid], PlayerInfo[playerid][pMats], onhandlimit[itemid-1]);
  679. SendClientMessageEx(playerid, COLOR_WHITE, string);
  680. }
  681. case 1: // Bag
  682. {
  683. if(StorageInfo[playerid][0][sStorage] == 0)
  684. {
  685. SendClientMessageEx(playerid, COLOR_WHITE, "You do not own a Bag. You may purchase one at a 24/7 store.");
  686. return 0;
  687. }
  688. if(itemid == 1 && (StorageInfo[playerid][0][sCash] + amount <= bbackpacklimit[itemid-1]))
  689. {
  690. // Check if Sending Player has sufficient amount.
  691. if(fromplayerid != -1 && fromstorageid != -1)
  692. {
  693. if(fromstorageid == 0)
  694. {
  695. if(PlayerInfo[fromplayerid][pCash] < amount)
  696. {
  697. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  698. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  699. return 0;
  700. }
  701. }
  702. else
  703. {
  704. if(StorageInfo[fromplayerid][fromstorageid-1][sCash] < amount)
  705. {
  706. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  707. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  708. return 0;
  709. }
  710. }
  711. if(fromstorageid == 0) PlayerInfo[fromplayerid][pCash] -= amount;
  712. else StorageInfo[fromplayerid][fromstorageid-1][sCash] -= amount;
  713. }
  714. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  715. StorageInfo[playerid][0][sCash] += amount;
  716. format(string, sizeof(string), "$%d has been transfered to your Bag ($%d/$%d).", amount, StorageInfo[playerid][0][sCash], bbackpacklimit[itemid-1]);
  717. SendClientMessage(playerid, COLOR_WHITE, string);
  718. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  719. format(string, sizeof(string), "$%d has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  720. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  721. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  722. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  723. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  724. new ipplayerid[16], ipfromplayerid[16];
  725. GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
  726. GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
  727. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  728. {
  729. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  730. Log("logs/adminpay.log", string);
  731. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  732. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  733. ABroadCast(COLOR_YELLOW, string, 4);
  734. }
  735. else
  736. {
  737. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  738. Log("logs/pay.log", string);
  739. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), ipplayerid);
  740. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  741. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  742. }
  743. }
  744. return 1;
  745. }
  746. if(itemid == 2 && (StorageInfo[playerid][0][sPot] + amount <= bbackpacklimit[itemid-1]))
  747. {
  748. // Check if Sending Player has sufficient amount.
  749. if(fromplayerid != -1 && fromstorageid != -1)
  750. {
  751. if(fromstorageid == 0)
  752. {
  753. if(PlayerInfo[fromplayerid][pDrugs][1] < amount)
  754. {
  755. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  756. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  757. return 0;
  758. }
  759. }
  760. else
  761. {
  762. if(StorageInfo[fromplayerid][fromstorageid-1][sPot] < amount)
  763. {
  764. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  765. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  766. return 0;
  767. }
  768. }
  769. if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][1] -= amount;
  770. else StorageInfo[fromplayerid][fromstorageid-1][sPot] -= amount;
  771. }
  772. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  773. StorageInfo[playerid][0][sPot] += amount;
  774. format(string, sizeof(string), "%d Pot has been transfered to your Bag (%d/%d).", amount, StorageInfo[playerid][0][sPot], bbackpacklimit[itemid-1]);
  775. SendClientMessage(playerid, COLOR_WHITE, string);
  776. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  777. format(string, sizeof(string), "%d Pot has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  778. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  779. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  780. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  781. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  782. new ipplayerid[16], ipfromplayerid[16];
  783. GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
  784. GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
  785. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  786. {
  787. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  788. Log("logs/adminpay.log", string);
  789. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  790. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  791. ABroadCast(COLOR_YELLOW, string, 4);
  792. }
  793. else
  794. {
  795. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  796. Log("logs/pay.log", string);
  797. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), ipplayerid);
  798. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  799. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  800. }
  801. }
  802. return 1;
  803. }
  804. if(itemid == 3 && (StorageInfo[playerid][0][sCrack] + amount <= bbackpacklimit[itemid-1]))
  805. {
  806. // Check if Sending Player has sufficient amount.
  807. if(fromplayerid != -1 && fromstorageid != -1)
  808. {
  809. if(fromstorageid == 0)
  810. {
  811. if(PlayerInfo[fromplayerid][pDrugs][2] < amount)
  812. {
  813. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  814. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  815. return 0;
  816. }
  817. }
  818. else
  819. {
  820. if(StorageInfo[fromplayerid][fromstorageid-1][sCrack] < amount)
  821. {
  822. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  823. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  824. return 0;
  825. }
  826. }
  827. if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][2] -= amount;
  828. else StorageInfo[fromplayerid][fromstorageid-1][sCrack] -= amount;
  829. }
  830. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  831. StorageInfo[playerid][0][sCrack] += amount;
  832. format(string, sizeof(string), "%d Crack has been transfered to your Bag (%d/%d).", amount, StorageInfo[playerid][0][sCrack], bbackpacklimit[itemid-1]);
  833. SendClientMessage(playerid, COLOR_WHITE, string);
  834. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  835. format(string, sizeof(string), "%d Crack has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  836. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  837. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  838. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  839. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  840. new ipplayerid[16], ipfromplayerid[16];
  841. GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
  842. GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
  843. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  844. {
  845. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  846. Log("logs/adminpay.log", string);
  847. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  848. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  849. ABroadCast(COLOR_YELLOW, string, 4);
  850. }
  851. else
  852. {
  853. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  854. Log("logs/pay.log", string);
  855. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), ipplayerid);
  856. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  857. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  858. }
  859. }
  860. return 1;
  861. }
  862. if(itemid == 4 && (StorageInfo[playerid][0][sMats] + amount <= bbackpacklimit[itemid-1]))
  863. {
  864. // Check if Sending Player has sufficient amount.
  865. if(fromplayerid != -1 && fromstorageid != -1)
  866. {
  867. if(fromstorageid == 0)
  868. {
  869. if(PlayerInfo[fromplayerid][pMats] < amount)
  870. {
  871. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  872. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  873. return 0;
  874. }
  875. }
  876. else
  877. {
  878. if(StorageInfo[fromplayerid][fromstorageid-1][sMats] < amount)
  879. {
  880. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  881. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  882. return 0;
  883. }
  884. }
  885. if(fromstorageid == 0) PlayerInfo[fromplayerid][pMats] -= amount;
  886. else StorageInfo[fromplayerid][fromstorageid-1][sMats] -= amount;
  887. }
  888. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  889. StorageInfo[playerid][0][sMats] += amount;
  890. format(string, sizeof(string), "%d Materials has been transfered to your Bag (%d/%d).", amount, StorageInfo[playerid][0][sMats], bbackpacklimit[itemid-1]);
  891. SendClientMessage(playerid, COLOR_WHITE, string);
  892. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  893. format(string, sizeof(string), "%d Materials has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  894. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  895. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  896. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  897. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  898. new ipplayerid[16], ipfromplayerid[16];
  899. GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
  900. GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
  901. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  902. {
  903. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  904. Log("logs/adminpay.log", string);
  905. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  906. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  907. ABroadCast(COLOR_YELLOW, string, 4);
  908. }
  909. else
  910. {
  911. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  912. Log("logs/pay.log", string);
  913. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), ipplayerid);
  914. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  915. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  916. }
  917. }
  918. return 1;
  919. }
  920. if(itemid == 1) format(string, sizeof(string), "Unable to transfer $%d to %s ($%d/$%d).", amount, storagetype[storageid], StorageInfo[playerid][0][sCash], bbackpacklimit[itemid-1]);
  921. else if(itemid == 2) format(string, sizeof(string), "Unable to transfer %d %s to %s (%d/%d).", amount, itemtype[itemid], storagetype[storageid], StorageInfo[playerid][0][sPot], bbackpacklimit[itemid-1]);
  922. else if(itemid == 3) format(string, sizeof(string), "Unable to transfer %d %s to %s (%d/%d).", amount, itemtype[itemid], storagetype[storageid], StorageInfo[playerid][0][sCrack], bbackpacklimit[itemid-1]);
  923. else if(itemid == 4) format(string, sizeof(string), "Unable to transfer %d %s to %s (%d/%d).", amount, itemtype[itemid], storagetype[storageid], StorageInfo[playerid][0][sMats], bbackpacklimit[itemid-1]);
  924. SendClientMessageEx(playerid, COLOR_WHITE, string);
  925. }
  926. case 2: // Backpack
  927. {
  928. if(StorageInfo[playerid][1][sStorage] == 0)
  929. {
  930. SendClientMessageEx(playerid, COLOR_WHITE, "You do not own a Backpack. You may purchase one on our E-Store.");
  931. return 0;
  932. }
  933. if(itemid == 1 && (StorageInfo[playerid][1][sCash] + amount <= backpacklimit[itemid-1]))
  934. {
  935. // Check if Sending Player has sufficient amount.
  936. if(fromplayerid != -1 && fromstorageid != -1)
  937. {
  938. if(fromstorageid == 0)
  939. {
  940. if(PlayerInfo[fromplayerid][pCash] < amount)
  941. {
  942. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  943. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  944. return 0;
  945. }
  946. }
  947. else
  948. {
  949. if(StorageInfo[fromplayerid][fromstorageid-1][sCash] < amount)
  950. {
  951. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  952. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  953. return 0;
  954. }
  955. }
  956. if(fromstorageid == 0) PlayerInfo[fromplayerid][pCash] -= amount;
  957. else StorageInfo[fromplayerid][fromstorageid-1][sCash] -= amount;
  958. }
  959. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  960. StorageInfo[playerid][1][sCash] += amount;
  961. format(string, sizeof(string), "$%d has been transfered to your Backpack ($%d/$%d).", amount, StorageInfo[playerid][1][sCash], backpacklimit[itemid-1]);
  962. SendClientMessage(playerid, COLOR_WHITE, string);
  963. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  964. format(string, sizeof(string), "$%d has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  965. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  966. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  967. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  968. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  969. new ipplayerid[16], ipfromplayerid[16];
  970. GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
  971. GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
  972. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  973. {
  974. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  975. Log("logs/adminpay.log", string);
  976. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  977. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  978. ABroadCast(COLOR_YELLOW, string, 4);
  979. }
  980. else
  981. {
  982. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  983. Log("logs/pay.log", string);
  984. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), ipplayerid);
  985. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  986. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  987. }
  988. }
  989. return 1;
  990. }
  991. if(itemid == 2 && (StorageInfo[playerid][1][sPot] + amount <= backpacklimit[itemid-1]))
  992. {
  993. // Check if Sending Player has sufficient amount.
  994. if(fromplayerid != -1 && fromstorageid != -1)
  995. {
  996. if(fromstorageid == 0)
  997. {
  998. if(PlayerInfo[fromplayerid][pDrugs][1] < amount)
  999. {
  1000. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  1001. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  1002. return 0;
  1003. }
  1004. }
  1005. else
  1006. {
  1007. if(StorageInfo[fromplayerid][fromstorageid-1][sPot] < amount)
  1008. {
  1009. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  1010. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  1011. return 0;
  1012. }
  1013. }
  1014. if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][1] -= amount;
  1015. else StorageInfo[fromplayerid][fromstorageid-1][sPot] -= amount;
  1016. }
  1017. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  1018. StorageInfo[playerid][1][sPot] += amount;
  1019. format(string, sizeof(string), "%d Pot has been transfered to your Backpack (%d/%d).", amount, StorageInfo[playerid][1][sPot], backpacklimit[itemid-1]);
  1020. SendClientMessage(playerid, COLOR_WHITE, string);
  1021. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  1022. format(string, sizeof(string), "%d Pot has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  1023. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  1024. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  1025. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  1026. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1027. new ipplayerid[16], ipfromplayerid[16];
  1028. GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
  1029. GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
  1030. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  1031. {
  1032. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  1033. Log("logs/adminpay.log", string);
  1034. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  1035. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  1036. ABroadCast(COLOR_YELLOW, string, 4);
  1037. }
  1038. else
  1039. {
  1040. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  1041. Log("logs/pay.log", string);
  1042. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), ipplayerid);
  1043. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  1044. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  1045. }
  1046. }
  1047. return 1;
  1048. }
  1049. if(itemid == 3 && (StorageInfo[playerid][1][sCrack] + amount <= backpacklimit[itemid-1]))
  1050. {
  1051. // Check if Sending Player has sufficient amount.
  1052. if(fromplayerid != -1 && fromstorageid != -1)
  1053. {
  1054. if(fromstorageid == 0)
  1055. {
  1056. if(PlayerInfo[fromplayerid][pDrugs][2] < amount)
  1057. {
  1058. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  1059. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  1060. return 0;
  1061. }
  1062. }
  1063. else
  1064. {
  1065. if(StorageInfo[fromplayerid][fromstorageid-1][sCrack] < amount)
  1066. {
  1067. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  1068. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  1069. return 0;
  1070. }
  1071. }
  1072. if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][2] -= amount;
  1073. else StorageInfo[fromplayerid][fromstorageid-1][sCrack] -= amount;
  1074. }
  1075. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  1076. StorageInfo[playerid][1][sCrack] += amount;
  1077. format(string, sizeof(string), "%d Crack has been transfered to your Backpack (%d/%d).", amount, StorageInfo[playerid][1][sCrack], backpacklimit[itemid-1]);
  1078. SendClientMessage(playerid, COLOR_WHITE, string);
  1079. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  1080. format(string, sizeof(string), "%d Crack has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  1081. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  1082. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  1083. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  1084. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1085. new ipplayerid[16], ipfromplayerid[16];
  1086. GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
  1087. GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
  1088. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  1089. {
  1090. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  1091. Log("logs/adminpay.log", string);
  1092. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  1093. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  1094. ABroadCast(COLOR_YELLOW, string, 4);
  1095. }
  1096. else
  1097. {
  1098. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  1099. Log("logs/pay.log", string);
  1100. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), ipplayerid);
  1101. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  1102. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  1103. }
  1104. }
  1105. return 1;
  1106. }
  1107. if(itemid == 4 && (StorageInfo[playerid][1][sMats] + amount <= backpacklimit[itemid-1]))
  1108. {
  1109. // Check if Sending Player has sufficient amount.
  1110. if(fromplayerid != -1 && fromstorageid != -1)
  1111. {
  1112. if(fromstorageid == 0)
  1113. {
  1114. if(PlayerInfo[fromplayerid][pMats] < amount)
  1115. {
  1116. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  1117. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  1118. return 0;
  1119. }
  1120. }
  1121. else
  1122. {
  1123. if(StorageInfo[fromplayerid][fromstorageid-1][sMats] < amount)
  1124. {
  1125. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  1126. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  1127. return 0;
  1128. }
  1129. }
  1130. if(fromstorageid == 0) PlayerInfo[fromplayerid][pMats] -= amount;
  1131. else StorageInfo[fromplayerid][fromstorageid-1][sMats] -= amount;
  1132. }
  1133. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  1134. StorageInfo[playerid][1][sMats] += amount;
  1135. format(string, sizeof(string), "%d Materials has been transfered to your Backpack (%d/%d).", amount, StorageInfo[playerid][1][sMats], backpacklimit[itemid-1]);
  1136. SendClientMessage(playerid, COLOR_WHITE, string);
  1137. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  1138. format(string, sizeof(string), "%d Materials has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  1139. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  1140. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  1141. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  1142. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1143. new ipplayerid[16], ipfromplayerid[16];
  1144. GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
  1145. GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
  1146. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  1147. {
  1148. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  1149. Log("logs/adminpay.log", string);
  1150. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  1151. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  1152. ABroadCast(COLOR_YELLOW, string, 4);
  1153. }
  1154. else
  1155. {
  1156. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  1157. Log("logs/pay.log", string);
  1158. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), ipplayerid);
  1159. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  1160. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  1161. }
  1162. }
  1163. return 1;
  1164. }
  1165. if(itemid == 1) format(string, sizeof(string), "Unable to transfer $%d to %s ($%d/$%d).", amount, storagetype[storageid], StorageInfo[playerid][1][sCash], backpacklimit[itemid-1]);
  1166. else if(itemid == 2) format(string, sizeof(string), "Unable to transfer %d %s to %s (%d/%d).", amount, itemtype[itemid], storagetype[storageid], StorageInfo[playerid][1][sPot], backpacklimit[itemid-1]);
  1167. else if(itemid == 3) format(string, sizeof(string), "Unable to transfer %d %s to %s (%d/%d).", amount, itemtype[itemid], storagetype[storageid], StorageInfo[playerid][1][sCrack], backpacklimit[itemid-1]);
  1168. else if(itemid == 4) format(string, sizeof(string), "Unable to transfer %d %s to %s (%d/%d).", amount, itemtype[itemid], storagetype[storageid], StorageInfo[playerid][1][sMats], backpacklimit[itemid-1]);
  1169. SendClientMessageEx(playerid, COLOR_WHITE, string);
  1170. }
  1171. case 3: // Briefcase
  1172. {
  1173. if(StorageInfo[playerid][2][sStorage] == 0)
  1174. {
  1175. SendClientMessageEx(playerid, COLOR_WHITE, "You do not own a Briefcase. You may purchase one on our E-Store.");
  1176. return 0;
  1177. }
  1178. if(itemid == 1 && (StorageInfo[playerid][2][sCash] + amount <= briefcaselimit[itemid-1]))
  1179. {
  1180. // Check if Sending Player has sufficient amount.
  1181. if(fromplayerid != -1 && fromstorageid != -1)
  1182. {
  1183. if(fromstorageid == 0)
  1184. {
  1185. if(PlayerInfo[fromplayerid][pCash] < amount)
  1186. {
  1187. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  1188. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  1189. return 0;
  1190. }
  1191. }
  1192. else
  1193. {
  1194. if(StorageInfo[fromplayerid][fromstorageid-1][sCash] < amount)
  1195. {
  1196. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  1197. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  1198. return 0;
  1199. }
  1200. }
  1201. if(fromstorageid == 0) PlayerInfo[fromplayerid][pCash] -= amount;
  1202. else StorageInfo[fromplayerid][fromstorageid-1][sCash] -= amount;
  1203. }
  1204. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  1205. StorageInfo[playerid][2][sCash] += amount;
  1206. format(string, sizeof(string), "$%d has been transfered to your Briefcase ($%d/$%d).", amount, StorageInfo[playerid][2][sCash], briefcaselimit[itemid-1]);
  1207. SendClientMessage(playerid, COLOR_WHITE, string);
  1208. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  1209. format(string, sizeof(string), "$%d has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  1210. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  1211. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  1212. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  1213. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1214. new ipplayerid[16], ipfromplayerid[16];
  1215. GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
  1216. GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
  1217. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  1218. {
  1219. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  1220. Log("logs/adminpay.log", string);
  1221. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  1222. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  1223. ABroadCast(COLOR_YELLOW, string, 4);
  1224. }
  1225. else
  1226. {
  1227. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  1228. Log("logs/pay.log", string);
  1229. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), ipplayerid);
  1230. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  1231. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  1232. }
  1233. }
  1234. return 1;
  1235. }
  1236. if(itemid == 2 && (StorageInfo[playerid][2][sPot] + amount <= briefcaselimit[itemid-1]))
  1237. {
  1238. // Check if Sending Player has sufficient amount.
  1239. if(fromplayerid != -1 && fromstorageid != -1)
  1240. {
  1241. if(fromstorageid == 0)
  1242. {
  1243. if(PlayerInfo[fromplayerid][pDrugs][1] < amount)
  1244. {
  1245. format(string, sizeof(string), "You do not have sufficient amount to give %d %s.", amount, itemtype[itemid]);
  1246. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  1247. return 0;
  1248. }
  1249. }
  1250. else
  1251. {
  1252. if(StorageInfo[fromplayerid][fromstorageid-1][sPot] < amount)
  1253. {
  1254. format(string, sizeof(string), "You do not have sufficient amount to give %d %s.", amount, itemtype[itemid]);
  1255. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  1256. return 0;
  1257. }
  1258. }
  1259. if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][1] -= amount;
  1260. else StorageInfo[fromplayerid][fromstorageid-1][sPot] -= amount;
  1261. }
  1262. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  1263. StorageInfo[playerid][2][sPot] += amount;
  1264. format(string, sizeof(string), "%d Pot has been transfered to your Briefcase (%d/%d).", amount, StorageInfo[playerid][2][sPot], briefcaselimit[itemid-1]);
  1265. SendClientMessage(playerid, COLOR_WHITE, string);
  1266. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  1267. format(string, sizeof(string), "%d Pot has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  1268. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  1269. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  1270. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  1271. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1272. new ipplayerid[16], ipfromplayerid[16];
  1273. GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
  1274. GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
  1275. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  1276. {
  1277. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  1278. Log("logs/adminpay.log", string);
  1279. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  1280. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  1281. ABroadCast(COLOR_YELLOW, string, 4);
  1282. }
  1283. else
  1284. {
  1285. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  1286. Log("logs/pay.log", string);
  1287. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), ipplayerid);
  1288. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  1289. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  1290. }
  1291. }
  1292. return 1;
  1293. }
  1294. if(itemid == 3 && (StorageInfo[playerid][2][sCrack] + amount <= briefcaselimit[itemid-1]))
  1295. {
  1296. // Check if Sending Player has sufficient amount.
  1297. if(fromplayerid != -1 && fromstorageid != -1)
  1298. {
  1299. if(fromstorageid == 0)
  1300. {
  1301. if(PlayerInfo[fromplayerid][pDrugs][2] < amount)
  1302. {
  1303. format(string, sizeof(string), "You do not have sufficient amount to give %d %s.", amount, itemtype[itemid]);
  1304. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  1305. return 0;
  1306. }
  1307. }
  1308. else
  1309. {
  1310. if(StorageInfo[fromplayerid][fromstorageid-1][sCrack] < amount)
  1311. {
  1312. format(string, sizeof(string), "You do not have sufficient amount to give %d %s.", amount, itemtype[itemid]);
  1313. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  1314. return 0;
  1315. }
  1316. }
  1317. if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][2] -= amount;
  1318. else StorageInfo[fromplayerid][fromstorageid-1][sCrack] -= amount;
  1319. }
  1320. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  1321. StorageInfo[playerid][2][sCrack] += amount;
  1322. format(string, sizeof(string), "%d Crack has been transfered to your Briefcase. (%d/%d)", amount, StorageInfo[playerid][2][sCrack], briefcaselimit[itemid-1]);
  1323. SendClientMessage(playerid, COLOR_WHITE, string);
  1324. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  1325. format(string, sizeof(string), "%d Crack has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  1326. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  1327. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  1328. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  1329. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1330. new ipplayerid[16], ipfromplayerid[16];
  1331. GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
  1332. GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
  1333. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  1334. {
  1335. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  1336. Log("logs/adminpay.log", string);
  1337. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  1338. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  1339. ABroadCast(COLOR_YELLOW, string, 4);
  1340. }
  1341. else
  1342. {
  1343. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  1344. Log("logs/pay.log", string);
  1345. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), ipplayerid);
  1346. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  1347. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  1348. }
  1349. }
  1350. return 1;
  1351. }
  1352. if(itemid == 4 && (StorageInfo[playerid][2][sMats] + amount <= briefcaselimit[itemid-1]))
  1353. {
  1354. // Check if Sending Player has sufficient amount.
  1355. if(fromplayerid != -1 && fromstorageid != -1)
  1356. {
  1357. if(fromstorageid == 0)
  1358. {
  1359. if(PlayerInfo[fromplayerid][pMats] < amount)
  1360. {
  1361. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  1362. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  1363. return 0;
  1364. }
  1365. }
  1366. else
  1367. {
  1368. if(StorageInfo[fromplayerid][fromstorageid-1][sMats] < amount)
  1369. {
  1370. format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
  1371. SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
  1372. return 0;
  1373. }
  1374. }
  1375. if(fromstorageid == 0) PlayerInfo[fromplayerid][pMats] -= amount;
  1376. else StorageInfo[fromplayerid][fromstorageid-1][sMats] -= amount;
  1377. }
  1378. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  1379. StorageInfo[playerid][2][sMats] += amount;
  1380. format(string, sizeof(string), "%d Materials has been transfered to your Briefcase (%d/%d).", amount, StorageInfo[playerid][2][sMats], briefcaselimit[itemid-1]);
  1381. SendClientMessage(playerid, COLOR_WHITE, string);
  1382. if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
  1383. format(string, sizeof(string), "%d Materials has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
  1384. SendClientMessage(fromplayerid, COLOR_WHITE, string);
  1385. PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
  1386. format(string, sizeof(string), "* %s takes out some %s from their %s, and hands it to %s.", GetPlayerNameEx(fromplayerid), itemtype[itemid], storagetype[fromstorageid], GetPlayerNameEx(playerid));
  1387. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1388. new ipplayerid[16], ipfromplayerid[16];
  1389. GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
  1390. GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
  1391. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
  1392. {
  1393. format(string, sizeof(string), "[Admin] %s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  1394. Log("logs/adminpay.log", string);
  1395. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
  1396. if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
  1397. ABroadCast(COLOR_YELLOW, string, 4);
  1398. }
  1399. else
  1400. {
  1401. format(string, sizeof(string), "%s(%d) (IP:%s) has given %s %s to %s(%d) (IP:%s)", GetPlayerNameEx(fromplayerid), GetPlayerSQLId(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ipplayerid);
  1402. Log("logs/pay.log", string);
  1403. format(string, sizeof(string), "%s (IP:%s) has given %s %s to %s (IP:%s)", GetPlayerNameEx(fromplayerid), ipfromplayerid, number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid), ipplayerid);
  1404. if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
  1405. if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
  1406. }
  1407. }
  1408. return 1;
  1409. }
  1410. if(itemid == 1) format(string, sizeof(string), "Unable to transfer $%d to %s ($%d/$%d).", amount, storagetype[storageid], StorageInfo[playerid][2][sCash], briefcaselimit[itemid-1]);
  1411. else if(itemid == 2) format(string, sizeof(string), "Unable to transfer %d %s to %s (%d/%d).", amount, itemtype[itemid], storagetype[storageid], StorageInfo[playerid][2][sPot], briefcaselimit[itemid-1]);
  1412. else if(itemid == 3) format(string, sizeof(string), "Unable to transfer %d %s to %s (%d/%d).", amount, itemtype[itemid], storagetype[storageid], StorageInfo[playerid][2][sCrack], briefcaselimit[itemid-1]);
  1413. else if(itemid == 4) format(string, sizeof(string), "Unable to transfer %d %s to %s (%d/%d).", amount, itemtype[itemid], storagetype[storageid], StorageInfo[playerid][2][sMats], briefcaselimit[itemid-1]);
  1414. SendClientMessageEx(playerid, COLOR_WHITE, string);
  1415. }
  1416. }
  1417. return 0;
  1418. }
  1419. stock ShowInventory(playerid,targetid)
  1420. {
  1421. if(IsPlayerConnected(targetid))
  1422. {
  1423. new resultline[1024], header[64], pnumber[20], toolboxstring[30];
  1424. if(PlayerInfo[targetid][pPnumber] == 0) pnumber = "None"; else format(pnumber, sizeof(pnumber), "%d", PlayerInfo[targetid][pPnumber]);
  1425. new totalwealth;
  1426. totalwealth = PlayerInfo[targetid][pAccount] + GetPlayerCash(targetid);
  1427. if(PlayerInfo[targetid][pPhousekey] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[targetid][pPhousekey]][hOwnerID] == GetPlayerSQLId(targetid)) totalwealth += HouseInfo[PlayerInfo[targetid][pPhousekey]][hSafeMoney];
  1428. if(PlayerInfo[targetid][pPhousekey2] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[targetid][pPhousekey2]][hOwnerID] == GetPlayerSQLId(targetid)) totalwealth += HouseInfo[PlayerInfo[targetid][pPhousekey2]][hSafeMoney];
  1429. if(PlayerInfo[targetid][pPhousekey3] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[targetid][pPhousekey3]][hOwnerID] == GetPlayerSQLId(targetid)) totalwealth += HouseInfo[PlayerInfo[targetid][pPhousekey3]][hSafeMoney];
  1430. if(PlayerInfo[targetid][pToolBox] >= 1) format(toolboxstring, 50, "Tool Box: 1, (Usages: %s)", number_format(PlayerInfo[targetid][pToolBox]));
  1431. else format(toolboxstring, 50, "Tool Box: 0");
  1432. SetPVarInt(playerid, "ShowInventory", targetid);
  1433. format(header, sizeof(header), "%s's Inventory", GetPlayerNameEx(targetid));
  1434. format(resultline, sizeof(resultline),"{FFFFFF}Total Wealth: $%s\n\
  1435. Cash: $%s\n\
  1436. Bank: $%s\n\
  1437. Phone Number: %s\n\
  1438. Radio Frequency: %dkhz\n\
  1439. Materials: %s\n\
  1440. Rope: %s\n\
  1441. Rags: %s\n\
  1442. Screwdrivers: %s\n\
  1443. Tires: %s\n\
  1444. Paper: %s\n\
  1445. Cigars: %s\n\
  1446. Sprunk Cans: %s\n\
  1447. Spraycans: %s\n\
  1448. %s\n\
  1449. Crowbar: %d",
  1450. number_format(totalwealth),
  1451. number_format(GetPlayerCash(targetid)),
  1452. number_format(PlayerInfo[targetid][pAccount]),
  1453. pnumber,
  1454. PlayerInfo[targetid][pRadioFreq],
  1455. number_format(PlayerInfo[targetid][pMats]),
  1456. number_format(PlayerInfo[targetid][pRope]),
  1457. number_format(PlayerInfo[targetid][pRags]),
  1458. number_format(PlayerInfo[targetid][pScrewdriver]),
  1459. number_format(PlayerInfo[targetid][pTire]),
  1460. number_format(PlayerInfo[targetid][pPaper]),
  1461. number_format(PlayerInfo[targetid][pCigar]),
  1462. number_format(PlayerInfo[targetid][pSprunk]),
  1463. number_format(PlayerInfo[targetid][pSpraycan]),
  1464. toolboxstring,
  1465. PlayerInfo[targetid][pCrowBar]);
  1466. ShowPlayerDialogEx(playerid, DISPLAY_INV, DIALOG_STYLE_MSGBOX, header, resultline, "Next Page", "Close");
  1467. }
  1468. return 1;
  1469. }
  1470. stock FindGunInVehicleForPlayer(ownerid, slot, playerid)
  1471. {
  1472. new
  1473. i = 0;
  1474. while (i < (PlayerVehicleInfo[ownerid][slot][pvWepUpgrade] + 1) && (!PlayerVehicleInfo[ownerid][slot][pvWeapons][i] || PlayerInfo[playerid][pGuns][GetWeaponSlot(PlayerVehicleInfo[ownerid][slot][pvWeapons][i])] == PlayerVehicleInfo[ownerid][slot][pvWeapons][i]))
  1475. {
  1476. i++;
  1477. }
  1478. if (i == (PlayerVehicleInfo[ownerid][slot][pvWepUpgrade] + 1)) return -1;
  1479. return i;
  1480. }
  1481. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  1482. if(arrAntiCheat[playerid][ac_iFlags][AC_DIALOGSPOOFING] > 0) return 1;
  1483. szMiscArray[0] = 0;
  1484. switch(dialogid)
  1485. {
  1486. case DISPLAY_INV:
  1487. {
  1488. new targetid = GetPVarInt(playerid, "ShowInventory");
  1489. if(IsPlayerConnected(targetid))
  1490. {
  1491. if(response)
  1492. {
  1493. new resultline[1024], header[64];
  1494. format(header, sizeof(header), "%s's Inventory", GetPlayerNameEx(targetid));
  1495. format(resultline, sizeof(resultline),"{FFFFFF}Locks: %d\n\
  1496. First Aid Kit: %d\n\
  1497. Receivers: %d\n\
  1498. GPS: %d\n\
  1499. Bug Sweeps: %d\n\
  1500. Fireworks: %d\n\
  1501. Boomboxes: %d\n\
  1502. Mailboxes: %d\n\
  1503. Rim Kits: %d\n\
  1504. Checks: %s\n\
  1505. Additional Vehicle Slots: %s\n\
  1506. Additional Toy Slots: %s",
  1507. PlayerInfo[targetid][pLock],
  1508. PlayerInfo[targetid][pFirstaid],
  1509. PlayerInfo[targetid][pReceiver],
  1510. PlayerInfo[targetid][pGPS],
  1511. PlayerInfo[targetid][pSweep],
  1512. PlayerInfo[targetid][pFirework],
  1513. PlayerInfo[targetid][pBoombox],
  1514. PlayerInfo[targetid][pMailbox],
  1515. PlayerInfo[targetid][pRimMod],
  1516. number_format(PlayerInfo[targetid][pChecks]),
  1517. number_format(PlayerInfo[targetid][pVehicleSlot]),
  1518. number_format(PlayerInfo[targetid][pToySlot]));
  1519. if(zombieevent) format(resultline, sizeof(resultline), "%s\nCure Vials: %d\nScrap Metal: %d\nAntibiotic Injections: %d\n.50 Cals: %d\nSurvivor Kits: %d\nFuel Can: %d%% Fuel", resultline, PlayerInfo[targetid][pVials], PlayerInfo[targetid][mInventory][16], PlayerInfo[targetid][mInventory][17], PlayerInfo[targetid][mPurchaseCount][18], PlayerInfo[targetid][mInventory][19], PlayerInfo[targetid][zFuelCan]);
  1520. ShowPlayerDialogEx(playerid, DISPLAY_INV2, DIALOG_STYLE_MSGBOX, header, resultline, "First Page", "Close");
  1521. }
  1522. else DeletePVar(playerid, "ShowInventory");
  1523. }
  1524. else
  1525. {
  1526. SendClientMessageEx(playerid, COLOR_GRAD1, "The player you were checking has logged out.");
  1527. DeletePVar(playerid, "ShowInventory");
  1528. return 1;
  1529. }
  1530. }
  1531. case DISPLAY_INV2:
  1532. {
  1533. new targetid = GetPVarInt(playerid, "ShowInventory");
  1534. if(IsPlayerConnected(targetid))
  1535. {
  1536. if(response)
  1537. {
  1538. ShowInventory(playerid, targetid);
  1539. }
  1540. else DeletePVar(playerid, "ShowInventory");
  1541. }
  1542. else
  1543. {
  1544. SendClientMessageEx(playerid, COLOR_GRAD1, "The player you were checking has logged out.");
  1545. DeletePVar(playerid, "ShowInventory");
  1546. return 1;
  1547. }
  1548. }
  1549. }
  1550. return 0;
  1551. }
  1552. /*CMD:storagehelp(playerid, params[])
  1553. {
  1554. SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
  1555. SendClientMessageEx(playerid, COLOR_WHITE,"*** HELP *** - type a command for more infomation.");
  1556. SendClientMessageEx(playerid, COLOR_GRAD3,"*** STORAGE *** /(vs)viewstorage /(es)equipstorage /personalwithdraw /personaldeposit /storagegive");
  1557. SendClientMessageEx(playerid, COLOR_GRAD3,"*** STORAGE *** /transferstorage");
  1558. return 1;
  1559. }*/
  1560. CMD:inv(playerid, params[]) {
  1561. return cmd_inventory(playerid, params);
  1562. }
  1563. CMD:inventory(playerid, params[])
  1564. {
  1565. if(gPlayerLogged{playerid} != 0) ShowInventory(playerid, playerid);
  1566. return 1;
  1567. }
  1568. CMD:mytokens(playerid, params[])
  1569. {
  1570. szMiscArray[0] = 0;
  1571. SendClientMessage(playerid, COLOR_GREY, "------------------------------------------------------------------------------------------------");
  1572. format(szMiscArray, sizeof(szMiscArray), "VIP Tokens: %s, Paintball Tokens: %s, EXP Tokens: %s (Hours: %s), Event Tokens: %s, Gold Giftbox: %s",
  1573. number_format(PlayerInfo[playerid][pTokens]),
  1574. number_format(PlayerInfo[playerid][pPaintTokens]),
  1575. number_format(PlayerInfo[playerid][pEXPToken]),
  1576. number_format(PlayerInfo[playerid][pDoubleEXP]),
  1577. number_format(PlayerInfo[playerid][pEventTokens]),
  1578. number_format(PlayerInfo[playerid][pGoldBoxTokens]));
  1579. SendClientMessage(playerid, COLOR_WHITE, szMiscArray);
  1580. SendClientMessage(playerid, COLOR_GREY, "------------------------------------------------------------------------------------------------");
  1581. return 1;
  1582. }
  1583. CMD:trunkput(playerid, params[])
  1584. {
  1585. if(GetPVarType(playerid, "IsInArena"))
  1586. {
  1587. SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in an arena!");
  1588. return 1;
  1589. }
  1590. if(GetPVarInt( playerid, "EventToken") != 0)
  1591. {
  1592. SendClientMessageEx(playerid, COLOR_GREY, "You can't use this while you're in an event.");
  1593. return 1;
  1594. }
  1595. if(IsPlayerInAnyVehicle(playerid)) { SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being inside the vehicle!"); return 1; }
  1596. if(GetPVarInt(playerid, "EMSAttempt") != 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't use this command!");
  1597. new string[128], weaponchoice[32], slot;
  1598. if(sscanf(params, "s[32]D(0)", weaponchoice, slot)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /trunkput [weapon] [slot]");
  1599. new pvid = -1, Float: x, Float: y, Float: z;
  1600. for(new d = 0 ; d < MAX_PLAYERVEHICLES; d++)
  1601. {
  1602. if(PlayerVehicleInfo[playerid][d][pvId] != INVALID_PLAYER_VEHICLE_ID) GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], x, y, z);
  1603. if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z))
  1604. {
  1605. pvid = d;
  1606. break;
  1607. }
  1608. }
  1609. if(pvid == -1) return SendClientMessageEx(playerid,COLOR_GREY,"You are not near any vehicle that you own.");
  1610. new engine,lights,alarm,doors,bonnet,boot,objective;
  1611. GetVehicleParamsEx(PlayerVehicleInfo[playerid][pvid][pvId],engine,lights,alarm,doors,bonnet,boot,objective);
  1612. if(boot == VEHICLE_PARAMS_OFF || boot == VEHICLE_PARAMS_UNSET) return SendClientMessageEx(playerid, COLOR_GRAD3, "You can't take/put stuff inside the trunk if it's closed!(/car trunk to open it)");
  1613. if(GetVehicleModel(PlayerVehicleInfo[playerid][pvid][pvId]) == 481 || GetVehicleModel(PlayerVehicleInfo[playerid][pvid][pvId]) == 510) return SendClientMessageEx(playerid,COLOR_GREY,"That vehicle doesn't have a trunk.");
  1614. new Float: Health;
  1615. GetHealth(playerid, Health);
  1616. if(Health < 80.0) return SendClientMessageEx(playerid,COLOR_GREY,"You cannot store weapons or drugs in a car when your health lower than 80.");
  1617. if (GetPVarInt(playerid, "GiveWeaponTimer") > 0)
  1618. {
  1619. format(string, sizeof(string), " You must wait %d seconds before depositing another weapon.", GetPVarInt(playerid, "GiveWeaponTimer"));
  1620. SendClientMessageEx(playerid,COLOR_GREY,string);
  1621. return 1;
  1622. }
  1623. new maxslots = PlayerVehicleInfo[playerid][pvid][pvWepUpgrade]+1;
  1624. if(slot > maxslots || slot < 1)
  1625. {
  1626. SendClientMessageEx(playerid, COLOR_GREY, "Invalid slot.");
  1627. return 1;
  1628. }
  1629. if( PlayerVehicleInfo[playerid][pvid][pvWeapons][slot-1] != 0)
  1630. {
  1631. SendClientMessageEx(playerid, COLOR_GREY, "You have a weapon stored in that slot already.");
  1632. return 1;
  1633. }
  1634. new weapon;
  1635. if(strcmp(weaponchoice, "sdpistol", true, strlen(weaponchoice)) == 0)
  1636. {
  1637. if(pTazer{playerid} == 1) return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot store a tazer!");
  1638. if( PlayerInfo[playerid][pGuns][2] == 23 && PlayerInfo[playerid][pAGuns][2] == 0 )
  1639. {
  1640. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a silenced pistol into your car gun locker.");
  1641. weapon = PlayerInfo[playerid][pGuns][2];
  1642. format(string,sizeof(string), "* %s deposited their silenced pistol in their car safe.", GetPlayerNameEx(playerid));
  1643. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1644. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1645. }
  1646. }
  1647. else if(strcmp(weaponchoice, "9mm", true, strlen(weaponchoice)) == 0)
  1648. {
  1649. if( PlayerInfo[playerid][pGuns][2] == 22 && PlayerInfo[playerid][pAGuns][2] == 0 )
  1650. {
  1651. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a 9mm in your car gun locker.");
  1652. weapon = PlayerInfo[playerid][pGuns][2];
  1653. format(string,sizeof(string), "* %s deposited their 9mm in their car safe.", GetPlayerNameEx(playerid));
  1654. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1655. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1656. }
  1657. }
  1658. else if(strcmp(weaponchoice, "deagle", true, strlen(weaponchoice)) == 0)
  1659. {
  1660. if( PlayerInfo[playerid][pGuns][2] == 24 && PlayerInfo[playerid][pAGuns][2] == 0 )
  1661. {
  1662. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a Desert Eagle in your car gun locker.");
  1663. weapon = PlayerInfo[playerid][pGuns][2];
  1664. format(string,sizeof(string), "* %s deposited their Desert Eagle in their car safe.", GetPlayerNameEx(playerid));
  1665. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1666. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1667. }
  1668. }
  1669. else if(strcmp(weaponchoice, "shotgun", true, strlen(weaponchoice)) == 0)
  1670. {
  1671. if( PlayerInfo[playerid][pGuns][3] == 25 && PlayerInfo[playerid][pAGuns][3] == 0 )
  1672. {
  1673. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a shotgun in your car gun locker.");
  1674. weapon = PlayerInfo[playerid][pGuns][3];
  1675. format(string,sizeof(string), "* %s deposited their Shotgun in their car safe.", GetPlayerNameEx(playerid));
  1676. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1677. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1678. }
  1679. }
  1680. else if(strcmp(weaponchoice, "spas12", true, strlen(weaponchoice)) == 0)
  1681. {
  1682. if( PlayerInfo[playerid][pGuns][3] == 27 && PlayerInfo[playerid][pAGuns][3] == 0 )
  1683. {
  1684. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a combat shotgun in your car gun locker.");
  1685. weapon = PlayerInfo[playerid][pGuns][3];
  1686. format(string,sizeof(string), "* %s deposited their Combat Shotgun in their car safe.", GetPlayerNameEx(playerid));
  1687. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1688. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1689. }
  1690. }
  1691. else if(strcmp(weaponchoice, "mp5", true, strlen(weaponchoice)) == 0)
  1692. {
  1693. if( PlayerInfo[playerid][pGuns][4] == 29 && PlayerInfo[playerid][pAGuns][4] == 0 )
  1694. {
  1695. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an MP5 in your car gun locker.");
  1696. weapon = PlayerInfo[playerid][pGuns][4];
  1697. format(string,sizeof(string), "* %s deposited their MP5 in their car safe.", GetPlayerNameEx(playerid));
  1698. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1699. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1700. }
  1701. }
  1702. else if(strcmp(weaponchoice, "tec9", true, strlen(weaponchoice)) == 0)
  1703. {
  1704. if( PlayerInfo[playerid][pGuns][4] == 32 && PlayerInfo[playerid][pAGuns][4] == 0 )
  1705. {
  1706. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a TEC9 in your car gun locker.");
  1707. weapon = PlayerInfo[playerid][pGuns][4];
  1708. format(string,sizeof(string), "* %s deposited their TEC9 in their car safe.", GetPlayerNameEx(playerid));
  1709. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1710. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1711. }
  1712. }
  1713. else if(strcmp(weaponchoice, "ak47", true, strlen(weaponchoice)) == 0)
  1714. {
  1715. if( PlayerInfo[playerid][pGuns][5] == 30 && PlayerInfo[playerid][pAGuns][5] == 0 )
  1716. {
  1717. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an AK-47 in your car gun locker.");
  1718. weapon = PlayerInfo[playerid][pGuns][5];
  1719. format(string,sizeof(string), "* %s deposited their AK-47 in their car safe.", GetPlayerNameEx(playerid));
  1720. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1721. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1722. }
  1723. }
  1724. else if(strcmp(weaponchoice, "m4", true, strlen(weaponchoice)) == 0)
  1725. {
  1726. if( PlayerInfo[playerid][pGuns][5] == 31 && PlayerInfo[playerid][pAGuns][5] == 0 )
  1727. {
  1728. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an M4 in your car gun locker.");
  1729. weapon = PlayerInfo[playerid][pGuns][5];
  1730. format(string,sizeof(string), "* %s deposited their M4 in their car safe.", GetPlayerNameEx(playerid));
  1731. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1732. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1733. }
  1734. }
  1735. else if(strcmp(weaponchoice, "rifle", true, strlen(weaponchoice)) == 0)
  1736. {
  1737. if( PlayerInfo[playerid][pGuns][6] == 33 && PlayerInfo[playerid][pAGuns][6] == 0 )
  1738. {
  1739. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a rifle in your car gun locker.");
  1740. weapon = PlayerInfo[playerid][pGuns][6];
  1741. format(string,sizeof(string), "* %s deposited their rifle in their car safe.", GetPlayerNameEx(playerid));
  1742. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1743. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1744. }
  1745. }
  1746. else if(strcmp(weaponchoice, "sniper", true, strlen(weaponchoice)) == 0)
  1747. {
  1748. if( PlayerInfo[playerid][pGuns][6] == 34 && PlayerInfo[playerid][pAGuns][6] == 0 )
  1749. {
  1750. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a sniper rifle in your car gun locker.");
  1751. weapon = PlayerInfo[playerid][pGuns][6];
  1752. format(string,sizeof(string), "* %s deposited their sniper rifle in their car safe.", GetPlayerNameEx(playerid));
  1753. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1754. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1755. }
  1756. }
  1757. else if(strcmp(weaponchoice, "golfclub", true, strlen(weaponchoice)) == 0)
  1758. {
  1759. if( PlayerInfo[playerid][pGuns][1] == 2 && PlayerInfo[playerid][pAGuns][1] == 0 )
  1760. {
  1761. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a golf club in your car gun locker.");
  1762. weapon = PlayerInfo[playerid][pGuns][1];
  1763. format(string,sizeof(string), "* %s deposited their golf club in their car safe.", GetPlayerNameEx(playerid));
  1764. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1765. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1766. }
  1767. }
  1768. else if(strcmp(weaponchoice, "baseballbat", true, strlen(weaponchoice)) == 0)
  1769. {
  1770. if( PlayerInfo[playerid][pGuns][1] == 5 && PlayerInfo[playerid][pAGuns][1] == 0 )
  1771. {
  1772. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a baseball bat in your car gun locker.");
  1773. weapon = PlayerInfo[playerid][pGuns][1];
  1774. format(string,sizeof(string), "* %s deposited their baseball bat in their car safe.", GetPlayerNameEx(playerid));
  1775. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1776. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1777. }
  1778. }
  1779. else if(strcmp(weaponchoice, "shovel", true, strlen(weaponchoice)) == 0)
  1780. {
  1781. if( PlayerInfo[playerid][pGuns][1] == 6 && PlayerInfo[playerid][pAGuns][1] == 0 )
  1782. {
  1783. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a shovel in your car gun locker.");
  1784. weapon = PlayerInfo[playerid][pGuns][1];
  1785. format(string,sizeof(string), "* %s deposited their shovel in their car safe.", GetPlayerNameEx(playerid));
  1786. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1787. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1788. }
  1789. }
  1790. else if(strcmp(weaponchoice, "poolcue", true, strlen(weaponchoice)) == 0)
  1791. {
  1792. if( PlayerInfo[playerid][pGuns][1] == 7 && PlayerInfo[playerid][pAGuns][1] == 0 )
  1793. {
  1794. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a pool cue in your car gun locker.");
  1795. weapon = PlayerInfo[playerid][pGuns][1];
  1796. format(string,sizeof(string), "* %s deposited their pool cue in their car safe.", GetPlayerNameEx(playerid));
  1797. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1798. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1799. }
  1800. }
  1801. else if(strcmp(weaponchoice, "katana", true, strlen(weaponchoice)) == 0)
  1802. {
  1803. if( PlayerInfo[playerid][pGuns][1] == 8 && PlayerInfo[playerid][pAGuns][1] == 0 )
  1804. {
  1805. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a katana in your car gun locker.");
  1806. weapon = PlayerInfo[playerid][pGuns][1];
  1807. format(string,sizeof(string), "* %s deposited their katana in their car safe.", GetPlayerNameEx(playerid));
  1808. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1809. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1810. }
  1811. }
  1812. else if(strcmp(weaponchoice, "cane", true, strlen(weaponchoice)) == 0)
  1813. {
  1814. if( PlayerInfo[playerid][pGuns][10] == 15 && PlayerInfo[playerid][pAGuns][1] == 0 )
  1815. {
  1816. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a cane in your car gun locker.");
  1817. weapon = PlayerInfo[playerid][pGuns][10];
  1818. format(string,sizeof(string), "* %s deposited their cane in their car safe.", GetPlayerNameEx(playerid));
  1819. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1820. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1821. }
  1822. }
  1823. else if(strcmp(weaponchoice, "flowers", true, strlen(weaponchoice)) == 0)
  1824. {
  1825. if( PlayerInfo[playerid][pGuns][10] == 14 && PlayerInfo[playerid][pAGuns][1] == 0 )
  1826. {
  1827. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited flowers in your car gun locker.");
  1828. weapon = PlayerInfo[playerid][pGuns][10];
  1829. format(string,sizeof(string), "* %s deposited their flowers in their car safe.", GetPlayerNameEx(playerid));
  1830. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1831. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1832. }
  1833. }
  1834. else if(strcmp(weaponchoice, "parachute", true, strlen(weaponchoice)) == 0)
  1835. {
  1836. if( PlayerInfo[playerid][pGuns][11] == 46 && PlayerInfo[playerid][pAGuns][1] == 0 )
  1837. {
  1838. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a parachute in your car gun locker.");
  1839. weapon = PlayerInfo[playerid][pGuns][11];
  1840. format(string,sizeof(string), "* %s deposited their parachute in their car safe.", GetPlayerNameEx(playerid));
  1841. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1842. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1843. }
  1844. }
  1845. else if(strcmp(weaponchoice, "dildo", true, strlen(weaponchoice)) == 0)
  1846. {
  1847. if( PlayerInfo[playerid][pGuns][10] == 10 && PlayerInfo[playerid][pAGuns][1] == 0 )
  1848. {
  1849. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a dildo in your car gun locker.");
  1850. weapon = PlayerInfo[playerid][pGuns][10];
  1851. format(string,sizeof(string), "* %s deposited their dildo in their car safe.", GetPlayerNameEx(playerid));
  1852. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1853. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1854. }
  1855. }
  1856. else { SendClientMessageEx(playerid,COLOR_GREY," Invalid weapon name!"); return 1; }
  1857. if(PlayerVehicleInfo[playerid][pvid][pvWeapons][slot-1] == 0)
  1858. {
  1859. PlayerVehicleInfo[playerid][pvid][pvWeapons][slot-1] = weapon;
  1860. RemovePlayerWeapon(playerid, weapon);
  1861. g_mysql_SaveVehicle(playerid, pvid);
  1862. }
  1863. return 1;
  1864. }
  1865. CMD:trunktake(playerid, params[]) {
  1866. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while you're inside a vehicle.");
  1867. if(PlayerInfo[playerid][pAccountRestricted] != 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "Your account is restricted!");
  1868. else if(GetPVarType(playerid, "IsInArena")) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in an arena!");
  1869. else if(GetPVarInt( playerid, "EventToken") != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't use this while you're in an event.");
  1870. else if(PlayerInfo[playerid][pConnectHours] < 2 || PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this as you are currently restricted from possessing weapons!");
  1871. else if(GetPVarInt(playerid, "GiveWeaponTimer") >= 1)
  1872. {
  1873. new szMessage[59];
  1874. format(szMessage, sizeof(szMessage), " You must wait %d seconds before getting another weapon.", GetPVarInt(playerid, "GiveWeaponTimer"));
  1875. return SendClientMessageEx(playerid, COLOR_GREY, szMessage);
  1876. }
  1877. new
  1878. Float: fVehPos[3],
  1879. iWeaponSlot = strval(params);
  1880. for(new d = 0 ; d < MAX_PLAYERVEHICLES; d++) {
  1881. if(PlayerVehicleInfo[playerid][d][pvId] != INVALID_PLAYER_VEHICLE_ID) {
  1882. GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], fVehPos[0], fVehPos[1], fVehPos[2]);
  1883. if(IsPlayerInRangeOfPoint(playerid, 4.0, fVehPos[0], fVehPos[1], fVehPos[2])) {
  1884. if(isnull(params)) {
  1885. new
  1886. szMessage[64];
  1887. format(szMessage, sizeof(szMessage), "*** %s's %s Safe ***", GetPlayerNameEx(playerid), GetVehicleName(PlayerVehicleInfo[playerid][d][pvId]));
  1888. SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
  1889. for(new s = 0; s < 3; s++) if(PlayerVehicleInfo[playerid][d][pvWeapons][s] != 0) {
  1890. new
  1891. szWeapon[16];
  1892. GetWeaponName(PlayerVehicleInfo[playerid][d][pvWeapons][s], szWeapon, sizeof(szWeapon));
  1893. format(szMessage, sizeof(szMessage), "Slot %d: %s", s+1, szWeapon);
  1894. SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
  1895. }
  1896. return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /trunktake [slot]");
  1897. }
  1898. else if(GetVehicleModel(PlayerVehicleInfo[playerid][d][pvId]) == 481 || GetVehicleModel(PlayerVehicleInfo[playerid][d][pvId]) == 509) {
  1899. return SendClientMessageEx(playerid,COLOR_GREY,"That vehicle doesn't have a trunk.");
  1900. }
  1901. new
  1902. engine, lights, alarm, doors, bonnet, boot, objective;
  1903. GetVehicleParamsEx(PlayerVehicleInfo[playerid][d][pvId], engine, lights, alarm, doors, bonnet, boot, objective);
  1904. if(boot == VEHICLE_PARAMS_OFF || boot == VEHICLE_PARAMS_UNSET) {
  1905. return SendClientMessageEx(playerid, COLOR_GRAD3, "You can't take weapons from the trunk if it's closed! /car trunk to open it.");
  1906. }
  1907. new maxslots = PlayerVehicleInfo[playerid][d][pvWepUpgrade]+1;
  1908. if(iWeaponSlot > maxslots || iWeaponSlot < 1) {
  1909. return SendClientMessageEx(playerid, COLOR_GREY, "Invalid slot specified.");
  1910. }
  1911. else if(PlayerVehicleInfo[playerid][d][pvWeapons][iWeaponSlot - 1] != 0) {
  1912. new
  1913. szWeapon[16],
  1914. szMessage[128];
  1915. new aWeapons[13][2];
  1916. for(new i; i < 13; ++i) {
  1917. GetPlayerWeaponData(playerid, i, aWeapons[i][0], aWeapons[i][1]);
  1918. if(aWeapons[i][0] == PlayerVehicleInfo[playerid][d][pvWeapons][iWeaponSlot - 1]) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are already carrying this weapon.");
  1919. }
  1920. GetWeaponName(PlayerVehicleInfo[playerid][d][pvWeapons][iWeaponSlot - 1], szWeapon, sizeof(szWeapon));
  1921. GivePlayerValidWeapon(playerid, PlayerVehicleInfo[playerid][d][pvWeapons][iWeaponSlot - 1]);
  1922. PlayerVehicleInfo[playerid][d][pvWeapons][iWeaponSlot - 1] = 0;
  1923. g_mysql_SaveVehicle(playerid, d);
  1924. format(szMessage, sizeof(szMessage), "You have withdrawn a %s from your car gun locker.", szWeapon);
  1925. SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
  1926. format(szMessage, sizeof(szMessage), "* %s has withdrawn a %s from their car safe.", GetPlayerNameEx(playerid), szWeapon);
  1927. return ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1928. }
  1929. else return SendClientMessageEx(playerid, COLOR_WHITE, "You don't have a weapon stored in that slot.");
  1930. }
  1931. }
  1932. }
  1933. return SendClientMessageEx(playerid,COLOR_GREY,"You are not near any vehicle that you own.");
  1934. }
  1935. CMD:storegun(playerid, params[])
  1936. {
  1937. if(Homes[playerid] > 0)
  1938. {
  1939. if(GetPVarType(playerid, "IsInArena")) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in an arena!");
  1940. if(GetPVarInt( playerid, "EventToken") != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't use this while you're in an event.");
  1941. if(GetPVarType(playerid, "PlayerCuffed") || GetPVarInt(playerid, "pBagged") >= 1 || GetPVarType(playerid, "Injured") || GetPVarType(playerid, "IsFrozen")) return SendClientMessage(playerid, COLOR_GRAD2, "You can't do that at this time!");
  1942. new string[128], weaponchoice[32], slot;
  1943. if(sscanf(params, "s[32]d", weaponchoice, slot)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /storegun [weapon] [slot]");
  1944. for(new i; i < MAX_HOUSES; i++)
  1945. {
  1946. if(GetPlayerSQLId(playerid) == HouseInfo[i][hOwnerID] && IsPlayerInRangeOfPoint(playerid, 50, HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]) && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hIntVW] && GetPlayerInterior(playerid) == HouseInfo[i][hIntIW])
  1947. {
  1948. if (GetPVarInt(playerid, "GiveWeaponTimer") > 0)
  1949. {
  1950. format(string, sizeof(string), " You must wait %d seconds before depositing another weapon.", GetPVarInt(playerid, "GiveWeaponTimer"));
  1951. SendClientMessageEx(playerid,COLOR_GREY,string);
  1952. return 1;
  1953. }
  1954. new maxslots = HouseInfo[i][hGLUpgrade];
  1955. if(slot > maxslots || slot == 0)
  1956. {
  1957. SendClientMessageEx(playerid, COLOR_GREY, "That is not a valid slot. Slots are from 1-5.");
  1958. return 1;
  1959. }
  1960. if( HouseInfo[i][hWeapons][slot-1] != 0)
  1961. {
  1962. SendClientMessageEx(playerid, COLOR_GREY, "You have a weapon stored in that slot already.");
  1963. return 1;
  1964. }
  1965. new weapon;
  1966. if(strcmp(weaponchoice, "sdpistol", true, strlen(weaponchoice)) == 0)
  1967. {
  1968. if( PlayerInfo[playerid][pGuns][2] == 23 && PlayerInfo[playerid][pAGuns][2] == 0 )
  1969. {
  1970. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a silenced pistol into your gun locker.");
  1971. weapon = PlayerInfo[playerid][pGuns][2];
  1972. format(string,sizeof(string), "* %s deposited their silenced pistol in their house safe.", GetPlayerNameEx(playerid));
  1973. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1974. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1975. }
  1976. }
  1977. else if(strcmp(weaponchoice, "deagle", true, strlen(weaponchoice)) == 0)
  1978. {
  1979. if( PlayerInfo[playerid][pGuns][2] == 24 && PlayerInfo[playerid][pAGuns][2] == 0 )
  1980. {
  1981. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a Desert Eagle in your gun locker.");
  1982. weapon = PlayerInfo[playerid][pGuns][2];
  1983. format(string,sizeof(string), "* %s deposited their Desert Eagle in their house safe.", GetPlayerNameEx(playerid));
  1984. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1985. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1986. }
  1987. }
  1988. else if(strcmp(weaponchoice, "shotgun", true, strlen(weaponchoice)) == 0)
  1989. {
  1990. if( PlayerInfo[playerid][pGuns][3] == 25 && PlayerInfo[playerid][pAGuns][3] == 0 )
  1991. {
  1992. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a shotgun in your gun locker.");
  1993. weapon = PlayerInfo[playerid][pGuns][3];
  1994. format(string,sizeof(string), "* %s deposited their Shotgun in their house safe.", GetPlayerNameEx(playerid));
  1995. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1996. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  1997. }
  1998. }
  1999. else if(strcmp(weaponchoice, "spas12", true, strlen(weaponchoice)) == 0)
  2000. {
  2001. if( PlayerInfo[playerid][pGuns][3] == 27 && PlayerInfo[playerid][pAGuns][3] == 0 )
  2002. {
  2003. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a combat shotgun in your gun locker.");
  2004. weapon = PlayerInfo[playerid][pGuns][3];
  2005. format(string,sizeof(string), "* %s deposited their Combat Shotgun in their house safe.", GetPlayerNameEx(playerid));
  2006. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2007. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2008. }
  2009. }
  2010. else if(strcmp(weaponchoice, "mp5", true, strlen(weaponchoice)) == 0)
  2011. {
  2012. if( PlayerInfo[playerid][pGuns][4] == 29 && PlayerInfo[playerid][pAGuns][4] == 0 )
  2013. {
  2014. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an MP5 in your gun locker.");
  2015. weapon = PlayerInfo[playerid][pGuns][4];
  2016. format(string,sizeof(string), "* %s deposited their MP5 in their house safe.", GetPlayerNameEx(playerid));
  2017. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2018. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2019. }
  2020. }
  2021. else if(strcmp(weaponchoice, "ak47", true, strlen(weaponchoice)) == 0)
  2022. {
  2023. if( PlayerInfo[playerid][pGuns][5] == 30 && PlayerInfo[playerid][pAGuns][5] == 0 )
  2024. {
  2025. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an AK-47 in your gun locker.");
  2026. weapon = PlayerInfo[playerid][pGuns][5];
  2027. format(string,sizeof(string), "* %s deposited their AK-47 in their house safe.", GetPlayerNameEx(playerid));
  2028. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2029. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2030. }
  2031. }
  2032. else if(strcmp(weaponchoice, "m4", true, strlen(weaponchoice)) == 0)
  2033. {
  2034. if( PlayerInfo[playerid][pGuns][5] == 31 && PlayerInfo[playerid][pAGuns][5] == 0 )
  2035. {
  2036. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an M4 in your gun locker.");
  2037. weapon = PlayerInfo[playerid][pGuns][5];
  2038. format(string,sizeof(string), "* %s deposited their M4 in their house safe.", GetPlayerNameEx(playerid));
  2039. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2040. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2041. }
  2042. }
  2043. else if(strcmp(weaponchoice, "rifle", true, strlen(weaponchoice)) == 0)
  2044. {
  2045. if( PlayerInfo[playerid][pGuns][6] == 33 && PlayerInfo[playerid][pAGuns][6] == 0 )
  2046. {
  2047. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a rifle in your gun locker.");
  2048. weapon = PlayerInfo[playerid][pGuns][6];
  2049. format(string,sizeof(string), "* %s deposited their rifle in their house safe.", GetPlayerNameEx(playerid));
  2050. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2051. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2052. }
  2053. }
  2054. else if(strcmp(weaponchoice, "sniper", true, strlen(weaponchoice)) == 0)
  2055. {
  2056. if( PlayerInfo[playerid][pGuns][6] == 34 && PlayerInfo[playerid][pAGuns][6] == 0 )
  2057. {
  2058. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a sniper rifle in your gun locker.");
  2059. weapon = PlayerInfo[playerid][pGuns][6];
  2060. format(string,sizeof(string), "* %s deposited their sniper rifle in their house safe.", GetPlayerNameEx(playerid));
  2061. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2062. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2063. }
  2064. }
  2065. else if(strcmp(weaponchoice, "uzi", true, strlen(weaponchoice)) == 0)
  2066. {
  2067. if( PlayerInfo[playerid][pGuns][4] == 28 && PlayerInfo[playerid][pAGuns][4] == 0 )
  2068. {
  2069. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an uzi in your gun locker.");
  2070. weapon = PlayerInfo[playerid][pGuns][4];
  2071. format(string,sizeof(string), "* %s deposited their uzi in their house safe.", GetPlayerNameEx(playerid));
  2072. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2073. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2074. }
  2075. }
  2076. else if(strcmp(weaponchoice, "tec9", true, strlen(weaponchoice)) == 0)
  2077. {
  2078. if( PlayerInfo[playerid][pGuns][4] == 32 && PlayerInfo[playerid][pAGuns][4] == 0 )
  2079. {
  2080. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a tec9 in your gun locker.");
  2081. weapon = PlayerInfo[playerid][pGuns][4];
  2082. format(string,sizeof(string), "* %s deposited their tec9 in their house safe.", GetPlayerNameEx(playerid));
  2083. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2084. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2085. }
  2086. }
  2087. if(weapon == 0) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that weapon.");
  2088. if(HouseInfo[i][hWeapons][slot-1] == 0)
  2089. {
  2090. HouseInfo[i][hWeapons][slot-1] = weapon;
  2091. RemovePlayerWeapon(playerid, weapon);
  2092. SaveHouse(i);
  2093. return 1;
  2094. }
  2095. else { SendClientMessageEx(playerid,COLOR_GREY," Invalid weapon name!"); return 1; }
  2096. }
  2097. }
  2098. SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
  2099. }
  2100. else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
  2101. return 1;
  2102. }
  2103. CMD:getgun(playerid, params[])
  2104. {
  2105. if(Homes[playerid] > 0)
  2106. {
  2107. new string[128], slot;
  2108. for(new i; i < MAX_HOUSES; i++)
  2109. {
  2110. if(GetPlayerSQLId(playerid) == HouseInfo[i][hOwnerID] && IsPlayerInRangeOfPoint(playerid, 50, HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]) && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hIntVW] && GetPlayerInterior(playerid) == HouseInfo[i][hIntIW])
  2111. {
  2112. if(PlayerInfo[playerid][pConnectHours] < 2 || PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this as you are currently restricted from possessing weapons!");
  2113. if(sscanf(params, "d", slot))
  2114. {
  2115. new weaponname[50];
  2116. SendClientMessageEx(playerid, COLOR_GREEN, "________________________________________________");
  2117. format(string, sizeof(string), "*** %s's Safe ***", GetPlayerNameEx(playerid));
  2118. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2119. for(new s = 0; s < 5; s++)
  2120. {
  2121. if( HouseInfo[i][hWeapons][s] != 0 )
  2122. {
  2123. GetWeaponName(HouseInfo[i][hWeapons][s], weaponname, sizeof(weaponname));
  2124. format(string, sizeof(string), "Slot %d: %s", s+1, weaponname);
  2125. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2126. }
  2127. }
  2128. SendClientMessageEx(playerid, COLOR_GREEN, "________________________________________________");
  2129. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /getgun [slot]");
  2130. return 1;
  2131. }
  2132. if (GetPVarInt(playerid, "GiveWeaponTimer") > 0)
  2133. {
  2134. format(string, sizeof(string), " You must wait %d seconds before getting another weapon.", GetPVarInt(playerid, "GiveWeaponTimer"));
  2135. SendClientMessageEx(playerid,COLOR_GREY,string);
  2136. return 1;
  2137. }
  2138. new maxslots = HouseInfo[i][hGLUpgrade];
  2139. if(slot > maxslots)
  2140. {
  2141. SendClientMessageEx(playerid, COLOR_GREY, "Invalid slot.");
  2142. return 1;
  2143. }
  2144. if(HouseInfo[i][hWeapons][slot-1] != 0)
  2145. {
  2146. new weaponname[50];
  2147. GetWeaponName(HouseInfo[i][hWeapons][slot-1], weaponname, sizeof(weaponname));
  2148. GivePlayerValidWeapon(playerid, HouseInfo[i][hWeapons][slot-1]);
  2149. HouseInfo[i][hWeapons][slot-1] = 0;
  2150. if(strcmp(weaponname, "silenced pistol", true, strlen(weaponname)) == 0)
  2151. {
  2152. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn a silenced pistol from your gun locker.");
  2153. format(string,sizeof(string), "* %s has withdrawn a silenced pistol from their house safe.", GetPlayerNameEx(playerid));
  2154. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2155. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2156. }
  2157. if(strcmp(weaponname, "desert eagle", true, strlen(weaponname)) == 0)
  2158. {
  2159. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn a Desert Eagle from your gun locker.");
  2160. format(string,sizeof(string), "* %s has withdrawn a Desert Eagle from their house safe.", GetPlayerNameEx(playerid));
  2161. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2162. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2163. }
  2164. if(strcmp(weaponname, "shotgun", true, strlen(weaponname)) == 0)
  2165. {
  2166. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn a shotgun from your gun locker.");
  2167. format(string,sizeof(string), "* %s has withdrawn a shotgun from their house safe.", GetPlayerNameEx(playerid));
  2168. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2169. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2170. }
  2171. if(strcmp(weaponname, "combat shotgun", true, strlen(weaponname)) == 0)
  2172. {
  2173. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn a combat shotgun from your gun locker.");
  2174. format(string,sizeof(string), "* %s has withdrawn a combat shotgun from their house safe.", GetPlayerNameEx(playerid));
  2175. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2176. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2177. }
  2178. if(strcmp(weaponname, "mp5", true, strlen(weaponname)) == 0)
  2179. {
  2180. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn an MP5 from your gun locker.");
  2181. format(string,sizeof(string), "* %s has withdrawn an MP5 from their house safe.", GetPlayerNameEx(playerid));
  2182. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2183. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2184. }
  2185. if(strcmp(weaponname, "ak47", true, strlen(weaponname)) == 0)
  2186. {
  2187. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn an AK-47 from your gun locker.");
  2188. format(string,sizeof(string), "* %s has withdrawn an AK-47 from their house safe.", GetPlayerNameEx(playerid));
  2189. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2190. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2191. }
  2192. if(strcmp(weaponname, "m4", true, strlen(weaponname)) == 0)
  2193. {
  2194. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn an M4 from your gun locker.");
  2195. format(string,sizeof(string), "* %s has withdrawn an M4 from their house safe.", GetPlayerNameEx(playerid));
  2196. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2197. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2198. }
  2199. if(strcmp(weaponname, "rifle", true, strlen(weaponname)) == 0)
  2200. {
  2201. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn a rifle from your gun locker.");
  2202. format(string,sizeof(string), "* %s has withdrawn a rifle from their house safe.", GetPlayerNameEx(playerid));
  2203. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2204. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2205. }
  2206. if(strcmp(weaponname, "sniper rifle", true, strlen(weaponname)) == 0)
  2207. {
  2208. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn a sniper rifle from your gun locker.");
  2209. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2210. format(string,sizeof(string), "* %s has withdrawn a sniper rifle from their house safe.", GetPlayerNameEx(playerid));
  2211. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2212. }
  2213. if(strcmp(weaponname, "micro smg", true, strlen(weaponname)) == 0)
  2214. {
  2215. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn an uzi from your gun locker.");
  2216. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2217. format(string,sizeof(string), "* %s has withdrawn an uzi from their house safe.", GetPlayerNameEx(playerid));
  2218. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2219. }
  2220. if(strcmp(weaponname, "tec9", true, strlen(weaponname)) == 0)
  2221. {
  2222. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn an uzi from your gun locker.");
  2223. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  2224. format(string,sizeof(string), "* %s has withdrawn an uzi from their house safe.", GetPlayerNameEx(playerid));
  2225. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2226. }
  2227. SaveHouse(i);
  2228. return 1;
  2229. }
  2230. else
  2231. {
  2232. SendClientMessageEx(playerid, COLOR_WHITE, "You don't have a weapon stored in that slot.");
  2233. return 1;
  2234. }
  2235. }
  2236. }
  2237. SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
  2238. }
  2239. else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
  2240. return 1;
  2241. }
  2242. CMD:hwithdraw(playerid, params[])
  2243. {
  2244. if(Homes[playerid] > 0)
  2245. {
  2246. for(new i; i < MAX_HOUSES; i++)
  2247. {
  2248. if(GetPlayerSQLId(playerid) == HouseInfo[i][hOwnerID] && IsPlayerInRangeOfPoint(playerid, 50, HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]) && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hIntVW] && GetPlayerInterior(playerid) == HouseInfo[i][hIntIW])
  2249. {
  2250. new itemid, amount, string[128];
  2251. if(sscanf(params, "dd", itemid, amount))
  2252. {
  2253. SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /hwithdraw [itemid] [amount]");
  2254. SendClientMessageEx(playerid, COLOR_GREY, "ItemIDs: (1) Cash - (2) Pot - (3) Crack - (4) Materials - (5) Meth - (6) Ecstasy - (7) Heroin");
  2255. return 1;
  2256. }
  2257. if(itemid < 1 || itemid > 7) {
  2258. SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /hwithdraw [itemid] [amount]");
  2259. SendClientMessageEx(playerid, COLOR_GREY, "ItemIDs: (1) Cash - (2) Pot - (3) Crack - (4) Materials - (5) Meth - (6) Ecstasy - (7) Heroin");
  2260. return 1;
  2261. }
  2262. if(amount < 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't withdraw less than 1.");
  2263. switch(itemid)
  2264. {
  2265. case 1: // Cash
  2266. {
  2267. if(HouseInfo[i][hSafeMoney] >= amount)
  2268. {
  2269. HouseInfo[i][hSafeMoney] -= amount;
  2270. GivePlayerCash(playerid, amount);
  2271. OnPlayerStatsUpdate(playerid);
  2272. SaveHouse(i);
  2273. format(string, sizeof(string), "You have withdrawn $%d from your house safe.", amount);
  2274. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2275. format(string, sizeof(string), "%s (SQL: %d) has withdrawn $%d from their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
  2276. Log("logs/hsafe.log", string);
  2277. return 1;
  2278. }
  2279. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to withdraw!");
  2280. }
  2281. case 2: // Pot
  2282. {
  2283. if(HouseInfo[i][hPot] >= amount)
  2284. {
  2285. HouseInfo[i][hPot] -= amount;
  2286. PlayerInfo[playerid][pDrugs][0] += amount;
  2287. OnPlayerStatsUpdate(playerid);
  2288. SaveHouse(i);
  2289. format(string, sizeof(string), "You have withdrawn %d Pot from your house safe.", amount);
  2290. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2291. format(string, sizeof(string), "%s (SQL: %d) has withdrawn %d Pot from their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
  2292. Log("logs/hsafe.log", string);
  2293. return 1;
  2294. }
  2295. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to withdraw!");
  2296. }
  2297. case 3: // Crack
  2298. {
  2299. if(HouseInfo[i][hCrack] >= amount)
  2300. {
  2301. HouseInfo[i][hCrack] -= amount;
  2302. PlayerInfo[playerid][pDrugs][1] += amount;
  2303. OnPlayerStatsUpdate(playerid);
  2304. SaveHouse(i);
  2305. format(string, sizeof(string), "You have withdrawn %d crack from your house safe.", amount);
  2306. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2307. format(string, sizeof(string), "%s (SQL: %d) has withdrawn %d crack from their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
  2308. Log("logs/hsafe.log", string);
  2309. return 1;
  2310. }
  2311. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to withdraw!");
  2312. }
  2313. case 4: // Materials
  2314. {
  2315. if(HouseInfo[i][hMaterials] >= amount)
  2316. {
  2317. HouseInfo[i][hMaterials] -= amount;
  2318. PlayerInfo[playerid][pMats] += amount;
  2319. OnPlayerStatsUpdate(playerid);
  2320. SaveHouse(i);
  2321. format(string, sizeof(string), "You have withdrawn %d materials from your house safe.", amount);
  2322. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2323. format(string, sizeof(string), "%s (SQL: %d) has withdrawn %d materials from their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
  2324. Log("logs/hsafe.log", string);
  2325. return 1;
  2326. }
  2327. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to withdraw!");
  2328. }
  2329. case 5: // Meth
  2330. {
  2331. if(HouseInfo[i][hMeth] >= amount)
  2332. {
  2333. HouseInfo[i][hMeth] -= amount;
  2334. PlayerInfo[playerid][pDrugs][2] += amount;
  2335. OnPlayerStatsUpdate(playerid);
  2336. SaveHouse(i);
  2337. format(string, sizeof(string), "You have withdrawn %d meth from your house safe.", amount);
  2338. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2339. format(string, sizeof(string), "%s (SQL: %d) has withdrawn %d meth from their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
  2340. Log("logs/hsafe.log", string);
  2341. return 1;
  2342. }
  2343. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to withdraw!");
  2344. }
  2345. case 6: // Ecstasy
  2346. {
  2347. if(HouseInfo[i][hEcstasy] >= amount)
  2348. {
  2349. HouseInfo[i][hEcstasy] -= amount;
  2350. PlayerInfo[playerid][pDrugs][3] += amount;
  2351. OnPlayerStatsUpdate(playerid);
  2352. SaveHouse(i);
  2353. format(string, sizeof(string), "You have withdrawn %d ecstasy from your house safe.", amount);
  2354. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2355. format(string, sizeof(string), "%s (SQL: %d) has withdrawn %d ecstasy from their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
  2356. Log("logs/hsafe.log", string);
  2357. return 1;
  2358. }
  2359. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to withdraw!");
  2360. }
  2361. case 7: // Heroin
  2362. {
  2363. if(HouseInfo[i][hHeroin] >= amount)
  2364. {
  2365. HouseInfo[i][hHeroin] -= amount;
  2366. PlayerInfo[playerid][pDrugs][4] += amount;
  2367. OnPlayerStatsUpdate(playerid);
  2368. SaveHouse(i);
  2369. format(string, sizeof(string), "You have withdrawn %d heroin from your house safe.", amount);
  2370. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2371. format(string, sizeof(string), "%s (SQL: %d) has withdrawn %d heroin from their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
  2372. Log("logs/hsafe.log", string);
  2373. return 1;
  2374. }
  2375. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to withdraw!");
  2376. }
  2377. }
  2378. }
  2379. }
  2380. SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
  2381. }
  2382. else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
  2383. return 1;
  2384. }
  2385. CMD:hdeposit(playerid, params[])
  2386. {
  2387. if(Homes[playerid] > 0)
  2388. {
  2389. for(new i; i < MAX_HOUSES; i++)
  2390. {
  2391. if(GetPlayerSQLId(playerid) == HouseInfo[i][hOwnerID] && IsPlayerInRangeOfPoint(playerid, 50, HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]) && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hIntVW] && GetPlayerInterior(playerid) == HouseInfo[i][hIntIW])
  2392. {
  2393. new string[128], itemid, amount;
  2394. if(sscanf(params, "dd", itemid, amount))
  2395. {
  2396. SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /hdeposit [itemid] [amount]");
  2397. SendClientMessageEx(playerid, COLOR_GREY, "ItemIDs: (1) Cash - (2) Pot - (3) Crack - (4) Materials - (5) Meth - (6) Ecstasy - (7) Heroin");
  2398. return 1;
  2399. }
  2400. if(itemid < 1 || itemid > 7) {
  2401. SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /hdeposit [itemid] [amount]");
  2402. SendClientMessageEx(playerid, COLOR_GREY, "ItemIDs: (1) Cash - (2) Pot - (3) Crack - (4) Materials - (5) Meth - (6) Ecstasy - (7) Heroin");
  2403. return 1;
  2404. }
  2405. if(amount < 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't deposit less than 1.");
  2406. switch(itemid)
  2407. {
  2408. case 1: // Cash
  2409. {
  2410. if(PlayerInfo[playerid][pCash] >= amount) PlayerInfo[playerid][pCash] -= amount;
  2411. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to deposit!");
  2412. HouseInfo[i][hSafeMoney] += amount;
  2413. format(string, sizeof(string), "You have deposited $%d to your house's safe.", amount);
  2414. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2415. OnPlayerStatsUpdate(playerid);
  2416. SaveHouse(i);
  2417. format(string, sizeof(string), "%s (SQL: %d) has deposited $%d into their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
  2418. Log("logs/hsafe.log", string);
  2419. return 1;
  2420. }
  2421. case 2: // Pot
  2422. {
  2423. if(PlayerInfo[playerid][pDrugs][0] >= amount) PlayerInfo[playerid][pDrugs][0] -= amount;
  2424. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to deposit!");
  2425. HouseInfo[i][hPot] += amount;
  2426. format(string, sizeof(string), "You have deposited %d Pot to your house's safe.", amount);
  2427. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2428. OnPlayerStatsUpdate(playerid);
  2429. SaveHouse(i);
  2430. format(string, sizeof(string), "%s (SQL: %d) has deposited %d Pot into their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
  2431. Log("logs/hsafe.log", string);
  2432. return 1;
  2433. }
  2434. case 3: // Crack
  2435. {
  2436. if(PlayerInfo[playerid][pDrugs][1] >= amount) PlayerInfo[playerid][pDrugs][1] -= amount;
  2437. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to deposit!");
  2438. HouseInfo[i][hCrack] += amount;
  2439. format(string, sizeof(string), "You have deposited %d Crack to your house's safe.", amount);
  2440. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2441. OnPlayerStatsUpdate(playerid);
  2442. SaveHouse(i);
  2443. format(string, sizeof(string), "%s (SQL: %d) has deposited %d crack into their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
  2444. Log("logs/hsafe.log", string);
  2445. return 1;
  2446. }
  2447. case 4: // Materials
  2448. {
  2449. if(PlayerInfo[playerid][pMats] >= amount) PlayerInfo[playerid][pMats] -= amount;
  2450. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to deposit!");
  2451. HouseInfo[i][hMaterials] += amount;
  2452. format(string, sizeof(string), "You have deposited %d Materials to your house's safe.", amount);
  2453. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2454. OnPlayerStatsUpdate(playerid);
  2455. SaveHouse(i);
  2456. format(string, sizeof(string), "%s (SQL: %d) has deposited %d materials into their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
  2457. Log("logs/hsafe.log", string);
  2458. return 1;
  2459. }
  2460. case 5: // Meth
  2461. {
  2462. if(PlayerInfo[playerid][pDrugs][2] >= amount) PlayerInfo[playerid][pDrugs][2] -= amount;
  2463. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to deposit!");
  2464. HouseInfo[i][hMeth] += amount;
  2465. format(string, sizeof(string), "You have deposited %d Meth to your house's safe.", amount);
  2466. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2467. OnPlayerStatsUpdate(playerid);
  2468. SaveHouse(i);
  2469. format(string, sizeof(string), "%s (SQL: %d) has deposited %d meth into their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
  2470. Log("logs/hsafe.log", string);
  2471. return 1;
  2472. }
  2473. case 6: // Ecstasy
  2474. {
  2475. if(PlayerInfo[playerid][pDrugs][3] >= amount) PlayerInfo[playerid][pDrugs][3] -= amount;
  2476. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to deposit!");
  2477. HouseInfo[i][hEcstasy] += amount;
  2478. format(string, sizeof(string), "You have deposited %d Ecstasy to your house's safe.", amount);
  2479. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2480. OnPlayerStatsUpdate(playerid);
  2481. SaveHouse(i);
  2482. format(string, sizeof(string), "%s (SQL: %d) has deposited %d Ecstasy into their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
  2483. Log("logs/hsafe.log", string);
  2484. return 1;
  2485. }
  2486. case 7: // Heroin
  2487. {
  2488. if(PlayerInfo[playerid][pDrugs][4] >= amount) PlayerInfo[playerid][pDrugs][4] -= amount;
  2489. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to deposit!");
  2490. HouseInfo[i][hHeroin] += amount;
  2491. format(string, sizeof(string), "You have deposited %d Heroin to your house's safe.", amount);
  2492. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2493. OnPlayerStatsUpdate(playerid);
  2494. SaveHouse(i);
  2495. format(string, sizeof(string), "%s (SQL: %d) has deposited %d heroin into their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
  2496. Log("logs/hsafe.log", string);
  2497. return 1;
  2498. }
  2499. }
  2500. }
  2501. }
  2502. SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
  2503. }
  2504. else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
  2505. return 1;
  2506. }
  2507. /*
  2508. CMD:workbench(playerid, params[]) {
  2509. new szType[10], iChoice, iAmount, houseid;
  2510. if(sscanf(params, "s[6]ii", szType, iChoice, iAmount)) {
  2511. SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /workbench [type] [choice] [amount]");
  2512. SendClientMessageEx(playerid, COLOR_GRAD2, "TYPE: melee, gun");
  2513. SendClientMessageEx(playerid, COLOR_GRAD2, "CHOICE GUN: 9mm (0), SDPistol (1), Shotgun (2), Rifle (3)");
  2514. SendClientMessageEx(playerid, COLOR_GRAD2, "CHOICE MELEE: Brass Knuckles (0), Baseball Bat (1), Shovel (2), Pool Cue (3), Cane (4)");
  2515. return SendClientMessageEx(playerid, COLOR_GRAD2, "CHOICE MELEE: Dildo (5), Vibrator (6), Katana (7), Flowers (8), SprayCan (9)");
  2516. }
  2517. for(new i = 0; i < 3; i++)
  2518. {
  2519. if(i == 0) houseid = PlayerInfo[playerid][pPhousekey];
  2520. if(i == 1) houseid = PlayerInfo[playerid][pPhousekey2];
  2521. if(i == 2) houseid = PlayerInfo[playerid][pPhousekey3];
  2522. if(houseid != INVALID_HOUSE_ID && HouseInfo[houseid][hOwnerID] == GetPlayerSQLId(playerid) && IsPlayerInRangeOfPoint(playerid, 50, HouseInfo[houseid][hInteriorX], HouseInfo[houseid][hInteriorY], HouseInfo[houseid][hInteriorZ]) && GetPlayerVirtualWorld(playerid) == HouseInfo[houseid][hIntVW] && GetPlayerInterior(playerid) == HouseInfo[houseid][hIntIW])
  2523. {
  2524. if(iAmount <= 0) return SendClientMessageEx(playerid, -1, "You can't have negative amount values.");
  2525. if(strcmp(szType,"melee",true) == 0)
  2526. {
  2527. if(playerid != INVALID_PLAYER_ID && iChoice >= 0 || iChoice <= 9)
  2528. {
  2529. if(PlayerInfo[playerid][pMats] < 150) return SendClientMessageEx(playerid, COLOR_GRAD2, "You dont have enough materials to produce the weapon.");
  2530. if(PlayerInfo[playerid][pMats] < 2000 && iChoice == 9) return SendClientMessageEx(playerid, COLOR_GRAD2, "You dont have enough materials to produce the weapon.");
  2531. switch(iChoice)
  2532. {
  2533. case 0: GivePlayerValidWeapon(playerid, WEAPON_BRASSKNUCKLE);
  2534. case 1: GivePlayerValidWeapon(playerid, WEAPON_BAT);
  2535. case 2: GivePlayerValidWeapon(playerid, WEAPON_SHOVEL);
  2536. case 3: GivePlayerValidWeapon(playerid, WEAPON_POOLSTICK);
  2537. case 4: GivePlayerValidWeapon(playerid, WEAPON_CANE);
  2538. case 5: GivePlayerValidWeapon(playerid, WEAPON_DILDO);
  2539. case 6: GivePlayerValidWeapon(playerid, WEAPON_VIBRATOR);
  2540. case 7: GivePlayerValidWeapon(playerid, WEAPON_KATANA);
  2541. case 8: GivePlayerValidWeapon(playerid, WEAPON_FLOWER);
  2542. case 9: GivePlayerValidWeapon(playerid, WEAPON_SPRAYCAN);
  2543. }
  2544. if(iChoice == 9) { PlayerInfo[playerid][pMats] -= 1850; }
  2545. PlayerInfo[playerid][pMats] -= 150;
  2546. format(szMiscArray, sizeof(szMiscArray), "You have crafted a melee weapon.", iAmount);
  2547. return SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  2548. }
  2549. }
  2550. if(strcmp(szType,"gun",true) == 0)
  2551. {
  2552. if(playerid != INVALID_PLAYER_ID && iChoice >= 0 || iChoice <= 3)
  2553. {
  2554. switch(iChoice)
  2555. {
  2556. case 0:
  2557. {
  2558. if(PlayerInfo[playerid][pMats] < 3000) return SendClientMessageEx(playerid, COLOR_GRAD2, "You dont have enough materials to produce the gun.");
  2559. GivePlayerValidWeapon(playerid, WEAPON_COLT45);
  2560. PlayerInfo[playerid][pMats] -= 3000;
  2561. format(szMiscArray, sizeof(szMiscArray), "You have crafted a 9mm weapon.", iAmount);
  2562. }
  2563. case 1:
  2564. {
  2565. if(PlayerInfo[playerid][pMats] < 3000) return SendClientMessageEx(playerid, COLOR_GRAD2, "You dont have enough materials to produce the gun.");
  2566. GivePlayerValidWeapon(playerid, WEAPON_SILENCED);
  2567. PlayerInfo[playerid][pMats] -= 3000;
  2568. format(szMiscArray, sizeof(szMiscArray), "You have crafted a Silenced weapon.", iAmount);
  2569. }
  2570. case 2:
  2571. {
  2572. if(PlayerInfo[playerid][pMats] < 4000) return SendClientMessageEx(playerid, COLOR_GRAD2, "You dont have enough materials to produce the gun.");
  2573. GivePlayerValidWeapon(playerid, WEAPON_SHOTGUN);
  2574. PlayerInfo[playerid][pMats] -= 4000;
  2575. format(szMiscArray, sizeof(szMiscArray), "You have crafted a Shotgun weapon.", iAmount);
  2576. }
  2577. case 3:
  2578. {
  2579. if(PlayerInfo[playerid][pMats] < 4000) return SendClientMessageEx(playerid, COLOR_GRAD2, "You dont have enough materials to produce the gun.");
  2580. GivePlayerValidWeapon(playerid, WEAPON_RIFLE);
  2581. PlayerInfo[playerid][pMats] -= 4000;
  2582. format(szMiscArray, sizeof(szMiscArray), "You have crafted a Country Rifle weapon.", iAmount);
  2583. }
  2584. }
  2585. return SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  2586. }
  2587. }
  2588. }
  2589. SendClientMessageEx(playerid, COLOR_WHITE, "You're not in a house you own.");
  2590. }
  2591. return 1;
  2592. }*/
  2593. CMD:hbalance(playerid, params[])
  2594. {
  2595. if(Homes[playerid] > 0)
  2596. {
  2597. for(new i; i < MAX_HOUSES; i++)
  2598. {
  2599. if(GetPlayerSQLId(playerid) == HouseInfo[i][hOwnerID] && IsPlayerInRangeOfPoint(playerid, 50, HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]) && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hIntVW] && GetPlayerInterior(playerid) == HouseInfo[i][hIntIW])
  2600. {
  2601. new string[128];
  2602. SendClientMessageEx(playerid, COLOR_GREEN, "|___________________________________ House Safe ___________________________________|");
  2603. format(string, sizeof(string), "Cash: $%s | Pot: %s | Crack: %s | Materials: %s | Meth: %s | Ecstasy: %s | Heroin: %s", number_format(HouseInfo[i][hSafeMoney]), number_format(HouseInfo[i][hPot]), number_format(HouseInfo[i][hCrack]), number_format(HouseInfo[i][hMaterials]), number_format(HouseInfo[i][hMeth]), number_format(HouseInfo[i][hEcstasy]), number_format(HouseInfo[i][hHeroin]));
  2604. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2605. SendClientMessageEx(playerid, COLOR_GREEN, "|__________________________________________________________________________________|");
  2606. return 1;
  2607. }
  2608. }
  2609. SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
  2610. }
  2611. else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
  2612. return 1;
  2613. }
  2614. CMD:closet(playerid, params[])
  2615. {
  2616. if(Homes[playerid] > 0)
  2617. {
  2618. for(new i; i < MAX_HOUSES; i++)
  2619. {
  2620. if(GetPlayerSQLId(playerid) == HouseInfo[i][hOwnerID] && IsPlayerInRangeOfPoint(playerid, 50, HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]) && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hIntVW] && GetPlayerInterior(playerid) == HouseInfo[i][hIntIW])
  2621. {
  2622. if(HouseInfo[i][hClosetX] != 0)
  2623. {
  2624. if(IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[i][hClosetX], HouseInfo[i][hClosetY], HouseInfo[i][hClosetZ]))
  2625. {
  2626. return DisplaySkins(playerid);
  2627. }
  2628. else return SendClientMessageEx(playerid, COLOR_GREY, "You aren't near your closet!");
  2629. }
  2630. else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a closet in this house!");
  2631. }
  2632. }
  2633. SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
  2634. }
  2635. else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
  2636. return 1;
  2637. }
  2638. CMD:closetadd(playerid, params[])
  2639. {
  2640. if(Homes[playerid] > 0)
  2641. {
  2642. for(new i; i < MAX_HOUSES; i++)
  2643. {
  2644. if(GetPlayerSQLId(playerid) == HouseInfo[i][hOwnerID] && IsPlayerInRangeOfPoint(playerid, 50, HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]) && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hIntVW] && GetPlayerInterior(playerid) == HouseInfo[i][hIntIW])
  2645. {
  2646. if(HouseInfo[i][hClosetX] != 0)
  2647. {
  2648. if(IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[i][hClosetX], HouseInfo[i][hClosetY], HouseInfo[i][hClosetZ]))
  2649. {
  2650. CountSkins(playerid);
  2651. if((PlayerInfo[playerid][pDonateRank] <= 0 && PlayerInfo[playerid][pSkins] <= 10) || (PlayerInfo[playerid][pDonateRank] > 0 && PlayerInfo[playerid][pSkins] <= 25))
  2652. {
  2653. new string[128];
  2654. new skinid = GetPlayerSkin(playerid);
  2655. AddSkin(playerid, skinid);
  2656. format(string, sizeof(string), "You have added skin ID %d to your closet.", skinid);
  2657. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2658. return 1;
  2659. }
  2660. else return SendClientMessageEx(playerid, COLOR_GREY, "Your closet doesn't have anymore space for clothes!");
  2661. }
  2662. else return SendClientMessageEx(playerid, COLOR_GREY, "You aren't near your closet!");
  2663. }
  2664. else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a closet in this house!");
  2665. }
  2666. }
  2667. SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
  2668. }
  2669. else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
  2670. return 1;
  2671. }
  2672. CMD:closetremove(playerid, params[])
  2673. {
  2674. if(Homes[playerid] > 0)
  2675. {
  2676. for(new i; i < MAX_HOUSES; i++)
  2677. {
  2678. if(GetPlayerSQLId(playerid) == HouseInfo[i][hOwnerID] && IsPlayerInRangeOfPoint(playerid, 50, HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]) && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hIntVW] && GetPlayerInterior(playerid) == HouseInfo[i][hIntIW])
  2679. {
  2680. if(HouseInfo[i][hClosetX] != 0)
  2681. {
  2682. if(IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[i][hClosetX], HouseInfo[i][hClosetY], HouseInfo[i][hClosetZ]))
  2683. {
  2684. new query[128];
  2685. mysql_format(MainPipeline, query, sizeof(query), "SELECT `skinid` FROM `house_closet` WHERE playerid = %d ORDER BY `skinid` ASC", GetPlayerSQLId(playerid));
  2686. mysql_tquery(MainPipeline, query, "SkinQueryFinish", "ii", playerid, Skin_Query_Delete);
  2687. return 1;
  2688. }
  2689. else return SendClientMessageEx(playerid, COLOR_GREY, "You aren't near your closet!");
  2690. }
  2691. else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a closet in this house!");
  2692. }
  2693. }
  2694. SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
  2695. }
  2696. else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
  2697. return 1;
  2698. }
  2699. CMD:drop(playerid, params[])
  2700. {
  2701. new string[128], amount, choice[32];
  2702. if(sscanf(params, "s[32]D(0)", choice, amount))
  2703. {
  2704. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /drop [name] [(optional) amount]");
  2705. SendClientMessageEx(playerid, COLOR_GREY, "Available names: Weapons, Materials, Packages, Radio, Pizza, Syringes, Backpack, Phone");
  2706. SendClientMessageEx(playerid, COLOR_GREY, "Available names: Pot, Crack, Meth, Ecstasy, Heroin");
  2707. return 1;
  2708. }
  2709. else if(strcmp(choice,"backpack",true) == 0)
  2710. {
  2711. if(PlayerInfo[playerid][pBackpack] > 0)
  2712. {
  2713. ShowPlayerDialogEx(playerid, DIALOG_BDROP, DIALOG_STYLE_MSGBOX, "Drop Backpack Confirmation", "{FFFFFF}Are you sure you would like to drop your backpack?\n{FF8000}Note{FFFFFF}: This will {FF0000}permanently{FFFFFF} remove the backpack and all of its contents!", "Yes", "No");
  2714. }
  2715. else
  2716. {
  2717. SendClientMessageEx(playerid, COLOR_GREY, "You do not have a backpack!");
  2718. }
  2719. }
  2720. else if(strcmp(choice,"syringes",true) == 0)
  2721. {
  2722. if(PlayerInfo[playerid][pSyringes] > 0)
  2723. {
  2724. if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Please specify an amount.");
  2725. if(amount > PlayerInfo[playerid][pSyringes]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many syringes!");
  2726. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  2727. format(string, sizeof(string), "You have dropped %d syringes.", amount);
  2728. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2729. PlayerInfo[playerid][pSyringes] -= amount;
  2730. format(string, sizeof(string), "* %s has thrown away some syringes.", GetPlayerNameEx(playerid));
  2731. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2732. }
  2733. else
  2734. {
  2735. SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any syringes to throw away!");
  2736. }
  2737. }
  2738. else if(strcmp(choice,"pot",true) == 0)
  2739. {
  2740. if(PlayerInfo[playerid][pDrugs][0] > 0)
  2741. {
  2742. if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Please specify an amount.");
  2743. if(amount > PlayerInfo[playerid][pDrugs][0]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many grams of pot!");
  2744. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  2745. format(string, sizeof(string), "You have dropped %d pot.", amount);
  2746. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2747. PlayerInfo[playerid][pDrugs][0] -= amount;
  2748. format(string, sizeof(string), "* %s has thrown away some pot.", GetPlayerNameEx(playerid));
  2749. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2750. }
  2751. else
  2752. {
  2753. SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any pot to throw away!");
  2754. }
  2755. }
  2756. else if(strcmp(choice,"crack",true) == 0)
  2757. {
  2758. if(PlayerInfo[playerid][pDrugs][1] > 0)
  2759. {
  2760. if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Please specify an amount.");
  2761. if(amount > PlayerInfo[playerid][pDrugs][1]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many grams of crack!");
  2762. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  2763. format(string, sizeof(string), "You have dropped %d crack.", amount);
  2764. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2765. PlayerInfo[playerid][pDrugs][1] -= amount;
  2766. format(string, sizeof(string), "* %s has thrown away some crack.", GetPlayerNameEx(playerid));
  2767. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2768. }
  2769. else
  2770. {
  2771. SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any crack to throw away!");
  2772. }
  2773. }
  2774. else if(strcmp(choice,"meth",true) == 0)
  2775. {
  2776. if(PlayerInfo[playerid][pDrugs][2] > 0)
  2777. {
  2778. if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Please specify an amount.");
  2779. if(amount > PlayerInfo[playerid][pDrugs][2]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many grams of meth!");
  2780. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  2781. format(string, sizeof(string), "You have dropped %d meth.", amount);
  2782. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2783. PlayerInfo[playerid][pDrugs][2] -= amount;
  2784. format(string, sizeof(string), "* %s has thrown away some meth.", GetPlayerNameEx(playerid));
  2785. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2786. }
  2787. else
  2788. {
  2789. SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any meth to throw away!");
  2790. }
  2791. }
  2792. else if(strcmp(choice,"ecstasy",true) == 0)
  2793. {
  2794. if(PlayerInfo[playerid][pDrugs][3] > 0)
  2795. {
  2796. if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Please specify an amount.");
  2797. if(amount > PlayerInfo[playerid][pDrugs][3]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many grams of ecstasy!");
  2798. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  2799. format(string, sizeof(string), "You have dropped %d ecstasy.", amount);
  2800. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2801. PlayerInfo[playerid][pDrugs][3] -= amount;
  2802. format(string, sizeof(string), "* %s has thrown away some ecstasy.", GetPlayerNameEx(playerid));
  2803. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2804. }
  2805. else
  2806. {
  2807. SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any ecstasy to throw away!");
  2808. }
  2809. }
  2810. else if(strcmp(choice,"heroin",true) == 0)
  2811. {
  2812. if(PlayerInfo[playerid][pDrugs][4] > 0)
  2813. {
  2814. if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Please specify an amount.");
  2815. if(amount > PlayerInfo[playerid][pDrugs][4]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many grams of heroin!");
  2816. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  2817. format(string, sizeof(string), "You have dropped %d heroin.", amount);
  2818. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2819. PlayerInfo[playerid][pDrugs][4] -= amount;
  2820. format(string, sizeof(string), "* %s has thrown away some heroin.", GetPlayerNameEx(playerid));
  2821. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2822. }
  2823. else
  2824. {
  2825. SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any heroin to throw away!");
  2826. }
  2827. }
  2828. else if(strcmp(choice,"materials",true) == 0)
  2829. {
  2830. if(PlayerInfo[playerid][pMats] > 0)
  2831. {
  2832. if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Please specify an amount.");
  2833. if(amount > PlayerInfo[playerid][pMats]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many materials!");
  2834. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  2835. format(string, sizeof(string), "You have dropped %d materials.", amount);
  2836. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2837. format(string, sizeof(string), "* %s has thrown away some materials.", GetPlayerNameEx(playerid));
  2838. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2839. PlayerInfo[playerid][pMats] -= amount;
  2840. }
  2841. else
  2842. {
  2843. SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any materials to throw away!");
  2844. }
  2845. }
  2846. else if(strcmp(choice,"radio",true) == 0)
  2847. {
  2848. if(PlayerInfo[playerid][pRadio] != 0)
  2849. {
  2850. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  2851. format(string, sizeof(string), "* %s has thrown away their portable radio.", GetPlayerNameEx(playerid));
  2852. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2853. PlayerInfo[playerid][pRadio] = 0;
  2854. PlayerInfo[playerid][pRadioFreq] = 0;
  2855. }
  2856. else
  2857. {
  2858. SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying a portable radio to throw away!");
  2859. }
  2860. }
  2861. else if(strcmp(choice,"weapons",true) == 0)
  2862. {
  2863. if(GetPVarType(playerid, "IsInArena"))
  2864. {
  2865. SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in an arena!");
  2866. return 1;
  2867. }
  2868. if(GetPVarInt( playerid, "EventToken") != 0)
  2869. {
  2870. SendClientMessageEx(playerid, COLOR_GREY, "You can't use this while you're in an event.");
  2871. return 1;
  2872. }
  2873. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  2874. ResetPlayerWeaponsEx(playerid);
  2875. format(string, sizeof(string), "* %s has thrown away their Weapons.", GetPlayerNameEx(playerid));
  2876. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2877. }
  2878. else if(strcmp(choice,"packages",true) == 0)
  2879. {
  2880. if(GetPVarInt(playerid, "Packages") > 0)
  2881. {
  2882. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  2883. format(string, sizeof(string), "* %s has thrown away their material packages.", GetPlayerNameEx(playerid));
  2884. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2885. DeletePVar(playerid, "Packages");
  2886. }
  2887. else
  2888. {
  2889. SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any material packages to throw away!");
  2890. }
  2891. }
  2892. else if(strcmp(choice,"pizza",true) == 0)
  2893. {
  2894. if(GetPVarType(playerid, "Pizza"))
  2895. {
  2896. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  2897. format(string, sizeof(string), "* %s has thrown away their pizza delivery.", GetPlayerNameEx(playerid));
  2898. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2899. DeletePVar(playerid, "Pizza");
  2900. DeletePVar(playerid, "pizzaTimer");
  2901. }
  2902. else
  2903. {
  2904. SendClientMessageEx(playerid, COLOR_GREY, "You are not delivering any pizzas!");
  2905. }
  2906. }
  2907. else if(strcmp(choice,"phone", true) == 0)
  2908. {
  2909. if(PlayerInfo[playerid][pPnumber] != 0)
  2910. {
  2911. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  2912. format(string, sizeof(string), "* %s throws away their phone.", GetPlayerNameEx(playerid));
  2913. ProxChatBubble(playerid, string);
  2914. PlayerInfo[playerid][pPnumber] = 0;
  2915. }
  2916. else
  2917. {
  2918. SendClientMessageEx(playerid, COLOR_GREY, "You don't have a phone.");
  2919. }
  2920. }
  2921. else
  2922. {
  2923. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /drop [name] [(optional) amount]");
  2924. SendClientMessageEx(playerid, COLOR_GREY, "Available names: Weapons, Materials, Packages, Radio, Pizza, Syringes, Backpack, Phone");
  2925. return SendClientMessageEx(playerid, COLOR_GREY, "Available names: Pot, Crack, Meth, Ecstasy, Heroin");
  2926. }
  2927. return 1;
  2928. }
  2929. CMD:show(playerid, params[])
  2930. {
  2931. new string[128], giveplayerid, choice[32];
  2932. if(sscanf(params, "us[32]", giveplayerid, choice))
  2933. {
  2934. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /show [player] [name]");
  2935. SendClientMessageEx(playerid, COLOR_GREY, "Available names: Pot, Crack, Meth, Ecstasy, Heroin, Materials, Credits");
  2936. return 1;
  2937. }
  2938. if(giveplayerid == playerid)
  2939. {
  2940. SendClientMessageEx(playerid, COLOR_GREY, "You can not show this to yourself!");
  2941. return 1;
  2942. }
  2943. if(IsPlayerConnected(giveplayerid))
  2944. {
  2945. if(giveplayerid != INVALID_PLAYER_ID)
  2946. {
  2947. if (!ProxDetectorS(5.0, playerid, giveplayerid))
  2948. {
  2949. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  2950. return 1;
  2951. }
  2952. if (strcmp(choice, "materials", true) == 0)
  2953. {
  2954. new amount = PlayerInfo[playerid][pMats];
  2955. if(amount < 1)
  2956. {
  2957. SendClientMessageEx(playerid, COLOR_GREY, "You do not have any materials!");
  2958. return 1;
  2959. }
  2960. format(string, sizeof(string), "%s has shown you their %d materials.", GetPlayerNameEx(playerid), amount);
  2961. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2962. format(string, sizeof(string), "You have shown %s your %d materials.", GetPlayerNameEx(giveplayerid), amount);
  2963. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  2964. format(string, sizeof(string), "* %s has shown %s some materials.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  2965. ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2966. return 1;
  2967. }
  2968. if (strcmp(choice, "pot", true) == 0)
  2969. {
  2970. new amount = PlayerInfo[playerid][pDrugs][0];
  2971. if(amount < 1)
  2972. {
  2973. SendClientMessageEx(playerid, COLOR_GREY, "You do not have any pot!");
  2974. return 1;
  2975. }
  2976. format(string, sizeof(string), "%s has shown you their %d grams of pot.", GetPlayerNameEx(playerid), amount);
  2977. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2978. format(string, sizeof(string), "You have shown %s your %d grams of pot.", GetPlayerNameEx(giveplayerid), amount);
  2979. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  2980. format(string, sizeof(string), "* %s has shown %s some pot.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  2981. ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2982. return 1;
  2983. }
  2984. if (strcmp(choice, "crack", true) == 0)
  2985. {
  2986. new amount = PlayerInfo[playerid][pDrugs][1];
  2987. if(amount < 1)
  2988. {
  2989. SendClientMessageEx(playerid, COLOR_GREY, "You do not have any crack!");
  2990. return 1;
  2991. }
  2992. format(string, sizeof(string), "%s has shown you their %d grams of crack.", GetPlayerNameEx(playerid), amount);
  2993. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2994. format(string, sizeof(string), "You have shown %s your %d grams of crack.", GetPlayerNameEx(giveplayerid), amount);
  2995. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  2996. format(string, sizeof(string), "* %s has shown %s some crack.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  2997. ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2998. return 1;
  2999. }
  3000. if (strcmp(choice, "meth", true) == 0)
  3001. {
  3002. new amount = PlayerInfo[playerid][pDrugs][2];
  3003. if(amount < 1)
  3004. {
  3005. SendClientMessageEx(playerid, COLOR_GREY, "You do not have any meth!");
  3006. return 1;
  3007. }
  3008. format(string, sizeof(string), "%s has shown you their %d grams of meth.", GetPlayerNameEx(playerid), amount);
  3009. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  3010. format(string, sizeof(string), "You have shown %s your %d grams of meth.", GetPlayerNameEx(giveplayerid), amount);
  3011. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  3012. format(string, sizeof(string), "* %s has shown %s some meth.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  3013. ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  3014. return 1;
  3015. }
  3016. if (strcmp(choice, "ecstasy", true) == 0)
  3017. {
  3018. new amount = PlayerInfo[playerid][pDrugs][3];
  3019. if(amount < 1)
  3020. {
  3021. SendClientMessageEx(playerid, COLOR_GREY, "You do not have any ecstasy!");
  3022. return 1;
  3023. }
  3024. format(string, sizeof(string), "%s has shown you their %d grams of ecstasy.", GetPlayerNameEx(playerid), amount);
  3025. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  3026. format(string, sizeof(string), "You have shown %s your %d grams of ecstasy.", GetPlayerNameEx(giveplayerid), amount);
  3027. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  3028. format(string, sizeof(string), "* %s has shown %s some ecstasy.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  3029. ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  3030. return 1;
  3031. }
  3032. if (strcmp(choice, "heroin", true) == 0)
  3033. {
  3034. new amount = PlayerInfo[playerid][pDrugs][4];
  3035. if(amount < 1)
  3036. {
  3037. SendClientMessageEx(playerid, COLOR_GREY, "You do not have any heroin!");
  3038. return 1;
  3039. }
  3040. format(string, sizeof(string), "%s has shown you their %d milligrams of heroin.", GetPlayerNameEx(playerid), amount);
  3041. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  3042. format(string, sizeof(string), "You have shown %s your %d milligrams of heroin.", GetPlayerNameEx(giveplayerid), amount);
  3043. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  3044. format(string, sizeof(string), "* %s has shown %s some heroin.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  3045. ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  3046. return 1;
  3047. }
  3048. if (strcmp(choice, "credits", true) == 0)
  3049. {
  3050. new amount = PlayerInfo[playerid][pCredits];
  3051. if(amount < 1)
  3052. {
  3053. SendClientMessageEx(playerid, COLOR_GREY, "You do not have any credits!");
  3054. return 1;
  3055. }
  3056. format(string, sizeof(string), "%s has shown you their %d credits.", GetPlayerNameEx(playerid), amount);
  3057. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  3058. format(string, sizeof(string), "You have shown %s your %d credits.", GetPlayerNameEx(giveplayerid), amount);
  3059. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  3060. format(string, sizeof(string), "* %s has shown %s some credits.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  3061. ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  3062. return 1;
  3063. }
  3064. }
  3065. }
  3066. return 1;
  3067. }
  3068. CMD:sell(playerid, params[])
  3069. {
  3070. new string[128], giveplayerid, choice[32], amount, price;
  3071. if(sscanf(params, "us[32]dd", giveplayerid, choice, amount, price))
  3072. {
  3073. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /sell [player] [name] [amount] [price]");
  3074. SendClientMessageEx(playerid, COLOR_GREY, "Available names: Pot, Crack, Materials, Firework, Syringes, Rawopium, Heroin, RimKit, Carvoucher, PVIPVoucher");
  3075. return 1;
  3076. }
  3077. if(PlayerCuffed[playerid] >= 1 || GetPVarInt(playerid, "pBagged") >= 1 ||PlayerInfo[playerid][pHospital] > 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now.");
  3078. if(GetPVarInt(playerid, "WatchingTV")) return SendClientMessageEx(playerid, COLOR_GREY, "You can not do this while watching TV!");
  3079. if(price < 50000) return SendClientMessageEx(playerid, COLOR_GREY, "Price can't be lower than $50,000. Use /give for deals below the scam limit.");
  3080. if(price > 500000000) return SendClientMessageEx(playerid, COLOR_GREY, "Price can't be lower than $50,000. Use /give for deals below the scam limit.");
  3081. if(price > 100000000)
  3082. {
  3083. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s is trying to sell %s to %s for $%d.", GetPlayerNameEx(playerid), choice, GetPlayerNameEx(giveplayerid), price);
  3084. ABroadCast(COLOR_YELLOW, string, 2);
  3085. }
  3086. if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Amount cannot be below 1.");
  3087. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  3088. if(playerid == giveplayerid) return SendClientMessageEx(playerid, COLOR_GREY, "You can't sell to yourself!");
  3089. if(!ProxDetectorS(8.0, playerid, giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  3090. else if (strcmp(choice, "rimkit", true) == 0)
  3091. {
  3092. if(amount > PlayerInfo[playerid][pRimMod])
  3093. return SendClientMessageEx(playerid, COLOR_GREY, " You don't have that many rim kits.");
  3094. format(string, sizeof(string), "* You offered %s to buy %d rim kits for $%s.", GetPlayerNameEx(giveplayerid), amount, number_format(price));
  3095. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  3096. format(string, sizeof(string), "* %s wants to sell you %d rim kits for $%s, (type /accept rimkit) to buy.", GetPlayerNameEx(playerid), amount, number_format(price));
  3097. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  3098. SetPVarInt(giveplayerid, "RimOffer", playerid);
  3099. SetPVarInt(giveplayerid, "RimPrice", price);
  3100. SetPVarInt(giveplayerid, "RimCount", amount);
  3101. SetPVarInt(giveplayerid, "RimSeller_SQLId", GetPlayerSQLId(playerid));
  3102. }
  3103. else if (strcmp(choice, "pvipvoucher", true) == 0)
  3104. {
  3105. if(amount > PlayerInfo[playerid][pPVIPVoucher])
  3106. return SendClientMessageEx(playerid, COLOR_GREY, " You don't have that many 1 month PVIP Vouchers.");
  3107. format(string, sizeof(string), "* You offered %s to buy %d 1 month PVIP Voucher(s) for $%s.", GetPlayerNameEx(giveplayerid), amount, number_format(price));
  3108. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  3109. format(string, sizeof(string), "* %s wants to sell you %d 1 month PVIP Voucher(s) for $%s, (type /accept pvipvoucher) to buy.", GetPlayerNameEx(playerid), amount, number_format(price));
  3110. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  3111. SetPVarInt(giveplayerid, "PVIPVoucherOffer", playerid);
  3112. SetPVarInt(giveplayerid, "PVIPVoucherPrice", price);
  3113. SetPVarInt(giveplayerid, "PVIPVoucherCount", amount);
  3114. SetPVarInt(giveplayerid, "PVIPVoucherSeller_SQLId", GetPlayerSQLId(playerid));
  3115. }
  3116. return 1;
  3117. }