1
0

gift.pwn 229 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Gift System
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. forward GiftPlayer_(playerid, giveplayerid, gtype); // For use via CallRemoteFunction
  34. public GiftPlayer_(playerid, giveplayerid, gtype) return GiftPlayer(playerid, giveplayerid, gtype);
  35. stock GiftPlayer(playerid, giveplayerid, gtype = 2) // Default is the normal giftbox
  36. {
  37. if(gtype == 1)
  38. {
  39. if(GetPVarInt(giveplayerid, "GiftFail") >= 20)
  40. {
  41. new string[128];
  42. GivePlayerCash(giveplayerid, 20000);
  43. SendClientMessageEx(giveplayerid, COLOR_GRAD2, "Congratulations, you have won $20,000!");
  44. format(string, sizeof(string), "* %s was just gifted $20,000, enjoy!", GetPlayerNameEx(giveplayerid));
  45. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  46. format(string, sizeof(string), "* %s(%d) was just gifted $20,000, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  47. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  48. return true;
  49. }
  50. SetPVarInt(giveplayerid, "GiftFail", GetPVarInt(giveplayerid, "GiftFail")+1);
  51. }
  52. new string[128], value = 0;
  53. if(gtype == 1)
  54. {
  55. if(IsPlayerConnected(giveplayerid))
  56. {
  57. if(playerid != MAX_PLAYERS && PlayerInfo[playerid][pAdmin] < 2) return true;
  58. if(playerid != MAX_PLAYERS) return GiftPlayer(MAX_PLAYERS, giveplayerid, 1);
  59. new randgift = Random(0, 100);
  60. printf("randgift %d", randgift);
  61. switch(randgift)
  62. {
  63. case 0..50: // cat 1 - Common gifts
  64. {
  65. new randy = random(32);
  66. printf("cat 1 %d", randy);
  67. if(randy == 0)
  68. {
  69. if(dgVar[dgMoney][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  70. if(dgVar[dgMoney][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  71. if(dgVar[dgMoney][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  72. GivePlayerCash(giveplayerid, dgVar[dgMoney][2]);
  73. format(string, sizeof(string), "Congratulations, you have won $%s!", number_format(dgVar[dgMoney][2]));
  74. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  75. format(string, sizeof(string), "* %s was just gifted $%s, enjoy!", GetPlayerNameEx(giveplayerid), number_format(dgVar[dgMoney][2]));
  76. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  77. dgVar[dgMoney][1]--;
  78. format(string, sizeof(string), "* %s(%d) was just gifted $%s, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), number_format(dgVar[dgMoney][2]));
  79. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  80. return true;
  81. }
  82. if(randy == 1)
  83. {
  84. if(dgVar[dgRimKit][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  85. if(dgVar[dgRimKit][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  86. if(dgVar[dgRimKit][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  87. PlayerInfo[giveplayerid][pRimMod] += dgVar[dgRimKit][2];
  88. format(string, sizeof(string), "Congratulations, you have won %d rimkit(s)!", dgVar[dgRimKit][2]);
  89. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  90. format(string, sizeof(string), "* %s was just gifted %d rimkit(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgRimKit][2]);
  91. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  92. dgVar[dgRimKit][1]--;
  93. format(string, sizeof(string), "* %s(%d) was just gifted %d rimkit(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgRimKit][2]);
  94. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  95. return true;
  96. }
  97. if(randy == 2)
  98. {
  99. if(dgVar[dgFirework][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  100. if(dgVar[dgFirework][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  101. if(dgVar[dgFirework][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  102. PlayerInfo[giveplayerid][pFirework] += dgVar[dgFirework][2];
  103. format(string, sizeof(string), "Congratulations, you have won %d firework(s)!", dgVar[dgFirework][2]);
  104. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  105. format(string, sizeof(string), "* %s was just gifted %d firework(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgFirework][2]);
  106. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  107. dgVar[dgFirework][1]--;
  108. format(string, sizeof(string), "* %s(%d) was just gifted %d firework(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgFirework][2]);
  109. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  110. return true;
  111. }
  112. if(randy == 3)
  113. {
  114. if(dgVar[dgGVIP][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  115. if(dgVar[dgGVIP][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  116. if(dgVar[dgGVIP][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  117. PlayerInfo[giveplayerid][pGVIPExVoucher] += dgVar[dgGVIP][2];
  118. format(string, sizeof(string), "Congratulations, you have won %d Seven day Gold VIP Voucher(s)!", dgVar[dgGVIP][2]);
  119. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  120. format(string, sizeof(string), "* %s was just gifted %d Seven day Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGVIP][2]);
  121. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  122. dgVar[dgGVIP][1]--;
  123. format(string, sizeof(string), "* %s(%d) was just gifted %d Seven day Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGVIP][2]);
  124. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  125. return true;
  126. }
  127. if(randy == 4)
  128. {
  129. if(dgVar[dgGVIPEx][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  130. if(dgVar[dgGVIPEx][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  131. if(dgVar[dgGVIPEx][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  132. PlayerInfo[giveplayerid][pGVIPVoucher] += dgVar[dgGVIPEx][2];
  133. format(string, sizeof(string), "Congratulations, you have won %d One Month Gold VIP Voucher(s)!", dgVar[dgGVIPEx][2]);
  134. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  135. format(string, sizeof(string), "* %s was just gifted %d One Month Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGVIPEx][2]);
  136. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  137. dgVar[dgGVIPEx][1]--;
  138. format(string, sizeof(string), "* %s(%d) was just gifted %d One Month Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGVIPEx][2]);
  139. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  140. return true;
  141. }
  142. if(randy == 5)
  143. {
  144. if(dgVar[dgSVIP][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  145. if(dgVar[dgSVIP][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  146. if(dgVar[dgSVIP][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  147. PlayerInfo[giveplayerid][pSVIPExVoucher] += dgVar[dgSVIP][2];
  148. format(string, sizeof(string), "Congratulations, you have won %d Seven day Silver VIP Voucher (s)!", dgVar[dgSVIP][2]);
  149. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  150. format(string, sizeof(string), "* %s was just gifted %d Seven day Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgSVIP][2]);
  151. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  152. dgVar[dgSVIP][1]--;
  153. format(string, sizeof(string), "* %s(%d) was just gifted %d Seven day Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgSVIP][2]);
  154. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  155. return true;
  156. }
  157. if(randy == 6)
  158. {
  159. if(dgVar[dgSVIPEx][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  160. if(dgVar[dgSVIPEx][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  161. if(dgVar[dgSVIPEx][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  162. PlayerInfo[giveplayerid][pSVIPVoucher] += dgVar[dgSVIPEx][2];
  163. format(string, sizeof(string), "Congratulations, you have won %d One Month Silver VIP Voucher(s)!", dgVar[dgSVIPEx][2]);
  164. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  165. format(string, sizeof(string), "* %s was just gifted %d One Month Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgSVIPEx][2]);
  166. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  167. dgVar[dgSVIPEx][1]--;
  168. format(string, sizeof(string), "* %s(%d) was just gifted %d One Month Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgSVIPEx][2]);
  169. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  170. return true;
  171. }
  172. if(randy == 7)
  173. {
  174. if(dgVar[dgCarSlot][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  175. if(dgVar[dgCarSlot][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  176. if(dgVar[dgCarSlot][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  177. PlayerInfo[giveplayerid][pVehicleSlot] += dgVar[dgCarSlot][2];
  178. format(string, sizeof(string), "Congratulations, you have won %d Car Slot(s)!", dgVar[dgCarSlot][2]);
  179. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  180. format(string, sizeof(string), "* %s was just gifted %d Car Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCarSlot][2]);
  181. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  182. dgVar[dgCarSlot][1]--;
  183. format(string, sizeof(string), "* %s(%d) was just gifted %d Car Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCarSlot][2]);
  184. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  185. return true;
  186. }
  187. if(randy == 8)
  188. {
  189. if(dgVar[dgToySlot][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  190. if(dgVar[dgCarSlot][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  191. if(dgVar[dgCarSlot][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  192. PlayerInfo[giveplayerid][pToySlot] += dgVar[dgToySlot][2];
  193. format(string, sizeof(string), "Congratulations, you have won %d Toy Slot(s)!", dgVar[dgToySlot][2]);
  194. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  195. format(string, sizeof(string), "* %s was just gifted %d Toy Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgToySlot][2]);
  196. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  197. dgVar[dgToySlot][1]--;
  198. format(string, sizeof(string), "* %s(%d) was just gifted %d Toy Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgToySlot][2]);
  199. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  200. return true;
  201. }
  202. if(randy == 9)
  203. {
  204. if(dgVar[dgArmor][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  205. if(dgVar[dgArmor][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  206. if(dgVar[dgArmor][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  207. new Float: armor;
  208. GetArmour(giveplayerid, armor);
  209. if(armor+dgVar[dgArmor][2] >= 100) return GiftPlayer(playerid, giveplayerid, 1);
  210. SetArmour(giveplayerid, armor + dgVar[dgArmor][2]);
  211. format(string, sizeof(string), "Congratulations, you have won %d Armour!", dgVar[dgArmor][2]);
  212. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  213. format(string, sizeof(string), "* %s was just gifted %d Armour, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgArmor][2]);
  214. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  215. dgVar[dgArmor][1]--;
  216. format(string, sizeof(string), "* %s(%d) was just gifted %d Armour, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgArmor][2]);
  217. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  218. return true;
  219. }
  220. if(randy == 10)
  221. {
  222. if(dgVar[dgFirstaid][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  223. if(dgVar[dgFirstaid][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  224. if(dgVar[dgFirstaid][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  225. PlayerInfo[giveplayerid][pFirstaid] += dgVar[dgFirstaid][2];
  226. format(string, sizeof(string), "Congratulations, you have won %d Firstaid(s)!", dgVar[dgFirstaid][2]);
  227. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  228. format(string, sizeof(string), "* %s was just gifted %d Firstaid(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgFirstaid][2]);
  229. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  230. dgVar[dgFirstaid][1]--;
  231. format(string, sizeof(string), "* %s(%d) was just gifted %d Firstaid(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgFirstaid][2]);
  232. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  233. return true;
  234. }
  235. if(randy == 11)
  236. {
  237. if(dgVar[dgDDFlag][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  238. if(dgVar[dgDDFlag][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  239. if(dgVar[dgDDFlag][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  240. AddFlag(giveplayerid, INVALID_PLAYER_ID, "Dynamic Gift Box: 1 Dynamic Door");
  241. format(string, sizeof(string), "Congratulations, you have won %d Dynamic Door Flag(s)!", dgVar[dgDDFlag][2]);
  242. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  243. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This prize may take up to 48 hours to be rewarded..");
  244. format(string, sizeof(string), "* %s was just gifted %d Dynamic Door Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgDDFlag][2]);
  245. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  246. dgVar[dgDDFlag][1]--;
  247. format(string, sizeof(string), "* %s(%d) was just gifted %d Dynamic Door Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgDDFlag][2]);
  248. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  249. return true;
  250. }
  251. if(randy == 12)
  252. {
  253. if(dgVar[dgGateFlag][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  254. if(dgVar[dgGateFlag][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  255. if(dgVar[dgGateFlag][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  256. AddFlag(giveplayerid, INVALID_PLAYER_ID, "Dynamic Gift Box: 1 Gate Gate");
  257. format(string, sizeof(string), "Congratulations, you have won %d Gate Flag(s)!", dgVar[dgGateFlag][2]);
  258. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  259. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This prize may take up to 48 hours to be rewarded..");
  260. format(string, sizeof(string), "* %s was just gifted %d Dynamic Gate Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGateFlag][2]);
  261. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  262. dgVar[dgGateFlag][1]--;
  263. format(string, sizeof(string), "* %s(%d) was just gifted %d Dynamic Gate Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGateFlag][2]);
  264. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  265. return true;
  266. }
  267. if(randy == 13)
  268. {
  269. if(dgVar[dgCredits][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  270. if(dgVar[dgCredits][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  271. if(dgVar[dgCredits][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  272. GivePlayerCredits(giveplayerid, dgVar[dgCredits][2], 1);
  273. format(string, sizeof(string), "Congratulations, you have won %d Credit(s)!", dgVar[dgCredits][2]);
  274. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  275. format(string, sizeof(string), "* %s was just gifted %d Credit(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCredits][2]);
  276. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  277. dgVar[dgCredits][1]--;
  278. format(string, sizeof(string), "* %s(%d) was just gifted %d Credit(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCredits][2]);
  279. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  280. return true;
  281. }
  282. if(randy == 14)
  283. {
  284. if(dgVar[dgPriorityAd][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  285. if(dgVar[dgPriorityAd][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  286. if(dgVar[dgPriorityAd][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  287. PlayerInfo[giveplayerid][pAdvertVoucher] += dgVar[dgPriorityAd][2];
  288. format(string, sizeof(string), "Congratulations, you have won %d Priority Advertisement Voucher(s)!", dgVar[dgPriorityAd][2]);
  289. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  290. format(string, sizeof(string), "* %s was just gifted %d Priority Advertisement Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPriorityAd][2]);
  291. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  292. dgVar[dgPriorityAd][1]--;
  293. format(string, sizeof(string), "* %s(%d) was just gifted %d Priority Advertisement Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPriorityAd][2]);
  294. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  295. return true;
  296. }
  297. if(randy == 15)
  298. {
  299. if(dgVar[dgHealthNArmor][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  300. if(dgVar[dgHealthNArmor][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  301. if(dgVar[dgHealthNArmor][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  302. SetHealth(giveplayerid, 100.0);
  303. SetArmour(giveplayerid, 100);
  304. format(string, sizeof(string), "Congratulations, you have won Full Health & Armor!");
  305. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  306. format(string, sizeof(string), "* %s was just gifted %d Full Health & Armor, enjoy!", GetPlayerNameEx(giveplayerid));
  307. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  308. dgVar[dgHealthNArmor][1]--;
  309. format(string, sizeof(string), "* %s(%d) was just gifted %d Full Health & Armor, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  310. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  311. return true;
  312. }
  313. if(randy == 16)
  314. {
  315. if(dgVar[dgGiftReset][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  316. if(dgVar[dgGiftReset][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  317. if(dgVar[dgGiftReset][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  318. PlayerInfo[giveplayerid][pGiftVoucher] += dgVar[dgGiftReset][2];
  319. format(string, sizeof(string), "Congratulations, you have won a %d Gift Reset Voucher(s)!", dgVar[dgGiftReset][2]);
  320. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  321. format(string, sizeof(string), "* %s was just gifted %d Gift Reset Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGiftReset][2]);
  322. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  323. dgVar[dgGiftReset][1]--;
  324. format(string, sizeof(string), "* %s(%d) was just gifted %d Gift Reset Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGiftReset][2]);
  325. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  326. return true;
  327. }
  328. if(randy == 17)
  329. {
  330. if(dgVar[dgMaterial][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  331. if(dgVar[dgMaterial][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  332. if(dgVar[dgMaterial][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  333. PlayerInfo[giveplayerid][pMats] += dgVar[dgMaterial][2];
  334. format(string, sizeof(string), "Congratulations, you have won a %d Material(s)!", dgVar[dgMaterial][2]);
  335. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  336. format(string, sizeof(string), "* %s was just gifted %d Material(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgMaterial][2]);
  337. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  338. dgVar[dgMaterial][1]--;
  339. format(string, sizeof(string), "* %s(%d) was just gifted %d Material(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgMaterial][2]);
  340. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  341. return true;
  342. }
  343. if(randy == 18)
  344. {
  345. if(dgVar[dgWarning][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  346. if(dgVar[dgWarning][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  347. if(dgVar[dgWarning][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  348. if(dgVar[dgWarning][2] > 3 || dgVar[dgWarning][2] < 0)
  349. {
  350. if(PlayerInfo[giveplayerid][pWarns] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  351. PlayerInfo[giveplayerid][pWarns] -= dgVar[dgWarning][2];
  352. }
  353. else
  354. return GiftPlayer(playerid, giveplayerid, 1);
  355. format(string, sizeof(string), "Congratulations, you have won a %d Warning(s) Removal!", dgVar[dgWarning][2]);
  356. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  357. format(string, sizeof(string), "* %s was just gifted %d Warning(s) Removal, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgWarning][2]);
  358. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  359. dgVar[dgWarning][1]--;
  360. format(string, sizeof(string), "* %s(%d) was just gifted %d Warning(s) Removal, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgWarning][2]);
  361. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  362. return true;
  363. }
  364. if(randy == 19)
  365. {
  366. if(dgVar[dgPot][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  367. if(dgVar[dgPot][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  368. if(dgVar[dgPot][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  369. PlayerInfo[giveplayerid][pDrugs][0] += dgVar[dgPot][2];
  370. format(string, sizeof(string), "Congratulations, you have won %d pot!", dgVar[dgPot][2]);
  371. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  372. format(string, sizeof(string), "* %s was just gifted %d pot, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPot][2]);
  373. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  374. dgVar[dgPot][1]--;
  375. format(string, sizeof(string), "* %s(%d) was just gifted %d pot, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPot][2]);
  376. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  377. return true;
  378. }
  379. if(randy == 20)
  380. {
  381. if(dgVar[dgCrack][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  382. if(dgVar[dgCrack][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  383. if(dgVar[dgCrack][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  384. PlayerInfo[giveplayerid][pDrugs][1] += dgVar[dgCrack][2];
  385. format(string, sizeof(string), "Congratulations, you have won %d Crack!", dgVar[dgCrack][2]);
  386. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  387. format(string, sizeof(string), "* %s was just gifted %d Crack, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCrack][2]);
  388. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  389. dgVar[dgCrack][1]--;
  390. format(string, sizeof(string), "* %s(%d) was just gifted %d Crack, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCrack][2]);
  391. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  392. return true;
  393. }
  394. if(randy == 21)
  395. {
  396. if(dgVar[dgPaintballToken][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  397. if(dgVar[dgPaintballToken][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  398. if(dgVar[dgPaintballToken][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  399. if(PlayerInfo[giveplayerid][pDonateRank] >= 4) return GiftPlayer(playerid, giveplayerid, 1);
  400. PlayerInfo[giveplayerid][pPaintTokens] += dgVar[dgPaintballToken][2];
  401. format(string, sizeof(string), "Congratulations, you have won a %d Paintball Token(s)!", dgVar[dgPaintballToken][2]);
  402. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  403. format(string, sizeof(string), "* %s was just gifted %d Paintball Token(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPaintballToken][2]);
  404. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  405. dgVar[dgPaintballToken][1]--;
  406. format(string, sizeof(string), "* %s(%d) was just gifted %d Paintball Token(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPaintballToken][2]);
  407. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  408. return true;
  409. }
  410. if(randy == 22)
  411. {
  412. if(dgVar[dgVIPToken][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  413. if(dgVar[dgVIPToken][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  414. if(dgVar[dgVIPToken][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  415. if(PlayerInfo[giveplayerid][pDonateRank] >= 4) return GiftPlayer(playerid, giveplayerid, 1);
  416. PlayerInfo[giveplayerid][pTokens] += dgVar[dgVIPToken][2];
  417. format(string, sizeof(string), "Congratulations, you have won a %d VIP Token(s)!", dgVar[dgVIPToken][2]);
  418. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  419. format(string, sizeof(string), "* %s was just gifted %d VIP Token(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgVIPToken][2]);
  420. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  421. dgVar[dgVIPToken][1]--;
  422. format(string, sizeof(string), "* %s(%d) was just gifted %d VIP Token(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgVIPToken][2]);
  423. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  424. return true;
  425. }
  426. if(randy == 23)
  427. {
  428. if(dgVar[dgRespectPoint][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  429. if(dgVar[dgRespectPoint][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  430. if(dgVar[dgRespectPoint][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  431. PlayerInfo[giveplayerid][pExp] += dgVar[dgRespectPoint][2];
  432. format(string, sizeof(string), "Congratulations, you have won a %d Respect Point(s)!", dgVar[dgRespectPoint][2]);
  433. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  434. format(string, sizeof(string), "* %s was just gifted %d Respect Point(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgRespectPoint][2]);
  435. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  436. dgVar[dgRespectPoint][1]--;
  437. format(string, sizeof(string), "* %s(%d) was just gifted %d Respect Point(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgRespectPoint][2]);
  438. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  439. return true;
  440. }
  441. if(randy == 24)
  442. {
  443. if(dgVar[dgCarVoucher][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  444. if(dgVar[dgCarVoucher][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  445. if(dgVar[dgCarVoucher][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  446. PlayerInfo[giveplayerid][pVehVoucher] += dgVar[dgCarVoucher][2];
  447. format(string, sizeof(string), "Congratulations, you have won a %d Car Voucher(s)!", dgVar[dgCarVoucher][2]);
  448. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  449. format(string, sizeof(string), "* %s was just gifted %d Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCarVoucher][2]);
  450. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  451. dgVar[dgCarVoucher][1]--;
  452. format(string, sizeof(string), "* %s(%d) was just gifted %d Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCarVoucher][2]);
  453. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  454. return true;
  455. }
  456. if(randy == 25)
  457. {
  458. if(dgVar[dgBuddyInvite][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  459. if(dgVar[dgBuddyInvite][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  460. if(dgVar[dgBuddyInvite][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  461. if(PlayerInfo[giveplayerid][pDonateRank] != 0) return GiftPlayer(playerid, giveplayerid, 1);
  462. PlayerInfo[giveplayerid][pDonateRank] = 1;
  463. PlayerInfo[giveplayerid][pTempVIP] = 180;
  464. PlayerInfo[giveplayerid][pBuddyInvited] = 1;
  465. format(string, sizeof(string), "BUDDY INVITE: %s(%d) has been invited to VIP by System", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  466. Log("logs/setvip.log", string);
  467. format(string, sizeof(string), "Congratulations, you have won a Buddy Invite!");
  468. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  469. format(string, sizeof(string), "* %s was just gifted a BuddyInvite, enjoy!", GetPlayerNameEx(giveplayerid));
  470. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  471. dgVar[dgBuddyInvite][1]--;
  472. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  473. return true;
  474. }
  475. if(randy == 26)
  476. {
  477. if(dgVar[dgLaser][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  478. if(dgVar[dgLaser][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  479. if(dgVar[dgLaser][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  480. new icount = GetPlayerToySlots(giveplayerid), success = 0;
  481. for(new v = 0; v < icount; v++)
  482. {
  483. if(PlayerToyInfo[giveplayerid][v][ptModelID] == 0)
  484. {
  485. PlayerToyInfo[giveplayerid][v][ptModelID] = 18643;
  486. PlayerToyInfo[giveplayerid][v][ptBone] = 6;
  487. PlayerToyInfo[giveplayerid][v][ptPosX] = 0.0;
  488. PlayerToyInfo[giveplayerid][v][ptPosY] = 0.0;
  489. PlayerToyInfo[giveplayerid][v][ptPosZ] = 0.0;
  490. PlayerToyInfo[giveplayerid][v][ptRotX] = 0.0;
  491. PlayerToyInfo[giveplayerid][v][ptRotY] = 0.0;
  492. PlayerToyInfo[giveplayerid][v][ptRotZ] = 0.0;
  493. PlayerToyInfo[giveplayerid][v][ptScaleX] = 1.0;
  494. PlayerToyInfo[giveplayerid][v][ptScaleY] = 1.0;
  495. PlayerToyInfo[giveplayerid][v][ptScaleZ] = 1.0;
  496. PlayerToyInfo[giveplayerid][v][ptTradable] = 1;
  497. g_mysql_NewToy(giveplayerid, v);
  498. success = 1;
  499. break;
  500. }
  501. }
  502. if(success == 0)
  503. {
  504. for(new i = 0; i < MAX_PLAYERTOYS; i++)
  505. {
  506. if(PlayerToyInfo[giveplayerid][i][ptModelID] == 0)
  507. {
  508. PlayerToyInfo[giveplayerid][i][ptModelID] = 18643;
  509. PlayerToyInfo[giveplayerid][i][ptBone] = 6;
  510. PlayerToyInfo[giveplayerid][i][ptPosX] = 0.0;
  511. PlayerToyInfo[giveplayerid][i][ptPosY] = 0.0;
  512. PlayerToyInfo[giveplayerid][i][ptPosZ] = 0.0;
  513. PlayerToyInfo[giveplayerid][i][ptRotX] = 0.0;
  514. PlayerToyInfo[giveplayerid][i][ptRotY] = 0.0;
  515. PlayerToyInfo[giveplayerid][i][ptRotZ] = 0.0;
  516. PlayerToyInfo[giveplayerid][i][ptScaleX] = 1.0;
  517. PlayerToyInfo[giveplayerid][i][ptScaleY] = 1.0;
  518. PlayerToyInfo[giveplayerid][i][ptScaleZ] = 1.0;
  519. PlayerToyInfo[giveplayerid][i][ptTradable] = 1;
  520. PlayerToyInfo[giveplayerid][i][ptSpecial] = 1;
  521. g_mysql_NewToy(giveplayerid, i);
  522. SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Due to you not having any available slots, we've temporarily gave you an additional slot to use/sell/trade your laser.");
  523. SendClientMessageEx(giveplayerid, COLOR_RED, "Note: Please take note that after selling the laser, the temporarily additional toy slot will be removed.");
  524. break;
  525. }
  526. }
  527. }
  528. format(string, sizeof(string), "Congratulations, you have won a Laser!");
  529. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  530. format(string, sizeof(string), "* %s was just gifted a Laser, enjoy!", GetPlayerNameEx(giveplayerid));
  531. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  532. dgVar[dgLaser][1]--;
  533. format(string, sizeof(string), "* %s(%d) was just gifted a Laser, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  534. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  535. return true;
  536. }
  537. if(randy == 27)
  538. {
  539. if(dgVar[dgCustomToy][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  540. if(dgVar[dgCustomToy][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  541. if(dgVar[dgCustomToy][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  542. /*new icount = GetPlayerToySlots(giveplayerid), success = 0;
  543. for(new v = 0; v < icount; v++)
  544. {
  545. if(PlayerToyInfo[giveplayerid][v][ptModelID] == 0)
  546. {
  547. PlayerToyInfo[giveplayerid][v][ptModelID] = dgVar[dgCustomToy][2];
  548. PlayerToyInfo[giveplayerid][v][ptBone] = 1;
  549. PlayerToyInfo[giveplayerid][v][ptPosX] = 0.0;
  550. PlayerToyInfo[giveplayerid][v][ptPosY] = 0.0;
  551. PlayerToyInfo[giveplayerid][v][ptPosZ] = 0.0;
  552. PlayerToyInfo[giveplayerid][v][ptRotX] = 0.0;
  553. PlayerToyInfo[giveplayerid][v][ptRotY] = 0.0;
  554. PlayerToyInfo[giveplayerid][v][ptRotZ] = 0.0;
  555. PlayerToyInfo[giveplayerid][v][ptScaleX] = 1.0;
  556. PlayerToyInfo[giveplayerid][v][ptScaleY] = 1.0;
  557. PlayerToyInfo[giveplayerid][v][ptScaleZ] = 1.0;
  558. PlayerToyInfo[giveplayerid][v][ptTradable] = 1;
  559. g_mysql_NewToy(giveplayerid, v);
  560. success = 1;
  561. break;
  562. }
  563. }
  564. if(success == 0)
  565. {
  566. for(new i = 0; i < MAX_PLAYERTOYS; i++)
  567. {
  568. if(PlayerToyInfo[giveplayerid][i][ptModelID] == 0)
  569. {
  570. PlayerToyInfo[giveplayerid][i][ptModelID] = dgVar[dgCustomToy][2];
  571. PlayerToyInfo[giveplayerid][i][ptBone] = 6;
  572. PlayerToyInfo[giveplayerid][i][ptPosX] = 0.0;
  573. PlayerToyInfo[giveplayerid][i][ptPosY] = 0.0;
  574. PlayerToyInfo[giveplayerid][i][ptPosZ] = 0.0;
  575. PlayerToyInfo[giveplayerid][i][ptRotX] = 0.0;
  576. PlayerToyInfo[giveplayerid][i][ptRotY] = 0.0;
  577. PlayerToyInfo[giveplayerid][i][ptRotZ] = 0.0;
  578. PlayerToyInfo[giveplayerid][i][ptScaleX] = 1.0;
  579. PlayerToyInfo[giveplayerid][i][ptScaleY] = 1.0;
  580. PlayerToyInfo[giveplayerid][i][ptScaleZ] = 1.0;
  581. PlayerToyInfo[giveplayerid][i][ptTradable] = 1;
  582. PlayerToyInfo[giveplayerid][i][ptSpecial] = 1;
  583. g_mysql_NewToy(giveplayerid, i);
  584. SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Due to you not having any available slots, we've temporarily gave you an additional slot to use/sell/trade your custom toy.");
  585. SendClientMessageEx(giveplayerid, COLOR_RED, "Note: Please take note that after selling the custom toy, the temporarily additional toy slot will be removed.");
  586. break;
  587. }
  588. }
  589. }*/
  590. AddFlag(giveplayerid, INVALID_PLAYER_ID, "[GIFTBOX] 1x Custom Toy");
  591. format(string, sizeof(string), "Congratulations, you have won a Custom Toy!");
  592. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  593. format(string, sizeof(string), "* %s was just gifted a Custom Toy, enjoy!", GetPlayerNameEx(giveplayerid));
  594. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  595. dgVar[dgCustomToy][1]--;
  596. format(string, sizeof(string), "* %s(%d) was just gifted a Custom Toy, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  597. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  598. return true;
  599. }
  600. if(randy == 28)
  601. {
  602. if(dgVar[dgAdmuteReset][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  603. if(dgVar[dgAdmuteReset][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  604. if(dgVar[dgAdmuteReset][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  605. if(PlayerInfo[giveplayerid][pADMuteTotal] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  606. PlayerInfo[giveplayerid][pADMuteTotal] -= dgVar[dgAdmuteReset][2];
  607. format(string, sizeof(string), "Congratulations, you have won %d Admute Reset(s)!", dgVar[dgAdmuteReset][2]);
  608. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  609. format(string, sizeof(string), "* %s was just gifted %d Admute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgAdmuteReset][2]);
  610. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  611. dgVar[dgAdmuteReset][1]--;
  612. format(string, sizeof(string), "* %s(%d) was just gifted %d Admute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgAdmuteReset][2]);
  613. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  614. return true;
  615. }
  616. if(randy == 29)
  617. {
  618. if(dgVar[dgNewbieMuteReset][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  619. if(dgVar[dgNewbieMuteReset][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  620. if(dgVar[dgNewbieMuteReset][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  621. if(PlayerInfo[giveplayerid][pNMuteTotal] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  622. PlayerInfo[giveplayerid][pNMuteTotal] -= dgVar[dgNewbieMuteReset][2];
  623. format(string, sizeof(string), "Congratulations, you have won %d Newbie Mute Reset(s)!", dgVar[dgNewbieMuteReset][2]);
  624. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  625. format(string, sizeof(string), "* %s was just gifted %d Newbie Mute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgNewbieMuteReset][2]);
  626. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  627. dgVar[dgNewbieMuteReset][1]--;
  628. format(string, sizeof(string), "* %s(%d) was just gifted %d Newbie Mute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgNewbieMuteReset][2]);
  629. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  630. return true;
  631. }
  632. if(randy == 30)
  633. {
  634. if(dgVar[dgRestrictedCarVoucher][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  635. if(dgVar[dgRestrictedCarVoucher][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  636. if(dgVar[dgRestrictedCarVoucher][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  637. PlayerInfo[giveplayerid][pCarVoucher] += dgVar[dgRestrictedCarVoucher][2];
  638. format(string, sizeof(string), "Congratulations, you have won a %d Restricted Car Voucher(s)!", dgVar[dgRestrictedCarVoucher][2]);
  639. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  640. format(string, sizeof(string), "* %s was just gifted %d Restricted Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgRestrictedCarVoucher][2]);
  641. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  642. dgVar[dgRestrictedCarVoucher][1]--;
  643. format(string, sizeof(string), "* %s(%d) was just gifted %d Restricted Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgRestrictedCarVoucher][2]);
  644. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  645. return true;
  646. }
  647. if(randy == 31)
  648. {
  649. if(dgVar[dgPlatinumVIPVoucher][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  650. if(dgVar[dgPlatinumVIPVoucher][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  651. if(dgVar[dgPlatinumVIPVoucher][3] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  652. PlayerInfo[giveplayerid][pPVIPVoucher] += dgVar[dgPlatinumVIPVoucher][2];
  653. format(string, sizeof(string), "Congratulations, you have won a %d 1 month PVIP Voucher(s)!", dgVar[dgPlatinumVIPVoucher][2]);
  654. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  655. format(string, sizeof(string), "* %s was just gifted %d 1 month PVIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPlatinumVIPVoucher][2]);
  656. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  657. dgVar[dgPlatinumVIPVoucher][1]--;
  658. format(string, sizeof(string), "* %s(%d) was just gifted %d 1 month PVIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPlatinumVIPVoucher][2]);
  659. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  660. return true;
  661. }
  662. else return SendClientMessageEx(giveplayerid, COLOR_RED, "Seems like the dynamic giftbox is empty, please try again.");
  663. }
  664. case 51..80: // cat 2 - Slightly more rare gifts
  665. {
  666. new randy = random(32);
  667. printf("cat 1 %d", randy);
  668. if(randy == 0)
  669. {
  670. if(dgVar[dgMoney][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  671. if(dgVar[dgMoney][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  672. if(dgVar[dgMoney][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  673. GivePlayerCash(giveplayerid, dgVar[dgMoney][2]);
  674. format(string, sizeof(string), "Congratulations, you have won $%s!", number_format(dgVar[dgMoney][2]));
  675. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  676. format(string, sizeof(string), "* %s was just gifted $%s, enjoy!", GetPlayerNameEx(giveplayerid), number_format(dgVar[dgMoney][2]));
  677. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  678. dgVar[dgMoney][1]--;
  679. format(string, sizeof(string), "* %s(%d) was just gifted $%s, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), number_format(dgVar[dgMoney][2]));
  680. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  681. return true;
  682. }
  683. if(randy == 1)
  684. {
  685. if(dgVar[dgRimKit][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  686. if(dgVar[dgRimKit][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  687. if(dgVar[dgRimKit][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  688. PlayerInfo[giveplayerid][pRimMod] += dgVar[dgRimKit][2];
  689. format(string, sizeof(string), "Congratulations, you have won %d rimkit(s)!", dgVar[dgRimKit][2]);
  690. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  691. format(string, sizeof(string), "* %s was just gifted %d rimkit(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgRimKit][2]);
  692. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  693. dgVar[dgRimKit][1]--;
  694. format(string, sizeof(string), "* %s(%d) was just gifted %d rimkit(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgRimKit][2]);
  695. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  696. return true;
  697. }
  698. if(randy == 2)
  699. {
  700. if(dgVar[dgFirework][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  701. if(dgVar[dgFirework][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  702. if(dgVar[dgFirework][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  703. PlayerInfo[giveplayerid][pFirework] += dgVar[dgFirework][2];
  704. format(string, sizeof(string), "Congratulations, you have won %d firework(s)!", dgVar[dgFirework][2]);
  705. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  706. format(string, sizeof(string), "* %s was just gifted %d firework(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgFirework][2]);
  707. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  708. dgVar[dgFirework][1]--;
  709. format(string, sizeof(string), "* %s(%d) was just gifted %d firework(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgFirework][2]);
  710. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  711. return true;
  712. }
  713. if(randy == 3)
  714. {
  715. if(dgVar[dgGVIP][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  716. if(dgVar[dgGVIP][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  717. if(dgVar[dgGVIP][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  718. PlayerInfo[giveplayerid][pGVIPExVoucher] += dgVar[dgGVIP][2];
  719. format(string, sizeof(string), "Congratulations, you have won %d Seven day Gold VIP Voucher(s)!", dgVar[dgGVIP][2]);
  720. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  721. format(string, sizeof(string), "* %s was just gifted %d Seven day Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGVIP][2]);
  722. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  723. dgVar[dgGVIP][1]--;
  724. format(string, sizeof(string), "* %s(%d) was just gifted %d Seven day Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGVIP][2]);
  725. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  726. return true;
  727. }
  728. if(randy == 4)
  729. {
  730. if(dgVar[dgGVIPEx][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  731. if(dgVar[dgGVIPEx][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  732. if(dgVar[dgGVIPEx][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  733. PlayerInfo[giveplayerid][pGVIPVoucher] += dgVar[dgGVIPEx][2];
  734. format(string, sizeof(string), "Congratulations, you have won %d One Month Gold VIP Voucher(s)!", dgVar[dgGVIPEx][2]);
  735. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  736. format(string, sizeof(string), "* %s was just gifted %d One Month Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGVIPEx][2]);
  737. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  738. dgVar[dgGVIPEx][1]--;
  739. format(string, sizeof(string), "* %s(%d) was just gifted %d One Month Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGVIPEx][2]);
  740. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  741. return true;
  742. }
  743. if(randy == 5)
  744. {
  745. if(dgVar[dgSVIP][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  746. if(dgVar[dgSVIP][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  747. if(dgVar[dgSVIP][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  748. PlayerInfo[giveplayerid][pSVIPExVoucher] += dgVar[dgSVIP][2];
  749. format(string, sizeof(string), "Congratulations, you have won %d Seven day Silver VIP Voucher (s)!", dgVar[dgSVIP][2]);
  750. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  751. format(string, sizeof(string), "* %s was just gifted %d Seven day Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgSVIP][2]);
  752. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  753. dgVar[dgSVIP][1]--;
  754. format(string, sizeof(string), "* %s(%d) was just gifted %d Seven day Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgSVIP][2]);
  755. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  756. return true;
  757. }
  758. if(randy == 6)
  759. {
  760. if(dgVar[dgSVIPEx][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  761. if(dgVar[dgSVIPEx][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  762. if(dgVar[dgSVIPEx][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  763. PlayerInfo[giveplayerid][pSVIPVoucher] += dgVar[dgSVIPEx][2];
  764. format(string, sizeof(string), "Congratulations, you have won %d One Month Silver VIP Voucher(s)!", dgVar[dgSVIPEx][2]);
  765. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  766. format(string, sizeof(string), "* %s was just gifted %d One Month Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgSVIPEx][2]);
  767. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  768. dgVar[dgSVIPEx][1]--;
  769. format(string, sizeof(string), "* %s(%d) was just gifted %d One Month Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgSVIPEx][2]);
  770. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  771. return true;
  772. }
  773. if(randy == 7)
  774. {
  775. if(dgVar[dgCarSlot][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  776. if(dgVar[dgCarSlot][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  777. if(dgVar[dgCarSlot][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  778. PlayerInfo[giveplayerid][pVehicleSlot] += dgVar[dgCarSlot][2];
  779. format(string, sizeof(string), "Congratulations, you have won %d Car Slot(s)!", dgVar[dgCarSlot][2]);
  780. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  781. format(string, sizeof(string), "* %s was just gifted %d Car Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCarSlot][2]);
  782. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  783. dgVar[dgCarSlot][1]--;
  784. format(string, sizeof(string), "* %s(%d) was just gifted %d Car Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCarSlot][2]);
  785. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  786. return true;
  787. }
  788. if(randy == 8)
  789. {
  790. if(dgVar[dgToySlot][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  791. if(dgVar[dgCarSlot][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  792. if(dgVar[dgCarSlot][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  793. PlayerInfo[giveplayerid][pToySlot] += dgVar[dgToySlot][2];
  794. format(string, sizeof(string), "Congratulations, you have won %d Toy Slot(s)!", dgVar[dgToySlot][2]);
  795. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  796. format(string, sizeof(string), "* %s was just gifted %d Toy Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgToySlot][2]);
  797. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  798. dgVar[dgToySlot][1]--;
  799. format(string, sizeof(string), "* %s(%d) was just gifted %d Toy Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgToySlot][2]);
  800. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  801. return true;
  802. }
  803. if(randy == 9)
  804. {
  805. if(dgVar[dgArmor][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  806. if(dgVar[dgArmor][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  807. if(dgVar[dgArmor][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  808. new Float: armor;
  809. GetArmour(giveplayerid, armor);
  810. if(armor+dgVar[dgArmor][2] >= 100) return GiftPlayer(playerid, giveplayerid, 1);
  811. SetArmour(giveplayerid, armor + dgVar[dgArmor][2]);
  812. format(string, sizeof(string), "Congratulations, you have won %d Armour!", dgVar[dgArmor][2]);
  813. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  814. format(string, sizeof(string), "* %s was just gifted %d Armour, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgArmor][2]);
  815. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  816. dgVar[dgArmor][1]--;
  817. format(string, sizeof(string), "* %s(%d) was just gifted %d Armour, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgArmor][2]);
  818. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  819. return true;
  820. }
  821. if(randy == 10)
  822. {
  823. if(dgVar[dgFirstaid][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  824. if(dgVar[dgFirstaid][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  825. if(dgVar[dgFirstaid][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  826. PlayerInfo[giveplayerid][pFirstaid] += dgVar[dgFirstaid][2];
  827. format(string, sizeof(string), "Congratulations, you have won %d Firstaid(s)!", dgVar[dgFirstaid][2]);
  828. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  829. format(string, sizeof(string), "* %s was just gifted %d Firstaid(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgFirstaid][2]);
  830. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  831. dgVar[dgFirstaid][1]--;
  832. format(string, sizeof(string), "* %s(%d) was just gifted %d Firstaid(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgFirstaid][2]);
  833. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  834. return true;
  835. }
  836. if(randy == 11)
  837. {
  838. if(dgVar[dgDDFlag][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  839. if(dgVar[dgDDFlag][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  840. if(dgVar[dgDDFlag][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  841. AddFlag(giveplayerid, INVALID_PLAYER_ID, "Dynamic Gift Box: 1 Dynamic Door");
  842. format(string, sizeof(string), "Congratulations, you have won %d Dynamic Door Flag(s)!", dgVar[dgDDFlag][2]);
  843. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  844. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This prize may take up to 48 hours to be rewarded..");
  845. format(string, sizeof(string), "* %s was just gifted %d Dynamic Door Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgDDFlag][2]);
  846. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  847. dgVar[dgDDFlag][1]--;
  848. format(string, sizeof(string), "* %s(%d) was just gifted %d Dynamic Door Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgDDFlag][2]);
  849. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  850. return true;
  851. }
  852. if(randy == 12)
  853. {
  854. if(dgVar[dgGateFlag][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  855. if(dgVar[dgGateFlag][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  856. if(dgVar[dgGateFlag][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  857. AddFlag(giveplayerid, INVALID_PLAYER_ID, "Dynamic Gift Box: 1 Dynamic Gate");
  858. format(string, sizeof(string), "Congratulations, you have won %d Dynamic Door Flag(s)!", dgVar[dgGateFlag][2]);
  859. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  860. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This prize may take up to 48 hours to be rewarded..");
  861. format(string, sizeof(string), "* %s was just gifted %d Dynamic Gate Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGateFlag][2]);
  862. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  863. dgVar[dgGateFlag][1]--;
  864. format(string, sizeof(string), "* %s(%d) was just gifted %d Dynamic Gate Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGateFlag][2]);
  865. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  866. return true;
  867. }
  868. if(randy == 13)
  869. {
  870. if(dgVar[dgCredits][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  871. if(dgVar[dgCredits][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  872. if(dgVar[dgCredits][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  873. GivePlayerCredits(giveplayerid, dgVar[dgCredits][2], 1);
  874. format(string, sizeof(string), "Congratulations, you have won %d Credit(s)!", dgVar[dgCredits][2]);
  875. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  876. format(string, sizeof(string), "* %s was just gifted %d Credit(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCredits][2]);
  877. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  878. dgVar[dgCredits][1]--;
  879. format(string, sizeof(string), "* %s(%d) was just gifted %d Credit(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCredits][2]);
  880. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  881. return true;
  882. }
  883. if(randy == 14)
  884. {
  885. if(dgVar[dgPriorityAd][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  886. if(dgVar[dgPriorityAd][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  887. if(dgVar[dgPriorityAd][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  888. PlayerInfo[giveplayerid][pAdvertVoucher] += dgVar[dgPriorityAd][2];
  889. format(string, sizeof(string), "Congratulations, you have won %d Priority Advertisement Voucher(s)!", dgVar[dgPriorityAd][2]);
  890. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  891. format(string, sizeof(string), "* %s was just gifted %d Priority Advertisement Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPriorityAd][2]);
  892. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  893. dgVar[dgPriorityAd][1]--;
  894. format(string, sizeof(string), "* %s(%d) was just gifted %d Priority Advertisement Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPriorityAd][2]);
  895. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  896. return true;
  897. }
  898. if(randy == 15)
  899. {
  900. if(dgVar[dgHealthNArmor][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  901. if(dgVar[dgHealthNArmor][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  902. if(dgVar[dgHealthNArmor][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  903. SetHealth(giveplayerid, 100.0);
  904. SetArmour(giveplayerid, 100);
  905. format(string, sizeof(string), "Congratulations, you have won Full Health & Armor!");
  906. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  907. format(string, sizeof(string), "* %s was just gifted %d Full Health & Armor, enjoy!", GetPlayerNameEx(giveplayerid));
  908. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  909. dgVar[dgHealthNArmor][1]--;
  910. format(string, sizeof(string), "* %s(%d) was just gifted %d Full Health & Armor, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  911. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  912. return true;
  913. }
  914. if(randy == 16)
  915. {
  916. if(dgVar[dgGiftReset][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  917. if(dgVar[dgGiftReset][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  918. if(dgVar[dgGiftReset][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  919. PlayerInfo[giveplayerid][pGiftVoucher] += dgVar[dgGiftReset][2];
  920. format(string, sizeof(string), "Congratulations, you have won a %d Gift Reset Voucher(s)!", dgVar[dgGiftReset][2]);
  921. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  922. format(string, sizeof(string), "* %s was just gifted %d Gift Reset Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGiftReset][2]);
  923. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  924. dgVar[dgGiftReset][1]--;
  925. format(string, sizeof(string), "* %s(%d) was just gifted %d Gift Reset Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGiftReset][2]);
  926. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  927. return true;
  928. }
  929. if(randy == 17)
  930. {
  931. if(dgVar[dgMaterial][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  932. if(dgVar[dgMaterial][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  933. if(dgVar[dgMaterial][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  934. PlayerInfo[giveplayerid][pMats] += dgVar[dgMaterial][2];
  935. format(string, sizeof(string), "Congratulations, you have won a %d Material(s)!", dgVar[dgMaterial][2]);
  936. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  937. format(string, sizeof(string), "* %s was just gifted %d Material(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgMaterial][2]);
  938. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  939. dgVar[dgMaterial][1]--;
  940. format(string, sizeof(string), "* %s(%d) was just gifted %d Material(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgMaterial][2]);
  941. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  942. return true;
  943. }
  944. if(randy == 18)
  945. {
  946. if(dgVar[dgWarning][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  947. if(dgVar[dgWarning][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  948. if(dgVar[dgWarning][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  949. if(dgVar[dgWarning][2] > 3 || dgVar[dgWarning][2] < 0)
  950. {
  951. if(PlayerInfo[giveplayerid][pWarns] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  952. PlayerInfo[giveplayerid][pWarns] -= dgVar[dgWarning][2];
  953. }
  954. else
  955. return GiftPlayer(playerid, giveplayerid, 1);
  956. format(string, sizeof(string), "Congratulations, you have won a %d Warning(s) Removal!", dgVar[dgWarning][2]);
  957. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  958. format(string, sizeof(string), "* %s was just gifted %d Warning(s) Removal, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgWarning][2]);
  959. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  960. dgVar[dgWarning][1]--;
  961. format(string, sizeof(string), "* %s(%d) was just gifted %d Warning(s) Removal, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgWarning][2]);
  962. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  963. return true;
  964. }
  965. if(randy == 19)
  966. {
  967. if(dgVar[dgPot][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  968. if(dgVar[dgPot][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  969. if(dgVar[dgPot][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  970. PlayerInfo[giveplayerid][pDrugs][0] += dgVar[dgPot][2];
  971. format(string, sizeof(string), "Congratulations, you have won %d pot!", dgVar[dgPot][2]);
  972. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  973. format(string, sizeof(string), "* %s was just gifted %d pot, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPot][2]);
  974. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  975. dgVar[dgPot][1]--;
  976. format(string, sizeof(string), "* %s(%d) was just gifted %d pot, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPot][2]);
  977. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  978. return true;
  979. }
  980. if(randy == 20)
  981. {
  982. if(dgVar[dgCrack][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  983. if(dgVar[dgCrack][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  984. if(dgVar[dgCrack][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  985. PlayerInfo[giveplayerid][pDrugs][1] += dgVar[dgCrack][2];
  986. format(string, sizeof(string), "Congratulations, you have won %d Crack!", dgVar[dgCrack][2]);
  987. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  988. format(string, sizeof(string), "* %s was just gifted %d Crack, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCrack][2]);
  989. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  990. dgVar[dgCrack][1]--;
  991. format(string, sizeof(string), "* %s(%d) was just gifted %d Crack, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCrack][2]);
  992. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  993. return true;
  994. }
  995. if(randy == 21)
  996. {
  997. if(dgVar[dgPaintballToken][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  998. if(dgVar[dgPaintballToken][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  999. if(dgVar[dgPaintballToken][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  1000. if(PlayerInfo[giveplayerid][pDonateRank] >= 4) return GiftPlayer(playerid, giveplayerid, 1);
  1001. PlayerInfo[giveplayerid][pPaintTokens] += dgVar[dgPaintballToken][2];
  1002. format(string, sizeof(string), "Congratulations, you have won a %d Paintball Token(s)!", dgVar[dgPaintballToken][2]);
  1003. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1004. format(string, sizeof(string), "* %s was just gifted %d Paintball Token(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPaintballToken][2]);
  1005. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1006. dgVar[dgPaintballToken][1]--;
  1007. format(string, sizeof(string), "* %s(%d) was just gifted %d Paintball Token(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPaintballToken][2]);
  1008. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1009. return true;
  1010. }
  1011. if(randy == 22)
  1012. {
  1013. if(dgVar[dgVIPToken][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1014. if(dgVar[dgVIPToken][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1015. if(dgVar[dgVIPToken][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  1016. if(PlayerInfo[giveplayerid][pDonateRank] >= 4) return GiftPlayer(playerid, giveplayerid, 1);
  1017. PlayerInfo[giveplayerid][pTokens] += dgVar[dgVIPToken][2];
  1018. format(string, sizeof(string), "Congratulations, you have won a %d VIP Token(s)!", dgVar[dgVIPToken][2]);
  1019. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1020. format(string, sizeof(string), "* %s was just gifted %d VIP Token(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgVIPToken][2]);
  1021. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1022. dgVar[dgVIPToken][1]--;
  1023. format(string, sizeof(string), "* %s(%d) was just gifted %d VIP Token(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgVIPToken][2]);
  1024. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1025. return true;
  1026. }
  1027. if(randy == 23)
  1028. {
  1029. if(dgVar[dgRespectPoint][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1030. if(dgVar[dgRespectPoint][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1031. if(dgVar[dgRespectPoint][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  1032. PlayerInfo[giveplayerid][pExp] += dgVar[dgRespectPoint][2];
  1033. format(string, sizeof(string), "Congratulations, you have won a %d Respect Point(s)!", dgVar[dgRespectPoint][2]);
  1034. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1035. format(string, sizeof(string), "* %s was just gifted %d Respect Point(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgRespectPoint][2]);
  1036. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1037. dgVar[dgRespectPoint][1]--;
  1038. format(string, sizeof(string), "* %s(%d) was just gifted %d Respect Point(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgRespectPoint][2]);
  1039. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1040. return true;
  1041. }
  1042. if(randy == 24)
  1043. {
  1044. if(dgVar[dgCarVoucher][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1045. if(dgVar[dgCarVoucher][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1046. if(dgVar[dgCarVoucher][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  1047. PlayerInfo[giveplayerid][pVehVoucher] += dgVar[dgCarVoucher][2];
  1048. format(string, sizeof(string), "Congratulations, you have won a %d Car Voucher(s)!", dgVar[dgCarVoucher][2]);
  1049. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1050. format(string, sizeof(string), "* %s was just gifted %d Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCarVoucher][2]);
  1051. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1052. dgVar[dgCarVoucher][1]--;
  1053. format(string, sizeof(string), "* %s(%d) was just gifted %d Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCarVoucher][2]);
  1054. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1055. return true;
  1056. }
  1057. if(randy == 25)
  1058. {
  1059. if(dgVar[dgBuddyInvite][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1060. if(dgVar[dgBuddyInvite][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1061. if(dgVar[dgBuddyInvite][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  1062. if(PlayerInfo[giveplayerid][pDonateRank] != 0) return GiftPlayer(playerid, giveplayerid, 1);
  1063. PlayerInfo[giveplayerid][pDonateRank] = 1;
  1064. PlayerInfo[giveplayerid][pTempVIP] = 180;
  1065. PlayerInfo[giveplayerid][pBuddyInvited] = 1;
  1066. format(string, sizeof(string), "BUDDY INVITE: %s(%d) has been invited to VIP by System", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  1067. Log("logs/setvip.log", string);
  1068. format(string, sizeof(string), "Congratulations, you have won a Buddy Invite!");
  1069. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1070. format(string, sizeof(string), "* %s was just gifted a BuddyInvite, enjoy!", GetPlayerNameEx(giveplayerid));
  1071. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1072. dgVar[dgBuddyInvite][1]--;
  1073. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1074. return true;
  1075. }
  1076. if(randy == 26)
  1077. {
  1078. if(dgVar[dgLaser][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1079. if(dgVar[dgLaser][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1080. if(dgVar[dgLaser][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  1081. new icount = GetPlayerToySlots(giveplayerid), success = 0;
  1082. for(new v = 0; v < icount; v++)
  1083. {
  1084. if(PlayerToyInfo[giveplayerid][v][ptModelID] == 0)
  1085. {
  1086. PlayerToyInfo[giveplayerid][v][ptModelID] = 18643;
  1087. PlayerToyInfo[giveplayerid][v][ptBone] = 6;
  1088. PlayerToyInfo[giveplayerid][v][ptPosX] = 0.0;
  1089. PlayerToyInfo[giveplayerid][v][ptPosY] = 0.0;
  1090. PlayerToyInfo[giveplayerid][v][ptPosZ] = 0.0;
  1091. PlayerToyInfo[giveplayerid][v][ptRotX] = 0.0;
  1092. PlayerToyInfo[giveplayerid][v][ptRotY] = 0.0;
  1093. PlayerToyInfo[giveplayerid][v][ptRotZ] = 0.0;
  1094. PlayerToyInfo[giveplayerid][v][ptScaleX] = 1.0;
  1095. PlayerToyInfo[giveplayerid][v][ptScaleY] = 1.0;
  1096. PlayerToyInfo[giveplayerid][v][ptScaleZ] = 1.0;
  1097. PlayerToyInfo[giveplayerid][v][ptTradable] = 1;
  1098. g_mysql_NewToy(giveplayerid, v);
  1099. success = 1;
  1100. break;
  1101. }
  1102. }
  1103. if(success == 0)
  1104. {
  1105. for(new i = 0; i < MAX_PLAYERTOYS; i++)
  1106. {
  1107. if(PlayerToyInfo[giveplayerid][i][ptModelID] == 0)
  1108. {
  1109. PlayerToyInfo[giveplayerid][i][ptModelID] = 18643;
  1110. PlayerToyInfo[giveplayerid][i][ptBone] = 6;
  1111. PlayerToyInfo[giveplayerid][i][ptPosX] = 0.0;
  1112. PlayerToyInfo[giveplayerid][i][ptPosY] = 0.0;
  1113. PlayerToyInfo[giveplayerid][i][ptPosZ] = 0.0;
  1114. PlayerToyInfo[giveplayerid][i][ptRotX] = 0.0;
  1115. PlayerToyInfo[giveplayerid][i][ptRotY] = 0.0;
  1116. PlayerToyInfo[giveplayerid][i][ptRotZ] = 0.0;
  1117. PlayerToyInfo[giveplayerid][i][ptScaleX] = 1.0;
  1118. PlayerToyInfo[giveplayerid][i][ptScaleY] = 1.0;
  1119. PlayerToyInfo[giveplayerid][i][ptScaleZ] = 1.0;
  1120. PlayerToyInfo[giveplayerid][i][ptTradable] = 1;
  1121. PlayerToyInfo[giveplayerid][i][ptSpecial] = 1;
  1122. g_mysql_NewToy(giveplayerid, i);
  1123. SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Due to you not having any available slots, we've temporarily gave you an additional slot to use/sell/trade your laser.");
  1124. SendClientMessageEx(giveplayerid, COLOR_RED, "Note: Please take note that after selling the laser, the temporarily additional toy slot will be removed.");
  1125. break;
  1126. }
  1127. }
  1128. }
  1129. format(string, sizeof(string), "Congratulations, you have won a Laser!");
  1130. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1131. format(string, sizeof(string), "* %s was just gifted a Laser, enjoy!", GetPlayerNameEx(giveplayerid));
  1132. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1133. dgVar[dgLaser][1]--;
  1134. format(string, sizeof(string), "* %s(%d) was just gifted a Laser, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  1135. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1136. return true;
  1137. }
  1138. if(randy == 27)
  1139. {
  1140. if(dgVar[dgCustomToy][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1141. if(dgVar[dgCustomToy][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1142. if(dgVar[dgCustomToy][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  1143. new icount = GetPlayerToySlots(giveplayerid), success = 0;
  1144. for(new v = 0; v < icount; v++)
  1145. {
  1146. if(PlayerToyInfo[giveplayerid][v][ptModelID] == 0)
  1147. {
  1148. PlayerToyInfo[giveplayerid][v][ptModelID] = dgVar[dgCustomToy][2];
  1149. PlayerToyInfo[giveplayerid][v][ptBone] = 1;
  1150. PlayerToyInfo[giveplayerid][v][ptPosX] = 0.0;
  1151. PlayerToyInfo[giveplayerid][v][ptPosY] = 0.0;
  1152. PlayerToyInfo[giveplayerid][v][ptPosZ] = 0.0;
  1153. PlayerToyInfo[giveplayerid][v][ptRotX] = 0.0;
  1154. PlayerToyInfo[giveplayerid][v][ptRotY] = 0.0;
  1155. PlayerToyInfo[giveplayerid][v][ptRotZ] = 0.0;
  1156. PlayerToyInfo[giveplayerid][v][ptScaleX] = 1.0;
  1157. PlayerToyInfo[giveplayerid][v][ptScaleY] = 1.0;
  1158. PlayerToyInfo[giveplayerid][v][ptScaleZ] = 1.0;
  1159. PlayerToyInfo[giveplayerid][v][ptTradable] = 1;
  1160. g_mysql_NewToy(giveplayerid, v);
  1161. success = 1;
  1162. break;
  1163. }
  1164. }
  1165. if(success == 0)
  1166. {
  1167. for(new i = 0; i < MAX_PLAYERTOYS; i++)
  1168. {
  1169. if(PlayerToyInfo[giveplayerid][i][ptModelID] == 0)
  1170. {
  1171. PlayerToyInfo[giveplayerid][i][ptModelID] = dgVar[dgCustomToy][2];
  1172. PlayerToyInfo[giveplayerid][i][ptBone] = 6;
  1173. PlayerToyInfo[giveplayerid][i][ptPosX] = 0.0;
  1174. PlayerToyInfo[giveplayerid][i][ptPosY] = 0.0;
  1175. PlayerToyInfo[giveplayerid][i][ptPosZ] = 0.0;
  1176. PlayerToyInfo[giveplayerid][i][ptRotX] = 0.0;
  1177. PlayerToyInfo[giveplayerid][i][ptRotY] = 0.0;
  1178. PlayerToyInfo[giveplayerid][i][ptRotZ] = 0.0;
  1179. PlayerToyInfo[giveplayerid][i][ptScaleX] = 1.0;
  1180. PlayerToyInfo[giveplayerid][i][ptScaleY] = 1.0;
  1181. PlayerToyInfo[giveplayerid][i][ptScaleZ] = 1.0;
  1182. PlayerToyInfo[giveplayerid][i][ptTradable] = 1;
  1183. PlayerToyInfo[giveplayerid][i][ptSpecial] = 1;
  1184. g_mysql_NewToy(giveplayerid, i);
  1185. SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Due to you not having any available slots, we've temporarily gave you an additional slot to use/sell/trade your custom toy.");
  1186. SendClientMessageEx(giveplayerid, COLOR_RED, "Note: Please take note that after selling the custom toy, the temporarily additional toy slot will be removed.");
  1187. break;
  1188. }
  1189. }
  1190. }
  1191. format(string, sizeof(string), "Congratulations, you have won a Custom Toy!");
  1192. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1193. format(string, sizeof(string), "* %s was just gifted a Custom Toy, enjoy!", GetPlayerNameEx(giveplayerid));
  1194. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1195. dgVar[dgCustomToy][1]--;
  1196. format(string, sizeof(string), "* %s(%d) was just gifted a Custom Toy, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  1197. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1198. return true;
  1199. }
  1200. if(randy == 28)
  1201. {
  1202. if(dgVar[dgAdmuteReset][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1203. if(dgVar[dgAdmuteReset][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1204. if(dgVar[dgAdmuteReset][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  1205. if(PlayerInfo[giveplayerid][pADMuteTotal] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1206. PlayerInfo[giveplayerid][pADMuteTotal] -= dgVar[dgAdmuteReset][2];
  1207. format(string, sizeof(string), "Congratulations, you have won %d Admute Reset(s)!", dgVar[dgAdmuteReset][2]);
  1208. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1209. format(string, sizeof(string), "* %s was just gifted %d Admute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgAdmuteReset][2]);
  1210. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1211. dgVar[dgAdmuteReset][1]--;
  1212. format(string, sizeof(string), "* %s(%d) was just gifted %d Admute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgAdmuteReset][2]);
  1213. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1214. return true;
  1215. }
  1216. if(randy == 29)
  1217. {
  1218. if(dgVar[dgNewbieMuteReset][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1219. if(dgVar[dgNewbieMuteReset][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1220. if(dgVar[dgNewbieMuteReset][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  1221. if(PlayerInfo[giveplayerid][pNMuteTotal] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1222. PlayerInfo[giveplayerid][pNMuteTotal] -= dgVar[dgNewbieMuteReset][2];
  1223. format(string, sizeof(string), "Congratulations, you have won %d Newbie Mute Reset(s)!", dgVar[dgNewbieMuteReset][2]);
  1224. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1225. format(string, sizeof(string), "* %s was just gifted %d Newbie Mute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgNewbieMuteReset][2]);
  1226. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1227. dgVar[dgNewbieMuteReset][1]--;
  1228. format(string, sizeof(string), "* %s(%d) was just gifted %d Newbie Mute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgNewbieMuteReset][2]);
  1229. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1230. return true;
  1231. }
  1232. if(randy == 30)
  1233. {
  1234. if(dgVar[dgRestrictedCarVoucher][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1235. if(dgVar[dgRestrictedCarVoucher][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1236. if(dgVar[dgRestrictedCarVoucher][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  1237. PlayerInfo[giveplayerid][pCarVoucher] += dgVar[dgRestrictedCarVoucher][2];
  1238. format(string, sizeof(string), "Congratulations, you have won a %d Restricted Car Voucher(s)!", dgVar[dgRestrictedCarVoucher][2]);
  1239. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1240. format(string, sizeof(string), "* %s was just gifted %d Restricted Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgRestrictedCarVoucher][2]);
  1241. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1242. dgVar[dgRestrictedCarVoucher][1]--;
  1243. format(string, sizeof(string), "* %s(%d) was just gifted %d Restricted Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgRestrictedCarVoucher][2]);
  1244. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1245. return true;
  1246. }
  1247. if(randy == 31)
  1248. {
  1249. if(dgVar[dgPlatinumVIPVoucher][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1250. if(dgVar[dgPlatinumVIPVoucher][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1251. if(dgVar[dgPlatinumVIPVoucher][3] == 1) return GiftPlayer(playerid, giveplayerid, 1);
  1252. PlayerInfo[giveplayerid][pPVIPVoucher] += dgVar[dgPlatinumVIPVoucher][2];
  1253. format(string, sizeof(string), "Congratulations, you have won a %d 1 month PVIP Voucher(s)!", dgVar[dgPlatinumVIPVoucher][2]);
  1254. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1255. format(string, sizeof(string), "* %s was just gifted %d 1 month PVIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPlatinumVIPVoucher][2]);
  1256. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1257. dgVar[dgPlatinumVIPVoucher][1]--;
  1258. format(string, sizeof(string), "* %s(%d) was just gifted %d 1 month PVIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPlatinumVIPVoucher][2]);
  1259. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1260. return true;
  1261. }
  1262. else return SendClientMessageEx(giveplayerid, COLOR_RED, "Seems like the dynamic giftbox is empty, please try again.");
  1263. }
  1264. case 81..95: // cat 3 rarish
  1265. {
  1266. new randy = random(32);
  1267. printf("cat 1 %d", randy);
  1268. if(randy == 0)
  1269. {
  1270. if(dgVar[dgMoney][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1271. if(dgVar[dgMoney][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1272. if(dgVar[dgMoney][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1273. GivePlayerCash(giveplayerid, dgVar[dgMoney][2]);
  1274. format(string, sizeof(string), "Congratulations, you have won $%s!", number_format(dgVar[dgMoney][2]));
  1275. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1276. format(string, sizeof(string), "* %s was just gifted $%s, enjoy!", GetPlayerNameEx(giveplayerid), number_format(dgVar[dgMoney][2]));
  1277. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1278. dgVar[dgMoney][1]--;
  1279. format(string, sizeof(string), "* %s(%d) was just gifted $%s, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), number_format(dgVar[dgMoney][2]));
  1280. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1281. return true;
  1282. }
  1283. if(randy == 1)
  1284. {
  1285. if(dgVar[dgRimKit][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1286. if(dgVar[dgRimKit][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1287. if(dgVar[dgRimKit][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1288. PlayerInfo[giveplayerid][pRimMod] += dgVar[dgRimKit][2];
  1289. format(string, sizeof(string), "Congratulations, you have won %d rimkit(s)!", dgVar[dgRimKit][2]);
  1290. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1291. format(string, sizeof(string), "* %s was just gifted %d rimkit(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgRimKit][2]);
  1292. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1293. dgVar[dgRimKit][1]--;
  1294. format(string, sizeof(string), "* %s(%d) was just gifted %d rimkit(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgRimKit][2]);
  1295. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1296. return true;
  1297. }
  1298. if(randy == 2)
  1299. {
  1300. if(dgVar[dgFirework][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1301. if(dgVar[dgFirework][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1302. if(dgVar[dgFirework][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1303. PlayerInfo[giveplayerid][pFirework] += dgVar[dgFirework][2];
  1304. format(string, sizeof(string), "Congratulations, you have won %d firework(s)!", dgVar[dgFirework][2]);
  1305. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1306. format(string, sizeof(string), "* %s was just gifted %d firework(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgFirework][2]);
  1307. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1308. dgVar[dgFirework][1]--;
  1309. format(string, sizeof(string), "* %s(%d) was just gifted %d firework(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgFirework][2]);
  1310. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1311. return true;
  1312. }
  1313. if(randy == 3)
  1314. {
  1315. if(dgVar[dgGVIP][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1316. if(dgVar[dgGVIP][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1317. if(dgVar[dgGVIP][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1318. PlayerInfo[giveplayerid][pGVIPExVoucher] += dgVar[dgGVIP][2];
  1319. format(string, sizeof(string), "Congratulations, you have won %d Seven day Gold VIP Voucher(s)!", dgVar[dgGVIP][2]);
  1320. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1321. format(string, sizeof(string), "* %s was just gifted %d Seven day Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGVIP][2]);
  1322. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1323. dgVar[dgGVIP][1]--;
  1324. format(string, sizeof(string), "* %s(%d) was just gifted %d Seven day Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGVIP][2]);
  1325. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1326. return true;
  1327. }
  1328. if(randy == 4)
  1329. {
  1330. if(dgVar[dgGVIPEx][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1331. if(dgVar[dgGVIPEx][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1332. if(dgVar[dgGVIPEx][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1333. PlayerInfo[giveplayerid][pGVIPVoucher] += dgVar[dgGVIPEx][2];
  1334. format(string, sizeof(string), "Congratulations, you have won %d One Month Gold VIP Voucher(s)!", dgVar[dgGVIPEx][2]);
  1335. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1336. format(string, sizeof(string), "* %s was just gifted %d One Month Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGVIPEx][2]);
  1337. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1338. dgVar[dgGVIPEx][1]--;
  1339. format(string, sizeof(string), "* %s(%d) was just gifted %d One Month Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGVIPEx][2]);
  1340. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1341. return true;
  1342. }
  1343. if(randy == 5)
  1344. {
  1345. if(dgVar[dgSVIP][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1346. if(dgVar[dgSVIP][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1347. if(dgVar[dgSVIP][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1348. PlayerInfo[giveplayerid][pSVIPExVoucher] += dgVar[dgSVIP][2];
  1349. format(string, sizeof(string), "Congratulations, you have won %d Seven day Silver VIP Voucher (s)!", dgVar[dgSVIP][2]);
  1350. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1351. format(string, sizeof(string), "* %s was just gifted %d Seven day Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgSVIP][2]);
  1352. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1353. dgVar[dgSVIP][1]--;
  1354. format(string, sizeof(string), "* %s(%d) was just gifted %d Seven day Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgSVIP][2]);
  1355. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1356. return true;
  1357. }
  1358. if(randy == 6)
  1359. {
  1360. if(dgVar[dgSVIPEx][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1361. if(dgVar[dgSVIPEx][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1362. if(dgVar[dgSVIPEx][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1363. PlayerInfo[giveplayerid][pSVIPVoucher] += dgVar[dgSVIPEx][2];
  1364. format(string, sizeof(string), "Congratulations, you have won %d One Month Silver VIP Voucher(s)!", dgVar[dgSVIPEx][2]);
  1365. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1366. format(string, sizeof(string), "* %s was just gifted %d One Month Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgSVIPEx][2]);
  1367. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1368. dgVar[dgSVIPEx][1]--;
  1369. format(string, sizeof(string), "* %s(%d) was just gifted %d One Month Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgSVIPEx][2]);
  1370. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1371. return true;
  1372. }
  1373. if(randy == 7)
  1374. {
  1375. if(dgVar[dgCarSlot][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1376. if(dgVar[dgCarSlot][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1377. if(dgVar[dgCarSlot][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1378. PlayerInfo[giveplayerid][pVehicleSlot] += dgVar[dgCarSlot][2];
  1379. format(string, sizeof(string), "Congratulations, you have won %d Car Slot(s)!", dgVar[dgCarSlot][2]);
  1380. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1381. format(string, sizeof(string), "* %s was just gifted %d Car Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCarSlot][2]);
  1382. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1383. dgVar[dgCarSlot][1]--;
  1384. format(string, sizeof(string), "* %s(%d) was just gifted %d Car Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCarSlot][2]);
  1385. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1386. return true;
  1387. }
  1388. if(randy == 8)
  1389. {
  1390. if(dgVar[dgToySlot][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1391. if(dgVar[dgCarSlot][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1392. if(dgVar[dgCarSlot][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1393. PlayerInfo[giveplayerid][pToySlot] += dgVar[dgToySlot][2];
  1394. format(string, sizeof(string), "Congratulations, you have won %d Toy Slot(s)!", dgVar[dgToySlot][2]);
  1395. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1396. format(string, sizeof(string), "* %s was just gifted %d Toy Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgToySlot][2]);
  1397. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1398. dgVar[dgToySlot][1]--;
  1399. format(string, sizeof(string), "* %s(%d) was just gifted %d Toy Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgToySlot][2]);
  1400. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1401. return true;
  1402. }
  1403. if(randy == 9)
  1404. {
  1405. if(dgVar[dgArmor][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1406. if(dgVar[dgArmor][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1407. if(dgVar[dgArmor][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1408. new Float: armor;
  1409. GetArmour(giveplayerid, armor);
  1410. if(armor+dgVar[dgArmor][2] >= 100) return GiftPlayer(playerid, giveplayerid, 1);
  1411. SetArmour(giveplayerid, armor + dgVar[dgArmor][2]);
  1412. format(string, sizeof(string), "Congratulations, you have won %d Armour!", dgVar[dgArmor][2]);
  1413. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1414. format(string, sizeof(string), "* %s was just gifted %d Armour, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgArmor][2]);
  1415. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1416. dgVar[dgArmor][1]--;
  1417. format(string, sizeof(string), "* %s(%d) was just gifted %d Armour, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgArmor][2]);
  1418. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1419. return true;
  1420. }
  1421. if(randy == 10)
  1422. {
  1423. if(dgVar[dgFirstaid][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1424. if(dgVar[dgFirstaid][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1425. if(dgVar[dgFirstaid][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1426. PlayerInfo[giveplayerid][pFirstaid] += dgVar[dgFirstaid][2];
  1427. format(string, sizeof(string), "Congratulations, you have won %d Firstaid(s)!", dgVar[dgFirstaid][2]);
  1428. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1429. format(string, sizeof(string), "* %s was just gifted %d Firstaid(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgFirstaid][2]);
  1430. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1431. dgVar[dgFirstaid][1]--;
  1432. format(string, sizeof(string), "* %s(%d) was just gifted %d Firstaid(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgFirstaid][2]);
  1433. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1434. return true;
  1435. }
  1436. if(randy == 11)
  1437. {
  1438. if(dgVar[dgDDFlag][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1439. if(dgVar[dgDDFlag][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1440. if(dgVar[dgDDFlag][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1441. AddFlag(giveplayerid, INVALID_PLAYER_ID, "Dynamic Gift Box: 1 Dynamic Door");
  1442. format(string, sizeof(string), "Congratulations, you have won %d Dynamic Door Flag(s)!", dgVar[dgDDFlag][2]);
  1443. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1444. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This prize may take up to 48 hours to be rewarded..");
  1445. format(string, sizeof(string), "* %s was just gifted %d Dynamic Door Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgDDFlag][2]);
  1446. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1447. dgVar[dgDDFlag][1]--;
  1448. format(string, sizeof(string), "* %s(%d) was just gifted %d Dynamic Door Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgDDFlag][2]);
  1449. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1450. return true;
  1451. }
  1452. if(randy == 12)
  1453. {
  1454. if(dgVar[dgGateFlag][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1455. if(dgVar[dgGateFlag][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1456. if(dgVar[dgGateFlag][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1457. AddFlag(giveplayerid, INVALID_PLAYER_ID, "Dynamic Gift Box: 1 Dynamic Gate");
  1458. format(string, sizeof(string), "Congratulations, you have won %d Dynamic Door Flag(s)!", dgVar[dgGateFlag][2]);
  1459. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1460. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This prize may take up to 48 hours to be rewarded..");
  1461. format(string, sizeof(string), "* %s was just gifted %d Dynamic Gate Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGateFlag][2]);
  1462. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1463. dgVar[dgGateFlag][1]--;
  1464. format(string, sizeof(string), "* %s(%d) was just gifted %d Dynamic Gate Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGateFlag][2]);
  1465. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1466. return true;
  1467. }
  1468. if(randy == 13)
  1469. {
  1470. if(dgVar[dgCredits][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1471. if(dgVar[dgCredits][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1472. if(dgVar[dgCredits][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1473. GivePlayerCredits(giveplayerid, dgVar[dgCredits][2], 1);
  1474. format(string, sizeof(string), "Congratulations, you have won %d Credit(s)!", dgVar[dgCredits][2]);
  1475. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1476. format(string, sizeof(string), "* %s was just gifted %d Credit(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCredits][2]);
  1477. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1478. dgVar[dgCredits][1]--;
  1479. format(string, sizeof(string), "* %s(%d) was just gifted %d Credit(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCredits][2]);
  1480. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1481. return true;
  1482. }
  1483. if(randy == 14)
  1484. {
  1485. if(dgVar[dgPriorityAd][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1486. if(dgVar[dgPriorityAd][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1487. if(dgVar[dgPriorityAd][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1488. PlayerInfo[giveplayerid][pAdvertVoucher] += dgVar[dgPriorityAd][2];
  1489. format(string, sizeof(string), "Congratulations, you have won %d Priority Advertisement Voucher(s)!", dgVar[dgPriorityAd][2]);
  1490. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1491. format(string, sizeof(string), "* %s was just gifted %d Priority Advertisement Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPriorityAd][2]);
  1492. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1493. dgVar[dgPriorityAd][1]--;
  1494. format(string, sizeof(string), "* %s(%d) was just gifted %d Priority Advertisement Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPriorityAd][2]);
  1495. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1496. return true;
  1497. }
  1498. if(randy == 15)
  1499. {
  1500. if(dgVar[dgHealthNArmor][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1501. if(dgVar[dgHealthNArmor][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1502. if(dgVar[dgHealthNArmor][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1503. SetHealth(giveplayerid, 100.0);
  1504. SetArmour(giveplayerid, 100);
  1505. format(string, sizeof(string), "Congratulations, you have won Full Health & Armor!");
  1506. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1507. format(string, sizeof(string), "* %s was just gifted %d Full Health & Armor, enjoy!", GetPlayerNameEx(giveplayerid));
  1508. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1509. dgVar[dgHealthNArmor][1]--;
  1510. format(string, sizeof(string), "* %s(%d) was just gifted %d Full Health & Armor, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  1511. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1512. return true;
  1513. }
  1514. if(randy == 16)
  1515. {
  1516. if(dgVar[dgGiftReset][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1517. if(dgVar[dgGiftReset][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1518. if(dgVar[dgGiftReset][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1519. PlayerInfo[giveplayerid][pGiftVoucher] += dgVar[dgGiftReset][2];
  1520. format(string, sizeof(string), "Congratulations, you have won a %d Gift Reset Voucher(s)!", dgVar[dgGiftReset][2]);
  1521. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1522. format(string, sizeof(string), "* %s was just gifted %d Gift Reset Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGiftReset][2]);
  1523. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1524. dgVar[dgGiftReset][1]--;
  1525. format(string, sizeof(string), "* %s(%d) was just gifted %d Gift Reset Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGiftReset][2]);
  1526. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1527. return true;
  1528. }
  1529. if(randy == 17)
  1530. {
  1531. if(dgVar[dgMaterial][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1532. if(dgVar[dgMaterial][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1533. if(dgVar[dgMaterial][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1534. PlayerInfo[giveplayerid][pMats] += dgVar[dgMaterial][2];
  1535. format(string, sizeof(string), "Congratulations, you have won a %d Material(s)!", dgVar[dgMaterial][2]);
  1536. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1537. format(string, sizeof(string), "* %s was just gifted %d Material(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgMaterial][2]);
  1538. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1539. dgVar[dgMaterial][1]--;
  1540. format(string, sizeof(string), "* %s(%d) was just gifted %d Material(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgMaterial][2]);
  1541. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1542. return true;
  1543. }
  1544. if(randy == 18)
  1545. {
  1546. if(dgVar[dgWarning][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1547. if(dgVar[dgWarning][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1548. if(dgVar[dgWarning][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1549. if(dgVar[dgWarning][2] > 3 || dgVar[dgWarning][2] < 0)
  1550. {
  1551. if(PlayerInfo[giveplayerid][pWarns] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1552. PlayerInfo[giveplayerid][pWarns] -= dgVar[dgWarning][2];
  1553. }
  1554. else
  1555. return GiftPlayer(playerid, giveplayerid, 1);
  1556. format(string, sizeof(string), "Congratulations, you have won a %d Warning(s) Removal!", dgVar[dgWarning][2]);
  1557. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1558. format(string, sizeof(string), "* %s was just gifted %d Warning(s) Removal, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgWarning][2]);
  1559. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1560. dgVar[dgWarning][1]--;
  1561. format(string, sizeof(string), "* %s(%d) was just gifted %d Warning(s) Removal, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgWarning][2]);
  1562. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1563. return true;
  1564. }
  1565. if(randy == 19)
  1566. {
  1567. if(dgVar[dgPot][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1568. if(dgVar[dgPot][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1569. if(dgVar[dgPot][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1570. PlayerInfo[giveplayerid][pDrugs][0] += dgVar[dgPot][2];
  1571. format(string, sizeof(string), "Congratulations, you have won %d pot!", dgVar[dgPot][2]);
  1572. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1573. format(string, sizeof(string), "* %s was just gifted %d pot, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPot][2]);
  1574. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1575. dgVar[dgPot][1]--;
  1576. format(string, sizeof(string), "* %s(%d) was just gifted %d pot, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPot][2]);
  1577. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1578. return true;
  1579. }
  1580. if(randy == 20)
  1581. {
  1582. if(dgVar[dgCrack][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1583. if(dgVar[dgCrack][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1584. if(dgVar[dgCrack][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1585. PlayerInfo[giveplayerid][pDrugs][1] += dgVar[dgCrack][2];
  1586. format(string, sizeof(string), "Congratulations, you have won %d Crack!", dgVar[dgCrack][2]);
  1587. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1588. format(string, sizeof(string), "* %s was just gifted %d Crack, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCrack][2]);
  1589. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1590. dgVar[dgCrack][1]--;
  1591. format(string, sizeof(string), "* %s(%d) was just gifted %d Crack, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCrack][2]);
  1592. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1593. return true;
  1594. }
  1595. if(randy == 21)
  1596. {
  1597. if(dgVar[dgPaintballToken][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1598. if(dgVar[dgPaintballToken][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1599. if(dgVar[dgPaintballToken][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1600. if(PlayerInfo[giveplayerid][pDonateRank] >= 4) return GiftPlayer(playerid, giveplayerid, 1);
  1601. PlayerInfo[giveplayerid][pPaintTokens] += dgVar[dgPaintballToken][2];
  1602. format(string, sizeof(string), "Congratulations, you have won a %d Paintball Token(s)!", dgVar[dgPaintballToken][2]);
  1603. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1604. format(string, sizeof(string), "* %s was just gifted %d Paintball Token(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPaintballToken][2]);
  1605. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1606. dgVar[dgPaintballToken][1]--;
  1607. format(string, sizeof(string), "* %s(%d) was just gifted %d Paintball Token(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPaintballToken][2]);
  1608. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1609. return true;
  1610. }
  1611. if(randy == 22)
  1612. {
  1613. if(dgVar[dgVIPToken][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1614. if(dgVar[dgVIPToken][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1615. if(dgVar[dgVIPToken][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1616. if(PlayerInfo[giveplayerid][pDonateRank] >= 4) return GiftPlayer(playerid, giveplayerid, 1);
  1617. PlayerInfo[giveplayerid][pTokens] += dgVar[dgVIPToken][2];
  1618. format(string, sizeof(string), "Congratulations, you have won a %d VIP Token(s)!", dgVar[dgVIPToken][2]);
  1619. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1620. format(string, sizeof(string), "* %s was just gifted %d VIP Token(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgVIPToken][2]);
  1621. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1622. dgVar[dgVIPToken][1]--;
  1623. format(string, sizeof(string), "* %s(%d) was just gifted %d VIP Token(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgVIPToken][2]);
  1624. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1625. return true;
  1626. }
  1627. if(randy == 23)
  1628. {
  1629. if(dgVar[dgRespectPoint][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1630. if(dgVar[dgRespectPoint][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1631. if(dgVar[dgRespectPoint][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1632. PlayerInfo[giveplayerid][pExp] += dgVar[dgRespectPoint][2];
  1633. format(string, sizeof(string), "Congratulations, you have won a %d Respect Point(s)!", dgVar[dgRespectPoint][2]);
  1634. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1635. format(string, sizeof(string), "* %s was just gifted %d Respect Point(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgRespectPoint][2]);
  1636. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1637. dgVar[dgRespectPoint][1]--;
  1638. format(string, sizeof(string), "* %s(%d) was just gifted %d Respect Point(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgRespectPoint][2]);
  1639. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1640. return true;
  1641. }
  1642. if(randy == 24)
  1643. {
  1644. if(dgVar[dgCarVoucher][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1645. if(dgVar[dgCarVoucher][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1646. if(dgVar[dgCarVoucher][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1647. PlayerInfo[giveplayerid][pVehVoucher] += dgVar[dgCarVoucher][2];
  1648. format(string, sizeof(string), "Congratulations, you have won a %d Car Voucher(s)!", dgVar[dgCarVoucher][2]);
  1649. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1650. format(string, sizeof(string), "* %s was just gifted %d Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCarVoucher][2]);
  1651. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1652. dgVar[dgCarVoucher][1]--;
  1653. format(string, sizeof(string), "* %s(%d) was just gifted %d Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCarVoucher][2]);
  1654. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1655. return true;
  1656. }
  1657. if(randy == 25)
  1658. {
  1659. if(dgVar[dgBuddyInvite][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1660. if(dgVar[dgBuddyInvite][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1661. if(dgVar[dgBuddyInvite][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1662. if(PlayerInfo[giveplayerid][pDonateRank] != 0) return GiftPlayer(playerid, giveplayerid, 1);
  1663. PlayerInfo[giveplayerid][pDonateRank] = 1;
  1664. PlayerInfo[giveplayerid][pTempVIP] = 180;
  1665. PlayerInfo[giveplayerid][pBuddyInvited] = 1;
  1666. format(string, sizeof(string), "BUDDY INVITE: %s(%d) has been invited to VIP by System", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  1667. Log("logs/setvip.log", string);
  1668. format(string, sizeof(string), "Congratulations, you have won a Buddy Invite!");
  1669. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1670. format(string, sizeof(string), "* %s was just gifted a BuddyInvite, enjoy!", GetPlayerNameEx(giveplayerid));
  1671. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1672. dgVar[dgBuddyInvite][1]--;
  1673. format(string, sizeof(string), "* %s(%d) was just gifted a BuddyInvite, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  1674. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1675. return true;
  1676. }
  1677. if(randy == 26)
  1678. {
  1679. if(dgVar[dgLaser][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1680. if(dgVar[dgLaser][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1681. if(dgVar[dgLaser][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1682. new icount = GetPlayerToySlots(giveplayerid), success = 0;
  1683. for(new v = 0; v < icount; v++)
  1684. {
  1685. if(PlayerToyInfo[giveplayerid][v][ptModelID] == 0)
  1686. {
  1687. PlayerToyInfo[giveplayerid][v][ptModelID] = 18643;
  1688. PlayerToyInfo[giveplayerid][v][ptBone] = 6;
  1689. PlayerToyInfo[giveplayerid][v][ptPosX] = 0.0;
  1690. PlayerToyInfo[giveplayerid][v][ptPosY] = 0.0;
  1691. PlayerToyInfo[giveplayerid][v][ptPosZ] = 0.0;
  1692. PlayerToyInfo[giveplayerid][v][ptRotX] = 0.0;
  1693. PlayerToyInfo[giveplayerid][v][ptRotY] = 0.0;
  1694. PlayerToyInfo[giveplayerid][v][ptRotZ] = 0.0;
  1695. PlayerToyInfo[giveplayerid][v][ptScaleX] = 1.0;
  1696. PlayerToyInfo[giveplayerid][v][ptScaleY] = 1.0;
  1697. PlayerToyInfo[giveplayerid][v][ptScaleZ] = 1.0;
  1698. PlayerToyInfo[giveplayerid][v][ptTradable] = 1;
  1699. g_mysql_NewToy(giveplayerid, v);
  1700. success = 1;
  1701. break;
  1702. }
  1703. }
  1704. if(success == 0)
  1705. {
  1706. for(new i = 0; i < MAX_PLAYERTOYS; i++)
  1707. {
  1708. if(PlayerToyInfo[giveplayerid][i][ptModelID] == 0)
  1709. {
  1710. PlayerToyInfo[giveplayerid][i][ptModelID] = 18643;
  1711. PlayerToyInfo[giveplayerid][i][ptBone] = 6;
  1712. PlayerToyInfo[giveplayerid][i][ptPosX] = 0.0;
  1713. PlayerToyInfo[giveplayerid][i][ptPosY] = 0.0;
  1714. PlayerToyInfo[giveplayerid][i][ptPosZ] = 0.0;
  1715. PlayerToyInfo[giveplayerid][i][ptRotX] = 0.0;
  1716. PlayerToyInfo[giveplayerid][i][ptRotY] = 0.0;
  1717. PlayerToyInfo[giveplayerid][i][ptRotZ] = 0.0;
  1718. PlayerToyInfo[giveplayerid][i][ptScaleX] = 1.0;
  1719. PlayerToyInfo[giveplayerid][i][ptScaleY] = 1.0;
  1720. PlayerToyInfo[giveplayerid][i][ptScaleZ] = 1.0;
  1721. PlayerToyInfo[giveplayerid][i][ptTradable] = 1;
  1722. PlayerToyInfo[giveplayerid][i][ptSpecial] = 1;
  1723. g_mysql_NewToy(giveplayerid, i);
  1724. SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Due to you not having any available slots, we've temporarily gave you an additional slot to use/sell/trade your laser.");
  1725. SendClientMessageEx(giveplayerid, COLOR_RED, "Note: Please take note that after selling the laser, the temporarily additional toy slot will be removed.");
  1726. break;
  1727. }
  1728. }
  1729. }
  1730. format(string, sizeof(string), "Congratulations, you have won a Laser!");
  1731. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1732. format(string, sizeof(string), "* %s was just gifted a Laser, enjoy!", GetPlayerNameEx(giveplayerid));
  1733. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1734. dgVar[dgLaser][1]--;
  1735. format(string, sizeof(string), "* %s(%d) was just gifted a Laser, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  1736. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1737. return true;
  1738. }
  1739. if(randy == 27)
  1740. {
  1741. if(dgVar[dgCustomToy][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1742. if(dgVar[dgCustomToy][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1743. if(dgVar[dgCustomToy][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1744. new icount = GetPlayerToySlots(giveplayerid), success = 0;
  1745. for(new v = 0; v < icount; v++)
  1746. {
  1747. if(PlayerToyInfo[giveplayerid][v][ptModelID] == 0)
  1748. {
  1749. PlayerToyInfo[giveplayerid][v][ptModelID] = dgVar[dgCustomToy][2];
  1750. PlayerToyInfo[giveplayerid][v][ptBone] = 1;
  1751. PlayerToyInfo[giveplayerid][v][ptPosX] = 0.0;
  1752. PlayerToyInfo[giveplayerid][v][ptPosY] = 0.0;
  1753. PlayerToyInfo[giveplayerid][v][ptPosZ] = 0.0;
  1754. PlayerToyInfo[giveplayerid][v][ptRotX] = 0.0;
  1755. PlayerToyInfo[giveplayerid][v][ptRotY] = 0.0;
  1756. PlayerToyInfo[giveplayerid][v][ptRotZ] = 0.0;
  1757. PlayerToyInfo[giveplayerid][v][ptScaleX] = 1.0;
  1758. PlayerToyInfo[giveplayerid][v][ptScaleY] = 1.0;
  1759. PlayerToyInfo[giveplayerid][v][ptScaleZ] = 1.0;
  1760. PlayerToyInfo[giveplayerid][v][ptTradable] = 1;
  1761. g_mysql_NewToy(giveplayerid, v);
  1762. success = 1;
  1763. break;
  1764. }
  1765. }
  1766. if(success == 0)
  1767. {
  1768. for(new i = 0; i < MAX_PLAYERTOYS; i++)
  1769. {
  1770. if(PlayerToyInfo[giveplayerid][i][ptModelID] == 0)
  1771. {
  1772. PlayerToyInfo[giveplayerid][i][ptModelID] = dgVar[dgCustomToy][2];
  1773. PlayerToyInfo[giveplayerid][i][ptBone] = 6;
  1774. PlayerToyInfo[giveplayerid][i][ptPosX] = 0.0;
  1775. PlayerToyInfo[giveplayerid][i][ptPosY] = 0.0;
  1776. PlayerToyInfo[giveplayerid][i][ptPosZ] = 0.0;
  1777. PlayerToyInfo[giveplayerid][i][ptRotX] = 0.0;
  1778. PlayerToyInfo[giveplayerid][i][ptRotY] = 0.0;
  1779. PlayerToyInfo[giveplayerid][i][ptRotZ] = 0.0;
  1780. PlayerToyInfo[giveplayerid][i][ptScaleX] = 1.0;
  1781. PlayerToyInfo[giveplayerid][i][ptScaleY] = 1.0;
  1782. PlayerToyInfo[giveplayerid][i][ptScaleZ] = 1.0;
  1783. PlayerToyInfo[giveplayerid][i][ptTradable] = 1;
  1784. PlayerToyInfo[giveplayerid][i][ptSpecial] = 1;
  1785. g_mysql_NewToy(giveplayerid, i);
  1786. SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Due to you not having any available slots, we've temporarily gave you an additional slot to use/sell/trade your custom toy.");
  1787. SendClientMessageEx(giveplayerid, COLOR_RED, "Note: Please take note that after selling the custom toy, the temporarily additional toy slot will be removed.");
  1788. break;
  1789. }
  1790. }
  1791. }
  1792. format(string, sizeof(string), "Congratulations, you have won a Custom Toy!");
  1793. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1794. format(string, sizeof(string), "* %s was just gifted a Custom Toy, enjoy!", GetPlayerNameEx(giveplayerid));
  1795. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1796. dgVar[dgCustomToy][1]--;
  1797. format(string, sizeof(string), "* %s(%d) was just gifted a Custom Toy, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  1798. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1799. return true;
  1800. }
  1801. if(randy == 28)
  1802. {
  1803. if(dgVar[dgAdmuteReset][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1804. if(dgVar[dgAdmuteReset][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1805. if(dgVar[dgAdmuteReset][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1806. if(PlayerInfo[giveplayerid][pADMuteTotal] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1807. PlayerInfo[giveplayerid][pADMuteTotal] -= dgVar[dgAdmuteReset][2];
  1808. format(string, sizeof(string), "Congratulations, you have won %d Admute Reset(s)!", dgVar[dgAdmuteReset][2]);
  1809. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1810. format(string, sizeof(string), "* %s was just gifted %d Admute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgAdmuteReset][2]);
  1811. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1812. dgVar[dgAdmuteReset][1]--;
  1813. format(string, sizeof(string), "* %s(%d) was just gifted %d Admute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgAdmuteReset][2]);
  1814. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1815. return true;
  1816. }
  1817. if(randy == 29)
  1818. {
  1819. if(dgVar[dgNewbieMuteReset][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1820. if(dgVar[dgNewbieMuteReset][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1821. if(dgVar[dgNewbieMuteReset][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1822. if(PlayerInfo[giveplayerid][pNMuteTotal] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1823. PlayerInfo[giveplayerid][pNMuteTotal] -= dgVar[dgNewbieMuteReset][2];
  1824. format(string, sizeof(string), "Congratulations, you have won %d Newbie Mute Reset(s)!", dgVar[dgNewbieMuteReset][2]);
  1825. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1826. format(string, sizeof(string), "* %s was just gifted %d Newbie Mute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgNewbieMuteReset][2]);
  1827. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1828. dgVar[dgNewbieMuteReset][1]--;
  1829. format(string, sizeof(string), "* %s(%d) was just gifted %d Newbie Mute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgNewbieMuteReset][2]);
  1830. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1831. return true;
  1832. }
  1833. if(randy == 30)
  1834. {
  1835. if(dgVar[dgRestrictedCarVoucher][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1836. if(dgVar[dgRestrictedCarVoucher][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1837. if(dgVar[dgRestrictedCarVoucher][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1838. PlayerInfo[giveplayerid][pCarVoucher] += dgVar[dgRestrictedCarVoucher][2];
  1839. format(string, sizeof(string), "Congratulations, you have won a %d Restricted Car Voucher(s)!", dgVar[dgRestrictedCarVoucher][2]);
  1840. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1841. format(string, sizeof(string), "* %s was just gifted %d Restricted Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgRestrictedCarVoucher][2]);
  1842. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1843. dgVar[dgRestrictedCarVoucher][1]--;
  1844. format(string, sizeof(string), "* %s(%d) was just gifted %d Restricted Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgRestrictedCarVoucher][2]);
  1845. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1846. return true;
  1847. }
  1848. if(randy == 31)
  1849. {
  1850. if(dgVar[dgPlatinumVIPVoucher][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1851. if(dgVar[dgPlatinumVIPVoucher][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1852. if(dgVar[dgPlatinumVIPVoucher][3] == 2) return GiftPlayer(playerid, giveplayerid, 1);
  1853. PlayerInfo[giveplayerid][pPVIPVoucher] += dgVar[dgPlatinumVIPVoucher][2];
  1854. format(string, sizeof(string), "Congratulations, you have won a %d 1 month PVIP Voucher(s)!", dgVar[dgPlatinumVIPVoucher][2]);
  1855. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1856. format(string, sizeof(string), "* %s was just gifted %d 1 month PVIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPlatinumVIPVoucher][2]);
  1857. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1858. dgVar[dgPlatinumVIPVoucher][1]--;
  1859. format(string, sizeof(string), "* %s(%d) was just gifted %d 1 month PVIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPlatinumVIPVoucher][2]);
  1860. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1861. return true;
  1862. }
  1863. else return SendClientMessageEx(giveplayerid, COLOR_RED, "Seems like the dynamic giftbox is empty, please try again.");
  1864. }
  1865. case 96..100: // cat 4 super rare
  1866. {
  1867. new randy = random(32);
  1868. printf("cat 1 %d", randy);
  1869. if(randy == 0)
  1870. {
  1871. if(dgVar[dgMoney][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  1872. if(dgVar[dgMoney][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1873. if(dgVar[dgMoney][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1874. GivePlayerCash(giveplayerid, dgVar[dgMoney][2]);
  1875. format(string, sizeof(string), "Congratulations, you have won $%s!", number_format(dgVar[dgMoney][2]));
  1876. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1877. format(string, sizeof(string), "* %s was just gifted $%s, enjoy!", GetPlayerNameEx(giveplayerid), number_format(dgVar[dgMoney][2]));
  1878. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1879. dgVar[dgMoney][1]--;
  1880. format(string, sizeof(string), "* %s(%d) was just gifted $%s, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), number_format(dgVar[dgMoney][2]));
  1881. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1882. return true;
  1883. }
  1884. if(randy == 1)
  1885. {
  1886. if(dgVar[dgRimKit][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  1887. if(dgVar[dgRimKit][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1888. if(dgVar[dgRimKit][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1889. PlayerInfo[giveplayerid][pRimMod] += dgVar[dgRimKit][2];
  1890. format(string, sizeof(string), "Congratulations, you have won %d rimkit(s)!", dgVar[dgRimKit][2]);
  1891. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1892. format(string, sizeof(string), "* %s was just gifted %d rimkit(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgRimKit][2]);
  1893. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1894. dgVar[dgRimKit][1]--;
  1895. format(string, sizeof(string), "* %s(%d) was just gifted %d rimkit(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgRimKit][2]);
  1896. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1897. return true;
  1898. }
  1899. if(randy == 2)
  1900. {
  1901. if(dgVar[dgFirework][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  1902. if(dgVar[dgFirework][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1903. if(dgVar[dgFirework][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1904. PlayerInfo[giveplayerid][pFirework] += dgVar[dgFirework][2];
  1905. format(string, sizeof(string), "Congratulations, you have won %d firework(s)!", dgVar[dgFirework][2]);
  1906. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1907. format(string, sizeof(string), "* %s was just gifted %d firework(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgFirework][2]);
  1908. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1909. dgVar[dgFirework][1]--;
  1910. format(string, sizeof(string), "* %s(%d) was just gifted %d firework(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgFirework][2]);
  1911. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1912. return true;
  1913. }
  1914. if(randy == 3)
  1915. {
  1916. if(dgVar[dgGVIP][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  1917. if(dgVar[dgGVIP][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1918. if(dgVar[dgGVIP][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1919. PlayerInfo[giveplayerid][pGVIPExVoucher] += dgVar[dgGVIP][2];
  1920. format(string, sizeof(string), "Congratulations, you have won %d Seven day Gold VIP Voucher(s)!", dgVar[dgGVIP][2]);
  1921. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1922. format(string, sizeof(string), "* %s was just gifted %d Seven day Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGVIP][2]);
  1923. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1924. dgVar[dgGVIP][1]--;
  1925. format(string, sizeof(string), "* %s(%d) was just gifted %d Seven day Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGVIP][2]);
  1926. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1927. return true;
  1928. }
  1929. if(randy == 4)
  1930. {
  1931. if(dgVar[dgGVIPEx][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1932. if(dgVar[dgGVIPEx][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1933. if(dgVar[dgGVIPEx][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  1934. PlayerInfo[giveplayerid][pGVIPVoucher] += dgVar[dgGVIPEx][2];
  1935. format(string, sizeof(string), "Congratulations, you have won %d One Month Gold VIP Voucher(s)!", dgVar[dgGVIPEx][2]);
  1936. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1937. format(string, sizeof(string), "* %s was just gifted %d One Month Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGVIPEx][2]);
  1938. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1939. dgVar[dgGVIPEx][1]--;
  1940. format(string, sizeof(string), "* %s(%d) was just gifted %d One Month Gold VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGVIPEx][2]);
  1941. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1942. return true;
  1943. }
  1944. if(randy == 5)
  1945. {
  1946. if(dgVar[dgSVIP][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1947. if(dgVar[dgSVIP][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1948. if(dgVar[dgSVIP][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  1949. PlayerInfo[giveplayerid][pSVIPExVoucher] += dgVar[dgSVIP][2];
  1950. format(string, sizeof(string), "Congratulations, you have won %d Seven day Silver VIP Voucher (s)!", dgVar[dgSVIP][2]);
  1951. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1952. format(string, sizeof(string), "* %s was just gifted %d Seven day Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgSVIP][2]);
  1953. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1954. dgVar[dgSVIP][1]--;
  1955. format(string, sizeof(string), "* %s(%d) was just gifted %d Seven day Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgSVIP][2]);
  1956. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1957. return true;
  1958. }
  1959. if(randy == 6)
  1960. {
  1961. if(dgVar[dgSVIPEx][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1962. if(dgVar[dgSVIPEx][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1963. if(dgVar[dgSVIPEx][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  1964. PlayerInfo[giveplayerid][pSVIPVoucher] += dgVar[dgSVIPEx][2];
  1965. format(string, sizeof(string), "Congratulations, you have won %d One Month Silver VIP Voucher(s)!", dgVar[dgSVIPEx][2]);
  1966. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1967. format(string, sizeof(string), "* %s was just gifted %d One Month Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgSVIPEx][2]);
  1968. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1969. dgVar[dgSVIPEx][1]--;
  1970. format(string, sizeof(string), "* %s(%d) was just gifted %d One Month Silver VIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgSVIPEx][2]);
  1971. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1972. return true;
  1973. }
  1974. if(randy == 7)
  1975. {
  1976. if(dgVar[dgCarSlot][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1977. if(dgVar[dgCarSlot][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1978. if(dgVar[dgCarSlot][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  1979. PlayerInfo[giveplayerid][pVehicleSlot] += dgVar[dgCarSlot][2];
  1980. format(string, sizeof(string), "Congratulations, you have won %d Car Slot(s)!", dgVar[dgCarSlot][2]);
  1981. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1982. format(string, sizeof(string), "* %s was just gifted %d Car Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCarSlot][2]);
  1983. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1984. dgVar[dgCarSlot][1]--;
  1985. format(string, sizeof(string), "* %s(%d) was just gifted %d Car Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCarSlot][2]);
  1986. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  1987. return true;
  1988. }
  1989. if(randy == 8)
  1990. {
  1991. if(dgVar[dgToySlot][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  1992. if(dgVar[dgCarSlot][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  1993. if(dgVar[dgCarSlot][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  1994. PlayerInfo[giveplayerid][pToySlot] += dgVar[dgToySlot][2];
  1995. format(string, sizeof(string), "Congratulations, you have won %d Toy Slot(s)!", dgVar[dgToySlot][2]);
  1996. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  1997. format(string, sizeof(string), "* %s was just gifted %d Toy Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgToySlot][2]);
  1998. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  1999. dgVar[dgToySlot][1]--;
  2000. format(string, sizeof(string), "* %s(%d) was just gifted %d Toy Slot(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgToySlot][2]);
  2001. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2002. return true;
  2003. }
  2004. if(randy == 9)
  2005. {
  2006. if(dgVar[dgArmor][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2007. if(dgVar[dgArmor][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2008. if(dgVar[dgArmor][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2009. new Float: armor;
  2010. GetArmour(giveplayerid, armor);
  2011. if(armor+dgVar[dgArmor][2] >= 100) return GiftPlayer(playerid, giveplayerid, 1);
  2012. SetArmour(giveplayerid, armor + dgVar[dgArmor][2]);
  2013. format(string, sizeof(string), "Congratulations, you have won %d Armour!", dgVar[dgArmor][2]);
  2014. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2015. format(string, sizeof(string), "* %s was just gifted %d Armour, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgArmor][2]);
  2016. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2017. dgVar[dgArmor][1]--;
  2018. format(string, sizeof(string), "* %s(%d) was just gifted %d Armour, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgArmor][2]);
  2019. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2020. return true;
  2021. }
  2022. if(randy == 10)
  2023. {
  2024. if(dgVar[dgFirstaid][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2025. if(dgVar[dgFirstaid][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2026. if(dgVar[dgFirstaid][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2027. PlayerInfo[giveplayerid][pFirstaid] += dgVar[dgFirstaid][2];
  2028. format(string, sizeof(string), "Congratulations, you have won %d Firstaid(s)!", dgVar[dgFirstaid][2]);
  2029. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2030. format(string, sizeof(string), "* %s was just gifted %d Firstaid(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgFirstaid][2]);
  2031. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2032. dgVar[dgFirstaid][1]--;
  2033. format(string, sizeof(string), "* %s(%d) was just gifted %d Firstaid(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgFirstaid][2]);
  2034. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2035. return true;
  2036. }
  2037. if(randy == 11)
  2038. {
  2039. if(dgVar[dgDDFlag][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2040. if(dgVar[dgDDFlag][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2041. if(dgVar[dgDDFlag][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2042. AddFlag(giveplayerid, INVALID_PLAYER_ID, "Dynamic Gift Box: 1 Dynamic Door");
  2043. format(string, sizeof(string), "Congratulations, you have won %d Dynamic Door Flag(s)!", dgVar[dgDDFlag][2]);
  2044. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2045. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This prize may take up to 48 hours to be rewarded..");
  2046. format(string, sizeof(string), "* %s was just gifted %d Dynamic Door Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgDDFlag][2]);
  2047. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2048. dgVar[dgDDFlag][1]--;
  2049. format(string, sizeof(string), "* %s(%d) was just gifted %d Dynamic Door Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgDDFlag][2]);
  2050. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2051. return true;
  2052. }
  2053. if(randy == 12)
  2054. {
  2055. if(dgVar[dgGateFlag][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2056. if(dgVar[dgGateFlag][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2057. if(dgVar[dgGateFlag][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2058. AddFlag(giveplayerid, INVALID_PLAYER_ID, "Dynamic Gift Box: 1 Dynamic Gate");
  2059. format(string, sizeof(string), "Congratulations, you have won %d Dynamic Door Flag(s)!", dgVar[dgGateFlag][2]);
  2060. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2061. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This prize may take up to 48 hours to be rewarded..");
  2062. format(string, sizeof(string), "* %s was just gifted %d Dynamic Gate Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGateFlag][2]);
  2063. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2064. dgVar[dgGateFlag][1]--;
  2065. format(string, sizeof(string), "* %s(%d) was just gifted %d Dynamic Gate Flag(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGateFlag][2]);
  2066. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2067. return true;
  2068. }
  2069. if(randy == 13)
  2070. {
  2071. if(dgVar[dgCredits][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2072. if(dgVar[dgCredits][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2073. if(dgVar[dgCredits][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2074. GivePlayerCredits(giveplayerid, dgVar[dgCredits][2], 1);
  2075. format(string, sizeof(string), "Congratulations, you have won %d Credit(s)!", dgVar[dgCredits][2]);
  2076. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2077. format(string, sizeof(string), "* %s was just gifted %d Credit(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCredits][2]);
  2078. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2079. dgVar[dgCredits][1]--;
  2080. format(string, sizeof(string), "* %s(%d) was just gifted %d Credit(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCredits][2]);
  2081. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2082. return true;
  2083. }
  2084. if(randy == 14)
  2085. {
  2086. if(dgVar[dgPriorityAd][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2087. if(dgVar[dgPriorityAd][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2088. if(dgVar[dgPriorityAd][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2089. PlayerInfo[giveplayerid][pAdvertVoucher] += dgVar[dgPriorityAd][2];
  2090. format(string, sizeof(string), "Congratulations, you have won %d Priority Advertisement Voucher(s)!", dgVar[dgPriorityAd][2]);
  2091. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2092. format(string, sizeof(string), "* %s was just gifted %d Priority Advertisement Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPriorityAd][2]);
  2093. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2094. dgVar[dgPriorityAd][1]--;
  2095. format(string, sizeof(string), "* %s(%d) was just gifted %d Priority Advertisement Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPriorityAd][2]);
  2096. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2097. return true;
  2098. }
  2099. if(randy == 15)
  2100. {
  2101. if(dgVar[dgHealthNArmor][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2102. if(dgVar[dgHealthNArmor][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2103. if(dgVar[dgHealthNArmor][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2104. SetHealth(giveplayerid, 100.0);
  2105. SetArmour(giveplayerid, 100);
  2106. format(string, sizeof(string), "Congratulations, you have won Full Health & Armor!");
  2107. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2108. format(string, sizeof(string), "* %s was just gifted %d Full Health & Armor, enjoy!", GetPlayerNameEx(giveplayerid));
  2109. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2110. dgVar[dgHealthNArmor][1]--;
  2111. format(string, sizeof(string), "* %s(%d) was just gifted %d Full Health & Armor, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2112. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2113. return true;
  2114. }
  2115. if(randy == 16)
  2116. {
  2117. if(dgVar[dgGiftReset][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2118. if(dgVar[dgGiftReset][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2119. if(dgVar[dgGiftReset][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2120. PlayerInfo[giveplayerid][pGiftVoucher] += dgVar[dgGiftReset][2];
  2121. format(string, sizeof(string), "Congratulations, you have won a %d Gift Reset Voucher(s)!", dgVar[dgGiftReset][2]);
  2122. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2123. format(string, sizeof(string), "* %s was just gifted %d Gift Reset Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgGiftReset][2]);
  2124. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2125. dgVar[dgGiftReset][1]--;
  2126. format(string, sizeof(string), "* %s(%d) was just gifted %d Gift Reset Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgGiftReset][2]);
  2127. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2128. return true;
  2129. }
  2130. if(randy == 17)
  2131. {
  2132. if(dgVar[dgMaterial][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2133. if(dgVar[dgMaterial][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2134. if(dgVar[dgMaterial][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2135. PlayerInfo[giveplayerid][pMats] += dgVar[dgMaterial][2];
  2136. format(string, sizeof(string), "Congratulations, you have won a %d Material(s)!", dgVar[dgMaterial][2]);
  2137. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2138. format(string, sizeof(string), "* %s was just gifted %d Material(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgMaterial][2]);
  2139. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2140. dgVar[dgMaterial][1]--;
  2141. format(string, sizeof(string), "* %s(%d) was just gifted %d Material(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgMaterial][2]);
  2142. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2143. return true;
  2144. }
  2145. if(randy == 18)
  2146. {
  2147. if(dgVar[dgWarning][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2148. if(dgVar[dgWarning][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2149. if(dgVar[dgWarning][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2150. if(dgVar[dgWarning][2] > 3 || dgVar[dgWarning][2] < 0)
  2151. {
  2152. if(PlayerInfo[giveplayerid][pWarns] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2153. PlayerInfo[giveplayerid][pWarns] -= dgVar[dgWarning][2];
  2154. }
  2155. else
  2156. return GiftPlayer(playerid, giveplayerid, 1);
  2157. format(string, sizeof(string), "Congratulations, you have won a %d Warning(s) Removal!", dgVar[dgWarning][2]);
  2158. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2159. format(string, sizeof(string), "* %s was just gifted %d Warning(s) Removal, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgWarning][2]);
  2160. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2161. dgVar[dgWarning][1]--;
  2162. format(string, sizeof(string), "* %s(%d) was just gifted %d Warning(s) Removal, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgWarning][2]);
  2163. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2164. return true;
  2165. }
  2166. if(randy == 19)
  2167. {
  2168. if(dgVar[dgPot][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2169. if(dgVar[dgPot][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2170. if(dgVar[dgPot][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2171. PlayerInfo[giveplayerid][pDrugs][0] += dgVar[dgPot][2];
  2172. format(string, sizeof(string), "Congratulations, you have won %d pot!", dgVar[dgPot][2]);
  2173. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2174. format(string, sizeof(string), "* %s was just gifted %d pot, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPot][2]);
  2175. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2176. dgVar[dgPot][1]--;
  2177. format(string, sizeof(string), "* %s(%d) was just gifted %d pot, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPot][2]);
  2178. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2179. return true;
  2180. }
  2181. if(randy == 20)
  2182. {
  2183. if(dgVar[dgCrack][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2184. if(dgVar[dgCrack][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2185. if(dgVar[dgCrack][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2186. PlayerInfo[giveplayerid][pDrugs][1] += dgVar[dgCrack][2];
  2187. format(string, sizeof(string), "Congratulations, you have won %d Crack!", dgVar[dgCrack][2]);
  2188. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2189. format(string, sizeof(string), "* %s was just gifted %d Crack, enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCrack][2]);
  2190. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2191. dgVar[dgCrack][1]--;
  2192. format(string, sizeof(string), "* %s(%d) was just gifted %d Crack, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCrack][2]);
  2193. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2194. return true;
  2195. }
  2196. if(randy == 21)
  2197. {
  2198. if(dgVar[dgPaintballToken][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2199. if(dgVar[dgPaintballToken][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2200. if(dgVar[dgPaintballToken][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2201. if(PlayerInfo[giveplayerid][pDonateRank] >= 4) return GiftPlayer(playerid, giveplayerid, 1);
  2202. PlayerInfo[giveplayerid][pPaintTokens] += dgVar[dgPaintballToken][2];
  2203. format(string, sizeof(string), "Congratulations, you have won a %d Paintball Token(s)!", dgVar[dgPaintballToken][2]);
  2204. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2205. format(string, sizeof(string), "* %s was just gifted %d Paintball Token(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPaintballToken][2]);
  2206. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2207. dgVar[dgPaintballToken][1]--;
  2208. format(string, sizeof(string), "* %s(%d) was just gifted %d Paintball Token(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPaintballToken][2]);
  2209. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2210. return true;
  2211. }
  2212. if(randy == 22)
  2213. {
  2214. if(dgVar[dgVIPToken][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2215. if(dgVar[dgVIPToken][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2216. if(dgVar[dgVIPToken][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2217. if(PlayerInfo[giveplayerid][pDonateRank] >= 4) return GiftPlayer(playerid, giveplayerid, 1);
  2218. PlayerInfo[giveplayerid][pTokens] += dgVar[dgVIPToken][2];
  2219. format(string, sizeof(string), "Congratulations, you have won a %d VIP Token(s)!", dgVar[dgVIPToken][2]);
  2220. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2221. format(string, sizeof(string), "* %s was just gifted %d VIP Token(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgVIPToken][2]);
  2222. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2223. dgVar[dgVIPToken][1]--;
  2224. format(string, sizeof(string), "* %s(%d) was just gifted %d VIP Token(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgVIPToken][2]);
  2225. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2226. return true;
  2227. }
  2228. if(randy == 23)
  2229. {
  2230. if(dgVar[dgRespectPoint][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2231. if(dgVar[dgRespectPoint][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2232. if(dgVar[dgRespectPoint][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2233. PlayerInfo[giveplayerid][pExp] += dgVar[dgRespectPoint][2];
  2234. format(string, sizeof(string), "Congratulations, you have won a %d Respect Point(s)!", dgVar[dgRespectPoint][2]);
  2235. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2236. format(string, sizeof(string), "* %s was just gifted %d Respect Point(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgRespectPoint][2]);
  2237. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2238. dgVar[dgRespectPoint][1]--;
  2239. format(string, sizeof(string), "* %s(%d) was just gifted %d Respect Point(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgRespectPoint][2]);
  2240. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2241. return true;
  2242. }
  2243. if(randy == 24)
  2244. {
  2245. if(dgVar[dgCarVoucher][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2246. if(dgVar[dgCarVoucher][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2247. if(dgVar[dgCarVoucher][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2248. PlayerInfo[giveplayerid][pVehVoucher] += dgVar[dgCarVoucher][2];
  2249. format(string, sizeof(string), "Congratulations, you have won a %d Car Voucher(s)!", dgVar[dgCarVoucher][2]);
  2250. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2251. format(string, sizeof(string), "* %s was just gifted %d Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgCarVoucher][2]);
  2252. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2253. dgVar[dgCarVoucher][1]--;
  2254. format(string, sizeof(string), "* %s(%d) was just gifted %d Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgCarVoucher][2]);
  2255. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2256. return true;
  2257. }
  2258. if(randy == 25)
  2259. {
  2260. if(dgVar[dgBuddyInvite][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2261. if(dgVar[dgBuddyInvite][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2262. if(dgVar[dgBuddyInvite][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2263. if(PlayerInfo[giveplayerid][pDonateRank] != 0) return GiftPlayer(playerid, giveplayerid, 1);
  2264. PlayerInfo[giveplayerid][pDonateRank] = 1;
  2265. PlayerInfo[giveplayerid][pTempVIP] = 180;
  2266. PlayerInfo[giveplayerid][pBuddyInvited] = 1;
  2267. format(string, sizeof(string), "BUDDY INVITE: %s(%d) has been invited to VIP by System", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2268. Log("logs/setvip.log", string);
  2269. format(string, sizeof(string), "Congratulations, you have won a Buddy Invite!");
  2270. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2271. format(string, sizeof(string), "* %s was just gifted a BuddyInvite, enjoy!", GetPlayerNameEx(giveplayerid));
  2272. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2273. dgVar[dgBuddyInvite][1]--;
  2274. format(string, sizeof(string), "* %s(%d) was just gifted a BuddyInvite, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2275. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2276. return true;
  2277. }
  2278. if(randy == 26)
  2279. {
  2280. if(dgVar[dgLaser][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2281. if(dgVar[dgLaser][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2282. if(dgVar[dgLaser][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2283. new icount = GetPlayerToySlots(giveplayerid), success = 0;
  2284. for(new v = 0; v < icount; v++)
  2285. {
  2286. if(PlayerToyInfo[giveplayerid][v][ptModelID] == 0)
  2287. {
  2288. PlayerToyInfo[giveplayerid][v][ptModelID] = 18643;
  2289. PlayerToyInfo[giveplayerid][v][ptBone] = 6;
  2290. PlayerToyInfo[giveplayerid][v][ptPosX] = 0.0;
  2291. PlayerToyInfo[giveplayerid][v][ptPosY] = 0.0;
  2292. PlayerToyInfo[giveplayerid][v][ptPosZ] = 0.0;
  2293. PlayerToyInfo[giveplayerid][v][ptRotX] = 0.0;
  2294. PlayerToyInfo[giveplayerid][v][ptRotY] = 0.0;
  2295. PlayerToyInfo[giveplayerid][v][ptRotZ] = 0.0;
  2296. PlayerToyInfo[giveplayerid][v][ptScaleX] = 1.0;
  2297. PlayerToyInfo[giveplayerid][v][ptScaleY] = 1.0;
  2298. PlayerToyInfo[giveplayerid][v][ptScaleZ] = 1.0;
  2299. PlayerToyInfo[giveplayerid][v][ptTradable] = 1;
  2300. g_mysql_NewToy(giveplayerid, v);
  2301. success = 1;
  2302. break;
  2303. }
  2304. }
  2305. if(success == 0)
  2306. {
  2307. for(new i = 0; i < MAX_PLAYERTOYS; i++)
  2308. {
  2309. if(PlayerToyInfo[giveplayerid][i][ptModelID] == 0)
  2310. {
  2311. PlayerToyInfo[giveplayerid][i][ptModelID] = 18643;
  2312. PlayerToyInfo[giveplayerid][i][ptBone] = 6;
  2313. PlayerToyInfo[giveplayerid][i][ptPosX] = 0.0;
  2314. PlayerToyInfo[giveplayerid][i][ptPosY] = 0.0;
  2315. PlayerToyInfo[giveplayerid][i][ptPosZ] = 0.0;
  2316. PlayerToyInfo[giveplayerid][i][ptRotX] = 0.0;
  2317. PlayerToyInfo[giveplayerid][i][ptRotY] = 0.0;
  2318. PlayerToyInfo[giveplayerid][i][ptRotZ] = 0.0;
  2319. PlayerToyInfo[giveplayerid][i][ptScaleX] = 1.0;
  2320. PlayerToyInfo[giveplayerid][i][ptScaleY] = 1.0;
  2321. PlayerToyInfo[giveplayerid][i][ptScaleZ] = 1.0;
  2322. PlayerToyInfo[giveplayerid][i][ptTradable] = 1;
  2323. PlayerToyInfo[giveplayerid][i][ptSpecial] = 1;
  2324. g_mysql_NewToy(giveplayerid, i);
  2325. SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Due to you not having any available slots, we've temporarily gave you an additional slot to use/sell/trade your laser.");
  2326. SendClientMessageEx(giveplayerid, COLOR_RED, "Note: Please take note that after selling the laser, the temporarily additional toy slot will be removed.");
  2327. break;
  2328. }
  2329. }
  2330. }
  2331. format(string, sizeof(string), "Congratulations, you have won a Laser!");
  2332. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2333. format(string, sizeof(string), "* %s was just gifted a Laser, enjoy!", GetPlayerNameEx(giveplayerid));
  2334. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2335. dgVar[dgLaser][1]--;
  2336. format(string, sizeof(string), "* %s(%d) was just gifted a Laser, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2337. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2338. return true;
  2339. }
  2340. if(randy == 27)
  2341. {
  2342. if(dgVar[dgCustomToy][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2343. if(dgVar[dgCustomToy][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2344. if(dgVar[dgCustomToy][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2345. new icount = GetPlayerToySlots(giveplayerid), success = 0;
  2346. for(new v = 0; v < icount; v++)
  2347. {
  2348. if(PlayerToyInfo[giveplayerid][v][ptModelID] == 0)
  2349. {
  2350. PlayerToyInfo[giveplayerid][v][ptModelID] = dgVar[dgCustomToy][2];
  2351. PlayerToyInfo[giveplayerid][v][ptBone] = 1;
  2352. PlayerToyInfo[giveplayerid][v][ptPosX] = 0.0;
  2353. PlayerToyInfo[giveplayerid][v][ptPosY] = 0.0;
  2354. PlayerToyInfo[giveplayerid][v][ptPosZ] = 0.0;
  2355. PlayerToyInfo[giveplayerid][v][ptRotX] = 0.0;
  2356. PlayerToyInfo[giveplayerid][v][ptRotY] = 0.0;
  2357. PlayerToyInfo[giveplayerid][v][ptRotZ] = 0.0;
  2358. PlayerToyInfo[giveplayerid][v][ptScaleX] = 1.0;
  2359. PlayerToyInfo[giveplayerid][v][ptScaleY] = 1.0;
  2360. PlayerToyInfo[giveplayerid][v][ptScaleZ] = 1.0;
  2361. PlayerToyInfo[giveplayerid][v][ptTradable] = 1;
  2362. g_mysql_NewToy(giveplayerid, v);
  2363. success = 1;
  2364. break;
  2365. }
  2366. }
  2367. if(success == 0)
  2368. {
  2369. for(new i = 0; i < MAX_PLAYERTOYS; i++)
  2370. {
  2371. if(PlayerToyInfo[giveplayerid][i][ptModelID] == 0)
  2372. {
  2373. PlayerToyInfo[giveplayerid][i][ptModelID] = dgVar[dgCustomToy][2];
  2374. PlayerToyInfo[giveplayerid][i][ptBone] = 6;
  2375. PlayerToyInfo[giveplayerid][i][ptPosX] = 0.0;
  2376. PlayerToyInfo[giveplayerid][i][ptPosY] = 0.0;
  2377. PlayerToyInfo[giveplayerid][i][ptPosZ] = 0.0;
  2378. PlayerToyInfo[giveplayerid][i][ptRotX] = 0.0;
  2379. PlayerToyInfo[giveplayerid][i][ptRotY] = 0.0;
  2380. PlayerToyInfo[giveplayerid][i][ptRotZ] = 0.0;
  2381. PlayerToyInfo[giveplayerid][i][ptScaleX] = 1.0;
  2382. PlayerToyInfo[giveplayerid][i][ptScaleY] = 1.0;
  2383. PlayerToyInfo[giveplayerid][i][ptScaleZ] = 1.0;
  2384. PlayerToyInfo[giveplayerid][i][ptTradable] = 1;
  2385. PlayerToyInfo[giveplayerid][i][ptSpecial] = 1;
  2386. g_mysql_NewToy(giveplayerid, i);
  2387. SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Due to you not having any available slots, we've temporarily gave you an additional slot to use/sell/trade your custom toy.");
  2388. SendClientMessageEx(giveplayerid, COLOR_RED, "Note: Please take note that after selling the custom toy, the temporarily additional toy slot will be removed.");
  2389. break;
  2390. }
  2391. }
  2392. }
  2393. format(string, sizeof(string), "Congratulations, you have won a Custom Toy!");
  2394. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2395. format(string, sizeof(string), "* %s was just gifted a Custom Toy, enjoy!", GetPlayerNameEx(giveplayerid));
  2396. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2397. dgVar[dgCustomToy][1]--;
  2398. format(string, sizeof(string), "* %s(%d) was just gifted a Custom Toy, enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2399. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2400. return true;
  2401. }
  2402. if(randy == 28)
  2403. {
  2404. if(dgVar[dgAdmuteReset][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2405. if(dgVar[dgAdmuteReset][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2406. if(dgVar[dgAdmuteReset][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2407. if(PlayerInfo[giveplayerid][pADMuteTotal] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2408. PlayerInfo[giveplayerid][pADMuteTotal] -= dgVar[dgAdmuteReset][2];
  2409. format(string, sizeof(string), "Congratulations, you have won %d Admute Reset(s)!", dgVar[dgAdmuteReset][2]);
  2410. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2411. format(string, sizeof(string), "* %s was just gifted %d Admute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgAdmuteReset][2]);
  2412. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2413. dgVar[dgAdmuteReset][1]--;
  2414. format(string, sizeof(string), "* %s(%d) was just gifted %d Admute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgAdmuteReset][2]);
  2415. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2416. return true;
  2417. }
  2418. if(randy == 29)
  2419. {
  2420. if(dgVar[dgNewbieMuteReset][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2421. if(dgVar[dgNewbieMuteReset][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2422. if(dgVar[dgNewbieMuteReset][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2423. if(PlayerInfo[giveplayerid][pNMuteTotal] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2424. PlayerInfo[giveplayerid][pNMuteTotal] -= dgVar[dgNewbieMuteReset][2];
  2425. format(string, sizeof(string), "Congratulations, you have won %d Newbie Mute Reset(s)!", dgVar[dgNewbieMuteReset][2]);
  2426. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2427. format(string, sizeof(string), "* %s was just gifted %d Newbie Mute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgNewbieMuteReset][2]);
  2428. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2429. dgVar[dgNewbieMuteReset][1]--;
  2430. format(string, sizeof(string), "* %s(%d) was just gifted %d Newbie Mute Reset(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgNewbieMuteReset][2]);
  2431. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2432. return true;
  2433. }
  2434. if(randy == 30)
  2435. {
  2436. if(dgVar[dgRestrictedCarVoucher][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2437. if(dgVar[dgRestrictedCarVoucher][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2438. if(dgVar[dgRestrictedCarVoucher][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2439. PlayerInfo[giveplayerid][pCarVoucher] += dgVar[dgRestrictedCarVoucher][2];
  2440. format(string, sizeof(string), "Congratulations, you have won a %d Restricted Car Voucher(s)!", dgVar[dgRestrictedCarVoucher][2]);
  2441. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2442. format(string, sizeof(string), "* %s was just gifted %d Restricted Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgRestrictedCarVoucher][2]);
  2443. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2444. dgVar[dgRestrictedCarVoucher][1]--;
  2445. format(string, sizeof(string), "* %s(%d) was just gifted %d Restricted Car Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgRestrictedCarVoucher][2]);
  2446. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2447. return true;
  2448. }
  2449. if(randy == 31)
  2450. {
  2451. if(dgVar[dgPlatinumVIPVoucher][1] == value) return GiftPlayer(playerid, giveplayerid, 1);
  2452. if(dgVar[dgPlatinumVIPVoucher][0] == 0) return GiftPlayer(playerid, giveplayerid, 1);
  2453. if(dgVar[dgPlatinumVIPVoucher][3] == 3) return GiftPlayer(playerid, giveplayerid, 1);
  2454. PlayerInfo[giveplayerid][pPVIPVoucher] += dgVar[dgPlatinumVIPVoucher][2];
  2455. format(string, sizeof(string), "Congratulations, you have won a %d 1 month PVIP Voucher(s)!", dgVar[dgPlatinumVIPVoucher][2]);
  2456. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  2457. format(string, sizeof(string), "* %s was just gifted %d 1 month PVIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), dgVar[dgPlatinumVIPVoucher][2]);
  2458. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  2459. dgVar[dgPlatinumVIPVoucher][1]--;
  2460. format(string, sizeof(string), "* %s(%d) was just gifted %d 1 month PVIP Voucher(s), enjoy!", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), dgVar[dgPlatinumVIPVoucher][2]);
  2461. SetPVarInt(giveplayerid, "GiftFail", 0), PlayerInfo[giveplayerid][pGiftTime] = 300, Log("logs/giftbox.log", string), SaveDynamicGiftBox(), OnPlayerStatsUpdate(giveplayerid);
  2462. return true;
  2463. }
  2464. else return SendClientMessageEx(giveplayerid, COLOR_RED, "Seems like the dynamic giftbox is empty, please try again.");
  2465. }
  2466. }
  2467. }
  2468. SaveDynamicGiftBox();
  2469. }
  2470. if(gtype == 2)
  2471. {
  2472. if(playerid == MAX_PLAYERS || PlayerInfo[playerid][pAdmin] >= 2)
  2473. {
  2474. new randgift = Random(1, 103);
  2475. if(randgift >= 1 && randgift <= 83)
  2476. {
  2477. new gift = Random(1, 12);
  2478. if(gift == 1)
  2479. {
  2480. if(PlayerInfo[giveplayerid][pConnectHours] < 2 || PlayerInfo[giveplayerid][pWRestricted] > 0) return GiftPlayer(playerid, giveplayerid);
  2481. return GiftPlayer(playerid, giveplayerid);
  2482. /* GivePlayerValidWeapon(giveplayerid, 27, 100);
  2483. GivePlayerValidWeapon(giveplayerid, 24, 100);
  2484. GivePlayerValidWeapon(giveplayerid, 31, 100);
  2485. GivePlayerValidWeapon(giveplayerid, 34, 100);
  2486. GivePlayerValidWeapon(giveplayerid, 29, 100);
  2487. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a full weapon set!");
  2488. format(string, sizeof(string), "* %s was just gifted a full weapon set, enjoy!", GetPlayerNameEx(giveplayerid));
  2489. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); */
  2490. }
  2491. else if(gift == 2)
  2492. {
  2493. if(PlayerInfo[giveplayerid][pDonateRank] > 2) return GiftPlayer(playerid, giveplayerid);
  2494. PlayerInfo[giveplayerid][pFirstaid]++;
  2495. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a first aid kit!");
  2496. format(string, sizeof(string), "* %s was just gifted a first aid kit, enjoy!", GetPlayerNameEx(giveplayerid));
  2497. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2498. }
  2499. else if(gift == 3)
  2500. {
  2501. PlayerInfo[giveplayerid][pMats] += 2000;
  2502. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 2,000 materials!");
  2503. format(string, sizeof(string), "* %s was just gifted 2,000 materials, enjoy!", GetPlayerNameEx(giveplayerid));
  2504. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2505. }
  2506. else if(gift == 4)
  2507. {
  2508. if(PlayerInfo[giveplayerid][pWarns] != 0)
  2509. {
  2510. PlayerInfo[giveplayerid][pWarns]--;
  2511. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a single warning removal!");
  2512. format(string, sizeof(string), "* %s was just gifted a single warning removal, enjoy!", GetPlayerNameEx(giveplayerid));
  2513. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2514. }
  2515. else
  2516. {
  2517. SendClientMessageEx(giveplayerid, COLOR_GRAD2, "Random gift ended up in a removal of one warning - let's try again!");
  2518. GiftPlayer(playerid, giveplayerid);
  2519. return 1;
  2520. }
  2521. }
  2522. else if(gift == 5)
  2523. {
  2524. PlayerInfo[giveplayerid][pDrugs][0] += 50;
  2525. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 50 grams of pot!");
  2526. format(string, sizeof(string), "* %s was just gifted 50 grams of pot, enjoy!", GetPlayerNameEx(giveplayerid));
  2527. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2528. }
  2529. else if(gift == 6)
  2530. {
  2531. PlayerInfo[giveplayerid][pDrugs][1] += 25;
  2532. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 25 grams of crack!");
  2533. format(string, sizeof(string), "* %s was just gifted 25 grams of crack, enjoy!", GetPlayerNameEx(giveplayerid));
  2534. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2535. }
  2536. else if(gift == 7)
  2537. {
  2538. GivePlayerCash(giveplayerid, 20000);
  2539. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won $20,000!");
  2540. format(string, sizeof(string), "* %s was just gifted $20,000, enjoy!", GetPlayerNameEx(giveplayerid));
  2541. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2542. }
  2543. else if(gift == 8)
  2544. {
  2545. if(PlayerInfo[giveplayerid][pDonateRank] >= 4) return GiftPlayer(playerid, giveplayerid);
  2546. PlayerInfo[giveplayerid][pPaintTokens] += 10;
  2547. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 10 paintball tokens!");
  2548. format(string, sizeof(string), "* %s was just gifted 10 paintball tokens, enjoy!", GetPlayerNameEx(giveplayerid));
  2549. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2550. }
  2551. else if(gift == 9)
  2552. {
  2553. if(PlayerInfo[giveplayerid][pDonateRank] < 1) return GiftPlayer(playerid, giveplayerid);
  2554. if(PlayerInfo[giveplayerid][pDonateRank] >= 4) return GiftPlayer(playerid, giveplayerid);
  2555. PlayerInfo[giveplayerid][pTokens] += 5;
  2556. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 5 VIP tokens!");
  2557. format(string, sizeof(string), "* %s was just gifted 5 VIP tokens, enjoy!", GetPlayerNameEx(giveplayerid));
  2558. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2559. }
  2560. else if(gift == 10)
  2561. {
  2562. PlayerInfo[giveplayerid][pFirework] += 2;
  2563. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 2 Fireworks!");
  2564. format(string, sizeof(string), "* %s was just gifted 2 Fireworks, enjoy!", GetPlayerNameEx(giveplayerid));
  2565. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2566. }
  2567. else if(gift == 11)
  2568. {
  2569. PlayerInfo[giveplayerid][pExp] += 5;
  2570. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 5 Respect Points!");
  2571. format(string, sizeof(string), "* %s was just gifted 5 Respect Points, enjoy!", GetPlayerNameEx(giveplayerid));
  2572. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2573. }
  2574. }
  2575. else if(randgift > 83 && randgift <= 98)
  2576. {
  2577. new gift = Random(1, 9);
  2578. if(gift == 1)
  2579. {
  2580. GivePlayerCash(giveplayerid, 150000);
  2581. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won $150,000!");
  2582. format(string, sizeof(string), "* %s was just gifted $150,000, enjoy!", GetPlayerNameEx(giveplayerid));
  2583. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2584. }
  2585. else if(gift == 2)
  2586. {
  2587. PlayerInfo[giveplayerid][pMats] += 15000;
  2588. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 15,000 materials!");
  2589. format(string, sizeof(string), "* %s was just gifted 15,000 materials, enjoy!", GetPlayerNameEx(giveplayerid));
  2590. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2591. }
  2592. else if(gift == 3)
  2593. {
  2594. PlayerInfo[giveplayerid][pExp] += 10;
  2595. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 10 respect points!");
  2596. format(string, sizeof(string), "* %s was just gifted 10 respect points, enjoy!", GetPlayerNameEx(giveplayerid));
  2597. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2598. }
  2599. else if(gift == 4)
  2600. {
  2601. PlayerInfo[giveplayerid][pVehVoucher]++;
  2602. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a free car!");
  2603. SendClientMessageEx(giveplayerid, COLOR_CYAN, " 1 Car Voucher has been added to your account.");
  2604. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note you may access your voucher(s) with /myvouchers");
  2605. format(string, sizeof(string), "AdmCmd: %s(%d) was just gifted by the system and he won a free car", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2606. Log("logs/gifts.log", string);
  2607. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s was just gifted by the system and he won a free car.", GetPlayerNameEx(giveplayerid));
  2608. ABroadCast(COLOR_YELLOW, string, 4);
  2609. format(string, sizeof(string), "* %s was just gifted a free car, enjoy!", GetPlayerNameEx(giveplayerid));
  2610. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2611. }
  2612. else if(gift == 5)
  2613. {
  2614. if(PlayerInfo[giveplayerid][pDonateRank] > 0)
  2615. {
  2616. if(PlayerInfo[giveplayerid][pDonateRank] >= 4) return GiftPlayer(playerid, giveplayerid);
  2617. PlayerInfo[giveplayerid][pTokens] += 15;
  2618. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 15 VIP tokens!");
  2619. format(string, sizeof(string), "* %s was just gifted 15 VIP tokens, enjoy!", GetPlayerNameEx(giveplayerid));
  2620. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2621. }
  2622. else
  2623. {
  2624. PlayerInfo[giveplayerid][pDonateRank] = 1;
  2625. PlayerInfo[giveplayerid][pTempVIP] = 180;
  2626. PlayerInfo[giveplayerid][pBuddyInvited] = 1;
  2627. format(string, sizeof(string), "You have been invited to become a Level 1 VIP for 3 hours. Enjoy!", GetPlayerNameEx(giveplayerid));
  2628. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  2629. format(string, sizeof(string), "BUDDY INVITE: %s(%d) has won a buddyinvite.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2630. Log("logs/setvip.log", string);
  2631. format(string, sizeof(string), "* %s was just gifted 3 hours of VIP, enjoy!", GetPlayerNameEx(giveplayerid));
  2632. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2633. }
  2634. }
  2635. else if(gift == 6)
  2636. {
  2637. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a Free Laser Pointer!");
  2638. format(string, sizeof(string), "* %s was just gifted a Free Laser Pointer, enjoy!", GetPlayerNameEx(giveplayerid));
  2639. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2640. new icount = GetPlayerToySlots(giveplayerid);
  2641. for(new v = 0; v < icount; v++)
  2642. {
  2643. if(PlayerToyInfo[giveplayerid][v][ptModelID] == 0)
  2644. {
  2645. PlayerToyInfo[giveplayerid][v][ptModelID] = 18643;
  2646. PlayerToyInfo[giveplayerid][v][ptBone] = 6;
  2647. PlayerToyInfo[giveplayerid][v][ptPosX] = 0.0;
  2648. PlayerToyInfo[giveplayerid][v][ptPosY] = 0.0;
  2649. PlayerToyInfo[giveplayerid][v][ptPosZ] = 0.0;
  2650. PlayerToyInfo[giveplayerid][v][ptRotX] = 0.0;
  2651. PlayerToyInfo[giveplayerid][v][ptRotY] = 0.0;
  2652. PlayerToyInfo[giveplayerid][v][ptRotZ] = 0.0;
  2653. PlayerToyInfo[giveplayerid][v][ptScaleX] = 1.0;
  2654. PlayerToyInfo[giveplayerid][v][ptScaleY] = 1.0;
  2655. PlayerToyInfo[giveplayerid][v][ptScaleZ] = 1.0;
  2656. PlayerToyInfo[giveplayerid][v][ptTradable] = 1;
  2657. g_mysql_NewToy(giveplayerid, v);
  2658. PlayerInfo[giveplayerid][pGiftTime] = 300;
  2659. return 1;
  2660. }
  2661. }
  2662. for(new i = 0; i < MAX_PLAYERTOYS; i++)
  2663. {
  2664. if(PlayerToyInfo[giveplayerid][i][ptModelID] == 0)
  2665. {
  2666. PlayerToyInfo[giveplayerid][i][ptModelID] = 18643;
  2667. PlayerToyInfo[giveplayerid][i][ptBone] = 6;
  2668. PlayerToyInfo[giveplayerid][i][ptPosX] = 0.0;
  2669. PlayerToyInfo[giveplayerid][i][ptPosY] = 0.0;
  2670. PlayerToyInfo[giveplayerid][i][ptPosZ] = 0.0;
  2671. PlayerToyInfo[giveplayerid][i][ptRotX] = 0.0;
  2672. PlayerToyInfo[giveplayerid][i][ptRotY] = 0.0;
  2673. PlayerToyInfo[giveplayerid][i][ptRotZ] = 0.0;
  2674. PlayerToyInfo[giveplayerid][i][ptScaleX] = 1.0;
  2675. PlayerToyInfo[giveplayerid][i][ptScaleY] = 1.0;
  2676. PlayerToyInfo[giveplayerid][i][ptScaleZ] = 1.0;
  2677. PlayerToyInfo[giveplayerid][i][ptTradable] = 1;
  2678. PlayerToyInfo[giveplayerid][i][ptSpecial] = 1;
  2679. g_mysql_NewToy(giveplayerid, i);
  2680. SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Due to you not having any available slots, we've temporarily gave you an additional slot to use/sell/trade your laser.");
  2681. SendClientMessageEx(giveplayerid, COLOR_RED, "Note: Please take note that after selling the laser, the temporarily additional toy slot will be removed.");
  2682. break;
  2683. }
  2684. }
  2685. //AddFlag(giveplayerid, INVALID_PLAYER_ID, "Free Laser Pointer (Gift)");
  2686. //SendClientMessageEx(giveplayerid, COLOR_GREY, "You have no empty toy slots, so you have been flagged for a free laser.");
  2687. }
  2688. else if(gift == 7)
  2689. {
  2690. if(PlayerInfo[giveplayerid][pADMuteTotal] < 1) return GiftPlayer(playerid, giveplayerid);
  2691. PlayerInfo[giveplayerid][pADMuteTotal] = 0;
  2692. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a Free Admute Reset!");
  2693. format(string, sizeof(string), "* %s was just gifted a Free Admute Reset, enjoy!", GetPlayerNameEx(giveplayerid));
  2694. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2695. }
  2696. else if(gift == 8)
  2697. {
  2698. if(PlayerInfo[giveplayerid][pNMuteTotal] < 1) return GiftPlayer(playerid, giveplayerid);
  2699. PlayerInfo[giveplayerid][pNMuteTotal] = 0;
  2700. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a Free Nmute Reset!");
  2701. format(string, sizeof(string), "* %s was just gifted a Free Nmute Reset, enjoy!", GetPlayerNameEx(giveplayerid));
  2702. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2703. }
  2704. }
  2705. else if(randgift > 98 && randgift <= 100)
  2706. {
  2707. new gift = Random(1, 6);
  2708. if(gift == 1 && PlayerInfo[giveplayerid][pDonateRank] <= 2) // Silver VIP can get it extended, I suppose
  2709. {
  2710. PlayerInfo[giveplayerid][pSVIPVoucher]++;
  2711. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won one month of Silver VIP!");
  2712. SendClientMessageEx(giveplayerid, COLOR_CYAN, " 1 Silver VIP Voucher has been added to your account.");
  2713. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note you may access your voucher(s) with /myvouchers");
  2714. if(playerid == MAX_PLAYERS) {
  2715. format(string, sizeof(string), "AdmCmd: %s(%d) was just gifted by the system and he won one month of Silver VIP.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2716. Log("logs/gifts.log", string);
  2717. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s was just gifted by the system and he won one month of Silver VIP.", GetPlayerNameEx(giveplayerid));
  2718. }
  2719. else {
  2720. format(string, sizeof(string), "AdmCmd: %s has just gifted %s(%d) and he won one month of Silver VIP.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2721. Log("logs/gifts.log", string);
  2722. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just gifted %s and he won one month of Silver VIP.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  2723. }
  2724. ABroadCast(COLOR_YELLOW, string, 2);
  2725. format(string, sizeof(string), "* %s was just gifted one month of Silver VIP, enjoy!", GetPlayerNameEx(giveplayerid));
  2726. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2727. }
  2728. else if(gift == 2)
  2729. {
  2730. format(string, sizeof(string), "AdmCmd: %s(%d) was just gifted by the system and he won a free house", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2731. Log("logs/gifts.log", string);
  2732. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s was just gifted by the system and he won a free house.", GetPlayerNameEx(giveplayerid));
  2733. ABroadCast(COLOR_YELLOW, string, 2);
  2734. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a free house!");
  2735. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This rare reward may take up to 48 hours to be rewarded.");
  2736. AddFlag(giveplayerid, INVALID_PLAYER_ID, "Free House (Gift)");
  2737. format(string, sizeof(string), "* %s was just gifted a free house, enjoy!", GetPlayerNameEx(giveplayerid));
  2738. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2739. }
  2740. else if(gift == 3)
  2741. {
  2742. if(PlayerInfo[giveplayerid][pDonateRank] < 1) return GiftPlayer(playerid, giveplayerid);
  2743. if(PlayerInfo[giveplayerid][pDonateRank] >= 4) return GiftPlayer(playerid, giveplayerid);
  2744. PlayerInfo[giveplayerid][pTokens] += 50;
  2745. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 50 VIP tokens!");
  2746. format(string, sizeof(string), "* %s was just gifted 50 VIP tokens, enjoy!", GetPlayerNameEx(giveplayerid));
  2747. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2748. }
  2749. else if(gift == 4)
  2750. {
  2751. GivePlayerCash(giveplayerid, 500000);
  2752. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won $500,000!");
  2753. if(playerid == MAX_PLAYERS) {
  2754. format(string, sizeof(string), "AdmCmd: %s(%d) was just gifted by the system and he won $500,000.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2755. Log("logs/gifts.log", string);
  2756. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s was just gifted by the system and he won $500,000.", GetPlayerNameEx(giveplayerid));
  2757. }
  2758. else {
  2759. format(string, sizeof(string), "AdmCmd: %s has just gifted %s(%d) and he won $500,000.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2760. Log("logs/gifts.log", string);
  2761. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just gifted %s and he won $500,000.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  2762. }
  2763. ABroadCast(COLOR_YELLOW, string, 2);
  2764. format(string, sizeof(string), "* %s was just gifted $500,000, enjoy!", GetPlayerNameEx(giveplayerid));
  2765. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2766. }
  2767. else if(gift == 5)
  2768. {
  2769. PlayerInfo[giveplayerid][pGVIPVoucher]++;
  2770. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won one month of Gold VIP!");
  2771. SendClientMessageEx(giveplayerid, COLOR_CYAN, " 1 Gold VIP Voucher has been added to your account.");
  2772. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note you may access your voucher(s) with /myvouchers");
  2773. if(playerid == MAX_PLAYERS) {
  2774. format(string, sizeof(string), "AdmCmd: %s(%d) was just gifted by the system and he won one month of Gold VIP.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2775. Log("logs/gifts.log", string);
  2776. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s was just gifted by the system and he won one month of Gold VIP.", GetPlayerNameEx(giveplayerid));
  2777. }
  2778. else {
  2779. format(string, sizeof(string), "AdmCmd: %s has just gifted %s(%d) and he won one month of Gold VIP.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2780. Log("logs/gifts.log", string);
  2781. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just gifted %s and he won one month of Gold VIP.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  2782. }
  2783. ABroadCast(COLOR_YELLOW, string, 2);
  2784. format(string, sizeof(string), "* %s was just gifted one month of Gold VIP, enjoy!", GetPlayerNameEx(giveplayerid));
  2785. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2786. }
  2787. }
  2788. else if(randgift > 100 && randgift <= 103) // Rim Mod
  2789. {
  2790. new gift = Random(1, 10);
  2791. if(gift >= 1 && gift <= 3)
  2792. {
  2793. if(RimMod > 0) // Rim Kit
  2794. {
  2795. PlayerInfo[giveplayerid][pRimMod]++;
  2796. RimMod--;
  2797. g_mysql_SaveMOTD();
  2798. if(playerid == MAX_PLAYERS) {
  2799. format(string, sizeof(string), "AdmCmd: %s(%d) was just gifted by the system and he won a rim modification kit. (%d left)", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), RimMod);
  2800. }
  2801. else {
  2802. format(string, sizeof(string), "AdmCmd: %s has just gifted %s(%d) and he won a rim modification kit. (%d left)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), RimMod);
  2803. }
  2804. Log("logs/gifts.log", string);
  2805. format(string, sizeof(string), "* %s was just gifted a rim modification kit, enjoy! Only %d kits left.", GetPlayerNameEx(giveplayerid), RimMod);
  2806. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2807. }
  2808. else
  2809. {
  2810. GiftPlayer(MAX_PLAYERS, giveplayerid);
  2811. return 1;
  2812. }
  2813. }
  2814. else if(gift == 4) //
  2815. {
  2816. if(CarVoucher > 0)
  2817. {
  2818. PlayerInfo[giveplayerid][pCarVoucher]++;
  2819. CarVoucher--;
  2820. g_mysql_SaveMOTD();
  2821. if(playerid == MAX_PLAYERS) {
  2822. format(string, sizeof(string), "AdmCmd: %s(%d) was just gifted by the system and he won a restricted car voucher. (%d left)", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), CarVoucher);
  2823. }
  2824. else {
  2825. format(string, sizeof(string), "AdmCmd: %s has just gifted %s(%d) and he won a restricted car voucher. (%d left)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), CarVoucher);
  2826. }
  2827. Log("logs/gifts.log", string);
  2828. format(string, sizeof(string), "* %s was just gifted a restricted car voucher, enjoy! Only %d car vouchers left.", GetPlayerNameEx(giveplayerid), CarVoucher);
  2829. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2830. SendClientMessageEx(giveplayerid, COLOR_CYAN, " 1 Restricted Car Voucher has been added to your account.");
  2831. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note you may access your voucher(s) with /myvouchers");
  2832. }
  2833. else
  2834. {
  2835. GiftPlayer(MAX_PLAYERS, giveplayerid);
  2836. return 1;
  2837. }
  2838. }
  2839. else if(gift == 5) //
  2840. {
  2841. new gift2 = Random(1, 15);
  2842. if(gift2 == 3)
  2843. {
  2844. if(PVIPVoucher > 0)
  2845. {
  2846. PlayerInfo[giveplayerid][pPVIPVoucher]++;
  2847. PVIPVoucher--;
  2848. g_mysql_SaveMOTD();
  2849. if(playerid == MAX_PLAYERS)
  2850. {
  2851. format(string, sizeof(string), "AdmCmd: %s(%d) was just gifted by the system and he won a 1 month PVIP Voucher. (%d left)", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), PVIPVoucher);
  2852. }
  2853. else
  2854. {
  2855. format(string, sizeof(string), "AdmCmd: %s has just gifted %s(%d) and he won a 1 month PVIP Voucher. (%d left)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), PVIPVoucher);
  2856. }
  2857. Log("logs/gifts.log", string);
  2858. format(string, sizeof(string), "* %s was just gifted a 1 month PVIP Voucher, enjoy! There are %d 1 month PVIP Vouchers left.", GetPlayerNameEx(giveplayerid), PVIPVoucher);
  2859. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2860. SendClientMessageEx(giveplayerid, COLOR_CYAN, " 1 1 month PVIP Voucher has been added to your account.");
  2861. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note you may access your voucher(s) with /myvouchers");
  2862. SendClientMessageToAll(COLOR_WHITE, string);
  2863. }
  2864. else
  2865. {
  2866. GiftPlayer(MAX_PLAYERS, giveplayerid);
  2867. return 1;
  2868. }
  2869. }
  2870. else
  2871. {
  2872. GiftPlayer(MAX_PLAYERS, giveplayerid);
  2873. return 1;
  2874. }
  2875. }
  2876. else
  2877. {
  2878. GiftPlayer(MAX_PLAYERS, giveplayerid);
  2879. return 1;
  2880. }
  2881. }
  2882. PlayerInfo[giveplayerid][pGiftTime] = 300;
  2883. }
  2884. }
  2885. return 1;
  2886. }
  2887. stock GetDynamicGiftBoxType(value)
  2888. {
  2889. new string[128];
  2890. if(value == 0)
  2891. format(string, sizeof(string), "Less Common");
  2892. else if(value == 1)
  2893. format(string, sizeof(string), "Common");
  2894. else if(value == 2)
  2895. format(string, sizeof(string), "Rare");
  2896. else if(value == 3)
  2897. format(string, sizeof(string), "Super Rare");
  2898. return string;
  2899. }
  2900. stock ShowPlayerDynamicGiftBox(playerid)
  2901. {
  2902. szMiscArray[0] = 0;
  2903. szMiscArray = "{1B7A3C}Giftbox Settings{FFFFFF}";
  2904. if(dgVar[dgMoney][0] == 1)
  2905. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Money", szMiscArray);
  2906. else
  2907. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Money", szMiscArray);
  2908. if(dgVar[dgRimKit][0] == 1)
  2909. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Rimkit", szMiscArray);
  2910. else
  2911. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Rimkit", szMiscArray);
  2912. if(dgVar[dgFirework][0] == 1)
  2913. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Firework", szMiscArray);
  2914. else
  2915. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Firework", szMiscArray);
  2916. if(dgVar[dgGVIP][0] == 1)
  2917. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}7 Days Gold VIP", szMiscArray);
  2918. else
  2919. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}7 Days Gold VIP", szMiscArray);
  2920. if(dgVar[dgGVIPEx][0] == 1)
  2921. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}1 Month Gold VIP", szMiscArray);
  2922. else
  2923. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}1 Month Gold VIP", szMiscArray);
  2924. if(dgVar[dgSVIP][0] == 1)
  2925. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}7 Days Silver VIP", szMiscArray);
  2926. else
  2927. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}7 Days Silver VIP", szMiscArray);
  2928. if(dgVar[dgSVIPEx][0] == 1)
  2929. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}1 Month Silver VIP", szMiscArray);
  2930. else
  2931. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}1 Month Silver VIP", szMiscArray);
  2932. if(dgVar[dgCarSlot][0] == 1)
  2933. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Car Slot", szMiscArray);
  2934. else
  2935. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Car Slot", szMiscArray);
  2936. if(dgVar[dgToySlot][0] == 1)
  2937. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Toy Slot", szMiscArray);
  2938. else
  2939. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Toy Slot", szMiscArray);
  2940. if(dgVar[dgArmor][0] == 1)
  2941. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Full Armor", szMiscArray);
  2942. else
  2943. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Full Armor", szMiscArray);
  2944. if(dgVar[dgFirstaid][0] == 1)
  2945. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Firstaid", szMiscArray);
  2946. else
  2947. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Firstaid", szMiscArray);
  2948. if(dgVar[dgDDFlag][0] == 1)
  2949. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Dynamic Door Flag", szMiscArray);
  2950. else
  2951. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Dynamic Door Flag", szMiscArray);
  2952. if(dgVar[dgGateFlag][0] == 1)
  2953. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Dynamic Gate Flag", szMiscArray);
  2954. else
  2955. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Dynamic Gate Flag", szMiscArray);
  2956. if(dgVar[dgCredits][0] == 1)
  2957. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Credits", szMiscArray);
  2958. else
  2959. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Credits", szMiscArray);
  2960. if(dgVar[dgPriorityAd][0] == 1)
  2961. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Priority Ad", szMiscArray);
  2962. else
  2963. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Priority Ad", szMiscArray);
  2964. if(dgVar[dgHealthNArmor][0] == 1)
  2965. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Health & Armor", szMiscArray);
  2966. else
  2967. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Health & Armor", szMiscArray);
  2968. if(dgVar[dgGiftReset][0] == 1)
  2969. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Gift Reset", szMiscArray);
  2970. else
  2971. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Gift Reset", szMiscArray);
  2972. if(dgVar[dgMaterial][0] == 1)
  2973. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Material", szMiscArray);
  2974. else
  2975. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Material", szMiscArray);
  2976. if(dgVar[dgWarning][0] == 1)
  2977. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Warning", szMiscArray);
  2978. else
  2979. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Warning", szMiscArray);
  2980. if(dgVar[dgPot][0] == 1)
  2981. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Pot", szMiscArray);
  2982. else
  2983. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Pot", szMiscArray);
  2984. if(dgVar[dgCrack][0] == 1)
  2985. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Crack", szMiscArray);
  2986. else
  2987. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Crack", szMiscArray);
  2988. if(dgVar[dgPaintballToken][0] == 1)
  2989. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Paintball Token", szMiscArray);
  2990. else
  2991. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Paintball Token", szMiscArray);
  2992. if(dgVar[dgVIPToken][0] == 1)
  2993. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}VIP Token", szMiscArray);
  2994. else
  2995. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}VIP Token", szMiscArray);
  2996. if(dgVar[dgRespectPoint][0] == 1)
  2997. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Respect Point", szMiscArray);
  2998. else
  2999. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Respect Point", szMiscArray);
  3000. if(dgVar[dgCarVoucher][0] == 1)
  3001. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Car Voucher", szMiscArray);
  3002. else
  3003. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Car Voucher", szMiscArray);
  3004. if(dgVar[dgBuddyInvite][0] == 1)
  3005. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Buddy Invite", szMiscArray);
  3006. else
  3007. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Buddy Invite", szMiscArray);
  3008. if(dgVar[dgLaser][0] == 1)
  3009. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Laser", szMiscArray);
  3010. else
  3011. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Laser", szMiscArray);
  3012. if(dgVar[dgCustomToy][0] == 1)
  3013. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Custom Toy", szMiscArray);
  3014. else
  3015. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Custom Toy", szMiscArray);
  3016. if(dgVar[dgAdmuteReset][0] == 1)
  3017. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Advertisement Mute Reset", szMiscArray);
  3018. else
  3019. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Advertisement Mute Reset", szMiscArray);
  3020. if(dgVar[dgNewbieMuteReset][0] == 1)
  3021. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Newbie Mute Reset", szMiscArray);
  3022. else
  3023. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Newbie Mute Reset", szMiscArray);
  3024. if(dgVar[dgRestrictedCarVoucher][0] == 1)
  3025. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}Restricted Car Voucher", szMiscArray);
  3026. else
  3027. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}Restricted Car Voucher", szMiscArray);
  3028. if(dgVar[dgPlatinumVIPVoucher][0] == 1)
  3029. format(szMiscArray, sizeof(szMiscArray), "%s\n{00FF61}1 month PVIP Voucher", szMiscArray);
  3030. else
  3031. format(szMiscArray, sizeof(szMiscArray), "%s\n{F2070B}1 month PVIP Voucher", szMiscArray);
  3032. return ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_VIEW, DIALOG_STYLE_LIST, "Dynamic Giftbox", szMiscArray, "Select", "Close");
  3033. }
  3034. CMD:gifts(playerid, params[])
  3035. {
  3036. if(PlayerInfo[playerid][pAdmin] >= 1337)
  3037. {
  3038. if(Gifts == 0)
  3039. {
  3040. Gifts = 1;
  3041. format(szMiscArray, sizeof(szMiscArray), "AdmCmd: %s has enabled the /gift command.", GetPlayerNameEx(playerid));
  3042. ABroadCast(COLOR_LIGHTRED, szMiscArray, 1337 );
  3043. }
  3044. else
  3045. {
  3046. Gifts = 0;
  3047. format(szMiscArray, sizeof(szMiscArray), "AdmCmd: %s has disabled the /gift command.", GetPlayerNameEx(playerid));
  3048. ABroadCast( COLOR_LIGHTRED, szMiscArray, 1337 );
  3049. }
  3050. }
  3051. return 1;
  3052. }
  3053. CMD:vipgifts(playerid, params[])
  3054. {
  3055. if(PlayerInfo[playerid][pAdmin] >= 1337)
  3056. {
  3057. if(VIPGifts == 0)
  3058. {
  3059. VIPGifts = 1;
  3060. format(szMiscArray, sizeof(szMiscArray), "%s would like for you to come to Club VIP for free gifts and great times [20 minutes remains]", GetPlayerNameEx(playerid));
  3061. SendVIPMessage(COLOR_LIGHTGREEN, szMiscArray);
  3062. VIPGiftsTimeLeft = 20;
  3063. format(VIPGiftsName, sizeof(VIPGiftsName), "%s", GetPlayerNameEx(playerid));
  3064. }
  3065. else
  3066. {
  3067. VIPGifts = 0;
  3068. format(szMiscArray, sizeof(szMiscArray), "AdmCmd: %s has disabled the /getgift command early", GetPlayerNameEx(playerid));
  3069. ABroadCast( COLOR_LIGHTRED, szMiscArray, 1337 );
  3070. format(szMiscArray, sizeof(szMiscArray), "Club VIP is no longer giving away free gifts. Thanks for coming!", VIPGiftsName, VIPGiftsTimeLeft);
  3071. SendVIPMessage(COLOR_LIGHTGREEN, szMiscArray);
  3072. VIPGiftsTimeLeft = 0;
  3073. }
  3074. }
  3075. return 1;
  3076. }
  3077. CMD:resetgift(playerid, params[])
  3078. {
  3079. new giveplayerid;
  3080. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /resetgift [player]");
  3081. if(PlayerInfo[playerid][pAdmin] >= 1337)
  3082. {
  3083. if(IsPlayerConnected(giveplayerid))
  3084. {
  3085. if(PlayerInfo[giveplayerid][pGiftTime] > 0)
  3086. {
  3087. PlayerInfo[giveplayerid][pGiftTime] = 0;
  3088. format(szMiscArray, sizeof(szMiscArray), "%s's gift timer has been reset", GetPlayerNameEx(giveplayerid));
  3089. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  3090. }
  3091. else
  3092. {
  3093. SendClientMessageEx(playerid, COLOR_GRAD2, "That players gift timer is already on 0!");
  3094. }
  3095. }
  3096. else
  3097. {
  3098. SendClientMessageEx(playerid, COLOR_GRAD2, "That person is not connected.");
  3099. }
  3100. }
  3101. return 1;
  3102. }
  3103. CMD:giftnear(playerid, params[])
  3104. {
  3105. if(PlayerInfo[playerid][pAdmin] >= 1337)
  3106. {
  3107. new range;
  3108. if(sscanf(params, "d", range)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /giftnear [range]");
  3109. if(range < 1)
  3110. {
  3111. SendClientMessageEx(playerid, COLOR_WHITE, "The range can not be lower than 1.");
  3112. return 1;
  3113. }
  3114. new count;
  3115. foreach(new i: Player)
  3116. {
  3117. if(ProxDetectorS(range, playerid, i))
  3118. {
  3119. if(PlayerInfo[i][pGiftTime] <= 0)
  3120. {
  3121. GiftPlayer(playerid, i);
  3122. count++;
  3123. }
  3124. }
  3125. }
  3126. format(szMiscArray, sizeof(szMiscArray), "You have gifted everyone (%d) nearby.", count);
  3127. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  3128. }
  3129. return 1;
  3130. }
  3131. CMD:resetgiftall(playerid, params[])
  3132. {
  3133. if(PlayerInfo[playerid][pAdmin] >= 1337)
  3134. {
  3135. format(szMiscArray, sizeof(szMiscArray), "{AA3333}AdmWarning{FFFF00}: %s has reset everyone's gift timer.", GetPlayerNameEx(playerid));
  3136. ABroadCast(COLOR_YELLOW, szMiscArray, 2);
  3137. foreach(new i: Player)
  3138. {
  3139. PlayerInfo[i][pGiftTime] = 0;
  3140. }
  3141. }
  3142. return 1;
  3143. }
  3144. CMD:gift(playerid, params[])
  3145. {
  3146. new giveplayerid;
  3147. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /gift [player]");
  3148. if(PlayerInfo[playerid][pAdmin] >= 2)
  3149. {
  3150. if(Gifts == 1 || PlayerInfo[playerid][pAdmin] >= 1337)
  3151. {
  3152. if(giveplayerid != INVALID_PLAYER_ID)
  3153. {
  3154. if(PlayerInfo[giveplayerid][pGiftTime] > 0)
  3155. {
  3156. SendClientMessageEx(playerid, COLOR_GRAD2, "The person has already got a gift in the last 5 hours !");
  3157. return 1;
  3158. }
  3159. GiftPlayer(playerid, giveplayerid);
  3160. }
  3161. else
  3162. {
  3163. SendClientMessageEx(playerid, COLOR_GRAD2, "That person is not connected.");
  3164. }
  3165. }
  3166. else
  3167. {
  3168. SendClientMessageEx(playerid, COLOR_GRAD2, "This command is not activated!");
  3169. }
  3170. }
  3171. return 1;
  3172. }
  3173. CMD:giftall(playerid, params[])
  3174. {
  3175. if(PlayerInfo[playerid][pAdmin] >= 1337)
  3176. {
  3177. if(GiftAllowed || PlayerInfo[playerid][pAdmin] >= 99999)
  3178. {
  3179. format(szMiscArray, sizeof(szMiscArray), "{AA3333}AdmWarning{FFFF00}: %s has just sent a gift to all players.", GetPlayerNameEx(playerid));
  3180. ABroadCast(COLOR_YELLOW, szMiscArray, 2);
  3181. GiftAllowed = 0;
  3182. foreach(new i: Player)
  3183. {
  3184. GiftPlayer(playerid, i);
  3185. }
  3186. }
  3187. else
  3188. {
  3189. return SendClientMessageEx(playerid, COLOR_GRAD2, "This command has already been used, wait until the next paycheck!");
  3190. }
  3191. }
  3192. return 1;
  3193. }
  3194. CMD:giftreset(playerid, params[])
  3195. {
  3196. if(PlayerInfo[playerid][pAdmin] < 1338) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
  3197. new giveplayerid;
  3198. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /giftreset [player]");
  3199. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  3200. if(PlayerInfo[giveplayerid][pGiftTime] == 0) return SendClientMessageEx(playerid, COLOR_GREY, "This player is already able to receive a gift.");
  3201. format(szMiscArray, sizeof(szMiscArray), "{AA3333}AdmWarning{FFFF00}: %s has reset %s's gift timer.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  3202. ABroadCast(COLOR_YELLOW, szMiscArray, 2);
  3203. PlayerInfo[giveplayerid][pGiftTime] = 0;
  3204. return 1;
  3205. }
  3206. CMD:setcode(playerid, params[])
  3207. {
  3208. if (PlayerInfo[playerid][pAdmin] >= 99999 || PlayerInfo[playerid][pShopTech] >= 3)
  3209. {
  3210. new code[32], bypass;
  3211. if (sscanf(params, "s[32]d", code, bypass))
  3212. {
  3213. SendClientMessageEx(playerid, COLOR_GREY, "Usage: /setcode <code> <bypass 0/1>");
  3214. SendClientMessageEx(playerid, COLOR_GREY, "If code is 'off', the active code will be disabled.");
  3215. return 1;
  3216. }
  3217. format(GiftCode, 32, code);
  3218. GiftCodeBypass = bypass;
  3219. g_mysql_SaveMOTD();
  3220. mysql_tquery(MainPipeline, "UPDATE `accounts` SET `GiftCode` = 0;", "OnQueryFinish", "i", SENDDATA_THREAD);
  3221. foreach(new i : Player)
  3222. {
  3223. if(PlayerInfo[i][pGiftCode] == 1)
  3224. PlayerInfo[i][pGiftCode] = 0;
  3225. }
  3226. if (strcmp(code, "off") == 0)
  3227. {
  3228. format(szMiscArray, sizeof(szMiscArray), "You have disabled the gift code.");
  3229. }
  3230. else
  3231. {
  3232. format(szMiscArray, sizeof(szMiscArray), "You have set the gift code to \"%s\".", code);
  3233. }
  3234. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  3235. }
  3236. else
  3237. {
  3238. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  3239. }
  3240. return 1;
  3241. }
  3242. CMD:giftcode(playerid, params[])
  3243. {
  3244. if (isnull(params))
  3245. {
  3246. SendClientMessageEx(playerid, COLOR_WHITE, "Usage: /giftcode <code>");
  3247. return 1;
  3248. }
  3249. if(PlayerInfo[playerid][pLevel] < 3) {
  3250. SendClientMessageEx(playerid, COLOR_GREY, "You must be at least level 3 to use this command.");
  3251. return 1;
  3252. }
  3253. if (strcmp(GiftCode, "off") == 0)
  3254. {
  3255. SendClientMessageEx(playerid, COLOR_GREY, "No gift codes are currently active.");
  3256. return 1;
  3257. }
  3258. else
  3259. {
  3260. if (strcmp(params, GiftCode) == 0)
  3261. {
  3262. if(GiftCodeBypass > 0)
  3263. {
  3264. if(PlayerInfo[playerid][pGiftCode] == 0)
  3265. {
  3266. SendClientMessageEx(playerid, COLOR_WHITE, "The code you entered was valid!");
  3267. PlayerInfo[playerid][pGiftCode] = 1;
  3268. GiftPlayer(MAX_PLAYERS, playerid);
  3269. }
  3270. else
  3271. {
  3272. SendClientMessageEx(playerid, COLOR_GREY, "You have already entered the gift code.");
  3273. }
  3274. }
  3275. else
  3276. {
  3277. if(PlayerInfo[playerid][pGiftTime] == 0)
  3278. {
  3279. if(PlayerInfo[playerid][pGiftCode] == 0)
  3280. {
  3281. SendClientMessageEx(playerid, COLOR_WHITE, "The code you entered was valid!");
  3282. PlayerInfo[playerid][pGiftCode] = 1;
  3283. GiftPlayer(MAX_PLAYERS, playerid);
  3284. }
  3285. else
  3286. {
  3287. SendClientMessageEx(playerid, COLOR_GREY, "You have already entered the gift code.");
  3288. }
  3289. }
  3290. else
  3291. {
  3292. SendClientMessageEx(playerid, COLOR_GREY, "You have already received a gift in the last 5 hours.");
  3293. }
  3294. }
  3295. }
  3296. else
  3297. {
  3298. SendClientMessageEx(playerid, COLOR_GREY, "You have entered a invalid gift code.");
  3299. }
  3300. }
  3301. return 1;
  3302. }
  3303. CMD:dynamicgift(playerid, params[])
  3304. {
  3305. if(PlayerInfo[playerid][pAdmin] >= 1337)
  3306. {
  3307. if(IsPlayerInAnyVehicle(playerid))
  3308. {
  3309. SendClientMessageEx(playerid, COLOR_GREY, "You must be on foot to use this command.");
  3310. return 1;
  3311. }
  3312. new string[128], Float:Position[4];
  3313. if(dynamicgift == 0)
  3314. {
  3315. GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
  3316. GetPlayerFacingAngle(playerid, Position[3]);
  3317. dynamicgift = CreateDynamicObject(19054, Position[0], Position[1], Position[2]-0.4, 0.0, 0.0, Position[3], -1, -1, -1, 200.0);
  3318. dynamicgift3DText = CreateDynamic3DTextLabel("/getgift\nTo reach inside.",COLOR_YELLOW,Position[0], Position[1], Position[2]+0.25,8.0);
  3319. SetPlayerPos(playerid, Position[0], Position[1], Position[2]+3);
  3320. format(string, sizeof(string), "AdmCmd: %s has placed the dynamic gift.", GetPlayerNameEx(playerid));
  3321. if(IsDynamicGiftBoxEnabled == true)
  3322. {
  3323. SendClientMessageEx(playerid, COLOR_RED, "Due to the Dynamic Giftbox being enabled, you may view the content inside the giftbox.");
  3324. if(PlayerInfo[playerid][pAdmin] == 99999 || PlayerInfo[playerid][pShopTech] >= 3)
  3325. {
  3326. SendClientMessageEx(playerid, COLOR_RED, "Note: You must fill up the giftbox with /dgedit.");
  3327. }
  3328. ShowPlayerDynamicGiftBox(playerid);
  3329. }
  3330. ABroadCast( COLOR_LIGHTRED, string, 1337);
  3331. }
  3332. else
  3333. {
  3334. DestroyDynamicObject(dynamicgift);
  3335. dynamicgift = 0;
  3336. DestroyDynamic3DTextLabel( Text3D:dynamicgift3DText );
  3337. format(string, sizeof(string), "AdmCmd: %s has destroyed the dynamic gift.", GetPlayerNameEx(playerid));
  3338. ABroadCast( COLOR_LIGHTRED, string, 1337);
  3339. }
  3340. }
  3341. else
  3342. {
  3343. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  3344. }
  3345. return 1;
  3346. }
  3347. CMD:nextgift(playerid, params[])
  3348. {
  3349. new string[128];
  3350. if(PlayerInfo[playerid][pGiftTime] < 1)
  3351. {
  3352. SendClientMessageEx(playerid, COLOR_YELLOW, "You're now able to receive a gift from the giftbox or the safe.");
  3353. }
  3354. else {
  3355. format(string, sizeof(string), "You will be able to receive a gift in %d minutes.", PlayerInfo[playerid][pGiftTime]);
  3356. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  3357. }
  3358. return 1;
  3359. }
  3360. CMD:getgift(playerid, params[])
  3361. {
  3362. new string[128], year, month, day;
  3363. getdate(year, month, day);
  3364. if(IsPlayerInRangeOfPoint(playerid, 3.0,2546.680908, 1403.430786, 7699.584472) || IsPlayerInRangeOfPoint(playerid, 3.0,1726.1000, 1370.1000, 1449.9000) || IsPlayerInRangeOfPoint(playerid, 3.0,1763.5000, 1432.5000, 2015.7000) || IsPlayerInRangeOfPoint(playerid, 3.0,772.4000, 1743.2000, 1938.8800))
  3365. {
  3366. if(PlayerInfo[playerid][pDonateRank] >= 1)
  3367. {
  3368. if(VIPGifts == 0 && PlayerInfo[playerid][pDonateRank] < 4)
  3369. {
  3370. SendClientMessageEx(playerid, COLOR_GRAD2, "The safe is locked!");
  3371. return 1;
  3372. }
  3373. if(PlayerInfo[playerid][pGiftTime] > 0)
  3374. {
  3375. format(string, sizeof(string),"Item: Reset Gift Timer\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[17][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[17][sItemPrice]));
  3376. ShowPlayerDialogEx( playerid, DIALOG_SHOPGIFTRESET, DIALOG_STYLE_MSGBOX, "Reset Gift Timer", string, "Purchase", "Exit" );
  3377. SendClientMessageEx(playerid, COLOR_GRAD2, "You have already received a gift in the last 5 hours!");
  3378. return 1;
  3379. }
  3380. format(string, sizeof(string), "* %s reaches inside the safe with their eyes closed.", GetPlayerNameEx(playerid));
  3381. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  3382. GiftPlayer(MAX_PLAYERS, playerid);
  3383. }
  3384. }
  3385. else if(dynamicgift != 0)
  3386. {
  3387. new Float:Position[3];
  3388. GetDynamicObjectPos(dynamicgift, Position[0], Position[1], Position[2]);
  3389. if(IsPlayerInRangeOfPoint(playerid, 5.0, Position[0], Position[1], Position[2]))
  3390. {
  3391. if(PlayerInfo[playerid][pLevel] >= 3)
  3392. {
  3393. if(PlayerInfo[playerid][pGiftTime] > 0 && (IsDynamicGiftBoxEnabled == false || (IsDynamicGiftBoxEnabled == true && !dgGoldToken)))
  3394. {
  3395. format(string, sizeof(string),"Item: Reset Gift Timer\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[17][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[17][sItemPrice]));
  3396. ShowPlayerDialogEx( playerid, DIALOG_SHOPGIFTRESET, DIALOG_STYLE_MSGBOX, "Reset Gift Timer", string, "Purchase", "Exit" );
  3397. SendClientMessageEx(playerid, COLOR_GRAD2, "You have already received a gift in the last 5 hours!");
  3398. return 1;
  3399. }
  3400. if(IsDynamicGiftBoxEnabled == true)
  3401. {
  3402. if(dgGoldToken)
  3403. {
  3404. if(!PlayerInfo[playerid][pGoldBoxTokens]) return SendClientMessageEx(playerid, COLOR_GREY, "You have no Gold Giftbox tokens!");
  3405. PlayerInfo[playerid][pGoldBoxTokens]--;
  3406. }
  3407. GiftPlayer(MAX_PLAYERS, playerid, 1);
  3408. }
  3409. else if(IsDynamicGiftBoxEnabled == false)
  3410. {
  3411. GiftPlayer(MAX_PLAYERS, playerid);
  3412. }
  3413. format(string, sizeof(string), "* %s reaches inside the bag of gifts with their eyes closed.", GetPlayerNameEx(playerid));
  3414. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  3415. }
  3416. else
  3417. {
  3418. SendClientMessageEx(playerid, COLOR_WHITE, "* You must be at least level 3 to use this, sorry!");
  3419. }
  3420. }
  3421. }
  3422. return 1;
  3423. }
  3424. // Dynamic Giftbox
  3425. CMD:dgedit(playerid, params[])
  3426. {
  3427. if(PlayerInfo[playerid][pAdmin] < 99999 && PlayerInfo[playerid][pShopTech] < 3) return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not authorized to use this command!");
  3428. new string[128], choice[32], type, amount, var;
  3429. if(strcmp(params, "autoreset", true) == 0)
  3430. {
  3431. DeletePVar(playerid, "dgInputSel");
  3432. format(string, sizeof(string), "Timer: %d min(s)\nAmount: %d\n%s", dgTimerTime, dgAmount, (dgTimer != -1)?("{FF0606}Disable"):("{00ff00}Enable"));
  3433. return ShowPlayerDialogEx(playerid, DIALOG_DGRAUTORESET, DIALOG_STYLE_LIST, "Dynamic Giftbox Auto Reset - Select to modify", string, "Select", "Close");
  3434. }
  3435. if(sscanf(params, "s[32]dD", choice, type, amount))
  3436. {
  3437. SendClientMessageEx(playerid, COLOR_GRAD1, "Usage: /dgedit [choice] [type] [value]");
  3438. SendClientMessageEx(playerid, COLOR_GRAD1, "Available Choices: Money, RimKit, Firework, 7DayGVIP, 1MonthGVIP, 7DaySVIP, 1MonthSVIP, CarSlot, ToySlot");
  3439. SendClientMessageEx(playerid, COLOR_GRAD1, "Available Choices: FullArmor, Firstaid, DDFlag, GateFlag, Credits, PriorityAd, HealthNArmor, Giftreset, Material");
  3440. SendClientMessageEx(playerid, COLOR_GRAD1, "Available Choices: Warning, Pot, Crack, PaintballToken, VIPToken, RespectPoint, CarVoucher, BuddyInvite, Laser");
  3441. SendClientMessageEx(playerid, COLOR_GRAD1, "Available Choices: CustomToy, AdmuteReset, NewbieMuteReset, RestrictedCarVoucher, PlatVIPVoucher");
  3442. SendClientMessageEx(playerid, COLOR_GRAD1, "Available Choices: AutoReset, UseGoldTokens");
  3443. return SendClientMessageEx(playerid, COLOR_RED, "Available Types: 0 = Enable/Disable | 1 = Quantity available | 2 = Quantity Given | 3 = Category");
  3444. }
  3445. if(type < 0 || type > 3)
  3446. {
  3447. SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid Type!");
  3448. return SendClientMessageEx(playerid, COLOR_RED, "Available Type: 0 = Enable/Disable | 1 = Quantity available | 2 = Quantity Given | 3 = Category");
  3449. }
  3450. if(amount < 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot choose an amount below 0!");
  3451. if(strcmp(choice, "money", true) == 0) var = dgMoney;
  3452. else if(strcmp(choice, "rimkit", true) == 0) var = dgRimKit;
  3453. else if(strcmp(choice, "firework", true) == 0) var = dgFirework;
  3454. else if(strcmp(choice, "7daygvip", true) == 0) var = dgGVIP;
  3455. else if(strcmp(choice, "1monthgvip", true) == 0) var = dgGVIPEx;
  3456. else if(strcmp(choice, "7daysvip", true) == 0) var = dgSVIPEx;
  3457. else if(strcmp(choice, "1monthsvip", true) == 0) var = dgSVIP;
  3458. else if(strcmp(choice, "carslot", true) == 0) var = dgCarSlot;
  3459. else if(strcmp(choice, "toyslot", true) == 0) var = dgToySlot;
  3460. else if(strcmp(choice, "fullarmor", true) == 0) var = dgArmor;
  3461. else if(strcmp(choice, "firstaid", true) == 0) var = dgFirstaid;
  3462. else if(strcmp(choice, "ddflag", true) == 0) var = dgDDFlag;
  3463. else if(strcmp(choice, "gateflag", true) == 0) var = dgGateFlag;
  3464. else if(strcmp(choice, "credits", true) == 0) var = dgCredits;
  3465. else if(strcmp(choice, "priorityad", true) == 0) var = dgPriorityAd;
  3466. else if(strcmp(choice, "healthnarmor", true) == 0) var = dgHealthNArmor;
  3467. else if(strcmp(choice, "giftreset", true) == 0) var = dgGiftReset;
  3468. else if(strcmp(choice, "material", true) == 0) var = dgMaterial;
  3469. else if(strcmp(choice, "warning", true) == 0) var = dgWarning;
  3470. else if(strcmp(choice, "pot", true) == 0) var = dgPot;
  3471. else if(strcmp(choice, "crack", true) == 0) var = dgCrack;
  3472. else if(strcmp(choice, "paintballtoken", true) == 0) var = dgPaintballToken;
  3473. else if(strcmp(choice, "viptoken", true) == 0) var = dgVIPToken;
  3474. else if(strcmp(choice, "respectpoint", true) == 0) var = dgRespectPoint;
  3475. else if(strcmp(choice, "carvoucher", true) == 0) var = dgCarVoucher;
  3476. else if(strcmp(choice, "buddyinvite", true) == 0) var = dgBuddyInvite;
  3477. else if(strcmp(choice, "laser", true) == 0) var = dgLaser;
  3478. else if(strcmp(choice, "customtoy", true) == 0) var = dgCustomToy;
  3479. else if(strcmp(choice, "admutereset", true) == 0) var = dgAdmuteReset;
  3480. else if(strcmp(choice, "newbiemutereset", true) == 0) var = dgNewbieMuteReset;
  3481. else if(strcmp(choice, "restrictedcarvoucher", true) == 0) var = dgRestrictedCarVoucher;
  3482. else if(strcmp(choice, "platvipvoucher", true) == 0) var = dgPlatinumVIPVoucher;
  3483. else if(strcmp(choice, "autoreset", true) == 0) return cmd_dgedit(playerid, "autoreset");
  3484. else if(strcmp(choice, "usegoldtokens", true) == 0)
  3485. {
  3486. if(dgGoldToken) dgGoldToken = 0, SendClientMessageEx(playerid, COLOR_WHITE, "You have disabled the use of a Gold Giftbox token to recieve a gift.");
  3487. else dgGoldToken = 1, SendClientMessageEx(playerid, COLOR_WHITE, "You have enabled the use of a Gold Giftbox token to recieve a gift.");
  3488. return 1;
  3489. }
  3490. else return SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid Choice!");
  3491. // Prepare the proper and approriate string
  3492. switch(type)
  3493. {
  3494. case 0:
  3495. {
  3496. // Little check to make sure they're not inserting invalid values
  3497. if(amount < 0 || amount > 1) return SendClientMessage(playerid, COLOR_RED, "0 = Disabled | 1 - Enabled");
  3498. switch(amount)
  3499. {
  3500. case 0: format(string, sizeof(string), "You have disabled the gift.");
  3501. case 1: format(string, sizeof(string), "You have enabled the gift.");
  3502. default: return true;
  3503. }
  3504. }
  3505. case 1:
  3506. {
  3507. format(string, sizeof(string), "You have set the gift quantity to %s.", number_format(amount));
  3508. }
  3509. case 2:
  3510. {
  3511. format(string, sizeof(string), "You have set the gift amount to %s.", number_format(amount));
  3512. }
  3513. case 3:
  3514. {
  3515. if(amount < 0 || amount > 3) return SendClientMessageEx(playerid, COLOR_RED, "0 = Common | 1 = Less Common | 2 = Rare | 3 = Super Rare");
  3516. switch(amount)
  3517. {
  3518. case 0: format(string, sizeof(string), "You have set the category to Common.");
  3519. case 1: format(string, sizeof(string), "You have set the category to Less Common.");
  3520. case 2: format(string, sizeof(string), "You have set the category to Rare.");
  3521. case 3: format(string, sizeof(string), "You have set the category to Super Rare.");
  3522. default: return true;
  3523. }
  3524. }
  3525. default: return true;
  3526. }
  3527. // Set the data to the variable
  3528. dgVar[dgItems:var][type] = amount;
  3529. // Save the GiftBox Stuff
  3530. SaveDynamicGiftBox();
  3531. // Send the client message
  3532. SendClientMessageEx(playerid, COLOR_WHITE, string);
  3533. return true;
  3534. }
  3535. CMD:viewgiftbox(playerid, params[])
  3536. {
  3537. if(PlayerInfo[playerid][pAdmin] == 99999 || PlayerInfo[playerid][pShopTech] >= 3)
  3538. {
  3539. ShowPlayerDynamicGiftBox(playerid);
  3540. }
  3541. else
  3542. return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not an Executive Administrator!");
  3543. return true;
  3544. }
  3545. CMD:togdynamicgift(playerid, params[])
  3546. {
  3547. if(PlayerInfo[playerid][pAdmin] == 99999 || PlayerInfo[playerid][pShopTech] >= 3)
  3548. {
  3549. if(IsDynamicGiftBoxEnabled == false)
  3550. {
  3551. IsDynamicGiftBoxEnabled = true;
  3552. SendClientMessageEx(playerid, COLOR_WHITE, "You have enabled the Dynamic GiftBox, please use /dgedit to modify the giftbox items.");
  3553. }
  3554. else if(IsDynamicGiftBoxEnabled == true)
  3555. {
  3556. IsDynamicGiftBoxEnabled = false;
  3557. SendClientMessageEx(playerid, COLOR_WHITE, "You have disabled the Dynamic Giftbox.");
  3558. }
  3559. }
  3560. else
  3561. return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not an Executive Administrator!");
  3562. return true;
  3563. }
  3564. CMD:giftbox(playerid, params[])
  3565. {
  3566. if(dynamicgift != 0)
  3567. {
  3568. new Float: pos[3];
  3569. SendClientMessageEx(playerid, COLOR_YELLOW, "** There is currently a giftbox placed down and we have set a checkpoint to the location of the giftbox.");
  3570. if(CheckPointCheck(playerid)) cmd_killcheckpoint(playerid, params); //If they have a checkpoint, just remove it
  3571. DisablePlayerCheckpoint(playerid);
  3572. GetDynamicObjectPos(dynamicgift, pos[0], pos[1], pos[2]);
  3573. SetPlayerCheckpoint(playerid, pos[0], pos[1], pos[2], 5);
  3574. SetPVarInt(playerid, "GiftBoxCP", 1);
  3575. }
  3576. else
  3577. {
  3578. SendClientMessageEx(playerid, COLOR_YELLOW, "** There is currently no giftbox placed down.");
  3579. }
  3580. return true;
  3581. }