| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355 |
- /*
- /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
- | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
- | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
- | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
- | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
- | $$\ $$$| $$ \ $$ | $$ \ $$| $$
- | $$ \ $$| $$$$$$/ | $$ | $$| $$
- |__/ \__/ \______/ |__/ |__/|__/
- Storage System
- Next Generation Gaming, LLC
- (created by Next Generation Gaming Development Team)
-
- * Copyright (c) 2016, Next Generation Gaming, LLC
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are not permitted in any case.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- #include <YSI\y_hooks>
- stock ShowStorageEquipDialog(playerid)
- {
- if(gPlayerLogged{playerid} != 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You are not logged in!");
- new dialogstring[256];
- new epstring[][] = { "Unequipped", "Equipped", "Not Owned" };
- for(new i = 0; i < 3; i++)
- {
- format(dialogstring, sizeof(dialogstring), "%s%s", dialogstring, storagetype[i+1]);
- if(StorageInfo[playerid][i][sStorage] != 1) format(dialogstring, sizeof(dialogstring), "%s (%s)\n", dialogstring, epstring[2]);
- else format(dialogstring, sizeof(dialogstring), "%s (%s)\n", dialogstring, epstring[StorageInfo[playerid][i][sAttached]]);
- }
- ShowPlayerDialogEx(playerid, STORAGEEQUIP, DIALOG_STYLE_LIST, "Storage - Equip/Unequip", dialogstring, "Select", "Exit");
- return 1;
- }
- /*stock ShowStorageDialog(playerid, fromplayerid, fromstorageid, itemid, amount, price, special)
- {
- new titlestring[128], dialogstring[512];
- SetPVarInt(playerid, "Storage_transaction", 1); // Prevent double transactions.
- SetPVarInt(playerid, "Storage_fromplayerid", fromplayerid);
- SetPVarInt(playerid, "Storage_fromstorageid", fromstorageid);
- SetPVarInt(playerid, "Storage_itemid", itemid);
- SetPVarInt(playerid, "Storage_amount", amount);
- SetPVarInt(playerid, "Storage_price", price);
- SetPVarInt(playerid, "Storage_special", special);
- if(price == -1) format(titlestring, sizeof(titlestring), "Where do you want to store %d %s?", amount, itemtype[itemid]);
- else format(titlestring, sizeof(titlestring), "You are buying %d %s for %d", amount, itemtype[itemid], price);
- switch(itemid)
- {
- case 1:
- {
- format(dialogstring, sizeof(dialogstring), "Hand/Pocket - ($%d)\n", PlayerInfo[playerid][pCash]);
- for(new i = 0; i < 3; i++)
- {
- if(StorageInfo[playerid][i][sAttached] == 1)
- {
- format(dialogstring, sizeof(dialogstring), "%s(%s) - ($%d/$%d)\n", dialogstring, storagetype[i+1], StorageInfo[playerid][i][sCash], limits[i+1][0]);
- }
- }
- //format(dialogstring, sizeof(dialogstring), "Hand/Pocket - ($%d)\nBag - ($%d/$%d)\nBackpack - ($%d/$%d)\nBriefcase - ($%d/$%d)",
- //PlayerInfo[playerid][pCash],
- //StorageInfo[playerid][0][sCash],
- //bbackpacklimit[itemid-1],
- //StorageInfo[playerid][1][sCash],
- //backpacklimit[itemid-1],
- //StorageInfo[playerid][2][sCash],
- //briefcaselimit[itemid-1]
- //);
- }
- case 2:
- {
- format(dialogstring, sizeof(dialogstring), "Hand/Pocket - (%d)\n", PlayerInfo[playerid][pPot]);
- for(new i = 0; i < 3; i++)
- {
- if(StorageInfo[playerid][i][sAttached] == 1)
- {
- format(dialogstring, sizeof(dialogstring), "%s(%s) - (%d/%d)\n", dialogstring, storagetype[i+1], StorageInfo[playerid][i][sPot], limits[i+1][0]);
- }
- }
- //format(dialogstring, sizeof(dialogstring), "Hand/Pocket - (%d/%d)\nBag - (%d/%d)\nBackpack - (%d/%d)\nBriefcase - (%d/%d)",
- //PlayerInfo[playerid][pPot],
- //onhandlimit[itemid-1],
- //StorageInfo[playerid][0][sPot],
- //bbackpacklimit[itemid-1],
- //StorageInfo[playerid][1][sPot],
- //backpacklimit[itemid-1],
- //StorageInfo[playerid][2][sPot],
- //briefcaselimit[itemid-1]
- //);
- }
- case 3:
- {
- format(dialogstring, sizeof(dialogstring), "Hand/Pocket - ($%d)\n", PlayerInfo[playerid][pCrack]);
- for(new i = 0; i < 3; i++)
- {
- if(StorageInfo[playerid][i][sAttached] == 1)
- {
- format(dialogstring, sizeof(dialogstring), "%s(%s) - (%d/%d)\n", dialogstring, storagetype[i+1], StorageInfo[playerid][i][sCrack], limits[i+1][0]);
- }
- }
- //format(dialogstring, sizeof(dialogstring), "Hand/Pocket - (%d/%d)\nBag - (%d/%d)\nBackpack - (%d/%d)\nBriefcase - (%d/%d)",
- //PlayerInfo[playerid][pCrack],
- //onhandlimit[itemid-1],
- //StorageInfo[playerid][0][sCrack],
- //bbackpacklimit[itemid-1],
- //StorageInfo[playerid][1][sCrack],
- //backpacklimit[itemid-1],
- //StorageInfo[playerid][2][sCrack],
- //briefcaselimit[itemid-1]
- //);
- }
- case 4:
- {
- format(dialogstring, sizeof(dialogstring), "Hand/Pocket - (%d)\n", PlayerInfo[playerid][pMats]);
- for(new i = 0; i < 3; i++)
- {
- if(StorageInfo[playerid][i][sAttached] == 1)
- {
- format(dialogstring, sizeof(dialogstring), "%s(%s) - (%d/%d)\n", dialogstring, storagetype[i+1], StorageInfo[playerid][i][sMats], limits[i+1][3]);
- }
- }
- //format(dialogstring, sizeof(dialogstring), "Hand/Pocket - (%d/%d)\nBag - (%d/%d)\nBackpack - (%d/%d)\nBriefcase - (%d/%d)",
- //PlayerInfo[playerid][pMats],
- //onhandlimit[itemid-1],
- //StorageInfo[playerid][0][sMats],
- //bbackpacklimit[itemid-1],
- //StorageInfo[playerid][1][sMats],
- //backpacklimit[itemid-1],
- //StorageInfo[playerid][2][sMats],
- //briefcaselimit[itemid-1]
- //);
- }
- }
- ShowPlayerDialogEx(playerid, STORAGESTORE, DIALOG_STYLE_LIST, titlestring, dialogstring, "Choose", "Cancel");
- }
- stock DeathDrop(playerid)
- {
- new storageid;
- new bool:itemEquipped = false;
- for(new i = 0; i < 3; i++)
- {
- if(StorageInfo[playerid][i][sAttached] == 1) {
- storageid = i;
- if(storageid != 0) itemEquipped = true; // Bag is exempted from death drops.
- }
- }
- if(itemEquipped == true)
- {
- new rand = random(101);
- switch (PlayerInfo[playerid][pDonateRank])
- {
- case 0: // Normal (50 Percent)
- {
- if(rand > 0 && rand <= 50) {
- StorageInfo[playerid][storageid][sCash] = 0;
- StorageInfo[playerid][storageid][sPot] = 0;
- StorageInfo[playerid][storageid][sCrack] = 0;
- StorageInfo[playerid][storageid][sMats] = 0;
- return SendClientMessageEx(playerid, COLOR_RED, "You have lost all items within your storage device.");
- }
- else return SendClientMessageEx(playerid, COLOR_YELLOW, "Luck is on your side today, you didn't lose any items within your storage device.");
- }
- case 1: // BVIP (40 Percent)
- {
- if(rand > 0 && rand <= 40) {
- StorageInfo[playerid][storageid][sCash] = 0;
- StorageInfo[playerid][storageid][sPot] = 0;
- StorageInfo[playerid][storageid][sCrack] = 0;
- StorageInfo[playerid][storageid][sMats] = 0;
- return SendClientMessageEx(playerid, COLOR_RED, "You have lost all items within your storage device.");
- }
- else return SendClientMessageEx(playerid, COLOR_YELLOW, "Luck is on your side today, you didn't lose any items within your storage device.");
- }
- case 2: // SVIP (30 Percent)
- {
- if(rand > 0 && rand <= 30) {
- StorageInfo[playerid][storageid][sCash] = 0;
- StorageInfo[playerid][storageid][sPot] = 0;
- StorageInfo[playerid][storageid][sCrack] = 0;
- StorageInfo[playerid][storageid][sMats] = 0;
- return SendClientMessageEx(playerid, COLOR_RED, "You have lost all items within your storage device.");
- }
- else return SendClientMessageEx(playerid, COLOR_YELLOW, "Luck is on your side today, you didn't lose any items within your storage device.");
- }
- case 3: // GVIP (20 Percent)
- {
- if(rand > 0 && rand <= 20) {
- StorageInfo[playerid][storageid][sCash] = 0;
- StorageInfo[playerid][storageid][sPot] = 0;
- StorageInfo[playerid][storageid][sCrack] = 0;
- StorageInfo[playerid][storageid][sMats] = 0;
- return SendClientMessageEx(playerid, COLOR_RED, "You have lost all items within your storage device.");
- }
- else return SendClientMessageEx(playerid, COLOR_YELLOW, "Luck is on your side today, you didn't lose any items within your storage device.");
- }
- case 4: // PVIP (No Chance)
- {
- return SendClientMessageEx(playerid, COLOR_YELLOW, "Since you are Platinum VIP, you lose nothing from storage device.");
- }
- case 5: // Moderator (No Chance)
- {
- return SendClientMessageEx(playerid, COLOR_YELLOW, "Since you are (Moderator) Platinum VIP, you lose nothing from storage device.");
- }
- }
- }
- return 1;
- }
- // Doc Usage:
- // playerid - Person Reciving the Item's Amount. (Who is storing the amount)
- // storageid - PlayerID's storage index. (Where to store sending amount)
- // fromplayerid - Person Giving the Item's Amount. (Notice: Use -1 if from a non-player, script-based etc.).
- // fromstorageid - FromStorageID's storage index. (Notice: Use -1 if from a non-player, script-based etc.)
- // itemid - ItemID index that is tradeing, used for both. (What is storing)
- // amount - The amount of ItemID that is tradeing, used for both. (What amount is storing)
- // price - The price of the transaction (in pCash), sent to playerid from sender. (Notice: Use -1 if no price is required)
- // special - Set this to 1 if function is being used by skills or other things. (Notice: Use -1 if no special is required)
- // ItemIDs:
- // 0 - Nothing
- // 1 - Cash
- // 2 - Pot
- // 3 - Crack
- // 4 - Materials
- // StorageIDs:
- // 0 - Pocket/OnHand
- // 1 - Bag
- // 2 - Backpack
- // 3 - Briefcase
- */
- stock TransferStorage(playerid, storageid, fromplayerid, fromstorageid, itemid, amount, price, special)
- {
- if(playerid == fromplayerid)
- {
- return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR! You cannot transfer from yourself to yourself");
- }
- storageid=0; fromstorageid=0; //temp
- //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);
- if(GetPVarInt(playerid, "Storage_transaction") == 1)
- {
- if(fromplayerid != -1 && fromstorageid != -1) {
- SendClientMessageEx(fromplayerid, COLOR_WHITE, "Player is busy with an existing transaction.");
- }
- return 0;
- }
- new string[128];
- // Disable Prices for Cash Transfers
- if(price != -1 && itemid == 1) price = -1;
- // Ask the player where to store
- if(storageid == -1)
- {
- //UNCOMMENT WHEN RE RELEASE
- //ShowStorageDialog(playerid, fromplayerid, fromstorageid, itemid, amount, price, special);
- return 0;
- }
- // Check if such item is equipped.
- if(storageid > 0 && storageid < 4)
- {
- if(StorageInfo[playerid][storageid-1][sAttached] == 0)
- {
- format(string, sizeof(string), "You don't have the %s equipped!", storagetype[storageid]);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(!IsPlayerConnected(fromplayerid)) return 0;
- if(amount < 0) return 0;
- if(fromstorageid > 0 && fromstorageid < 4)
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sAttached] == 0)
- {
- format(string, sizeof(string), "You don't have the %s equipped!", storagetype[fromstorageid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- }
- if(special == 1 && itemid == 2) // Pot Special "Selling"
- {
- ExtortionTurfsWarsZone(PotOffer[playerid], 0, PotPrice[playerid]);
- GivePlayerCash(PotOffer[playerid], PotPrice[playerid]);
- GivePlayerCash(playerid, -PotPrice[playerid]);
- if(PlayerInfo[PotOffer[playerid]][pDoubleEXP] > 0)
- {
- 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]);
- SendClientMessageEx(PotOffer[playerid], COLOR_YELLOW, string);
- PlayerInfo[PotOffer[playerid]][pDrugSmuggler] += 2;
- }
- else
- {
- PlayerInfo[PotOffer[playerid]][pDrugSmuggler] += 1;
- }
- if(PlayerInfo[PotOffer[playerid]][pDrugSmuggler] == 50)
- { SendClientMessageEx(PotOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 2, you can buy more Grams and Cheaper."); }
- else if(PlayerInfo[PotOffer[playerid]][pDrugSmuggler] == 100)
- { SendClientMessageEx(PotOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 3, you can buy more Grams and Cheaper."); }
- else if(PlayerInfo[PotOffer[playerid]][pDrugSmuggler] == 200)
- { SendClientMessageEx(PotOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 4, you can buy more Grams and Cheaper."); }
- else if(PlayerInfo[PotOffer[playerid]][pDrugSmuggler] == 400)
- { SendClientMessageEx(PotOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 5, you can buy more Grams and Cheaper."); }
- OnPlayerStatsUpdate(playerid);
- OnPlayerStatsUpdate(PotOffer[playerid]);
- PotOffer[playerid] = INVALID_PLAYER_ID;
- PotStorageID[playerid] = -1;
- PotPrice[playerid] = 0;
- PotGram[playerid] = 0;
- }
- if(special == 1 && itemid == 3) // Crack Special "Selling"
- {
- ExtortionTurfsWarsZone(CrackOffer[playerid], 0, CrackPrice[playerid]);
- GivePlayerCash(CrackOffer[playerid], CrackPrice[playerid]);
- GivePlayerCash(playerid, -CrackPrice[playerid]);
- if(PlayerInfo[CrackOffer[playerid]][pDoubleEXP] > 0)
- {
- 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]);
- SendClientMessageEx(CrackOffer[playerid], COLOR_YELLOW, string);
- PlayerInfo[CrackOffer[playerid]][pDrugSmuggler] += 2;
- }
- else
- {
- PlayerInfo[CrackOffer[playerid]][pDrugSmuggler] += 1;
- }
- PlayerInfo[playerid][pDrugs][2] += CrackGram[playerid];
- PlayerInfo[CrackOffer[playerid]][pDrugs][2] -= CrackGram[playerid];
- if(PlayerInfo[CrackOffer[playerid]][pDrugSmuggler] == 50)
- { SendClientMessageEx(CrackOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 2, you can buy more Grams and Cheaper."); }
- else if(PlayerInfo[CrackOffer[playerid]][pDrugSmuggler] == 100)
- { SendClientMessageEx(CrackOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 3, you can buy more Grams and Cheaper."); }
- else if(PlayerInfo[CrackOffer[playerid]][pDrugSmuggler] == 200)
- { SendClientMessageEx(CrackOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 4, you can buy more Grams and Cheaper."); }
- else if(PlayerInfo[CrackOffer[playerid]][pDrugSmuggler] == 400)
- { SendClientMessageEx(CrackOffer[playerid], COLOR_YELLOW, "* Your Drug Dealer Skill is now Level 5, you can buy more Grams and Cheaper."); }
- OnPlayerStatsUpdate(playerid);
- OnPlayerStatsUpdate(CrackOffer[playerid]);
- CrackOffer[playerid] = INVALID_PLAYER_ID;
- CrackStorageID[playerid] = -1;
- CrackPrice[playerid] = 0;
- CrackGram[playerid] = 0;
- }
- if(special == 2 && itemid == 2) // Pot Special "Getting"
- {
- new mypoint = -1;
- for (new i=0; i<MAX_POINTS; i++)
- {
- if (IsPlayerInRangeOfPoint(playerid, 3.0, Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && Points[i][Type] == 3)
- {
- new myvw = GetPlayerVirtualWorld(playerid);
- if(myvw == Points[i][pointVW3])
- {
- mypoint = i;
- }
- }
- }
- if(PlayerInfo[playerid][pDonateRank] < 1)
- {
- Points[mypoint][Stock] -= amount;
- format(string, sizeof(string), " Pot/OPIUM AVAILABLE: %d/1000.", Points[mypoint][Stock]);
- UpdateDynamic3DTextLabelText(Points[mypoint][TextLabel], COLOR_YELLOW, string);
- }
- for(new i = 0; i < MAX_GROUPS; i++)
- {
- if(strcmp(Points[mypoint][Owner], arrGroupData[i][g_szGroupName], true) == 0)
- {
- arrGroupData[i][g_iBudget] += price/2;
- }
- }
- }
- if(special == 2 && itemid == 3) // Crack Special "Getting"
- {
- new mypoint = -1;
- for (new i=0; i<MAX_POINTS; i++)
- {
- if (IsPlayerInRangeOfPoint(playerid, 3.0, Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && Points[i][Type] == 4)
- {
- new myvw = GetPlayerVirtualWorld(playerid);
- if(myvw == Points[i][pointVW3])
- {
- mypoint = i;
- }
- }
- }
- if(PlayerInfo[playerid][pDonateRank] < 1)
- {
- Points[mypoint][Stock] -= amount;
- format(string, sizeof(string), " CRACK AVAILABLE: %d/500.", Points[mypoint][Stock]);
- UpdateDynamic3DTextLabelText(Points[mypoint][TextLabel], COLOR_YELLOW, string);
- }
- for(new i = 0; i < MAX_GROUPS; i++)
- {
- if(strcmp(Points[mypoint][Owner], arrGroupData[i][g_szGroupName], true) == 0)
- {
- arrGroupData[i][g_iBudget] += price/2;
- }
- }
- }
- if(special == 2 && itemid == 4) // Materials Special "Getting"
- {
- DeletePVar(playerid, "Packages");
- DeletePVar(playerid, "MatDeliver");
- DisablePlayerCheckpoint(playerid);
- }
- if(special == 4 && itemid == 1) // House Withdraw - Cash
- {
- new houseid = GetPVarInt(playerid, "Special_HouseID");
- DeletePVar(playerid, "Special_HouseID");
- HouseInfo[houseid][hSafeMoney] -= amount;
- }
- if(special == 4 && itemid == 2) // House Withdraw - Pot
- {
- new houseid = GetPVarInt(playerid, "Special_HouseID");
- DeletePVar(playerid, "Special_HouseID");
- HouseInfo[houseid][hPot] -= amount;
- }
- if(special == 4 && itemid == 3) // House Withdraw - Crack
- {
- new houseid = GetPVarInt(playerid, "Special_HouseID");
- DeletePVar(playerid, "Special_HouseID");
- HouseInfo[houseid][hCrack] -= amount;
- }
- if(special == 4 && itemid == 4) // House Withdraw - Mats
- {
- new houseid = GetPVarInt(playerid, "Special_HouseID");
- DeletePVar(playerid, "Special_HouseID");
- HouseInfo[houseid][hMaterials] -= amount;
- }
- switch(storageid)
- {
- case 0: // Pocket or On Hand
- {
- if(itemid == 1)
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pCash] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sCash] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pCash] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sCash] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- PlayerInfo[playerid][pCash] += amount;
- OnPlayerStatsUpdate(playerid);
- if(fromplayerid != -1) {
- OnPlayerStatsUpdate(fromplayerid);
- }
- format(string, sizeof(string), "$%d has been transfered to your Pocket ($%d).", amount, PlayerInfo[playerid][pCash]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "$%d has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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));
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given $%s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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));
- Log("logs/pay.log", string);
- 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));
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- if(itemid == 2 && (PlayerInfo[playerid][pDrugs][1] + amount <= onhandlimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pDrugs][1] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sPot] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][1] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sPot] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- PlayerInfo[playerid][pDrugs][1] += amount;
- format(string, sizeof(string), "%d Pot has been transfered to your Pocket (%d).", amount, PlayerInfo[playerid][pDrugs][1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "%d Pot has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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));
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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));
- Log("logs/pay.log", string);
- 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));
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- if(itemid == 3 && (PlayerInfo[playerid][pDrugs][2] + amount <= onhandlimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pDrugs][2] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sCrack] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][2] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sCrack] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- PlayerInfo[playerid][pDrugs][2] += amount;
- format(string, sizeof(string), "%d Crack has been transfered to your Pocket (%d).", amount, PlayerInfo[playerid][pDrugs][2]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "%d Crack has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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));
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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));
- Log("logs/pay.log", string);
- 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));
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- if(itemid == 4 && (PlayerInfo[playerid][pMats] + amount <= onhandlimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pMats] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give %d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sMats] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give %d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pMats] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sMats] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- PlayerInfo[playerid][pMats] += amount;
- //format(string, sizeof(string), "%d Materials has been transfered to your Pocket (%d/%d).", amount, PlayerInfo[playerid][pMats], onhandlimit[itemid-1]);
- format(string, sizeof(string), "%s Materials has been transfered to your Pocket (%s).", number_format(amount), number_format(PlayerInfo[playerid][pMats]));
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "%d Materials has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- new ipplayerid[16], ipfromplayerid[16];
- GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
- GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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);
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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);
- Log("logs/pay.log", string);
- 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);
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- /*if(itemid == 4)
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You need at least a Bag to be able to store Materials.");
- return 0;
- }*/
- if(itemid == 1) format(string, sizeof(string), "Unable to transfer $%d to %s ($%d).", amount, storagetype[storageid], PlayerInfo[playerid][pCash]);
- 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]);
- 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]);
- 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]);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- }
- case 1: // Bag
- {
- if(StorageInfo[playerid][0][sStorage] == 0)
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You do not own a Bag. You may purchase one at a 24/7 store.");
- return 0;
- }
- if(itemid == 1 && (StorageInfo[playerid][0][sCash] + amount <= bbackpacklimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pCash] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sCash] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pCash] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sCash] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- StorageInfo[playerid][0][sCash] += amount;
- format(string, sizeof(string), "$%d has been transfered to your Bag ($%d/$%d).", amount, StorageInfo[playerid][0][sCash], bbackpacklimit[itemid-1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "$%d has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- new ipplayerid[16], ipfromplayerid[16];
- GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
- GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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);
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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);
- Log("logs/pay.log", string);
- 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);
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- if(itemid == 2 && (StorageInfo[playerid][0][sPot] + amount <= bbackpacklimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pDrugs][1] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sPot] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][1] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sPot] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- StorageInfo[playerid][0][sPot] += amount;
- format(string, sizeof(string), "%d Pot has been transfered to your Bag (%d/%d).", amount, StorageInfo[playerid][0][sPot], bbackpacklimit[itemid-1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "%d Pot has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- new ipplayerid[16], ipfromplayerid[16];
- GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
- GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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);
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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);
- Log("logs/pay.log", string);
- 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);
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- if(itemid == 3 && (StorageInfo[playerid][0][sCrack] + amount <= bbackpacklimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pDrugs][2] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sCrack] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][2] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sCrack] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- StorageInfo[playerid][0][sCrack] += amount;
- format(string, sizeof(string), "%d Crack has been transfered to your Bag (%d/%d).", amount, StorageInfo[playerid][0][sCrack], bbackpacklimit[itemid-1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "%d Crack has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- new ipplayerid[16], ipfromplayerid[16];
- GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
- GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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);
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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);
- Log("logs/pay.log", string);
- 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);
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- if(itemid == 4 && (StorageInfo[playerid][0][sMats] + amount <= bbackpacklimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pMats] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sMats] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pMats] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sMats] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- StorageInfo[playerid][0][sMats] += amount;
- format(string, sizeof(string), "%d Materials has been transfered to your Bag (%d/%d).", amount, StorageInfo[playerid][0][sMats], bbackpacklimit[itemid-1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "%d Materials has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- new ipplayerid[16], ipfromplayerid[16];
- GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
- GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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);
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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);
- Log("logs/pay.log", string);
- 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);
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- 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]);
- 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]);
- 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]);
- 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]);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- }
- case 2: // Backpack
- {
- if(StorageInfo[playerid][1][sStorage] == 0)
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You do not own a Backpack. You may purchase one on our E-Store.");
- return 0;
- }
- if(itemid == 1 && (StorageInfo[playerid][1][sCash] + amount <= backpacklimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pCash] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sCash] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pCash] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sCash] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- StorageInfo[playerid][1][sCash] += amount;
- format(string, sizeof(string), "$%d has been transfered to your Backpack ($%d/$%d).", amount, StorageInfo[playerid][1][sCash], backpacklimit[itemid-1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "$%d has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- new ipplayerid[16], ipfromplayerid[16];
- GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
- GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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);
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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);
- Log("logs/pay.log", string);
- 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);
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- if(itemid == 2 && (StorageInfo[playerid][1][sPot] + amount <= backpacklimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pDrugs][1] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sPot] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][1] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sPot] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- StorageInfo[playerid][1][sPot] += amount;
- format(string, sizeof(string), "%d Pot has been transfered to your Backpack (%d/%d).", amount, StorageInfo[playerid][1][sPot], backpacklimit[itemid-1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "%d Pot has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- new ipplayerid[16], ipfromplayerid[16];
- GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
- GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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);
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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);
- Log("logs/pay.log", string);
- 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);
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- if(itemid == 3 && (StorageInfo[playerid][1][sCrack] + amount <= backpacklimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pDrugs][2] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sCrack] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][2] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sCrack] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- StorageInfo[playerid][1][sCrack] += amount;
- format(string, sizeof(string), "%d Crack has been transfered to your Backpack (%d/%d).", amount, StorageInfo[playerid][1][sCrack], backpacklimit[itemid-1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "%d Crack has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- new ipplayerid[16], ipfromplayerid[16];
- GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
- GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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);
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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);
- Log("logs/pay.log", string);
- 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);
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- if(itemid == 4 && (StorageInfo[playerid][1][sMats] + amount <= backpacklimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pMats] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sMats] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pMats] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sMats] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- StorageInfo[playerid][1][sMats] += amount;
- format(string, sizeof(string), "%d Materials has been transfered to your Backpack (%d/%d).", amount, StorageInfo[playerid][1][sMats], backpacklimit[itemid-1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "%d Materials has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- new ipplayerid[16], ipfromplayerid[16];
- GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
- GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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);
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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);
- Log("logs/pay.log", string);
- 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);
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- 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]);
- 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]);
- 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]);
- 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]);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- }
- case 3: // Briefcase
- {
- if(StorageInfo[playerid][2][sStorage] == 0)
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You do not own a Briefcase. You may purchase one on our E-Store.");
- return 0;
- }
- if(itemid == 1 && (StorageInfo[playerid][2][sCash] + amount <= briefcaselimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pCash] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sCash] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pCash] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sCash] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- StorageInfo[playerid][2][sCash] += amount;
- format(string, sizeof(string), "$%d has been transfered to your Briefcase ($%d/$%d).", amount, StorageInfo[playerid][2][sCash], briefcaselimit[itemid-1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "$%d has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- new ipplayerid[16], ipfromplayerid[16];
- GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
- GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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);
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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);
- Log("logs/pay.log", string);
- 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);
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- if(itemid == 2 && (StorageInfo[playerid][2][sPot] + amount <= briefcaselimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pDrugs][1] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give %d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sPot] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give %d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][1] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sPot] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- StorageInfo[playerid][2][sPot] += amount;
- format(string, sizeof(string), "%d Pot has been transfered to your Briefcase (%d/%d).", amount, StorageInfo[playerid][2][sPot], briefcaselimit[itemid-1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "%d Pot has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- new ipplayerid[16], ipfromplayerid[16];
- GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
- GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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);
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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);
- Log("logs/pay.log", string);
- 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);
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- if(itemid == 3 && (StorageInfo[playerid][2][sCrack] + amount <= briefcaselimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pDrugs][2] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give %d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sCrack] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give %d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pDrugs][2] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sCrack] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- StorageInfo[playerid][2][sCrack] += amount;
- format(string, sizeof(string), "%d Crack has been transfered to your Briefcase. (%d/%d)", amount, StorageInfo[playerid][2][sCrack], briefcaselimit[itemid-1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "%d Crack has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- new ipplayerid[16], ipfromplayerid[16];
- GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
- GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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);
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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);
- Log("logs/pay.log", string);
- 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);
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- if(itemid == 4 && (StorageInfo[playerid][2][sMats] + amount <= briefcaselimit[itemid-1]))
- {
- // Check if Sending Player has sufficient amount.
- if(fromplayerid != -1 && fromstorageid != -1)
- {
- if(fromstorageid == 0)
- {
- if(PlayerInfo[fromplayerid][pMats] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- else
- {
- if(StorageInfo[fromplayerid][fromstorageid-1][sMats] < amount)
- {
- format(string, sizeof(string), "You do not have sufficient amount to give $%d %s.", amount, itemtype[itemid]);
- SendClientMessageEx(fromplayerid, COLOR_WHITE, string);
- return 0;
- }
- }
- if(fromstorageid == 0) PlayerInfo[fromplayerid][pMats] -= amount;
- else StorageInfo[fromplayerid][fromstorageid-1][sMats] -= amount;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- StorageInfo[playerid][2][sMats] += amount;
- format(string, sizeof(string), "%d Materials has been transfered to your Briefcase (%d/%d).", amount, StorageInfo[playerid][2][sMats], briefcaselimit[itemid-1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- if(fromplayerid != -1 && fromstorageid != -1 && playerid != fromplayerid) {
- format(string, sizeof(string), "%d Materials has been transfered from your %s to %s's %s.", amount, storagetype[fromstorageid], GetPlayerNameEx(playerid), storagetype[storageid]);
- SendClientMessage(fromplayerid, COLOR_WHITE, string);
- PlayerPlaySound(fromplayerid, 1052, 0.0, 0.0, 0.0);
- 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));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- new ipplayerid[16], ipfromplayerid[16];
- GetPlayerIp(playerid, ipplayerid, sizeof(ipplayerid));
- GetPlayerIp(fromplayerid, ipfromplayerid, sizeof(ipfromplayerid));
- if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[fromplayerid][pAdmin] >= 2)
- {
- 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);
- Log("logs/adminpay.log", string);
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has given %s %s to %s", GetPlayerNameEx(fromplayerid), number_format(amount), itemtype[itemid], GetPlayerNameEx(playerid));
- if(!strcmp(GetPlayerIpEx(playerid), GetPlayerIpEx(fromplayerid), true)) strcat(string, " (1)");
- ABroadCast(COLOR_YELLOW, string, 4);
- }
- else
- {
- 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);
- Log("logs/pay.log", string);
- 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);
- if(amount >= 100000 && PlayerInfo[fromplayerid][pLevel] <= 3 && itemid == 1) ABroadCast(COLOR_YELLOW, string, 2);
- if(amount >= 1000000 && itemid == 1) ABroadCast(COLOR_YELLOW,string,2);
- }
- }
- return 1;
- }
- 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]);
- 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]);
- 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]);
- 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]);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- }
- }
- return 0;
- }
- stock ShowInventory(playerid,targetid)
- {
- if(IsPlayerConnected(targetid))
- {
- new resultline[1024], header[64], pnumber[20], toolboxstring[30];
- if(PlayerInfo[targetid][pPnumber] == 0) pnumber = "None"; else format(pnumber, sizeof(pnumber), "%d", PlayerInfo[targetid][pPnumber]);
- new totalwealth;
- totalwealth = PlayerInfo[targetid][pAccount] + GetPlayerCash(targetid);
- if(PlayerInfo[targetid][pPhousekey] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[targetid][pPhousekey]][hOwnerID] == GetPlayerSQLId(targetid)) totalwealth += HouseInfo[PlayerInfo[targetid][pPhousekey]][hSafeMoney];
- if(PlayerInfo[targetid][pPhousekey2] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[targetid][pPhousekey2]][hOwnerID] == GetPlayerSQLId(targetid)) totalwealth += HouseInfo[PlayerInfo[targetid][pPhousekey2]][hSafeMoney];
- if(PlayerInfo[targetid][pPhousekey3] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[targetid][pPhousekey3]][hOwnerID] == GetPlayerSQLId(targetid)) totalwealth += HouseInfo[PlayerInfo[targetid][pPhousekey3]][hSafeMoney];
- if(PlayerInfo[targetid][pToolBox] >= 1) format(toolboxstring, 50, "Tool Box: 1, (Usages: %s)", number_format(PlayerInfo[targetid][pToolBox]));
- else format(toolboxstring, 50, "Tool Box: 0");
-
- SetPVarInt(playerid, "ShowInventory", targetid);
- format(header, sizeof(header), "%s's Inventory", GetPlayerNameEx(targetid));
- format(resultline, sizeof(resultline),"{FFFFFF}Total Wealth: $%s\n\
- Cash: $%s\n\
- Bank: $%s\n\
- Phone Number: %s\n\
- Radio Frequency: %dkhz\n\
- Materials: %s\n\
- Rope: %s\n\
- Rags: %s\n\
- Screwdrivers: %s\n\
- Tires: %s\n\
- Paper: %s\n\
- Cigars: %s\n\
- Sprunk Cans: %s\n\
- Spraycans: %s\n\
- %s\n\
- Crowbar: %d",
- number_format(totalwealth),
- number_format(GetPlayerCash(targetid)),
- number_format(PlayerInfo[targetid][pAccount]),
- pnumber,
- PlayerInfo[targetid][pRadioFreq],
- number_format(PlayerInfo[targetid][pMats]),
- number_format(PlayerInfo[targetid][pRope]),
- number_format(PlayerInfo[targetid][pRags]),
- number_format(PlayerInfo[targetid][pScrewdriver]),
- number_format(PlayerInfo[targetid][pTire]),
- number_format(PlayerInfo[targetid][pPaper]),
- number_format(PlayerInfo[targetid][pCigar]),
- number_format(PlayerInfo[targetid][pSprunk]),
- number_format(PlayerInfo[targetid][pSpraycan]),
- toolboxstring,
- PlayerInfo[targetid][pCrowBar]);
- ShowPlayerDialogEx(playerid, DISPLAY_INV, DIALOG_STYLE_MSGBOX, header, resultline, "Next Page", "Close");
- }
- return 1;
- }
- stock FindGunInVehicleForPlayer(ownerid, slot, playerid)
- {
- new
- i = 0;
- 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]))
- {
- i++;
- }
- if (i == (PlayerVehicleInfo[ownerid][slot][pvWepUpgrade] + 1)) return -1;
- return i;
- }
- hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
- if(arrAntiCheat[playerid][ac_iFlags][AC_DIALOGSPOOFING] > 0) return 1;
- szMiscArray[0] = 0;
- switch(dialogid)
- {
- case DISPLAY_INV:
- {
- new targetid = GetPVarInt(playerid, "ShowInventory");
- if(IsPlayerConnected(targetid))
- {
- if(response)
- {
- new resultline[1024], header[64];
- format(header, sizeof(header), "%s's Inventory", GetPlayerNameEx(targetid));
- format(resultline, sizeof(resultline),"{FFFFFF}Locks: %d\n\
- First Aid Kit: %d\n\
- Receivers: %d\n\
- GPS: %d\n\
- Bug Sweeps: %d\n\
- Fireworks: %d\n\
- Boomboxes: %d\n\
- Mailboxes: %d\n\
- Rim Kits: %d\n\
- Checks: %s\n\
- Additional Vehicle Slots: %s\n\
- Additional Toy Slots: %s",
- PlayerInfo[targetid][pLock],
- PlayerInfo[targetid][pFirstaid],
- PlayerInfo[targetid][pReceiver],
- PlayerInfo[targetid][pGPS],
- PlayerInfo[targetid][pSweep],
- PlayerInfo[targetid][pFirework],
- PlayerInfo[targetid][pBoombox],
- PlayerInfo[targetid][pMailbox],
- PlayerInfo[targetid][pRimMod],
- number_format(PlayerInfo[targetid][pChecks]),
- number_format(PlayerInfo[targetid][pVehicleSlot]),
- number_format(PlayerInfo[targetid][pToySlot]));
- 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]);
- ShowPlayerDialogEx(playerid, DISPLAY_INV2, DIALOG_STYLE_MSGBOX, header, resultline, "First Page", "Close");
- }
- else DeletePVar(playerid, "ShowInventory");
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GRAD1, "The player you were checking has logged out.");
- DeletePVar(playerid, "ShowInventory");
- return 1;
- }
- }
- case DISPLAY_INV2:
- {
- new targetid = GetPVarInt(playerid, "ShowInventory");
- if(IsPlayerConnected(targetid))
- {
- if(response)
- {
- ShowInventory(playerid, targetid);
- }
- else DeletePVar(playerid, "ShowInventory");
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GRAD1, "The player you were checking has logged out.");
- DeletePVar(playerid, "ShowInventory");
- return 1;
- }
- }
- }
- return 0;
- }
- /*CMD:storagehelp(playerid, params[])
- {
- SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
- SendClientMessageEx(playerid, COLOR_WHITE,"*** HELP *** - type a command for more infomation.");
- SendClientMessageEx(playerid, COLOR_GRAD3,"*** STORAGE *** /(vs)viewstorage /(es)equipstorage /personalwithdraw /personaldeposit /storagegive");
- SendClientMessageEx(playerid, COLOR_GRAD3,"*** STORAGE *** /transferstorage");
- return 1;
- }*/
- CMD:inv(playerid, params[]) {
- return cmd_inventory(playerid, params);
- }
- CMD:inventory(playerid, params[])
- {
- if(gPlayerLogged{playerid} != 0) ShowInventory(playerid, playerid);
- return 1;
- }
- CMD:mytokens(playerid, params[])
- {
- szMiscArray[0] = 0;
- SendClientMessage(playerid, COLOR_GREY, "------------------------------------------------------------------------------------------------");
- format(szMiscArray, sizeof(szMiscArray), "VIP Tokens: %s, Paintball Tokens: %s, EXP Tokens: %s (Hours: %s), Event Tokens: %s, Gold Giftbox: %s",
- number_format(PlayerInfo[playerid][pTokens]),
- number_format(PlayerInfo[playerid][pPaintTokens]),
- number_format(PlayerInfo[playerid][pEXPToken]),
- number_format(PlayerInfo[playerid][pDoubleEXP]),
- number_format(PlayerInfo[playerid][pEventTokens]),
- number_format(PlayerInfo[playerid][pGoldBoxTokens]));
- SendClientMessage(playerid, COLOR_WHITE, szMiscArray);
- SendClientMessage(playerid, COLOR_GREY, "------------------------------------------------------------------------------------------------");
- return 1;
- }
- CMD:trunkput(playerid, params[])
- {
- if(GetPVarType(playerid, "IsInArena"))
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in an arena!");
- return 1;
- }
- if(GetPVarInt( playerid, "EventToken") != 0)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You can't use this while you're in an event.");
- return 1;
- }
- if(IsPlayerInAnyVehicle(playerid)) { SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being inside the vehicle!"); return 1; }
- if(GetPVarInt(playerid, "EMSAttempt") != 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't use this command!");
- new string[128], weaponchoice[32], slot;
- if(sscanf(params, "s[32]D(0)", weaponchoice, slot)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /trunkput [weapon] [slot]");
- new pvid = -1, Float: x, Float: y, Float: z;
- for(new d = 0 ; d < MAX_PLAYERVEHICLES; d++)
- {
- if(PlayerVehicleInfo[playerid][d][pvId] != INVALID_PLAYER_VEHICLE_ID) GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], x, y, z);
- if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z))
- {
- pvid = d;
- break;
- }
- }
- if(pvid == -1) return SendClientMessageEx(playerid,COLOR_GREY,"You are not near any vehicle that you own.");
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetVehicleParamsEx(PlayerVehicleInfo[playerid][pvid][pvId],engine,lights,alarm,doors,bonnet,boot,objective);
- 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)");
- 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.");
- new Float: Health;
- GetHealth(playerid, Health);
- if(Health < 80.0) return SendClientMessageEx(playerid,COLOR_GREY,"You cannot store weapons or drugs in a car when your health lower than 80.");
- if (GetPVarInt(playerid, "GiveWeaponTimer") > 0)
- {
- format(string, sizeof(string), " You must wait %d seconds before depositing another weapon.", GetPVarInt(playerid, "GiveWeaponTimer"));
- SendClientMessageEx(playerid,COLOR_GREY,string);
- return 1;
- }
-
- new maxslots = PlayerVehicleInfo[playerid][pvid][pvWepUpgrade]+1;
- if(slot > maxslots || slot < 1)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "Invalid slot.");
- return 1;
- }
- if( PlayerVehicleInfo[playerid][pvid][pvWeapons][slot-1] != 0)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You have a weapon stored in that slot already.");
- return 1;
- }
- new weapon;
- if(strcmp(weaponchoice, "sdpistol", true, strlen(weaponchoice)) == 0)
- {
- if(pTazer{playerid} == 1) return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot store a tazer!");
- if( PlayerInfo[playerid][pGuns][2] == 23 && PlayerInfo[playerid][pAGuns][2] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a silenced pistol into your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][2];
- format(string,sizeof(string), "* %s deposited their silenced pistol in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "9mm", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][2] == 22 && PlayerInfo[playerid][pAGuns][2] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a 9mm in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][2];
- format(string,sizeof(string), "* %s deposited their 9mm in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "deagle", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][2] == 24 && PlayerInfo[playerid][pAGuns][2] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a Desert Eagle in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][2];
- format(string,sizeof(string), "* %s deposited their Desert Eagle in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "shotgun", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][3] == 25 && PlayerInfo[playerid][pAGuns][3] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a shotgun in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][3];
- format(string,sizeof(string), "* %s deposited their Shotgun in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "spas12", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][3] == 27 && PlayerInfo[playerid][pAGuns][3] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a combat shotgun in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][3];
- format(string,sizeof(string), "* %s deposited their Combat Shotgun in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "mp5", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][4] == 29 && PlayerInfo[playerid][pAGuns][4] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an MP5 in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][4];
- format(string,sizeof(string), "* %s deposited their MP5 in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "tec9", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][4] == 32 && PlayerInfo[playerid][pAGuns][4] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a TEC9 in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][4];
- format(string,sizeof(string), "* %s deposited their TEC9 in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "ak47", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][5] == 30 && PlayerInfo[playerid][pAGuns][5] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an AK-47 in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][5];
- format(string,sizeof(string), "* %s deposited their AK-47 in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "m4", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][5] == 31 && PlayerInfo[playerid][pAGuns][5] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an M4 in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][5];
- format(string,sizeof(string), "* %s deposited their M4 in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "rifle", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][6] == 33 && PlayerInfo[playerid][pAGuns][6] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a rifle in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][6];
- format(string,sizeof(string), "* %s deposited their rifle in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "sniper", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][6] == 34 && PlayerInfo[playerid][pAGuns][6] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a sniper rifle in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][6];
- format(string,sizeof(string), "* %s deposited their sniper rifle in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "golfclub", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][1] == 2 && PlayerInfo[playerid][pAGuns][1] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a golf club in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][1];
- format(string,sizeof(string), "* %s deposited their golf club in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "baseballbat", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][1] == 5 && PlayerInfo[playerid][pAGuns][1] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a baseball bat in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][1];
- format(string,sizeof(string), "* %s deposited their baseball bat in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "shovel", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][1] == 6 && PlayerInfo[playerid][pAGuns][1] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a shovel in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][1];
- format(string,sizeof(string), "* %s deposited their shovel in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "poolcue", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][1] == 7 && PlayerInfo[playerid][pAGuns][1] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a pool cue in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][1];
- format(string,sizeof(string), "* %s deposited their pool cue in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "katana", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][1] == 8 && PlayerInfo[playerid][pAGuns][1] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a katana in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][1];
- format(string,sizeof(string), "* %s deposited their katana in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "cane", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][10] == 15 && PlayerInfo[playerid][pAGuns][1] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a cane in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][10];
- format(string,sizeof(string), "* %s deposited their cane in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "flowers", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][10] == 14 && PlayerInfo[playerid][pAGuns][1] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited flowers in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][10];
- format(string,sizeof(string), "* %s deposited their flowers in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "parachute", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][11] == 46 && PlayerInfo[playerid][pAGuns][1] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a parachute in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][11];
- format(string,sizeof(string), "* %s deposited their parachute in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "dildo", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][10] == 10 && PlayerInfo[playerid][pAGuns][1] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a dildo in your car gun locker.");
- weapon = PlayerInfo[playerid][pGuns][10];
- format(string,sizeof(string), "* %s deposited their dildo in their car safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else { SendClientMessageEx(playerid,COLOR_GREY," Invalid weapon name!"); return 1; }
- if(PlayerVehicleInfo[playerid][pvid][pvWeapons][slot-1] == 0)
- {
- PlayerVehicleInfo[playerid][pvid][pvWeapons][slot-1] = weapon;
- RemovePlayerWeapon(playerid, weapon);
- g_mysql_SaveVehicle(playerid, pvid);
- }
- return 1;
- }
- CMD:trunktake(playerid, params[]) {
- if(IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while you're inside a vehicle.");
- if(PlayerInfo[playerid][pAccountRestricted] != 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "Your account is restricted!");
- else if(GetPVarType(playerid, "IsInArena")) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in an arena!");
- else if(GetPVarInt( playerid, "EventToken") != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't use this while you're in an event.");
- 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!");
- else if(GetPVarInt(playerid, "GiveWeaponTimer") >= 1)
- {
- new szMessage[59];
- format(szMessage, sizeof(szMessage), " You must wait %d seconds before getting another weapon.", GetPVarInt(playerid, "GiveWeaponTimer"));
- return SendClientMessageEx(playerid, COLOR_GREY, szMessage);
- }
- new
- Float: fVehPos[3],
- iWeaponSlot = strval(params);
- for(new d = 0 ; d < MAX_PLAYERVEHICLES; d++) {
- if(PlayerVehicleInfo[playerid][d][pvId] != INVALID_PLAYER_VEHICLE_ID) {
- GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], fVehPos[0], fVehPos[1], fVehPos[2]);
- if(IsPlayerInRangeOfPoint(playerid, 4.0, fVehPos[0], fVehPos[1], fVehPos[2])) {
- if(isnull(params)) {
- new
- szMessage[64];
- format(szMessage, sizeof(szMessage), "*** %s's %s Safe ***", GetPlayerNameEx(playerid), GetVehicleName(PlayerVehicleInfo[playerid][d][pvId]));
- SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
- for(new s = 0; s < 3; s++) if(PlayerVehicleInfo[playerid][d][pvWeapons][s] != 0) {
- new
- szWeapon[16];
- GetWeaponName(PlayerVehicleInfo[playerid][d][pvWeapons][s], szWeapon, sizeof(szWeapon));
- format(szMessage, sizeof(szMessage), "Slot %d: %s", s+1, szWeapon);
- SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
- }
- return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /trunktake [slot]");
- }
- else if(GetVehicleModel(PlayerVehicleInfo[playerid][d][pvId]) == 481 || GetVehicleModel(PlayerVehicleInfo[playerid][d][pvId]) == 509) {
- return SendClientMessageEx(playerid,COLOR_GREY,"That vehicle doesn't have a trunk.");
- }
- new
- engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(PlayerVehicleInfo[playerid][d][pvId], engine, lights, alarm, doors, bonnet, boot, objective);
- if(boot == VEHICLE_PARAMS_OFF || boot == VEHICLE_PARAMS_UNSET) {
- return SendClientMessageEx(playerid, COLOR_GRAD3, "You can't take weapons from the trunk if it's closed! /car trunk to open it.");
- }
- new maxslots = PlayerVehicleInfo[playerid][d][pvWepUpgrade]+1;
- if(iWeaponSlot > maxslots || iWeaponSlot < 1) {
- return SendClientMessageEx(playerid, COLOR_GREY, "Invalid slot specified.");
- }
- else if(PlayerVehicleInfo[playerid][d][pvWeapons][iWeaponSlot - 1] != 0) {
- new
- szWeapon[16],
- szMessage[128];
- new aWeapons[13][2];
- for(new i; i < 13; ++i) {
- GetPlayerWeaponData(playerid, i, aWeapons[i][0], aWeapons[i][1]);
- if(aWeapons[i][0] == PlayerVehicleInfo[playerid][d][pvWeapons][iWeaponSlot - 1]) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are already carrying this weapon.");
- }
- GetWeaponName(PlayerVehicleInfo[playerid][d][pvWeapons][iWeaponSlot - 1], szWeapon, sizeof(szWeapon));
- GivePlayerValidWeapon(playerid, PlayerVehicleInfo[playerid][d][pvWeapons][iWeaponSlot - 1]);
- PlayerVehicleInfo[playerid][d][pvWeapons][iWeaponSlot - 1] = 0;
- g_mysql_SaveVehicle(playerid, d);
- format(szMessage, sizeof(szMessage), "You have withdrawn a %s from your car gun locker.", szWeapon);
- SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
- format(szMessage, sizeof(szMessage), "* %s has withdrawn a %s from their car safe.", GetPlayerNameEx(playerid), szWeapon);
- return ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You don't have a weapon stored in that slot.");
- }
- }
- }
- return SendClientMessageEx(playerid,COLOR_GREY,"You are not near any vehicle that you own.");
- }
- CMD:storegun(playerid, params[])
- {
- if(Homes[playerid] > 0)
- {
- if(GetPVarType(playerid, "IsInArena")) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in an arena!");
- if(GetPVarInt( playerid, "EventToken") != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't use this while you're in an event.");
- 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!");
- new string[128], weaponchoice[32], slot;
- if(sscanf(params, "s[32]d", weaponchoice, slot)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /storegun [weapon] [slot]");
- for(new i; i < MAX_HOUSES; i++)
- {
- 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])
- {
- if (GetPVarInt(playerid, "GiveWeaponTimer") > 0)
- {
- format(string, sizeof(string), " You must wait %d seconds before depositing another weapon.", GetPVarInt(playerid, "GiveWeaponTimer"));
- SendClientMessageEx(playerid,COLOR_GREY,string);
- return 1;
- }
- new maxslots = HouseInfo[i][hGLUpgrade];
- if(slot > maxslots || slot == 0)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "That is not a valid slot. Slots are from 1-5.");
- return 1;
- }
- if( HouseInfo[i][hWeapons][slot-1] != 0)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You have a weapon stored in that slot already.");
- return 1;
- }
- new weapon;
- if(strcmp(weaponchoice, "sdpistol", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][2] == 23 && PlayerInfo[playerid][pAGuns][2] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a silenced pistol into your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][2];
- format(string,sizeof(string), "* %s deposited their silenced pistol in their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "deagle", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][2] == 24 && PlayerInfo[playerid][pAGuns][2] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a Desert Eagle in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][2];
- format(string,sizeof(string), "* %s deposited their Desert Eagle in their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "shotgun", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][3] == 25 && PlayerInfo[playerid][pAGuns][3] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a shotgun in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][3];
- format(string,sizeof(string), "* %s deposited their Shotgun in their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "spas12", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][3] == 27 && PlayerInfo[playerid][pAGuns][3] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a combat shotgun in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][3];
- format(string,sizeof(string), "* %s deposited their Combat Shotgun in their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "mp5", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][4] == 29 && PlayerInfo[playerid][pAGuns][4] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an MP5 in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][4];
- format(string,sizeof(string), "* %s deposited their MP5 in their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "ak47", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][5] == 30 && PlayerInfo[playerid][pAGuns][5] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an AK-47 in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][5];
- format(string,sizeof(string), "* %s deposited their AK-47 in their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "m4", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][5] == 31 && PlayerInfo[playerid][pAGuns][5] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an M4 in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][5];
- format(string,sizeof(string), "* %s deposited their M4 in their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "rifle", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][6] == 33 && PlayerInfo[playerid][pAGuns][6] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a rifle in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][6];
- format(string,sizeof(string), "* %s deposited their rifle in their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "sniper", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][6] == 34 && PlayerInfo[playerid][pAGuns][6] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a sniper rifle in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][6];
- format(string,sizeof(string), "* %s deposited their sniper rifle in their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "uzi", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][4] == 28 && PlayerInfo[playerid][pAGuns][4] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an uzi in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][4];
- format(string,sizeof(string), "* %s deposited their uzi in their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- else if(strcmp(weaponchoice, "tec9", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][4] == 32 && PlayerInfo[playerid][pAGuns][4] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a tec9 in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][4];
- format(string,sizeof(string), "* %s deposited their tec9 in their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- }
- if(weapon == 0) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that weapon.");
- if(HouseInfo[i][hWeapons][slot-1] == 0)
- {
- HouseInfo[i][hWeapons][slot-1] = weapon;
- RemovePlayerWeapon(playerid, weapon);
- SaveHouse(i);
- return 1;
- }
- else { SendClientMessageEx(playerid,COLOR_GREY," Invalid weapon name!"); return 1; }
- }
- }
- SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
- return 1;
- }
- CMD:getgun(playerid, params[])
- {
- if(Homes[playerid] > 0)
- {
- new string[128], slot;
- for(new i; i < MAX_HOUSES; i++)
- {
- 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])
- {
- 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!");
- if(sscanf(params, "d", slot))
- {
- new weaponname[50];
- SendClientMessageEx(playerid, COLOR_GREEN, "________________________________________________");
- format(string, sizeof(string), "*** %s's Safe ***", GetPlayerNameEx(playerid));
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- for(new s = 0; s < 5; s++)
- {
- if( HouseInfo[i][hWeapons][s] != 0 )
- {
- GetWeaponName(HouseInfo[i][hWeapons][s], weaponname, sizeof(weaponname));
- format(string, sizeof(string), "Slot %d: %s", s+1, weaponname);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- }
- }
- SendClientMessageEx(playerid, COLOR_GREEN, "________________________________________________");
- SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /getgun [slot]");
- return 1;
- }
- if (GetPVarInt(playerid, "GiveWeaponTimer") > 0)
- {
- format(string, sizeof(string), " You must wait %d seconds before getting another weapon.", GetPVarInt(playerid, "GiveWeaponTimer"));
- SendClientMessageEx(playerid,COLOR_GREY,string);
- return 1;
- }
- new maxslots = HouseInfo[i][hGLUpgrade];
- if(slot > maxslots)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "Invalid slot.");
- return 1;
- }
- if(HouseInfo[i][hWeapons][slot-1] != 0)
- {
- new weaponname[50];
- GetWeaponName(HouseInfo[i][hWeapons][slot-1], weaponname, sizeof(weaponname));
- GivePlayerValidWeapon(playerid, HouseInfo[i][hWeapons][slot-1]);
- HouseInfo[i][hWeapons][slot-1] = 0;
- if(strcmp(weaponname, "silenced pistol", true, strlen(weaponname)) == 0)
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn a silenced pistol from your gun locker.");
- format(string,sizeof(string), "* %s has withdrawn a silenced pistol from their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- if(strcmp(weaponname, "desert eagle", true, strlen(weaponname)) == 0)
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn a Desert Eagle from your gun locker.");
- format(string,sizeof(string), "* %s has withdrawn a Desert Eagle from their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- if(strcmp(weaponname, "shotgun", true, strlen(weaponname)) == 0)
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn a shotgun from your gun locker.");
- format(string,sizeof(string), "* %s has withdrawn a shotgun from their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- if(strcmp(weaponname, "combat shotgun", true, strlen(weaponname)) == 0)
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn a combat shotgun from your gun locker.");
- format(string,sizeof(string), "* %s has withdrawn a combat shotgun from their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- if(strcmp(weaponname, "mp5", true, strlen(weaponname)) == 0)
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn an MP5 from your gun locker.");
- format(string,sizeof(string), "* %s has withdrawn an MP5 from their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- if(strcmp(weaponname, "ak47", true, strlen(weaponname)) == 0)
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn an AK-47 from your gun locker.");
- format(string,sizeof(string), "* %s has withdrawn an AK-47 from their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- if(strcmp(weaponname, "m4", true, strlen(weaponname)) == 0)
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn an M4 from your gun locker.");
- format(string,sizeof(string), "* %s has withdrawn an M4 from their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- if(strcmp(weaponname, "rifle", true, strlen(weaponname)) == 0)
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn a rifle from your gun locker.");
- format(string,sizeof(string), "* %s has withdrawn a rifle from their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- }
- if(strcmp(weaponname, "sniper rifle", true, strlen(weaponname)) == 0)
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn a sniper rifle from your gun locker.");
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- format(string,sizeof(string), "* %s has withdrawn a sniper rifle from their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- if(strcmp(weaponname, "micro smg", true, strlen(weaponname)) == 0)
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn an uzi from your gun locker.");
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- format(string,sizeof(string), "* %s has withdrawn an uzi from their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- if(strcmp(weaponname, "tec9", true, strlen(weaponname)) == 0)
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdrawn an uzi from your gun locker.");
- SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
- format(string,sizeof(string), "* %s has withdrawn an uzi from their house safe.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- SaveHouse(i);
- return 1;
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You don't have a weapon stored in that slot.");
- return 1;
- }
- }
- }
- SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
- return 1;
- }
- CMD:hwithdraw(playerid, params[])
- {
- if(Homes[playerid] > 0)
- {
- for(new i; i < MAX_HOUSES; i++)
- {
- 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])
- {
- new itemid, amount, string[128];
- if(sscanf(params, "dd", itemid, amount))
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /hwithdraw [itemid] [amount]");
- SendClientMessageEx(playerid, COLOR_GREY, "ItemIDs: (1) Cash - (2) Pot - (3) Crack - (4) Materials - (5) Meth - (6) Ecstasy - (7) Heroin");
- return 1;
- }
- if(itemid < 1 || itemid > 7) {
- SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /hwithdraw [itemid] [amount]");
- SendClientMessageEx(playerid, COLOR_GREY, "ItemIDs: (1) Cash - (2) Pot - (3) Crack - (4) Materials - (5) Meth - (6) Ecstasy - (7) Heroin");
- return 1;
- }
- if(amount < 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't withdraw less than 1.");
- switch(itemid)
- {
- case 1: // Cash
- {
- if(HouseInfo[i][hSafeMoney] >= amount)
- {
- HouseInfo[i][hSafeMoney] -= amount;
- GivePlayerCash(playerid, amount);
- OnPlayerStatsUpdate(playerid);
- SaveHouse(i);
- format(string, sizeof(string), "You have withdrawn $%d from your house safe.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "%s (SQL: %d) has withdrawn $%d from their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
- Log("logs/hsafe.log", string);
- return 1;
- }
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to withdraw!");
- }
- case 2: // Pot
- {
- if(HouseInfo[i][hPot] >= amount)
- {
- HouseInfo[i][hPot] -= amount;
- PlayerInfo[playerid][pDrugs][0] += amount;
- OnPlayerStatsUpdate(playerid);
- SaveHouse(i);
- format(string, sizeof(string), "You have withdrawn %d Pot from your house safe.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "%s (SQL: %d) has withdrawn %d Pot from their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
- Log("logs/hsafe.log", string);
- return 1;
- }
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to withdraw!");
- }
- case 3: // Crack
- {
- if(HouseInfo[i][hCrack] >= amount)
- {
- HouseInfo[i][hCrack] -= amount;
- PlayerInfo[playerid][pDrugs][1] += amount;
- OnPlayerStatsUpdate(playerid);
- SaveHouse(i);
- format(string, sizeof(string), "You have withdrawn %d crack from your house safe.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "%s (SQL: %d) has withdrawn %d crack from their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
- Log("logs/hsafe.log", string);
- return 1;
- }
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to withdraw!");
- }
- case 4: // Materials
- {
- if(HouseInfo[i][hMaterials] >= amount)
- {
- HouseInfo[i][hMaterials] -= amount;
- PlayerInfo[playerid][pMats] += amount;
- OnPlayerStatsUpdate(playerid);
- SaveHouse(i);
- format(string, sizeof(string), "You have withdrawn %d materials from your house safe.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "%s (SQL: %d) has withdrawn %d materials from their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
- Log("logs/hsafe.log", string);
- return 1;
- }
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to withdraw!");
- }
- case 5: // Meth
- {
- if(HouseInfo[i][hMeth] >= amount)
- {
- HouseInfo[i][hMeth] -= amount;
- PlayerInfo[playerid][pDrugs][2] += amount;
- OnPlayerStatsUpdate(playerid);
- SaveHouse(i);
- format(string, sizeof(string), "You have withdrawn %d meth from your house safe.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "%s (SQL: %d) has withdrawn %d meth from their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
- Log("logs/hsafe.log", string);
- return 1;
- }
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to withdraw!");
- }
- case 6: // Ecstasy
- {
- if(HouseInfo[i][hEcstasy] >= amount)
- {
- HouseInfo[i][hEcstasy] -= amount;
- PlayerInfo[playerid][pDrugs][3] += amount;
- OnPlayerStatsUpdate(playerid);
- SaveHouse(i);
- format(string, sizeof(string), "You have withdrawn %d ecstasy from your house safe.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "%s (SQL: %d) has withdrawn %d ecstasy from their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
- Log("logs/hsafe.log", string);
- return 1;
- }
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to withdraw!");
- }
- case 7: // Heroin
- {
- if(HouseInfo[i][hHeroin] >= amount)
- {
- HouseInfo[i][hHeroin] -= amount;
- PlayerInfo[playerid][pDrugs][4] += amount;
- OnPlayerStatsUpdate(playerid);
- SaveHouse(i);
- format(string, sizeof(string), "You have withdrawn %d heroin from your house safe.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "%s (SQL: %d) has withdrawn %d heroin from their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
- Log("logs/hsafe.log", string);
- return 1;
- }
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to withdraw!");
- }
- }
- }
- }
- SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
- return 1;
- }
- CMD:hdeposit(playerid, params[])
- {
- if(Homes[playerid] > 0)
- {
- for(new i; i < MAX_HOUSES; i++)
- {
- 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])
- {
- new string[128], itemid, amount;
- if(sscanf(params, "dd", itemid, amount))
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /hdeposit [itemid] [amount]");
- SendClientMessageEx(playerid, COLOR_GREY, "ItemIDs: (1) Cash - (2) Pot - (3) Crack - (4) Materials - (5) Meth - (6) Ecstasy - (7) Heroin");
- return 1;
- }
- if(itemid < 1 || itemid > 7) {
- SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /hdeposit [itemid] [amount]");
- SendClientMessageEx(playerid, COLOR_GREY, "ItemIDs: (1) Cash - (2) Pot - (3) Crack - (4) Materials - (5) Meth - (6) Ecstasy - (7) Heroin");
- return 1;
- }
- if(amount < 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't deposit less than 1.");
- switch(itemid)
- {
- case 1: // Cash
- {
- if(PlayerInfo[playerid][pCash] >= amount) PlayerInfo[playerid][pCash] -= amount;
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to deposit!");
- HouseInfo[i][hSafeMoney] += amount;
- format(string, sizeof(string), "You have deposited $%d to your house's safe.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- OnPlayerStatsUpdate(playerid);
- SaveHouse(i);
- format(string, sizeof(string), "%s (SQL: %d) has deposited $%d into their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
- Log("logs/hsafe.log", string);
- return 1;
- }
- case 2: // Pot
- {
- if(PlayerInfo[playerid][pDrugs][0] >= amount) PlayerInfo[playerid][pDrugs][0] -= amount;
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to deposit!");
- HouseInfo[i][hPot] += amount;
- format(string, sizeof(string), "You have deposited %d Pot to your house's safe.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- OnPlayerStatsUpdate(playerid);
- SaveHouse(i);
- format(string, sizeof(string), "%s (SQL: %d) has deposited %d Pot into their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
- Log("logs/hsafe.log", string);
- return 1;
- }
- case 3: // Crack
- {
- if(PlayerInfo[playerid][pDrugs][1] >= amount) PlayerInfo[playerid][pDrugs][1] -= amount;
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to deposit!");
- HouseInfo[i][hCrack] += amount;
- format(string, sizeof(string), "You have deposited %d Crack to your house's safe.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- OnPlayerStatsUpdate(playerid);
- SaveHouse(i);
- format(string, sizeof(string), "%s (SQL: %d) has deposited %d crack into their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
- Log("logs/hsafe.log", string);
- return 1;
- }
- case 4: // Materials
- {
- if(PlayerInfo[playerid][pMats] >= amount) PlayerInfo[playerid][pMats] -= amount;
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to deposit!");
- HouseInfo[i][hMaterials] += amount;
- format(string, sizeof(string), "You have deposited %d Materials to your house's safe.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- OnPlayerStatsUpdate(playerid);
- SaveHouse(i);
- format(string, sizeof(string), "%s (SQL: %d) has deposited %d materials into their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
- Log("logs/hsafe.log", string);
- return 1;
- }
- case 5: // Meth
- {
- if(PlayerInfo[playerid][pDrugs][2] >= amount) PlayerInfo[playerid][pDrugs][2] -= amount;
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to deposit!");
- HouseInfo[i][hMeth] += amount;
- format(string, sizeof(string), "You have deposited %d Meth to your house's safe.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- OnPlayerStatsUpdate(playerid);
- SaveHouse(i);
- format(string, sizeof(string), "%s (SQL: %d) has deposited %d meth into their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
- Log("logs/hsafe.log", string);
- return 1;
- }
- case 6: // Ecstasy
- {
- if(PlayerInfo[playerid][pDrugs][3] >= amount) PlayerInfo[playerid][pDrugs][3] -= amount;
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to deposit!");
- HouseInfo[i][hEcstasy] += amount;
- format(string, sizeof(string), "You have deposited %d Ecstasy to your house's safe.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- OnPlayerStatsUpdate(playerid);
- SaveHouse(i);
- format(string, sizeof(string), "%s (SQL: %d) has deposited %d Ecstasy into their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
- Log("logs/hsafe.log", string);
- return 1;
- }
- case 7: // Heroin
- {
- if(PlayerInfo[playerid][pDrugs][4] >= amount) PlayerInfo[playerid][pDrugs][4] -= amount;
- else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have enough to deposit!");
- HouseInfo[i][hHeroin] += amount;
- format(string, sizeof(string), "You have deposited %d Heroin to your house's safe.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- OnPlayerStatsUpdate(playerid);
- SaveHouse(i);
- format(string, sizeof(string), "%s (SQL: %d) has deposited %d heroin into their house (ID: %d) safe.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), amount, i);
- Log("logs/hsafe.log", string);
- return 1;
- }
- }
- }
- }
- SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
- return 1;
- }
- /*
- CMD:workbench(playerid, params[]) {
- new szType[10], iChoice, iAmount, houseid;
- if(sscanf(params, "s[6]ii", szType, iChoice, iAmount)) {
- SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /workbench [type] [choice] [amount]");
- SendClientMessageEx(playerid, COLOR_GRAD2, "TYPE: melee, gun");
- SendClientMessageEx(playerid, COLOR_GRAD2, "CHOICE GUN: 9mm (0), SDPistol (1), Shotgun (2), Rifle (3)");
- SendClientMessageEx(playerid, COLOR_GRAD2, "CHOICE MELEE: Brass Knuckles (0), Baseball Bat (1), Shovel (2), Pool Cue (3), Cane (4)");
- return SendClientMessageEx(playerid, COLOR_GRAD2, "CHOICE MELEE: Dildo (5), Vibrator (6), Katana (7), Flowers (8), SprayCan (9)");
- }
- for(new i = 0; i < 3; i++)
- {
- if(i == 0) houseid = PlayerInfo[playerid][pPhousekey];
- if(i == 1) houseid = PlayerInfo[playerid][pPhousekey2];
- if(i == 2) houseid = PlayerInfo[playerid][pPhousekey3];
- 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])
- {
- if(iAmount <= 0) return SendClientMessageEx(playerid, -1, "You can't have negative amount values.");
- if(strcmp(szType,"melee",true) == 0)
- {
- if(playerid != INVALID_PLAYER_ID && iChoice >= 0 || iChoice <= 9)
- {
- if(PlayerInfo[playerid][pMats] < 150) return SendClientMessageEx(playerid, COLOR_GRAD2, "You dont have enough materials to produce the weapon.");
- if(PlayerInfo[playerid][pMats] < 2000 && iChoice == 9) return SendClientMessageEx(playerid, COLOR_GRAD2, "You dont have enough materials to produce the weapon.");
- switch(iChoice)
- {
- case 0: GivePlayerValidWeapon(playerid, WEAPON_BRASSKNUCKLE);
- case 1: GivePlayerValidWeapon(playerid, WEAPON_BAT);
- case 2: GivePlayerValidWeapon(playerid, WEAPON_SHOVEL);
- case 3: GivePlayerValidWeapon(playerid, WEAPON_POOLSTICK);
- case 4: GivePlayerValidWeapon(playerid, WEAPON_CANE);
- case 5: GivePlayerValidWeapon(playerid, WEAPON_DILDO);
- case 6: GivePlayerValidWeapon(playerid, WEAPON_VIBRATOR);
- case 7: GivePlayerValidWeapon(playerid, WEAPON_KATANA);
- case 8: GivePlayerValidWeapon(playerid, WEAPON_FLOWER);
- case 9: GivePlayerValidWeapon(playerid, WEAPON_SPRAYCAN);
- }
- if(iChoice == 9) { PlayerInfo[playerid][pMats] -= 1850; }
- PlayerInfo[playerid][pMats] -= 150;
- format(szMiscArray, sizeof(szMiscArray), "You have crafted a melee weapon.", iAmount);
- return SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
- }
- }
- if(strcmp(szType,"gun",true) == 0)
- {
- if(playerid != INVALID_PLAYER_ID && iChoice >= 0 || iChoice <= 3)
- {
- switch(iChoice)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pMats] < 3000) return SendClientMessageEx(playerid, COLOR_GRAD2, "You dont have enough materials to produce the gun.");
- GivePlayerValidWeapon(playerid, WEAPON_COLT45);
- PlayerInfo[playerid][pMats] -= 3000;
- format(szMiscArray, sizeof(szMiscArray), "You have crafted a 9mm weapon.", iAmount);
- }
- case 1:
- {
- if(PlayerInfo[playerid][pMats] < 3000) return SendClientMessageEx(playerid, COLOR_GRAD2, "You dont have enough materials to produce the gun.");
- GivePlayerValidWeapon(playerid, WEAPON_SILENCED);
- PlayerInfo[playerid][pMats] -= 3000;
- format(szMiscArray, sizeof(szMiscArray), "You have crafted a Silenced weapon.", iAmount);
- }
- case 2:
- {
- if(PlayerInfo[playerid][pMats] < 4000) return SendClientMessageEx(playerid, COLOR_GRAD2, "You dont have enough materials to produce the gun.");
- GivePlayerValidWeapon(playerid, WEAPON_SHOTGUN);
- PlayerInfo[playerid][pMats] -= 4000;
- format(szMiscArray, sizeof(szMiscArray), "You have crafted a Shotgun weapon.", iAmount);
- }
- case 3:
- {
- if(PlayerInfo[playerid][pMats] < 4000) return SendClientMessageEx(playerid, COLOR_GRAD2, "You dont have enough materials to produce the gun.");
- GivePlayerValidWeapon(playerid, WEAPON_RIFLE);
- PlayerInfo[playerid][pMats] -= 4000;
- format(szMiscArray, sizeof(szMiscArray), "You have crafted a Country Rifle weapon.", iAmount);
- }
- }
- return SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
- }
- }
- }
- SendClientMessageEx(playerid, COLOR_WHITE, "You're not in a house you own.");
- }
- return 1;
- }*/
- CMD:hbalance(playerid, params[])
- {
- if(Homes[playerid] > 0)
- {
- for(new i; i < MAX_HOUSES; i++)
- {
- 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])
- {
- new string[128];
- SendClientMessageEx(playerid, COLOR_GREEN, "|___________________________________ House Safe ___________________________________|");
- 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]));
- SendClientMessageEx(playerid, COLOR_WHITE, string);
-
- SendClientMessageEx(playerid, COLOR_GREEN, "|__________________________________________________________________________________|");
- return 1;
- }
- }
- SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
- return 1;
- }
- CMD:closet(playerid, params[])
- {
- if(Homes[playerid] > 0)
- {
- for(new i; i < MAX_HOUSES; i++)
- {
- 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])
- {
- if(HouseInfo[i][hClosetX] != 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[i][hClosetX], HouseInfo[i][hClosetY], HouseInfo[i][hClosetZ]))
- {
- return DisplaySkins(playerid);
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You aren't near your closet!");
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a closet in this house!");
- }
- }
- SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
- return 1;
- }
- CMD:closetadd(playerid, params[])
- {
- if(Homes[playerid] > 0)
- {
- for(new i; i < MAX_HOUSES; i++)
- {
- 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])
- {
- if(HouseInfo[i][hClosetX] != 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[i][hClosetX], HouseInfo[i][hClosetY], HouseInfo[i][hClosetZ]))
- {
- CountSkins(playerid);
- if((PlayerInfo[playerid][pDonateRank] <= 0 && PlayerInfo[playerid][pSkins] <= 10) || (PlayerInfo[playerid][pDonateRank] > 0 && PlayerInfo[playerid][pSkins] <= 25))
- {
- new string[128];
- new skinid = GetPlayerSkin(playerid);
- AddSkin(playerid, skinid);
- format(string, sizeof(string), "You have added skin ID %d to your closet.", skinid);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- return 1;
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "Your closet doesn't have anymore space for clothes!");
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You aren't near your closet!");
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a closet in this house!");
- }
- }
- SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
- return 1;
- }
- CMD:closetremove(playerid, params[])
- {
- if(Homes[playerid] > 0)
- {
- for(new i; i < MAX_HOUSES; i++)
- {
- 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])
- {
- if(HouseInfo[i][hClosetX] != 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[i][hClosetX], HouseInfo[i][hClosetY], HouseInfo[i][hClosetZ]))
- {
- new query[128];
- mysql_format(MainPipeline, query, sizeof(query), "SELECT `skinid` FROM `house_closet` WHERE playerid = %d ORDER BY `skinid` ASC", GetPlayerSQLId(playerid));
- mysql_tquery(MainPipeline, query, "SkinQueryFinish", "ii", playerid, Skin_Query_Delete);
- return 1;
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You aren't near your closet!");
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a closet in this house!");
- }
- }
- SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
- return 1;
- }
- CMD:drop(playerid, params[])
- {
- new string[128], amount, choice[32];
- if(sscanf(params, "s[32]D(0)", choice, amount))
- {
- SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /drop [name] [(optional) amount]");
- SendClientMessageEx(playerid, COLOR_GREY, "Available names: Weapons, Materials, Packages, Radio, Pizza, Syringes, Backpack, Phone");
- SendClientMessageEx(playerid, COLOR_GREY, "Available names: Pot, Crack, Meth, Ecstasy, Heroin");
- return 1;
- }
- else if(strcmp(choice,"backpack",true) == 0)
- {
- if(PlayerInfo[playerid][pBackpack] > 0)
- {
- 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");
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You do not have a backpack!");
- }
- }
- else if(strcmp(choice,"syringes",true) == 0)
- {
- if(PlayerInfo[playerid][pSyringes] > 0)
- {
- if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Please specify an amount.");
- if(amount > PlayerInfo[playerid][pSyringes]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many syringes!");
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "You have dropped %d syringes.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- PlayerInfo[playerid][pSyringes] -= amount;
- format(string, sizeof(string), "* %s has thrown away some syringes.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any syringes to throw away!");
- }
- }
- else if(strcmp(choice,"pot",true) == 0)
- {
- if(PlayerInfo[playerid][pDrugs][0] > 0)
- {
- if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Please specify an amount.");
- if(amount > PlayerInfo[playerid][pDrugs][0]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many grams of pot!");
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "You have dropped %d pot.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- PlayerInfo[playerid][pDrugs][0] -= amount;
- format(string, sizeof(string), "* %s has thrown away some pot.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any pot to throw away!");
- }
- }
- else if(strcmp(choice,"crack",true) == 0)
- {
- if(PlayerInfo[playerid][pDrugs][1] > 0)
- {
- if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Please specify an amount.");
- if(amount > PlayerInfo[playerid][pDrugs][1]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many grams of crack!");
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "You have dropped %d crack.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- PlayerInfo[playerid][pDrugs][1] -= amount;
- format(string, sizeof(string), "* %s has thrown away some crack.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any crack to throw away!");
- }
- }
- else if(strcmp(choice,"meth",true) == 0)
- {
- if(PlayerInfo[playerid][pDrugs][2] > 0)
- {
- if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Please specify an amount.");
- if(amount > PlayerInfo[playerid][pDrugs][2]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many grams of meth!");
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "You have dropped %d meth.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- PlayerInfo[playerid][pDrugs][2] -= amount;
- format(string, sizeof(string), "* %s has thrown away some meth.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any meth to throw away!");
- }
- }
- else if(strcmp(choice,"ecstasy",true) == 0)
- {
- if(PlayerInfo[playerid][pDrugs][3] > 0)
- {
- if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Please specify an amount.");
- if(amount > PlayerInfo[playerid][pDrugs][3]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many grams of ecstasy!");
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "You have dropped %d ecstasy.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- PlayerInfo[playerid][pDrugs][3] -= amount;
- format(string, sizeof(string), "* %s has thrown away some ecstasy.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any ecstasy to throw away!");
- }
- }
- else if(strcmp(choice,"heroin",true) == 0)
- {
- if(PlayerInfo[playerid][pDrugs][4] > 0)
- {
- if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Please specify an amount.");
- if(amount > PlayerInfo[playerid][pDrugs][4]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many grams of heroin!");
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "You have dropped %d heroin.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- PlayerInfo[playerid][pDrugs][4] -= amount;
- format(string, sizeof(string), "* %s has thrown away some heroin.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any heroin to throw away!");
- }
- }
- else if(strcmp(choice,"materials",true) == 0)
- {
- if(PlayerInfo[playerid][pMats] > 0)
- {
- if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Please specify an amount.");
- if(amount > PlayerInfo[playerid][pMats]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that many materials!");
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "You have dropped %d materials.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "* %s has thrown away some materials.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- PlayerInfo[playerid][pMats] -= amount;
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any materials to throw away!");
- }
- }
- else if(strcmp(choice,"radio",true) == 0)
- {
- if(PlayerInfo[playerid][pRadio] != 0)
- {
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "* %s has thrown away their portable radio.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- PlayerInfo[playerid][pRadio] = 0;
- PlayerInfo[playerid][pRadioFreq] = 0;
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying a portable radio to throw away!");
- }
- }
- else if(strcmp(choice,"weapons",true) == 0)
- {
- if(GetPVarType(playerid, "IsInArena"))
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in an arena!");
- return 1;
- }
- if(GetPVarInt( playerid, "EventToken") != 0)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You can't use this while you're in an event.");
- return 1;
- }
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- ResetPlayerWeaponsEx(playerid);
- format(string, sizeof(string), "* %s has thrown away their Weapons.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- else if(strcmp(choice,"packages",true) == 0)
- {
- if(GetPVarInt(playerid, "Packages") > 0)
- {
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "* %s has thrown away their material packages.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- DeletePVar(playerid, "Packages");
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any material packages to throw away!");
- }
- }
- else if(strcmp(choice,"pizza",true) == 0)
- {
- if(GetPVarType(playerid, "Pizza"))
- {
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "* %s has thrown away their pizza delivery.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- DeletePVar(playerid, "Pizza");
- DeletePVar(playerid, "pizzaTimer");
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You are not delivering any pizzas!");
- }
- }
- else if(strcmp(choice,"phone", true) == 0)
- {
- if(PlayerInfo[playerid][pPnumber] != 0)
- {
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "* %s throws away their phone.", GetPlayerNameEx(playerid));
- ProxChatBubble(playerid, string);
- PlayerInfo[playerid][pPnumber] = 0;
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You don't have a phone.");
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /drop [name] [(optional) amount]");
- SendClientMessageEx(playerid, COLOR_GREY, "Available names: Weapons, Materials, Packages, Radio, Pizza, Syringes, Backpack, Phone");
- return SendClientMessageEx(playerid, COLOR_GREY, "Available names: Pot, Crack, Meth, Ecstasy, Heroin");
- }
- return 1;
- }
- CMD:show(playerid, params[])
- {
- new string[128], giveplayerid, choice[32];
- if(sscanf(params, "us[32]", giveplayerid, choice))
- {
- SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /show [player] [name]");
- SendClientMessageEx(playerid, COLOR_GREY, "Available names: Pot, Crack, Meth, Ecstasy, Heroin, Materials, Credits");
- return 1;
- }
- if(giveplayerid == playerid)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You can not show this to yourself!");
- return 1;
- }
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if (!ProxDetectorS(5.0, playerid, giveplayerid))
- {
- SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
- return 1;
- }
- if (strcmp(choice, "materials", true) == 0)
- {
- new amount = PlayerInfo[playerid][pMats];
- if(amount < 1)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You do not have any materials!");
- return 1;
- }
- format(string, sizeof(string), "%s has shown you their %d materials.", GetPlayerNameEx(playerid), amount);
- SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
- format(string, sizeof(string), "You have shown %s your %d materials.", GetPlayerNameEx(giveplayerid), amount);
- SendClientMessageEx(playerid, COLOR_GRAD2, string);
- format(string, sizeof(string), "* %s has shown %s some materials.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
- ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- if (strcmp(choice, "pot", true) == 0)
- {
- new amount = PlayerInfo[playerid][pDrugs][0];
- if(amount < 1)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You do not have any pot!");
- return 1;
- }
- format(string, sizeof(string), "%s has shown you their %d grams of pot.", GetPlayerNameEx(playerid), amount);
- SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
- format(string, sizeof(string), "You have shown %s your %d grams of pot.", GetPlayerNameEx(giveplayerid), amount);
- SendClientMessageEx(playerid, COLOR_GRAD2, string);
- format(string, sizeof(string), "* %s has shown %s some pot.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
- ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- if (strcmp(choice, "crack", true) == 0)
- {
- new amount = PlayerInfo[playerid][pDrugs][1];
- if(amount < 1)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You do not have any crack!");
- return 1;
- }
- format(string, sizeof(string), "%s has shown you their %d grams of crack.", GetPlayerNameEx(playerid), amount);
- SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
- format(string, sizeof(string), "You have shown %s your %d grams of crack.", GetPlayerNameEx(giveplayerid), amount);
- SendClientMessageEx(playerid, COLOR_GRAD2, string);
- format(string, sizeof(string), "* %s has shown %s some crack.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
- ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- if (strcmp(choice, "meth", true) == 0)
- {
- new amount = PlayerInfo[playerid][pDrugs][2];
- if(amount < 1)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You do not have any meth!");
- return 1;
- }
- format(string, sizeof(string), "%s has shown you their %d grams of meth.", GetPlayerNameEx(playerid), amount);
- SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
- format(string, sizeof(string), "You have shown %s your %d grams of meth.", GetPlayerNameEx(giveplayerid), amount);
- SendClientMessageEx(playerid, COLOR_GRAD2, string);
- format(string, sizeof(string), "* %s has shown %s some meth.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
- ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- if (strcmp(choice, "ecstasy", true) == 0)
- {
- new amount = PlayerInfo[playerid][pDrugs][3];
- if(amount < 1)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You do not have any ecstasy!");
- return 1;
- }
- format(string, sizeof(string), "%s has shown you their %d grams of ecstasy.", GetPlayerNameEx(playerid), amount);
- SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
- format(string, sizeof(string), "You have shown %s your %d grams of ecstasy.", GetPlayerNameEx(giveplayerid), amount);
- SendClientMessageEx(playerid, COLOR_GRAD2, string);
- format(string, sizeof(string), "* %s has shown %s some ecstasy.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
- ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- if (strcmp(choice, "heroin", true) == 0)
- {
- new amount = PlayerInfo[playerid][pDrugs][4];
- if(amount < 1)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You do not have any heroin!");
- return 1;
- }
- format(string, sizeof(string), "%s has shown you their %d milligrams of heroin.", GetPlayerNameEx(playerid), amount);
- SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
- format(string, sizeof(string), "You have shown %s your %d milligrams of heroin.", GetPlayerNameEx(giveplayerid), amount);
- SendClientMessageEx(playerid, COLOR_GRAD2, string);
- format(string, sizeof(string), "* %s has shown %s some heroin.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
- ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- if (strcmp(choice, "credits", true) == 0)
- {
- new amount = PlayerInfo[playerid][pCredits];
- if(amount < 1)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You do not have any credits!");
- return 1;
- }
- format(string, sizeof(string), "%s has shown you their %d credits.", GetPlayerNameEx(playerid), amount);
- SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
- format(string, sizeof(string), "You have shown %s your %d credits.", GetPlayerNameEx(giveplayerid), amount);
- SendClientMessageEx(playerid, COLOR_GRAD2, string);
- format(string, sizeof(string), "* %s has shown %s some credits.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
- ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- }
- }
- return 1;
- }
- CMD:sell(playerid, params[])
- {
- new string[128], giveplayerid, choice[32], amount, price;
- if(sscanf(params, "us[32]dd", giveplayerid, choice, amount, price))
- {
- SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /sell [player] [name] [amount] [price]");
- SendClientMessageEx(playerid, COLOR_GREY, "Available names: Pot, Crack, Materials, Firework, Syringes, Rawopium, Heroin, RimKit, Carvoucher, PVIPVoucher");
- return 1;
- }
- if(PlayerCuffed[playerid] >= 1 || GetPVarInt(playerid, "pBagged") >= 1 ||PlayerInfo[playerid][pHospital] > 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now.");
- if(GetPVarInt(playerid, "WatchingTV")) return SendClientMessageEx(playerid, COLOR_GREY, "You can not do this while watching TV!");
- if(price < 50000) return SendClientMessageEx(playerid, COLOR_GREY, "Price can't be lower than $50,000. Use /give for deals below the scam limit.");
- if(price > 500000000) return SendClientMessageEx(playerid, COLOR_GREY, "Price can't be lower than $50,000. Use /give for deals below the scam limit.");
- if(price > 100000000)
- {
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s is trying to sell %s to %s for $%d.", GetPlayerNameEx(playerid), choice, GetPlayerNameEx(giveplayerid), price);
- ABroadCast(COLOR_YELLOW, string, 2);
- }
- if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "Amount cannot be below 1.");
- if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
- if(playerid == giveplayerid) return SendClientMessageEx(playerid, COLOR_GREY, "You can't sell to yourself!");
- if(!ProxDetectorS(8.0, playerid, giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
- else if (strcmp(choice, "rimkit", true) == 0)
- {
- if(amount > PlayerInfo[playerid][pRimMod])
- return SendClientMessageEx(playerid, COLOR_GREY, " You don't have that many rim kits.");
- format(string, sizeof(string), "* You offered %s to buy %d rim kits for $%s.", GetPlayerNameEx(giveplayerid), amount, number_format(price));
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
- 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));
- SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
- SetPVarInt(giveplayerid, "RimOffer", playerid);
- SetPVarInt(giveplayerid, "RimPrice", price);
- SetPVarInt(giveplayerid, "RimCount", amount);
- SetPVarInt(giveplayerid, "RimSeller_SQLId", GetPlayerSQLId(playerid));
- }
- else if (strcmp(choice, "pvipvoucher", true) == 0)
- {
- if(amount > PlayerInfo[playerid][pPVIPVoucher])
- return SendClientMessageEx(playerid, COLOR_GREY, " You don't have that many 1 month PVIP Vouchers.");
- format(string, sizeof(string), "* You offered %s to buy %d 1 month PVIP Voucher(s) for $%s.", GetPlayerNameEx(giveplayerid), amount, number_format(price));
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
- 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));
- SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
- SetPVarInt(giveplayerid, "PVIPVoucherOffer", playerid);
- SetPVarInt(giveplayerid, "PVIPVoucherPrice", price);
- SetPVarInt(giveplayerid, "PVIPVoucherCount", amount);
- SetPVarInt(giveplayerid, "PVIPVoucherSeller_SQLId", GetPlayerSQLId(playerid));
- }
- return 1;
- }
|