OnDialogResponse.pwn 629 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. //-------------------------[OnDialogResponse.PWN]--------------------------------
  11. * Copyright (c) 2016, Next Generation Gaming, LLC
  12. *
  13. * All rights reserved.
  14. *
  15. * Redistribution and use in source and binary forms, with or without modification,
  16. * are not permitted in any case.
  17. *
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  22. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  23. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  24. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  25. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  26. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  27. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  28. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  29. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. // This is the first hooked OnDialogResponse. It's used to check dialog spoofing.
  32. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  33. if(dialogid != iLastDialogID[playerid]) {
  34. if(dialogid != DIALOG_FS_ELEVATOR1 && dialogid != DIALOG_FS_ELEVATOR2) { // For dialogs called from filterscripts.
  35. if(PlayerInfo[playerid][pAdmin] == 99999 || dialogid == 32700) return 1;
  36. SendClientMessageEx(playerid, COLOR_LIGHTRED, "[SYSTEM] Please delete your dialog CLEO.");
  37. SetTimerEx("KickEx", 1000, 0, "i", playerid);
  38. }
  39. }
  40. iLastDialogID[playerid] = -1;
  41. return 0;
  42. }
  43. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  44. if(arrAntiCheat[playerid][ac_iFlags][AC_DIALOGSPOOFING] > 0) return 1;
  45. if(dialogid == DIALOG_DISABLED) return ShowPlayerDialogEx(playerid, DIALOG_DISABLED, DIALOG_STYLE_MSGBOX, "Account Disabled - Visit http://www.laco-rp.com", "Your account has been disabled as it has been inactive for more than six months.\nPlease visit the forums and post an Administrative Request to begin the process to reactivate your account.", "Okay", "");
  46. new sendername[MAX_PLAYER_NAME];
  47. new string[256];
  48. szMiscArray[0] = 0;
  49. // Crash Bug Fix
  50. if(strfind(inputtext, "%", true) != -1)
  51. {
  52. if(dialogid == MAINMENU) ShowMainMenuDialog(playerid, 1);
  53. if(dialogid == MAINMENU2) ShowMainMenuDialog(playerid, 2);
  54. if(dialogid == DIALOG_CHANGEPASS2) ShowLoginDialogs(playerid, 0);
  55. SendClientMessage(playerid, COLOR_GREY, "Invalid Character, please try again.");
  56. return 1;
  57. }
  58. if(strfind(inputtext, "UPDATE", true) != -1 || strfind(inputtext, "SELECT", true) != -1 || strfind(inputtext, "DROP", true) != -1 || strfind(inputtext, "INSERT", true) != -1 || strfind(inputtext, "SLEEP", true) != -1)
  59. {
  60. new logstirng[400];
  61. format(logstirng, sizeof(logstirng), "%s | Dialog ID: %d | SQL ID: %d", inputtext, dialogid, PlayerInfo[playerid][pId]);
  62. Log("logs/fquery.log", logstirng);
  63. }
  64. if(RegistrationStep[playerid] != 0)
  65. {
  66. if(dialogid == REGISTERSEX)
  67. {
  68. if(response)
  69. {
  70. if(listitem == 0)
  71. {
  72. PlayerInfo[playerid][pSex] = 1;
  73. SendClientMessageEx(playerid, COLOR_YELLOW2, "Alright, so you're a male.");
  74. ShowPlayerDialogEx(playerid, REGISTERMONTH, DIALOG_STYLE_LIST, "{FF0000}Which month was your character born?", "January\nFebruary\nMarch\nApril\nMay\nJune\nJuly\nAugust\nSeptember\nOctober\nNovember\nDecember", "Submit", "");
  75. RegistrationStep[playerid] = 2;
  76. }
  77. else
  78. {
  79. PlayerInfo[playerid][pSex] = 2;
  80. SendClientMessageEx(playerid, COLOR_YELLOW2, "Alright, so you're a female.");
  81. ShowPlayerDialogEx(playerid, REGISTERMONTH, DIALOG_STYLE_LIST, "{FF0000}Which month was your character born?", "January\nFebruary\nMarch\nApril\nMay\nJune\nJuly\nAugust\nSeptember\nOctober\nNovember\nDecember", "Submit", "");
  82. RegistrationStep[playerid] = 2;
  83. }
  84. }
  85. else ShowPlayerDialogEx(playerid, REGISTERSEX, DIALOG_STYLE_LIST, "{FF0000}Is your character male or female?", "Male\nFemale", "Submit", "");
  86. }
  87. }
  88. if(RegistrationStep[playerid] != 0 || strcmp(PlayerInfo[playerid][pBirthDate], "0000-00-00", true) == 0)
  89. {
  90. if(dialogid == REGISTERMONTH)
  91. {
  92. if(response)
  93. {
  94. new month = listitem+1;
  95. SetPVarInt(playerid, "RegisterMonth", month);
  96. new lastdate, stringdiag[410];
  97. if(listitem == 0 || listitem == 2 || listitem == 4 || listitem == 6 || listitem == 7 || listitem == 9 || listitem == 11) lastdate = 32;
  98. else if(listitem == 3 || listitem == 5 || listitem == 8 || listitem == 10) lastdate = 31;
  99. else lastdate = 29;
  100. for(new x = 1; x < lastdate; x++)
  101. {
  102. format(stringdiag, sizeof(stringdiag), "%s%d\n", stringdiag, x);
  103. }
  104. ShowPlayerDialogEx(playerid, REGISTERDAY, DIALOG_STYLE_LIST, "{FF0000}Which day was your character born?", stringdiag, "Submit", "");
  105. }
  106. else ShowPlayerDialogEx(playerid, REGISTERMONTH, DIALOG_STYLE_LIST, "{FF0000}Which month was your character born?", "January\nFebruary\nMarch\nApril\nMay\nJune\nJuly\nAugust\nSeptember\nOctober\nNovember\nDecember", "Submit", "");
  107. }
  108. else if(dialogid == REGISTERDAY)
  109. {
  110. if(response)
  111. {
  112. new setday = listitem+1;
  113. SetPVarInt(playerid, "RegisterDay", setday);
  114. new month, day, year, stringdiag[600];
  115. getdate(year,month,day);
  116. new startyear = year-100;
  117. for(new x = startyear; x < year; x++)
  118. {
  119. format(stringdiag, sizeof(stringdiag), "%s%d\n", stringdiag, x);
  120. }
  121. ShowPlayerDialogEx(playerid, REGISTERYEAR, DIALOG_STYLE_LIST, "{FF0000}Which year was your character born?", stringdiag, "Submit", "");
  122. }
  123. else ShowPlayerDialogEx(playerid, REGISTERMONTH, DIALOG_STYLE_LIST, "{FF0000}Which month was your character born?", "January\nFebruary\nMarch\nApril\nMay\nJune\nJuly\nAugust\nSeptember\nOctober\nNovember\nDecember", "Submit", "");
  124. }
  125. else if(dialogid == REGISTERYEAR)
  126. {
  127. new month, day, year, stringdiag[600];
  128. getdate(year,month,day);
  129. new startyear = year-100;
  130. if(response)
  131. {
  132. new setyear = listitem+startyear;
  133. format(PlayerInfo[playerid][pBirthDate], 11, "%d-%02d-%02d", setyear, GetPVarInt(playerid, "RegisterMonth"), GetPVarInt(playerid, "RegisterDay"));
  134. DeletePVar(playerid, "RegisterMonth");
  135. DeletePVar(playerid, "RegisterDay");
  136. if(RegistrationStep[playerid] != 0)
  137. {
  138. ShowPlayerDialogEx(playerid, REGISTERREF, DIALOG_STYLE_INPUT, "{FF0000}Next Generation Roleplay Referral System", "Have you been referred to our server by one of our players?\nIf so, please enter the player name below.\n\nIf you haven't been referred by anyone, you may press the skip button.\n\n{FF0000}Note: You must enter the player name with a underscore (Example: FirstName_LastName)", "Enter", "Skip");
  139. }
  140. else return SendClientMessageEx(playerid, COLOR_LIGHTRED, "Your birthdate has been successfully set.");
  141. }
  142. else
  143. {
  144. for(new x = startyear; x < year; x++)
  145. {
  146. format(stringdiag, sizeof(stringdiag), "%s%d\n", stringdiag, x);
  147. }
  148. ShowPlayerDialogEx(playerid, REGISTERYEAR, DIALOG_STYLE_LIST, "{FF0000}Which year was your character born?", stringdiag, "Submit", "");
  149. }
  150. }
  151. else if(dialogid == REGISTERREF)
  152. {
  153. if(response)
  154. {
  155. if(IsNumeric(inputtext))
  156. {
  157. ShowPlayerDialogEx(playerid, REGISTERREF, DIALOG_STYLE_INPUT, "{FF0000}Error - Invalid Roleplay Name", "That is not a roleplay name\nPlease enter a proper roleplay name.\n\nExample: FirstName_LastName", "Enter", "Skip");
  158. return 1;
  159. }
  160. if(strfind(inputtext, "_", true) == -1)
  161. {
  162. ShowPlayerDialogEx(playerid, REGISTERREF, DIALOG_STYLE_INPUT, "{FF0000}Error - Invalid Roleplay Name", "That is not a roleplay name\nPlease enter a proper roleplay name.\n\nExample: FirstName_LastName", "Enter", "Skip");
  163. return 1;
  164. }
  165. if(strlen(inputtext) > 20)
  166. {
  167. ShowPlayerDialogEx(playerid, REGISTERREF, DIALOG_STYLE_INPUT, "{FF0000}Error - Invalid Roleplay Name", "That name is too long\nPlease shorten the name.\n\nExample: FirstName_LastName (20 Characters Max)", "Enter", "Skip");
  168. return 1;
  169. }
  170. if(strcmp(inputtext, GetPlayerNameExt(playerid), true) == 0)
  171. {
  172. ShowPlayerDialogEx(playerid, REGISTERREF, DIALOG_STYLE_INPUT, "{FF0000}Error", "You can't add yourself as a referrer.\nPlease enter the referrer name or press 'Skip'.\n\nExample: FirstName_LastName (20 Characters Max)", "Enter", "Skip");
  173. return 1;
  174. }
  175. for(new sz = 0; sz < strlen(inputtext); sz++)
  176. {
  177. if(inputtext[sz] == ' ')
  178. {
  179. ShowPlayerDialogEx(playerid, REGISTERREF, DIALOG_STYLE_INPUT, "{FF0000}Error - Invalid Roleplay Name", "That is not a roleplay name\nPlease enter a proper roleplay name.\n\nExample: FirstName_LastName", "Enter", "Skip");
  180. return 1;
  181. }
  182. }
  183. new
  184. szQuery[128], szEscape[MAX_PLAYER_NAME];
  185. mysql_escape_string(inputtext, szEscape);
  186. format(PlayerInfo[playerid][pReferredBy], MAX_PLAYER_NAME, "%s", szEscape);
  187. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "SELECT `Username` FROM `accounts` WHERE `Username` = '%s'", szEscape);
  188. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "iii", MAIN_REFERRAL_THREAD, playerid, g_arrQueryHandle{playerid});
  189. }
  190. else {
  191. PlayerInfo[playerid][pTut]++;
  192. AdvanceTutorial(playerid);
  193. format(string, sizeof(string), "Nobody");
  194. strmid(PlayerInfo[playerid][pReferredBy], string, 0, strlen(string), MAX_PLAYER_NAME);
  195. SendClientMessageEx(playerid, COLOR_LIGHTRED, "Thanks for filling in all the information, now you can proceed to the tutorial!");
  196. //Tutorial_Start(playerid);
  197. RegistrationStep[playerid] = 3;
  198. SetPlayerVirtualWorld(playerid, 0);
  199. ClearChatbox(playerid);
  200. TutStep[playerid] = 1;
  201. //ShowTutGUIBox(playerid);
  202. if(fexist("NoTutorial.h"))
  203. {
  204. //ShowTutGUIFrame(playerid, 23);
  205. //TutStep[playerid] = 23;
  206. }
  207. /*else
  208. {
  209. ShowTutGUIFrame(playerid, 1);
  210. TutStep[playerid] = 1;
  211. }*/
  212. Streamer_UpdateEx(playerid, 1607.0160,-1510.8218,207.4438);
  213. SetPlayerPos(playerid, 1607.0160,-1510.8218,-10.0);
  214. SetPlayerCameraPos(playerid, 1850.1813,-1765.7552,81.9271);
  215. SetPlayerCameraLookAt(playerid, 1607.0160,-1510.8218,207.4438);
  216. }
  217. }
  218. }
  219. switch(dialogid)
  220. {
  221. case DIALOG_911PICKLOCK: if(response)
  222. {
  223. new Float: carPos[3];
  224. if(PlayerVehicleInfo[playerid][listitem][pvId] > INVALID_PLAYER_VEHICLE_ID) {
  225. if(PlayerVehicleInfo[playerid][listitem][pvAlarmTriggered]) {
  226. GetVehiclePos(PlayerVehicleInfo[playerid][listitem][pvId], carPos[0], carPos[1], carPos[2]);
  227. new zone[MAX_ZONE_NAME], mainzone[MAX_ZONE_NAME];
  228. Get3DZone(carPos[0], carPos[1], carPos[2], zone, sizeof(zone));
  229. Get2DMainZone(carPos[0], carPos[1], mainzone, sizeof(mainzone));
  230. format(string, sizeof(string), "Your vehicle is located in %s(%s).", zone, mainzone);
  231. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  232. format(string, sizeof(string), "Suspected Vehicle Burglary, %s(%d)", GetVehicleName(PlayerVehicleInfo[playerid][listitem][pvId]), PlayerVehicleInfo[playerid][listitem][pvId]);
  233. SendCallToQueue(playerid, string, zone, mainzone, 4, PlayerVehicleInfo[playerid][listitem][pvId]);
  234. SetPVarInt(playerid, "Has911Call", 1);
  235. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Dispatch: We have alerted all units in the area.");
  236. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Thank you for reporting this incident");
  237. }
  238. else {
  239. SetPVarInt(playerid, "ConfirmReport", listitem);
  240. ShowPlayerDialogEx(playerid, DIALOG_911PICKLOCK2, DIALOG_STYLE_MSGBOX, "{FFFB00}Warning - Confirmation Required", "Are you sure you want to report this Vehicle Burglary?\nYour alarm has not yet been triggered for this vehicle.\nPlease have in mind that it is a Vehicle Burglary {FF8400}In Progress", "Confirm", "Cancel");
  241. }
  242. }
  243. else if(PlayerVehicleInfo[playerid][listitem][pvImpounded]) SendClientMessageEx(playerid, COLOR_WHITE, "You can not report an impounded vehicle. If you wish to reclaim it, do so at the DMV in Dillimore.");
  244. else if(PlayerVehicleInfo[playerid][listitem][pvDisabled] == 1) SendClientMessageEx(playerid, COLOR_WHITE, "You can not report a disabled vehicle. It is disabled due to your VIP level (vehicle restrictions).");
  245. else if(PlayerVehicleInfo[playerid][listitem][pvSpawned] == 0) SendClientMessageEx(playerid, COLOR_WHITE, "You can not report a stored vehicle. Use /vstorage to spawn it.");
  246. else SendClientMessageEx(playerid, COLOR_WHITE, "You can not track a non-existent vehicle.");
  247. }
  248. case DIALOG_911PICKLOCK2: {
  249. if(response) {
  250. new Float: carPos[3];
  251. GetVehiclePos(PlayerVehicleInfo[playerid][listitem][pvId], carPos[0], carPos[1], carPos[2]);
  252. new zone[MAX_ZONE_NAME], mainzone[MAX_ZONE_NAME];
  253. Get3DZone(carPos[0], carPos[1], carPos[2], zone, sizeof(zone));
  254. Get2DMainZone(carPos[0], carPos[1], mainzone, sizeof(mainzone));
  255. format(string, sizeof(string), "Your vehicle is located in %s(%s).", zone, mainzone);
  256. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  257. format(string, sizeof(string), "Suspected Vehicle Burglary, %s(%d)", GetVehicleName(PlayerVehicleInfo[playerid][listitem][pvId]), PlayerVehicleInfo[playerid][listitem][pvId]);
  258. SendCallToQueue(playerid, string, zone, mainzone, 4, PlayerVehicleInfo[playerid][listitem][pvId]);
  259. SetPVarInt(playerid, "Has911Call", 1);
  260. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Dispatch: We have alerted all units in the area.");
  261. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Thank you for reporting this incident");
  262. }
  263. DeletePVar(playerid, "ConfirmReport");
  264. }
  265. case DIALOG_NATION_CHECK:
  266. {
  267. if(response) {
  268. PlayerInfo[playerid][pNation] = listitem;
  269. switch(listitem) {
  270. case 0: SendClientMessageEx(playerid, COLOR_GRAD1, "You are now a citizen of San Andreas.");
  271. case 1: SendClientMessageEx(playerid, COLOR_GRAD1, "You are now a citizen of New Robada.");
  272. }
  273. }
  274. else
  275. {
  276. SendClientMessageEx(playerid, COLOR_GRAD1, "You did not provide a response, picking a random nation for you...");
  277. new rand = random(2);
  278. PlayerInfo[playerid][pNation] = rand;
  279. switch(rand) {
  280. case 0: SendClientMessageEx(playerid, COLOR_GRAD1, "You are now a citizen of San Andreas.");
  281. case 1: SendClientMessageEx(playerid, COLOR_GRAD1, "You are now a citizen of New Robada.");
  282. }
  283. }
  284. }
  285. case BIGEARS3:
  286. {
  287. if(response) {
  288. new group = ListItemTrackId[playerid][listitem];
  289. if (arrGroupData[group][g_iGroupType] == GROUP_TYPE_CONTRACT && PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1)
  290. {
  291. SendClientMessage(playerid, COLOR_WHITE, "Only Senior Admins+ are allowed to use this feature.");
  292. return 1;
  293. }
  294. SetPVarInt(playerid, "BigEar", 5);
  295. SetPVarInt(playerid, "BigEarOOCGroup", group);
  296. }
  297. else ShowPlayerDialogEx(playerid, BIGEARS, DIALOG_STYLE_LIST, "Please choose an item to proceed", "Global Chat\nOOC Chat\nIC Chat\nFaction Chat\nGroup OOC Chat\nPlayer\nPrivate Messages\nDisable Bigears", "Select", "Cancel");
  298. }
  299. case BIGEARS: if(response) switch(listitem) {
  300. case 0: {
  301. SetPVarInt(playerid, "BigEar", 1);
  302. SendClientMessage(playerid, COLOR_WHITE, "You have selected the Global Chat, you can now see all the messages server-wide.");
  303. }
  304. case 1: {
  305. SetPVarInt(playerid, "BigEar", 2);
  306. SendClientMessage(playerid, COLOR_WHITE, "You have selected the OOC Chat, you can now see all the OOC(/b) messages server-wide.");
  307. }
  308. case 2: {
  309. SetPVarInt(playerid, "BigEar", 3);
  310. SendClientMessage(playerid, COLOR_WHITE, "You have selected the IC Chat, you can now see all the IC(Includes /me's & /do's) messages server-wide.");
  311. }
  312. case 3: {
  313. Group_ListGroups(playerid, BIGEARS2);
  314. }
  315. case 4: {
  316. Group_ListGroups(playerid, BIGEARS3);
  317. }
  318. case 5: {
  319. ShowPlayerDialogEx(playerid, BIGEARS4, DIALOG_STYLE_INPUT, "{3399FF}Big Ears Player", "Please type in the name or the Id of the person you want to use the Big Ears function", "Select", "Back");
  320. }
  321. case 6: {
  322. ShowPlayerDialogEx(playerid, BIGEARS5, DIALOG_STYLE_INPUT, "{3399FF}Big Ears | Private Messages", "Please type in the name or the Id of the person you want to use the Big Ears function", "Select", "Back");
  323. }
  324. case 7: {
  325. DeletePVar(playerid, "BigEar");
  326. DeletePVar(playerid, "BigEarGroup");
  327. DeletePVar(playerid, "BigEarPlayer");
  328. DeletePVar(playerid, "BigEarOOCGroup");
  329. DeletePVar(playerid, "BigEarPM");
  330. DeletePVar(playerid, "BigEarPlayerPM");
  331. rBigEarT[playerid] = 0;
  332. SendClientMessage(playerid, COLOR_WHITE, "You have disabled the bigears feature, you no longer see anything on your screen.");
  333. }
  334. }
  335. case BIGEARS4: {
  336. if(response) {
  337. new giveplayerid;
  338. if(sscanf(inputtext, "u", giveplayerid) || PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin]) {
  339. ShowPlayerDialogEx(playerid, BIGEARS4, DIALOG_STYLE_INPUT, "{3399FF}Big Ears Player", "Error - Please type in the name or the Id of the person you want to use the Big Ears function", "Select", "Back");
  340. return 1;
  341. }
  342. SetPVarInt(playerid, "BigEar", 6);
  343. SetPVarInt(playerid, "BigEarPlayer", giveplayerid);
  344. SendClientMessageEx(playerid, COLOR_WHITE, "You can now see all the messages from this player.");
  345. }
  346. else ShowPlayerDialogEx(playerid, BIGEARS, DIALOG_STYLE_LIST, "Please choose an item to proceed", "Global Chat\nOOC Chat\nIC Chat\nFaction Chat\nGroup OOC Chat\nPlayer\nPrivate Messages\nDisable Bigears", "Select", "Cancel");
  347. }
  348. case BIGEARS5: {
  349. if(response) {
  350. new giveplayerid, szString[128];
  351. if(sscanf(inputtext, "u", giveplayerid) || PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin]) {
  352. ShowPlayerDialogEx(playerid, BIGEARS5, DIALOG_STYLE_INPUT, "{3399FF}Big Ears | Private Messages", "Error - Please type in the name or the Id of the person you want to use the Big Ears function", "Select", "Back");
  353. return 1;
  354. }
  355. SetPVarInt(playerid, "BigEarPM", 1);
  356. SetPVarInt(playerid, "BigEarPlayerPM", giveplayerid);
  357. format(szString, sizeof(szString), "You will now receive all private messages from %s", GetPlayerNameEx(giveplayerid));
  358. SendClientMessageEx(playerid, COLOR_WHITE, szString);
  359. }
  360. else ShowPlayerDialogEx(playerid, BIGEARS, DIALOG_STYLE_LIST, "Please choose an item to proceed", "Global Chat\nOOC Chat\nIC Chat\nFaction Chat\nGroup OOC Chat\nPlayer\nPrivate Messages\nDisable Bigears", "Select", "Cancel");
  361. }
  362. case BIGEARS2: {
  363. if(response) {
  364. new group = ListItemTrackId[playerid][listitem];
  365. if (arrGroupData[group][g_iGroupType] == GROUP_TYPE_CONTRACT && PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1)
  366. {
  367. SendClientMessage(playerid, COLOR_WHITE, "Only Senior Admins+ are allowed to use this feature.");
  368. return 1;
  369. }
  370. SetPVarInt(playerid, "BigEar", 4);
  371. SetPVarInt(playerid, "BigEarGroup", group);
  372. }
  373. else ShowPlayerDialogEx(playerid, BIGEARS, DIALOG_STYLE_LIST, "Please choose an item to proceed", "Global Chat\nOOC Chat\nIC Chat\nFaction Chat\nGroup OOC Chat\nPlayer\nPrivate Messages\nDisable Bigears", "Select", "Cancel");
  374. }
  375. case DIALOG_DELETECAR:
  376. {
  377. if(response)
  378. {
  379. if(GetPVarType(playerid, "vDel")) {
  380. new
  381. i = GetPVarInt(playerid, "vDel");
  382. if(PlayerVehicleInfo[playerid][i][pvId] != INVALID_PLAYER_VEHICLE_ID && !PlayerVehicleInfo[playerid][i][pvImpounded] && PlayerVehicleInfo[playerid][i][pvSpawned]) {
  383. switch(PlayerVehicleInfo[playerid][i][pvModelId]) {
  384. case 519, 553, 508: {
  385. if(IsValidDynamicArea(iVehEnterAreaID[PlayerVehicleInfo[playerid][i][pvId]])) DestroyDynamicArea(iVehEnterAreaID[PlayerVehicleInfo[playerid][i][pvId]]);
  386. }
  387. }
  388. DestroyVehicle(PlayerVehicleInfo[playerid][i][pvId]);
  389. --PlayerCars;
  390. VehicleSpawned[playerid]--;
  391. }
  392. if(PlayerVehicleInfo[playerid][i][pvTicket] != 0)
  393. {
  394. GivePlayerCash(playerid, -PlayerVehicleInfo[playerid][i][pvTicket]);
  395. OnPlayerStatsUpdate(playerid);
  396. format(string, sizeof(string), "Your vehicle had active tickets on it. You have been charged the amount of the tickets ($%s).", number_format(PlayerVehicleInfo[playerid][i][pvTicket]));
  397. SendClientMessageEx(playerid, COLOR_WHITE, string);
  398. }
  399. format(szMiscArray, sizeof(szMiscArray), "[DELETECAR] %s (IP: %s) (SQLID: %d) has deleted their %s (%d) (SQLID: %d).", GetPlayerNameEx(playerid), GetPlayerIpEx(playerid), GetPlayerSQLId(playerid), VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400], PlayerVehicleInfo[playerid][i][pvModelId], PlayerVehicleInfo[playerid][i][pvSlotId]);
  400. Log("logs/playervehicle.log", szMiscArray);
  401. PlayerVehicleInfo[playerid][i][pvId] = 0;
  402. PlayerVehicleInfo[playerid][i][pvModelId] = 0;
  403. PlayerVehicleInfo[playerid][i][pvPosX] = 0.0;
  404. PlayerVehicleInfo[playerid][i][pvPosY] = 0.0;
  405. PlayerVehicleInfo[playerid][i][pvPosZ] = 0.0;
  406. PlayerVehicleInfo[playerid][i][pvPosAngle] = 0.0;
  407. PlayerVehicleInfo[playerid][i][pvLock] = 0;
  408. PlayerVehicleInfo[playerid][i][pvLocksLeft] = 0;
  409. PlayerVehicleInfo[playerid][i][pvLocked] = 0;
  410. PlayerVehicleInfo[playerid][i][pvPaintJob] = -1;
  411. PlayerVehicleInfo[playerid][i][pvColor1] = 0;
  412. PlayerVehicleInfo[playerid][i][pvColor2] = 0;
  413. PlayerVehicleInfo[playerid][i][pvPrice] = 0;
  414. PlayerVehicleInfo[playerid][i][pvTicket] = 0;
  415. for(new j = 0; j < 3; j++)
  416. {
  417. PlayerVehicleInfo[playerid][i][pvWeapons][j] = 0;
  418. }
  419. PlayerVehicleInfo[playerid][i][pvImpounded] = 0;
  420. PlayerVehicleInfo[playerid][i][pvSpawned] = 0;
  421. PlayerVehicleInfo[playerid][i][pvVW] = 0;
  422. PlayerVehicleInfo[playerid][i][pvInt] = 0;
  423. PlayerVehicleInfo[playerid][i][pvAlarm] = 0;
  424. PlayerVehicleInfo[playerid][i][pvAlarmTriggered] = 0;
  425. PlayerVehicleInfo[playerid][i][pvBeingPickLocked] = 0;
  426. if(PlayerVehicleInfo[playerid][i][pvAllowedPlayerId] != INVALID_PLAYER_ID)
  427. {
  428. PlayerInfo[PlayerVehicleInfo[playerid][i][pvAllowedPlayerId]][pVehicleKeys] = INVALID_PLAYER_VEHICLE_ID;
  429. PlayerInfo[PlayerVehicleInfo[playerid][i][pvAllowedPlayerId]][pVehicleKeysFrom] = INVALID_PLAYER_ID;
  430. PlayerVehicleInfo[playerid][i][pvAllowedPlayerId] = INVALID_PLAYER_ID;
  431. }
  432. GiveKeysTo[playerid] = INVALID_PLAYER_ID;
  433. DeletePVar(playerid, "vDel");
  434. new query[128];
  435. mysql_format(MainPipeline, query, sizeof(query), "DELETE FROM `vehicles` WHERE `id` = '%d'", PlayerVehicleInfo[playerid][i][pvSlotId]);
  436. mysql_tquery(MainPipeline, query, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
  437. PlayerVehicleInfo[playerid][i][pvSlotId] = 0;
  438. return SendClientMessageEx(playerid, COLOR_WHITE, "Your vehicle has been permanently deleted.");
  439. }
  440. new
  441. szDialogStr[256];
  442. SetPVarInt(playerid, "vDel", listitem);
  443. if(PlayerVehicleInfo[playerid][listitem][pvTicket] != 0) format(szDialogStr, sizeof(szDialogStr), "{FFFFFF}Your {FF0000}%s{FFFFFF} will be {FF0000}permanently deleted{FFFFFF}.\n\n{FF0000}This vehicle currently has active tickets.\n{FFFFFF}You will be fined {FF0000}$%s{FFFFFF} upon vehicle deletion.\n\nYou may now confirm or cancel the deletion.", VehicleName[PlayerVehicleInfo[playerid][listitem][pvModelId] - 400], number_format(PlayerVehicleInfo[playerid][listitem][pvTicket]));
  444. else format(szDialogStr, sizeof(szDialogStr), "{FFFFFF}Your {FF0000}%s{FFFFFF} will be {FF0000}permanently deleted{FFFFFF}.\n\nYou may now confirm or cancel the deletion.", VehicleName[PlayerVehicleInfo[playerid][listitem][pvModelId] - 400]);
  445. return ShowPlayerDialogEx(playerid, DIALOG_DELETECAR, DIALOG_STYLE_MSGBOX, "Delete Vehicle", szDialogStr, "Delete", "Cancel");
  446. }
  447. else return DeletePVar(playerid, "vDel");
  448. }
  449. }
  450. if(dialogid == RCPINTRO)
  451. {
  452. if (response)
  453. {
  454. new msgstring[218];
  455. format(msgstring,sizeof(msgstring),"\tThere are stages you follow in order to make a checkpoint;\n1.- Adjusting the position of the checkpoint.\n2.- Confirm the position of the checkpoint.\n3.- Set the checkpoint size.\n4.- Set the checkpoint type.");
  456. ShowPlayerDialogEx(playerid,RCPINTRO2,DIALOG_STYLE_MSGBOX,"Race Checkpoints Introduction",msgstring,"Start","Cancel");
  457. }
  458. else
  459. {
  460. format(string,sizeof(string),"Create a checkpoint...\nEdit an existing checkpoint\nRemove checkpoint preview");
  461. ShowPlayerDialogEx(playerid,RCPCHOOSE,DIALOG_STYLE_LIST,"Race Checkpoints Configuration",string,"Okay","I'm done!");
  462. ConfigEventCPId[playerid] = 0;
  463. ConfigEventCPs[playerid][1] = 0;
  464. }
  465. }
  466. if(dialogid == RCPINTRO2)
  467. {
  468. if (response)
  469. {
  470. format(string,sizeof(string),"Create a checkpoint...\nEdit an existing checkpoint\nRemove checkpoint preview");
  471. ShowPlayerDialogEx(playerid,RCPCHOOSE,DIALOG_STYLE_LIST,"Race Checkpoints Configuration",string,"Okay","I'm done!");
  472. ConfigEventCPId[playerid] = 0;
  473. ConfigEventCPs[playerid][1] = 0;
  474. }
  475. }
  476. if(dialogid == RCPCHOOSE)
  477. {
  478. if (response && ConfigEventCPs[playerid][0] == 1)
  479. {
  480. if(listitem == 0) // Create a checkpoint
  481. {
  482. if(ConfigEventCPs[playerid][1] != 0) return SendClientMessageEx(playerid, COLOR_RED, "ERROR: You cannot create a new checkpoint since you are editing an existing one.");
  483. if(ConfigEventCPId[playerid] >= 20) {
  484. ConfigEventCPs[playerid][0] = 0;
  485. ConfigEventCPs[playerid][1] = 0;
  486. ConfigEventCPId[playerid] = 0;
  487. return SendClientMessageEx(playerid, COLOR_RED, "ERROR: You cannot create a new checkpoint since you have reached the checkpoint limit(20).");
  488. }
  489. new i;
  490. for(i = 0; i < 20; i++)
  491. {
  492. if(EventRCPU[i] == 0) break;
  493. }
  494. if(i >= 20) {
  495. ConfigEventCPs[playerid][0] = 0;
  496. ConfigEventCPs[playerid][1] = 0;
  497. ConfigEventCPId[playerid] = 0;
  498. return SendClientMessageEx(playerid, COLOR_RED, "ERROR: You cannot create a new checkpoint since you have reached the checkpoint limit(20).");
  499. }
  500. ConfigEventCPId[playerid] = i;
  501. ConfigEventCPs[playerid][1] = 1;
  502. ConfigEventCPs[playerid][2] = 1;
  503. SendClientMessageEx(playerid, COLOR_WHITE, "You are now creating a new checkpoint, you need to choose the position where the checkpoint will be at.");
  504. SendClientMessageEx(playerid, COLOR_YELLOW, "NOTE: Once you are done and have the right place please press the fire button to save the position.");
  505. SendClientMessageEx(playerid, COLOR_YELLOW, "NOTE: You can also cancel this action by pressing the AIM button.");
  506. }
  507. else if(listitem == 1) // Edit an existing checkpoint IN PROCESS
  508. {
  509. if(ConfigEventCPs[playerid][1] != 0) return SendClientMessageEx(playerid, COLOR_RED, "ERROR: You cannot edit a checkpoint since you are editing an existing one.");
  510. new bigstring[798], totalrcps;
  511. for(new i = 0; i < 20; i++)
  512. {
  513. if(EventRCPU[i] > 0) {
  514. switch(EventRCPT[i]) {
  515. case 1:
  516. {
  517. format(bigstring, sizeof(bigstring), "%s(RCPID:%i) Start Checkpoint", bigstring, i+1);
  518. format(bigstring, sizeof(bigstring), "%s\n", bigstring);
  519. }
  520. case 2:
  521. {
  522. format(bigstring, sizeof(bigstring), "%s(RCPID:%i) Normal Checkpoint", bigstring, i+1);
  523. format(bigstring, sizeof(bigstring), "%s\n", bigstring);
  524. }
  525. case 3:
  526. {
  527. format(bigstring, sizeof(bigstring), "%s(RCPID:%i) Watering Station Checkpoint", bigstring, i+1);
  528. format(bigstring, sizeof(bigstring), "%s\n", bigstring);
  529. }
  530. case 4:
  531. {
  532. format(bigstring, sizeof(bigstring), "%s(RCPID:%i) Finish Checkpoint", bigstring, i+1);
  533. format(bigstring, sizeof(bigstring), "%s\n", bigstring);
  534. }
  535. default:
  536. {
  537. format(bigstring, sizeof(bigstring), "%s(RCPID:%i) No Checkpoint type", bigstring, i+1);
  538. format(bigstring, sizeof(bigstring), "%s\n", bigstring);
  539. }
  540. }
  541. ListItemRCPId[playerid][totalrcps] = i;
  542. totalrcps++;
  543. }
  544. }
  545. if(totalrcps == 0) return SendClientMessageEx(playerid, COLOR_RED, "ERROR: No checkpoints have been created.");
  546. ShowPlayerDialogEx(playerid, RCPEDITMENU, DIALOG_STYLE_LIST,"Please choose a checkpoint to edit:", bigstring, "Edit", "Cancel");
  547. }
  548. else if(listitem == 2) // Remove view of checkpoint
  549. {
  550. DisablePlayerCheckpoint(playerid);
  551. SendClientMessageEx(playerid, COLOR_WHITE, "You have disabled your race checkpoints.");
  552. }
  553. }
  554. }
  555. if(dialogid == RCPEDITMENU)
  556. {
  557. ConfigEventCPs[playerid][2] = 0;
  558. ConfigEventCPId[playerid] = ListItemRCPId[playerid][listitem];
  559. ConfigEventCPs[playerid][1] = 0;
  560. DisablePlayerCheckpoint(playerid);
  561. if(EventRCPT[ConfigEventCPId[playerid]] == 1) {
  562. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  563. }
  564. else if(EventRCPT[ConfigEventCPId[playerid]] == 4) {
  565. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  566. }
  567. else {
  568. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  569. }
  570. format(string,sizeof(string),"Checkpoint Edit(ID:%d)", ConfigEventCPId[playerid]);
  571. ShowPlayerDialogEx(playerid,RCPEDITMENU2,DIALOG_STYLE_LIST,string,"Edit position\nEdit size\nEdit type\nView checkpoint","Okay","I'm done!");
  572. }
  573. if(dialogid == RCPEDITMENU2)
  574. {
  575. if (response)
  576. {
  577. if(listitem == 0) // Edit position
  578. {
  579. ConfigEventCPs[playerid][1] = 1;
  580. SendClientMessageEx(playerid, COLOR_WHITE, "You are now creating editing this checkpoint's position, you need to choose the position where the checkpoint will be at.");
  581. SendClientMessageEx(playerid, COLOR_WHITE, "NOTE: Press the FIRE button to save the position. You can cancel this action by pressing the AIM button.");
  582. }
  583. else if(listitem == 1) // edit size
  584. {
  585. ConfigEventCPs[playerid][1] = 3;
  586. format(string,sizeof(string),"Race Checkpoint %d Size", ConfigEventCPId[playerid]);
  587. ShowPlayerDialogEx(playerid,RCPSIZE,DIALOG_STYLE_INPUT,string,"Please choose the size of the checkpoint.\nRecommended size: 5.0","Ok","Cancel");
  588. }
  589. else if(listitem == 2) // edit type
  590. {
  591. ConfigEventCPs[playerid][1] = 4;
  592. ShowPlayerDialogEx(playerid,RCPTYPE,DIALOG_STYLE_LIST,"Race Checkpoints Type List","1.- Start checkpoint\n2.- Normal checkpoint\n3.- Watering Station\n4.- Finish checkpoint","Okay","Cancel");
  593. }
  594. else if(listitem == 3) // view checkpoint
  595. {
  596. if(EventRCPT[ConfigEventCPId[playerid]] == 1) {
  597. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  598. }
  599. else if(EventRCPT[ConfigEventCPId[playerid]] == 4) {
  600. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  601. }
  602. else {
  603. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  604. }
  605. SetPlayerPos(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]]);
  606. SendClientMessageEx(playerid, COLOR_WHITE, "You now have a view of this checkpoint, you are inside of the checkpoint, step outside to see it.");
  607. }
  608. }
  609. }
  610. if(dialogid == RCPTYPE)
  611. {
  612. if (response && ConfigEventCPs[playerid][0] == 1)
  613. {
  614. if(listitem == 0) // Start checkpoint
  615. {
  616. EventRCPT[ConfigEventCPId[playerid]] = 1;
  617. DisablePlayerCheckpoint(playerid);
  618. ConfigEventCPs[playerid][1] = 0;
  619. ConfigEventCPs[playerid][0] = 0;
  620. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  621. }
  622. else if(listitem == 1) // Normal Checkpoint
  623. {
  624. EventRCPT[ConfigEventCPId[playerid]] = 2;
  625. DisablePlayerCheckpoint(playerid);
  626. ConfigEventCPs[playerid][1] = 0;
  627. ConfigEventCPs[playerid][0] = 0;
  628. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  629. }
  630. else if(listitem == 2) // Watering Checkpoint
  631. {
  632. EventRCPT[ConfigEventCPId[playerid]] = 3;
  633. DisablePlayerCheckpoint(playerid);
  634. ConfigEventCPs[playerid][1] = 0;
  635. ConfigEventCPs[playerid][0] = 0;
  636. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  637. }
  638. else if(listitem == 3) // Finish Checkpoint
  639. {
  640. EventRCPT[ConfigEventCPId[playerid]] = 4;
  641. DisablePlayerCheckpoint(playerid);
  642. ConfigEventCPs[playerid][1] = 0;
  643. ConfigEventCPs[playerid][0] = 0;
  644. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  645. }
  646. }
  647. }
  648. if(dialogid == RCPSIZE)
  649. {
  650. if(response && ConfigEventCPs[playerid][0] == 1)
  651. {
  652. if(strlen(inputtext) < 1)
  653. {
  654. format(string,sizeof(string),"Race Checkpoint %d Size", ConfigEventCPId[playerid]);
  655. ShowPlayerDialogEx(playerid,RCPSIZE,DIALOG_STYLE_INPUT,string,"Please type a number for the size of the checkpoint","Ok","Cancel");
  656. return 1;
  657. }
  658. new Float: rcpsize;
  659. rcpsize = floatstr(inputtext);
  660. if(rcpsize < 1.0 && rcpsize > 15.0) return 1;
  661. EventRCPS[ConfigEventCPId[playerid]] = rcpsize;
  662. SendClientMessage(playerid, COLOR_WHITE, "Successfully changed the size, updating preview...");
  663. /*if(EventRCPT[ConfigEventCPId[playerid]] == 1) {
  664. DisablePlayerCheckpoint(playerid);
  665. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  666. }
  667. else if(EventRCPT[ConfigEventCPId[playerid]] == 4) {
  668. DisablePlayerCheckpoint(playerid);
  669. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  670. }*/
  671. DisablePlayerCheckpoint(playerid);
  672. if(ConfigEventCPs[playerid][2] == 1) {
  673. ConfigEventCPs[playerid][1] = 4;
  674. ShowPlayerDialogEx(playerid,RCPTYPE,DIALOG_STYLE_LIST,"Race Checkpoints Type List","1.- Start checkpoint\n2.- Normal checkpoint\n3.- Watering Station\n4.- Finish checkpoint","Okay","Cancel");
  675. }
  676. else
  677. {
  678. SetTimerEx("RFLCheckpointu", 1000, false, "i", playerid);
  679. //SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  680. }
  681. }
  682. }
  683. if(dialogid == UNMODCARMENU)
  684. {
  685. if (response)
  686. {
  687. new count = GetPVarInt(playerid, "modCount");
  688. new d;
  689. for(new z = 0 ; z < MAX_PLAYERVEHICLES; z++)
  690. {
  691. if(IsPlayerInVehicle(playerid, PlayerVehicleInfo[playerid][z][pvId]))
  692. {
  693. d = z;
  694. break;
  695. }
  696. }
  697. for (new i = 0; i < count; i++)
  698. {
  699. if(listitem == i)
  700. {
  701. format(string, sizeof(string), "partList%i", i);
  702. new partID = GetPVarInt(playerid, string);
  703. if (partID == 999)
  704. {
  705. for(new f = 0 ; f < MAX_MODS; f++)
  706. {
  707. SetPVarInt(playerid, "unMod", 1);
  708. RemoveVehicleComponent(PlayerVehicleInfo[playerid][d][pvId], GetVehicleComponentInSlot(PlayerVehicleInfo[playerid][d][pvId], f));
  709. PlayerVehicleInfo[playerid][d][pvMods][f] = 0;
  710. }
  711. SendClientMessageEx(playerid, COLOR_WHITE, "All modifications have been removed from your vehicle.");
  712. return 1;
  713. }
  714. SetPVarInt(playerid, "unMod", 1);
  715. RemoveVehicleComponent(GetPlayerVehicleID(playerid), partID);
  716. if(GetVehicleComponentType(partID) == 3) {
  717. PlayerVehicleInfo[playerid][d][pvMods][14] = 0;
  718. }
  719. PlayerVehicleInfo[playerid][d][pvMods][GetVehicleComponentType(partID)] = 0;
  720. SendClientMessageEx(playerid, COLOR_WHITE, "The modification you requested has been removed.");
  721. return 1;
  722. }
  723. }
  724. }
  725. }
  726. if(dialogid == 7954) // Report tips
  727. {
  728. ShowPlayerDialogEx(playerid,7955,DIALOG_STYLE_MSGBOX,"Report tips","Tips when reporting:\n- Report what you need, not who you need.\n- Be specific, report exactly what you need.\n- Do not make false reports.\n- Do not flame admins.\n- Report only for in-game items.\n- For shop orders use the /shoporder command","Close", "");
  729. }
  730. #if defined SHOPAUTOMATED
  731. if(dialogid == DIALOG_SHOPORDER)
  732. {
  733. if(response)
  734. {
  735. if(strlen(inputtext) < 1 || strlen(inputtext) > 6)
  736. {
  737. ShowPlayerDialogEx(playerid, DIALOG_SHOPERROR, DIALOG_STYLE_MSGBOX, "Shop Order","ERROR: The shop order ID must be no longer than 6 characters and no lower than 1 character.", "Retry", "Cancel");
  738. return 1;
  739. }
  740. if(!IsNumeric(inputtext))
  741. {
  742. ShowPlayerDialogEx(playerid, DIALOG_SHOPERROR, DIALOG_STYLE_MSGBOX, "Shop Order","ERROR: The shop order ID must be a numerical value.", "Retry", "Cancel");
  743. return 1;
  744. }
  745. new orderid = strval(inputtext);
  746. if(orderid == 0)
  747. {
  748. ShowPlayerDialogEx(playerid, DIALOG_SHOPERROR, DIALOG_STYLE_MSGBOX, "Shop Order","ERROR: The shop order ID can not be 0.", "Retry", "Cancel");
  749. return 1;
  750. }
  751. ShowNoticeGUIFrame(playerid, 6);
  752. PlayerInfo[playerid][pOrder] = orderid;
  753. new query[384];
  754. format(query, sizeof(query), "\
  755. SELECT p.order_product_id, p.order_id, p.name, p.quantity, h.order_status_id, o.email, o.ip \
  756. FROM betazorder_product p \
  757. LEFT JOIN betazorder_history h ON h.order_id = p.order_id AND h.order_history_id = (SELECT max(order_history_id) FROM betazorder_history WHERE p.order_id = order_id) \
  758. LEFT JOIN betazorder o ON o.order_id = p.order_id \
  759. WHERE p.order_id = %d", orderid);
  760. mysql_tquery(ShopPipeline, query, true, "OnShopOrder", "i", playerid);
  761. SetPVarInt(playerid, "ShopOrderTimer", 60); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_SHOPORDERTIMER);
  762. }
  763. }
  764. if(dialogid == DIALOG_SHOPORDEREMAIL)
  765. {
  766. if(response)
  767. {
  768. new email[256];
  769. GetPVarString(playerid, "ShopEmailVerify", email, sizeof(email));
  770. if(!isnull(inputtext) && strcmp(inputtext, email, true) == 0)
  771. {
  772. ShowNoticeGUIFrame(playerid, 6);
  773. new query[384];
  774. format(query, sizeof(query), "\
  775. SELECT p.order_product_id, p.order_id, p.name, p.quantity, p.delivered, h.order_status_id \
  776. FROM betazorder_product p \
  777. LEFT JOIN betazorder_history h ON h.order_id = p.order_id AND h.order_history_id = (SELECT max(order_history_id) FROM betazorder_history WHERE p.order_id = order_id) \
  778. LEFT JOIN betazorder o ON o.order_id = p.order_id \
  779. WHERE p.order_id = %d", PlayerInfo[playerid][pOrder]);
  780. mysql_tquery(ShopPipeline, query, true, "OnShopOrderEmailVer", "i", playerid);
  781. }
  782. else
  783. {
  784. //ERROR ASK FURTHER HELP
  785. ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, "Shop Order Error", "We were unable to verify that e-mail to that order, would you like further assistance from a shop technician?", "Yes", "No");
  786. }
  787. }
  788. }
  789. if(dialogid == DIALOG_SHOPORDER2)
  790. {
  791. if(response)
  792. {
  793. ShowNoticeGUIFrame(playerid, 6);
  794. new query[256];
  795. format(query, sizeof(query), "SELECT * FROM `shop` WHERE `order_id`=%d", PlayerInfo[playerid][pOrder]);
  796. mysql_tquery(ShopPipeline, query, true, "OnShopOrder2", "ii", playerid, listitem);
  797. }
  798. }
  799. if(dialogid == DIALOG_SHOPDELIVER)
  800. {
  801. if(response)
  802. {
  803. switch(GetPVarInt(playerid, "DShop_product_id"))
  804. {
  805. case 69: //Custom car
  806. {
  807. new carstring[5012];
  808. for(new x;x<sizeof(VehicleNameShop);x++)
  809. {
  810. format(carstring, sizeof(carstring), "%s%d - %s\n", carstring, VehicleNameShop[x][svehicleid], VehicleNameShop[x][svehiclename]);
  811. }
  812. ShowPlayerDialogEx(playerid, DIALOG_SHOPDELIVERCAR, DIALOG_STYLE_LIST, "Shop Car Delivery", carstring, "Select Car", "Cancel");
  813. }
  814. }
  815. }
  816. }
  817. if(dialogid == DIALOG_SHOPDELIVERCAR)
  818. {
  819. if(response)
  820. {
  821. new dialogstring[256], name[64];
  822. GetPVarString(playerid, "DShop_name", name, sizeof(name));
  823. SetPVarInt(playerid, "DShop_listitem", listitem);
  824. format(dialogstring, sizeof(dialogstring), "You are about to redeem: %s\nOrder ID: %d\nWith vehicle: %s (ID %d)\n\nAre you sure?", name, GetPVarInt(playerid, "DShop_order_id"), VehicleNameShop[listitem][svehicleid], VehicleNameShop[listitem][svehiclename]);
  825. ShowPlayerDialogEx(playerid, DIALOG_SHOPDELIVERCAR2, DIALOG_STYLE_MSGBOX, "Shop Car Delivery", dialogstring, "Reedem", "Cancel");
  826. }
  827. }
  828. if(dialogid == DIALOG_SHOPDELIVERCAR2)
  829. {
  830. if(response)
  831. {
  832. if(!vehicleCountCheck(playerid))
  833. {
  834. ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, "Error", "You can't have any more vehicles, you own too many!", "OK", "");
  835. }
  836. else if(!vehicleSpawnCountCheck(playerid))
  837. {
  838. ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, "Error", "You have too many vehicles spawned, you must store one first.", "OK", "");
  839. }
  840. else
  841. {
  842. new Float: arr_fPlayerPos[4];
  843. listitem = GetPVarInt(playerid, "DShop_listitem");
  844. GetPlayerPos(playerid, arr_fPlayerPos[0], arr_fPlayerPos[1], arr_fPlayerPos[2]);
  845. GetPlayerFacingAngle(playerid, arr_fPlayerPos[3]);
  846. CreatePlayerVehicle(playerid, GetPlayerFreeVehicleId(playerid), VehicleNameShop[listitem][svehicleid], arr_fPlayerPos[0], arr_fPlayerPos[1], arr_fPlayerPos[2], arr_fPlayerPos[3], 0, 0, 2000000, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
  847. format(string, sizeof(string), "[shoporder] created a %s (%d) for %s(%d) (invoice %s).", GetVehicleName(VehicleNameShop[listitem][svehicleid]), VehicleNameShop[listitem][svehicleid], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPVarInt(playerid, "DShop_order_id"));
  848. Log("logs/shoplog.log", string);
  849. }
  850. }
  851. }
  852. #else
  853. if(dialogid == DIALOG_SHOPORDER)
  854. {
  855. if(response)
  856. {
  857. if(strlen(inputtext) < 1 || strlen(inputtext) > 6)
  858. {
  859. ShowPlayerDialogEx(playerid, DIALOG_SHOPERROR, DIALOG_STYLE_MSGBOX, "Shop Order","ERROR: The shop order ID must be no longer than 6 characters and no lower than 1 character.", "Retry", "Cancel");
  860. return 1;
  861. }
  862. if(!IsNumeric(inputtext))
  863. {
  864. ShowPlayerDialogEx(playerid, DIALOG_SHOPERROR, DIALOG_STYLE_MSGBOX, "Shop Order","ERROR: The shop order ID must be a numerical value.", "Retry", "Cancel");
  865. return 1;
  866. }
  867. new orderid = strval(inputtext);
  868. if(orderid == 0)
  869. {
  870. ShowPlayerDialogEx(playerid, DIALOG_SHOPERROR, DIALOG_STYLE_MSGBOX, "Shop Order","ERROR: The shop order ID can not be 0.", "Retry", "Cancel");
  871. return 1;
  872. }
  873. PlayerInfo[playerid][pOrder] = orderid;
  874. SetPVarInt(playerid, "ShopOrderTimer", 60); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_SHOPORDERTIMER);
  875. format(string, sizeof(string), "shop.ng-gaming.net/idcheck.php?id=%d", orderid);
  876. HTTP(playerid, HTTP_GET, string, "", "HttpCallback_ShopIDCheck");
  877. }
  878. }
  879. #endif
  880. if(dialogid == DIALOG_SHOPERROR)
  881. {
  882. if(response)
  883. {
  884. ShowPlayerDialogEx(playerid, DIALOG_SHOPORDER, DIALOG_STYLE_INPUT, "Shop Order", "This is for shop orders from http://shop.ng-gaming.net\n\nIf you do not have a shop order then please cancel this dialog box now.\n\nWarning: Abuse of this feature may result to an indefinite block from this command.\n\nPlease enter your shop order ID (if you do not know it put 1):", "Submit", "Cancel" );
  885. }
  886. }
  887. if(dialogid == DIALOG_SHOPERROR2)
  888. {
  889. if(response)
  890. {
  891. ShowPlayerDialogEx(playerid, DIALOG_SHOPSENT, DIALOG_STYLE_INPUT, "Shop Order", "", "Submit", "Cancel" );
  892. }
  893. }
  894. if(dialogid == PMOTDNOTICE && 1 <= PlayerInfo[playerid][pDonateRank] <= 3 && (PlayerInfo[playerid][pVIPExpire] - 86400 < gettime()))
  895. {
  896. ShowPlayerDialogEx(playerid, VIP_EXPIRES, DIALOG_STYLE_MSGBOX, "VIP Expiration!", "Your VIP expires in less than a day - renew today at shop.ng-gaming.net!", "OK", "");
  897. }
  898. else if(dialogid == PMOTDNOTICE || dialogid == VIP_EXPIRES)
  899. {
  900. SetPVarInt(playerid, "ViewedPMOTD", 1);
  901. if(PlayerInfo[playerid][pReceivedCredits] != 0) ShowLoginDialogs(playerid, 5);
  902. }
  903. if(dialogid == DIALOG_LOADTRUCK)
  904. {
  905. if(response)
  906. {
  907. new iBusiness = ListItemTrackId[playerid][listitem];
  908. if (Businesses[iBusiness][bOrderState] != 1) {
  909. SendClientMessageEx(playerid, COLOR_WHITE, "That order cannot be taken anymore (either taken by another Shipment Contractor or the business has cancelled it)");
  910. return 1;
  911. }
  912. new iTruckModel = GetVehicleModel(GetPlayerVehicleID(playerid));
  913. if (iTruckModel != 443 && Businesses[iBusiness][bType] == BUSINESS_TYPE_NEWCARDEALERSHIP) {
  914. SendClientMessageEx(playerid, COLOR_WHITE, "You need to be driving a Packer in order to accept orders from car dealerships.");
  915. TogglePlayerControllable(playerid, 1);
  916. DeletePVar(playerid, "IsFrozen");
  917. return 1;
  918. }
  919. if (iTruckModel != 514 && Businesses[iBusiness][bType] == BUSINESS_TYPE_GASSTATION) {
  920. SendClientMessageEx(playerid, COLOR_WHITE, "You need to be driving a tank truck in order to accept orders from gas stations.");
  921. TogglePlayerControllable(playerid, 1);
  922. DeletePVar(playerid, "IsFrozen");
  923. return 1;
  924. }
  925. if ((iTruckModel == 443 || iTruckModel == 514) && Businesses[iBusiness][bType] != BUSINESS_TYPE_NEWCARDEALERSHIP && Businesses[iBusiness][bType] != BUSINESS_TYPE_GASSTATION)
  926. {
  927. SendClientMessageEx(playerid, COLOR_WHITE, "You need to be driving a regular truck (i.e not packer or tank truck) in order to accept orders from this type of business.");
  928. TogglePlayerControllable(playerid, 1);
  929. DeletePVar(playerid, "IsFrozen");
  930. return 1;
  931. }
  932. Businesses[iBusiness][bOrderState] = 2;
  933. TruckDeliveringTo[GetPlayerVehicleID(playerid)] = iBusiness;
  934. SaveBusiness(iBusiness);
  935. format(string,sizeof(string),"* Please wait a moment while the vehicle is being loaded with %s...", GetInventoryType(iBusiness));
  936. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  937. SetPVarInt(playerid, "LoadTruckTime", 10);
  938. SetTimerEx("LoadTruck", 1000, 0, "d", playerid);
  939. }
  940. else
  941. {
  942. DeletePVar(playerid, "IsFrozen");
  943. TogglePlayerControllable(playerid, 1);
  944. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You canceled the loading of the shipment, type /loadshipment to try again.");
  945. }
  946. }
  947. if((dialogid == BUYTOYSCOP) && response)
  948. {
  949. szMiscArray[0] = 0;
  950. new icount = GetPlayerToySlots(playerid);
  951. for(new x;x<icount;x++)
  952. {
  953. new name[24] = "None";
  954. for(new i;i<sizeof(HoldingObjectsAll);i++)
  955. {
  956. if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID])
  957. {
  958. format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
  959. }
  960. }
  961. if(PlayerToyInfo[playerid][x][ptModelID] != 0 && (strcmp(name, "None", true) == 0))
  962. {
  963. format(name, sizeof(name), "ID: %d", PlayerToyInfo[playerid][x][ptModelID]);
  964. }
  965. format(szMiscArray, sizeof(szMiscArray), "%s(%d) %s (Bone: %s)\n", szMiscArray, x, name, HoldingBones[PlayerToyInfo[playerid][x][ptBone]]);
  966. }
  967. ShowPlayerDialogEx(playerid, BUYTOYSCOP2, DIALOG_STYLE_LIST, "Select a Slot", szMiscArray, "Select", "Cancel");
  968. }
  969. if((dialogid == BUYTOYSCOP2) && response)
  970. {
  971. /*
  972. if(listitem >= 5 && PlayerInfo[playerid][pDonateRank] < 1 || listitem >= 5 && PlayerInfo[playerid][pBuddyInvited] == 1) return SendClientMessageEx(playerid, COLOR_WHITE, "* You must be a Bronze VIP + to use that slot!");
  973. if(listitem >= 8 && PlayerInfo[playerid][pDonateRank] < 2) return SendClientMessageEx(playerid, COLOR_WHITE, "* You must be a Silver VIP + to use that slot!");
  974. if(listitem >= 9 && PlayerInfo[playerid][pDonateRank] < 3) return SendClientMessageEx(playerid, COLOR_WHITE, "* You must be a Gold VIP + to use that slot!");
  975. if(listitem >= 10 && PlayerInfo[playerid][pDonateRank] < 4) return SendClientMessageEx(playerid, COLOR_WHITE, "* You must be a Platinum VIP + to use that slot!");
  976. */
  977. if(!toyCountCheck(playerid)) return SendClientMessageEx(playerid, COLOR_YELLOW, "* You cannot hold anymore toys.");
  978. if(PlayerToyInfo[playerid][listitem][ptModelID] != 0) return SendClientMessageEx(playerid, COLOR_YELLOW, "* You already have something in that slot. Delete it with /toys");
  979. SetPVarInt(playerid, "ToySlot", listitem);
  980. new stringg[1024];
  981. for(new x;x<sizeof(HoldingObjectsCop);x++)
  982. {
  983. format(stringg, sizeof(stringg), "%s%s ($%d)\n", stringg, HoldingObjectsCop[x][holdingmodelname], HoldingObjectsCop[x][holdingprice]);
  984. }
  985. ShowPlayerDialogEx(playerid, BUYTOYSCOP3, DIALOG_STYLE_LIST, "Select an Item", stringg, "Buy", "Cancel");
  986. }
  987. if((dialogid == BUYTOYSCOP3) && response)
  988. {
  989. if(GetPlayerCash(playerid) < HoldingObjectsCop[listitem][holdingprice])
  990. {
  991. SendClientMessageEx(playerid, COLOR_WHITE, "* You can't afford that!");
  992. }
  993. else
  994. {
  995. GivePlayerCash(playerid, -HoldingObjectsCop[listitem][holdingprice]);
  996. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptModelID] = HoldingObjectsCop[listitem][holdingmodelid];
  997. new modelid = PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptModelID];
  998. if((modelid >= 19006 && modelid <= 19035) || (modelid >= 19138 && modelid <= 19140))
  999. {
  1000. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1001. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.9;
  1002. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1003. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.35;
  1004. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 90.0;
  1005. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 90.0;
  1006. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1007. }
  1008. else if(modelid >= 18891 && modelid <= 18910)
  1009. {
  1010. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1011. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.15;
  1012. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1013. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1014. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 90.0;
  1015. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 180.0;
  1016. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 90.0;
  1017. }
  1018. else if(modelid >= 18926 && modelid <= 18935)
  1019. {
  1020. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1021. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.1;
  1022. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1023. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1024. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 0.0;
  1025. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 0.0;
  1026. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1027. }
  1028. else if(modelid >= 18911 && modelid <= 18920)
  1029. {
  1030. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1031. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.1;
  1032. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.035;
  1033. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1034. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 90.0;
  1035. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 180.0;
  1036. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 90.0;
  1037. }
  1038. else if(modelid == 19078 || modelid == 19078)
  1039. {
  1040. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 16;
  1041. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0;
  1042. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0;
  1043. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0;
  1044. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 180.0;
  1045. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 180.0;
  1046. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1047. }
  1048. else if((modelid >= 18641 && modelid <= 18644) || (modelid >= 19080 && modelid <= 19084) || modelid == 18890)
  1049. {
  1050. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 6;
  1051. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.0;
  1052. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1053. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1054. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 0.0;
  1055. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 0.0;
  1056. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1057. }
  1058. else
  1059. {
  1060. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1061. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.0;
  1062. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1063. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1064. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 0.0;
  1065. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 0.0;
  1066. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1067. }
  1068. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptScaleX] = 1.0;
  1069. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptScaleY] = 1.0;
  1070. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptScaleZ] = 1.0;
  1071. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptTradable] = 0;
  1072. g_mysql_NewToy(playerid, GetPVarInt(playerid, "ToySlot"));
  1073. format(string, sizeof(string), "* You have purchased %s for $%d (Slot: %d)", HoldingObjectsCop[listitem][holdingmodelname], HoldingObjectsCop[listitem][holdingprice], GetPVarInt(playerid, "ToySlot"));
  1074. SendClientMessageEx(playerid, COLOR_RED, string);
  1075. SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Use /toys to wear/edit this");
  1076. }
  1077. }
  1078. if((dialogid == BUYTOYSGOLD) && response)
  1079. {
  1080. if(PlayerInfo[playerid][pDonateRank] < 3) return SendClientMessageEx(playerid, COLOR_WHITE, "* You must be a Gold VIP +");
  1081. new icount = GetPlayerToySlots(playerid);
  1082. for(new x;x<icount;x++)
  1083. {
  1084. new name[24] = "None";
  1085. for(new i;i<sizeof(HoldingObjectsAll);i++)
  1086. {
  1087. if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID])
  1088. {
  1089. format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
  1090. }
  1091. }
  1092. if(PlayerToyInfo[playerid][x][ptModelID] != 0 && (strcmp(name, "None", true) == 0))
  1093. {
  1094. format(name, sizeof(name), "ID: %d", PlayerToyInfo[playerid][x][ptModelID]);
  1095. }
  1096. format(szMiscArray, sizeof(szMiscArray), "%s(%d) %s (Bone: %s)\n", szMiscArray, x, name, HoldingBones[PlayerToyInfo[playerid][x][ptBone]]);
  1097. }
  1098. ShowPlayerDialogEx(playerid, BUYTOYSGOLD2, DIALOG_STYLE_LIST, "Select a Slot", szMiscArray, "Select", "Cancel");
  1099. }
  1100. if((dialogid == BUYTOYSGOLD2) && response)
  1101. {
  1102. if(PlayerInfo[playerid][pDonateRank] < 3) return SendClientMessageEx(playerid, COLOR_WHITE, "* You must be a Gold VIP +");
  1103. if(!toyCountCheck(playerid)) return SendClientMessageEx(playerid, COLOR_YELLOW, "* You cannot hold anymore toys.");
  1104. if(PlayerToyInfo[playerid][listitem][ptModelID] != 0) return SendClientMessageEx(playerid, COLOR_YELLOW, "* You already have something in that slot. Delete it with /toys");
  1105. SetPVarInt(playerid, "ToySlot", listitem);
  1106. for(new x;x<sizeof(HoldingObjectsAll);x++)
  1107. {
  1108. format(szMiscArray, sizeof(szMiscArray), "%s%s ($%d)\n", szMiscArray, HoldingObjectsAll[x][holdingmodelname], HoldingObjectsAll[x][holdingprice]);
  1109. }
  1110. ShowPlayerDialogEx(playerid, BUYTOYSGOLD3, DIALOG_STYLE_LIST, "Select an Item", szMiscArray, "Buy", "Cancel");
  1111. }
  1112. if((dialogid == BUYTOYSGOLD3) && response)
  1113. {
  1114. if(PlayerInfo[playerid][pDonateRank] < 3) return SendClientMessageEx(playerid, COLOR_WHITE, "* You must be a Gold VIP +");
  1115. if(GetPlayerCash(playerid) < HoldingObjectsAll[listitem][holdingprice])
  1116. {
  1117. SendClientMessageEx(playerid, COLOR_WHITE, "* You can't afford that!");
  1118. }
  1119. else
  1120. {
  1121. GivePlayerCash(playerid, -HoldingObjectsAll[listitem][holdingprice]);
  1122. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptModelID] = HoldingObjectsAll[listitem][holdingmodelid];
  1123. new modelid = PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptModelID];
  1124. if((modelid >= 19006 && modelid <= 19035) || (modelid >= 19138 && modelid <= 19140))
  1125. {
  1126. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1127. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.9;
  1128. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1129. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.35;
  1130. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 90.0;
  1131. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 90.0;
  1132. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1133. }
  1134. else if(modelid >= 18891 && modelid <= 18910)
  1135. {
  1136. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1137. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.15;
  1138. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1139. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1140. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 90.0;
  1141. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 180.0;
  1142. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 90.0;
  1143. }
  1144. else if(modelid >= 18926 && modelid <= 18935)
  1145. {
  1146. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1147. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.1;
  1148. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1149. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1150. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 0.0;
  1151. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 0.0;
  1152. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1153. }
  1154. else if(modelid >= 18911 && modelid <= 18920)
  1155. {
  1156. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1157. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.1;
  1158. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.035;
  1159. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1160. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 90.0;
  1161. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 180.0;
  1162. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 90.0;
  1163. }
  1164. else if(modelid == 19078 || modelid == 19078)
  1165. {
  1166. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 16;
  1167. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0;
  1168. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0;
  1169. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0;
  1170. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 180.0;
  1171. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 180.0;
  1172. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1173. }
  1174. else if((modelid >= 18641 && modelid <= 18644) || (modelid >= 19080 && modelid <= 19084) || modelid == 18890)
  1175. {
  1176. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 6;
  1177. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.0;
  1178. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1179. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1180. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 0.0;
  1181. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 0.0;
  1182. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1183. }
  1184. else
  1185. {
  1186. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1187. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.0;
  1188. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1189. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1190. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 0.0;
  1191. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 0.0;
  1192. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1193. }
  1194. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptScaleX] = 1.0;
  1195. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptScaleY] = 1.0;
  1196. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptScaleZ] = 1.0;
  1197. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptTradable] = 0;
  1198. g_mysql_NewToy(playerid, GetPVarInt(playerid, "ToySlot"));
  1199. format(string, sizeof(string), "* You have purchased %s for $%d (Slot: %d)", HoldingObjectsAll[listitem][holdingmodelname], HoldingObjectsAll[listitem][holdingprice], GetPVarInt(playerid, "ToySlot"));
  1200. SendClientMessageEx(playerid, COLOR_RED, string);
  1201. SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Use /toys to wear/edit this");
  1202. }
  1203. }
  1204. if((dialogid == BUYTOYS) && response)
  1205. {
  1206. szMiscArray[0] = 0;
  1207. new icount = GetPlayerToySlots(playerid);
  1208. for(new x;x<icount;x++)
  1209. {
  1210. new name[24];
  1211. format(name, sizeof(name), "None");
  1212. for(new i;i<sizeof(HoldingObjectsAll);i++)
  1213. {
  1214. if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID])
  1215. {
  1216. format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
  1217. }
  1218. }
  1219. if(PlayerToyInfo[playerid][x][ptModelID] != 0 && (strcmp(name, "None", true) == 0))
  1220. {
  1221. format(name, sizeof(name), "ID: %d", PlayerToyInfo[playerid][x][ptModelID]);
  1222. }
  1223. format(szMiscArray, sizeof(szMiscArray), "%s(%d) %s (Bone: %s)\n", szMiscArray, x, name, HoldingBones[PlayerToyInfo[playerid][x][ptBone]]);
  1224. }
  1225. ShowPlayerDialogEx(playerid, BUYTOYS2, DIALOG_STYLE_LIST, "Select a Slot", szMiscArray, "Select", "Cancel");
  1226. }
  1227. if((dialogid == BUYTOYS2) && response)
  1228. {
  1229. /*
  1230. if(listitem >= 5 + PlayerInfo[playerid][pToySlot] && PlayerInfo[playerid][pDonateRank] < 1 || listitem >= 5 + PlayerInfo[playerid][pToySlot] && PlayerInfo[playerid][pBuddyInvited] == 1) return SendClientMessageEx(playerid, COLOR_WHITE, "* You must be a Bronze VIP + to use that slot!");
  1231. if(listitem >= 8 + PlayerInfo[playerid][pToySlot] && PlayerInfo[playerid][pDonateRank] < 2) return SendClientMessageEx(playerid, COLOR_WHITE, "* You must be a Silver VIP + to use that slot!");
  1232. if(listitem >= 9 + PlayerInfo[playerid][pToySlot] && PlayerInfo[playerid][pDonateRank] < 3) return SendClientMessageEx(playerid, COLOR_WHITE, "* You must be a Gold VIP + to use that slot!");
  1233. if(listitem >= 10 + PlayerInfo[playerid][pToySlot] && PlayerInfo[playerid][pDonateRank] < 4) return SendClientMessageEx(playerid, COLOR_WHITE, "* You must be a Platinum VIP + to use that slot!");
  1234. */
  1235. if(!toyCountCheck(playerid)) return SendClientMessageEx(playerid, COLOR_YELLOW, "* You cannot hold anymore toys.");
  1236. if(PlayerToyInfo[playerid][listitem][ptModelID] != 0) return SendClientMessageEx(playerid, COLOR_YELLOW, "* You already have something in that slot. Delete it with /toys");
  1237. SetPVarInt(playerid, "ToySlot", listitem);
  1238. new stringg[5000];
  1239. for(new x;x<sizeof(HoldingObjects);x++)
  1240. {
  1241. format(stringg, sizeof(stringg), "%s%s ($%d)\n", stringg, HoldingObjects[x][holdingmodelname], HoldingObjects[x][holdingprice]);
  1242. }
  1243. ShowPlayerDialogEx(playerid, BUYTOYS3, DIALOG_STYLE_LIST, "Select an Item", stringg, "Buy", "Cancel");
  1244. }
  1245. if((dialogid == BUYTOYS3) && response)
  1246. {
  1247. if(GetPlayerCash(playerid) < HoldingObjects[listitem][holdingprice])
  1248. {
  1249. SendClientMessageEx(playerid, COLOR_WHITE, "* You can't afford that!");
  1250. }
  1251. else
  1252. {
  1253. GivePlayerCash(playerid, -HoldingObjects[listitem][holdingprice]);
  1254. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptModelID] = HoldingObjects[listitem][holdingmodelid];
  1255. new modelid = PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptModelID];
  1256. if((modelid >= 19006 && modelid <= 19035) || (modelid >= 19138 && modelid <= 19140))
  1257. {
  1258. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1259. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.9;
  1260. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1261. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.35;
  1262. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 90.0;
  1263. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 90.0;
  1264. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1265. }
  1266. else if(modelid >= 18891 && modelid <= 18910)
  1267. {
  1268. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1269. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.15;
  1270. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1271. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1272. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 90.0;
  1273. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 180.0;
  1274. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 90.0;
  1275. }
  1276. else if(modelid >= 18926 && modelid <= 18935)
  1277. {
  1278. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1279. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.1;
  1280. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1281. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1282. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 0.0;
  1283. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 0.0;
  1284. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1285. }
  1286. else if(modelid >= 18911 && modelid <= 18920)
  1287. {
  1288. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1289. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.1;
  1290. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.035;
  1291. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1292. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 90.0;
  1293. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 180.0;
  1294. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 90.0;
  1295. }
  1296. else if(modelid == 19078 || modelid == 19078)
  1297. {
  1298. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 16;
  1299. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0;
  1300. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0;
  1301. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0;
  1302. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 180.0;
  1303. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 180.0;
  1304. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1305. }
  1306. else if((modelid >= 18641 && modelid <= 18644) || (modelid >= 19080 && modelid <= 19084) || modelid == 18890)
  1307. {
  1308. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 6;
  1309. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.0;
  1310. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1311. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1312. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 0.0;
  1313. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 0.0;
  1314. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1315. }
  1316. else
  1317. {
  1318. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  1319. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.0;
  1320. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  1321. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  1322. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 0.0;
  1323. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 0.0;
  1324. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  1325. }
  1326. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptScaleX] = 1.0;
  1327. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptScaleY] = 1.0;
  1328. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptScaleZ] = 1.0;
  1329. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptTradable] = 1;
  1330. g_mysql_NewToy(playerid, GetPVarInt(playerid, "ToySlot"));
  1331. format(string, sizeof(string), "* You have purchased %s for $%d (Slot: %d)", HoldingObjects[listitem][holdingmodelname], HoldingObjects[listitem][holdingprice], GetPVarInt(playerid, "ToySlot"));
  1332. SendClientMessageEx(playerid, COLOR_RED, string);
  1333. SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Use /toys to wear/edit this");
  1334. }
  1335. }
  1336. if((dialogid == TOYS) && response)
  1337. {
  1338. szMiscArray[0] = 0;
  1339. new icount = GetPlayerToySlots(playerid);
  1340. for(new x;x<icount;x++)
  1341. {
  1342. new name[24];
  1343. format(name, sizeof(name), "None");
  1344. for(new i;i<sizeof(HoldingObjectsAll);i++)
  1345. {
  1346. if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID])
  1347. {
  1348. format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
  1349. }
  1350. }
  1351. if(PlayerToyInfo[playerid][x][ptModelID] != 0 && (strcmp(name, "None", true) == 0))
  1352. {
  1353. format(name, sizeof(name), "ID: %d", PlayerToyInfo[playerid][x][ptModelID]);
  1354. }
  1355. format(szMiscArray, sizeof(szMiscArray), "%s(%d) %s (Bone: %s)\n", szMiscArray, x+1, name, HoldingBones[PlayerToyInfo[playerid][x][ptBone]]); // x+1 Since the toys list starts of from 1( As players see it )
  1356. }
  1357. format(szMiscArray, sizeof(szMiscArray), "%s\n{40FFFF}Additional Toy Slot {FFD700}(Credits: %s){A9C4E4}", szMiscArray, number_format(ShopItems[28][sItemPrice]));
  1358. switch(listitem) {
  1359. case 0:
  1360. ShowPlayerDialogEx(playerid, WEARTOY, DIALOG_STYLE_LIST, "Select a Toy", szMiscArray, "Select", "Cancel");
  1361. case 1:
  1362. ShowPlayerDialogEx(playerid, EDITTOYS, DIALOG_STYLE_LIST, "Select a Toy", szMiscArray, "Select", "Cancel");
  1363. case 2:
  1364. ShowPlayerDialogEx(playerid, DELETETOY, DIALOG_STYLE_LIST, "Select a Toy", szMiscArray, "Delete", "Cancel");
  1365. }
  1366. }
  1367. if((dialogid == EDITTOYS) && response)
  1368. {
  1369. /*new toycount = GetFreeToySlot(playerid);
  1370. if(toycount >= 10) return SendClientMessageEx(playerid, COLOR_GRAD1, "You currently have 10 objects attached, please deattach an object.");*/
  1371. if(listitem >= GetPlayerToySlots(playerid))
  1372. {
  1373. new szstring[128];
  1374. SetPVarInt(playerid, "MiscShop", 8);
  1375. format(szstring, sizeof(szstring), "Additional Toy Slot\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[28][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[28][sItemPrice]));
  1376. return ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Additional Toy Slot", szstring, "Purchase", "Cancel");
  1377. }
  1378. else if(PlayerToyInfo[playerid][listitem][ptModelID] == 0 && listitem < GetPlayerToySlots(playerid))
  1379. {
  1380. ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, "Edit your toy", "Woops! You don't have anything to edit in that slot.", "Okay", "");
  1381. }
  1382. else
  1383. {
  1384. SendClientMessageEx(playerid, COLOR_WHITE, "{AA3333}HINT:{FFFF00} Position your camera differently to better see where your editing.");
  1385. SetPVarInt(playerid, "ToySlot", listitem);
  1386. ShowEditMenu(playerid);
  1387. }
  1388. }
  1389. if((dialogid == EDITTOYS2)) {
  1390. if(response) switch(listitem) {
  1391. case 0: ShowPlayerDialogEx(playerid, EDITTOYSBONE, DIALOG_STYLE_LIST, "Select a Bone", "Spine\nHead\nLeft upper arm\nRight upper arm\nLeft hand\nRight hand\nLeft thigh\nRight thigh\nLeft foot\nRight foot\nRight calf\nLeft calf\nLeft forearm\nRight forearm\nLeft clavicle\nRight clavicle\nNeck\nJaw", "Select", "Cancel");
  1392. case 1:
  1393. {
  1394. for(new i; i < 10; i++)
  1395. {
  1396. if(PlayerHoldingObject[playerid][i] == GetPVarInt(playerid, "ToySlot"))
  1397. {
  1398. EditAttachedObject(playerid, i);
  1399. break;
  1400. }
  1401. }
  1402. SendClientMessage(playerid, COLOR_WHITE, "HINT: Hold {8000FF}~k~~PED_SPRINT~ {FFFFAA}to move your camera, press escape to cancel");
  1403. }
  1404. case 2:
  1405. {
  1406. new szstring[128];
  1407. if(PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptAutoAttach] == -2) format(szstring, sizeof(szstring), "Select an auto-attach option (Currently Disabled)");
  1408. else if(PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptAutoAttach] == -1) format(szstring, sizeof(szstring), "Select an auto-attach option (Currently: All Skins)");
  1409. else format(szstring, sizeof(szstring), "Select an auto-attach option (Currently: Skin %d)", GetPlayerSkin(playerid));
  1410. ShowPlayerDialogEx(playerid, EDITTOYSAUTOATTACH, DIALOG_STYLE_LIST, szstring, "Attach to any skin\nAttach to current skin\nDisable auto-attachment", "Select", "Cancel");
  1411. }
  1412. }
  1413. else
  1414. {
  1415. szMiscArray[0] = 0;
  1416. new icount = GetPlayerToySlots(playerid);
  1417. if(PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptSpecial] == 2) for(new i; i < 10; i++) {
  1418. if(PlayerHoldingObject[playerid][i] == GetPVarInt(playerid, "ToySlot")) {
  1419. PlayerHoldingObject[playerid][i] = 0;
  1420. RemovePlayerAttachedObject(playerid, i);
  1421. SendClientMessageEx(playerid, COLOR_GRAD1, "You may only wear this toy with /helmet.");
  1422. break;
  1423. }
  1424. }
  1425. for(new x;x<icount;x++)
  1426. {
  1427. new name[24];
  1428. format(name, sizeof(name), "None");
  1429. for(new i;i<sizeof(HoldingObjectsAll);i++)
  1430. {
  1431. if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID])
  1432. {
  1433. format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
  1434. }
  1435. }
  1436. if(PlayerToyInfo[playerid][x][ptModelID] != 0 && (strcmp(name, "None", true) == 0))
  1437. {
  1438. format(name, sizeof(name), "ID: %d", PlayerToyInfo[playerid][x][ptModelID]);
  1439. }
  1440. format(szMiscArray, sizeof(szMiscArray), "%s(%d) %s (Bone: %s)\n", szMiscArray, x+1, name, HoldingBones[PlayerToyInfo[playerid][x][ptBone]]); // x+1 since toys list starts off from 1 (From players view)
  1441. }
  1442. format(szMiscArray, sizeof(szMiscArray), "%s\n{40FFFF}Additional Toy Slot {FFD700}(Credits: %s){A9C4E4}", szMiscArray, number_format(ShopItems[28][sItemPrice]));
  1443. ShowPlayerDialogEx(playerid, EDITTOYS, DIALOG_STYLE_LIST, "Select a Toy", szMiscArray, "Select", "Cancel");
  1444. }
  1445. }
  1446. if(dialogid == EDITTOYSBONE)
  1447. {
  1448. if(response)
  1449. {
  1450. if(PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptSpecial] == 2)
  1451. SendClientMessageEx(playerid, COLOR_GRAD2, "This toy is limited to be attached to the head only.");
  1452. else {
  1453. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = listitem+1;
  1454. g_mysql_SaveToys(playerid,GetPVarInt(playerid, "ToySlot"));
  1455. }
  1456. }
  1457. ShowEditMenu(playerid);
  1458. }
  1459. if(dialogid == EDITTOYSAUTOATTACH)
  1460. {
  1461. if(response)
  1462. {
  1463. switch(listitem)
  1464. {
  1465. case 0:
  1466. {
  1467. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptAutoAttach] = -1;
  1468. g_mysql_SaveToys(playerid,GetPVarInt(playerid, "ToySlot"));
  1469. }
  1470. case 1:
  1471. {
  1472. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptAutoAttach] = GetPlayerSkin(playerid);
  1473. g_mysql_SaveToys(playerid,GetPVarInt(playerid, "ToySlot"));
  1474. }
  1475. case 2:
  1476. {
  1477. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptAutoAttach] = -2;
  1478. g_mysql_SaveToys(playerid,GetPVarInt(playerid, "ToySlot"));
  1479. }
  1480. }
  1481. }
  1482. ShowEditMenu(playerid);
  1483. }
  1484. if(dialogid == SELLTOY)
  1485. {
  1486. if(response)
  1487. {
  1488. new buyerid = GetPVarInt(playerid, "ttBuyer"),
  1489. cost = GetPVarInt(playerid, "ttCost");
  1490. if(PlayerToyInfo[playerid][listitem][ptModelID] == 0) {
  1491. DeletePVar(buyerid, "ttSeller");
  1492. DeletePVar(playerid, "ttCost");
  1493. DeletePVar(playerid, "ttBuyer");
  1494. ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, "Sell your toy", "Woops! You don't have anything to sell from that slot.", "Okay", "");
  1495. }
  1496. if(PlayerToyInfo[playerid][listitem][ptTradable] == 0) {
  1497. SendClientMessageEx(playerid, COLOR_GREY, "This toy isn't tradable.");
  1498. DeletePVar(buyerid, "ttSeller");
  1499. DeletePVar(playerid, "ttCost");
  1500. return DeletePVar(playerid, "ttBuyer");
  1501. }
  1502. if(!IsPlayerAttachedObjectSlotUsed(playerid, listitem))
  1503. {
  1504. new szmessage[128], name[24],
  1505. toyid = PlayerToyInfo[playerid][listitem][ptModelID];
  1506. format(name, sizeof(name), "None");
  1507. for(new i;i<sizeof(HoldingObjectsAll);i++)
  1508. {
  1509. if(HoldingObjectsAll[i][holdingmodelid] == toyid)
  1510. {
  1511. format(name, sizeof(name), "(%s)", HoldingObjectsAll[i][holdingmodelname]);
  1512. }
  1513. }
  1514. if(PlayerToyInfo[playerid][listitem][ptModelID] != 0 && (strcmp(name, "None", true) == 0))
  1515. {
  1516. format(name, sizeof(name), "(ID: %d)", toyid);
  1517. }
  1518. format(szmessage, sizeof(szmessage), "You have offered %s to purchase your toy. %s", GetPlayerNameEx(buyerid), name);
  1519. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szmessage);
  1520. SetPVarInt(playerid, "ttToy", toyid);
  1521. SetPVarInt(playerid, "ttToySlot", listitem);
  1522. PrepTradeToysGUI(buyerid, playerid, cost, toyid);
  1523. }
  1524. else {
  1525. SendClientMessageEx(playerid, COLOR_GREY, "You currently have this toy attached, please deattach it and try again.");
  1526. DeletePVar(buyerid, "ttSeller");
  1527. DeletePVar(playerid, "ttCost");
  1528. DeletePVar(playerid, "ttSeller");
  1529. }
  1530. }
  1531. else
  1532. {
  1533. SetPVarInt(playerid, "ttSeller", INVALID_PLAYER_ID);
  1534. SetPVarInt(playerid, "ttCost", 0);
  1535. SetPVarInt(playerid, "ttSeller", INVALID_PLAYER_ID);
  1536. }
  1537. }
  1538. if(dialogid == CONFIRMSELLTOY)
  1539. {
  1540. if(response) {
  1541. CompleteToyTrade(playerid);
  1542. }
  1543. else {
  1544. format(szMiscArray, sizeof(szMiscArray), "%s has declined the toy offer.", GetPlayerNameEx(playerid));
  1545. SendClientMessageEx(GetPVarInt(playerid, "ttSeller"), COLOR_GREY, szMiscArray);
  1546. SendClientMessageEx(playerid, COLOR_GREY, "You have declined the toy offer.");
  1547. DeletePVar(GetPVarInt(playerid, "ttSeller"), "ttBuyer");
  1548. DeletePVar(GetPVarInt(playerid, "ttSeller"), "ttCost");
  1549. DeletePVar(playerid, "ttSeller");
  1550. HideTradeToysGUI(playerid);
  1551. }
  1552. }
  1553. if((dialogid == WEARTOY) && response)
  1554. {
  1555. //if(PlayerToyInfo[playerid][listitem][ptModelID] == 0)
  1556. if(listitem >= GetPlayerToySlots(playerid))
  1557. {
  1558. SetPVarInt(playerid, "MiscShop", 8);
  1559. format(szMiscArray, sizeof(szMiscArray), "Additional Toy Slot\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[28][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[28][sItemPrice]));
  1560. return ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Additional Toy Slot", szMiscArray, "Purchase", "Cancel");
  1561. }
  1562. else if(PlayerToyInfo[playerid][listitem][ptModelID] == 0 && listitem < GetPlayerToySlots(playerid))
  1563. {
  1564. ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, "Wear your toy", "Woops! You don't have anything to wear from that slot.", "Okay", "");
  1565. }
  1566. else if(PlayerToyInfo[playerid][listitem][ptSpecial] == 2)
  1567. {
  1568. ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, "Wear your toy", "You may only wear this toy with /helmet.", "Okay", "");
  1569. }
  1570. else
  1571. {
  1572. new toys = 99999;
  1573. for(new i; i < 10; i++)
  1574. {
  1575. if(PlayerHoldingObject[playerid][i] == listitem)
  1576. {
  1577. toys = i;
  1578. break;
  1579. }
  1580. }
  1581. if(IsPlayerAttachedObjectSlotUsed(playerid, toys))
  1582. {
  1583. new name[24];
  1584. format(name, sizeof(name), "None");
  1585. for(new i;i<sizeof(HoldingObjectsAll);i++)
  1586. {
  1587. if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][listitem][ptModelID])
  1588. {
  1589. format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
  1590. }
  1591. }
  1592. format(string, sizeof(string), "Successfully dettached %s (Bone: %s) (Slot: %d)", name, HoldingBones[PlayerToyInfo[playerid][listitem][ptBone]], listitem);
  1593. SendClientMessageEx(playerid, COLOR_RED, string);
  1594. RemovePlayerAttachedObject(playerid, toys);
  1595. for(new i; i < 10; i++)
  1596. {
  1597. if(PlayerHoldingObject[playerid][i] == listitem)
  1598. {
  1599. PlayerHoldingObject[playerid][i] = 0;
  1600. break;
  1601. }
  1602. }
  1603. }
  1604. else AttachToy(playerid, listitem);
  1605. }
  1606. }
  1607. if((dialogid == DELETETOY) && response)
  1608. {
  1609. new toys = 99999;
  1610. for(new i; i < 10; i++)
  1611. {
  1612. if(PlayerHoldingObject[playerid][i] == listitem)
  1613. {
  1614. toys = i;
  1615. if(IsPlayerAttachedObjectSlotUsed(playerid, toys))
  1616. {
  1617. PlayerHoldingObject[playerid][i] = 0;
  1618. RemovePlayerAttachedObject(playerid, toys);
  1619. }
  1620. break;
  1621. }
  1622. }
  1623. new szQuery[128];
  1624. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "DELETE FROM `toys` WHERE `id` = '%d'", PlayerToyInfo[playerid][listitem][ptID]);
  1625. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
  1626. PlayerToyInfo[playerid][listitem][ptID] = 0;
  1627. PlayerToyInfo[playerid][listitem][ptModelID] = 0;
  1628. PlayerToyInfo[playerid][listitem][ptBone] = 0;
  1629. if(PlayerToyInfo[playerid][listitem][ptSpecial] != 0)
  1630. {
  1631. PlayerToyInfo[playerid][listitem][ptSpecial] = 0;
  1632. }
  1633. format(string, sizeof(string), "You have deleted your toy in slot %d.", listitem);
  1634. ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, "Toy Menu", string, "OK", "");
  1635. }
  1636. if((dialogid == LAELEVATORPASS) && response)
  1637. {
  1638. listitem = GetPVarInt(playerid, "ElevatorFloorPick");
  1639. if(FloorRequestedBy[listitem] != INVALID_PLAYER_ID || IsFloorInQueue(listitem))
  1640. GameTextForPlayer(playerid, "~r~The floor is already in the queue", 3500, 4);
  1641. else if(DidPlayerRequestElevator(playerid))
  1642. GameTextForPlayer(playerid, "~r~You already requested the elevator", 3500, 4);
  1643. else
  1644. {
  1645. if(strfind(inputtext, "hats", true) == 0 && IsAHitman(playerid))
  1646. {
  1647. CallElevator(playerid, 20);
  1648. }
  1649. else if(strfind(inputtext, LAElevatorFloorData[1][listitem], true) == 0)
  1650. {
  1651. CallElevator(playerid, listitem);
  1652. }
  1653. else
  1654. {
  1655. GameTextForPlayer(playerid, "~r~Invalid Password", 3500, 4);
  1656. }
  1657. }
  1658. }
  1659. if((dialogid == LAELEVATOR) && response)
  1660. {
  1661. if(FloorRequestedBy[listitem] != INVALID_PLAYER_ID || IsFloorInQueue(listitem))
  1662. GameTextForPlayer(playerid, "~r~The floor is already in the queue", 3500, 4);
  1663. else if(DidPlayerRequestElevator(playerid))
  1664. GameTextForPlayer(playerid, "~r~You already requested the elevator", 3500, 4);
  1665. else
  1666. {
  1667. if(strlen(LAElevatorFloorData[1][listitem]) > 0)
  1668. {
  1669. SetPVarInt(playerid, "ElevatorFloorPick", listitem);
  1670. ShowPlayerDialogEx(playerid, LAELEVATORPASS, DIALOG_STYLE_INPUT, "Elevator", "Enter the password for this level", "Enter", "Cancel");
  1671. }
  1672. else
  1673. {
  1674. CallElevator(playerid, listitem);
  1675. }
  1676. }
  1677. return 1;
  1678. }
  1679. if((dialogid == AUDIO_URL) && response) // /audiourl
  1680. {
  1681. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  1682. {
  1683. new range = GetPVarInt(playerid, "aURLrange");
  1684. new Float:aX, Float:aY, Float:aZ;
  1685. GetPlayerPos(playerid, aX, aY, aZ);
  1686. //SendAudioURLToRange(inputtext,aX,aY,aZ,range);
  1687. format(audiourlurl, sizeof(audiourlurl), "%s", inputtext);
  1688. SetGVarInt("MusicArea", CreateDynamicSphere(aX, aY, aZ, range, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
  1689. if(range > 100)
  1690. {
  1691. format(string,sizeof(string),"{AA3333}AdmWarning{FFFF00}: %s has placed url %s - Range: %d.",GetPlayerNameEx(playerid),inputtext,range);
  1692. ABroadCast(COLOR_YELLOW, string, 4);
  1693. format(string, sizeof(string),"Use /audiostopurl to stop playback");
  1694. SendClientMessage(playerid, COLOR_YELLOW, string);
  1695. }
  1696. else
  1697. {
  1698. format(string,sizeof(string),"You have placed url %s - Range: %d",inputtext,range);
  1699. SendClientMessage(playerid, COLOR_YELLOW, string);
  1700. format(string, sizeof(string),"Use /audiostopurl to stop playback");
  1701. SendClientMessage(playerid, COLOR_YELLOW, string);
  1702. }
  1703. }
  1704. }
  1705. /*if(dialogid == DIALOG_NUMBER_PLATE_CHOSEN) {
  1706. if(response == 1) {
  1707. for(new i = 0; i < MAX_PLAYERVEHICLES; i++) {
  1708. if(listitem == i) {
  1709. if(PlayerInfo[playerid][pDonateRank] > 0) {
  1710. new
  1711. tmpSz_NumPlate[32];
  1712. GetPVarString(playerid, "szNumPS", tmpSz_NumPlate, sizeof(tmpSz_NumPlate));
  1713. RegisterVehicleNumberPlate(PlayerVehicleInfo[playerid][i][pvId], tmpSz_NumPlate);
  1714. SetPVarInt(playerid, "Cash", PlayerInfo[playerid][pCash]-80000);
  1715. strcpy(PlayerVehicleInfo[playerid][i][pvNumberPlate], tmpSz_NumPlate, 32);
  1716. SendClientMessageEx(playerid, COLOR_WHITE, "Your registration plate has successfully been configured.");
  1717. }
  1718. else {
  1719. new
  1720. tmpSz_NumPlate[32];
  1721. GetPVarString(playerid, "szNumPS", tmpSz_NumPlate, sizeof(tmpSz_NumPlate));
  1722. RegisterVehicleNumberPlate(PlayerVehicleInfo[playerid][i][pvId], tmpSz_NumPlate);
  1723. strcpy(PlayerVehicleInfo[playerid][i][pvNumberPlate], tmpSz_NumPlate, 32);
  1724. SetPVarInt(playerid, "Cash", PlayerInfo[playerid][pCash]-100000);
  1725. SendClientMessageEx(playerid, COLOR_WHITE, "Your registration plate has successfully been configured.");
  1726. }
  1727. return 1;
  1728. }
  1729. }
  1730. }
  1731. }*/
  1732. if(dialogid == DIALOG_NUMBER_PLATE) {
  1733. if(response) {
  1734. if(strlen(inputtext) < 1 || strlen(inputtext) > 8) {
  1735. SendClientMessageEx(playerid, COLOR_WHITE, "{AA3333}ERROR:{FFFF00} You can only have a number plate that consists of 1-8 characters.");
  1736. }
  1737. else {
  1738. if(strfind("XMT", inputtext, true) != -1) {
  1739. SendClientMessageEx(playerid, COLOR_WHITE, "{AA3333}ERROR:{FFFF00} You cannot use the term \"XMT\" in your registration plate.");
  1740. return 1;
  1741. }
  1742. SetPVarString(playerid, "szNumPS", inputtext);
  1743. new
  1744. vstring[1024]; // ew, another 4096 bytes of memory down the drain
  1745. for(new i = 0; i < MAX_PLAYERVEHICLES; i++)
  1746. {
  1747. if(PlayerVehicleInfo[playerid][i][pvId] != INVALID_PLAYER_VEHICLE_ID)
  1748. {
  1749. format(vstring, sizeof(vstring), "%s\n%s", vstring, GetVehicleName(PlayerVehicleInfo[playerid][i][pvId]));
  1750. }
  1751. else
  1752. {
  1753. format(vstring, sizeof(vstring), "%s\nEmpty", vstring);
  1754. }
  1755. }
  1756. ShowPlayerDialogEx(playerid, DIALOG_NUMBER_PLATE_CHOSEN, DIALOG_STYLE_LIST, "Registration plate selection", vstring, "Select", "Cancel");
  1757. }
  1758. }
  1759. /*if(PlayerInfo[playerid][pDonateRank] > 0) {
  1760. PlayerInfo[playerid][pMoney] -= 80000;
  1761. SendClientMessageEx(playerid, COLOR_WHITE, "Your new number plate has been configured!");
  1762. RegisterVehicleNumberPlate();
  1763. }
  1764. else {
  1765. PlayerInfo[playerid][pMoney] -= 100000;
  1766. SendClientMessageEx(playerid, COLOR_WHITE, "Your new number plate has been configured!");
  1767. RegisterVehicleNumberPlate();
  1768. }*/
  1769. }
  1770. if(dialogid == NMUTE)
  1771. {
  1772. if(response == 1)
  1773. {
  1774. switch(listitem)
  1775. {
  1776. case 0: // Jailtime
  1777. {
  1778. if(PlayerInfo[playerid][pNMuteTotal] < 4)
  1779. {
  1780. if(GetPVarType(playerid, "IsInArena"))
  1781. {
  1782. LeavePaintballArena(playerid, GetPVarInt(playerid, "IsInArena"));
  1783. }
  1784. PlayerInfo[playerid][pNMute] = 0;
  1785. ResetPlayerWeaponsEx(playerid);
  1786. PlayerInfo[playerid][pJailTime] += PlayerInfo[playerid][pNMuteTotal]*15*60;
  1787. strcpy(PlayerInfo[playerid][pPrisonReason], "[OOC] NMute Prison", 128);
  1788. PhoneOnline[playerid] = 1;
  1789. SetPlayerInterior(playerid, 1);
  1790. PlayerInfo[playerid][pInt] = 1;
  1791. new rand = random(sizeof(OOCPrisonSpawns));
  1792. Streamer_UpdateEx(playerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
  1793. SetPlayerPos(playerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
  1794. SetPlayerSkin(playerid, 50);
  1795. SetPlayerColor(playerid, TEAM_APRISON_COLOR);
  1796. Player_StreamPrep(playerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2], FREEZE_TIME);
  1797. }
  1798. else if(PlayerInfo[playerid][pNMuteTotal] >= 4 || PlayerInfo[playerid][pNMuteTotal] < 7)
  1799. {
  1800. if(GetPVarType(playerid, "IsInArena"))
  1801. {
  1802. LeavePaintballArena(playerid, GetPVarInt(playerid, "IsInArena"));
  1803. }
  1804. PlayerInfo[playerid][pNMute] = 0;
  1805. GameTextForPlayer(playerid, "~w~Welcome to ~n~~r~Fort DeMorgan", 5000, 3);
  1806. ResetPlayerWeaponsEx(playerid);
  1807. PlayerInfo[playerid][pJailTime] += PlayerInfo[playerid][pNMuteTotal]*15*60;
  1808. PhoneOnline[playerid] = 1;
  1809. SetPlayerInterior(playerid, 1);
  1810. PlayerInfo[playerid][pInt] = 1;
  1811. new rand = random(sizeof(OOCPrisonSpawns));
  1812. Streamer_UpdateEx(playerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
  1813. SetPlayerPos(playerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
  1814. SetPlayerSkin(playerid, 50);
  1815. SetPlayerColor(playerid, TEAM_APRISON_COLOR);
  1816. Player_StreamPrep(playerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2], FREEZE_TIME);
  1817. }
  1818. strcpy(PlayerInfo[playerid][pPrisonReason], "[OOC][NEWB-UNMUTE]", 128);
  1819. format(string,sizeof(string),"{AA3333}AdmWarning{FFFF00}: %s is serving %d Minutes in Jail/Prison for Newbie Unmute.",GetPlayerNameEx(playerid),PlayerInfo[playerid][pNMuteTotal]*15);
  1820. ABroadCast(COLOR_YELLOW,string,2);
  1821. }
  1822. case 1: // Fine
  1823. {
  1824. new playername[MAX_PLAYER_NAME];
  1825. GetPlayerName(playerid, playername, sizeof(playername));
  1826. new totalwealth = PlayerInfo[playerid][pAccount] + GetPlayerCash(playerid);
  1827. if(PlayerInfo[playerid][pPhousekey] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwnerID] == GetPlayerSQLId(playerid)) totalwealth += HouseInfo[PlayerInfo[playerid][pPhousekey]][hSafeMoney];
  1828. if(PlayerInfo[playerid][pPhousekey2] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[playerid][pPhousekey2]][hOwnerID] == GetPlayerSQLId(playerid)) totalwealth += HouseInfo[PlayerInfo[playerid][pPhousekey2]][hSafeMoney];
  1829. if(PlayerInfo[playerid][pPhousekey3] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[playerid][pPhousekey3]][hOwnerID] == GetPlayerSQLId(playerid)) totalwealth += HouseInfo[PlayerInfo[playerid][pPhousekey3]][hSafeMoney];
  1830. new fine = 10 * totalwealth / 100;
  1831. if(GetPlayerCash(playerid) < fine || totalwealth < 0)
  1832. {
  1833. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has declined the Newbie Unmute (Insufficient Funds).", GetPlayerNameEx(playerid));
  1834. ABroadCast(COLOR_YELLOW, string, 2);
  1835. return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot afford an unmute!");
  1836. }
  1837. format(string,sizeof(string),"{AA3333}AdmWarning{FFFF00}: %s has paid a $%d fine for Newbie Chat Unmute.",GetPlayerNameEx(playerid),fine);
  1838. GivePlayerCash(playerid,-fine);
  1839. ABroadCast(COLOR_YELLOW,string,2);
  1840. PlayerInfo[playerid][pNMute] = 0;
  1841. }
  1842. }
  1843. }
  1844. else
  1845. {
  1846. format(string,sizeof(string),"{AA3333}AdmWarning{FFFF00}: %s has canceled punishment for Newbie Chat Unmute.",GetPlayerNameEx(playerid));
  1847. ABroadCast(COLOR_YELLOW,string,2);
  1848. }
  1849. }
  1850. if(dialogid == ADMUTE)
  1851. {
  1852. if(response == 1)
  1853. {
  1854. switch(listitem)
  1855. {
  1856. case 0: // Jailtime
  1857. {
  1858. if(PlayerInfo[playerid][pADMuteTotal] < 4)
  1859. {
  1860. if(GetPVarType(playerid, "IsInArena"))
  1861. {
  1862. LeavePaintballArena(playerid, GetPVarInt(playerid, "IsInArena"));
  1863. }
  1864. PlayerInfo[playerid][pADMute] = 0;
  1865. ResetPlayerWeaponsEx(playerid);
  1866. PlayerInfo[playerid][pJailTime] += PlayerInfo[playerid][pADMuteTotal]*15*60;
  1867. PhoneOnline[playerid] = 1;
  1868. SetPlayerInterior(playerid, 1);
  1869. PlayerInfo[playerid][pInt] = 1;
  1870. new rand = random(sizeof(OOCPrisonSpawns));
  1871. Streamer_UpdateEx(playerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
  1872. SetPlayerPos(playerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
  1873. SetPlayerSkin(playerid, 50);
  1874. SetPlayerColor(playerid, TEAM_APRISON_COLOR);
  1875. Player_StreamPrep(playerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2], FREEZE_TIME);
  1876. }
  1877. else if(PlayerInfo[playerid][pADMuteTotal] >= 4 || PlayerInfo[playerid][pADMuteTotal] < 7)
  1878. {
  1879. if(GetPVarType(playerid, "IsInArena"))
  1880. {
  1881. LeavePaintballArena(playerid, GetPVarInt(playerid, "IsInArena"));
  1882. }
  1883. PlayerInfo[playerid][pADMute] = 0;
  1884. GameTextForPlayer(playerid, "~w~Welcome to ~n~~r~Fort DeMorgan", 5000, 3);
  1885. ResetPlayerWeaponsEx(playerid);
  1886. PlayerInfo[playerid][pJailTime] += PlayerInfo[playerid][pADMuteTotal]*15*60;
  1887. PhoneOnline[playerid] = 1;
  1888. SetPlayerInterior(playerid, 1);
  1889. PlayerInfo[playerid][pInt] = 1;
  1890. new rand = random(sizeof(OOCPrisonSpawns));
  1891. Streamer_UpdateEx(playerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
  1892. SetPlayerPos(playerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
  1893. SetPlayerSkin(playerid, 50);
  1894. SetPlayerColor(playerid, TEAM_APRISON_COLOR);
  1895. Player_StreamPrep(playerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2], FREEZE_TIME);
  1896. }
  1897. strcpy(PlayerInfo[playerid][pPrisonReason], "[OOC][AD-UNMUTE]", 128);
  1898. format(string,sizeof(string),"{AA3333}AdmWarning{FFFF00}: %s is serving %d Minutes in Jail/Prison for Advertisement Unmute.",GetPlayerNameEx(playerid),PlayerInfo[playerid][pADMuteTotal]*15);
  1899. ABroadCast(COLOR_YELLOW,string,2);
  1900. }
  1901. case 1: // Fine
  1902. {
  1903. new playername[MAX_PLAYER_NAME];
  1904. GetPlayerName(playerid, playername, sizeof(playername));
  1905. new totalwealth = PlayerInfo[playerid][pAccount] + GetPlayerCash(playerid);
  1906. if(PlayerInfo[playerid][pPhousekey] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwnerID] == GetPlayerSQLId(playerid)) totalwealth += HouseInfo[PlayerInfo[playerid][pPhousekey]][hSafeMoney];
  1907. if(PlayerInfo[playerid][pPhousekey2] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[playerid][pPhousekey2]][hOwnerID] == GetPlayerSQLId(playerid)) totalwealth += HouseInfo[PlayerInfo[playerid][pPhousekey2]][hSafeMoney];
  1908. if(PlayerInfo[playerid][pPhousekey3] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[playerid][pPhousekey3]][hOwnerID] == GetPlayerSQLId(playerid)) totalwealth += HouseInfo[PlayerInfo[playerid][pPhousekey3]][hSafeMoney];
  1909. new fine = 10 * totalwealth / 100;
  1910. if(GetPlayerCash(playerid) < fine)
  1911. {
  1912. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has declined the Advertisement Unmute (Insufficient Funds).", GetPlayerNameEx(playerid));
  1913. ABroadCast(COLOR_YELLOW, string, 2);
  1914. return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot afford an unmute!");
  1915. }
  1916. PlayerInfo[playerid][pADMute] = 0;
  1917. format(string,sizeof(string),"{AA3333}AdmWarning{FFFF00}: %s has paid a $%d fine for Advertisement Unmute.",GetPlayerNameEx(playerid),fine);
  1918. GivePlayerCash(playerid,-fine);
  1919. ABroadCast(COLOR_YELLOW,string,2);
  1920. }
  1921. }
  1922. }
  1923. else
  1924. {
  1925. format(string,sizeof(string),"{AA3333}AdmWarning{FFFF00}: %s has canceled punishment for Advertisement Unmute.",GetPlayerNameEx(playerid));
  1926. ABroadCast(COLOR_YELLOW,string,2);
  1927. }
  1928. }
  1929. if(dialogid == RTONEMENU) // Ringtone Menu
  1930. {
  1931. if(response == 1)
  1932. {
  1933. switch(listitem)
  1934. {
  1935. case 0:
  1936. {
  1937. PlayerInfo[playerid][pRingtone] = 1;
  1938. //SendAudioToPlayer(playerid, 51, 100);
  1939. }
  1940. case 1:
  1941. {
  1942. PlayerInfo[playerid][pRingtone] = 2;
  1943. //SendAudioToPlayer(playerid, 52, 100);
  1944. }
  1945. case 2:
  1946. {
  1947. PlayerInfo[playerid][pRingtone] = 3;
  1948. //SendAudioToPlayer(playerid, 53, 100);
  1949. }
  1950. case 3:
  1951. {
  1952. PlayerInfo[playerid][pRingtone] = 4;
  1953. //SendAudioToPlayer(playerid, 54, 100);
  1954. }
  1955. case 4:
  1956. {
  1957. PlayerInfo[playerid][pRingtone] = 5;
  1958. //SendAudioToPlayer(playerid, 55, 100);
  1959. }
  1960. case 5:
  1961. {
  1962. PlayerInfo[playerid][pRingtone] = 6;
  1963. //SendAudioToPlayer(playerid, 56, 100);
  1964. }
  1965. case 6:
  1966. {
  1967. PlayerInfo[playerid][pRingtone] = 7;
  1968. //SendAudioToPlayer(playerid, 57, 100);
  1969. }
  1970. case 7:
  1971. {
  1972. PlayerInfo[playerid][pRingtone] = 8;
  1973. //SendAudioToPlayer(playerid, 58, 100);
  1974. }
  1975. case 8:
  1976. {
  1977. PlayerInfo[playerid][pRingtone] = 9;
  1978. //SendAudioToPlayer(playerid, 59, 100);
  1979. }
  1980. case 9:
  1981. {
  1982. PlayerInfo[playerid][pRingtone] = 0;
  1983. }
  1984. }
  1985. RemovePlayerAttachedObject(playerid, 8);
  1986. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  1987. }
  1988. }
  1989. if(dialogid == MAINMENU || dialogid == MAINMENU2)
  1990. {
  1991. if(response == 0)
  1992. {
  1993. SendClientMessage(playerid, COLOR_RED, "SERVER: You have been kicked out automatically.");
  1994. SetTimerEx("KickEx", 1000, 0, "i", playerid);
  1995. }
  1996. else if(dialogid == MAINMENU)
  1997. {
  1998. if(!isnull(inputtext) && strlen(inputtext) <= 64 && gPlayerLogged{playerid} == 0)
  1999. {
  2000. SetPVarString(playerid, "PassAuth", inputtext);
  2001. g_mysql_AccountLoginCheck(playerid);
  2002. }
  2003. else
  2004. {
  2005. ShowMainMenuDialog(playerid, 1);
  2006. }
  2007. }
  2008. else if(dialogid == MAINMENU2)
  2009. {
  2010. if(PassComplexCheck && CheckPasswordComplexity(inputtext) != 1) return ShowMainMenuDialog(playerid, 2);
  2011. if(!isnull(inputtext) && strlen(inputtext) <= 64)
  2012. {
  2013. SetPVarString(playerid, "PassAuth", inputtext);
  2014. g_mysql_CreateAccount(playerid, inputtext);
  2015. }
  2016. else ShowMainMenuDialog(playerid, 2);
  2017. }
  2018. return 1;
  2019. }
  2020. if(dialogid == MAINMENU3)
  2021. {
  2022. Kick(playerid);
  2023. }
  2024. if (dialogid == ELEVATOR3 && response)
  2025. {
  2026. if (listitem == 0)
  2027. {
  2028. SetPlayerPos(playerid, 1564.8, -1666.2, 28.3);
  2029. SetPlayerInterior(playerid, 0);
  2030. PlayerInfo[playerid][pVW] = 0;
  2031. SetPlayerVirtualWorld(playerid, 0);
  2032. }
  2033. else
  2034. {
  2035. SetPlayerPos(playerid, 1568.6676, -1689.9708, 6.2188);
  2036. SetPlayerInterior(playerid, 0);
  2037. PlayerInfo[playerid][pVW] = 0;
  2038. SetPlayerVirtualWorld(playerid, 0);
  2039. }
  2040. }
  2041. if (dialogid == ELEVATOR && response)
  2042. {
  2043. if (listitem == 0)
  2044. {
  2045. SetPlayerPos(playerid, 276.0980, 122.1232, 1004.6172);
  2046. SetPlayerInterior(playerid, 10);
  2047. PlayerInfo[playerid][pVW] = 133337;
  2048. SetPlayerVirtualWorld(playerid, 133337);
  2049. }
  2050. else
  2051. {
  2052. SetPlayerPos(playerid, 1568.6676, -1689.9708, 6.2188);
  2053. SetPlayerInterior(playerid, 0);
  2054. PlayerInfo[playerid][pVW] = 0;
  2055. SetPlayerVirtualWorld(playerid, 0);
  2056. }
  2057. }
  2058. if (dialogid == ELEVATOR2 && response)
  2059. {
  2060. if (listitem == 0)
  2061. {
  2062. SetPlayerPos(playerid, 1564.8, -1666.2, 28.3);
  2063. SetPlayerInterior(playerid, 0);
  2064. PlayerInfo[playerid][pVW] = 0;
  2065. SetPlayerVirtualWorld(playerid, 0);
  2066. }
  2067. else
  2068. {
  2069. SetPlayerPos(playerid, 276.0980, 122.1232, 1004.6172);
  2070. SetPlayerInterior(playerid, 10);
  2071. PlayerInfo[playerid][pVW] = 133337;
  2072. SetPlayerVirtualWorld(playerid, 133337);
  2073. }
  2074. }
  2075. if(dialogid == VIPNUMMENU)
  2076. {
  2077. if(response)
  2078. {
  2079. new numberstr = -abs(strval(inputtext));
  2080. if(!(1 < strlen(inputtext) < 9) || strval(inputtext) == 0) { return ShowPlayerDialogEx(playerid, VIPNUMMENU, DIALOG_STYLE_INPUT, "Error", "The phone number can only be between 2 and 8 digits long. Please input a new number below", "Submit", "Cancel"); }
  2081. new query[128];
  2082. new numb[16];
  2083. format(numb, sizeof(numb), "%d", numberstr);
  2084. new checkmon = GetPlayerCash(playerid);
  2085. if(PlayerInfo[playerid][pPnumber] == numberstr)
  2086. {
  2087. SendClientMessageEx(playerid,COLOR_GREY," Cannot change to your existing number");
  2088. return 1;
  2089. }
  2090. if(strlen(numb) == 2) return ShowPlayerDialogEx(playerid, VIPNUMMENU, DIALOG_STYLE_INPUT, "Error", "The phone number can only be between 2 and 10 digits long. Please input a new number below", "Submit", "Cancel");
  2091. if(strlen(numb) == 3)
  2092. {
  2093. new iCheck = abs(checkmon * 30/100);
  2094. if(GetPlayerCash(playerid) <= iCheck)
  2095. {
  2096. SendClientMessageEx(playerid, COLOR_WHITE, "You don't have enough money for the phone number!");
  2097. return 1;
  2098. }
  2099. if(GetPlayerCash(playerid) >= 1000000)
  2100. {
  2101. SetPVarInt(playerid, "WantedPh", numberstr);
  2102. SetPVarInt(playerid, "CurrentPh", PlayerInfo[playerid][pPnumber]);
  2103. SetPVarInt(playerid, "PhChangeCost", iCheck);
  2104. mysql_format(MainPipeline, query, sizeof(query), "SELECT `Username` FROM `accounts` WHERE `PhoneNr` = '%d'", numberstr);
  2105. mysql_tquery(MainPipeline, query, "OnPhoneNumberCheck", "ii", playerid, 1);
  2106. return 1;
  2107. }
  2108. else if(GetPlayerCash(playerid) >= 300000 && GetPlayerCash(playerid) < 1000000)
  2109. {
  2110. SetPVarInt(playerid, "WantedPh", numberstr);
  2111. SetPVarInt(playerid, "CurrentPh", PlayerInfo[playerid][pPnumber]);
  2112. SetPVarInt(playerid, "PhChangeCost", 300000);
  2113. mysql_format(MainPipeline, query, sizeof(query), "SELECT `Username` FROM `accounts` WHERE `PhoneNr` = '%d'",numberstr);
  2114. mysql_tquery(MainPipeline, query, "OnPhoneNumberCheck", "ii", playerid, 1);
  2115. return 1;
  2116. }
  2117. else
  2118. {
  2119. SendClientMessageEx(playerid,COLOR_GREY," You do not have enough money to purchase a negative 2 digit number, try again.");
  2120. return 1;
  2121. }
  2122. }
  2123. else if(strlen(numb) == 4)
  2124. {
  2125. new iCheck = abs(checkmon * 20/100);
  2126. if(GetPlayerCash(playerid) <= iCheck)
  2127. {
  2128. SendClientMessageEx(playerid, COLOR_WHITE, "You don't have enough money for the phone number!");
  2129. return 1;
  2130. }
  2131. if(GetPlayerCash(playerid) >= 1000000)
  2132. {
  2133. SetPVarInt(playerid, "WantedPh", numberstr);
  2134. SetPVarInt(playerid, "CurrentPh", PlayerInfo[playerid][pPnumber]);
  2135. SetPVarInt(playerid, "PhChangeCost", iCheck);
  2136. mysql_format(MainPipeline, query, sizeof(query), "SELECT `Username` FROM `accounts` WHERE `PhoneNr` = '%d'",numberstr);
  2137. mysql_tquery(MainPipeline, query, "OnPhoneNumberCheck", "ii", playerid, 1);
  2138. return 1;
  2139. }
  2140. else if(GetPlayerCash(playerid) >= 200000 && GetPlayerCash(playerid) < 1000000)
  2141. {
  2142. SetPVarInt(playerid, "WantedPh", numberstr);
  2143. SetPVarInt(playerid, "CurrentPh", PlayerInfo[playerid][pPnumber]);
  2144. SetPVarInt(playerid, "PhChangeCost", 200000);
  2145. mysql_format(MainPipeline, query, sizeof(query), "SELECT `Username` FROM `accounts` WHERE `PhoneNr` = '%d'",numberstr);
  2146. mysql_tquery(MainPipeline, query, "OnPhoneNumberCheck", "ii", playerid, 1);
  2147. return 1;
  2148. }
  2149. else
  2150. {
  2151. SendClientMessageEx(playerid,COLOR_GREY," You do not have enough money to purchase a negative 3 digit number, try again.");
  2152. return 1;
  2153. }
  2154. }
  2155. else if(strlen(numb) >= 5 && strlen(numb) <= 9)
  2156. {
  2157. new iCheck = abs(checkmon * 10/100);
  2158. if(GetPlayerCash(playerid) <= iCheck)
  2159. {
  2160. SendClientMessageEx(playerid, COLOR_WHITE, "You don't have enough money for the phone number!");
  2161. return 1;
  2162. }
  2163. if(GetPlayerCash(playerid) >= 500000)
  2164. {
  2165. SetPVarInt(playerid, "WantedPh", numberstr);
  2166. SetPVarInt(playerid, "CurrentPh", PlayerInfo[playerid][pPnumber]);
  2167. SetPVarInt(playerid, "PhChangeCost", iCheck);
  2168. mysql_format(MainPipeline, query, sizeof(query), "SELECT `Username` FROM `accounts` WHERE `PhoneNr` = '%d'",numberstr);
  2169. mysql_tquery(MainPipeline, query, "OnPhoneNumberCheck", "ii", playerid, 1);
  2170. return 1;
  2171. }
  2172. else if(GetPlayerCash(playerid) >= 50000 && GetPlayerCash(playerid) < 500000)
  2173. {
  2174. SetPVarInt(playerid, "WantedPh", numberstr);
  2175. SetPVarInt(playerid, "CurrentPh", PlayerInfo[playerid][pPnumber]);
  2176. SetPVarInt(playerid, "PhChangeCost", 50000);
  2177. mysql_format(MainPipeline, query, sizeof(query), "SELECT `Username` FROM `accounts` WHERE `PhoneNr` = '%d'",numberstr);
  2178. mysql_tquery(MainPipeline, query, "OnPhoneNumberCheck", "ii", playerid, 1);
  2179. return 1;
  2180. }
  2181. else
  2182. {
  2183. SendClientMessageEx(playerid,COLOR_GREY," You do not have enough money to purchase a negative 2 digit number, try again.");
  2184. return 1;
  2185. }
  2186. }
  2187. else return SendClientMessageEx(playerid,COLOR_GREY," Unable to change your number!");
  2188. }
  2189. else
  2190. {
  2191. SendClientMessageEx(playerid,COLOR_GREY," You chose not to change numbers.");
  2192. }
  2193. }
  2194. if(dialogid == VIPNUMMENU2)
  2195. {
  2196. if(response)
  2197. {
  2198. SendClientMessageEx(playerid, COLOR_GREEN, "________________________________________________");
  2199. SendClientMessageEx(playerid, COLOR_YELLOW, "Phone number is not being used, updating your phone number.");
  2200. format(string,sizeof(string),"You have changed numbers from %d, to %d, and it cost $%s", GetPVarInt(playerid, "CurrentPh"), GetPVarInt(playerid, "WantedPh"), number_format(GetPVarInt(playerid, "PhChangeCost")));
  2201. SendClientMessageEx(playerid,COLOR_GREY,string);
  2202. PlayerInfo[playerid][pPnumber] = GetPVarInt(playerid, "WantedPh");
  2203. new iCost = abs(GetPVarInt(playerid, "PhChangeCost"));
  2204. GivePlayerCash(playerid, -iCost);
  2205. mysql_format(MainPipeline, string, sizeof(string), "UPDATE `accounts` SET `PhoneNr` = %d WHERE `id` = '%d'", PlayerInfo[playerid][pPnumber], GetPlayerSQLId(playerid));
  2206. mysql_tquery(MainPipeline, string, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
  2207. DeletePVar(playerid, "PhChangerId");
  2208. DeletePVar(playerid, "WantedPh");
  2209. DeletePVar(playerid, "PhChangeCost");
  2210. DeletePVar(playerid, "CurrentPh");
  2211. }
  2212. else
  2213. {
  2214. SendClientMessageEx(playerid,COLOR_GREY," You chose not to change numbers.");
  2215. DeletePVar(playerid, "PhChangerId");
  2216. DeletePVar(playerid, "WantedPh");
  2217. DeletePVar(playerid, "PhChangeCost");
  2218. DeletePVar(playerid, "CurrentPh");
  2219. }
  2220. }
  2221. /*if(dialogid == RENTMENU)
  2222. {
  2223. if(response)
  2224. {
  2225. switch(listitem)
  2226. {
  2227. case 0://15 Minutes
  2228. {
  2229. if(GetPlayerCash(playerid) < 1000)
  2230. {
  2231. SendClientMessageEx(playerid, COLOR_GRAD1, "You don't have enough money!");
  2232. RemovePlayerFromVehicle(playerid);
  2233. new Float:slx, Float:sly, Float:slz;
  2234. GetPlayerPos(playerid, slx, sly, slz);
  2235. SetPlayerPos(playerid, slx, sly, slz+1.2);
  2236. TogglePlayerControllable(playerid,1);
  2237. }
  2238. else
  2239. {
  2240. GivePlayerCash(playerid,-1000);
  2241. gBike[playerid] = 3;
  2242. gBikeRenting[playerid] = 1;
  2243. TogglePlayerControllable(playerid, 1);
  2244. SendClientMessageEx(playerid,COLOR_GREY," You have rented a bike for 15 minutes, enjoy!");
  2245. SetPVarInt(playerid, "RentTime", SetTimerEx("RentTimer", (1000*60)*15, true, "d", playerid));
  2246. }
  2247. }
  2248. case 1: // 30 minutes
  2249. {
  2250. if(GetPlayerCash(playerid) < 2000)
  2251. {
  2252. SendClientMessageEx(playerid, COLOR_GRAD1, "You don't have enough money!");
  2253. RemovePlayerFromVehicle(playerid);
  2254. new Float:slx, Float:sly, Float:slz;
  2255. GetPlayerPos(playerid, slx, sly, slz);
  2256. SetPlayerPos(playerid, slx, sly, slz+1.2);
  2257. TogglePlayerControllable(playerid,1);
  2258. }
  2259. else
  2260. {
  2261. GivePlayerCash(playerid,-2000);
  2262. gBike[playerid] = 6;
  2263. gBikeRenting[playerid] = 1;
  2264. TogglePlayerControllable(playerid, 1);
  2265. SendClientMessageEx(playerid,COLOR_GREY," You have rented a bike for 30 minutes, enjoy!");
  2266. SetPVarInt(playerid, "RentTime", SetTimerEx("RentTimer", (1000*60)*30, true, "d", playerid));
  2267. }
  2268. }
  2269. case 2: // 1 hour
  2270. {
  2271. if(GetPlayerCash(playerid) < 4000)
  2272. {
  2273. SendClientMessageEx(playerid, COLOR_GRAD1, "You don't have enough money!");
  2274. RemovePlayerFromVehicle(playerid);
  2275. new Float:slx, Float:sly, Float:slz;
  2276. GetPlayerPos(playerid, slx, sly, slz);
  2277. SetPlayerPos(playerid, slx, sly, slz+1.2);
  2278. TogglePlayerControllable(playerid,1);
  2279. }
  2280. else
  2281. {
  2282. GivePlayerCash(playerid,-4000);
  2283. gBike[playerid] = 12;
  2284. gBikeRenting[playerid] = 1;
  2285. TogglePlayerControllable(playerid, 1);
  2286. SendClientMessageEx(playerid,COLOR_GREY," You have rented a bike for an hour, enjoy!");
  2287. SetPVarInt(playerid, "RentTime", SetTimerEx("RentTimer", (1000*60)*60, true, "d", playerid));
  2288. }
  2289. }
  2290. }
  2291. }
  2292. if(!response)
  2293. {
  2294. RemovePlayerFromVehicle(playerid);
  2295. new Float:slx, Float:sly, Float:slz;
  2296. GetPlayerPos(playerid, slx, sly, slz);
  2297. SetPlayerPos(playerid, slx, sly, slz+1.2);
  2298. TogglePlayerControllable(playerid,1);
  2299. SendClientMessageEx(playerid,COLOR_GREY," You may only use these bikes if you rent one.");
  2300. }
  2301. }*/
  2302. if(dialogid == 1348)
  2303. {
  2304. if(response)
  2305. {
  2306. new
  2307. Float: carPosF[3],
  2308. miscid = GetPVarInt(playerid, "playeraffectedcarTP"),
  2309. v = ListItemTrackId[playerid][listitem];
  2310. GetVehiclePos(PlayerVehicleInfo[miscid][v][pvId], carPosF[0], carPosF[1], carPosF[2]);
  2311. SetPlayerVirtualWorld(playerid,GetVehicleVirtualWorld(PlayerVehicleInfo[miscid][v][pvId]));
  2312. SetPlayerPos(playerid, carPosF[0], carPosF[1], carPosF[2]);
  2313. }
  2314. }
  2315. if(dialogid == GOTOPLAYERCAR)
  2316. {
  2317. if(response == 1)
  2318. {
  2319. for(new i = 0; i < MAX_PLAYERVEHICLES; i++)
  2320. {
  2321. if(listitem == i)
  2322. {
  2323. new Float: carPos[3], id = GetPVarInt(playerid, "playeraffectedcarTP");
  2324. if(PlayerVehicleInfo[id][i][pvId] > INVALID_PLAYER_VEHICLE_ID)
  2325. {
  2326. GetVehiclePos(PlayerVehicleInfo[id][i][pvId], carPos[0], carPos[1], carPos[2]);
  2327. SetPlayerVirtualWorld(playerid,GetVehicleVirtualWorld(PlayerVehicleInfo[id][i][pvId]));
  2328. SetPlayerInterior(playerid,0);
  2329. SetPlayerPos(playerid, carPos[0], carPos[1], carPos[2]);
  2330. }
  2331. else
  2332. {
  2333. SendClientMessageEx(playerid, COLOR_WHITE, "You can not teleport to an empty, disabled or impounded slot.");
  2334. }
  2335. }
  2336. }
  2337. }
  2338. }
  2339. if(dialogid == VEHICLESTORAGE && response) {
  2340. //if(!(400 <= PlayerVehicleInfo[playerid][listitem][pvModelId] <= 611))
  2341. //printf("DEBUG: listitem: %d, Vehicle Slots: %d", listitem, GetPlayerVehicleSlots(playerid));
  2342. if(listitem == GetPlayerVehicleSlots(playerid)) {
  2343. new szstring[128];
  2344. SetPVarInt(playerid, "MiscShop", 7);
  2345. format(szstring, sizeof(szstring), "Additional Vehicle Slot\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[23][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[23][sItemPrice]));
  2346. return ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Purchase a additional vehicle slot", szstring, "Purchase", "Cancel");
  2347. }
  2348. if(PlayerVehicleInfo[playerid][listitem][pvSpawned]) {
  2349. new
  2350. iVehicleID = PlayerVehicleInfo[playerid][listitem][pvId];
  2351. if((!IsVehicleOccupied(iVehicleID) || IsPlayerInVehicle(playerid, iVehicleID)) && !IsVehicleInTow(iVehicleID) && !PlayerVehicleInfo[playerid][listitem][pvBeingPickLocked]) {
  2352. new
  2353. Float: vehiclehealth;
  2354. GetVehicleHealth(iVehicleID, vehiclehealth);
  2355. if(vehiclehealth < 800) {
  2356. SendClientMessageEx(playerid, COLOR_WHITE, "This vehicle is too damaged to be stored.");
  2357. }
  2358. else if (GetPVarInt(playerid, "Refueling") == PlayerVehicleInfo[playerid][listitem][pvId])
  2359. SendClientMessageEx(playerid, COLOR_WHITE, "You can not store a vehicle while it is being refueled.");
  2360. else if (WheelClamp{PlayerVehicleInfo[playerid][listitem][pvId]})
  2361. SendClientMessageEx(playerid, COLOR_WHITE, "You can not store this vehicle at this moment.");
  2362. else {
  2363. --PlayerCars;
  2364. VehicleSpawned[playerid]--;
  2365. PlayerVehicleInfo[playerid][listitem][pvSpawned] = 0;
  2366. PlayerVehicleInfo[playerid][listitem][pvFuel] = VehicleFuel[iVehicleID];
  2367. GetVehicleHealth(PlayerVehicleInfo[playerid][listitem][pvId], PlayerVehicleInfo[playerid][listitem][pvHealth]);
  2368. DestroyVehicle(iVehicleID);
  2369. if(IsValidDynamicArea(iVehEnterAreaID[iVehicleID])) DestroyDynamicArea(iVehEnterAreaID[iVehicleID]);
  2370. PlayerVehicleInfo[playerid][listitem][pvId] = INVALID_PLAYER_VEHICLE_ID;
  2371. g_mysql_SaveVehicle(playerid, listitem);
  2372. new vstring[128];
  2373. format(vstring, sizeof(vstring), "You have stored your %s. The vehicle has been despawned.", VehicleName[PlayerVehicleInfo[playerid][listitem][pvModelId] - 400]);
  2374. SendClientMessageEx(playerid, COLOR_WHITE, vstring);
  2375. CheckPlayerVehiclesForDesync(playerid);
  2376. }
  2377. }
  2378. else SendClientMessageEx(playerid, COLOR_WHITE, "This vehicle is currently occupied - it cannot be despawned right now.");
  2379. }
  2380. else if(PlayerVehicleInfo[playerid][listitem][pvImpounded]) {
  2381. SendClientMessageEx(playerid, COLOR_WHITE, "You can not spawn an impounded vehicle. If you wish to reclaim it, do so at the DMV in Dillimore.");
  2382. }
  2383. else if(PlayerVehicleInfo[playerid][listitem][pvDisabled]) {
  2384. SendClientMessageEx(playerid, COLOR_WHITE, "You can not spawn a disabled vehicle. It is disabled due to your VIP level (vehicle restrictions).");
  2385. }
  2386. else if((PlayerInfo[playerid][pRVehRestricted] > gettime() || PlayerVehicleInfo[playerid][listitem][pvRestricted] > gettime()) && IsRestrictedVehicle(PlayerVehicleInfo[playerid][listitem][pvModelId]))
  2387. {
  2388. SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to spawn this restricted vehicle.");
  2389. }
  2390. else if(!PlayerVehicleInfo[playerid][listitem][pvSpawned]) {
  2391. if(PlayerInfo[playerid][pDonateRank] == 0 && VehicleSpawned[playerid] >= 2) {
  2392. SendClientMessageEx(playerid, COLOR_GREY, "As non-VIP you can only have 2 vehicles spawned. You must store a vehicle in order to spawn another one.");
  2393. }
  2394. else if(PlayerInfo[playerid][pDonateRank] == 1 && VehicleSpawned[playerid] >= 2) {
  2395. SendClientMessageEx(playerid, COLOR_GREY, "As Bronze VIP you can only have 2 vehicles spawned. You must store a vehicle in order to spawn another one.");
  2396. }
  2397. else if(PlayerInfo[playerid][pDonateRank] == 2 && VehicleSpawned[playerid] >= 2) {
  2398. SendClientMessageEx(playerid, COLOR_GREY, "As Silver VIP you can only have 2 vehicles spawned. You must store a vehicle in order to spawn another one.");
  2399. }
  2400. else if(PlayerInfo[playerid][pDonateRank] == 3 && VehicleSpawned[playerid] >= 3) {
  2401. SendClientMessageEx(playerid, COLOR_GREY, "As Gold VIP you can only have 3 vehicles spawned. You must store a vehicle in order to spawn another one.");
  2402. }
  2403. else if(PlayerInfo[playerid][pDonateRank] == 4 && VehicleSpawned[playerid] >= 5) {
  2404. SendClientMessageEx(playerid, COLOR_GREY, "As Platinum VIP you can only have 5 vehicles spawned. You must store a vehicle in order to spawn another one.");
  2405. }
  2406. else if(!(0 <= PlayerInfo[playerid][pDonateRank] <= 4)) {
  2407. SendClientMessageEx(playerid, COLOR_GREY, "You have an invalid VIP level.");
  2408. }
  2409. else if((PlayerVehicleInfo[playerid][listitem][pvModelId]) < 400) {
  2410. SendClientMessageEx(playerid, COLOR_GREY, "The vehicle slot is empty.");
  2411. }
  2412. else {
  2413. new
  2414. iVeh = CreateVehicle(PlayerVehicleInfo[playerid][listitem][pvModelId], PlayerVehicleInfo[playerid][listitem][pvPosX], PlayerVehicleInfo[playerid][listitem][pvPosY], (PlayerVehicleInfo[playerid][listitem][pvModelId] == 460) ? PlayerVehicleInfo[playerid][listitem][pvPosZ]+5 : PlayerVehicleInfo[playerid][listitem][pvPosZ], PlayerVehicleInfo[playerid][listitem][pvPosAngle],PlayerVehicleInfo[playerid][listitem][pvColor1], PlayerVehicleInfo[playerid][listitem][pvColor2], -1);
  2415. SetVehicleVirtualWorld(iVeh, PlayerVehicleInfo[playerid][listitem][pvVW]);
  2416. LinkVehicleToInterior(iVeh, PlayerVehicleInfo[playerid][listitem][pvInt]);
  2417. switch(GetVehicleModel(iVeh)) {
  2418. case 519, 553, 508: {
  2419. iVehEnterAreaID[iVeh] = CreateDynamicSphere(PlayerVehicleInfo[playerid][listitem][pvPosX]+2, PlayerVehicleInfo[playerid][listitem][pvPosY], PlayerVehicleInfo[playerid][listitem][pvPosZ], 4, GetVehicleVirtualWorld(iVeh));
  2420. AttachDynamicAreaToVehicle(iVehEnterAreaID[iVeh], iVeh);
  2421. // Streamer_SetIntData(STREAMER_TYPE_AREA, iVehEnterAreaID[iVeh], E_STREAMER_EXTRA_ID, iVeh);
  2422. }
  2423. }
  2424. ++PlayerCars;
  2425. VehicleSpawned[playerid]++;
  2426. PlayerVehicleInfo[playerid][listitem][pvSpawned] = 1;
  2427. PlayerVehicleInfo[playerid][listitem][pvId] = iVeh;
  2428. if(PlayerVehicleInfo[playerid][listitem][pvLocked] == 1) LockPlayerVehicle(playerid, iVeh, PlayerVehicleInfo[playerid][listitem][pvLock]);
  2429. LoadPlayerVehicleMods(playerid, listitem);
  2430. g_mysql_SaveVehicle(playerid, listitem);
  2431. new vstring[64];
  2432. format(vstring, sizeof(vstring), "You have taken your %s out of storage.", VehicleName[PlayerVehicleInfo[playerid][listitem][pvModelId] - 400]);
  2433. SendClientMessageEx(playerid, COLOR_WHITE, vstring);
  2434. CheckPlayerVehiclesForDesync(playerid);
  2435. Vehicle_ResetData(iVeh);
  2436. VehicleFuel[iVeh] = PlayerVehicleInfo[playerid][listitem][pvFuel];
  2437. new zyear, zmonth, zday;
  2438. getdate(zyear, zmonth, zday);
  2439. if(zombieevent || (zmonth == 10 && zday == 31) || (zmonth == 11 && zday == 1)) SetVehicleHealth(iVeh, PlayerVehicleInfo[playerid][listitem][pvHealth]);
  2440. if (VehicleFuel[iVeh] > 100.0) VehicleFuel[iVeh] = 100.0;
  2441. if(PlayerVehicleInfo[playerid][listitem][pvCrashFlag] == 1 && PlayerVehicleInfo[playerid][listitem][pvCrashX] != 0.0)
  2442. {
  2443. SetVehiclePos(iVeh, PlayerVehicleInfo[playerid][listitem][pvCrashX], PlayerVehicleInfo[playerid][listitem][pvCrashY], PlayerVehicleInfo[playerid][listitem][pvCrashZ]);
  2444. SetVehicleZAngle(iVeh, PlayerVehicleInfo[playerid][listitem][pvCrashAngle]);
  2445. SetVehicleVirtualWorld(iVeh, PlayerVehicleInfo[playerid][listitem][pvCrashVW]);
  2446. PlayerVehicleInfo[playerid][listitem][pvCrashFlag] = 0;
  2447. PlayerVehicleInfo[playerid][listitem][pvCrashVW] = 0;
  2448. PlayerVehicleInfo[playerid][listitem][pvCrashX] = 0.0;
  2449. PlayerVehicleInfo[playerid][listitem][pvCrashY] = 0.0;
  2450. PlayerVehicleInfo[playerid][listitem][pvCrashZ] = 0.0;
  2451. PlayerVehicleInfo[playerid][listitem][pvCrashAngle] = 0.0;
  2452. SendClientMessageEx(playerid, COLOR_WHITE, "Your vehicle has been restored to it's last known location from your previous timeout.");
  2453. }
  2454. }
  2455. }
  2456. else SendClientMessageEx(playerid, COLOR_WHITE, "You can not spawn a non-existent vehicle.");
  2457. }
  2458. if(dialogid == ADMIN_VEHCHECK && response) {
  2459. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1) { return SendClientMessage(playerid, COLOR_GRAD2, "You are not authorized"); }
  2460. new giveplayerid = GetPVarInt(playerid, "vehcheck_giveplayerid");
  2461. if(!IsPlayerConnected(giveplayerid)) { return SendClientMessage(playerid, COLOR_GRAD2, "The person has disconnected"); }
  2462. new iVehicleID = PlayerVehicleInfo[giveplayerid][listitem][pvId];
  2463. new model;
  2464. model = PlayerVehicleInfo[giveplayerid][listitem][pvModelId];
  2465. PlayerVehicleInfo[giveplayerid][listitem][pvId] = 0;
  2466. PlayerVehicleInfo[giveplayerid][listitem][pvModelId] = 0;
  2467. PlayerVehicleInfo[giveplayerid][listitem][pvPosX] = 0.0;
  2468. PlayerVehicleInfo[giveplayerid][listitem][pvPosY] = 0.0;
  2469. PlayerVehicleInfo[giveplayerid][listitem][pvPosZ] = 0.0;
  2470. PlayerVehicleInfo[giveplayerid][listitem][pvPosAngle] = 0.0;
  2471. PlayerVehicleInfo[giveplayerid][listitem][pvLock] = 0;
  2472. PlayerVehicleInfo[giveplayerid][listitem][pvLocksLeft] = 0;
  2473. PlayerVehicleInfo[giveplayerid][listitem][pvLocked] = 0;
  2474. PlayerVehicleInfo[giveplayerid][listitem][pvPaintJob] = -1;
  2475. PlayerVehicleInfo[giveplayerid][listitem][pvColor1] = 0;
  2476. PlayerVehicleInfo[giveplayerid][listitem][pvImpounded] = 0;
  2477. PlayerVehicleInfo[giveplayerid][listitem][pvColor2] = 0;
  2478. PlayerVehicleInfo[giveplayerid][listitem][pvAllowedPlayerId] = INVALID_PLAYER_ID;
  2479. PlayerVehicleInfo[giveplayerid][listitem][pvPark] = 0;
  2480. PlayerVehicleInfo[giveplayerid][listitem][pvVW] = 0;
  2481. PlayerVehicleInfo[giveplayerid][listitem][pvInt] = 0;
  2482. PlayerVehicleInfo[giveplayerid][listitem][pvAlarm] = 0;
  2483. PlayerVehicleInfo[giveplayerid][listitem][pvAlarmTriggered] = 0;
  2484. PlayerVehicleInfo[giveplayerid][listitem][pvBeingPickLocked] = 0;
  2485. PlayerVehicleInfo[giveplayerid][listitem][pvBeingPickLockedBy] = INVALID_PLAYER_ID;
  2486. PlayerVehicleInfo[giveplayerid][listitem][pvLastLockPickedBy] = 0;
  2487. if(PlayerVehicleInfo[giveplayerid][listitem][pvSpawned])
  2488. {
  2489. PlayerVehicleInfo[giveplayerid][iVehicleID][pvSpawned] = 0;
  2490. DestroyVehicle(iVehicleID);
  2491. PlayerVehicleInfo[playerid][listitem][pvId] = INVALID_PLAYER_VEHICLE_ID;
  2492. VehicleSpawned[giveplayerid]--;
  2493. }
  2494. DestroyPlayerVehicle(giveplayerid, listitem);
  2495. for(new m = 0; m < MAX_MODS; m++)
  2496. {
  2497. PlayerVehicleInfo[giveplayerid][listitem][pvMods][m] = 0;
  2498. }
  2499. format(string, sizeof(string), "AdmCmd: Admin %s has deleted one of %s's(%d) vehicles (VehModel:%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), model);
  2500. Log("logs/admin.log", string);
  2501. format(string, sizeof(string), "AdmCmd: Admin %s has deleted one of %s's vehicles (VehModel:%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), model);
  2502. ABroadCast(COLOR_YELLOW, string, 4);
  2503. format(string, sizeof(string), "* Admin %s has deleted one of your vehicles.", GetPlayerNameEx(playerid));
  2504. SendClientMessageEx(giveplayerid, COLOR_YELLOW, string);
  2505. format(string, sizeof(string), "* You have deleted one of %s's vehicles.", GetPlayerNameEx(giveplayerid));
  2506. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2507. }
  2508. if(dialogid == TRACKCAR2)
  2509. {
  2510. if(response)
  2511. {
  2512. switch(listitem)
  2513. {
  2514. case 0:
  2515. {
  2516. new Float: carPos[3];
  2517. GetVehiclePos(GetPVarInt(playerid, "RentedVehicle"), carPos[0], carPos[1], carPos[2]);
  2518. if(CheckPointCheck(playerid))
  2519. {
  2520. SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
  2521. }
  2522. else
  2523. {
  2524. SetPVarInt(playerid, "TrackCar", 1);
  2525. new zone[MAX_ZONE_NAME];
  2526. Get3DZone(carPos[0], carPos[1], carPos[2], zone, sizeof(zone));
  2527. format(string, sizeof(string), "Your vehicle is located in %s.", zone);
  2528. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2529. SetPlayerCheckpoint(playerid, carPos[0], carPos[1], carPos[2], 15.0);
  2530. SendClientMessageEx(playerid, COLOR_WHITE, "Hint: Make your way to the checkpoint to find your vehicle!");
  2531. }
  2532. }
  2533. case 1:
  2534. {
  2535. new vstring[1024];
  2536. new szCarLocation[MAX_ZONE_NAME];
  2537. for(new i, iModelID; i < MAX_PLAYERVEHICLES; i++)
  2538. {
  2539. if((iModelID = PlayerVehicleInfo[playerid][i][pvModelId] - 400) >= 0)
  2540. {
  2541. Get3DZone(PlayerVehicleInfo[playerid][i][pvPosX], PlayerVehicleInfo[playerid][i][pvPosY], PlayerVehicleInfo[playerid][i][pvPosZ], szCarLocation, sizeof(szCarLocation));
  2542. if(PlayerVehicleInfo[playerid][i][pvImpounded]) {
  2543. format(vstring, sizeof(vstring), "%s\n%s (impounded) | Location: DMV", vstring, VehicleName[iModelID]);
  2544. }
  2545. else if(PlayerVehicleInfo[playerid][i][pvDisabled]) {
  2546. format(vstring, sizeof(vstring), "%s\n%s (disabled) | Location: Unknown", vstring, VehicleName[iModelID]);
  2547. }
  2548. else if(!PlayerVehicleInfo[playerid][i][pvSpawned]) {
  2549. format(vstring, sizeof(vstring), "%s\n%s (stored)", vstring, VehicleName[iModelID]);
  2550. }
  2551. else format(vstring, sizeof(vstring), "%s\n%s | Location: %s", vstring, VehicleName[iModelID], szCarLocation);
  2552. }
  2553. else strcat(vstring, "\nEmpty");
  2554. }
  2555. ShowPlayerDialogEx(playerid, TRACKCAR, DIALOG_STYLE_LIST, "Vehicle GPS Tracking", vstring, "Track", "Cancel");
  2556. }
  2557. }
  2558. }
  2559. }
  2560. if(dialogid == TRACKCAR && response) {
  2561. new Float: carPos[3];
  2562. if(PlayerVehicleInfo[playerid][listitem][pvId] > INVALID_PLAYER_VEHICLE_ID)
  2563. {
  2564. GetVehiclePos(PlayerVehicleInfo[playerid][listitem][pvId], carPos[0], carPos[1], carPos[2]);
  2565. if(CheckPointCheck(playerid))
  2566. {
  2567. SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
  2568. }
  2569. else
  2570. {
  2571. SetPVarInt(playerid, "TrackCar", 1);
  2572. new zone[MAX_ZONE_NAME];
  2573. Get3DZone(carPos[0], carPos[1], carPos[2], zone, sizeof(zone));
  2574. format(string, sizeof(string), "Your vehicle is located in %s.", zone);
  2575. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2576. SetPlayerCheckpoint(playerid, carPos[0], carPos[1], carPos[2], 15.0);
  2577. SendClientMessageEx(playerid, COLOR_WHITE, "Hint: Make your way to the checkpoint to find your vehicle!");
  2578. }
  2579. }
  2580. else if(PlayerVehicleInfo[playerid][listitem][pvImpounded]) SendClientMessageEx(playerid, COLOR_WHITE, "You can not track an impounded vehicle. If you wish to reclaim it, do so at the DMV in Dillimore.");
  2581. else if(PlayerVehicleInfo[playerid][listitem][pvDisabled] == 1) SendClientMessageEx(playerid, COLOR_WHITE, "You can not track a disabled vehicle. It is disabled due to your VIP level (vehicle restrictions).");
  2582. else if(PlayerVehicleInfo[playerid][listitem][pvSpawned] == 0) SendClientMessageEx(playerid, COLOR_WHITE, "You can not track a stored vehicle. Use /vstorage to spawn it.");
  2583. else SendClientMessageEx(playerid, COLOR_WHITE, "You can not track a non-existent vehicle.");
  2584. }
  2585. if(dialogid == DV_STORAGE && response) {
  2586. new stpos = strfind(inputtext, "(");
  2587. new fpos = strfind(inputtext, ")");
  2588. new caridstr[6], carid;
  2589. strmid(caridstr, inputtext, stpos+1, fpos);
  2590. carid = strval(caridstr);
  2591. if(DynVehicleInfo[carid][gv_iSpawnedID] != INVALID_VEHICLE_ID && !DynVehicleInfo[carid][gv_iDisabled])
  2592. {
  2593. if((!IsVehicleOccupied(DynVehicleInfo[carid][gv_iSpawnedID]) || IsPlayerInVehicle(playerid, DynVehicleInfo[carid][gv_iSpawnedID])) && !IsVehicleInTow(DynVehicleInfo[carid][gv_iSpawnedID]))
  2594. {
  2595. new Float: vHealth;
  2596. GetVehicleHealth(DynVehicleInfo[carid][gv_iSpawnedID], vHealth);
  2597. if(vHealth < 800)
  2598. return SendClientMessageEx(playerid, COLOR_GRAD1, "This vehicle is too damaged to be stored.");
  2599. if(!IsPlayerInRangeOfVehicle(playerid, DynVehicleInfo[carid][gv_iSpawnedID], 9.0) && !IsWeaponizedVehicle(DynVehicleInfo[carid][gv_iModel]))
  2600. return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not near the vehicle.");
  2601. DestroyVehicle(DynVehicleInfo[carid][gv_iSpawnedID]);
  2602. DynVeh[DynVehicleInfo[carid][gv_iSpawnedID]] = -1;
  2603. DynVehicleInfo[carid][gv_iDisabled] = 2;
  2604. DynVehicleInfo[carid][gv_iSpawnedID] = INVALID_VEHICLE_ID;
  2605. for(new i = 0; i != MAX_DV_OBJECTS; i++)
  2606. {
  2607. if(DynVehicleObjInfo[carid][i][gv_iAttachedObjectID] != INVALID_OBJECT_ID)
  2608. {
  2609. DestroyDynamicObject(DynVehicleObjInfo[carid][i][gv_iAttachedObjectID]);
  2610. DynVehicleObjInfo[carid][i][gv_iAttachedObjectID] = INVALID_OBJECT_ID;
  2611. }
  2612. }
  2613. new szstring[128];
  2614. format(szstring, sizeof(szstring), "You have stored your dynamic group vehicle (%s)", VehicleName[DynVehicleInfo[carid][gv_iModel] - 400]);
  2615. SendClientMessageEx(playerid, COLOR_WHITE, szstring);
  2616. }
  2617. else
  2618. return SendClientMessageEx(playerid, COLOR_GRAD1, "This vehicle is currently occupied.");
  2619. }
  2620. else if(DynVehicleInfo[carid][gv_iDisabled] == 1) SendClientMessageEx(playerid, COLOR_WHITE, "You can not spawn a repo'd vehicle. Please see /grepocars to buy it back.");
  2621. else {
  2622. DynVehicleInfo[carid][gv_iDisabled] = 0;
  2623. DynVeh_Spawn(carid);
  2624. new szstring[128];
  2625. format(szstring, sizeof(szstring), "You have spawned your dynamic group vehicle (%s)", VehicleName[DynVehicleInfo[carid][gv_iModel] - 400]);
  2626. SendClientMessageEx(playerid, COLOR_WHITE, szstring);
  2627. }
  2628. }
  2629. if(dialogid == DV_TRACKCAR && response) {
  2630. new stpos = strfind(inputtext, "(");
  2631. new fpos = strfind(inputtext, ")");
  2632. new caridstr[6], carid;
  2633. strmid(caridstr, inputtext, stpos+1, fpos);
  2634. carid = strval(caridstr);
  2635. new Float: carPos[3];
  2636. GetVehiclePos(DynVehicleInfo[carid][gv_iSpawnedID], carPos[0], carPos[1], carPos[2]);
  2637. if(DynVehicleInfo[carid][gv_iSpawnedID] != INVALID_VEHICLE_ID)
  2638. {
  2639. if(CheckPointCheck(playerid))
  2640. {
  2641. SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
  2642. }
  2643. else
  2644. {
  2645. SetPVarInt(playerid, "DV_TrackCar", 1);
  2646. new zone[MAX_ZONE_NAME];
  2647. Get3DZone(carPos[0], carPos[1], carPos[2], zone, sizeof(zone));
  2648. format(string, sizeof(string), "Your vehicle is located in %s.", zone);
  2649. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2650. SetPlayerCheckpoint(playerid, carPos[0], carPos[1], carPos[2], 15.0);
  2651. SendClientMessageEx(playerid, COLOR_WHITE, "Hint: Make your way to the checkpoint to find your vehicle!");
  2652. if(carPos[2] > 500.0)
  2653. {
  2654. SendClientMessageEx(playerid, COLOR_WHITE, "Note: This vehicle may be parked in a garage or interior!");
  2655. }
  2656. }
  2657. }
  2658. else if(DynVehicleInfo[carid][gv_iDisabled] == 1) SendClientMessageEx(playerid, COLOR_WHITE, "You can not track a repo'd vehicle. Please see /grepocars to buy it back.");
  2659. else if(DynVehicleInfo[carid][gv_iDisabled] == 2) SendClientMessageEx(playerid, COLOR_WHITE, "You can not track a stored vehicle. Use /dvstorage to restore.");
  2660. else SendClientMessageEx(playerid, COLOR_WHITE, "You can not track a non-existent vehicle.");
  2661. }
  2662. // --------------------------------------------------------------------------------------------------
  2663. if(dialogid == VIPWEPSMENU)
  2664. {
  2665. if(!response) return 1;
  2666. if(PlayerInfo[playerid][pDonateRank] < 3 && PlayerInfo[playerid][pTokens] == 0)
  2667. {
  2668. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have any tokens!");
  2669. return 1;
  2670. }
  2671. if(PlayerInfo[playerid][pConnectHours] < 2 || PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this as you are currently restricted from possessing weapons!");
  2672. //if(!CanGetVIPWeapon(playerid) && (listitem < 4 || listitem == 8)) return SendClientMessageEx(playerid, COLOR_WHITE, "You can no longer withdraw anymore VIP weapons today, wait until tomorrow!");
  2673. switch( listitem )
  2674. {
  2675. case 0:
  2676. {
  2677. if(PlayerInfo[playerid][pDonateRank] < 3)
  2678. {
  2679. if(PlayerInfo[playerid][pTokens] < 3)
  2680. {
  2681. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough tokens for this.");
  2682. return 1;
  2683. }
  2684. PlayerInfo[playerid][pTokens] -= 3;
  2685. format(string, sizeof(string), "VIP: You have traded 3 tokens for a Desert Eagle, you now have %d token(s).", PlayerInfo[playerid][pTokens]);
  2686. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2687. }
  2688. GivePlayerValidWeapon(playerid, 24);
  2689. PlayerInfo[playerid][pVIPGuncount]++;
  2690. }
  2691. case 1:
  2692. {
  2693. if(PlayerInfo[playerid][pDonateRank] < 3)
  2694. {
  2695. if(PlayerInfo[playerid][pTokens] < 2)
  2696. {
  2697. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough tokens for this.");
  2698. return 1;
  2699. }
  2700. PlayerInfo[playerid][pTokens] -= 2;
  2701. format(string, sizeof(string), "VIP: You have traded 2 tokens for a shotgun, you now have %d token(s).", PlayerInfo[playerid][pTokens]);
  2702. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2703. }
  2704. GivePlayerValidWeapon(playerid, 25);
  2705. PlayerInfo[playerid][pVIPGuncount]++;
  2706. }
  2707. case 2:
  2708. {
  2709. if(PlayerInfo[playerid][pDonateRank] < 3)
  2710. {
  2711. if(PlayerInfo[playerid][pTokens] < 3)
  2712. {
  2713. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough tokens for this.");
  2714. return 1;
  2715. }
  2716. PlayerInfo[playerid][pTokens] -= 3;
  2717. format(string, sizeof(string), "VIP: You have traded 3 tokens for an MP5, you now have %d token(s).", PlayerInfo[playerid][pTokens]);
  2718. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2719. }
  2720. GivePlayerValidWeapon(playerid, 29);
  2721. PlayerInfo[playerid][pVIPGuncount]++;
  2722. }
  2723. case 3:
  2724. {
  2725. if(PlayerInfo[playerid][pDonateRank] < 3)
  2726. {
  2727. if(PlayerInfo[playerid][pTokens] > 1)
  2728. {
  2729. PlayerInfo[playerid][pTokens] -= 2;
  2730. format(string, sizeof(string), "VIP: You have traded 2 tokens for a silenced pistol, you now have %d token(s).", PlayerInfo[playerid][pTokens]);
  2731. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2732. }
  2733. else
  2734. {
  2735. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough tokens for this.");
  2736. return 1;
  2737. }
  2738. }
  2739. GivePlayerValidWeapon(playerid, 23);
  2740. PlayerInfo[playerid][pVIPGuncount]++;
  2741. }
  2742. case 4:
  2743. {
  2744. if(PlayerInfo[playerid][pDonateRank] < 3)
  2745. {
  2746. if(PlayerInfo[playerid][pTokens] > 0)
  2747. {
  2748. PlayerInfo[playerid][pTokens] -= 1;
  2749. format(string, sizeof(string), "VIP: You have traded a token for a golf club, you now have %d token(s).", PlayerInfo[playerid][pTokens]);
  2750. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2751. }
  2752. else
  2753. {
  2754. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough tokens for this.");
  2755. return 1;
  2756. }
  2757. }
  2758. GivePlayerValidWeapon(playerid, 2);
  2759. PlayerInfo[playerid][pVIPGuncount]++;
  2760. }
  2761. case 5:
  2762. {
  2763. if(PlayerInfo[playerid][pDonateRank] < 3)
  2764. {
  2765. if(PlayerInfo[playerid][pTokens] > 0)
  2766. {
  2767. PlayerInfo[playerid][pTokens] -= 1;
  2768. format(string, sizeof(string), "VIP: You have traded a token for a baseball bat, you now have %d token(s).", PlayerInfo[playerid][pTokens]);
  2769. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2770. }
  2771. else
  2772. {
  2773. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough tokens for this.");
  2774. return 1;
  2775. }
  2776. }
  2777. GivePlayerValidWeapon(playerid, 5);
  2778. }
  2779. case 6:
  2780. {
  2781. if(PlayerInfo[playerid][pDonateRank] < 3)
  2782. {
  2783. if(PlayerInfo[playerid][pTokens] > 0)
  2784. {
  2785. PlayerInfo[playerid][pTokens] -= 1;
  2786. format(string, sizeof(string), "VIP: You have traded a token for a dildo, you now have %d token(s).", PlayerInfo[playerid][pTokens]);
  2787. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2788. }
  2789. else
  2790. {
  2791. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough tokens for this.");
  2792. return 1;
  2793. }
  2794. }
  2795. GivePlayerValidWeapon(playerid, 10);
  2796. PlayerInfo[playerid][pVIPGuncount]++;
  2797. }
  2798. case 7:
  2799. {
  2800. if(PlayerInfo[playerid][pDonateRank] < 3)
  2801. {
  2802. if(PlayerInfo[playerid][pTokens] > 0)
  2803. {
  2804. PlayerInfo[playerid][pTokens] -= 1;
  2805. format(string, sizeof(string), "VIP: You have traded a token for a sword, you now have %d token(s).", PlayerInfo[playerid][pTokens]);
  2806. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2807. }
  2808. else
  2809. {
  2810. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough tokens for this.");
  2811. return 1;
  2812. }
  2813. }
  2814. GivePlayerValidWeapon(playerid, 8);
  2815. }
  2816. case 8:
  2817. {
  2818. if(PlayerInfo[playerid][pDonateRank] < 3)
  2819. {
  2820. if(PlayerInfo[playerid][pTokens] > 1)
  2821. {
  2822. PlayerInfo[playerid][pTokens] -= 2;
  2823. format(string, sizeof(string), "VIP: You have traded 2 tokens for a 9mm, you now have %d token(s).", PlayerInfo[playerid][pTokens]);
  2824. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2825. }
  2826. else
  2827. {
  2828. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough tokens for this.");
  2829. return 1;
  2830. }
  2831. }
  2832. GivePlayerValidWeapon(playerid, 22);
  2833. PlayerInfo[playerid][pVIPGuncount]++;
  2834. }
  2835. }
  2836. }
  2837. if( dialogid == 3497) //famed change skin
  2838. {
  2839. new skinid = strval(inputtext);
  2840. if(response)
  2841. {
  2842. if(skinid < 1 || skinid > 299)
  2843. {
  2844. SendClientMessageEx(playerid, COLOR_GREY, "That skin ID is invalid, the range of available skin IDs are 1-299 !");
  2845. ShowPlayerDialogEx( playerid, 3497, DIALOG_STYLE_INPUT, "Skin Selection","Please enter a valid Skin ID!", "Wear", "Cancel" );
  2846. return 1;
  2847. }
  2848. if(PlayerInfo[playerid][pFamed] == 1)
  2849. {
  2850. if(GetPlayerCash(playerid) < 3000)
  2851. {
  2852. SendClientMessageEx(playerid, COLOR_GREY, "You do not have $3,000 on you.");
  2853. ShowPlayerDialogEx(playerid, 3497, DIALOG_STYLE_INPUT, "Famed Skin Selection","Please enter a Skin ID!\n\n{FF0000}Note: Skin changes are $3,000 for Old School.", "Change", "Cancel" );
  2854. return 1;
  2855. }
  2856. GivePlayerCash(playerid, -3000);
  2857. }
  2858. if(PlayerInfo[playerid][pFamed] == 2)
  2859. {
  2860. if(GetPlayerCash(playerid) < 1500)
  2861. {
  2862. SendClientMessageEx(playerid, COLOR_GREY, "You do not have $1,500 on you.");
  2863. ShowPlayerDialogEx(playerid, 3497, DIALOG_STYLE_INPUT, "Famed Skin Selection","Please enter a Skin ID!\n\n{FF0000}Note: Skin changes are $1,500 for Chartered Old School.", "Change", "Cancel" );
  2864. return 1;
  2865. }
  2866. GivePlayerCash(playerid, -1500);
  2867. }
  2868. SendClientMessageEx(playerid, COLOR_YELLOW, "Famed Locker: You have changed your clothes.");
  2869. PlayerInfo[playerid][pModel] = skinid;
  2870. SetPlayerSkin(playerid, skinid);
  2871. }
  2872. else return 0;
  2873. return 1;
  2874. }
  2875. if(dialogid == 3498) //Famed Weapon Locker
  2876. {
  2877. if(!response) return SendClientMessageEx(playerid, COLOR_GRAD2, "You exited the famed locker.");
  2878. if(PlayerInfo[playerid][pConnectHours] < 2 || PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this as you are currently restricted from possessing weapons!");
  2879. switch(listitem)
  2880. {
  2881. case 0: //Deagle
  2882. {
  2883. GivePlayerValidWeapon(playerid, 24);
  2884. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You have taken a Desert Eagle from the famed locker.");
  2885. }
  2886. case 1: //MP5
  2887. {
  2888. GivePlayerValidWeapon(playerid, 29);
  2889. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You have taken a Semi-Automatic MP5 from the famed locker.");
  2890. }
  2891. case 2: //Shotgun
  2892. {
  2893. GivePlayerValidWeapon(playerid, 25);
  2894. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You have taken a Pump Shotgun from the famed locker.");
  2895. }
  2896. case 3: //Rifle
  2897. {
  2898. GivePlayerValidWeapon(playerid, 33);
  2899. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You have taken a County Rifle from the famed locker.");
  2900. }
  2901. case 4: //SD Pistol
  2902. {
  2903. GivePlayerValidWeapon(playerid, 23);
  2904. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You have taken a Silenced Pistol from the famed locker.");
  2905. }
  2906. case 5: //Katana
  2907. {
  2908. GivePlayerValidWeapon(playerid, 8);
  2909. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You have taken a Japanese Katana from the famed locker.");
  2910. }
  2911. case 6: //Purple Dildo
  2912. {
  2913. GivePlayerValidWeapon(playerid, 10);
  2914. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You have taken a Purple Dildo from the famed locker.");
  2915. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] Have Fun...");
  2916. }
  2917. case 7: //White Dildo
  2918. {
  2919. GivePlayerValidWeapon(playerid, 11);
  2920. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You have taken a White Dildo from the famed locker.");
  2921. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] Have Fun...");
  2922. }
  2923. case 8: //Big Vibrator
  2924. {
  2925. GivePlayerValidWeapon(playerid, 12);
  2926. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You have taken a Big Vibrator from the famed locker.");
  2927. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] Have Fun...");
  2928. }
  2929. case 9: //Silver Vibrator
  2930. {
  2931. GivePlayerValidWeapon(playerid, 13);
  2932. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You have taken a Silver Vibrator from the famed locker.");
  2933. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] Have Fun...");
  2934. }
  2935. }
  2936. }
  2937. else if(dialogid == DIALOG_CHANGEPASS2)
  2938. {
  2939. if(!response || strlen(inputtext) == 0) return ShowLoginDialogs(playerid, 0);
  2940. if(response)
  2941. {
  2942. if(PassComplexCheck && CheckPasswordComplexity(inputtext) != 1) return ShowLoginDialogs(playerid, 0);
  2943. if(strlen(inputtext) > 64) return ShowLoginDialogs(playerid, 0), SendClientMessageEx(playerid, COLOR_GREY, "You can't select a password that's above 64 characters.");
  2944. if(!strcmp(PlayerInfo[playerid][pLastPass], inputtext, true)) return ShowLoginDialogs(playerid, 0), SendClientMessageEx(playerid, COLOR_RED, "There was an issue with processing your request.");
  2945. new
  2946. szBuffer[129],
  2947. szQuery[256],
  2948. salt[11];
  2949. SetPVarString(playerid, "PassChange", inputtext);
  2950. randomString(salt);
  2951. format(szQuery, sizeof(szQuery), "%s%s", inputtext, salt);
  2952. WP_Hash(szBuffer, sizeof(szBuffer), szQuery);
  2953. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `accounts` SET `Key` = '%s', `Salt` = '%s' WHERE `id` = '%i'", szBuffer, salt, PlayerInfo[playerid][pId]);
  2954. mysql_tquery(MainPipeline, szQuery, "OnPlayerChangePass", "i", playerid);
  2955. SendClientMessageEx(playerid, COLOR_YELLOW, "Processing your request...");
  2956. if(strcmp(PlayerInfo[playerid][pBirthDate], "0000-00-00", true) == 0 && PlayerInfo[playerid][pTut] != 0) ShowLoginDialogs(playerid, 1);
  2957. else if(pMOTD[0] && GetPVarInt(playerid, "ViewedPMOTD") != 1) ShowLoginDialogs(playerid, 4);
  2958. else if(PlayerInfo[playerid][pReceivedCredits] != 0) ShowLoginDialogs(playerid, 5);
  2959. }
  2960. }
  2961. else if( dialogid == DIALOG_CHANGEPASS )
  2962. {
  2963. if(!response || strlen(inputtext) == 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You have prevented yourself from changing your password." );
  2964. if(response)
  2965. {
  2966. if(PassComplexCheck && CheckPasswordComplexity(inputtext) != 1) return ShowPlayerDialogEx(playerid, DIALOG_CHANGEPASS, DIALOG_STYLE_INPUT, "Password Change", "Please enter a new password for your account.\n\n\
  2967. - You can't select a password that's below 8 or above 64 characters\n\
  2968. - Your password must contain a combination of letters, numbers and special characters.\n\
  2969. - Invalid Character: %", "Change", "Exit" );
  2970. if(strlen(inputtext) > 64) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't select a password that's above 64 characters.");
  2971. if(!strcmp(PlayerInfo[playerid][pLastPass], inputtext, true)) return SendClientMessageEx(playerid, COLOR_RED, "There was an issue with processing your request.");
  2972. new
  2973. szBuffer[129],
  2974. szQuery[256],
  2975. salt[11];
  2976. SetPVarString(playerid, "PassChange", inputtext);
  2977. randomString(salt);
  2978. format(szQuery, sizeof(szQuery), "%s%s", inputtext, salt);
  2979. WP_Hash(szBuffer, sizeof(szBuffer), szQuery);
  2980. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `accounts` SET `Key` = '%s', `Salt` = '%s' WHERE `id` = '%i'", szBuffer, salt, PlayerInfo[playerid][pId]);
  2981. mysql_tquery(MainPipeline, szQuery, "OnPlayerChangePass", "i", playerid);
  2982. SendClientMessageEx(playerid, COLOR_YELLOW, "Processing your request...");
  2983. }
  2984. }
  2985. else if(dialogid == DIALOG_NAMECHANGE)
  2986. {
  2987. if(!response || strlen(inputtext) == 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You have prevented yourself from changing your name." );
  2988. if(strlen(inputtext) > 20)
  2989. {
  2990. SendClientMessageEx(playerid, COLOR_WHITE, "You can't select a name that's above 20 characters.");
  2991. }
  2992. else
  2993. {
  2994. if(strlen(inputtext) >= 1)
  2995. {
  2996. if(!response)
  2997. {
  2998. SendClientMessageEx(playerid, COLOR_WHITE, "You have prevented yourself from changing your name." );
  2999. }
  3000. else
  3001. {
  3002. if(!IsValidName(inputtext)) return SendClientMessageEx(playerid, COLOR_WHITE, "Name change rejected. Please choose a name in the correct format: Firstname_Lastname.");
  3003. /*new namechangecost;
  3004. namechangecost = (PlayerInfo[playerid][pLevel]) * 15000;
  3005. if(PlayerInfo[playerid][pDonateRank] >= 3)
  3006. {
  3007. namechangecost = 90*namechangecost/100;
  3008. }*/
  3009. DeletePVar(playerid, "marriagelastname");
  3010. new tmpName[MAX_PLAYER_NAME];
  3011. mysql_escape_string(inputtext, tmpName);
  3012. if(strcmp(inputtext, tmpName, false) != 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "Unacceptable characters used in namechange, try again");
  3013. if((0 <= PlayerInfo[playerid][pMember] < MAX_GROUPS) && (PlayerInfo[playerid][pRank] >= arrGroupData[PlayerInfo[playerid][pMember]][g_iFreeNameChange] && (PlayerInfo[playerid][pDivision] == arrGroupData[PlayerInfo[playerid][pMember]][g_iFreeNameChangeDiv] || arrGroupData[PlayerInfo[playerid][pMember]][g_iFreeNameChangeDiv] == INVALID_DIVISION)))
  3014. {
  3015. if(GetPVarType(playerid, "HasReport")) {
  3016. SendClientMessageEx(playerid, COLOR_GREY, "You can only have 1 active report at a time. (/cancelreport)");
  3017. return 1;
  3018. }
  3019. new String[128];
  3020. SetPVarInt(playerid, "RequestingNameChange", 1);
  3021. SetPVarString(playerid, "NewNameRequest", inputtext);
  3022. SetPVarInt(playerid, "NameChangeCost", 0);
  3023. new playername[MAX_PLAYER_NAME];
  3024. GetPlayerName(playerid, playername, sizeof(playername));
  3025. format( String, sizeof( String ), "You have requested a namechange from %s to %s at no cost, please wait until an admin approves it.", playername, inputtext);
  3026. SendClientMessageEx( playerid, COLOR_YELLOW, String );
  3027. SendReportToQue(playerid, "Name Change Request", 2, 4);
  3028. return 1;
  3029. }
  3030. if(PlayerInfo[playerid][pAdmin] == 1 && PlayerInfo[playerid][pSMod] > 0)
  3031. {
  3032. if(GetPVarType(playerid, "HasReport")) {
  3033. SendClientMessageEx(playerid, COLOR_GREY, "You can only have 1 active report at a time. (/cancelreport)");
  3034. return 1;
  3035. }
  3036. new String[128];
  3037. SetPVarInt(playerid, "RequestingNameChange", 1);
  3038. SetPVarString(playerid, "NewNameRequest", inputtext);
  3039. new playername[MAX_PLAYER_NAME];
  3040. GetPlayerName(playerid, playername, sizeof(playername));
  3041. format( String, sizeof( String ), "You have requested a namechange from %s to %s at no cost (Senior Mod), please wait until an admin approves it.", playername, inputtext);
  3042. SendClientMessageEx( playerid, COLOR_YELLOW, String );
  3043. SendReportToQue(playerid, "Name Change Request", 2, 4);
  3044. return 1;
  3045. }
  3046. if(gettime() >= PlayerInfo[playerid][pNextNameChange])
  3047. {
  3048. if(GetPVarType(playerid, "HasReport")) return SendClientMessageEx(playerid, COLOR_GREY, "You can only have 1 active report at a time. (/cancelreport)");
  3049. new String[128];
  3050. SetPVarInt(playerid, "RequestingNameChange", 1);
  3051. SetPVarString(playerid, "NewNameRequest", inputtext);
  3052. SetPVarInt(playerid, "NameChangeCost", 1);
  3053. new playername[MAX_PLAYER_NAME];
  3054. GetPlayerName(playerid, playername, sizeof(playername));
  3055. format( String, sizeof( String ), "You have requested a namechange from %s to %s for free, please wait until an admin approves it.", playername, inputtext);
  3056. SendClientMessageEx( playerid, COLOR_YELLOW, String );
  3057. SendReportToQue(playerid, "Name Change Request", 2, 4);
  3058. return 1;
  3059. }
  3060. /*
  3061. if(PlayerInfo[playerid][pCredits] >= ShopItems[40][sItemPrice])
  3062. {
  3063. if(GetPVarType(playerid, "HasReport")) return SendClientMessageEx(playerid, COLOR_GREY, "You can only have 1 active report at a time. (/cancelreport)");
  3064. new String[128];
  3065. SetPVarInt(playerid, "RequestingNameChange", 1);
  3066. SetPVarString(playerid, "NewNameRequest", inputtext);
  3067. SetPVarInt(playerid, "NameChangeCost", 2);
  3068. new playername[MAX_PLAYER_NAME];
  3069. GetPlayerName(playerid, playername, sizeof(playername));
  3070. format( String, sizeof( String ), "You have requested a namechange from %s to %s for %s credits, please wait until a General Admin approves it.", playername, inputtext, number_format(ShopItems[40][sItemPrice]));
  3071. SendClientMessageEx( playerid, COLOR_YELLOW, String );
  3072. SendReportToQue(playerid, "Name Change Request (Credits)", 2, 4);
  3073. return 1;
  3074. }
  3075. else
  3076. {
  3077. SendClientMessageEx(playerid, COLOR_GRAD2, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  3078. }
  3079. */
  3080. new namechangecost;
  3081. switch(PlayerInfo[playerid][pLevel])
  3082. {
  3083. case 1: namechangecost = 10000;
  3084. case 2: namechangecost = 15000;
  3085. case 3: namechangecost = 20000;
  3086. default: namechangecost = (PlayerInfo[playerid][pLevel]-3)*50000;
  3087. }
  3088. if(PlayerInfo[playerid][pCash] >= namechangecost)
  3089. {
  3090. if(GetPVarType(playerid, "HasReport")) return SendClientMessageEx(playerid, COLOR_GREY, "You can only have 1 active report at a time. (/cancelreport)");
  3091. SetPVarInt(playerid, "RequestingNameChange", 1);
  3092. SetPVarString(playerid, "NewNameRequest", inputtext);
  3093. SetPVarInt(playerid, "NameChangeCost", namechangecost);
  3094. SendClientMessageEx(playerid, COLOR_YELLOW, "You have requested a namechange from %s to %s for $%s, please wait until an admin approves it.", GetPlayerNameExt(playerid), inputtext, number_format(namechangecost));
  3095. SendReportToQue(playerid, "Name Change Request (Cash)", 2, 4);
  3096. return 1;
  3097. }
  3098. else
  3099. {
  3100. SendClientMessageEx(playerid, COLOR_GRAD2, "You don't have enough money for a name change.");
  3101. }
  3102. }
  3103. }
  3104. else
  3105. {
  3106. SendClientMessageEx( playerid, COLOR_WHITE, "Your name must be longer than 1 character." );
  3107. }
  3108. }
  3109. }
  3110. else if( dialogid == DIALOG_NAMECHANGE2 )
  3111. {
  3112. if(!response || strlen(inputtext) == 0) return Kick(playerid);
  3113. if(strlen(inputtext) >= 20)
  3114. {
  3115. SendClientMessageEx( playerid, COLOR_WHITE, "You can't select a name that's above 20 characters." );
  3116. ShowPlayerDialogEx( playerid, DIALOG_NAMECHANGE2, DIALOG_STYLE_INPUT, "Free name change","This is a roleplay server where you must have a name in this format: Firstname_Lastname.\nFor example: John_Smith or Jimmy_Johnson\n\nAn admin has offered you to change your name to the correct format for free. Please enter your desired name below.\n\nNote: If you press cancel you will be kicked from the server.", "Change", "Cancel" );
  3117. }
  3118. else
  3119. {
  3120. if( strlen(inputtext) >= 1 )
  3121. {
  3122. if(!response)
  3123. {
  3124. ShowPlayerDialogEx( playerid, DIALOG_NAMECHANGE2, DIALOG_STYLE_INPUT, "Free name change","This is a roleplay server where you must have a name in this format: Firstname_Lastname.\nFor example: John_Smith or Jimmy_Johnson\n\nAn admin has offered you to change your name to the correct format for free. Please enter your desired name below.\n\nNote: If you press cancel you will be kicked from the server.", "Change", "Cancel" );
  3125. }
  3126. else
  3127. {
  3128. for(new i = 0; i < strlen( inputtext ); i++)
  3129. {
  3130. if (inputtext[i] == ' ')
  3131. {
  3132. SendClientMessageEx(playerid, COLOR_WHITE, "Please use the '_'(underscore) instead of the ' '(space)");
  3133. ShowPlayerDialogEx( playerid, DIALOG_NAMECHANGE2, DIALOG_STYLE_INPUT, "Free name change","This is a roleplay server where you must have a name in this format: Firstname_Lastname.\nFor example: John_Smith or Jimmy_Johnson\n\nAn admin has offered you to change your name to the correct format for free. Please enter your desired name below.\n\nNote: If you press cancel you will be kicked from the server.", "Change", "Cancel" );
  3134. return 1;
  3135. }
  3136. }
  3137. if( strfind( inputtext, "_", true) == -1 )
  3138. {
  3139. SendClientMessageEx( playerid, COLOR_WHITE, "Name change rejected. Please choose a name in the correct format: Firstname_Lastname." );
  3140. ShowPlayerDialogEx( playerid, DIALOG_NAMECHANGE2, DIALOG_STYLE_INPUT, "Free name change","This is a roleplay server where you must have a name in this format: Firstname_Lastname.\nFor example: John_Smith or Jimmy_Johnson\n\nAn admin has offered you to change your name to the correct format for free. Please enter your desired name below.\n\nNote: If you press cancel you will be kicked from the server.", "Change", "Cancel" );
  3141. return 1;
  3142. }
  3143. else
  3144. {
  3145. if(GetPVarType(playerid, "HasReport")) {
  3146. SendClientMessageEx(playerid, COLOR_GREY, "You can only have 1 active report at a time. (/cancelreport)");
  3147. return 1;
  3148. }
  3149. new String[128];
  3150. DeletePVar(playerid, "marriagelastname");
  3151. SetPVarInt(playerid, "RequestingNameChange", 1);
  3152. SetPVarString(playerid, "NewNameRequest", inputtext);
  3153. SetPVarInt(playerid, "NameChangeCost", 0);
  3154. new playername[MAX_PLAYER_NAME];
  3155. GetPlayerName(playerid, playername, sizeof(playername));
  3156. format( String, sizeof( String ), "You have requested a namechange from %s to %s please wait until an admin approves it.", playername, inputtext);
  3157. SendClientMessageEx( playerid, COLOR_YELLOW, String );
  3158. // format( String, sizeof( String ), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) requested a name change to %s for free (non-RP name) - /approvename %d (accept), or /denyname %d (deny).", playername, playerid, inputtext, playerid, playerid);
  3159. // ABroadCast( COLOR_YELLOW, String, 3 );
  3160. SendReportToQue(playerid, "Name Change Request", 2, 4);
  3161. return 1;
  3162. }
  3163. }
  3164. }
  3165. else
  3166. {
  3167. SendClientMessageEx( playerid, COLOR_WHITE, "Your name must be longer than 1 character." );
  3168. ShowPlayerDialogEx( playerid, DIALOG_NAMECHANGE2, DIALOG_STYLE_INPUT, "Free name change","This is a roleplay server where you must have a name in this format: Firstname_Lastname.\nFor example: John_Smith or Jimmy_Johnson\n\nAn admin has offered you to change your name to the correct format for free. Please enter your desired name below.\n\nNote: If you press cancel you will be kicked from the server.", "Change", "Cancel" );
  3169. }
  3170. }
  3171. }
  3172. if(dialogid == DIALOG_CDLOCKMENU)
  3173. {
  3174. if(response)
  3175. {
  3176. if(GetPVarInt(playerid, "lockmenu") == 1)
  3177. {
  3178. new pvid;
  3179. if (IsNumeric(inputtext))
  3180. {
  3181. pvid = strval(inputtext)-1;
  3182. if(PlayerVehicleInfo[playerid][pvid][pvId] == INVALID_PLAYER_VEHICLE_ID)
  3183. {
  3184. SendClientMessageEx(playerid, COLOR_GRAD4, "ERROR: You don't have a vehicle in this slot.");
  3185. DeletePVar(playerid, "lockmenu");
  3186. return 1;
  3187. }
  3188. if(PlayerVehicleInfo[playerid][pvid][pvAlarm] == 1)
  3189. {
  3190. SendClientMessageEx(playerid, COLOR_GRAD4, "ERROR: You already have this item installed on this vehicle.");
  3191. DeletePVar(playerid, "lockmenu");
  3192. return 1;
  3193. }
  3194. SendClientMessageEx(playerid, COLOR_GRAD4, " You have purchased a standard car alarm!");
  3195. SendClientMessageEx(playerid, COLOR_YELLOW, "HINT: Your alarm will now activate and alert you when someone tries to steal your car.");
  3196. PlayerVehicleInfo[playerid][pvid][pvAlarm] = 1;
  3197. g_mysql_SaveVehicle(playerid, pvid);
  3198. DeletePVar(playerid, "lockmenu");
  3199. new iBusiness = GetPVarInt(playerid, "businessid");
  3200. new cost = GetPVarInt(playerid, "lockcost");
  3201. new iItem = GetPVarInt(playerid, "item")-1;
  3202. Businesses[iBusiness][bInventory]-= StoreItemCost[iItem][ItemValue];
  3203. Businesses[iBusiness][bTotalSales]++;
  3204. Businesses[iBusiness][bSafeBalance] += TaxSale(cost);
  3205. //if(penalty) Businesses[iBusiness][bSafeBalance] -= floatround(cost * BIZ_PENALTY);
  3206. GivePlayerCash(playerid, -cost);
  3207. if (PlayerInfo[playerid][pBusiness] != InBusiness(playerid)) Businesses[iBusiness][bLevelProgress]++;
  3208. SaveBusiness(iBusiness);
  3209. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  3210. /*if (PlayerInfo[playerid][pDonateRank] >= 1)
  3211. {
  3212. format(string,sizeof(string),"VIP: You have received 20 percent off this product. Instead of paying $%s, you paid $%s.", number_format(Businesses[iBusiness][bItemPrices][iItem]), number_format(cost));
  3213. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  3214. }*/
  3215. format(string,sizeof(string),"%s(%d) (IP: %s) has bought a Standard Car Alarm in %s (%d) for $%s.",GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), Businesses[iBusiness][bName], iBusiness, number_format(cost));
  3216. Log("logs/business.log", string);
  3217. format(string,sizeof(string),"* You have purchased a Standard Car Alarm from %s for $%s.", Businesses[iBusiness][bName], number_format(cost));
  3218. SendClientMessage(playerid, COLOR_GRAD2, string);
  3219. new playersold = GetPVarInt(playerid, "playersold");
  3220. if(playersold)
  3221. {
  3222. DeletePVar(playerid, "Business_ItemType");
  3223. DeletePVar(playerid, "Business_ItemPrice");
  3224. DeletePVar(playerid, "Business_ItemOfferer");
  3225. DeletePVar(playerid, "Business_ItemOffererSQLId");
  3226. }
  3227. }
  3228. }
  3229. else if(GetPVarInt(playerid, "lockmenu") == 4)
  3230. {
  3231. new pvid;
  3232. if (IsNumeric(inputtext))
  3233. {
  3234. pvid = strval(inputtext)-1;
  3235. if(PlayerVehicleInfo[playerid][pvid][pvId] == INVALID_PLAYER_VEHICLE_ID)
  3236. {
  3237. SendClientMessageEx(playerid, COLOR_GRAD4, "ERROR: You don't have a vehicle in this slot.");
  3238. DeletePVar(playerid, "lockmenu");
  3239. return 1;
  3240. }
  3241. if(PlayerVehicleInfo[playerid][pvid][pvAlarm] == 2)
  3242. {
  3243. SendClientMessageEx(playerid, COLOR_GRAD4, "ERROR: You already have this item installed & working on this vehicle.");
  3244. DeletePVar(playerid, "lockmenu");
  3245. return 1;
  3246. }
  3247. PlayerVehicleInfo[playerid][pvid][pvAlarm] = 2;
  3248. g_mysql_SaveVehicle(playerid, pvid);
  3249. DeletePVar(playerid, "lockmenu");
  3250. GivePlayerCredits(playerid, -ShopItems[39][sItemPrice], 1);
  3251. printf("Price39: %d", ShopItems[39][sItemPrice]);
  3252. AmountSold[39]++;
  3253. AmountMade[39] += ShopItems[39][sItemPrice];
  3254. new szQuery[128];
  3255. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold39` = '%d', `AmountMade39` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[39], AmountMade[39]);
  3256. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  3257. format(string, sizeof(string), "You have purchased a Deluxe Car Alarm for %s credits.", number_format(ShopItems[39][sItemPrice]));
  3258. SendClientMessageEx(playerid, COLOR_CYAN, string);
  3259. SendClientMessageEx(playerid, COLOR_YELLOW, "HINT: Your alarm will now activate and alert you when someone tries to steal your car.");
  3260. format(string, sizeof(string), "[Deluxe Car Alarm] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[39][sItemPrice]));
  3261. Log("logs/credits.log", string), print(string);
  3262. }
  3263. }
  3264. else if(GetPVarInt(playerid, "lockmenu") == 2)
  3265. {
  3266. new pvid;
  3267. if (IsNumeric(inputtext))
  3268. {
  3269. pvid = strval(inputtext)-1;
  3270. if(PlayerVehicleInfo[playerid][pvid][pvId] == INVALID_PLAYER_VEHICLE_ID)
  3271. {
  3272. SendClientMessageEx(playerid, COLOR_GRAD4, "ERROR: You don't have a vehicle in this slot.");
  3273. SetPVarInt(playerid, "lockmenu", 0);
  3274. return 1;
  3275. }
  3276. if(PlayerVehicleInfo[playerid][pvid][pvLocksLeft] > 0 && PlayerVehicleInfo[playerid][pvid][pvLock] == 2)
  3277. {
  3278. SendClientMessageEx(playerid, COLOR_GRAD4, "ERROR: You already have this item installed & working on this vehicle.");
  3279. DeletePVar(playerid, "lockmenu");
  3280. return 1;
  3281. }
  3282. format(string, sizeof(string), " You have purchased an electronic lock!");
  3283. SendClientMessageEx(playerid, COLOR_GRAD4, string);
  3284. SendClientMessageEx(playerid, COLOR_YELLOW, "HINT: You can now use /pvlock to lock your car.");
  3285. UnLockPlayerVehicle(playerid, PlayerVehicleInfo[playerid][pvid][pvId], PlayerVehicleInfo[playerid][pvid][pvLock]);
  3286. PlayerVehicleInfo[playerid][pvid][pvLock] = 2;
  3287. PlayerVehicleInfo[playerid][pvid][pvLocksLeft] = 5;
  3288. g_mysql_SaveVehicle(playerid, pvid);
  3289. DeletePVar(playerid, "lockmenu");
  3290. new iBusiness = GetPVarInt(playerid, "businessid");
  3291. new cost = GetPVarInt(playerid, "lockcost");
  3292. new iItem = GetPVarInt(playerid, "item")-1;
  3293. Businesses[iBusiness][bInventory]-= StoreItemCost[iItem][ItemValue];
  3294. Businesses[iBusiness][bTotalSales]++;
  3295. Businesses[iBusiness][bSafeBalance] += TaxSale(cost);
  3296. //if(penalty) Businesses[iBusiness][bSafeBalance] -= floatround(cost * BIZ_PENALTY);
  3297. GivePlayerCash(playerid, -cost);
  3298. if (PlayerInfo[playerid][pBusiness] != InBusiness(playerid)) Businesses[iBusiness][bLevelProgress]++;
  3299. SaveBusiness(iBusiness);
  3300. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  3301. /*if (PlayerInfo[playerid][pDonateRank] >= 1)
  3302. {
  3303. format(string,sizeof(string),"VIP: You have received 20 percent off this product. Instead of paying $%s, you paid $%s.", number_format(Businesses[iBusiness][bItemPrices][iItem]), number_format(cost));
  3304. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  3305. }*/
  3306. format(string,sizeof(string),"%s(%d) (IP: %s) has bought a Electronic Lock in %s (%d) for $%s.",GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), Businesses[iBusiness][bName], iBusiness, number_format(cost));
  3307. Log("logs/business.log", string);
  3308. format(string,sizeof(string),"* You have purchased a Electronic Lock from %s for $%s.", Businesses[iBusiness][bName], number_format(cost));
  3309. SendClientMessage(playerid, COLOR_GRAD2, string);
  3310. new playersold = GetPVarInt(playerid, "playersold");
  3311. if(playersold)
  3312. {
  3313. DeletePVar(playerid, "Business_ItemType");
  3314. DeletePVar(playerid, "Business_ItemPrice");
  3315. DeletePVar(playerid, "Business_ItemOfferer");
  3316. DeletePVar(playerid, "Business_ItemOffererSQLId");
  3317. }
  3318. }
  3319. }
  3320. else if(GetPVarInt(playerid, "lockmenu") == 3)
  3321. {
  3322. new pvid;
  3323. if (IsNumeric(inputtext))
  3324. {
  3325. pvid = strval(inputtext)-1;
  3326. if(PlayerVehicleInfo[playerid][pvid][pvId] == INVALID_PLAYER_VEHICLE_ID)
  3327. {
  3328. SendClientMessageEx(playerid, COLOR_GRAD4, "ERROR: You don't have a vehicle in this slot.");
  3329. SetPVarInt(playerid, "lockmenu", 0);
  3330. return 1;
  3331. }
  3332. if(PlayerVehicleInfo[playerid][pvid][pvLocksLeft] > 0 && PlayerVehicleInfo[playerid][pvid][pvLock] == 3)
  3333. {
  3334. SendClientMessageEx(playerid, COLOR_GRAD4, "ERROR: You already have this item installed & working on this vehicle.");
  3335. DeletePVar(playerid, "lockmenu");
  3336. return 1;
  3337. }
  3338. format(string, sizeof(string), " You have Purchased an industrial lock!");
  3339. SendClientMessageEx(playerid, COLOR_GRAD4, string);
  3340. SendClientMessageEx(playerid, COLOR_YELLOW, "HINT: You can now use /pvlock to lock your car.");
  3341. PlayerVehicleInfo[playerid][pvid][pvLock] = 3;
  3342. PlayerVehicleInfo[playerid][pvid][pvLocksLeft] = 5;
  3343. g_mysql_SaveVehicle(playerid, pvid);
  3344. DeletePVar(playerid, "lockmenu");
  3345. new iBusiness = GetPVarInt(playerid, "businessid");
  3346. new cost = GetPVarInt(playerid, "lockcost");
  3347. new iItem = GetPVarInt(playerid, "item")-1;
  3348. Businesses[iBusiness][bInventory]-= StoreItemCost[iItem][ItemValue];
  3349. Businesses[iBusiness][bTotalSales]++;
  3350. Businesses[iBusiness][bSafeBalance] += TaxSale(cost);
  3351. //if(penalty) Businesses[iBusiness][bSafeBalance] -= floatround(cost * BIZ_PENALTY);
  3352. GivePlayerCash(playerid, -cost);
  3353. if (PlayerInfo[playerid][pBusiness] != InBusiness(playerid)) Businesses[iBusiness][bLevelProgress]++;
  3354. SaveBusiness(iBusiness);
  3355. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  3356. /*if (PlayerInfo[playerid][pDonateRank] >= 1)
  3357. {
  3358. format(string,sizeof(string),"VIP: You have received 20 percent off this product. Instead of paying $%s, you paid $%s.", number_format(Businesses[iBusiness][bItemPrices][iItem]), number_format(cost));
  3359. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  3360. }*/
  3361. format(string,sizeof(string),"%s(%d) (IP: %s) has bought a Industrial Lock in %s (%d) for $%s.",GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), Businesses[iBusiness][bName], iBusiness, number_format(cost));
  3362. Log("logs/business.log", string);
  3363. format(string,sizeof(string),"* You have purchased a Industrial Lock from %s for $%s.",Businesses[iBusiness][bName], number_format(cost));
  3364. SendClientMessage(playerid, COLOR_GRAD2, string);
  3365. new playersold = GetPVarInt(playerid, "playersold");
  3366. if(playersold)
  3367. {
  3368. DeletePVar(playerid, "Business_ItemType");
  3369. DeletePVar(playerid, "Business_ItemPrice");
  3370. DeletePVar(playerid, "Business_ItemOfferer");
  3371. DeletePVar(playerid, "Business_ItemOffererSQLId");
  3372. }
  3373. }
  3374. }
  3375. }
  3376. }
  3377. if(dialogid == DIALOG_LOCKER_OS)
  3378. {
  3379. if(!response) return SendClientMessageEx(playerid, COLOR_GRAD2, "You have exited the locker.");
  3380. if(listitem == 0)
  3381. {
  3382. new Float:health;
  3383. GetHealth(playerid, health);
  3384. new hpint = floatround( health, floatround_round );
  3385. if( hpint >= 100 )
  3386. {
  3387. SendClientMessageEx(playerid, COLOR_GREY, "You already have full health.");
  3388. return 1;
  3389. }
  3390. else {
  3391. SetHealth(playerid, 100);
  3392. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You have used a first aid kit, you now have 100.0 HP.");
  3393. }
  3394. }
  3395. if(listitem == 1)
  3396. {
  3397. new Float:armour;
  3398. GetArmour(playerid, armour);
  3399. if(armour >= 100)
  3400. {
  3401. SendClientMessageEx(playerid, COLOR_GREY, "You already have full armor.");
  3402. return 1;
  3403. }
  3404. else if(GetPlayerCash(playerid) < 10000)
  3405. {
  3406. SendClientMessageEx(playerid, COLOR_GREY,"You don't have $10000");
  3407. return 1;
  3408. }
  3409. else {
  3410. GivePlayerCash(playerid, -10000);
  3411. SetArmour(playerid, 100);
  3412. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You paid $10000 for a kevlar vest.");
  3413. }
  3414. }
  3415. if(listitem == 2)
  3416. {
  3417. ShowPlayerDialogEx(playerid, 3497, DIALOG_STYLE_INPUT, "Famed Skin Selection","Please enter a Skin ID!\n\nNote: Skin changes are free for famed members.", "Change", "Cancel" );
  3418. }
  3419. if(listitem == 3)
  3420. {
  3421. ShowPlayerDialogEx(playerid, 7484, DIALOG_STYLE_LIST, "Job Center", "Detective\nLawyer\nWhore\nDrugs Dealer\nBodyguard\nMechanic\nArms Dealer\nBoxer\nDrugs Smuggler\nTaxi Driver\nCraftsman\nBartender\nShipment Contractor\nPizza Boy", "Proceed", "Cancel");
  3422. }
  3423. }
  3424. if(dialogid == DIALOG_LOCKER_COS)
  3425. {
  3426. if(!response) return SendClientMessageEx(playerid, COLOR_GRAD2, "You have exited the locker.");
  3427. if(listitem == 0)
  3428. {
  3429. new Float:health;
  3430. GetHealth(playerid, health);
  3431. new hpint = floatround( health, floatround_round );
  3432. if( hpint >= 100 )
  3433. {
  3434. SendClientMessageEx(playerid, COLOR_GREY, "You already have full health.");
  3435. return 1;
  3436. }
  3437. else {
  3438. SetHealth(playerid, 100);
  3439. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You have used a first aid kit, you now have 100.0 HP.");
  3440. }
  3441. }
  3442. if(listitem == 1)
  3443. {
  3444. new Float:armour;
  3445. GetArmour(playerid, armour);
  3446. if(armour >= 100)
  3447. {
  3448. SendClientMessageEx(playerid, COLOR_GREY, "You already have full armor.");
  3449. return 1;
  3450. }
  3451. else if(GetPlayerCash(playerid) < 5000)
  3452. {
  3453. SendClientMessageEx(playerid, COLOR_GREY,"You don't have $5000");
  3454. return 1;
  3455. }
  3456. else {
  3457. GivePlayerCash(playerid, -5000);
  3458. SetArmour(playerid, 100);
  3459. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You paid $5000 for a kevlar vest.");
  3460. }
  3461. }
  3462. if(listitem == 2)
  3463. {
  3464. ShowPlayerDialogEx(playerid, 3497, DIALOG_STYLE_INPUT, "Famed Skin Selection","Please enter a Skin ID!\n\nNote: Skin changes are free for famed members.", "Change", "Cancel" );
  3465. }
  3466. if(listitem == 3)
  3467. {
  3468. ShowPlayerDialogEx(playerid, 7484, DIALOG_STYLE_LIST, "Job Center", "Detective\nLawyer\nWhore\nDrugs Dealer\nBodyguard\nMechanic\nArms Dealer\nBoxer\nDrugs Smuggler\nTaxi Driver\nCraftsman\nBartender\nShipment Contractor\nPizza Boy", "Proceed", "Cancel");
  3469. }
  3470. }
  3471. if(dialogid == DIALOG_LOCKER_FAMED)
  3472. {
  3473. if(!response) return SendClientMessageEx(playerid, COLOR_GRAD2, "You have exited the locker.");
  3474. if(listitem == 0)
  3475. {
  3476. new Float:health;
  3477. GetHealth(playerid, health);
  3478. new hpint = floatround(health, floatround_round);
  3479. if(hpint >= 100)
  3480. {
  3481. SendClientMessageEx(playerid, COLOR_GREY, "You already have full health.");
  3482. return 1;
  3483. }
  3484. else {
  3485. SetHealth(playerid, 100);
  3486. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You have used a first aid kit, you now have 100.0 HP.");
  3487. }
  3488. }
  3489. if(listitem == 1)
  3490. {
  3491. new Float:armour;
  3492. GetArmour(playerid, armour);
  3493. if(armour >= 100)
  3494. {
  3495. SendClientMessageEx(playerid, COLOR_GREY, "You already have full armor.");
  3496. return 1;
  3497. }
  3498. else {
  3499. SetArmour(playerid, 100);
  3500. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] You have received a Kevlar Vest free of charge.");
  3501. }
  3502. }
  3503. if(listitem == 2)
  3504. {
  3505. if(PlayerInfo[playerid][pAccountRestricted] != 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "Your account is restricted!");
  3506. ShowPlayerDialogEx(playerid, 3498, DIALOG_STYLE_LIST, "Famed Weapon Inventory", "Desert Eagle (Free)\nSemi-Automatic MP5 (Free)\nPump Shotgun (Free)\nCounty Rifle (Free)\nSilenced Pistol (Free)\nJapanese Katana (Free)\nPurple Dildo (Free)\nWhite Dildo (Free)\nBig Vibrator (Free)\nSilver Vibrator (Free)\n", "Take", "Cancel");
  3507. }
  3508. if(listitem == 3)
  3509. {
  3510. ShowPlayerDialogEx(playerid, 3497, DIALOG_STYLE_INPUT, "Famed Skin Selection", "Please enter a Skin ID!\n\nNote: Skin changes are free for famed members.", "Change", "Cancel" );
  3511. }
  3512. if(listitem == 4)
  3513. {
  3514. ShowPlayerDialogEx(playerid, 7484, DIALOG_STYLE_LIST, "Job Center", "Detective\nLawyer\nWhore\nDrugs Dealer\nBodyguard\nMechanic\nArms Dealer\nBoxer\nDrugs Smuggler\nTaxi Driver\nCraftsman\nBartender\nShipment Contractor\nPizza Boy", "Proceed", "Cancel");
  3515. }
  3516. if(listitem == 5)
  3517. {
  3518. if(!response) return SendClientMessageEx(playerid, COLOR_GRAD2, "You have exited the famed locker.");
  3519. if(PlayerInfo[playerid][pWantedLevel] >= 6)
  3520. return SendClientMessageEx(playerid, COLOR_YELLOW, "You cannot use this as Most Wanted!");
  3521. if(PlayerInfo[playerid][pJailTime] > 0)
  3522. {
  3523. SendClientMessageEx(playerid, COLOR_YELLOW, "You cannot do this at this time.");
  3524. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has attempted to change his name tag color to famed while in jail/prison.", GetPlayerNameEx(playerid));
  3525. ABroadCast(COLOR_YELLOW, string, 2);
  3526. return 1;
  3527. }
  3528. if(GetPVarInt(playerid, "famedTag") == 0)
  3529. {
  3530. SetPlayerColor(playerid, COLOR_FAMED);
  3531. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] Your name color will now appear as famed.");
  3532. SetPVarInt(playerid, "famedTag", 1);
  3533. return 1;
  3534. }
  3535. else {
  3536. SetPlayerToTeamColor(playerid);
  3537. SendClientMessageEx(playerid, COLOR_YELLOW, "[Famed Locker] Your name color will now appear as normal.");
  3538. SetPVarInt(playerid, "famedTag", 0);
  3539. }
  3540. }
  3541. }
  3542. if(dialogid == 7483) // VIP Locker /viplocker
  3543. {
  3544. if(response)
  3545. {
  3546. if(!IsPlayerInRangeOfPoint(playerid, 7.0, 2555.747314, 1404.106079, 7699.584472) && !IsPlayerInRangeOfPoint(playerid, 7.0, 1832.0533, 1380.7281, 1464.3822) && !IsPlayerInRangeOfPoint(playerid, 7.0, 772.4844, 1715.7213, 1938.0391) && !IsPlayerInRangeOfPoint(playerid, 7.0, 1378.0017, 1747.4668, 927.3564)) SendClientMessageEx(playerid, COLOR_GRAD1, "You're not at a VIP Locker.");
  3547. if(listitem == 0)
  3548. {
  3549. new Float:health;
  3550. GetHealth(playerid, health);
  3551. new hpint = floatround( health, floatround_round );
  3552. if( hpint >= 100 )
  3553. {
  3554. SendClientMessageEx(playerid, COLOR_GREY, "You already have full health.");
  3555. return 1;
  3556. }
  3557. SetHealth(playerid, 100);
  3558. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have used a first aid kit, you now have 100.0 HP.");
  3559. }
  3560. if(listitem == 1)
  3561. {
  3562. new Float:armour;
  3563. GetArmour(playerid, armour);
  3564. if(armour >= 100)
  3565. {
  3566. SendClientMessageEx(playerid, COLOR_GREY, "You already have full armor.");
  3567. return 1;
  3568. }
  3569. if(PlayerInfo[playerid][pDonateRank] == 1)
  3570. {
  3571. if(GetPlayerCash(playerid) < 15000)
  3572. {
  3573. SendClientMessageEx(playerid, COLOR_GREY,"You can't afford the $15000!");
  3574. return 1;
  3575. }
  3576. GivePlayerCash(playerid, -15000);
  3577. SetArmour(playerid, 100);
  3578. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You paid $15000 for a kevlar vest.");
  3579. }
  3580. else if(PlayerInfo[playerid][pDonateRank] == 2)
  3581. {
  3582. if(GetPlayerCash(playerid) < 10000)
  3583. {
  3584. SendClientMessageEx(playerid, COLOR_GREY,"You can't afford the $10000!");
  3585. return 1;
  3586. }
  3587. GivePlayerCash(playerid, -10000);
  3588. SetArmour(playerid, 100);
  3589. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You paid $10000 for a kevlar vest.");
  3590. }
  3591. if(PlayerInfo[playerid][pDonateRank] >= 3)
  3592. {
  3593. SetArmour(playerid, 100);
  3594. SetPVarInt(playerid, "Armor", 1);
  3595. }
  3596. }
  3597. if(listitem == 2)
  3598. {
  3599. if(PlayerInfo[playerid][pAccountRestricted] != 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "Your account is restricted!");
  3600. if(PlayerInfo[playerid][pDonateRank] >= 1)
  3601. {
  3602. switch(PlayerInfo[playerid][pDonateRank])
  3603. {
  3604. case 1, 2: ShowPlayerDialogEx(playerid, VIPWEPSMENU, DIALOG_STYLE_LIST, "VIP Weapons", "Desert Eagle (3)\nShotgun (2)\nMP5 (3)\nSilenced Pistol (2)\nGolf Club (1)\nBat (1)\nDildo (1)\nSword (1)\n9mm (2)", "Select", "Cancel");
  3605. default: ShowPlayerDialogEx(playerid, VIPWEPSMENU, DIALOG_STYLE_LIST, "VIP Weapons", "Desert Eagle\nShotgun\nMP5\nSilenced Pistol\nGolf Club\nBat\nDildo\nSword\n9mm", "Select", "Cancel");
  3606. }
  3607. }
  3608. else
  3609. {
  3610. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You must be a VIP member to access the gun lockers.");
  3611. }
  3612. }
  3613. if(listitem == 3)
  3614. {
  3615. if(PlayerInfo[playerid][pDonateRank] >= 2)
  3616. {
  3617. ShowModelSelectionMenu(playerid, SkinList, "Change your clothes.");
  3618. }
  3619. else
  3620. {
  3621. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You must be at least Silver VIP to access the clothes corner. In the clothes corner you can get ANY skin.");
  3622. }
  3623. }
  3624. if(listitem == 4)
  3625. {
  3626. if(PlayerInfo[playerid][pDonateRank] >= 2)
  3627. {
  3628. ShowPlayerDialogEx(playerid, 7484, DIALOG_STYLE_LIST, "VIP: Job Center", "Detective\nLawyer\nWhore\nDrugs Dealer\nBodyguard\nMechanic\nArms Dealer\nBoxer\nDrugs Smuggler\nTaxi Driver\nCraftsman\nBartender\nShipment Contractor\nPizza Boy", "Proceed", "Cancel");
  3629. }
  3630. else
  3631. {
  3632. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You must be at least Silver VIP to access the job center.");
  3633. }
  3634. }
  3635. if(listitem == 5)
  3636. {
  3637. ShowPlayerDialogEx(playerid, 7486, DIALOG_STYLE_LIST, "VIP: VIP Color", "On\nOff", "Proceed", "Cancel");
  3638. }
  3639. }
  3640. }
  3641. if(dialogid == 7484) //This is now the default dialog for job centers in any lockers AKA VIP & Famed
  3642. {
  3643. if(!response) return DeletePVar(playerid, "m_Item");
  3644. switch(listitem)
  3645. {
  3646. case 0: // Detective
  3647. {
  3648. SetPVarInt(playerid, "jobSelection", 1);
  3649. }
  3650. case 1: // Lawyer
  3651. {
  3652. SetPVarInt(playerid, "jobSelection", 2);
  3653. }
  3654. case 2: // Whore
  3655. {
  3656. SetPVarInt(playerid, "jobSelection", 3);
  3657. }
  3658. case 3: // Drugs Dealer
  3659. {
  3660. //SetPVarInt(playerid, "jobSelection", 4);
  3661. }
  3662. case 4: // Bodyguard
  3663. {
  3664. SetPVarInt(playerid, "jobSelection", 8);
  3665. if(GetPVarInt(playerid, "m_Item") == 1) SetPVarInt(playerid, "jobSelection", 7);
  3666. }
  3667. case 5: // Mechanic
  3668. {
  3669. SetPVarInt(playerid, "jobSelection", 7);
  3670. if(GetPVarInt(playerid, "m_Item") == 1) SetPVarInt(playerid, "jobSelection", 9);
  3671. }
  3672. case 6: // Arms Dealer
  3673. {
  3674. SetPVarInt(playerid, "jobSelection", 9);
  3675. if(GetPVarInt(playerid, "m_Item") == 1) SetPVarInt(playerid, "jobSelection", 12);
  3676. }
  3677. case 7: // Boxer
  3678. {
  3679. SetPVarInt(playerid, "jobSelection", 12);
  3680. if(GetPVarInt(playerid, "m_Item") == 1) SetPVarInt(playerid, "jobSelection", 20);
  3681. }
  3682. case 8: // Drugs Smuggler
  3683. {
  3684. SetPVarInt(playerid, "jobSelection", 14);
  3685. }
  3686. case 9: // Taxi Driver
  3687. {
  3688. SetPVarInt(playerid, "jobSelection", 17);
  3689. }
  3690. case 10: // Craftsman
  3691. {
  3692. SetPVarInt(playerid, "jobSelection", 18);
  3693. }
  3694. case 11: // Bartender
  3695. {
  3696. SetPVarInt(playerid, "jobSelection", 19);
  3697. }
  3698. case 12: // Trucker
  3699. {
  3700. SetPVarInt(playerid, "jobSelection", 20);
  3701. }
  3702. case 13: // Pizza Boy
  3703. {
  3704. SetPVarInt(playerid, "jobSelection", 21);
  3705. }
  3706. }
  3707. if(GetPVarInt(playerid, "m_Item") == 1)
  3708. {
  3709. if(GetJobLevel(playerid, GetPVarInt(playerid, "jobSelection")) == 5) return SendClientMessageEx(playerid, COLOR_GRAD2, "Your skill level for this job is already at its highest.");
  3710. format(string, sizeof(string), "Item: %s - %s\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", mItemName[1], GetJobName(GetPVarInt(playerid, "jobSelection")), number_format(PlayerInfo[playerid][pCredits]), number_format(MicroItems[1]), number_format(PlayerInfo[playerid][pCredits]-MicroItems[1]));
  3711. return ShowPlayerDialogEx(playerid, DIALOG_MICROSHOP3, DIALOG_STYLE_MSGBOX, "Micro Shop", string, "Purchase", "Cancel");
  3712. }
  3713. if(GetPVarType(playerid, "m_Item") && GetPVarInt(playerid, "m_Item") == 0) strcat(string, "Micro Shop: Change a Job"); else strcat(string, "Locker: Job Center");
  3714. if(PlayerInfo[playerid][pFamed] > 0 && PlayerInfo[playerid][pDonateRank] < 3)
  3715. {
  3716. ShowPlayerDialogEx(playerid, 7485, DIALOG_STYLE_LIST, string, "Job Slot 1\nJob Slot 2", "Proceed", "Cancel");
  3717. }
  3718. else if(PlayerInfo[playerid][pDonateRank] == 2)
  3719. {
  3720. ShowPlayerDialogEx(playerid, 7485, DIALOG_STYLE_LIST, string, "Job Slot 1\nJob Slot 2", "Proceed", "Cancel");
  3721. }
  3722. else if(PlayerInfo[playerid][pDonateRank] >= 3)
  3723. {
  3724. ShowPlayerDialogEx(playerid, 7485, DIALOG_STYLE_LIST, string, "Job Slot 1\nJob Slot 2\nJob Slot 3", "Proceed", "Cancel");
  3725. }
  3726. else ShowPlayerDialogEx(playerid, 7485, DIALOG_STYLE_LIST, string, "Job Slot 1", "Proceed", "Cancel");
  3727. }
  3728. if(dialogid == 7485)
  3729. {
  3730. if(!response) return DeletePVar(playerid, "m_Item");
  3731. if(GetPVarType(playerid, "m_Item") && GetPVarInt(playerid, "m_Item") == 0)
  3732. {
  3733. SetPVarInt(playerid, "m_Response", listitem);
  3734. format(string, sizeof(string), "Item: %s - %s\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", mItemName[0], GetJobName(GetPVarInt(playerid, "jobSelection")), number_format(PlayerInfo[playerid][pCredits]), number_format(MicroItems[0]), number_format(PlayerInfo[playerid][pCredits]-MicroItems[0]));
  3735. return ShowPlayerDialogEx(playerid, DIALOG_MICROSHOP3, DIALOG_STYLE_MSGBOX, "Micro Shop", string, "Purchase", "Cancel");
  3736. }
  3737. switch(listitem)
  3738. {
  3739. case 0:
  3740. {
  3741. PlayerInfo[playerid][pJob] = GetPVarInt(playerid, "jobSelection");
  3742. SendClientMessageEx(playerid, COLOR_YELLOW, "You have changed your first job!");
  3743. }
  3744. case 1:
  3745. {
  3746. PlayerInfo[playerid][pJob2] = GetPVarInt(playerid, "jobSelection");
  3747. SendClientMessageEx(playerid, COLOR_YELLOW, "You have changed your second job!");
  3748. }
  3749. case 2:
  3750. {
  3751. PlayerInfo[playerid][pJob3] = GetPVarInt(playerid, "jobSelection");
  3752. SendClientMessageEx(playerid, COLOR_YELLOW, "You have changed your third job!");
  3753. }
  3754. }
  3755. }
  3756. if(dialogid == 7486)
  3757. {
  3758. if(!response) return 1;
  3759. if(PlayerInfo[playerid][pWantedLevel] >= 6)
  3760. {
  3761. SendClientMessageEx(playerid, COLOR_YELLOW, "You cannot use this as Most Wanted!");
  3762. return 1;
  3763. }
  3764. if(PlayerInfo[playerid][pJailTime] > 0)
  3765. {
  3766. SendClientMessageEx(playerid, COLOR_YELLOW, "You cannot do this at this time.");
  3767. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has attempted to change to VIP color while jailed.", GetPlayerNameEx(playerid));
  3768. ABroadCast(COLOR_YELLOW, string, 2);
  3769. return 1;
  3770. }
  3771. switch(listitem)
  3772. {
  3773. case 0:
  3774. {
  3775. SetPlayerColor(playerid, COLOR_VIP);
  3776. SendClientMessageEx(playerid, COLOR_YELLOW, "You have turned on your VIP Name Color!");
  3777. }
  3778. case 1:
  3779. {
  3780. SetPlayerToTeamColor(playerid);
  3781. SendClientMessageEx(playerid, COLOR_YELLOW, "You have turned off your VIP Name Color!");
  3782. }
  3783. }
  3784. }
  3785. if(dialogid == RESTAURANTMENU)
  3786. {
  3787. new pvar[25];
  3788. if (response)
  3789. {
  3790. new iBusiness = InBusiness(playerid);
  3791. format(pvar, sizeof(pvar), "Business_MenuItemPrice%d", listitem);
  3792. new iPrice = GetPVarInt(playerid, pvar);
  3793. format(pvar, sizeof(pvar), "Business_MenuItem%d", listitem);
  3794. new iItem = GetPVarInt(playerid, pvar);
  3795. new cost = (PlayerInfo[playerid][pDonateRank] >= 1) ? (floatround(iPrice * 0.8)) : (iPrice);
  3796. if (!iPrice) {
  3797. SendClientMessageEx(playerid, COLOR_GRAD4, "Item is not for sale anymore.");
  3798. }
  3799. else if (Businesses[iBusiness][bInventory] < 1) {
  3800. SendClientMessageEx(playerid, COLOR_GRAD2, "Store does not have any items anymore!");
  3801. }
  3802. else if (iPrice != Businesses[iBusiness][bItemPrices][iItem]) {
  3803. SendClientMessageEx(playerid, COLOR_GRAD4, "Purchase failed because the price for this item has changed.");
  3804. }
  3805. else if (GetPlayerCash(playerid) < cost) {
  3806. SendClientMessageEx(playerid, COLOR_GRAD4, "You can't afford this item!");
  3807. }
  3808. else {
  3809. format(pvar, sizeof(pvar), "Business_MenuItem%d", listitem);
  3810. Businesses[iBusiness][bInventory]--;
  3811. Businesses[iBusiness][bTotalSales]++;
  3812. Businesses[iBusiness][bSafeBalance] += TaxSale(cost);
  3813. //Businesses[iBusiness][bSafeBalance] -= floatround(cost * BIZ_PENALTY);
  3814. GivePlayerCash(playerid, -cost);
  3815. if (PlayerInfo[playerid][pBusiness] != InBusiness(playerid)) Businesses[iBusiness][bLevelProgress]++;
  3816. SaveBusiness(iBusiness);
  3817. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  3818. if (PlayerInfo[playerid][pDonateRank] >= 1)
  3819. {
  3820. format(string,sizeof(string),"VIP: You have received 20 percent off this product. Instead of paying $%s, you paid $%s.", number_format(Businesses[iBusiness][bItemPrices][listitem]), number_format(cost));
  3821. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  3822. }
  3823. format(string,sizeof(string),"%s(%d) (IP: %s) has bought a %s in %s (%d) for $%d.",GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid),RestaurantItems[iItem], Businesses[iBusiness][bName], iBusiness, cost);
  3824. Log("logs/business.log", string);
  3825. format(string,sizeof(string),"* You have purchased a %s from %s for $%d.",RestaurantItems[iItem],Businesses[iBusiness][bName], cost);
  3826. SendClientMessage(playerid, COLOR_GRAD2, string);
  3827. printf("%s\n%i", RestaurantItems[iItem], iItem);
  3828. if (strcmp("Starter Meal", RestaurantItems[iItem]) == 0) // starter
  3829. {
  3830. if (PlayerInfo[playerid][pFitness] >= 3)
  3831. PlayerInfo[playerid][pFitness] -= 3;
  3832. else
  3833. PlayerInfo[playerid][pFitness] = 0;
  3834. }
  3835. if (strcmp("Full Meal", RestaurantItems[iItem]) == 0) // full meal
  3836. {
  3837. switch(PlayerInfo[playerid][pBackpack]) {
  3838. case 1: if(PlayerInfo[playerid][pBItems][0] < 1 && PlayerInfo[playerid][pBEquipped]) {
  3839. ShowPlayerDialogEx(playerid, DIALOG_BMEALSTORE, DIALOG_STYLE_MSGBOX, "Eat or Store", "You can store this full meal inside your backpack or you can eat it right now", "Store", "Eat");
  3840. return 1;
  3841. }
  3842. case 2: if(PlayerInfo[playerid][pBItems][0] < 4 && PlayerInfo[playerid][pBEquipped]) {
  3843. ShowPlayerDialogEx(playerid, DIALOG_BMEALSTORE, DIALOG_STYLE_MSGBOX, "Eat or Store", "You can store this full meal inside your backpack or you can eat it right now", "Store", "Eat");
  3844. return 1;
  3845. }
  3846. case 3: if(PlayerInfo[playerid][pBItems][0] < 5 && PlayerInfo[playerid][pBEquipped]) {
  3847. ShowPlayerDialogEx(playerid, DIALOG_BMEALSTORE, DIALOG_STYLE_MSGBOX, "Eat or Store", "You can store this full meal inside your backpack or you can eat it right now", "Store", "Eat");
  3848. return 1;
  3849. }
  3850. }
  3851. }
  3852. SetHealth(playerid, 100.0);
  3853. }
  3854. }
  3855. for (new i; i <= 13; i++)
  3856. {
  3857. format(pvar,sizeof(pvar),"Business_MenuItem%d", i);
  3858. DeletePVar(playerid, pvar);
  3859. format(pvar,sizeof(pvar),"Business_MenuItemPrice%d", i);
  3860. DeletePVar(playerid, pvar);
  3861. }
  3862. }
  3863. if (dialogid == RESTAURANTMENU2)
  3864. {
  3865. if (response)
  3866. {
  3867. new business = InBusiness(playerid);
  3868. if (GetPlayerCash(playerid) < Businesses[business][bItemPrices][listitem])
  3869. {
  3870. return SendClientMessageEx(playerid, COLOR_GRAD4, "You don't have the cash for this item!");
  3871. }
  3872. GivePlayerCash(playerid, -Businesses[business][bItemPrices][listitem]);
  3873. Businesses[business][bSafeBalance] += TaxSale(Businesses[business][bItemPrices][listitem]);
  3874. Businesses[business][bTotalSales]++;
  3875. Businesses[business][bTotalProfits] += Businesses[business][bItemPrices][listitem];
  3876. new buf[128];
  3877. format(buf, sizeof(buf), "You have purchased a '%s'.", RestaurantItems[listitem]);
  3878. SendClientMessageEx(playerid, COLOR_GRAD4, buf);
  3879. }
  3880. return 1;
  3881. }
  3882. if(dialogid == STOREMENU)
  3883. {
  3884. new pvar[25];
  3885. if (response)
  3886. {
  3887. new iBusiness = InBusiness(playerid);
  3888. format(pvar, sizeof(pvar), "Business_MenuItemPrice%d", listitem);
  3889. new iPrice = GetPVarInt(playerid, pvar);
  3890. format(pvar, sizeof(pvar), "Business_MenuItem%d", listitem);
  3891. new iItem = GetPVarInt(playerid, pvar);
  3892. new cost = (PlayerInfo[playerid][pDonateRank] >= 1) ? (floatround(iPrice * 0.8)) : (iPrice);
  3893. if (!iPrice) {
  3894. SendClientMessageEx(playerid, COLOR_GRAD4, "Item is not for sale anymore.");
  3895. }
  3896. else if (Businesses[iBusiness][bInventory] < 1) {
  3897. SendClientMessageEx(playerid, COLOR_GRAD2, "Store does not have any items anymore!");
  3898. }
  3899. else if (iPrice != Businesses[iBusiness][bItemPrices][iItem-1]) {
  3900. SendClientMessageEx(playerid, COLOR_GRAD4, "Purchase failed because the price for this item has changed.");
  3901. }
  3902. else if (GetPlayerCash(playerid) < cost) {
  3903. SendClientMessageEx(playerid, COLOR_GRAD4, "You can't afford this item!");
  3904. }
  3905. else {
  3906. format(pvar, sizeof(pvar), "Business_MenuItem%d", listitem);
  3907. if(iItem == ITEM_ILOCK || iItem == ITEM_SCALARM || iItem == ITEM_ELOCK)
  3908. {
  3909. if(Businesses[iBusiness][bInventory] >= StoreItemCost[iItem-1][ItemValue])
  3910. {
  3911. SetPVarInt(playerid, "lockcost", cost);
  3912. SetPVarInt(playerid, "businessid", iBusiness);
  3913. SetPVarInt(playerid, "item", iItem);
  3914. SetPVarInt(playerid, "penalty", 1);
  3915. GivePlayerStoreItem(playerid, 0, iBusiness, iItem, cost);
  3916. }
  3917. else return SendClientMessageEx(playerid, COLOR_GRAD2, "The store does not have enough stock for that item!");
  3918. }
  3919. else
  3920. {
  3921. GivePlayerStoreItem(playerid, 0, iBusiness, iItem, cost);
  3922. }
  3923. }
  3924. }
  3925. for (new i; i < sizeof(StoreItems); i++)
  3926. {
  3927. format(pvar,sizeof(pvar),"Business_MenuItem%d", i);
  3928. DeletePVar(playerid, pvar);
  3929. format(pvar,sizeof(pvar),"Business_MenuItemPrice%d", i);
  3930. DeletePVar(playerid, pvar);
  3931. }
  3932. }
  3933. if(dialogid == SHOPMENU)
  3934. {
  3935. if(response)
  3936. {
  3937. new biz = InBusiness(playerid);
  3938. if (GetPlayerCash(playerid) < Businesses[biz][bItemPrices][listitem])
  3939. {
  3940. return SendClientMessageEx(playerid, COLOR_GRAD4, "You don't have the cash for this item!");
  3941. }
  3942. Businesses[biz][bTotalSales]++;
  3943. Businesses[biz][bSafeBalance] += TaxSale(Businesses[biz][bItemPrices][listitem]);
  3944. GivePlayerCash(playerid, -Businesses[biz][bItemPrices][listitem]);
  3945. switch (listitem)
  3946. {
  3947. case 0:
  3948. {
  3949. GivePlayerValidWeapon(playerid, WEAPON_DILDO);
  3950. SendClientMessageEx(playerid, COLOR_GRAD4, "Purple Dildo purchased, you can now pleasure yourself.");
  3951. }
  3952. case 1:
  3953. {
  3954. GivePlayerValidWeapon(playerid, WEAPON_VIBRATOR);
  3955. SendClientMessageEx(playerid, COLOR_GRAD4, "Short Vibrator purchased, you can now pleasure yourself.");
  3956. }
  3957. case 2:
  3958. {
  3959. GivePlayerValidWeapon(playerid, WEAPON_VIBRATOR2);
  3960. SendClientMessageEx(playerid, COLOR_GRAD4, "Long Vibrator purchased, you can now pleasure yourself.");
  3961. }
  3962. case 3:
  3963. {
  3964. GivePlayerValidWeapon(playerid, WEAPON_DILDO2);
  3965. SendClientMessageEx(playerid, COLOR_GRAD4, "White Dildo purchased, you can now pleasure yourself.");
  3966. }
  3967. }
  3968. }
  3969. return 1;
  3970. }
  3971. if(dialogid == GIVEKEYS)
  3972. {
  3973. if(response)
  3974. {
  3975. if(PlayerVehicleInfo[playerid][listitem][pvId] == INVALID_PLAYER_VEHICLE_ID) {
  3976. SendClientMessageEx(playerid, COLOR_GRAD2, "You can't give out keys to a non-existent, impounded vehicle or stored vehicle.");
  3977. GiveKeysTo[playerid] = INVALID_PLAYER_ID;
  3978. return 1;
  3979. }
  3980. if(PlayerVehicleInfo[playerid][listitem][pvAllowedPlayerId] != INVALID_PLAYER_ID)
  3981. {
  3982. SendClientMessageEx(playerid, COLOR_GRAD2, "You already gave someone the keys of this car.");
  3983. GiveKeysTo[playerid] = INVALID_PLAYER_ID;
  3984. return 1;
  3985. }
  3986. if(PlayerInfo[GiveKeysTo[playerid]][pVehicleKeysFrom] != INVALID_PLAYER_ID)
  3987. {
  3988. SendClientMessageEx(playerid, COLOR_GRAD2, "That person already has keys from a different car.");
  3989. GiveKeysTo[playerid] = INVALID_PLAYER_ID;
  3990. return 1;
  3991. }
  3992. PlayerVehicleInfo[playerid][listitem][pvAllowedPlayerId] = GiveKeysTo[playerid];
  3993. PlayerInfo[GiveKeysTo[playerid]][pVehicleKeys] = listitem;
  3994. PlayerInfo[GiveKeysTo[playerid]][pVehicleKeysFrom] = playerid;
  3995. format(string, sizeof(string), "%s has given you the keys for their %s.", GetPlayerNameEx(playerid), GetVehicleName(PlayerVehicleInfo[playerid][listitem][pvId]));
  3996. SendClientMessageEx(GiveKeysTo[playerid], COLOR_GRAD2, string);
  3997. format(string, sizeof(string), "You gave %s the keys for your %s.", GetPlayerNameEx(GiveKeysTo[playerid]), GetVehicleName(PlayerVehicleInfo[playerid][listitem][pvId]));
  3998. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  3999. GiveKeysTo[playerid] = INVALID_PLAYER_ID;
  4000. }
  4001. }
  4002. if(dialogid == REMOVEKEYS)
  4003. {
  4004. if(response)
  4005. {
  4006. if(PlayerVehicleInfo[playerid][listitem][pvId] == INVALID_PLAYER_VEHICLE_ID) {
  4007. SendClientMessageEx(playerid, COLOR_GRAD2, "You can't remove the keys of a non-existent, impounded vehicle or stored vehicle.");
  4008. return 1;
  4009. }
  4010. if(PlayerVehicleInfo[playerid][listitem][pvAllowedPlayerId] != PlayerVehicleInfo[playerid][listitem][pvAllowedPlayerId])
  4011. {
  4012. SendClientMessageEx(playerid, COLOR_GRAD2, "This person doesn't have the keys of this car.");
  4013. return 1;
  4014. }
  4015. if(PlayerVehicleInfo[playerid][listitem][pvAllowedPlayerId] == INVALID_PLAYER_ID)
  4016. {
  4017. SendClientMessageEx(playerid, COLOR_GRAD2, "You have not given anyone the keys for this car.");
  4018. return 1;
  4019. }
  4020. if (ProxDetectorS(4.0, playerid, PlayerVehicleInfo[playerid][listitem][pvAllowedPlayerId])) {
  4021. PlayerInfo[PlayerVehicleInfo[playerid][listitem][pvAllowedPlayerId]][pVehicleKeys] = INVALID_PLAYER_VEHICLE_ID;
  4022. PlayerInfo[PlayerVehicleInfo[playerid][listitem][pvAllowedPlayerId]][pVehicleKeysFrom] = INVALID_PLAYER_ID;
  4023. format(string, sizeof(string), "%s has taken the keys of their %s.", GetPlayerNameEx(playerid), GetVehicleName(PlayerVehicleInfo[playerid][listitem][pvId]));
  4024. SendClientMessageEx(PlayerVehicleInfo[playerid][listitem][pvAllowedPlayerId], COLOR_GRAD2, string);
  4025. format(string, sizeof(string), "You took the keys of your %s from %s.", GetVehicleName(PlayerVehicleInfo[playerid][listitem][pvId]),GetPlayerNameEx(PlayerVehicleInfo[playerid][listitem][pvAllowedPlayerId]));
  4026. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  4027. PlayerVehicleInfo[playerid][listitem][pvAllowedPlayerId] = INVALID_PLAYER_ID;
  4028. }
  4029. else
  4030. return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not close enough to that player.");
  4031. }
  4032. }
  4033. if(dialogid == MPSPAYTICKETSCOP)
  4034. {
  4035. if(response)
  4036. {
  4037. new
  4038. szMessage[128],
  4039. iTargetID = GetPVarInt(playerid, "vRel");
  4040. if(PlayerVehicleInfo[iTargetID][listitem][pvTicket]) {
  4041. format(szMessage, sizeof(szMessage), "You have paid the $%s ticket on %s's %s.", number_format(PlayerVehicleInfo[iTargetID][listitem][pvTicket]), GetPlayerNameEx(iTargetID), VehicleName[PlayerVehicleInfo[iTargetID][listitem][pvModelId] - 400]);
  4042. SendClientMessageEx(playerid, COLOR_GRAD2, szMessage);
  4043. format(szMessage, sizeof(szMessage), "%s has paid all tickets on your %s (%i).", GetPlayerNameEx(playerid), VehicleName[PlayerVehicleInfo[iTargetID][listitem][pvModelId] - 400], PlayerVehicleInfo[iTargetID][listitem][pvTicket]);
  4044. SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szMessage);
  4045. PlayerVehicleInfo[iTargetID][listitem][pvTicket] = 0;
  4046. g_mysql_SaveVehicle(iTargetID, listitem);
  4047. }
  4048. else if(PlayerVehicleInfo[iTargetID][listitem][pvImpounded])
  4049. {
  4050. format(szMessage, sizeof(szMessage), "You have released %s's %s.", GetPlayerNameEx(iTargetID), VehicleName[PlayerVehicleInfo[iTargetID][listitem][pvModelId] - 400]);
  4051. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
  4052. format(szMessage, sizeof(szMessage), "%s has released your %s from the impound. (/vstorage to spawn it)", GetPlayerNameEx(playerid), VehicleName[PlayerVehicleInfo[iTargetID][listitem][pvModelId] - 400]);
  4053. SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szMessage);
  4054. format(szMessage, sizeof(szMessage), "HQ: %s has released %s's %s from the impound.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), VehicleName[PlayerVehicleInfo[iTargetID][listitem][pvModelId] - 400]);
  4055. SendGroupMessage(GROUP_TYPE_LEA, RADIO, szMessage);
  4056. SendGroupMessage(GROUP_TYPE_TOWING, RADIO, szMessage);
  4057. new rand = random(sizeof(DMVRelease));
  4058. PlayerVehicleInfo[iTargetID][listitem][pvImpounded] = 0;
  4059. PlayerVehicleInfo[iTargetID][listitem][pvSpawned] = 0;
  4060. PlayerVehicleInfo[iTargetID][listitem][pvPosX] = DMVRelease[rand][0];
  4061. PlayerVehicleInfo[iTargetID][listitem][pvPosY] = DMVRelease[rand][1];
  4062. PlayerVehicleInfo[iTargetID][listitem][pvPosZ] = DMVRelease[rand][2];
  4063. PlayerVehicleInfo[iTargetID][listitem][pvPosAngle] = 180.000;
  4064. PlayerVehicleInfo[iTargetID][listitem][pvTicket] = 0;
  4065. g_mysql_SaveVehicle(iTargetID, listitem);
  4066. }
  4067. else SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle either does not exist, or does not need to be released or have its tickets paid.");
  4068. }
  4069. return 1;
  4070. }
  4071. if(dialogid == MPSPAYTICKETS)
  4072. {
  4073. if(response)
  4074. {
  4075. new
  4076. szMessage[128];
  4077. if(PlayerInfo[playerid][pWantedLevel] != 0)
  4078. {
  4079. format(szMessage, sizeof(szMessage), "%s has attempted to pay/release their vehicles with %i active warrants.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pWantedLevel]);
  4080. SendGroupMessage(GROUP_TYPE_LEA, DEPTRADIO, szMessage);
  4081. return SendClientMessageEx(playerid, COLOR_YELLOW, "The police has been warned that you are wanted, and are on their way.");
  4082. }
  4083. if(PlayerVehicleInfo[playerid][listitem][pvTicket] && PlayerVehicleInfo[playerid][listitem][pvImpounded] == 0) {
  4084. if(GetPlayerCash(playerid) < PlayerVehicleInfo[playerid][listitem][pvTicket]) {
  4085. return SendClientMessageEx(playerid, COLOR_GRAD2, "You don't have enough money on you to pay the ticket.");
  4086. }
  4087. GivePlayerCash(playerid, -PlayerVehicleInfo[playerid][listitem][pvTicket]);
  4088. Tax += PlayerVehicleInfo[playerid][listitem][pvTicket];
  4089. SpeedingTickets += PlayerVehicleInfo[playerid][listitem][pvTicket];
  4090. for(new z; z < MAX_GROUPS; z++)
  4091. {
  4092. if(arrGroupData[z][g_iAllegiance] == 1)
  4093. {
  4094. if(arrGroupData[z][g_iGroupType] == GROUP_TYPE_GOV)
  4095. {
  4096. new str[128];
  4097. format(str, sizeof(str), "%s has paid some vehicle tickets adding $%s to the vault.", GetPlayerNameEx(playerid), number_format((PlayerVehicleInfo[playerid][listitem][pvTicket] / 100) * 30));
  4098. GroupPayLog(z, str);
  4099. break;
  4100. }
  4101. }
  4102. }
  4103. Misc_Save();
  4104. format(szMessage, sizeof(szMessage), "You have paid the $%s ticket on your %s.", number_format(PlayerVehicleInfo[playerid][listitem][pvTicket]), VehicleName[PlayerVehicleInfo[playerid][listitem][pvModelId] - 400]);
  4105. SendClientMessageEx(playerid, COLOR_GRAD2, szMessage);
  4106. PlayerVehicleInfo[playerid][listitem][pvTicket] = 0;
  4107. g_mysql_SaveVehicle(playerid, listitem);
  4108. }
  4109. else if(PlayerVehicleInfo[playerid][listitem][pvImpounded]) {
  4110. new
  4111. iCost = (PlayerVehicleInfo[playerid][listitem][pvPrice] / 20) + PlayerVehicleInfo[playerid][listitem][pvTicket] + (PlayerInfo[playerid][pLevel] * 3000);
  4112. if(GetPlayerCash(playerid) < iCost) {
  4113. return SendClientMessage(playerid, COLOR_GRAD2, "You don't have enough money on you.");
  4114. }
  4115. format(szMessage, sizeof(szMessage), "You have released your %s for $%i.", VehicleName[PlayerVehicleInfo[playerid][listitem][pvModelId] - 400], iCost);
  4116. SendClientMessage(playerid, COLOR_LIGHTBLUE, szMessage);
  4117. GivePlayerCash(playerid, -iCost);
  4118. Tax += iCost;
  4119. SpeedingTickets += iCost;
  4120. for(new z; z < MAX_GROUPS; z++)
  4121. {
  4122. if(arrGroupData[z][g_iAllegiance] == 0 || arrGroupData[z][g_iAllegiance] == 1)
  4123. {
  4124. if(arrGroupData[z][g_iGroupType] == GROUP_TYPE_GOV)
  4125. {
  4126. new str[128];
  4127. format(str, sizeof(str), "%s has paid some vehicle tickets adding $%s to the vault.", GetPlayerNameEx(playerid), number_format((iCost / 100) * 30));
  4128. GroupPayLog(z, str);
  4129. break;
  4130. }
  4131. }
  4132. }
  4133. Misc_Save();
  4134. new rand = random(sizeof(DMVRelease));
  4135. PlayerVehicleInfo[playerid][listitem][pvPosX] = DMVRelease[rand][0];
  4136. PlayerVehicleInfo[playerid][listitem][pvPosY] = DMVRelease[rand][1];
  4137. PlayerVehicleInfo[playerid][listitem][pvPosZ] = DMVRelease[rand][2];
  4138. PlayerVehicleInfo[playerid][listitem][pvImpounded] = 0;
  4139. PlayerVehicleInfo[playerid][listitem][pvSpawned] = 0;
  4140. PlayerVehicleInfo[playerid][listitem][pvPosAngle] = 180.000;
  4141. PlayerVehicleInfo[playerid][listitem][pvTicket] = 0;
  4142. SendClientMessageEx(playerid, COLOR_WHITE, "Your vehicle has been released, type /vstorage to spawn it.");
  4143. g_mysql_SaveVehicle(playerid, listitem);
  4144. }
  4145. else SendClientMessage(playerid, COLOR_GRAD2, "This vehicle either does not exist, or does not need to be released or have its tickets paid.");
  4146. }
  4147. return 1;
  4148. }
  4149. if(dialogid == REPORTSMENU)
  4150. {
  4151. if(response)
  4152. {
  4153. if(CancelReport[playerid] == listitem) return 1;
  4154. new reportid = ListItemReportId[playerid][listitem];
  4155. if(Reports[reportid][BeingUsed] == 0)
  4156. {
  4157. SendClientMessageEx(playerid, COLOR_GREY, " That report ID is not being used!");
  4158. return 1;
  4159. }
  4160. if(!IsPlayerConnected(Reports[reportid][ReportFrom]))
  4161. {
  4162. SendClientMessageEx(playerid, COLOR_GREY, " The reporter has disconnected !");
  4163. Reports[reportid][ReportFrom] = INVALID_PLAYER_ID;
  4164. Reports[reportid][BeingUsed] = 0;
  4165. return 1;
  4166. }
  4167. format(string, sizeof(string), "AdmCmd: %s has accepted the report from %s (ID: %i RID: %i).", GetPlayerNameEx(playerid), GetPlayerNameEx(Reports[reportid][ReportFrom]), Reports[reportid][ReportFrom], reportid);
  4168. ABroadCast(COLOR_ORANGE, string, 2);
  4169. AddReportToken(playerid); // Report Tokens
  4170. if(PlayerInfo[playerid][pAdmin] == 1)
  4171. {
  4172. SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, "An admin has accepted your report and is reviewing it, you can /reply to send messages to the admin reviewing your report.");
  4173. }
  4174. else
  4175. {
  4176. format(string, sizeof(string), "%s has accepted your report and is reviewing it, you can /reply to send messages to the admin reviewing your report.", GetPlayerNameEx(playerid));
  4177. SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string);
  4178. }
  4179. PlayerInfo[playerid][pAcceptReport]++;
  4180. ReportCount[playerid]++;
  4181. ReportHourCount[playerid]++;
  4182. Reports[reportid][ReplyTimerr] = SetTimerEx("ReplyTimer", 30000, 0, "d", reportid);
  4183. Reports[reportid][CheckingReport] = playerid;
  4184. //Reports[reportid][ReportFrom] = INVALID_PLAYER_ID;
  4185. Reports[reportid][BeingUsed] = 0;
  4186. Reports[reportid][TimeToExpire] = 0;
  4187. //strmid(Reports[reportid][Report], "None", 0, 4, 4);
  4188. }
  4189. else
  4190. {
  4191. if(CancelReport[playerid] == listitem) return 1;
  4192. new reportid = ListItemReportId[playerid][listitem];
  4193. if(Reports[reportid][BeingUsed] == 0)
  4194. {
  4195. SendClientMessageEx(playerid, COLOR_GREY, " That report ID is not being used!");
  4196. return 1;
  4197. }
  4198. if(!IsPlayerConnected(Reports[reportid][ReportFrom]))
  4199. {
  4200. SendClientMessageEx(playerid, COLOR_GREY, " The reporter has disconnected !");
  4201. Reports[reportid][ReportFrom] = INVALID_PLAYER_ID;
  4202. Reports[reportid][BeingUsed] = 0;
  4203. return 1;
  4204. }
  4205. format(string, sizeof(string), "AdmCmd: %s has trashed the report from %s (RID: %i).", GetPlayerNameEx(playerid), GetPlayerNameEx(Reports[reportid][ReportFrom]), reportid);
  4206. ABroadCast(COLOR_ORANGE, string, 2);
  4207. if(PlayerInfo[playerid][pAdmin] == 1)
  4208. {
  4209. SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, "An admin has marked your report invalid. It will not be reviewed.");
  4210. }
  4211. else
  4212. {
  4213. format(string, sizeof(string), "%s has marked your report invalid. It will not be reviewed.", GetPlayerNameEx(playerid));
  4214. SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string);
  4215. }
  4216. PlayerInfo[playerid][pTrashReport]++;
  4217. Reports[reportid][ReportFrom] = INVALID_PLAYER_ID;
  4218. Reports[reportid][BeingUsed] = 0;
  4219. Reports[reportid][TimeToExpire] = 0;
  4220. new reportdialog[2048], itemid = 0;
  4221. for(new i = 0; i < MAX_REPORTS; i++)
  4222. {
  4223. if(Reports[i][BeingUsed] == 1 && itemid < 40)
  4224. {
  4225. ListItemReportId[playerid][itemid] = i;
  4226. itemid++;
  4227. if(strlen((Reports[i][Report])) > 92)
  4228. {
  4229. new firstline[128], secondline[128];
  4230. strmid(firstline, Reports[i][Report], 0, 88);
  4231. strmid(secondline, Reports[i][Report], 88, 128);
  4232. format(reportdialog, sizeof(reportdialog), "%s%s(ID:%i) | Report: %s", reportdialog, GetPlayerNameEx(Reports[i][ReportFrom]), Reports[i][ReportFrom], i, firstline);
  4233. format(reportdialog, sizeof(reportdialog), "%s%s", reportdialog, secondline);
  4234. ListItemReportId[playerid][itemid] = i;
  4235. itemid++;
  4236. }
  4237. else format(reportdialog, sizeof(reportdialog), "%s%s(ID:%i) | Report: %s", reportdialog, GetPlayerNameEx(Reports[i][ReportFrom]), Reports[i][ReportFrom], i, (Reports[i][Report]));
  4238. format(reportdialog, sizeof(reportdialog), "%s\n", reportdialog);
  4239. }
  4240. }
  4241. CancelReport[playerid] = itemid;
  4242. format(reportdialog, sizeof(reportdialog), "%s\n", reportdialog);
  4243. format(reportdialog, sizeof(reportdialog), "%sCancel Reports", reportdialog);
  4244. //SendClientMessageEx(playerid, COLOR_GREEN, "___________________________________________________");
  4245. ShowPlayerDialogEx(playerid, REPORTSMENU, DIALOG_STYLE_LIST, "Reports", reportdialog, "Accept", "Trash");
  4246. //strmid(Reports[reportid][Report], "None", 0, 4, 4);
  4247. }
  4248. }
  4249. if(dialogid == COLORMENU)
  4250. {
  4251. if(response)
  4252. {
  4253. if(listitem == 0)
  4254. {
  4255. SetPlayerColor(playerid,COLOR_DBLUE);
  4256. SendClientMessageEx(playerid, COLOR_DBLUE, "Your color has been set to Blue!");
  4257. }
  4258. if(listitem == 1)
  4259. {
  4260. SetPlayerColor(playerid,COLOR_BLACK);
  4261. SendClientMessageEx(playerid, COLOR_BLACK, "Your color has been set to Black!");
  4262. }
  4263. if(listitem == 2)
  4264. {
  4265. SetPlayerColor(playerid,COLOR_RED);
  4266. SendClientMessageEx(playerid, COLOR_RED, "Your color has been set to Red!");
  4267. }
  4268. if(listitem == 3)
  4269. {
  4270. SetPlayerColor(playerid,TEAM_ORANGE_COLOR);
  4271. SendClientMessageEx(playerid, TEAM_ORANGE_COLOR, "Your color has been set to Orange!");
  4272. }
  4273. if(listitem == 4)
  4274. {
  4275. SetPlayerColor(playerid,COLOR_PINK);
  4276. SendClientMessageEx(playerid, COLOR_PINK, "Your color has been set to Pink!");
  4277. }
  4278. if(listitem == 5)
  4279. {
  4280. SetPlayerColor(playerid,COLOR_PURPLE);
  4281. SendClientMessageEx(playerid, COLOR_PURPLE, "Your color has been set to Purple!");
  4282. }
  4283. if(listitem == 6)
  4284. {
  4285. SetPlayerColor(playerid,COLOR_GREEN);
  4286. SendClientMessageEx(playerid, COLOR_GREEN, "Your color has been set to Green!");
  4287. }
  4288. if(listitem == 7)
  4289. {
  4290. SetPlayerColor(playerid,COLOR_YELLOW);
  4291. SendClientMessageEx(playerid, COLOR_YELLOW, "Your color has been set to Yellow!");
  4292. }
  4293. if(listitem == 8)
  4294. {
  4295. SetPlayerColor(playerid,COLOR_WHITE);
  4296. SendClientMessageEx(playerid, COLOR_WHITE, "Your color has been set to White!");
  4297. }
  4298. if(listitem == 9)
  4299. {
  4300. SetPlayerColor(playerid,TEAM_APRISON_COLOR);
  4301. SendClientMessageEx(playerid, COLOR_WHITE, "Your color has been set to OOC Prisoner Orange!");
  4302. }
  4303. }
  4304. }
  4305. if(dialogid == FIGHTMENU)
  4306. {
  4307. if(response)
  4308. {
  4309. if(GetPlayerCash(playerid) >= 50000)
  4310. {
  4311. if(listitem == 0)
  4312. {
  4313. PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_BOXING;
  4314. SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
  4315. SendClientMessageEx(playerid, COLOR_WHITE, " You are now using the boxing fighting style!");
  4316. if(PlayerInfo[playerid][pDonateRank] >= 1)
  4317. {
  4318. GivePlayerCash(playerid, -40000);
  4319. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have received 20 percent off this product. Instead of paying $50000, you paid $40000.");
  4320. }
  4321. else
  4322. {
  4323. GivePlayerCash(playerid, -50000);
  4324. }
  4325. }
  4326. if(listitem == 1)
  4327. {
  4328. PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_ELBOW;
  4329. SetPlayerFightingStyle (playerid, FIGHT_STYLE_ELBOW);
  4330. SendClientMessageEx(playerid, COLOR_WHITE, " You are now using the elbow fighting style!");
  4331. if(PlayerInfo[playerid][pDonateRank] >= 1)
  4332. {
  4333. GivePlayerCash(playerid, -40000);
  4334. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have received 20 percent off this product. Instead of paying $50000, you paid $40000.");
  4335. }
  4336. else
  4337. {
  4338. GivePlayerCash(playerid, -50000);
  4339. }
  4340. }
  4341. if(listitem == 2)
  4342. {
  4343. PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_KNEEHEAD;
  4344. SetPlayerFightingStyle (playerid, FIGHT_STYLE_KNEEHEAD);
  4345. SendClientMessageEx(playerid, COLOR_WHITE, " You are now using the kneehead fighting style!");
  4346. if(PlayerInfo[playerid][pDonateRank] >= 1)
  4347. {
  4348. GivePlayerCash(playerid, -40000);
  4349. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have received 20 percent off this product. Instead of paying $50000, you paid $40000.");
  4350. }
  4351. else
  4352. {
  4353. GivePlayerCash(playerid, -50000);
  4354. }
  4355. }
  4356. if(listitem == 3)
  4357. {
  4358. PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_KUNGFU;
  4359. SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU);
  4360. SendClientMessageEx(playerid, COLOR_WHITE, " You are now using the kungfu fighting style!");
  4361. if(PlayerInfo[playerid][pDonateRank] >= 1)
  4362. {
  4363. GivePlayerCash(playerid, -40000);
  4364. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have received 20 percent off this product. Instead of paying $50000, you paid $40000.");
  4365. }
  4366. else
  4367. {
  4368. GivePlayerCash(playerid, -50000);
  4369. }
  4370. }
  4371. if(listitem == 4)
  4372. {
  4373. PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_GRABKICK;
  4374. SetPlayerFightingStyle (playerid, FIGHT_STYLE_GRABKICK);
  4375. SendClientMessageEx(playerid, COLOR_WHITE, " You are now using the grabkick fighting style!");
  4376. if(PlayerInfo[playerid][pDonateRank] >= 1)
  4377. {
  4378. GivePlayerCash(playerid, -40000);
  4379. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have received 20 percent off this product. Instead of paying $50000, you paid $40000.");
  4380. }
  4381. else
  4382. {
  4383. GivePlayerCash(playerid, -50000);
  4384. }
  4385. }
  4386. }
  4387. else
  4388. {
  4389. SendClientMessageEx(playerid, COLOR_GREY, " You do not have the cash for that!");
  4390. return 1;
  4391. }
  4392. if(listitem == 5)
  4393. {
  4394. PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_NORMAL;
  4395. SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL);
  4396. SendClientMessageEx(playerid, COLOR_WHITE, " You are now using the normal fighting style!");
  4397. return 1;
  4398. }
  4399. }
  4400. }
  4401. if(dialogid == DIALOG_LICENSE_BUY && response) // LICENSE BUY DIALOG ~Brian
  4402. {
  4403. switch (listitem)
  4404. {
  4405. /*case 0:
  4406. {
  4407. if(PlayerInfo[playerid][pCarLic] == 0)
  4408. {
  4409. if(GetPlayerCash(playerid) < 5000)
  4410. {
  4411. SendClientMessageEx(playerid, COLOR_GREY, "You can not afford to buy a driver's license.");
  4412. return 1;
  4413. }
  4414. GivePlayerCash(playerid,-5000);
  4415. PlayerInfo[playerid][pCarLic] = 1;
  4416. SendClientMessageEx(playerid, COLOR_GREY, "You have successfully acquired a driver's license.");
  4417. }
  4418. else SendClientMessageEx(playerid, COLOR_GREY, "You already have a driver's license.");
  4419. }*/
  4420. case 0:
  4421. {
  4422. if(PlayerInfo[playerid][pBoatLic] == 0)
  4423. {
  4424. if(GetPlayerCash(playerid) < 5000)
  4425. {
  4426. SendClientMessageEx(playerid, COLOR_GREY, "You can not afford to buy a boating license.");
  4427. return 1;
  4428. }
  4429. GivePlayerCash(playerid,-5000);
  4430. PlayerInfo[playerid][pBoatLic] = 1;
  4431. SendClientMessageEx(playerid, COLOR_GREY, "You have successfully acquired a boating license.");
  4432. }
  4433. else SendClientMessageEx(playerid, COLOR_GREY, "You already have a boating license.");
  4434. }
  4435. case 1:
  4436. {
  4437. if(PlayerInfo[playerid][pFlyLic] == 0)
  4438. {
  4439. if(PlayerInfo[playerid][pLevel] >=2)
  4440. {
  4441. if(GetPlayerCash(playerid) < 25000)
  4442. {
  4443. SendClientMessageEx(playerid, COLOR_GREY, "You can not afford to buy a pilot's license.");
  4444. return 1;
  4445. }
  4446. GivePlayerCash(playerid,-25000);
  4447. PlayerInfo[playerid][pFlyLic] = 1;
  4448. SendClientMessageEx(playerid, COLOR_GREY, "You have successfully acquired a pilot license; you will now be able to pilot aircraft.");
  4449. }
  4450. else SendClientMessageEx(playerid, COLOR_GREY, "You must be level 2 or above to acquire a pilot license.");
  4451. }
  4452. else SendClientMessageEx(playerid, COLOR_GREY, "You already have a pilot license.");
  4453. }
  4454. case 2:
  4455. {
  4456. if(PlayerInfo[playerid][pTaxiLicense] == 0)
  4457. {
  4458. if(GetPlayerCash(playerid) < 35000)
  4459. {
  4460. SendClientMessageEx(playerid, COLOR_GREY, "You can not afford to buy a taxi license.");
  4461. return 1;
  4462. }
  4463. GivePlayerCash(playerid,-35000);
  4464. PlayerInfo[playerid][pTaxiLicense] = 1;
  4465. SendClientMessageEx(playerid, COLOR_GREY, "You have successfully acquired a taxi license; you will be able to use /fare in any vehicle, and accept calls for taxis.");
  4466. }
  4467. else SendClientMessageEx(playerid, COLOR_GREY, "You already have a taxi license.");
  4468. }
  4469. }
  4470. }
  4471. if(dialogid == MDC_MAIN && response)
  4472. {
  4473. if(!IsMDCPermitted(playerid)) return SendClientMessageEx(playerid, COLOR_LIGHTBLUE, " Login Failed. You are not permitted to use the MDC!");
  4474. switch( listitem )
  4475. {
  4476. case 0:
  4477. {
  4478. ShowPlayerDialogEx(playerid, MDC_CIVILIANS, DIALOG_STYLE_LIST, "MDC - Logged in | Civilian Options", "*Check Record\n*View Arrest Reports\n*Licenses\n*Warrants\n*Issue Warrant\n*BOLO\n*Create BOLO\n*Delete", "OK", "Cancel");
  4479. }
  4480. case 1: ShowPlayerDialogEx(playerid, MDC_SUSPECT, DIALOG_STYLE_INPUT, "MDC - Register Suspect", "Please enter (a part of) the name of the suspect to register them.", "OK", "Cancel");
  4481. case 2: ShowPlayerDialogEx(playerid, G_LOCKER_CLEARSUSPECT, DIALOG_STYLE_INPUT, arrGroupData[PlayerInfo[playerid][pMember]][g_szGroupName]," Who would you like to clear?","Clear","Return");
  4482. case 3: ShowPlayerDialogEx(playerid, MDC_VEHICLE, DIALOG_STYLE_INPUT, "MDC - Vehicle Registrations", "Please enter (a part of) the name of the person to check their active vehicle registrations.", "OK", "Cancel");
  4483. case 4:
  4484. {
  4485. ShowPlayerDialogEx(playerid, MDC_FIND, DIALOG_STYLE_INPUT, "MDC - Logged in | LEO GPS Location", "Enter the Law Enforcment Official's Name or ID No.", "Enter", "Cancel");
  4486. }
  4487. case 5:
  4488. {
  4489. new groups[1024], item;
  4490. for (new i; i < MAX_GROUPS; i++)
  4491. {
  4492. if (arrGroupData[i][g_szGroupName][0] && arrGroupData[i][g_iGroupType] == GROUP_TYPE_LEA && arrGroupData[i][g_iAllegiance] == arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance])
  4493. {
  4494. format(groups, sizeof(groups), "%s*%s\n", groups, arrGroupData[i][g_szGroupName]);
  4495. ListItemTrackId[playerid][item++] = i;
  4496. }
  4497. ShowPlayerDialogEx(playerid, MDC_MEMBERS, DIALOG_STYLE_LIST, "MDC - Logged in | Agency List", groups, "OK", "Cancel");
  4498. }
  4499. }
  4500. case 6: ShowPlayerDialogEx(playerid, MDC_MESSAGE, DIALOG_STYLE_INPUT, "MDC - Logged In | MDC Message", "Enter recipient's Name or ID No.", "OK", "Cancel");
  4501. case 7: ShowPlayerDialogEx(playerid, MDC_SMS, DIALOG_STYLE_INPUT, "MDC - Logged In | SMS", "Enter recipient's phone number.", "OK", "Cancel");
  4502. }
  4503. }
  4504. if(dialogid == MDC_SUSPECT) return cmd_su(playerid, inputtext);
  4505. if(dialogid == MDC_VEHICLE) return cmd_vmdc(playerid, inputtext);
  4506. if(dialogid == MDC_VLOOKUP) return cmd_vlookup(playerid, inputtext);
  4507. if(dialogid == MDC_FIND && response)
  4508. {
  4509. new giveplayerid;
  4510. if(!IsMDCPermitted(playerid)) return SendClientMessageEx(playerid, COLOR_LIGHTBLUE, " Login Failed. You are not permitted to use the MDC!");
  4511. if(sscanf(inputtext, "u", giveplayerid))
  4512. {
  4513. ShowPlayerDialogEx(playerid, MDC_FIND, DIALOG_STYLE_INPUT, "MDC - Logged in | LEO GPS Location", "Enter the Law Enforcment Official's Name or ID No.", "Enter", "Cancel");
  4514. return 1;
  4515. }
  4516. if(IsPlayerConnected(giveplayerid))
  4517. {
  4518. if(giveplayerid != INVALID_PLAYER_ID)
  4519. {
  4520. if(giveplayerid == playerid)
  4521. {
  4522. ShowPlayerDialogEx(playerid, MDC_FIND, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: You cannot find yourself.\nEnter the Law Enforcment Official's Name or ID No.", "Enter", "Cancel");
  4523. return 1;
  4524. }
  4525. if(IsACop(giveplayerid) && arrGroupData[PlayerInfo[giveplayerid][pMember]][g_iAllegiance] == arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance])
  4526. {
  4527. SetPlayerMarkerForPlayer(playerid,giveplayerid,FIND_COLOR);
  4528. FindingPlayer[playerid] = giveplayerid;
  4529. FindTime[playerid] = 1;
  4530. FindTimePoints[playerid] = 30;
  4531. }
  4532. else
  4533. {
  4534. SendClientMessageEx(playerid, COLOR_GRAD2, " You can only track other cops!");
  4535. }
  4536. }
  4537. }
  4538. }
  4539. if(dialogid == MDC_CIVILIANS && response)
  4540. { //"*Check Record\n*View Arrest Reports\n*Licenses\n*Warrants\n*Issue Warrant\n*BOLO\n*Create BOLO\n*Delete"
  4541. new WarrantString[512];
  4542. if(!IsMDCPermitted(playerid)) return SendClientMessageEx(playerid, COLOR_LIGHTBLUE, " Login Failed. You are not permitted to use the MDC!");
  4543. if(News[hTaken6] == 1)
  4544. {
  4545. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd6], News[hContact6]);
  4546. strcat(WarrantString, string, sizeof(WarrantString));
  4547. }
  4548. if(News[hTaken7] == 1)
  4549. {
  4550. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd7], News[hContact7]);
  4551. strcat(WarrantString, string, sizeof(WarrantString));
  4552. }
  4553. if(News[hTaken8] == 1)
  4554. {
  4555. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd8], News[hContact8]);
  4556. strcat(WarrantString, string, sizeof(WarrantString));
  4557. }
  4558. if(News[hTaken9] == 1)
  4559. {
  4560. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd9], News[hContact9]);
  4561. strcat(WarrantString, string, sizeof(WarrantString));
  4562. }
  4563. if(News[hTaken10] == 1)
  4564. {
  4565. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd10], News[hContact10]);
  4566. strcat(WarrantString, string, sizeof(WarrantString));
  4567. }
  4568. if(News[hTaken11] == 1)
  4569. {
  4570. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd11], News[hContact11]);
  4571. strcat(WarrantString, string, sizeof(WarrantString));
  4572. }
  4573. if(News[hTaken12] == 1)
  4574. {
  4575. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd12], News[hContact12]);
  4576. strcat(WarrantString, string, sizeof(WarrantString));
  4577. }
  4578. if(News[hTaken13] == 1)
  4579. {
  4580. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd13], News[hContact13]);
  4581. strcat(WarrantString, string, sizeof(WarrantString));
  4582. }
  4583. if(strlen(WarrantString) == 0)
  4584. {
  4585. strcat(WarrantString, "No Warrants at this time.", sizeof(WarrantString));
  4586. }
  4587. switch(listitem)
  4588. {
  4589. case 0: ShowPlayerDialogEx(playerid, MDC_CHECK, DIALOG_STYLE_INPUT, "MDC - Logged in | Records Check", "Enter the Person's Name or ID No.", "Enter", "Cancel");
  4590. case 1: ShowPlayerDialogEx(playerid, MDC_REPORTS, DIALOG_STYLE_INPUT, "MDC - Logged in | Reports Check", "Enter the Person's Name or ID No.", "Enter", "Cancel");
  4591. case 2: ShowPlayerDialogEx(playerid, MDC_LICENSES, DIALOG_STYLE_INPUT, "MDC - Logged in | License Check", "Enter the Person's Name or ID No.", "Enter", "Cancel");
  4592. case 3: ShowPlayerDialogEx(playerid, MDC_WARRANTS, DIALOG_STYLE_LIST, "MDC - Logged in | Warrant List", WarrantString, "Enter", "Cancel");
  4593. case 4: ShowPlayerDialogEx(playerid, MDC_ISSUE_SLOT, DIALOG_STYLE_LIST, "MDC - Logged in | Which Slot would you like to use?", "1\n2\n3\n4\n5\n6\n7\n8", "Enter", "Cancel");
  4594. case 5:
  4595. {
  4596. new BOLOString[512];
  4597. if(News[hTaken14] == 1)
  4598. {
  4599. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd14], News[hContact14]);
  4600. strcat(BOLOString, string, sizeof(BOLOString));
  4601. }
  4602. if(News[hTaken15] == 1)
  4603. {
  4604. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd15], News[hContact15]);
  4605. strcat(BOLOString, string, sizeof(BOLOString));
  4606. }
  4607. if(News[hTaken16] == 1)
  4608. {
  4609. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd16], News[hContact16]);
  4610. strcat(BOLOString, string, sizeof(BOLOString));
  4611. }
  4612. if(News[hTaken17] == 1)
  4613. {
  4614. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd17], News[hContact17]);
  4615. strcat(BOLOString, string, sizeof(BOLOString));
  4616. }
  4617. if(News[hTaken18] == 1)
  4618. {
  4619. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd18], News[hContact18]);
  4620. strcat(BOLOString, string, sizeof(BOLOString));
  4621. }
  4622. if(News[hTaken19] == 1)
  4623. {
  4624. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd19], News[hContact19]);
  4625. strcat(BOLOString, string, sizeof(BOLOString));
  4626. }
  4627. if(News[hTaken20] == 1)
  4628. {
  4629. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd20], News[hContact20]);
  4630. strcat(BOLOString, string, sizeof(BOLOString));
  4631. }
  4632. if(News[hTaken21] == 1)
  4633. {
  4634. format(string, sizeof(string), "%s :: Officer: %s\n", News[hAdd21], News[hContact21]);
  4635. strcat(BOLOString, string, sizeof(BOLOString));
  4636. }
  4637. if(strlen(BOLOString) == 0)
  4638. {
  4639. strcat(BOLOString, "No BOLOs at this time.", sizeof(BOLOString));
  4640. }
  4641. ShowPlayerDialogEx(playerid, MDC_BOLOLIST, DIALOG_STYLE_LIST, "MDC - Logged In | BOLO List", BOLOString, "OK", "Cancel");
  4642. }
  4643. case 6:
  4644. {
  4645. ShowPlayerDialogEx(playerid, MDC_BOLO_SLOT, DIALOG_STYLE_LIST, "MDC - Logged in | Which Slot would you like to use?", "1\n2\n3\n4\n5\n6\n7\n8", "Enter", "Cancel");
  4646. }
  4647. case 7:
  4648. {
  4649. ShowPlayerDialogEx(playerid, MDC_DELETE, DIALOG_STYLE_LIST, "MDC - Logged In | Delete", "*BOLO\n*Warrant", "OK", "Cancel");
  4650. }
  4651. }
  4652. }
  4653. if(dialogid == MDC_MEMBERS && response)
  4654. {
  4655. if(!IsMDCPermitted(playerid)) return SendClientMessageEx(playerid, COLOR_LIGHTBLUE, " Login Failed. You are not permitted to use the MDC!");
  4656. new MemberString[1024], giveplayer[MAX_PLAYER_NAME], badge[11];
  4657. new rank[GROUP_MAX_RANK_LEN], division[GROUP_MAX_DIV_LEN], employer[GROUP_MAX_NAME_LEN];
  4658. new group = ListItemTrackId[playerid][listitem];
  4659. foreach(new i: Player)
  4660. {
  4661. if(PlayerInfo[i][pMember] == group)
  4662. {
  4663. if(strcmp(PlayerInfo[i][pBadge], "None", true) != 0) format(badge, sizeof(badge), "[%s] ", PlayerInfo[i][pBadge]);
  4664. GetPlayerGroupInfo(i, rank, division, employer);
  4665. giveplayer = GetPlayerNameEx(i);
  4666. format(string, sizeof(string), "* %s%s (%s) %s Ph: %d\n", badge, rank, division, giveplayer, PlayerInfo[i][pPnumber]);
  4667. strcat(MemberString, string, sizeof(MemberString));
  4668. }
  4669. }
  4670. if(strlen(MemberString) == 0)
  4671. {
  4672. strcat(MemberString, "No Members online at this time.", sizeof(MemberString));
  4673. }
  4674. format(string, sizeof(string), "MDC - Logged in | %s Members", arrGroupData[group][g_szGroupName]);
  4675. ShowPlayerDialogEx(playerid, DIALOG_NOTHING, DIALOG_STYLE_LIST, string, MemberString, "Select", "Cancel");
  4676. }
  4677. if(dialogid == MDC_WARRANTS && response)
  4678. {
  4679. if(!IsMDCPermitted(playerid)) return SendClientMessageEx(playerid, COLOR_LIGHTBLUE, " Login Failed. You are not permitted to use the MDC!");
  4680. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Warrants", inputtext, "OK", "Back");
  4681. }
  4682. if(dialogid == MDC_BOLOLIST && response)
  4683. {
  4684. if(!IsMDCPermitted(playerid)) return SendClientMessageEx(playerid, COLOR_LIGHTBLUE, " Login Failed. You are not permitted to use the MDC!");
  4685. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | BOLO Hot Sheet", inputtext, "OK", "Back");
  4686. }
  4687. /* if(dialogid == MDC_CHECK && response)
  4688. {
  4689. if(!IsMDCPermitted(playerid)) return SendClientMessageEx(playerid, COLOR_LIGHTBLUE, " Login Failed. You are not permitted to use the MDC!");
  4690. new giveplayerid = ReturnUser(inputtext);
  4691. new HistoryString[1024];
  4692. new giveplayer[MAX_PLAYER_NAME];
  4693. giveplayer = GetPlayerNameEx(giveplayerid);
  4694. if(giveplayerid != INVALID_PLAYER_ID)
  4695. {
  4696. format(string, sizeof(string), "Name : %s\n", GetPlayerNameEx(giveplayerid));
  4697. strcat(HistoryString, string, sizeof(HistoryString));
  4698. format(string, sizeof(string), "Crime : %s\n", PlayerCrime[giveplayerid][pAccusedof]);
  4699. strcat(HistoryString, string, sizeof(HistoryString));
  4700. format(string, sizeof(string), "Claimant : %s\n", PlayerCrime[giveplayerid][pVictim]);
  4701. strcat(HistoryString, string, sizeof(HistoryString));
  4702. format(string, sizeof(string), "Reported : %s\n", PlayerCrime[giveplayerid][pAccusing]);
  4703. strcat(HistoryString, string, sizeof(HistoryString));
  4704. format(string, sizeof(string), "Accused : %s\n", PlayerCrime[giveplayerid][pBplayer]);
  4705. strcat(HistoryString, string, sizeof(HistoryString));
  4706. if(PlayerInfo[giveplayerid][pProbationTime] != 0)
  4707. {
  4708. format(string, sizeof(string), "Probation : %d minutes left\n", PlayerInfo[giveplayerid][pProbationTime]);
  4709. strcat(HistoryString, string, sizeof(HistoryString));
  4710. }
  4711. for(new i=0; i<MAX_PLAYERVEHICLES; i++)
  4712. {
  4713. if(PlayerVehicleInfo[giveplayerid][i][pvTicket] != 0)
  4714. {
  4715. format(string, sizeof(string), "Vehicle registration: %d | Vehicle Name: %s | Ticket: $%d.\n",PlayerVehicleInfo[giveplayerid][i][pvId],GetVehicleName(PlayerVehicleInfo[giveplayerid][i][pvId]),PlayerVehicleInfo[giveplayerid][i][pvTicket]);
  4716. strcat(HistoryString, string, sizeof(HistoryString));
  4717. }
  4718. }
  4719. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_LIST, "MDC - Logged in | Criminal History", HistoryString, "OK", "Cancel");
  4720. format(string, sizeof(string), "** DISPATCH: %s has run a check for warrants on %s **", GetPlayerNameEx(playerid), giveplayer);
  4721. SendRadioMessage(1, COLOR_DBLUE, string);
  4722. SendRadioMessage(2, COLOR_DBLUE, string);
  4723. SendRadioMessage(3, COLOR_DBLUE, string);
  4724. return 1;
  4725. }
  4726. else
  4727. {
  4728. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | ERROR ", "There is no record of that person.", "OK", "Cancel");
  4729. return 1;
  4730. }
  4731. }*/
  4732. if(dialogid == MDC_REPORTS && response)
  4733. {
  4734. if(!IsMDCPermitted(playerid)) return SendClientMessageEx(playerid, COLOR_LIGHTBLUE, " Login Failed. You are not permitted to use the MDC!");
  4735. new giveplayerid = ReturnUser(inputtext);
  4736. if(giveplayerid != INVALID_PLAYER_ID)
  4737. {
  4738. DisplayReports(playerid, giveplayerid);
  4739. format(string, sizeof(string), "* %s has run a check for arrest reports on %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  4740. foreach(new i: Player)
  4741. {
  4742. if(PlayerInfo[playerid][pToggledChats][12] == 0)
  4743. {
  4744. if(PlayerInfo[i][pMember] == PlayerInfo[playerid][pMember] && PlayerInfo[playerid][pRank] >= arrGroupData[PlayerInfo[i][pMember]][g_iRadioAccess]) {
  4745. ChatTrafficProcess(i, arrGroupData[PlayerInfo[i][pMember]][g_hRadioColour] * 256 + 255, string, 12);
  4746. }
  4747. }
  4748. }
  4749. //SendGroupMessage(GROUP_TYPE_LEA, COLOR_DBLUE, string);
  4750. return 1;
  4751. }
  4752. else
  4753. {
  4754. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | ERROR ", "There is no record of that person.", "OK", "Cancel");
  4755. return 1;
  4756. }
  4757. }
  4758. if(dialogid == MDC_SHOWREPORTS && response)
  4759. {
  4760. new stpos = strfind(inputtext, "(");
  4761. new fpos = strfind(inputtext, ")");
  4762. new reportidstr[6], repid;
  4763. strmid(reportidstr, inputtext, stpos+1, fpos);
  4764. repid = strval(reportidstr);
  4765. return DisplayReport(playerid, repid);
  4766. }
  4767. if(dialogid == DIALOG_JFINECONFIRM)
  4768. {
  4769. if(response)
  4770. {
  4771. SetPVarInt(playerid, "jGroup", listitem);
  4772. format(string, sizeof(string), "Are you sure you want to send a portion of the fine to %s?", arrGroupData[listitem][g_szGroupName]);
  4773. ShowPlayerDialogEx(playerid, DIALOG_JFINE, DIALOG_STYLE_MSGBOX, "Judge Fine - Confirm", string, "Confirm", "Cancel");
  4774. }
  4775. else {
  4776. DeletePVar(playerid, "jGroup");
  4777. DeletePVar(playerid, "jfined");
  4778. DeletePVar(playerid, "judgefine");
  4779. DeletePVar(playerid, "jreason");
  4780. SendClientMessageEx(playerid, COLOR_GRAD2, "Fine Cancelled - retype the judge fine command to start again.");
  4781. }
  4782. }
  4783. if(dialogid == DIALOG_JFINE)
  4784. {
  4785. if(response)
  4786. {
  4787. new iGroupID = GetPVarInt(playerid, "jGroup");
  4788. new giveplayerid = GetPVarInt(playerid, "jfined");
  4789. new judgefine = GetPVarInt(playerid, "judgefine");
  4790. new reason[64];
  4791. GetPVarString(playerid, "jreason", reason, 64);
  4792. new Judicial, Group, Gov;
  4793. GivePlayerCash(giveplayerid, -judgefine);
  4794. Judicial = floatround( judgefine * 0.10 ); // Judicials cut - 10%
  4795. Group = floatround ( judgefine * 0.6); // Arresting Groups Cut - 60%
  4796. Gov = floatround ( judgefine * 0.10); // Government cut = 10%
  4797. // 20% Deleted from economy
  4798. Tax += Gov;
  4799. arrGroupData[PlayerInfo[playerid][pMember]][g_iBudget] += Judicial;
  4800. arrGroupData[iGroupID][g_iBudget] += Group;
  4801. new str[128];
  4802. format(str, sizeof(str), "%s has been fined by $%s by Judge %s. $%s has been sent to the %s Vault.",GetPlayerNameEx(giveplayerid), number_format(judgefine), GetPlayerNameEx(playerid), number_format(Judicial), arrGroupData[PlayerInfo[playerid][pMember]][g_szGroupName]);
  4803. GroupPayLog(PlayerInfo[playerid][pMember], str);
  4804. format(str, sizeof(str), "%s has been fined by $%s by Judge %s. $%s has been sent to the %s Vault.",GetPlayerNameEx(giveplayerid), number_format(judgefine), GetPlayerNameEx(playerid), number_format(Group), arrGroupData[iGroupID][g_szGroupName]);
  4805. GroupPayLog(iGroupID, str);
  4806. for(new z; z < MAX_GROUPS; z++)
  4807. {
  4808. if(arrGroupData[z][g_iAllegiance] == 1)
  4809. {
  4810. if(arrGroupData[z][g_iGroupType] == GROUP_TYPE_GOV)
  4811. {
  4812. format(str, sizeof(str), "%s has been fined by $%s by Judge %s. $%s has been sent to the SA Government Vault.",GetPlayerNameEx(giveplayerid), number_format(judgefine), GetPlayerNameEx(playerid), number_format(Gov));
  4813. GroupPayLog(z, str);
  4814. break;
  4815. }
  4816. }
  4817. }
  4818. format(string, sizeof(string), "You have fined %s $%s, reason: %s", GetPlayerNameEx(giveplayerid), number_format(judgefine), reason);
  4819. SendClientMessageEx(playerid, COLOR_WHITE, string);
  4820. format(string, sizeof(string), "You have been fined $%s by %s, reason: %s", number_format(judgefine), GetPlayerNameEx(playerid), reason);
  4821. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  4822. format(string, sizeof(string), "%s has been fined $%s by Judge %s. Commission has been sent to %s.", GetPlayerNameEx(giveplayerid), number_format(judgefine), GetPlayerNameEx(playerid), arrGroupData[iGroupID][g_szGroupName]);
  4823. ABroadCast( COLOR_YELLOW, string, 2);
  4824. format(string, sizeof(string), "%s(%d) has been fined $%s by Judge %s(%d). Commission has been sent to %s.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), number_format(judgefine), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), arrGroupData[iGroupID][g_szGroupName]);
  4825. Log("logs/rpspecial.log", string);
  4826. }
  4827. }
  4828. if(dialogid == DIALOG_ARRESTREPORT)
  4829. {
  4830. if(response)
  4831. {
  4832. new moneys = GetPVarInt(playerid, "Arrest_Price"), time = GetPVarInt(playerid, "Arrest_Time"),
  4833. bail = GetPVarInt(playerid, "Arrest_Bail"), bailprice = 15000000, // STATIC BAIL. GetPVarInt(playerid, "Arrest_BailPrice"),
  4834. suspect = GetPVarInt(playerid, "Arrest_Suspect"), arresttype = GetPVarInt(playerid, "Arrest_Type");
  4835. if(strlen(inputtext) < 30 || strlen(inputtext) > 128)
  4836. {
  4837. format(szMiscArray, sizeof(szMiscArray), "Please write a brief arrest report on how %s acted during the arrest.\n\nThis report must be at least 30 characters and no more than 128.", GetPlayerNameEx(suspect));
  4838. return ShowPlayerDialogEx(playerid, DIALOG_ARRESTREPORT, DIALOG_STYLE_INPUT, "Arrest Report", szMiscArray, "Submit", "");
  4839. }
  4840. switch(arresttype)
  4841. {
  4842. case 0, 1: { //arrest
  4843. if(bail && bailprice > 0)
  4844. {
  4845. format(string, sizeof(string), "You have been given the option to post bail. Your bail is set at $%s. (/bail)", number_format(bailprice));
  4846. SendClientMessageEx(suspect, COLOR_RED, string);
  4847. PlayerInfo[suspect][pBailPrice] = bailprice;
  4848. }
  4849. format(string, sizeof(string), "* You have sent %s to the Local PD Jail.", GetPlayerNameEx(suspect));
  4850. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  4851. GivePlayerCash(suspect, -moneys);
  4852. new money = floatround(moneys / 3), iGroupID = PlayerInfo[playerid][pMember];
  4853. arrGroupData[iGroupID][g_iBudget] += money;
  4854. new str[164];
  4855. format(str, sizeof(str), "%s has been arrested by %s for %d minutes and fined $%d. $%d has been sent to %s's budget fund.",GetPlayerNameEx(suspect), GetPlayerNameEx(playerid),time, moneys, money, arrGroupData[iGroupID][g_szGroupName]);
  4856. GroupPayLog(iGroupID, str);
  4857. for(new z; z < MAX_GROUPS; z++)
  4858. {
  4859. if(arrGroupData[iGroupID][g_iAllegiance] == 1)
  4860. {
  4861. if(arrGroupData[z][g_iAllegiance] == 1)
  4862. {
  4863. if(arrGroupData[z][g_iGroupType] == GROUP_TYPE_GOV)
  4864. {
  4865. Tax += money;
  4866. format(str, sizeof(str), "%s has been arrested by %s and fined $%d. $%d has been sent to the SA Government Vault.",GetPlayerNameEx(suspect), GetPlayerNameEx(playerid), moneys, money);
  4867. GroupPayLog(z, str);
  4868. break;
  4869. }
  4870. }
  4871. }
  4872. else if(arrGroupData[z][g_iAllegiance] == 2)
  4873. {
  4874. if(arrGroupData[z][g_iAllegiance] == 2)
  4875. {
  4876. if(arrGroupData[z][g_iGroupType] == GROUP_TYPE_GOV)
  4877. {
  4878. TRTax += money;
  4879. format(str, sizeof(str), "%s has been arrested by %s and fined $%d. $%d has been sent to the NE Government Vault.",GetPlayerNameEx(suspect), GetPlayerNameEx(playerid), moneys, money);
  4880. GroupPayLog(z, str);
  4881. break;
  4882. }
  4883. }
  4884. }
  4885. }
  4886. ResetPlayerWeaponsEx(suspect);
  4887. SetPlayerInterior(suspect, ArrestPoints[GetArrestPointID(playerid)][jailInt]);
  4888. //new rand = random(sizeof(LSPDJailSpawns));
  4889. //SetPlayerFacingAngle(suspect, LSPDJailSpawns[rand][3]);
  4890. //SetPlayerPos(suspect, LSPDJailSpawns[rand][0], LSPDJailSpawns[rand][1], LSPDJailSpawns[rand][2]);
  4891. switch(random(2)) {
  4892. case 0: {
  4893. SetPlayerPos(suspect, ArrestPoints[GetArrestPointID(playerid)][JailPos1][0], ArrestPoints[GetArrestPointID(playerid)][JailPos1][1], ArrestPoints[GetArrestPointID(playerid)][JailPos1][2]);
  4894. Player_StreamPrep(suspect, ArrestPoints[GetArrestPointID(playerid)][JailPos1][0], ArrestPoints[GetArrestPointID(playerid)][JailPos1][1], ArrestPoints[GetArrestPointID(playerid)][JailPos1][2], FREEZE_TIME);
  4895. }
  4896. case 1: {
  4897. SetPlayerPos(suspect, ArrestPoints[GetArrestPointID(playerid)][JailPos2][0], ArrestPoints[GetArrestPointID(playerid)][JailPos2][1], ArrestPoints[GetArrestPointID(playerid)][JailPos2][2]);
  4898. Player_StreamPrep(suspect, ArrestPoints[GetArrestPointID(playerid)][JailPos2][0], ArrestPoints[GetArrestPointID(playerid)][JailPos2][1], ArrestPoints[GetArrestPointID(playerid)][JailPos2][2], FREEZE_TIME);
  4899. }
  4900. }
  4901. SetPVarInt(suspect, "ArrestPoint", (GetArrestPointID(playerid) + 1));
  4902. if(PlayerInfo[suspect][pDonateRank] >= 2)
  4903. {
  4904. PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
  4905. }
  4906. else
  4907. {
  4908. PlayerInfo[suspect][pJailTime] = time * 60;
  4909. }
  4910. if(PlayerInfo[suspect][pJailTime] > 7200) PlayerInfo[suspect][pJailTime] = 7200;
  4911. DeletePVar(suspect, "IsFrozen");
  4912. PhoneOnline[suspect] = 1;
  4913. PlayerInfo[suspect][pArrested] += 1;
  4914. SetPlayerFree(suspect,playerid, "was arrested");
  4915. PlayerInfo[suspect][pWantedLevel] = 0;
  4916. SetPlayerToTeamColor(suspect);
  4917. SetPlayerWantedLevel(suspect, 0);
  4918. WantLawyer[suspect] = 1;
  4919. TogglePlayerControllable(suspect, 1);
  4920. ClearAnimationsEx(suspect);
  4921. SetPlayerSpecialAction(suspect, SPECIAL_ACTION_NONE);
  4922. PlayerCuffed[suspect] = 0;
  4923. DeletePVar(suspect, "PlayerCuffed");
  4924. PlayerCuffedTime[suspect] = 0;
  4925. SetPlayerInterior(suspect, ArrestPoints[GetArrestPointID(playerid)][jailInt]);
  4926. PlayerInfo[suspect][pInt] = ArrestPoints[GetArrestPointID(playerid)][jailVW];
  4927. PlayerInfo[suspect][pVW] = ArrestPoints[GetArrestPointID(playerid)][jailVW];
  4928. SetPlayerVirtualWorld(suspect, ArrestPoints[GetArrestPointID(playerid)][jailVW]);
  4929. strcpy(PlayerInfo[suspect][pPrisonedBy], GetPlayerNameEx(playerid), MAX_PLAYER_NAME);
  4930. strcpy(PlayerInfo[suspect][pPrisonReason], "[IC] EBCF", 128);
  4931. SetPlayerToTeamColor(suspect);
  4932. SetHealth(suspect, 100);
  4933. }
  4934. case 2: { // /docarrest
  4935. format(string, sizeof(string), "* You have sent %s to DoC.", GetPlayerNameEx(suspect));
  4936. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  4937. GivePlayerCash(suspect, -moneys);
  4938. new money = floatround(moneys / 3), iGroupID = PlayerInfo[playerid][pMember];
  4939. arrGroupData[iGroupID][g_iBudget] += money;
  4940. new str[164];
  4941. format(str, sizeof(str), "%s has been arrested by %s for %d minutes and fined $%d. $%d has been sent to %s's budget fund.",GetPlayerNameEx(suspect), GetPlayerNameEx(playerid),time, moneys, money, arrGroupData[iGroupID][g_szGroupName]);
  4942. GroupPayLog(iGroupID, str);
  4943. for(new z; z < MAX_GROUPS; z++)
  4944. {
  4945. if(arrGroupData[iGroupID][g_iAllegiance] == 1)
  4946. {
  4947. if(arrGroupData[z][g_iAllegiance] == 1)
  4948. {
  4949. if(arrGroupData[z][g_iGroupType] == GROUP_TYPE_GOV)
  4950. {
  4951. Tax += money;
  4952. format(str, sizeof(str), "%s has been arrested by %s and fined $%d. $%d has been sent to the SA Government Vault.",GetPlayerNameEx(suspect), GetPlayerNameEx(playerid), moneys, money);
  4953. GroupPayLog(z, str);
  4954. break;
  4955. }
  4956. }
  4957. }
  4958. else if(arrGroupData[z][g_iAllegiance] == 2)
  4959. {
  4960. if(arrGroupData[z][g_iAllegiance] == 2)
  4961. {
  4962. if(arrGroupData[z][g_iGroupType] == GROUP_TYPE_GOV)
  4963. {
  4964. TRTax += money;
  4965. format(str, sizeof(str), "%s has been arrested by %s and fined $%d. $%d has been sent to the NE Government Vault.",GetPlayerNameEx(suspect), GetPlayerNameEx(playerid), moneys, money);
  4966. GroupPayLog(z, str);
  4967. break;
  4968. }
  4969. }
  4970. }
  4971. }
  4972. ResetPlayerWeaponsEx(suspect);
  4973. SetPlayerInterior(suspect, 1);
  4974. PlayerInfo[suspect][pInt] = 1;
  4975. SetPlayerFacingAngle(suspect, 0);
  4976. if(PlayerInfo[suspect][pDonateRank] >= 2)
  4977. {
  4978. PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
  4979. }
  4980. else
  4981. {
  4982. PlayerInfo[suspect][pJailTime] = time * 60;
  4983. }
  4984. if(PlayerInfo[suspect][pJailTime] > 7200) PlayerInfo[suspect][pJailTime] = 7200;
  4985. DeletePVar(suspect, "IsFrozen");
  4986. PhoneOnline[suspect] = 1;
  4987. PlayerInfo[suspect][pArrested] += 1;
  4988. SetPlayerFree(suspect,playerid, "was arrested");
  4989. PlayerInfo[suspect][pWantedLevel] = 0;
  4990. SetPlayerToTeamColor(suspect);
  4991. SetPlayerWantedLevel(suspect, 0);
  4992. WantLawyer[suspect] = 1;
  4993. TogglePlayerControllable(suspect, 1);
  4994. ClearAnimationsEx(suspect);
  4995. SetPlayerSpecialAction(suspect, SPECIAL_ACTION_NONE);
  4996. PlayerCuffed[suspect] = 0;
  4997. DeletePVar(suspect, "PlayerCuffed");
  4998. PlayerCuffedTime[suspect] = 0;
  4999. PlayerInfo[suspect][pVW] = 0;
  5000. SetPlayerVirtualWorld(suspect, 0);
  5001. SetHealth(suspect, 100);
  5002. strcpy(PlayerInfo[suspect][pPrisonedBy], GetPlayerNameEx(playerid), MAX_PLAYER_NAME);
  5003. strcpy(PlayerInfo[suspect][pPrisonReason], "[IC] DMCF Arrest", 128);
  5004. SetPlayerToTeamColor(suspect);
  5005. SetHealth(suspect, 100);
  5006. new randcell = random(29);
  5007. PlayerInfo[suspect][pPrisonCell] = randcell;
  5008. SpawnPlayerInPrisonCell(suspect, randcell);
  5009. }
  5010. case 3: // doc judge arrest
  5011. {
  5012. format(string, sizeof(string), "* You have sentenced %s at the DoC courthouse.", GetPlayerNameEx(suspect));
  5013. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  5014. GivePlayerCash(suspect, -moneys);
  5015. new money = floatround(moneys / 3), iGroupID = PlayerInfo[playerid][pMember];
  5016. arrGroupData[iGroupID][g_iBudget] += money;
  5017. new str[164];
  5018. format(str, sizeof(str), "%s has been arrested by %s for %d minutes and fined $%d. $%d has been sent to %s's budget fund.",GetPlayerNameEx(suspect), GetPlayerNameEx(playerid),time, moneys, money, arrGroupData[iGroupID][g_szGroupName]);
  5019. GroupPayLog(iGroupID, str);
  5020. for(new z; z < MAX_GROUPS; z++)
  5021. {
  5022. if(arrGroupData[iGroupID][g_iAllegiance] == 1)
  5023. {
  5024. if(arrGroupData[z][g_iAllegiance] == 1)
  5025. {
  5026. if(arrGroupData[z][g_iGroupType] == GROUP_TYPE_GOV)
  5027. {
  5028. Tax += money;
  5029. format(str, sizeof(str), "%s has been arrested by %s and fined $%d. $%d has been sent to the SA Government Vault.",GetPlayerNameEx(suspect), GetPlayerNameEx(playerid), moneys, money);
  5030. GroupPayLog(z, str);
  5031. break;
  5032. }
  5033. }
  5034. }
  5035. else if(arrGroupData[z][g_iAllegiance] == 2)
  5036. {
  5037. if(arrGroupData[z][g_iAllegiance] == 2)
  5038. {
  5039. if(arrGroupData[z][g_iGroupType] == GROUP_TYPE_GOV)
  5040. {
  5041. TRTax += money;
  5042. format(str, sizeof(str), "%s has been arrested by %s and fined $%d. $%d has been sent to the NE Government Vault.",GetPlayerNameEx(suspect), GetPlayerNameEx(playerid), moneys, money);
  5043. GroupPayLog(z, str);
  5044. break;
  5045. }
  5046. }
  5047. }
  5048. }
  5049. if(PlayerInfo[suspect][pDonateRank] >= 2)
  5050. {
  5051. PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
  5052. }
  5053. else
  5054. {
  5055. PlayerInfo[suspect][pJailTime] = time * 60;
  5056. }
  5057. PhoneOnline[suspect] = 1;
  5058. PlayerInfo[suspect][pArrested] += 1;
  5059. SetPlayerFree(suspect,playerid, "was arrested");
  5060. PlayerInfo[suspect][pWantedLevel] = 0;
  5061. SetPlayerToTeamColor(suspect);
  5062. SetPlayerWantedLevel(suspect, 0);
  5063. SetPVarInt(playerid, "pTut", 0);
  5064. strcpy(PlayerInfo[suspect][pPrisonedBy], GetPlayerNameEx(playerid), MAX_PLAYER_NAME);
  5065. strcpy(PlayerInfo[suspect][pPrisonReason], "[IC][JUDGE] EBCF Arrest", 128);
  5066. SetPlayerToTeamColor(suspect);
  5067. }
  5068. }
  5069. new iAllegiance;
  5070. if((0 <= PlayerInfo[playerid][pMember] < MAX_GROUPS))
  5071. {
  5072. iAllegiance = arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance];
  5073. }
  5074. else iAllegiance = 1;
  5075. mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "INSERT INTO `arrestreports` (`copid`, `suspectid`, `shortreport`, `origin`) VALUES ('%d', '%d', '%e', '%d')", GetPlayerSQLId(playerid), GetPlayerSQLId(suspect), inputtext, iAllegiance);
  5076. mysql_tquery(MainPipeline, szMiscArray, "OnQueryFinish", "i", SENDDATA_THREAD);
  5077. format(szMiscArray, sizeof(szMiscArray), "You have arrested %s for %d minutes with a fine of $%s", GetPlayerNameEx(suspect), time, number_format(moneys));
  5078. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMiscArray);
  5079. PlayerInfo[suspect][pWantedJailFine] = 0;
  5080. PlayerInfo[suspect][pWantedJailTime] = 0;
  5081. Prison_SetPlayerSkin(suspect);
  5082. for(new x;x<MAX_PLAYERTOYS;x++) {
  5083. if(IsPlayerAttachedObjectSlotUsed(suspect, x))
  5084. {
  5085. if(x == 9 && PlayerInfo[suspect][pBEquipped])
  5086. break;
  5087. RemovePlayerAttachedObject(suspect, x);
  5088. }
  5089. }
  5090. for(new i; i < 10; i++) {
  5091. PlayerHoldingObject[suspect][i] = 0;
  5092. }
  5093. DeletePVar(suspect, "jailcuffs");
  5094. DeletePVar(playerid, "Arrest_Price");
  5095. DeletePVar(playerid, "Arrest_Time");
  5096. DeletePVar(playerid, "Arrest_Bail");
  5097. DeletePVar(playerid, "Arrest_BailPrice");
  5098. DeletePVar(playerid, "Arrest_Suspect");
  5099. }
  5100. }
  5101. if(dialogid == MDC_CHECK && response)
  5102. {
  5103. if(!IsMDCPermitted(playerid)) return SendClientMessageEx(playerid, COLOR_LIGHTBLUE, " Login Failed. You are not permitted to use the MDC!");
  5104. new giveplayerid = ReturnUser(inputtext);
  5105. if(giveplayerid != INVALID_PLAYER_ID)
  5106. {
  5107. DisplayCrimes(playerid, giveplayerid);
  5108. format(string, sizeof(string), "* %s has run a check for warrants on %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  5109. foreach(new i: Player)
  5110. {
  5111. if(PlayerInfo[playerid][pToggledChats][12] == 0)
  5112. {
  5113. if(PlayerInfo[i][pMember] == PlayerInfo[playerid][pMember] && PlayerInfo[playerid][pRank] >= arrGroupData[PlayerInfo[i][pMember]][g_iRadioAccess]) {
  5114. ChatTrafficProcess(i, arrGroupData[PlayerInfo[i][pMember]][g_hRadioColour] * 256 + 255, string, 12);
  5115. }
  5116. }
  5117. }
  5118. //SendGroupMessage(GROUP_TYPE_LEA, COLOR_DBLUE, string);
  5119. return 1;
  5120. }
  5121. else
  5122. {
  5123. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | ERROR ", "There is no record of that person.", "OK", "Cancel");
  5124. return 1;
  5125. }
  5126. }
  5127. if(dialogid == MDC_LICENSES && response)
  5128. {
  5129. if(!IsMDCPermitted(playerid)) return SendClientMessageEx(playerid, COLOR_LIGHTBLUE, " Login Failed. You are not permitted to use the MDC!");
  5130. new giveplayerid;
  5131. if(sscanf(inputtext, "u", giveplayerid))
  5132. {
  5133. ShowPlayerDialogEx(playerid, MDC_LICENSES, DIALOG_STYLE_INPUT, "MDC - Logged in | License Check", "Enter the Person's Name or ID No.", "Enter", "Cancel");
  5134. return 1;
  5135. }
  5136. if(IsPlayerConnected(giveplayerid))
  5137. {
  5138. if(giveplayerid != INVALID_PLAYER_ID)
  5139. {
  5140. new LicenseString[256], giveplayer[MAX_PLAYER_NAME];
  5141. GetPlayerName(playerid, sendername, sizeof(sendername));
  5142. GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  5143. format(string, sizeof(string), " Name: %s\n", giveplayer);
  5144. strcat(LicenseString, string, sizeof(LicenseString));
  5145. format(string, sizeof(string), "-Drivers License: %s%s.\n", !PlayerInfo[giveplayerid][pCarLic] ? ("Not Passed"):("Expires: "), !PlayerInfo[giveplayerid][pCarLic] ? (""):date(PlayerInfo[giveplayerid][pCarLic], 1));
  5146. strcat(LicenseString, string, sizeof(LicenseString));
  5147. format(string, sizeof(string), "-Flying License: %s.\n", PlayerInfo[giveplayerid][pFlyLic] ? ("Passed"):("Not Passed"));
  5148. strcat(LicenseString, string, sizeof(LicenseString));
  5149. format(string, sizeof(string), "-Sailing License: %s.\n", PlayerInfo[giveplayerid][pBoatLic] ? ("Passed"):("Not Passed"));
  5150. strcat(LicenseString, string, sizeof(LicenseString));
  5151. format(string, sizeof(string), "-Weapon License: %s.\n", PlayerInfo[giveplayerid][pGunLic] ? ("Passed"):("Not Passed"));
  5152. strcat(LicenseString, string, sizeof(LicenseString));
  5153. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_LIST, "MDC - Logged in | Criminal History", LicenseString, "OK", "Cancel");
  5154. format(string, sizeof(string), "* %s has ran a license check on %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  5155. foreach(new i: Player)
  5156. {
  5157. if(PlayerInfo[playerid][pToggledChats][12] == 0)
  5158. {
  5159. if(PlayerInfo[i][pMember] == PlayerInfo[playerid][pMember] && PlayerInfo[playerid][pRank] >= arrGroupData[PlayerInfo[i][pMember]][g_iRadioAccess]) {
  5160. ChatTrafficProcess(i, arrGroupData[PlayerInfo[i][pMember]][g_hRadioColour] * 256 + 255, string, 12);
  5161. }
  5162. }
  5163. }
  5164. return 1;
  5165. }
  5166. else return ShowPlayerDialogEx(playerid, MDC_LICENSES, DIALOG_STYLE_INPUT, "MDC - Logged in | Error!", "ERROR: Invalid Name or ID No.\nEnter the Person's Name or ID No.", "Enter", "Cancel");
  5167. }
  5168. else return ShowPlayerDialogEx(playerid, MDC_LICENSES, DIALOG_STYLE_INPUT, "MDC - Logged in | Error!", "ERROR: Invalid Name or ID No.\nEnter the Person's Name or ID No.", "Enter", "Cancel");
  5169. }
  5170. if(dialogid == MDC_MESSAGE && response)
  5171. {
  5172. if(!IsMDCPermitted(playerid)) return SendClientMessageEx(playerid, COLOR_LIGHTBLUE, " Login Failed. You are not permitted to use the MDC!");
  5173. new giveplayerid;
  5174. if(sscanf(inputtext, "u", giveplayerid))
  5175. {
  5176. return ShowPlayerDialogEx(playerid, MDC_MESSAGE, DIALOG_STYLE_INPUT, "MDC - Logged In | Error!", "ERROR: Invalid Recipient\nEnter recipient's Name or ID No.", "OK", "Cancel");
  5177. }
  5178. if (IsPlayerConnected(giveplayerid))
  5179. {
  5180. if(giveplayerid != INVALID_PLAYER_ID)
  5181. {
  5182. format(string, sizeof(string), " Enter your message to %s ", GetPlayerNameEx(giveplayerid));
  5183. ShowPlayerDialogEx(playerid, MDC_MESSAGE_2, DIALOG_STYLE_INPUT, "MDC - Logged In | MDC Message", string, "OK", "Cancel");
  5184. SetPVarInt(playerid, "MDCMessageRecipient", giveplayerid);
  5185. }
  5186. else return ShowPlayerDialogEx(playerid, MDC_MESSAGE, DIALOG_STYLE_INPUT, "MDC - Logged In | Error!", "ERROR: Invalid Recipient\nEnter recipient's Name or ID No.", "OK", "Cancel");
  5187. }
  5188. else return ShowPlayerDialogEx(playerid, MDC_MESSAGE, DIALOG_STYLE_INPUT, "MDC - Logged In | Error!", "ERROR: Invalid Recipient\nEnter recipient's Name or ID No.", "OK", "Cancel");
  5189. }
  5190. if(dialogid == MDC_SMS && response)
  5191. {
  5192. if(isnull(inputtext) || strval(inputtext) == 0)
  5193. {
  5194. return ShowPlayerDialogEx(playerid, MDC_SMS, DIALOG_STYLE_INPUT, "MDC - Logged In | Error!", "ERROR: Invalid Phone Number\nEnter Recipient's Phone Number", "OK", "Cancel");
  5195. }
  5196. new phonenumb = strval(inputtext);
  5197. format(string, sizeof(string), " Enter your message to %d ", phonenumb);
  5198. ShowPlayerDialogEx(playerid, MDC_SMS_2, DIALOG_STYLE_INPUT, "MDC - Logged In | SMS Message", string, "OK", "Cancel");
  5199. SetPVarInt(playerid, "SMSMessageRecipient", phonenumb);
  5200. }
  5201. if(dialogid == MDC_MESSAGE_2 && response)
  5202. {
  5203. new giveplayerid = GetPVarInt(playerid, "MDCMessageRecipient");
  5204. if(giveplayerid == INVALID_PLAYER_ID) return ShowPlayerDialogEx(playerid, MDC_MESSAGE, DIALOG_STYLE_INPUT, "MDC - Logged In | Error!", "ERROR: Invalid Recipient\nEnter recipient's Name or ID No.", "OK", "Cancel");
  5205. if(giveplayerid == playerid)
  5206. {
  5207. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | ERROR ", "You cannot send messages to yourself!", "OK", "Cancel");
  5208. return 1;
  5209. }
  5210. if(ConnectedToPC[giveplayerid] == 1337 || IsPlayerInAnyVehicle(giveplayerid))
  5211. {
  5212. if(!IsMDCPermitted(giveplayerid))
  5213. {
  5214. return ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | ERROR ", "That person is not logged into the MDC.", "OK", "Cancel");
  5215. }
  5216. if(!strlen(inputtext))
  5217. {
  5218. return ShowPlayerDialogEx(playerid, MDC_MESSAGE_2, DIALOG_STYLE_INPUT, "MDC - Logged In | Error!", "ERROR: You must type a message!\nEnter Recipient's Name or ID No.", "OK", "Cancel");
  5219. }
  5220. format(string, sizeof(string), "MDC Message sent to %s:\n%s", GetPlayerNameEx(giveplayerid), inputtext);
  5221. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Message Sent! ", string, "OK", "Cancel");
  5222. if(ConnectedToPC[giveplayerid] == 1337)
  5223. {
  5224. format(string, sizeof(string), "MDC Message from %s:\n%s", GetPlayerNameEx(playerid), inputtext);
  5225. ShowPlayerDialogEx(giveplayerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | New Message!", string, "OK", "Cancel");
  5226. format(string, sizeof(string), "MDC Message from %s: %s", GetPlayerNameEx(playerid), inputtext);
  5227. SendClientMessageEx(giveplayerid, COLOR_YELLOW, string);
  5228. }
  5229. else
  5230. {
  5231. format(string, sizeof(string), "MDC Message from %s:\n%s", GetPlayerNameEx(playerid), inputtext);
  5232. ShowPlayerDialogEx(giveplayerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | New Message! ", string, "OK", "Cancel");
  5233. }
  5234. }
  5235. else
  5236. {
  5237. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | ERROR ", "That officer is not logged into the MDC.", "OK", "Cancel");
  5238. return 1;
  5239. }
  5240. return 1;
  5241. }
  5242. if(dialogid == MDC_SMS_2 && response)
  5243. {
  5244. new phonenumb = GetPVarInt(playerid, "SMSMessageRecipient");
  5245. if(!strlen(inputtext))
  5246. {
  5247. return ShowPlayerDialogEx(playerid, MDC_SMS_2, DIALOG_STYLE_INPUT, "MDC - Logged In | Error!", "ERROR: You must type a message!\nEnter Recipient's Phone Number", "OK", "Cancel");
  5248. }
  5249. if(phonenumb == 555)
  5250. {
  5251. if(strcmp("yes", inputtext, true) == 0) {
  5252. SendClientMessageEx(playerid, COLOR_WHITE, "Text Message Delivered.");
  5253. SendClientMessageEx(playerid, COLOR_YELLOW, "SMS: I have no idea what you're talking about, Sender: MOLE (555)");
  5254. //SendAudioToPlayer(playerid, 47, 100);
  5255. RingTone[playerid] = 20;
  5256. return 0;
  5257. }
  5258. else
  5259. {
  5260. SendClientMessageEx(playerid, COLOR_YELLOW, "SMS: A simple 'yes' will do, Sender: MOLE (555)");
  5261. //SendAudioToPlayer(playerid, 47, 100);
  5262. RingTone[playerid] = 20;
  5263. //ChatLog(string);
  5264. return 0;
  5265. }
  5266. }
  5267. foreach(new i: Player)
  5268. {
  5269. if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
  5270. {
  5271. if(PhoneOnline[i] > 0)
  5272. {
  5273. SendClientMessageEx(playerid, COLOR_GREY, "That player's phone is switched off.");
  5274. return 1;
  5275. }
  5276. format(string, sizeof(string), "SMS: %s, Sender: %s (Ph: %d)", inputtext, GetPlayerNameEx(playerid),PlayerInfo[playerid][pPnumber]);
  5277. GetPlayerName(i, sendername, sizeof(sendername));
  5278. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Message Sent! ", string, "OK", "Cancel");
  5279. SendClientMessageEx(i, COLOR_YELLOW, string);
  5280. return 1;
  5281. }
  5282. }
  5283. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Message Delivery Failed! ", "Message Delivery Failed. Try Again", "OK", "Cancel");
  5284. }
  5285. if(dialogid == MDC_BOLO && response)
  5286. {
  5287. new x_nr = GetPVarInt(playerid, "BOLOISSUESLOT");
  5288. if(x_nr == 1)
  5289. {
  5290. if(News[hTaken14] == 0)
  5291. {
  5292. GetPlayerName(playerid, sendername, sizeof(sendername));
  5293. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_BOLO, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter BOLO Details", "Enter", "Cancel"); return 1; }
  5294. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd14], string, 0, strlen(string), 255);
  5295. format(string, sizeof(string), "%s",sendername); strmid(News[hContact14], string, 0, strlen(string), 255);
  5296. News[hTaken14] = 1;
  5297. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for a BOLO on the MDC -BOLO\nto see the current BOLO List browse to BOLO when logged in to the mdc", "OK", "Back");
  5298. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for a BOLO have been updated.");
  5299. return 1;
  5300. }
  5301. else
  5302. {
  5303. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 1 is already Taken!", "OK", "Back");
  5304. return 1;
  5305. }
  5306. }
  5307. if(x_nr == 2)
  5308. {
  5309. if(News[hTaken15] == 0)
  5310. {
  5311. GetPlayerName(playerid, sendername, sizeof(sendername));
  5312. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_BOLO, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter BOLO Details", "Enter", "Cancel"); return 1; }
  5313. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd15], string, 0, strlen(string), 255);
  5314. format(string, sizeof(string), "%s",sendername); strmid(News[hContact15], string, 0, strlen(string), 255);
  5315. News[hTaken15] = 1;
  5316. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for a BOLO on the MDC -BOLO\nto see the current BOLO List browse to BOLO when logged in to the mdc", "OK", "Back");
  5317. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for a BOLO have been updated.");
  5318. return 1;
  5319. }
  5320. else
  5321. {
  5322. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 2 is already Taken!", "OK", "Back");
  5323. return 1;
  5324. }
  5325. }
  5326. if(x_nr == 3)
  5327. {
  5328. if(News[hTaken16] == 0)
  5329. {
  5330. GetPlayerName(playerid, sendername, sizeof(sendername));
  5331. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_BOLO, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter BOLO Details", "Enter", "Cancel"); return 1; }
  5332. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd16], string, 0, strlen(string), 255);
  5333. format(string, sizeof(string), "%s",sendername); strmid(News[hContact16], string, 0, strlen(string), 255);
  5334. News[hTaken16] = 1;
  5335. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for a BOLO on the MDC -BOLO\nto see the current BOLO List browse to BOLO when logged in to the mdc", "OK", "Back");
  5336. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for a BOLO have been updated.");
  5337. return 1;
  5338. }
  5339. else
  5340. {
  5341. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 3 is already Taken!", "OK", "Back");
  5342. return 1;
  5343. }
  5344. }
  5345. if(x_nr == 4)
  5346. {
  5347. if(News[hTaken17] == 0)
  5348. {
  5349. GetPlayerName(playerid, sendername, sizeof(sendername));
  5350. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_BOLO, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter BOLO Details", "Enter", "Cancel"); return 1; }
  5351. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd17], string, 0, strlen(string), 255);
  5352. format(string, sizeof(string), "%s",sendername); strmid(News[hContact17], string, 0, strlen(string), 255);
  5353. News[hTaken17] = 1;
  5354. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for a BOLO on the MDC -BOLO\nto see the current BOLO List browse to BOLO when logged in to the mdc", "OK", "Back");
  5355. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for a BOLO have been updated.");
  5356. return 1;
  5357. }
  5358. else
  5359. {
  5360. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 4 is already Taken!", "OK", "Back");
  5361. return 1;
  5362. }
  5363. }
  5364. if(x_nr == 5)
  5365. {
  5366. if(News[hTaken18] == 0)
  5367. {
  5368. GetPlayerName(playerid, sendername, sizeof(sendername));
  5369. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_BOLO, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter BOLO Details", "Enter", "Cancel"); return 1; }
  5370. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd18], string, 0, strlen(string), 255);
  5371. format(string, sizeof(string), "%s",sendername); strmid(News[hContact18], string, 0, strlen(string), 255);
  5372. News[hTaken18] = 1;
  5373. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for a BOLO on the MDC -BOLO\nto see the current BOLO List browse to BOLO when logged in to the mdc", "OK", "Back");
  5374. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for a BOLO have been updated.");
  5375. return 1;
  5376. }
  5377. else
  5378. {
  5379. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 5 is already Taken!", "OK", "Back");
  5380. return 1;
  5381. }
  5382. }
  5383. if(x_nr == 6)
  5384. {
  5385. if(News[hTaken19] == 0)
  5386. {
  5387. GetPlayerName(playerid, sendername, sizeof(sendername));
  5388. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_BOLO, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter BOLO Details", "Enter", "Cancel"); return 1; }
  5389. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd19], string, 0, strlen(string), 255);
  5390. format(string, sizeof(string), "%s",sendername); strmid(News[hContact19], string, 0, strlen(string), 255);
  5391. News[hTaken19] = 1;
  5392. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for a BOLO on the MDC -BOLO\nto see the current BOLO List browse to BOLO when logged in to the mdc", "OK", "Back");
  5393. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for a BOLO have been updated.");
  5394. return 1;
  5395. }
  5396. else
  5397. {
  5398. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 6 is already Taken!", "OK", "Back");
  5399. return 1;
  5400. }
  5401. }
  5402. if(x_nr == 7)
  5403. {
  5404. if(News[hTaken20] == 0)
  5405. {
  5406. GetPlayerName(playerid, sendername, sizeof(sendername));
  5407. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_BOLO, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter BOLO Details", "Enter", "Cancel"); return 1; }
  5408. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd20], string, 0, strlen(string), 255);
  5409. format(string, sizeof(string), "%s",sendername); strmid(News[hContact20], string, 0, strlen(string), 255);
  5410. News[hTaken20] = 1;
  5411. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for a BOLO on the MDC -BOLO\nto see the current BOLO List browse to BOLO when logged in to the mdc", "OK", "Back");
  5412. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for a BOLO have been updated.");
  5413. return 1;
  5414. }
  5415. else
  5416. {
  5417. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 7 is already Taken!", "OK", "Back");
  5418. return 1;
  5419. }
  5420. }
  5421. if(x_nr == 8)
  5422. {
  5423. if(News[hTaken21] == 0)
  5424. {
  5425. GetPlayerName(playerid, sendername, sizeof(sendername));
  5426. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_BOLO, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter BOLO Details", "Enter", "Cancel"); return 1; }
  5427. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd21], string, 0, strlen(string), 255);
  5428. format(string, sizeof(string), "%s",sendername); strmid(News[hContact21], string, 0, strlen(string), 255);
  5429. News[hTaken21] = 1;
  5430. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for a BOLO on the MDC -BOLO\nto see the current BOLO List browse to BOLO when logged in to the mdc", "OK", "Back");
  5431. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for a BOLO have been updated.");
  5432. return 1;
  5433. }
  5434. else
  5435. {
  5436. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 8 is already Taken!", "OK", "Back");
  5437. return 1;
  5438. }
  5439. }
  5440. }
  5441. if(dialogid == MDC_BOLO_SLOT && response)
  5442. {
  5443. SetPVarInt(playerid, "BOLOISSUESLOT", listitem + 1);
  5444. ShowPlayerDialogEx(playerid, MDC_BOLO, DIALOG_STYLE_INPUT, "MDC - Logged in | Issue Warrant", "Enter BOLO Details", "Enter", "Cancel");
  5445. }
  5446. if(dialogid == MDC_ISSUE_SLOT && response)
  5447. {
  5448. SetPVarInt(playerid, "ISSUESLOT", listitem + 1);
  5449. ShowPlayerDialogEx(playerid, MDC_ISSUE, DIALOG_STYLE_INPUT, "MDC - Logged in | Issue Warrant", "Enter Arrest Warrant Details", "Enter", "Cancel");
  5450. }
  5451. if(dialogid == MDC_END_ID && response)
  5452. {
  5453. ShowPlayerDialogEx(playerid, MDC_MAIN, DIALOG_STYLE_LIST, "MDC - Logged in", "*Civilian Information\n*Register Suspect\n*Clear Suspect\n*Vehicle registrations\n*Find LEO\n*Law Enforcement Agencies\n*MDC Message\n*SMS", "OK", "Cancel");
  5454. }
  5455. if(dialogid == MDC_ISSUE && response)
  5456. {
  5457. new x_nr = GetPVarInt(playerid, "ISSUESLOT");
  5458. if(x_nr == 1)
  5459. {
  5460. if(News[hTaken6] == 0)
  5461. {
  5462. GetPlayerName(playerid, sendername, sizeof(sendername));
  5463. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_ISSUE, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter Arrest Warrant Details", "Enter", "Cancel"); return 1; }
  5464. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd6], string, 0, strlen(string), 255);
  5465. format(string, sizeof(string), "%s",sendername); strmid(News[hContact6], string, 0, strlen(string), 255);
  5466. News[hTaken6] = 1;
  5467. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for an arrest warrant on the MDC -Warrants\nto see the current Warrants browse to Warrants when logged in to the mdc", "OK", "Back");
  5468. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for an arrest warrant have been updated.");
  5469. return 1;
  5470. }
  5471. else
  5472. {
  5473. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 1 is already Taken!", "OK", "Back");
  5474. return 1;
  5475. }
  5476. }
  5477. if(x_nr == 2)
  5478. {
  5479. if(News[hTaken7] == 0)
  5480. {
  5481. GetPlayerName(playerid, sendername, sizeof(sendername));
  5482. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_ISSUE, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter Arrest Warrant Details", "Enter", "Cancel"); return 1; }
  5483. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd7], string, 0, strlen(string), 255);
  5484. format(string, sizeof(string), "%s",sendername); strmid(News[hContact7], string, 0, strlen(string), 255);
  5485. News[hTaken7] = 1;
  5486. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for an arrest warrant on the MDC -Warrants\nto see the current Warrants browse to Warrants when logged in to the mdc", "OK", "Back");
  5487. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for an arrest warrant have been updated.");
  5488. return 1;
  5489. }
  5490. else
  5491. {
  5492. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 2 is already Taken!", "OK", "Back");
  5493. return 1;
  5494. }
  5495. }
  5496. if(x_nr == 3)
  5497. {
  5498. if(News[hTaken8] == 0)
  5499. {
  5500. GetPlayerName(playerid, sendername, sizeof(sendername));
  5501. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_ISSUE, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter Arrest Warrant Details", "Enter", "Cancel"); return 1; }
  5502. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd8], string, 0, strlen(string), 255);
  5503. format(string, sizeof(string), "%s",sendername); strmid(News[hContact8], string, 0, strlen(string), 255);
  5504. News[hTaken8] = 1;
  5505. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for an arrest warrant on the MDC -Warrants\nto see the current Warrants browse to Warrants when logged in to the mdc", "OK", "Back");
  5506. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for an arrest warrant have been updated.");
  5507. return 1;
  5508. }
  5509. else
  5510. {
  5511. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 3 is already Taken!", "OK", "Back");
  5512. return 1;
  5513. }
  5514. }
  5515. if(x_nr == 4)
  5516. {
  5517. if(News[hTaken9] == 0)
  5518. {
  5519. GetPlayerName(playerid, sendername, sizeof(sendername));
  5520. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_ISSUE, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter Arrest Warrant Details", "Enter", "Cancel"); return 1; }
  5521. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd9], string, 0, strlen(string), 255);
  5522. format(string, sizeof(string), "%s",sendername); strmid(News[hContact9], string, 0, strlen(string), 255);
  5523. News[hTaken9] = 1;
  5524. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for an arrest warrant on the MDC -Warrants\nto see the current Warrants browse to Warrants when logged in to the mdc", "OK", "Back");
  5525. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for an arrest warrant have been updated.");
  5526. return 1;
  5527. }
  5528. else
  5529. {
  5530. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 4 is already Taken!", "OK", "Back");
  5531. return 1;
  5532. }
  5533. }
  5534. if(x_nr == 5)
  5535. {
  5536. if(News[hTaken10] == 0)
  5537. {
  5538. GetPlayerName(playerid, sendername, sizeof(sendername));
  5539. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_ISSUE, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter Arrest Warrant Details", "Enter", "Cancel"); return 1; }
  5540. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd10], string, 0, strlen(string), 255);
  5541. format(string, sizeof(string), "%s",sendername); strmid(News[hContact10], string, 0, strlen(string), 255);
  5542. News[hTaken10] = 1;
  5543. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for an arrest warrant on the MDC -Warrants\nto see the current Warrants browse to Warrants when logged in to the mdc", "OK", "Back");
  5544. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for an arrest warrant have been updated.");
  5545. return 1;
  5546. }
  5547. else
  5548. {
  5549. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 5 is already Taken!", "OK", "Back");
  5550. return 1;
  5551. }
  5552. }
  5553. if(x_nr == 6)
  5554. {
  5555. if(News[hTaken11] == 0)
  5556. {
  5557. GetPlayerName(playerid, sendername, sizeof(sendername));
  5558. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_ISSUE, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter Arrest Warrant Details", "Enter", "Cancel"); return 1; }
  5559. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd11], string, 0, strlen(string), 255);
  5560. format(string, sizeof(string), "%s",sendername); strmid(News[hContact11], string, 0, strlen(string), 255);
  5561. News[hTaken11] = 1;
  5562. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for an arrest warrant on the MDC -Warrants\nto see the current Warrants browse to Warrants when logged in to the mdc", "OK", "Back");
  5563. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for an arrest warrant have been updated.");
  5564. return 1;
  5565. }
  5566. else
  5567. {
  5568. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 6 is already Taken!", "OK", "Back");
  5569. return 1;
  5570. }
  5571. }
  5572. if(x_nr == 7)
  5573. {
  5574. if(News[hTaken12] == 0)
  5575. {
  5576. GetPlayerName(playerid, sendername, sizeof(sendername));
  5577. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_ISSUE, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter Arrest Warrant Details", "Enter", "Cancel"); return 1; }
  5578. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd12], string, 0, strlen(string), 255);
  5579. format(string, sizeof(string), "%s",sendername); strmid(News[hContact12], string, 0, strlen(string), 255);
  5580. News[hTaken12] = 1;
  5581. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for an arrest warrant on the MDC -Warrants\nto see the current Warrants browse to Warrants when logged in to the mdc", "OK", "Back");
  5582. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for an arrest warrant have been updated.");
  5583. return 1;
  5584. }
  5585. else
  5586. {
  5587. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 7 is already Taken!", "OK", "Back");
  5588. return 1;
  5589. }
  5590. }
  5591. if(x_nr == 8)
  5592. {
  5593. if(News[hTaken13] == 0)
  5594. {
  5595. GetPlayerName(playerid, sendername, sizeof(sendername));
  5596. if(strlen(inputtext) < 9) { ShowPlayerDialogEx(playerid, MDC_ISSUE, DIALOG_STYLE_INPUT, "MDC - Logged in | ERROR", "ERROR: Must Be 9+ characters\nEnter Arrest Warrant Details", "Enter", "Cancel"); return 1; }
  5597. format(string, sizeof(string), "%s",inputtext); strmid(News[hAdd13], string, 0, strlen(string), 255);
  5598. format(string, sizeof(string), "%s",sendername); strmid(News[hContact13], string, 0, strlen(string), 255);
  5599. News[hTaken13] = 1;
  5600. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Success! ","* You placed details for an arrest warrant on the MDC -Warrants\nto see the current Warrants browse to Warrants when logged in to the mdc", "OK", "Back");
  5601. SendGroupMessage(GROUP_TYPE_LEA, COLOR_LIGHTBLUE, "** MDC: Details for an arrest warrant have been updated.");
  5602. return 1;
  5603. }
  5604. else
  5605. {
  5606. ShowPlayerDialogEx(playerid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "MDC - Logged in | Error! ", "Spot 8 is already Taken!", "OK", "Back");
  5607. return 1;
  5608. }
  5609. }
  5610. }
  5611. if(dialogid == MDC_DELETE && response)
  5612. {
  5613. if(listitem == 0)
  5614. {
  5615. ShowPlayerDialogEx(playerid, MDC_DEL_BOLO, DIALOG_STYLE_LIST, "MDC - Logged in | Which BOLO Slot would you like to delete?", "1\n2\n3\n4\n5\n6\n7\n8\nALL", "Enter", "Cancel");
  5616. }
  5617. if(listitem == 1)
  5618. {
  5619. ShowPlayerDialogEx(playerid, MDC_DEL_WARRANT, DIALOG_STYLE_LIST, "MDC - Logged in | Which Warrant Slot would you like to delete?", "1\n2\n3\n4\n5\n6\n7\n8\nALL", "Enter", "Cancel");
  5620. }
  5621. }
  5622. if(dialogid == MDC_DEL_BOLO && response)
  5623. {
  5624. new string1[MAX_PLAYER_NAME];
  5625. if(isnull(inputtext))
  5626. {
  5627. ShowPlayerDialogEx(playerid, MDC_DEL_WARRANT, DIALOG_STYLE_LIST, "MDC - Logged in | Which Warrant Slot would you like to delete?", "1\n2\n3\n4\n5\n6\n7\n8\nALL", "Enter", "Cancel");
  5628. return 1;
  5629. }
  5630. if(strcmp(inputtext, "1") == 0)
  5631. {
  5632. format(string, sizeof(string), "Nothing"); strmid(News[hAdd14], string, 0, strlen(string), 255);
  5633. format(string1, sizeof(string1), "No-one"); strmid(News[hContact14], string1, 0, strlen(string1), 255);
  5634. News[hTaken14] = 0;
  5635. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Be on the Lookout (1) from the MDC -BOLO.");
  5636. return 1;
  5637. }
  5638. else if(strcmp(inputtext, "2") == 0)
  5639. {
  5640. format(string, sizeof(string), "Nothing"); strmid(News[hAdd15], string, 0, strlen(string), 255);
  5641. format(string1, sizeof(string1), "No-one"); strmid(News[hContact15], string1, 0, strlen(string1), 255);
  5642. News[hTaken15] = 0;
  5643. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Be on the Lookout (2) from the MDC -BOLO.");
  5644. return 1;
  5645. }
  5646. else if(strcmp(inputtext, "3") == 0)
  5647. {
  5648. format(string, sizeof(string), "Nothing"); strmid(News[hAdd16], string, 0, strlen(string), 255);
  5649. format(string1, sizeof(string1), "No-one"); strmid(News[hContact16], string1, 0, strlen(string1), 255);
  5650. News[hTaken16] = 0;
  5651. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Be on the Lookout (3) from the MDC -BOLO.");
  5652. return 1;
  5653. }
  5654. else if(strcmp(inputtext, "4") == 0)
  5655. {
  5656. format(string, sizeof(string), "Nothing"); strmid(News[hAdd17], string, 0, strlen(string), 255);
  5657. format(string1, sizeof(string1), "No-one"); strmid(News[hContact17], string1, 0, strlen(string1), 255);
  5658. News[hTaken17] = 0;
  5659. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Be on the Lookout (4) from the MDC -BOLO.");
  5660. return 1;
  5661. }
  5662. else if(strcmp(inputtext, "5") == 0)
  5663. {
  5664. format(string, sizeof(string), "Nothing"); strmid(News[hAdd18], string, 0, strlen(string), 255);
  5665. format(string1, sizeof(string1), "No-one"); strmid(News[hContact18], string1, 0, strlen(string1), 255);
  5666. News[hTaken18] = 0;
  5667. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Be on the Lookout (5) from the MDC -BOLO.");
  5668. return 1;
  5669. }
  5670. else if(strcmp(inputtext, "6") == 0)
  5671. {
  5672. format(string, sizeof(string), "Nothing"); strmid(News[hAdd19], string, 0, strlen(string), 255);
  5673. format(string1, sizeof(string1), "No-one"); strmid(News[hContact19], string1, 0, strlen(string1), 255);
  5674. News[hTaken19] = 0;
  5675. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Be on the Lookout (6) from the MDC -BOLO.");
  5676. return 1;
  5677. }
  5678. else if(strcmp(inputtext, "7") == 0)
  5679. {
  5680. format(string, sizeof(string), "Nothing"); strmid(News[hAdd20], string, 0, strlen(string), 255);
  5681. format(string1, sizeof(string1), "No-one"); strmid(News[hContact20], string1, 0, strlen(string1), 255);
  5682. News[hTaken20] = 0;
  5683. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Be on the Lookout (7) from the MDC -BOLO.");
  5684. return 1;
  5685. }
  5686. else if(strcmp(inputtext, "8") == 0)
  5687. {
  5688. format(string, sizeof(string), "Nothing"); strmid(News[hAdd21], string, 0, strlen(string), 255);
  5689. format(string1, sizeof(string1), "No-one"); strmid(News[hContact21], string1, 0, strlen(string1), 255);
  5690. News[hTaken21] = 0;
  5691. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Be on the Lookout (8) from the MDC -BOLO.");
  5692. return 1;
  5693. }
  5694. else if(strcmp(inputtext,"all",true) == 0)
  5695. {
  5696. format(string, sizeof(string), "Nothing"); strmid(News[hAdd14], string, 0, strlen(string), 255);
  5697. format(string1, sizeof(string1), "No-one"); strmid(News[hContact14], string1, 0, strlen(string1), 255);
  5698. News[hTaken14] = 0;
  5699. format(string, sizeof(string), "Nothing"); strmid(News[hAdd15], string, 0, strlen(string), 255);
  5700. format(string1, sizeof(string1), "No-one"); strmid(News[hContact15], string1, 0, strlen(string1), 255);
  5701. News[hTaken15] = 0;
  5702. format(string, sizeof(string), "Nothing"); strmid(News[hAdd16], string, 0, strlen(string), 255);
  5703. format(string1, sizeof(string1), "No-one"); strmid(News[hContact16], string1, 0, strlen(string1), 255);
  5704. News[hTaken16] = 0;
  5705. format(string, sizeof(string), "Nothing"); strmid(News[hAdd17], string, 0, strlen(string), 255);
  5706. format(string1, sizeof(string1), "No-one"); strmid(News[hContact17], string1, 0, strlen(string1), 255);
  5707. News[hTaken17] = 0;
  5708. format(string, sizeof(string), "Nothing"); strmid(News[hAdd18], string, 0, strlen(string), 255);
  5709. format(string1, sizeof(string1), "No-one"); strmid(News[hContact18], string1, 0, strlen(string1), 255);
  5710. News[hTaken18] = 0;
  5711. format(string, sizeof(string), "Nothing"); strmid(News[hAdd19], string, 0, strlen(string), 255);
  5712. format(string1, sizeof(string1), "No-one"); strmid(News[hContact19], string1, 0, strlen(string1), 255);
  5713. News[hTaken19] = 0;
  5714. format(string, sizeof(string), "Nothing"); strmid(News[hAdd20], string, 0, strlen(string), 255);
  5715. format(string1, sizeof(string1), "No-one"); strmid(News[hContact20], string1, 0, strlen(string1), 255);
  5716. News[hTaken20] = 0;
  5717. format(string, sizeof(string), "Nothing"); strmid(News[hAdd21], string, 0, strlen(string), 255);
  5718. format(string1, sizeof(string1), "No-one"); strmid(News[hContact21], string1, 0, strlen(string1), 255);
  5719. News[hTaken21] = 0;
  5720. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted all the details for Be on the Lookout from the MDC -BOLO.");
  5721. return 1;
  5722. }
  5723. }
  5724. if(dialogid == MDC_DEL_WARRANT && response)
  5725. {
  5726. new string1[MAX_PLAYER_NAME];
  5727. if(isnull(inputtext))
  5728. {
  5729. ShowPlayerDialogEx(playerid, MDC_DEL_WARRANT, DIALOG_STYLE_LIST, "MDC - Logged in | Which Warrant Slot would you like to delete?", "1\n2\n3\n4\n5\n6\n7\n8\nALL", "Enter", "Cancel");
  5730. return 1;
  5731. }
  5732. if(strcmp(inputtext,"1",true) == 0)
  5733. {
  5734. format(string, sizeof(string), "Nothing"); strmid(News[hAdd6], string, 0, strlen(string), 255);
  5735. format(string1, sizeof(string1), "No-one"); strmid(News[hContact6], string1, 0, strlen(string1), 255);
  5736. News[hTaken6] = 0;
  5737. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Arrest Warrant (1) from the MDC -Warrants.");
  5738. return 1;
  5739. }
  5740. else if(strcmp(inputtext,"2",true) == 0)
  5741. {
  5742. format(string, sizeof(string), "Nothing"); strmid(News[hAdd7], string, 0, strlen(string), 255);
  5743. format(string1, sizeof(string1), "No-one"); strmid(News[hContact7], string1, 0, strlen(string1), 255);
  5744. News[hTaken7] = 0;
  5745. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Arrest Warrant (2) from the MDC -Warrants.");
  5746. return 1;
  5747. }
  5748. else if(strcmp(inputtext,"3",true) == 0)
  5749. {
  5750. format(string, sizeof(string), "Nothing"); strmid(News[hAdd8], string, 0, strlen(string), 255);
  5751. format(string1, sizeof(string1), "No-one"); strmid(News[hContact8], string1, 0, strlen(string1), 255);
  5752. News[hTaken8] = 0;
  5753. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Arrest Warrant (3) from the MDC -Warrants.");
  5754. return 1;
  5755. }
  5756. else if(strcmp(inputtext,"4",true) == 0)
  5757. {
  5758. format(string, sizeof(string), "Nothing"); strmid(News[hAdd9], string, 0, strlen(string), 255);
  5759. format(string1, sizeof(string1), "No-one"); strmid(News[hContact9], string1, 0, strlen(string1), 255);
  5760. News[hTaken9] = 0;
  5761. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Arrest Warrant (4) from the MDC -Warrants.");
  5762. return 1;
  5763. }
  5764. else if(strcmp(inputtext,"5",true) == 0)
  5765. {
  5766. format(string, sizeof(string), "Nothing"); strmid(News[hAdd10], string, 0, strlen(string), 255);
  5767. format(string1, sizeof(string1), "No-one"); strmid(News[hContact10], string1, 0, strlen(string1), 255);
  5768. News[hTaken10] = 0;
  5769. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Arrest Warrant (5) from the MDC -Warrants.");
  5770. return 1;
  5771. }
  5772. else if(strcmp(inputtext,"6",true) == 0)
  5773. {
  5774. format(string, sizeof(string), "Nothing"); strmid(News[hAdd11], string, 0, strlen(string), 255);
  5775. format(string1, sizeof(string1), "No-one"); strmid(News[hContact11], string1, 0, strlen(string1), 255);
  5776. News[hTaken11] = 0;
  5777. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Arrest Warrant (6) from the MDC -Warrants.");
  5778. return 1;
  5779. }
  5780. else if(strcmp(inputtext,"7",true) == 0)
  5781. {
  5782. format(string, sizeof(string), "Nothing"); strmid(News[hAdd12], string, 0, strlen(string), 255);
  5783. format(string1, sizeof(string1), "No-one"); strmid(News[hContact12], string1, 0, strlen(string1), 255);
  5784. News[hTaken12] = 0;
  5785. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Arrest Warrant (7) from the MDC -Warrants.");
  5786. return 1;
  5787. }
  5788. else if(strcmp(inputtext,"8",true) == 0)
  5789. {
  5790. format(string, sizeof(string), "Nothing"); strmid(News[hAdd13], string, 0, strlen(string), 255);
  5791. format(string1, sizeof(string1), "No-one"); strmid(News[hContact13], string1, 0, strlen(string1), 255);
  5792. News[hTaken13] = 0;
  5793. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted details for Arrest Warrant (8) from the MDC -Warrants.");
  5794. return 1;
  5795. }
  5796. else if(strcmp(inputtext,"all",true) == 0)
  5797. {
  5798. format(string, sizeof(string), "Nothing"); strmid(News[hAdd6], string, 0, strlen(string), 255);
  5799. format(string1, sizeof(string1), "No-one"); strmid(News[hContact6], string1, 0, strlen(string1), 255);
  5800. News[hTaken6] = 0;
  5801. format(string, sizeof(string), "Nothing"); strmid(News[hAdd7], string, 0, strlen(string), 255);
  5802. format(string1, sizeof(string1), "No-one"); strmid(News[hContact7], string1, 0, strlen(string1), 255);
  5803. News[hTaken7] = 0;
  5804. format(string, sizeof(string), "Nothing"); strmid(News[hAdd8], string, 0, strlen(string), 255);
  5805. format(string1, sizeof(string1), "No-one"); strmid(News[hContact8], string1, 0, strlen(string1), 255);
  5806. News[hTaken8] = 0;
  5807. format(string, sizeof(string), "Nothing"); strmid(News[hAdd9], string, 0, strlen(string), 255);
  5808. format(string1, sizeof(string1), "No-one"); strmid(News[hContact9], string1, 0, strlen(string1), 255);
  5809. News[hTaken9] = 0;
  5810. format(string, sizeof(string), "Nothing"); strmid(News[hAdd10], string, 0, strlen(string), 255);
  5811. format(string1, sizeof(string1), "No-one"); strmid(News[hContact10], string1, 0, strlen(string1), 255);
  5812. News[hTaken10] = 0;
  5813. format(string, sizeof(string), "Nothing"); strmid(News[hAdd11], string, 0, strlen(string), 255);
  5814. format(string1, sizeof(string1), "No-one"); strmid(News[hContact11], string1, 0, strlen(string1), 255);
  5815. News[hTaken11] = 0;
  5816. format(string, sizeof(string), "Nothing"); strmid(News[hAdd12], string, 0, strlen(string), 255);
  5817. format(string1, sizeof(string1), "No-one"); strmid(News[hContact12], string1, 0, strlen(string1), 255);
  5818. News[hTaken12] = 0;
  5819. format(string, sizeof(string), "Nothing"); strmid(News[hAdd13], string, 0, strlen(string), 255);
  5820. format(string1, sizeof(string1), "No-one"); strmid(News[hContact13], string1, 0, strlen(string1), 255);
  5821. News[hTaken13] = 0;
  5822. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You deleted all the details for Arrest Warrants from the MDC -Warrants.");
  5823. return 1;
  5824. }
  5825. }
  5826. if(dialogid == MDC_LOGOUT && response)
  5827. {
  5828. }
  5829. if(dialogid == MDC_CREATE && response)
  5830. {
  5831. }
  5832. if( (dialogid >= MDC_START_ID && dialogid <= MDC_END_ID) && !response)
  5833. {
  5834. if(dialogid == MDC_MAIN)
  5835. {
  5836. ConnectedToPC[playerid] = 0;
  5837. }
  5838. else
  5839. {
  5840. ShowPlayerDialogEx(playerid, MDC_MAIN, DIALOG_STYLE_LIST, "MDC - Logged in", "*Civilian Information\n*Register Suspect\n*Clear Suspect\n*Vehicle registrations\n*Find LEO\n*Law Enforcement Agencies\n*MDC Message\n*SMS", "OK", "Cancel");
  5841. }
  5842. }
  5843. if((dialogid == SELLVIP))
  5844. {
  5845. new
  5846. iTargetID = GetPVarInt(playerid, "VIPSell"),
  5847. iPrice = GetPVarInt(playerid, "VIPCost"),
  5848. logstring[156];
  5849. if(response)
  5850. {
  5851. if(!IsPlayerConnected(iTargetID)) return SendClientMessageEx(playerid, COLOR_GREY, "The other person has disconnected.");
  5852. new iTargetName[MAX_PLAYER_NAME];
  5853. GetPVarString(playerid, "VIPSeller", iTargetName, sizeof(iTargetName));
  5854. if(strcmp(iTargetName, GetPlayerNameEx(iTargetID)) != 0) {
  5855. return SendClientMessageEx(playerid, COLOR_GREY, "The other person has disconnected.");
  5856. }
  5857. new viptype[7];
  5858. if(GetPlayerCash(playerid) >= iPrice)
  5859. {
  5860. if(PlayerInfo[iTargetID][pDonateRank] == 3)
  5861. {
  5862. PlayerInfo[iTargetID][pGVip] = 0;
  5863. PlayerInfo[playerid][pGVip] = 1;
  5864. }
  5865. //Player buying the VIP
  5866. GivePlayerCash(playerid, -GetPVarInt(playerid, "VIPCost"));
  5867. PlayerInfo[playerid][pDonateRank] = PlayerInfo[iTargetID][pDonateRank];
  5868. PlayerInfo[playerid][pVIPExpire] = PlayerInfo[iTargetID][pVIPExpire];
  5869. PlayerInfo[playerid][pTempVIP] = 0;
  5870. PlayerInfo[playerid][pBuddyInvited] = 0;
  5871. PlayerInfo[playerid][pVIPSellable] = 0;
  5872. LoadPlayerDisabledVehicles(iTargetID);
  5873. if(PlayerInfo[playerid][pVIPM] != 0)
  5874. {
  5875. PlayerInfo[playerid][pVIPMO] = PlayerInfo[playerid][pVIPM];
  5876. }
  5877. PlayerInfo[playerid][pVIPM] = PlayerInfo[iTargetID][pVIPM];
  5878. // person selling the vip
  5879. GivePlayerCash(iTargetID, GetPVarInt(playerid, "VIPCost"));
  5880. PlayerInfo[iTargetID][pDonateRank] = 0;
  5881. PlayerInfo[iTargetID][pVIPExpire] = 0;
  5882. PlayerInfo[iTargetID][pVIPMO] = PlayerInfo[iTargetID][pVIPM];
  5883. PlayerInfo[iTargetID][pVIPM] = 0;
  5884. switch(PlayerInfo[playerid][pDonateRank])
  5885. {
  5886. case 1: viptype = "Bronze";
  5887. case 2: viptype = "Silver";
  5888. case 3: viptype = "Gold";
  5889. default: viptype = "Error";
  5890. }
  5891. format(string, sizeof(string), "You have purchased %s VIP from %s for $%d which will expire on %s.", viptype, GetPlayerNameEx(iTargetID), iPrice, date(PlayerInfo[playerid][pVIPExpire], 2));
  5892. SendClientMessage(playerid, COLOR_WHITE, string);
  5893. format(string, sizeof(string), "You have sold your %s VIP to %s for $%d.", viptype, GetPlayerNameEx(playerid), iPrice);
  5894. SendClientMessage(iTargetID, COLOR_WHITE, string);
  5895. new iYear, iMonth, iDay, szIP[16], szIP2[16];
  5896. getdate(iYear, iMonth, iDay);
  5897. GetPlayerIp(iTargetID, szIP, sizeof(szIP));
  5898. GetPlayerIp(playerid, szIP2, sizeof(szIP2));
  5899. format(logstring, sizeof(logstring), "[SELLVIP] %s(%d) (IP:%s) has sold %s VIP to %s(%d) (IP:%s) for $%d. (VIPM: %d) - (%d/%d/%d)", GetPlayerNameEx(iTargetID), GetPlayerSQLId(iTargetID), szIP, viptype, GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), szIP2, iPrice, PlayerInfo[playerid][pVIPM], iMonth,iDay,iYear);
  5900. Log("logs/shoplog.log", logstring);
  5901. PlayerInfo[playerid][pVIPSold] = gettime() + 7200;
  5902. PlayerInfo[iTargetID][pVIPSold] = gettime() + 7200;
  5903. }
  5904. else
  5905. {
  5906. SendClientMessage(playerid, COLOR_GREY, "You don't have enough cash to purchase it!");
  5907. SendClientMessage(iTargetID, COLOR_GREY, "He did not have enough cash to purchase it!");
  5908. }
  5909. DeletePVar(playerid, "VIPSell");
  5910. DeletePVar(playerid, "VIPCost");
  5911. }
  5912. else
  5913. {
  5914. format(string, sizeof(string), "You have declined the offer to purchase VIP from %s.", GetPlayerNameEx(iTargetID));
  5915. SendClientMessage(playerid, COLOR_WHITE, string);
  5916. format(string, sizeof(string), "%s has declined the offer to purchase VIP.", GetPlayerNameEx(playerid));
  5917. SendClientMessage(iTargetID, COLOR_WHITE, string);
  5918. DeletePVar(playerid, "VIPSell");
  5919. DeletePVar(playerid, "VIPCost");
  5920. }
  5921. return 1;
  5922. }
  5923. if((dialogid == DRINKDIALOG))
  5924. {
  5925. if(response)
  5926. {
  5927. ShowPlayerDialogEx(playerid, TIPDIALOG, DIALOG_STYLE_INPUT, "Tipping the Bartender", "How much would you like to tip the bartender for their service?", "OK", "Cancel");
  5928. }
  5929. else
  5930. {
  5931. DrinkOffer[playerid] = INVALID_PLAYER_ID;
  5932. }
  5933. }
  5934. if((dialogid == TIPDIALOG))
  5935. {
  5936. if(response)
  5937. {
  5938. if(GetPlayerCash(playerid) >= strval(inputtext))
  5939. {
  5940. if(strval(inputtext) < 0 || strval(inputtext) > 10000)
  5941. {
  5942. return ShowPlayerDialogEx(playerid, TIPDIALOG, DIALOG_STYLE_INPUT, "Tipping the Bartender", "Must be above $0 or below $10,000.\nHow much would you like to tip the bartender for their service?", "OK", "Cancel");
  5943. }
  5944. format(string, sizeof(string), "** %s gives %s a tip for their service.", GetPlayerNameEx(playerid), GetPlayerNameEx(DrinkOffer[playerid]));
  5945. ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  5946. format(string, sizeof(string), "* %s has given you a tip of $%d for your service.", GetPlayerNameEx(playerid), strval(inputtext));
  5947. SendClientMessageEx(DrinkOffer[playerid], COLOR_LIGHTBLUE, string);
  5948. GivePlayerCash(DrinkOffer[playerid], strval(inputtext));
  5949. GivePlayerCash(playerid, -strval(inputtext));
  5950. new ip[32], ipex[32];
  5951. GetPlayerIp(playerid, ip, sizeof(ip));
  5952. GetPlayerIp(DrinkOffer[playerid], ipex, sizeof(ipex));
  5953. if(strval(inputtext) >= 25000 && (PlayerInfo[DrinkOffer[playerid]][pLevel] <= 3 || PlayerInfo[playerid][pLevel] <= 3 ))
  5954. {
  5955. format(string, sizeof(string), "%s(%d) (IP:%s) has tipped %s(%d) (IP:%s) $%s in this session.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ip, GetPlayerNameEx(DrinkOffer[playerid]), GetPlayerSQLId(DrinkOffer[playerid]), ipex, number_format(strval(inputtext)));
  5956. Log("logs/pay.log", string);
  5957. format(string, sizeof(string), "%s (IP:%s) has tipped %s (IP:%s) $%s in this session.", GetPlayerNameEx(playerid), ip, GetPlayerNameEx(DrinkOffer[playerid]), ipex, number_format(strval(inputtext)));
  5958. ABroadCast(COLOR_YELLOW, string, 2);
  5959. }
  5960. DrinkOffer[playerid] = INVALID_PLAYER_ID;
  5961. }
  5962. }
  5963. else
  5964. {
  5965. DrinkOffer[playerid] = INVALID_PLAYER_ID;
  5966. }
  5967. }
  5968. else if(dialogid == INTERACTMAIN)
  5969. {
  5970. if(response)
  5971. {
  5972. new name[MAX_PLAYER_NAME+8];
  5973. GetPVarString(playerid, "pInteractName", name, sizeof(name));
  5974. if(listitem == 0)
  5975. {
  5976. ShowPlayerDialogEx(playerid, INTERACTPAY, DIALOG_STYLE_INPUT, name, "Input an amount to pay", "Pay", "Cancel");
  5977. }
  5978. else if(listitem == 1)
  5979. {
  5980. ShowPlayerDialogEx(playerid, INTERACTGIVE, DIALOG_STYLE_LIST, name, "Cannabis\nCrack\nMaterials\nFirework\nHeroin\nRawOpium\nSyringes\nOpiumSeeds\nSprunk", "Select", "Cancel");
  5981. }
  5982. }
  5983. else
  5984. {
  5985. DeletePVar(playerid, "pInteractName");
  5986. DeletePVar(playerid, "pInteractID");
  5987. }
  5988. }
  5989. else if(dialogid == INTERACTPAY)
  5990. {
  5991. if(response)
  5992. {
  5993. new params[24];
  5994. format(params, sizeof(params), "%d %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  5995. DeletePVar(playerid, "pInteractName");
  5996. DeletePVar(playerid, "pInteractID");
  5997. return cmd_pay(playerid, params);
  5998. }
  5999. else
  6000. {
  6001. DeletePVar(playerid, "pInteractName");
  6002. DeletePVar(playerid, "pInteractID");
  6003. }
  6004. }
  6005. else if(dialogid == INTERACTGIVE)
  6006. {
  6007. if(response)
  6008. {
  6009. new name[MAX_PLAYER_NAME+8];
  6010. SetPVarInt(playerid, "pInteractGiveType", listitem);
  6011. GetPVarString(playerid, "pInteractName", name, sizeof(name));
  6012. ShowPlayerDialogEx(playerid, INTERACTGIVE2, DIALOG_STYLE_INPUT, name, "Input an amount to give", "Give", "Cancel");
  6013. }
  6014. else
  6015. {
  6016. DeletePVar(playerid, "pInteractName");
  6017. DeletePVar(playerid, "pInteractID");
  6018. }
  6019. }
  6020. /*else if(dialogid == INTERACTGIVE2)
  6021. {
  6022. if(response)
  6023. {
  6024. new params[24];
  6025. switch(GetPVarInt(playerid, "pInteractGiveType"))
  6026. {
  6027. case 0: format(params, sizeof(params), "%d pot %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  6028. case 1: format(params, sizeof(params), "%d crack %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  6029. case 2: format(params, sizeof(params), "%d materials %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  6030. case 3: format(params, sizeof(params), "%d firework %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  6031. case 4: format(params, sizeof(params), "%d heroin %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  6032. case 5: format(params, sizeof(params), "%d rawopium %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  6033. case 6: format(params, sizeof(params), "%d syringes %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  6034. case 7: format(params, sizeof(params), "%d opiumseeds %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  6035. case 8: format(params, sizeof(params), "%d sprunk %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  6036. case 9: format(params, sizeof(params), "%d ammo1 %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  6037. case 10: format(params, sizeof(params), "%d ammo2 %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  6038. case 11: format(params, sizeof(params), "%d ammo3 %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  6039. case 12: format(params, sizeof(params), "%d ammo4 %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  6040. case 13: format(params, sizeof(params), "%d ammo5 %d", GetPVarInt(playerid, "pInteractID"), strval(inputtext));
  6041. }
  6042. DeletePVar(playerid, "pInteractName");
  6043. DeletePVar(playerid, "pInteractID");
  6044. DeletePVar(playerid, "pInteractGive");
  6045. return cmd_give(playerid, params);
  6046. }
  6047. else
  6048. {
  6049. DeletePVar(playerid, "pInteractName");
  6050. DeletePVar(playerid, "pInteractID");
  6051. DeletePVar(playerid, "pInteractGive");
  6052. }
  6053. }*/
  6054. else if(dialogid == DMRCONFIRM)
  6055. {
  6056. if(response)
  6057. {
  6058. new giveplayerid = GetPVarInt(playerid, "pDMReport");
  6059. SetPVarInt(playerid, "_rAutoM", 5);
  6060. SetPVarInt(playerid, "_rRepID", giveplayerid); format(string, sizeof(string), "You have successfully reported %s.", GetPlayerNameEx(giveplayerid));
  6061. SendClientMessage(playerid, COLOR_WHITE, string);
  6062. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pSMod] == 1) mysql_format(MainPipeline, string, sizeof(string), "INSERT INTO dm_watchdog (id,reporter,timestamp,superwatch) VALUES (%d,%d,%d,1)", GetPlayerSQLId(giveplayerid), GetPlayerSQLId(playerid), gettime());
  6063. else mysql_format(MainPipeline, string, sizeof(string), "INSERT INTO dm_watchdog (id,reporter,timestamp) VALUES (%d,%d,%d)", GetPlayerSQLId(giveplayerid), GetPlayerSQLId(playerid), gettime());
  6064. mysql_tquery(MainPipeline, string, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
  6065. format(string, sizeof(string), "%s(%i) Deathmatching (last shot: %i seconds ago)", GetPlayerNameEx(giveplayerid), giveplayerid, gettime() - ShotPlayer[giveplayerid][playerid]);
  6066. SendReportToQue(playerid, string, 2, 1);
  6067. ShotPlayer[giveplayerid][playerid] = 0;
  6068. SetPVarInt(playerid, "AlertedThisPlayer", giveplayerid);
  6069. SetPVarInt(playerid, "AlertType", 1);
  6070. AlertTime[playerid] = 300;
  6071. }
  6072. else
  6073. {
  6074. SendClientMessage(playerid, COLOR_GRAD2, "DM Report Cancelled");
  6075. }
  6076. DeletePVar(playerid, "pDMReport");
  6077. }
  6078. else if(dialogid == SHOPOBJECT_ORDERID)
  6079. {
  6080. if(response)
  6081. {
  6082. SetPVarString(playerid, "shopobject_orderid", inputtext);
  6083. ShowPlayerDialogEx(playerid, SHOPOBJECT_GIVEPLAYER, DIALOG_STYLE_INPUT, "Shop Objects - player ID", "Please enter the player ID", "OK", "Cancel");
  6084. }
  6085. }
  6086. else if(dialogid == SHOPOBJECT_GIVEPLAYER)
  6087. {
  6088. if(response)
  6089. {
  6090. SetPVarString(playerid, "shopobject_giveplayerid", inputtext);
  6091. new stringg[1024];
  6092. for(new x;x<sizeof(HoldingObjectsShop);x++)
  6093. {
  6094. format(stringg, sizeof(stringg), "%s%s\n", stringg, HoldingObjectsShop[x][holdingmodelname]);
  6095. }
  6096. ShowPlayerDialogEx(playerid, SHOPOBJECT_OBJECTID, DIALOG_STYLE_LIST, "Shop Objects - Object ID", stringg, "Select", "Cancel");
  6097. }
  6098. }
  6099. else if(dialogid == SHOPOBJECT_OBJECTID)
  6100. {
  6101. if(response)
  6102. {
  6103. new giveplayerid;
  6104. new str[MAX_PLAYER_NAME];
  6105. GetPVarString(playerid, "shopobject_giveplayerid", str, MAX_PLAYER_NAME);
  6106. sscanf(str, "u", giveplayerid);
  6107. new stringg[512], icount = GetPlayerToySlots(giveplayerid);
  6108. if(!IsPlayerConnected(giveplayerid) || giveplayerid == INVALID_PLAYER_ID)
  6109. {
  6110. ShowPlayerDialogEx(playerid, SHOPOBJECT_GIVEPLAYER, DIALOG_STYLE_INPUT, "Shop Objects - player ID", "ERROR: That person is not connected \nPlease re-enter the player ID", "OK", "Cancel");
  6111. return 1;
  6112. }
  6113. SetPVarInt(playerid, "shopobject_objectid", listitem);
  6114. for(new x;x<icount;x++)
  6115. {
  6116. new name[24] = "None";
  6117. for(new i;i<sizeof(HoldingObjectsAll);i++)
  6118. {
  6119. if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[giveplayerid][x][ptModelID])
  6120. {
  6121. format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
  6122. }
  6123. }
  6124. format(stringg, sizeof(stringg), "%s(%d) %s (Bone: %s)\n", stringg, x, name, HoldingBones[PlayerToyInfo[giveplayerid][x][ptBone]]);
  6125. }
  6126. ShowPlayerDialogEx(playerid, SHOPOBJECT_TOYSLOT, DIALOG_STYLE_LIST, "Shop Objects - Select a Slot", stringg, "Select", "Cancel");
  6127. }
  6128. }
  6129. else if(dialogid == SHOPOBJECT_TOYSLOT)
  6130. {
  6131. if(response)
  6132. {
  6133. new stringg[128];
  6134. new giveplayerid;
  6135. new str[MAX_PLAYER_NAME];
  6136. GetPVarString(playerid, "shopobject_giveplayerid", str, MAX_PLAYER_NAME);
  6137. sscanf(str, "u", giveplayerid);
  6138. new object = HoldingObjectsShop[GetPVarInt(playerid, "shopobject_objectid")][holdingmodelid];
  6139. new slot = listitem;
  6140. new invoice[64];
  6141. GetPVarString(playerid, "shopobject_orderid", invoice, sizeof(invoice));
  6142. if(!IsPlayerConnected(giveplayerid) || giveplayerid == INVALID_PLAYER_ID)
  6143. {
  6144. ShowPlayerDialogEx(playerid, SHOPOBJECT_GIVEPLAYER, DIALOG_STYLE_INPUT, "Shop Objects - player ID", "ERROR: That person is not connected \nPlease re-enter the player ID", "OK", "Cancel");
  6145. return 1;
  6146. }
  6147. if(!toyCountCheck(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "This player does not have enough free slots");
  6148. format(stringg, sizeof(stringg), "You have given %s object %d in slot %d", GetPlayerNameEx(giveplayerid), object, slot);
  6149. ShowPlayerDialogEx(playerid, SHOPOBJECT_SUCCESS, DIALOG_STYLE_MSGBOX, "Shop Objects - Success", stringg, "OK", "");
  6150. SendClientMessageEx(giveplayerid, COLOR_WHITE, "You have received a new /toys from the shop!");
  6151. format(string, sizeof(string), "[SHOPOBJECTS] %s gave %s(%d) object %d in slot %d - Invoice %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), object, slot, invoice);
  6152. PlayerToyInfo[giveplayerid][slot][ptModelID] = object;
  6153. PlayerToyInfo[giveplayerid][slot][ptBone] = 1;
  6154. PlayerToyInfo[giveplayerid][slot][ptTradable] = 1;
  6155. g_mysql_NewToy(giveplayerid, slot);
  6156. Log("logs/shoplog.log", string);
  6157. }
  6158. }
  6159. else if(dialogid == LISTTOYS_DELETETOY)
  6160. {
  6161. if(response)
  6162. {
  6163. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1)
  6164. {
  6165. return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not authorized to do that");
  6166. }
  6167. new giveplayerid = GetPVarInt(playerid, "listtoys_giveplayerid");
  6168. SetPVarInt(playerid, "listitem_toyslot", listitem);
  6169. format(string, sizeof(string), "Are you sure you want to delete %s's toy (Model ID: %d) from slot %d?", GetPlayerNameEx(giveplayerid), PlayerToyInfo[giveplayerid][listitem][ptModelID], listitem+1);
  6170. ShowPlayerDialogEx(playerid, LISTTOYS_DELETETOYCONFIRM, DIALOG_STYLE_MSGBOX, "Delete Toy - Are you sure?", string, "Yes", "No");
  6171. }
  6172. }
  6173. else if(dialogid == LISTTOYS_DELETETOYCONFIRM)
  6174. {
  6175. if(response)
  6176. {
  6177. new stringg[128], szQuery[128], giveplayerid = GetPVarInt(playerid, "listtoys_giveplayerid"), slot = GetPVarInt(playerid, "listitem_toyslot");
  6178. new object = PlayerToyInfo[giveplayerid][slot][ptModelID];
  6179. if(!IsPlayerConnected(giveplayerid) || giveplayerid == INVALID_PLAYER_ID)
  6180. {
  6181. ShowPlayerDialogEx(playerid, SHOPOBJECT_GIVEPLAYER, DIALOG_STYLE_MSGBOX, "Delete Toy - Player ID", "ERROR: That player is not connected", "OK", "");
  6182. return 1;
  6183. }
  6184. new toys = 99999;
  6185. for(new i; i < 10; i++)
  6186. {
  6187. if(PlayerHoldingObject[giveplayerid][i] == slot)
  6188. {
  6189. toys = i;
  6190. if(IsPlayerAttachedObjectSlotUsed(giveplayerid, toys))
  6191. {
  6192. PlayerHoldingObject[giveplayerid][i] = 0;
  6193. RemovePlayerAttachedObject(giveplayerid, toys);
  6194. }
  6195. break;
  6196. }
  6197. }
  6198. format(stringg, sizeof(stringg), "You have deleted %s's object %d in slot %d", GetPlayerNameEx(giveplayerid), object, slot+1);
  6199. ShowPlayerDialogEx(playerid, SHOPOBJECT_SUCCESS, DIALOG_STYLE_MSGBOX, "Delete Toy - Success", stringg, "OK", "");
  6200. format(stringg, sizeof(stringg), "Admin %s has deleted your toy (obj model: %d) from slot %d.", GetPlayerNameEx(playerid), object, slot);
  6201. SendClientMessageEx(giveplayerid, COLOR_WHITE, stringg);
  6202. format(string, sizeof(string), "[TOYDELETE] %s deleted %s's(%d) object %d in slot %d", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), object, slot);
  6203. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "DELETE FROM `toys` WHERE `id` = %d", PlayerToyInfo[giveplayerid][slot][ptID]);
  6204. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "ii", SENDDATA_THREAD, giveplayerid);
  6205. PlayerToyInfo[giveplayerid][slot][ptModelID] = 0;
  6206. PlayerToyInfo[giveplayerid][slot][ptBone] = 0;
  6207. PlayerToyInfo[giveplayerid][slot][ptSpecial] = 0;
  6208. Log("logs/toydelete.log", string);
  6209. }
  6210. }
  6211. else if(dialogid == MDC_SHOWCRIMES)
  6212. {
  6213. if(response)
  6214. {
  6215. ShowPlayerDialogEx(playerid, MDC_CIVILIANS, DIALOG_STYLE_LIST, "MDC - Logged in | Civilian Options", "*Check Record\n*View Arrest Reports\n*Licenses\n*Warrants\n*Issue Warrant\n*BOLO\n*Create BOLO\n*Delete", "OK", "Cancel");
  6216. }
  6217. }
  6218. else if(dialogid == FLAG_LIST)
  6219. {
  6220. if(response)
  6221. {
  6222. if(!IsPlayerConnected(GetPVarInt(playerid, "viewingflags"))) return SendClientMessage(playerid, -1, "The player whos flags you were managing is no longer connected!");
  6223. if(!GetPVarType(playerid, "ManageFlagID"))
  6224. {
  6225. new stpos = strfind(inputtext, "(");
  6226. new fpos = strfind(inputtext, ")");
  6227. new fid[11];
  6228. strmid(fid, inputtext, stpos+5, fpos);
  6229. SetPVarInt(playerid, "ManageFlagID", strval(fid));
  6230. format(string, sizeof(string), "Managing FlagID: %d", GetPVarInt(playerid, "ManageFlagID"));
  6231. return ShowPlayerDialogEx(playerid, FLAG_LIST, DIALOG_STYLE_LIST, string, "View\nTransfer\nDelete", "Select", "Close");
  6232. }
  6233. else
  6234. {
  6235. if(listitem == -1)
  6236. {
  6237. new target;
  6238. if(sscanf(inputtext, "u", target)) return ShowPlayerDialogEx(playerid, FLAG_LIST, DIALOG_STYLE_INPUT, "FLAG TRANSFER", "Who do you want to transfer the flag to?", "Select", "Cancel");
  6239. if(GetPVarInt(playerid, "viewingflags") == target) return SendClientMessageEx(playerid, COLOR_GRAD2, "ERROR: You cannot transfer to the same person!");
  6240. if(!IsPlayerConnected(target)) return ShowPlayerDialogEx(playerid, FLAG_LIST, DIALOG_STYLE_INPUT, "FLAG TRANSFER - ERROR", "Player is not connected!\nWho do you want to transfer the flag to?", "Select", "Cancel");
  6241. mysql_format(MainPipeline, string, sizeof(string), "SELECT id, flag, issuer, time, type FROM `flags` WHERE `fid` = %i", GetPVarInt(playerid, "ManageFlagID"));
  6242. mysql_tquery(MainPipeline, string, "OnRequestTransferFlag", "iiii", playerid, GetPVarInt(playerid, "ManageFlagID"), target, GetPVarInt(playerid, "viewingflags"));
  6243. }
  6244. if(listitem == 0)
  6245. {
  6246. mysql_format(MainPipeline, string, sizeof(string), "SELECT fid, issuer, flag, time FROM `flags` WHERE fid = %d", GetPVarInt(playerid, "ManageFlagID"));
  6247. mysql_tquery(MainPipeline, string, "FlagQueryFinish", "iii", playerid, GetPVarInt(playerid, "viewingflags"), 0);
  6248. }
  6249. if(listitem == 1)
  6250. {
  6251. ShowPlayerDialogEx(playerid, FLAG_LIST, DIALOG_STYLE_INPUT, "FLAG TRANSFER", "Who do you want to transfer the flag to?", "Select", "Cancel");
  6252. }
  6253. if(listitem == 2)
  6254. {
  6255. mysql_format(MainPipeline, string, sizeof(string), "SELECT flag, issuer, time, type FROM `flags` WHERE `fid` = %i", GetPVarInt(playerid, "ManageFlagID"));
  6256. mysql_tquery(MainPipeline, string, "OnRequestDeleteFlag", "ii", playerid, GetPVarInt(playerid, "ManageFlagID"));
  6257. }
  6258. }
  6259. }
  6260. }
  6261. else if(dialogid == FLAG_DELETE)
  6262. {
  6263. if(response)
  6264. {
  6265. new flagid;
  6266. if(sscanf(inputtext, "d", flagid)) return ShowPlayerDialogEx(playerid, FLAG_DELETE, DIALOG_STYLE_INPUT, "FLAG DELETION", "Which flag would you like to delete?", "Delete Flag", "Close");
  6267. new query[128];
  6268. mysql_format(MainPipeline, query, sizeof(query), "SELECT flag, issuer, time, type FROM `flags` WHERE `fid` = %i", flagid);
  6269. mysql_tquery(MainPipeline, query, "OnRequestDeleteFlag", "ii", playerid, flagid);
  6270. }
  6271. }
  6272. else if(dialogid == FLAG_DELETE2)
  6273. {
  6274. if(response)
  6275. {
  6276. new flagid = GetPVarInt(playerid, "Flag_Delete_ID");
  6277. DeleteFlag(flagid, playerid);
  6278. SendClientMessageEx(playerid, COLOR_YELLOW, " Flag deleted successfully ");
  6279. }
  6280. }
  6281. else if(dialogid == SKIN_LIST)
  6282. {
  6283. if(response)
  6284. {
  6285. new query[128];
  6286. SetPVarInt(playerid, "closetchoiceid", listitem);
  6287. mysql_format(MainPipeline, query, sizeof(query), "SELECT `skinid` FROM `house_closet` WHERE playerid = %d ORDER BY `skinid` ASC", GetPlayerSQLId(playerid));
  6288. mysql_tquery(MainPipeline, query, "SkinQueryFinish", "ii", playerid, Skin_Query_ID);
  6289. }
  6290. }
  6291. else if(dialogid == SKIN_CONFIRM)
  6292. {
  6293. if(response)
  6294. {
  6295. PlayerInfo[playerid][pModel] = GetPVarInt(playerid, "closetskinid");
  6296. DeletePVar(playerid, "closetchoiceid");
  6297. DeletePVar(playerid, "closetskinid");
  6298. }
  6299. else
  6300. {
  6301. SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
  6302. DeletePVar(playerid, "closetchoiceid");
  6303. DeletePVar(playerid, "closetskinid");
  6304. DisplaySkins(playerid);
  6305. }
  6306. }
  6307. else if(dialogid == SKIN_DELETE)
  6308. {
  6309. if(response)
  6310. {
  6311. new query[128];
  6312. SetPVarInt(playerid, "closetchoiceid", listitem);
  6313. mysql_format(MainPipeline, query, sizeof(query), "SELECT `id`, `skinid` FROM `house_closet` WHERE playerid = %d ORDER BY `skinid` ASC", GetPlayerSQLId(playerid));
  6314. mysql_tquery(MainPipeline, query, "SkinQueryFinish", "ii", playerid, Skin_Query_Delete_ID);
  6315. }
  6316. }
  6317. else if(dialogid == SKIN_DELETE2)
  6318. {
  6319. if(response)
  6320. {
  6321. DeleteSkin(GetPVarInt(playerid, "closetskinid"));
  6322. DeletePVar(playerid, "closetchoiceid");
  6323. DeletePVar(playerid, "closetskinid");
  6324. SendClientMessageEx(playerid, COLOR_WHITE, "Clothes removed successfully!");
  6325. }
  6326. else
  6327. {
  6328. DeletePVar(playerid, "closetchoiceid");
  6329. DeletePVar(playerid, "closetskinid");
  6330. DisplaySkins(playerid);
  6331. }
  6332. }
  6333. else if(dialogid == NATION_APP_LIST)
  6334. {
  6335. if(response)
  6336. {
  6337. ShowPlayerDialogEx(playerid, NATION_APP_CHOOSE, DIALOG_STYLE_MSGBOX, "Nation Applications", "What would you like to do with this application?", "Accept", "Deny");
  6338. SetPVarInt(playerid, "Nation_App_ID", listitem);
  6339. }
  6340. }
  6341. else if(dialogid == NATION_APP_CHOOSE)
  6342. {
  6343. if(response)
  6344. {
  6345. switch(arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance])
  6346. {
  6347. case 1: mysql_tquery(MainPipeline, "SELECT `id`, `playerid`, `name` FROM `nation_queue` WHERE `nation` = 0 AND `status` = 1 ORDER BY `id` ASC", "NationAppFinish", "ii", playerid, AcceptApp);
  6348. case 2: mysql_tquery(MainPipeline, "SELECT `id`, `playerid`, `name` FROM `nation_queue` WHERE `nation` = 1 AND `status` = 1 ORDER BY `id` ASC", "NationAppFinish", "ii", playerid, AcceptApp);
  6349. }
  6350. }
  6351. else
  6352. {
  6353. switch(arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance])
  6354. {
  6355. case 1: mysql_tquery(MainPipeline, "SELECT `id`, `playerid`, `name` FROM `nation_queue` WHERE `nation` = 0 AND `status` = 1 ORDER BY `id` ASC", "NationAppFinish", "ii", playerid, DenyApp);
  6356. case 2: mysql_tquery(MainPipeline, "SELECT `id`, `playerid`, `name` FROM `nation_queue` WHERE `nation` = 1 AND `status` = 1 ORDER BY `id` ASC", "NationAppFinish", "ii", playerid, DenyApp);
  6357. }
  6358. }
  6359. }
  6360. else if(dialogid == DIALOG_911MENU)
  6361. {
  6362. if(response)
  6363. {
  6364. switch(listitem)
  6365. {
  6366. case 0: ShowPlayerDialogEx(playerid, DIALOG_911EMERGENCY, DIALOG_STYLE_INPUT, "911 Emergency Services", "Please describe the emergency.", "Enter", "End Call");
  6367. case 1: ShowPlayerDialogEx(playerid, DIALOG_911MEDICAL, DIALOG_STYLE_INPUT, "911 Emergency Services", "Please describe your medical emergency.", "Enter", "End Call");
  6368. case 2: ShowPlayerDialogEx(playerid, DIALOG_911POLICE, DIALOG_STYLE_INPUT, "911 Emergency Services", "Please describe why you require police assistance.", "Enter", "End Call");
  6369. case 3: ShowPlayerDialogEx(playerid, DIALOG_911TOWING, DIALOG_STYLE_INPUT, "911 Emergency Services", "Please describe why you require towing services.", "Enter", "End Call");
  6370. case 4: {
  6371. szMiscArray[0] = 0;
  6372. new icount = GetPlayerVehicleSlots(playerid);
  6373. new szCarLocation[MAX_ZONE_NAME];
  6374. for(new i, iModelID; i < icount; i++)
  6375. {
  6376. if((iModelID = PlayerVehicleInfo[playerid][i][pvModelId] - 400) >= 0)
  6377. {
  6378. Get3DZone(PlayerVehicleInfo[playerid][i][pvPosX], PlayerVehicleInfo[playerid][i][pvPosY], PlayerVehicleInfo[playerid][i][pvPosZ], szCarLocation, sizeof(szCarLocation));
  6379. if(PlayerVehicleInfo[playerid][i][pvImpounded]) {
  6380. format(szMiscArray, sizeof(szMiscArray), "%s\n%s (impounded) | Location: DMV", szMiscArray, VehicleName[iModelID]);
  6381. }
  6382. else if(PlayerVehicleInfo[playerid][i][pvDisabled]) {
  6383. format(szMiscArray, sizeof(szMiscArray), "%s\n%s (disabled) | Location: Unknown", szMiscArray, VehicleName[iModelID]);
  6384. }
  6385. else if(!PlayerVehicleInfo[playerid][i][pvSpawned]) {
  6386. format(szMiscArray, sizeof(szMiscArray), "%s\n%s (stored) | Location: %s", szMiscArray, VehicleName[iModelID], szCarLocation);
  6387. }
  6388. else {
  6389. if(PlayerVehicleInfo[playerid][i][pvAlarmTriggered]) format(szMiscArray, sizeof(szMiscArray), "%s\n%s (alarm triggered) | Location: %s", szMiscArray, VehicleName[iModelID], szCarLocation);
  6390. else format(szMiscArray, sizeof(szMiscArray), "%s\n%s | Location: %s", szMiscArray, VehicleName[iModelID], szCarLocation);
  6391. }
  6392. }
  6393. }
  6394. ShowPlayerDialogEx(playerid, DIALOG_911PICKLOCK, DIALOG_STYLE_LIST, "Vehicle Burglary Report", szMiscArray, "Track", "Cancel");
  6395. }
  6396. case 5: ShowPlayerDialogEx(playerid, DIALOG_911FIRE, DIALOG_STYLE_INPUT, "911 Emergency Services", "Please describe why you require the fire bridgade.", "Enter", "End Call");
  6397. }
  6398. }
  6399. }
  6400. else if(dialogid == DIALOG_911EMERGENCY)
  6401. {
  6402. if(response)
  6403. {
  6404. new zone[MAX_ZONE_NAME], mainzone[MAX_ZONE_NAME];
  6405. if(strlen(inputtext) < 4) return ShowPlayerDialogEx(playerid, DIALOG_911EMERGENCY, DIALOG_STYLE_INPUT, "911 Emergency Services", "Sorry, I don't quite understand. What is the emergency you are experiencing?", "Enter", "End Call");
  6406. else
  6407. {
  6408. GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
  6409. GetPlayerMainZone(playerid, mainzone, MAX_ZONE_NAME);
  6410. SendCallToQueue(playerid, inputtext, zone, mainzone, 0);
  6411. SetPVarInt(playerid, "Has911Call", 1);
  6412. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Dispatch: We have alerted all units in the area.");
  6413. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Thank you for reporting this incident");
  6414. }
  6415. }
  6416. }
  6417. else if(dialogid == DIALOG_911MEDICAL)
  6418. {
  6419. if(response)
  6420. {
  6421. new zone[MAX_ZONE_NAME], mainzone[MAX_ZONE_NAME];
  6422. if(strlen(inputtext) < 4) return ShowPlayerDialogEx(playerid, DIALOG_911MEDICAL, DIALOG_STYLE_INPUT, "911 Emergency Services", "Sorry, I don't quite understand. What is the medical emergency you are experiencing?", "Enter", "End Call");
  6423. else
  6424. {
  6425. GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
  6426. GetPlayerMainZone(playerid, mainzone, MAX_ZONE_NAME);
  6427. SendCallToQueue(playerid, inputtext, zone, mainzone, 1);
  6428. SetPVarInt(playerid, "Has911Call", 1);
  6429. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Dispatch: We have alerted all units in the area.");
  6430. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Thank you for reporting this incident");
  6431. }
  6432. }
  6433. }
  6434. else if(dialogid == DIALOG_911POLICE)
  6435. {
  6436. if(response)
  6437. {
  6438. new zone[MAX_ZONE_NAME], mainzone[MAX_ZONE_NAME];
  6439. if(strlen(inputtext) < 4) return ShowPlayerDialogEx(playerid, DIALOG_911POLICE, DIALOG_STYLE_INPUT, "911 Emergency Services", "Sorry, I don't quite understand. Why are you needing police assistance?", "Enter", "End Call");
  6440. else
  6441. {
  6442. GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
  6443. GetPlayerMainZone(playerid, mainzone, MAX_ZONE_NAME);
  6444. SendCallToQueue(playerid, inputtext, zone, mainzone, 2);
  6445. SetPVarInt(playerid, "Has911Call", 1);
  6446. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Dispatch: We have alerted all units in the area.");
  6447. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Thank you for reporting this incident");
  6448. }
  6449. }
  6450. }
  6451. else if(dialogid == DIALOG_911TOWING)
  6452. {
  6453. if(response)
  6454. {
  6455. new zone[MAX_ZONE_NAME], mainzone[MAX_ZONE_NAME];
  6456. if(strlen(inputtext) < 4) return ShowPlayerDialogEx(playerid, DIALOG_911TOWING, DIALOG_STYLE_INPUT, "911 Emergency Services", "Sorry, I don't quite understand. Why do you need towing assistance?", "Enter", "End Call");
  6457. else
  6458. {
  6459. GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
  6460. GetPlayerMainZone(playerid, mainzone, MAX_ZONE_NAME);
  6461. SendCallToQueue(playerid, inputtext, zone, mainzone, 3);
  6462. SetPVarInt(playerid, "Has911Call", 1);
  6463. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Dispatch: We have alerted all units in the area.");
  6464. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Thank you for reporting this incident");
  6465. }
  6466. }
  6467. }
  6468. else if(dialogid == DIALOG_911FIRE)
  6469. {
  6470. if(response)
  6471. {
  6472. new zone[MAX_ZONE_NAME], mainzone[MAX_ZONE_NAME];
  6473. if(strlen(inputtext) < 4) return ShowPlayerDialogEx(playerid, DIALOG_911FIRE, DIALOG_STYLE_INPUT, "911 Emergency Services", "Sorry, I don't quite understand. Why do you need assistance?", "Enter", "End Call");
  6474. else
  6475. {
  6476. GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
  6477. GetPlayerMainZone(playerid, mainzone, MAX_ZONE_NAME);
  6478. SendCallToQueue(playerid, inputtext, zone, mainzone, 5);
  6479. SetPVarInt(playerid, "Has911Call", 1);
  6480. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Dispatch: We have alerted all units in the area.");
  6481. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Thank you for reporting this incident");
  6482. }
  6483. }
  6484. }
  6485. else if(dialogid == DIALOG_HOTLINE)
  6486. {
  6487. if(response)
  6488. {
  6489. new zone[MAX_ZONE_NAME], mainzone[MAX_ZONE_NAME];
  6490. if(strlen(inputtext) < 4) {
  6491. if(GetPVarType(playerid, "BUSICALL")) {
  6492. new i = GetPVarInt(playerid, "BUSICALL");
  6493. format(szMiscArray, sizeof(szMiscArray), "%s's Landline | %d", Businesses[i][bName], Businesses[i][bPhoneNr]);
  6494. }
  6495. else {
  6496. new i = GetPVarInt(playerid, "GRPCALL");
  6497. format(szMiscArray, sizeof(szMiscArray), "{%s}%s's Hotline", Group_NumToDialogHex(arrGroupData[i][g_hDutyColour]), arrGroupData[i][g_szGroupName]);
  6498. }
  6499. return ShowPlayerDialogEx(playerid, DIALOG_HOTLINE, DIALOG_STYLE_INPUT, szMiscArray, "I'm sorry, may I have a bit more information.", "Enter", "End Call");
  6500. }
  6501. else
  6502. {
  6503. GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
  6504. GetPlayerMainZone(playerid, mainzone, MAX_ZONE_NAME);
  6505. if(GetPVarType(playerid, "GRPCALL")) SendCallToQueue(playerid, inputtext, zone, mainzone, 6);
  6506. if(GetPVarType(playerid, "BUSICALL")) SendCallToQueue(playerid, inputtext, zone, mainzone, 7);
  6507. SetPVarInt(playerid, "Has911Call", 1);
  6508. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "Autoanswer: Thank you for calling our land line.");
  6509. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "We will be with you shortly.");
  6510. }
  6511. }
  6512. }
  6513. else if(dialogid == DIALOG_SUSPECTMENU)
  6514. {
  6515. if(response)
  6516. {
  6517. if(strcmp(inputtext, "Other (Not Listed)", true) == 0)
  6518. {
  6519. return ShowPlayerDialogEx(playerid, DIALOG_SUSPECTMENU, DIALOG_STYLE_INPUT, "Specify a crime", "Please specify a crime", "Submit", "Cancel");
  6520. }
  6521. if(strlen(inputtext) <= 3)
  6522. {
  6523. return ShowPlayerCrimeDialog(playerid);
  6524. }
  6525. if(inputtext[0] == '-')
  6526. {
  6527. return ShowPlayerCrimeDialog(playerid);
  6528. }
  6529. new iTargetID = GetPVarInt(playerid, "suspect_TargetID");
  6530. new
  6531. szMessage[128];
  6532. ++PlayerInfo[iTargetID][pCrimes];
  6533. new crimeid = -1;
  6534. for(new i; i < sizeof(SuspectCrimes); i++)
  6535. {
  6536. if(strcmp(inputtext, SuspectCrimes[i]) == 0)
  6537. {
  6538. crimeid = i;
  6539. break;
  6540. }
  6541. }
  6542. if(crimeid != -1)
  6543. {
  6544. PlayerInfo[iTargetID][pWantedLevel] += SuspectCrimeInfo[crimeid][1];
  6545. }
  6546. else PlayerInfo[iTargetID][pWantedLevel] += 1;
  6547. if(PlayerInfo[iTargetID][pWantedLevel] > 6)
  6548. {
  6549. PlayerInfo[iTargetID][pWantedLevel] = 6;
  6550. }
  6551. SetPlayerWantedLevel(iTargetID, PlayerInfo[iTargetID][pWantedLevel]);
  6552. if(PlayerInfo[iTargetID][pConnectHours] < 32)
  6553. {
  6554. PlayerInfo[iTargetID][pWantedJailTime] += SuspectCrimeInfo[crimeid][2]/10;
  6555. PlayerInfo[iTargetID][pWantedJailFine] += SuspectCrimeInfo[crimeid][3]/10;
  6556. }
  6557. else
  6558. {
  6559. PlayerInfo[iTargetID][pWantedJailTime] += SuspectCrimeInfo[crimeid][2];
  6560. PlayerInfo[iTargetID][pWantedJailFine] += SuspectCrimeInfo[crimeid][3];
  6561. }
  6562. new szCountry[10], szCrime[128];
  6563. if(arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance] == 1)
  6564. {
  6565. format(szCountry, sizeof(szCountry), "[SA] ");
  6566. }
  6567. else if(arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance] == 2)
  6568. {
  6569. format(szCountry, sizeof(szCountry), "[NE] ");
  6570. }
  6571. strcat(szCrime, szCountry);
  6572. strcat(szCrime, inputtext);
  6573. AddCrime(playerid, iTargetID, szCrime);
  6574. format(szMessage, sizeof(szMessage), "You've commited a crime ( %s ). Reporter: %s.", szCrime, GetPlayerNameEx(playerid));
  6575. SendClientMessageEx(iTargetID, COLOR_LIGHTRED, szMessage);
  6576. format(szMessage, sizeof(szMessage), "Current wanted level: %d", PlayerInfo[iTargetID][pWantedLevel]);
  6577. SendClientMessageEx(iTargetID, COLOR_YELLOW, szMessage);
  6578. foreach(new i: Player)
  6579. {
  6580. if(IsACop(i) && arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance] == arrGroupData[PlayerInfo[i][pMember]][g_iAllegiance]) {
  6581. format(szMessage, sizeof(szMessage), "HQ: All units APB (reporter: %s)",GetPlayerNameEx(playerid));
  6582. SendClientMessageEx(i, TEAM_BLUE_COLOR, szMessage);
  6583. format(szMessage, sizeof(szMessage), "HQ: Crime: %s, suspect: %s", szCrime, GetPlayerNameEx(iTargetID));
  6584. SendClientMessageEx(i, TEAM_BLUE_COLOR, szMessage);
  6585. }
  6586. }
  6587. PlayerInfo[iTargetID][pDefendTime] = 60;
  6588. }
  6589. }
  6590. else if(dialogid == DIALOG_REPORTMENU)
  6591. {
  6592. if(response)
  6593. {
  6594. switch(listitem)
  6595. {
  6596. case 0: //Deathmatch
  6597. {
  6598. if(PlayerInfo[playerid][pJailTime] > 0) {
  6599. SendClientMessage(playerid, COLOR_GREY, "You can't report while in prison.");
  6600. }
  6601. else {
  6602. ShowPlayerDialogEx(playerid, DIALOG_REPORTDM, DIALOG_STYLE_INPUT, "Report player - Deathmatch", "Enter the name or ID of the player.", "Enter", "Cancel");
  6603. }
  6604. }
  6605. case 1: //Falling
  6606. {
  6607. if(gettime() - LastShot[playerid] < 20)
  6608. {
  6609. SendClientMessageEx(playerid, COLOR_GREY, "You have been hurt in the last 20 seconds, abusing this system will result in a temporary ban.");
  6610. }
  6611. else
  6612. {
  6613. new
  6614. Message[128];
  6615. TogglePlayerControllable(playerid, 0);
  6616. SetPVarInt(playerid, "IsFrozen", 1);
  6617. SetPVarInt(playerid, "_rAutoM", 5);
  6618. SetPVarInt(playerid, "_rRepID", playerid);
  6619. format(Message, sizeof(Message), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) has been frozen. (Falling Report)", GetPlayerNameEx(playerid), playerid);
  6620. ABroadCast(COLOR_YELLOW, Message, 2);
  6621. SendReportToQue(playerid, "Falling (Player Frozen)", 2, GetPlayerPriority(playerid));
  6622. SendClientMessageEx(playerid, COLOR_WHITE, "A report has been sent to the available admins, you have been frozen.");
  6623. }
  6624. }
  6625. case 2: //Hacking
  6626. {
  6627. ShowPlayerDialogEx(playerid, DIALOG_REPORTHACK, DIALOG_STYLE_INPUT, "Report player - Hacking", "Enter the name or ID of the player.", "Enter", "Cancel");
  6628. }
  6629. case 3: //Chicken Running
  6630. {
  6631. ShowPlayerDialogEx(playerid, DIALOG_REPORTCR, DIALOG_STYLE_INPUT, "Report player - Chicken Running", "Enter the name or ID of the player.", "Enter", "Cancel");
  6632. }
  6633. case 4: //Car Ramming
  6634. {
  6635. ShowPlayerDialogEx(playerid, DIALOG_REPORTCARRAM, DIALOG_STYLE_INPUT, "Report player - Car Ramming", "Enter the name or ID of the player.", "Enter", "Cancel");
  6636. }
  6637. case 5: //Power Gaming
  6638. {
  6639. ShowPlayerDialogEx(playerid, DIALOG_REPORTPG, DIALOG_STYLE_INPUT, "Report player - Power Gaming", "Enter the name or ID of the player.", "Enter", "Cancel");
  6640. }
  6641. case 6: //Meta Gaming
  6642. {
  6643. ShowPlayerDialogEx(playerid, DIALOG_REPORTMG, DIALOG_STYLE_INPUT, "Report player - Meta Gaming", "Enter the name or ID of the player.", "Enter", "Cancel");
  6644. }
  6645. case 7: //Gun Discharge Exploits
  6646. {
  6647. ShowPlayerDialogEx(playerid, DIALOG_REPORTGDE, DIALOG_STYLE_INPUT, "Report player - Gun Discharge Exploits", "Enter the name or ID of the player.", "Enter", "Cancel");
  6648. }
  6649. case 8: //Spamming
  6650. {
  6651. ShowPlayerDialogEx(playerid, DIALOG_REPORTSPAM, DIALOG_STYLE_INPUT, "Report player - Spamming", "Enter the name or ID of the player.", "Enter", "Cancel");
  6652. }
  6653. case 9: //Money Farming
  6654. {
  6655. ShowPlayerDialogEx(playerid, DIALOG_REPORTMF, DIALOG_STYLE_INPUT, "Report player - Money Farming", "Enter the name or ID of the player.", "Enter", "Cancel");
  6656. }
  6657. case 10: //Ban Evader
  6658. {
  6659. ShowPlayerDialogEx(playerid, DIALOG_REPORTBANEVADE, DIALOG_STYLE_INPUT, "Report player - Ban Evader", "Enter the name or ID of the player.", "Enter", "Cancel");
  6660. }
  6661. case 11: //General Exploits
  6662. {
  6663. ShowPlayerDialogEx(playerid, DIALOG_REPORTGE, DIALOG_STYLE_INPUT, "Report player - General Exploits", "Enter the name or ID of the player.", "Enter", "Cancel");
  6664. }
  6665. case 12: //Releasing Hitman Names
  6666. {
  6667. ShowPlayerDialogEx(playerid, DIALOG_REPORTRHN, DIALOG_STYLE_INPUT, "Report player - Releasing Hitman Names", "Enter the name or ID of the player.", "Enter", "Cancel");
  6668. }
  6669. case 13: //Running/Swimming Man Exploit
  6670. {
  6671. ShowPlayerDialogEx(playerid, DIALOG_REPORTRSE, DIALOG_STYLE_INPUT, "Report player - Running/Swimming Man Exploit", "Enter the name or ID of the player.", "Enter", "Cancel");
  6672. }
  6673. case 14: //Car Surfing
  6674. {
  6675. ShowPlayerDialogEx(playerid, DIALOG_REPORTCARSURF, DIALOG_STYLE_INPUT, "Report player - Car Surfing", "Enter the name or ID of the player.", "Enter", "Cancel");
  6676. }
  6677. case 15: //NonRp Behavior
  6678. {
  6679. ShowPlayerDialogEx(playerid, DIALOG_REPORTNRPB, DIALOG_STYLE_INPUT, "Report player - NonRP Behavior", "Enter the name or ID of the player.", "Enter", "Cancel");
  6680. }
  6681. case 16: //Next Page
  6682. {
  6683. ShowPlayerDialogEx(playerid, DIALOG_REPORTMENU2, DIALOG_STYLE_LIST, "Report Menu [2/2]", "Revenge Killing\nOOC Hit\nServer Advertising\nNonRP Name\nOther/Freetext (PVIP Only)\nHouse Move\nAppeal Admin Action\nPrize Claim\nShop Issue\nNot Listed Here\nRequest CA\nRequest Unmute\nPrevious Page","Select", "Exit");
  6684. }
  6685. }
  6686. }
  6687. }
  6688. else if(dialogid == DIALOG_REPORTMENU2)
  6689. {
  6690. if(response)
  6691. {
  6692. switch(listitem)
  6693. {
  6694. case 0: //Revenge Killing
  6695. {
  6696. ShowPlayerDialogEx(playerid, DIALOG_REPORTRK, DIALOG_STYLE_INPUT, "Report player - Revenge Killing", "Enter the name or ID of the player.", "Enter", "Cancel");
  6697. }
  6698. case 1: //OOC Hit
  6699. {
  6700. ShowPlayerDialogEx(playerid, DIALOG_NOTHING, DIALOG_STYLE_MSGBOX, "OOC Hit", "{FFFFFF}OOC Hits are to be handled on the forums. (Player Complaint)\n\n ng-gaming.net/forums", "Close", "");
  6701. }
  6702. case 2: //Server Advertising
  6703. {
  6704. ShowPlayerDialogEx(playerid, DIALOG_REPORTSA, DIALOG_STYLE_INPUT, "Report player - Server Advertising", "Enter the name or ID of the player.", "Enter", "Cancel");
  6705. }
  6706. case 3: //Non RP Name
  6707. {
  6708. ShowPlayerDialogEx(playerid, DIALOG_REPORTNRPN, DIALOG_STYLE_INPUT, "Report player - Non-RP Name", "Enter the name or ID of the player.", "Enter", "Cancel");
  6709. }
  6710. case 4: //Other/Freetext (PVip Only!!)
  6711. {
  6712. if(PlayerInfo[playerid][pDonateRank] >= 4) {
  6713. ShowPlayerDialogEx(playerid, DIALOG_REPORTFREE, DIALOG_STYLE_INPUT,"Other / Free Text","Enter the message you want to send to the admin team.","Send","Cancel");
  6714. }
  6715. else {
  6716. SendClientMessageEx(playerid, COLOR_GREY, "This is a Platinum VIP feature only.");
  6717. }
  6718. }
  6719. case 5: //House Move
  6720. {
  6721. SendReportToQue(playerid, "House Move", 4, GetPlayerPriority(playerid));
  6722. SendClientMessageEx(playerid, COLOR_WHITE, "Your house move request has been sent to the current available admins.");
  6723. }
  6724. case 6: //Appeal Admin Action
  6725. {
  6726. if(gettime() < GetPVarInt(playerid, "_rAppeal")) return SendClientMessageEx(playerid, COLOR_GREY, "You need to wait at least 60 seconds before appealing an admin action.");
  6727. SendReportToQue(playerid,"Appeal Admin Action", 4, GetPlayerPriority(playerid));
  6728. SendClientMessageEx(playerid, COLOR_WHITE, "Your Appeal Admin Action report has been sent to the current available admins.");
  6729. }
  6730. case 7: //Prize Claim
  6731. {
  6732. if(PlayerInfo[playerid][pFlagged] == 0) {
  6733. SendClientMessageEx(playerid, COLOR_GREY, "You do not have any prize claims pending. (Not Flagged)");
  6734. return 1;
  6735. }
  6736. else
  6737. {
  6738. SendReportToQue(playerid, "Prize Claim", 4, 5);
  6739. SendClientMessageEx(playerid, COLOR_WHITE, "Your Prize Claim report has been sent to the current available admins.");
  6740. }
  6741. }
  6742. case 8: //Shop Issue
  6743. {
  6744. ShowPlayerDialogEx(playerid, DIALOG_NOTHING, DIALOG_STYLE_MSGBOX, "Shop Issue", "{FFFFFF}You can use /shophelp for additional information.", "Close", "");
  6745. }
  6746. case 9: //Not Listed Here
  6747. {
  6748. ShowPlayerDialogEx(playerid, DIALOG_REPORTNOTLIST, DIALOG_STYLE_INPUT,"Not Listed","Using this category will receive a slower response from the admin team, please consider using the most appropriate category for a faster response.","Send","Cancel");
  6749. }
  6750. case 10: // Request CA
  6751. {
  6752. if(PlayerInfo[playerid][pRHMutes] >= 4 || PlayerInfo[playerid][pRHMuteTime] > 0) return SendClientMessageEx(playerid, COLOR_GREY, "You are currently banned from requesting help.");
  6753. if(JustReported[playerid] > 0) return SendClientMessageEx(playerid, COLOR_GREY, "Wait 10 seconds after sending a next request!");
  6754. JustReported[playerid]=10;
  6755. format(string, sizeof(string), "** %s(%i) is requesting help, reason: Report Menu. (type /accepthelp %i)", GetPlayerNameEx(playerid), playerid, playerid);
  6756. SendDutyAdvisorMessage(TEAM_AZTECAS_COLOR, string);
  6757. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You have requested help from a Advisor, wait for a reply.");
  6758. SetPVarInt( playerid, "COMMUNITY_ADVISOR_REQUEST", 1 );
  6759. SetPVarInt( playerid, "HelpTime", 5);
  6760. SetPVarString( playerid, "HelpReason", "Report Menu");
  6761. SetTimerEx( "HelpTimer", 60000, 0, "d", playerid);
  6762. }
  6763. case 11: //Request Unmute
  6764. {
  6765. if(gettime()-GetPVarInt(playerid, "UnmuteTime") < 300) {
  6766. SendClientMessageEx(playerid, COLOR_GREY, "You must wait at least 5 minutes before requesting an unmute.");
  6767. return 1;
  6768. }
  6769. ShowPlayerDialogEx(playerid, DIALOG_UNMUTE, DIALOG_STYLE_LIST, "Requesting Unmute", "Ad Unmute\nNewbie Unmute", "Select", "Exit");
  6770. }
  6771. case 12: //Previous Page
  6772. {
  6773. ShowPlayerDialogEx(playerid, DIALOG_REPORTMENU, DIALOG_STYLE_LIST, "Report Menu [1/2]", "Deathmatch\nHacking\nRevenge Killing\nChicken Running\nCar Ramming\nPower Gaming\nMeta Gaming\nGun Discharge Exploits (QS/CS)\nSpamming\nMoney Farming\nBan Evader\nGeneral Exploits\nReleasing Hitman Names\nRunning Man Exploiter\nCar Surfing\nNonRP Behavior\nNext Page","Select", "Exit");
  6774. }
  6775. }
  6776. }
  6777. }
  6778. else if(dialogid == DIALOG_UNMUTE)
  6779. {
  6780. if(response)
  6781. {
  6782. switch(listitem)
  6783. {
  6784. case 0:
  6785. {
  6786. if(PlayerInfo[playerid][pADMute] == 0) return SendClientMessageEx(playerid, COLOR_GREY, "You are not muted from /ads.");
  6787. SetPVarInt(playerid, "_rAutoM", 1);
  6788. SendReportToQue(playerid, "Ad Unmute", 2, GetPlayerPriority(playerid));
  6789. SendClientMessageEx(playerid, COLOR_WHITE, "Your report has been sent to the current available admins.");
  6790. }
  6791. case 1:
  6792. {
  6793. if(PlayerInfo[playerid][pNMute] == 0) return SendClientMessageEx(playerid, COLOR_GREY, "You are not muted from /newb.");
  6794. SetPVarInt(playerid, "_rAutoM", 2);
  6795. SendReportToQue(playerid, "Newbie Unmute", 2, GetPlayerPriority(playerid));
  6796. SendClientMessageEx(playerid, COLOR_WHITE, "Your report has been sent to the current available admins.");
  6797. }
  6798. }
  6799. }
  6800. }
  6801. else if(dialogid == DIALOG_REPORTDM)
  6802. {
  6803. if(response)
  6804. {
  6805. new
  6806. Player;
  6807. if(sscanf(inputtext, "u", Player)) {
  6808. ShowPlayerDialogEx(playerid, DIALOG_REPORTDM, DIALOG_STYLE_INPUT, "Report player - Deathmatch", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  6809. return 1;
  6810. }
  6811. if(!IsPlayerConnected(Player)) {
  6812. ShowPlayerDialogEx(playerid, DIALOG_REPORTDM, DIALOG_STYLE_INPUT, "Report player - Deathmatch", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  6813. }
  6814. if(PlayerInfo[playerid][pDMRMuted] != 0) return SendClientMessage(playerid, COLOR_GRAD2, "You are blocked from submitting DM reports.");
  6815. //if(PlayerInfo[playerid][pLevel] < 2) return SendClientMessage(playerid, COLOR_GRAD2, "You must be level 2 to use this command.");
  6816. if(playerid == Player) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself!");
  6817. if(PlayerInfo[Player][pAdmin] >= 2 && PlayerInfo[Player][pTogReports] != 1) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on admins!");
  6818. if(gettime() - ShotPlayer[Player][playerid] < 300)
  6819. {
  6820. SetPVarInt(playerid, "pDMReport", Player);
  6821. ShowPlayerDialogEx(playerid, DMRCONFIRM, DIALOG_STYLE_MSGBOX, "DM Report", "You personally witnessed the reported player death matching within the last 60 seconds. Abuse of this command could result in a temporary ban.", "Confirm", "Cancel");
  6822. }
  6823. else
  6824. {
  6825. SendClientMessage(playerid, COLOR_WHITE, "You have not been shot by that person or have already reported them in the last 5 minutes.");
  6826. SendClientMessage(playerid, COLOR_WHITE, "As a reminder, abuse of this system could lead to punishment up to a temporary ban.");
  6827. }
  6828. }
  6829. }
  6830. else if(dialogid == DIALOG_REPORTRK)
  6831. {
  6832. if(response)
  6833. {
  6834. new
  6835. Player,
  6836. Message[128];
  6837. if(sscanf(inputtext, "u", Player)) {
  6838. ShowPlayerDialogEx(playerid, DIALOG_REPORTRK, DIALOG_STYLE_INPUT, "Report player - Revenge Killing", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  6839. return 1;
  6840. }
  6841. else if(!IsPlayerConnected(Player)) {
  6842. ShowPlayerDialogEx(playerid, DIALOG_REPORTRK, DIALOG_STYLE_INPUT, "Report player - Revenge Killing", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  6843. }
  6844. else if(Player == playerid) {
  6845. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  6846. }
  6847. else {
  6848. SetPVarInt(playerid, "_rAutoM", 4);
  6849. SetPVarInt(playerid, "_rRepID", Player);
  6850. format(Message, sizeof(Message), "%s(%i) Revenge Killing", GetPlayerNameEx(Player), Player);
  6851. SendReportToQue(playerid, Message, 2, GetPlayerPriority(playerid));
  6852. format(Message, sizeof(Message), "You have submitted a report on %s for Revenge Killing. It has been sent to all available admins.", GetPlayerNameEx(Player));
  6853. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  6854. SetPVarInt(playerid, "AlertedThisPlayer", Player);
  6855. SetPVarInt(playerid, "AlertType", 2);
  6856. AlertTime[playerid] = 300;
  6857. }
  6858. }
  6859. }
  6860. else if(dialogid == DIALOG_REPORTCR)
  6861. {
  6862. if(response)
  6863. {
  6864. new
  6865. Player,
  6866. Message[128];
  6867. if(sscanf(inputtext, "u", Player)) {
  6868. ShowPlayerDialogEx(playerid, DIALOG_REPORTCR, DIALOG_STYLE_INPUT, "Report player - Chicken Running", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  6869. return 1;
  6870. }
  6871. else if(!IsPlayerConnected(Player)) {
  6872. ShowPlayerDialogEx(playerid, DIALOG_REPORTCR, DIALOG_STYLE_INPUT, "Report player - Chicken Running", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  6873. }
  6874. else if(Player == playerid) {
  6875. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  6876. }
  6877. else {
  6878. SetPVarInt(playerid, "_rAutoM", 5);
  6879. SetPVarInt(playerid, "_rRepID", Player);
  6880. format(Message, sizeof(Message), "%s(%i) Chicken Running", GetPlayerNameEx(Player), Player);
  6881. SendReportToQue(playerid,Message, 2, GetPlayerPriority(playerid));
  6882. format(Message, sizeof(Message), "You have submitted a report on %s for Chicken Running. It has been sent to all available admins.", GetPlayerNameEx(Player));
  6883. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  6884. }
  6885. }
  6886. }
  6887. else if(dialogid == DIALOG_REPORTCARRAM)
  6888. {
  6889. if(response)
  6890. {
  6891. new
  6892. Player,
  6893. Message[128];
  6894. if(sscanf(inputtext, "u", Player)) {
  6895. ShowPlayerDialogEx(playerid, DIALOG_REPORTCARRAM, DIALOG_STYLE_INPUT, "Report player - Car Ramming", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  6896. return 1;
  6897. }
  6898. else if(!IsPlayerConnected(Player)) {
  6899. ShowPlayerDialogEx(playerid, DIALOG_REPORTCARRAM, DIALOG_STYLE_INPUT, "Report player - Car Ramming", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  6900. }
  6901. else if(Player == playerid) {
  6902. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  6903. }
  6904. else {
  6905. SetPVarInt(playerid, "_rAutoM", 5);
  6906. SetPVarInt(playerid, "_rRepID", Player);
  6907. format(Message, sizeof(Message), "%s(%i) Car Ramming", GetPlayerNameEx(Player), Player);
  6908. SendReportToQue(playerid,Message, 2, GetPlayerPriority(playerid));
  6909. format(Message, sizeof(Message), "You have submitted a report on %s for Car Ramming. It has been sent to all available admins.", GetPlayerNameEx(Player));
  6910. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  6911. SetPVarInt(playerid, "AlertedThisPlayer", Player);
  6912. SetPVarInt(playerid, "AlertType", 4);
  6913. AlertTime[playerid] = 300;
  6914. }
  6915. }
  6916. }
  6917. else if(dialogid == DIALOG_REPORTPG)
  6918. {
  6919. if(response)
  6920. {
  6921. new
  6922. Player,
  6923. Message[128];
  6924. if(sscanf(inputtext, "u", Player)) {
  6925. ShowPlayerDialogEx(playerid, DIALOG_REPORTPG, DIALOG_STYLE_INPUT, "Report player - Power Gaming", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  6926. return 1;
  6927. }
  6928. else if(!IsPlayerConnected(Player)) {
  6929. ShowPlayerDialogEx(playerid, DIALOG_REPORTPG, DIALOG_STYLE_INPUT, "Report player - Power Gaming", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  6930. }
  6931. else if(Player == playerid) {
  6932. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  6933. }
  6934. else {
  6935. SetPVarInt(playerid, "_rAutoM", 5);
  6936. SetPVarInt(playerid, "_rRepID", Player);
  6937. format(Message, sizeof(Message), "%s(%i) Power Gaming", GetPlayerNameEx(Player), Player);
  6938. SendReportToQue(playerid,Message, 2, GetPlayerPriority(playerid));
  6939. format(Message, sizeof(Message), "You have submitted a report on %s for Power Gaming. It has been sent to all available admins.", GetPlayerNameEx(Player));
  6940. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  6941. }
  6942. }
  6943. }
  6944. else if(dialogid == DIALOG_REPORTMG)
  6945. {
  6946. if(response)
  6947. {
  6948. new
  6949. Player,
  6950. Message[128];
  6951. if(sscanf(inputtext, "u", Player)) {
  6952. ShowPlayerDialogEx(playerid, DIALOG_REPORTMG, DIALOG_STYLE_INPUT, "Report player - Meta Gaming", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  6953. return 1;
  6954. }
  6955. else if(!IsPlayerConnected(Player)) {
  6956. ShowPlayerDialogEx(playerid, DIALOG_REPORTMG, DIALOG_STYLE_INPUT, "Report player - Meta Gaming", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  6957. }
  6958. else if(Player == playerid) {
  6959. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  6960. }
  6961. else {
  6962. SetPVarInt(playerid, "_rAutoM", 6);
  6963. SetPVarInt(playerid, "_rRepID", Player);
  6964. format(Message, sizeof(Message), "%s(%i) Meta Gaming", GetPlayerNameEx(Player), Player);
  6965. SendReportToQue(playerid,Message, 2, GetPlayerPriority(playerid));
  6966. format(Message, sizeof(Message), "You have submitted a report on %s for Meta Gaming. It has been sent to all available admins.", GetPlayerNameEx(Player));
  6967. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  6968. }
  6969. }
  6970. }
  6971. else if(dialogid == DIALOG_REPORTSPAM)
  6972. {
  6973. if(response && !GetPVarType(playerid, "HasReport"))
  6974. {
  6975. new
  6976. Player,
  6977. Message[128];
  6978. if(sscanf(inputtext, "u", Player)) {
  6979. ShowPlayerDialogEx(playerid, DIALOG_REPORTSPAM, DIALOG_STYLE_INPUT, "Report player - Spamming", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  6980. return 1;
  6981. }
  6982. else if(!IsPlayerConnected(Player)) {
  6983. ShowPlayerDialogEx(playerid, DIALOG_REPORTSPAM, DIALOG_STYLE_INPUT, "Report player - Spamming", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  6984. }
  6985. else if(Player == playerid) {
  6986. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  6987. }
  6988. else {
  6989. SetPVarInt(playerid, "_rAutoM", 6);
  6990. SetPVarInt(playerid, "_rRepID", Player);
  6991. format(Message, sizeof(Message), "%s(%i) Spamming", GetPlayerNameEx(Player), Player);
  6992. SendReportToQue(playerid,Message, 2, GetPlayerPriority(playerid));
  6993. format(Message, sizeof(Message), "You have submitted a report on %s for Spamming. It has been sent to all available admins.", GetPlayerNameEx(Player));
  6994. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  6995. SetPVarInt(playerid, "AlertedThisPlayer", Player);
  6996. SetPVarInt(playerid, "AlertType", 6);
  6997. AlertTime[playerid] = 300;
  6998. }
  6999. }
  7000. }
  7001. else if(dialogid == DIALOG_REPORTGDE)
  7002. {
  7003. if(response && !GetPVarType(playerid, "HasReport"))
  7004. {
  7005. new
  7006. Player,
  7007. Message[128];
  7008. if(sscanf(inputtext, "u", Player)) {
  7009. ShowPlayerDialogEx(playerid, DIALOG_REPORTGDE, DIALOG_STYLE_INPUT, "Report player - Gun Discharge Exploits", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7010. return 1;
  7011. }
  7012. else if(!IsPlayerConnected(Player)) {
  7013. ShowPlayerDialogEx(playerid, DIALOG_REPORTGDE, DIALOG_STYLE_INPUT, "Report player - Gun Discharge Exploits", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7014. }
  7015. else if(Player == playerid) {
  7016. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  7017. }
  7018. else {
  7019. SetPVarInt(playerid, "_rAutoM", 5);
  7020. SetPVarInt(playerid, "_rRepID", Player);
  7021. format(Message, sizeof(Message), "%s(%i) Gun Discharge Exploits", GetPlayerNameEx(Player), Player);
  7022. SendReportToQue(playerid,Message, 2, GetPlayerPriority(playerid));
  7023. format(Message, sizeof(Message), "You have submitted a report on %s for Gun Discharge Exploits. It has been sent to all available admins.", GetPlayerNameEx(Player));
  7024. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  7025. SetPVarInt(playerid, "AlertedThisPlayer", Player);
  7026. SetPVarInt(playerid, "AlertType", 7);
  7027. AlertTime[playerid] = 300;
  7028. }
  7029. }
  7030. }
  7031. else if(dialogid == DIALOG_REPORTHACK)
  7032. {
  7033. if(response && !GetPVarType(playerid, "HasReport"))
  7034. {
  7035. new
  7036. Player,
  7037. Message[128];
  7038. if(sscanf(inputtext, "u", Player)) {
  7039. ShowPlayerDialogEx(playerid, DIALOG_REPORTHACK, DIALOG_STYLE_INPUT, "Report player - Hacking", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7040. return 1;
  7041. }
  7042. else if(!IsPlayerConnected(Player)) {
  7043. ShowPlayerDialogEx(playerid, DIALOG_REPORTHACK, DIALOG_STYLE_INPUT, "Report player - Hacking", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7044. }
  7045. else if(Player == playerid) {
  7046. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  7047. }
  7048. else {
  7049. SetPVarInt(playerid, "_rAutoM", 5);
  7050. SetPVarInt(playerid, "_rRepID", Player);
  7051. format(Message, sizeof(Message), "%s(%i) Hacking", GetPlayerNameEx(Player), Player);
  7052. SendReportToQue(playerid,Message, 2, 2);
  7053. format(Message, sizeof(Message), "You have submitted a report on %s for Hacking. It has been sent to all available admins.", GetPlayerNameEx(Player));
  7054. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  7055. }
  7056. }
  7057. }
  7058. else if(dialogid == DIALOG_REPORTMF)
  7059. {
  7060. if(response && !GetPVarType(playerid, "HasReport"))
  7061. {
  7062. new
  7063. Player,
  7064. Message[128];
  7065. if(sscanf(inputtext, "u", Player)) {
  7066. ShowPlayerDialogEx(playerid, DIALOG_REPORTMF, DIALOG_STYLE_INPUT, "Report player - Money Farming", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7067. return 1;
  7068. }
  7069. else if(!IsPlayerConnected(Player)) {
  7070. ShowPlayerDialogEx(playerid, DIALOG_REPORTMF, DIALOG_STYLE_INPUT, "Report player - Money Farming", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7071. }
  7072. else if(Player == playerid) {
  7073. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  7074. }
  7075. else {
  7076. format(Message, sizeof(Message), "%s(%i) Money Farming", GetPlayerNameEx(Player), Player);
  7077. SendReportToQue(playerid,Message, 2, GetPlayerPriority(playerid));
  7078. format(Message, sizeof(Message), "You have submitted a report on %s for Money Farming. It has been sent to all available admins.", GetPlayerNameEx(Player));
  7079. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  7080. }
  7081. }
  7082. }
  7083. else if(dialogid == DIALOG_REPORTSA)
  7084. {
  7085. if(response && !GetPVarType(playerid, "HasReport"))
  7086. {
  7087. new
  7088. Player,
  7089. Message[128];
  7090. if(sscanf(inputtext, "u", Player)) {
  7091. ShowPlayerDialogEx(playerid, DIALOG_REPORTSA, DIALOG_STYLE_INPUT, "Report player - Server Advertising", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7092. return 1;
  7093. }
  7094. else if(!IsPlayerConnected(Player)) {
  7095. ShowPlayerDialogEx(playerid, DIALOG_REPORTSA, DIALOG_STYLE_INPUT, "Report player - Server Advertising", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7096. }
  7097. else if(Player == playerid) {
  7098. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  7099. }
  7100. else {
  7101. SetPVarInt(playerid, "_rAutoM", 6);
  7102. SetPVarInt(playerid, "_rRepID", Player);
  7103. format(Message, sizeof(Message), "%s(%i) Server Advertising", GetPlayerNameEx(Player), Player);
  7104. SendReportToQue(playerid,Message, 2, 2);
  7105. format(Message, sizeof(Message), "You have submitted a report on %s for Server Advertising. It has been sent to all available admins.", GetPlayerNameEx(Player));
  7106. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  7107. }
  7108. }
  7109. }
  7110. else if(dialogid == DIALOG_REPORTNRPN)
  7111. {
  7112. if(response && !GetPVarType(playerid, "HasReport"))
  7113. {
  7114. new
  7115. Player,
  7116. Message[128];
  7117. if(sscanf(inputtext, "u", Player)) {
  7118. ShowPlayerDialogEx(playerid, DIALOG_REPORTNRPN, DIALOG_STYLE_INPUT, "Report player - NonRP Name", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7119. return 1;
  7120. }
  7121. else if(!IsPlayerConnected(Player)) {
  7122. ShowPlayerDialogEx(playerid, DIALOG_REPORTNRPN, DIALOG_STYLE_INPUT, "Report player - NonRP Name", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7123. }
  7124. else if(Player == playerid) {
  7125. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  7126. }
  7127. else {
  7128. SetPVarInt(playerid, "_rAutoM", 3);
  7129. SetPVarInt(playerid, "_rRepID", Player);
  7130. format(Message, sizeof(Message), "%s(%i) NonRP Name", GetPlayerNameEx(Player), Player);
  7131. SendReportToQue(playerid,Message, 2, GetPlayerPriority(playerid));
  7132. format(Message, sizeof(Message), "You have submitted a report on %s for NonRP Name. It has been sent to all available admins.", GetPlayerNameEx(Player));
  7133. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  7134. SetPVarInt(playerid, "AlertedThisPlayer", Player);
  7135. SetPVarInt(playerid, "AlertType", 8);
  7136. AlertTime[playerid] = 300;
  7137. }
  7138. }
  7139. }
  7140. else if(dialogid == DIALOG_REPORTBANEVADE)
  7141. {
  7142. if(response && !GetPVarType(playerid, "HasReport"))
  7143. {
  7144. new
  7145. Player,
  7146. Message[128];
  7147. if(sscanf(inputtext, "u", Player)) {
  7148. ShowPlayerDialogEx(playerid, DIALOG_REPORTBANEVADE, DIALOG_STYLE_INPUT, "Report player - Ban Evader", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7149. return 1;
  7150. }
  7151. else if(!IsPlayerConnected(Player)) {
  7152. ShowPlayerDialogEx(playerid, DIALOG_REPORTBANEVADE, DIALOG_STYLE_INPUT, "Report player - Ban Evader", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7153. }
  7154. else if(Player == playerid) {
  7155. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  7156. }
  7157. else {
  7158. format(Message, sizeof(Message), "%s(%i) Ban Evader", GetPlayerNameEx(Player), Player);
  7159. SendReportToQue(playerid,Message, 2, GetPlayerPriority(playerid));
  7160. format(Message, sizeof(Message), "You have submitted a report on %s for Ban Evader. It has been sent to all available admins.", GetPlayerNameEx(Player));
  7161. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  7162. }
  7163. }
  7164. }
  7165. else if(dialogid == DIALOG_REPORTGE)
  7166. {
  7167. if(response && !GetPVarType(playerid, "HasReport"))
  7168. {
  7169. new
  7170. Player,
  7171. Message[128];
  7172. if(sscanf(inputtext, "u", Player)) {
  7173. ShowPlayerDialogEx(playerid, DIALOG_REPORTGE, DIALOG_STYLE_INPUT, "Report player - General Exploits", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7174. return 1;
  7175. }
  7176. else if(!IsPlayerConnected(Player)) {
  7177. ShowPlayerDialogEx(playerid, DIALOG_REPORTGE, DIALOG_STYLE_INPUT, "Report player - General Exploits", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7178. }
  7179. else if(Player == playerid) {
  7180. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  7181. }
  7182. else {
  7183. SetPVarInt(playerid, "_rAutoM", 5);
  7184. SetPVarInt(playerid, "_rRepID", Player);
  7185. format(Message, sizeof(Message), "%s(%i) General Exploits", GetPlayerNameEx(Player), Player);
  7186. SendReportToQue(playerid,Message, 2, GetPlayerPriority(playerid));
  7187. format(Message, sizeof(Message), "You have submitted a report on %s for General Exploits. It has been sent to all available admins.", GetPlayerNameEx(Player));
  7188. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  7189. }
  7190. }
  7191. }
  7192. else if(dialogid == DIALOG_REPORTRHN)
  7193. {
  7194. if(response && !GetPVarType(playerid, "HasReport"))
  7195. {
  7196. new
  7197. Player,
  7198. Message[128];
  7199. if(sscanf(inputtext, "u", Player)) {
  7200. ShowPlayerDialogEx(playerid, DIALOG_REPORTRHN, DIALOG_STYLE_INPUT, "Report player - Releasing Hitman Names", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7201. return 1;
  7202. }
  7203. else if(!IsPlayerConnected(Player)) {
  7204. ShowPlayerDialogEx(playerid, DIALOG_REPORTRHN, DIALOG_STYLE_INPUT, "Report player - Releasing Hitman Names", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7205. }
  7206. else if(Player == playerid) {
  7207. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  7208. }
  7209. else {
  7210. format(Message, sizeof(Message), "%s(%i) Releasing Hitman Names", GetPlayerNameEx(Player), Player);
  7211. SendReportToQue(playerid,Message, 2, GetPlayerPriority(playerid));
  7212. format(Message, sizeof(Message), "You have submitted a report on %s for Releasing Hitman Names. It has been sent to all available admins.", GetPlayerNameEx(Player));
  7213. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  7214. }
  7215. }
  7216. }
  7217. else if(dialogid == DIALOG_REPORTRSE)
  7218. {
  7219. if(response && !GetPVarType(playerid, "HasReport"))
  7220. {
  7221. new
  7222. Player,
  7223. Message[128];
  7224. if(sscanf(inputtext, "u", Player)) {
  7225. ShowPlayerDialogEx(playerid, DIALOG_REPORTRSE, DIALOG_STYLE_INPUT, "Report player - Running/Swimming Man Exploit", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7226. return 1;
  7227. }
  7228. else if(!IsPlayerConnected(Player)) {
  7229. ShowPlayerDialogEx(playerid, DIALOG_REPORTRSE, DIALOG_STYLE_INPUT, "Report player - Running/Swimming Man Exploit", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7230. }
  7231. else if(Player == playerid) {
  7232. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  7233. }
  7234. else {
  7235. SetPVarInt(playerid, "_rAutoM", 5);
  7236. SetPVarInt(playerid, "_rRepID", Player);
  7237. format(Message, sizeof(Message), "%s(%i) Running/Swimming Man Exploit", GetPlayerNameEx(Player), Player);
  7238. SendReportToQue(playerid,Message, 2, GetPlayerPriority(playerid));
  7239. format(Message, sizeof(Message), "You have submitted a report on %s for Running/Swimming Man Exploit. It has been sent to all available admins.", GetPlayerNameEx(Player));
  7240. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  7241. }
  7242. }
  7243. }
  7244. else if(dialogid == DIALOG_REPORTCARSURF)
  7245. {
  7246. if(response && !GetPVarType(playerid, "HasReport"))
  7247. {
  7248. new
  7249. Player,
  7250. Message[128];
  7251. if(sscanf(inputtext, "u", Player)) {
  7252. ShowPlayerDialogEx(playerid, DIALOG_REPORTCARSURF, DIALOG_STYLE_INPUT, "Report player - Car Surfing", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7253. return 1;
  7254. }
  7255. else if(!IsPlayerConnected(Player)) {
  7256. ShowPlayerDialogEx(playerid, DIALOG_REPORTCARSURF, DIALOG_STYLE_INPUT, "Report player - Car Surfing", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7257. }
  7258. else if(Player == playerid) {
  7259. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  7260. }
  7261. else {
  7262. SetPVarInt(playerid, "_rAutoM", 5);
  7263. SetPVarInt(playerid, "_rRepID", Player);
  7264. format(Message, sizeof(Message), "%s(%i) Car Surfing", GetPlayerNameEx(Player), Player);
  7265. SendReportToQue(playerid,Message, 2, GetPlayerPriority(playerid));
  7266. format(Message, sizeof(Message), "You have submitted a report on %s for Car Surfing. It has been sent to all available admins.", GetPlayerNameEx(Player));
  7267. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  7268. SetPVarInt(playerid, "AlertedThisPlayer", Player);
  7269. SetPVarInt(playerid, "AlertType", 10);
  7270. AlertTime[playerid] = 300;
  7271. }
  7272. }
  7273. }
  7274. else if(dialogid == DIALOG_REPORTNRPB)
  7275. {
  7276. if(response && !GetPVarType(playerid, "HasReport"))
  7277. {
  7278. new
  7279. Player;
  7280. if(sscanf(inputtext, "u", Player)) {
  7281. ShowPlayerDialogEx(playerid, DIALOG_REPORTNRPB, DIALOG_STYLE_INPUT, "Report player - NonRP Behavior", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7282. return 1;
  7283. }
  7284. else if(!IsPlayerConnected(Player)) {
  7285. ShowPlayerDialogEx(playerid, DIALOG_REPORTNRPB, DIALOG_STYLE_INPUT, "Report player - NonRP Behavior", "(Error - Invalid Player) Enter the name or ID of the player.", "Enter", "Cancel");
  7286. }
  7287. else if(Player == playerid) {
  7288. SendClientMessage(playerid, COLOR_GREY, "You can't submit a report on yourself.");
  7289. }
  7290. else {
  7291. SetPVarInt(playerid, "NRPB", Player);
  7292. ShowPlayerDialogEx(playerid, DIALOG_REPORTNRPB2, DIALOG_STYLE_INPUT,"Report player - NonRP Behavior","Explain what the person is doing.","Send","Cancel");
  7293. }
  7294. }
  7295. }
  7296. else if(dialogid == DIALOG_REPORTNRPB2)
  7297. {
  7298. if(response == 1 && !GetPVarType(playerid, "HasReport"))
  7299. {
  7300. if(isnull(inputtext)) return ShowPlayerDialogEx(playerid, DIALOG_REPORTNRPB2, DIALOG_STYLE_INPUT,"Report player - NonRP Behavior","Explain what the person is doing.","Send","Cancel");
  7301. new
  7302. Message[128],
  7303. Player;
  7304. Player = GetPVarInt(playerid, "NRPB");
  7305. SetPVarInt(playerid, "_rAutoM", 5);
  7306. SetPVarInt(playerid, "_rRepID", Player);
  7307. format(Message, sizeof(Message), "%s(%i), %s (nonrp behavior)", GetPlayerNameEx(Player), Player, inputtext);
  7308. SendReportToQue(playerid, Message, 2, GetPlayerPriority(playerid));
  7309. format(Message, sizeof(Message), "You have submitted a report on %s for NonRP Behavior. It has been sent to all available admins.", GetPlayerNameEx(Player));
  7310. SendClientMessageEx(playerid, COLOR_WHITE, Message);
  7311. DeletePVar(playerid, "NRPB");
  7312. SetPVarInt(playerid, "AlertedThisPlayer", Player);
  7313. SetPVarInt(playerid, "AlertType", 11);
  7314. AlertTime[playerid] = 300;
  7315. }
  7316. else {
  7317. DeletePVar(playerid, "NRPB");
  7318. }
  7319. }
  7320. else if(dialogid == DIALOG_REPORTFREE)
  7321. {
  7322. if(response == 1 && !GetPVarType(playerid, "HasReport"))
  7323. {
  7324. if(isnull(inputtext)) {
  7325. ShowPlayerDialogEx(playerid, DIALOG_REPORTFREE, DIALOG_STYLE_INPUT,"Other / Free Text","(Error - No Message) Enter the message you want to send to the admin team.","Send","Cancel");
  7326. }
  7327. SendReportToQue(playerid, inputtext, 2, GetPlayerPriority(playerid));
  7328. SendClientMessageEx(playerid, COLOR_WHITE, "Your message has been sent to the admin team.");
  7329. }
  7330. }
  7331. else if(dialogid == DIALOG_REPORTNOTLIST)
  7332. {
  7333. if(response == 1 && !GetPVarType(playerid, "HasReport"))
  7334. {
  7335. if(isnull(inputtext)) {
  7336. ShowPlayerDialogEx(playerid, DIALOG_REPORTNOTLIST, DIALOG_STYLE_INPUT,"Not Listed","(Error - No Message) Using this category will receive a slower response from the admin team, please consider using the most appropriate category for a faster response","Send","Cancel");
  7337. }
  7338. SetPVarString(playerid, "ReportNotList", inputtext);
  7339. ShowPlayerDialogEx(playerid, DIALOG_REPORTNOTLIST2, DIALOG_STYLE_MSGBOX, "Not Listed", "Are you sure your report doesn't fit under any other report categories?", "Yes", "No");
  7340. }
  7341. }
  7342. else if(dialogid == DIALOG_REPORTNOTLIST2)
  7343. {
  7344. if(response == 1 && !GetPVarType(playerid, "HasReport"))
  7345. {
  7346. new Message[128];
  7347. GetPVarString(playerid, "ReportNotList", Message, sizeof(Message));
  7348. SendReportToQue(playerid, Message, 2, 5);
  7349. SendClientMessageEx(playerid, COLOR_WHITE, "Your message has been sent to the admin team.");
  7350. }
  7351. }
  7352. else if(dialogid == DIALOG_SPEAKTOADMIN)
  7353. {
  7354. if(response == 1)
  7355. {
  7356. if(isnull(inputtext)) {
  7357. ShowPlayerDialogEx(playerid, DIALOG_REPORTNOTLIST, DIALOG_STYLE_INPUT,"Other / Free Text","(Error - No Message) Using this category will receive a slower response from the admin team, please consider using the most appropriate category for a faster response","Send","Cancel");
  7358. }
  7359. SetPVarString(playerid, "ReportNotList", inputtext);
  7360. ShowPlayerDialogEx(playerid, DIALOG_REPORTNOTLIST2, DIALOG_STYLE_MSGBOX, "Other / Free Text", "Are you sure you need to contact an admin?", "Yes", "No");
  7361. }
  7362. }
  7363. else if(dialogid == DIALOG_REPORTNAME)
  7364. {
  7365. new
  7366. Player;
  7367. Player = GetPVarInt(playerid, "NameChange");
  7368. if(GetPVarInt(Player, "RequestingNameChange") == 0)
  7369. {
  7370. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't requesting a namechange!");
  7371. return 1;
  7372. }
  7373. if(response == 1)
  7374. {
  7375. new newname[MAX_PLAYER_NAME], tmpName[24];
  7376. GetPVarString(Player, "NewNameRequest", newname, MAX_PLAYER_NAME);
  7377. mysql_escape_string(newname, tmpName);
  7378. SetPVarString(Player, "NewNameRequest", tmpName);
  7379. mysql_format(MainPipeline, string, sizeof(string), "SELECT `Username` FROM `accounts` WHERE `Username`='%s'", tmpName);
  7380. mysql_tquery(MainPipeline, string, "OnApproveName", "ii", playerid, Player);
  7381. }
  7382. else
  7383. {
  7384. SendClientMessageEx(Player,COLOR_YELLOW," Your name change request has been denied.");
  7385. format(string, sizeof(string), " You have denied %s's name change request.", GetPlayerNameEx(Player));
  7386. SendClientMessageEx(playerid,COLOR_YELLOW,string);
  7387. format(string, sizeof(string), "%s has denied %s's name change request",GetPlayerNameEx(playerid),GetPlayerNameEx(Player));
  7388. ABroadCast(COLOR_YELLOW, string, 3);
  7389. SetPVarInt(Player, "LastNameChange", gettime());
  7390. DeletePVar(Player, "RequestingNameChange");
  7391. }
  7392. }
  7393. else if(dialogid == DIALOG_REPORTTEAMNAME)
  7394. {
  7395. new
  7396. Player;
  7397. Player = GetPVarInt(playerid, "RFLNameChange");
  7398. if(GetPVarInt(Player, "RFLNameRequest") == 0)
  7399. {
  7400. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't requesting a namechange!");
  7401. return 1;
  7402. }
  7403. if(response == 1)
  7404. {
  7405. new newname[25], tmpName[25], query[128];
  7406. GetPVarString(Player, "NewRFLName", newname, MAX_PLAYER_NAME);
  7407. mysql_escape_string(newname, tmpName);
  7408. SetPVarString(Player, "NewRFLName", tmpName);
  7409. mysql_format(MainPipeline, query, sizeof(query), "SELECT `name` FROM `rflteams` WHERE `name` = '%s'", tmpName);
  7410. mysql_tquery(MainPipeline, query, "OnCheckRFLName", "ii", playerid, Player);
  7411. }
  7412. else
  7413. {
  7414. SendClientMessageEx(Player,COLOR_YELLOW," Your team name change request has been denied.");
  7415. format(string, sizeof(string), " You have denied %s's team name change request.", GetPlayerNameEx(Player));
  7416. SendClientMessageEx(playerid,COLOR_YELLOW,string);
  7417. format(string, sizeof(string), "%s has denied %s's team name change request",GetPlayerNameEx(playerid),GetPlayerNameEx(Player));
  7418. ABroadCast(COLOR_YELLOW, string, 3);
  7419. DeletePVar(Player, "RFLNameRequest");
  7420. DeletePVar(playerid, "RFLNameChange");
  7421. DeletePVar(Player, "NewRFLName");
  7422. }
  7423. }
  7424. else if(dialogid == DIALOG_DEDICATEDPLAYER)
  7425. {
  7426. if(response)
  7427. {
  7428. new
  7429. szName[MAX_PLAYER_NAME],
  7430. szDialogStr[260],
  7431. szFileStr[32],
  7432. iPos,
  7433. iCount = 0,
  7434. iTime = gettime() - 5184000,
  7435. File: fDedicated = fopen("RewardDedicated.cfg", io_read);
  7436. GetPVarString(playerid, "DedicatedPlayer", szName, sizeof(szName));
  7437. while(fread(fDedicated, szFileStr)) {
  7438. iPos = strfind(szFileStr, "|");
  7439. if(strval(szFileStr[iPos + 1]) > iTime && iCount == 0 && strcmp(szFileStr, szName, false, strlen(szName))==0 ) {
  7440. szFileStr[iPos] = 0;
  7441. strcat(szDialogStr, szFileStr);
  7442. iCount++;
  7443. strcat(szDialogStr, "\n");
  7444. }
  7445. else if(iCount > 0)
  7446. {
  7447. szFileStr[iPos] = 0;
  7448. strcat(szDialogStr, szFileStr);
  7449. iCount++;
  7450. if(iCount == 10) {
  7451. SetPVarString(playerid, "DedicatedPlayer", szFileStr);
  7452. printf("%s - Dedicated Player", szFileStr);
  7453. break;
  7454. }
  7455. strcat(szDialogStr, "\n");
  7456. }
  7457. }
  7458. fclose(fDedicated);
  7459. //szDialogStr[strlen(szDialogStr) - 1] = 0;
  7460. if(iCount == 10)
  7461. {
  7462. ShowPlayerDialogEx(playerid, DIALOG_DEDICATEDPLAYER, DIALOG_STYLE_LIST, "Dedicated Players (over 150 Reward Hours)", szDialogStr, "Next", "Exit");
  7463. }
  7464. else
  7465. {
  7466. ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_LIST, "Dedicated Players (over 150 Reward Hours)", szDialogStr, "Exit", "");
  7467. }
  7468. return 1;
  7469. }
  7470. }
  7471. else if (dialogid == DIALOG_POSTAMP && response)
  7472. {
  7473. switch (listitem) {
  7474. case REGULAR_MAIL: {
  7475. SetPVarInt(playerid, "LetterTime", 240);
  7476. SetPVarInt(playerid, "LetterCost", 100);
  7477. }
  7478. case PRIORITY_MAIL: {
  7479. SetPVarInt(playerid, "LetterTime", 120);
  7480. SetPVarInt(playerid, "LetterCost", 250);
  7481. }
  7482. case PREMIUM_MAIL: {
  7483. if (PlayerInfo[playerid][pDonateRank] < 3) {
  7484. return SendClientMessageEx(playerid, COLOR_GREY, "You need to be at least Gold VIP for sending Premium Mail.");
  7485. }
  7486. else {
  7487. SetPVarInt(playerid, "LetterCost", 500);
  7488. SetPVarInt(playerid, "LetterNotify", 1);
  7489. }
  7490. }
  7491. case GOVERNMENT_MAIL: {
  7492. if (!IsAGovernment(playerid) && !IsACop(playerid) && !IsAJudge(playerid)) {
  7493. return SendClientMessageEx(playerid, COLOR_GREY, " Only Government agencies can use Government Mail! ");
  7494. }
  7495. if (PlayerInfo[playerid][pRank] < 4) {
  7496. return SendClientMessageEx(playerid, COLOR_GREY, " Only rank 4 or higher can do this.");
  7497. }
  7498. SetPVarInt(playerid, "LetterTime", 60);
  7499. SetPVarInt(playerid, "LetterCost", 500);
  7500. SetPVarInt(playerid, "LetterNotify", 1);
  7501. SetPVarInt(playerid, "LetterGov", 1);
  7502. }
  7503. default:
  7504. return 1;
  7505. }
  7506. if (listitem != GOVERNMENT_MAIL && GetPlayerCash(playerid) < GetPVarInt(playerid, "LetterCost")) {
  7507. DeletePVar(playerid, "LetterTime");
  7508. DeletePVar(playerid, "LetterCost");
  7509. return SendClientMessageEx(playerid, COLOR_GREY, "You can't afford the stamp.");
  7510. }
  7511. ShowPlayerDialogEx(playerid, DIALOG_PORECEIVER, DIALOG_STYLE_INPUT, "Recipient", "{FFFFFF}Please type the name of the recipient (online or offline)", "Next", "Cancel");
  7512. return 1;
  7513. }
  7514. else if (dialogid == DIALOG_PORECEIVER && response)
  7515. {
  7516. if (!strlen(inputtext)) {
  7517. ShowPlayerDialogEx(playerid, DIALOG_PORECEIVER, DIALOG_STYLE_INPUT, "Recipient", "{FF3333}Error: {FFFFFF}Recipient Name Not Entered!\n\nPlease type the name of the recipient (online or offline)", "Next", "Cancel");
  7518. return 1;
  7519. }
  7520. if (strlen(inputtext) > 20) {
  7521. ShowPlayerDialogEx(playerid, DIALOG_PORECEIVER, DIALOG_STYLE_INPUT, "Recipient", "{FF3333}Error: {FFFFFF}Recipient Name Too Long!\n\nPlease type the name of the recipient (online or offline)", "Next", "Cancel");
  7522. return 1;
  7523. }
  7524. if (strcmp(inputtext, GetPlayerNameExt(playerid), true) == 0) {
  7525. ShowPlayerDialogEx(playerid, DIALOG_PORECEIVER, DIALOG_STYLE_INPUT, "Recipient", "{FF3333}Error: {FFFFFF}Invalid Recipient! - Can't send to yourself!\n\nPlease type the name of the recipient (online or offline)", "Next", "Cancel");
  7526. return 1;
  7527. }
  7528. SetPVarString(playerid, "LetterRecipientName", inputtext);
  7529. new giveplayer = ReturnUser(inputtext);
  7530. if(giveplayer == INVALID_PLAYER_ID)
  7531. {
  7532. new szQuery[256];
  7533. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "SELECT `id`, `AdminLevel`, `TogReports` FROM `accounts` WHERE `Username` = '%e'", inputtext);
  7534. mysql_tquery(MainPipeline, szQuery, "RecipientLookupFinish", "i", playerid);
  7535. }
  7536. else
  7537. {
  7538. if(PlayerInfo[giveplayer][pAdmin] >= 2 && PlayerInfo[giveplayer][pTogReports] != 1)
  7539. {
  7540. ShowPlayerDialogEx(playerid, DIALOG_PORECEIVER, DIALOG_STYLE_INPUT, "Recipient", "{FF3333}Error: {FFFFFF}You can't send a letter to admins!\n\nPlease type the name of the recipient (online or offline)", "Next", "Cancel");
  7541. }
  7542. else
  7543. {
  7544. SetPVarInt(playerid, "LetterRecipient", GetPlayerSQLId(giveplayer));
  7545. ShowPlayerDialogEx(playerid, DIALOG_POMESSAGE, DIALOG_STYLE_INPUT, "Send Letter", "{FFFFFF}Please type the message.", "Send", "Cancel");
  7546. }
  7547. }
  7548. return 1;
  7549. }
  7550. else if (dialogid == DIALOG_POMESSAGE && response)
  7551. {
  7552. if (PlayerInfo[playerid][pAdmin] < 2 && CheckServerAd(inputtext)) {
  7553. format(string,sizeof(string),"Warning: %s may be server advertising via mail: '%s'.", GetPlayerNameEx(playerid),inputtext);
  7554. ABroadCast(COLOR_RED, string, 2);
  7555. format(string,sizeof(string),"Warning: %s(%d) may be server advertising via mail: '%s'.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), inputtext);
  7556. Log("logs/hack.log", string);
  7557. return 1;
  7558. }
  7559. new query[512], rec[MAX_PLAYER_NAME];
  7560. if (strlen(inputtext) == 0) {
  7561. ShowPlayerDialogEx(playerid, DIALOG_POMESSAGE, DIALOG_STYLE_INPUT, "Send Letter", "{FF3333}Error: {FFFFFF}Message Not Entered!\n\nPlease type the message.", "Send", "Cancel");
  7562. return 1;
  7563. }
  7564. if (strlen(inputtext) > 128) return 1; // Apparently not possible, but just in case
  7565. if (!GetPVarType(playerid, "LetterGov")) {
  7566. if (GetPlayerCash(playerid) < GetPVarInt(playerid, "LetterCost")) {
  7567. return SendClientMessageEx(playerid, COLOR_GREY, "You can't afford the stamp.");
  7568. }
  7569. GivePlayerCash(playerid, -GetPVarInt(playerid, "LetterCost"));
  7570. }
  7571. else {
  7572. DeletePVar(playerid, "LetterGov");
  7573. if (Tax < 500) return SendClientMessageEx(playerid, COLOR_WHITE, "No government funds are available for stamp.");
  7574. Tax -= 500;
  7575. Misc_Save();
  7576. }
  7577. mysql_format(MainPipeline, query,sizeof(query), "INSERT INTO `letters` (`Sender_Id`, `Receiver_Id`, `Date`, `Message`, `Delivery_Min`, `Notify`) VALUES (%d, %d, NOW(), '%e', %d, %d)", GetPlayerSQLId(playerid), GetPVarInt(playerid, "LetterRecipient"), inputtext, GetPVarInt(playerid, "LetterTime"), GetPVarInt(playerid, "LetterNotify"));
  7578. mysql_tquery(MainPipeline, query, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
  7579. GetPVarString(playerid, "LetterRecipientName", rec, MAX_PLAYER_NAME);
  7580. if (GetPVarInt(playerid, "LetterTime") == 0)
  7581. {
  7582. SendClientMessageEx(playerid, COLOR_WHITE, "Your letter has been sent. It will be delivered immediately.");
  7583. new xid=ReturnUser(rec);
  7584. if (xid != INVALID_PLAYER_ID)
  7585. {
  7586. if (PlayerInfo[xid][pDonateRank] >= 4 && HasMailbox(xid))
  7587. {
  7588. SendClientMessageEx(xid, COLOR_YELLOW, "A letter has just been delivered to your mailbox.");
  7589. SetPVarInt(xid, "UnreadMails", 1);
  7590. }
  7591. }
  7592. }
  7593. else
  7594. {
  7595. format(string, sizeof(string), "Your letter has been sent. It will be delivered in %d hour(s).", GetPVarInt(playerid, "LetterTime") / 60);
  7596. SendClientMessageEx(playerid, COLOR_WHITE, string);
  7597. }
  7598. PlayerInfo[playerid][pPaper]--;
  7599. DeletePVar(playerid, "LetterCost");
  7600. DeletePVar(playerid, "LetterTime");
  7601. DeletePVar(playerid, "LetterRecipient");
  7602. DeletePVar(playerid, "LetterNotify");
  7603. SetPVarInt(playerid, "MailTime", 30);
  7604. new szLog[256];
  7605. format(szLog, sizeof(szLog), "%s(%d) has sent mail to %s: %s", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), rec, inputtext);
  7606. Log("logs/mail.log", szLog);
  7607. return 1;
  7608. }
  7609. else if (dialogid == DIALOG_POMAILS && response)
  7610. {
  7611. SetPVarInt(playerid, "ReadingMail", ListItemTrackId[playerid][listitem]);
  7612. DisplayMailDetails(playerid, ListItemTrackId[playerid][listitem]);
  7613. }
  7614. else if (dialogid == DIALOG_PODETAIL)
  7615. {
  7616. if (response) // Back
  7617. {
  7618. DisplayMails(playerid);
  7619. }
  7620. else // Trash
  7621. {
  7622. new query[64];
  7623. mysql_format(MainPipeline, query, sizeof(query), "DELETE FROM `letters` WHERE `ID` = %i", GetPVarInt(playerid, "ReadingMail"));
  7624. mysql_tquery(MainPipeline, query, "OnQueryFinish", "i", SENDDATA_THREAD);
  7625. ShowPlayerDialogEx(playerid, DIALOG_POTRASHED, DIALOG_STYLE_MSGBOX, "Info", "You've trashed your mail.", "Back", "Close");
  7626. }
  7627. DeletePVar(playerid, "ReadingMail");
  7628. return 1;
  7629. }
  7630. else if (dialogid == DIALOG_POTRASHED && response)
  7631. {
  7632. DisplayMails(playerid);
  7633. return 1;
  7634. }
  7635. else if (dialogid == DIALOG_STOREPRICES)
  7636. {
  7637. if (!response || (GetPVarInt(playerid, "EditingBusiness") != PlayerInfo[playerid][pBusiness]) || (GetPVarInt(playerid, "EditingBusiness") != InBusiness(playerid)) || PlayerInfo[playerid][pBusinessRank] != 5) {
  7638. DeletePVar(playerid, "EditingBusiness");
  7639. }
  7640. else {
  7641. format(string, sizeof(string), "{FFFFFF}Enter the new sale price for %s\n(Items with the price of $0 will not be for sale)", StoreItems[listitem]);
  7642. ShowPlayerDialogEx(playerid, DIALOG_STOREITEMPRICE, DIALOG_STYLE_INPUT, "Edit Price", string, "Okay", "Cancel");
  7643. SetPVarInt(playerid, "EditingStoreItem", listitem);
  7644. }
  7645. return 1;
  7646. }
  7647. else if (dialogid == DIALOG_BARPRICE)
  7648. {
  7649. if (!response || (GetPVarInt(playerid, "EditingBusiness") != PlayerInfo[playerid][pBusiness]) || (GetPVarInt(playerid, "EditingBusiness") != InBusiness(playerid)) || PlayerInfo[playerid][pBusinessRank] != 5) {
  7650. DeletePVar(playerid, "EditingBusiness");
  7651. }
  7652. else {
  7653. format(string, sizeof(string), "{FFFFFF}Enter the new sale price for %s\n(Items with the price of $0 will not be for sale)", Drinks[listitem]);
  7654. ShowPlayerDialogEx(playerid, DIALOG_BARPRICE2, DIALOG_STYLE_INPUT, "Edit Price", string, "Okay", "Cancel");
  7655. SetPVarInt(playerid, "EditingStoreItem", listitem);
  7656. }
  7657. return 1;
  7658. }
  7659. else if(dialogid == DIALOG_SEXSHOP)
  7660. {
  7661. if (!response || (GetPVarInt(playerid, "EditingBusiness") != PlayerInfo[playerid][pBusiness]) || (GetPVarInt(playerid, "EditingBusiness") != InBusiness(playerid)) || PlayerInfo[playerid][pBusinessRank] != 5) {
  7662. DeletePVar(playerid, "EditingBusiness");
  7663. }
  7664. else {
  7665. format(string, sizeof(string), "{FFFFFF}Enter the new sale price for %s\n(Items with the price of $0 will not be for sale)", Drinks[listitem]);
  7666. ShowPlayerDialogEx(playerid, DIALOG_SEXSHOP2, DIALOG_STYLE_INPUT, "Edit Price", string, "Okay", "Cancel");
  7667. SetPVarInt(playerid, "EditingStoreItem", listitem);
  7668. }
  7669. return 1;
  7670. }
  7671. else if (dialogid == DIALOG_RESTAURANT)
  7672. {
  7673. if (!response || (GetPVarInt(playerid, "EditingBusiness") != PlayerInfo[playerid][pBusiness]) || (GetPVarInt(playerid, "EditingBusiness") != InBusiness(playerid)) || PlayerInfo[playerid][pBusinessRank] != 5)
  7674. {
  7675. DeletePVar(playerid, "EditingBusiness");
  7676. }
  7677. else
  7678. {
  7679. format(string, sizeof(string), "{FFFFFF}Enter the new sale price for %s\n(Items with the price of $0 will not be for sale)", RestaurantItems[listitem]);
  7680. ShowPlayerDialogEx(playerid, DIALOG_RESTAURANT2, DIALOG_STYLE_INPUT, "Edit Price", string, "Okay", "Cancel");
  7681. SetPVarInt(playerid, "EditingStoreItem", listitem);
  7682. }
  7683. }
  7684. else if (dialogid == DIALOG_SEXSHOP2)
  7685. {
  7686. if (PlayerInfo[playerid][pBusiness] != GetPVarInt(playerid, "EditingBusiness") || (GetPVarInt(playerid, "EditingBusiness") != InBusiness(playerid)) || PlayerInfo[playerid][pBusinessRank] != 5) {
  7687. DeletePVar(playerid, "EditingStoreItem");
  7688. DeletePVar(playerid, "EditingBusiness");
  7689. return 1;
  7690. }
  7691. new iBusiness = PlayerInfo[playerid][pBusiness];
  7692. if (response) {
  7693. new iPrice = strval(inputtext), item = GetPVarInt(playerid, "EditingStoreItem");
  7694. if (iPrice < 0 || iPrice > 500000) {
  7695. format(string, sizeof(string), "{FF0000}Error: {DDDDDD}Price is out of range{FFFFFF}\n\nEnter the new sale price for %s", Drinks[item]);
  7696. ShowPlayerDialogEx(playerid, DIALOG_STOREITEMPRICE, DIALOG_STYLE_INPUT, "Edit Price", string, "Okay", "Cancel");
  7697. return 1;
  7698. }
  7699. format(string,sizeof(string), "%s price has been set to $%s!", SexItems[item], number_format(iPrice));
  7700. Businesses[iBusiness][bItemPrices][item] = iPrice;
  7701. SaveBusiness(iBusiness);
  7702. SendClientMessageEx(playerid, COLOR_WHITE, string);
  7703. format(string, sizeof(string), "%s %s(%d) (IP: %s) has set the %s price to %s in %s ($%d)", GetBusinessRankName(PlayerInfo[playerid][pBusinessRank]), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), SexItems[item], number_format(iPrice), Businesses[iBusiness][bName], iBusiness);
  7704. new szDialog[302];
  7705. for (new i = 0; i <= 13; i++) format(szDialog, sizeof(szDialog), "%s%s ($%s)\n", szDialog, SexItems[i], number_format(Businesses[iBusiness][bItemPrices][i]));
  7706. ShowPlayerDialogEx(playerid, DIALOG_BARPRICE, DIALOG_STYLE_LIST, "Edit Business Prices", szDialog, "Okay", "Cancel");
  7707. Log("logs/business.log", string);
  7708. }
  7709. DeletePVar(playerid, "EditingStoreItem");
  7710. return 1;
  7711. }
  7712. else if (dialogid == DIALOG_RESTAURANT2)
  7713. {
  7714. if (PlayerInfo[playerid][pBusiness] != GetPVarInt(playerid, "EditingBusiness") || (GetPVarInt(playerid, "EditingBusiness") != InBusiness(playerid)) || PlayerInfo[playerid][pBusinessRank] != 5)
  7715. {
  7716. DeletePVar(playerid, "EditingStoreItem");
  7717. DeletePVar(playerid, "EditingBusiness");
  7718. return 1;
  7719. }
  7720. new business = PlayerInfo[playerid][pBusiness];
  7721. if (response)
  7722. {
  7723. new price = strval(inputtext), item = GetPVarInt(playerid, "EditingStoreItem");
  7724. if (price < 0 || price > 500000)
  7725. {
  7726. format(string, sizeof(string), "{FF0000}Error: {DDDDDD}Price is out of range{FFFFFF}\n\nEnter the new sale price for %s", RestaurantItems[item]);
  7727. ShowPlayerDialogEx(playerid, DIALOG_RESTAURANT2, DIALOG_STYLE_INPUT, "Edit Price", string, "Okay", "Cancel");
  7728. return 1;
  7729. }
  7730. format(string,sizeof(string), "%s price has been set to $%s!", RestaurantItems[item], number_format(price));
  7731. Businesses[business][bItemPrices][item] = price;
  7732. SaveBusiness(business);
  7733. SendClientMessageEx(playerid, COLOR_WHITE, string);
  7734. format(string, sizeof(string), "%s %s(%d) (IP: %s) has set the %s price to %s in %s ($%d)", GetBusinessRankName(PlayerInfo[playerid][pBusinessRank]), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), RestaurantItems[item], number_format(price), Businesses[business][bName], business);
  7735. new szDialog[302];
  7736. for (new i = 0; i <= 13; i++) format(szDialog, sizeof(szDialog), "%s%s ($%s)\n", szDialog, RestaurantItems[i], number_format(Businesses[business][bItemPrices][i]));
  7737. ShowPlayerDialogEx(playerid, DIALOG_RESTAURANT, DIALOG_STYLE_LIST, "Edit Business Prices", szDialog, "Okay", "Cancel");
  7738. Log("logs/business.log", string);
  7739. }
  7740. DeletePVar(playerid, "EditingStoreItem");
  7741. return 1;
  7742. }
  7743. else if (dialogid == DIALOG_BARPRICE2)
  7744. {
  7745. if (PlayerInfo[playerid][pBusiness] != GetPVarInt(playerid, "EditingBusiness") || (GetPVarInt(playerid, "EditingBusiness") != InBusiness(playerid)) || PlayerInfo[playerid][pBusinessRank] != 5) {
  7746. DeletePVar(playerid, "EditingStoreItem");
  7747. DeletePVar(playerid, "EditingBusiness");
  7748. return 1;
  7749. }
  7750. new iBusiness = PlayerInfo[playerid][pBusiness];
  7751. if (response) {
  7752. new iPrice = strval(inputtext), item = GetPVarInt(playerid, "EditingStoreItem");
  7753. if (iPrice < 0 || iPrice > 500000) {
  7754. format(string, sizeof(string), "{FF0000}Error: {DDDDDD}Price is out of range{FFFFFF}\n\nEnter the new sale price for %s", Drinks[item]);
  7755. ShowPlayerDialogEx(playerid, DIALOG_STOREITEMPRICE, DIALOG_STYLE_INPUT, "Edit Price", string, "Okay", "Cancel");
  7756. return 1;
  7757. }
  7758. format(string,sizeof(string), "%s price has been set to $%s!", Drinks[item], number_format(iPrice));
  7759. Businesses[iBusiness][bItemPrices][item] = iPrice;
  7760. SaveBusiness(iBusiness);
  7761. SendClientMessageEx(playerid, COLOR_WHITE, string);
  7762. format(string, sizeof(string), "%s %s(%d) (IP: %s) has set the %s price to $%s in %s (%d)", GetBusinessRankName(PlayerInfo[playerid][pBusinessRank]), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), Drinks[item], number_format(iPrice), Businesses[iBusiness][bName], iBusiness);
  7763. new szDialog[302];
  7764. for (new i = 0; i <= 13; i++) format(szDialog, sizeof(szDialog), "%s%s ($%s)\n", szDialog, Drinks[i], number_format(Businesses[iBusiness][bItemPrices][i]));
  7765. ShowPlayerDialogEx(playerid, DIALOG_BARPRICE, DIALOG_STYLE_LIST, "Edit Business Prices", szDialog, "Okay", "Cancel");
  7766. Log("logs/business.log", string);
  7767. }
  7768. DeletePVar(playerid, "EditingStoreItem");
  7769. return 1;
  7770. }
  7771. else if (dialogid == DIALOG_STOREITEMPRICE)
  7772. {
  7773. if (PlayerInfo[playerid][pBusiness] != GetPVarInt(playerid, "EditingBusiness") || (GetPVarInt(playerid, "EditingBusiness") != InBusiness(playerid)) || PlayerInfo[playerid][pBusinessRank] != 5) {
  7774. DeletePVar(playerid, "EditingStoreItem");
  7775. DeletePVar(playerid, "EditingBusiness");
  7776. return 1;
  7777. }
  7778. new iBusiness = PlayerInfo[playerid][pBusiness];
  7779. if (response) {
  7780. new iPrice = strval(inputtext), item = GetPVarInt(playerid, "EditingStoreItem");
  7781. if (iPrice < 0 || iPrice > 500000) {
  7782. format(string, sizeof(string), "{FF0000}Error: {DDDDDD}Price is out of range{FFFFFF}\n\nEnter the new sale price for %s", StoreItems[item]);
  7783. ShowPlayerDialogEx(playerid, DIALOG_STOREITEMPRICE, DIALOG_STYLE_INPUT, "Edit Price", string, "OK", "Cancel");
  7784. return 1;
  7785. }
  7786. format(string,sizeof(string), "%s price has been set to $%s!", StoreItems[item], number_format(iPrice));
  7787. Businesses[iBusiness][bItemPrices][item] = iPrice;
  7788. SaveBusiness(iBusiness);
  7789. SendClientMessageEx(playerid, COLOR_WHITE, string);
  7790. format(string, sizeof(string), "%s %s(%d) (IP: %s) has set the %s price to $%s in %s (%d)", GetBusinessRankName(PlayerInfo[playerid][pBusinessRank]), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), StoreItems[item], number_format(iPrice), Businesses[iBusiness][bName], iBusiness);
  7791. new szDialog[912];
  7792. for (new i = 0; i < sizeof(StoreItems); i++) format(szDialog, sizeof(szDialog), "%s%s ($%s) (Cost of Good: $%s)\n", szDialog, StoreItems[i], number_format(Businesses[iBusiness][bItemPrices][i]), number_format(floatround(StoreItemCost[i][ItemValue] * BUSINESS_ITEMS_COST)));
  7793. ShowPlayerDialogEx(playerid, DIALOG_STOREPRICES, DIALOG_STYLE_LIST, "Edit 24/7 Prices", szDialog, "OK", "Cancel");
  7794. Log("logs/business.log", string);
  7795. }
  7796. DeletePVar(playerid, "EditingStoreItem");
  7797. return 1;
  7798. }
  7799. else if(dialogid == DIALOG_STORECLOTHINGPRICE)
  7800. {
  7801. new iBusiness = PlayerInfo[playerid][pBusiness];
  7802. if (PlayerInfo[playerid][pBusiness] != GetPVarInt(playerid, "EditingBusiness") || (GetPVarInt(playerid, "EditingBusiness") != InBusiness(playerid)) || PlayerInfo[playerid][pBusinessRank] != 5) {
  7803. DeletePVar(playerid, "EditingStoreItem");
  7804. DeletePVar(playerid, "EditingBusiness");
  7805. return 1;
  7806. }
  7807. if (response) {
  7808. new iPrice = strval(inputtext);
  7809. if (iPrice < 0 || iPrice > 500000) {
  7810. ShowPlayerDialogEx(playerid, DIALOG_STORECLOTHINGPRICE, DIALOG_STYLE_INPUT, "Edit Price", "{FF0000}Error: {DDDDDD}Price is out of range{FFFFFF}\n\nEnter the new sale price for clothing", "Okay", "Cancel");
  7811. return 1;
  7812. }
  7813. format(string,sizeof(string), "Clothing price has been set to $%s!", number_format(iPrice));
  7814. Businesses[iBusiness][bItemPrices][0] = iPrice;
  7815. SaveBusiness(iBusiness);
  7816. SendClientMessageEx(playerid, COLOR_WHITE, string);
  7817. format(string, sizeof(string), "%s %s(%d) (IP: %s) has set the %s price to $%s in %s (%d)", GetBusinessRankName(PlayerInfo[playerid][pBusinessRank]), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), "clothing", number_format(iPrice), Businesses[iBusiness][bName], iBusiness);
  7818. Log("logs/business.log", string);
  7819. }
  7820. DeletePVar(playerid, "EditingStoreItem");
  7821. }
  7822. else if (dialogid == DIALOG_GUNPRICES)
  7823. {
  7824. if (!response || (GetPVarInt(playerid, "EditingBusiness") != PlayerInfo[playerid][pBusiness]) || (GetPVarInt(playerid, "EditingBusiness") != InBusiness(playerid)) || PlayerInfo[playerid][pBusinessRank] != 5) {
  7825. DeletePVar(playerid, "EditingBusiness");
  7826. }
  7827. else {
  7828. format(string, sizeof(string), "{FFFFFF}Enter the new sale price for %s\n(Items with the price of $0 will not be for sale)", GetWeaponNameEx(Weapons[listitem][WeaponId]));
  7829. ShowPlayerDialogEx(playerid, DIALOG_GUNSHOPPRICE, DIALOG_STYLE_INPUT, "Edit Price", string, "Okay", "Cancel");
  7830. SetPVarInt(playerid, "EditingStoreItem", listitem);
  7831. }
  7832. return 1;
  7833. }
  7834. else if(dialogid == DIALOG_GUNSHOPPRICE)
  7835. {
  7836. if (PlayerInfo[playerid][pBusiness] != GetPVarInt(playerid, "EditingBusiness") || (GetPVarInt(playerid, "EditingBusiness") != InBusiness(playerid)) || PlayerInfo[playerid][pBusinessRank] != 5) {
  7837. DeletePVar(playerid, "EditingStoreItem");
  7838. DeletePVar(playerid, "EditingBusiness");
  7839. return 1;
  7840. }
  7841. new iBusiness = PlayerInfo[playerid][pBusiness];
  7842. if (response) {
  7843. new iPrice = strval(inputtext), item = GetPVarInt(playerid, "EditingStoreItem");
  7844. if (iPrice < 0 || iPrice > 500000) {
  7845. format(string, sizeof(string), "{FF0000}Error: {DDDDDD}Price is out of range{FFFFFF}\n\nEnter the new sale price for %s", StoreItems[item]);
  7846. ShowPlayerDialogEx(playerid, DIALOG_GUNSHOPPRICE, DIALOG_STYLE_INPUT, "Edit Price", string, "OK", "Cancel");
  7847. return 1;
  7848. }
  7849. format(string,sizeof(string), "%s price has been set to $%s!", GetWeaponNameEx(Weapons[item][WeaponId]), number_format(iPrice));
  7850. Businesses[iBusiness][bItemPrices][item] = iPrice;
  7851. SaveBusiness(iBusiness);
  7852. SendClientMessageEx(playerid, COLOR_WHITE, string);
  7853. format(string, sizeof(string), "%s %s(%d) (IP: %s) has set the %s price to $%s in %s (%d)", GetBusinessRankName(PlayerInfo[playerid][pBusinessRank]), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), GetWeaponParam(item, WeaponId), number_format(iPrice), Businesses[iBusiness][bName], iBusiness);
  7854. new szDialog[512];
  7855. for (new i = 0; i < sizeof(Weapons); i++) format(szDialog, sizeof(szDialog), "%s%s ($%s)\n", szDialog, GetWeaponNameEx(Weapons[i][WeaponId]), number_format(Businesses[iBusiness][bItemPrices][i]));
  7856. ShowPlayerDialogEx(playerid, DIALOG_GUNPRICES, DIALOG_STYLE_LIST, "Edit Gun Store Prices", szDialog, "OK", "Cancel");
  7857. Log("logs/business.log", string);
  7858. }
  7859. DeletePVar(playerid, "EditingStoreItem");
  7860. return 1;
  7861. }
  7862. else if (dialogid == DIALOG_GASPRICE)
  7863. {
  7864. if (!response || (GetPVarInt(playerid, "EditingBusiness") != PlayerInfo[playerid][pBusiness]) || PlayerInfo[playerid][pBusinessRank] != 5) {
  7865. }
  7866. else {
  7867. new szSaleText[148], Float:price = floatstr(inputtext);
  7868. if (price < 1 || price > 5000) return SendClientMessageEx(playerid, COLOR_WHITE, "Price can't be lower than $1 or higher than $5,000");
  7869. Businesses[PlayerInfo[playerid][pBusiness]][bGasPrice] = price;
  7870. for (new i; i < MAX_BUSINESS_GAS_PUMPS; i++)
  7871. {
  7872. format(szSaleText,sizeof(szSaleText),"Price Per Gallon: $%.2f\nThis Sale: $%.2f\nGallons: %.3f\nGas Available: %.2f/%.2f gallons", price, Businesses[PlayerInfo[playerid][pBusiness]][GasPumpSalePrice][i], Businesses[PlayerInfo[playerid][pBusiness]][GasPumpSaleGallons][i], Businesses[PlayerInfo[playerid][pBusiness]][GasPumpGallons][i], Businesses[PlayerInfo[playerid][pBusiness]][GasPumpCapacity][i]);
  7873. UpdateDynamic3DTextLabelText(Businesses[PlayerInfo[playerid][pBusiness]][GasPumpSaleTextID][i], COLOR_YELLOW, szSaleText);
  7874. }
  7875. SaveBusiness(PlayerInfo[playerid][pBusiness]);
  7876. format(string, sizeof(string), "Gallon price has been set to %.2f!", price);
  7877. SendClientMessageEx(playerid, COLOR_WHITE, string);
  7878. format(string, sizeof(string), "%s(%d) (IP: %s) has set the gas price to %f in %s", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), price, Businesses[PlayerInfo[playerid][pBusiness]][bName]);
  7879. Log("logs/business.log", string);
  7880. }
  7881. DeletePVar(playerid, "EditingBusiness");
  7882. return 1;
  7883. }
  7884. else if (dialogid == DIALOG_SWITCHGROUP && response)
  7885. {
  7886. if (!(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1 || PlayerInfo[playerid][pFactionModerator] >= 1)) return 1;
  7887. new
  7888. iGroupID = listitem;
  7889. if(arrGroupData[iGroupID][g_iGroupType] == GROUP_TYPE_CONTRACT) {
  7890. return SendClientMessage(playerid, COLOR_WHITE, "You can't switch to a contract agency with this command.");
  7891. }
  7892. format(string, sizeof(string), "You have switched to group ID %d (%s).", iGroupID+1, arrGroupData[iGroupID][g_szGroupName]);
  7893. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  7894. PlayerInfo[playerid][pMember] = iGroupID;
  7895. PlayerInfo[playerid][pRank] = Group_GetMaxRank(iGroupID);
  7896. PlayerInfo[playerid][pLeader] = -1;
  7897. }
  7898. else if (dialogid == DIALOG_MAKELEADER && response)
  7899. {
  7900. if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1 || PlayerInfo[playerid][pFactionModerator] >= 2)
  7901. {
  7902. new
  7903. iGroupID = listitem,
  7904. iTargetID = GetPVarInt(playerid, "MakingLeader");
  7905. if(!arrGroupData[iGroupID][g_szGroupName][0]) { return SendClientMessageEx(playerid, COLOR_GREY, "This group has not been properly set up yet."); }
  7906. PlayerInfo[iTargetID][pLeader] = iGroupID;
  7907. PlayerInfo[iTargetID][pMember] = iGroupID;
  7908. PlayerInfo[iTargetID][pRank] = Group_GetMaxRank(iGroupID);
  7909. PlayerInfo[iTargetID][pDivision] = -1;
  7910. format(string, sizeof(string), "You have been made the leader of the %s by Administrator %s.", arrGroupData[iGroupID][g_szGroupName], GetPlayerNameEx(playerid));
  7911. SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, string);
  7912. format(string, sizeof(string), "You have made %s the leader of the %s.", GetPlayerNameEx(iTargetID), arrGroupData[iGroupID][g_szGroupName]);
  7913. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  7914. format(string, sizeof(string), "%s (%d) has made %s (%d) the leader of the %s.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerNameEx(iTargetID), GetPlayerSQLId(iTargetID), arrGroupData[iGroupID][g_szGroupName]);
  7915. GroupLog(iGroupID, string);
  7916. }
  7917. else SendClientMessageEx(playerid, COLOR_GRAD2, "You do not have access to this.");
  7918. }
  7919. else if (dialogid == DIALOG_HBADGE && response)
  7920. {
  7921. if (!IsAHitman(playerid)) return 1;
  7922. new iGroupID = listitem;
  7923. if(!arrGroupData[iGroupID][g_szGroupName][0]) { return SendClientMessageEx(playerid, COLOR_GREY, "This group has not been properly set up yet."); }
  7924. switch(listitem)
  7925. {
  7926. case 0..20: {
  7927. format(string, sizeof(string), "You have set your badge to %s", arrGroupData[iGroupID][g_szGroupName]);
  7928. SendClientMessageEx(playerid, COLOR_WHITE, string);
  7929. SetPlayerColor(playerid, arrGroupData[iGroupID][g_hDutyColour] * 256);
  7930. SetPVarInt(playerid, "HitmanBadgeColour", arrGroupData[iGroupID][g_hDutyColour] * 256);
  7931. }
  7932. default: {
  7933. SendClientMessageEx(playerid, COLOR_GREY, "Invalid group specified.");
  7934. }
  7935. }
  7936. }
  7937. else if(dialogid == DIALOG_CDBUY)
  7938. {
  7939. // Account Eating Bug Fix
  7940. if(!IsPlayerInAnyVehicle(playerid))
  7941. {
  7942. TogglePlayerControllable(playerid, 1);
  7943. SendClientMessageEx(playerid,COLOR_GRAD2,"You need to be in the vehicle you wish to purchase.");
  7944. return 1;
  7945. }
  7946. new vehicleid = GetPlayerVehicleID(playerid);
  7947. new playervehicleid = GetPlayerFreeVehicleId(playerid);
  7948. new v = GetBusinessCarSlot(vehicleid);
  7949. new d = GetCarBusiness(vehicleid);
  7950. if(response)
  7951. {
  7952. if(!vehicleCountCheck(playerid))
  7953. {
  7954. TogglePlayerControllable(playerid, 1);
  7955. RemovePlayerFromVehicle(playerid);
  7956. new Float:slx, Float:sly, Float:slz;
  7957. GetPlayerPos(playerid, slx, sly, slz);
  7958. SetPlayerPos(playerid, slx, sly, slz+1.2);
  7959. return SendClientMessageEx(playerid, COLOR_GREY, "ERROR: You cannot own any additional vehicles. You may purchase additional vehicle slots through /vstorage.");
  7960. }
  7961. if(Businesses[d][bPurchaseX] == 0.0 && Businesses[d][bPurchaseY] == 0.0 && Businesses[d][bPurchaseZ] == 0.0)
  7962. {
  7963. SendClientMessageEx(playerid, COLOR_GRAD1, "ERROR: The owner of this Car Dealership hasn't set the purchased vehicles spawn point.");
  7964. RemovePlayerFromVehicle(playerid);
  7965. new Float:slx, Float:sly, Float:slz;
  7966. GetPlayerPos(playerid, slx, sly, slz);
  7967. SetPlayerPos(playerid, slx, sly, slz+1.2);
  7968. TogglePlayerControllable(playerid, 1);
  7969. return 1;
  7970. }
  7971. new randcolor1 = Random(0, 126);
  7972. new randcolor2 = Random(0, 126);
  7973. SetPlayerPos(playerid, Businesses[d][bParkPosX][v], Businesses[d][bParkPosY][v], Businesses[d][bParkPosZ][v]+2);
  7974. TogglePlayerControllable(playerid, 1);
  7975. new cost;
  7976. if(PlayerInfo[playerid][pDonateRank] < 1)
  7977. {
  7978. cost = Businesses[d][bPrice][v];
  7979. if(PlayerInfo[playerid][pCash] < cost)
  7980. {
  7981. SendClientMessageEx(playerid, COLOR_GRAD1, "ERROR: You don't have enough money to buy this.");
  7982. RemovePlayerFromVehicle(playerid);
  7983. new Float:slx, Float:sly, Float:slz;
  7984. GetPlayerPos(playerid, slx, sly, slz);
  7985. SetPlayerPos(playerid, slx, sly, slz+1.2);
  7986. return 1;
  7987. }
  7988. format(string, sizeof(string), " Thank you for buying at %s.", Businesses[d][bName]);
  7989. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  7990. PlayerInfo[playerid][pCash] -= cost;
  7991. cost = Businesses[d][bPrice][v] / 100 * 15;
  7992. Businesses[d][bSafeBalance] += TaxSale( cost );
  7993. }
  7994. else
  7995. {
  7996. cost = Businesses[d][bPrice][v];
  7997. if(PlayerInfo[playerid][pCash] < cost)
  7998. {
  7999. SendClientMessageEx(playerid, COLOR_GRAD1, "ERROR: You don't have enough money to buy this.");
  8000. RemovePlayerFromVehicle(playerid);
  8001. new Float:slx, Float:sly, Float:slz;
  8002. GetPlayerPos(playerid, slx, sly, slz);
  8003. SetPlayerPos(playerid, slx, sly, slz+1.2);
  8004. return 1;
  8005. }
  8006. format(string, sizeof(string), " Thank you for buying at %s.",Businesses[d][bName]);
  8007. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  8008. PlayerInfo[playerid][pCash] -= cost;
  8009. cost = Businesses[d][bPrice][v] / 100 * 15;
  8010. Businesses[d][bSafeBalance] += TaxSale( cost );
  8011. }
  8012. if(PlayerInfo[playerid][pTut] == 15)
  8013. {
  8014. PlayerInfo[playerid][pCarLic] = gettime() + (86400); // temp 1 day license
  8015. PlayerInfo[playerid][pTut]++;
  8016. AdvanceTutorial(playerid);
  8017. }
  8018. Businesses[d][bInventory]--;
  8019. Businesses[d][bTotalSales]++;
  8020. IsPlayerEntering{playerid} = true;
  8021. new car = CreatePlayerVehicle(playerid, playervehicleid, Businesses[d][bModel][v], Businesses[d][bPurchaseX], Businesses[d][bPurchaseY], Businesses[d][bPurchaseZ], Businesses[d][bPurchaseAngle], randcolor1, randcolor2, cost, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
  8022. PutPlayerInVehicle(playerid, car, 0);
  8023. SaveBusiness(d);
  8024. format(string, sizeof(string), "%s(%d) has purchased a %s(%d) from %s for $%s", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), VehicleName[Businesses[d][bModel][v] - 400], Businesses[d][bModel][v], Businesses[d][bName], number_format(Businesses[d][bPrice][v]));
  8025. Log("logs/dealership.log", string);
  8026. }
  8027. else
  8028. {
  8029. RemovePlayerFromVehicle(playerid);
  8030. new Float:slx, Float:sly, Float:slz;
  8031. GetPlayerPos(playerid, slx, sly, slz);
  8032. SetPlayerPos(playerid, slx, sly, slz+1.2);
  8033. TogglePlayerControllable(playerid, 1);
  8034. return 1;
  8035. }
  8036. }
  8037. else if(dialogid == DIALOG_LOADTRUCKOLD) // TRUCKER JOB LOAD TRUCK
  8038. {
  8039. if(response)
  8040. {
  8041. if(listitem == 0) // Legal goods
  8042. {
  8043. ShowPlayerDialogEx(playerid, DIALOG_LOADTRUCKL, DIALOG_STYLE_LIST, "What do you want to transport?","{00F70C}Food & beverages\n{00F70C}Clothing\n{00F70C}Materials\n{00F70C}24/7 Items", "Select", "Cancel");
  8044. }
  8045. if(listitem == 1) // Illegal goods
  8046. {
  8047. new level = PlayerInfo[playerid][pTruckSkill];
  8048. if(level >= 0 && level <= 50)
  8049. {
  8050. ShowPlayerDialogEx(playerid, DIALOG_LOADTRUCKI, DIALOG_STYLE_LIST, "What do you want to transport?","{FF0606}Weapons {FFFFFF}(Level 1 Bonus: Free 9mm)\n{FF0606}Drugs {FFFFFF}(Level 1 Bonus: Free 2 Cannabis, 1 crack)\n{FF0606}Illegal materials {FFFFFF}(Level 1 Bonus: Free 100 materials)", "Select", "Cancel");
  8051. }
  8052. else if(level >= 51 && level <= 100)
  8053. {
  8054. ShowPlayerDialogEx(playerid, DIALOG_LOADTRUCKI, DIALOG_STYLE_LIST, "What do you want to transport?","{FF0606}Weapons {FFFFFF}(Level 2 Bonus: Free Shotgun)\n{FF0606}Drugs {FFFFFF}(Level 2 Bonus: Free 4 Cannabis, 2 crack)\n{FF0606}Illegal materials {FFFFFF}(Level 2 Bonus: Free 200 materials)", "Select", "Cancel");
  8055. }
  8056. else if(level >= 101 && level <= 200)
  8057. {
  8058. ShowPlayerDialogEx(playerid, DIALOG_LOADTRUCKI, DIALOG_STYLE_LIST, "What do you want to transport?","{FF0606}Weapons {FFFFFF}(Level 3 Bonus: Free MP5)\n{FF0606}Drugs {FFFFFF}(Level 3 Bonus: Free 6 Cannabis, 3 crack)\n{FF0606}Illegal materials {FFFFFF}(Level 3 Bonus: Free 400 materials)", "Select", "Cancel");
  8059. }
  8060. else if(level >= 201 && level <= 400)
  8061. {
  8062. ShowPlayerDialogEx(playerid, DIALOG_LOADTRUCKI, DIALOG_STYLE_LIST, "What do you want to transport?","{FF0606}Weapons {FFFFFF}(Level 4 Bonus: Free Deagle)\n{FF0606}Drugs {FFFFFF}(Level 4 Bonus: Free 8 Cannabis, 4 crack)\n{FF0606}Illegal materials {FFFFFF}(Level 4 Bonus: Free 600 materials)", "Select", "Cancel");
  8063. }
  8064. else if(level >= 401)
  8065. {
  8066. ShowPlayerDialogEx(playerid, DIALOG_LOADTRUCKI, DIALOG_STYLE_LIST, "What do you want to transport?","{FF0606}Weapons {FFFFFF}(Level 5 Bonus: Free AK-47)\n{FF0606}Drugs {FFFFFF}(Level 5 Bonus: Free 10 Cannabis, 5 crack)\n{FF0606}Illegal materials {FFFFFF}(Level 5 Bonus: Free 1000 materials)", "Select", "Cancel");
  8067. }
  8068. }
  8069. }
  8070. else
  8071. {
  8072. DeletePVar(playerid, "IsFrozen");
  8073. TogglePlayerControllable(playerid, 1);
  8074. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You canceled the loading of the shipment, type /loadshipment to try again.");
  8075. }
  8076. }
  8077. else if(dialogid == DIALOG_LOADTRUCKL) // TRUCKER JOB LEGAL GOODS
  8078. {
  8079. if(response)
  8080. {
  8081. if(listitem == 0) // Food & beverages
  8082. {
  8083. SetPVarInt(playerid, "TruckDeliver", 1);
  8084. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Please wait a moment while the vehicle is being loaded with food & beverages....");
  8085. }
  8086. if(listitem == 1) // Clothing
  8087. {
  8088. SetPVarInt(playerid, "TruckDeliver", 2);
  8089. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Please wait a moment while the vehicle is being loaded with clothing....");
  8090. }
  8091. if(listitem == 2) // Materials
  8092. {
  8093. SetPVarInt(playerid, "TruckDeliver", 3);
  8094. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Please wait a moment while the vehicle is being loaded with materials....");
  8095. }
  8096. if(listitem == 3) // 24/7 Items
  8097. {
  8098. SetPVarInt(playerid, "TruckDeliver", 4);
  8099. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Please wait a moment while the vehicle is being loaded with 24/7 items....");
  8100. }
  8101. SetPVarInt(playerid, "LoadType", 1);
  8102. SetPVarInt(playerid, "LoadTruckTime", 10);
  8103. SetTimerEx("LoadTruckOld", 1000, 0, "d", playerid);
  8104. }
  8105. else
  8106. {
  8107. DeletePVar(playerid, "IsFrozen");
  8108. TogglePlayerControllable(playerid, 1);
  8109. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You canceled the loading of the shipment, type /loadshipment to try again.");
  8110. }
  8111. }
  8112. else if(dialogid == DIALOG_LOADTRUCKI) // TRUCKER JOB ILLEGAL GOODS
  8113. {
  8114. if(response)
  8115. {
  8116. // 1 = food and bev
  8117. // 2 = clothing
  8118. // 3 = legal mats
  8119. // 4 = 24/7 items
  8120. // 5 = weapons
  8121. // 6 = illegal drugs
  8122. // 7 = illegal materials
  8123. //new level = PlayerInfo[playerid][pTruckSkill];
  8124. if(listitem == 0) // Weapons
  8125. {
  8126. SetPVarInt(playerid, "TruckDeliver", 5);
  8127. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Please wait a moment while the vehicle is being loaded with weapons....");
  8128. }
  8129. if(listitem == 1) // Drugs
  8130. {
  8131. SetPVarInt(playerid, "TruckDeliver", 6);
  8132. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Please wait a moment while the vehicle is being loaded with drugs....");
  8133. }
  8134. if(listitem == 2) // Illegal materials
  8135. {
  8136. SetPVarInt(playerid, "TruckDeliver", 7);
  8137. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Please wait a moment while the vehicle is being loaded with illegal materials....");
  8138. }
  8139. SetPVarInt(playerid, "LoadType", 1);
  8140. SetPVarInt(playerid, "LoadTruckTime", 10);
  8141. SetTimerEx("LoadTruckOld", 1000, 0, "d", playerid);
  8142. }
  8143. else
  8144. {
  8145. DeletePVar(playerid, "IsFrozen");
  8146. TogglePlayerControllable(playerid, 1);
  8147. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You canceled the loading of the shipment, type /loadshipment to try again.");
  8148. }
  8149. }
  8150. else if(dialogid == DIALOG_ADMINAUCTIONS)
  8151. {
  8152. if(response) {
  8153. SetPVarInt(playerid, "AuctionItem", listitem);
  8154. ShowPlayerDialogEx(playerid, DIALOG_ADMINAUCTIONS2, DIALOG_STYLE_LIST, "Edit Auction", "Auction Enabled\nAuction Item Description\nAuction Expiration\nStarting Bid\nIncease Increment", "Select", "Exit");
  8155. }
  8156. }
  8157. else if(dialogid == DIALOG_ADMINAUCTIONS2)
  8158. {
  8159. if(response)
  8160. {
  8161. switch(listitem)
  8162. {
  8163. case 0:
  8164. {
  8165. ShowPlayerDialogEx(playerid, DIALOG_ADMINAUCTIONS3, DIALOG_STYLE_LIST, "Edit Auction Enabled", "Enabled\nDisabled", "Select", "Exit");
  8166. }
  8167. case 1:
  8168. {
  8169. ShowPlayerDialogEx(playerid, DIALOG_ADMINAUCTIONS4, DIALOG_STYLE_INPUT, "Edit Auction Item Description", "Enter below the item description for the auction.","Change","Exit");
  8170. }
  8171. case 2:
  8172. {
  8173. ShowPlayerDialogEx(playerid, DIALOG_ADMINAUCTIONS5, DIALOG_STYLE_INPUT, "Edit Auction Expiration", "Enter the amount of minutes you want the auction to last for.","Change","Exit");
  8174. }
  8175. case 3:
  8176. {
  8177. ShowPlayerDialogEx(playerid, DIALOG_ADMINAUCTIONS6, DIALOG_STYLE_INPUT, "Edit Auction Starting Bid", "Enter the starting bid amount.","Change","Exit");
  8178. }
  8179. case 4:
  8180. {
  8181. ShowPlayerDialogEx(playerid, DIALOG_ADMINAUCTIONS7, DIALOG_STYLE_INPUT, "Edit Auction Increase Increment", "Enter the increase increment amount.","Change","Exit");
  8182. }
  8183. }
  8184. }
  8185. }
  8186. else if(dialogid == DIALOG_ADMINAUCTIONS3)
  8187. {
  8188. if(response) {
  8189. new
  8190. AuctionItem = GetPVarInt(playerid, "AuctionItem"),
  8191. szMessage[128];
  8192. if(listitem == 0)
  8193. {
  8194. if(Auctions[AuctionItem][Expires] == 0) {
  8195. SendClientMessageEx(playerid, COLOR_GREY, "Before you can start an auction you must set the expiration time.");
  8196. return 1;
  8197. }
  8198. format(szMessage, sizeof(szMessage), "%s(%d) (IP:%s) has edited auction %i enabled to 1 (Enabled)", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), AuctionItem);
  8199. Log("logs/adminauction.log", szMessage);
  8200. Auctions[AuctionItem][InProgress] = 1;
  8201. Auctions[AuctionItem][Timer] = SetTimerEx("EndAuction", 60000, true, "i", AuctionItem);
  8202. SendClientMessageEx(playerid, COLOR_WHITE, "Auction has been enabled, people can start biding.");
  8203. }
  8204. else
  8205. {
  8206. KillTimer(Auctions[AuctionItem][Timer]);
  8207. format(szMessage, sizeof(szMessage), "%s(%d) (IP:%s) has edited auction %i enabled to 0 (disabled)", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), AuctionItem);
  8208. Log("logs/adminauction.log", szMessage);
  8209. Auctions[AuctionItem][InProgress] = 0;
  8210. SendClientMessageEx(playerid, COLOR_WHITE, "Auction has been disabled.");
  8211. }
  8212. SaveAuction(AuctionItem);
  8213. DeletePVar(playerid, "AuctionItem");
  8214. }
  8215. }
  8216. else if(dialogid == DIALOG_ADMINAUCTIONS4)
  8217. {
  8218. if(response)
  8219. {
  8220. new
  8221. AuctionItem = GetPVarInt(playerid, "AuctionItem"),
  8222. szMessage[128];
  8223. if(isnull(inputtext))
  8224. {
  8225. ShowPlayerDialogEx(playerid, DIALOG_ADMINAUCTIONS4, DIALOG_STYLE_INPUT, "Edit Auction Item Description", "Enter below the item description for the auction.","Change","Exit");
  8226. return 1;
  8227. }
  8228. if(strlen(inputtext) > 64)
  8229. {
  8230. SendClientMessageEx(playerid, COLOR_GREY, "The item description can't be longer then 64 characters.");
  8231. ShowPlayerDialogEx(playerid, DIALOG_ADMINAUCTIONS4, DIALOG_STYLE_INPUT, "Edit Auction Item Description", "Enter below the item description for the auction.","Change","Exit");
  8232. return 1;
  8233. }
  8234. format(szMessage, sizeof(szMessage), "%s(%d) (IP:%s) has edited auction %i item description to %s", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), AuctionItem, inputtext);
  8235. Log("logs/adminauction.log", szMessage);
  8236. format(Auctions[AuctionItem][BiddingFor], 64, inputtext);
  8237. SaveAuction(AuctionItem);
  8238. DeletePVar(playerid, "AuctionItem");
  8239. SendClientMessageEx(playerid, COLOR_WHITE, "You have adjusted the auction item description.");
  8240. }
  8241. }
  8242. else if(dialogid == DIALOG_ADMINAUCTIONS5)
  8243. {
  8244. if(response) {
  8245. new
  8246. Time = strval(inputtext),
  8247. AuctionItem = GetPVarInt(playerid, "AuctionItem"),
  8248. szMessage[128];
  8249. if(Time < 0) {
  8250. ShowPlayerDialogEx(playerid, DIALOG_ADMINAUCTIONS5, DIALOG_STYLE_INPUT, "Edit Auction Expiration", "Enter the amount of minutes you want the auction to last for.","Change","Exit");
  8251. SendClientMessageEx(playerid, COLOR_GREY, "The time can't be below 0.");
  8252. return 1;
  8253. }
  8254. format(szMessage, sizeof(szMessage), "%s(%d) (IP:%s) has edited auction %i expire time to %i", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), AuctionItem, Time);
  8255. Log("logs/adminauction.log", szMessage);
  8256. Auctions[AuctionItem][Expires] = Time;
  8257. SaveAuction(AuctionItem);
  8258. DeletePVar(playerid, "AuctionItem");
  8259. SendClientMessageEx(playerid, COLOR_WHITE, "You have adjusted the auction expiration time.");
  8260. }
  8261. }
  8262. else if(dialogid == DIALOG_ADMINAUCTIONS6)
  8263. {
  8264. if(response) {
  8265. new
  8266. Time = strval(inputtext),
  8267. AuctionItem = GetPVarInt(playerid, "AuctionItem"),
  8268. szMessage[128];
  8269. if(Time < 0) {
  8270. ShowPlayerDialogEx(playerid, DIALOG_ADMINAUCTIONS6, DIALOG_STYLE_INPUT, "Edit Auction Starting Bid", "Enter the starting bid amount.","Change","Exit");
  8271. SendClientMessageEx(playerid, COLOR_GREY, "The starting bid can't be below 0.");
  8272. return 1;
  8273. }
  8274. format(szMessage, sizeof(szMessage), "%s(%d) (IP:%s) has edited auction %i starting bid to %i", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), AuctionItem, Time );
  8275. Log("logs/adminauction.log", szMessage);
  8276. Auctions[AuctionItem][Bid] = Time;
  8277. SaveAuction(AuctionItem);
  8278. DeletePVar(playerid, "AuctionItem");
  8279. SendClientMessageEx(playerid, COLOR_WHITE, "You have adjusted the bid starting amount.");
  8280. }
  8281. }
  8282. else if(dialogid == DIALOG_ADMINAUCTIONS7)
  8283. {
  8284. if(response) {
  8285. new
  8286. Time = strval(inputtext),
  8287. AuctionItem = GetPVarInt(playerid, "AuctionItem"),
  8288. szMessage[128];
  8289. if(Time < 0) {
  8290. ShowPlayerDialogEx(playerid, DIALOG_ADMINAUCTIONS7, DIALOG_STYLE_INPUT, "Edit Auction Increase Increment", "Enter the increase increment amount.","Change","Exit");
  8291. SendClientMessageEx(playerid, COLOR_GREY, "The increase increment amount can't be below 0.");
  8292. return 1;
  8293. }
  8294. format(szMessage, sizeof(szMessage), "%s(%d) (IP:%s) has edited auction %i increment to %i", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), AuctionItem, Time );
  8295. Log("logs/adminauction.log", szMessage);
  8296. Auctions[AuctionItem][Increment] = Time;
  8297. SaveAuction(AuctionItem);
  8298. DeletePVar(playerid, "AuctionItem");
  8299. SendClientMessageEx(playerid, COLOR_WHITE, "You have adjusted the increase increment amount.");
  8300. }
  8301. }
  8302. else if(dialogid == DIALOG_AUCTIONS)
  8303. {
  8304. if(response) {
  8305. if(Auctions[listitem][InProgress] == 1) {
  8306. new
  8307. szInfo[200];
  8308. format(szInfo, sizeof(szInfo), "{00BFFF}Item: {FFFFFF}%s\n\n{00BFFF}Current Bid: {FFFFFF}$%i\n\n{00BFFF}Bidder: {FFFFFF}%s\n\n{00BFFF}Expires: {FFFFFF}%s", Auctions[listitem][BiddingFor], Auctions[listitem][Bid], Auctions[listitem][Wining], Auctions[listitem][Expires]);
  8309. ShowPlayerDialogEx(playerid, DIALOG_AUCTIONS2, DIALOG_STYLE_MSGBOX, "{00BFFF}Auction Information", szInfo, "Bid", "Exit");
  8310. SetPVarInt(playerid, "AuctionItem", listitem);
  8311. }
  8312. else SendClientMessageEx(playerid, COLOR_GREY, "That auction isn't currently available.");
  8313. }
  8314. }
  8315. else if(dialogid == DIALOG_AUCTIONS2)
  8316. {
  8317. if(response) {
  8318. new
  8319. AuctionItem = GetPVarInt(playerid, "AuctionItem");
  8320. if(Auctions[AuctionItem][InProgress] == 1) {
  8321. new
  8322. szInfo[128];
  8323. format(szInfo, sizeof(szInfo), "You are bidding on %s. The current bid is $%i, to place a bid it must be higher then the current one.", Auctions[AuctionItem][BiddingFor], Auctions[AuctionItem][Bid]);
  8324. ShowPlayerDialogEx(playerid, DIALOG_AUCTIONS3, DIALOG_STYLE_INPUT, "Auction - Bidding",szInfo,"Place Bid","Exit");
  8325. }
  8326. else {
  8327. SendClientMessageEx(playerid, COLOR_GREY, "That auction isn't currently available.");
  8328. DeletePVar(playerid, "AuctionItem");
  8329. }
  8330. }
  8331. }
  8332. else if(dialogid == DIALOG_AUCTIONS3)
  8333. {
  8334. if(response) {
  8335. new
  8336. BidPlaced = strval(inputtext),
  8337. AuctionItem = GetPVarInt(playerid, "AuctionItem");
  8338. if(GetPlayerCash(playerid) < BidPlaced) {
  8339. SendClientMessageEx(playerid, COLOR_GREY, "You can't bid money you don't have.");
  8340. return 1;
  8341. }
  8342. if(BidPlaced < 1) {
  8343. SendClientMessageEx(playerid, COLOR_GREY, "You can't place a bid under $1.");
  8344. return 1;
  8345. }
  8346. if(BidPlaced < Auctions[AuctionItem][Bid]+Auctions[AuctionItem][Increment]) {
  8347. new szMessage[128];
  8348. format(szMessage, sizeof(szMessage), "You need to bid at least %i over the current bid of %i.", Auctions[AuctionItem][Increment], Auctions[AuctionItem][Bid]);
  8349. SendClientMessageEx(playerid, COLOR_GREY, szMessage);
  8350. return 1;
  8351. }
  8352. if(Auctions[AuctionItem][InProgress] == 1) {
  8353. if(BidPlaced > Auctions[AuctionItem][Bid]) {
  8354. SetPVarInt(playerid, "BidPlaced", BidPlaced);
  8355. HigherBid(playerid);
  8356. }
  8357. else SendClientMessageEx(playerid, COLOR_GREY, "That bid is to low, a higher amount is needed to place the bid.");
  8358. }
  8359. else SendClientMessageEx(playerid, COLOR_GREY, "That auction isn't currently available.");
  8360. }
  8361. }
  8362. if(dialogid == DIALOG_CGAMESADMINMENU)
  8363. {
  8364. if(response) {
  8365. switch(listitem)
  8366. {
  8367. case 0:
  8368. {
  8369. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSELECTPOKER);
  8370. }
  8371. case 1:
  8372. {
  8373. }
  8374. case 2:
  8375. {
  8376. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESCREDITS);
  8377. }
  8378. }
  8379. }
  8380. }
  8381. if(dialogid == DIALOG_CGAMESSELECTPOKER)
  8382. {
  8383. if(response) {
  8384. SetPVarInt(playerid, "tmpEditPokerTableID", listitem+1);
  8385. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPOKER);
  8386. } else {
  8387. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESADMINMENU);
  8388. }
  8389. }
  8390. if(dialogid == DIALOG_CGAMESSETUPPOKER)
  8391. {
  8392. if(response) {
  8393. new tableid = GetPVarInt(playerid, "tmpEditPokerTableID")-1;
  8394. if(PokerTable[tableid][pkrPlaced] == 0) {
  8395. switch(listitem)
  8396. {
  8397. case 0: // Place Poker Table
  8398. {
  8399. new szString[128];
  8400. format(szString, sizeof(szString), "Press '{3399FF}~k~~PED_SPRINT~{FFFFFF}' to place poker table.");
  8401. SendClientMessage(playerid, COLOR_WHITE, szString);
  8402. SetPVarInt(playerid, "tmpPlacePokerTable", 1);
  8403. }
  8404. }
  8405. } else {
  8406. switch(listitem)
  8407. {
  8408. case 0: // Edit Poker Table
  8409. {
  8410. SetPVarFloat(playerid, "tmpPkrX", PokerTable[tableid][pkrX]);
  8411. SetPVarFloat(playerid, "tmpPkrY", PokerTable[tableid][pkrY]);
  8412. SetPVarFloat(playerid, "tmpPkrZ", PokerTable[tableid][pkrZ]);
  8413. SetPVarFloat(playerid, "tmpPkrRX", PokerTable[tableid][pkrRX]);
  8414. SetPVarFloat(playerid, "tmpPkrRY", PokerTable[tableid][pkrRY]);
  8415. SetPVarFloat(playerid, "tmpPkrRZ", PokerTable[tableid][pkrRZ]);
  8416. EditObject(playerid, PokerTable[tableid][pkrObjectID]);
  8417. new szString[128];
  8418. format(szString, sizeof(szString), "You have selected Poker Table %d, You may now customize it's position/rotation.", tableid);
  8419. SendClientMessage(playerid, COLOR_WHITE, szString);
  8420. }
  8421. case 1: // Destroy Poker Table
  8422. {
  8423. DestroyPokerTable(tableid);
  8424. new szString[64];
  8425. format(szString, sizeof(szString), "You have deleted Poker Table %d.", tableid);
  8426. SendClientMessage(playerid, COLOR_WHITE, szString);
  8427. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSELECTPOKER);
  8428. }
  8429. }
  8430. }
  8431. } else {
  8432. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSELECTPOKER);
  8433. }
  8434. }
  8435. if(dialogid == DIALOG_CGAMESCREDITS)
  8436. {
  8437. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESADMINMENU);
  8438. }
  8439. if(dialogid == DIALOG_CGAMESSETUPPGAME)
  8440. {
  8441. if(response) {
  8442. switch(listitem)
  8443. {
  8444. case 0: // Buy-In Max
  8445. {
  8446. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME2);
  8447. }
  8448. case 1: // Buy-In Min
  8449. {
  8450. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME3);
  8451. }
  8452. case 2: // Blind
  8453. {
  8454. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME4);
  8455. }
  8456. case 3: // Limit
  8457. {
  8458. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME5);
  8459. }
  8460. case 4: // Password
  8461. {
  8462. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME6);
  8463. }
  8464. case 5: // Round Delay
  8465. {
  8466. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME7);
  8467. }
  8468. case 6: // Start Game
  8469. {
  8470. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESBUYINPOKER);
  8471. }
  8472. }
  8473. } else {
  8474. LeavePokerTable(playerid);
  8475. }
  8476. }
  8477. if(dialogid == DIALOG_CGAMESSETUPPGAME2)
  8478. {
  8479. if(response) {
  8480. if(strval(inputtext) < 1 || strval(inputtext) > 10000) {
  8481. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME2);
  8482. }
  8483. if(strval(inputtext) <= PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrBuyInMin]) {
  8484. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME2);
  8485. }
  8486. PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrBuyInMax] = strval(inputtext);
  8487. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME);
  8488. } else {
  8489. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME);
  8490. }
  8491. }
  8492. if(dialogid == DIALOG_CGAMESSETUPPGAME3)
  8493. {
  8494. if(response) {
  8495. if(strval(inputtext) < 1 || strval(inputtext) > 10000) {
  8496. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME3);
  8497. }
  8498. if(strval(inputtext) >= PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrBuyInMax]) {
  8499. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME3);
  8500. }
  8501. PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrBuyInMin] = strval(inputtext);
  8502. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME);
  8503. } else {
  8504. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME);
  8505. }
  8506. }
  8507. if(dialogid == DIALOG_CGAMESSETUPPGAME4)
  8508. {
  8509. if(response) {
  8510. if(strval(inputtext) < 1 || strval(inputtext) > 10000) {
  8511. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME4);
  8512. }
  8513. PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrBlind] = strval(inputtext);
  8514. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME);
  8515. } else {
  8516. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME);
  8517. }
  8518. }
  8519. if(dialogid == DIALOG_CGAMESSETUPPGAME5)
  8520. {
  8521. if(response) {
  8522. if(strval(inputtext) < 2 || strval(inputtext) > 6) {
  8523. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME5);
  8524. }
  8525. PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrLimit] = strval(inputtext);
  8526. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME);
  8527. } else {
  8528. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME);
  8529. }
  8530. }
  8531. if(dialogid == DIALOG_CGAMESSETUPPGAME6)
  8532. {
  8533. if(response) {
  8534. new tableid = GetPVarInt(playerid, "pkrTableID")-1;
  8535. strmid(PokerTable[tableid][pkrPass], inputtext, 0, strlen(inputtext), 32);
  8536. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME);
  8537. } else {
  8538. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME);
  8539. }
  8540. }
  8541. if(dialogid == DIALOG_CGAMESSETUPPGAME7)
  8542. {
  8543. if(response) {
  8544. if(strval(inputtext) < 15 || strval(inputtext) > 120) {
  8545. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME7);
  8546. }
  8547. PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrSetDelay] = strval(inputtext);
  8548. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME);
  8549. } else {
  8550. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESSETUPPGAME);
  8551. }
  8552. }
  8553. if(dialogid == DIALOG_CGAMESBUYINPOKER)
  8554. {
  8555. if(response) {
  8556. if(strval(inputtext) < PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrBuyInMin] || strval(inputtext) > PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrBuyInMax] || strval(inputtext) > GetPlayerCash(playerid)) {
  8557. return ShowCasinoGamesMenu(playerid, DIALOG_CGAMESBUYINPOKER);
  8558. }
  8559. PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrActivePlayers]++;
  8560. SetPVarInt(playerid, "pkrChips", GetPVarInt(playerid, "pkrChips")+strval(inputtext));
  8561. //SetPVarInt(playerid, "cgChips", GetPVarInt(playerid, "cgChips")-strval(inputtext));
  8562. GivePlayerCashEx(playerid, TYPE_ONHAND, -strval(inputtext));
  8563. format(string, sizeof(string), "%s(%d) (IP:%s) has bought in with the amount of $%s (%d)", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(GetPVarInt(playerid, "pkrChips")), GetPVarInt(playerid, "pkrTableID")-1);
  8564. Log("logs/poker.log", string);
  8565. if(PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrActive] == 3 && PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrRound] == 0 && PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrDelay] >= 6) {
  8566. SetPVarInt(playerid, "pkrStatus", 1);
  8567. }
  8568. else if(PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrActive] < 3) {
  8569. SetPVarInt(playerid, "pkrStatus", 1);
  8570. }
  8571. if(PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrActive] == 1 && GetPVarInt(playerid, "pkrRoomLeader")) {
  8572. PokerTable[GetPVarInt(playerid, "pkrTableID")-1][pkrActive] = 2;
  8573. SelectTextDraw(playerid, COLOR_YELLOW);
  8574. }
  8575. } else {
  8576. return LeavePokerTable(playerid);
  8577. }
  8578. }
  8579. if(dialogid == DIALOG_CGAMESCALLPOKER)
  8580. {
  8581. if(response) {
  8582. new tableid = GetPVarInt(playerid, "pkrTableID")-1;
  8583. new actualBet = PokerTable[tableid][pkrActiveBet]-GetPVarInt(playerid, "pkrCurrentBet");
  8584. if(actualBet > GetPVarInt(playerid, "pkrChips")) {
  8585. PokerTable[tableid][pkrPot] += GetPVarInt(playerid, "pkrChips");
  8586. SetPVarInt(playerid, "pkrChips", 0);
  8587. SetPVarInt(playerid, "pkrCurrentBet", PokerTable[tableid][pkrActiveBet]);
  8588. } else {
  8589. PokerTable[tableid][pkrPot] += actualBet;
  8590. SetPVarInt(playerid, "pkrChips", GetPVarInt(playerid, "pkrChips")-actualBet);
  8591. SetPVarInt(playerid, "pkrCurrentBet", PokerTable[tableid][pkrActiveBet]);
  8592. }
  8593. SetPVarString(playerid, "pkrStatusString", "Call");
  8594. PokerRotateActivePlayer(tableid);
  8595. ApplyAnimation(playerid, "CASINO", "cards_raise", 4.1, 0, 1, 1, 1, 1, 1);
  8596. }
  8597. DeletePVar(playerid, "pkrActionChoice");
  8598. }
  8599. if(dialogid == DIALOG_CGAMESRAISEPOKER)
  8600. {
  8601. if(response) {
  8602. new tableid = GetPVarInt(playerid, "pkrTableID")-1;
  8603. new actualRaise = strval(inputtext)-GetPVarInt(playerid, "pkrCurrentBet");
  8604. if(strval(inputtext) >= PokerTable[tableid][pkrActiveBet]+PokerTable[tableid][pkrBlind]/2 && strval(inputtext) <= GetPVarInt(playerid, "pkrCurrentBet")+GetPVarInt(playerid, "pkrChips")) {
  8605. PokerTable[tableid][pkrPot] += actualRaise;
  8606. PokerTable[tableid][pkrActiveBet] = strval(inputtext);
  8607. SetPVarInt(playerid, "pkrChips", GetPVarInt(playerid, "pkrChips")-actualRaise);
  8608. SetPVarInt(playerid, "pkrCurrentBet", PokerTable[tableid][pkrActiveBet]);
  8609. SetPVarString(playerid, "pkrStatusString", "Raise");
  8610. PokerTable[tableid][pkrRotations] = 0;
  8611. PokerRotateActivePlayer(tableid);
  8612. ApplyAnimation(playerid, "CASINO", "cards_raise", 4.1, 0, 1, 1, 1, 1, 1);
  8613. } else {
  8614. ShowCasinoGamesMenu(playerid, DIALOG_CGAMESRAISEPOKER);
  8615. }
  8616. }
  8617. DeletePVar(playerid, "pkrActionChoice");
  8618. }
  8619. if(dialogid == DIALOG_CHARGEPLAYER)
  8620. {
  8621. if(response)
  8622. {
  8623. if(PlayerInfo[playerid][pCredits] < GetPVarInt(playerid, "FineAmount"))
  8624. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to be fined.");
  8625. new reason[60];
  8626. GetPVarString(playerid, "FineReason", reason, 60);
  8627. format(string, sizeof(string), "AdmCmd: %s(%d) was fined %s credits by %s, reason: %s", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), number_format(GetPVarInt(playerid, "FineAmount")), GetPlayerNameEx(GetPVarInt(playerid, "FineBy")), reason);
  8628. Log("logs/admin.log", string);
  8629. format(string, sizeof(string), "[CHARGEPLAYER] [User: %s(%i)] [IP: %s] [Credits: %s] [Charged: %s]", GetPlayerNameEx(playerid), PlayerInfo[playerid][pId], GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(GetPVarInt(playerid, "FineAmount")));
  8630. Log("logs/credits.log", string);
  8631. GivePlayerCredits(playerid, -GetPVarInt(playerid, "FineAmount"), 1);
  8632. format(string, sizeof(string), "You were charged %s credits for %s by %s.", number_format(GetPVarInt(playerid, "FineAmount")), reason, GetPlayerNameEx(GetPVarInt(playerid, "FineBy")));
  8633. SendClientMessageEx(playerid, COLOR_CYAN, string);
  8634. format(string, sizeof(string), "You charged %s %s credits for %s.", GetPlayerNameEx(playerid), number_format(GetPVarInt(playerid, "FineAmount")), reason);
  8635. SendClientMessageEx(GetPVarInt(playerid, "FineBy"), COLOR_CYAN, string);
  8636. }
  8637. else
  8638. {
  8639. SendClientMessageEx(GetPVarInt(playerid, "FineBy"), COLOR_CYAN, "The player has declined the charge.");
  8640. }
  8641. DeletePVar(playerid, "FineAmount");
  8642. DeletePVar(playerid, "FineBy");
  8643. DeletePVar(playerid, "FineReason");
  8644. }
  8645. if(dialogid == DIALOG_EDITSHOPMENU)
  8646. {
  8647. if(response)
  8648. {
  8649. if(listitem == 0)
  8650. {
  8651. new shopstring[4500];
  8652. format(shopstring, sizeof(shopstring),
  8653. "Gold VIP (Credits: %s)\n\
  8654. Gold VIP Renewal (Credits: %s)\n\
  8655. Silver VIP (Credits: %s)\n\
  8656. Bronze VIP (Credits: %s)\n\
  8657. Toys (Credits: %s)\n\
  8658. Vehicles (Credits: %s)\n\
  8659. Poker Table (Credits: %s)\n\
  8660. Boombox (Credits: %s)", number_format(ShopItems[0][sItemPrice]), number_format(ShopItems[1][sItemPrice]), number_format(ShopItems[2][sItemPrice]), number_format(ShopItems[3][sItemPrice]), number_format(ShopItems[4][sItemPrice]),
  8661. number_format(ShopItems[5][sItemPrice]), number_format(ShopItems[6][sItemPrice]), number_format(ShopItems[7][sItemPrice]));
  8662. format(shopstring, sizeof(shopstring), "%s\n\
  8663. Paintball Tokens (Credits %s)\n\
  8664. EXP Token (Credits: %s)\n\
  8665. Fireworks x5 (Credits: %s)\n\
  8666. Renewal Regular (Credits: %s)\n\
  8667. Renewal Standard (Credits: %s)\n\
  8668. Renewal Premium (Credits: %s)\n\
  8669. House (Credits: %s)\n\
  8670. House Interior Change (Credits: %s)\n\
  8671. House Move (Credits: %s)\n\
  8672. (Micro) Reset Gift Timer (Credits: %s)",shopstring, number_format(ShopItems[8][sItemPrice]), number_format(ShopItems[9][sItemPrice]), number_format(ShopItems[10][sItemPrice]),
  8673. number_format(ShopItems[11][sItemPrice]), number_format(ShopItems[12][sItemPrice]), number_format(ShopItems[13][sItemPrice]), number_format(ShopItems[14][sItemPrice]),
  8674. number_format(ShopItems[15][sItemPrice]), number_format(ShopItems[16][sItemPrice]), number_format(ShopItems[17][sItemPrice]));
  8675. format(shopstring, sizeof(shopstring),
  8676. "%s\n(Micro) Advanced Healthcare (Credits: %s)\n\
  8677. (Micro) Super Advanced Healthcare (Credits: %s)\n\
  8678. (Micro) Rent a Car (Credits: %s)\n\
  8679. Platinum VIP (Credits: %s)\n\
  8680. Custom License Plate (Credits: %s)\n\
  8681. Additional Vehicle Slot (Credits: %s)", shopstring, number_format(ShopItems[18][sItemPrice]), number_format(ShopItems[19][sItemPrice]), number_format(ShopItems[20][sItemPrice]),
  8682. number_format(ShopItems[21][sItemPrice]), number_format(ShopItems[22][sItemPrice]), number_format(ShopItems[23][sItemPrice]));
  8683. format(shopstring, sizeof(shopstring),
  8684. "%s\nGarage - Small (Credits: %s)\n\
  8685. Garage - Medium (Credits: %s)\n\
  8686. Garage - Large (Credits: %s)\n\
  8687. Garage - Extra Large (Credits: %s)\n\
  8688. Additional Toy Slot (Credits: %s)\n\
  8689. Hunger Voucher (Credits: %s)\n\
  8690. Spawn at Gold VIP+ room (Credits: %s)", shopstring, number_format(ShopItems[24][sItemPrice]), number_format(ShopItems[25][sItemPrice]), number_format(ShopItems[26][sItemPrice]),
  8691. number_format(ShopItems[27][sItemPrice]), number_format(ShopItems[28][sItemPrice]), number_format(ShopItems[29][sItemPrice]), number_format(ShopItems[30][sItemPrice]));
  8692. format(shopstring, sizeof(shopstring),
  8693. "%s\n\
  8694. Restricted Last Name (NEW) (Credits: %s)\n\
  8695. Restricted Last Name (CHANGE) (Credits: %s)\n\
  8696. Custom User Title (NEW) (Credits: %s)\n\
  8697. Custom User Title (CHANGE) (Credits: %s)\n\
  8698. Teamspeak User Channel (Credits: %s)\n\
  8699. Small Backpack (Credits: %s)\n\
  8700. Medium Backpack (Credits: %s)\n\
  8701. Large Backpack (Credits: %s)\n\
  8702. Deluxe Car Alarm (Credits: %s)\n\
  8703. Name Changes (Credits: %s)\n\
  8704. Furniture Pack - Bronze (Credits: %s)\n\
  8705. Furniture Pack - Silver (Credits: %s)\n\
  8706. Furniture Pack - Gold (Credits: %s)",
  8707. shopstring, number_format(ShopItems[31][sItemPrice]), number_format(ShopItems[32][sItemPrice]), number_format(ShopItems[33][sItemPrice]), number_format(ShopItems[34][sItemPrice]),
  8708. number_format(ShopItems[35][sItemPrice]),number_format(ShopItems[36][sItemPrice]),number_format(ShopItems[37][sItemPrice]),number_format(ShopItems[38][sItemPrice]),number_format(ShopItems[39][sItemPrice]), number_format(ShopItems[40][sItemPrice]),
  8709. number_format(ShopItems[41][sItemPrice]), number_format(ShopItems[42][sItemPrice]), number_format(ShopItems[43][sItemPrice]));
  8710. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOP, DIALOG_STYLE_LIST, "Edit Shop Prices", shopstring, "Edit", "Exit");
  8711. }
  8712. if(listitem == 1)
  8713. {
  8714. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS, DIALOG_STYLE_LIST, "Edit Business Shop", "Add Business\nEdit Business\nView Businesses Sold", "Select", "Exit");
  8715. }
  8716. if(listitem == 2)
  8717. {
  8718. for(new i; i < MAX_MICROITEMS; i++)
  8719. {
  8720. format(szMiscArray, sizeof(szMiscArray), "%s\n%s (Credits: %s)", szMiscArray, mItemName[i], number_format(MicroItems[i]));
  8721. }
  8722. ShowPlayerDialogEx(playerid, DIALOG_EDITMICROSHOP, DIALOG_STYLE_LIST, "Edit Micro Shop Prices", szMiscArray, "Edit", "Exit");
  8723. }
  8724. }
  8725. }
  8726. if(dialogid == DIALOG_EDITSHOP)
  8727. {
  8728. if(response) {
  8729. new item[30];
  8730. SetPVarInt(playerid, "EditingPrice", listitem);
  8731. switch(listitem)
  8732. {
  8733. case 0: item = "Gold VIP";
  8734. case 1: item = "Gold VIP Renewal";
  8735. case 2: item = "Silver VIP";
  8736. case 3: item = "Bronze VIP";
  8737. case 4: item = "Toys";
  8738. case 5: item = "Vehicles";
  8739. case 6: item = "Poker Table";
  8740. case 7: item = "Boombox";
  8741. case 8: item = "Paintball Tokens";
  8742. case 9: item = "EXP Token";
  8743. case 10: item = "Fireworks x5";
  8744. case 11: item = "Renewal Regular";
  8745. case 12: item = "Renewal Standard";
  8746. case 13: item = "Renewal Premium";
  8747. case 14: item = "House";
  8748. case 15: item = "House Interior Change";
  8749. case 16: item = "House Move";
  8750. case 17: item = "(Micro) Reset Gift Timer";
  8751. case 18: item = "(Micro) Advanced Health Care";
  8752. case 19: item = "(Micro) Super Health Care";
  8753. case 20: item = "(Micro) Rent a Car";
  8754. case 21: item = "Platinum VIP";
  8755. case 22: item = "License Plate";
  8756. case 23: item = "Additional Vehicle Slot";
  8757. case 24: item = "Garage - Small";
  8758. case 25: item = "Garage - Medium";
  8759. case 26: item = "Garage - Large";
  8760. case 27: item = "Garage - Extra Large";
  8761. case 28: item = "Additional Toy Slot";
  8762. case 29: item = "Hunger Voucher";
  8763. case 30: item = "Spawn at Gold VIP+ room";
  8764. case 31: item = "Restricted Last Name (NEW)";
  8765. case 32: item = "Restricted Last Name (CHANGE)";
  8766. case 33: item = "Custom User Title (NEW)";
  8767. case 34: item = "Custom User Title (CHANGE)";
  8768. case 35: item = "Teamspeak User Channel";
  8769. case 36: item = "Small Backpack";
  8770. case 37: item = "Medium Backpack";
  8771. case 38: item = "Large Backpack";
  8772. case 39: item = "Deluxe Car Alarm";
  8773. case 40: item = "Name Changes";
  8774. case 41: item = "Furniture Slots Pack - Bronze";
  8775. case 42: item = "Furniture Slots Pack - Silver";
  8776. case 43: item = "Furniture Slots Pack - Gold";
  8777. }
  8778. format(string, sizeof(string), "You are currently editing the price of %s. The current credit cost is %d.", item, ShopItems[listitem][sItemPrice]);
  8779. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOP2, DIALOG_STYLE_INPUT, "Editing Price", string, "Change", "Back");
  8780. }
  8781. }
  8782. if(dialogid == DIALOG_EDITSHOP2)
  8783. {
  8784. if(response) {
  8785. new
  8786. Prices = strval(inputtext),
  8787. item[30];
  8788. switch(GetPVarInt(playerid, "EditingPrice"))
  8789. {
  8790. case 0: item = "Gold VIP";
  8791. case 1: item = "Gold VIP Renewal";
  8792. case 2: item = "Silver VIP";
  8793. case 3: item = "Bronze VIP";
  8794. case 4: item = "Toys";
  8795. case 5: item = "Vehicles";
  8796. case 6: item = "Poker Table";
  8797. case 7: item = "Boombox";
  8798. case 8: item = "Paintball Tokens";
  8799. case 9: item = "EXP Token";
  8800. case 10: item = "Fireworks x5";
  8801. case 11: item = "Renewal Regular";
  8802. case 12: item = "Renewal Standard";
  8803. case 13: item = "Renewal Premium";
  8804. case 14: item = "House";
  8805. case 15: item = "House Interior Change";
  8806. case 16: item = "House Move";
  8807. case 17: item = "(Micro) Reset Gift Timer";
  8808. case 18: item = "(Micro) Advanced Health Care";
  8809. case 19: item = "(Micro) Super Health Care";
  8810. case 20: item = "(Micro) Rent a Car";
  8811. case 21: item = "Platinum VIP";
  8812. case 22: item = "License Plate";
  8813. case 23: item = "Additional Vehicle Slot";
  8814. case 24: item = "Garage - Small";
  8815. case 25: item = "Garage - Medium";
  8816. case 26: item = "Garage - Large";
  8817. case 27: item = "Garage - Extra Large";
  8818. case 28: item = "Additional Toy Slot";
  8819. case 29: item = "Hunger Voucher";
  8820. case 30: item = "Spawn at Gold VIP+ room";
  8821. case 31: item = "Restricted Last Name (NEW)";
  8822. case 32: item = "Restricted Last Name (CHANGE)";
  8823. case 33: item = "Custom User Title (NEW)";
  8824. case 34: item = "Custom User Title (CHANGE)";
  8825. case 35: item = "Teamspeak User Channel";
  8826. case 36: item = "Small Backpack";
  8827. case 37: item = "Medium Backpack";
  8828. case 38: item = "Large Backpack";
  8829. case 39: item = "Deluxe Car Alarm";
  8830. case 40: item = "Name Changes";
  8831. case 41: item = "Furniture Slots Pack - Bronze";
  8832. case 42: item = "Furniture Slots Pack - Silver";
  8833. case 43: item = "Furniture Slots Pack - Gold";
  8834. }
  8835. if(isnull(inputtext) || Prices <= 0) {
  8836. format(string, sizeof(string), "The price can't be below 0.\n\nYou are currently editing the price of %s. The current credit cost is %d.", item, ShopItems[GetPVarInt(playerid, "EditingPrice")][sItemPrice]);
  8837. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOP2, DIALOG_STYLE_INPUT, "Editing Price", string, "Change", "Back");
  8838. }
  8839. else
  8840. {
  8841. SetPVarInt(playerid, "EditingPriceValue", Prices);
  8842. format(string,sizeof(string),"Are you sure you want to edit the cost of %s?\n\nOld Cost: %d\nNew Cost: %d", item, ShopItems[GetPVarInt(playerid, "EditingPrice")][sItemPrice], Prices);
  8843. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOP3, DIALOG_STYLE_MSGBOX, "Confirmation", string, "Confirm", "Cancel");
  8844. return 1;
  8845. }
  8846. }
  8847. format(szMiscArray, sizeof(szMiscArray),
  8848. "Gold VIP (Credits: %s)\n\
  8849. Gold VIP Renewal (Credits: %s)\n\
  8850. Silver VIP (Credits: %s)\n\
  8851. Bronze VIP (Credits: %s)\n\
  8852. Toys (Credits: %s)\n\
  8853. Vehicles (Credits: %s)\n\
  8854. Poker Table (Credits: %s)\n\
  8855. Boombox (Credits: %s)", number_format(ShopItems[0][sItemPrice]), number_format(ShopItems[1][sItemPrice]), number_format(ShopItems[2][sItemPrice]), number_format(ShopItems[3][sItemPrice]), number_format(ShopItems[4][sItemPrice]),
  8856. number_format(ShopItems[5][sItemPrice]), number_format(ShopItems[6][sItemPrice]), number_format(ShopItems[7][sItemPrice]));
  8857. format(szMiscArray, sizeof(szMiscArray), "%s\n\
  8858. Paintball Tokens (Credits %s)\n\
  8859. EXP Token (Credits: %s)\n\
  8860. Fireworks x5 (Credits: %s)\n\
  8861. Renewal Regular (Credits: %s)\n\
  8862. Renewal Standard (Credits: %s)\n\
  8863. Renewal Premium (Credits: %s)\n\
  8864. House (Credits: %s)\n\
  8865. House Interior Change (Credits: %s)\n\
  8866. House Move (Credits: %s)\n\
  8867. (Micro) Reset Gift Timer (Credits: %s)", szMiscArray, number_format(ShopItems[8][sItemPrice]), number_format(ShopItems[9][sItemPrice]), number_format(ShopItems[10][sItemPrice]),
  8868. number_format(ShopItems[11][sItemPrice]), number_format(ShopItems[12][sItemPrice]), number_format(ShopItems[13][sItemPrice]), number_format(ShopItems[14][sItemPrice]), number_format(ShopItems[15][sItemPrice]),
  8869. number_format(ShopItems[16][sItemPrice]), number_format(ShopItems[17][sItemPrice]));
  8870. format(szMiscArray, sizeof(szMiscArray),
  8871. "%s\n(Micro) Advanced Healthcare (Credits: %s)\n\
  8872. (Micro) Super Advanced Healthcare (Credits: %s)\n\
  8873. (Micro) Rent a Car (Credits: %s)\n\
  8874. Platinum VIP (Credits: %s)\n\
  8875. Custom License Plate (Credits: %s)\n\
  8876. Additional Vehicle Slot (Credits: %s)", szMiscArray, number_format(ShopItems[18][sItemPrice]), number_format(ShopItems[19][sItemPrice]), number_format(ShopItems[20][sItemPrice]), number_format(ShopItems[21][sItemPrice]),
  8877. number_format(ShopItems[22][sItemPrice]), number_format(ShopItems[23][sItemPrice]));
  8878. format(szMiscArray, sizeof(szMiscArray),
  8879. "%s\nGarage - Small (Credits: %s)\n\
  8880. Garage - Medium (Credits: %s)\n\
  8881. Garage - Large (Credits: %s)\n\
  8882. Garage - Extra Large (Credits: %s)\n\
  8883. Additional Toy Slot (Credits: %s)\n\
  8884. Hunger Voucher (Credits: %s)\n\
  8885. Spawn at Gold VIP+ room (Credits: %s)", szMiscArray, number_format(ShopItems[24][sItemPrice]), number_format(ShopItems[25][sItemPrice]), number_format(ShopItems[26][sItemPrice]),
  8886. number_format(ShopItems[27][sItemPrice]), number_format(ShopItems[28][sItemPrice]), number_format(ShopItems[29][sItemPrice]), number_format(ShopItems[30][sItemPrice]));
  8887. format(szMiscArray, sizeof(szMiscArray),
  8888. "%s\n\
  8889. Restricted Last Name (NEW) (Credits: %s)\n\
  8890. Restricted Last Name (CHANGE) (Credits: %s)\n\
  8891. Custom User Title (NEW) (Credits: %s)\n\
  8892. Custom User Title (CHANGE) (Credits: %s)\n\
  8893. Teamspeak User Channel (Credits: %s)\n\
  8894. Small Backpack (Credits: %s)\n\
  8895. Medium Backpack (Credits: %s)\n\
  8896. Large Backpack (Credits: %s)\n\
  8897. Deluxe Car Alarm (Credits: %s)\n\
  8898. Name Changes (Credits: %s)\n\
  8899. Furniture Pack - Bronze (Credits: %s)\n\
  8900. Furniture Pack - Silver (Credits: %s)\n\
  8901. Furniture Pack - Gold (Credits: %s)",
  8902. szMiscArray, number_format(ShopItems[31][sItemPrice]), number_format(ShopItems[32][sItemPrice]), number_format(ShopItems[33][sItemPrice]), number_format(ShopItems[34][sItemPrice]),
  8903. number_format(ShopItems[35][sItemPrice]),number_format(ShopItems[36][sItemPrice]),number_format(ShopItems[37][sItemPrice]),number_format(ShopItems[38][sItemPrice]),number_format(ShopItems[39][sItemPrice]), number_format(ShopItems[40][sItemPrice]),
  8904. number_format(ShopItems[41][sItemPrice]), number_format(ShopItems[42][sItemPrice]), number_format(ShopItems[43][sItemPrice]));
  8905. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOP, DIALOG_STYLE_LIST, "Edit Shop Prices", szMiscArray, "Edit", "Exit");
  8906. }
  8907. if(dialogid == DIALOG_EDITSHOP3)
  8908. {
  8909. if(response)
  8910. {
  8911. new item[30];
  8912. switch(GetPVarInt(playerid, "EditingPrice"))
  8913. {
  8914. case 0: item = "Gold VIP";
  8915. case 1: item = "Gold VIP Renewal";
  8916. case 2: item = "Silver VIP";
  8917. case 3: item = "Bronze VIP";
  8918. case 4: item = "Toys";
  8919. case 5: item = "Vehicles";
  8920. case 6: item = "Poker Table";
  8921. case 7: item = "Boombox";
  8922. case 8: item = "Paintball Tokens";
  8923. case 9: item = "EXP Token";
  8924. case 10: item = "Fireworks x5";
  8925. case 11: item = "Renewal Regular";
  8926. case 12: item = "Renewal Standard";
  8927. case 13: item = "Renewal Premium";
  8928. case 14: item = "House";
  8929. case 15: item = "House Interior Change";
  8930. case 16: item = "House Move";
  8931. case 17: item = "(Micro) Reset Gift Timer";
  8932. case 18: item = "(Micro) Advanced Health Care";
  8933. case 19: item = "(Micro) Super Health Care";
  8934. case 20: item = "(Micro) Rent a Car";
  8935. case 21: item = "Platinum VIP";
  8936. case 22: item = "License Plate";
  8937. case 23: item = "Additional Vehicle Slot";
  8938. case 24: item = "Garage - Small";
  8939. case 25: item = "Garage - Medium";
  8940. case 26: item = "Garage - Large";
  8941. case 27: item = "Garage - Extra Large";
  8942. case 28: item = "Additional Toy Slot";
  8943. case 29: item = "Hunger Voucher";
  8944. case 30: item = "Spawn at Gold VIP+ room";
  8945. case 31: item = "Restricted Last Name (NEW)";
  8946. case 32: item = "Restricted Last Name (CHANGE)";
  8947. case 33: item = "Custom User Title (NEW)";
  8948. case 34: item = "Custom User Title (CHANGE)";
  8949. case 35: item = "Teamspeak User Channel";
  8950. case 36: item = "Small Backpack";
  8951. case 37: item = "Medium Backpack";
  8952. case 38: item = "Large Backpack";
  8953. case 39: item = "Deluxe Car Alarm";
  8954. case 40: item = "Name Changes";
  8955. case 41: item = "Furniture Slots Pack - Bronze";
  8956. case 42: item = "Furniture Slots Pack - Silver";
  8957. case 43: item = "Furniture Slots Pack - Gold";
  8958. }
  8959. if(GetPVarInt(playerid, "EditingPriceValue") == 0)
  8960. SetPVarInt(playerid, "EditingPriceValue", 999999);
  8961. Price[GetPVarInt(playerid, "EditingPrice")] = GetPVarInt(playerid, "EditingPriceValue");
  8962. ShopItems[GetPVarInt(playerid, "EditingPrice")][sItemPrice] = GetPVarInt(playerid, "EditingPriceValue");
  8963. format(string, sizeof(string), "You have successfully edited the price of %s to %d.", item, GetPVarInt(playerid, "EditingPriceValue"));
  8964. SendClientMessageEx(playerid, COLOR_WHITE, string);
  8965. format(string, sizeof(string), "[EDITSHOPPRICES] [User: %s(%i)] [IP: %s] [%s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), item, number_format(ShopItems[GetPVarInt(playerid, "EditingPrice")][sItemPrice]));
  8966. Log("logs/editshop.log", string), print(string);
  8967. g_mysql_SavePrices();
  8968. return 1;
  8969. }
  8970. DeletePVar(playerid, "EditingPrice");
  8971. DeletePVar(playerid, "EditingPriceValue");
  8972. SendClientMessageEx(playerid, COLOR_GREY, "You have canceled the price change.");
  8973. }
  8974. if(dialogid == DIALOG_ENTERPIN)
  8975. {
  8976. if(response)
  8977. {
  8978. if(isnull(inputtext) || strlen(inputtext) > 4 || !IsNumeric(inputtext))
  8979. {
  8980. ShowPlayerDialogEx(playerid, DIALOG_ENTERPIN, DIALOG_STYLE_INPUT, "Pin Number", "Enter your pin number to access credit shops.", "Confirm", "Exit");
  8981. return 1;
  8982. }
  8983. SetPVarString(playerid, "PinNumber", inputtext);
  8984. mysql_format(MainPipeline, string, sizeof(string), "SELECT `Pin` FROM `accounts` WHERE `Username` = '%e'", GetPlayerNameExt(playerid));
  8985. mysql_tquery(MainPipeline, string, "OnPinCheck2", "i", playerid);
  8986. }
  8987. }
  8988. if(dialogid == DIALOG_CREATEPIN)
  8989. {
  8990. if(response)
  8991. {
  8992. if(strlen(inputtext) > 4 || !IsNumeric(inputtext))
  8993. return ShowPlayerDialogEx(playerid, DIALOG_CREATEPIN, DIALOG_STYLE_INPUT, "Pin Number", "Error: A pin must be numbers only, and have at least 4 digits. \nCreate a pin number so you can secure your account credits.", "Create", "Exit");
  8994. if(GetPVarType(playerid, "ChangePin"))
  8995. {
  8996. if(isnull(inputtext))
  8997. return ShowPlayerDialogEx(playerid, DIALOG_CREATEPIN, DIALOG_STYLE_INPUT, "Change Pin Number", "Enter a new pin number to change your current one.", "Change", "Cancel");
  8998. }
  8999. else
  9000. {
  9001. if(isnull(inputtext))
  9002. return ShowPlayerDialogEx(playerid, DIALOG_CREATEPIN, DIALOG_STYLE_INPUT, "Pin Number", "Create a pin number so you can secure your account credits.", "Create", "Exit");
  9003. }
  9004. SetPVarString(playerid, "PinConfirm", inputtext);
  9005. ShowPlayerDialogEx(playerid, DIALOG_CREATEPIN2, DIALOG_STYLE_INPUT, "Pin Number", "Enter your pin number again to confirm it.", "Create", "Exit");
  9006. }
  9007. else if(GetPVarType(playerid, "ChangePin")) DeletePVar(playerid, "ChangePin");
  9008. }
  9009. if(dialogid == DIALOG_VIEWSALE)
  9010. {
  9011. if(response)
  9012. {
  9013. mysql_format(MainPipeline, string, sizeof(string), "SELECT * FROM `sales` WHERE `id` = '%d'", Selected[playerid][listitem]);
  9014. SetPVarInt(playerid, "checkingsale", Selected[playerid][listitem]);
  9015. mysql_tquery(MainPipeline, string, "CheckSales2", "i", playerid);
  9016. }
  9017. }
  9018. if(dialogid == DIALOG_VIEWSALE2)
  9019. {
  9020. if(response)
  9021. {
  9022. mysql_format(MainPipeline, string, sizeof(string), "SELECT * FROM `sales` WHERE `id` = '%d'", GetPVarInt(playerid, "checkingsale"));
  9023. mysql_tquery(MainPipeline, string, "CheckSales3", "i", playerid);
  9024. }
  9025. }
  9026. if(dialogid == DIALOG_CREATEPIN2)
  9027. {
  9028. if(response)
  9029. {
  9030. if(isnull(inputtext))
  9031. return ShowPlayerDialogEx(playerid, DIALOG_CREATEPIN2, DIALOG_STYLE_INPUT, "Pin Number", "Enter your pin number again to confirm it.", "Create", "Exit");
  9032. new confirm[128];
  9033. GetPVarString(playerid, "PinConfirm", confirm, 128);
  9034. if(strcmp(inputtext, confirm, true) != 0)
  9035. {
  9036. if(GetPVarType(playerid, "ChangePin"))
  9037. {
  9038. ShowPlayerDialogEx(playerid, DIALOG_CREATEPIN, DIALOG_STYLE_INPUT, "Pin Number", "Enter a new pin number to change your current one.", "Change", "Cancel");
  9039. }
  9040. else
  9041. {
  9042. ShowPlayerDialogEx(playerid, DIALOG_CREATEPIN, DIALOG_STYLE_INPUT, "Pin Number", "Error: Pin numbers did not match.\n\nCreate a pin number so you can secure your account credits.", "Create", "Exit");
  9043. }
  9044. DeletePVar(playerid, "PinConfirm");
  9045. }
  9046. else
  9047. {
  9048. format(string, sizeof(string), "Your new pin number is '%s.'", inputtext);
  9049. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9050. new passbuffer[258];
  9051. WP_Hash(passbuffer, sizeof(passbuffer), inputtext);
  9052. new query[256];
  9053. mysql_format(MainPipeline, query, sizeof(query), "UPDATE `accounts` SET `Pin`='%s' WHERE `id` = %d", passbuffer, GetPlayerSQLId(playerid));
  9054. mysql_tquery(MainPipeline, query, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
  9055. DeletePVar(playerid, "PinConfirm");
  9056. DeletePVar(playerid, "ChangePin");
  9057. }
  9058. }
  9059. }
  9060. if(dialogid == DIALOG_MISCSHOP && response)
  9061. {
  9062. SetPVarInt(playerid, "MiscShop", listitem+1);
  9063. switch(listitem)
  9064. {
  9065. case 0:
  9066. {
  9067. format(string, sizeof(string), "Item: Poker Table\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[6][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[6][sItemPrice]));
  9068. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", string, "Purchase", "Cancel");
  9069. }
  9070. case 1:
  9071. {
  9072. format(string, sizeof(string), "Item: Boombox\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[7][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[7][sItemPrice]));
  9073. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", string, "Purchase", "Cancel");
  9074. }
  9075. case 2:
  9076. {
  9077. format(string, sizeof(string), "Item: 100 Paintball Tokens\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[8][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[8][sItemPrice]));
  9078. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", string, "Purchase", "Cancel");
  9079. }
  9080. case 3:
  9081. {
  9082. format(string, sizeof(string), "Item: EXP Token\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[9][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[9][sItemPrice]));
  9083. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", string, "Purchase", "Cancel");
  9084. }
  9085. case 4:
  9086. {
  9087. format(string, sizeof(string), "Item: Fireworks x5\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[10][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[10][sItemPrice]));
  9088. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", string, "Purchase", "Cancel");
  9089. }
  9090. case 5:
  9091. {
  9092. format(string, sizeof(string), "Item: Custom License Plate\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[22][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[22][sItemPrice]));
  9093. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", string, "Purchase", "Cancel");
  9094. }
  9095. case 6:
  9096. {
  9097. SetPVarInt(playerid, "MiscShop", 10);
  9098. format(string, sizeof(string), "Item: Restricted Last Name (NEW)\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[31][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[31][sItemPrice]));
  9099. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", string, "Purchase", "Cancel");
  9100. }
  9101. case 7:
  9102. {
  9103. SetPVarInt(playerid, "MiscShop", 11);
  9104. format(string, sizeof(string), "Item: Restricted Last Name (CHANGE)\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[32][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[32][sItemPrice]));
  9105. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", string, "Purchase", "Cancel");
  9106. }
  9107. case 8:
  9108. {
  9109. SetPVarInt(playerid, "MiscShop", 12);
  9110. format(string, sizeof(string), "Item: Custom User Title (NEW)\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[33][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[33][sItemPrice]));
  9111. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", string, "Purchase", "Cancel");
  9112. }
  9113. case 9:
  9114. {
  9115. SetPVarInt(playerid, "MiscShop", 13);
  9116. format(string, sizeof(string), "Item: Custom User Title (CHANGE)\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[34][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[34][sItemPrice]));
  9117. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", string, "Purchase", "Cancel");
  9118. }
  9119. case 10:
  9120. {
  9121. SetPVarInt(playerid, "MiscShop", 14);
  9122. format(string, sizeof(string), "Item: Teamspeak User Channel\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[35][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[35][sItemPrice]));
  9123. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", string, "Purchase", "Cancel");
  9124. }
  9125. case 11:
  9126. {
  9127. new bdialog[145];
  9128. format(bdialog, sizeof(bdialog), "Small Backpack (Credits: {FFD700}%s{A9C4E4})\nMedium Backpack (Credits: {FFD700}%s{A9C4E4})\nLarge Backpack (Credits: {FFD700}%s{A9C4E4})",
  9129. number_format(ShopItems[36][sItemPrice]), number_format(ShopItems[37][sItemPrice]), number_format(ShopItems[38][sItemPrice]));
  9130. ShowPlayerDialogEx(playerid, DIALOG_BACKPACKS, DIALOG_STYLE_LIST, "Misc Shop", bdialog, "Select", "Cancel");
  9131. }
  9132. case 12:
  9133. {
  9134. SetPVarInt(playerid, "MiscShop", 18);
  9135. format(string, sizeof(string), "Item: Deluxe Car Alarm\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[39][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[39][sItemPrice]));
  9136. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", string, "Purchase", "Cancel");
  9137. }
  9138. }
  9139. }
  9140. if(dialogid == DIALOG_BACKPACKS && response)
  9141. {
  9142. new bdialog[170];
  9143. switch(listitem)
  9144. {
  9145. case 0:
  9146. {
  9147. SetPVarInt(playerid, "MiscShop", 15); // small backpack
  9148. format(bdialog, sizeof(bdialog), "Item: Small Backpack\nFood Storage: 1 Meal\nNarcotics Storage: 30 Grams\nFirearms Storage: 1 Weapon\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[36][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[36][sItemPrice]));
  9149. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", bdialog, "Purchase", "Cancel");
  9150. }
  9151. case 1:
  9152. {
  9153. SetPVarInt(playerid, "MiscShop", 16); // med backpack
  9154. format(bdialog, sizeof(bdialog), "Item: Medium Backpack\nFood Storage: 3 Meals\nNarcotics Storage: 50 Grams\nFirearms Storage: 2 Weapons\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[37][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[37][sItemPrice]));
  9155. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", bdialog, "Purchase", "Cancel");
  9156. }
  9157. case 2:
  9158. {
  9159. SetPVarInt(playerid, "MiscShop", 17); // large backpack
  9160. format(bdialog, sizeof(bdialog), "Item: Large Backpack\nFood Storage: 5 Meals\nNarcotics Storage: 80 Grams\nFirearms Storage: 4 Weapons\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[38][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[38][sItemPrice]));
  9161. ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Misc Shop", bdialog, "Purchase", "Cancel");
  9162. }
  9163. }
  9164. }
  9165. if(dialogid == DIALOG_MISCSHOP2 && response)
  9166. {
  9167. if(GetPVarInt(playerid, "MiscShop") == 1)
  9168. {
  9169. if(PlayerInfo[playerid][pCredits] < ShopItems[6][sItemPrice])
  9170. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9171. else if(PlayerInfo[playerid][pTable] == 1)
  9172. return SendClientMessageEx(playerid, COLOR_GREY, "You already own a poker table.");
  9173. else
  9174. {
  9175. AmountSold[6]++;
  9176. AmountMade[6] += ShopItems[6][sItemPrice];
  9177. //ShopItems[6][sSold]++;
  9178. //ShopItems[6][sMade] += ShopItems[6][sItemPrice];
  9179. new szQuery[128];
  9180. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold6` = '%d', `AmountMade6` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[6], AmountMade[6]);
  9181. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9182. GivePlayerCredits(playerid, -ShopItems[6][sItemPrice], 1);
  9183. printf("Price6: %d", 250);
  9184. PlayerInfo[playerid][pTable] = 1;
  9185. format(string, sizeof(string), "[SHOPMISC] [User: %s(%i)] [IP: %s] [Credits: %s] [Pokertable] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[6][sItemPrice]));
  9186. Log("logs/credits.log", string), print(string);
  9187. format(string, sizeof(string), "You have purchased a pokertable for %s credits.", number_format(ShopItems[6][sItemPrice]));
  9188. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9189. DeletePVar(playerid, "MiscShop");
  9190. }
  9191. }
  9192. else if(GetPVarInt(playerid, "MiscShop") == 2)
  9193. {
  9194. if(PlayerInfo[playerid][pCredits] < ShopItems[7][sItemPrice])
  9195. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9196. else if(PlayerInfo[playerid][pBoombox] == 1)
  9197. return SendClientMessageEx(playerid, COLOR_GREY, "You already own a boombox.");
  9198. else
  9199. {
  9200. AmountSold[7]++;
  9201. AmountMade[7] += ShopItems[7][sItemPrice];
  9202. //ShopItems[7][sSold]++;
  9203. //ShopItems[7][sMade] += ShopItems[7][sItemPrice];
  9204. new szQuery[128];
  9205. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold7` = '%d', `AmountMade7` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[7], AmountMade[7]);
  9206. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9207. GivePlayerCredits(playerid, -ShopItems[7][sItemPrice], 1);
  9208. printf("Price7: %d", ShopItems[7][sItemPrice]);
  9209. PlayerInfo[playerid][pBoombox] = 1;
  9210. format(string, sizeof(string), "[SHOPMISC] [User: %s(%i)] [IP: %s] [Credits: %s] [Boombox] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[7][sItemPrice]));
  9211. Log("logs/credits.log", string), print(string);
  9212. format(string, sizeof(string), "You have purchased a boombox for %s credits.", number_format(ShopItems[7][sItemPrice]));
  9213. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9214. DeletePVar(playerid, "MiscShop");
  9215. }
  9216. }
  9217. else if(GetPVarInt(playerid, "MiscShop") == 3)
  9218. {
  9219. if(PlayerInfo[playerid][pCredits] < ShopItems[8][sItemPrice])
  9220. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9221. AmountSold[8]++;
  9222. AmountMade[8] += ShopItems[8][sItemPrice];
  9223. //ShopItems[8][sSold]++;
  9224. //ShopItems[8][sMade] += ShopItems[8][sItemPrice];
  9225. new szQuery[128];
  9226. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold8` = '%d', `AmountMade8` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[8], AmountMade[8]);
  9227. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9228. GivePlayerCredits(playerid, -ShopItems[8][sItemPrice], 1);
  9229. printf("Price8: %d", ShopItems[8][sItemPrice]);
  9230. PlayerInfo[playerid][pPaintTokens] += 100;
  9231. format(string, sizeof(string), "[SHOPMISC] [User: %s(%i)] [IP: %s] [Credits: %s] [100 Paintball Tokens] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[8][sItemPrice]));
  9232. Log("logs/credits.log", string), print(string);
  9233. format(string, sizeof(string), "You have purchased 100 paintball tokens for %s credits.", number_format(ShopItems[8][sItemPrice]));
  9234. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9235. DeletePVar(playerid, "MiscShop");
  9236. }
  9237. else if(GetPVarInt(playerid, "MiscShop") == 4)
  9238. {
  9239. if(PlayerInfo[playerid][pCredits] < ShopItems[9][sItemPrice])
  9240. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9241. AmountSold[9]++;
  9242. AmountMade[9] += ShopItems[9][sItemPrice];
  9243. //ShopItems[9][sSold]++;
  9244. //ShopItems[9][sMade] += ShopItems[9][sItemPrice];
  9245. new szQuery[128];
  9246. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold9` = '%d', `AmountMade9` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[9], AmountMade[9]);
  9247. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9248. GivePlayerCredits(playerid, -ShopItems[9][sItemPrice], 1);
  9249. printf("Price9: %d", ShopItems[9][sItemPrice]);
  9250. PlayerInfo[playerid][pEXPToken] += 1;
  9251. format(string, sizeof(string), "[SHOPMISC] [User: %s(%i)] [IP: %s] [Credits: %s] [EXP Token] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[9][sItemPrice]));
  9252. Log("logs/credits.log", string), print(string);
  9253. format(string, sizeof(string), "You have purchased a EXP Token for %s credits.", number_format(ShopItems[9][sItemPrice]));
  9254. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9255. DeletePVar(playerid, "MiscShop");
  9256. }
  9257. else if(GetPVarInt(playerid, "MiscShop") == 5)
  9258. {
  9259. if(PlayerInfo[playerid][pCredits] < ShopItems[10][sItemPrice])
  9260. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9261. AmountSold[10]++;
  9262. AmountMade[10] += ShopItems[10][sItemPrice];
  9263. //ShopItems[10][sSold]++;
  9264. //ShopItems[10][sMade] += ShopItems[10][sItemPrice];
  9265. new szQuery[128];
  9266. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold10` = '%d', `AmountMade10` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[10], AmountMade[10]);
  9267. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9268. GivePlayerCredits(playerid, -ShopItems[10][sItemPrice], 1);
  9269. printf("Price10: %d", ShopItems[10][sItemPrice]);
  9270. PlayerInfo[playerid][pFirework] += 5;
  9271. format(string, sizeof(string), "[SHOPMISC] [User: %s(%i)] [IP: %s] [Credits: %s] [Firework X5] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[10][sItemPrice]));
  9272. Log("logs/credits.log", string), print(string);
  9273. format(string, sizeof(string), "You have purchased 5 fireworks for %s credits.", number_format(ShopItems[10][sItemPrice]));
  9274. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9275. DeletePVar(playerid, "MiscShop");
  9276. }
  9277. else if(GetPVarInt(playerid, "MiscShop") == 6)
  9278. {
  9279. if(PlayerInfo[playerid][pCredits] < ShopItems[22][sItemPrice])
  9280. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9281. GivePlayerCredits(playerid, -ShopItems[22][sItemPrice], 1);
  9282. printf("Price22: %d", ShopItems[22][sItemPrice]);
  9283. AmountSold[22]++;
  9284. AmountMade[22] += ShopItems[22][sItemPrice];
  9285. //ShopItems[22][sSold]++;
  9286. //ShopItems[22][sMade] += ShopItems[22][sItemPrice];
  9287. new szQuery[128];
  9288. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold22` = '%d', `AmountMade22` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[22], AmountMade[22]);
  9289. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9290. AddFlag(playerid, INVALID_PLAYER_ID, "Purchased Custom License Plate (Credits)");
  9291. SendReportToQue(playerid, "Custom License Plate (Credits)", 2, 2);
  9292. format(string, sizeof(string), "You have purchased a custom license plate for %s credits.", number_format(ShopItems[22][sItemPrice]));
  9293. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9294. SendClientMessageEx(playerid, COLOR_CYAN, "Contact a senior admin to have the custom license plate issued.");
  9295. format(string, sizeof(string), "[Custom License Plate] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[22][sItemPrice]));
  9296. Log("logs/credits.log", string), print(string);
  9297. }
  9298. else if(GetPVarInt(playerid, "MiscShop") == 7) // Vehicle Slots
  9299. {
  9300. if(PlayerInfo[playerid][pCredits] < ShopItems[23][sItemPrice])
  9301. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9302. GivePlayerCredits(playerid, -ShopItems[23][sItemPrice], 1);
  9303. printf("Price23: %d", ShopItems[23][sItemPrice]);
  9304. AmountSold[23]++;
  9305. AmountMade[23] += ShopItems[23][sItemPrice];
  9306. new szQuery[128];
  9307. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold23` = '%d', `AmountMade23` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[23], AmountMade[23]);
  9308. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9309. format(string, sizeof(string), "You have purchased a additional vehicle slot for %s credits.", number_format(ShopItems[23][sItemPrice]));
  9310. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9311. PlayerInfo[playerid][pVehicleSlot] += 1;
  9312. LoadPlayerDisabledVehicles(playerid);
  9313. format(string, sizeof(string), "[Additional Vehicle Slot] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[23][sItemPrice]));
  9314. Log("logs/credits.log", string), print(string);
  9315. }
  9316. else if(GetPVarInt(playerid, "MiscShop") == 8) // Toy Slots
  9317. {
  9318. if(PlayerInfo[playerid][pCredits] < ShopItems[28][sItemPrice])
  9319. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9320. GivePlayerCredits(playerid, -ShopItems[28][sItemPrice], 1);
  9321. printf("Price28: %d", ShopItems[28][sItemPrice]);
  9322. AmountSold[28]++;
  9323. AmountMade[28] += ShopItems[28][sItemPrice];
  9324. new szQuery[128];
  9325. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold28` = '%d', `AmountMade28` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[28], AmountMade[28]);
  9326. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9327. format(string, sizeof(string), "You have purchased a additional toy slot for %s credits.", number_format(ShopItems[28][sItemPrice]));
  9328. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9329. PlayerInfo[playerid][pToySlot] += 1;
  9330. LoadPlayerDisabledVehicles(playerid);
  9331. format(string, sizeof(string), "[Additional Toy Slot] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[28][sItemPrice]));
  9332. Log("logs/credits.log", string), print(string);
  9333. }
  9334. else if(GetPVarInt(playerid, "MiscShop") == 9) // Spawn at Gold VIP+ room
  9335. {
  9336. if(PlayerInfo[playerid][pCredits] < ShopItems[30][sItemPrice])
  9337. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9338. GivePlayerCredits(playerid, -ShopItems[30][sItemPrice], 1);
  9339. printf("Price30: %d", ShopItems[30][sItemPrice]);
  9340. AmountSold[30]++;
  9341. AmountMade[30] += ShopItems[30][sItemPrice];
  9342. new szQuery[128];
  9343. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold30` = '%d', `AmountMade30` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[30], AmountMade[30]);
  9344. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9345. format(string, sizeof(string), "You have purchased a spawn at the Gold VIP+ room, you will be able to use it after your next death.", number_format(ShopItems[30][sItemPrice]));
  9346. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9347. PlayerInfo[playerid][pVIPSpawn] = 1;
  9348. OnPlayerStatsUpdate(playerid);
  9349. format(string, sizeof(string), "[Spawn at Gold VIP+ room] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[30][sItemPrice]));
  9350. Log("logs/credits.log", string), print(string);
  9351. }
  9352. else if(GetPVarInt(playerid, "MiscShop") == 10) // Restricted Last Name (NEW)
  9353. {
  9354. if(PlayerInfo[playerid][pCredits] < ShopItems[31][sItemPrice])
  9355. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9356. GivePlayerCredits(playerid, -ShopItems[31][sItemPrice], 1);
  9357. printf("Price31: %d", ShopItems[31][sItemPrice]);
  9358. AmountSold[31]++;
  9359. AmountMade[31] += ShopItems[31][sItemPrice];
  9360. new szQuery[128];
  9361. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold31` = '%d', `AmountMade31` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[31], AmountMade[31]);
  9362. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9363. AddFlag(playerid, INVALID_PLAYER_ID, "Purchased Restricted Last Name (NEW) (Credits)");
  9364. format(string, sizeof(string), "You have purchased a Restricted Last Name (NEW) for %s credits.", number_format(ShopItems[31][sItemPrice]));
  9365. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9366. SendClientMessageEx(playerid, COLOR_GREY, "Contact a member of Customer Relations to have the Restricted Last Name (NEW) issued.");
  9367. format(string, sizeof(string), "[Restricted Last Name (NEW)] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[31][sItemPrice]));
  9368. Log("logs/credits.log", string), print(string);
  9369. }
  9370. else if(GetPVarInt(playerid, "MiscShop") == 11) // Restricted Last Name (CHANGE)
  9371. {
  9372. if(PlayerInfo[playerid][pCredits] < ShopItems[32][sItemPrice])
  9373. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9374. GivePlayerCredits(playerid, -ShopItems[32][sItemPrice], 1);
  9375. printf("Price32: %d", ShopItems[32][sItemPrice]);
  9376. AmountSold[32]++;
  9377. AmountMade[32] += ShopItems[32][sItemPrice];
  9378. new szQuery[128];
  9379. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold32` = '%d', `AmountMade32` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[32], AmountMade[32]);
  9380. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9381. AddFlag(playerid, INVALID_PLAYER_ID, "Purchased Restricted Last Name (CHANGE) (Credits)");
  9382. format(string, sizeof(string), "You have purchased a Restricted Last Name (CHANGE) for %s credits.", number_format(ShopItems[32][sItemPrice]));
  9383. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9384. SendClientMessageEx(playerid, COLOR_GREY, "Contact a member of Customer Relations to have the Restricted Last Name (CHANGED) issued.");
  9385. format(string, sizeof(string), "[Restricted Last Name (CHANGE)] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[32][sItemPrice]));
  9386. Log("logs/credits.log", string), print(string);
  9387. }
  9388. else if(GetPVarInt(playerid, "MiscShop") == 12) // Custom User Title (NEW)
  9389. {
  9390. if(PlayerInfo[playerid][pCredits] < ShopItems[33][sItemPrice])
  9391. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9392. GivePlayerCredits(playerid, -ShopItems[33][sItemPrice], 1);
  9393. printf("Price33: %d", ShopItems[33][sItemPrice]);
  9394. AmountSold[33]++;
  9395. AmountMade[33] += ShopItems[33][sItemPrice];
  9396. new szQuery[128];
  9397. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold33` = '%d', `AmountMade33` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[33], AmountMade[33]);
  9398. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9399. AddFlag(playerid, INVALID_PLAYER_ID, "Purchased Custom User Title (NEW) (Credits)");
  9400. format(string, sizeof(string), "You have purchased a Custom User Title (NEW) for %s credits.", number_format(ShopItems[33][sItemPrice]));
  9401. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9402. SendClientMessageEx(playerid, COLOR_GREY, "Contact a member of Customer Relations to have the Custom User Title (NEW) issued.");
  9403. format(string, sizeof(string), "[Custom User Title (NEW)] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[33][sItemPrice]));
  9404. Log("logs/credits.log", string), print(string);
  9405. }
  9406. else if(GetPVarInt(playerid, "MiscShop") == 13) // Custom User Title (CHANGE)
  9407. {
  9408. if(PlayerInfo[playerid][pCredits] < ShopItems[34][sItemPrice])
  9409. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9410. GivePlayerCredits(playerid, -ShopItems[34][sItemPrice], 1);
  9411. printf("Price34: %d", ShopItems[34][sItemPrice]);
  9412. AmountSold[34]++;
  9413. AmountMade[34] += ShopItems[34][sItemPrice];
  9414. new szQuery[128];
  9415. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold34` = '%d', `AmountMade34` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[34], AmountMade[34]);
  9416. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9417. AddFlag(playerid, INVALID_PLAYER_ID, "Purchased Custom User Title (CHANGE) (Credits)");
  9418. format(string, sizeof(string), "You have purchased a Restricted Custom User Title (CHANGE) for %s credits.", number_format(ShopItems[34][sItemPrice]));
  9419. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9420. SendClientMessageEx(playerid, COLOR_GREY, "Contact a member of Customer Relations to have the Custom User Title (CHANGE) issued.");
  9421. format(string, sizeof(string), "[Custom User Title (CHANGE)] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[34][sItemPrice]));
  9422. Log("logs/credits.log", string), print(string);
  9423. }
  9424. else if(GetPVarInt(playerid, "MiscShop") == 14) // Teamspeak User Channel
  9425. {
  9426. if(PlayerInfo[playerid][pCredits] < ShopItems[35][sItemPrice])
  9427. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9428. GivePlayerCredits(playerid, -ShopItems[35][sItemPrice], 1);
  9429. printf("Price35: %d", ShopItems[35][sItemPrice]);
  9430. AmountSold[35]++;
  9431. AmountMade[35] += ShopItems[35][sItemPrice];
  9432. new szQuery[128];
  9433. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold35` = '%d', `AmountMade35` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[35], AmountMade[35]);
  9434. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9435. AddFlag(playerid, INVALID_PLAYER_ID, "Purchased Teamspeak User Channel (Credits)");
  9436. format(string, sizeof(string), "You have purchased a Teamspeak User Channel for %s credits.", number_format(ShopItems[35][sItemPrice]));
  9437. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9438. SendClientMessageEx(playerid, COLOR_GREY, "Contact a member of Customer Relations to have the Teamspeak User Channel issued.");
  9439. format(string, sizeof(string), "[Teamspeak User Channel] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[35][sItemPrice]));
  9440. Log("logs/credits.log", string), print(string);
  9441. }
  9442. else if(GetPVarInt(playerid, "MiscShop") == 15) // Small Backpack
  9443. {
  9444. if(PlayerInfo[playerid][pBackpack] > 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can only purchase one backpack at a time, use /sellbackpack.");
  9445. if(PlayerInfo[playerid][pCredits] < ShopItems[36][sItemPrice])
  9446. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9447. GivePlayerCredits(playerid, -ShopItems[36][sItemPrice], 1);
  9448. printf("Price35: %d", ShopItems[36][sItemPrice]);
  9449. AmountSold[36]++;
  9450. AmountMade[36] += ShopItems[36][sItemPrice];
  9451. new szQuery[128];
  9452. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold36` = '%d', `AmountMade36` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[36], AmountMade[36]);
  9453. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9454. if(PlayerHoldingObject[playerid][9] != 0 || IsPlayerAttachedObjectSlotUsed(playerid, 9))
  9455. RemovePlayerAttachedObject(playerid, 9), PlayerHoldingObject[playerid][9] = 0;
  9456. SetPlayerAttachedObject(playerid, 9, 371, 1, -0.002, -0.140999, -0.01, 8.69999, 88.8, -8.79993, 1.11, 0.963);
  9457. PlayerInfo[playerid][pBEquipped] = 1;
  9458. PlayerInfo[playerid][pBStoredV] = INVALID_PLAYER_VEHICLE_ID;
  9459. PlayerInfo[playerid][pBStoredH] = INVALID_HOUSE_ID;
  9460. PlayerInfo[playerid][pBackpack] = 1;
  9461. format(string, sizeof(string), "You have purchased a Small Backpack for %s credits.", number_format(ShopItems[36][sItemPrice]));
  9462. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9463. SendClientMessageEx(playerid, COLOR_GREY, "Use /backpackhelp to see the list of commands.");
  9464. format(string, sizeof(string), "[Small Backpack] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[36][sItemPrice]));
  9465. Log("logs/credits.log", string), print(string);
  9466. }
  9467. else if(GetPVarInt(playerid, "MiscShop") == 16) // Medium Backpack
  9468. {
  9469. if(PlayerInfo[playerid][pBackpack] > 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can only purchase one backpack at a time, use /sellbackpack.");
  9470. if(PlayerInfo[playerid][pCredits] < ShopItems[37][sItemPrice])
  9471. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9472. GivePlayerCredits(playerid, -ShopItems[37][sItemPrice], 1);
  9473. printf("Price35: %d", ShopItems[37][sItemPrice]);
  9474. AmountSold[37]++;
  9475. AmountMade[37] += ShopItems[37][sItemPrice];
  9476. new szQuery[128];
  9477. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold37` = '%d', `AmountMade37` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[37], AmountMade[37]);
  9478. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9479. if(PlayerHoldingObject[playerid][9] != 0 || IsPlayerAttachedObjectSlotUsed(playerid, 9))
  9480. RemovePlayerAttachedObject(playerid, 9), PlayerHoldingObject[playerid][9] = 0;
  9481. SetPlayerAttachedObject(playerid, 9, 371, 1, -0.002, -0.140999, -0.01, 8.69999, 88.8, -8.79993, 1.11, 0.963);
  9482. PlayerInfo[playerid][pBEquipped] = 1;
  9483. PlayerInfo[playerid][pBStoredV] = INVALID_PLAYER_VEHICLE_ID;
  9484. PlayerInfo[playerid][pBStoredH] = INVALID_HOUSE_ID;
  9485. PlayerInfo[playerid][pBackpack] = 2;
  9486. format(string, sizeof(string), "You have purchased a Medium Backpack for %s credits.", number_format(ShopItems[37][sItemPrice]));
  9487. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9488. SendClientMessageEx(playerid, COLOR_GREY, "Use /backpackhelp to see the list of commands.");
  9489. format(string, sizeof(string), "[Medium Backpack] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[37][sItemPrice]));
  9490. Log("logs/credits.log", string), print(string);
  9491. }
  9492. else if(GetPVarInt(playerid, "MiscShop") == 17) // Large Backpack
  9493. {
  9494. if(PlayerInfo[playerid][pBackpack] > 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can only purchase one backpack at a time, use /sellbackpack.");
  9495. if(PlayerInfo[playerid][pCredits] < ShopItems[38][sItemPrice])
  9496. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9497. GivePlayerCredits(playerid, -ShopItems[38][sItemPrice], 1);
  9498. printf("Price35: %d", ShopItems[38][sItemPrice]);
  9499. AmountSold[38]++;
  9500. AmountMade[38] += ShopItems[38][sItemPrice];
  9501. new szQuery[128];
  9502. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold38` = '%d', `AmountMade38` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[38], AmountMade[38]);
  9503. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9504. if(PlayerHoldingObject[playerid][9] != 0 || IsPlayerAttachedObjectSlotUsed(playerid, 9))
  9505. RemovePlayerAttachedObject(playerid, 9), PlayerHoldingObject[playerid][9] = 0;
  9506. SetPlayerAttachedObject(playerid, 9, 3026, 1, -0.254999, -0.109, -0.022999, 10.6, -1.20002, 3.4, 1.265, 1.242, 1.062);
  9507. PlayerInfo[playerid][pBEquipped] = 1;
  9508. PlayerInfo[playerid][pBStoredV] = INVALID_PLAYER_VEHICLE_ID;
  9509. PlayerInfo[playerid][pBStoredH] = INVALID_HOUSE_ID;
  9510. PlayerInfo[playerid][pBackpack] = 3;
  9511. format(string, sizeof(string), "You have purchased a Large Backpack for %s credits.", number_format(ShopItems[38][sItemPrice]));
  9512. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9513. SendClientMessageEx(playerid, COLOR_GREY, "Use /backpackhelp to see the list of commands.");
  9514. format(string, sizeof(string), "[Large Backpack] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[38][sItemPrice]));
  9515. Log("logs/credits.log", string), print(string);
  9516. }
  9517. else if(GetPVarInt(playerid, "MiscShop") == 18) // Deluxe Car Alarm
  9518. {
  9519. if(PlayerInfo[playerid][pCredits] < ShopItems[39][sItemPrice])
  9520. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9521. if(GetPlayerVehicleCount(playerid) != 0)
  9522. {
  9523. SetPVarInt(playerid, "lockmenu", 4);
  9524. for(new i=0; i<MAX_PLAYERVEHICLES; i++)
  9525. {
  9526. if(PlayerVehicleInfo[playerid][i][pvId] != INVALID_PLAYER_VEHICLE_ID)
  9527. {
  9528. format(string, sizeof(string), "Vehicle %d | Name: %s.",i+1,GetVehicleName(PlayerVehicleInfo[playerid][i][pvId]));
  9529. SendClientMessageEx(playerid, COLOR_WHITE, string);
  9530. }
  9531. }
  9532. return ShowPlayerDialogEx(playerid, DIALOG_CDLOCKMENU, DIALOG_STYLE_INPUT, "24-7;"," Select a vehicle you wish to install this on:", "Select", "Cancel");
  9533. }
  9534. else return SendClientMessageEx(playerid, COLOR_WHITE, "You don't have any cars - where we can install this item?");
  9535. }
  9536. else if(GetPVarInt(playerid, "MiscShop") == 19) // Furniture Bronze
  9537. {
  9538. if(PlayerInfo[playerid][pCredits] < ShopItems[41][sItemPrice])
  9539. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9540. if(PlayerInfo[playerid][pFurnitureSlots] >= MAX_FURNITURE_SLOTS) return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot buy anymore furniture slots.");
  9541. PlayerInfo[playerid][pFurnitureSlots] += 25;
  9542. if(PlayerInfo[playerid][pFurnitureSlots] > MAX_FURNITURE_SLOTS) {
  9543. PlayerInfo[playerid][pFurnitureSlots] = MAX_FURNITURE_SLOTS;
  9544. SendClientMessageEx(playerid, COLOR_GRAD1, "Your furniture slots have been maximized.");
  9545. }
  9546. format(szMiscArray, sizeof(szMiscArray), "You have purchased a Furniture Pack - Bronze for %s credits.", number_format(ShopItems[41][sItemPrice]));
  9547. SendClientMessageEx(playerid, COLOR_CYAN, szMiscArray);
  9548. SendClientMessageEx(playerid, COLOR_GREY, "Use /furniturehelp to see the list of commands.");
  9549. format(szMiscArray, sizeof(szMiscArray), "[Furniture Pack - Bronze] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[41][sItemPrice]));
  9550. Log("logs/credits.log", szMiscArray), print(szMiscArray);
  9551. GivePlayerCredits(playerid, -ShopItems[41][sItemPrice], 1);
  9552. printf("Price43: %d", ShopItems[41][sItemPrice]);
  9553. AmountSold[41]++;
  9554. AmountMade[41] += ShopItems[41][sItemPrice];
  9555. mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "UPDATE `sales` SET `TotalSold41` = '%d', `AmountMade41` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[41], AmountMade[41]);
  9556. mysql_tquery(MainPipeline, szMiscArray, "OnQueryFinish", "i", SENDDATA_THREAD);
  9557. }
  9558. else if(GetPVarInt(playerid, "MiscShop") == 20) // Furniture Bronze
  9559. {
  9560. if(PlayerInfo[playerid][pCredits] < ShopItems[42][sItemPrice])
  9561. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9562. if(PlayerInfo[playerid][pFurnitureSlots] >= MAX_FURNITURE_SLOTS) return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot buy anymore furniture slots.");
  9563. PlayerInfo[playerid][pFurnitureSlots] += 40;
  9564. if(PlayerInfo[playerid][pFurnitureSlots] > MAX_FURNITURE_SLOTS) {
  9565. PlayerInfo[playerid][pFurnitureSlots] = MAX_FURNITURE_SLOTS;
  9566. SendClientMessageEx(playerid, COLOR_GRAD1, "Your furniture slots have been maximized.");
  9567. }
  9568. format(szMiscArray, sizeof(szMiscArray), "You have purchased a Furniture Pack - Silver for %s credits.", number_format(ShopItems[42][sItemPrice]));
  9569. SendClientMessageEx(playerid, COLOR_CYAN, szMiscArray);
  9570. SendClientMessageEx(playerid, COLOR_GREY, "Use /furniturehelp to see the list of commands.");
  9571. format(szMiscArray, sizeof(szMiscArray), "[Furniture Pack - Silver] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[42][sItemPrice]));
  9572. Log("logs/credits.log", szMiscArray), print(szMiscArray);
  9573. GivePlayerCredits(playerid, -ShopItems[42][sItemPrice], 1);
  9574. printf("Price43: %d", ShopItems[42][sItemPrice]);
  9575. AmountSold[42]++;
  9576. AmountMade[42] += ShopItems[42][sItemPrice];
  9577. mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "UPDATE `sales` SET `TotalSold42` = '%d', `AmountMade42` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[42], AmountMade[42]);
  9578. mysql_tquery(MainPipeline, szMiscArray, "OnQueryFinish", "i", SENDDATA_THREAD);
  9579. }
  9580. else if(GetPVarInt(playerid, "MiscShop") == 21) // Furniture Gold
  9581. {
  9582. if(PlayerInfo[playerid][pCredits] < ShopItems[43][sItemPrice])
  9583. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9584. if(PlayerInfo[playerid][pFurnitureSlots] >= MAX_FURNITURE_SLOTS) return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot buy anymore furniture slots.");
  9585. PlayerInfo[playerid][pFurnitureSlots] += 50;
  9586. if(PlayerInfo[playerid][pFurnitureSlots] > MAX_FURNITURE_SLOTS) {
  9587. PlayerInfo[playerid][pFurnitureSlots] = MAX_FURNITURE_SLOTS;
  9588. SendClientMessageEx(playerid, COLOR_GRAD1, "Your furniture slots have been maximized.");
  9589. }
  9590. format(szMiscArray, sizeof(szMiscArray), "You have purchased a Furniture Pack - Gold for %s credits.", number_format(ShopItems[43][sItemPrice]));
  9591. SendClientMessageEx(playerid, COLOR_CYAN, szMiscArray);
  9592. SendClientMessageEx(playerid, COLOR_GREY, "Use /furniturehelp to see the list of commands.");
  9593. format(szMiscArray, sizeof(szMiscArray), "[Furniture Pack] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[43][sItemPrice]));
  9594. Log("logs/credits.log", szMiscArray), print(szMiscArray);
  9595. GivePlayerCredits(playerid, -ShopItems[43][sItemPrice], 1);
  9596. printf("Price43: %d", ShopItems[43][sItemPrice]);
  9597. AmountSold[43]++;
  9598. AmountMade[43] += ShopItems[43][sItemPrice];
  9599. mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "UPDATE `sales` SET `TotalSold43` = '%d', `AmountMade43` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[43], AmountMade[43]);
  9600. mysql_tquery(MainPipeline, szMiscArray, "OnQueryFinish", "i", SENDDATA_THREAD);
  9601. }
  9602. DeletePVar(playerid, "MiscShop");
  9603. }
  9604. if(dialogid == DIALOG_SHOPHELPMENU)
  9605. {
  9606. if(response)
  9607. {
  9608. switch(listitem)
  9609. {
  9610. case 0: //VIP Shop
  9611. {
  9612. SetPVarInt(playerid, "ShopCheckpoint", listitem+1);
  9613. ShowPlayerDialogEx(playerid, DIALOG_SHOPHELPMENU8, DIALOG_STYLE_MSGBOX, "VIP Shop", "To purchase Bronze VIP, Silver VIP or Gold VIP you use /vipshop at one of the VIP points located outside each VIP Club.\n You can renew your Gold VIP by using /vipshop however you need to make sure that you have renewable Gold VIP.\n You can read the benefits of VIP on the Shop Control Panel or listed within /vipshop.", "Checkpoint", "Exit");
  9614. }
  9615. case 1:
  9616. {
  9617. ShowPlayerDialogEx(playerid, DIALOG_NOTHING, DIALOG_STYLE_MSGBOX, "House Shop", "To purchase a house, change your house interior, or buy a house move from the shop, you can use /houseshop anywhere. \nYou can read more information regarding houses on the Shop Control Panel.", "Exit", "");
  9618. }
  9619. case 2:
  9620. {
  9621. ShowPlayerDialogEx(playerid, DIALOG_NOTHING, DIALOG_STYLE_MSGBOX, "Business Shop", "Want to buy a business or renew your current one? Use the command /businessshop and this will allow you to purchase a business or renew your current one.\n It is important that you read the business rules on the forums and read more about businesses on the Shop Control Panel. Note: The Purchase Business will list the available businesses for sale at that time.", "Exit", "");
  9622. }
  9623. case 3:
  9624. {
  9625. ShowPlayerDialogEx(playerid, DIALOG_NOTHING, DIALOG_STYLE_MSGBOX, "Toy Shop", "To purchase a custom toy use /toyshop at a clothing shop. This allows you to see the selection of toys available and purchase one by simply clicking on it!\n After purchasing the toy will be put in your toy slot.", "Exit", "");
  9626. }
  9627. case 4:
  9628. {
  9629. ShowPlayerDialogEx(playerid, DIALOG_NOTHING, DIALOG_STYLE_MSGBOX, "Miscellaneous Shop", "To buy miscellaneous products such as poker tables and EXP tokens, visit any 24/7 business and use the /miscshop command.\n This will pop-up all the available miscellaneous products that are for sale. Keep an eye out as there are always new additions!", "Exit", "");
  9630. }
  9631. case 5:
  9632. {
  9633. ShowPlayerDialogEx(playerid, DIALOG_SHOPHELPMENU2, DIALOG_STYLE_MSGBOX, "Car Shop", "To purchase a custom car, you can use /carshop at locations from shipping docks and other locations.\n Using /carshop allows you to see the selection of cars available and purchase one by simply clicking on it!\n The car will be put into your car slot after you purchase.", "Checkpoint", "Exit");
  9634. }
  9635. case 6:
  9636. {
  9637. ShowPlayerDialogEx(playerid, DIALOG_SHOPHELPMENU3, DIALOG_STYLE_MSGBOX, "Plane Shop", "To purchase a custom car, you can use /carshop at locations from shipping docks and other locations.\n Using /carshop allows you to see the selection of cars available and purchase one by simply clicking on it!\n The car will be put into your car slot after you purchase.", "Checkpoint", "Exit");
  9638. }
  9639. case 7:
  9640. {
  9641. ShowPlayerDialogEx(playerid, DIALOG_SHOPHELPMENU5, DIALOG_STYLE_MSGBOX, "Boat Shop", "To purchase a custom car, you can use /carshop at locations from shipping docks and other locations.\n Using /carshop allows you to see the selection of cars available and purchase one by simply clicking on it!\n The car will be put into your car slot after you purchase.", "Checkpoint", "Exit");
  9642. }
  9643. }
  9644. }
  9645. }
  9646. if(dialogid == DIALOG_SHOPHELPMENU8)
  9647. {
  9648. if(response)
  9649. {
  9650. ShowPlayerDialogEx(playerid, DIALOG_SHOPHELPMENU9, DIALOG_STYLE_LIST, "Boat Shop Locater", "Los Santos\nSan Fierro\nLas Venturas", "Locate", "Cancel");
  9651. }
  9652. }
  9653. if(dialogid == DIALOG_SHOPHELPMENU9)
  9654. {
  9655. if(response)
  9656. {
  9657. if(CheckPointCheck(playerid))
  9658. return SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
  9659. SetPVarInt(playerid, "ShopCheckpoint", 1);
  9660. switch(listitem)
  9661. {
  9662. case 0: SetPlayerCheckpoint(playerid, 1811.3344, -1569.4244, 13.4811, 5.0);
  9663. case 1: SetPlayerCheckpoint(playerid, -2443.6013, 499.7480, 30.0906, 5.0);
  9664. case 2: SetPlayerCheckpoint(playerid, 1934.1083, 1364.5004, 9.2578, 5.0);
  9665. }
  9666. }
  9667. }
  9668. if(dialogid == DIALOG_SHOPHELPMENU5)
  9669. {
  9670. if(response)
  9671. {
  9672. ShowPlayerDialogEx(playerid, DIALOG_SHOPHELPMENU6, DIALOG_STYLE_LIST, "Boat Shop Locater", "Los Santos\nSan Fierro\nBayside", "Locate", "Cancel");
  9673. }
  9674. }
  9675. if(dialogid == DIALOG_SHOPHELPMENU6)
  9676. {
  9677. if(response)
  9678. {
  9679. if(CheckPointCheck(playerid))
  9680. return SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
  9681. SetPVarInt(playerid, "ShopCheckpoint", 1);
  9682. switch(listitem)
  9683. {
  9684. case 0: SetPlayerCheckpoint(playerid, 723.1553, -1494.4547, 1.9343, 5.0);
  9685. case 1: SetPlayerCheckpoint(playerid, -2975.8950, 505.1325, 2.4297, 5.0);
  9686. case 2: SetPlayerCheckpoint(playerid, -2214.1636, 2422.4763, 2.496, 5.0);
  9687. }
  9688. }
  9689. }
  9690. if(dialogid == DIALOG_SHOPHELPMENU3)
  9691. {
  9692. if(response)
  9693. {
  9694. ShowPlayerDialogEx(playerid, DIALOG_SHOPHELPMENU4, DIALOG_STYLE_LIST, "Plane Shop Locater", "Los Santos Airport\nLas Venturas Airport", "Locate", "Cancel");
  9695. }
  9696. }
  9697. if(dialogid == DIALOG_SHOPHELPMENU4)
  9698. {
  9699. if(response)
  9700. {
  9701. if(CheckPointCheck(playerid))
  9702. return SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
  9703. SetPVarInt(playerid, "ShopCheckpoint", 1);
  9704. switch(listitem)
  9705. {
  9706. case 0: SetPlayerCheckpoint(playerid, 1891.9105, -2279.6174, 13.5469, 5.0);
  9707. case 1: SetPlayerCheckpoint(playerid, 1632.0836, 1551.7365, 10.8061, 5.0);
  9708. }
  9709. }
  9710. }
  9711. if(dialogid == DIALOG_SHOPHELPMENU2)
  9712. {
  9713. if(response)
  9714. {
  9715. ShowPlayerDialogEx(playerid, DIALOG_SHOPHELPMENU7, DIALOG_STYLE_LIST, "Car Shop Locater", "Los Santos\nSan Fierro\nLas Venturas", "Locate", "Cancel");
  9716. }
  9717. }
  9718. if(dialogid == DIALOG_SHOPHELPMENU7)
  9719. {
  9720. if(response)
  9721. {
  9722. if(CheckPointCheck(playerid))
  9723. return SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
  9724. SetPVarInt(playerid, "ShopCheckpoint", 1);
  9725. switch(listitem)
  9726. {
  9727. case 0: SetPlayerCheckpoint(playerid, 2280.5720, -2325.2490, 13.5469, 5.0);
  9728. case 1: SetPlayerCheckpoint(playerid, -1731.1923, 127.4794, 3.2976, 5.0);
  9729. case 2: SetPlayerCheckpoint(playerid, 1663.9569, 1628.5106, 10.8203, 5.0);
  9730. }
  9731. }
  9732. }
  9733. if(dialogid == DIALOG_RENTACAR)
  9734. {
  9735. if(response)
  9736. {
  9737. if(PlayerInfo[playerid][pCredits] < ShopItems[20][sItemPrice])
  9738. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9739. new
  9740. szQuery[215];
  9741. AmountSold[20]++;
  9742. AmountMade[20] += ShopItems[20][sItemPrice];
  9743. //ShopItems[20][sSold]++;
  9744. //ShopItems[20][sMade] += ShopItems[20][sItemPrice];
  9745. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold20` = '%d', `AmountMade20` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[20], AmountMade[20]);
  9746. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9747. if(IsPlayerInRangeOfPoint(playerid, 4, 1102.8999, -1440.1669, 15.7969))
  9748. {
  9749. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "INSERT INTO `rentedcars` (`sqlid`, `modelid`, `posx`, `posy`, `posz`, `posa`, `spawned`, `hours`) VALUES ('%d', '%d', '%f', '%f', '%f', '%f', '1', '180')", GetPlayerSQLId(playerid), GetPVarInt(playerid, "VehicleID"), 1060.4927,-1474.9323,13.1905,345.2816);
  9750. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9751. SetPVarInt(playerid, "RentedVehicle", CreateVehicle(GetPVarInt(playerid, "VehicleID"), 1060.4927, -1474.9323, 13.1905, 345.2816, random(128), random(128), 2000000));
  9752. }
  9753. else if(IsPlayerInRangeOfPoint(playerid, 4, 1796.0620, -1588.5571, 13.4951))
  9754. {
  9755. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "INSERT INTO `rentedcars` (`sqlid`, `modelid`, `posx`, `posy`, `posz`, `posa`, `spawned`, `hours`) VALUES ('%d', '%d', '%f', '%f', '%f', '%f', '1', '180')", GetPlayerSQLId(playerid), GetPVarInt(playerid, "VehicleID"), 1787.6924, -1605.8617,13.1750, 76.7439);
  9756. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9757. SetPVarInt(playerid, "RentedVehicle", CreateVehicle(GetPVarInt(playerid, "VehicleID"), 1787.6924, -1605.8617, 13.1750, 76.7439, random(128), random(128), 2000000));
  9758. }
  9759. GivePlayerCredits(playerid, -ShopItems[20][sItemPrice], 1);
  9760. printf("Price20: %d", ShopItems[20][sItemPrice]);
  9761. IsPlayerEntering{playerid} = true;
  9762. PutPlayerInVehicle(playerid, GetPVarInt(playerid, "RentedVehicle"), 0);
  9763. format(szQuery, sizeof(szQuery), "[RentaCar] [User: %s(%i)] [IP: %s] [Model: %d] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), GetPVarInt(playerid, "VehicleID"), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[20][sItemPrice]));
  9764. Log("logs/credits.log", szQuery), print(szQuery);
  9765. format(szQuery, sizeof(szQuery), "[Rent a Car] You have rented a %s for %s credits, the vehicle will last 3 hours.", VehicleName[GetPVarInt(playerid, "VehicleID") - 400], number_format(ShopItems[20][sItemPrice]));
  9766. SendClientMessageEx(playerid, COLOR_CYAN, szQuery);
  9767. SendClientMessageEx(playerid, COLOR_CYAN, "Commands Available: /park, /stoprentacar, /trackcar");
  9768. SetPVarInt(playerid, "RentedHours", 180);
  9769. VehicleFuel[GetPVarInt(playerid, "RentedVehicle")] = 100;
  9770. }
  9771. DeletePVar(playerid, "VehicleID");
  9772. }
  9773. if(dialogid == DIALOG_CARSHOP)
  9774. {
  9775. if(response)
  9776. {
  9777. if(PlayerInfo[playerid][pCredits] < ShopItems[5][sItemPrice])
  9778. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  9779. else if(!vehicleCountCheck(playerid))
  9780. return ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, "Error", "You can't have any more vehicles, you own too many!", "OK", "");
  9781. else if(!vehicleSpawnCountCheck(playerid))
  9782. return ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, "Error", "You have too many vehicles spawned, you must store one first.", "OK", "");
  9783. else
  9784. {
  9785. if(GetPVarType(playerid, "BoatShop"))
  9786. {
  9787. new createdcar;
  9788. if(IsPlayerInRangeOfPoint(playerid, 4, -2214.1636, 2422.4763, 2.4961))
  9789. {
  9790. createdcar = CreatePlayerVehicle(playerid, GetPlayerFreeVehicleId(playerid), GetPVarInt(playerid, "VehicleID"), -2218.4795, 2424.9880, -0.3707, 314.4837, 0, 0, 2000000, 0, 0);
  9791. }
  9792. else if(IsPlayerInRangeOfPoint(playerid, 4, -2975.8950, 505.1325, 2.4297))
  9793. {
  9794. createdcar = CreatePlayerVehicle(playerid, GetPlayerFreeVehicleId(playerid), GetPVarInt(playerid, "VehicleID"), -2975.4841, 509.6216, -0.4241, 89.7179, 0, 0, 2000000, 0, 0);
  9795. }
  9796. else if(IsPlayerInRangeOfPoint(playerid, 4, 723.1553, -1494.4547, 1.9343))
  9797. {
  9798. createdcar = CreatePlayerVehicle(playerid, GetPlayerFreeVehicleId(playerid), GetPVarInt(playerid, "VehicleID"), 723.4292, -1505.4899, -0.4145, 180.4212, 0, 0, 2000000, 0, 0);
  9799. }
  9800. else if(IsPlayerInRangeOfPoint(playerid, 4, 2974.7520, -1462.9265, 2.8184))
  9801. {
  9802. createdcar = CreatePlayerVehicle(playerid, GetPlayerFreeVehicleId(playerid), GetPVarInt(playerid, "VehicleID"), 2996.4255, -1467.3026, 2.8184, 0, 0, 0, 2000000, 0, 0);
  9803. DeletePVar(playerid, "ShopTP");
  9804. }
  9805. GivePlayerCredits(playerid, -ShopItems[5][sItemPrice], 1);
  9806. printf("Price5: %d", ShopItems[5][sItemPrice]);
  9807. IsPlayerEntering{playerid} = true;
  9808. SetPlayerVirtualWorld(playerid, 0);
  9809. PutPlayerInVehicle(playerid, createdcar, 0);
  9810. AmountSold[5]++;
  9811. AmountMade[5] += ShopItems[5][sItemPrice];
  9812. //ShopItems[5][sSold]++;
  9813. //ShopItems[5][sMade] += ShopItems[5][sItemPrice];
  9814. new szQuery[128];
  9815. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold5` = '%d', `AmountMade5` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[5], AmountMade[5]);
  9816. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9817. new Float: arr_fPlayerPos[4];
  9818. GetPlayerPos(playerid, arr_fPlayerPos[0], arr_fPlayerPos[1], arr_fPlayerPos[2]);
  9819. GetPlayerFacingAngle(playerid, arr_fPlayerPos[3]);
  9820. format(string, sizeof(string), "[CAR %i] [User: %s(%i)] [IP: %s] [Credits: %s] [Vehicle: %s] [Price: %s]", AmountSold[5], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), VehicleName[GetPVarInt(playerid, "VehicleID") - 400], number_format(ShopItems[5][sItemPrice]));
  9821. Log("logs/credits.log", string), print(string);
  9822. format(string, sizeof(string), "[Car Shop] You have purchased a %s for %s credits.", VehicleName[GetPVarInt(playerid, "VehicleID") - 400], number_format(ShopItems[5][sItemPrice]));
  9823. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9824. DeletePVar(playerid, "BoatShop");
  9825. }
  9826. else
  9827. {
  9828. GivePlayerCredits(playerid, -ShopItems[5][sItemPrice], 1);
  9829. printf("Price5: %d", ShopItems[5][sItemPrice]);
  9830. AmountSold[5]++;
  9831. AmountMade[5] += ShopItems[5][sItemPrice];
  9832. //ShopItems[5][sSold]++;
  9833. //ShopItems[5][sMade] += ShopItems[5][sItemPrice];
  9834. new szQuery[128];
  9835. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold5` = '%d', `AmountMade5` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[5], AmountMade[5]);
  9836. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  9837. new Float: arr_fPlayerPos[4], createdcar;
  9838. GetPlayerPos(playerid, arr_fPlayerPos[0], arr_fPlayerPos[1], arr_fPlayerPos[2]);
  9839. GetPlayerFacingAngle(playerid, arr_fPlayerPos[3]);
  9840. if(IsPlayerInDynamicArea(playerid, NGGShop))
  9841. {
  9842. arr_fPlayerPos[0] = 2923.3220;
  9843. arr_fPlayerPos[1] = -1276.6011;
  9844. arr_fPlayerPos[2] = 10.9809;
  9845. arr_fPlayerPos[3] = 11.4626;
  9846. if(IsAPlane(GetPVarInt(playerid, "VehicleID"), 1))
  9847. {
  9848. arr_fPlayerPos[0] = 1937.1254;
  9849. arr_fPlayerPos[1] = -2494.1057;
  9850. arr_fPlayerPos[2] = 14.4581;
  9851. arr_fPlayerPos[3] = 90.2559;
  9852. }
  9853. DeletePVar(playerid, "ShopTP");
  9854. }
  9855. createdcar = CreatePlayerVehicle(playerid, GetPlayerFreeVehicleId(playerid), GetPVarInt(playerid, "VehicleID"), arr_fPlayerPos[0], arr_fPlayerPos[1], arr_fPlayerPos[2], arr_fPlayerPos[3], 0, 0, 2000000, 0, 0);
  9856. format(string, sizeof(string), "[CAR %i] [User: %s(%i)] [IP: %s] [Credits: %s] [Vehicle: %s] [Price: %s]", AmountSold[5], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), VehicleName[GetPVarInt(playerid, "VehicleID") - 400], number_format(ShopItems[5][sItemPrice]));
  9857. Log("logs/credits.log", string), print(string);
  9858. IsPlayerEntering{playerid} = true;
  9859. SetPlayerVirtualWorld(playerid, 0);
  9860. PutPlayerInVehicle(playerid, createdcar, 0);
  9861. format(string, sizeof(string), "[Car Shop] You have purchased a %s for %s credits.", VehicleName[GetPVarInt(playerid, "VehicleID") - 400], number_format(ShopItems[5][sItemPrice]));
  9862. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9863. }
  9864. }
  9865. }
  9866. DeletePVar(playerid, "VehicleID");
  9867. }
  9868. if(dialogid == DIALOG_CARSHOP2)
  9869. {
  9870. if(response)
  9871. {
  9872. if(PlayerInfo[playerid][pCarVoucher] == 0)
  9873. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have a restricted vehicle voucher. ");
  9874. else if(!vehicleCountCheck(playerid))
  9875. return ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, "Error", "You can't have any more vehicles, you own too many!", "OK", "");
  9876. else if(!vehicleSpawnCountCheck(playerid))
  9877. return ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, "Error", "You have too many vehicles spawned, you must store one first.", "OK", "");
  9878. else
  9879. {
  9880. PlayerInfo[playerid][pCarVoucher]--;
  9881. new Float: arr_fPlayerPos[4], createdcar;
  9882. GetPlayerPos(playerid, arr_fPlayerPos[0], arr_fPlayerPos[1], arr_fPlayerPos[2]);
  9883. GetPlayerFacingAngle(playerid, arr_fPlayerPos[3]);
  9884. createdcar = CreatePlayerVehicle(playerid, GetPlayerFreeVehicleId(playerid), GetPVarInt(playerid, "VehicleID"), arr_fPlayerPos[0], arr_fPlayerPos[1], arr_fPlayerPos[2], arr_fPlayerPos[3], 0, 0, 2000000, 0, 0);
  9885. format(string, sizeof(string), "[CAR %i] [User: %s(%i)] [IP: %s] [Credits: %s] [Vehicle: %s] [Price: %s]", AmountSold[5], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), VehicleName[GetPVarInt(playerid, "VehicleID") - 400], number_format(ShopItems[5][sItemPrice]));
  9886. Log("logs/carvoucher.log", string), print(string);
  9887. IsPlayerEntering{playerid} = true;
  9888. SetPlayerVirtualWorld(playerid, 0);
  9889. PutPlayerInVehicle(playerid, createdcar, 0);
  9890. format(string, sizeof(string), "[Car Shop] You have purchased a %s for 1 restricted car voucher.", VehicleName[GetPVarInt(playerid, "VehicleID") - 400]);
  9891. SendClientMessageEx(playerid, COLOR_CYAN, string);
  9892. }
  9893. }
  9894. DeletePVar(playerid, "VehicleID");
  9895. }
  9896. if(dialogid == DIALOG_EDITSHOPBUSINESS)
  9897. {
  9898. if(response)
  9899. {
  9900. switch(listitem)
  9901. {
  9902. case 0: // Add Business
  9903. {
  9904. for (new i; i < sizeof(BusinessSales); i++)
  9905. {
  9906. if(BusinessSales[i][bAvailable] == 0)
  9907. {
  9908. SetPVarInt(playerid, "EditingSale", i);
  9909. break;
  9910. }
  9911. }
  9912. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS2, DIALOG_STYLE_INPUT, "Adding Business [1/4]","Enter the business ID you wish to sell.", "Next", "Cancel");
  9913. }
  9914. case 1: // Edit Business
  9915. {
  9916. new Count, szDialog[500];
  9917. for (new i; i < sizeof(BusinessSales); i++)
  9918. {
  9919. if(BusinessSales[i][bAvailable] == 1 || BusinessSales[i][bAvailable] == 3)
  9920. {
  9921. format(szDialog, sizeof(szDialog), "%s\n(%d) %s | Type: %d | Credits: %s", szDialog, BusinessSales[i][bBusinessID], BusinessSales[i][bText],BusinessSales[i][bType], number_format(BusinessSales[i][bPrice]));
  9922. Selected[playerid][Count] = i;
  9923. Count++;
  9924. }
  9925. }
  9926. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS8, DIALOG_STYLE_LIST, "Select business to edit.", szDialog, "Select", "Exit");
  9927. }
  9928. case 2: // View Businesses Sold
  9929. {
  9930. new Count, szDialog[500];
  9931. for (new i; i < sizeof(BusinessSales); i++)
  9932. {
  9933. if(BusinessSales[i][bAvailable] == 2)
  9934. {
  9935. format(szDialog, sizeof(szDialog), "%s\n(Business ID: %d)%s | (Credits: %s) | Purchaser: %d", szDialog, BusinessSales[i][bBusinessID], BusinessSales[i][bText], number_format(BusinessSales[i][bPrice]), BusinessSales[i][bPurchased]);
  9936. Selected[playerid][Count] = i;
  9937. Count++;
  9938. }
  9939. }
  9940. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS7, DIALOG_STYLE_LIST, "Businesses Purchased", szDialog, "Reset", "Exit");
  9941. }
  9942. }
  9943. }
  9944. }
  9945. if(dialogid == DIALOG_EDITSHOPBUSINESS8)
  9946. {
  9947. if(response)
  9948. {
  9949. new szDialog[128];
  9950. SetPVarInt(playerid, "BusinessList", listitem);
  9951. format(szDialog, sizeof(szDialog), "Business ID: %d\nText: %s\nType: %d\nCredits: %s\nAvailable: %d", BusinessSales[Selected[playerid][listitem]][bBusinessID], BusinessSales[Selected[playerid][listitem]][bText],BusinessSales[Selected[playerid][listitem]][bType],
  9952. number_format(BusinessSales[Selected[playerid][listitem]][bPrice]), BusinessSales[Selected[playerid][listitem]][bAvailable]);
  9953. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS9, DIALOG_STYLE_LIST, "Select business to edit.", szDialog, "Reset", "Exit");
  9954. }
  9955. }
  9956. if(dialogid == DIALOG_EDITSHOPBUSINESS9)
  9957. {
  9958. if(response)
  9959. {
  9960. switch(listitem)
  9961. {
  9962. case 0: // Business ID
  9963. {
  9964. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS10, DIALOG_STYLE_INPUT, "Editing Business","Enter the business ID you wish to sell.", "Submit", "Back");
  9965. }
  9966. case 1: // Text
  9967. {
  9968. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS11, DIALOG_STYLE_INPUT, "Editing Business","Enter the business description.", "Submit", "Back");
  9969. }
  9970. case 2: // Type
  9971. {
  9972. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS12, DIALOG_STYLE_INPUT, "Editing Business","Enter the type of the business. (1-3)", "Submit", "Back");
  9973. }
  9974. case 3: // Credits
  9975. {
  9976. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS13, DIALOG_STYLE_INPUT, "Editing Business","Enter the amount of credits needed to purchase the business.", "Submit", "Back");
  9977. }
  9978. case 4: // Available
  9979. {
  9980. if(BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bAvailable] == 1)
  9981. {
  9982. BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bAvailable] = 3;
  9983. SendClientMessageEx(playerid, COLOR_CYAN, "That business is now unavailable for purchase.");
  9984. }
  9985. else
  9986. {
  9987. BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bAvailable] = 1;
  9988. SendClientMessageEx(playerid, COLOR_CYAN, "That business is now available for purchase.");
  9989. }
  9990. new szDialog[128];
  9991. format(szDialog, sizeof(szDialog), "Business ID: %d\nText: %s\nType: %d\nCredits: %s\nAvailable: %d", BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bBusinessID], BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bText],BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bType],
  9992. number_format(BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bPrice]), BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bAvailable]);
  9993. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS9, DIALOG_STYLE_LIST, "Select business to edit.", szDialog, "Select", "Exit");
  9994. }
  9995. }
  9996. }
  9997. else
  9998. {
  9999. SaveBusinessSale(Selected[playerid][GetPVarInt(playerid, "BusinessList")]);
  10000. DeletePVar(playerid, "BusinessList");
  10001. }
  10002. }
  10003. if(dialogid == DIALOG_EDITSHOPBUSINESS13)
  10004. {
  10005. if(response)
  10006. {
  10007. new BusinessID;
  10008. if (sscanf(inputtext, "d", BusinessID))
  10009. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS13, DIALOG_STYLE_INPUT, "Editing Business","Enter the amount of credits needed to purchase the business.", "Submit", "Back");
  10010. if(BusinessID < 0)
  10011. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS13, DIALOG_STYLE_INPUT, "Editing Business","Enter the amount of credits needed to purchase the business.", "Submit", "Back");
  10012. new szDialog[128];
  10013. BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bPrice] = BusinessID;
  10014. format(szDialog, sizeof(szDialog), "Business ID: %d\nText: %s\nType: %d\nCredits: %s\nAvailable: %d", BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bBusinessID], BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bText],BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bType],
  10015. number_format(BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bPrice]), BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bAvailable]);
  10016. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS9, DIALOG_STYLE_LIST, "Select business to edit.", szDialog, "Select", "Exit");
  10017. }
  10018. else
  10019. {
  10020. new szDialog[128];
  10021. format(szDialog, sizeof(szDialog), "Business ID: %d\nText: %s\nType: %d\nCredits: %s\nAvailable: %d", BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bBusinessID], BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bText],BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bType],
  10022. number_format(BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bPrice]), BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bAvailable]);
  10023. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS9, DIALOG_STYLE_LIST, "Select business to edit.", szDialog, "Select", "Exit");
  10024. }
  10025. }
  10026. if(dialogid == DIALOG_EDITSHOPBUSINESS12)
  10027. {
  10028. if(response)
  10029. {
  10030. new BusinessID;
  10031. if (sscanf(inputtext, "d", BusinessID))
  10032. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS12, DIALOG_STYLE_INPUT, "Editing Business","Enter the type of the business. (1-3)", "Submit", "Back");
  10033. if(BusinessID < 1 || BusinessID > 3)
  10034. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS12, DIALOG_STYLE_INPUT, "Editing Business","Enter the type of the business. (1-3)", "Submit", "Back");
  10035. new szDialog[128];
  10036. BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bType] = BusinessID;
  10037. format(szDialog, sizeof(szDialog), "Business ID: %d\nText: %s\nType: %d\nCredits: %s\nAvailable: %d", BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bBusinessID], BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bText],BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bType],
  10038. number_format(BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bPrice]), BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bAvailable]);
  10039. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS9, DIALOG_STYLE_LIST, "Select business to edit.", szDialog, "Select", "Exit");
  10040. }
  10041. else
  10042. {
  10043. new szDialog[128];
  10044. format(szDialog, sizeof(szDialog), "Business ID: %d\nText: %s\nType: %d\nCredits: %s\nAvailable: %d", BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bBusinessID], BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bText],BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bType],
  10045. number_format(BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bPrice]), BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bAvailable]);
  10046. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS9, DIALOG_STYLE_LIST, "Select business to edit.", szDialog, "Select", "Exit");
  10047. }
  10048. }
  10049. if(dialogid == DIALOG_EDITSHOPBUSINESS11)
  10050. {
  10051. if(response)
  10052. {
  10053. if(isnull(inputtext))
  10054. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS11, DIALOG_STYLE_INPUT, "Editing Business","Enter the business description.", "Submit", "Back");
  10055. if(strlen(inputtext) > 128)
  10056. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS11, DIALOG_STYLE_INPUT, "Editing Business","Enter the business description.", "Submit", "Back");
  10057. new szDialog[128];
  10058. strcpy(BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bText], inputtext, 128);
  10059. format(szDialog, sizeof(szDialog), "Business ID: %d\nText: %s\nType: %d\nCredits: %s\nAvailable: %d", BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bBusinessID], BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bText],BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bType],
  10060. number_format(BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bPrice]), BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bAvailable]);
  10061. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS9, DIALOG_STYLE_LIST, "Select business to edit.", szDialog, "Select", "Exit");
  10062. }
  10063. else
  10064. {
  10065. new szDialog[128];
  10066. format(szDialog, sizeof(szDialog), "Business ID: %d\nText: %s\nType: %d\nCredits: %s\nAvailable: %d", BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bBusinessID], BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bText],BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bType],
  10067. number_format(BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bPrice]), BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bAvailable]);
  10068. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS9, DIALOG_STYLE_LIST, "Select business to edit.", szDialog, "Select", "Exit");
  10069. }
  10070. }
  10071. if(dialogid == DIALOG_EDITSHOPBUSINESS10)
  10072. {
  10073. if(response)
  10074. {
  10075. new BusinessID;
  10076. if (sscanf(inputtext, "d", BusinessID))
  10077. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS10, DIALOG_STYLE_INPUT, "Editing Business","Enter the business ID you wish to sell.", "Submit", "Back");
  10078. if(!IsValidBusinessID(BusinessID))
  10079. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS10, DIALOG_STYLE_INPUT, "Editing Business","Enter the business ID you wish to sell.", "Submit", "Back");
  10080. new szDialog[128];
  10081. BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bBusinessID] = BusinessID;
  10082. format(szDialog, sizeof(szDialog), "Business ID: %d\nText: %s\nType: %d\nCredits: %s\nAvailable: %d", BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bBusinessID], BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bText],BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bType],
  10083. number_format(BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bPrice]), BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bAvailable]);
  10084. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS9, DIALOG_STYLE_LIST, "Select business to edit.", szDialog, "Select", "Exit");
  10085. }
  10086. else
  10087. {
  10088. new szDialog[128];
  10089. format(szDialog, sizeof(szDialog), "Business ID: %d\nText: %s\nType: %d\nCredits: %s\nAvailable: %d", BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bBusinessID], BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bText],BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bType],
  10090. number_format(BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bPrice]), BusinessSales[Selected[playerid][GetPVarInt(playerid, "BusinessList")]][bAvailable]);
  10091. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS9, DIALOG_STYLE_LIST, "Select business to edit.", szDialog, "Select", "Exit");
  10092. }
  10093. }
  10094. if(dialogid == DIALOG_EDITSHOPBUSINESS7)
  10095. {
  10096. if(response)
  10097. {
  10098. if(BusinessSales[Selected[playerid][listitem]][bAvailable] == 2) {
  10099. strcpy(BusinessSales[Selected[playerid][listitem]][bText], "None", 128);
  10100. BusinessSales[Selected[playerid][listitem]][bBusinessID] = -1;
  10101. BusinessSales[Selected[playerid][listitem]][bType] = 0;
  10102. BusinessSales[Selected[playerid][listitem]][bAvailable] = 0;
  10103. BusinessSales[Selected[playerid][listitem]][bPrice] = 0;
  10104. SendClientMessageEx(playerid, COLOR_CYAN, "You have reset the business sale.");
  10105. }
  10106. }
  10107. }
  10108. if(dialogid == DIALOG_EDITSHOPBUSINESS2)
  10109. {
  10110. if(response)
  10111. {
  10112. new BusinessID;
  10113. if (sscanf(inputtext, "d", BusinessID))
  10114. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS2, DIALOG_STYLE_INPUT, "Adding Business [1/4]","Enter the business ID you wish to sell.", "Next", "Cancel");
  10115. if(!IsValidBusinessID(BusinessID))
  10116. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS2, DIALOG_STYLE_INPUT, "Adding Business [1/4]","Enter the business ID you wish to sell.", "Next", "Cancel");
  10117. for (new i; i < sizeof(BusinessSales); i++)
  10118. {
  10119. if(BusinessSales[i][bBusinessID] == BusinessID)
  10120. {
  10121. SendClientMessageEx(playerid, COLOR_GREY, "That business ID is already in use.");
  10122. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS2, DIALOG_STYLE_INPUT, "Adding Business [1/4]","Enter the business ID you wish to sell.", "Next", "Cancel");
  10123. }
  10124. }
  10125. BusinessSales[GetPVarInt(playerid, "EditingSale")][bBusinessID] = BusinessID;
  10126. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS3, DIALOG_STYLE_INPUT, "Adding Business [2/4]", "Enter a description for the business.", "Next", "Cancel");
  10127. }
  10128. else
  10129. {
  10130. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS, DIALOG_STYLE_LIST, "Edit Business Shop", "Add Business\nEdit Business\nView Businesses Sold", "Select", "Exit");
  10131. }
  10132. }
  10133. if(dialogid == DIALOG_EDITSHOPBUSINESS3)
  10134. {
  10135. if(response)
  10136. {
  10137. if(isnull(inputtext))
  10138. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS3, DIALOG_STYLE_INPUT, "Adding Business [2/4]", "Enter a description for the business.", "Next", "Cancel");
  10139. if(strlen(inputtext) > 128)
  10140. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS3, DIALOG_STYLE_INPUT, "Adding Business [2/4]", "Enter a description for the business.", "Next", "Cancel");
  10141. strcpy(BusinessSales[GetPVarInt(playerid, "EditingSale")][bText], inputtext, 128);
  10142. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS4, DIALOG_STYLE_INPUT, "Adding Business [3/4]", "Enter the business type (1-3).", "Next", "Cancel");
  10143. }
  10144. else
  10145. {
  10146. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS, DIALOG_STYLE_LIST, "Edit Business Shop", "Add Business\nEdit Business\nView Businesses Sold", "Select", "Exit");
  10147. }
  10148. }
  10149. if(dialogid == DIALOG_EDITSHOPBUSINESS4)
  10150. {
  10151. if(response)
  10152. {
  10153. new BusinessID;
  10154. if (sscanf(inputtext, "d", BusinessID))
  10155. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS4, DIALOG_STYLE_INPUT, "Adding Business [3/4]", "Enter the business type (1-3).", "Next", "Cancel");
  10156. if(BusinessID < 1 || BusinessID > 3)
  10157. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS4, DIALOG_STYLE_INPUT, "Adding Business [3/4]", "Enter the business type (1-3).", "Next", "Cancel");
  10158. BusinessSales[GetPVarInt(playerid, "EditingSale")][bType] = BusinessID;
  10159. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS5, DIALOG_STYLE_INPUT, "Adding Business [4/4]", "Enter the amount of credits needed to purchase this business.", "Next", "Cancel");
  10160. }
  10161. else
  10162. {
  10163. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS, DIALOG_STYLE_LIST, "Edit Business Shop", "Add Business\nEdit Business\nView Businesses Sold", "Select", "Exit");
  10164. }
  10165. }
  10166. if(dialogid == DIALOG_EDITSHOPBUSINESS5)
  10167. {
  10168. if(response)
  10169. {
  10170. new BusinessID;
  10171. if (sscanf(inputtext, "d", BusinessID))
  10172. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS5, DIALOG_STYLE_INPUT, "Adding Business [4/4]", "Enter the amount of credits needed to purchase this business.", "Next", "Cancel");
  10173. if(BusinessID < 0)
  10174. return ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS5, DIALOG_STYLE_INPUT, "Adding Business [4/4]", "Enter the amount of credits needed to purchase this business.", "Next", "Cancel");
  10175. BusinessSales[GetPVarInt(playerid, "EditingSale")][bPrice] = BusinessID;
  10176. format(string, sizeof(string), "Business ID: %d\nBusiness Description: %s\nBusiness Type: %d\nBusiness Price: %d", BusinessSales[GetPVarInt(playerid, "EditingSale")][bBusinessID], BusinessSales[GetPVarInt(playerid, "EditingSale")][bText], BusinessSales[GetPVarInt(playerid, "EditingSale")][bType], BusinessSales[GetPVarInt(playerid, "EditingSale")][bPrice]);
  10177. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS6, DIALOG_STYLE_MSGBOX, "Finalize Business Sale", string, "Submit Business", "Cancel");
  10178. }
  10179. else
  10180. {
  10181. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS, DIALOG_STYLE_LIST, "Edit Business Shop", "Add Business\nEdit Business\nView Businesses Sold", "Select", "Exit");
  10182. }
  10183. }
  10184. if(dialogid == DIALOG_EDITSHOPBUSINESS6)
  10185. {
  10186. if(response)
  10187. {
  10188. format(string, sizeof(string), "[EDITBUSINESSSHOP] [User: %s(%i)] [IP: %s] [BusinessID: %d] [Description: %s] [Type: %d] [Price: %d]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), BusinessSales[GetPVarInt(playerid, "EditingSale")][bBusinessID], BusinessSales[GetPVarInt(playerid, "EditingSale")][bText], BusinessSales[GetPVarInt(playerid, "EditingSale")][bType], BusinessSales[GetPVarInt(playerid, "EditingSale")][bPrice]);
  10189. Log("logs/editshop.log", string), print(string);
  10190. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS, DIALOG_STYLE_LIST, "Edit Business Shop", "Add Business\nEdit Business\nView Businesses Sold", "Select", "Exit");
  10191. SendClientMessageEx(playerid, COLOR_CYAN, "You have successfully submitted a business sale.");
  10192. BusinessSales[GetPVarInt(playerid, "EditingSale")][bAvailable] = 1;
  10193. SaveBusinessSale(GetPVarInt(playerid, "EditingSale"));
  10194. DeletePVar(playerid, "EditingSale");
  10195. }
  10196. else
  10197. {
  10198. ShowPlayerDialogEx(playerid, DIALOG_EDITSHOPBUSINESS, DIALOG_STYLE_LIST, "Edit Business Shop", "Add Business\nEdit Business\nView Businesses Sold", "Select", "Exit");
  10199. }
  10200. }
  10201. if(dialogid == DIALOG_SHOPBUSINESS)
  10202. {
  10203. if(response)
  10204. {
  10205. switch(listitem)
  10206. {
  10207. case 0:
  10208. {
  10209. new szDialog[500], Count;
  10210. for (new i; i < sizeof(BusinessSales); i++)
  10211. {
  10212. if(BusinessSales[i][bAvailable] == 1)
  10213. {
  10214. format(szDialog, sizeof(szDialog), "%s\n%s (Credits: %s)", szDialog, BusinessSales[i][bText], number_format(BusinessSales[i][bPrice]));
  10215. Selected[playerid][Count] = i;
  10216. Count++;
  10217. }
  10218. }
  10219. if(Count != 0)
  10220. ShowPlayerDialogEx(playerid, DIALOG_SHOPBUSINESS2, DIALOG_STYLE_LIST, "Businesses Shop", szDialog, "More Info", "Exit");
  10221. else
  10222. SendClientMessageEx(playerid, COLOR_GREY, "No businesses are currently available.");
  10223. }
  10224. case 1:
  10225. {
  10226. if(PlayerInfo[playerid][pBusiness] == INVALID_BUSINESS_ID || PlayerInfo[playerid][pBusinessRank] < 5)
  10227. return SendClientMessageEx(playerid, COLOR_GREY, "You don't currently own a business.");
  10228. if(Businesses[PlayerInfo[playerid][pBusiness]][bGrade] == 0)
  10229. return SendClientMessageEx(playerid, COLOR_GREY, "An error has occured please contact the Director of Customer Relations.");
  10230. ShowPlayerDialogEx(playerid, DIALOG_SHOPBUSINESS4, DIALOG_STYLE_LIST, "Select how many months you wish to renew for.", "1 Month\n2 Months\n3 Months\n4 Months\n5 Months\n6 Months\n7 Months\n8 Months\n9 Months\n10 Months\n11 Months\n1 Year", "Select", "Cancel");
  10231. }
  10232. }
  10233. }
  10234. }
  10235. if(dialogid == DIALOG_SHOPBUSINESS4)
  10236. {
  10237. if(response)
  10238. {
  10239. new Prices;
  10240. SetPVarInt(playerid, "BusinessMonths", listitem+1);
  10241. switch (Businesses[PlayerInfo[playerid][pBusiness]][bGrade])
  10242. {
  10243. case 1: Prices = ShopItems[11][sItemPrice];
  10244. case 2: Prices = ShopItems[12][sItemPrice];
  10245. case 3: Prices = ShopItems[13][sItemPrice];
  10246. }
  10247. SetPVarInt(playerid, "BusinessPrice", (listitem+1)*Prices);
  10248. format(string, sizeof(string),"Business Renew\nGrade: %d\nExpires: %d Month\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", Businesses[PlayerInfo[playerid][pBusiness]][bGrade],listitem+1, number_format(PlayerInfo[playerid][pCredits]), number_format(GetPVarInt(playerid, "BusinessPrice")), number_format(PlayerInfo[playerid][pCredits]-GetPVarInt(playerid, "BusinessPrice")));
  10249. ShowPlayerDialogEx(playerid, DIALOG_SHOPBUSINESS5, DIALOG_STYLE_MSGBOX, "Purchase Business Renew", string, "Purchase", "Cancel");
  10250. }
  10251. }
  10252. if(dialogid == DIALOG_SHOPBUSINESS5)
  10253. {
  10254. if(response)
  10255. {
  10256. if(PlayerInfo[playerid][pBusiness] == INVALID_BUSINESS_ID || PlayerInfo[playerid][pBusinessRank] < 5)
  10257. return SendClientMessageEx(playerid, COLOR_GREY, "You don't currently own a business.");
  10258. new Prices;
  10259. Prices = GetPVarInt(playerid, "BusinessPrice");
  10260. if(PlayerInfo[playerid][pCredits] < Prices)
  10261. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  10262. if(!GetPVarType(playerid, "BusinessMonths"))
  10263. return SendClientMessageEx(playerid, COLOR_GREY, "An error has occurred please try again.");
  10264. new szQuery[128];
  10265. switch (Businesses[PlayerInfo[playerid][pBusiness]][bGrade])
  10266. {
  10267. case 1:
  10268. {
  10269. AmountSold[11]++;
  10270. AmountMade[11] += Prices;
  10271. //ShopItems[11][sSold]++;
  10272. //ShopItems[11][sMade] += Prices;
  10273. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold11` = '%d', `AmountMade11` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[11], AmountMade[11]);
  10274. }
  10275. case 2:
  10276. {
  10277. AmountSold[12]++;
  10278. AmountMade[12] += Prices;
  10279. //ShopItems[12][sSold]++;
  10280. //ShopItems[12][sMade] += Prices;
  10281. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold12` = '%d', `AmountMade12` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[12], AmountMade[12]);
  10282. }
  10283. case 3:
  10284. {
  10285. AmountSold[13]++;
  10286. AmountMade[13] += Prices;
  10287. //ShopItems[13][sSold]++;
  10288. //ShopItems[13][sMade] += Prices;
  10289. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold13` = '%d', `AmountMade13` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[13], AmountMade[13]);
  10290. }
  10291. }
  10292. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  10293. new Months = GetPVarInt(playerid, "BusinessMonths");
  10294. GivePlayerCredits(playerid, -Prices, 1);
  10295. new stamp = Businesses[PlayerInfo[playerid][pBusiness]][bMonths];
  10296. if(stamp-gettime() < 0)
  10297. {
  10298. Businesses[PlayerInfo[playerid][pBusiness]][bMonths] = (2592000*Months)+gettime()+259200;
  10299. }
  10300. else Businesses[PlayerInfo[playerid][pBusiness]][bMonths] = ((2592000*Months)+gettime()+259200)+stamp-gettime();
  10301. format(string, sizeof(string), "[Business Renewal(%i)] [Months: %d] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s] -- %d | %d",PlayerInfo[playerid][pBusiness], Months, GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(Prices), stamp, Businesses[PlayerInfo[playerid][pBusiness]][bMonths]);
  10302. Log("logs/credits.log", string), print(string);
  10303. format(string, sizeof(string), "You have successfully payed %s credits to renew your business for %d months.", number_format(Prices), Months);
  10304. SendClientMessageEx(playerid, COLOR_CYAN, string);
  10305. }
  10306. DeletePVar(playerid, "BusinessMonths");
  10307. }
  10308. if(dialogid == DIALOG_SHOPBUSINESS2)
  10309. {
  10310. if(response)
  10311. {
  10312. format(string, sizeof(string),"Business: %s\nType: %d\nExpires: 1 Month\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", BusinessSales[Selected[playerid][listitem]][bText], BusinessSales[Selected[playerid][listitem]][bType], number_format(PlayerInfo[playerid][pCredits]), number_format(BusinessSales[Selected[playerid][listitem]][bPrice]), number_format(PlayerInfo[playerid][pCredits]-BusinessSales[Selected[playerid][listitem]][bPrice]));
  10313. ShowPlayerDialogEx(playerid, DIALOG_SHOPBUSINESS3, DIALOG_STYLE_MSGBOX, "Purchase Business", string, "Purchase", "Cancel");
  10314. SetPVarInt(playerid, "BusinessSaleID", BusinessSales[Selected[playerid][listitem]][bBusinessID]), SetPVarInt(playerid, "BusinessSale", Selected[playerid][listitem]);
  10315. }
  10316. }
  10317. if(dialogid == DIALOG_SHOPBUSINESS3)
  10318. {
  10319. if(response)
  10320. {
  10321. if(PlayerInfo[playerid][pCredits] < BusinessSales[GetPVarInt(playerid, "BusinessSale")][bPrice])
  10322. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  10323. if (PlayerInfo[playerid][pBusiness] != INVALID_BUSINESS_ID)
  10324. return SendClientMessageEx(playerid, COLOR_GREY, "You already own a business.");
  10325. if(BusinessSales[GetPVarInt(playerid, "BusinessSale")][bAvailable] != 1)
  10326. return SendClientMessageEx(playerid, COLOR_GREY, "This business is not for sale anymore.");
  10327. if (!IsValidBusinessID(GetPVarInt(playerid, "BusinessSaleID")))
  10328. return SendClientMessageEx(playerid, COLOR_GRAD2, "An error has occurred.");
  10329. BusinessSales[GetPVarInt(playerid, "BusinessSale")][bAvailable] = 2;
  10330. GivePlayerCredits(playerid, -BusinessSales[GetPVarInt(playerid, "BusinessSale")][bPrice], 1);
  10331. BusinessSales[GetPVarInt(playerid, "BusinessSale")][bPurchased] = GetPlayerSQLId(playerid);
  10332. Businesses[GetPVarInt(playerid, "BusinessSaleID")][bOwner] = GetPlayerSQLId(playerid);
  10333. strcpy(Businesses[GetPVarInt(playerid, "BusinessSaleID")][bOwnerName], GetPlayerNameEx(playerid), MAX_PLAYER_NAME);
  10334. PlayerInfo[playerid][pBusiness] = GetPVarInt(playerid, "BusinessSaleID");
  10335. PlayerInfo[playerid][pBusinessRank] = 5;
  10336. Businesses[GetPVarInt(playerid, "BusinessSaleID")][bMonths] = (2592000*1)+gettime()+259200;
  10337. format(string, sizeof(string), "You have purchased business %s (1 Month) for %s credits.", BusinessSales[GetPVarInt(playerid, "BusinessSale")][bText], number_format(BusinessSales[GetPVarInt(playerid, "BusinessSale")][bPrice]));
  10338. SendClientMessageEx(playerid, COLOR_CYAN, string);
  10339. SendClientMessageEx(playerid, COLOR_WHITE, "Type /help to review the business help section!");
  10340. SaveBusiness(GetPVarInt(playerid, "BusinessSaleID"));
  10341. OnPlayerStatsUpdate(playerid);
  10342. RefreshBusinessPickup(GetPVarInt(playerid, "BusinessSaleID"));
  10343. format(string,sizeof(string),"%s(%d) (IP: %s) has bought business ID %d for %d.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), GetPVarInt(playerid, "BusinessSale"), BusinessSales[GetPVarInt(playerid, "BusinessSale")][bPrice]);
  10344. Log("logs/business.log", string);
  10345. SaveBusinessSale(GetPVarInt(playerid, "BusinessSale"));
  10346. format(string, sizeof(string), "[Business %i] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]",GetPVarInt(playerid, "BusinessSale"), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(BusinessSales[GetPVarInt(playerid, "BusinessSale")][bPrice]));
  10347. Log("logs/credits.log", string), print(string);
  10348. for(new i = 0; i < MAX_BUSINESSSALES; i++) {
  10349. Selected[playerid][i] = 0;
  10350. }
  10351. }
  10352. DeletePVar(playerid, "BusinessSaleID");
  10353. DeletePVar(playerid, "BusinessSale");
  10354. }
  10355. if(dialogid == DIALOG_HOUSESHOP)
  10356. {
  10357. if(response)
  10358. {
  10359. new szDialog[180];
  10360. switch(listitem)
  10361. {
  10362. case 0: // Purchase House
  10363. {
  10364. format(szDialog, sizeof(szDialog),"*You must contact a senior admin to have this issued.\n\n\nItem: House\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[14][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[14][sItemPrice]));
  10365. ShowPlayerDialogEx( playerid, DIALOG_HOUSESHOP2, DIALOG_STYLE_MSGBOX, "House Shop", szDialog, "Purchase", "Cancel" );
  10366. }
  10367. case 1: // House Interior Change
  10368. {
  10369. format(szDialog, sizeof(szDialog),"*You must contact a senior admin to have this issued.\n\n\nItem: House Interior Change\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[15][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[15][sItemPrice]));
  10370. ShowPlayerDialogEx( playerid, DIALOG_HOUSESHOP3, DIALOG_STYLE_MSGBOX, "House Shop", szDialog, "Purchase", "Cancel" );
  10371. }
  10372. case 2: // House Move
  10373. {
  10374. format(szDialog, sizeof(szDialog),"*You must contact a senior admin to have this issued.\n\n\nItem: House Move\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[16][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[16][sItemPrice]));
  10375. ShowPlayerDialogEx( playerid, DIALOG_HOUSESHOP4, DIALOG_STYLE_MSGBOX, "House Shop", szDialog, "Purchase", "Cancel" );
  10376. }
  10377. case 3: // Small Garage
  10378. {
  10379. format(szDialog, sizeof(szDialog),"*You must contact a senior admin to have this issued.\n\n\nItem: Garage - Small\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[24][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[24][sItemPrice]));
  10380. ShowPlayerDialogEx( playerid, DIALOG_HOUSESHOP5, DIALOG_STYLE_MSGBOX, "House Shop", szDialog, "Purchase", "Cancel" );
  10381. }
  10382. case 4: // Medium Garage
  10383. {
  10384. format(szDialog, sizeof(szDialog),"*You must contact a senior admin to have this issued.\n\n\nItem: Garage - Medium\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[25][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[25][sItemPrice]));
  10385. ShowPlayerDialogEx( playerid, DIALOG_HOUSESHOP6, DIALOG_STYLE_MSGBOX, "House Shop", szDialog, "Purchase", "Cancel" );
  10386. }
  10387. case 5: // Large Garage
  10388. {
  10389. format(szDialog, sizeof(szDialog),"*You must contact a senior admin to have this issued.\n\n\nItem: Garage - Large\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[26][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[26][sItemPrice]));
  10390. ShowPlayerDialogEx( playerid, DIALOG_HOUSESHOP7, DIALOG_STYLE_MSGBOX, "House Shop", szDialog, "Purchase", "Cancel" );
  10391. }
  10392. case 6: // Large Garage
  10393. {
  10394. format(szDialog, sizeof(szDialog),"*You must contact a senior admin to have this issued.\n\n\nItem: Garage - Extra Large\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[27][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[27][sItemPrice]));
  10395. ShowPlayerDialogEx( playerid, DIALOG_HOUSESHOP8, DIALOG_STYLE_MSGBOX, "House Shop", szDialog, "Purchase", "Cancel" );
  10396. }
  10397. }
  10398. }
  10399. }
  10400. if(dialogid == DIALOG_HOUSESHOP2)
  10401. {
  10402. if(response)
  10403. {
  10404. if(PlayerInfo[playerid][pCredits] < ShopItems[14][sItemPrice])
  10405. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  10406. GivePlayerCredits(playerid, -ShopItems[14][sItemPrice], 1);
  10407. printf("Price14: %d", ShopItems[14][sItemPrice]);
  10408. AmountSold[14]++;
  10409. AmountMade[14] += ShopItems[14][sItemPrice];
  10410. //ShopItems[14][sSold]++;
  10411. //ShopItems[14][sMade] += ShopItems[14][sItemPrice];
  10412. new szQuery[128];
  10413. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold14` = '%d', `AmountMade14` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[14], AmountMade[14]);
  10414. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  10415. AddFlag(playerid, INVALID_PLAYER_ID, "Purchased House (Credits)");
  10416. SendReportToQue(playerid, "House (Credits)", 2, 2);
  10417. format(string, sizeof(string), "You have purchased a house for %s credits.", number_format(ShopItems[14][sItemPrice]));
  10418. SendClientMessageEx(playerid, COLOR_CYAN, string);
  10419. SendClientMessageEx(playerid, COLOR_CYAN, "Contact a senior admin to have the house issued.");
  10420. format(string, sizeof(string), "[House] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[14][sItemPrice]));
  10421. Log("logs/credits.log", string), print(string);
  10422. }
  10423. }
  10424. if(dialogid == DIALOG_HOUSESHOP3)
  10425. {
  10426. if(response)
  10427. {
  10428. if(PlayerInfo[playerid][pCredits] < ShopItems[15][sItemPrice])
  10429. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  10430. GivePlayerCredits(playerid, -ShopItems[15][sItemPrice], 1);
  10431. printf("Price15: %d", ShopItems[15][sItemPrice]);
  10432. AmountSold[15]++;
  10433. AmountMade[15] += ShopItems[15][sItemPrice];
  10434. //ShopItems[15][sSold]++;
  10435. //ShopItems[15][sMade] += ShopItems[15][sItemPrice];
  10436. new szQuery[128];
  10437. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold15` = '%d', `AmountMade15` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[15], AmountMade[15]);
  10438. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  10439. AddFlag(playerid, INVALID_PLAYER_ID, "Purchased House Interior Change (Credits)");
  10440. SendReportToQue(playerid, "House Interior Change (Credits)", 2, 2);
  10441. format(string, sizeof(string), "You have purchased a house interior change for %s credits.", number_format(ShopItems[15][sItemPrice]));
  10442. SendClientMessageEx(playerid, COLOR_CYAN, string);
  10443. SendClientMessageEx(playerid, COLOR_CYAN, "Contact a senior admin to have the house interior change issued.");
  10444. format(string, sizeof(string), "[House Interior Change] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[15][sItemPrice]));
  10445. Log("logs/credits.log", string), print(string);
  10446. }
  10447. }
  10448. if(dialogid == DIALOG_HOUSESHOP4)
  10449. {
  10450. if(response)
  10451. {
  10452. if(PlayerInfo[playerid][pCredits] < ShopItems[16][sItemPrice])
  10453. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  10454. GivePlayerCredits(playerid, -ShopItems[16][sItemPrice], 1);
  10455. printf("Price16: %d", ShopItems[16][sItemPrice]);
  10456. AmountSold[16]++;
  10457. AmountMade[16] += ShopItems[16][sItemPrice];
  10458. //ShopItems[16][sSold]++;
  10459. //ShopItems[16][sMade] += ShopItems[16][sItemPrice];
  10460. new szQuery[128];
  10461. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold16` = '%d', `AmountMade16` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[16], AmountMade[16]);
  10462. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  10463. AddFlag(playerid, INVALID_PLAYER_ID, "Purchased House Move (Credits)");
  10464. SendReportToQue(playerid, "House Move (Credits)", 2, 2);
  10465. format(string, sizeof(string), "You have purchased a house move for %s credits.", number_format(ShopItems[16][sItemPrice]));
  10466. SendClientMessageEx(playerid, COLOR_CYAN, string);
  10467. SendClientMessageEx(playerid, COLOR_CYAN, "Contact a senior admin to have the house move issued.");
  10468. format(string, sizeof(string), "[House Move] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[16][sItemPrice]));
  10469. Log("logs/credits.log", string), print(string);
  10470. }
  10471. }
  10472. if(dialogid == DIALOG_HOUSESHOP5)
  10473. {
  10474. if(response)
  10475. {
  10476. if(PlayerInfo[playerid][pCredits] < ShopItems[24][sItemPrice])
  10477. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  10478. GivePlayerCredits(playerid, -ShopItems[24][sItemPrice], 1);
  10479. printf("Price24: %d", ShopItems[24][sItemPrice]);
  10480. AmountSold[24]++;
  10481. AmountMade[24] += ShopItems[24][sItemPrice];
  10482. new szQuery[128];
  10483. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold24` = '%d', `AmountMade24` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[24], AmountMade[24]);
  10484. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  10485. GarageVW++;
  10486. g_mysql_SaveMOTD();
  10487. format(szQuery, sizeof(szQuery), "Garage - Small (VW: %d)", GarageVW);
  10488. AddFlag(playerid, INVALID_PLAYER_ID, szQuery);
  10489. SendReportToQue(playerid, szQuery, 2, 2);
  10490. format(string, sizeof(string), "You have purchased a small garage for %s credits.", number_format(ShopItems[24][sItemPrice]));
  10491. SendClientMessageEx(playerid, COLOR_CYAN, string);
  10492. SendClientMessageEx(playerid, COLOR_CYAN, "Contact a senior admin to have the small garage issued.");
  10493. format(string, sizeof(string), "[Garage - Small] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[24][sItemPrice]));
  10494. Log("logs/credits.log", string), print(string);
  10495. }
  10496. }
  10497. if(dialogid == DIALOG_HOUSESHOP6)
  10498. {
  10499. if(response)
  10500. {
  10501. if(PlayerInfo[playerid][pCredits] < ShopItems[25][sItemPrice])
  10502. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  10503. GivePlayerCredits(playerid, -ShopItems[25][sItemPrice], 1);
  10504. printf("Price25: %d", ShopItems[25][sItemPrice]);
  10505. AmountSold[25]++;
  10506. AmountMade[25] += ShopItems[25][sItemPrice];
  10507. new szQuery[128];
  10508. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold25` = '%d', `AmountMade25` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[25], AmountMade[25]);
  10509. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  10510. GarageVW++;
  10511. g_mysql_SaveMOTD();
  10512. format(szQuery, sizeof(szQuery), "Garage - Medium (VW: %d)", GarageVW);
  10513. AddFlag(playerid, INVALID_PLAYER_ID, szQuery);
  10514. SendReportToQue(playerid, szQuery, 2, 2);
  10515. format(string, sizeof(string), "You have purchased a medium garage for %s credits.", number_format(ShopItems[25][sItemPrice]));
  10516. SendClientMessageEx(playerid, COLOR_CYAN, string);
  10517. SendClientMessageEx(playerid, COLOR_CYAN, "Contact a senior admin to have the medium garage issued.");
  10518. format(string, sizeof(string), "[Garage - Medium] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[25][sItemPrice]));
  10519. Log("logs/credits.log", string), print(string);
  10520. }
  10521. }
  10522. if(dialogid == DIALOG_HOUSESHOP7)
  10523. {
  10524. if(response)
  10525. {
  10526. if(PlayerInfo[playerid][pCredits] < ShopItems[26][sItemPrice])
  10527. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  10528. GivePlayerCredits(playerid, -ShopItems[26][sItemPrice], 1);
  10529. printf("Price26: %d", ShopItems[26][sItemPrice]);
  10530. AmountSold[26]++;
  10531. AmountMade[26] += ShopItems[26][sItemPrice];
  10532. new szQuery[128];
  10533. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold26` = '%d', `AmountMade26` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[26], AmountMade[26]);
  10534. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  10535. GarageVW++;
  10536. g_mysql_SaveMOTD();
  10537. format(szQuery, sizeof(szQuery), "Garage - Large (VW: %d)", GarageVW);
  10538. AddFlag(playerid, INVALID_PLAYER_ID, szQuery);
  10539. SendReportToQue(playerid, szQuery, 2, 2);
  10540. format(string, sizeof(string), "You have purchased a large garage for %s credits.", number_format(ShopItems[26][sItemPrice]));
  10541. SendClientMessageEx(playerid, COLOR_CYAN, string);
  10542. SendClientMessageEx(playerid, COLOR_CYAN, "Contact a senior admin to have the large garage issued.");
  10543. format(string, sizeof(string), "[Garage - Large] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[26][sItemPrice]));
  10544. Log("logs/credits.log", string), print(string);
  10545. }
  10546. }
  10547. if(dialogid == DIALOG_HOUSESHOP8)
  10548. {
  10549. if(response)
  10550. {
  10551. if(PlayerInfo[playerid][pCredits] < ShopItems[27][sItemPrice])
  10552. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  10553. GivePlayerCredits(playerid, -ShopItems[27][sItemPrice], 1);
  10554. printf("Price27: %d", ShopItems[27][sItemPrice]);
  10555. AmountSold[27]++;
  10556. AmountMade[27] += ShopItems[27][sItemPrice];
  10557. new szQuery[128];
  10558. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold27` = '%d', `AmountMade27` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[27], AmountMade[27]);
  10559. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  10560. GarageVW++;
  10561. g_mysql_SaveMOTD();
  10562. format(szQuery, sizeof(szQuery), "Garage - Extra Large (VW: %d)", GarageVW);
  10563. AddFlag(playerid, INVALID_PLAYER_ID, szQuery);
  10564. SendReportToQue(playerid, szQuery, 2, 2);
  10565. format(string, sizeof(string), "You have purchased a extra large garage for %s credits.", number_format(ShopItems[27][sItemPrice]));
  10566. SendClientMessageEx(playerid, COLOR_CYAN, string);
  10567. SendClientMessageEx(playerid, COLOR_CYAN, "Contact a senior admin to have the extra large garage issued.");
  10568. format(string, sizeof(string), "[Garage - Extra Large] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[27][sItemPrice]));
  10569. Log("logs/credits.log", string), print(string);
  10570. }
  10571. }
  10572. if(dialogid == DIALOG_HEALTHCARE)
  10573. {
  10574. if(response)
  10575. {
  10576. switch(listitem)
  10577. {
  10578. case 0:
  10579. {
  10580. new szDialog[160];
  10581. format(szDialog, sizeof(szDialog), "When spawning from the hospital you will spawn with full health, and will be served a full meal.\n\nCost per hospital visit: {FFD700}%s{A9C4E4}", number_format(ShopItems[18][sItemPrice]));
  10582. ShowPlayerDialogEx(playerid, DIALOG_HEALTHCARE2, DIALOG_STYLE_MSGBOX, "Advanced Health Care" , szDialog, "Activate", "Exit");
  10583. }
  10584. case 1:
  10585. {
  10586. new szDialog[160];
  10587. SetPVarInt(playerid, "HealthCare", 1);
  10588. format(szDialog, sizeof(szDialog), "When spawning from the hospital you will spawn 80%% faster, with full health, and be served a full meal.\n\nCost per hospital visit: {FFD700}%s{A9C4E4}", number_format(ShopItems[19][sItemPrice]));
  10589. ShowPlayerDialogEx(playerid, DIALOG_HEALTHCARE2, DIALOG_STYLE_MSGBOX, "Super Advanced Health Care" , szDialog, "Activate", "Exit");
  10590. }
  10591. }
  10592. }
  10593. }
  10594. if(dialogid == DIALOG_HEALTHCARE2)
  10595. {
  10596. if(response)
  10597. {
  10598. if(!GetPVarType(playerid, "HealthCare")) // Advanced
  10599. {
  10600. PlayerInfo[playerid][pHealthCare] = 1;
  10601. SendClientMessageEx(playerid, COLOR_CYAN, "You have enabled Advanced Health Care, type /togglehealthcare to disable it.");
  10602. }
  10603. else // Super Advanced
  10604. {
  10605. PlayerInfo[playerid][pHealthCare] = 2;
  10606. SendClientMessageEx(playerid, COLOR_CYAN, "You have enabled Super Advanced Health Care, type /togglehealthcare to disable it.");
  10607. }
  10608. }
  10609. DeletePVar(playerid, "HealthCare");
  10610. }
  10611. if(dialogid == DIALOG_VIPSHOP && response)
  10612. {
  10613. if(listitem == 0)
  10614. {
  10615. ShowPlayerDialogEx(playerid, DIALOG_VIPSHOP2, DIALOG_STYLE_LIST, "Select which VIP you want to purchase.", "Bronze\nSilver\nGold", "Select", "Cancel");
  10616. }
  10617. else
  10618. {
  10619. if(PlayerInfo[playerid][pGVip] == 0) {
  10620. SendClientMessageEx(playerid, COLOR_GREY, "You have never purchased Gold VIP, so you can't renew it.");
  10621. }
  10622. else
  10623. {
  10624. ShowPlayerDialogEx(playerid, DIALOG_VIPSHOP3, DIALOG_STYLE_LIST, "Select how many months you wish to renew for.", "1 Month\n2 Months\n3 Months\n4 Months\n5 Months\n6 Months\n7 Months\n8 Months\n9 Months\n10 Months\n11 Months\n1 Year", "Select", "Cancel");
  10625. }
  10626. }
  10627. }
  10628. if(dialogid == DIALOG_VIPSHOP3 && response)
  10629. {
  10630. new Months = listitem+1;
  10631. SetPVarInt(playerid, "VIPType", 3), SetPVarInt(playerid, "VIPPrice", ShopItems[1][sItemPrice]*Months), SetPVarInt(playerid, "VIPMonths", Months), SetPVarInt(playerid, "GoldRenewal", 1);
  10632. format(string, sizeof(string),"Type: Gold VIP\nExpires: %d Month(s)\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", listitem+1, number_format(PlayerInfo[playerid][pCredits]), number_format(GetPVarInt(playerid, "VIPPrice")), number_format(PlayerInfo[playerid][pCredits]-GetPVarInt(playerid, "VIPPrice")));
  10633. ShowPlayerDialogEx( playerid, DIALOG_PURCHASEVIP, DIALOG_STYLE_MSGBOX, "Gold VIP Renew", string, "Purchase", "Cancel" );
  10634. }
  10635. if(dialogid == DIALOG_VIPSHOP2 && response)
  10636. {
  10637. switch(listitem)
  10638. {
  10639. case 0:
  10640. {
  10641. new Message[520];
  10642. Message = "Purple VIP name on the forums.\nVIP Forums Access\
  10643. \nVIP Chat\nVIP Garage with access to all the most select cars on the map.\nVIP Lounge\nFirst Aid Station [HP Refills]\nGun Locker \nAbility to get Cannabis and Crack using the jobs without having to wait for refills at the Drug House.";
  10644. strcat(Message, "\nPreferred Pricing on Cars from the Dealership [20% off]\n24/7 VIP Pricing [20% Off]\nFree ATM Use \nFree Checking \nInvites to VIP Only Parties\nMax Hourly Interest Increase: $100k per paycheck");
  10645. ShowPlayerDialogEx(playerid, DIALOG_VIPBRONZE, DIALOG_STYLE_MSGBOX, "Bronze VIP Features" , Message, "Continue", "Cancel" );
  10646. }
  10647. case 1:
  10648. {
  10649. new Message[850];
  10650. Message = "Purple VIP name on the forums. \n\
  10651. VIP Forums Access \n\
  10652. VIP Chat \n\
  10653. VIP Garage with access to all the most select cars on the map. \n\
  10654. VIP Lounge\n\
  10655. First Aid Station [HP Refills] \n\
  10656. Gun Locker \n\
  10657. Ability to get Cannabis and Crack using the jobs without having to wait for refills at the Drug House. \n\
  10658. Preferred Pricing on Cars from the Dealership [20% off] \n\
  10659. 24/7 VIP Pricing [20% Off]";
  10660. strcat(Message, "\nFree ATM Use \n\
  10661. Free Checking \n\
  10662. Invites to VIP Only Parties \n\
  10663. Caller ID \n\
  10664. Ability to have 2 jobs. \n\
  10665. Ability to own 3 additional cars. \n\
  10666. Unrestricted Access to All Skins \n\
  10667. Increased Interest Rate \n\
  10668. Ability to purchase negative phone numbers. \n\
  10669. Ability to purchase one time spawns at the Gold VIP+ room. \n\
  10670. Auto Reply Text Messages \n\
  10671. Priority Advertisements cost $125,000 \n\
  10672. Weekly VIP Buddy Invites* [ability to invite a friend to use VIP Bronze Features for 3 hours]");
  10673. ShowPlayerDialogEx(playerid, DIALOG_VIPSILVER, DIALOG_STYLE_MSGBOX, "Silver VIP Features" , Message, "Continue", "Cancel" );
  10674. }
  10675. case 2:
  10676. {
  10677. new Message[1000];
  10678. Message = "Purple VIP name on the forums. \n\
  10679. VIP Forums Access \n\
  10680. Gold VIP Tag on TS. \n\
  10681. VIP Chat \n\
  10682. VIP Garage with access to all the most select cars on the map. \n\
  10683. VIP Lounge\n\
  10684. First Aid Station [HP Refills] \n\
  10685. Gun Locker \n\
  10686. Ability to get Cannabis and Crack using the jobs without having to wait for refills at the Drug House. \n\
  10687. Preferred Pricing on Cars from the Dealership [20% off] \n\
  10688. Full Health and Hunger after death \n\
  10689. 24/7 VIP Pricing [20% Off]";
  10690. strcat(Message, "\nFree ATM Use \n\
  10691. Free Checking \n\
  10692. Invites to VIP Only Parties \n\
  10693. Caller ID \n\
  10694. Ability to have 3 jobs. \n\
  10695. Ability to own 3 additional cars. \n\
  10696. Unrestricted Access to All Skins \n\
  10697. Increased Interest Rate \n\
  10698. Ability to purchase negative phone numbers. \n\
  10699. Priority Advertisements cost $100,000 \n\
  10700. 10 percent discount on NameChanges \n\
  10701. Auto Reply Text Messages \n\
  10702. Daily VIP Buddy Invites* [ability to invite a friend to use VIP Bronze Features for 3 hours]");
  10703. strcat(Message, "\nx2 Paycheck on Birthday \n\
  10704. One random Gift on Birthday \n\
  10705. 5 Percent discount on House/Gate/Door Moves \n\
  10706. WAR option at Paintball");
  10707. ShowPlayerDialogEx(playerid, DIALOG_VIPGOLD, DIALOG_STYLE_MSGBOX, "Gold VIP Features" , Message, "Continue", "Cancel" );
  10708. }
  10709. }
  10710. }
  10711. if(dialogid == DIALOG_VIPBRONZE && response)
  10712. {
  10713. ShowPlayerDialogEx(playerid, DIALOG_VIPBRONZE2, DIALOG_STYLE_LIST, "Select how many months you wish to renew for.", "1 Month\n2 Months\n3 Months\n4 Months\n5 Months\n6 Months\n7 Months\n8 Months\n9 Months\n10 Months\n11 Months\n1 Year", "Select", "Cancel");
  10714. }
  10715. if(dialogid == DIALOG_VIPBRONZE2 && response)
  10716. {
  10717. new Months = listitem+1;
  10718. SetPVarInt(playerid, "VIPType", 1), SetPVarInt(playerid, "VIPPrice", ShopItems[3][sItemPrice]*Months), SetPVarInt(playerid, "VIPMonths", Months);
  10719. format(string, sizeof(string),"Type: Bronze VIP\nExpires: %d Month(s)\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", listitem+1, number_format(PlayerInfo[playerid][pCredits]), number_format(GetPVarInt(playerid, "VIPPrice")), number_format(PlayerInfo[playerid][pCredits]-GetPVarInt(playerid, "VIPPrice")));
  10720. ShowPlayerDialogEx( playerid, DIALOG_PURCHASEVIP, DIALOG_STYLE_MSGBOX, "Bronze VIP", string, "Purchase", "Cancel" );
  10721. }
  10722. if(dialogid == DIALOG_VIPSILVER && response)
  10723. {
  10724. ShowPlayerDialogEx(playerid, DIALOG_VIPSILVER2, DIALOG_STYLE_LIST, "Select how many months you wish to renew for.", "1 Month\n2 Months\n3 Months\n4 Months\n5 Months\n6 Months\n7 Months\n8 Months\n9 Months\n10 Months\n11 Months\n1 Year", "Select", "Cancel");
  10725. }
  10726. if(dialogid == DIALOG_VIPSILVER2 && response)
  10727. {
  10728. new Months = listitem+1;
  10729. SetPVarInt(playerid, "VIPType", 2), SetPVarInt(playerid, "VIPPrice", ShopItems[2][sItemPrice]*Months), SetPVarInt(playerid, "VIPMonths", Months);
  10730. format(string, sizeof(string),"Type: Silver VIP\nExpires: %d Month(s)\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", listitem+1, number_format(PlayerInfo[playerid][pCredits]), number_format(GetPVarInt(playerid, "VIPPrice")), number_format(PlayerInfo[playerid][pCredits]-GetPVarInt(playerid, "VIPPrice")));
  10731. ShowPlayerDialogEx( playerid, DIALOG_PURCHASEVIP, DIALOG_STYLE_MSGBOX, "Silver VIP", string, "Purchase", "Cancel" );
  10732. }
  10733. if(dialogid == DIALOG_VIPGOLD && response)
  10734. {
  10735. SetPVarInt(playerid, "VIPMonths", 1), SetPVarInt(playerid, "VIPType", 3), SetPVarInt(playerid, "VIPPrice", ShopItems[0][sItemPrice]);
  10736. format(string, sizeof(string),"Type: Gold VIP\nExpires: 1 Month\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(GetPVarInt(playerid, "VIPPrice")), number_format(PlayerInfo[playerid][pCredits]-GetPVarInt(playerid, "VIPPrice")));
  10737. ShowPlayerDialogEx( playerid, DIALOG_PURCHASEVIP, DIALOG_STYLE_MSGBOX, "Gold VIP", string, "Purchase", "Cancel" );
  10738. }
  10739. if(dialogid == DIALOG_PURCHASEVIP)
  10740. {
  10741. if(response)
  10742. {
  10743. if(PlayerInfo[playerid][pCredits] < GetPVarInt(playerid, "VIPPrice"))
  10744. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  10745. if(PlayerInfo[playerid][pDonateRank] != 0)
  10746. return SendClientMessageEx(playerid, COLOR_GREY, "You already have VIP, please wait for it to expire.");
  10747. if(GetPVarType(playerid, "VIPType") != 1)
  10748. return SendClientMessageEx(playerid, COLOR_GREY, "An error has occured, please try again.");
  10749. PlayerInfo[playerid][pDonateRank] = GetPVarInt(playerid, "VIPType");
  10750. PlayerInfo[playerid][pTempVIP] = 0;
  10751. PlayerInfo[playerid][pBuddyInvited] = 0;
  10752. PlayerInfo[playerid][pVIPSellable] = 0;
  10753. if(PlayerInfo[playerid][pVIPM] == 0)
  10754. {
  10755. PlayerInfo[playerid][pVIPM] = VIPM;
  10756. VIPM++;
  10757. }
  10758. if(GetPVarType(playerid, "VIPMonths"))
  10759. {
  10760. PlayerInfo[playerid][pVIPExpire] = (2592000*GetPVarInt(playerid, "VIPMonths"))+gettime();
  10761. }
  10762. else
  10763. {
  10764. PlayerInfo[playerid][pVIPExpire] = 2592000+gettime();
  10765. }
  10766. GivePlayerCredits(playerid, -GetPVarInt(playerid, "VIPPrice"), 1);
  10767. if(GetPVarInt(playerid, "VIPType") == 3)
  10768. PlayerInfo[playerid][pGVip] = 1;
  10769. new VIPType[7];
  10770. new szQuery[128];
  10771. if(GetPVarType(playerid, "GoldRenewal"))
  10772. {
  10773. AmountSold[1]++;
  10774. AmountMade[1] += GetPVarInt(playerid, "VIPPrice");
  10775. VIPType = "Gold";
  10776. //ShopItems[1][sMade] += GetPVarInt(playerid, "VIPPrice");
  10777. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold1` = '%d', `AmountMade1` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[1], AmountMade[1]);
  10778. DeletePVar(playerid, "GoldRenewal");
  10779. }
  10780. else
  10781. {
  10782. switch(GetPVarInt(playerid, "VIPType")) {
  10783. case 1:
  10784. {
  10785. VIPType = "Bronze";
  10786. AmountSold[3]++;
  10787. AmountMade[3] += GetPVarInt(playerid, "VIPPrice");
  10788. //ShopItems[3][sSold]++;
  10789. //ShopItems[3][sMade] += GetPVarInt(playerid, "VIPPrice");
  10790. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold3` = '%d', `AmountMade3` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[3], AmountMade[3]);
  10791. }
  10792. case 2:
  10793. {
  10794. VIPType = "Silver";
  10795. AmountSold[2]++;
  10796. AmountMade[2] += GetPVarInt(playerid, "VIPPrice");
  10797. //ShopItems[2][sSold]++;
  10798. //ShopItems[2][sMade] += GetPVarInt(playerid, "VIPPrice");
  10799. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold2` = '%d', `AmountMade2` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[2], AmountMade[2]);
  10800. }
  10801. case 3:
  10802. {
  10803. VIPType = "Gold";
  10804. AmountSold[0]++;
  10805. AmountMade[0] += GetPVarInt(playerid, "VIPPrice");
  10806. //ShopItems[0][sSold]++;
  10807. //ShopItems[0][sMade] += GetPVarInt(playerid, "VIPPrice");
  10808. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold0` = '%d', `AmountMade0` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[0], AmountMade[0]);
  10809. }
  10810. }
  10811. }
  10812. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  10813. format(string, sizeof(string), "You have purchased %s VIP (%d Month(s)) for %s credits.", VIPType,GetPVarInt(playerid, "VIPMonths"), number_format(GetPVarInt(playerid, "VIPPrice")));
  10814. SendClientMessageEx(playerid, COLOR_CYAN, string);
  10815. format(string, sizeof(string), "[VIP %i] [User: %s(%i)] [IP: %s] [Credits: %s] [VIP: %s(%d)] [Price: %s]", PlayerInfo[playerid][pVIPM], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), VIPType,GetPVarInt(playerid, "VIPMonths"), number_format(GetPVarInt(playerid, "VIPPrice")));
  10816. Log("logs/credits.log", string), Log("logs/setvip.log", string), print(string);
  10817. }
  10818. DeletePVar(playerid, "VIPPrice");
  10819. DeletePVar(playerid, "VIPMonths");
  10820. DeletePVar(playerid, "VIPType");
  10821. }
  10822. if(dialogid == DIALOG_SHOPGIFTRESET)
  10823. {
  10824. if(response)
  10825. {
  10826. if(PlayerInfo[playerid][pCredits] < ShopItems[17][sItemPrice])
  10827. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  10828. PlayerInfo[playerid][pGiftTime] = 0;
  10829. GivePlayerCredits(playerid, -ShopItems[17][sItemPrice], 1);
  10830. printf("Price18: %d", ShopItems[17][sItemPrice]);
  10831. format(string, sizeof(string), "You have purchased gift timer reset for %s credits.", number_format(ShopItems[17][sItemPrice]));
  10832. SendClientMessageEx(playerid, COLOR_CYAN, string);
  10833. AmountSold[17]++;
  10834. AmountMade[17] += ShopItems[17][sItemPrice];
  10835. //ShopItems[17][sSold]++;
  10836. //ShopItems[17][sMade] += ShopItems[17][sItemPrice];
  10837. new szQuery[128];
  10838. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold17` = '%d', `AmountMade17` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[17], AmountMade[17]);
  10839. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  10840. format(string, sizeof(string), "[GIFTTIMERRESET] [User: %s(%i)] [IP: %s] [Credits: %s] [Gift Timer Reset] [Price: %s]",GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[17][sItemPrice]));
  10841. Log("logs/credits.log", string), print(string);
  10842. }
  10843. }
  10844. if(dialogid == DIALOG_SHOPTOTRESET)
  10845. {
  10846. if(response)
  10847. {
  10848. if(PlayerInfo[playerid][pCredits] < 20)
  10849. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  10850. PlayerInfo[playerid][pTrickortreat] = 0;
  10851. GivePlayerCredits(playerid, -20, 1);
  10852. format(string, sizeof(string), "You have purchased a Holiday timer reset for %s credits.", number_format(20));
  10853. SendClientMessageEx(playerid, COLOR_CYAN, string);
  10854. format(string, sizeof(string), "[GIFTTIMERRESET] [User: %s(%i)] [IP: %s] [Credits: %s] [Special Holiday Timer Reset] [Price: %s]",GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(20));
  10855. Log("logs/zombiecure.log", string), print(string);
  10856. }
  10857. }
  10858. if(dialogid == DIALOG_HALLOWEENSHOP)
  10859. {
  10860. if(response)
  10861. {
  10862. if(listitem == 0)
  10863. {
  10864. format(string, sizeof(string),"Item: Limited Edition Straw Hat\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(150), number_format(PlayerInfo[playerid][pCredits]-150));
  10865. ShowPlayerDialogEx( playerid, DIALOG_HALLOWEENSHOP1, DIALOG_STYLE_MSGBOX, "Thanksgiving Shop", string, "Purchase", "Exit" );
  10866. }
  10867. else
  10868. {
  10869. format(string, sizeof(string),"Item: Limited Edition Cluckin Bell Hat\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(150), number_format(PlayerInfo[playerid][pCredits]-150));
  10870. ShowPlayerDialogEx( playerid, DIALOG_HALLOWEENSHOP2, DIALOG_STYLE_MSGBOX, "Thanksgiving Shop", string, "Purchase", "Exit" );
  10871. }
  10872. }
  10873. }
  10874. if(dialogid == DIALOG_HALLOWEENSHOP1)
  10875. {
  10876. if(response)
  10877. {
  10878. if(PumpkinStock <= 0)
  10879. return SendClientMessageEx(playerid, COLOR_GREY, "This limited item has sold out!");
  10880. if(PlayerInfo[playerid][pCredits] < 150)
  10881. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  10882. GivePlayerCredits(playerid, -150, 1);
  10883. PumpkinStock--;
  10884. format(string, sizeof(string), "You have purchased the Straw Hat toy for %s credits.", number_format(150));
  10885. SendClientMessageEx(playerid, COLOR_CYAN, string);
  10886. g_mysql_SaveAccount(playerid);
  10887. g_mysql_SaveMOTD();
  10888. format(string, sizeof(string), "[TOYSALE] [User: %s(%i)] [IP: %s] [Credits: %s] [Straw Hat] [Price: %s]",GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(150));
  10889. Log("logs/zombiecure.log", string), print(string);
  10890. new icount = GetPlayerToySlots(playerid);
  10891. for(new v = 0; v < icount; v++)
  10892. {
  10893. if(PlayerToyInfo[playerid][v][ptModelID] == 0)
  10894. {
  10895. PlayerToyInfo[playerid][v][ptModelID] = 19553;
  10896. PlayerToyInfo[playerid][v][ptBone] = 6;
  10897. PlayerToyInfo[playerid][v][ptPosX] = 0.0;
  10898. PlayerToyInfo[playerid][v][ptPosY] = 0.0;
  10899. PlayerToyInfo[playerid][v][ptPosZ] = 0.0;
  10900. PlayerToyInfo[playerid][v][ptRotX] = 0.0;
  10901. PlayerToyInfo[playerid][v][ptRotY] = 0.0;
  10902. PlayerToyInfo[playerid][v][ptRotZ] = 0.0;
  10903. PlayerToyInfo[playerid][v][ptScaleX] = 1.0;
  10904. PlayerToyInfo[playerid][v][ptScaleY] = 1.0;
  10905. PlayerToyInfo[playerid][v][ptScaleZ] = 1.0;
  10906. PlayerToyInfo[playerid][v][ptTradable] = 1;
  10907. g_mysql_NewToy(playerid, v);
  10908. return 1;
  10909. }
  10910. }
  10911. for(new i = 0; i < MAX_PLAYERTOYS; i++)
  10912. {
  10913. if(PlayerToyInfo[playerid][i][ptModelID] == 0)
  10914. {
  10915. PlayerToyInfo[playerid][i][ptModelID] = 19553;
  10916. PlayerToyInfo[playerid][i][ptBone] = 6;
  10917. PlayerToyInfo[playerid][i][ptPosX] = 0.0;
  10918. PlayerToyInfo[playerid][i][ptPosY] = 0.0;
  10919. PlayerToyInfo[playerid][i][ptPosZ] = 0.0;
  10920. PlayerToyInfo[playerid][i][ptRotX] = 0.0;
  10921. PlayerToyInfo[playerid][i][ptRotY] = 0.0;
  10922. PlayerToyInfo[playerid][i][ptRotZ] = 0.0;
  10923. PlayerToyInfo[playerid][i][ptScaleX] = 1.0;
  10924. PlayerToyInfo[playerid][i][ptScaleY] = 1.0;
  10925. PlayerToyInfo[playerid][i][ptScaleZ] = 1.0;
  10926. PlayerToyInfo[playerid][i][ptTradable] = 1;
  10927. PlayerToyInfo[playerid][i][ptSpecial] = 1;
  10928. g_mysql_NewToy(playerid, i);
  10929. SendClientMessageEx(playerid, COLOR_GRAD1, "Due to you not having any available slots, we've temporarily gave you an additional slot to use/sell/trade your toy.");
  10930. SendClientMessageEx(playerid, COLOR_RED, "Note: Please take note that after selling the toy, the temporarily additional toy slot will be removed.");
  10931. break;
  10932. }
  10933. }
  10934. }
  10935. }
  10936. if(dialogid == DIALOG_HALLOWEENSHOP2)
  10937. {
  10938. if(response)
  10939. {
  10940. if(PlayerInfo[playerid][pCredits] < 150)
  10941. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  10942. GivePlayerCredits(playerid, -150, 1);
  10943. format(string, sizeof(string), "You have purchased the Cluckin Bell Hat toy for %s credits.", number_format(150));
  10944. SendClientMessageEx(playerid, COLOR_CYAN, string);
  10945. g_mysql_SaveAccount(playerid);
  10946. g_mysql_SaveMOTD();
  10947. format(string, sizeof(string), "[TOYSALE] [User: %s(%i)] [IP: %s] [Credits: %s] [Cluckin Bell Hat] [Price: %s]",GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(60));
  10948. Log("logs/zombiecure.log", string), print(string);
  10949. new icount = GetPlayerToySlots(playerid);
  10950. for(new v = 0; v < icount; v++)
  10951. {
  10952. if(PlayerToyInfo[playerid][v][ptModelID] == 0)
  10953. {
  10954. PlayerToyInfo[playerid][v][ptModelID] = 19137;
  10955. PlayerToyInfo[playerid][v][ptBone] = 5;
  10956. PlayerToyInfo[playerid][v][ptPosX] = 0.0;
  10957. PlayerToyInfo[playerid][v][ptPosY] = 0.0;
  10958. PlayerToyInfo[playerid][v][ptPosZ] = 0.0;
  10959. PlayerToyInfo[playerid][v][ptRotX] = 0.0;
  10960. PlayerToyInfo[playerid][v][ptRotY] = 0.0;
  10961. PlayerToyInfo[playerid][v][ptRotZ] = 0.0;
  10962. PlayerToyInfo[playerid][v][ptScaleX] = 1.0;
  10963. PlayerToyInfo[playerid][v][ptScaleY] = 1.0;
  10964. PlayerToyInfo[playerid][v][ptScaleZ] = 1.0;
  10965. PlayerToyInfo[playerid][v][ptTradable] = 1;
  10966. g_mysql_NewToy(playerid, v);
  10967. return 1;
  10968. }
  10969. }
  10970. for(new i = 0; i < MAX_PLAYERTOYS; i++)
  10971. {
  10972. if(PlayerToyInfo[playerid][i][ptModelID] == 0)
  10973. {
  10974. PlayerToyInfo[playerid][i][ptModelID] = 19137;
  10975. PlayerToyInfo[playerid][i][ptBone] = 5;
  10976. PlayerToyInfo[playerid][i][ptPosX] = 0.0;
  10977. PlayerToyInfo[playerid][i][ptPosY] = 0.0;
  10978. PlayerToyInfo[playerid][i][ptPosZ] = 0.0;
  10979. PlayerToyInfo[playerid][i][ptRotX] = 0.0;
  10980. PlayerToyInfo[playerid][i][ptRotY] = 0.0;
  10981. PlayerToyInfo[playerid][i][ptRotZ] = 0.0;
  10982. PlayerToyInfo[playerid][i][ptScaleX] = 1.0;
  10983. PlayerToyInfo[playerid][i][ptScaleY] = 1.0;
  10984. PlayerToyInfo[playerid][i][ptScaleZ] = 1.0;
  10985. PlayerToyInfo[playerid][i][ptTradable] = 1;
  10986. PlayerToyInfo[playerid][i][ptSpecial] = 1;
  10987. g_mysql_NewToy(playerid, i);
  10988. SendClientMessageEx(playerid, COLOR_GRAD1, "Due to you not having any available slots, we've temporarily gave you an additional slot to use/sell/trade your toy.");
  10989. SendClientMessageEx(playerid, COLOR_RED, "Note: Please take note that after selling the toy, the temporarily additional toy slot will be removed.");
  10990. break;
  10991. }
  10992. }
  10993. }
  10994. }
  10995. if(dialogid == DIALOG_SHOPNEON && response)
  10996. {
  10997. switch(listitem)
  10998. {
  10999. case 0: SetPVarInt(playerid, "ToyID", 18647);
  11000. case 1: SetPVarInt(playerid, "ToyID", 18648);
  11001. case 2: SetPVarInt(playerid, "ToyID", 18649);
  11002. case 3: SetPVarInt(playerid, "ToyID", 18650);
  11003. case 4: SetPVarInt(playerid, "ToyID", 18651);
  11004. case 5: SetPVarInt(playerid, "ToyID", 18652);
  11005. }
  11006. new stringg[512], icount = GetPlayerToySlots(playerid);
  11007. for(new z;z<icount;z++)
  11008. {
  11009. new name[24];
  11010. format(name, sizeof(name), "None");
  11011. for(new i;i<sizeof(HoldingObjectsAll);i++)
  11012. {
  11013. if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][z][ptModelID])
  11014. {
  11015. format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
  11016. }
  11017. }
  11018. format(stringg, sizeof(stringg), "%s(%d) %s (Bone: %s)\n", stringg, z, name, HoldingBones[PlayerToyInfo[playerid][z][ptBone]]);
  11019. }
  11020. ShowPlayerDialogEx(playerid, DIALOG_SHOPBUYTOYS, DIALOG_STYLE_LIST, "Select a Slot", stringg, "Select", "Cancel");
  11021. }
  11022. if(dialogid == DIALOG_SHOPBUYTOYS && response)
  11023. {
  11024. new name[24];
  11025. for(new i;i<sizeof(HoldingObjectsShop);i++)
  11026. {
  11027. if(HoldingObjectsShop[i][holdingmodelid] == GetPVarInt(playerid, "ToyID"))
  11028. {
  11029. format(name, sizeof(name), "%s", HoldingObjectsShop[i][holdingmodelname]);
  11030. }
  11031. }
  11032. format(string, sizeof(string), "Item: %s\n\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", name, number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[4][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[4][sItemPrice]));
  11033. ShowPlayerDialogEx(playerid, DIALOG_SHOPBUYTOYS2, DIALOG_STYLE_MSGBOX, "Toy Shop", string, "Purchase", "Cancel");
  11034. SetPVarInt(playerid, "ToySlot", listitem);
  11035. }
  11036. if((dialogid == DIALOG_SHOPBUYTOYS2) && response)
  11037. {
  11038. if(PlayerInfo[playerid][pCredits] < ShopItems[4][sItemPrice])
  11039. {
  11040. SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits for that item. Purchase some credits at shop.ng-gaming.net");
  11041. }
  11042. else
  11043. {
  11044. if(!toyCountCheck(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You do not have enough toy slots, you may purchase more via /toys");
  11045. if(PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptModelID] != 0) return SendClientMessageEx(playerid, COLOR_YELLOW, "* You already have something in that slot. Delete it with /toys");
  11046. new name[24];
  11047. for(new i;i<sizeof(HoldingObjectsShop);i++)
  11048. {
  11049. if(HoldingObjectsShop[i][holdingmodelid] == GetPVarInt(playerid, "ToyID"))
  11050. {
  11051. format(name, sizeof(name), "%s", HoldingObjectsShop[i][holdingmodelname]);
  11052. }
  11053. }
  11054. GivePlayerCredits(playerid, -ShopItems[4][sItemPrice], 1);
  11055. printf("Price4: %d", ShopItems[4][sItemPrice]);
  11056. AmountSold[4]++;
  11057. AmountMade[4] += ShopItems[4][sItemPrice];
  11058. //ShopItems[4][sSold]++;
  11059. //ShopItems[4][sMade] += ShopItems[4][sItemPrice];
  11060. new szQuery[1024];
  11061. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold4` = '%d', `AmountMade4` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[4], AmountMade[4]);
  11062. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  11063. format(string, sizeof(string), "[TOY %i] [User: %s(%i)] [IP: %s] [Credits: %s] [Toy: %s] [Price: %s]", AmountSold[4], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), name, number_format(ShopItems[4][sItemPrice]));
  11064. Log("logs/credits.log", string), print(string);
  11065. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptModelID] = GetPVarInt(playerid, "ToyID");
  11066. new modelid = GetPVarInt(playerid, "ToyID");
  11067. if((modelid >= 19006 && modelid <= 19035) || (modelid >= 19138 && modelid <= 19140))
  11068. {
  11069. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  11070. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.9;
  11071. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  11072. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.35;
  11073. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 90.0;
  11074. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 90.0;
  11075. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  11076. }
  11077. else if(modelid >= 18891 && modelid <= 18910)
  11078. {
  11079. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  11080. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.15;
  11081. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  11082. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  11083. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 90.0;
  11084. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 180.0;
  11085. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 90.0;
  11086. }
  11087. else if(modelid >= 18926 && modelid <= 18935)
  11088. {
  11089. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  11090. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.1;
  11091. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  11092. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  11093. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 0.0;
  11094. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 0.0;
  11095. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  11096. }
  11097. else if(modelid >= 18911 && modelid <= 18920)
  11098. {
  11099. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  11100. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.1;
  11101. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.035;
  11102. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  11103. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 90.0;
  11104. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 180.0;
  11105. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 90.0;
  11106. }
  11107. else if(modelid == 19078 || modelid == 19078)
  11108. {
  11109. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 16;
  11110. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0;
  11111. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0;
  11112. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0;
  11113. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 180.0;
  11114. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 180.0;
  11115. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  11116. }
  11117. else if((modelid >= 18641 && modelid <= 18644) || (modelid >= 19080 && modelid <= 19084) || modelid == 18890)
  11118. {
  11119. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 6;
  11120. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.0;
  11121. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  11122. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  11123. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 0.0;
  11124. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 0.0;
  11125. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  11126. }
  11127. else
  11128. {
  11129. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = 2;
  11130. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosX] = 0.0;
  11131. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosY] = 0.0;
  11132. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptPosZ] = 0.0;
  11133. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotX] = 0.0;
  11134. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotY] = 0.0;
  11135. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptRotZ] = 0.0;
  11136. }
  11137. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptScaleX] = 1.0;
  11138. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptScaleY] = 1.0;
  11139. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptScaleZ] = 1.0;
  11140. PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptTradable] = 1;
  11141. g_mysql_NewToy(playerid, GetPVarInt(playerid, "ToySlot"));
  11142. format(string, sizeof(string), "You have purchased %s for %s credits. (Slot: %d)", name, number_format(ShopItems[4][sItemPrice]), GetPVarInt(playerid, "ToySlot"));
  11143. SendClientMessageEx(playerid, COLOR_CYAN, string);
  11144. SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Use /toys to wear/edit this");
  11145. DeletePVar(playerid, "ToyID"), DeletePVar(playerid, "ToySlot");
  11146. }
  11147. }
  11148. if(dialogid == DIALOG_SELLCREDITS)
  11149. {
  11150. if(response)
  11151. {
  11152. if(GetPVarInt(GetPVarInt(playerid, "CreditsSeller"), "CreditsSeller") != playerid)
  11153. {
  11154. SendClientMessageEx(playerid, COLOR_GREY, "The other player has disconnected please try again.");
  11155. DeletePVar(playerid, "CreditsOffer");
  11156. DeletePVar(playerid, "CreditsAmount");
  11157. DeletePVar(playerid, "CreditsSeller");
  11158. DeletePVar(playerid, "CreditsFirstAmount");
  11159. return 1;
  11160. }
  11161. if(PlayerInfo[GetPVarInt(playerid, "CreditsSeller")][pCredits] < GetPVarInt(playerid, "CreditsAmount"))
  11162. {
  11163. SendClientMessageEx(playerid, COLOR_GREY, "The seller didn't have enough credits.");
  11164. SendClientMessageEx(GetPVarInt(playerid, "CreditsSeller"), COLOR_GREY, "You don't have enough credits.");
  11165. DeletePVar(playerid, "CreditsOffer");
  11166. DeletePVar(playerid, "CreditsAmount");
  11167. DeletePVar(playerid, "CreditsSeller");
  11168. DeletePVar(playerid, "CreditsFirstAmount");
  11169. return 1;
  11170. }
  11171. if(GetPlayerCash(playerid) < GetPVarInt(playerid, "CreditsOffer"))
  11172. {
  11173. SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough money to accept the offer.");
  11174. SendClientMessageEx(GetPVarInt(playerid, "CreditsSeller"), COLOR_GREY, "That player does not have enough money to accept your offer.");
  11175. DeletePVar(playerid, "CreditsOffer");
  11176. DeletePVar(playerid, "CreditsAmount");
  11177. DeletePVar(playerid, "CreditsSeller");
  11178. DeletePVar(playerid, "CreditsFirstAmount");
  11179. return 1;
  11180. }
  11181. new szMessage[156];
  11182. GivePlayerCash(playerid, -GetPVarInt(playerid, "CreditsOffer"));
  11183. GivePlayerCash(GetPVarInt(playerid, "CreditsSeller"), GetPVarInt(playerid, "CreditsOffer"));
  11184. GivePlayerCredits(playerid, GetPVarInt(playerid, "CreditsAmount"), 0);
  11185. GivePlayerCredits(GetPVarInt(playerid, "CreditsSeller"), -GetPVarInt(playerid, "CreditsFirstAmount"), 0);
  11186. AmountSold[21]++;
  11187. AmountMade[21] += GetPVarInt(playerid, "CreditsFirstAmount")-GetPVarInt(playerid, "CreditsAmount");
  11188. //ShopItems[21][sSold]++;
  11189. //ShopItems[21][sMade] += GetPVarInt(playerid, "CreditsFirstAmount")-GetPVarInt(playerid, "CreditsAmount");
  11190. mysql_format(MainPipeline, szMessage, sizeof(szMessage), "UPDATE `sales` SET `TotalSold21` = '%d', `AmountMade21` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[21], AmountMade[21]);
  11191. mysql_tquery(MainPipeline, szMessage, "OnQueryFinish", "i", SENDDATA_THREAD);
  11192. print(szMessage);
  11193. format(szMessage, sizeof(szMessage), "You have accepted the offer of %s credits for $%s from %s.", number_format(GetPVarInt(playerid, "CreditsAmount")), number_format(GetPVarInt(playerid, "CreditsOffer")), GetPlayerNameEx(GetPVarInt(playerid, "CreditsSeller")));
  11194. SendClientMessageEx(playerid, COLOR_CYAN, szMessage);
  11195. format(szMessage, sizeof(szMessage), "%s has accepted your offer of %s credits for $%s.", GetPlayerNameEx(playerid), number_format(GetPVarInt(playerid, "CreditsAmount")), number_format(GetPVarInt(playerid, "CreditsOffer")));
  11196. SendClientMessageEx(GetPVarInt(playerid, "CreditsSeller"), COLOR_CYAN, szMessage);
  11197. format(szMessage, sizeof(szMessage), "[S %s(%d)][IP %s][B %s(%d)][IP %s][C %s][P $%s]", GetPlayerNameEx(GetPVarInt(playerid, "CreditsSeller")),GetPlayerSQLId(GetPVarInt(playerid, "CreditsSeller")), GetPlayerIpEx(GetPVarInt(playerid, "CreditsSeller")),
  11198. GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(GetPVarInt(playerid, "CreditsAmount")), number_format(GetPVarInt(playerid, "CreditsOffer")));
  11199. Log("logs/sellcredits.log", szMessage), print(szMessage);
  11200. }
  11201. else
  11202. {
  11203. SendClientMessageEx(playerid, COLOR_GREY, "You have declined the credits offer.");
  11204. SendClientMessageEx(GetPVarInt(playerid, "CreditsSeller"), COLOR_GREY, "Your credits offer has been declined.");
  11205. }
  11206. DeletePVar(playerid, "CreditsOffer");
  11207. DeletePVar(playerid, "CreditsAmount");
  11208. DeletePVar(playerid, "CreditsSeller");
  11209. DeletePVar(playerid, "CreditsFirstAmount");
  11210. }
  11211. if(dialogid == DIALOG_TACKLED)
  11212. {
  11213. if(response) // complying
  11214. {
  11215. SetPVarInt(playerid, "TackledResisting", 1);
  11216. }
  11217. else // resisting
  11218. {
  11219. SetPVarInt(playerid, "TackledResisting", 2);
  11220. format(string, sizeof(string), "** %s struggles with %s, attempting to escape.", GetPlayerNameEx(playerid), GetPlayerNameEx(GetPVarInt(playerid, "IsTackled")));
  11221. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  11222. }
  11223. }
  11224. if(dialogid == DIALOG_RIMMOD)
  11225. {
  11226. if(response)
  11227. {
  11228. new szRims[24];
  11229. switch(listitem)
  11230. {
  11231. case 0: SetPVarInt(playerid, "RimMod", 1025), szRims = "Offroad";
  11232. case 1: SetPVarInt(playerid, "RimMod", 1073), szRims = "Shadow";
  11233. case 2: SetPVarInt(playerid, "RimMod", 1074), szRims = "Mega";
  11234. case 3: SetPVarInt(playerid, "RimMod", 1075), szRims = "Rimshine";
  11235. case 4: SetPVarInt(playerid, "RimMod", 1076), szRims = "Wires";
  11236. case 5: SetPVarInt(playerid, "RimMod", 1077), szRims = "Classic";
  11237. case 6: SetPVarInt(playerid, "RimMod", 1078), szRims = "Twist";
  11238. case 7: SetPVarInt(playerid, "RimMod", 1079), szRims = "Cutter";
  11239. case 8: SetPVarInt(playerid, "RimMod", 1080), szRims = "Switch";
  11240. case 9: SetPVarInt(playerid, "RimMod", 1081), szRims = "Grove";
  11241. case 10: SetPVarInt(playerid, "RimMod", 1082), szRims = "Import";
  11242. case 11: SetPVarInt(playerid, "RimMod", 1083), szRims = "Dollar";
  11243. case 12: SetPVarInt(playerid, "RimMod", 1084), szRims = "Trance";
  11244. case 13: SetPVarInt(playerid, "RimMod", 1085), szRims = "Atomic";
  11245. case 14: SetPVarInt(playerid, "RimMod", 1096), szRims = "Ahab";
  11246. case 15: SetPVarInt(playerid, "RimMod", 1097), szRims = "Virtual";
  11247. case 16: SetPVarInt(playerid, "RimMod", 1098), szRims = "Access";
  11248. }
  11249. new szMessage[128];
  11250. format(szMessage, 128, "You are about to place %s rims on this vehicle.", szRims);
  11251. ShowPlayerDialogEx(playerid, DIALOG_RIMMOD2, DIALOG_STYLE_MSGBOX, "Confirm Rims", szMessage, "Confirm", "Deny");
  11252. }
  11253. }
  11254. if(dialogid == DIALOG_RIMMOD2)
  11255. {
  11256. if(response)
  11257. {
  11258. if(PlayerInfo[playerid][pRimMod] == 0)
  11259. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have any rim modification kits.");
  11260. if(IsRestrictedVehicle(GetVehicleModel(GetPlayerVehicleID(playerid)))) return SendClientMessageEx(playerid, COLOR_GREY, "This vehicle cannot have rims applied to it");
  11261. if(InvalidModCheck(GetVehicleModel(GetPlayerVehicleID(playerid)), 1025))
  11262. {
  11263. for(new d = 0 ; d < MAX_PLAYERVEHICLES; d++)
  11264. {
  11265. if(IsPlayerInVehicle(playerid, PlayerVehicleInfo[playerid][d][pvId]))
  11266. {
  11267. new szLog[128];
  11268. format(szLog, sizeof(szLog), "%s(%d) has modded his vehicle with rims %d", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPVarInt(playerid, "RimMod"));
  11269. Log("logs/rimkit.log", szLog);
  11270. SendClientMessageEx(playerid, COLOR_GREEN, "You have successfully installed rims.");
  11271. PlayerInfo[playerid][pRimMod]--;
  11272. AddVehicleComponent(GetPlayerVehicleID(playerid), GetPVarInt(playerid, "RimMod"));
  11273. DeletePVar(playerid, "RimMod");
  11274. UpdatePlayerVehicleMods(playerid, d);
  11275. return 1;
  11276. }
  11277. }
  11278. SendClientMessageEx(playerid, COLOR_GREY, "You need to be in your vehicle.");
  11279. }
  11280. else
  11281. {
  11282. SendClientMessageEx(playerid, COLOR_GREY, "That vehicle can't be modded with rims.");
  11283. }
  11284. }
  11285. }
  11286. if(dialogid == DIALOG_PVIPVOUCHER)
  11287. {
  11288. if(response)
  11289. {
  11290. PlayerInfo[playerid][pPVIPVoucher]--;
  11291. PlayerInfo[playerid][pTotalCredits] = ShopItems[21][sItemPrice];
  11292. PlayerInfo[playerid][pDonateRank] = 4;
  11293. PlayerInfo[playerid][pVIPExpire] = gettime()+2592000*1;
  11294. PlayerInfo[playerid][pTempVIP] = 0;
  11295. PlayerInfo[playerid][pBuddyInvited] = 0;
  11296. PlayerInfo[playerid][pVIPSellable] = 1;
  11297. LoadPlayerDisabledVehicles(playerid);
  11298. if(PlayerInfo[playerid][pVIPM] == 0)
  11299. {
  11300. PlayerInfo[playerid][pVIPM] = VIPM;
  11301. VIPM++;
  11302. }
  11303. format(string, sizeof(string), "%s(%d) (IP: %s) has used a 1 month PVIP Voucher.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid));
  11304. Log("logs/credits.log", string);
  11305. format(string, sizeof(string), "AdmCmd: %s's VIP level to Platinum (4) by the server (1 Month)(voucher).", GetPlayerNameEx(playerid));
  11306. ABroadCast(COLOR_LIGHTRED, string, 2);
  11307. format(string, sizeof(string), "AdmCmd: %s's(%d) VIP level to Platinum (4) by the server (1 Month)(voucher).", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid));
  11308. Log("logs/setvip.log", string), Log("logs/vouchers.log", string);
  11309. format(string, sizeof(string), "You have been issued your Platinum VIP and have %d PVIP Voucher(s) left.", PlayerInfo[playerid][pPVIPVoucher]);
  11310. SendClientMessageEx(playerid, COLOR_CYAN, string);
  11311. SendClientMessageEx(playerid, COLOR_CYAN, "** Your 1 month PVIP Voucher will expire in 1 Month.");
  11312. PlayerInfo[playerid][pArmsSkill] = 1200;
  11313. new szQuery[128];
  11314. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `accounts` SET `TotalCredits`=%d WHERE `id` = %d", PlayerInfo[playerid][pTotalCredits], GetPlayerSQLId(playerid));
  11315. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
  11316. }
  11317. }
  11318. if(dialogid == GIVETOY)
  11319. {
  11320. if(response)
  11321. {
  11322. new giveplayerid = GetPVarInt(playerid, "giveplayeridtoy"),
  11323. toyid = GetPVarInt(playerid, "toyid"),
  11324. stringg[128];
  11325. if(!toyCountCheck(giveplayerid)) return SendClientMessageEx(playerid, COLOR_YELLOW, "* This player cannot hold anymore toys!");
  11326. if(PlayerToyInfo[giveplayerid][listitem][ptModelID] != 0) return SendClientMessageEx(playerid, COLOR_YELLOW, "* This player already has something in that specified slot!");
  11327. PlayerToyInfo[giveplayerid][listitem][ptModelID] = toyid;
  11328. PlayerToyInfo[giveplayerid][listitem][ptBone] = 1;
  11329. PlayerToyInfo[giveplayerid][listitem][ptTradable] = 1;
  11330. PlayerToyInfo[giveplayerid][listitem][ptSpecial] = 0;
  11331. format(stringg, sizeof(stringg), "You have given %s object %d", GetPlayerNameEx(giveplayerid), toyid);
  11332. SendClientMessageEx(playerid, COLOR_YELLOW, stringg);
  11333. SendClientMessageEx(giveplayerid, COLOR_WHITE, "You have received a new toy from an administrator!");
  11334. format(stringg, sizeof(stringg), "%s has given %s(%d) object %d", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), toyid);
  11335. Log("logs/toys.log", stringg);
  11336. DeletePVar(playerid, "giveplayeridtoy");
  11337. DeletePVar(playerid, "toyid");
  11338. new v = listitem; // lazy
  11339. g_mysql_NewToy(giveplayerid, v);
  11340. }
  11341. }
  11342. if(dialogid == PBFORCE)
  11343. {
  11344. new giveplayerid = GetPVarInt(playerid, "tempPBP");
  11345. DeletePVar(playerid, "tempPSP");
  11346. if(response)
  11347. {
  11348. if(PlayerInfo[playerid][pAdmin] >= 2)
  11349. {
  11350. if(IsPlayerConnected(giveplayerid))
  11351. {
  11352. if(GetPVarType(giveplayerid, "IsInArena"))
  11353. {
  11354. LeavePaintballArena(giveplayerid, GetPVarInt(giveplayerid, "IsInArena"));
  11355. format(string, sizeof(string), "You have forced %s out of paintball. You may now teleport this player.", GetPlayerNameEx(giveplayerid));
  11356. SendClientMessageEx(playerid, COLOR_WHITE, string);
  11357. format(string, sizeof(string), "You have been forced out of paintball by %s.", GetPlayerNameEx(playerid));
  11358. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  11359. }
  11360. else
  11361. {
  11362. SendClientMessageEx(playerid, COLOR_WHITE, "This user is not in an active paintball match.");
  11363. }
  11364. }
  11365. else
  11366. {
  11367. SendClientMessageEx(playerid, COLOR_GRAD2, "This user has logged off.");
  11368. }
  11369. }
  11370. }
  11371. else
  11372. {
  11373. if(PlayerInfo[playerid][pAdmin] >= 2)
  11374. {
  11375. if(IsPlayerConnected(giveplayerid))
  11376. {
  11377. format(string, sizeof(string), "%s will remain in the paintball match.", GetPlayerNameEx(giveplayerid));
  11378. SendClientMessageEx(playerid, COLOR_WHITE, string);
  11379. }
  11380. else
  11381. {
  11382. SendClientMessageEx(playerid, COLOR_GRAD2, "This user has logged off.");
  11383. }
  11384. }
  11385. }
  11386. }
  11387. if(dialogid == DISPLAY_STATS)
  11388. {
  11389. new targetid = GetPVarInt(playerid, "ShowStats");
  11390. if(IsPlayerConnected(targetid))
  11391. {
  11392. if(response)
  11393. {
  11394. new resultline[1024], header[64], pvtstring[256], adminstring[128], advisorstring[128];
  11395. if (PlayerInfo[playerid][pAdmin] >= 2)
  11396. {
  11397. format(pvtstring, sizeof(pvtstring), "House: %d\nHouse 2: %d\nHouse 3: %d\nRenting: %d\nInt: %d\nVW: %d\nReal VW: %d\nJail: %d sec\nWJail: %d sec\nVIPM: %i\nGVIP: %i\nReward Hours: %.2f\n", PlayerInfo[targetid][pPhousekey], PlayerInfo[targetid][pPhousekey2], PlayerInfo[targetid][pPhousekey3], PlayerInfo[targetid][pRenting],
  11398. GetPlayerInterior(targetid), PlayerInfo[targetid][pVW], GetPlayerVirtualWorld(targetid), PlayerInfo[targetid][pJailTime], PlayerInfo[targetid][pBeingSentenced], PlayerInfo[targetid][pVIPM], PlayerInfo[targetid][pGVip], PlayerInfo[targetid][pRewardHours]);
  11399. }
  11400. if(PlayerInfo[playerid][pAdmin] >= 4 && PlayerInfo[targetid][pAdmin] >= 2) format(adminstring, sizeof(adminstring), "Accepted Reports: %s\nTrashed Reports: %s\n", number_format(PlayerInfo[targetid][pAcceptReport]), number_format(PlayerInfo[targetid][pTrashReport]));
  11401. if((PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pPR] >= 1 || PlayerInfo[playerid][pASM] >= 1) && PlayerInfo[targetid][pHelper] >= 2) format(advisorstring, sizeof(advisorstring), "Hours on Duty: %s\nAccepted Help Requests: %s\n", number_format(PlayerInfo[targetid][pDutyHours]), number_format(PlayerInfo[targetid][pAcceptedHelp]));
  11402. format(header, sizeof(header), "Showing Statistics of %s", GetPlayerNameEx(targetid));
  11403. format(resultline, sizeof(resultline),"{FFFFFF}Wanted Level: %d\n\
  11404. Crimes: %s\n\
  11405. Arrests: %s\n\
  11406. Referrals: %s\n\
  11407. Warnings: %s\n\
  11408. Weapon Restriction: %s hour(s)\n\
  11409. Gang Warnings: %s\n\
  11410. Newbie Chat Mutes: %s\n\
  11411. Advertisement Mutes: %s\n\
  11412. Report Mutes: %s\n\
  11413. %s\
  11414. %s\
  11415. %s",
  11416. PlayerInfo[targetid][pWantedLevel],
  11417. number_format(PlayerInfo[targetid][pCrimes]),
  11418. number_format(PlayerInfo[targetid][pArrested]),
  11419. number_format(PlayerInfo[targetid][pRefers]),
  11420. number_format(PlayerInfo[targetid][pWarns]),
  11421. number_format(PlayerInfo[targetid][pWRestricted]),
  11422. number_format(PlayerInfo[targetid][pGangWarn]),
  11423. number_format(PlayerInfo[targetid][pNMuteTotal]),
  11424. number_format(PlayerInfo[targetid][pADMuteTotal]),
  11425. number_format(PlayerInfo[targetid][pRMutedTotal]),
  11426. pvtstring,
  11427. advisorstring,
  11428. adminstring);
  11429. ShowPlayerDialogEx(playerid, DISPLAY_STATS2, DIALOG_STYLE_MSGBOX, header, resultline, "First Page", "Close");
  11430. }
  11431. else DeletePVar(playerid, "ShowStats");
  11432. }
  11433. else
  11434. {
  11435. SendClientMessageEx(playerid, COLOR_GRAD1, "The player you were checking has logged out.");
  11436. DeletePVar(playerid, "ShowStats");
  11437. return 1;
  11438. }
  11439. }
  11440. if(dialogid == DISPLAY_STATS2)
  11441. {
  11442. new targetid = GetPVarInt(playerid, "ShowStats");
  11443. if(IsPlayerConnected(targetid))
  11444. {
  11445. if(response)
  11446. {
  11447. ShowStats(playerid, targetid);
  11448. }
  11449. else DeletePVar(playerid, "ShowStats");
  11450. }
  11451. else
  11452. {
  11453. SendClientMessageEx(playerid, COLOR_GRAD1, "The player you were checking has logged out.");
  11454. DeletePVar(playerid, "ShowStats");
  11455. return 1;
  11456. }
  11457. }
  11458. #if defined event_chancegambler
  11459. if(dialogid == DIALOG_ROLL)
  11460. {
  11461. if(response)
  11462. {
  11463. if(FIFEnabled == 1)
  11464. {
  11465. new iNumber = Random(1, 11);
  11466. if(iNumber > 4)
  11467. {
  11468. new szMessage[128];
  11469. format(szMessage, sizeof(szMessage), "You have rolled %d and doubled your chances!", iNumber);
  11470. SendClientMessageEx(playerid, COLOR_CYAN, szMessage);
  11471. format(szMessage, sizeof(szMessage), "* %s has rolled %d and doubled his chances!", GetPlayerNameEx(playerid), iNumber);
  11472. ProxDetector(30.0, playerid, szMessage, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  11473. FIFInfo[playerid][FIFChances] *= 2;
  11474. format(szMessage, sizeof(szMessage), "%s (IP:%s) has doubled their chances. (Chances: %d)", GetPlayerNameEx(playerid), GetPlayerIpEx(playerid), FIFInfo[playerid][FIFChances]);
  11475. Log("logs/gamblechances.log", szMessage);
  11476. }
  11477. else
  11478. {
  11479. new szMessage[128];
  11480. format(szMessage, sizeof(szMessage), "* %s has rolled %d and lost it all!", GetPlayerNameEx(playerid), iNumber);
  11481. ProxDetector(30.0, playerid, szMessage, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  11482. format(szMessage, sizeof(szMessage), "You have rolled %d and lost it all!", iNumber);
  11483. SendClientMessageEx(playerid, COLOR_CYAN, szMessage);
  11484. FIFInfo[playerid][FIFChances] = 0;
  11485. format(szMessage, sizeof(szMessage), "%s (IP:%s) has lost it all. (Chances: %d)", GetPlayerNameEx(playerid), GetPlayerIpEx(playerid), FIFInfo[playerid][FIFChances]);
  11486. Log("logs/gamblechances.log", szMessage);
  11487. }
  11488. }
  11489. }
  11490. }
  11491. if(dialogid == DIALOG_HUNGERGAMES)
  11492. {
  11493. if(response)
  11494. {
  11495. if(PlayerInfo[playerid][pHungerVoucher] == 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "You do not have any Hunger Games Vouchers.");
  11496. SendClientMessageEx(playerid, COLOR_CYAN, "You have used a Hunger Games Voucher and will have 100 HP instead of 50 for the event and will receive a free MP5.");
  11497. PlayerInfo[playerid][pHungerVoucher]--;
  11498. SetPVarInt(playerid, "HungerVoucher", 1);
  11499. }
  11500. }
  11501. #endif
  11502. if(dialogid == DIALOG_NRNCONFIRM)
  11503. {
  11504. if(response)
  11505. {
  11506. new playersz[5];
  11507. GetPVarString(playerid, "nrn", playersz, 5);
  11508. DeletePVar(playerid, "nrn");
  11509. cmd_nrn(playerid, playersz);
  11510. }
  11511. else
  11512. {
  11513. DeletePVar(playerid, "nrn");
  11514. }
  11515. }
  11516. if(dialogid == DIALOG_CONFIRMADP)
  11517. {
  11518. if(response)
  11519. {
  11520. new advert[256], reportid = GetPVarInt(playerid, "ReporterID");
  11521. new szString[128], shared;
  11522. GetPVarString(reportid, "PriorityAdText", advert, 128);
  11523. if(isnull(advert) || !IsPlayerConnected(reportid))
  11524. {
  11525. DeletePVar(playerid, "ReporterID");
  11526. DeletePVar(reportid, "PriorityAdText");
  11527. DeletePVar(reportid, "RequestingAdP");
  11528. DeletePVar(reportid, "AdvertVoucher");
  11529. return SendClientMessageEx(playerid, -1, "There was a issue with the advertisement, the ad was empty and/or the player logged out.");
  11530. }
  11531. // Do not comment this out! This is needed to re-format the ad with the proper format - Nathan
  11532. format(advert, sizeof(advert), "Advertisement: %s - contact: %s (%d)", advert, GetPlayerNameEx(reportid), PlayerInfo[reportid][pPnumber]);
  11533. SendClientMessageEx(reportid, -1, "Your Priority Advertisement has been approved & published.");
  11534. if(GetPVarInt(reportid, "AdvertVoucher") > 0)
  11535. {
  11536. SendClientMessageEx(reportid, COLOR_CYAN, "You have used 1 Priority Advertisement.");
  11537. PlayerInfo[reportid][pAdvertVoucher]--;
  11538. }
  11539. else if(PlayerInfo[reportid][pFreeAdsLeft] > 0 && PlayerInfo[reportid][pDonateRank] >= 4)
  11540. {
  11541. PlayerInfo[reportid][pFreeAdsLeft]--;
  11542. format(szString, sizeof(szString), "Platinum VIP: You have used a free advertisement, you have %d left for today.", PlayerInfo[reportid][pFreeAdsLeft]);
  11543. SendClientMessageEx(reportid, COLOR_YELLOW, szString);
  11544. }
  11545. else if(PlayerInfo[reportid][pDonateRank] == 2)
  11546. {
  11547. GivePlayerCash(reportid, -125000);
  11548. shared = 125000 / 3;
  11549. SendClientMessageEx(reportid, COLOR_YELLOW, "VIP Discount: You have paid $125,000 for being Silver VIP.");
  11550. }
  11551. else if(PlayerInfo[reportid][pDonateRank] == 3)
  11552. {
  11553. GivePlayerCash(reportid, -100000);
  11554. shared = 100000 / 3;
  11555. SendClientMessageEx(reportid, COLOR_YELLOW, "VIP Discount: You have paid $100,000 for being Gold VIP.");
  11556. }
  11557. else if(PlayerInfo[reportid][pDonateRank] >= 4)
  11558. {
  11559. GivePlayerCash(reportid, -50000);
  11560. shared = 50000 / 3;
  11561. SendClientMessageEx(reportid, COLOR_YELLOW, "VIP Discount: You have paid $50,000 for being Platinum VIP.");
  11562. }
  11563. else
  11564. {
  11565. GivePlayerCash(reportid, -150000);
  11566. shared = 150000 / 3;
  11567. }
  11568. iAdverTimer = gettime()+30;
  11569. if(shared > 0)
  11570. {
  11571. for(new x; x < MAX_GROUPS; x++)
  11572. {
  11573. if(arrGroupData[x][g_iGroupType] == GROUP_TYPE_NEWS)
  11574. {
  11575. arrGroupData[x][g_iBudget] += shared;
  11576. }
  11577. }
  11578. }
  11579. foreach(new i: Player)
  11580. {
  11581. if(!gNews[i] && InsideMainMenu{i} != 1 && InsideTut{i} != 1 && ActiveChatbox[i] != 0) SendClientMessage(i, TEAM_GROVE_COLOR, advert);
  11582. }
  11583. format(advert, sizeof(advert), "%s -- (SQLID: %d) | Accepted by: %s -- (SQLID: %d)", advert, GetPlayerSQLId(reportid), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid));
  11584. Log("logs/pads.log", advert);
  11585. /*if(Homes[reportid] > 0 && AdvertType[reportid] == 1 && !PlayerInfo[playerid][pShopNotice])
  11586. {
  11587. PlayerTextDrawSetString(reportid, MicroNotice[reportid], ShopMsg[6]);
  11588. PlayerTextDrawShow(reportid, MicroNotice[reportid]);
  11589. SetTimerEx("HidePlayerTextDraw", 10000, false, "ii", reportid, _:MicroNotice[reportid]);
  11590. }*/
  11591. DeletePVar(reportid, "PriorityAdText");
  11592. DeletePVar(playerid, "ReporterID");
  11593. DeletePVar(reportid, "RequestingAdP");
  11594. DeletePVar(reportid, "AdvertVoucher");
  11595. }
  11596. else
  11597. {
  11598. SendClientMessageEx(GetPVarInt(playerid, "ReporterID"), -1, "Your priority advertisement has been denied.");
  11599. szAdvert[GetPVarInt(playerid, "ReporterID")][0] = 0;
  11600. DeletePVar(GetPVarInt(playerid, "ReporterID"), "PriorityAdText");
  11601. DeletePVar(GetPVarInt(playerid, "ReporterID"), "AdvertVoucher");
  11602. DeletePVar(GetPVarInt(playerid, "ReporterID"), "RequestingAdP");
  11603. DeletePVar(playerid, "ReporterID");
  11604. }
  11605. }
  11606. if(dialogid == DIALOG_GIFTBOX_INFO)
  11607. {
  11608. if(response)
  11609. {
  11610. return ShowPlayerDynamicGiftBox(playerid);
  11611. }
  11612. }
  11613. if(dialogid == DIALOG_GIFTBOX_VIEW)
  11614. {
  11615. if(response)
  11616. {
  11617. if(PlayerInfo[playerid][pAdmin] < 99999 && PlayerInfo[playerid][pShopTech] < 3) return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not authorized to use this command!");
  11618. switch(listitem)
  11619. {
  11620. case 1:
  11621. {
  11622. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgMoney][0], dgVar[dgMoney][1], dgVar[dgMoney][2], GetDynamicGiftBoxType(dgVar[dgMoney][3]));
  11623. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Money", string, "Back", "");
  11624. }
  11625. case 2:
  11626. {
  11627. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgRimKit][0], dgVar[dgRimKit][1], dgVar[dgRimKit][2], GetDynamicGiftBoxType(dgVar[dgRimKit][3]));
  11628. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Rimkit", string, "Back", "");
  11629. }
  11630. case 3:
  11631. {
  11632. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgFirework][0], dgVar[dgFirework][1], dgVar[dgFirework][2], GetDynamicGiftBoxType(dgVar[dgFirework][3]));
  11633. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Firework", string, "Back", "");
  11634. }
  11635. case 4:
  11636. {
  11637. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgGVIP][0], dgVar[dgGVIP][1], dgVar[dgGVIP][2], GetDynamicGiftBoxType(dgVar[dgGVIP][3]));
  11638. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - 7 Day GVIP", string, "Back", "");
  11639. }
  11640. case 5:
  11641. {
  11642. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgGVIPEx][0], dgVar[dgGVIPEx][1], dgVar[dgGVIPEx][2], GetDynamicGiftBoxType(dgVar[dgGVIPEx][3]));
  11643. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - 1 Month GVIP", string, "Back", "");
  11644. }
  11645. case 6:
  11646. {
  11647. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgSVIP][0], dgVar[dgSVIP][1], dgVar[dgSVIP][2], GetDynamicGiftBoxType(dgVar[dgSVIP][3]));
  11648. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - 7 Day SVIP", string, "Back", "");
  11649. }
  11650. case 7:
  11651. {
  11652. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgSVIPEx][0], dgVar[dgSVIPEx][1], dgVar[dgSVIPEx][2], GetDynamicGiftBoxType(dgVar[dgSVIPEx][3]));
  11653. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - 1 Month SVIP", string, "Back", "");
  11654. }
  11655. case 8:
  11656. {
  11657. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgCarSlot][0], dgVar[dgCarSlot][1], dgVar[dgCarSlot][2], GetDynamicGiftBoxType(dgVar[dgCarSlot][3]));
  11658. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Car Slot", string, "Back", "");
  11659. }
  11660. case 9:
  11661. {
  11662. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgToySlot][0], dgVar[dgToySlot][1], dgVar[dgToySlot][2], GetDynamicGiftBoxType(dgVar[dgToySlot][3]));
  11663. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Toy Slot", string, "Back", "");
  11664. }
  11665. case 10:
  11666. {
  11667. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgArmor][0], dgVar[dgArmor][1], dgVar[dgArmor][2], GetDynamicGiftBoxType(dgVar[dgArmor][3]));
  11668. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Armor", string, "Back", "");
  11669. }
  11670. case 11:
  11671. {
  11672. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgFirstaid][0], dgVar[dgFirstaid][1], dgVar[dgFirstaid][2], GetDynamicGiftBoxType(dgVar[dgFirstaid][3]));
  11673. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Firstaid", string, "Back", "");
  11674. }
  11675. case 12:
  11676. {
  11677. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgDDFlag][0], dgVar[dgDDFlag][1], dgVar[dgDDFlag][2], GetDynamicGiftBoxType(dgVar[dgDDFlag][3]));
  11678. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Dynamic Door Flag", string, "Back", "");
  11679. }
  11680. case 13:
  11681. {
  11682. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgGateFlag][0], dgVar[dgGateFlag][1], dgVar[dgGateFlag][2], GetDynamicGiftBoxType(dgVar[dgGateFlag][3]));
  11683. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Dynamic Gate Flag", string, "Back", "");
  11684. }
  11685. case 14:
  11686. {
  11687. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgCredits][0], dgVar[dgCredits][1], dgVar[dgCredits][2], GetDynamicGiftBoxType(dgVar[dgCredits][3]));
  11688. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Credits", string, "Back", "");
  11689. }
  11690. case 15:
  11691. {
  11692. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgPriorityAd][0], dgVar[dgPriorityAd][1], dgVar[dgPriorityAd][2], GetDynamicGiftBoxType(dgVar[dgPriorityAd][3]));
  11693. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Priority Advertisement", string, "Back", "");
  11694. }
  11695. case 16:
  11696. {
  11697. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgHealthNArmor][0], dgVar[dgHealthNArmor][1], dgVar[dgHealthNArmor][2], GetDynamicGiftBoxType(dgVar[dgHealthNArmor][3]));
  11698. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Health & Armor", string, "Back", "");
  11699. }
  11700. case 17:
  11701. {
  11702. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgGiftReset][0], dgVar[dgGiftReset][1], dgVar[dgGiftReset][2], GetDynamicGiftBoxType(dgVar[dgGiftReset][3]));
  11703. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Gift Reset", string, "Back", "");
  11704. }
  11705. case 18:
  11706. {
  11707. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgMaterial][0], dgVar[dgMaterial][1], dgVar[dgMaterial][2], GetDynamicGiftBoxType(dgVar[dgMaterial][3]));
  11708. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Material", string, "Back", "");
  11709. }
  11710. case 19:
  11711. {
  11712. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgWarning][0], dgVar[dgWarning][1], dgVar[dgWarning][2], GetDynamicGiftBoxType(dgVar[dgWarning][3]));
  11713. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Warning", string, "Back", "");
  11714. }
  11715. case 20:
  11716. {
  11717. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgPot][0], dgVar[dgPot][1], dgVar[dgPot][2], GetDynamicGiftBoxType(dgVar[dgPot][3]));
  11718. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Cannabis", string, "Back", "");
  11719. }
  11720. case 21:
  11721. {
  11722. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgCrack][0], dgVar[dgCrack][1], dgVar[dgCrack][2], GetDynamicGiftBoxType(dgVar[dgCrack][3]));
  11723. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Crack", string, "Back", "");
  11724. }
  11725. case 22:
  11726. {
  11727. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgPaintballToken][0], dgVar[dgPaintballToken][1], dgVar[dgPaintballToken][2], GetDynamicGiftBoxType(dgVar[dgPaintballToken][3]));
  11728. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Paintball Token", string, "Back", "");
  11729. }
  11730. case 23:
  11731. {
  11732. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgVIPToken][0], dgVar[dgVIPToken][1], dgVar[dgVIPToken][2], GetDynamicGiftBoxType(dgVar[dgVIPToken][3]));
  11733. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - VIP Token", string, "Back", "");
  11734. }
  11735. case 24:
  11736. {
  11737. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgRespectPoint][0], dgVar[dgRespectPoint][1], dgVar[dgRespectPoint][2], GetDynamicGiftBoxType(dgVar[dgRespectPoint][3]));
  11738. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Respect Point", string, "Back", "");
  11739. }
  11740. case 25:
  11741. {
  11742. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgCarVoucher][0], dgVar[dgCarVoucher][1], dgVar[dgCarVoucher][2], GetDynamicGiftBoxType(dgVar[dgCarVoucher][3]));
  11743. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Car Voucher", string, "Back", "");
  11744. }
  11745. case 26:
  11746. {
  11747. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgBuddyInvite][0], dgVar[dgBuddyInvite][1], dgVar[dgBuddyInvite][2], GetDynamicGiftBoxType(dgVar[dgBuddyInvite][3]));
  11748. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Buddy Invite", string, "Back", "");
  11749. }
  11750. case 27:
  11751. {
  11752. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgLaser][0], dgVar[dgLaser][1], dgVar[dgLaser][2], GetDynamicGiftBoxType(dgVar[dgLaser][3]));
  11753. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Laser", string, "Back", "");
  11754. }
  11755. case 28:
  11756. {
  11757. format(string, sizeof(string), "Enabled: %d\nStock: %d\nToy ID: %d\nGift Type: %s", dgVar[dgCustomToy][0], dgVar[dgCustomToy][1], dgVar[dgCustomToy][2], GetDynamicGiftBoxType(dgVar[dgCustomToy][3]));
  11758. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Custom Toy", string, "Back", "");
  11759. }
  11760. case 29:
  11761. {
  11762. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgAdmuteReset][0], dgVar[dgAdmuteReset][1], dgVar[dgAdmuteReset][2], GetDynamicGiftBoxType(dgVar[dgAdmuteReset][3]));
  11763. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Advertisement Mute Reset", string, "Back", "");
  11764. }
  11765. case 30:
  11766. {
  11767. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgNewbieMuteReset][0], dgVar[dgNewbieMuteReset][1], dgVar[dgNewbieMuteReset][2], GetDynamicGiftBoxType(dgVar[dgNewbieMuteReset][3]));
  11768. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Newbie Mute Reset", string, "Back", "");
  11769. }
  11770. case 31:
  11771. {
  11772. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgRestrictedCarVoucher][0], dgVar[dgRestrictedCarVoucher][1], dgVar[dgRestrictedCarVoucher][2], GetDynamicGiftBoxType(dgVar[dgRestrictedCarVoucher][3]));
  11773. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - Restricted Car Voucher", string, "Back", "");
  11774. }
  11775. case 32:
  11776. {
  11777. format(string, sizeof(string), "Enabled: %d\nStock: %d\nGift Quantity: %d\nGift Type: %s", dgVar[dgPlatinumVIPVoucher][0], dgVar[dgPlatinumVIPVoucher][1], dgVar[dgPlatinumVIPVoucher][2], GetDynamicGiftBoxType(dgVar[dgPlatinumVIPVoucher][3]));
  11778. ShowPlayerDialogEx(playerid, DIALOG_GIFTBOX_INFO, DIALOG_STYLE_MSGBOX, "Dynamic Giftbox - 1 month PVIP Voucher", string, "Back", "");
  11779. }
  11780. default: return true;
  11781. }
  11782. }
  11783. }
  11784. if(dialogid == DIALOG_VIPSPAWN)
  11785. {
  11786. if(response)
  11787. {
  11788. switch(listitem)
  11789. {
  11790. case 0:
  11791. {
  11792. SetPVarInt(playerid, "VIPSpawn", 1);
  11793. SendClientMessageEx(playerid, COLOR_CYAN, "You have used your free spawn at the Gold VIP+ room, you will be spawned at Los Santos VIP in 60 seconds.");
  11794. }
  11795. case 1:
  11796. {
  11797. SetPVarInt(playerid, "VIPSpawn", 2);
  11798. SendClientMessageEx(playerid, COLOR_CYAN, "You have used your free spawn at the Gold VIP+ room, you will be spawned at San Fierro VIP in 60 seconds.");
  11799. }
  11800. case 2:
  11801. {
  11802. SetPVarInt(playerid, "VIPSpawn", 3);
  11803. SendClientMessageEx(playerid, COLOR_CYAN, "You have used your free spawn at the Gold VIP+ room, you will be spawned at Las Ventures VIP in 60 seconds.");
  11804. }
  11805. case 3:
  11806. {
  11807. SetPVarInt(playerid, "VIPSpawn", 4);
  11808. SendClientMessageEx(playerid, COLOR_GREY, "You have not used your free spawn at the Gold VIP+ room this time.");
  11809. }
  11810. }
  11811. SetPlayerSpawn(playerid);
  11812. }
  11813. else
  11814. {
  11815. SetPVarInt(playerid, "VIPSpawn", 4);
  11816. SendClientMessageEx(playerid, COLOR_GREY, "You have not used your free spawn at Gold VIP+ room this time.");
  11817. SetPlayerSpawn(playerid);
  11818. }
  11819. }
  11820. if(dialogid == DIALOG_NONRPACTION)
  11821. {
  11822. if(response)
  11823. {
  11824. ResetPlayerWeaponsEx(GetPVarInt(playerid, "PendingAction4"));
  11825. PlayerInfo[GetPVarInt(playerid, "PendingAction4")][pAccountRestricted] = 1;
  11826. SendClientMessageEx(playerid, COLOR_RED, "You have restricted this player account.");
  11827. PlayerTextDrawShow(GetPVarInt(playerid, "PendingAction4"), AccountRestriction[GetPVarInt(playerid, "PendingAction4")]);
  11828. PlayerTextDrawShow(GetPVarInt(playerid, "PendingAction4"), AccountRestrictionEx[GetPVarInt(playerid, "PendingAction4")]);
  11829. format(string, sizeof(string), "%s has restricted %s(%d) account", GetPlayerNameEx(playerid), GetPlayerNameEx(GetPVarInt(playerid, "PendingAction4")), GetPlayerSQLId(GetPVarInt(playerid, "PendingAction4")));
  11830. Log("logs/restrictaccount.log", string);
  11831. return DeletePVar(playerid, "PendingAction4");
  11832. }
  11833. else
  11834. {
  11835. DeletePVar(playerid, "PendingAction4");
  11836. return SendClientMessageEx(playerid, COLOR_GRAD1, "You have decided to not restrict this player account.");
  11837. }
  11838. }
  11839. if(dialogid == DIALOG_VIPJOB)
  11840. {
  11841. if(response && PlayerInfo[playerid][pDonateRank] >= 4 && PlayerInfo[playerid][pVIPJob] > 0)
  11842. {
  11843. switch(listitem)
  11844. {
  11845. case 0:
  11846. {
  11847. if(PlayerInfo[playerid][pDetSkill] >= 400)
  11848. {
  11849. SendClientMessageEx(playerid, COLOR_GREY, "Your skill level of this job is already the highest one.");
  11850. return 1;
  11851. }
  11852. PlayerInfo[playerid][pDetSkill] = 400;
  11853. SendClientMessageEx(playerid, COLOR_YELLOW, "Your Detective skill level has been set to 5.");
  11854. }
  11855. case 1:
  11856. {
  11857. if(PlayerInfo[playerid][pLawSkill] >= 400)
  11858. {
  11859. SendClientMessageEx(playerid, COLOR_GREY, "Your skill level of this job is already the highest one.");
  11860. return 1;
  11861. }
  11862. PlayerInfo[playerid][pLawSkill] = 400;
  11863. SendClientMessageEx(playerid, COLOR_YELLOW, "Your Lawyer skill level has been set to 5.");
  11864. }
  11865. case 2:
  11866. {
  11867. if(PlayerInfo[playerid][pSexSkill] >= 400)
  11868. {
  11869. SendClientMessageEx(playerid, COLOR_GREY, "Your skill level of this job is already the highest one.");
  11870. return 1;
  11871. }
  11872. PlayerInfo[playerid][pSexSkill] = 400;
  11873. SendClientMessageEx(playerid, COLOR_YELLOW, "Your Whore skill level has been set to 5.");
  11874. }
  11875. case 3:
  11876. {
  11877. return 1;
  11878. }
  11879. case 4:
  11880. {
  11881. if(PlayerInfo[playerid][pDrugSmuggler] >= 200)
  11882. {
  11883. SendClientMessageEx(playerid, COLOR_GREY, "Your skill level of this job is already the highest one.");
  11884. return 1;
  11885. }
  11886. PlayerInfo[playerid][pDrugSmuggler] = 200;
  11887. SendClientMessageEx(playerid, COLOR_YELLOW, "Your Drugs Smuggling skill level has been set to 5.");
  11888. }
  11889. case 5:
  11890. {
  11891. if(PlayerInfo[playerid][pArmsSkill] >= 1200)
  11892. {
  11893. SendClientMessageEx(playerid, COLOR_GREY, "Your skill level of this job is already the highest one.");
  11894. return 1;
  11895. }
  11896. PlayerInfo[playerid][pArmsSkill] = 1200;
  11897. SendClientMessageEx(playerid, COLOR_YELLOW, "Your Arms Dealer skill level has been set to 5.");
  11898. }
  11899. case 6:
  11900. {
  11901. if(PlayerInfo[playerid][pMechSkill] >= 400)
  11902. {
  11903. SendClientMessageEx(playerid, COLOR_GREY, "Your skill level of this job is already the highest one.");
  11904. return 1;
  11905. }
  11906. PlayerInfo[playerid][pMechSkill] = 400;
  11907. SendClientMessageEx(playerid, COLOR_YELLOW, "Your Car Mechanic skill level has been set to 5.");
  11908. }
  11909. case 7:
  11910. {
  11911. if(PlayerInfo[playerid][pBoxSkill] >= 400)
  11912. {
  11913. SendClientMessageEx(playerid, COLOR_GREY, "Your skill level of this job is already the highest one.");
  11914. return 1;
  11915. }
  11916. PlayerInfo[playerid][pBoxSkill] = 400;
  11917. SendClientMessageEx(playerid, COLOR_YELLOW, "Your Boxer skill level has been set to 5.");
  11918. }
  11919. case 8:
  11920. {
  11921. if(PlayerInfo[playerid][pFishSkill] >= 400)
  11922. {
  11923. SendClientMessageEx(playerid, COLOR_GREY, "Your skill level of this job is already the highest one.");
  11924. return 1;
  11925. }
  11926. PlayerInfo[playerid][pFishSkill] = 400;
  11927. SendClientMessageEx(playerid, COLOR_YELLOW, "Your Fishing skill level has been set to 5.");
  11928. }
  11929. case 9:
  11930. {
  11931. if(PlayerInfo[playerid][pTruckSkill] >= 401)
  11932. {
  11933. SendClientMessageEx(playerid, COLOR_GREY, "Your skill level of this job is already the highest one.");
  11934. return 1;
  11935. }
  11936. PlayerInfo[playerid][pTruckSkill] = 401;
  11937. SendClientMessageEx(playerid, COLOR_YELLOW, "Your Shipment Contractor skill level has been set to 5.");
  11938. }
  11939. /* case 10:
  11940. {
  11941. if(PlayerInfo[playerid][pTreasureSkill] >= 600)
  11942. {
  11943. SendClientMessageEx(playerid, COLOR_GREY, "Your skill level of this job is already the highest one.");
  11944. return 1;
  11945. }
  11946. PlayerInfo[playerid][pTreasureSkill] = 600;
  11947. SendClientMessageEx(playerid, COLOR_YELLOW, "Your Treasure Hunter skill level has been set to 5.");
  11948. } */
  11949. case 10:
  11950. {
  11951. if(PlayerInfo[playerid][pCarLockPickSkill] >= 350)
  11952. return SendClientMessageEx(playerid, COLOR_GREY, "Your skill level of this job is already the highest one.");
  11953. PlayerInfo[playerid][pCarLockPickSkill] = 350;
  11954. SendClientMessageEx(playerid, COLOR_YELLOW, "Your Lock Picking skill level has been set to 5.");
  11955. }
  11956. }
  11957. PlayerInfo[playerid][pVIPJob] = 0;
  11958. OnPlayerStatsUpdate(playerid);
  11959. }
  11960. }
  11961. if(dialogid == DIALOG_WDREPORT)
  11962. {
  11963. if(!response || strlen(inputtext) < 30)
  11964. {
  11965. format(string, sizeof(string), "Please write a brief report on what you watched %s do.\n * 30 characters min", GetPlayerNameEx(GetPVarInt(playerid, "SpectatingWatch")));
  11966. return ShowPlayerDialogEx(playerid, DIALOG_WDREPORT, DIALOG_STYLE_INPUT, "Incident Report", string, "Submit", "");
  11967. }
  11968. new szQuery[256];
  11969. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "INSERT INTO `watchdog_reports` (reporter, report, reported, type, time) VALUES ('%d', '%e', '%d', '%d', UNIX_TIMESTAMP())", GetPlayerSQLId(playerid), inputtext, GetPlayerSQLId(GetPVarInt(playerid, "SpectatingWatch")), GetPVarInt(playerid, "WDReport"));
  11970. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
  11971. SendClientMessageEx(playerid, COLOR_GRAD4, inputtext);
  11972. SendClientMessageEx(playerid, COLOR_GRAD1, "Incident Report successfully submitted.");
  11973. }
  11974. if(dialogid == DIALOG_DGRAUTORESET)
  11975. {
  11976. if(!response && GetPVarType(playerid, "dgInputSel")) return cmd_dgedit(playerid, "autoreset");
  11977. if(response)
  11978. {
  11979. if(listitem == 0)
  11980. {
  11981. SetPVarInt(playerid, "dgInputSel", 1);
  11982. return ShowPlayerDialogEx(playerid, DIALOG_DGRAUTORESET, DIALOG_STYLE_INPUT, "Dynamic Giftbox Auto Reset - Timer", "Please enter a interval in minutes of when you want the giftbox to be automatically reset.", "Submit", "Close");
  11983. }
  11984. if(listitem == 1)
  11985. {
  11986. SetPVarInt(playerid, "dgInputSel", 2);
  11987. return ShowPlayerDialogEx(playerid, DIALOG_DGRAUTORESET, DIALOG_STYLE_INPUT, "Dynamic Giftbox Auto Reset - Amount", "Please enter a amount to be added to empty items when the giftbox is automatically reset.", "Submit", "Close");
  11988. }
  11989. if(listitem == 2)
  11990. {
  11991. if(dgTimer != -1)
  11992. {
  11993. KillTimer(dgTimer);
  11994. dgTimer = -1;
  11995. SendClientMessage(playerid, -1, "You have successfully disabled the auto reset feature.");
  11996. }
  11997. else
  11998. {
  11999. if(!dynamicgift) return SendClientMessageEx(playerid, -1, "Giftbox has not been placed!");
  12000. if(IsDynamicGiftBoxEnabled == false) return SendClientMessageEx(playerid, -1, "Dynamic Giftbox is currently disabled! /togdynamicgift to enable.");
  12001. if(dgTimerTime <= 0 || dgAmount <= 0) return SendClientMessageEx(playerid, -1, "Invalid Settings!");
  12002. dgTimer = SetTimer("DG_AutoReset", dgTimerTime*60000, true);
  12003. format(string, sizeof(string), "You have enabled the auto reset feature. Settings: Timer: %d minute(s) | Amount: %d", dgTimerTime, dgAmount);
  12004. SendClientMessageEx(playerid, -1, string);
  12005. }
  12006. }
  12007. if(GetPVarInt(playerid, "dgInputSel") == 1)
  12008. {
  12009. new _time;
  12010. if(sscanf(inputtext, "d", _time) || _time <= 0) return ShowPlayerDialogEx(playerid, DIALOG_DGRAUTORESET, DIALOG_STYLE_INPUT, "Dynamic Giftbox Auto Reset - Timer", "Please enter a interval in minutes of when you want the giftbox to be automatically reset.", "Submit", "Close");
  12011. dgTimerTime = _time;
  12012. format(string, sizeof(string), "You have set the auto reset timer to: %d minute(s).", dgTimerTime);
  12013. SendClientMessageEx(playerid, -1, string);
  12014. }
  12015. if(GetPVarInt(playerid, "dgInputSel") == 2)
  12016. {
  12017. new _amount;
  12018. if(sscanf(inputtext, "d", _amount) || _amount <= 0) return ShowPlayerDialogEx(playerid, DIALOG_DGRAUTORESET, DIALOG_STYLE_INPUT, "Dynamic Giftbox Auto Reset - Amount", "Please enter a amount to be added to empty items when the giftbox is automatically reset.", "Submit", "Close");
  12019. dgAmount = _amount;
  12020. format(string, sizeof(string), "You have set the auto reset amount to: %d.", dgAmount);
  12021. SendClientMessageEx(playerid, -1, string);
  12022. }
  12023. return cmd_dgedit(playerid, "autoreset");
  12024. }
  12025. }
  12026. if(dialogid == DIALOG_MARRIAGE)
  12027. {
  12028. if(response)
  12029. {
  12030. SetPVarInt(playerid, "marriagelastname", 1);
  12031. SendClientMessageEx(playerid, -1, "You have chosen to keep your last name.");
  12032. }
  12033. else
  12034. {
  12035. SetPVarInt(playerid, "marriagelastname", 2);
  12036. SendClientMessageEx(playerid, -1, "You have chosen to take your spouse's last name.");
  12037. }
  12038. }
  12039. if(dialogid == FLAG_TRANSFER)
  12040. {
  12041. if(response)
  12042. {
  12043. GetPVarString(playerid, "FlagText", string, sizeof(string));
  12044. DeleteFlag(GetPVarInt(playerid, "Flag_Transfer_ID"), playerid);
  12045. format(string, sizeof(string), "%s [Transfered from: %s]", string, GetPlayerNameEx(GetPVarInt(playerid, "Flag_Transfer_From")));
  12046. AddFlag(GetPVarInt(playerid, "Flag_Transfer_To"), playerid, string);
  12047. format(string, sizeof(string), "You have successfully transferred FlagID: %d To: %s From: %s", GetPVarInt(playerid, "Flag_Transfer_ID"), GetPlayerNameEx(GetPVarInt(playerid, "Flag_Transfer_To")), GetPlayerNameEx(GetPVarInt(playerid, "Flag_Transfer_From")));
  12048. SendClientMessageEx(playerid, -1, string);
  12049. format(string, sizeof(string), "[TRANSFER] %s has transferred FlagID: %d To: %s(%d) From: %s(%d)", GetPlayerNameEx(playerid), GetPVarInt(playerid, "Flag_Transfer_ID"), GetPlayerNameEx(GetPVarInt(playerid, "Flag_Transfer_To")), GetPlayerSQLId(GetPVarInt(playerid, "Flag_Transfer_To")), GetPlayerNameEx(GetPVarInt(playerid, "Flag_Transfer_From")), GetPlayerSQLId(GetPVarInt(playerid, "Flag_Transfer_From")));
  12050. Log("logs/flags.log", string);
  12051. DeletePVar(playerid, "Flag_Transfer_ID");
  12052. DeletePVar(playerid, "Flag_Transfer_To");
  12053. DeletePVar(playerid, "Flag_Transfer_From");
  12054. DeletePVar(playerid, "FlagText");
  12055. }
  12056. else
  12057. {
  12058. DeletePVar(playerid, "Flag_Transfer_ID");
  12059. DeletePVar(playerid, "Flag_Transfer_To");
  12060. DeletePVar(playerid, "Flag_Transfer_From");
  12061. DeletePVar(playerid, "FlagText");
  12062. SendClientMessageEx(playerid, -1, "You have cancelled yourself from transferring the flag!");
  12063. }
  12064. }
  12065. if(dialogid == DIALOG_SETEXAMINE)
  12066. {
  12067. if(response)
  12068. {
  12069. if(isnull(inputtext)) return ShowPlayerDialogEx(playerid, DIALOG_SETEXAMINE, DIALOG_STYLE_INPUT, "Examine Description", "Please enter a description of yourself.\nExample: appears to be a white male, 6' 3 ..etc", "Set", "Cancel");
  12070. format(PlayerInfo[playerid][pExamineDesc], 128, "%s", inputtext);
  12071. }
  12072. else
  12073. {
  12074. SendClientMessageEx(playerid, -1, "You have cancelled yourself from setting your examine description.");
  12075. }
  12076. }
  12077. if(dialogid == DIALOG_HOLSTER && response)
  12078. {
  12079. if(listitem == 0)
  12080. {
  12081. GameTextForPlayer(playerid, "holstering", 1000, 6);
  12082. }
  12083. else
  12084. {
  12085. GameTextForPlayer(playerid, "unholstering", 1000, 6);
  12086. }
  12087. SetTimerEx("UnholsterWeapon", 1000, false, "ii", playerid, listitem);
  12088. }
  12089. if(dialogid == DIALOG_MICROSHOP)
  12090. {
  12091. if(response)
  12092. {
  12093. new stringg[512];
  12094. if(listitem == 0)
  12095. {
  12096. format(stringg, sizeof(stringg), "%s (Credits: {FFD700}%s{FFFFFF})\n%s (Credits: {FFD700}%s{FFFFFF})\nDouble EXP Tokens (Credits: {FFD700}%s{FFFFFF})", mItemName[0], number_format(MicroItems[0]), mItemName[1], number_format(MicroItems[1]), number_format(ShopItems[9][sItemPrice]));
  12097. ShowPlayerDialogEx(playerid, DIALOG_MICROSHOP2, DIALOG_STYLE_LIST, "Microtransaction Shop - Job & Experience", stringg, "Select", "Exit");
  12098. }
  12099. if(listitem == 1)
  12100. {
  12101. format(stringg, sizeof(stringg), "%s (Credits: {FFD700}%s{FFFFFF})\n%s (Credits: {FFD700}%s{FFFFFF})", mItemName[2], number_format(MicroItems[2]), mItemName[3], number_format(MicroItems[3]));
  12102. ShowPlayerDialogEx(playerid, DIALOG_MICROSHOP2, DIALOG_STYLE_LIST, "Microtransaction Shop - VIP", stringg, "Select", "Exit");
  12103. }
  12104. if(listitem == 2)
  12105. {
  12106. format(stringg, sizeof(stringg), "%s (Credits: {FFD700}%s{FFFFFF})", mItemName[4], number_format(MicroItems[4]));
  12107. ShowPlayerDialogEx(playerid, DIALOG_MICROSHOP2, DIALOG_STYLE_LIST, "Microtransaction Shop - Food", stringg, "Select", "Exit");
  12108. }
  12109. if(listitem == 3)
  12110. {
  12111. format(szMiscArray, sizeof(szMiscArray), "%s (Credits: {FFD700}%s{FFFFFF})\nHouse Move (Credits: {FFD700}%s{FFFFFF})\nHouse Interior Change (Credits: {FFD700}%s{FFFFFF})",
  12112. mItemName[6], number_format(MicroItems[6]), number_format(ShopItems[16][sItemPrice]), number_format(ShopItems[15][sItemPrice]));
  12113. format(szMiscArray, sizeof(szMiscArray), "%s\nFurniture Slots - Bronze Pack (25 slots) (Credits: {FFD700}%s{FFFFFF})\nFurniture Slots - Silver Pack (40 slots) (Credits: {FFD700}%s{FFFFFF})\n\
  12114. Furniture Slots - Gold Pack (50 slots) (Credits: {FFD700}%s{FFFFFF})", szMiscArray, number_format(ShopItems[41][sItemPrice]), number_format(ShopItems[42][sItemPrice]), number_format(ShopItems[43][sItemPrice]));
  12115. ShowPlayerDialogEx(playerid, DIALOG_MICROSHOP2, DIALOG_STYLE_LIST, "Microtransaction Shop - House", szMiscArray, "Select", "Exit");
  12116. }
  12117. if(listitem == 4)
  12118. {
  12119. format(stringg, sizeof(stringg), "%s (Credits: {FFD700}%s{FFFFFF})\n%s (Credits: {FFD700}%s{FFFFFF})\n%s (Credits: {FFD700}%s{FFFFFF})\nDeluxe Car Alarm (Credits: {FFD700}%s{FFFFFF})\nAdditional Vehicle Slots (Credits: {FFD700}%s{FFFFFF})",
  12120. mItemName[7], number_format(MicroItems[7]), mItemName[8], number_format(MicroItems[8]), mItemName[9], number_format(MicroItems[9]), number_format(ShopItems[39][sItemPrice]), number_format(ShopItems[23][sItemPrice]));
  12121. ShowPlayerDialogEx(playerid, DIALOG_MICROSHOP2, DIALOG_STYLE_LIST, "Microtransaction Shop - Vehicle", stringg, "Select", "Exit");
  12122. }
  12123. if(listitem == 5)
  12124. {
  12125. format(stringg, sizeof(stringg), "%s (Credits: {FFD700}%s{FFFFFF})\n%s (Credits: {FFD700}%s{FFFFFF})\n%s (Credits: {FFD700}%s{FFFFFF})\n%s (Credits: {FFD700}%s{FFFFFF})\
  12126. \nFireworks x5 (Credits: {FFD700}%s{FFFFFF})\n100 Paintball Tokens (Credits: {FFD700}%s{FFFFFF})\nAdditional Toy Slots (Credits: {FFD700}%s{FFFFFF})\n%s (Credits: {FFD700}%s{FFFFFF})\n%s (Credits: {FFD700}%s{FFFFFF})",
  12127. mItemName[10], number_format(MicroItems[10]), mItemName[12], number_format(MicroItems[12]), mItemName[13], number_format(MicroItems[13]), mItemName[5], number_format(MicroItems[5]), number_format(ShopItems[10][sItemPrice]),
  12128. number_format(ShopItems[8][sItemPrice]), number_format(ShopItems[28][sItemPrice]), mItemName[14], number_format(MicroItems[14]), mItemName[15], number_format(MicroItems[15])/*, mItemName[11], number_format(MicroItems[11])*/);
  12129. ShowPlayerDialogEx(playerid, DIALOG_MICROSHOP2, DIALOG_STYLE_LIST, "Microtransaction Shop - Miscellaneous", stringg, "Select", "Exit");
  12130. }
  12131. if(listitem == 6)
  12132. {
  12133. if(prezombie || zombieevent)
  12134. {
  12135. format(stringg, sizeof(stringg), "%s (Credits: {FFD700}%s{FFFFFF})\n%s (Credits: {FFD700}%s{FFFFFF})\n%s (Credits: {FFD700}%s{FFFFFF})\n%s (Credits: {FFD700}%s{FFFFFF})",
  12136. mItemName[16], number_format(MicroItems[16]), mItemName[17], number_format(MicroItems[17]), mItemName[18], number_format(MicroItems[18]), mItemName[19], number_format(MicroItems[19]));
  12137. ShowPlayerDialogEx(playerid, DIALOG_MICROSHOP2, DIALOG_STYLE_LIST, "Microtransaction Shop - Events", stringg, "Select", "Exit");
  12138. }
  12139. if(!strlen(stringg)) ShowPlayerDialogEx(playerid, DIALOG_NOTHING, DIALOG_STYLE_MSGBOX, "Microtransaction Shop - Events", "Nothing available to purchase at this time!", "Okay", "");
  12140. }
  12141. SetPVarInt(playerid, "m_listitem", listitem+1);
  12142. }
  12143. }
  12144. if(dialogid == DIALOG_MICROSHOP2)
  12145. {
  12146. if(!response) return cmd_microshop(playerid, "");
  12147. if(response)
  12148. {
  12149. new item;
  12150. switch(GetPVarInt(playerid, "m_listitem")-1)
  12151. {
  12152. case 0://Job & Experience
  12153. {
  12154. if(listitem == 0) item = 0;
  12155. if(listitem == 1) item = 1;
  12156. if(listitem == 2) item = 100;//EXP Token
  12157. }
  12158. case 1://VIP
  12159. {
  12160. if(listitem == 0) item = 2;
  12161. if(listitem == 1) item = 3;
  12162. }
  12163. case 2://Food
  12164. {
  12165. if(listitem == 0) item = 4;
  12166. }
  12167. case 3://House
  12168. {
  12169. if(listitem == 0) item = 6;
  12170. if(listitem == 1) item = 101;//House Move
  12171. if(listitem == 2) item = 102;//House Interior Change
  12172. if(listitem == 3) item = 108;//Furniture Bronze Pack
  12173. if(listitem == 4) item = 109;//Furniture Silver Pack
  12174. if(listitem == 5) item = 110;//Furniture Gold Pack
  12175. }
  12176. case 4://Vehicle
  12177. {
  12178. if(listitem == 0) item = 7;
  12179. if(listitem == 1) item = 8;
  12180. if(listitem == 2) item = 9;
  12181. if(listitem == 3) item = 103;//Deluxe Car Alarm
  12182. if(listitem == 4) item = 104;//Additional Vehicle Slot
  12183. }
  12184. case 5://Misc
  12185. {
  12186. if(listitem == 0) item = 10;
  12187. if(listitem == 1) item = 12;
  12188. if(listitem == 2) item = 13;
  12189. if(listitem == 3) item = 5;
  12190. if(listitem == 4) item = 105;//Fireworks x5
  12191. if(listitem == 5) item = 106;//100 Paintball Tokens
  12192. if(listitem == 6) item = 107;//Additional Toy Slot
  12193. if(listitem == 7) item = 14;
  12194. if(listitem == 8) item = 15;
  12195. //if(listitem == 9) item = 11; //Phone Change (TODO)
  12196. }
  12197. case 6://Event
  12198. {
  12199. if(listitem == 0) item = 16;
  12200. if(listitem == 1) item = 17;
  12201. if(listitem == 2) item = 18;
  12202. if(listitem == 3) item = 19;
  12203. }
  12204. }
  12205. if(item == 100)//EXP Token
  12206. {
  12207. SetPVarInt(playerid, "MiscShop", 4);
  12208. format(string, sizeof(string), "Item: Double EXP Token\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[9][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[9][sItemPrice]));
  12209. return ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Micro Shop", string, "Purchase", "Cancel");
  12210. }
  12211. if(item == 101)//House Move
  12212. {
  12213. format(string, sizeof(string),"Item: House Move\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[16][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[16][sItemPrice]));
  12214. return ShowPlayerDialogEx(playerid, DIALOG_HOUSESHOP4, DIALOG_STYLE_MSGBOX, "Micro Shop", string, "Purchase", "Cancel");
  12215. }
  12216. if(item == 102)//House Interior Change
  12217. {
  12218. format(string, sizeof(string),"Item: House Interior Change\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[15][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[15][sItemPrice]));
  12219. return ShowPlayerDialogEx(playerid, DIALOG_HOUSESHOP3, DIALOG_STYLE_MSGBOX, "Micro Shop", string, "Purchase", "Cancel");
  12220. }
  12221. if(item == 103)//Deluxe Car Alarm
  12222. {
  12223. SetPVarInt(playerid, "MiscShop", 18);
  12224. format(string, sizeof(string), "Item: Deluxe Car Alarm\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[39][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[39][sItemPrice]));
  12225. return ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Micro Shop", string, "Purchase", "Cancel");
  12226. }
  12227. if(item == 104)//Additional Vehicle Slot
  12228. {
  12229. SetPVarInt(playerid, "MiscShop", 7);
  12230. format(string, sizeof(string), "Item: Additional Vehicle Slot\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[23][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[23][sItemPrice]));
  12231. return ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Micro Shop", string, "Purchase", "Cancel");
  12232. }
  12233. if(item == 105)//Fireworks x5
  12234. {
  12235. SetPVarInt(playerid, "MiscShop", 5);
  12236. format(string, sizeof(string), "Item: Fireworks x5\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[10][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[10][sItemPrice]));
  12237. return ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Micro Shop", string, "Purchase", "Cancel");
  12238. }
  12239. if(item == 106)//100 Paintball Tokens
  12240. {
  12241. SetPVarInt(playerid, "MiscShop", 3);
  12242. format(string, sizeof(string), "Item: 100 Paintball Tokens\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[8][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[8][sItemPrice]));
  12243. return ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Micro Shop", string, "Purchase", "Cancel");
  12244. }
  12245. if(item == 107)//Additional Toy Slot
  12246. {
  12247. SetPVarInt(playerid, "MiscShop", 8);
  12248. format(string, sizeof(string), "Additional Toy Slot\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[28][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[28][sItemPrice]));
  12249. return ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Micro Shop", string, "Purchase", "Cancel");
  12250. }
  12251. if(item == 108)//Furniture Bronze
  12252. {
  12253. SetPVarInt(playerid, "MiscShop", 19);
  12254. format(string, sizeof(string), "Furniture Pack - Bronze (25 slots)\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[41][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[41][sItemPrice]));
  12255. return ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Micro Shop", string, "Purchase", "Cancel");
  12256. }
  12257. if(item == 109)//Furniture Silver
  12258. {
  12259. SetPVarInt(playerid, "MiscShop", 20);
  12260. format(string, sizeof(string), "Furniture Pack - Silver (40 slots)\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[42][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[42][sItemPrice]));
  12261. return ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Micro Shop", string, "Purchase", "Cancel");
  12262. }
  12263. if(item == 110)//Furniture Gold
  12264. {
  12265. SetPVarInt(playerid, "MiscShop", 21);
  12266. format(string, sizeof(string), "Furniture Pack - Bronze (50 slots)\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[43][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[43][sItemPrice]));
  12267. return ShowPlayerDialogEx(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Micro Shop", string, "Purchase", "Cancel");
  12268. }
  12269. SetPVarInt(playerid, "m_Item", item);
  12270. if(item == 0)//Change a Job
  12271. {
  12272. if(gettime() < PlayerInfo[playerid][mCooldown][item])
  12273. {
  12274. format(string, sizeof(string), "You have purchased this item 3 times in the past 24 hours, please wait %s to purchase it again.", ConvertTimeS(PlayerInfo[playerid][mCooldown][item]-gettime()));
  12275. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  12276. return cmd_microshop(playerid, "");
  12277. }
  12278. PlayerInfo[playerid][mCooldown][item] = 0;
  12279. return ShowPlayerDialogEx(playerid, 7484, DIALOG_STYLE_LIST, "Micro Shop: Job Center", "Detective\nLawyer\nWhore\nDrugs Dealer\nBodyguard\nMechanic\nArms Dealer\nBoxer\nDrugs Smuggler\nTaxi Driver\nCraftsman\nBartender\nShipment Contractor\nPizza Boy", "Proceed", "Cancel");
  12280. }
  12281. if(item == 1)//Job Boost
  12282. {
  12283. if(PlayerInfo[playerid][mPurchaseCount][item])
  12284. {
  12285. format(string, sizeof(string), "You currently have a active job boost, please wait for it to expire in %d minute(s) to purchase again.", PlayerInfo[playerid][mCooldown][item]);
  12286. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  12287. return cmd_microshop(playerid, "");
  12288. }
  12289. return ShowPlayerDialogEx(playerid, 7484, DIALOG_STYLE_LIST, "Micro Shop: Job Boost", "Detective\nLawyer\nWhore\nDrugs Dealer\nMechanic\nArms Dealer\nBoxer\nShipment Contractor", "Proceed", "Cancel");
  12290. }
  12291. if(item == 2)//Buddy Invites Reset
  12292. {
  12293. if(PlayerInfo[playerid][pDonateRank] < 2) return SendClientMessageEx(playerid, COLOR_GRAD2, "You must be Silver VIP+ to purchase this item.");
  12294. if(PlayerInfo[playerid][pBuddyInvites]) return SendClientMessageEx(playerid, COLOR_GRAD2, "You currently have Buddy Invites available, please use them before purchasing this item.");
  12295. if(gettime() < PlayerInfo[playerid][mCooldown][item])
  12296. {
  12297. format(string, sizeof(string), "You have purchased this item in the past 24 hours, please wait %s to purchase it again.", ConvertTimeS(PlayerInfo[playerid][mCooldown][item]-gettime()));
  12298. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  12299. return cmd_microshop(playerid, "");
  12300. }
  12301. PlayerInfo[playerid][mCooldown][item] = 0;
  12302. }
  12303. if(item == 3)//Buddy Invite Extension
  12304. {
  12305. if(!PlayerInfo[playerid][pBuddyInvited]) return SendClientMessageEx(playerid, COLOR_GRAD2, "You must be on a Buddy Invite to purchase this item.");
  12306. if(gettime() < PlayerInfo[playerid][mCooldown][item])
  12307. {
  12308. format(string, sizeof(string), "You have purchased this item 3 times in the past 24 hours, please wait %s to purchase it again.", ConvertTimeS(PlayerInfo[playerid][mCooldown][item]-gettime()));
  12309. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  12310. return cmd_microshop(playerid, "");
  12311. }
  12312. PlayerInfo[playerid][mCooldown][item] = 0;
  12313. }
  12314. if(item == 4)//Energy Bars
  12315. {
  12316. if(1 <= PlayerInfo[playerid][mInventory][4] <= 4)
  12317. {
  12318. format(string, sizeof(string), "You currently have %d energy bars on hand, they are sold in bulks of 4 which is also the max on hand.", PlayerInfo[playerid][mInventory][4]);
  12319. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  12320. if(!PlayerInfo[playerid][pBackpack]) SendClientMessageEx(playerid, COLOR_GRAD2, "If you would like to be able to hold more, purchase a backpack via /miscshop");
  12321. else SendClientMessageEx(playerid, COLOR_GRAD2, "As you have a backpack you can store your on hand energy bars and try again.");
  12322. return 1;
  12323. }
  12324. }
  12325. if(item == 6 && PlayerInfo[playerid][mInventory][item]) return SendClientMessageEx(playerid, COLOR_GRAD2, "You currently have a House Sale Sign in your inventory, please use it before purchasing another."); //House Sale Sign
  12326. if(item == 10)//Priority Ads
  12327. {
  12328. if(gettime() < PlayerInfo[playerid][mCooldown][item])
  12329. {
  12330. format(string, sizeof(string), "You have purchased this item 2 times in the past 24 hours, please wait %s to purchase it again.", ConvertTimeS(PlayerInfo[playerid][mCooldown][item]-gettime()));
  12331. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  12332. return cmd_microshop(playerid, "");
  12333. }
  12334. PlayerInfo[playerid][mCooldown][item] = 0;
  12335. }
  12336. if(item == 12)//Quick Bank Access
  12337. {
  12338. if(PlayerInfo[playerid][mPurchaseCount][item])
  12339. {
  12340. format(string, sizeof(string), "You currently have a active Quick Bank Access, please wait for it to expire in %d minute(s) to purchase again.", PlayerInfo[playerid][mCooldown][item]);
  12341. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  12342. return cmd_microshop(playerid, "");
  12343. }
  12344. }
  12345. if(item == 13)//Restricted Skin
  12346. {
  12347. if(gettime() < PlayerInfo[playerid][mCooldown][item])
  12348. {
  12349. format(string, sizeof(string), "You have purchased this item 3 times in the past 24 hours, please wait %s to purchase it again.", ConvertTimeS(PlayerInfo[playerid][mCooldown][item]-gettime()));
  12350. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  12351. return cmd_microshop(playerid, "");
  12352. }
  12353. PlayerInfo[playerid][mCooldown][item] = 0;
  12354. }
  12355. format(string, sizeof(string), "Item: %s\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", mItemName[item], number_format(PlayerInfo[playerid][pCredits]), number_format(MicroItems[item]), number_format(PlayerInfo[playerid][pCredits]-MicroItems[item]));
  12356. ShowPlayerDialogEx(playerid, DIALOG_MICROSHOP3, DIALOG_STYLE_MSGBOX, "Micro Shop", string, "Purchase", "Cancel");
  12357. }
  12358. }
  12359. if(dialogid == DIALOG_MICROSHOP3)
  12360. {
  12361. if(!response) return cmd_microshop(playerid, "");
  12362. if(response)
  12363. {
  12364. new item = GetPVarInt(playerid, "m_Item");
  12365. if(PlayerInfo[playerid][pCredits] < MicroItems[item]) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  12366. AmountSoldMicro[item]++;
  12367. AmountMadeMicro[item] += MicroItems[item];
  12368. new asString[128], amString[128];
  12369. for(new m; m < MAX_MICROITEMS; m++)
  12370. {
  12371. format(asString, sizeof(asString), "%s%d", asString, AmountSoldMicro[m]);
  12372. format(amString, sizeof(amString), "%s%d", amString, AmountMadeMicro[m]);
  12373. if(m != MAX_MICROITEMS-1) strcat(asString, "|"), strcat(amString, "|");
  12374. }
  12375. new szQuery[512];
  12376. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSoldMicro` = '%s', `AmountMadeMicro` = '%s' WHERE `Month` > NOW() - INTERVAL 1 MONTH", asString, amString);
  12377. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "i", SENDDATA_THREAD);
  12378. GivePlayerCredits(playerid, -MicroItems[item], 1);
  12379. printf("MicroPrice%d: %d", item, MicroItems[item]);
  12380. format(string, sizeof(string), "[MICROSHOP] [User: %s(%i)] [IP: %s] [Credits: %s] [%s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), mItemName[item], number_format(MicroItems[item]));
  12381. Log("logs/micro.log", string), print(string);
  12382. format(string, sizeof(string), "You have purchased \"%s\" for %s credits.", mItemName[item], number_format(MicroItems[item]));
  12383. SendClientMessageEx(playerid, COLOR_CYAN, string);
  12384. if(item == 0)//Change a Job
  12385. {
  12386. if(GetPVarInt(playerid, "m_Response") == 0) PlayerInfo[playerid][pJob] = GetPVarInt(playerid, "jobSelection"), SendClientMessageEx(playerid, COLOR_YELLOW, "You have changed your first job!");
  12387. if(GetPVarInt(playerid, "m_Response") == 1) PlayerInfo[playerid][pJob2] = GetPVarInt(playerid, "jobSelection"), SendClientMessageEx(playerid, COLOR_YELLOW, "You have changed your second job!");
  12388. if(GetPVarInt(playerid, "m_Response") == 2) PlayerInfo[playerid][pJob3] = GetPVarInt(playerid, "jobSelection"), SendClientMessageEx(playerid, COLOR_YELLOW, "You have changed your third job!");
  12389. PlayerInfo[playerid][mInventory][item]++;
  12390. if(++PlayerInfo[playerid][mPurchaseCount][item] == 3) PlayerInfo[playerid][mCooldown][item] = gettime()+86400, PlayerInfo[playerid][mPurchaseCount][item] = 0;
  12391. }
  12392. if(item == 1)//Job Boost
  12393. {
  12394. new skill;
  12395. switch(GetPVarInt(playerid, "jobSelection"))
  12396. { //Point to enum
  12397. case 1: skill = pInfo:pDetSkill;
  12398. case 2: skill = pInfo:pLawSkill;
  12399. case 3: skill = pInfo:pSexSkill;
  12400. case 4: skill = pInfo:pDrugsSkill;
  12401. case 7: skill = pInfo:pMechSkill;
  12402. case 9: skill = pInfo:pArmsSkill;
  12403. case 12: skill = pInfo:pBoxSkill;
  12404. case 20: skill = pInfo:pTruckSkill;
  12405. }
  12406. PlayerInfo[playerid][mBoost][0] = GetPVarInt(playerid, "jobSelection");
  12407. PlayerInfo[playerid][mBoost][1] = PlayerInfo[playerid][pInfo:skill];
  12408. PlayerInfo[playerid][pInfo:skill] = 401;
  12409. PlayerInfo[playerid][mPurchaseCount][item] = 1;//Set Active
  12410. PlayerInfo[playerid][mCooldown][item] = 120;//2 Hours
  12411. format(string, sizeof(string), "[JOBBOOST] %s(%d) Job: %s (%d) Skill: %d (%d)", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetJobName(GetPVarInt(playerid, "jobSelection")), GetPVarInt(playerid, "jobSelection"), PlayerInfo[playerid][mBoost][1], GetJobLevel(playerid, GetPVarInt(playerid, "jobSelection")));
  12412. Log("logs/micro.log", string);
  12413. format(string, sizeof(string), "Job Boost for the %s job is now active and will expire in 60 minutes.", GetJobName(GetPVarInt(playerid, "jobSelection")));
  12414. SendClientMessageEx(playerid, -1, string);
  12415. }
  12416. if(item == 2)//Buddy Invites Reset
  12417. {
  12418. PlayerInfo[playerid][pVIPInviteDay] = 0;
  12419. PlayerInfo[playerid][pBuddyInvites] += 3;
  12420. PlayerInfo[playerid][mCooldown][item] = gettime()+86400;
  12421. }
  12422. if(item == 3)//Buddy Invite Extension
  12423. {
  12424. PlayerInfo[playerid][pTempVIP] += 180;
  12425. if(++PlayerInfo[playerid][mPurchaseCount][item] == 3) PlayerInfo[playerid][mCooldown][item] = gettime()+86400, PlayerInfo[playerid][mPurchaseCount][item] = 0;
  12426. }
  12427. if(item == 4)//Energy Bars
  12428. {
  12429. PlayerInfo[playerid][mInventory][item] += 4;
  12430. SendClientMessageEx(playerid, -1, "To eat a energy bar type /eatbar");
  12431. }
  12432. if(item == 5)//Gift Reset Voucher
  12433. {
  12434. PlayerInfo[playerid][pGiftVoucher]++;
  12435. SendClientMessageEx(playerid, -1, "Use /myvouchers to access your gift reset voucher.");
  12436. }
  12437. if(item == 6)//House Sale Sign
  12438. {
  12439. PlayerInfo[playerid][mInventory][item] = 1;
  12440. SendClientMessageEx(playerid, -1, "To place down your sign type /placesign, To edit your sign type /editsign");
  12441. }
  12442. if(item == 7)//Fuel Canister
  12443. {
  12444. PlayerInfo[playerid][mInventory][item]++;
  12445. SendClientMessageEx(playerid, -1, "To use a fuel can get near a vehicle and type /fuelcan");
  12446. }
  12447. if(item == 8)//Jump Start
  12448. {
  12449. PlayerInfo[playerid][mInventory][item]++;
  12450. SendClientMessageEx(playerid, -1, "To jump start a vehicle type /jumpstart");
  12451. }
  12452. if(item == 9) //Restricted Car Colors
  12453. {
  12454. PlayerInfo[playerid][mInventory][item]++;
  12455. SendClientMessageEx(playerid, -1, "To paint a vehicle a restricted car color type /rcarcolor");
  12456. }
  12457. if(item == 10)//Priority Ads
  12458. {
  12459. PlayerInfo[playerid][pAdvertVoucher] += 3;
  12460. if(++PlayerInfo[playerid][mPurchaseCount][item] == 2) PlayerInfo[playerid][mCooldown][item] = gettime()+86400;
  12461. SendClientMessageEx(playerid, -1, "3 Advertisement vouchers have been added to your account.");
  12462. }
  12463. if(item == 11)//Number Change
  12464. {
  12465. //TODO
  12466. }
  12467. if(item == 12)//Quick Bank Access
  12468. {
  12469. PlayerInfo[playerid][mPurchaseCount][item] = 1;
  12470. PlayerInfo[playerid][mCooldown][item] = 15;
  12471. SendClientMessageEx(playerid, -1, "You can now use /balance /withdraw /deposit /wiretransfer from anywhere for 15 minutes.");
  12472. }
  12473. if(item == 13)//Restricted Skin
  12474. {
  12475. PlayerInfo[playerid][mInventory][item]++;
  12476. if(++PlayerInfo[playerid][mPurchaseCount][item] == 3) PlayerInfo[playerid][mCooldown][item] = gettime()+86400;
  12477. SendClientMessageEx(playerid, -1, "Head over to a clothing store and select any restricted skin.");
  12478. }
  12479. if(item == 14) AddFlag(playerid, INVALID_PLAYER_ID, "Dynamic Door Move (Credits)"), SendReportToQue(playerid, "Dynamic Door Move (Credits)", 2, 2), SendClientMessageEx(playerid, COLOR_CYAN, "Contact a senior admin to have the Dynamic Door Move issued.");
  12480. if(item == 15) AddFlag(playerid, INVALID_PLAYER_ID, "Dynamic Door Interior Change (Credits)"), SendReportToQue(playerid, "Dynamic Door Interior Change (Credits)", 2, 2), SendClientMessageEx(playerid, COLOR_CYAN, "Contact a senior admin to have the Dynamic Door Interior Change issued.");
  12481. if(item == 16)
  12482. {
  12483. SendClientMessageEx(playerid, -1, "Type /zscrapmetal to boost the vehicle health by 500 HP!");
  12484. PlayerInfo[playerid][mInventory][item]++;
  12485. }
  12486. if(item == 17)
  12487. {
  12488. SendClientMessageEx(playerid, -1, "Type /z50cal to use your .50 caliber ammo. Use the same command to toggle your .50 caliber ammo. This will only work for Rifles & Sniper Rifles");
  12489. PlayerInfo[playerid][mInventory][item] += 15;
  12490. }
  12491. if(item == 18)
  12492. {
  12493. SendClientMessageEx(playerid, -1, "Type /zinject to use the antibiotic.");
  12494. PlayerInfo[playerid][mPurchaseCount][item] += 3;
  12495. }
  12496. if(item == 19)
  12497. {
  12498. SendClientMessageEx(playerid, -1, "Type /zopenkit to open up the kit and see which variation of the Survivor kit you won.");
  12499. PlayerInfo[playerid][mInventory][item]++;
  12500. }
  12501. DeletePVar(playerid, "m_listitem");
  12502. DeletePVar(playerid, "m_Item");
  12503. DeletePVar(playerid, "m_Response");
  12504. }
  12505. }
  12506. if(dialogid == DIALOG_EDITMICROSHOP)
  12507. {
  12508. if(response)
  12509. {
  12510. if(!GetPVarType(playerid, "mEditingPrice"))
  12511. {
  12512. SetPVarInt(playerid, "mEditingPrice", listitem);
  12513. format(string, sizeof(string), "You are currently editing the price of %s. The current credit cost is %s.", mItemName[listitem], number_format(MicroItems[listitem]));
  12514. return ShowPlayerDialogEx(playerid, DIALOG_EDITMICROSHOP, DIALOG_STYLE_INPUT, "Editing Price", string, "Change", "Back");
  12515. }
  12516. else
  12517. {
  12518. if(!GetPVarType(playerid, "mEditingPriceValue"))
  12519. {
  12520. new price;
  12521. if(sscanf(inputtext, "d", price) || price <= 0)
  12522. {
  12523. format(string, sizeof(string), "The price can't be below 1.\n\nYou are currently editing the price of %s. The current credit cost is %s.", mItemName[GetPVarInt(playerid, "mEditingPrice")], number_format(MicroItems[GetPVarInt(playerid, "mEditingPrice")]));
  12524. return ShowPlayerDialogEx(playerid, DIALOG_EDITMICROSHOP, DIALOG_STYLE_INPUT, "Editing Price - Error", string, "Change", "Back");
  12525. }
  12526. else
  12527. {
  12528. SetPVarInt(playerid, "mEditingPriceValue", price);
  12529. format(string,sizeof(string),"Are you sure you want to edit the cost of %s?\n\nOld Cost: %s\nNew Cost: %s", mItemName[GetPVarInt(playerid, "mEditingPrice")], number_format(MicroItems[GetPVarInt(playerid, "mEditingPrice")]), number_format(price));
  12530. return ShowPlayerDialogEx(playerid, DIALOG_EDITMICROSHOP, DIALOG_STYLE_MSGBOX, "Confirmation", string, "Confirm", "Cancel");
  12531. }
  12532. }
  12533. else
  12534. {
  12535. if(GetPVarInt(playerid, "mEditingPriceValue") == 0) SetPVarInt(playerid, "mEditingPriceValue", 999999);
  12536. MicroItems[GetPVarInt(playerid, "mEditingPrice")] = GetPVarInt(playerid, "mEditingPriceValue");
  12537. format(string, sizeof(string), "You have successfully edited the price of %s to %s.", mItemName[GetPVarInt(playerid, "mEditingPrice")], number_format(GetPVarInt(playerid, "mEditingPriceValue")));
  12538. SendClientMessageEx(playerid, COLOR_WHITE, string);
  12539. format(string, sizeof(string), "[EDITMICROSHOPPRICES] [User: %s(%i)] [IP: %s] [%s] [Price: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), mItemName[GetPVarInt(playerid, "mEditingPrice")], number_format(MicroItems[GetPVarInt(playerid, "mEditingPrice")]));
  12540. Log("logs/editshop.log", string), print(string);
  12541. g_mysql_SavePrices();
  12542. DeletePVar(playerid, "mEditingPrice");
  12543. DeletePVar(playerid, "mEditingPriceValue");
  12544. }
  12545. }
  12546. }
  12547. else
  12548. {
  12549. if(GetPVarType(playerid, "mEditingPriceValue")) SendClientMessageEx(playerid, COLOR_GREY, "You have canceled the price change.");
  12550. DeletePVar(playerid, "mEditingPrice");
  12551. DeletePVar(playerid, "mEditingPriceValue");
  12552. }
  12553. }
  12554. if(dialogid == DIALOG_WEPVEHSALE)
  12555. {
  12556. if(response)
  12557. {
  12558. new alarmstring[9], lockstring[11], worklockstring[10];
  12559. new giveplayerid = GetPVarInt(playerid, "WepVehSalePlayer");
  12560. new price = GetPVarInt(playerid, "WepVehSalePrice");
  12561. new d = GetPVarInt(playerid, "WepVehSaleVehicle");
  12562. new fine = GetPVarInt(playerid, "WepVehSaleFine");
  12563. SetPVarInt(playerid, "LastTransaction", gettime());
  12564. VehicleOffer[giveplayerid] = playerid;
  12565. VehicleId[giveplayerid] = d;
  12566. VehiclePrice[giveplayerid] = price;
  12567. switch(PlayerVehicleInfo[playerid][d][pvAlarm]) {
  12568. case 1: alarmstring = "Standard";
  12569. case 2: alarmstring = "Deluxe";
  12570. default: alarmstring = "no";
  12571. }
  12572. switch(PlayerVehicleInfo[playerid][d][pvLock]) {
  12573. case 2: lockstring = "Electronic";
  12574. case 3: lockstring = "Industrial";
  12575. default: lockstring = "no";
  12576. }
  12577. if(PlayerVehicleInfo[playerid][d][pvLocksLeft] < 1) worklockstring = "(Broken)";
  12578. format(string, sizeof(string), "* [WEPVEHICLE] You offered %s to buy this %s with %s Alarm & %s%s Lock for $%s with a %s fine.", GetPlayerNameEx(giveplayerid), GetVehicleName(PlayerVehicleInfo[playerid][d][pvId]), alarmstring, worklockstring, lockstring, number_format(price), number_format(fine));
  12579. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  12580. format(string, sizeof(string), "* [WEPVEHICLE] %s has offered you their %s (VID: %d) with %s Alarm & %s%s Lock for $%s, (type /accept car) to buy.", GetPlayerNameEx(playerid), GetVehicleName(PlayerVehicleInfo[playerid][d][pvId]), PlayerVehicleInfo[playerid][d][pvId], alarmstring, worklockstring, lockstring, number_format(price));
  12581. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  12582. DeletePVar(playerid, "confirmvehsell");
  12583. }
  12584. else
  12585. {
  12586. SendClientMessageEx(playerid, COLOR_GREY, "You have canceled the weaponized vehicle sale. You will not be fined.");
  12587. DeletePVar(playerid, "WepVehSalePlayer");
  12588. DeletePVar(playerid, "WepVehSaleVehicle");
  12589. DeletePVar(playerid, "WepVehSalePrice");
  12590. DeletePVar(playerid, "WepVehSaleFine");
  12591. }
  12592. }
  12593. if(dialogid == DIALOG_REPORT_HSIGN)
  12594. {
  12595. new Player = GetPVarInt(playerid, "hSignTextChange");
  12596. if(!GetPVarType(Player, "hSignRequest")) return SendClientMessageEx(playerid, COLOR_GREY, "That person isn't requesting a namechange!");
  12597. if(response)
  12598. {
  12599. new desc[64], escapeDesc[66];
  12600. GetPVarString(Player, "hSignRequestText", desc, 64);
  12601. mysql_escape_string(desc, escapeDesc);
  12602. format(HouseInfo[GetPVarInt(Player, "hSignRequest")][hSignDesc], 64, "%s", escapeDesc);
  12603. SaveHouse(GetPVarInt(Player, "hSignRequest"));
  12604. SendClientMessageEx(Player, COLOR_YELLOW, "Your house sale sign text has been approved.");
  12605. format(string, sizeof(string), " You have approved %s's house sale sign text change on House ID: %d", GetPlayerNameEx(Player), GetPVarInt(Player, "hSignRequest"));
  12606. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  12607. format(string, sizeof(string), "%s changed House ID: %d sale sign text to \"%s\", owned by: %s(%d)", GetPlayerNameEx(playerid), GetPVarInt(Player, "hSignRequest"), desc, GetPlayerNameEx(Player), GetPlayerSQLId(Player));
  12608. Log("logs/house.log", string);
  12609. format(string, sizeof(string), "%s has approved %s's house sale sign text on House ID: %d", GetPlayerNameEx(playerid), GetPlayerNameEx(Player), GetPVarInt(Player, "hSignRequest"));
  12610. ABroadCast(COLOR_YELLOW, string, 2);
  12611. }
  12612. else
  12613. {
  12614. SendClientMessageEx(Player, COLOR_YELLOW, "Your request to modify your house sale sign text has been denied.");
  12615. format(string, sizeof(string), " You have denied %s's house sale sign text modification request.", GetPlayerNameEx(Player));
  12616. SendClientMessageEx(playerid,COLOR_YELLOW,string);
  12617. format(string, sizeof(string), "%s has denied %s's house sale sign text modification request", GetPlayerNameEx(playerid), GetPlayerNameEx(Player));
  12618. ABroadCast(COLOR_YELLOW, string, 2);
  12619. }
  12620. DeletePVar(Player, "hSignRequest");
  12621. DeletePVar(Player, "hSignTextChange");
  12622. }
  12623. if(dialogid == DIALOG_ENERGYBARS)
  12624. {
  12625. if(response)
  12626. {
  12627. if(!IsBackpackAvailable(playerid)) {
  12628. DeletePVar(playerid, "BackpackOpen"), DeletePVar(playerid, "BackpackProt"), SendClientMessageEx(playerid, COLOR_GREY, "You cannot use your backpack at this moment.");
  12629. return 1;
  12630. }
  12631. if(!GetPVarType(playerid, "bnwd"))
  12632. {
  12633. SetPVarInt(playerid, "bnwd", listitem);
  12634. return ShowBackpackMenu(playerid, DIALOG_ENERGYBARS*2, "");
  12635. }
  12636. new str[148];
  12637. if(GetPVarInt(playerid, "bnwd"))//Deposit
  12638. {
  12639. new amount, maxbars;
  12640. switch(PlayerInfo[playerid][pBackpack])
  12641. {
  12642. case 1: maxbars = 8;
  12643. case 2: maxbars = 12;
  12644. case 3: maxbars = 16;
  12645. }
  12646. if(sscanf(inputtext, "d", amount)) return ShowBackpackMenu(playerid, DIALOG_ENERGYBARS*2, "{B20400}Wrong input{A9C4E4}");
  12647. if(amount < 1) return ShowBackpackMenu(playerid, DIALOG_ENERGYBARS*2, "{B20400}Wrong input{A9C4E4}\nYou cannot put the amount less than 1");
  12648. if(amount > maxbars-PlayerInfo[playerid][pBItems][11])
  12649. {
  12650. format(str, sizeof(str), "{B20400}Wrong input, you can only store %d Energy Bars{A9C4E4}\nEnergy Bars available left to store {FFF600}%d{A9C4E4}", maxbars, maxbars-PlayerInfo[playerid][pBItems][11]);
  12651. return ShowBackpackMenu(playerid, DIALOG_ENERGYBARS*2, str);
  12652. }
  12653. if(PlayerInfo[playerid][mInventory][4] >= amount) PlayerInfo[playerid][mInventory][4] -= amount;
  12654. else return ShowBackpackMenu(playerid, DIALOG_ENERGYBARS*2, "{B20400}Wrong input{A9C4E4}\nYou don't have that many Energy Bars");
  12655. PlayerInfo[playerid][pBItems][11] += amount;
  12656. format(string, sizeof(string), "You have deposited %d energy bars in your backpack.", amount);
  12657. SendClientMessageEx(playerid, COLOR_WHITE, string);
  12658. format(string, sizeof(string), "[EBARS] %s(%d) (IP:%s) deposited %d energy bars (%d bars Total) [BACKPACK %d]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), amount, PlayerInfo[playerid][pBItems][11], PlayerInfo[playerid][pBackpack]);
  12659. Log("logs/backpack.log", string);
  12660. }
  12661. else//Withdraw
  12662. {
  12663. new amount;
  12664. if(sscanf(inputtext, "d", amount)) return ShowBackpackMenu(playerid, DIALOG_ENERGYBARS*2, "{B20400}Wrong input{A9C4E4}");
  12665. if(amount < 1) return ShowBackpackMenu(playerid, DIALOG_ENERGYBARS*2, "{B20400}Wrong input{A9C4E4}\nYou cannot put the amount less than 1");
  12666. if(amount > PlayerInfo[playerid][pBItems][11])
  12667. {
  12668. format(str, sizeof(str), "{B20400}Wrong input, you only have %d Energy Bars{A9C4E4}\nEnergy Bars trying to withdraw {FFF600}%d{A9C4E4}", PlayerInfo[playerid][pBItems][11], amount);
  12669. return ShowBackpackMenu(playerid, DIALOG_ENERGYBARS*2, str);
  12670. }
  12671. PlayerInfo[playerid][pBItems][11] -= amount;
  12672. PlayerInfo[playerid][mInventory][4] += amount;
  12673. format(string, sizeof(string), "You have withdrawn %d energy bars from your backpack.", amount);
  12674. SendClientMessageEx(playerid, COLOR_WHITE, string);
  12675. format(string, sizeof(string), "[EBARS] %s(%d) (IP:%s) withdrawn %d energy bars (%d bars Total) [BACKPACK %d]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), amount, PlayerInfo[playerid][pBItems][11], PlayerInfo[playerid][pBackpack]);
  12676. Log("logs/backpack.log", string);
  12677. }
  12678. ShowBackpackMenu(playerid, DIALOG_ENERGYBARS, "- {02B0F5}Energy Bars");
  12679. }
  12680. else
  12681. {
  12682. if(GetPVarType(playerid, "bnwd")) ShowBackpackMenu(playerid, DIALOG_ENERGYBARS, "- {02B0F5}Energy Bars");
  12683. else ShowBackpackMenu(playerid, DIALOG_OBACKPACK, "");
  12684. }
  12685. }
  12686. if(dialogid == DIALOG_MANAGECREDITS)
  12687. {
  12688. if(!response) return 1;
  12689. SetPVarInt(playerid, "ManageCreditsDiag", listitem);
  12690. switch(listitem) {
  12691. case 0: {
  12692. if(SellClosed)
  12693. ShowPlayerDialogEx(playerid, DIALOG_MANAGECREDITS2, DIALOG_STYLE_MSGBOX, "Sale of Credits", "Would you like ENABLE the selling of credits?", "Okay", "Cancel");
  12694. else
  12695. ShowPlayerDialogEx(playerid, DIALOG_MANAGECREDITS2, DIALOG_STYLE_MSGBOX, "Sale of Credits", "Would you like DISABLE the selling of credits?", "Okay", "Cancel");
  12696. }
  12697. case 1: {
  12698. if(!freeweekend)
  12699. ShowPlayerDialogEx(playerid, DIALOG_MANAGECREDITS2, DIALOG_STYLE_MSGBOX, "Sale of Credits", "Would you like ENABLE the free weekend?", "Okay", "Cancel");
  12700. else
  12701. ShowPlayerDialogEx(playerid, DIALOG_MANAGECREDITS2, DIALOG_STYLE_MSGBOX, "Sale of Credits", "Would you like DISABLE the free weekend?", "Okay", "Cancel");
  12702. }
  12703. case 2: {
  12704. if(!nonvipcredits)
  12705. ShowPlayerDialogEx(playerid, DIALOG_MANAGECREDITS2, DIALOG_STYLE_MSGBOX, "Sale of Credits", "Would you like ENABLE the selling of credits for NON-VIPs?", "Okay", "Cancel");
  12706. else
  12707. ShowPlayerDialogEx(playerid, DIALOG_MANAGECREDITS2, DIALOG_STYLE_MSGBOX, "Sale of Credits", "Would you like DISABLE the selling of credits for NON-VIPs?", "Okay", "Cancel");
  12708. }
  12709. }
  12710. }
  12711. if(dialogid == DIALOG_MANAGECREDITS2)
  12712. {
  12713. if(!response) return 1;
  12714. switch(GetPVarInt(playerid, "ManageCreditsDiag")) {
  12715. case 0: {
  12716. if(!SellClosed) SellClosed = 1, SendClientMessageEx(playerid, COLOR_WHITE, "Selling of credits disabled.");
  12717. else SellClosed = 0, SendClientMessageEx(playerid, COLOR_WHITE, "Selling of credits enabled.");
  12718. }
  12719. case 1: {
  12720. if(!freeweekend) freeweekend = 1, SendClientMessageEx(playerid, COLOR_WHITE, "Free weekend enabled.");
  12721. else freeweekend = 0, SendClientMessageEx(playerid, COLOR_WHITE, "Free weekend disabled.");
  12722. }
  12723. case 2: {
  12724. if(!nonvipcredits) nonvipcredits = 1, SendClientMessageEx(playerid, COLOR_WHITE, "Selling of credits for Non-VIPs enabled.");
  12725. else nonvipcredits = 0, SendClientMessageEx(playerid, COLOR_WHITE, "Selling of credits for Non-VIPs disabled.");
  12726. }
  12727. }
  12728. }
  12729. if(dialogid == DIALOG_MEDIC_LIST) {
  12730. if(response) Medic_GetPatient(playerid, ListItemTrackId[playerid][listitem]);
  12731. }
  12732. return 0;
  12733. }