admin.pwn 264 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Admin System
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. #define ADMIN_JUNIOR 2
  34. #define ADMIN_GENERAL 3
  35. #define ADMIN_SENIOR 4
  36. #define ADMIN_HEAD 1337
  37. #define ADMIN_EXECUTIVE 99999
  38. stock IsAdminLevel(playerid, level, warning = 1) {
  39. if(PlayerInfo[playerid][pAdmin] >= level) return 1;
  40. if(warning) SendClientMessage(playerid, COLOR_GRAD1, "You do not have the authority to use this command.");
  41. return 0;
  42. }
  43. stock ABroadCast(hColor, szMessage[], iLevel, bool: bUndercover = false, bool: Discord = true)
  44. {
  45. foreach(new i: Player) {
  46. if(PlayerInfo[i][pAdmin] >= iLevel && (bUndercover || !PlayerInfo[i][pTogReports])) {
  47. SendClientMessageEx(i, hColor, szMessage);
  48. }
  49. }
  50. //if(!Discord && iLevel <= 2) SendDiscordMessage(0, szMessage);
  51. if(strfind(szMessage, "AdmWarning", false) != -1)
  52. {
  53. StripColorEmbedding(szMessage);
  54. //SendDiscordMessage(1, szMessage); // Route AdmWarnings to Discord
  55. }
  56. return 1;
  57. }
  58. stock ShopTechBroadCast(color,string[])
  59. {
  60. foreach(new i: Player)
  61. {
  62. if ((PlayerInfo[i][pShopTech] >= 1 || PlayerInfo[i][pAdmin] >= 1338) && PlayerInfo[i][pTogReports] == 0)
  63. {
  64. SendClientMessageEx(i, color, string);
  65. }
  66. }
  67. return 1;
  68. }
  69. stock Player_KillCheckPoint(playerid) {
  70. if(PlayerInfo[playerid][pTut] != -1) {
  71. SendClientMessageEx(playerid, COLOR_GREY, "-----------------------------");
  72. SendClientMessageEx(playerid, COLOR_WHITE, "You have canceled the objectives tutorial. Welcome to Next Generation Gaming!");
  73. SendClientMessageEx(playerid, COLOR_GREY, "-----------------------------");
  74. PlayerInfo[playerid][pTut] = -1;
  75. }
  76. gPlayerCheckpointStatus[playerid] = CHECKPOINT_NOTHING;
  77. ClearCheckpoint(playerid);
  78. DisablePlayerCheckpoint(playerid);
  79. SendClientMessageEx(playerid,COLOR_WHITE, "All current checkpoints, trackers and accepted fares have been reset.");
  80. }
  81. stock GetAdminRankName(i)
  82. {
  83. switch(i)
  84. {
  85. case 2: format(szMiscArray, sizeof(szMiscArray), "Junior Administrator");
  86. case 3: format(szMiscArray, sizeof(szMiscArray), "General Administrator");
  87. case 4: format(szMiscArray, sizeof(szMiscArray), "Senior Administrator");
  88. case 1337: format(szMiscArray, sizeof(szMiscArray), "Head Administrator");
  89. case 99999: format(szMiscArray, sizeof(szMiscArray), "Executive Administrator");
  90. default: format(szMiscArray, sizeof(szMiscArray), "Undefined Administrator (%i)", i);
  91. }
  92. return szMiscArray;
  93. }
  94. stock StaffAccountCheck(playerid, ip[])
  95. {
  96. mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "SELECT NULL FROM `accounts` WHERE (`IP` = '%s' OR `SecureIP` = '%s') AND `AdminLevel` > 0", ip, ip);
  97. mysql_tquery(MainPipeline, szMiscArray, "OnStaffAccountCheck", "i", playerid);
  98. }
  99. stock GetStaffRank(playerid)
  100. {
  101. if(PlayerInfo[playerid][pSEC] > 0)
  102. {
  103. switch(PlayerInfo[playerid][pSEC])
  104. {
  105. case 1: szMiscArray = "{00FA9A}Regular Coordinator{FFFFFF}";
  106. case 2: szMiscArray = "{00FA9A}Senior Coordinator{FFFFFF}";
  107. case 3: szMiscArray = "{00FA9A}Assistant Chairman{FFFFFF}";
  108. case 4: szMiscArray = "{00FA9A}Deputy Chairman{FFFFFF}";
  109. case 5: szMiscArray = "{00FA9A}Chairman{FFFFFF}";
  110. }
  111. }
  112. if(PlayerInfo[playerid][pWatchdog] > 0)
  113. {
  114. switch(PlayerInfo[playerid][pWatchdog])
  115. {
  116. case 1: szMiscArray = "{2267F0}Watchdog{FFFFFF}";
  117. case 2: szMiscArray = "{2267F0}Senior Watchdog{FFFFFF}";
  118. case 3: szMiscArray = "{2267F0}RP Specialist{FFFFFF}";
  119. case 4: szMiscArray = "{2267F0}Director of RP Improvement{FFFFFF}";
  120. }
  121. }
  122. if(PlayerInfo[playerid][pHelper] > 0)
  123. {
  124. switch(PlayerInfo[playerid][pHelper])
  125. {
  126. case 1: szMiscArray = "{6495ED}Helper{FFFFFF}";
  127. case 2: szMiscArray = "{00FFFF}Community Advisor{FFFFFF}";
  128. case 3: szMiscArray = "{00FFFF}Senior Advisor{FFFFFF}";
  129. case 4: szMiscArray = "{00FFFF}Chief Advisor{FFFFFF}";
  130. }
  131. }
  132. if(PlayerInfo[playerid][pAdmin] == 1)
  133. {
  134. switch(PlayerInfo[playerid][pSMod])
  135. {
  136. case 0: szMiscArray = "{FFFF00}Server Moderator{FFFFFF}";
  137. case 1: szMiscArray = "{FFFF00}Senior Server Moderator{FFFFFF}";
  138. }
  139. }
  140. if(PlayerInfo[playerid][pAdmin] > 1)
  141. {
  142. switch(PlayerInfo[playerid][pAdmin])
  143. {
  144. case 2: szMiscArray = "{00FF00}Junior Administrator{FFFFFF}";
  145. case 3: szMiscArray = "{00FF00}General Administrator{FFFFFF}";
  146. case 4: szMiscArray = "{F4A460}Senior Administrator{FFFFFF}";
  147. case 1337: szMiscArray = "{FF0000}Head Administrator{FFFFFF}";
  148. case 99999: szMiscArray = "{298EFF}Executive Administrator{FFFFFF}";
  149. default: format(szMiscArray, sizeof(szMiscArray), "Undefined Administrator (%d)", PlayerInfo[playerid][pAdmin]);
  150. }
  151. }
  152. return szMiscArray;
  153. }
  154. CMD:resetvw(playerid, params[])
  155. {
  156. if(GetPVarType(playerid, "IsInArena")) return 1;
  157. SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
  158. SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
  159. SendClientMessageEx(playerid, COLOR_WHITE, "Your virtual and interior world have been synced with the server. You might be desynced though - please relog.");
  160. return 1;
  161. }
  162. CMD:id(playerid, params[]) {
  163. if(isnull(params)) {
  164. return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /id [player name]");
  165. }
  166. new
  167. szMessage[128],
  168. szPlayerName[MAX_PLAYER_NAME],
  169. iTargetID = strval(params);
  170. if(IsNumeric(params) && IsPlayerConnected(strval(params)))
  171. {
  172. if(PlayerInfo[playerid][pAdmin] >= 2) format(szMessage, sizeof szMessage, "%s (ID: %d · Hours: %s · Ping: %d · FPS: %d · Packet Loss: %.2f)", GetPlayerNameEx(iTargetID), iTargetID, number_format(PlayerInfo[iTargetID][pConnectHours]), GetPlayerPing(iTargetID), GetPlayerFPS(iTargetID), GetPlayerPacketLoss(iTargetID));
  173. else format(szMessage, sizeof szMessage, "%s (ID: %d · Level: %d · Ping: %d)", GetPlayerNameEx(iTargetID), iTargetID, GetPlayerScore(iTargetID), GetPlayerPing(iTargetID));
  174. return SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
  175. }
  176. else if(strlen(params) < 3) {
  177. return SendClientMessageEx(playerid, COLOR_GREY, "Input at least 3 characters to search.");
  178. }
  179. else foreach(new i: Player)
  180. {
  181. GetPlayerName(i, szPlayerName, sizeof szPlayerName);
  182. if(strfind(szPlayerName, params, true) != -1) {
  183. if(PlayerInfo[playerid][pAdmin] >= 2) format(szMessage, sizeof szMessage, "%s (ID: %d · Hours: %s · Ping: %d · FPS: %d · Packet Loss: %.2f)", GetPlayerNameEx(i), i, number_format(PlayerInfo[i][pConnectHours]), GetPlayerPing(i), GetPlayerFPS(i), GetPlayerPacketLoss(i));
  184. else format(szMessage, sizeof szMessage, "%s (ID: %d · Level: %d · Ping: %d)", GetPlayerNameEx(i), i, GetPlayerScore(i), GetPlayerPing(i));
  185. SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
  186. }
  187. }
  188. return 1;
  189. }
  190. CMD:near(playerid, params[])
  191. {
  192. if(PlayerInfo[playerid][pAdmin] >= 2)
  193. {
  194. new radius;
  195. if(sscanf(params, "d", radius)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /near [radius]");
  196. if(radius < 1 || radius > 100) return SendClientMessageEx(playerid, COLOR_GREY, "Radius must be higher than 0 and lower than 100!");
  197. format(szMiscArray, sizeof(szMiscArray), "Players within a %d block radius", radius);
  198. SendClientMessageEx(playerid, COLOR_GRAD5, szMiscArray);
  199. foreach(new i: Player)
  200. {
  201. if(i != playerid && ProxDetectorS(radius, playerid, i))
  202. {
  203. format(szMiscArray, sizeof(szMiscArray), "%s (ID: %d - Hours: %s)", GetPlayerNameEx(i), i, number_format(PlayerInfo[i][pConnectHours]));
  204. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  205. }
  206. }
  207. }
  208. else return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  209. return 1;
  210. }
  211. CMD:givegun(playerid, params[])
  212. {
  213. if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1) {
  214. new playa, gun;
  215. if(sscanf(params, "udd", playa, gun)) {
  216. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /givegun [player] [weaponid]");
  217. SendClientMessageEx(playerid, COLOR_GREEN, "_______________________________________");
  218. SendClientMessageEx(playerid, COLOR_GRAD4, "(1)Brass Knuckles (2)Golf Club (3)Nite Stick (4)Knife (5)Baseball Bat (6)Shovel (7)Pool Cue (8)Katana (9)Chainsaw");
  219. SendClientMessageEx(playerid, COLOR_GRAD4, "(10)Purple Dildo (11)Small White Vibrator (12)Large White Vibrator (13)Silver Vibrator (14)Flowers (15)Cane (16)Frag Grenade");
  220. SendClientMessageEx(playerid, COLOR_GRAD3, "(17)Tear Gas (18)Molotov Cocktail (21)Jetpack (22)9mm (23)Silenced 9mm (24)Desert Eagle (25)Shotgun (26)Sawnoff Shotgun");
  221. SendClientMessageEx(playerid, COLOR_GRAD4, "(27)Combat Shotgun (28)Micro SMG (Mac 10) (29)SMG (MP5) (30)AK-47 (31)M4 (32)Tec9 (33)Rifle (34)Sniper Rifle");
  222. SendClientMessageEx(playerid, COLOR_GRAD4, "(35)Rocket Launcher (36)HS Rocket Launcher (37)Flamethrower (38)Minigun (39)Satchel Charge (40)Detonator");
  223. SendClientMessageEx(playerid, COLOR_GRAD4, "(41)Spraycan (42)Fire Extinguisher (43)Camera (44)Nightvision Goggles (45)Infared Goggles (46)Parachute");
  224. SendClientMessageEx(playerid, COLOR_GREEN, "_______________________________________");
  225. return 1;
  226. }
  227. format(szMiscArray, sizeof(szMiscArray), "You have given %s gun ID %d!", GetPlayerNameEx(playa), gun);
  228. if(gun < 1||gun > 47)
  229. { SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid weapon ID!"); return 1; }
  230. if(IsPlayerConnected(playa))
  231. {
  232. if((PlayerInfo[playa][pConnectHours] < 2 || PlayerInfo[playa][pWRestricted] > 0) && gun != 46 && gun != 43) return SendClientMessageEx(playerid, COLOR_GRAD2, "That person is currently restricted from carrying weapons");
  233. if(PlayerInfo[playa][pAccountRestricted] != 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot do this to someone that has his account restricted!");
  234. if(playa != INVALID_PLAYER_ID && gun <= 20 || gun >= 22) {
  235. PlayerInfo[playa][pGuns][GetWeaponSlot(gun)] = gun;
  236. GivePlayerValidWeapon(playa, gun);
  237. SendClientMessageEx(playerid, COLOR_GRAD1, szMiscArray);
  238. }
  239. else if(playa != INVALID_PLAYER_ID && gun == 21) {
  240. JetPack[playa] = 1;
  241. SetPlayerSpecialAction(playa, SPECIAL_ACTION_USEJETPACK);
  242. SendClientMessageEx(playerid, COLOR_GRAD1, szMiscArray);
  243. }
  244. format(szMiscArray, sizeof(szMiscArray), "%s(%s) has given %s(%d) (%s) a %s(%d)", GetPlayerNameEx(playerid), GetPlayerIpEx(playerid), GetPlayerNameEx(playa), GetPlayerSQLId(playa), GetPlayerIpEx(playa), GetWeaponNameEx(gun), gun);
  245. Log("logs/admingive.log", szMiscArray);
  246. }
  247. }
  248. else {
  249. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  250. }
  251. return 1;
  252. }
  253. CMD:givedrug(playerid, params[])
  254. {
  255. if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  256. {
  257. new id, drugstring[16], amount;
  258. if(sscanf(params, "us[16]d", id, drugstring, amount))
  259. {
  260. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /givedrug [player] [drug] [amount]");
  261. ListDrugs(playerid);
  262. return 1;
  263. }
  264. new drug = GetDrugID(drugstring);
  265. if(drug == -1)
  266. {
  267. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /givedrug [player] [drug] [amount]");
  268. ListDrugs(playerid);
  269. return 1;
  270. }
  271. if(IsPlayerConnected(id))
  272. {
  273. PlayerInfo[id][pDrugs][drug] += amount;
  274. format(szMiscArray, sizeof(szMiscArray), "You have given %s drug %s (%dg)!", GetPlayerNameEx(id), GetDrugName(drug), amount);
  275. SendClientMessageEx(playerid, COLOR_GRAD1, szMiscArray);
  276. format(szMiscArray, sizeof(szMiscArray), "%s(%s) has given %s(%d) (%s) some %s(%dg)", GetPlayerNameEx(playerid), GetPlayerIpEx(playerid), GetPlayerNameEx(id), GetPlayerSQLId(id), GetPlayerIpEx(id), GetDrugName(drug), amount);
  277. Log("logs/admingive.log", szMiscArray);
  278. }
  279. else return SendClientMessage(playerid, COLOR_GRAD1, "That player is not connected.");
  280. }
  281. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  282. return 1;
  283. }
  284. CMD:jetpack(playerid, params[])
  285. {
  286. new plo;
  287. if((PlayerInfo[playerid][pAdmin] >= 2) && sscanf(params, "u", plo)) {
  288. JetPack[playerid] = 1;
  289. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
  290. return 1;
  291. }
  292. else if(PlayerInfo[playerid][pAdmin] >= 4 && !sscanf(params, "u", plo) || PlayerInfo[playerid][pASM] >= 1 && !sscanf(params, "u", plo))
  293. {
  294. if (IsPlayerConnected(plo))
  295. {
  296. if(plo != INVALID_PLAYER_ID)
  297. {
  298. SendClientMessageEx(plo, COLOR_GRAD1, "Enjoy your new jetpack!");
  299. JetPack[plo] = 1;
  300. SetPlayerSpecialAction(plo, SPECIAL_ACTION_USEJETPACK);
  301. format(szMiscArray, sizeof(szMiscArray), "AdmCmd: %s has received a jetpack from %s", GetPlayerNameEx(plo), GetPlayerNameEx(playerid));
  302. SendClientMessageToAllEx(COLOR_LIGHTRED, szMiscArray);
  303. format(szMiscArray, sizeof(szMiscArray), "[Admin] %s (IP:%s) has given %s(%d) (IP:%s) a Jetpack.", GetPlayerNameEx(playerid), GetPlayerIpEx(playerid), GetPlayerNameEx(plo), GetPlayerSQLId(plo), GetPlayerIpEx(plo));
  304. Log("logs/admingive.log", szMiscArray);
  305. }
  306. }
  307. else return SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  308. }
  309. else return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  310. return 1;
  311. }
  312. CMD:sethp(playerid, params[])
  313. {
  314. new playa, health;
  315. if(sscanf(params, "ud", playa, health)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /sethp [player] [health]");
  316. if(PlayerInfo[playa][pJailTime] >= 1 && strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1) return SendClientMessage(playerid, COLOR_WHITE, "You can't set a OOC Prisoner Health!");
  317. if((PlayerInfo[playa][pAdmin] >= PlayerInfo[playerid][pAdmin]) && playa != playerid) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot use this command on the same/greater level admin than you!");
  318. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1) {
  319. if(IsPlayerConnected(playa)) {
  320. if(playa != INVALID_PLAYER_ID)
  321. {
  322. SetHealth(playa, health);
  323. format(szMiscArray, sizeof(szMiscArray), "You have set %s's health to %d.", GetPlayerNameEx(playa), health);
  324. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  325. }
  326. }
  327. else return SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  328. }
  329. else return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  330. return 1;
  331. }
  332. CMD:setmyhp(playerid, params[])
  333. {
  334. new health;
  335. if(sscanf(params, "d", health)) {
  336. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setmyhp [health]");
  337. return 1;
  338. }
  339. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pUndercover] >= 1 || PlayerInfo[playerid][pASM] >= 1) {
  340. SetHealth(playerid, health);
  341. format(szMiscArray, sizeof(szMiscArray), "You have set your health to %d.", health);
  342. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  343. }
  344. else {
  345. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  346. }
  347. return 1;
  348. }
  349. CMD:setarmor(playerid, params[])
  350. {
  351. new playa, health;
  352. if(sscanf(params, "ud", playa, health))
  353. {
  354. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setarmor [player] [armor]");
  355. return 1;
  356. }
  357. if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  358. {
  359. if(IsPlayerConnected(playa))
  360. {
  361. if(playa != INVALID_PLAYER_ID)
  362. {
  363. SetArmour(playa, health);
  364. format(szMiscArray, sizeof(szMiscArray), "You have set %s's armor to %d.", GetPlayerNameEx(playa), health);
  365. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  366. }
  367. }
  368. }
  369. else
  370. {
  371. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  372. }
  373. return 1;
  374. }
  375. CMD:setmyarmor(playerid, params[])
  376. {
  377. new armor;
  378. if(sscanf(params, "d", armor))
  379. {
  380. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setmyarmor [amount]");
  381. return 1;
  382. }
  383. if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pUndercover] >= 1 || PlayerInfo[playerid][pASM] >= 1)
  384. {
  385. SetArmour(playerid, armor);
  386. format(szMiscArray, sizeof(szMiscArray), "You have set your armor to %d.", armor);
  387. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  388. }
  389. else
  390. {
  391. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  392. }
  393. return 1;
  394. }
  395. CMD:setarmorall(playerid, params[])
  396. {
  397. new armor;
  398. if(sscanf(params, "d", armor)) {
  399. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setarmorall [armor]");
  400. return 1;
  401. }
  402. if (PlayerInfo[playerid][pAdmin] >= 1337) {
  403. foreach(new i: Player)
  404. {
  405. SetArmour(i, armor);
  406. }
  407. }
  408. else {
  409. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  410. }
  411. return 1;
  412. }
  413. CMD:loadcfgs(playerid, params[])
  414. {
  415. if(PlayerInfo[playerid][pAdmin] < 1337) {
  416. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command.");
  417. return 1;
  418. }
  419. SendClientMessageEx(playerid, COLOR_WHITE, "* Reloading CFG Files..");
  420. g_mysql_LoadMOTD();
  421. // Local Configs
  422. Misc_Load();
  423. SendClientMessageEx(playerid, COLOR_WHITE, "* Done");
  424. return 1;
  425. }
  426. CMD:admins(playerid, params[])
  427. {
  428. if(PlayerInfo[playerid][pAdmin] >= 2) {
  429. SendClientMessageEx(playerid, COLOR_GRAD1, "Admins Online:");
  430. foreach(new i: Player)
  431. {
  432. if(PlayerInfo[i][pAdmin] >= 2 && PlayerInfo[i][pAdmin] <= PlayerInfo[playerid][pAdmin]) {
  433. new tdate[11], thour[9], i_timestamp[3];
  434. getdate(i_timestamp[0], i_timestamp[1], i_timestamp[2]);
  435. format(tdate, sizeof(tdate), "%d-%02d-%02d", i_timestamp[0], i_timestamp[1], i_timestamp[2]);
  436. format(thour, sizeof(thour), "%02d:00:00", hour);
  437. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  438. {
  439. if(PlayerInfo[i][pAdmin] == 2) format(szMiscArray, sizeof(szMiscArray), "%s{BFC0C2}: %s (RTH: %d | RT: %d)", GetStaffRank(i), GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  440. else if(PlayerInfo[i][pAdmin] == 3) format(szMiscArray, sizeof(szMiscArray), "%s{BFC0C2}: %s (RTH: %d | RT: %d)", GetStaffRank(i), GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  441. else if(PlayerInfo[i][pAdmin] == 4) format(szMiscArray, sizeof(szMiscArray), "%s{BFC0C2}: %s (RTH: %d | RT: %d)", GetStaffRank(i), GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  442. else if(PlayerInfo[i][pAdmin] == 1337) format(szMiscArray, sizeof(szMiscArray), "%s{BFC0C2}: %s (RTH: %d | RT: %d)", GetStaffRank(i), GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  443. else if(PlayerInfo[i][pAdmin] == 1338) format(szMiscArray, sizeof(szMiscArray), "%s{BFC0C2}: %s (RTH: %d | RT: %d)", GetStaffRank(i), GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  444. else if(PlayerInfo[i][pAdmin] == 99999) format(szMiscArray, sizeof(szMiscArray), "%s{BFC0C2}: %s (RTH: %d | RT: %d)", GetStaffRank(i), GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  445. else format(szMiscArray, sizeof(szMiscArray), "%s{BFC0C2}: %s", GetStaffRank(i), PlayerInfo[i][pAdmin], GetPlayerNameEx(i));
  446. }
  447. else
  448. {
  449. if(PlayerInfo[i][pAdmin] == 2) format(szMiscArray, sizeof(szMiscArray), "%s{BFC0C2}: %s", GetStaffRank(i), GetPlayerNameEx(i));
  450. else if(PlayerInfo[i][pAdmin] == 3) format(szMiscArray, sizeof(szMiscArray), "%s{BFC0C2}: %s", GetStaffRank(i), GetPlayerNameEx(i));
  451. else if(PlayerInfo[i][pAdmin] == 4) format(szMiscArray, sizeof(szMiscArray), "%s{BFC0C2}: %s", GetStaffRank(i), GetPlayerNameEx(i));
  452. else if(PlayerInfo[i][pAdmin] == 1337) format(szMiscArray, sizeof(szMiscArray), "%s{BFC0C2}: %s", GetStaffRank(i), GetPlayerNameEx(i));
  453. else if(PlayerInfo[i][pAdmin] == 1338) format(szMiscArray, sizeof(szMiscArray), "%s{BFC0C2}: %s", GetStaffRank(i), GetPlayerNameEx(i));
  454. else if(PlayerInfo[i][pAdmin] == 99999) format(szMiscArray, sizeof(szMiscArray), "%s{BFC0C2}: %s", GetStaffRank(i), GetPlayerNameEx(i));
  455. else format(szMiscArray, sizeof(szMiscArray), "%s{BFC0C2}: %s", PlayerInfo[i][pAdmin], GetPlayerNameEx(i));
  456. }
  457. if(PlayerInfo[i][pBanAppealer] == 1) strcat(szMiscArray, " [BA]");
  458. if(PlayerInfo[i][pBanAppealer] == 2) strcat(szMiscArray, " [DOCI]");
  459. if(PlayerInfo[i][pShopTech] == 1) strcat(szMiscArray, " [ST]");
  460. if(PlayerInfo[i][pShopTech] == 2) strcat(szMiscArray, " [SST]");
  461. if(PlayerInfo[i][pShopTech] == 3) strcat(szMiscArray, " [DOCR]");
  462. if(PlayerInfo[i][pUndercover] == 1) strcat(szMiscArray, " [UC]");
  463. if(PlayerInfo[i][pUndercover] == 2) strcat(szMiscArray, " [DOSO]");
  464. if(PlayerInfo[i][pFactionModerator] == 1) strcat(szMiscArray, " [FMOD]");
  465. if(PlayerInfo[i][pFactionModerator] == 2) strcat(szMiscArray, " [DOFM]");
  466. if(PlayerInfo[i][pGangModerator] == 1) strcat(szMiscArray, " [GMOD]");
  467. if(PlayerInfo[i][pGangModerator] == 2) strcat(szMiscArray, " [DOGM]");
  468. if(PlayerInfo[i][pTogReports]) strcat(szMiscArray, " [SPEC MODE]");
  469. if(PlayerInfo[i][pPR] == 1) strcat(szMiscArray, " [PR]");
  470. if(PlayerInfo[i][pPR] == 2) strcat(szMiscArray, " [DOPR]");
  471. if(PlayerInfo[i][pHR] >= 1) strcat(szMiscArray, " [HR]");
  472. if(PlayerInfo[i][pAP] >= 1) strcat(szMiscArray, " [AP]");
  473. if(PlayerInfo[i][pWatchdog] == 4) strcat(szMiscArray, " [DoRPI]");
  474. if(PlayerInfo[i][pSecurity] >= 1) strcat(szMiscArray, " [Sec]");
  475. if(PlayerInfo[i][pBM] == 1) strcat(szMiscArray, " [BM]");
  476. if(PlayerInfo[i][pBM] == 2) strcat(szMiscArray, " [DOBM]");
  477. if(PlayerInfo[i][pASM] == 1) strcat(szMiscArray, " [ASM]");
  478. SendClientMessageEx(playerid, COLOR_GRAD2, szMiscArray);
  479. }
  480. }
  481. }
  482. else {
  483. SendClientMessageEx(playerid, COLOR_GRAD1, "If you have questions regarding gameplay or the server, use /requesthelp or /newb");
  484. SendClientMessageEx(playerid, COLOR_GRAD1, "If you see a player breaking rules or need Admin assistance, use /report");
  485. }
  486. return 1;
  487. }
  488. CMD:dn(playerid, params[])
  489. {
  490. if (PlayerInfo[playerid][pAdmin] >= 2)
  491. {
  492. new Float:slx, Float:sly, Float:slz;
  493. GetPlayerPos(playerid, slx, sly, slz);
  494. if (GetPlayerState(playerid) == 2)
  495. {
  496. new tmpcar = GetPlayerVehicleID(playerid);
  497. SetVehiclePos(tmpcar, slx, sly, slz-2);
  498. fVehSpeed[playerid] = 0.0;
  499. }
  500. else
  501. {
  502. SetPlayerPos(playerid, slx, sly, slz-2);
  503. }
  504. return 1;
  505. }
  506. else
  507. {
  508. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  509. }
  510. return 1;
  511. }
  512. CMD:up(playerid, params[])
  513. {
  514. if (PlayerInfo[playerid][pAdmin] >= 2)
  515. {
  516. new Float:slx, Float:sly, Float:slz;
  517. GetPlayerPos(playerid, slx, sly, slz);
  518. if (GetPlayerState(playerid) == 2)
  519. {
  520. new tmpcar = GetPlayerVehicleID(playerid);
  521. SetVehiclePos(tmpcar, slx, sly, slz+5);
  522. fVehSpeed[playerid] = 0.0;
  523. }
  524. else
  525. {
  526. SetPlayerPos(playerid, slx, sly, slz+5);
  527. }
  528. return 1;
  529. }
  530. else
  531. {
  532. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  533. }
  534. return 1;
  535. }
  536. CMD:fly(playerid, params[])
  537. {
  538. if (PlayerInfo[playerid][pAdmin] >= 2) {
  539. new Float:px, Float:py, Float:pz, Float:pa;
  540. GetPlayerFacingAngle(playerid,pa);
  541. if(pa >= 0.0 && pa <= 22.5) { //n1
  542. GetPlayerPos(playerid, px, py, pz);
  543. if (GetPlayerState(playerid) == 2)
  544. {
  545. new tmpcar = GetPlayerVehicleID(playerid);
  546. SetVehiclePos(tmpcar, px, py+30, pz+5);
  547. fVehSpeed[playerid] = 0.0;
  548. }
  549. else
  550. {
  551. SetPlayerPos(playerid, px, py+30, pz+5);
  552. }
  553. }
  554. if(pa >= 332.5 && pa < 0.0) { //n2
  555. GetPlayerPos(playerid, px, py, pz);
  556. if (GetPlayerState(playerid) == 2)
  557. {
  558. new tmpcar = GetPlayerVehicleID(playerid);
  559. SetVehiclePos(tmpcar, px, py+30, pz+5);
  560. fVehSpeed[playerid] = 0.0;
  561. }
  562. else
  563. {
  564. SetPlayerPos(playerid, px, py+30, pz+5);
  565. }
  566. }
  567. if(pa >= 22.5 && pa <= 67.5) { //nw
  568. GetPlayerPos(playerid, px, py, pz);
  569. if (GetPlayerState(playerid) == 2)
  570. {
  571. new tmpcar = GetPlayerVehicleID(playerid);
  572. SetVehiclePos(tmpcar, px-15, py+15, pz+5);
  573. fVehSpeed[playerid] = 0.0;
  574. }
  575. else
  576. {
  577. SetPlayerPos(playerid, px-15, py+15, pz+5);
  578. }
  579. }
  580. if(pa >= 67.5 && pa <= 112.5) { //w
  581. GetPlayerPos(playerid, px, py, pz);
  582. if (GetPlayerState(playerid) == 2)
  583. {
  584. new tmpcar = GetPlayerVehicleID(playerid);
  585. SetVehiclePos(tmpcar, px-30, py, pz+5);
  586. fVehSpeed[playerid] = 0.0;
  587. }
  588. else
  589. {
  590. SetPlayerPos(playerid, px-30, py, pz+5);
  591. }
  592. }
  593. if(pa >= 112.5 && pa <= 157.5) { //sw
  594. GetPlayerPos(playerid, px, py, pz);
  595. if (GetPlayerState(playerid) == 2)
  596. {
  597. new tmpcar = GetPlayerVehicleID(playerid);
  598. SetVehiclePos(tmpcar, px-15, py-15, pz+5);
  599. fVehSpeed[playerid] = 0.0;
  600. }
  601. else
  602. {
  603. SetPlayerPos(playerid, px-15, py-15, pz+5);
  604. }
  605. }
  606. if(pa >= 157.5 && pa <= 202.5) { //s
  607. GetPlayerPos(playerid, px, py, pz);
  608. if (GetPlayerState(playerid) == 2)
  609. {
  610. new tmpcar = GetPlayerVehicleID(playerid);
  611. SetVehiclePos(tmpcar, px, py-30, pz+5);
  612. fVehSpeed[playerid] = 0.0;
  613. }
  614. else
  615. {
  616. SetPlayerPos(playerid, px, py-30, pz+5);
  617. }
  618. }
  619. if(pa >= 202.5 && pa <= 247.5) { //se
  620. GetPlayerPos(playerid, px, py, pz);
  621. if (GetPlayerState(playerid) == 2)
  622. {
  623. new tmpcar = GetPlayerVehicleID(playerid);
  624. SetVehiclePos(tmpcar, px+15, py-15, pz+5);
  625. fVehSpeed[playerid] = 0.0;
  626. }
  627. else
  628. {
  629. SetPlayerPos(playerid, px+15, py-15, pz+5);
  630. }
  631. }
  632. if(pa >= 247.5 && pa <= 292.5) { //e
  633. GetPlayerPos(playerid, px, py, pz);
  634. if (GetPlayerState(playerid) == 2)
  635. {
  636. new tmpcar = GetPlayerVehicleID(playerid);
  637. SetVehiclePos(tmpcar, px+30, py, pz+5);
  638. fVehSpeed[playerid] = 0.0;
  639. }
  640. else
  641. {
  642. SetPlayerPos(playerid, px+30, py, pz+5);
  643. }
  644. }
  645. if(pa >= 292.5 && pa <= 332.5) { //e
  646. GetPlayerPos(playerid, px, py, pz);
  647. if (GetPlayerState(playerid) == 2)
  648. {
  649. new tmpcar = GetPlayerVehicleID(playerid);
  650. SetVehiclePos(tmpcar, px+15, py+15, pz+5);
  651. fVehSpeed[playerid] = 0.0;
  652. }
  653. else
  654. {
  655. SetPlayerPos(playerid, px+15, py+15, pz+5);
  656. }
  657. }
  658. }
  659. else {
  660. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  661. }
  662. return 1;
  663. }
  664. CMD:lt(playerid, params[])
  665. {
  666. if (PlayerInfo[playerid][pAdmin] >= 2)
  667. {
  668. new Float:slx, Float:sly, Float:slz;
  669. GetPlayerPos(playerid, slx, sly, slz);
  670. if (GetPlayerState(playerid) == 2)
  671. {
  672. new tmpcar = GetPlayerVehicleID(playerid);
  673. SetVehiclePos(tmpcar, slx-2, sly, slz);
  674. fVehSpeed[playerid] = 0.0;
  675. }
  676. else
  677. {
  678. SetPlayerPos(playerid, slx-2, sly, slz);
  679. }
  680. return 1;
  681. }
  682. else
  683. {
  684. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  685. }
  686. return 1;
  687. }
  688. CMD:rt(playerid, params[])
  689. {
  690. if (PlayerInfo[playerid][pAdmin] >= 2)
  691. {
  692. new Float:slx, Float:sly, Float:slz;
  693. GetPlayerPos(playerid, slx, sly, slz);
  694. if (GetPlayerState(playerid) == 2)
  695. {
  696. new tmpcar = GetPlayerVehicleID(playerid);
  697. SetVehiclePos(tmpcar, slx+2, sly, slz);
  698. fVehSpeed[playerid] = 0.0;
  699. }
  700. else
  701. {
  702. SetPlayerPos(playerid, slx+2, sly, slz);
  703. }
  704. return 1;
  705. }
  706. else
  707. {
  708. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  709. }
  710. return 1;
  711. }
  712. CMD:fd(playerid, params[])
  713. {
  714. if (PlayerInfo[playerid][pAdmin] >= 2)
  715. {
  716. new Float:slx, Float:sly, Float:slz;
  717. GetPlayerPos(playerid, slx, sly, slz);
  718. if (GetPlayerState(playerid) == 2)
  719. {
  720. new tmpcar = GetPlayerVehicleID(playerid);
  721. SetVehiclePos(tmpcar, slx, sly+2, slz);
  722. fVehSpeed[playerid] = 0.0;
  723. }
  724. else
  725. {
  726. SetPlayerPos(playerid, slx, sly+2, slz);
  727. }
  728. return 1;
  729. }
  730. else
  731. {
  732. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  733. }
  734. return 1;
  735. }
  736. CMD:bk(playerid, params[])
  737. {
  738. if (PlayerInfo[playerid][pAdmin] >= 2)
  739. {
  740. new Float:slx, Float:sly, Float:slz;
  741. GetPlayerPos(playerid, slx, sly, slz);
  742. if (GetPlayerState(playerid) == 2)
  743. {
  744. new tmpcar = GetPlayerVehicleID(playerid);
  745. SetVehiclePos(tmpcar, slx, sly-2, slz);
  746. fVehSpeed[playerid] = 0.0;
  747. }
  748. else
  749. {
  750. SetPlayerPos(playerid, slx, sly-2, slz);
  751. }
  752. return 1;
  753. }
  754. else
  755. {
  756. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  757. }
  758. return 1;
  759. }
  760. CMD:mjail(playerid, params[]) {
  761. if(PlayerInfo[playerid][pAdmin] == 1 || PlayerInfo[playerid][pHelper] >= 2) {
  762. new
  763. iTargetID,
  764. szReason[64];
  765. if(sscanf(params, "us[64]", iTargetID, szReason)) {
  766. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /mjail [player] [reason]");
  767. }
  768. else if(IsPlayerConnected(iTargetID)) {
  769. if(PlayerInfo[iTargetID][pAdmin] == 1) {
  770. return SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on moderators.");
  771. }
  772. if(PlayerInfo[iTargetID][pAdmin] > PlayerInfo[playerid][pAdmin]) {
  773. return SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on administrators.");
  774. }
  775. if(PlayerInfo[iTargetID][pHelper] >= 2) {
  776. return SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on Advisors.");
  777. }
  778. if(PlayerInfo[iTargetID][pJailTime] > 0) {
  779. return SendClientMessageEx(playerid, COLOR_GREY, "You can't perform this action on someone in jail already.");
  780. }
  781. if(PrisonPlayer(playerid, iTargetID, szReason, .time=20, .custom=1) == 0) return 1;
  782. }
  783. else
  784. {
  785. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  786. }
  787. }
  788. return 1;
  789. }
  790. CMD:prisoners(playerid, params[])
  791. {
  792. if(PlayerInfo[playerid][pAdmin] >= 2)
  793. {
  794. new Count;
  795. SendClientMessageEx(playerid, COLOR_WHITE, "----------------------------------------");
  796. SendClientMessageEx(playerid, COLOR_WHITE, "Name | Prisoned By | Time Left | Reason");
  797. foreach(new i: Player)
  798. {
  799. if(PlayerInfo[i][pJailTime] >= 1)
  800. {
  801. if(strlen(PlayerInfo[i][pPrisonReason]) >= 1 && strlen(PlayerInfo[i][pPrisonedBy]) >= 1)
  802. {
  803. Count++;
  804. format(szMiscArray, sizeof(szMiscArray), "%s (%d) | %s | %s | %s", GetPlayerNameEx(i), i, PlayerInfo[i][pPrisonedBy], TimeConvert(PlayerInfo[i][pJailTime]), PlayerInfo[i][pPrisonReason]);
  805. SendClientMessageEx(playerid, COLOR_GREY, szMiscArray);
  806. }
  807. else
  808. {
  809. format(szMiscArray, sizeof(szMiscArray), "%s (%d) | Unavailable | %s | Unavailable", GetPlayerNameEx(i), i, TimeConvert(PlayerInfo[i][pJailTime]));
  810. SendClientMessageEx(playerid, COLOR_GREY, szMiscArray);
  811. }
  812. }
  813. }
  814. SendClientMessageEx(playerid, COLOR_WHITE, "----------------------------------------");
  815. }
  816. return 1;
  817. }
  818. CMD:noooc(playerid, params[])
  819. {
  820. if(PlayerInfo[playerid][pAdmin] >= 3)
  821. {
  822. if (!noooc)
  823. {
  824. noooc = 1;
  825. SendClientMessageToAllEx(COLOR_GRAD2, " OOC chat channel disabled by an Admin!");
  826. }
  827. else
  828. {
  829. noooc = 0;
  830. SendClientMessageToAllEx(COLOR_GRAD2, " OOC chat channel enabled by an Admin!");
  831. }
  832. }
  833. else
  834. {
  835. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  836. }
  837. return 1;
  838. }
  839. CMD:vehname(playerid, params[]) {
  840. if(PlayerInfo[playerid][pAdmin] >= 2) {
  841. SendClientMessageEx(playerid, COLOR_YELLOW, "--------------------------------------------------------------------------------------------------------------------------------");
  842. SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle Search:");
  843. if(isnull(params)) return SendClientMessageEx(playerid, COLOR_GREY, "No keyword specified.");
  844. if(!params[2]) return SendClientMessageEx(playerid, COLOR_GREY, "Search keyword too short.");
  845. szMiscArray[0] = 0;
  846. for(new v; v < sizeof(VehicleName); v++) {
  847. if(strfind(VehicleName[v], params, true) != -1) {
  848. if(isnull(szMiscArray)) format(szMiscArray, sizeof(szMiscArray), "%s (ID %d)", VehicleName[v], v+400);
  849. else format(szMiscArray, sizeof(szMiscArray), "%s | %s (ID %d)", szMiscArray, VehicleName[v], v+400);
  850. }
  851. }
  852. if(!szMiscArray[0]) SendClientMessageEx(playerid, COLOR_GREY, "No results found.");
  853. //else if(szMiscArray[127]) SendClientMessageEx(playerid, COLOR_GREY, "Too many results found.");
  854. else SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  855. SendClientMessageEx(playerid, COLOR_YELLOW, "--------------------------------------------------------------------------------------------------------------------------------");
  856. }
  857. return 1;
  858. }
  859. CMD:mstats(playerid, params[]) {
  860. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1) {
  861. SendClientMessageEx(playerid, COLOR_GREY, "You're not authorised to use this command.");
  862. return 1;
  863. }
  864. else {
  865. new stats[256];
  866. mysql_stat(stats, sizeof(stats), MainPipeline);
  867. SendClientMessageEx(playerid, COLOR_GREEN,"___________________________________________________________________________________________________");
  868. SendClientMessageEx(playerid, COLOR_GREY, stats);
  869. SendClientMessageEx(playerid, COLOR_GREEN,"___________________________________________________________________________________________________");
  870. #if defined SHOPAUTOMATED
  871. mysql_stat(stats, sizeof(stats), ShopPipeline);
  872. SendClientMessageEx(playerid, COLOR_GREEN,"___________________________________________________________________________________________________");
  873. SendClientMessageEx(playerid, COLOR_GREY, stats);
  874. SendClientMessageEx(playerid, COLOR_GREEN,"___________________________________________________________________________________________________");
  875. #endif
  876. }
  877. return 1;
  878. }
  879. CMD:netstats(playerid, params[]) {
  880. if(gPlayerLogged{playerid} != 0) {
  881. new strStats[401], szTitle[64];
  882. GetPlayerNetworkStats(playerid, strStats, sizeof(strStats));
  883. format(szTitle, sizeof(szTitle), "Network Stats (ID: %d) - %s", playerid, GetPlayerNameEx(playerid));
  884. ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, szTitle, strStats, "Close", "");
  885. }
  886. return 1;
  887. }
  888. CMD:anetstats(playerid, params[])
  889. {
  890. if (PlayerInfo[playerid][pAdmin] < 2) {
  891. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  892. return 1;
  893. }
  894. new giveplayerid, strStats[401], szTitle[64];
  895. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /anetstats [player]");
  896. if(gPlayerLogged{giveplayerid} != 0) {
  897. GetPlayerNetworkStats(giveplayerid, strStats, sizeof(strStats));
  898. format(szTitle, sizeof(szTitle), "Network Stats (ID: %d) - %s", giveplayerid, GetPlayerNameEx(giveplayerid));
  899. ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, szTitle, strStats, "Close", "");
  900. }
  901. return 1;
  902. }
  903. // Testing Commands
  904. CMD:playsound(playerid, params[])
  905. {
  906. if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use this command!");
  907. new id, soundid;
  908. if(sscanf(params, "ud", id, soundid))
  909. {
  910. SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /playsound [player] [soundid]");
  911. return 1;
  912. }
  913. else
  914. {
  915. PlayerPlaySound(id, soundid, 0, 0, 0);
  916. }
  917. return 1;
  918. }
  919. CMD:aobject(playerid, params[])
  920. {
  921. if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use this command!");
  922. new id, objectid, bone, Float:offsetx, Float:offsety, Float:offsetz, Float:rotx, Float:roty, Float:rotz, Float:scalex, Float:scaley, Float:scalez;
  923. if(sscanf(params, "uddfffffffff", id, objectid, bone, offsetx, offsety, offsetz, rotx, roty, rotz, scalex, scaley, scalez))
  924. {
  925. SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /aobject [player] [objectid] [bone] [offx] [offy] [offz] [rotx] [roty] [rotz] [scax] [scay] [scaz]");
  926. return 1;
  927. }
  928. else
  929. {
  930. if(IsPlayerAttachedObjectSlotUsed(id, 8)) RemovePlayerAttachedObject(id, 8);
  931. SetPlayerAttachedObject(id, 8, objectid, bone, offsetx, offsety, offsetz, rotx, roty, rotz, scalex, scaley, scalez);
  932. format(szMiscArray, sizeof(szMiscArray), "%s has given %s(%d) object ID %d with /aobject", GetPlayerNameEx(playerid), GetPlayerNameEx(id), GetPlayerSQLId(id), objectid);
  933. Log("logs/toys.log", szMiscArray);
  934. }
  935. return 1;
  936. }
  937. CMD:robject(playerid, params[])
  938. {
  939. if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use this command!");
  940. new id;
  941. if(sscanf(params, "u", id))
  942. {
  943. SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /robject [player]");
  944. return 1;
  945. }
  946. else
  947. {
  948. if(IsPlayerAttachedObjectSlotUsed(id, 9)) RemovePlayerAttachedObject(id, 9);
  949. }
  950. return 1;
  951. }
  952. CMD:wepreset(playerid, params[])
  953. {
  954. if(PlayerInfo[playerid][pAdmin] >= 3)
  955. {
  956. new giveplayerid;
  957. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /wepreset [player]");
  958. if(IsPlayerConnected(giveplayerid))
  959. {
  960. if(PlayerInfo[giveplayerid][pWRestricted] > 0)
  961. {
  962. PlayerInfo[giveplayerid][pWRestricted] = 0;
  963. format(szMiscArray, sizeof(szMiscArray), "{AA3333}AdmWarning{FFFF00}: %s reset %s's (ID:%d) weapon restriction timer.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), giveplayerid);
  964. ABroadCast(COLOR_YELLOW, szMiscArray, 2);
  965. }
  966. else
  967. {
  968. SendClientMessageEx(playerid, COLOR_WHITE, "Their weapons are not restricted!");
  969. }
  970. }
  971. else
  972. {
  973. SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
  974. }
  975. }
  976. return 1;
  977. }
  978. CMD:bigears(playerid, params[])
  979. {
  980. if( PlayerInfo[playerid][pAdmin] >= 2) {
  981. ShowPlayerDialogEx(playerid, BIGEARS, DIALOG_STYLE_LIST, "Please choose an item to proceed", "Global Chat\nOOC Chat\nIC Chat\nGroup OOC Chat\nFamily Chat\nPlayer\nPrivate Messages\nDisable Bigears", "Select", "Cancel");
  982. }
  983. return 1;
  984. }
  985. CMD:clearall(playerid, params[])
  986. {
  987. if (PlayerInfo[playerid][pAdmin] >= 1337) {
  988. foreach(new i: Player)
  989. {
  990. PlayerInfo[i][pWantedLevel] = 0;
  991. SetPlayerToTeamColor(i);
  992. SetPlayerWantedLevel(i, 0);
  993. ClearCrimes(i);
  994. }
  995. SendClientMessageEx(playerid,COLOR_GRAD1, "You have cleared everyone's Wanted Level.");
  996. }
  997. else {
  998. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  999. }
  1000. return 1;
  1001. }
  1002. CMD:savechars(playerid, params[])
  1003. {
  1004. if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1) {
  1005. SaveEventPoints();
  1006. //mysql_SaveCrates();
  1007. SendClientMessageEx(playerid, COLOR_YELLOW, "All Crates Saved successfully.");
  1008. SaveAllAccountsUpdate();
  1009. //g_mysql_DumpAccounts();
  1010. SendClientMessageEx(playerid, COLOR_YELLOW, "Update Process Started - Wait for Account Saving Finish Confirmation.");
  1011. SaveHouses();
  1012. SendClientMessageEx(playerid, COLOR_YELLOW, "House saving process started.");
  1013. }
  1014. else {
  1015. SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
  1016. }
  1017. return 1;
  1018. }
  1019. CMD:setcolor(playerid, params[])
  1020. {
  1021. if (PlayerInfo[playerid][pAdmin] >= 1337)
  1022. {
  1023. ShowPlayerDialogEx(playerid, COLORMENU, DIALOG_STYLE_LIST, "Color Menu", "Blue\nBlack\nRed\nOrange\nPink\nPurple\nGreen\nYellow\nWhite\nOOC Prisoner Orange", "Select", "Cancel");
  1024. }
  1025. else
  1026. {
  1027. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  1028. }
  1029. return 1;
  1030. }
  1031. CMD:mark(playerid, params[])
  1032. {
  1033. if (PlayerInfo[playerid][pAdmin] >= 2) {
  1034. new
  1035. Float: f_PlayerPos[3];
  1036. GetPlayerPos(playerid, f_PlayerPos[0], f_PlayerPos[1], f_PlayerPos[2]);
  1037. SetPVarFloat(playerid, "tpPosX1", f_PlayerPos[0]);
  1038. SetPVarFloat(playerid, "tpPosY1", f_PlayerPos[1]);
  1039. SetPVarFloat(playerid, "tpPosZ1", f_PlayerPos[2]);
  1040. SetPVarInt(playerid, "tpInt1", GetPlayerInterior(playerid));
  1041. SendClientMessageEx(playerid, COLOR_GRAD1, "Teleporter destination set!");
  1042. }
  1043. else {
  1044. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  1045. }
  1046. return 1;
  1047. }
  1048. CMD:mark2(playerid, params[])
  1049. {
  1050. if (PlayerInfo[playerid][pAdmin] >= 2) {
  1051. new
  1052. Float: f_PlayerPos[3];
  1053. GetPlayerPos(playerid, f_PlayerPos[0], f_PlayerPos[1], f_PlayerPos[2]);
  1054. SetPVarFloat(playerid, "tpPosX2", f_PlayerPos[0]);
  1055. SetPVarFloat(playerid, "tpPosY2", f_PlayerPos[1]);
  1056. SetPVarFloat(playerid, "tpPosZ2", f_PlayerPos[2]);
  1057. SetPVarInt(playerid, "tpInt2", GetPlayerInterior(playerid));
  1058. SendClientMessageEx(playerid, COLOR_GRAD1, "Teleporter destination set!");
  1059. }
  1060. else {
  1061. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  1062. }
  1063. return 1;
  1064. }
  1065. CMD:gotojet(playerid, params[])
  1066. {
  1067. if (PlayerInfo[playerid][pAdmin] >= 3) {
  1068. if (GetPlayerState(playerid) == 2) {
  1069. new tmpcar = GetPlayerVehicleID(playerid);
  1070. SetVehiclePos(tmpcar, 1.71875, 30.4062, 1200.34);
  1071. }
  1072. else {
  1073. SetPlayerPos(playerid, 1.71875, 30.4062, 1200.34);
  1074. }
  1075. SetPlayerInterior(playerid,1);
  1076. SendClientMessageEx(playerid, COLOR_GRAD1, " You have been teleported!");
  1077. }
  1078. else {
  1079. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  1080. }
  1081. return 1;
  1082. }
  1083. CMD:god(playerid, params[])
  1084. {
  1085. if(PlayerInfo[playerid][pAdmin] < 2 && PlayerInfo[playerid][pWatchdog] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not authorized to use this command!");
  1086. {
  1087. new Float:health, Float:armor;
  1088. if(GetPVarType(playerid, "pGodMode"))
  1089. {
  1090. health = GetPVarFloat(playerid, "pPreGodHealth");
  1091. SetHealth(playerid,health);
  1092. armor = GetPVarFloat(playerid, "pPreGodArmor");
  1093. SetArmour(playerid, armor);
  1094. DeletePVar(playerid, "pGodMode");
  1095. DeletePVar(playerid, "pPreGodHealth");
  1096. DeletePVar(playerid, "pPreGodArmor");
  1097. SendClientMessage(playerid, COLOR_WHITE, "God mode disabled");
  1098. }
  1099. else
  1100. {
  1101. GetHealth(playerid,health);
  1102. SetPVarFloat(playerid, "pPreGodHealth", health);
  1103. GetArmour(playerid,armor);
  1104. SetPVarFloat(playerid, "pPreGodArmor", armor);
  1105. SetHealth(playerid, 0x7FB00000);
  1106. SetArmour(playerid, 0x7FB00000);
  1107. SetPVarInt(playerid, "pGodMode", 1);
  1108. SendClientMessage(playerid, COLOR_WHITE, "God mode enabled");
  1109. }
  1110. }
  1111. return 1;
  1112. }
  1113. CMD:damagecheck(playerid, params[])
  1114. {
  1115. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
  1116. if(GetPVarType(playerid, "_dCheck")) {
  1117. DeletePVar(playerid, "_dCheck");
  1118. SendClientMessageEx(playerid, COLOR_WHITE, "You have stopped damagecheck.");
  1119. return 1;
  1120. }
  1121. new pID;
  1122. if(sscanf(params, "u", pID)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /damagecheck [playerid]");
  1123. if(!IsPlayerConnected(pID)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1124. SetPVarInt(playerid, "_dCheck", pID);
  1125. format(szMiscArray, sizeof(szMiscArray), "You will now see all the damage that %s takes/gives.", GetPlayerNameEx(pID));
  1126. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  1127. if(GetPVarInt(pID, "usingfirstaid") == 1) SendClientMessageEx(playerid, COLOR_ORANGE, "Note{ffffff}: Player is currently using a first aid kit.");
  1128. return 1;
  1129. }
  1130. CMD:lastshot(playerid, params[])
  1131. {
  1132. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
  1133. new pID;
  1134. if(sscanf(params, "u", pID)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /lastshot [playerid]");
  1135. if(!IsPlayerConnected(pID)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1136. if(aLastShot[pID] == INVALID_PLAYER_ID) return SendClientMessageEx(playerid, COLOR_GREY, "Player was not shot yet.");
  1137. format(szMiscArray, sizeof(szMiscArray), "%s was last shot by %s (ID: %d).",GetPlayerNameEx(pID), GetPlayerNameEx(aLastShot[pID]), aLastShot[pID]);
  1138. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  1139. return 1;
  1140. }
  1141. CMD:healnear(playerid, params[])
  1142. {
  1143. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1) {
  1144. new radius, count;
  1145. if(sscanf(params, "d", radius)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /healnear [radius]");
  1146. if(radius < 1 || radius > 100)
  1147. {
  1148. SendClientMessageEx(playerid, COLOR_WHITE, "Radius must be higher than 0 and lower than 100!");
  1149. return 1;
  1150. }
  1151. foreach(new i: Player)
  1152. {
  1153. if(ProxDetectorS(radius, playerid, i)) {
  1154. SetHealth(i, 100);
  1155. count++;
  1156. }
  1157. }
  1158. format(szMiscArray, sizeof(szMiscArray), "You have healed everyone (%d) nearby.", count);
  1159. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  1160. }
  1161. return 1;
  1162. }
  1163. CMD:armornear(playerid, params[])
  1164. {
  1165. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1) {
  1166. new string[128], radius, count;
  1167. if(sscanf(params, "d", radius)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /armornear [radius]");
  1168. if(radius < 1 || radius > 100)
  1169. {
  1170. SendClientMessageEx(playerid, COLOR_WHITE, "Radius must be higher than 0 and lower than 100!");
  1171. return 1;
  1172. }
  1173. foreach(new i: Player)
  1174. {
  1175. if(ProxDetectorS(radius, playerid, i)) {
  1176. SetArmour(i, 100);
  1177. count++;
  1178. }
  1179. }
  1180. format(string, sizeof(string), "You have given armor to everyone (%d) nearby.", count);
  1181. SendClientMessageEx(playerid, COLOR_WHITE, string);
  1182. }
  1183. return 1;
  1184. }
  1185. CMD:fixveh(playerid, params[])
  1186. {
  1187. if(IsPlayerConnected(playerid)) {
  1188. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1) {
  1189. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  1190. return 1;
  1191. }
  1192. if(IsPlayerInAnyVehicle(playerid)) {
  1193. new Float:vrot;
  1194. GetVehicleZAngle(GetPlayerVehicleID(playerid), vrot);
  1195. SetVehicleZAngle(GetPlayerVehicleID(playerid), vrot);
  1196. RepairVehicle(GetPlayerVehicleID(playerid));
  1197. Vehicle_Armor(GetPlayerVehicleID(playerid));
  1198. SendClientMessageEx(playerid, COLOR_GREY, " Vehicle Fixed!");
  1199. }
  1200. }
  1201. return 1;
  1202. }
  1203. CMD:fixvehall(playerid, params[])
  1204. {
  1205. if(IsPlayerConnected(playerid)) {
  1206. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1) {
  1207. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  1208. return 1;
  1209. }
  1210. for(new v = 0; v < MAX_VEHICLES; v++) {
  1211. RepairVehicle(v);
  1212. Vehicle_Armor(v);
  1213. }
  1214. SendClientMessageEx(playerid, COLOR_GREY, " All vehicles fixed!");
  1215. }
  1216. return 1;
  1217. }
  1218. CMD:destroycars(playerid, params[])
  1219. {
  1220. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1) {
  1221. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  1222. return 1;
  1223. }
  1224. for(new i = 0; i < sizeof(CreatedCars); i++) {
  1225. if(CreatedCars[i] != INVALID_VEHICLE_ID) {
  1226. DestroyVehicle(CreatedCars[i]);
  1227. CreatedCars[i] = INVALID_VEHICLE_ID;
  1228. }
  1229. }
  1230. SendClientMessageEx(playerid, COLOR_GREY, " Created vehicles destroyed!");
  1231. return 1;
  1232. }
  1233. /*
  1234. CMD:announcem(playerid, params[])
  1235. {
  1236. if(PlayerInfo[playerid][pAdmin] < 1337) {
  1237. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use this command.");
  1238. return 1;
  1239. }
  1240. restarting = 1;
  1241. SetTimer( "Maintenance", 30000, false );
  1242. SendClientMessageToAllEx(COLOR_LIGHTBLUE, "* The server will be going down in 30 seconds for Scheduled Maintenance.");
  1243. foreach(new i: Player)
  1244. {
  1245. GameTextForPlayer(i, "~y~Scheduled Maintenance Alert", 5000, 6);
  1246. }
  1247. return 1;
  1248. }*/
  1249. CMD:rehashall(playerid, params[])
  1250. {
  1251. if(PlayerInfo[playerid][pAdmin] < 1337)
  1252. {
  1253. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  1254. return 1;
  1255. }
  1256. RehashHouses();
  1257. RehashDynamicDoors();
  1258. RehashDynamicMapIcons();
  1259. return 1;
  1260. }
  1261. CMD:levelones(playerid, params[]) {
  1262. if(PlayerInfo[playerid][pAdmin] >= 2)
  1263. {
  1264. new szNoobs[156], zone[MAX_ZONE_NAME], search[MAX_ZONE_NAME], hours;
  1265. SendClientMessageEx(playerid, COLOR_WHITE, "Listing level ones...");
  1266. if(!sscanf(params, "d", hours))
  1267. {
  1268. foreach(new i: Player)
  1269. {
  1270. if(gPlayerLogged{playerid} > 0 && PlayerInfo[i][pLevel] == 1 && PlayerInfo[i][pConnectHours] == hours && PlayerInfo[i][pAdmin] == 0)
  1271. {
  1272. GetPlayer3DZone(i, zone, sizeof(zone));
  1273. format(szNoobs, sizeof(szNoobs), "* %s (ID %i) (Hours %i) - Location: %s", GetPlayerNameEx(i), i, PlayerInfo[i][pConnectHours], zone);
  1274. SendClientMessageEx(playerid, COLOR_WHITE, szNoobs);
  1275. }
  1276. }
  1277. }
  1278. else if(!sscanf(params, "s[28]", search))
  1279. {
  1280. foreach(new i: Player)
  1281. {
  1282. if(gPlayerLogged{playerid} > 0 && PlayerInfo[i][pLevel] == 1 && PlayerInfo[i][pAdmin] == 0)
  1283. {
  1284. GetPlayer3DZone(i, zone, sizeof(zone));
  1285. if(strcmp(search, zone, true) == 0 && !isnull(zone)) // null check, as strcmp returns 0 if empty.
  1286. {
  1287. format(szNoobs, sizeof(szNoobs), "* %s (ID %i) (Hours %i) - Location: %s", GetPlayerNameEx(i), i, PlayerInfo[i][pConnectHours], zone);
  1288. SendClientMessageEx(playerid, COLOR_WHITE, szNoobs);
  1289. }
  1290. }
  1291. }
  1292. }
  1293. else
  1294. {
  1295. foreach(new i: Player)
  1296. {
  1297. if(gPlayerLogged{playerid} > 0 && PlayerInfo[i][pLevel] == 1 && PlayerInfo[i][pAdmin] == 0)
  1298. {
  1299. GetPlayer3DZone(i, zone, sizeof(zone));
  1300. format(szNoobs, sizeof(szNoobs), "* %s (ID %i) (Hours %i) - Location: %s", GetPlayerNameEx(i), i, PlayerInfo[i][pConnectHours], zone);
  1301. SendClientMessageEx(playerid, COLOR_WHITE, szNoobs);
  1302. }
  1303. }
  1304. }
  1305. }
  1306. return 1;
  1307. }
  1308. CMD:paused(playerid, params[]) {
  1309. if(PlayerInfo[playerid][pAdmin] >= 2) {
  1310. new
  1311. szMessage[42 + MAX_PLAYER_NAME];
  1312. SendClientMessageEx(playerid,COLOR_WHITE,"Listing all paused players...");
  1313. foreach(new i: Player)
  1314. {
  1315. if(playerTabbed[i] != 0) {
  1316. if(playerTabbed[i] > 60) format(szMessage, sizeof(szMessage), "* %s (ID %d), tabbed for %d minutes.", GetPlayerNameEx(i), i, playerTabbed[i] / 60);
  1317. else format(szMessage, sizeof(szMessage), "* %s (ID %d), tabbed for %d seconds.", GetPlayerNameEx(i), i, playerTabbed[i]);
  1318. if(PlayerInfo[i][pAdmin] >= 2) SendClientMessageEx(playerid,COLOR_RED, szMessage);
  1319. else SendClientMessageEx(playerid,COLOR_GREY, szMessage);
  1320. }
  1321. }
  1322. }
  1323. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
  1324. return 1;
  1325. }
  1326. CMD:afk(playerid, params[]) {
  1327. if(PlayerInfo[playerid][pAdmin] >= 2) {
  1328. new
  1329. szMessage[36 + MAX_PLAYER_NAME];
  1330. SendClientMessageEx(playerid,COLOR_WHITE,"Listing all AFK players...");
  1331. foreach(new i: Player)
  1332. {
  1333. if(playerAFK[i] != 0 && playerAFK[i] > 60) {
  1334. format(szMessage,sizeof(szMessage),"* %s (ID %d), AFK for %d minutes.", GetPlayerNameEx(i), i, playerAFK[i] / 60);
  1335. if(PlayerInfo[i][pAdmin] >= 2) SendClientMessageEx(playerid,COLOR_RED,szMessage);
  1336. else SendClientMessageEx(playerid,COLOR_GREY,szMessage);
  1337. }
  1338. }
  1339. }
  1340. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
  1341. return 1;
  1342. }
  1343. CMD:destroypvehicle(playerid, params[])
  1344. {
  1345. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  1346. {
  1347. new string[128], giveplayerid, vehicleid;
  1348. if(sscanf(params, "ud", giveplayerid, vehicleid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /destroypvehicle [player] [vehicleid]");
  1349. if(!(400 <= GetVehicleModel(vehicleid) <= 612)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid vehicle specified.");
  1350. new playervehicleid = GetPlayerVehicle(giveplayerid, vehicleid);
  1351. if(playervehicleid == -1) return SendClientMessageEx(playerid, COLOR_GREY, "ERROR: That person doesn't own that vehicle.");
  1352. format(string, sizeof(string), "You have deleted %s's %s (vehicle ID %d).", GetPlayerNameEx(giveplayerid), GetVehicleName(vehicleid), vehicleid);
  1353. SendClientMessageEx(playerid, COLOR_WHITE, string);
  1354. format(string, sizeof(string), "An Administrator has deleted your %s.", GetVehicleName(vehicleid));
  1355. SendClientMessageEx(giveplayerid, COLOR_GREY, string);
  1356. format(string, sizeof(string), "%s has destroyed %s's(%d) %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetVehicleName(vehicleid));
  1357. Log("logs/playervehicle.log", string);
  1358. DestroyPlayerVehicle(giveplayerid, playervehicleid);
  1359. }
  1360. else SendClientMessageEx(playerid, COLOR_GREY, "You are not allowed to use this command.");
  1361. return 1;
  1362. }
  1363. CMD:setsec(playerid, params[])
  1364. {
  1365. if(PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pHR] >= 2 || PlayerInfo[playerid][pAP] >= 2 || PlayerInfo[playerid][pSecurity] >= 2)
  1366. {
  1367. new giveplayerid, task[8], string[128];
  1368. if(sscanf(params, "us[8]", giveplayerid, task))
  1369. {
  1370. SendClientMessage(playerid, COLOR_GREY, "USAGE: /setsec [playerid] [secondary task]");
  1371. SendClientMessage(playerid, COLOR_GRAD6, "Secondary Tasks: FMod, GMod, SO, BA, ST, PR, HR, Sec, BM, ASM");
  1372. return 1;
  1373. }
  1374. if(giveplayerid != INVALID_PLAYER_ID)
  1375. {
  1376. if(PlayerInfo[giveplayerid][pAdmin] > 2)
  1377. {
  1378. if(strcmp(task, "fmod", true) == 0)
  1379. {
  1380. if(PlayerInfo[giveplayerid][pFactionModerator] == 0)
  1381. {
  1382. PlayerInfo[giveplayerid][pFactionModerator] = 1;
  1383. SendClientMessage(playerid, COLOR_WHITE, "You have made them a Faction Moderator");
  1384. SendClientMessage(giveplayerid, COLOR_WHITE, "You have been made a Faction Moderator");
  1385. format(string, sizeof(string), "%s has given Faction Moderator to %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1386. Log("logs/admin.log", string);
  1387. DBLog(playerid, giveplayerid, "Admin", "issued faction moderator");
  1388. }
  1389. else
  1390. {
  1391. PlayerInfo[giveplayerid][pFactionModerator] = 0;
  1392. SendClientMessageEx(playerid, COLOR_GREY, "You have taken their Faction Moderator");
  1393. SendClientMessage(giveplayerid, COLOR_GREY, "You have had your Faction Moderator taken");
  1394. format(string, sizeof(string), "%s has taken Faction Moderator from %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1395. Log("logs/admin.log", string);
  1396. DBLog(playerid, giveplayerid, "Admin", "removed from faction moderator");
  1397. }
  1398. }
  1399. else if(strcmp(task, "gmod", true) == 0)
  1400. {
  1401. if(PlayerInfo[giveplayerid][pGangModerator] == 0)
  1402. {
  1403. PlayerInfo[giveplayerid][pGangModerator] = 1;
  1404. SendClientMessage(playerid, COLOR_WHITE, "You have made them a Gang Moderator");
  1405. SendClientMessage(giveplayerid, COLOR_WHITE, "You have been made a Gang Moderator");
  1406. format(string, sizeof(string), "%s has given Gang Moderator to %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1407. Log("logs/admin.log", string);
  1408. DBLog(playerid, giveplayerid, "Admin", "issued gang moderator");
  1409. }
  1410. else
  1411. {
  1412. PlayerInfo[giveplayerid][pGangModerator] = 0;
  1413. SendClientMessageEx(playerid, COLOR_GREY, "You have taken their Gang Moderator");
  1414. SendClientMessage(giveplayerid, COLOR_GREY, "You have had your Gang Moderator taken");
  1415. format(string, sizeof(string), "%s has taken Gang Moderator from %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1416. Log("logs/admin.log", string);
  1417. DBLog(playerid, giveplayerid, "Admin", "removed from gang moderator");
  1418. }
  1419. }
  1420. else if(strcmp(task, "so", true) == 0)
  1421. {
  1422. if(PlayerInfo[giveplayerid][pUndercover] == 0)
  1423. {
  1424. PlayerInfo[giveplayerid][pUndercover] = 1;
  1425. SendClientMessage(playerid, COLOR_WHITE, "You have made them a Special Operative");
  1426. SendClientMessage(giveplayerid, COLOR_WHITE, "You have been made a Special Operative");
  1427. format(string, sizeof(string), "%s has given Special Operative to %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1428. Log("logs/admin.log", string);
  1429. DBLog(playerid, giveplayerid, "Admin", "issued special ops");
  1430. }
  1431. else
  1432. {
  1433. PlayerInfo[giveplayerid][pUndercover] = 0;
  1434. SendClientMessageEx(playerid, COLOR_GREY, "You have taken their Special Operative");
  1435. SendClientMessage(giveplayerid, COLOR_GREY, "You have had your Special Operative permissions taken");
  1436. format(string, sizeof(string), "%s has taken Special Operative permissions from %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1437. Log("logs/admin.log", string);
  1438. DBLog(playerid, giveplayerid, "Admin", "removed from special ops");
  1439. }
  1440. }
  1441. else if(strcmp(task, "ba", true) == 0)
  1442. {
  1443. if(PlayerInfo[giveplayerid][pBanAppealer] == 0)
  1444. {
  1445. PlayerInfo[giveplayerid][pBanAppealer] = 1;
  1446. SendClientMessage(playerid, COLOR_WHITE, "You have made them a Ban Appealer");
  1447. SendClientMessage(giveplayerid, COLOR_WHITE, "You have been made a Ban Appealer");
  1448. format(string, sizeof(string), "%s has given Ban Appealer to %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1449. Log("logs/admin.log", string);
  1450. DBLog(playerid, giveplayerid, "Admin", "issued ban appealer");
  1451. }
  1452. else
  1453. {
  1454. PlayerInfo[giveplayerid][pBanAppealer] = 0;
  1455. SendClientMessageEx(playerid, COLOR_GREY, "You have taken their Ban Appealer");
  1456. SendClientMessage(giveplayerid, COLOR_GREY, "You have had your Ban Appealer taken");
  1457. format(string, sizeof(string), "%s has taken Ban Appealer from %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1458. Log("logs/admin.log", string);
  1459. DBLog(playerid, giveplayerid, "Admin", "removed from ban appealer");
  1460. }
  1461. }
  1462. else if(strcmp(task, "st", true) == 0)
  1463. {
  1464. if(PlayerInfo[giveplayerid][pShopTech] == 0)
  1465. {
  1466. PlayerInfo[giveplayerid][pShopTech] = 1;
  1467. SendClientMessage(playerid, COLOR_WHITE, "You have made them a Shop Technician");
  1468. SendClientMessage(giveplayerid, COLOR_WHITE, "You have been made a Shop Technician");
  1469. format(string, sizeof(string), "%s has given Shop Technician to %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1470. Log("logs/admin.log", string);
  1471. DBLog(playerid, giveplayerid, "Admin", "issued shop tech");
  1472. }
  1473. else
  1474. {
  1475. PlayerInfo[giveplayerid][pShopTech] = 0;
  1476. SendClientMessageEx(playerid, COLOR_GREY, "You have taken their Shop Technician");
  1477. SendClientMessage(giveplayerid, COLOR_GREY, "You have had your Shop Technician taken");
  1478. format(string, sizeof(string), "%s has taken Shop Technician from %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1479. Log("logs/admin.log", string);
  1480. DBLog(playerid, giveplayerid, "Admin", "removed from shop tech");
  1481. }
  1482. }
  1483. else if(strcmp(task, "pr", true) == 0)
  1484. {
  1485. if(PlayerInfo[giveplayerid][pPR] == 0)
  1486. {
  1487. PlayerInfo[giveplayerid][pPR] = 1;
  1488. SendClientMessage(playerid, COLOR_WHITE, "You have made them a member of Public Relations");
  1489. SendClientMessage(giveplayerid, COLOR_WHITE, "You have been made a member of Public Relations");
  1490. format(string, sizeof(string), "%s has given Public Relations permissions to %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1491. Log("logs/admin.log", string);
  1492. DBLog(playerid, giveplayerid, "Admin", "issued public relations");
  1493. }
  1494. else
  1495. {
  1496. PlayerInfo[giveplayerid][pPR] = 0;
  1497. SendClientMessageEx(playerid, COLOR_GREY, "You have taken their Public Relations permissions");
  1498. SendClientMessage(giveplayerid, COLOR_GREY, "You have had your Public Relations permissions taken");
  1499. format(string, sizeof(string), "%s has taken Public Relations permissions from %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1500. Log("logs/admin.log", string);
  1501. DBLog(playerid, giveplayerid, "Admin", "removed from public relations");
  1502. }
  1503. }
  1504. else if(strcmp(task, "hr", true) == 0)
  1505. {
  1506. if(PlayerInfo[giveplayerid][pHR] == 0)
  1507. {
  1508. PlayerInfo[giveplayerid][pHR] = 1;
  1509. SendClientMessage(playerid, COLOR_WHITE, "You have made them a member of Human Resources");
  1510. SendClientMessage(giveplayerid, COLOR_WHITE, "You have been made a member of Human Resources");
  1511. format(string, sizeof(string), "%s has given Human Resources permissions to %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1512. Log("logs/admin.log", string);
  1513. DBLog(playerid, giveplayerid, "Admin", "issued human resources");
  1514. }
  1515. else
  1516. {
  1517. PlayerInfo[giveplayerid][pHR] = 0;
  1518. SendClientMessageEx(playerid, COLOR_GREY, "You have taken their Human Resources permissions");
  1519. SendClientMessage(giveplayerid, COLOR_GREY, "You have had your Human Resources permissions taken");
  1520. format(string, sizeof(string), "%s has taken Human Resources permissions from %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1521. Log("logs/admin.log", string);
  1522. DBLog(playerid, giveplayerid, "Admin", "removed from human resources");
  1523. }
  1524. }
  1525. else if(strcmp(task, "dosm", true) == 0)
  1526. {
  1527. if(PlayerInfo[giveplayerid][pHR] == 0)
  1528. {
  1529. PlayerInfo[giveplayerid][pHR] = 2;
  1530. SendClientMessage(playerid, COLOR_WHITE, "You have made them a level 2 member of Human Resources");
  1531. SendClientMessage(giveplayerid, COLOR_WHITE, "You have been made a level 2 member of Human Resources");
  1532. format(string, sizeof(string), "%s has given level 2 Human Resources permissions to %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1533. Log("logs/admin.log", string);
  1534. DBLog(playerid, giveplayerid, "Admin", "issued human resources");
  1535. }
  1536. else
  1537. {
  1538. PlayerInfo[giveplayerid][pHR] = 0;
  1539. SendClientMessageEx(playerid, COLOR_GREY, "You have taken their Human Resources permissions");
  1540. SendClientMessage(giveplayerid, COLOR_GREY, "You have had your Human Resources permissions taken");
  1541. format(string, sizeof(string), "%s has taken Human Resources permissions from %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1542. Log("logs/admin.log", string);
  1543. DBLog(playerid, giveplayerid, "Admin", "removed from human resources");
  1544. }
  1545. }
  1546. else if(strcmp(task, "sec", true) == 0)
  1547. {
  1548. if(PlayerInfo[giveplayerid][pSecurity] == 0)
  1549. {
  1550. PlayerInfo[giveplayerid][pSecurity] = 1;
  1551. SendClientMessage(playerid, COLOR_WHITE, "You have made them a member of Security");
  1552. SendClientMessage(giveplayerid, COLOR_WHITE, "You have been made a member of Security");
  1553. format(string, sizeof(string), "%s has given Security permissions to %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1554. Log("logs/admin.log", string);
  1555. DBLog(playerid, giveplayerid, "Admin", "issued security");
  1556. }
  1557. else
  1558. {
  1559. PlayerInfo[giveplayerid][pSecurity] = 0;
  1560. SendClientMessageEx(playerid, COLOR_GREY, "You have taken their Security permissions");
  1561. SendClientMessage(giveplayerid, COLOR_GREY, "You have had your Security permissions taken");
  1562. format(string, sizeof(string), "%s has taken Security permissions from %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1563. Log("logs/admin.log", string);
  1564. DBLog(playerid, giveplayerid, "Admin", "removed from security");
  1565. }
  1566. }
  1567. else if(strcmp(task, "bm", true) == 0)
  1568. {
  1569. if(PlayerInfo[giveplayerid][pBM] == 0)
  1570. {
  1571. PlayerInfo[giveplayerid][pBM] = 1;
  1572. SendClientMessage(playerid, COLOR_WHITE, "You have made them a Business Moderator");
  1573. SendClientMessage(giveplayerid, COLOR_WHITE, "You have been made a Business Moderator");
  1574. format(string, sizeof(string), "%s has given Business Moderator permissions to %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1575. Log("logs/admin.log", string);
  1576. DBLog(playerid, giveplayerid, "Admin", "issued business moderator");
  1577. }
  1578. else
  1579. {
  1580. PlayerInfo[giveplayerid][pBM] = 0;
  1581. SendClientMessageEx(playerid, COLOR_GREY, "You have taken their Business Moderator");
  1582. SendClientMessage(giveplayerid, COLOR_GREY, "You have had your Business Moderator taken");
  1583. format(string, sizeof(string), "%s has taken Business Moderator permissions from %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1584. Log("logs/admin.log", string);
  1585. DBLog(playerid, giveplayerid, "Admin", "removed from business moderator");
  1586. }
  1587. }
  1588. else if(strcmp(task, "asm", true) == 0)
  1589. {
  1590. if(PlayerInfo[giveplayerid][pASM] == 0)
  1591. {
  1592. PlayerInfo[giveplayerid][pASM] = 1;
  1593. SendClientMessage(playerid, COLOR_WHITE, "You have made them an Assistant Shift Manager");
  1594. SendClientMessage(giveplayerid, COLOR_WHITE, "You have been made an Assistant Shift Manager");
  1595. format(string, sizeof(string), "%s has given Assistant Shift Manager permissions to %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1596. Log("logs/admin.log", string);
  1597. DBLog(playerid, giveplayerid, "Admin", "issued Assistant Shift Manager");
  1598. }
  1599. else
  1600. {
  1601. PlayerInfo[giveplayerid][pASM] = 0;
  1602. SendClientMessageEx(playerid, COLOR_GREY, "You have taken their Assistant Shift Manager");
  1603. SendClientMessage(giveplayerid, COLOR_GREY, "You have had your Assistant Shift Manager taken");
  1604. format(string, sizeof(string), "%s has taken Assistant Shift Manager permissions from %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1605. Log("logs/admin.log", string);
  1606. DBLog(playerid, giveplayerid, "Admin", "removed from Assistant Shift Manager");
  1607. }
  1608. }
  1609. }
  1610. else SendClientMessage(playerid, COLOR_GRAD2, "They are not an admin!");
  1611. }
  1612. else SendClientMessageEx(playerid, COLOR_GRAD2, "That person is not connected.");
  1613. }
  1614. else SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
  1615. return 1;
  1616. }
  1617. CMD:removepvehicle(playerid, params[])
  1618. {
  1619. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  1620. {
  1621. new giveplayerid;
  1622. if(sscanf(params, "u", giveplayerid)) {
  1623. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /removepvehicle [player]");
  1624. return 1;
  1625. }
  1626. szMiscArray[0] = 0;
  1627. for(new i, iModelID; i < GetPlayerVehicleSlots(giveplayerid); i++) {
  1628. if((iModelID = PlayerVehicleInfo[giveplayerid][i][pvModelId] - 400) >= 0) {
  1629. if(PlayerVehicleInfo[giveplayerid][i][pvImpounded]) {
  1630. format(szMiscArray, sizeof(szMiscArray), "%s\n%s (impounded)", szMiscArray, VehicleName[iModelID]);
  1631. }
  1632. else if(PlayerVehicleInfo[giveplayerid][i][pvDisabled]) {
  1633. format(szMiscArray, sizeof(szMiscArray), "%s\n%s (disabled)", szMiscArray, VehicleName[iModelID]);
  1634. }
  1635. else if(!PlayerVehicleInfo[giveplayerid][i][pvSpawned]) {
  1636. format(szMiscArray, sizeof(szMiscArray), "%s\n%s (stored)", szMiscArray, VehicleName[iModelID]);
  1637. }
  1638. else format(szMiscArray, sizeof(szMiscArray), "%s\n%s (spawned)", szMiscArray, VehicleName[iModelID]);
  1639. }
  1640. else strcat(szMiscArray, "\nEmpty");
  1641. }
  1642. new string[64];
  1643. SetPVarInt(playerid, "vehcheck_giveplayerid", giveplayerid);
  1644. format(string, sizeof(string), "%s's Vehicle List", GetPlayerNameEx(giveplayerid));
  1645. ShowPlayerDialogEx(playerid, ADMIN_VEHCHECK, DIALOG_STYLE_LIST, string, szMiscArray, "Delete Car", "Cancel");
  1646. }
  1647. return 1;
  1648. }
  1649. CMD:makeadmin(playerid, params[]) {
  1650. if(PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pAP] >= 2 || PlayerInfo[playerid][pHR] >= 3) {
  1651. new
  1652. iAdminValue,
  1653. iTargetID;
  1654. if(sscanf(params, "ui", iTargetID, iAdminValue)) {
  1655. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /makeadmin [player] [level]");
  1656. }
  1657. else if(IsPlayerConnected(iTargetID)) {
  1658. if(PlayerInfo[iTargetID][pHelper] >= 1) {
  1659. SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot make Advisors admins!");
  1660. }
  1661. if(PlayerInfo[iTargetID][pAdmin] == iAdminValue) return SendClientMessageEx(playerid, COLOR_GREY, "This person already has this administrator level.");
  1662. else {
  1663. if(PlayerInfo[iTargetID][pStaffBanned] >= 1) return SendClientMessage(playerid, COLOR_WHITE, "That player is currently staff banned.");
  1664. /*new
  1665. szMessage[47 + (MAX_PLAYER_NAME * 2)];*/
  1666. PriorityReport[iTargetID] = TextDrawCreate(261.000000, 373.000000, "New Report");
  1667. TextDrawBackgroundColor(PriorityReport[iTargetID], 255);
  1668. TextDrawFont(PriorityReport[iTargetID], 2);
  1669. TextDrawLetterSize(PriorityReport[iTargetID], 0.460000, 1.800000);
  1670. TextDrawColor(PriorityReport[iTargetID], -65281);
  1671. TextDrawSetOutline(PriorityReport[iTargetID], 0);
  1672. TextDrawSetProportional(PriorityReport[iTargetID], 1);
  1673. TextDrawSetShadow(PriorityReport[iTargetID], 1);
  1674. new szRank[128];
  1675. switch(iAdminValue) {
  1676. case 0: format(szRank, sizeof(szRank), "AdmCmd: %s has removed %s's administrator rank.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID));
  1677. case 1: format(szRank, sizeof(szRank), "AdmCmd: %s has made %s a Server Moderator.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID));
  1678. case 2: format(szRank, sizeof(szRank), "AdmCmd: %s has made %s a Junior Administrator.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID));
  1679. case 3: format(szRank, sizeof(szRank), "AdmCmd: %s has made %s a General Administrator.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID));
  1680. case 4: format(szRank, sizeof(szRank), "AdmCmd: %s has made %s a Senior Administrator.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID));
  1681. case 1337: format(szRank, sizeof(szRank), "AdmCmd: %s has made %s a Head Administrator.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID));
  1682. case 99999: format(szRank, sizeof(szRank), "AdmCmd: %s has made %s an Executive Administrator.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID));
  1683. default: format(szRank, sizeof(szRank), "AdmCmd: %s has made %s an undefined level administrator.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID));
  1684. }
  1685. PlayerInfo[iTargetID][pAdmin] = iAdminValue;
  1686. ABroadCast(COLOR_LIGHTRED, szRank, 2);
  1687. Log("logs/admin.log", szRank);
  1688. switch(iAdminValue) {
  1689. case 0: format(szRank, sizeof(szRank), "Your administrator rank has been removed by %s.", GetPlayerNameEx(playerid));
  1690. case 1: format(szRank, sizeof(szRank), "You have been made a Server Moderator by %s.", GetPlayerNameEx(playerid));
  1691. case 2: format(szRank, sizeof(szRank), "You have been made a Junior Administrator by %s.", GetPlayerNameEx(playerid));
  1692. case 3: format(szRank, sizeof(szRank), "You have been made a General Administrator by %s.", GetPlayerNameEx(playerid));
  1693. case 4: format(szRank, sizeof(szRank), "You have been made a Senior Administrator by %s.", GetPlayerNameEx(playerid));
  1694. case 1337: format(szRank, sizeof(szRank), "You have been made a Head Administrator by %s.", GetPlayerNameEx(playerid));
  1695. case 99999: format(szRank, sizeof(szRank), "You have been made an Executive Administrator by %s.", GetPlayerNameEx(playerid));
  1696. default: format(szRank, sizeof(szRank), "You have been made an undefined level administrator by %s.", GetPlayerNameEx(playerid));
  1697. }
  1698. SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szRank);
  1699. switch(iAdminValue) {
  1700. case 0: format(szRank, sizeof(szRank), "You have removed %s's administrator rank.", GetPlayerNameEx(iTargetID));
  1701. case 1: format(szRank, sizeof(szRank), "You have made %s a Server Moderator.", GetPlayerNameEx(iTargetID));
  1702. case 2: format(szRank, sizeof(szRank), "You have made %s a Junior Administrator.", GetPlayerNameEx(iTargetID));
  1703. case 3: format(szRank, sizeof(szRank), "You have made %s a General Administrator.", GetPlayerNameEx(iTargetID));
  1704. case 4: format(szRank, sizeof(szRank), "You have made %s a Senior Administrator.", GetPlayerNameEx(iTargetID));
  1705. case 1337: format(szRank, sizeof(szRank), "You have made %s a Head Administrator.", GetPlayerNameEx(iTargetID));
  1706. case 99999: format(szRank, sizeof(szRank), "You have made %s an Executive Administrator.", GetPlayerNameEx(iTargetID));
  1707. default: format(szRank, sizeof(szRank), "You have made %s an undefined level administrator.", GetPlayerNameEx(iTargetID));
  1708. }
  1709. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szRank);
  1710. format(szMiscArray, sizeof(szMiscArray), "was made a %s (%d)", GetAdminRankName(iAdminValue), iAdminValue);
  1711. DBLog(playerid, iTargetID, "Admin", szMiscArray);
  1712. }
  1713. }
  1714. else SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
  1715. }
  1716. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  1717. return 1;
  1718. }
  1719. CMD:apark(playerid, params[]) {
  1720. if (PlayerInfo[playerid][pAdmin] >= 3)
  1721. {
  1722. foreach(new ownerid: Player)
  1723. {
  1724. for(new d = 0 ; d < MAX_PLAYERVEHICLES; d++)
  1725. {
  1726. if(IsPlayerInVehicle(playerid, PlayerVehicleInfo[ownerid][d][pvId]))
  1727. {
  1728. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessageEx(playerid, COLOR_GREY, "You must be in the driver seat.");
  1729. new Float:x, Float:y, Float:z, Float:angle, Float:health;
  1730. if(PlayerInfo[playerid][pLockCar] == GetPlayerVehicleID(playerid)) PlayerInfo[playerid][pLockCar] = INVALID_VEHICLE_ID;
  1731. if(IsARC(GetPlayerVehicleID(playerid))) // RC Vehicles
  1732. {
  1733. new Float:vehPos[3];
  1734. GetVehiclePos(GetPlayerVehicleID(playerid),vehPos[0], vehPos[1], vehPos[2]);
  1735. SetPlayerPos(playerid,vehPos[0], vehPos[1]+0.5, vehPos[2]+0.5);
  1736. }
  1737. GetVehicleHealth(PlayerVehicleInfo[ownerid][d][pvId], health);
  1738. GetVehiclePos(PlayerVehicleInfo[ownerid][d][pvId], x, y, z);
  1739. GetVehicleZAngle(PlayerVehicleInfo[ownerid][d][pvId], angle);
  1740. SurfingCheck(GetPlayerVehicleID(playerid));
  1741. UpdatePlayerVehicleParkPosition(ownerid, d, x, y, z, angle, health, GetPlayerVirtualWorld(ownerid), GetPlayerInterior(ownerid));
  1742. IsPlayerEntering{playerid} = true;
  1743. PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
  1744. SetPlayerArmedWeapon(playerid, 0);
  1745. new szMessage[128];
  1746. format(szMessage, sizeof(szMessage),"* You have parked %s's %s.",GetPlayerNameEx(ownerid), VehicleName[PlayerVehicleInfo[ownerid][d][pvModelId] - 400]);
  1747. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
  1748. format(szMessage, sizeof(szMessage), "Your %s has been parked at another location by an admin. Use /trackcar to find it.", VehicleName[PlayerVehicleInfo[ownerid][d][pvModelId] - 400]);
  1749. SendClientMessageEx(ownerid, COLOR_LIGHTBLUE, szMessage);
  1750. return 1;
  1751. }
  1752. }
  1753. }
  1754. }
  1755. else
  1756. {
  1757. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  1758. }
  1759. return 1;
  1760. }
  1761. CMD:a(playerid, params[]) {
  1762. return cmd_admin(playerid, params);
  1763. }
  1764. CMD:admin(playerid, params[]) {
  1765. if(PlayerInfo[playerid][pAdmin] >= 2) {
  1766. if(!isnull(params)) {
  1767. new
  1768. szMessage[128];
  1769. format(szMessage, sizeof(szMessage), "* %s %s: %s", GetAdminRankName(PlayerInfo[playerid][pAdmin]), GetPlayerNameEx(playerid), params);
  1770. foreach(new i: Player)
  1771. {
  1772. if(PlayerInfo[i][pAdmin] >= 2)
  1773. {
  1774. SendClientMessage(i, COLOR_YELLOW, szMessage);
  1775. }
  1776. }
  1777. format(szMessage, sizeof(szMessage), "%s %s: %s", GetAdminRankName(PlayerInfo[playerid][pAdmin]), GetPlayerNameEx(playerid), params);
  1778. //SendDiscordMessage(0, szMessage);
  1779. }
  1780. else SendClientMessageEx(playerid, COLOR_GREY, "USAGE: (/a)dmin [admin chat]");
  1781. }
  1782. return 1;
  1783. }
  1784. CMD:ha(playerid, params[]) {
  1785. return cmd_headadmin(playerid, params);
  1786. }
  1787. CMD:headadmin(playerid, params[]) {
  1788. if(PlayerInfo[playerid][pAdmin] >= 1337) {
  1789. if(!isnull(params)) {
  1790. new
  1791. szMessage[128];
  1792. format(szMessage, sizeof(szMessage), "(PRIVATE) %s %s: %s", GetAdminRankName(PlayerInfo[playerid][pAdmin]), GetPlayerNameEx(playerid), params);
  1793. foreach(new i: Player)
  1794. {
  1795. if(PlayerInfo[i][pAdmin] >= 1337)
  1796. {
  1797. SendClientMessage(i, COLOR_GREEN, szMessage);
  1798. }
  1799. }
  1800. format(szMessage, sizeof(szMessage), "%s %s: %s", GetAdminRankName(PlayerInfo[playerid][pAdmin]), GetPlayerNameEx(playerid), params);
  1801. //SendDiscordMessage(2, szMessage);
  1802. }
  1803. else SendClientMessageEx(playerid, COLOR_GREY, "USAGE: (/ha)eadmin [Head admin+ chat]");
  1804. }
  1805. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  1806. return 1;
  1807. }
  1808. CMD:staff(playerid, params[]) {
  1809. if((PlayerInfo[playerid][pHelper] >= 2 || PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pVIPMod] || PlayerInfo[playerid][pWatchdog] >= 1) && PlayerInfo[playerid][pToggledChats][15] == 0) {
  1810. if(PlayerInfo[playerid][pJailTime] && strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1) return SendClientMessageEx(playerid, COLOR_GREY, "OOC prisoners are restricted to only speak in /b");
  1811. if(!isnull(params)) {
  1812. szMiscArray[0] = 0;
  1813. if(PlayerInfo[playerid][pAdmin] == 2) format(szMiscArray, sizeof(szMiscArray), "** Junior Admin %s: %s", GetPlayerNameEx(playerid), params);
  1814. else if(PlayerInfo[playerid][pAdmin] == 3) format(szMiscArray, sizeof(szMiscArray), "** General Admin %s: %s", GetPlayerNameEx(playerid), params);
  1815. else if(PlayerInfo[playerid][pAdmin] == 4) format(szMiscArray, sizeof(szMiscArray), "** Senior Admin %s: %s", GetPlayerNameEx(playerid), params);
  1816. else if(PlayerInfo[playerid][pAdmin] == 1337) format(szMiscArray, sizeof(szMiscArray), "** Head Admin %s: %s", GetPlayerNameEx(playerid), params);
  1817. else if(PlayerInfo[playerid][pAdmin] == 99999) format(szMiscArray, sizeof(szMiscArray), "** Executive Admin %s: %s", GetPlayerNameEx(playerid), params);
  1818. else if(PlayerInfo[playerid][pHelper] == 2) format(szMiscArray, sizeof(szMiscArray), "** Advisor %s: %s", GetPlayerNameEx(playerid), params);
  1819. else if(PlayerInfo[playerid][pHelper] == 3) format(szMiscArray, sizeof(szMiscArray), "** Senior Advisor %s: %s", GetPlayerNameEx(playerid), params);
  1820. else if(PlayerInfo[playerid][pHelper] >= 4) format(szMiscArray, sizeof(szMiscArray), "** Chief Advisor %s: %s", GetPlayerNameEx(playerid), params);
  1821. else if(PlayerInfo[playerid][pAdmin] == 1)
  1822. {
  1823. if(PlayerInfo[playerid][pSMod] != 0) format(szMiscArray, sizeof(szMiscArray), "** Senior Moderator %s: %s", GetPlayerNameEx(playerid), params);
  1824. else format(szMiscArray, sizeof(szMiscArray), "** Server Moderator %s: %s", GetPlayerNameEx(playerid), params);
  1825. }
  1826. else if(PlayerInfo[playerid][pVIPMod] == 1) format(szMiscArray, sizeof(szMiscArray), "** VIP Moderator %s: %s", GetPlayerNameEx(playerid), params);
  1827. else if(PlayerInfo[playerid][pVIPMod] == 2) format(szMiscArray, sizeof(szMiscArray), "** Senior VIP Moderator %s: %s", GetPlayerNameEx(playerid), params);
  1828. else if(PlayerInfo[playerid][pWatchdog] == 1) format(szMiscArray, sizeof(szMiscArray), "** Watchdog %s: %s", GetPlayerNameEx(playerid), params);
  1829. else if(PlayerInfo[playerid][pWatchdog] == 2) format(szMiscArray, sizeof(szMiscArray), "** Senior Watchdog %s: %s", GetPlayerNameEx(playerid), params);
  1830. else if(PlayerInfo[playerid][pWatchdog] == 3) format(szMiscArray, sizeof(szMiscArray), "** RP Specialist %s: %s", GetPlayerNameEx(playerid), params);
  1831. else if(PlayerInfo[playerid][pWatchdog] == 4) format(szMiscArray, sizeof(szMiscArray), "** Director of RP Improvement %s: %s", GetPlayerNameEx(playerid), params);
  1832. else format(szMiscArray, sizeof(szMiscArray), "** Undefined Admin (%d) %s: %s", PlayerInfo[playerid][pAdmin], GetPlayerNameEx(playerid), params);
  1833. SendAdvisorMessage(COLOR_COMBINEDCHAT, szMiscArray);
  1834. Log("logs/staffchat.log", szMiscArray);
  1835. ChatDBLog(playerid, "StaffChat", szMiscArray);
  1836. }
  1837. else SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /staff [chat]");
  1838. }
  1839. return 1;
  1840. }
  1841. CMD:cnn(playerid, params[]) {
  1842. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1) {
  1843. if(!isnull(params)) {
  1844. format(szMiscArray, sizeof(szMiscArray), "~b~%s: ~w~%s",GetPlayerNameEx(playerid), params);
  1845. foreach(new i: Player)
  1846. {
  1847. GameTextForPlayer(i, szMiscArray, 5000, 6);
  1848. }
  1849. }
  1850. else SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /cnn [message]. ~n~ = new line, ~r~ = red, ~g~ = green, ~b~ = blue, ~w~ = white, ~y~ = yellow.");
  1851. }
  1852. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  1853. return 1;
  1854. }
  1855. CMD:veh(playerid, params[]) {
  1856. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1) {
  1857. new
  1858. iVehicle,
  1859. iColors[2];
  1860. if(sscanf(params, "iD(0)D(0)", iVehicle, iColors[0], iColors[1])) {
  1861. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /veh [model ID] [color 1] [color 2]");
  1862. }
  1863. else if(!(400 <= iVehicle <= 611)) {
  1864. SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid model specified (model IDs start at 400, and end at 611).");
  1865. }
  1866. else if(IsATrain(iVehicle)) {
  1867. SendClientMessageEx(playerid, COLOR_GREY, "Trains cannot be spawned during runtime.");
  1868. }
  1869. else if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255)) {
  1870. SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid color specified (IDs start at 0, and end at 255).");
  1871. }
  1872. else for(new iIterator; iIterator < sizeof(CreatedCars); iIterator++) if(iIterator >= 49) {
  1873. return SendClientMessageEx(playerid, COLOR_GRAD1, "The maximum limit of 50 spawned vehicles has been reached.");
  1874. }
  1875. else if(CreatedCars[iIterator] == INVALID_VEHICLE_ID) {
  1876. new
  1877. Float: fVehPos[4];
  1878. new fVW = GetPlayerVirtualWorld(playerid);
  1879. GetPlayerPos(playerid, fVehPos[0], fVehPos[1], fVehPos[2]);
  1880. GetPlayerFacingAngle(playerid, fVehPos[3]);
  1881. CreatedCars[iIterator] = CreateVehicle(iVehicle, fVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
  1882. VehicleFuel[CreatedCars[iIterator]] = 100.0;
  1883. Vehicle_ResetData(CreatedCars[iIterator]);
  1884. LinkVehicleToInterior(CreatedCars[iIterator], GetPlayerInterior(playerid));
  1885. SetVehicleVirtualWorld(CreatedCars[iIterator], fVW);
  1886. return SendClientMessageEx(playerid, COLOR_GREY, "Vehicle spawned!");
  1887. }
  1888. }
  1889. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  1890. return 1;
  1891. }
  1892. CMD:cnnn(playerid, params[]) {
  1893. if(PlayerInfo[playerid][pAdmin] >= 1337) {
  1894. new
  1895. iTextID,
  1896. szMessage[128];
  1897. if(sscanf(params, "is[128]", iTextID, szMessage)) {
  1898. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /cnnn [type 1-6] [message]. ~n~ = new line, ~r~ = red, ~g~ = green, ~b~ = blue, ~w~ = white, ~y~ = yellow.");
  1899. }
  1900. else if(!(0 <= iTextID <= 6 && iTextID != 2)) {
  1901. SendClientMessageEx(playerid, COLOR_GRAD2, "Text ID must be between 0 and 6, but not 2 (due to SA:MP bugs).");
  1902. }
  1903. else GameTextForAll(szMessage, 5000, iTextID);
  1904. }
  1905. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  1906. return 1;
  1907. }
  1908. CMD:gotopveh(playerid, params[]) {
  1909. if(PlayerInfo[playerid][pAdmin] >= 2) {
  1910. new iTargetID;
  1911. if(sscanf(params, "u", iTargetID)) {
  1912. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /gotopveh [player]");
  1913. }
  1914. else if(IsPlayerConnected(iTargetID)) {
  1915. new szVehString[8024], icount = GetPlayerVehicleSlots(iTargetID);
  1916. if(!GetPlayerVehicleCount(iTargetID)) return SendClientMessageEx(playerid, COLOR_GREY, "ERROR: Player doesn't own any vehicles.");
  1917. new szCarLocation[MAX_ZONE_NAME];
  1918. for(new i, iModelID; i < icount; i++)
  1919. {
  1920. Get3DZone(PlayerVehicleInfo[iTargetID][i][pvPosX], PlayerVehicleInfo[iTargetID][i][pvPosY], PlayerVehicleInfo[iTargetID][i][pvPosZ], szCarLocation, sizeof(szCarLocation));
  1921. if((iModelID = PlayerVehicleInfo[iTargetID][i][pvModelId] - 400) >= 0)
  1922. {
  1923. if(PlayerVehicleInfo[iTargetID][i][pvImpounded]) {
  1924. format(szVehString, sizeof(szVehString), "%s\n%s (impounded) | Location: DMV", szVehString, VehicleName[iModelID]);
  1925. }
  1926. else if(PlayerVehicleInfo[iTargetID][i][pvDisabled]) {
  1927. format(szVehString, sizeof(szVehString), "%s\n%s (disabled) | Location: Unknown", szVehString, VehicleName[iModelID]);
  1928. }
  1929. else if(!PlayerVehicleInfo[iTargetID][i][pvSpawned]) {
  1930. format(szVehString, sizeof(szVehString), "%s\n%s (stored)", szVehString, VehicleName[iModelID]);
  1931. }
  1932. else format(szVehString, sizeof(szVehString), "%s\n%s (ID %i) | Location: %s", szVehString, VehicleName[iModelID], PlayerVehicleInfo[iTargetID][i][pvId], szCarLocation);
  1933. }
  1934. }
  1935. ShowPlayerDialogEx(playerid, GOTOPLAYERCAR, DIALOG_STYLE_LIST, "Vehicle Teleportation", szVehString, "Teleport", "Cancel");
  1936. SetPVarInt(playerid, "playeraffectedcarTP", iTargetID);
  1937. }
  1938. else SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1939. {
  1940. }
  1941. }
  1942. return 1;
  1943. }
  1944. CMD:reloadpvehicles(playerid, params[])
  1945. {
  1946. if (PlayerInfo[playerid][pAdmin] < 3)
  1947. {
  1948. SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
  1949. return 1;
  1950. }
  1951. new string[128], giveplayerid;
  1952. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /reloadpvehicles [player]");
  1953. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "Player specified is invalid!");
  1954. UnloadPlayerVehicles(giveplayerid);
  1955. LoadPlayerVehicles(giveplayerid);
  1956. format(string, sizeof(string), " You have successfully reloaded %s's Vehicles.", GetPlayerNameEx(giveplayerid));
  1957. SendClientMessageEx(playerid, COLOR_GREY, string);
  1958. return 1;
  1959. }
  1960. CMD:reloadpveh(playerid, params[])
  1961. {
  1962. return cmd_reloadpvehicles(playerid, params);
  1963. }
  1964. CMD:unloadpvehicles(playerid, params[])
  1965. {
  1966. if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessageEx(playerid, COLOR_GREY, "You're not authorized to use this command!");
  1967. foreach(new p: Player)
  1968. {
  1969. UnloadPlayerVehicles(p);
  1970. }
  1971. SendClientMessageEx(playerid, COLOR_GREY, "You have successfully unloaded all vehicles.");
  1972. return 1;
  1973. }
  1974. CMD:loadpvehicles(playerid, params[])
  1975. {
  1976. if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessageEx(playerid, COLOR_GREY, "You're not authorized to use this command!");
  1977. foreach(new p: Player)
  1978. {
  1979. LoadPlayerVehicles(p);
  1980. }
  1981. SendClientMessageEx(playerid, COLOR_GREY, "You have successfully loaded all vehicles.");
  1982. return 1;
  1983. }
  1984. CMD:createpvehicle(playerid, params[]) {
  1985. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  1986. {
  1987. new iColors[2], iTargetID, iModelID;
  1988. if(sscanf(params, "uiD(0)D(0)", iTargetID, iModelID, iColors[0], iColors[1])) SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /createpvehicle [player] [model] [color 1] [color 2]");
  1989. else if(!(400 <= iModelID <= 611)) SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid model specified (model IDs start at 400, and end at 611).");
  1990. else if(IsATrain(iModelID)) SendClientMessageEx(playerid, COLOR_GREY, "Trains cannot be spawned during runtime.");
  1991. else if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255)) SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid color specified (IDs start at 0, and end at 255).");
  1992. else if(!vehicleCountCheck(iTargetID)) SendClientMessageEx(playerid, COLOR_GREY, "That person can't have more vehicles - they own too many.");
  1993. else if(!vehicleSpawnCountCheck(iTargetID)) SendClientMessageEx(playerid, COLOR_GREY, "That person has too many vehicles spawned - they must store one first.");
  1994. else if(PlayerInfo[iTargetID][pLevel] == 1 && PlayerInfo[iTargetID][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_RED, "You can't use /givemoney on level 1's");
  1995. else
  1996. {
  1997. new Float: arr_fPlayerPos[4], szMessage[84];
  1998. GetPlayerPos(iTargetID, arr_fPlayerPos[0], arr_fPlayerPos[1], arr_fPlayerPos[2]);
  1999. GetPlayerFacingAngle(iTargetID, arr_fPlayerPos[3]);
  2000. CreatePlayerVehicle(iTargetID, GetPlayerFreeVehicleId(iTargetID), iModelID, arr_fPlayerPos[0], arr_fPlayerPos[1], arr_fPlayerPos[2], arr_fPlayerPos[3], iColors[0], iColors[1], 2000000, GetPlayerVirtualWorld(iTargetID), GetPlayerInterior(iTargetID));
  2001. format(szMessage, sizeof(szMessage), "You have successfully created a %s for %s.", VehicleName[iModelID - 400], GetPlayerNameEx(iTargetID));
  2002. SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
  2003. format(szMessage, sizeof(szMessage), "%s created a %s (%i) for %s(%d)", GetPlayerNameEx(playerid), VehicleName[iModelID - 400], iModelID, GetPlayerNameEx(iTargetID), GetPlayerSQLId(iTargetID));
  2004. Log("logs/playervehicle.log", szMessage);
  2005. format(szMiscArray, sizeof(szMiscArray), "created a %s (%d)", VehicleName[iModelID - 400], iModelID);
  2006. DBLog(playerid, iTargetID, "PlayerVehicle", szMiscArray);
  2007. }
  2008. }
  2009. else SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
  2010. return 1;
  2011. }
  2012. CMD:ip(playerid, params[])
  2013. {
  2014. if(PlayerInfo[playerid][pAdmin] >= 2)
  2015. {
  2016. if(isnull(params)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /ip [ip]");
  2017. new string[128], IP[32];
  2018. foreach(new i: Player)
  2019. {
  2020. GetPlayerIp(i, IP, sizeof(IP));
  2021. if(strfind(IP, params, true) != -1 && PlayerInfo[i][pAdmin] <= PlayerInfo[playerid][pAdmin])
  2022. {
  2023. format(string, sizeof(string), "Player: %s (ID: %d) (Level: %d) | IP: %s", GetPlayerNameEx(i), i, PlayerInfo[i][pLevel], IP);
  2024. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2025. format(string, sizeof(string), "%s has IP Checked %s(%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(i), GetPlayerSQLId(i));
  2026. if(PlayerInfo[i][pAdmin] >= 2) {
  2027. Log("logs/adminipcheck.log", string);
  2028. DBLog(playerid, i, "AdminIPCheck", "performed an IP check");
  2029. }
  2030. else {
  2031. Log("logs/ipcheck.log", string);
  2032. DBLog(playerid, i, "IPCheck", "performed an IP check");
  2033. }
  2034. }
  2035. }
  2036. }
  2037. return 1;
  2038. }
  2039. CMD:unlockveh(playerid, params[])
  2040. {
  2041. if(PlayerInfo[playerid][pAdmin] >= 3)
  2042. {
  2043. new vehicleid;
  2044. if(sscanf(params, "d", vehicleid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /unlockveh [vehicle id]");
  2045. if(IsValidVehicleID(vehicleid))
  2046. {
  2047. vehicle_unlock_doors(vehicleid);
  2048. GameTextForPlayer(playerid, "~g~unlocked", 1000, 6);
  2049. PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  2050. }
  2051. else
  2052. {
  2053. SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid vehicle ID");
  2054. }
  2055. }
  2056. return 1;
  2057. }
  2058. CMD:ounsuspend(playerid, params[])
  2059. {
  2060. if(PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pAP] >= 2 || PlayerInfo[playerid][pHR] >= 3)
  2061. {
  2062. new string[128], query[512], tmpName[24];
  2063. if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ounsuspend [player name]");
  2064. mysql_escape_string(params, tmpName);
  2065. SetPVarString(playerid, "OnSetSuspended", tmpName);
  2066. mysql_format(MainPipeline, query,sizeof(query),"UPDATE `accounts` SET `Disabled` = 0 WHERE `Username` = '%s' AND `AdminLevel` < 1338 AND `AdminLevel` > 1", tmpName);
  2067. mysql_tquery(MainPipeline, query, "OnSetSuspended", "ii", playerid, false);
  2068. format(string,sizeof(string),"Attempting to unsuspend %s's account...",tmpName);
  2069. SendClientMessageEx(playerid,COLOR_YELLOW,string);
  2070. }
  2071. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  2072. return 1;
  2073. }
  2074. CMD:osetrmutes(playerid, params[]) {
  2075. if(PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pAP] >= 2 || PlayerInfo[playerid][pHR] >= 3) {
  2076. new
  2077. szPlayerName[MAX_PLAYER_NAME],
  2078. iMuteCount;
  2079. if(sscanf(params, "s[24]i", szPlayerName, iMuteCount)) {
  2080. return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /osetrmutes [player name] [mutes]");
  2081. }
  2082. else if(iMuteCount >= 0) {
  2083. new
  2084. szQuery[128];
  2085. mysql_escape_string(szPlayerName, szPlayerName);
  2086. mysql_format(MainPipeline, szQuery, sizeof szQuery, "UPDATE `accounts` SET `ReportMutedTotal` = %i, `ReportMuted` = 0, `ReportMutedTime` = 0 WHERE `Username` = '%s'", iMuteCount, szPlayerName);
  2087. mysql_tquery(MainPipeline, szQuery, "Query_OnExecution", "ii", playerid);
  2088. SetPVarString(playerid, "QueryEx_Name", szPlayerName);
  2089. }
  2090. else SendClientMessageEx(playerid, COLOR_GRAD1, "Mutes cannot be set to less than zero.");
  2091. }
  2092. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  2093. return 1;
  2094. }
  2095. CMD:destroycar(playerid, params[]) {
  2096. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1) {
  2097. if(IsPlayerInAnyVehicle(playerid)) {
  2098. for(new i = 0; i < sizeof(CreatedCars); ++i) if(CreatedCars[i] == GetPlayerVehicleID(playerid)) {
  2099. DestroyVehicle(CreatedCars[i]);
  2100. CreatedCars[i] = INVALID_VEHICLE_ID;
  2101. return SendClientMessageEx(playerid, COLOR_GREY, "You have successfully despawned this vehicle.");
  2102. }
  2103. SendClientMessageEx(playerid, COLOR_GRAD1, "This vehicle is not admin-spawned.");
  2104. }
  2105. else SendClientMessageEx(playerid, COLOR_GRAD1, "You're not in any vehicle.");
  2106. }
  2107. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  2108. return 1;
  2109. }
  2110. CMD:setfightstyle(playerid, params[])
  2111. {
  2112. if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  2113. {
  2114. new string[128], giveplayerid, fightstyle;
  2115. if(sscanf(params, "ud", giveplayerid, fightstyle))
  2116. {
  2117. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setfightstyle [player] [fightstyle]");
  2118. SendClientMessageEx(playerid, COLOR_GRAD2, "Available fighting styles: 4, 5, 6, 7, 15, 26.");
  2119. return 1;
  2120. }
  2121. if(fightstyle > 3 && fightstyle < 8 || fightstyle == 15 || fightstyle == 26)
  2122. {
  2123. format(string, sizeof(string), " Your fighting style has been changed to %d.", fightstyle);
  2124. SendClientMessageEx(giveplayerid,COLOR_YELLOW,string);
  2125. format(string, sizeof(string), " You have changed %s's fighting style to %d.", GetPlayerNameEx(giveplayerid), fightstyle);
  2126. SendClientMessageEx(playerid,COLOR_YELLOW,string);
  2127. SetPlayerFightingStyle(giveplayerid, fightstyle);
  2128. PlayerInfo[playerid][pFightStyle] = fightstyle;
  2129. return 1;
  2130. }
  2131. }
  2132. else
  2133. {
  2134. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command.");
  2135. }
  2136. return 1;
  2137. }
  2138. CMD:setmyname(playerid, params[])
  2139. {
  2140. new string[128], query[128];
  2141. if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /setmyname [newname]");
  2142. if (PlayerInfo[playerid][pUndercover] >= 1 || PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1 || PlayerInfo[playerid][pFactionModerator] >= 4)
  2143. {
  2144. if(GetPVarInt(playerid, "TempName") == 0)
  2145. {
  2146. if(strlen(params) > MAX_PLAYER_NAME)
  2147. {
  2148. format(string, sizeof(string), "You can't select a name that's above %d characters.", MAX_PLAYER_NAME);
  2149. return SendClientMessageEx(playerid, COLOR_WHITE, string);
  2150. }
  2151. new tmpName[24];
  2152. mysql_escape_string(params, tmpName);
  2153. mysql_format(MainPipeline, query, sizeof(query), "SELECT `Username` FROM `accounts` WHERE `Username`='%s'", tmpName);
  2154. SetPVarString(playerid, "OnSetMyName", tmpName);
  2155. mysql_tquery(MainPipeline, query, "OnSetMyName", "i", playerid);
  2156. }
  2157. else
  2158. {
  2159. new name[MAX_PLAYER_NAME];
  2160. GetPVarString(playerid, "TempNameName", name, sizeof(name));
  2161. if(strlen(name) > 0)
  2162. {
  2163. SetPlayerName(playerid, name);
  2164. SetPVarInt(playerid, "TempName", 0);
  2165. format(string, sizeof(string), "You changed your name back to %s.", name);
  2166. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2167. SendClientMessageEx(playerid, COLOR_GRAD2, "NOTE: Your stats will now save again.");
  2168. }
  2169. }
  2170. }
  2171. return 1;
  2172. }
  2173. CMD:setname(playerid, params[])
  2174. {
  2175. new giveplayerid, string[128], name[MAX_PLAYER_NAME];
  2176. if(sscanf(params, "us[24]", giveplayerid, name)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /setname [playerid] [newname]");
  2177. if(IsPlayerConnected(giveplayerid))
  2178. {
  2179. if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  2180. {
  2181. if(strlen(name) > MAX_PLAYER_NAME)
  2182. {
  2183. format(string, sizeof(string), "You can't select a name that's above %d characters.", MAX_PLAYER_NAME);
  2184. return SendClientMessageEx(playerid, COLOR_WHITE, string);
  2185. }
  2186. new query[128], tmpName[MAX_PLAYER_NAME];
  2187. mysql_escape_string(name, tmpName);
  2188. if(strcmp(name, tmpName, false) == 0)
  2189. {
  2190. SetPVarString(playerid, "OnSetName", tmpName);
  2191. mysql_format(MainPipeline, query, sizeof(query), "SELECT `Username` FROM `accounts` WHERE `Username`='%s'", tmpName);
  2192. mysql_tquery(MainPipeline, query, "OnSetName", "ii", playerid, giveplayerid);
  2193. }
  2194. else return SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid characters!");
  2195. }
  2196. else
  2197. {
  2198. SendClientMessageEx(playerid, COLOR_GRAD2, "You aren't authorised to use this command.");
  2199. }
  2200. }
  2201. else
  2202. {
  2203. SendClientMessageEx(playerid, COLOR_GRAD2, "No Such Player");
  2204. }
  2205. return 1;
  2206. }
  2207. CMD:blowup(playerid, params[])
  2208. {
  2209. new string[128], giveplayerid;
  2210. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /blowup [player]");
  2211. if((PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin]) && giveplayerid != playerid) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot use this command on the same/greater level admin than you!");
  2212. if(IsPlayerConnected(giveplayerid))
  2213. {
  2214. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  2215. {
  2216. if(IsPlayerConnected(giveplayerid))
  2217. {
  2218. format(string, sizeof(string), "You have successfully exploded %s (ID: %d).",GetPlayerNameEx(giveplayerid),giveplayerid);
  2219. SendClientMessageEx(playerid,COLOR_GRAD2,string);
  2220. new Float:boomx, Float:boomy, Float:boomz;
  2221. GetPlayerPos(giveplayerid,boomx, boomy, boomz);
  2222. CreateExplosion(boomx, boomy , boomz, 7, 1);
  2223. format(string, sizeof(string), "AdmCmd: %s has exploded %s(%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2224. Log("logs/admin.log", string);
  2225. DBLog(playerid, giveplayerid, "Admin", "exploded");
  2226. }
  2227. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  2228. }
  2229. else
  2230. {
  2231. SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
  2232. }
  2233. }
  2234. return 1;
  2235. }
  2236. CMD:givenos(playerid, params[])
  2237. {
  2238. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  2239. {
  2240. new string[128], giveplayerid;
  2241. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /givenos [player]");
  2242. if(giveplayerid == INVALID_PLAYER_ID) return 1;
  2243. if(!IsPlayerConnected(giveplayerid)) return 1;
  2244. if(IsPlayerInAnyVehicle(giveplayerid))
  2245. {
  2246. new VehicleID = GetPlayerVehicleID(giveplayerid), Model = GetVehicleModel(VehicleID);
  2247. switch(Model)
  2248. {
  2249. case 448,461,462,463,468,471,509,510,521,522,523,581,586,449: return
  2250. SendClientMessageEx(playerid,COLOR_GRAD1,"ERROR: You can not tune this vehicle!");
  2251. }
  2252. AddVehicleComponent(VehicleID, 1010); PlayerPlaySound(giveplayerid,1133,0.0,0.0,0.0);//NOS
  2253. format(string, sizeof(string), " Successfully added nos to %s's vehicle.", GetPlayerNameEx(giveplayerid));
  2254. SendClientMessageEx(playerid,COLOR_GRAD1,string);
  2255. format(string, sizeof(string), "AdmCmd: %s has given nos to %s(%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2256. Log("logs/admin.log", string);
  2257. DBLog(playerid, giveplayerid, "Admin", "gave nos");
  2258. }
  2259. else
  2260. {
  2261. SendClientMessageEx(playerid,COLOR_GRAD1,"ERROR: person must be in a vehicle.");
  2262. }
  2263. }
  2264. else
  2265. {
  2266. SendClientMessageEx(playerid,COLOR_GRAD1,"You are not authorized to use that command.");
  2267. }
  2268. return 1;
  2269. }
  2270. CMD:countdown(playerid, params[])
  2271. {
  2272. if(IsARacer(playerid) && PlayerInfo[playerid][pTogReports] == 1 && PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pTogReports] == 1 && PlayerInfo[playerid][pASM] >= 1) {
  2273. if(CountDown == 0) {
  2274. SetTimerEx("Countdown", 100, false, "i", playerid); //Keep this at 100milliseconds
  2275. } else {
  2276. SendClientMessageEx(playerid, COLOR_WHITE, "There is already a countdown currently started.");
  2277. }
  2278. }
  2279. else if(IsARacer(playerid)) {
  2280. if(CountDown == 0) {
  2281. SetTimerEx("Countdown", 100, false, "i", playerid); //Keep this at 100milliseconds
  2282. } else {
  2283. SendClientMessageEx(playerid, COLOR_WHITE, "There is already a countdown currently started.");
  2284. }
  2285. }
  2286. else if(PlayerInfo[playerid][pAdmin] >= 3 && PlayerInfo[playerid][pTogReports] == 0) {
  2287. if(CountDown == 0) {
  2288. SetTimerEx("Countdown", 100, false, "i", playerid); //Keep this at 100milliseconds
  2289. } else {
  2290. SendClientMessageEx(playerid, COLOR_WHITE, "There is already a countdown currently started.");
  2291. }
  2292. }
  2293. return 1;
  2294. }
  2295. CMD:ipwhitelist(playerid, params[])
  2296. {
  2297. if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  2298. {
  2299. new string[128], query[256], giveplayer[MAX_PLAYER_NAME], ip[16];
  2300. if(sscanf(params, "s[24]s[16]", giveplayer, ip))
  2301. {
  2302. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /ipwhitelist [admin name] [IP]");
  2303. return 1;
  2304. }
  2305. new tmpName[24], tmpIP[16];
  2306. mysql_escape_string(giveplayer, tmpName);
  2307. mysql_escape_string(ip, tmpIP);
  2308. SetPVarString(playerid, "OnIPWhitelist", tmpName);
  2309. mysql_format(MainPipeline, query, sizeof(query), "UPDATE `accounts` SET `SecureIP`='%s' WHERE `Username`='%s' AND `AdminLevel` <= %d", tmpIP, tmpName, PlayerInfo[playerid][pAdmin]);
  2310. mysql_tquery(MainPipeline, query, "OnIPWhitelist", "i", playerid);
  2311. format(string, sizeof(string), "Attempting to whitelist %s on %s's account...", tmpIP, tmpName);
  2312. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2313. }
  2314. return 1;
  2315. }
  2316. CMD:hosp(playerid, params[]) {
  2317. return cmd_hospital(playerid, params);
  2318. }
  2319. CMD:hospital(playerid, params[])
  2320. {
  2321. if(PlayerInfo[playerid][pAdmin] >= 2)
  2322. {
  2323. new string[128], giveplayerid;
  2324. if(sscanf(params, "u", giveplayerid))
  2325. {
  2326. if(PlayerInfo[playerid][pHospital] > 0)
  2327. {
  2328. ClearAnimationsEx(playerid);
  2329. SetPVarInt(playerid, "_SpawningAtHospital", 2);
  2330. return SendClientMessageEx(playerid, COLOR_GREY, "You have released yourself from the hospital.");
  2331. }
  2332. else return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /hospital [player]");
  2333. }
  2334. else
  2335. {
  2336. if(IsPlayerConnected(giveplayerid))
  2337. {
  2338. if(PlayerInfo[giveplayerid][pHospital] > 0)
  2339. {
  2340. format(string, sizeof(string), " You have forced %s out of the hospital.", GetPlayerNameEx(giveplayerid));
  2341. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2342. SendClientMessageEx(giveplayerid, COLOR_WHITE, "You have been forced out of the hospital by an Admin.");
  2343. ClearAnimationsEx(giveplayerid);
  2344. SetPVarInt(giveplayerid, "_SpawningAtHospital", 2);
  2345. }
  2346. else SendClientMessageEx(playerid, COLOR_GRAD2, "That person is not in the hospital!");
  2347. }
  2348. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  2349. }
  2350. }
  2351. return 1;
  2352. }
  2353. CMD:revive(playerid, params[])
  2354. {
  2355. if(PlayerInfo[playerid][pAdmin] >= 2)
  2356. {
  2357. new string[128], giveplayerid;
  2358. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /revive [player]");
  2359. if(IsPlayerConnected(giveplayerid))
  2360. {
  2361. if(GetPVarInt(giveplayerid, "Injured") == 1)
  2362. {
  2363. format(string, sizeof(string), " You have revived %s.", GetPlayerNameEx(giveplayerid));
  2364. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2365. SendClientMessageEx(giveplayerid, COLOR_WHITE, "You have been revived by an Admin.");
  2366. format(string, sizeof(string), "AdmCmd: %s(%d) has been revived by %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid));
  2367. Log("logs/admin.log", string);
  2368. DBLog(playerid, giveplayerid, "Admin", "revived");
  2369. KillEMSQueue(giveplayerid);
  2370. ClearAnimationsEx(giveplayerid);
  2371. SetHealth(giveplayerid, 100);
  2372. }
  2373. else
  2374. {
  2375. SendClientMessageEx(playerid, COLOR_GRAD2, "That person is not injured!");
  2376. }
  2377. }
  2378. }
  2379. else
  2380. {
  2381. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  2382. }
  2383. return 1;
  2384. }
  2385. CMD:revivenear(playerid, params[])
  2386. {
  2387. if(PlayerInfo[playerid][pAdmin] >= 2)
  2388. {
  2389. new string[128], radius, count;
  2390. if(sscanf(params, "d", radius)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /revivenear [radius]");
  2391. if(radius < 1 || radius > 100)
  2392. {
  2393. SendClientMessageEx(playerid, COLOR_WHITE, "Radius must be higher than 0 and lower than 100!");
  2394. return 1;
  2395. }
  2396. foreach(new i: Player)
  2397. {
  2398. if(ProxDetectorS(radius, playerid, i))
  2399. {
  2400. if(GetPVarInt(i, "Injured") == 1)
  2401. {
  2402. SetHealth(i, 100);
  2403. count++;
  2404. SendClientMessageEx(i, COLOR_WHITE, "You have been revived by an Admin.");
  2405. KillEMSQueue(i);
  2406. ClearAnimationsEx(i);
  2407. SetHealth(i, 100);
  2408. format(string, sizeof(string), "AdmCmd: %s(%d) has been revived by %s", GetPlayerNameEx(i), GetPlayerSQLId(i), GetPlayerNameEx(playerid));
  2409. Log("logs/admin.log", string);
  2410. DBLog(playerid, i, "Admin", "revived (/revivenear)");
  2411. }
  2412. }
  2413. }
  2414. format(string, sizeof(string), "You have revived everyone (%d) nearby.", count);
  2415. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2416. }
  2417. else
  2418. {
  2419. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  2420. }
  2421. return 1;
  2422. }
  2423. CMD:forcedeath(playerid, params[])
  2424. {
  2425. if (PlayerInfo[playerid][pAdmin] >= 3)
  2426. {
  2427. new string[128], giveplayerid;
  2428. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /forcedeath [player]");
  2429. if(IsPlayerConnected(giveplayerid))
  2430. {
  2431. if(GetPVarInt(giveplayerid, "Injured") == 1)
  2432. {
  2433. format(string, sizeof(string), " You have forced %s to death.", GetPlayerNameEx(giveplayerid));
  2434. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2435. SendClientMessageEx(giveplayerid, COLOR_WHITE, "You have been forced to death by an Admin.");
  2436. KillEMSQueue(giveplayerid);
  2437. ResetPlayerWeaponsEx(giveplayerid);
  2438. SpawnPlayer(giveplayerid);
  2439. format(string, sizeof(string), "AdmCmd: %s has forced death %s(%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2440. Log("logs/admin.log", string);
  2441. DBLog(playerid, giveplayerid, "Admin", "forced death");
  2442. }
  2443. else
  2444. {
  2445. SendClientMessageEx(playerid, COLOR_GRAD2, "That person is not injured!");
  2446. }
  2447. }
  2448. }
  2449. else
  2450. {
  2451. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  2452. }
  2453. return 1;
  2454. }
  2455. CMD:ipcheck(playerid, params[])
  2456. {
  2457. if(PlayerInfo[playerid][pAdmin] >= 2)
  2458. {
  2459. new string[128], giveplayerid;
  2460. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /ipcheck [player]");
  2461. if(giveplayerid == INVALID_PLAYER_ID) return 1;
  2462. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  2463. if(PlayerInfo[giveplayerid][pAdmin] <= 1 || (PlayerInfo[giveplayerid][pAdmin] <= PlayerInfo[playerid][pAdmin] && PlayerInfo[playerid][pAdmin] >= 1337))
  2464. {
  2465. new playerip[32];
  2466. GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
  2467. format(string, sizeof(string), "(ID: %d) - (Name: %s) - (IP: %s)", giveplayerid, GetPlayerNameEx(giveplayerid), playerip);
  2468. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2469. format(string, sizeof(string), "%s has IP Checked %s(%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2470. if(PlayerInfo[giveplayerid][pAdmin] >= 2) {
  2471. Log("logs/adminipcheck.log", string);
  2472. DBLog(playerid, giveplayerid, "AdminIPCheck", "performed an IP check");
  2473. }
  2474. else {
  2475. Log("logs/ipcheck.log", string);
  2476. DBLog(playerid, giveplayerid, "IPCheck", "performed an IP check");
  2477. }
  2478. return 1;
  2479. }
  2480. if(PlayerInfo[giveplayerid][pAdmin] >= 2)
  2481. {
  2482. if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
  2483. {
  2484. format(string, sizeof(string), "%s has tried to check the IP address of a higher admin\nPlease report this to SIU/OED or an EA", GetPlayerNameEx(playerid));
  2485. foreach(new i : Player)
  2486. {
  2487. if(PlayerInfo[i][pAdmin] >= 4) ShowPlayerDialogEx(i, DIALOG_NOTHING, DIALOG_STYLE_MSGBOX, "{FFFF00}AdminWarning - {FF0000}Report ASAP", string, "Close", "");
  2488. }
  2489. }
  2490. format(string, sizeof(string), "%s tried to IP check %s(%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  2491. Log("logs/adminipcheck.log", string);
  2492. DBLog(playerid, giveplayerid, "AdminIPCheck", "tried to IP check a higher admin");
  2493. }
  2494. }
  2495. else
  2496. {
  2497. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  2498. }
  2499. return 1;
  2500. }
  2501. CMD:pfine(playerid, params[])
  2502. {
  2503. new string[128], giveplayerid, percentage, minimum, reason[64];
  2504. if(sscanf(params, "udds[64]", giveplayerid, percentage, minimum, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /pfine [player] [percentage] [minimum] [reason]");
  2505. if (PlayerInfo[playerid][pAdmin] >= 3)
  2506. {
  2507. if(IsPlayerConnected(giveplayerid))
  2508. {
  2509. new totalwealth = PlayerInfo[giveplayerid][pAccount] + GetPlayerCash(giveplayerid);
  2510. if(PlayerInfo[giveplayerid][pPhousekey] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[giveplayerid][pPhousekey]][hOwnerID] == GetPlayerSQLId(giveplayerid)) totalwealth += HouseInfo[PlayerInfo[giveplayerid][pPhousekey]][hSafeMoney];
  2511. if(PlayerInfo[giveplayerid][pPhousekey2] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[giveplayerid][pPhousekey2]][hOwnerID] == GetPlayerSQLId(giveplayerid)) totalwealth += HouseInfo[PlayerInfo[giveplayerid][pPhousekey2]][hSafeMoney];
  2512. if(PlayerInfo[giveplayerid][pPhousekey3] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[giveplayerid][pPhousekey3]][hOwnerID] == GetPlayerSQLId(giveplayerid)) totalwealth += HouseInfo[PlayerInfo[giveplayerid][pPhousekey3]][hSafeMoney];
  2513. if(totalwealth < 1) return SendClientMessageEx(giveplayerid, COLOR_GRAD2, "That person does not have any money!");
  2514. new fine = percentage * totalwealth / 100;
  2515. if(percentage < 1 || percentage > 100) return SendClientMessageEx(playerid, COLOR_GRAD2, "Percentage must be greater than 0 and below 100.");
  2516. else if(minimum < 1) return SendClientMessageEx(playerid, COLOR_GRAD2, "Minimum amount must be greater than 0.");
  2517. if(minimum > fine)
  2518. {
  2519. //GivePlayerCash(giveplayerid, -minimum);
  2520. GivePlayerCashEx(giveplayerid, TYPE_ONHAND, -minimum);
  2521. format(string, sizeof(string), "AdmCmd: %s(%d) was fined $%s by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), number_format(minimum), GetPlayerNameEx(playerid), reason);
  2522. Log("logs/admin.log", string);
  2523. format(szMiscArray, sizeof(szMiscArray), "was fined $%s (%s)", number_format(minimum), reason);
  2524. DBLog(playerid, giveplayerid, "Admin", szMiscArray);
  2525. format(string, sizeof(string), "AdmCmd: %s was fined $%s by %s, reason: %s", GetPlayerNameEx(giveplayerid), number_format(minimum), GetPlayerNameEx(playerid), reason);
  2526. }
  2527. else
  2528. {
  2529. //GivePlayerCash(giveplayerid, -fine);
  2530. GivePlayerCashEx(giveplayerid, TYPE_ONHAND, -fine);
  2531. format(string, sizeof(string), "AdmCmd: %s(%d) was fined $%s by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), number_format(fine), GetPlayerNameEx(playerid), reason);
  2532. Log("logs/admin.log", string);
  2533. format(szMiscArray, sizeof(szMiscArray), "was fined $%s (%s)", number_format(fine), reason);
  2534. DBLog(playerid, giveplayerid, "Admin", szMiscArray);
  2535. format(string, sizeof(string), "AdmCmd: %s was fined $%s by %s, reason: %s", GetPlayerNameEx(giveplayerid), number_format(fine), GetPlayerNameEx(playerid), reason);
  2536. }
  2537. SendClientMessageToAllEx(COLOR_LIGHTRED, string);
  2538. //OnPlayerStatsUpdate(giveplayerid);
  2539. return 1;
  2540. }
  2541. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  2542. }
  2543. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  2544. return 1;
  2545. }
  2546. CMD:fine(playerid, params[])
  2547. {
  2548. new string[128], giveplayerid, amount, reason[64];
  2549. if(sscanf(params, "uds[64]", giveplayerid, amount, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /fine [player] [amount] [reason]");
  2550. if (PlayerInfo[playerid][pAdmin] >= 3)
  2551. {
  2552. if(strcmp(GetPlayerIpEx(playerid), PlayerInfo[playerid][pSecureIP], false, 16) != 0)
  2553. {
  2554. format(string, sizeof(string), "[/FINE] %s has had their account disabled for not matching their whitelisted ip, contact a member of security.", GetPlayerNameEx(playerid));
  2555. ABroadCast(COLOR_YELLOW, string, 4);
  2556. Log("logs/admin.log", string);
  2557. DBLog(playerid, INVALID_PLAYER_ID, "Admin", "Account auto-disabled (whitelist fail)");
  2558. PlayerInfo[playerid][pDisabled] = 1;
  2559. Kick(playerid);
  2560. return 1;
  2561. }
  2562. if(IsPlayerConnected(giveplayerid))
  2563. {
  2564. if (amount < 1)
  2565. {
  2566. SendClientMessageEx(playerid, COLOR_GRAD2, "Amount must be greater than 0");
  2567. return 1;
  2568. }
  2569. format(string, sizeof(string), "AdmCmd: %s(%d) was fined $%s by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), number_format(amount), GetPlayerNameEx(playerid), reason);
  2570. Log("logs/admin.log", string);
  2571. format(szMiscArray, sizeof(szMiscArray), "fined $%s (%s)", number_format(amount), reason);
  2572. DBLog(playerid, giveplayerid, "Admin", szMiscArray);
  2573. format(string, sizeof(string), "AdmCmd: %s was fined $%s by %s, reason: %s", GetPlayerNameEx(giveplayerid), number_format(amount), GetPlayerNameEx(playerid), reason);
  2574. SendClientMessageToAllEx(COLOR_LIGHTRED, string);
  2575. StaffAccountCheck(giveplayerid, GetPlayerIpEx(giveplayerid));
  2576. GivePlayerCash(giveplayerid, -amount);
  2577. OnPlayerStatsUpdate(giveplayerid);
  2578. return 1;
  2579. }
  2580. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  2581. }
  2582. else
  2583. {
  2584. SendClientMessageEx(playerid, COLOR_WHITE, "You're not a level three admin.");
  2585. }
  2586. return 1;
  2587. }
  2588. CMD:sfine(playerid, params[])
  2589. {
  2590. new string[128], giveplayerid, amount, reason[64];
  2591. if(sscanf(params, "uds[64]", giveplayerid, amount, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /sfine [player] [amount] [reason]");
  2592. if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  2593. {
  2594. if(strcmp(GetPlayerIpEx(playerid), PlayerInfo[playerid][pSecureIP], false, 16) != 0)
  2595. {
  2596. format(string, sizeof(string), "[/SFINE] %s has had their account disabled for not matching their whitelisted ip, contact a member of security.", GetPlayerNameEx(playerid));
  2597. ABroadCast(COLOR_YELLOW, string, 4);
  2598. Log("logs/admin.log", string);
  2599. DBLog(playerid, INVALID_PLAYER_ID, "Admin", "Account auto-disabled (whitelist fail)");
  2600. PlayerInfo[playerid][pDisabled] = 1;
  2601. Kick(playerid);
  2602. return 1;
  2603. }
  2604. if(IsPlayerConnected(giveplayerid))
  2605. {
  2606. if (amount < 1)
  2607. {
  2608. SendClientMessageEx(playerid, COLOR_GRAD2, "Amount must be greater than 0");
  2609. return 1;
  2610. }
  2611. format(string, sizeof(string), "AdmCmd: %s(%d) was silent fined $%s by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), number_format(amount), GetPlayerNameEx(playerid), reason);
  2612. Log("logs/admin.log", string);
  2613. format(szMiscArray, sizeof(szMiscArray), "silent fined $%s (%s)", number_format(amount), reason);
  2614. DBLog(playerid, giveplayerid, "Admin", szMiscArray);
  2615. format(string, sizeof(string), "AdmCmd: %s was silent fined $%s by %s, reason: %s", GetPlayerNameEx(giveplayerid), number_format(amount), GetPlayerNameEx(playerid), reason);
  2616. ABroadCast(COLOR_LIGHTRED, string, 2);
  2617. format(string, sizeof(string), "You have been silent fined $%s by %s, reason: %s", number_format(amount), GetPlayerNameEx(playerid), reason);
  2618. SendClientMessageEx(giveplayerid, COLOR_LIGHTRED, string);
  2619. GivePlayerCash(giveplayerid, -amount);
  2620. OnPlayerStatsUpdate(giveplayerid);
  2621. return 1;
  2622. }
  2623. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  2624. }
  2625. else
  2626. {
  2627. SendClientMessageEx(playerid, COLOR_WHITE, "You're not a level three admin.");
  2628. }
  2629. return 1;
  2630. }
  2631. CMD:listguns(playerid, params[])
  2632. {
  2633. if(PlayerInfo[playerid][pAdmin] >= 2)
  2634. {
  2635. new string[128], giveplayerid;
  2636. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /listguns [player]");
  2637. if(IsPlayerConnected(giveplayerid))
  2638. {
  2639. new weapons[13][2], weaponname[50];
  2640. if(GetPVarInt(giveplayerid, "EventToken") != 0 || GetPVarType(giveplayerid, "IsInArena"))
  2641. {
  2642. SendClientMessageEx(playerid, COLOR_GRAD2, "That person is at an event/paintball so the weapons may appear as non-server sided.");
  2643. }
  2644. SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
  2645. format(string, sizeof(string), "Weapons on %s:", GetPlayerNameEx(giveplayerid));
  2646. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2647. for (new i = 0; i < 13; i++)
  2648. {
  2649. GetPlayerWeaponData(giveplayerid, i, weapons[i][0], weapons[i][1]);
  2650. if(weapons[i][0] > 0)
  2651. {
  2652. if(PlayerInfo[giveplayerid][pGuns][i] == weapons[i][0])
  2653. {
  2654. GetWeaponName(weapons[i][0], weaponname, sizeof(weaponname));
  2655. format(string, sizeof(string), "%s (%d).", weaponname, weapons[i][0]);
  2656. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  2657. }
  2658. else
  2659. {
  2660. GetWeaponName(weapons[i][0], weaponname, sizeof(weaponname));
  2661. format(string, sizeof(string), "%s (%d) (non server-side).", weaponname, weapons[i][0]);
  2662. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  2663. }
  2664. }
  2665. }
  2666. SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
  2667. }
  2668. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  2669. }
  2670. else
  2671. {
  2672. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  2673. }
  2674. return 1;
  2675. }
  2676. CMD:oipcheck(playerid, params[])
  2677. {
  2678. if(PlayerInfo[playerid][pAdmin] < 3)
  2679. {
  2680. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  2681. return 1;
  2682. }
  2683. new query[128], name[MAX_PLAYER_NAME];
  2684. if(sscanf(params, "s[24]", name)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /oipcheck [name]");
  2685. new tmpName[24];
  2686. mysql_escape_string(name, tmpName);
  2687. mysql_format(MainPipeline, query, sizeof(query), "SELECT `AdminLevel`, `Username`, `IP` FROM `accounts` WHERE `Username` = '%s'", tmpName);
  2688. mysql_tquery(MainPipeline, query, "OnIPCheck", "i", playerid);
  2689. return 1;
  2690. }
  2691. CMD:serverstats(playerid, params[])
  2692. {
  2693. new
  2694. string[128],
  2695. iVehCount,
  2696. x;
  2697. while(x < MAX_VEHICLES) if(GetVehicleModel(++x)) ++iVehCount;
  2698. format(string,sizeof(string),"Server Statistics - Version %s (recorded since the 20th of August, 2010).",SERVER_GM_TEXT);
  2699. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2700. format(string, sizeof(string), "* Objects: %d | Pickups: %d | Map icons: %d | 3D text labels: %d | Text draws: %d | Loaded houses: %d",CountDynamicObjects(),CountDynamicPickups(),CountDynamicMapIcons(),CountDynamic3DTextLabels(),textdrawscount,MAX_HOUSES);
  2701. SendClientMessageEx(playerid, COLOR_GREY, string);
  2702. format(string, sizeof(string), "* Logins: %d | Connections: %d | Registrations: %d | Hackers autobanned: %d | Uptime: %d hours",TotalLogin, TotalConnect, TotalRegister, TotalAutoBan, TotalUptime);
  2703. SendClientMessageEx(playerid, COLOR_GREY, string);
  2704. format(string, sizeof(string), "* Players connected: %d | Peak person count: %d (%d/%d/%d) | person vehicles loaded: %d | Total vehicles: %i",Iter_Count(Player),MaxPlayersConnected,MPDay,MPMonth,MPYear,PlayerCars, iVehCount);
  2705. SendClientMessageEx(playerid, COLOR_GREY, string);
  2706. return 1;
  2707. }
  2708. CMD:payday(playerid, params[])
  2709. {
  2710. if (PlayerInfo[playerid][pAdmin] >= 1337) {
  2711. PlayerInfo[playerid][pConnectSeconds] = 3600;
  2712. PayDay(playerid);
  2713. }
  2714. return 1;
  2715. }
  2716. CMD:ofine(playerid, params[])
  2717. {
  2718. if (PlayerInfo[playerid][pAdmin] >= 3)
  2719. {
  2720. new string[128], query[256], name[MAX_PLAYER_NAME], amount, reason[64];
  2721. if(sscanf(params, "s[24]ds[64]", name, amount, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ofine [name] [amount] [reason]");
  2722. new giveplayerid = ReturnUser(name);
  2723. if(IsPlayerConnected(giveplayerid))
  2724. {
  2725. if (amount < 1) return SendClientMessageEx(playerid, COLOR_GRAD2, "Amount must be greater than 0");
  2726. format(string, sizeof(string), "AdmCmd: %s(%d) was fined $%s by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), number_format(amount), GetPlayerNameEx(playerid), reason);
  2727. Log("logs/admin.log", string);
  2728. format(szMiscArray, sizeof(szMiscArray), "fined $%s (%s)", number_format(amount), reason);
  2729. DBLog(playerid, giveplayerid, "Admin", szMiscArray);
  2730. format(string, sizeof(string), "AdmCmd: %s was fined $%s by %s, reason: %s", GetPlayerNameEx(giveplayerid), number_format(amount), GetPlayerNameEx(playerid), reason);
  2731. SendClientMessageToAllEx(COLOR_LIGHTRED, string);
  2732. GivePlayerCash(giveplayerid, -amount);
  2733. StaffAccountCheck(giveplayerid, GetPlayerIpEx(giveplayerid));
  2734. }
  2735. else
  2736. {
  2737. new tmpName[24];
  2738. mysql_escape_string(name, tmpName);
  2739. SetPVarString(playerid, "OnFine", tmpName);
  2740. SetPVarInt(playerid, "OnFineAmount", amount);
  2741. SetPVarString(playerid, "OnFineReason", reason);
  2742. mysql_format(MainPipeline, query, sizeof(query), "UPDATE `accounts` SET `Money` = `Money` - %d WHERE `PermBand` < 3 AND `Band` = 0 AND `AdminLevel` < 2 AND `Username`='%s'", amount, tmpName);
  2743. mysql_tquery(MainPipeline, query, "OnFine", "i", playerid);
  2744. format(string, sizeof(string), "Attempting to fine $%s from %s's account...", number_format(amount), tmpName);
  2745. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2746. }
  2747. }
  2748. else
  2749. {
  2750. SendClientMessageEx(playerid, COLOR_WHITE, "You're not a level three admin.");
  2751. }
  2752. return 1;
  2753. }
  2754. CMD:check(playerid, params[])
  2755. {
  2756. if (PlayerInfo[playerid][pAdmin] >= 2)
  2757. {
  2758. new giveplayerid;
  2759. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /check [player]");
  2760. if(IsPlayerConnected(giveplayerid)) ShowStats(playerid, giveplayerid);
  2761. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  2762. }
  2763. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
  2764. return 1;
  2765. }
  2766. CMD:checkinv(playerid, params[])
  2767. {
  2768. if (PlayerInfo[playerid][pAdmin] >= 2)
  2769. {
  2770. new giveplayerid;
  2771. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /checkinv [player]");
  2772. if(IsPlayerConnected(giveplayerid)) ShowInventory(playerid, giveplayerid);
  2773. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  2774. }
  2775. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
  2776. return 1;
  2777. }
  2778. CMD:mole(playerid, params[])
  2779. {
  2780. if(PlayerInfo[playerid][pAdmin] >= 3)
  2781. {
  2782. new string[128], log[128];
  2783. if(isnull(params)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /mole [mole text]");
  2784. format(string, sizeof(string), "SMS: %s, Sender: MOLE (555)", params);
  2785. foreach(new i: Player)
  2786. {
  2787. SendClientMessageEx(i, COLOR_YELLOW, string);
  2788. //SendAudioToPlayer(i, 47, 100);
  2789. }
  2790. format(log, sizeof(log), "[MOLE] %s sent: %s", GetPlayerNameEx(playerid), params);
  2791. Log("logs/admin.log", log);
  2792. ChatDBLog(playerid, "AdminMole", params);
  2793. }
  2794. else SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
  2795. return 1;
  2796. }
  2797. // Both below were adjusted to Head Admin because of them now being able to roleplay on their admin account. - Winterfield
  2798. CMD:togspec(playerid, params[])
  2799. {
  2800. if(PlayerInfo[playerid][pAdmin] >= 1337)
  2801. {
  2802. if(GetPVarType(playerid, "EASpecable"))
  2803. {
  2804. SendClientMessage(playerid, COLOR_WHITE, "You can not be spectated anymore");
  2805. DeletePVar(playerid, "EASpecable");
  2806. }
  2807. else
  2808. {
  2809. SendClientMessage(playerid, COLOR_WHITE, "You can now be spectated again");
  2810. SetPVarInt(playerid, "EASpecable", 1);
  2811. }
  2812. }
  2813. return 1;
  2814. }
  2815. CMD:togtp(playerid, params[])
  2816. {
  2817. if(PlayerInfo[playerid][pAdmin] >= 1337)
  2818. {
  2819. if(GetPVarType(playerid, "EATeleportable"))
  2820. {
  2821. SendClientMessage(playerid, COLOR_WHITE, "You can not be teleported to anymore");
  2822. DeletePVar(playerid, "EATeleportable");
  2823. }
  2824. else
  2825. {
  2826. SendClientMessage(playerid, COLOR_WHITE, "You can now be teleported to again");
  2827. SetPVarInt(playerid, "EATeleportable", 1);
  2828. }
  2829. }
  2830. return 1;
  2831. }
  2832. CMD:spec(playerid, params[])
  2833. {
  2834. if(PlayerInfo[playerid][pAdmin] < 2 && PlayerInfo[playerid][pHelper] < 1)
  2835. {
  2836. SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
  2837. return 1;
  2838. }
  2839. if(GetPVarInt(playerid, "Injured") == 1 && PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You are injured.");
  2840. if(strcmp(params, "off", true) == 0)
  2841. {
  2842. if(Spectating[playerid] > 0 && PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pHelper] >= 1 && Spectating[playerid] > 0)
  2843. {
  2844. GettingSpectated[Spectate[playerid]] = INVALID_PLAYER_ID;
  2845. Spectating[playerid] = 0;
  2846. Spectate[playerid] = INVALID_PLAYER_ID;
  2847. SpecTime[playerid] = 0;
  2848. SetPVarInt(playerid, "SpecOff", 1 );
  2849. TogglePlayerSpectating(playerid, false);
  2850. SetCameraBehindPlayer(playerid);
  2851. return 1;
  2852. }
  2853. else
  2854. {
  2855. SendClientMessageEx(playerid, COLOR_GREY, "You're not spectating anyone.");
  2856. return 1;
  2857. }
  2858. }
  2859. new giveplayerid;
  2860. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /spec (playerid/off)");
  2861. if(giveplayerid != INVALID_PLAYER_ID)
  2862. {
  2863. if(PlayerInfo[playerid][pHelper] < PlayerInfo[giveplayerid][pHelper] && PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GREY, "You can't spectate higher level helpers.");
  2864. if(PlayerInfo[playerid][pHelper] > 0 && PlayerInfo[giveplayerid][pAdmin] > 1) return SendClientMessageEx(playerid, COLOR_GREY, "You can't spectate an administrator");
  2865. if(PlayerInfo[playerid][pHelper] > 0) {
  2866. switch(PlayerInfo[playerid][pHelper]) {
  2867. case 1, 2: if(!(1 <= PlayerInfo[giveplayerid][pLevel] <= 5)) return SendClientMessageEx(playerid, COLOR_GREY, "You can only use this on Levels 1 - 5 as a JPA/GPA!");
  2868. case 3, 4: if(!(1 <= PlayerInfo[giveplayerid][pLevel] <= 10)) return SendClientMessageEx(playerid, COLOR_GREY, "You can only use this on Levels 1 - 10 as a SPA/CPA!");
  2869. }
  2870. }
  2871. if(PlayerInfo[giveplayerid][pAdmin] > 1337 && !GetPVarType(giveplayerid, "EASpecable")) return SendClientMessageEx(playerid, COLOR_WHITE, "You cannot spectate this person.");
  2872. if(PlayerInfo[playerid][pAdmin] >= 4 && Spectate[giveplayerid] != INVALID_PLAYER_ID && Spectating[giveplayerid] == 1)
  2873. {
  2874. new string[128];
  2875. format(string, sizeof(string), "Admin %s is speccing %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(Spectate[giveplayerid]));
  2876. if(PlayerInfo[playerid][pAdmin] >= 1337 && SpecTime[giveplayerid])
  2877. {
  2878. new seconds = gettime()-SpecTime[giveplayerid];
  2879. new minutes = seconds/60;
  2880. format(string, sizeof(string), "%s (%d min %d sec)", string, minutes, seconds-60*minutes);
  2881. }
  2882. SendClientMessageEx(playerid, COLOR_GREEN, string);
  2883. return 1;
  2884. }
  2885. SpectatePlayer(playerid, giveplayerid);
  2886. }
  2887. else
  2888. {
  2889. SendClientMessageEx(playerid, COLOR_WHITE, "Target is not available.");
  2890. }
  2891. return 1;
  2892. }
  2893. CMD:rcreset(playerid, params[]) {
  2894. if(PlayerInfo[playerid][pAdmin] >= 1337) {
  2895. new
  2896. iTargetID;
  2897. if(sscanf(params, "u", iTargetID)) {
  2898. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /rcreset [player]");
  2899. }
  2900. else if(!IsPlayerConnected(iTargetID)) {
  2901. SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  2902. }
  2903. else {
  2904. new
  2905. i = 0,
  2906. szMessage[96];
  2907. format(szMessage, sizeof szMessage, "AdmCmd: %s has reset %s's restricted vehicle warnings.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID));
  2908. ABroadCast(COLOR_LIGHTRED, szMessage, 2);
  2909. format(szMessage, sizeof szMessage, "%s has reset your restricted vehicle warnings.", GetPlayerNameEx(playerid));
  2910. SendClientMessageEx(iTargetID, COLOR_WHITE, szMessage);
  2911. DBLog(playerid, iTargetID, "Admin", "Reset Restricted Veh Warns");
  2912. PlayerInfo[iTargetID][pRVehWarns] = 0;
  2913. PlayerInfo[iTargetID][pLastRVehWarn] = 0;
  2914. PlayerInfo[iTargetID][pRVehRestricted] = 0;
  2915. while(i != MAX_PLAYERVEHICLES) {
  2916. if(PlayerVehicleInfo[iTargetID][i][pvRestricted] != 0) {
  2917. PlayerVehicleInfo[iTargetID][i][pvRestricted] = 0;
  2918. }
  2919. ++i;
  2920. }
  2921. }
  2922. }
  2923. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  2924. return 1;
  2925. }
  2926. CMD:rcabuse(playerid, params[]) {
  2927. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1) {
  2928. new
  2929. iTargetID;
  2930. if(sscanf(params, "u", iTargetID)) SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /rcabuse [player]");
  2931. else if(!IsPlayerConnected(iTargetID)) SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  2932. else if(GetPlayerState(iTargetID) == PLAYER_STATE_DRIVER && IsRestrictedVehicle(GetVehicleModel(GetPlayerVehicleID(iTargetID))))
  2933. {
  2934. new
  2935. iVehicleID = GetPlayerVehicleID(iTargetID),
  2936. iVehIndex = GetPlayerVehicle(iTargetID, iVehicleID),
  2937. Float: fPlayerPos[3],
  2938. szMessage[256]; // Dialog string - don't kill me!!!!!1
  2939. if(iVehIndex != -1) { // Owned by player
  2940. switch(++PlayerInfo[iTargetID][pRVehWarns]) {
  2941. case 1: {
  2942. PlayerVehicleInfo[iTargetID][iVehIndex][pvRestricted] = gettime() + 28800;
  2943. --PlayerCars;
  2944. VehicleSpawned[iTargetID]--;
  2945. PlayerVehicleInfo[iTargetID][iVehIndex][pvSpawned] = 0;
  2946. PlayerVehicleInfo[iTargetID][iVehIndex][pvFuel] = VehicleFuel[iVehicleID];
  2947. DestroyVehicle(iVehicleID);
  2948. PlayerVehicleInfo[iTargetID][iVehIndex][pvId] = INVALID_PLAYER_VEHICLE_ID;
  2949. g_mysql_SaveVehicle(iTargetID, iVehIndex);
  2950. CheckPlayerVehiclesForDesync(iTargetID);
  2951. GetPlayerPos(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  2952. SetPlayerPosFindZ(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  2953. format(szMessage, sizeof szMessage, "%s has issued you a warning for abusing your %s.\n\nAs this is your first warning, it will be restricted from use for 8 hours.", GetPlayerNameEx(playerid), GetVehicleName(iVehicleID));
  2954. ShowPlayerDialogEx(iTargetID, 0, DIALOG_STYLE_MSGBOX, "Restricted Vehicle Warning", szMessage, "Exit", "");
  2955. SendClientMessageEx(playerid, COLOR_GRAD1, "You have warned this person for abusing their restricted vehicle.");
  2956. }
  2957. case 2: {
  2958. PlayerInfo[iTargetID][pRVehRestricted] = gettime() + 172800;
  2959. --PlayerCars;
  2960. VehicleSpawned[iTargetID]--;
  2961. PlayerVehicleInfo[iTargetID][iVehIndex][pvSpawned] = 0;
  2962. PlayerVehicleInfo[iTargetID][iVehIndex][pvFuel] = VehicleFuel[iVehicleID];
  2963. DestroyVehicle(iVehicleID);
  2964. PlayerVehicleInfo[iTargetID][iVehIndex][pvId] = INVALID_PLAYER_VEHICLE_ID;
  2965. g_mysql_SaveVehicle(iTargetID, iVehIndex);
  2966. CheckPlayerVehiclesForDesync(iTargetID);
  2967. GetPlayerPos(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  2968. SetPlayerPosFindZ(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  2969. format(szMessage, sizeof szMessage, "%s has issued you a warning for abusing your %s.\n\nAs this is your second warning, you will be unable to use restricted vehicles for two days.", GetPlayerNameEx(playerid), GetVehicleName(iVehicleID));
  2970. ShowPlayerDialogEx(iTargetID, 0, DIALOG_STYLE_MSGBOX, "Restricted Vehicle Warning", szMessage, "Exit", "");
  2971. SendClientMessageEx(playerid, COLOR_GRAD1, "You have warned this person for abusing their restricted vehicle.");
  2972. }
  2973. case 3: {
  2974. PlayerInfo[iTargetID][pRVehRestricted] = gettime() + 604800;
  2975. PlayerInfo[iTargetID][pRVehWarns] = 0;
  2976. DestroyPlayerVehicle(iTargetID, iVehIndex);
  2977. GetPlayerPos(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  2978. SetPlayerPosFindZ(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  2979. format(szMessage, sizeof szMessage, "%s has issued you a warning for abusing your %s.\n\nAs this is your third warning, you will be unable to use restricted vehicles for a week, and the vehicle in question has been removed.", GetPlayerNameEx(playerid), GetVehicleName(iVehicleID));
  2980. ShowPlayerDialogEx(iTargetID, 0, DIALOG_STYLE_MSGBOX, "Restricted Vehicle Warning", szMessage, "Exit", "");
  2981. SendClientMessageEx(playerid, COLOR_GRAD1, "You have warned this person for abusing their restricted vehicle.");
  2982. }
  2983. }
  2984. }
  2985. else foreach(new i: Player)
  2986. {
  2987. if((iVehIndex = GetPlayerVehicle(i, iVehicleID)) != -1) { // Owned by another player
  2988. switch(++PlayerInfo[iTargetID][pRVehWarns]) {
  2989. case 1: {
  2990. SetVehicleToRespawn(iVehicleID);
  2991. CheckPlayerVehiclesForDesync(i);
  2992. GetPlayerPos(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  2993. SetPlayerPosFindZ(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  2994. format(szMessage, sizeof szMessage, "%s has issued you a warning for abusing %s's %s.\n\nAs this is your first warning, one of your restricted vehicles (if any) will not be able to be used for two days.", GetPlayerNameEx(playerid), GetPlayerNameEx(i), GetVehicleName(iVehicleID));
  2995. ShowPlayerDialogEx(iTargetID, 0, DIALOG_STYLE_MSGBOX, "Restricted Vehicle Warning", szMessage, "Exit", "");
  2996. SendClientMessageEx(playerid, COLOR_GRAD1, "You have warned this person for abusing their restricted vehicle.");
  2997. for(new x = 0; x != MAX_PLAYERVEHICLES; ++x) if(IsRestrictedVehicle(PlayerVehicleInfo[iTargetID][iVehIndex][pvModelId])) {
  2998. PlayerVehicleInfo[iTargetID][iVehIndex][pvRestricted] = gettime() + 28800;
  2999. break;
  3000. }
  3001. }
  3002. case 2: {
  3003. PlayerInfo[iTargetID][pRVehRestricted] = gettime() + 172800;
  3004. SetVehicleToRespawn(iVehicleID);
  3005. CheckPlayerVehiclesForDesync(i);
  3006. GetPlayerPos(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  3007. SetPlayerPosFindZ(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  3008. format(szMessage, sizeof szMessage, "%s has issued you a warning for abusing %s's %s.\n\nAs this is your second warning, you will be unable to use restricted vehicles for two days.", GetPlayerNameEx(playerid), GetPlayerNameEx(i), GetVehicleName(iVehicleID));
  3009. ShowPlayerDialogEx(iTargetID, 0, DIALOG_STYLE_MSGBOX, "Restricted Vehicle Warning", szMessage, "Exit", "");
  3010. SendClientMessageEx(playerid, COLOR_GRAD1, "You have warned this person for abusing their restricted vehicle.");
  3011. }
  3012. case 3: {
  3013. PlayerInfo[iTargetID][pRVehRestricted] = gettime() + 604800;
  3014. PlayerInfo[iTargetID][pRVehWarns] = 0;
  3015. GetPlayerPos(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  3016. SetPlayerPosFindZ(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  3017. format(szMessage, sizeof szMessage, "%s has issued you a warning for abusing %s's %s.\n\nAs this is your third warning, you will be unable to use restricted vehicles for a week.", GetPlayerNameEx(playerid), GetPlayerNameEx(i), GetVehicleName(iVehicleID));
  3018. ShowPlayerDialogEx(iTargetID, 0, DIALOG_STYLE_MSGBOX, "Restricted Vehicle Warning", szMessage, "Exit", "");
  3019. SendClientMessageEx(playerid, COLOR_GRAD1, "You have warned this person for abusing their restricted vehicle.");
  3020. }
  3021. }
  3022. format(szMessage, sizeof szMessage, "%s has issued %s a warning for abusing your %s.\n\nThe vehicle in question has been respawned. Please be mindful of your restricted vehicles.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), GetVehicleName(iVehicleID));
  3023. ShowPlayerDialogEx(i, 0, DIALOG_STYLE_MSGBOX, "Restricted Vehicle Warning", szMessage, "Exit", "");
  3024. SendClientMessageEx(playerid, COLOR_GRAD1, "You have warned this person for abusing their restricted vehicle.");
  3025. break;
  3026. }
  3027. }
  3028. if(iVehIndex == -1 && IsACop(iTargetID)) { // Not person owned
  3029. SetVehicleToRespawn(iVehicleID);
  3030. switch(++PlayerInfo[iTargetID][pRVehWarns]) {
  3031. case 1: {
  3032. GetPlayerPos(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  3033. SetPlayerPosFindZ(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  3034. format(szMessage, sizeof szMessage, "%s has issued you a warning for abusing your faction's %s.\n\nAs this is your first warning, you will face no punishment.", GetPlayerNameEx(playerid), GetVehicleName(iVehicleID));
  3035. ShowPlayerDialogEx(iTargetID, 0, DIALOG_STYLE_MSGBOX, "Restricted Vehicle Warning", szMessage, "Exit", "");
  3036. SendClientMessageEx(playerid, COLOR_GRAD1, "You have warned this person for abusing their restricted vehicle.");
  3037. }
  3038. case 2: {
  3039. PlayerInfo[iTargetID][pRVehRestricted] = gettime() + 1209600;
  3040. GetPlayerPos(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  3041. SetPlayerPosFindZ(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  3042. format(szMessage, sizeof szMessage, "%s has issued you a warning for abusing your faction's %s.\n\nAs this is your second warning, you will be unable to use restricted vehicles for two weeks and prisoned for two hours.", GetPlayerNameEx(playerid), GetVehicleName(iVehicleID));
  3043. ShowPlayerDialogEx(iTargetID, 0, DIALOG_STYLE_MSGBOX, "Restricted Vehicle Warning", szMessage, "Exit", "");
  3044. SendClientMessageEx(playerid, COLOR_GRAD1, "You have warned this person for abusing their restricted vehicle.");
  3045. GameTextForPlayer(iTargetID, "~w~Welcome to ~n~~r~Fort DeMorgan", 5000, 3);
  3046. ResetPlayerWeaponsEx(iTargetID);
  3047. format(szMessage, sizeof(szMessage), "AdmCmd: %s(%d) has been prisoned by %s, reason: Abuse of faction vehicles.", GetPlayerNameEx(iTargetID), GetPlayerSQLId(iTargetID), GetPlayerNameEx(playerid));
  3048. Log("logs/admin.log", szMessage);
  3049. DBLog(playerid, iTargetID, "Admin", "[Prisoned] Restricted Vehicle Abuse");
  3050. format(szMessage, sizeof(szMessage), "AdmCmd: %s has been prisoned by %s, reason: Abuse of faction vehicles.", GetPlayerNameEx(iTargetID), GetPlayerNameEx(playerid));
  3051. SendClientMessageToAllEx(COLOR_LIGHTRED, szMessage);
  3052. PlayerInfo[iTargetID][pJailTime] = 120 * 60;
  3053. strcpy(PlayerInfo[iTargetID][pPrisonReason], "[OOC][PRISON] Abuse of faction vehicles", 128);
  3054. strcpy(PlayerInfo[iTargetID][pPrisonedBy], GetPlayerNameEx(playerid), MAX_PLAYER_NAME);
  3055. PhoneOnline[iTargetID] = 1;
  3056. SetPlayerInterior(iTargetID, 1);
  3057. PlayerInfo[iTargetID][pInt] = 1;
  3058. new rand = random(sizeof(OOCPrisonSpawns));
  3059. Streamer_UpdateEx(iTargetID, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
  3060. SetPlayerPos(iTargetID, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
  3061. SetPlayerSkin(iTargetID, 50);
  3062. SetPlayerColor(iTargetID, TEAM_APRISON_COLOR);
  3063. Player_StreamPrep(iTargetID, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2], FREEZE_TIME);
  3064. }
  3065. case 3: {
  3066. PlayerInfo[iTargetID][pRVehRestricted] = gettime() + 1814400;
  3067. PlayerInfo[iTargetID][pRVehWarns] = 0;
  3068. GetPlayerPos(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  3069. SetPlayerPosFindZ(iTargetID, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  3070. format(szMessage, sizeof szMessage, "%s has issued you a warning for abusing your faction's %s.\n\nAs this is your third warning, you will be unable to use restricted vehicles for three weeks, kicked from your faction and banned for two days.", GetPlayerNameEx(playerid), GetVehicleName(iVehicleID));
  3071. ShowPlayerDialogEx(iTargetID, 0, DIALOG_STYLE_MSGBOX, "Restricted Vehicle Warning", szMessage, "Exit", "");
  3072. SendClientMessageEx(playerid, COLOR_GRAD1, "You have warned this person for abusing their restricted vehicle.");
  3073. new playerip[32];
  3074. GetPlayerIp(iTargetID, playerip, sizeof(playerip));
  3075. format(szMessage, sizeof(szMessage), "AdmCmd: %s(%d) (IP:%s) was banned by %s, reason: Abuse of faction vehicles", GetPlayerNameEx(iTargetID), GetPlayerSQLId(iTargetID), playerip, GetPlayerNameEx(playerid));
  3076. Log("logs/ban.log", szMessage);
  3077. format(szMessage, sizeof(szMessage), "AdmCmd: %s was banned by %s, reason: Abuse of faction vehicles", GetPlayerNameEx(iTargetID), GetPlayerNameEx(playerid));
  3078. SendClientMessageToAllEx(COLOR_LIGHTRED, szMessage);
  3079. PlayerInfo[iTargetID][pBanned] = 1;
  3080. AddBan(playerid, iTargetID, "Abuse of faction vehicles.");
  3081. SetTimerEx("KickEx", 1000, 0, "i", iTargetID);
  3082. }
  3083. }
  3084. }
  3085. PlayerInfo[iTargetID][pLastRVehWarn] = gettime();
  3086. }
  3087. else SendClientMessageEx(playerid, COLOR_GRAD1, "That person is not using a restricted vehicle.");
  3088. }
  3089. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  3090. return 1;
  3091. }
  3092. CMD:calc(playerid, params[]) {
  3093. return cmd_calculate(playerid, params);
  3094. }
  3095. CMD:calculate(playerid, params[])
  3096. {
  3097. new string[128], method[20], value1, value2;
  3098. if(sscanf(params, "ds[20]d", value1, method, value2))
  3099. {
  3100. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /calculate [value] [operation] [value].");
  3101. SendClientMessageEx(playerid, COLOR_GRAD2, "Operations: Add, Subtract, Multiply, Divide.");
  3102. return 1;
  3103. }
  3104. if(strcmp(method,"multiply",true) == 0 || strcmp(method,"*",true) == 0)
  3105. {
  3106. new sum = value1*value2;
  3107. format(string,sizeof(string),"%s * %s = %s.", number_format(value1), number_format(value2), number_format(sum));
  3108. SendClientMessageEx(playerid,COLOR_WHITE,string);
  3109. }
  3110. if(strcmp(method,"divide",true) == 0 || strcmp(method,"/",true) == 0)
  3111. {
  3112. if(value2 == 0)
  3113. {
  3114. SendClientMessageEx(playerid,COLOR_WHITE,"The world will implode in 10 seconds - you divided by zero, idiot!");
  3115. return 1;
  3116. }
  3117. new sum = value1/value2;
  3118. format(string,sizeof(string),"%s / %s = %s.", number_format(value1), number_format(value2), number_format(sum));
  3119. SendClientMessageEx(playerid,COLOR_WHITE,string);
  3120. }
  3121. if(strcmp(method,"add",true) == 0 || strcmp(method,"+",true) == 0)
  3122. {
  3123. new sum = value1+value2;
  3124. format(string,sizeof(string),"%s + %s = %s.", number_format(value1), number_format(value2), number_format(sum));
  3125. SendClientMessageEx(playerid,COLOR_WHITE,string);
  3126. }
  3127. if(strcmp(method,"subtract",true) == 0 || strcmp(method,"-",true) == 0)
  3128. {
  3129. new sum = value1-value2;
  3130. format(string,sizeof(string),"%s - %s = %s.", number_format(value1), number_format(value2), number_format(sum));
  3131. SendClientMessageEx(playerid,COLOR_WHITE,string);
  3132. }
  3133. return 1;
  3134. }
  3135. CMD:suspend(playerid, params[])
  3136. {
  3137. if(PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pAP] >= 2 || PlayerInfo[playerid][pHR] >= 3 || PlayerInfo[playerid][pSecurity] >= 2)
  3138. {
  3139. new string[128], giveplayerid;
  3140. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /suspend [player]");
  3141. if(IsPlayerConnected(giveplayerid))
  3142. {
  3143. format(string, sizeof(string), "AdmCmd: %s(%d) has been suspended by %s.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid));
  3144. Log("logs/admin.log", string);
  3145. DBLog(playerid, giveplayerid, "Admin", "account suspended");
  3146. format(string, sizeof(string), "AdmCmd: %s has been suspended by %s.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
  3147. ABroadCast(COLOR_LIGHTRED, string, 2);
  3148. PlayerInfo[giveplayerid][pAdmin] = 0;
  3149. PlayerInfo[giveplayerid][pHR] = 0;
  3150. PlayerInfo[giveplayerid][pAP] = 0;
  3151. PlayerInfo[giveplayerid][pPR] = 0;
  3152. PlayerInfo[giveplayerid][pSecurity] = 0;
  3153. PlayerInfo[giveplayerid][pShopTech] = 0;
  3154. PlayerInfo[giveplayerid][pFactionModerator] = 0;
  3155. PlayerInfo[giveplayerid][pGangModerator] = 0;
  3156. PlayerInfo[giveplayerid][pUndercover] = 0;
  3157. PlayerInfo[giveplayerid][pBanAppealer] = 0;
  3158. PlayerInfo[giveplayerid][pLeader] = 0;
  3159. PlayerInfo[giveplayerid][pMember] = 0;
  3160. PlayerInfo[giveplayerid][pSecureIP][0] = 0;
  3161. PlayerInfo[giveplayerid][pSMod] = 0;
  3162. PlayerInfo[giveplayerid][pDonateRank] = 0;
  3163. PlayerInfo[giveplayerid][pBanAppealer] = 0;
  3164. PlayerInfo[giveplayerid][pShopTech] = 0;
  3165. PlayerInfo[giveplayerid][pDisabled] = 1;
  3166. Kick(giveplayerid);
  3167. }
  3168. }
  3169. else
  3170. {
  3171. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  3172. }
  3173. return 1;
  3174. }
  3175. CMD:osuspend(playerid, params[])
  3176. {
  3177. if(PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pAP] >= 2 || PlayerInfo[playerid][pHR] >= 3 || PlayerInfo[playerid][pSecurity] >= 2)
  3178. {
  3179. new string[128], query[512], tmpName[MAX_PLAYER_NAME];
  3180. if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /osuspend [player name]");
  3181. mysql_escape_string(params, tmpName);
  3182. SetPVarString(playerid, "OnSetSuspended", tmpName);
  3183. mysql_format(MainPipeline, query,sizeof(query),"UPDATE `accounts` SET `Disabled` = 1, `AdminLevel` = 0, `HR` = 0, `AP` = 0, `Security` = 0, `ShopTech` = 0, `FactionModerator` = 0, `GangModerator` = 0, \
  3184. `Undercover` = 0, `BanAppealer` = 0, `Leader` = 0, `Member` = 0, `SecureIP` = '0.0.0.0', `SeniorModerator` = 0, `BanAppealer` = 0, `ShopTech` = 0 WHERE `Username`= '%s' AND `AdminLevel` < 1338 AND `AdminLevel` > 1", tmpName);
  3185. mysql_tquery(MainPipeline, query, "OnSetSuspended", "ii", playerid, true);
  3186. format(string, sizeof(string), "Attempting to suspend %s's account.", tmpName);
  3187. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  3188. }
  3189. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  3190. return 1;
  3191. }
  3192. CMD:prisonaccount(playerid, params[])
  3193. {
  3194. if(PlayerInfo[playerid][pAdmin] >= 3)
  3195. {
  3196. new string[128], name[MAX_PLAYER_NAME], minutes, reason[64];
  3197. if(sscanf(params, "s[24]ds[64]", name, minutes, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /prisonaccount [player name] [time (minutes)] [reason]");
  3198. new giveplayerid = ReturnUser(name);
  3199. if(IsPlayerConnected(giveplayerid))
  3200. {
  3201. if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin])
  3202. {
  3203. SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
  3204. return 1;
  3205. }
  3206. //if(strlen(reason) >= 25) return SendClientMessageEx(playerid, COLOR_WHITE, "Please provide a shorter reason. The maximum length for a prison reason is 25.");
  3207. }
  3208. else
  3209. {
  3210. new tmpName[24], tmpPrisonedBy[24], tmpPrisonReason[64], query[512];
  3211. format(tmpPrisonReason, 64, "[OOC][PRISONACC] %s", reason);
  3212. format(tmpPrisonedBy, 24, "%s", GetPlayerNameEx(playerid));
  3213. mysql_escape_string(name, tmpName);
  3214. mysql_escape_string(tmpPrisonReason, tmpPrisonReason);
  3215. SetPVarString(playerid, "OnPrisonAccount", tmpName);
  3216. SetPVarString(playerid, "OnPrisonAccountReason", tmpPrisonReason);
  3217. format(string, sizeof(string), "Attempting to prison %s's account for %d minutes...", tmpName, minutes);
  3218. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  3219. mysql_format(MainPipeline, query,sizeof(query),"UPDATE `accounts` SET `PrisonReason` = '%s', `PrisonedBy` = '%s', `JailTime` = %d WHERE `PermBand` < 3 AND `Band` < 1 AND `AdminLevel` < %d AND `Username` = '%s'", tmpPrisonReason, tmpPrisonedBy, minutes*60, PlayerInfo[playerid][pAdmin], tmpName);
  3220. mysql_tquery(MainPipeline, query, "OnPrisonAccount", "i", playerid);
  3221. }
  3222. }
  3223. return 1;
  3224. }
  3225. CMD:jailaccount(playerid, params[])
  3226. {
  3227. if(PlayerInfo[playerid][pAdmin] >= 3)
  3228. {
  3229. new string[128], name[MAX_PLAYER_NAME], minutes, reason[64];
  3230. if(sscanf(params, "s[24]ds[64]", name, minutes, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /jailaccount [player name] [time (minutes)] [reason]");
  3231. new tmpName[24], tmpPrisonedBy[24], tmpPrisonReason[64], query[512];
  3232. format(tmpPrisonReason, 64, "[OOC][JAILACC] %s", reason);
  3233. format(tmpPrisonedBy, 24, "%s", GetPlayerNameEx(playerid));
  3234. mysql_escape_string(name, tmpName);
  3235. mysql_escape_string(tmpPrisonReason, tmpPrisonReason);
  3236. SetPVarString(playerid, "OnJailAccount", tmpName);
  3237. SetPVarString(playerid, "OnJailAccountReason", tmpPrisonReason);
  3238. format(string, sizeof(string), "Attempting to jail %s's account for %d minutes...", tmpName, minutes);
  3239. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  3240. mysql_format(MainPipeline, query,sizeof(query),"UPDATE `accounts` SET `PrisonReason` = '%s', `PrisonedBy` = '%s', `JailTime` = %d WHERE `PermBand` < 3 AND `Band` < 1 AND `AdminLevel` < %d AND `Username` = '%s'", tmpPrisonReason, tmpPrisonedBy, minutes*60, PlayerInfo[playerid][pAdmin], tmpName);
  3241. mysql_tquery(MainPipeline, query, "OnJailAccount", "i", playerid);
  3242. }
  3243. return 1;
  3244. }
  3245. CMD:release(playerid, params[])
  3246. {
  3247. if(PlayerInfo[playerid][pAdmin] >= 3 || PlayerInfo[playerid][pASM] >= 1)
  3248. {
  3249. new string[128], giveplayerid, reason[64];
  3250. if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /release [player] [reason]");
  3251. if(IsPlayerConnected(giveplayerid))
  3252. {
  3253. if(PlayerInfo[giveplayerid][pJailTime] == 0)
  3254. {
  3255. SendClientMessageEx(playerid, COLOR_GRAD1, "This player is not currently in prison!");
  3256. }
  3257. else
  3258. {
  3259. format(string, sizeof(string), "AdmCmd: %s(%d) has been released from prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), reason);
  3260. Log("logs/admin.log", string);
  3261. DBLog(playerid, giveplayerid, "Admin", "released from prison");
  3262. format(string, sizeof(string), "AdmCmd: %s has been released from prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
  3263. SendClientMessageToAllEx(COLOR_LIGHTRED, string);
  3264. PhoneOnline[giveplayerid] = 0;
  3265. PlayerInfo[giveplayerid][pWantedLevel] = 0;
  3266. PlayerInfo[giveplayerid][pBeingSentenced] = 0;
  3267. SetPlayerToTeamColor(giveplayerid);
  3268. SetHealth(giveplayerid, 100);
  3269. SetPlayerWantedLevel(giveplayerid, 0);
  3270. PlayerInfo[giveplayerid][pJailTime] = 0;
  3271. SetPlayerPos(giveplayerid, 1529.6,-1691.2,13.3);
  3272. SetPlayerInterior(giveplayerid,0);
  3273. PlayerInfo[giveplayerid][pInt] = 0;
  3274. SetPlayerVirtualWorld(giveplayerid, 0);
  3275. PlayerInfo[giveplayerid][pVW] = 0;
  3276. strcpy(PlayerInfo[giveplayerid][pPrisonReason], "None", 128);
  3277. SetPlayerToTeamColor(giveplayerid);
  3278. }
  3279. }
  3280. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  3281. }
  3282. else
  3283. {
  3284. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  3285. }
  3286. return 1;
  3287. }
  3288. CMD:sprison(playerid, params[])
  3289. {
  3290. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pUndercover] >= 1 || PlayerInfo[playerid][pASM] >= 1)
  3291. {
  3292. new giveplayerid, minutes, reason[64];
  3293. if(sscanf(params, "uds[64]", giveplayerid, minutes, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /sprison [player] [minutes] [reason]");
  3294. if(IsPlayerConnected(giveplayerid))
  3295. {
  3296. if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin]) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
  3297. //if(strlen(reason) >= 25) return SendClientMessageEx(playerid, COLOR_WHITE, "Please provide a shorter reason. The maximum length for a prison reason is 25.");
  3298. if(PrisonPlayer(playerid, giveplayerid, reason, minutes, .silent=1, .custom=1) == 0) return 1;
  3299. }
  3300. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  3301. }
  3302. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  3303. return 1;
  3304. }
  3305. CMD:jail(playerid, params[])
  3306. {
  3307. new giveplayerid, minutes, reason[64];
  3308. if(sscanf(params, "uds[64]", giveplayerid, minutes, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /jail [player] [minutes] [reason]");
  3309. if(minutes < 15 || minutes > 45) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't jail for less than 15 minutes or more than 45 minutes.");
  3310. if (PlayerInfo[playerid][pAdmin] >= 1)
  3311. {
  3312. if(PlayerInfo[playerid][pSMod] < 1 && PlayerInfo[playerid][pAdmin] == 1) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  3313. if(IsPlayerConnected(giveplayerid))
  3314. {
  3315. if((PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin]) || (PlayerInfo[playerid][pAdmin] == 1 && (PlayerInfo[giveplayerid][pHelper] >= 2 || PlayerInfo[giveplayerid][pWatchdog] >= 2))) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
  3316. if(PrisonPlayer(playerid, giveplayerid, reason, .time=minutes, .custom=1) == 0) return 1;
  3317. }
  3318. }
  3319. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  3320. return 1;
  3321. }
  3322. CMD:setstat(playerid, params[])
  3323. {
  3324. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  3325. {
  3326. new string[128], giveplayerid, statcode, amount;
  3327. if(sscanf(params, "udd", giveplayerid, statcode, amount))
  3328. {
  3329. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setstat [player] [statcode] [amount]");
  3330. SendClientMessageEx(playerid, COLOR_GRAD4, "|1 Level |2 ArmorUpgrade |3 UpgradePoints |4 Model |5 BankAccount |6 PhoneNumber |7 RespectPoints |8 House1 |9 House2 |10 House3");
  3331. SendClientMessageEx(playerid, COLOR_GRAD2, "|11 Not Used |12 Det |13 Lawyer |14 Fixer |17 Drug |18 Sex |19 Box |20 Arms |21 Materials |22 Pot |23 Crack");
  3332. SendClientMessageEx(playerid, COLOR_GRAD2, "|24 Fishing |25 Job |26 Rank |27 Packages |28 Crates |29 Smuggler |30 Insurance |31 Warnings |32 Screwdriver");
  3333. SendClientMessageEx(playerid, COLOR_GRAD1, "|33 Age |34 Gender |35 NMute |36 AdMute |37 Faction |38 Restricted Weapon Time |39 Gang Warns |40 RMute |41 Reward Hours");
  3334. SendClientMessageEx(playerid, COLOR_GRAD1, "|42 Playing Hours |43 Gold Box Tokens |44 Computer Drawings |45 Papers |46 Business |47 BusinessRank | 48 Spraycan");
  3335. SendClientMessageEx(playerid, COLOR_GRAD1, "|49 Heroin |50 RawOpium |51 Syringes |52 Hunger |53 Fitness |54 Event Tokens |55 Modkit");
  3336. SendClientMessageEx(playerid, COLOR_GRAD2, "|56 Car Jack Skill |57 Lock Pick Vehicle Count |58 Lock Pick Vehicle Time |59 Tool Box |60 Crowbar");
  3337. return 1;
  3338. }
  3339. if(PlayerInfo[giveplayerid][pLevel] == 1 && PlayerInfo[giveplayerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_RED, "You can't use /setstat on level 1's");
  3340. if(IsPlayerConnected(giveplayerid))
  3341. {
  3342. switch (statcode)
  3343. {
  3344. case 1:
  3345. {
  3346. PlayerInfo[giveplayerid][pLevel] = amount;
  3347. format(string, sizeof(string), " %s's(%d) Level has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3348. SetPlayerScore(giveplayerid, PlayerInfo[giveplayerid][pLevel]);
  3349. }
  3350. case 2:
  3351. {
  3352. PlayerInfo[giveplayerid][pSHealth] = amount;
  3353. format(string, sizeof(string), " %s's(%d) ArmorUpgrade has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3354. }
  3355. case 3:
  3356. {
  3357. PlayerInfo[giveplayerid][gPupgrade] = amount;
  3358. format(string, sizeof(string), " %s's(%d) Upgrade Points has been set %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3359. }
  3360. case 4:
  3361. {
  3362. PlayerInfo[giveplayerid][pModel] = amount;
  3363. format(string, sizeof(string), " %s's(%d) Model has been set %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3364. }
  3365. case 5:
  3366. {
  3367. PlayerInfo[giveplayerid][pAccount] = amount;
  3368. format(string, sizeof(string), " %s's(%d) Bank Account has been set to $%d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3369. }
  3370. case 6:
  3371. {
  3372. if(amount == 0)
  3373. {
  3374. PlayerInfo[giveplayerid][pPnumber] = amount;
  3375. format(string, sizeof(string), " %s had their phone removed", GetPlayerNameEx(giveplayerid));
  3376. }
  3377. else
  3378. {
  3379. new query[128];
  3380. SetPVarInt(giveplayerid, "WantedPh", amount);
  3381. SetPVarInt(giveplayerid, "CurrentPh", PlayerInfo[giveplayerid][pPnumber]);
  3382. SetPVarInt(giveplayerid, "PhChangeCost", 50000);
  3383. SetPVarInt(giveplayerid, "PhChangerId", playerid);
  3384. mysql_format(MainPipeline, query, sizeof(query), "SELECT `Username` FROM `accounts` WHERE `PhoneNr` = '%d'",amount);
  3385. mysql_tquery(MainPipeline, query, "OnPhoneNumberCheck", "ii", giveplayerid, 4);
  3386. return 1;
  3387. }
  3388. }
  3389. case 7:
  3390. {
  3391. PlayerInfo[giveplayerid][pExp] = amount;
  3392. format(string, sizeof(string), " %s's(%d) Respect Points have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3393. }
  3394. case 8:
  3395. {
  3396. PlayerInfo[giveplayerid][pPhousekey] = amount;
  3397. format(string, sizeof(string), " %s's(%d) House 1 has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3398. }
  3399. case 9:
  3400. {
  3401. PlayerInfo[giveplayerid][pPhousekey2] = amount;
  3402. format(string, sizeof(string), " %s's(%d) House 2 has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3403. }
  3404. case 10:
  3405. {
  3406. PlayerInfo[giveplayerid][pPhousekey3] = amount;
  3407. format(string, sizeof(string), " %s's(%d) House 3 has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3408. }
  3409. case 11:
  3410. {
  3411. return SendClientMessageEx(playerid, COLOR_WHITE, "Family system has been merged to group system!");
  3412. }
  3413. case 12:
  3414. {
  3415. PlayerInfo[giveplayerid][pDetSkill] = amount;
  3416. format(string, sizeof(string), " %s's(%d) Detective Skill has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3417. }
  3418. case 13:
  3419. {
  3420. PlayerInfo[giveplayerid][pLawSkill] = amount;
  3421. format(string, sizeof(string), " %s's(%d) Lawyer Skill has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3422. }
  3423. case 14:
  3424. {
  3425. PlayerInfo[giveplayerid][pMechSkill] = amount;
  3426. format(string, sizeof(string), " %s's(%d) Car Mechanic Skill has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3427. }
  3428. case 17:
  3429. {
  3430. return 1;
  3431. }
  3432. case 18:
  3433. {
  3434. PlayerInfo[giveplayerid][pSexSkill] = amount;
  3435. format(string, sizeof(string), " %s's(%d) Sex Skill has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3436. }
  3437. case 19:
  3438. {
  3439. PlayerInfo[giveplayerid][pBoxSkill] = amount;
  3440. format(string, sizeof(string), " %s's(%d) Box Skill has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3441. }
  3442. case 20:
  3443. {
  3444. PlayerInfo[giveplayerid][pArmsSkill] = amount;
  3445. format(string, sizeof(string), " %s's(%d) Arms Skill has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3446. }
  3447. case 21:
  3448. {
  3449. PlayerInfo[giveplayerid][pMats] = amount;
  3450. format(string, sizeof(string), " %s's(%d) Materials have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3451. }
  3452. case 22:
  3453. {
  3454. PlayerInfo[giveplayerid][pDrugs][0] = amount;
  3455. format(string, sizeof(string), " %s's(%d) Pot has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3456. }
  3457. case 23:
  3458. {
  3459. PlayerInfo[giveplayerid][pDrugs][1] = amount;
  3460. format(string, sizeof(string), " %s's(%d) Crack has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3461. }
  3462. case 24:
  3463. {
  3464. PlayerInfo[playerid][pFishingSkill] = amount;
  3465. format(string, sizeof(string), " %s's(%d) Fishing Skill has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3466. }
  3467. case 25:
  3468. {
  3469. PlayerInfo[giveplayerid][pJob] = amount;
  3470. format(string, sizeof(string), " %s's(%d) Job has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3471. }
  3472. case 26:
  3473. {
  3474. PlayerInfo[giveplayerid][pRank] = amount;
  3475. format(string, sizeof(string), " %s's(%d) Rank has been to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3476. }
  3477. case 27:
  3478. {
  3479. SetPVarInt(giveplayerid, "Packages", amount);
  3480. format(string, sizeof(string), " %s's(%d) Materials Packages have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3481. }
  3482. case 28:
  3483. {
  3484. PlayerInfo[giveplayerid][pCrates] = amount;
  3485. format(string, sizeof(string), " %s's(%d) Drug Crates have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3486. }
  3487. case 29:
  3488. {
  3489. PlayerInfo[giveplayerid][pDrugSmuggler] = amount;
  3490. format(string, sizeof(string), " %s's(%d) Smuggler Skill has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3491. }
  3492. case 30:
  3493. {
  3494. PlayerInfo[giveplayerid][pInsurance] = amount;
  3495. format(string, sizeof(string), " %s's(%d) Insurance has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3496. }
  3497. case 31:
  3498. {
  3499. PlayerInfo[giveplayerid][pWarns] = amount;
  3500. format(string, sizeof(string), " %s's(%d) Warnings have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3501. }
  3502. case 32:
  3503. {
  3504. PlayerInfo[giveplayerid][pScrewdriver] = amount;
  3505. format(string, sizeof(string), " %s's(%d) Screwdrivers have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3506. }
  3507. /*case 33:
  3508. {
  3509. PlayerInfo[giveplayerid][pBirthDate] = amount;
  3510. format(string, sizeof(string), " %s's(%d) Age has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3511. }*/
  3512. case 34:
  3513. {
  3514. PlayerInfo[giveplayerid][pSex] = amount;
  3515. format(string, sizeof(string), " %s's(%d) Gender has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3516. }
  3517. case 35:
  3518. {
  3519. PlayerInfo[giveplayerid][pNMuteTotal] = amount;
  3520. format(string, sizeof(string), " %s's(%d) Total Newbie Mutes has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3521. }
  3522. case 36:
  3523. {
  3524. PlayerInfo[giveplayerid][pADMuteTotal] = amount;
  3525. format(string, sizeof(string), " %s's(%d) Total Ad Mutes has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3526. }
  3527. case 37:
  3528. {
  3529. PlayerInfo[giveplayerid][pMember] = amount;
  3530. format(string, sizeof(string), " %s's(%d) Faction has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3531. }
  3532. case 38:
  3533. {
  3534. if(PlayerInfo[giveplayerid][pConnectHours] >= 2) {
  3535. PlayerInfo[giveplayerid][pWRestricted] = amount;
  3536. if(amount) ResetPlayerWeaponsEx(giveplayerid);
  3537. format(string, sizeof(string), " %s's(%d) Weapon Restricted Time has been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3538. }
  3539. else {
  3540. return SendClientMessageEx(playerid, COLOR_GREY, "You cannot set this on a person who has under 2 playing hours.");
  3541. }
  3542. }
  3543. case 39:
  3544. {
  3545. PlayerInfo[giveplayerid][pGangWarn] = amount;
  3546. format(string, sizeof(string), " %s's(%d) Gang Warns have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3547. }
  3548. case 40:
  3549. {
  3550. PlayerInfo[giveplayerid][pRMutedTotal] = amount;
  3551. format(string, sizeof(string), " %s's(%d) Report Mutes have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3552. }
  3553. case 41:
  3554. {
  3555. PlayerInfo[giveplayerid][pRewardHours] = amount;
  3556. format(string, sizeof(string), " %s's(%d) Reward Playing Hours have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3557. }
  3558. case 42:
  3559. {
  3560. PlayerInfo[giveplayerid][pConnectHours] = amount;
  3561. format(string, sizeof(string), " %s's(%d) Playing Hours have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3562. }
  3563. case 43:
  3564. {
  3565. PlayerInfo[giveplayerid][pGoldBoxTokens] = amount;
  3566. format(string, sizeof(string), " %s's(%d) Box Tokens have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3567. }
  3568. case 44:
  3569. {
  3570. PlayerInfo[giveplayerid][pRewardDrawChance] = amount;
  3571. format(string, sizeof(string), " %s's(%d) Computer Drawings have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3572. }
  3573. case 45:
  3574. {
  3575. PlayerInfo[giveplayerid][pPaper] = amount;
  3576. format(string, sizeof(string), " %s's(%d) Papers have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3577. }
  3578. case 46:
  3579. {
  3580. if (amount < 0 || amount >= MAX_BUSINESSES) return 1;
  3581. PlayerInfo[giveplayerid][pBusiness] = amount;
  3582. format(string, sizeof(string), " %s's(%d) Business have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3583. }
  3584. case 47:
  3585. {
  3586. if (amount < 0 || amount > 5) return 1;
  3587. PlayerInfo[giveplayerid][pBusinessRank] = amount;
  3588. format(string, sizeof(string), " %s's(%d) Business Rank have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3589. }
  3590. case 48:
  3591. {
  3592. PlayerInfo[giveplayerid][pSpraycan] = amount;
  3593. format(string, sizeof(string), " %s's(%d) Spraycans have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3594. }
  3595. case 49:
  3596. {
  3597. PlayerInfo[giveplayerid][pHeroin] = amount;
  3598. format(string, sizeof(string), " %s's(%d) Heroin have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3599. }
  3600. case 50:
  3601. {
  3602. PlayerInfo[giveplayerid][pRawOpium] = amount;
  3603. format(string, sizeof(string), " %s's(%d) raw opium have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3604. }
  3605. case 51:
  3606. {
  3607. PlayerInfo[giveplayerid][pSyringes] = amount;
  3608. format(string, sizeof(string), " %s's(%d) Syringes have been set to %d.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3609. }
  3610. case 52:
  3611. {
  3612. return 1;
  3613. }
  3614. case 53:
  3615. {
  3616. return 1;
  3617. }
  3618. case 54:
  3619. {
  3620. PlayerInfo[giveplayerid][pEventTokens] = amount;
  3621. format(string, sizeof(string), " %s's(%d) Event Tokens have been set to %i.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3622. }
  3623. case 55:
  3624. {
  3625. PlayerInfo[giveplayerid][pRimMod] = amount;
  3626. format(string, sizeof(string), " %s's(%d) Rim Kits have been set to %i.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3627. }
  3628. case 56:
  3629. {
  3630. PlayerInfo[giveplayerid][pCarLockPickSkill] = amount;
  3631. format(string, sizeof(string), " %s's(%d) Car Lock Pick Skill have been set to %i.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3632. }
  3633. case 57:
  3634. {
  3635. PlayerInfo[giveplayerid][pLockPickVehCount] = amount;
  3636. format(string, sizeof(string), " %s's(%d) Lock Pick Vehicle Count have been set to %i.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3637. }
  3638. case 58:
  3639. {
  3640. PlayerInfo[giveplayerid][pLockPickTime] = amount;
  3641. format(string, sizeof(string), " %s's(%d) Lock Pick Vehicle Time have been set to %i.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3642. }
  3643. case 59:
  3644. {
  3645. PlayerInfo[giveplayerid][pToolBox] = amount;
  3646. format(string, sizeof(string), " %s's(%d) Tool Box usages have been set to %i.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3647. }
  3648. case 60:
  3649. {
  3650. PlayerInfo[giveplayerid][pCrowBar] = amount;
  3651. format(string, sizeof(string), " %s's(%d) Crowbar usages have been set to %i.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), amount);
  3652. }
  3653. default:
  3654. {
  3655. format(string, sizeof(string), " Invalid stat code.", amount);
  3656. }
  3657. }
  3658. format(string, sizeof(string), "%s by %s", string, GetPlayerNameEx(playerid));
  3659. Log("logs/stats.log", string);
  3660. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  3661. }
  3662. else return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  3663. }
  3664. return 1;
  3665. }
  3666. CMD:setmystat(playerid, params[])
  3667. {
  3668. if(PlayerInfo[playerid][pUndercover] >= 1 || PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  3669. {
  3670. new string[128], statcode, amount;
  3671. if(sscanf(params, "dd", statcode, amount))
  3672. {
  3673. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1) {
  3674. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setmystat [statcode] [amount]");
  3675. SendClientMessageEx(playerid, COLOR_GRAD4, "|1 Level |2 ArmorUpgrade |3 UpgradePoints |4 Model |5 BankAccount |6 PhoneNumber |7 RespectPoints |8 House1 |9 House2 |10 House3");
  3676. SendClientMessageEx(playerid, COLOR_GRAD2, "|11 Not Used |12 Det |13 Lawyer |14 Fixer |17 Drug |18 Sex |19 Box |20 Arms |21 Materials |22 Cannabis |23 Crack");
  3677. SendClientMessageEx(playerid, COLOR_GRAD2, "|24 Fishing |25 Job |26 Rank |27 Packages |28 Crates |29 Smuggler |30 Insurance |31 Warnings |32 Screwdriver");
  3678. SendClientMessageEx(playerid, COLOR_GRAD1, "|33 Age |34 Gender |35 NMute |36 AdMute |37 Faction |38 Restricted Weapon Time |39 Gang Warns |40 RMute |41 Reward Hours");
  3679. SendClientMessageEx(playerid, COLOR_GRAD1, "|42 Playing Hours |43 Gold Box Tokens |44 Computer Drawings |45 Papers |46 Business |47 BusinessRank | 48 Spraycan");
  3680. SendClientMessageEx(playerid, COLOR_GRAD1, "|49 Heroin |50 RawOpium |51 Syringes |52 Hunger |53 Fitness |54 Event Tokens |55 Modkit");
  3681. SendClientMessageEx(playerid, COLOR_GRAD2, "|56 Car Lock Pick Skill |57 Lock Pick Vehicle Count |58 Lock Pick Vehicle Time");
  3682. return 1;
  3683. }
  3684. else if (PlayerInfo[playerid][pUndercover] >= 1) {
  3685. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setmystat [statcode] [amount]");
  3686. SendClientMessageEx(playerid, COLOR_GRAD4, "|1 Level |6 PhoneNumber |26 Rank |33 Age |34 Gender |37 Faction ");
  3687. return 1;
  3688. }
  3689. }
  3690. if((PlayerInfo[playerid][pUndercover] >= 1 && PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1) && statcode != 1 && statcode != 6 && statcode != 26 && statcode != 33
  3691. && statcode != 34 && statcode != 37 && statcode != 52) return 1;
  3692. switch (statcode)
  3693. {
  3694. case 1:
  3695. {
  3696. PlayerInfo[playerid][pLevel] = amount;
  3697. format(string, sizeof(string), " %s's Level has been set to %d.", GetPlayerNameEx(playerid), amount);
  3698. SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  3699. }
  3700. case 2:
  3701. {
  3702. PlayerInfo[playerid][pSHealth] = amount;
  3703. format(string, sizeof(string), " %s's ArmorUpgrade has been set to %d.", GetPlayerNameEx(playerid), amount);
  3704. }
  3705. case 3:
  3706. {
  3707. PlayerInfo[playerid][gPupgrade] = amount;
  3708. format(string, sizeof(string), " %s's Upgrade Points has been set %d.", GetPlayerNameEx(playerid), amount);
  3709. }
  3710. case 4:
  3711. {
  3712. PlayerInfo[playerid][pModel] = amount;
  3713. format(string, sizeof(string), " %s's Model has been set %d.", GetPlayerNameEx(playerid), amount);
  3714. }
  3715. case 5:
  3716. {
  3717. PlayerInfo[playerid][pAccount] = amount;
  3718. format(string, sizeof(string), " %s's Bank Account has been set to $%d.", GetPlayerNameEx(playerid), amount);
  3719. }
  3720. case 6:
  3721. {
  3722. if(amount == 0)
  3723. {
  3724. PlayerInfo[playerid][pPnumber] = amount;
  3725. format(string, sizeof(string), " %s had their phone removed", GetPlayerNameEx(playerid));
  3726. }
  3727. else
  3728. {
  3729. new query[128];
  3730. SetPVarInt(playerid, "WantedPh", amount);
  3731. SetPVarInt(playerid, "CurrentPh", PlayerInfo[playerid][pPnumber]);
  3732. SetPVarInt(playerid, "PhChangeCost", 50000);
  3733. SetPVarInt(playerid, "PhChangerId", playerid);
  3734. mysql_format(MainPipeline, query, sizeof(query), "SELECT `Username` FROM `accounts` WHERE `PhoneNr` = '%d'",amount);
  3735. mysql_tquery(MainPipeline, query, "OnPhoneNumberCheck", "ii", playerid, 4);
  3736. return 1;
  3737. }
  3738. }
  3739. case 7:
  3740. {
  3741. PlayerInfo[playerid][pExp] = amount;
  3742. format(string, sizeof(string), " %s's Respect Points have been set to %d.", GetPlayerNameEx(playerid), amount);
  3743. }
  3744. case 8:
  3745. {
  3746. PlayerInfo[playerid][pPhousekey] = amount;
  3747. format(string, sizeof(string), " %s's House 1 has been set to %d.", GetPlayerNameEx(playerid), amount);
  3748. }
  3749. case 9:
  3750. {
  3751. PlayerInfo[playerid][pPhousekey2] = amount;
  3752. format(string, sizeof(string), " %s's House 2 has been set to %d.", GetPlayerNameEx(playerid), amount);
  3753. }
  3754. case 10:
  3755. {
  3756. PlayerInfo[playerid][pPhousekey3] = amount;
  3757. format(string, sizeof(string), " %s's House 3 has been set to %d.", GetPlayerNameEx(playerid), amount);
  3758. }
  3759. case 11:
  3760. {
  3761. SendClientMessageEx(playerid, COLOR_WHITE, "Family system has been merged to group system!");
  3762. }
  3763. case 12:
  3764. {
  3765. PlayerInfo[playerid][pDetSkill] = amount;
  3766. format(string, sizeof(string), " %s's Detective Skill has been set to %d.", GetPlayerNameEx(playerid), amount);
  3767. }
  3768. case 13:
  3769. {
  3770. PlayerInfo[playerid][pLawSkill] = amount;
  3771. format(string, sizeof(string), " %s's Lawyer Skill has been set to %d.", GetPlayerNameEx(playerid), amount);
  3772. }
  3773. case 14:
  3774. {
  3775. PlayerInfo[playerid][pMechSkill] = amount;
  3776. format(string, sizeof(string), " %s's Car Mechanic Skill has been set to %d.", GetPlayerNameEx(playerid), amount);
  3777. }
  3778. case 17:
  3779. {
  3780. PlayerInfo[playerid][pDrugSmuggler] = amount;
  3781. format(string, sizeof(string), " %s's Drug Smuggler Skill has been set to %d.", GetPlayerNameEx(playerid), amount);
  3782. }
  3783. case 18:
  3784. {
  3785. PlayerInfo[playerid][pSexSkill] = amount;
  3786. format(string, sizeof(string), " %s's Sex Skill has been set to %d.", GetPlayerNameEx(playerid), amount);
  3787. }
  3788. case 19:
  3789. {
  3790. PlayerInfo[playerid][pBoxSkill] = amount;
  3791. format(string, sizeof(string), " %s's Box Skill has been set to %d.", GetPlayerNameEx(playerid), amount);
  3792. }
  3793. case 20:
  3794. {
  3795. PlayerInfo[playerid][pArmsSkill] = amount;
  3796. format(string, sizeof(string), " %s's Arms Skill has been set to %d.", GetPlayerNameEx(playerid), amount);
  3797. }
  3798. case 21:
  3799. {
  3800. PlayerInfo[playerid][pMats] = amount;
  3801. format(string, sizeof(string), " %s's Materials have been set to %d.", GetPlayerNameEx(playerid), amount);
  3802. }
  3803. case 22:
  3804. {
  3805. PlayerInfo[playerid][pDrugs][0] = amount;
  3806. format(string, sizeof(string), " %s's Cannabis has been set to %d.", GetPlayerNameEx(playerid), amount);
  3807. }
  3808. case 23:
  3809. {
  3810. PlayerInfo[playerid][pDrugs][1] = amount;
  3811. format(string, sizeof(string), " %s's Crack has been set to %d.", GetPlayerNameEx(playerid), amount);
  3812. }
  3813. case 24:
  3814. {
  3815. PlayerInfo[playerid][pFishingSkill] = amount;
  3816. format(string, sizeof(string), " %s's Fishing Skill has been set to %d.", GetPlayerNameEx(playerid), amount);
  3817. }
  3818. case 25:
  3819. {
  3820. PlayerInfo[playerid][pJob] = amount;
  3821. format(string, sizeof(string), " %s's Job has been set to %d.", GetPlayerNameEx(playerid), amount);
  3822. }
  3823. case 26:
  3824. {
  3825. PlayerInfo[playerid][pRank] = amount;
  3826. format(string, sizeof(string), " %s's Rank has been to %d.", GetPlayerNameEx(playerid), amount);
  3827. }
  3828. case 27:
  3829. {
  3830. SetPVarInt(playerid, "Packages", amount);
  3831. format(string, sizeof(string), " %s's Materials Packages have been set to %d.", GetPlayerNameEx(playerid), amount);
  3832. }
  3833. case 28:
  3834. {
  3835. PlayerInfo[playerid][pCrates] = amount;
  3836. format(string, sizeof(string), " %s's Drug Crates have been set to %d.", GetPlayerNameEx(playerid), amount);
  3837. }
  3838. case 29:
  3839. {
  3840. PlayerInfo[playerid][pDrugSmuggler] = amount;
  3841. format(string, sizeof(string), " %s's Smuggler Skill has been set to %d.", GetPlayerNameEx(playerid), amount);
  3842. }
  3843. case 30:
  3844. {
  3845. PlayerInfo[playerid][pInsurance] = amount;
  3846. format(string, sizeof(string), " %s's Insurance has been set to %d.", GetPlayerNameEx(playerid), amount);
  3847. }
  3848. case 31:
  3849. {
  3850. PlayerInfo[playerid][pWarns] = amount;
  3851. format(string, sizeof(string), " %s's Warnings have been set to %d.", GetPlayerNameEx(playerid), amount);
  3852. }
  3853. case 32:
  3854. {
  3855. PlayerInfo[playerid][pScrewdriver] = amount;
  3856. format(string, sizeof(string), " %s's Screwdrivers have been set to %d.", GetPlayerNameEx(playerid), amount);
  3857. }
  3858. /*case 33:
  3859. {
  3860. PlayerInfo[playerid][pBirthDate] = amount;
  3861. format(string, sizeof(string), " %s's Age has been set to %d.", GetPlayerNameEx(playerid), amount);
  3862. }*/
  3863. case 34:
  3864. {
  3865. PlayerInfo[playerid][pSex] = amount;
  3866. format(string, sizeof(string), " %s's Gender has been set to %d.", GetPlayerNameEx(playerid), amount);
  3867. }
  3868. case 35:
  3869. {
  3870. PlayerInfo[playerid][pNMuteTotal] = amount;
  3871. format(string, sizeof(string), " %s's Total Newbie Mutes has been set to %d.", GetPlayerNameEx(playerid), amount);
  3872. }
  3873. case 36:
  3874. {
  3875. PlayerInfo[playerid][pADMuteTotal] = amount;
  3876. format(string, sizeof(string), " %s's Total Ad Mutes has been set to %d.", GetPlayerNameEx(playerid), amount);
  3877. }
  3878. case 37:
  3879. {
  3880. PlayerInfo[playerid][pMember] = amount;
  3881. format(string, sizeof(string), " %s's Faction has been set to %d.", GetPlayerNameEx(playerid), amount);
  3882. }
  3883. case 38:
  3884. {
  3885. if(PlayerInfo[playerid][pConnectHours] >= 2) {
  3886. PlayerInfo[playerid][pWRestricted] = amount;
  3887. format(string, sizeof(string), " %s's Weapon Restricted Time has been set to %d.", GetPlayerNameEx(playerid), amount);
  3888. }
  3889. else {
  3890. return SendClientMessageEx(playerid, COLOR_GREY, "You cannot set this on a person who has under 2 playing hours.");
  3891. }
  3892. }
  3893. case 39:
  3894. {
  3895. PlayerInfo[playerid][pGangWarn] = amount;
  3896. format(string, sizeof(string), " %s's Gang Warns have been set to %d.", GetPlayerNameEx(playerid), amount);
  3897. }
  3898. case 40:
  3899. {
  3900. PlayerInfo[playerid][pRMutedTotal] = amount;
  3901. format(string, sizeof(string), " %s's Report Mutes have been set to %d.", GetPlayerNameEx(playerid), amount);
  3902. }
  3903. case 41:
  3904. {
  3905. PlayerInfo[playerid][pRewardHours] = amount;
  3906. format(string, sizeof(string), " %s's Reward Playing Hours have been set to %d.", GetPlayerNameEx(playerid), amount);
  3907. }
  3908. case 42:
  3909. {
  3910. PlayerInfo[playerid][pConnectHours] = amount;
  3911. format(string, sizeof(string), " %s's Playing Hours have been set to %d.", GetPlayerNameEx(playerid), amount);
  3912. }
  3913. case 43:
  3914. {
  3915. PlayerInfo[playerid][pGoldBoxTokens] = amount;
  3916. format(string, sizeof(string), " %s's Box Tokens have been set to %d.", GetPlayerNameEx(playerid), amount);
  3917. }
  3918. case 44:
  3919. {
  3920. PlayerInfo[playerid][pRewardDrawChance] = amount;
  3921. format(string, sizeof(string), " %s's Computer Drawings have been set to %d.", GetPlayerNameEx(playerid), amount);
  3922. }
  3923. case 45:
  3924. {
  3925. PlayerInfo[playerid][pPaper] = amount;
  3926. format(string, sizeof(string), " %s's Papers have been set to %d.", GetPlayerNameEx(playerid), amount);
  3927. }
  3928. case 46:
  3929. {
  3930. if (amount < 0 || amount >= MAX_BUSINESSES) return 1;
  3931. PlayerInfo[playerid][pBusiness] = amount;
  3932. format(string, sizeof(string), " %s's Business have been set to %d.", GetPlayerNameEx(playerid), amount);
  3933. }
  3934. case 47:
  3935. {
  3936. if (amount < 0 || amount > 5) return 1;
  3937. PlayerInfo[playerid][pBusinessRank] = amount;
  3938. format(string, sizeof(string), " %s's Business Rank have been set to %d.", GetPlayerNameEx(playerid), amount);
  3939. }
  3940. case 48:
  3941. {
  3942. PlayerInfo[playerid][pSpraycan] = amount;
  3943. format(string, sizeof(string), " %s's Spraycans have been set to %d.", GetPlayerNameEx(playerid), amount);
  3944. }
  3945. case 49:
  3946. {
  3947. PlayerInfo[playerid][pHeroin] = amount;
  3948. format(string, sizeof(string), " %s's Heroin have been set to %d.", GetPlayerNameEx(playerid), amount);
  3949. }
  3950. case 50:
  3951. {
  3952. PlayerInfo[playerid][pRawOpium] = amount;
  3953. format(string, sizeof(string), " %s's raw opium have been set to %d.", GetPlayerNameEx(playerid), amount);
  3954. }
  3955. case 51:
  3956. {
  3957. PlayerInfo[playerid][pSyringes] = amount;
  3958. format(string, sizeof(string), " %s's Syringes have been set to %d.", GetPlayerNameEx(playerid), amount);
  3959. }
  3960. case 52:
  3961. {
  3962. return 1;
  3963. }
  3964. case 53:
  3965. {
  3966. return 1;
  3967. }
  3968. case 54:
  3969. {
  3970. PlayerInfo[playerid][pEventTokens] = amount;
  3971. format(string, sizeof(string), " %s's Event Tokens have been set to %i.", GetPlayerNameEx(playerid), amount);
  3972. }
  3973. case 55:
  3974. {
  3975. PlayerInfo[playerid][pRimMod] = amount;
  3976. format(string, sizeof(string), " %s's Rim Kits have been set to %i.", GetPlayerNameEx(playerid), amount);
  3977. }
  3978. case 56:
  3979. {
  3980. PlayerInfo[playerid][pCarLockPickSkill] = amount;
  3981. format(string, sizeof(string), " %s's Car Lock Pick Skill have been set to %i.", GetPlayerNameEx(playerid), amount);
  3982. }
  3983. case 57:
  3984. {
  3985. PlayerInfo[playerid][pLockPickVehCount] = amount;
  3986. format(string, sizeof(string), " %s's Lock Pick Vehicle Count have been set to %i.", GetPlayerNameEx(playerid), amount);
  3987. }
  3988. case 58:
  3989. {
  3990. PlayerInfo[playerid][pLockPickTime] = amount;
  3991. format(string, sizeof(string), " %s's Lock Pick Vehicle Time have been set to %i.", GetPlayerNameEx(playerid), amount);
  3992. }
  3993. case 59:
  3994. {
  3995. PlayerInfo[playerid][pToolBox] = amount;
  3996. format(string, sizeof(string), " %s's Tool Box usages have been set to %i.", GetPlayerNameEx(playerid), amount);
  3997. }
  3998. case 60:
  3999. {
  4000. PlayerInfo[playerid][pCrowBar] = amount;
  4001. format(string, sizeof(string), " %s's Crowbar usages have been set to %i.", GetPlayerNameEx(playerid), amount);
  4002. }
  4003. default:
  4004. {
  4005. format(string, sizeof(string), " Invalid stat code.", amount);
  4006. }
  4007. }
  4008. format(string, sizeof(string), "%s by %s", string, GetPlayerNameEx(playerid));
  4009. Log("logs/undercover.log", string);
  4010. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  4011. }
  4012. return 1;
  4013. }
  4014. CMD:setvw(playerid, params[])
  4015. {
  4016. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4017. new giveplayerid, vw;
  4018. if(sscanf(params, "ud", giveplayerid, vw)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setvw [player] [virtual world]");
  4019. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  4020. new string[128];
  4021. if(GetPVarType(giveplayerid, "IsInArena"))
  4022. {
  4023. SetPVarInt(playerid, "tempPBP", giveplayerid);
  4024. format(string, sizeof(string), "%s (ID: %d) is currently in an active Paintball game.\n\nDo you want to force this player out?", GetPlayerNameEx(giveplayerid), giveplayerid);
  4025. ShowPlayerDialogEx(playerid, PBFORCE, DIALOG_STYLE_MSGBOX, "Paintball", string, "Yes", "No");
  4026. return 1;
  4027. }
  4028. PlayerInfo[giveplayerid][pVW] = vw;
  4029. SetPlayerVirtualWorld(giveplayerid, vw);
  4030. format(string, sizeof(string), "You have set %s's virtual world to %d.", GetPlayerNameEx(giveplayerid), vw);
  4031. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  4032. return 1;
  4033. }
  4034. CMD:setint(playerid, params[])
  4035. {
  4036. if (PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4037. new giveplayerid, int;
  4038. if(sscanf(params, "ud", giveplayerid, int)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setint [player] [interiorid]");
  4039. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  4040. new string[128];
  4041. PlayerInfo[giveplayerid][pInt] = int;
  4042. SetPlayerInterior(giveplayerid, int);
  4043. format(string, sizeof(string), "You have set %s's interior to %d.", GetPlayerNameEx(giveplayerid), int);
  4044. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  4045. return 1;
  4046. }
  4047. CMD:setskin(playerid, params[])
  4048. {
  4049. if (PlayerInfo[playerid][pAdmin] >= 3)
  4050. {
  4051. new string[128], giveplayerid, skinid;
  4052. if(sscanf(params, "ud", giveplayerid, skinid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setskin [player] [skinid]");
  4053. if(IsPlayerConnected(giveplayerid))
  4054. {
  4055. if((PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin]) && giveplayerid != playerid) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot use this command on a the same/greater level admin than you!");
  4056. if(!IsInvalidSkin(skinid))
  4057. {
  4058. if(GetPlayerSkin(giveplayerid) == skinid)
  4059. {
  4060. SendClientMessageEx( playerid, COLOR_WHITE, "The person you're trying to change skins of already is using the skin you're trying to set." );
  4061. }
  4062. else
  4063. {
  4064. PlayerInfo[giveplayerid][pModel] = skinid;
  4065. format(string, sizeof(string), "Your skin has been changed to ID %d by Administrator %s.", skinid, GetPlayerNameEx(playerid));
  4066. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  4067. format(string, sizeof(string), "You have given %s skin ID %d.", GetPlayerNameEx(giveplayerid), skinid);
  4068. SendClientMessageEx(playerid, COLOR_WHITE, string);
  4069. SetPlayerSkin(giveplayerid, PlayerInfo[giveplayerid][pModel]);
  4070. format(szMiscArray, sizeof(szMiscArray), "Skin changed %d", skinid);
  4071. DBLog(playerid, giveplayerid, "Admin", szMiscArray);
  4072. }
  4073. }
  4074. else
  4075. {
  4076. SendClientMessageEx(playerid, COLOR_GREY, "Invalid skin ID!");
  4077. }
  4078. }
  4079. }
  4080. else
  4081. {
  4082. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4083. }
  4084. return 1;
  4085. }
  4086. CMD:entercar(playerid, params[])
  4087. {
  4088. if (PlayerInfo[playerid][pAdmin] >= 3)
  4089. {
  4090. new carid, seatid;
  4091. if(sscanf(params, "ii", carid, seatid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /entercar [carid] [seatid]");
  4092. if(!(1 <= carid <= MAX_VEHICLES)) return SendClientMessageEx(playerid, COLOR_GREY, "Valid vehicle IDs run from 1 to 2000.");
  4093. if(seatid < 0 || seatid > 3) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid Seat ID!");
  4094. else if(!IsVehicleOccupied(carid, seatid)) IsPlayerEntering{playerid} = true, PutPlayerInVehicle(playerid, carid, seatid), SendClientMessageEx(playerid, COLOR_GRAD1, " You have been teleported!");
  4095. else SendClientMessageEx(playerid, COLOR_GREY, "That seat is occupied.");
  4096. }
  4097. else
  4098. {
  4099. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4100. }
  4101. return 1;
  4102. }
  4103. CMD:gotocar(playerid, params[])
  4104. {
  4105. new string[128];
  4106. if (PlayerInfo[playerid][pAdmin] >= 2)
  4107. {
  4108. new carid;
  4109. if(sscanf(params, "d", carid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /gotocar [carid]");
  4110. new Float:cwx2,Float:cwy2,Float:cwz2;
  4111. GetVehiclePos(carid, cwx2, cwy2, cwz2);
  4112. if (GetPlayerState(playerid) == 2)
  4113. {
  4114. new tmpcar = GetPlayerVehicleID(playerid);
  4115. SetVehiclePos(tmpcar, cwx2, cwy2, cwz2);
  4116. fVehSpeed[playerid] = 0.0;
  4117. }
  4118. else
  4119. {
  4120. SetPlayerPos(playerid, cwx2, cwy2, cwz2);
  4121. }
  4122. format(string, sizeof(string), " You have teleported to vehicle ID %d (%s)", carid, GetVehicleName(carid));
  4123. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  4124. SetPlayerInterior(playerid, 0);
  4125. SetPlayerVirtualWorld(playerid, GetVehicleVirtualWorld(carid));
  4126. }
  4127. else
  4128. {
  4129. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4130. }
  4131. return 1;
  4132. }
  4133. CMD:gotoid(playerid, params[])
  4134. {
  4135. new giveplayerid;
  4136. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /gotoid [player]");
  4137. new Float:plocx,Float:plocy,Float:plocz;
  4138. if (IsPlayerConnected(giveplayerid))
  4139. {
  4140. if (PlayerInfo[playerid][pAdmin] >= 2)
  4141. {
  4142. if(GetPlayerState(giveplayerid) == PLAYER_STATE_SPECTATING)
  4143. {
  4144. SendClientMessageEx(playerid, COLOR_GRAD2, "That person is spectating someone.");
  4145. return 1;
  4146. }
  4147. if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
  4148. {
  4149. SendClientMessageEx(playerid, COLOR_GRAD2, "You can not do this while spectating.");
  4150. return 1;
  4151. }
  4152. if(PlayerInfo[giveplayerid][pAdmin] >= 1337 && !GetPVarType(giveplayerid, "EATeleportable")) return SendClientMessageEx(playerid, COLOR_WHITE, "You cannot teleport to them");
  4153. GetPlayerPos(giveplayerid, plocx, plocy, plocz);
  4154. SetPlayerVirtualWorld(playerid, PlayerInfo[giveplayerid][pVW]);
  4155. Streamer_UpdateEx(playerid, plocx, plocy, plocz);
  4156. if (GetPlayerState(playerid) == 2)
  4157. {
  4158. new tmpcar = GetPlayerVehicleID(playerid);
  4159. SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
  4160. fVehSpeed[playerid] = 0.0;
  4161. }
  4162. else
  4163. {
  4164. SetPlayerPos(playerid,plocx,plocy+2, plocz);
  4165. SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  4166. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
  4167. }
  4168. SendClientMessageEx(playerid, COLOR_GRAD1, " You have been teleported!");
  4169. }
  4170. else
  4171. {
  4172. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4173. }
  4174. }
  4175. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  4176. return 1;
  4177. }
  4178. CMD:sendtoid(playerid, params[])
  4179. {
  4180. new string[128];
  4181. new giveplayerid;
  4182. new targetplayerid;
  4183. if(sscanf(params, "uu", giveplayerid, targetplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /sendtoid [player] [target player]");
  4184. new Float:plocx,Float:plocy,Float:plocz;
  4185. if(IsPlayerConnected(giveplayerid) && IsPlayerConnected(targetplayerid))
  4186. {
  4187. if (PlayerInfo[playerid][pAdmin] >= 2)
  4188. {
  4189. if(GetPlayerState(giveplayerid) == PLAYER_STATE_SPECTATING || GetPlayerState(targetplayerid) == PLAYER_STATE_SPECTATING)
  4190. {
  4191. return SendClientMessageEx(playerid, COLOR_GRAD2, "That person is spectating someone.");
  4192. }
  4193. if(giveplayerid == playerid)
  4194. {
  4195. return SendClientMessageEx(playerid, COLOR_GRAD2, "Use /gotoid to teleport instead!");
  4196. }
  4197. if(targetplayerid == playerid)
  4198. {
  4199. return SendClientMessageEx(playerid, COLOR_GRAD2, "Use /gethere to teleport instead!");
  4200. }
  4201. if(PlayerInfo[targetplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin])
  4202. {
  4203. return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this command on a Admin with the same/greater Administrative Level than you.");
  4204. }
  4205. if(GetPVarType(giveplayerid, "IsInArena"))
  4206. {
  4207. SetPVarInt(playerid, "tempPBP", giveplayerid);
  4208. format(string, sizeof(string), "%s (ID: %d) is currently in an active Paintball game.\n\nDo you want to force this player out?", GetPlayerNameEx(giveplayerid), giveplayerid);
  4209. return ShowPlayerDialogEx(playerid, PBFORCE, DIALOG_STYLE_MSGBOX, "Paintball", string, "Yes", "No");
  4210. }
  4211. if(PlayerInfo[giveplayerid][pAdmin] == 99999 && !GetPVarType(giveplayerid, "EATeleportable")) return SendClientMessageEx(playerid, COLOR_WHITE, "You cannot teleport them");
  4212. if(PlayerInfo[targetplayerid][pAdmin] == 99999 && !GetPVarType(targetplayerid, "EATeleportable")) return SendClientMessageEx(playerid, COLOR_WHITE, "You cannot teleport to them");
  4213. GetPlayerPos(targetplayerid, plocx, plocy, plocz);
  4214. SetPlayerVirtualWorld(giveplayerid, PlayerInfo[targetplayerid][pVW]);
  4215. Streamer_UpdateEx(giveplayerid, plocx, plocy, plocz);
  4216. DeletePVar(giveplayerid, "BusinessesID");
  4217. if (GetPlayerState(giveplayerid) == 2)
  4218. {
  4219. new tmpcar = GetPlayerVehicleID(giveplayerid);
  4220. SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
  4221. fVehSpeed[giveplayerid] = 0.0;
  4222. }
  4223. else
  4224. {
  4225. SetPlayerPos(giveplayerid,plocx,plocy+2, plocz);
  4226. SetPlayerInterior(giveplayerid, GetPlayerInterior(targetplayerid));
  4227. SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(targetplayerid));
  4228. }
  4229. format(string, sizeof(string), "You have been teleported to %s", GetPlayerNameEx(targetplayerid));
  4230. SendClientMessageEx(giveplayerid, COLOR_GRAD1, string);
  4231. format(string, sizeof(string), "You have teleported %s to %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(targetplayerid));
  4232. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  4233. }
  4234. else
  4235. {
  4236. return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4237. }
  4238. }
  4239. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  4240. return 1;
  4241. }
  4242. CMD:gethere(playerid, params[])
  4243. {
  4244. new giveplayerid;
  4245. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /gethere [player]");
  4246. new Float:plocx,Float:plocy,Float:plocz;
  4247. if (IsPlayerConnected(giveplayerid))
  4248. {
  4249. if (PlayerInfo[playerid][pAdmin] >= 2)
  4250. {
  4251. if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin])
  4252. {
  4253. SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
  4254. return 1;
  4255. }
  4256. if(GetPlayerState(giveplayerid) == PLAYER_STATE_SPECTATING)
  4257. {
  4258. SendClientMessageEx(playerid, COLOR_GRAD2, "That person is spectating someone.");
  4259. return 1;
  4260. }
  4261. if(GetPVarType(giveplayerid, "IsInArena"))
  4262. {
  4263. new string[128];
  4264. SetPVarInt(playerid, "tempPBP", giveplayerid);
  4265. format(string, sizeof(string), "%s (ID: %d) is currently in an active Paintball game.\n\nDo you want to force this player out?", GetPlayerNameEx(giveplayerid), giveplayerid);
  4266. ShowPlayerDialogEx(playerid, PBFORCE, DIALOG_STYLE_MSGBOX, "Paintball", string, "Yes", "No");
  4267. return 1;
  4268. }
  4269. Furniture_ResetPVars(playerid);
  4270. GetPlayerPos(playerid, plocx, plocy, plocz);
  4271. SetPlayerVirtualWorld(giveplayerid, PlayerInfo[playerid][pVW]);
  4272. Streamer_UpdateEx(giveplayerid, plocx, plocy, plocz);
  4273. DeletePVar(giveplayerid, "BusinessesID");
  4274. if (GetPlayerState(giveplayerid) == 2)
  4275. {
  4276. fVehSpeed[giveplayerid] = 0.0;
  4277. new tmpcar = GetPlayerVehicleID(giveplayerid);
  4278. SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
  4279. LinkVehicleToInterior(GetPlayerVehicleID(giveplayerid), GetPlayerInterior(playerid));
  4280. SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
  4281. SetVehicleVirtualWorld(GetPlayerVehicleID(giveplayerid), GetPlayerVirtualWorld(playerid));
  4282. SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
  4283. if(IsValidDynamicArea(iVehEnterAreaID[tmpcar])) {
  4284. // Streamer_SetIntData(STREAMER_TYPE_AREA, iVehEnterAreaID[tmpcar], E_STREAMER_WORLD_ID, tmpcar);
  4285. }
  4286. }
  4287. else
  4288. {
  4289. SetPlayerPos(giveplayerid,plocx,plocy+2, plocz);
  4290. SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
  4291. SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
  4292. }
  4293. SendClientMessageEx(giveplayerid, COLOR_GRAD1, " You have been teleported!");
  4294. }
  4295. else
  4296. {
  4297. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4298. }
  4299. }
  4300. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  4301. return 1;
  4302. }
  4303. CMD:getcar(playerid, params[])
  4304. {
  4305. if (PlayerInfo[playerid][pAdmin] >= 2)
  4306. {
  4307. new carid;
  4308. if(sscanf(params, "d", carid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /getcar [carid]");
  4309. new Float:plocx,Float:plocy,Float:plocz;
  4310. GetPlayerPos(playerid, plocx, plocy, plocz);
  4311. SetVehiclePos(carid,plocx,plocy+4, plocz);
  4312. SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid));
  4313. LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
  4314. if(IsValidDynamicArea(iVehEnterAreaID[carid])) {
  4315. // Streamer_SetIntData(STREAMER_TYPE_AREA, iVehEnterAreaID[carid], E_STREAMER_WORLD_ID, carid);
  4316. }
  4317. }
  4318. else
  4319. {
  4320. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4321. }
  4322. return 1;
  4323. }
  4324. CMD:respawncars(playerid, params[])
  4325. {
  4326. if (PlayerInfo[playerid][pAdmin] >= 3)
  4327. {
  4328. new string[128], radius;
  4329. if(sscanf(params, "d", radius)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /respawncars [radius]");
  4330. if(radius < 1 || radius > 40)
  4331. {
  4332. SendClientMessageEx(playerid, COLOR_WHITE, "Radius must be higher than 0 and lower than 41!");
  4333. return 1;
  4334. }
  4335. RespawnNearbyVehicles(playerid, radius);
  4336. format(string, sizeof(string), "You have respawned all vehicles within a radius of %d.", radius);
  4337. SendClientMessageEx(playerid, COLOR_GREY, string);
  4338. }
  4339. else
  4340. {
  4341. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4342. }
  4343. return 1;
  4344. }
  4345. CMD:respawncar(playerid, params[])
  4346. {
  4347. if (PlayerInfo[playerid][pAdmin] >= 2)
  4348. {
  4349. new string[128], carid;
  4350. if(sscanf(params, "d", carid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /respawncar [carid]");
  4351. SetVehicleToRespawn(carid);
  4352. format(string, sizeof(string), "You have respawned vehicle ID %d.", carid);
  4353. SendClientMessageEx(playerid, COLOR_GREY, string);
  4354. }
  4355. else
  4356. {
  4357. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4358. }
  4359. return 1;
  4360. }
  4361. CMD:takeadminweapons(playerid, params[])
  4362. {
  4363. if(PlayerInfo[playerid][pAdmin] >= 3)
  4364. {
  4365. new string[128], giveplayerid;
  4366. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /takeadminweapons [player]");
  4367. if(IsPlayerConnected(giveplayerid))
  4368. {
  4369. for(new s = 0; s < 12; s++)
  4370. {
  4371. if(PlayerInfo[giveplayerid][pAGuns][s] != 0)
  4372. {
  4373. RemovePlayerWeapon(giveplayerid, PlayerInfo[giveplayerid][pAGuns][s]);
  4374. }
  4375. }
  4376. format(string,sizeof(string),"You have removed %s's admin spawned weapons.", GetPlayerNameEx(giveplayerid));
  4377. SendClientMessageEx(playerid, COLOR_WHITE, string);
  4378. }
  4379. }
  4380. return 1;
  4381. }
  4382. CMD:gotoco(playerid, params[])
  4383. {
  4384. if(PlayerInfo[playerid][pAdmin] >= 3)
  4385. {
  4386. new Float: pos[3], int, vw;
  4387. if(sscanf(params, "p<,>fffD(0)D(0)", pos[0], pos[1], pos[2], int, vw)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /gotoco [x coordinate] [y coordinate] [z coordinate] [interior] [vw]");
  4388. SendClientMessageEx(playerid, COLOR_GRAD2, "You have been teleported to the coordinates specified.");
  4389. SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  4390. SetPlayerInterior(playerid, int);
  4391. SetPlayerVirtualWorld(playerid, vw);
  4392. }
  4393. return 1;
  4394. }
  4395. CMD:setweather(playerid, params[])
  4396. {
  4397. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1)
  4398. {
  4399. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4400. return 1;
  4401. }
  4402. new weather;
  4403. if(sscanf(params, "d", weather)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setweather [weatherid]");
  4404. if(weather < 0||weather > 45) { SendClientMessageEx(playerid, COLOR_GREY, " Weather ID can't be below 0 or above 45!"); return 1; }
  4405. SetWeather(weather);
  4406. gWeather = weather;
  4407. SendClientMessageEx(playerid, COLOR_GREY, "Weather set to everyone!");
  4408. return 1;
  4409. }
  4410. CMD:setmoney(playerid, params[])
  4411. {
  4412. if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  4413. {
  4414. new string[128], giveplayerid, money;
  4415. if(sscanf(params, "ud", giveplayerid, money)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setmoney [player] [money]");
  4416. if(PlayerInfo[giveplayerid][pLevel] == 1 && PlayerInfo[giveplayerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_RED, "You can't use /setmoney on level 1's");
  4417. if(IsPlayerConnected(giveplayerid))
  4418. {
  4419. ResetPlayerCash(giveplayerid);
  4420. GivePlayerCash(giveplayerid, money);
  4421. format(string, sizeof(string), "You have set %s's money to $%d !",GetPlayerNameEx(giveplayerid),money);
  4422. SendClientMessageEx(playerid, COLOR_WHITE, string);
  4423. format(string, sizeof(string), "%s has set %s's(%d) to $%d (/setmoney)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), money);
  4424. Log("logs/stats.log", string);
  4425. format(szMiscArray, sizeof(szMiscArray), "Money set to $%s", number_format(money));
  4426. DBLog(playerid, giveplayerid, "Admin", szMiscArray);
  4427. }
  4428. }
  4429. else
  4430. {
  4431. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4432. }
  4433. return 1;
  4434. }
  4435. CMD:givemoney(playerid, params[])
  4436. {
  4437. if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  4438. {
  4439. new string[128], giveplayerid, money;
  4440. if(sscanf(params, "ud", giveplayerid, money)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /givemoney [player] [money]");
  4441. if(PlayerInfo[giveplayerid][pLevel] == 1 && PlayerInfo[giveplayerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_RED, "You can't use /givemoney on level 1's");
  4442. if(money < 1) return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot give less than $1!");
  4443. if(IsPlayerConnected(giveplayerid))
  4444. {
  4445. GivePlayerCash(giveplayerid, money);
  4446. format(string, sizeof(string), "You have given %s $%s !",GetPlayerNameEx(giveplayerid), number_format(money));
  4447. SendClientMessageEx(playerid, COLOR_WHITE, string);
  4448. format(string, sizeof(string), "%s has given %s(%d) $%s (/givemoney)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), number_format(money));
  4449. Log("logs/stats.log", string);
  4450. format(szMiscArray, sizeof(szMiscArray), "Money given $%s", number_format(money));
  4451. DBLog(playerid, giveplayerid, "Admin", szMiscArray);
  4452. }
  4453. }
  4454. else
  4455. {
  4456. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4457. }
  4458. return 1;
  4459. }
  4460. CMD:slap(playerid, params[])
  4461. {
  4462. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pWatchdog] == 2)
  4463. {
  4464. new szString[128], giveplayerid, Float:posx, Float:posy, Float:posz, Float:shealth;
  4465. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "Usage: /slap [player]");
  4466. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  4467. if((PlayerInfo[giveplayerid][pAdmin] && PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin]) && giveplayerid != playerid) {
  4468. format(szString, sizeof(szString), "AdmCmd: %s has tried to slap you!", GetPlayerNameEx(playerid));
  4469. SendClientMessageEx(giveplayerid, COLOR_YELLOW, szString);
  4470. SendClientMessageEx(playerid, COLOR_GREY, "You cannot use this command on a the same/greater level admin than you!");
  4471. PlayerPlaySound(giveplayerid, 1130, posx, posy, posz);
  4472. return 1;
  4473. }
  4474. else {
  4475. GetHealth(giveplayerid, shealth);
  4476. SetHealth(giveplayerid, shealth-5);
  4477. GetPlayerPos(giveplayerid, posx, posy, posz);
  4478. SetPlayerPos(giveplayerid, posx, posy, posz+5);
  4479. PlayerPlaySound(giveplayerid, 1130, posx, posy, posz+5);
  4480. if(giveplayerid != playerid) {
  4481. format(szString, sizeof(szString), "AdmCmd: %s was slapped by %s.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
  4482. ABroadCast(COLOR_LIGHTRED, szString, 2);
  4483. }
  4484. }
  4485. }
  4486. else return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not authorized to use this command!");
  4487. return 1;
  4488. }
  4489. CMD:kills(playerid, params[])
  4490. {
  4491. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pWatchdog] >= 2)
  4492. {
  4493. new string[256], giveplayerid;
  4494. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /kills [player]");
  4495. if(IsPlayerConnected(giveplayerid))
  4496. {
  4497. SendClientMessageEx(playerid, COLOR_GREEN, "________________________________________________");
  4498. format(string, sizeof(string), "<< Last 10 Kills/Deaths of %s >>", GetPlayerNameEx(giveplayerid));
  4499. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  4500. GetLatestKills(playerid, giveplayerid);
  4501. }
  4502. else
  4503. {
  4504. SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  4505. }
  4506. }
  4507. else
  4508. {
  4509. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4510. }
  4511. return 1;
  4512. }
  4513. CMD:okills(playerid, params[])
  4514. {
  4515. if(PlayerInfo[playerid][pAdmin] >= 3)
  4516. {
  4517. if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /okills [name]");
  4518. new query[256], giveplayerid;
  4519. giveplayerid = ReturnUser(params);
  4520. if(giveplayerid != INVALID_PLAYER_ID) return SendClientMessageEx(playerid, COLOR_GRAD2, "That person is online, use /kills for online players.");
  4521. new tmpName[24];
  4522. mysql_escape_string(params, tmpName);
  4523. mysql_format(MainPipeline, query, sizeof(query), "SELECT `id` FROM `accounts` WHERE `Username` = '%s'", tmpName);
  4524. mysql_tquery(MainPipeline, query, "OnGetOKills", "is", playerid, tmpName);
  4525. }
  4526. else return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  4527. return 1;
  4528. }
  4529. CMD:mute(playerid, params[])
  4530. {
  4531. if(PlayerInfo[playerid][pAdmin] >= 1337)
  4532. {
  4533. new string[128], giveplayerid;
  4534. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /mute [player]");
  4535. if(IsPlayerConnected(giveplayerid))
  4536. {
  4537. if(giveplayerid == playerid)
  4538. {
  4539. SendClientMessageEx(playerid, COLOR_GRAD2, "You can not use this command on yourself!");
  4540. return 1;
  4541. }
  4542. if(PlayerInfo[giveplayerid][pMuted] == 0)
  4543. {
  4544. if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin])
  4545. {
  4546. format(string, sizeof(string), "%s just tried to /mute you.",GetPlayerNameEx(playerid));
  4547. SendClientMessageEx(giveplayerid, COLOR_YELLOW, string);
  4548. SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
  4549. return 1;
  4550. }
  4551. PlayerInfo[giveplayerid][pMuted] = 1;
  4552. format(string, sizeof(string), "AdmCmd: %s was silenced by %s.",GetPlayerNameEx(giveplayerid),GetPlayerNameEx(playerid));
  4553. ABroadCast(COLOR_LIGHTRED,string,2);
  4554. DBLog(playerid, giveplayerid, "Admin", "Was silenced (/mute)");
  4555. }
  4556. else
  4557. {
  4558. PlayerInfo[giveplayerid][pMuted] = 0;
  4559. format(string, sizeof(string), "AdmCmd: %s was unsilenced by %s.",GetPlayerNameEx(giveplayerid),GetPlayerNameEx(playerid));
  4560. ABroadCast(COLOR_LIGHTRED,string,2);
  4561. DBLog(playerid, giveplayerid, "Admin", "Was unsilenced (/mute)");
  4562. }
  4563. }
  4564. }
  4565. else
  4566. {
  4567. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4568. }
  4569. return 1;
  4570. }
  4571. CMD:kick(playerid, params[])
  4572. {
  4573. if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 2 || PlayerInfo[playerid][pWatchdog] >= 2)
  4574. {
  4575. new string[128], giveplayerid, reason[64];
  4576. if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /kick [player] [reason]");
  4577. if(giveplayerid != INVALID_PLAYER_ID)
  4578. {
  4579. if(playerid == giveplayerid) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't kick yourself from the server, use /q instead!");
  4580. if(PlayerInfo[playerid][pAdmin] == 1 && (PlayerInfo[giveplayerid][pHelper] >= 2 || PlayerInfo[giveplayerid][pWatchdog] >= 2)) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
  4581. if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin] && (PlayerInfo[giveplayerid][pHelper] >= 2 || PlayerInfo[giveplayerid][pAdmin] > 0) && playerid != giveplayerid && PlayerInfo[giveplayerid][pWatchdog] >= PlayerInfo[playerid][pWatchdog]) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
  4582. else
  4583. {
  4584. new playerip[32];
  4585. GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
  4586. format(string, sizeof(string), "AdmCmd: %s(%d) (IP:%s) was kicked by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), playerip, GetPlayerNameEx(playerid), reason);
  4587. Log("logs/kick.log", string);
  4588. if(PlayerInfo[playerid][pAdmin] == 1) Log("logs/moderator.log", string);
  4589. format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
  4590. SendClientMessageToAllEx(COLOR_LIGHTRED, string);
  4591. DBLog(playerid, giveplayerid, "Kick", reason);
  4592. StaffAccountCheck(giveplayerid, GetPlayerIpEx(giveplayerid));
  4593. SetTimerEx("KickEx", 1000, 0, "i", giveplayerid);
  4594. if(GetPVarType(giveplayerid, "RepFam_TL")) Rivalry_Toggle(giveplayerid, false);
  4595. }
  4596. return 1;
  4597. }
  4598. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  4599. }
  4600. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4601. return 1;
  4602. }
  4603. CMD:kickres(playerid, params[])
  4604. {
  4605. if (PlayerInfo[playerid][pAdmin] < 99999)
  4606. {
  4607. return 1;
  4608. }
  4609. new level, amount;
  4610. if(sscanf(params, "dd", level, amount)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /kickres [level] [amount]");
  4611. if(level < 0 || level > 5) { SendClientMessageEx(playerid, COLOR_GREY, " Can only Reserved Slots Kick from level 0 to 5!"); return 1; }
  4612. if(amount < 1 || amount > 10) { SendClientMessageEx(playerid, COLOR_GREY, " Can only Reserved Slots Kick of a maximum of 10 players!"); return 1; }
  4613. foreach(new i: Player)
  4614. {
  4615. if(PlayerInfo[i][pLevel] == level && PlayerInfo[i][pAdmin] < 1 && PlayerInfo[i][pDonateRank] < 1 && amount > 0)
  4616. {
  4617. DBLog(playerid, i, "Kick", "Reserve slot kicked (/kickres)");
  4618. amount -= 1;
  4619. Kick(i);
  4620. }
  4621. }
  4622. return 1;
  4623. }
  4624. CMD:warn(playerid, params[])
  4625. {
  4626. if (PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pWatchdog] >= 2)
  4627. {
  4628. new string[128], giveplayerid, reason[64];
  4629. if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /warn [player] [reason]");
  4630. if(IsPlayerConnected(giveplayerid))
  4631. {
  4632. if(PlayerInfo[giveplayerid][pAdmin] >= 2) return SendClientMessageEx(playerid, COLOR_GRAD2, "Admins cannot be warned!");
  4633. PlayerInfo[giveplayerid][pWarns] += 1;
  4634. if(PlayerInfo[giveplayerid][pWarns] >= 3)
  4635. {
  4636. PlayerInfo[giveplayerid][pWarns] = 0;
  4637. CreateBan(playerid, PlayerInfo[giveplayerid][pId], giveplayerid, PlayerInfo[giveplayerid][pIP], "3 Warnings", 14);
  4638. return 1;
  4639. }
  4640. format(string, sizeof(string), "AdmCmd: %s was warned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
  4641. ABroadCast(COLOR_LIGHTRED, string, 2);
  4642. if(PlayerInfo[playerid][pWatchdog] >= 2)
  4643. {
  4644. foreach(new i: Player) if(PlayerInfo[i][pWatchdog] >= 1 && PlayerInfo[i][pAdmin] < 2) SendClientMessageEx(i, COLOR_LIGHTRED, string);
  4645. }
  4646. format(string, sizeof(string), "AdmCmd: %s(%d) was warned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), reason);
  4647. Log("logs/admin.log", string);
  4648. format(szMiscArray, sizeof(szMiscArray), "Was warned (%s)", reason);
  4649. DBLog(playerid, giveplayerid, "Admin", szMiscArray);
  4650. StaffAccountCheck(giveplayerid, GetPlayerIpEx(giveplayerid));
  4651. format(string, sizeof(string), "You were warned by %s, reason: %s", GetPlayerNameEx(playerid), reason);
  4652. SendClientMessageEx(giveplayerid, COLOR_LIGHTRED, string);
  4653. return 1;
  4654. }
  4655. }
  4656. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  4657. return 1;
  4658. }
  4659. CMD:swarn(playerid, params[])
  4660. {
  4661. if (PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pUndercover] >= 1)
  4662. {
  4663. new string[128], giveplayerid, reason[64];
  4664. if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /swarn [player] [reason]");
  4665. if(IsPlayerConnected(giveplayerid))
  4666. {
  4667. if(PlayerInfo[giveplayerid][pAdmin] >= 2) return SendClientMessageEx(playerid, COLOR_GRAD2, "Admins cannot be warned!");
  4668. PlayerInfo[giveplayerid][pWarns] += 1;
  4669. if(PlayerInfo[giveplayerid][pWarns] >= 3)
  4670. {
  4671. PlayerInfo[giveplayerid][pWarns] = 0;
  4672. CreateBan(playerid, PlayerInfo[giveplayerid][pId], giveplayerid, PlayerInfo[giveplayerid][pIP], "3 Warnings", 14);
  4673. return 1;
  4674. }
  4675. format(string, sizeof(string), "AdmCmd: %s was silent warned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
  4676. ABroadCast(COLOR_LIGHTRED, string, 2);
  4677. format(string, sizeof(string), "AdmCmd: %s(%d) was silent warned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), reason);
  4678. Log("logs/admin.log", string);
  4679. format(szMiscArray, sizeof(szMiscArray), "Was warned (%s)", reason);
  4680. DBLog(playerid, giveplayerid, "Admin", szMiscArray);
  4681. StaffAccountCheck(giveplayerid, GetPlayerIpEx(giveplayerid));
  4682. format(string, sizeof(string), "You were warned by an Admin, reason: %s", reason);
  4683. SendClientMessageEx(giveplayerid, COLOR_LIGHTRED, string);
  4684. return 1;
  4685. }
  4686. }
  4687. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  4688. return 1;
  4689. }
  4690. CMD:owarn(playerid, params[])
  4691. {
  4692. if(PlayerInfo[playerid][pAdmin] < 3)
  4693. {
  4694. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  4695. return 1;
  4696. }
  4697. new string[128], query[512], name[MAX_PLAYER_NAME], reason[64];
  4698. if(sscanf(params, "s[24]s[64]", name, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /owarn [name] [reason]");
  4699. new giveplayerid = ReturnUser(name);
  4700. if(giveplayerid != INVALID_PLAYER_ID)
  4701. {
  4702. SendClientMessageEx(playerid, COLOR_GRAD2, "That person is online, use /warn for online players.");
  4703. return 1;
  4704. }
  4705. new tmpName[24];
  4706. mysql_escape_string(name,tmpName);
  4707. SetPVarString(playerid, "OnWarnPlayer", tmpName);
  4708. SetPVarString(playerid, "OnWarnPlayerReason", reason);
  4709. mysql_format(MainPipeline, query, sizeof(query), "UPDATE `accounts` SET `Warnings`=`Warnings`+1 WHERE `Username`='%s' AND `PermBand` < 3 AND `Band` < 1 AND `AdminLevel` < 2",tmpName);
  4710. mysql_tquery(MainPipeline, query, "OnWarnPlayer", "i", playerid);
  4711. format(string,sizeof(string),"Attempting to warn %s...", tmpName);
  4712. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  4713. return 1;
  4714. }
  4715. CMD:skick(playerid, params[])
  4716. {
  4717. if (PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pWatchdog] >= 2)
  4718. {
  4719. new string[128], giveplayerid, reason[64];
  4720. if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /skick [player] [reason]");
  4721. if(giveplayerid != INVALID_PLAYER_ID)
  4722. {
  4723. if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
  4724. {
  4725. format(string, sizeof(string), "AdmCmd: %s has been auto-kicked, reason: Trying to /skick a higher admin.", GetPlayerNameEx(playerid));
  4726. ABroadCast(COLOR_YELLOW,string,2);
  4727. SetTimerEx("KickEx", 1000, 0, "i", playerid);
  4728. return 1;
  4729. }
  4730. else
  4731. {
  4732. new playerip[32];
  4733. GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
  4734. format(string, sizeof(string), "AdmCmd: %s(%d) (IP:%s) was silent kicked by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), playerip, GetPlayerNameEx(playerid), reason);
  4735. Log("logs/kick.log", string);
  4736. format(string, sizeof(string), "AdmCmd: %s was silent kicked by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
  4737. ABroadCast(COLOR_LIGHTRED,string,2);
  4738. StaffAccountCheck(giveplayerid, GetPlayerIpEx(giveplayerid));
  4739. SetTimerEx("KickEx", 1000, 0, "i", giveplayerid);
  4740. }
  4741. return 1;
  4742. }
  4743. }
  4744. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  4745. return 1;
  4746. }
  4747. CMD:freeze(playerid, params[])
  4748. {
  4749. if (PlayerInfo[playerid][pAdmin] >= 2)
  4750. {
  4751. new string[128], giveplayerid;
  4752. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /freeze [player]");
  4753. if(IsPlayerConnected(giveplayerid))
  4754. {
  4755. if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
  4756. {
  4757. SendClientMessageEx(playerid, COLOR_GRAD2, "You can't freeze a higher admin.");
  4758. return 1;
  4759. }
  4760. TogglePlayerControllable(giveplayerid, 0);
  4761. SetPVarInt(giveplayerid, "IsFrozen", 1);
  4762. format(string, sizeof(string), "AdmCmd: %s was frozen by %s",GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
  4763. ABroadCast(COLOR_LIGHTRED,string, 2);
  4764. DBLog(playerid, giveplayerid, "Admin", "Was frozen");
  4765. }
  4766. }
  4767. else
  4768. {
  4769. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4770. }
  4771. return 1;
  4772. }
  4773. CMD:unfreeze(playerid, params[])
  4774. {
  4775. if (PlayerInfo[playerid][pAdmin] >= 2)
  4776. {
  4777. new string[128], giveplayerid;
  4778. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /unfreeze [player]");
  4779. if(IsPlayerConnected(giveplayerid))
  4780. {
  4781. DeletePVar(giveplayerid, "IsFrozen");
  4782. DeletePVar(giveplayerid, "PlayerCuffed");
  4783. PlayerCuffed[giveplayerid] = 0;
  4784. PlayerTied[giveplayerid] = 0;
  4785. TogglePlayerControllable(giveplayerid, 1);
  4786. format(string, sizeof(string), "AdmCmd: %s was unfrozen by %s.",GetPlayerNameEx(giveplayerid),GetPlayerNameEx(playerid));
  4787. ABroadCast(COLOR_LIGHTRED,string,2);
  4788. DBLog(playerid, giveplayerid, "Admin", "Was un-frozen");
  4789. }
  4790. else
  4791. {
  4792. SendClientMessageEx(playerid, COLOR_WHITE, "Invalid player specified.");
  4793. }
  4794. }
  4795. else
  4796. {
  4797. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4798. }
  4799. return 1;
  4800. }
  4801. CMD:makemoderator(playerid, params[])
  4802. {
  4803. if (PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pAP] >= 2 || PlayerInfo[playerid][pHR] >= 3)
  4804. {
  4805. new string[128], giveplayerid, level;
  4806. if(sscanf(params, "ui", giveplayerid, level)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /makemoderator [player] [level 1-2]");
  4807. if(IsPlayerConnected(giveplayerid))
  4808. {
  4809. if(PlayerInfo[giveplayerid][pAdmin] >= 2)
  4810. {
  4811. SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot do this to current admins!");
  4812. return 1;
  4813. }
  4814. if(PlayerInfo[giveplayerid][pStaffBanned] >= 1) return SendClientMessage(playerid, COLOR_WHITE, "That player is currently staff banned.");
  4815. PlayerInfo[giveplayerid][pAdmin] = 1;
  4816. if(level == 1) {
  4817. PlayerInfo[giveplayerid][pSMod] = 0;
  4818. format(string, sizeof(string), "You have been made a moderator by %s", GetPlayerNameEx(playerid));
  4819. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  4820. format(string, sizeof(string), "You have made %s a moderator.", GetPlayerNameEx(giveplayerid));
  4821. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  4822. format(string, sizeof(string), "%s(%d) has been made a moderator by %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid));
  4823. Log("logs/moderator.log", string);
  4824. }
  4825. else if(level == 2) {
  4826. PlayerInfo[giveplayerid][pSMod] = 1;
  4827. format(string, sizeof(string), "You have been made a senior moderator by %s", GetPlayerNameEx(playerid));
  4828. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  4829. format(string, sizeof(string), "You have made %s a senior moderator.", GetPlayerNameEx(giveplayerid));
  4830. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  4831. format(string, sizeof(string), "%s(%d) has been made a senior moderator by %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid));
  4832. Log("logs/moderator.log", string);
  4833. }
  4834. }
  4835. }
  4836. else
  4837. {
  4838. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4839. }
  4840. return 1;
  4841. }
  4842. CMD:removemoderator(playerid, params[])
  4843. {
  4844. if (PlayerInfo[playerid][pAdmin] >= 1337)
  4845. {
  4846. new string[128], giveplayerid;
  4847. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /removemoderator [player]");
  4848. if(IsPlayerConnected(giveplayerid))
  4849. {
  4850. if(PlayerInfo[giveplayerid][pAdmin] == 1)
  4851. {
  4852. if(GetPVarInt(playerid, "AdvisorDuty") == 1)
  4853. {
  4854. DeletePVar(playerid, "AdvisorDuty");
  4855. Advisors -= 1;
  4856. }
  4857. PlayerInfo[giveplayerid][pAdmin] = 0;
  4858. PlayerInfo[giveplayerid][pSMod] = 0;
  4859. format(string, sizeof(string), "%s has kicked you out from the moderator team.", GetPlayerNameEx(playerid));
  4860. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  4861. format(string, sizeof(string), "You took %s's moderator.", GetPlayerNameEx(giveplayerid));
  4862. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  4863. format(string, sizeof(string), "%s(%d) moderator has been removed by %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid));
  4864. Log("logs/moderator.log", string);
  4865. }
  4866. }
  4867. }
  4868. else
  4869. {
  4870. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  4871. }
  4872. return 1;
  4873. }
  4874. CMD:ahelp(playerid, params[]) {
  4875. return cmd_ah(playerid, params);
  4876. }
  4877. CMD:ah(playerid, params[]) {
  4878. if(PlayerInfo[playerid][pAdmin] >= 1) Help_ListCat(playerid, DIALOG_HELPCATADMIN);
  4879. return 1;
  4880. }
  4881. CMD:oahelp(playerid, params[]) {
  4882. return cmd_oah(playerid, params);
  4883. }
  4884. CMD:oah(playerid, params[])
  4885. {
  4886. if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1) SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
  4887. if (PlayerInfo[playerid][pAdmin] >= 1)
  4888. {
  4889. if(PlayerInfo[playerid][pSMod] > 0) SendClientMessageEx(playerid, COLOR_GRAD1, "*** {FFFF00}SENIOR SERVER MODERATOR{B4B5B7} --* /jail /kick /staff /togstaff /changename");
  4890. else SendClientMessageEx(playerid, COLOR_GRAD1, "--* {FFFF00}SERVER MODERATOR{B4B5B7} --* /mjail /kick /staff /togstaff");
  4891. }
  4892. if (PlayerInfo[playerid][pWatchdog] >= 3)
  4893. {
  4894. SendClientMessageEx(playerid, COLOR_GRAD2,"--* RP SPECIALIST --* /watchdogs /restrictaccount /unrestrictaccount /togwd /makewatchdog");
  4895. }
  4896. if (PlayerInfo[playerid][pWatchdog] >= 4)
  4897. {
  4898. SendClientMessageEx(playerid, COLOR_GRAD2,"--* Director of RP Improvement --* /watchlistadd /watchlistremove /wdwhitelist");
  4899. }
  4900. if (PlayerInfo[playerid][pAdmin] >= 2)
  4901. {
  4902. SendClientMessageEx(playerid, COLOR_GRAD2,"--* REPORTS --* /reports /ar /tr /sta /nao /st /post /dmr /ts --* MOVEMENT --* /up /dn /fd /bk /lt /rt /fly");
  4903. SendClientMessageEx(playerid, COLOR_GRAD2,"--* {00FF00}JUNIOR ADMIN{BFC0C2} --* /kick /ban /prison /freeze /unfreeze /slap /warn /admins /spec /levelones /sendtoid");
  4904. SendClientMessageEx(playerid, COLOR_GRAD2,"--* {00FF00}JUNIOR ADMIN{BFC0C2} --* /sendto /gotopveh /gotocar /jetpack /god /check /anetstats /ipcheck /ip /nrn /listguns");
  4905. SendClientMessageEx(playerid, COLOR_GRAD2,"--* {00FF00}JUNIOR ADMIN{BFC0C2} --* /setvw /setint /vehname /gethere /gotoid /hospital /goto /revive /bigears /skick /damagecheck");
  4906. SendClientMessageEx(playerid, COLOR_GRAD2,"--* {00FF00}JUNIOR ADMIN{BFC0C2} --* /requestevent /watch /dmwatchlist /mark(2) /n(un)mute /ad(un)mute /checkinv /lastshot");
  4907. SendClientMessageEx(playerid, COLOR_GRAD2,"--* {00FF00}JUNIOR ADMIN{BFC0C2} --* /respawncar /watchlist /watchdogs /flag /viewflag /aflag /aviewflag /transferflag /deleteflag");
  4908. }
  4909. if (PlayerInfo[playerid][pAdmin] >= 3)
  4910. {
  4911. SendClientMessageEx(playerid, COLOR_GRAD3,"--* {00FF00}GENERAL ADMIN{CBCCCE} --* /noooc /nonewbie /fine /pfine /takeadminweapons /prisonaccount /entercar /getcar");
  4912. SendClientMessageEx(playerid, COLOR_GRAD3,"--* {00FF00}GENERAL ADMIN{CBCCCE} --* /mole /setskin /countdown /release /forcedeath /rto(reset) /adviorce /metaldetector");
  4913. SendClientMessageEx(playerid, COLOR_GRAD3,"--* {00FF00}GENERAL ADMIN{CBCCCE} --* /gotoco /leaders /wepreset /owarn /ofine /okills /respawncars /resetvw /aviewrivals");
  4914. SendClientMessageEx(playerid, COLOR_GRAD3,"--* {00FF00}GENERAL ADMIN{CBCCCE} --* /reloadpvehicles /apark /aimpound /dmrmute /dmrlookup /dmtokens /createmetaldetector /metdets");
  4915. }
  4916. if (PlayerInfo[playerid][pAdmin] >= 4)
  4917. {
  4918. SendClientMessageEx(playerid, COLOR_GRAD4,"--* {EE9A4D}SENIOR ADMIN{D8D8D8} --* /asellbiz /fixvehall /givenos /blowup /setname /savechars /dmstrikereset /cnn /respawnvipcars");
  4919. SendClientMessageEx(playerid, COLOR_GRAD4,"--* {EE9A4D}SENIOR ADMIN{D8D8D8} --* /veh /fixveh /sethp /setarmor /givegun /givemoney /setmoney /setstat /setfightstyle /switchgroup /switchfam");
  4920. SendClientMessageEx(playerid, COLOR_GRAD4,"--* {EE9A4D}SENIOR ADMIN{D8D8D8} --* /fcreate /fdelete /adivorce /destroycar /destroycars /eventhelp /contracts /sprison /banip /unbanip");
  4921. SendClientMessageEx(playerid, COLOR_GRAD4,"--* {EE9A4D}SENIOR ADMIN{D8D8D8} --* /groupban /deletehit /setinsurance /cmotd /givelicense /adestroyplant /tl(edit/text/status/next)");
  4922. SendClientMessageEx(playerid, COLOR_GRAD4,"--* {EE9A4D}SENIOR ADMIN{D8D8D8} --* /gotolabel /createpvehicle /destroypvehicle /vto /vtoreset /admingatepw /gotogate /dedit /fedit");
  4923. SendClientMessageEx(playerid, COLOR_GRAD4,"--* {EE9A4D}SENIOR ADMIN{D8D8D8} --* /hnext /dmpnext /g(status/near/next/edit) /(goto/goin)door /(goto/goin)house /(create/delete/goto)point");
  4924. SendClientMessageEx(playerid, COLOR_GRAD4,"--* {EE9A4D}SENIOR ADMIN{D8D8D8} --* /hedit /dd(edit/next/name/pass) /dmpedit /dmpnear /gotomapicon /gangwarn /gangunban /setcapping /banaccount");
  4925. SendClientMessageEx(playerid, COLOR_GRAD4,"--* {EE9A4D}SENIOR ADMIN{D8D8D8} --* /removepvehicle /rcabuse /createmailbox /adestroymailbox /b(edit/next/name) /adestroycrate /gotocrate /srelease");
  4926. SendClientMessageEx(playerid, COLOR_GRAD4,"--* {EE9A4D}SENIOR ADMIN{D8D8D8} --* /(create/edit/delete)gaspump /(goto/goin)biz /dvcreate /dvstatus /dvrespawn /dvedit /dveditslot /dvplate /checkvouchers");
  4927. SendClientMessageEx(playerid, COLOR_GRAD4,"--* {EE9A4D}SENIOR ADMIN{D8D8D8} --* /checkvouchers /srelease /ovmute /ovunmute /restrictaccount /unrestrictaccount /wdwhitelist /resetexamine");
  4928. SendClientMessageEx(playerid, COLOR_GRAD4,"--* {EE9A4D}SENIOR ADMIN{D8D8D8} --* /makeleader /groupunban /groupcsfunban /eventreset /asellhouse /editgrouptoy /amanagerivals /gotodpoint");
  4929. }
  4930. if (PlayerInfo[playerid][pAdmin] >= 1337)
  4931. {
  4932. SendClientMessageEx(playerid, COLOR_GRAD5,"--* {FF0000}HEAD ADMIN{E3E3E3} --* /ha /setweather /pedit /giftall /removemoderator /vipgifts /buddyinvite /rewardplay /setarmorall /dynamicgift");
  4933. SendClientMessageEx(playerid, COLOR_GRAD5,"--* {FF0000}HEAD ADMIN{E3E3E3} --* /permaban /setcolor /payday /clearallreports /amotd /motd /vipmotd /givetoken /giftgvip /dvrespawnall");
  4934. SendClientMessageEx(playerid, COLOR_GRAD5,"--* {FF0000}HEAD ADMIN{E3E3E3} --* /vmute /vsuspend /togfireworks /togshopnotices /spg /snonrp /smg /skos /undercover /makewatchdog /watchlistadd");
  4935. SendClientMessageEx(playerid, COLOR_GRAD5,"--* {FF0000}HEAD ADMIN{E3E3E3} --* /gifts /rcreset /audiourl /audiostopurl /editgrouptoy /setsec /suspend /osuspend /ounsuspend");
  4936. SendClientMessageEx(playerid, COLOR_GRAD5,"--* {FF0000}HEAD ADMIN{E3E3E3} --* /osetrmutes /rmute /clearall /specreset /pausespec /random /vrandom /giftreset /searchvipm /editpoint");
  4937. }
  4938. if (PlayerInfo[playerid][pAdmin] >= 99999)
  4939. {
  4940. SendClientMessageEx(playerid, COLOR_GRAD6,"--* {298EFF}EXECUTIVE ADMIN{F0F0F0} --* /togspec /togtp /kickres /givecredits /setcredits /settotalcredits /setstpay /resetstpay /pmotd");
  4941. SendClientMessageEx(playerid, COLOR_GRAD6,"--* {298EFF}EXECUTIVE ADMIN{F0F0F0} --* /setcode /togdynamicgift /dgedit /viewgiftbox /togpasscomplexity");
  4942. }
  4943. if (PlayerInfo[playerid][pHR] >= 2)
  4944. {
  4945. SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - Human Resources --* /givesprize /setsec");
  4946. }
  4947. if(PlayerInfo[playerid][pAP] >= 2 || PlayerInfo[playerid][pHR] >= 3)
  4948. {
  4949. SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - AP/HR --* /makemoderator /makeadmin /rmute /suspend /osuspend /ounsuspend /osetrmutes");
  4950. }
  4951. if (PlayerInfo[playerid][pBanAppealer] >= 1) SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - Ban Appealer --* /unbanip /unban");
  4952. if (PlayerInfo[playerid][pUndercover] >= 1)
  4953. {
  4954. SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - Spec Ops --* /setmystat /setmyname /setmyhp /setmyarmour /sprison /sdm /swarn");
  4955. SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - Spec Ops --* /spg /snonrp /smg /skos");
  4956. }
  4957. if (PlayerInfo[playerid][pGangModerator] >= 1)
  4958. {
  4959. SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - Gang Mod --* /switchfam /fedit /feditcolor /gangwarn /gangban /gangunban /fcreate /fdelete /twmenu /dvrespawn");
  4960. SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - Gang Mod --* /gtedit /gtstatus /gtnear /tagperm /tagedit /fires /destroyfire /destroyfires /gotofire /setfstrength");
  4961. }
  4962. if (PlayerInfo[playerid][pGangModerator] >= 2) SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - DoGM --* /dvcreate /dvedit /dveditslot /dvplate");
  4963. if (PlayerInfo[playerid][pShopTech] >= 1)
  4964. {
  4965. SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - Shop Tech --* /orders /adjustoid /shop(car(del)/house/tokens/exp/plate/laser/vest/firework/viptokens/boombox/object) /gedit /gnear");
  4966. SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - Shop Tech --* /g(status/next) /hnext /goto(gate/door) /goinhouse /setvip /searchvipm /newgvip /renewgvip" );
  4967. SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - Shop Tech --* /shopbusiness /shopbusinessname /brenewal");
  4968. }
  4969. if (PlayerInfo[playerid][pShopTech] >= 2)
  4970. {
  4971. SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - Senior Shop Tech --* /shopcredits");
  4972. }
  4973. if(PlayerInfo[playerid][pBM] >= 1)
  4974. {
  4975. SendClientMessageEx(playerid, COLOR_GRAD3, "--* Special - Biz Mod --* /bedit /bname /bnext /bnear /gotobiz /goinbiz /creategaspump /editgaspump /deletegaspump /switchbiz");
  4976. if(PlayerInfo[playerid][pBM] >= 2) SendClientMessageEx(playerid, COLOR_GRAD3, "--* Special - DoBM --* /asellbiz");
  4977. }
  4978. if (PlayerInfo[playerid][pShopTech] >= 3) SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - DoCR --* /pmotd /ovmute /ovunmute /vipm /togdynamicgift /dgedit /viewgiftbox /freeweekend");
  4979. if (PlayerInfo[playerid][pFactionModerator] >= 1) SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - Faction Mod --* /switchgroup /groupcsfban /groupban /groupkick /leaders /dvrespawn"), SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - Faction Mod --* /fires /destroyfire /destroyfires /gotofire /setfstrength");
  4980. if (PlayerInfo[playerid][pFactionModerator] >= 2) SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - DoFM --* /dvcreate /dvedit /dveditslot /dvplate /editpoint");
  4981. if (PlayerInfo[playerid][pPR] >= 1) SendClientMessageEx(playerid, COLOR_GRAD5, "--* Special - Public Relations --* /catokens /cmotd /makeadvisor /takeadvisor");
  4982. if (PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] >= 1) // If they're not a senior admin and they're ASM level is 1 or higher.
  4983. {
  4984. SendClientMessageEx(playerid, COLOR_GRAD5,"--* Special - ASM --* /asellbiz /fixvehall /givenos /blowup /setname /savechars /dmstrikereset /cnn /respawnvipcars");
  4985. SendClientMessageEx(playerid, COLOR_GRAD5,"--* Special - ASM --* /veh /fixveh /sethp /setarmor /givegun /givemoney /setmoney /setstat /setfightstyle /switchgroup /switchfam");
  4986. SendClientMessageEx(playerid, COLOR_GRAD5,"--* Special - ASM --* /fcreate /fdelete /adivorce /destroycar /destroycars /eventhelp /contracts /sprison /banip /unbanip");
  4987. SendClientMessageEx(playerid, COLOR_GRAD5,"--* Special - ASM --* /groupban /deletehit /setinsurance /cmotd /givelicense /adestroyplant /tl(edit/text/status/next)");
  4988. SendClientMessageEx(playerid, COLOR_GRAD5,"--* Special - ASM --* /gotolabel /createpvehicle /destroypvehicle /vto /vtoreset /admingatepw /gotogate /dedit /fedit");
  4989. SendClientMessageEx(playerid, COLOR_GRAD5,"--* Special - ASM --* /hnext /dmpnext /g(status/near/next/edit) /(goto/goin)door /(goto/goin)house /(create/delete/goto)point");
  4990. SendClientMessageEx(playerid, COLOR_GRAD5,"--* Special - ASM --* /hedit /dd(edit/next/name/pass) /dmpedit /dmpnear /gotomapicon /gangwarn /gangunban /setcapping /banaccount");
  4991. SendClientMessageEx(playerid, COLOR_GRAD5,"--* Special - ASM --* /removepvehicle /rcabuse /createmailbox /adestroymailbox /b(edit/next/name) /adestroycrate /gotocrate /srelease");
  4992. SendClientMessageEx(playerid, COLOR_GRAD5,"--* Special - ASM --* /(create/edit/delete)gaspump /(goto/goin)biz /dvcreate /dvstatus /dvrespawn /dvedit /dveditslot /dvplate /checkvouchers");
  4993. SendClientMessageEx(playerid, COLOR_GRAD5,"--* Special - ASM --* /checkvouchers /srelease /ovmute /ovunmute /restrictaccount /unrestrictaccount /wdwhitelist /resetexamine");
  4994. }
  4995. if (PlayerInfo[playerid][pHelper] >= 1) SendClientMessageEx(playerid, COLOR_GRAD5, "--* Helper Advisor --* /advisors /ca /newbquestions /an /tn /spec");
  4996. if ( PlayerInfo[playerid][pHelper] >= 2) SendClientMessageEx(playerid, COLOR_GRAD5, "--* Community Advisor --* /caduty /showrequests /accepthelp /finishhelp /findnewb /staff /kick /mjail /rhmute /nmute");
  4997. if ( PlayerInfo[playerid][pHelper] >= 3) SendClientMessageEx(playerid, COLOR_GRAD5, "--* Senior Advisor --* /makeadvisor /takeadvisor /requestevent /newbspec");
  4998. if ( PlayerInfo[playerid][pHelper] == 4) SendClientMessageEx(playerid, COLOR_GRAD5, "--* Chief Advisor --* /advisormotd /nonewbie /newbspec");
  4999. if ( PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1) SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
  5000. return 1;
  5001. }
  5002. CMD:nrn(playerid, params[])
  5003. {
  5004. if (PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pSMod] == 1)
  5005. {
  5006. new string[128], giveplayerid;
  5007. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /nrn [player]");
  5008. if(IsPlayerConnected(giveplayerid))
  5009. {
  5010. if(PlayerInfo[giveplayerid][pAdmin] >= 2)return SendClientMessageEx(playerid, COLOR_GRAD2, "You can not use that command on admins!");
  5011. // Can't believe this isn't fixed, happened to me like 2321231321 times - Akatony
  5012. if((PlayerInfo[playerid][pSMod] == 1 || PlayerInfo[playerid][pWatchdog] >= 2) && (PlayerInfo[giveplayerid][pSMod] == 1 || PlayerInfo[giveplayerid][pWatchdog] >= 2)) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this command on this person!");
  5013. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has offered %s a free name change because their name is non-RP.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  5014. format(szMiscArray, sizeof(szMiscArray), "%s (SQL ID: %d) has offered %s (SQL ID: %d) a free name change because their name is non-RP.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  5015. Log("logs/nrnlog.log", szMiscArray);
  5016. foreach(new i: Player)
  5017. {
  5018. if(PlayerInfo[i][pSMod] == 1 || PlayerInfo[i][pWatchdog] >= 2)
  5019. {
  5020. SendClientMessageEx(i, COLOR_YELLOW, string);
  5021. }
  5022. }
  5023. ABroadCast( COLOR_YELLOW, string, 2);
  5024. ShowPlayerDialogEx(giveplayerid, 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" );
  5025. }
  5026. }
  5027. else
  5028. {
  5029. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  5030. }
  5031. return 1;
  5032. }
  5033. CMD:reloadlist(playerid, params[])
  5034. {
  5035. if(PlayerInfo[playerid][pAdmin] >= 1337)
  5036. {
  5037. ToyList2 = LoadModelSelectionMenu("ToyList.txt");
  5038. CarList2 = LoadModelSelectionMenu("CarList.txt");
  5039. PlaneList = LoadModelSelectionMenu("PlaneList.txt");
  5040. BoatList = LoadModelSelectionMenu("BoatList.txt");
  5041. SendClientMessageEx(playerid, COLOR_CYAN, "Lists have been reloaded.");
  5042. }
  5043. return 1;
  5044. }
  5045. CMD:mods(playerid, params[])
  5046. {
  5047. if(PlayerInfo[playerid][pAdmin] >= 2)
  5048. {
  5049. new string[3024]; // This is what happens when there is 100 moderators online
  5050. foreach(new i : Player)
  5051. {
  5052. if(PlayerInfo[i][pAdmin] == 1)
  5053. {
  5054. format(string, sizeof(string), "%s\nModerator %s (ID %i)", string, GetPlayerNameEx(i), i);
  5055. }
  5056. }
  5057. ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_LIST, "Current Online Moderators", string, "Close", "");
  5058. }
  5059. else
  5060. return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not authorized to use this command!");
  5061. return 1;
  5062. }
  5063. CMD:givesprize(playerid, params[])
  5064. {
  5065. if(PlayerInfo[playerid][pAdmin] < 1338 && PlayerInfo[playerid][pHR] < 2) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
  5066. new PName[MAX_PLAYER_NAME], choice[16], amount;
  5067. if(sscanf(params, "s[24]s[16]d", PName, choice, amount))
  5068. {
  5069. SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /givesprize [playerid/PlayerName] [Choice] [Amount]");
  5070. SendClientMessageEx(playerid, COLOR_GREY, "Choice: CarSlot | ToySlot | CarVoucher | GiftVoucher");
  5071. SendClientMessageEx(playerid, COLOR_GREY, "Note: This command works offline and online.");
  5072. return 1;
  5073. }
  5074. if(amount < 1) return SendClientMessage(playerid, COLOR_GREY, "Amount cannot go below 1");
  5075. new string[128];
  5076. new pID = ReturnUser(PName);
  5077. if(IsPlayerConnected(pID))
  5078. {
  5079. if(strcmp(choice, "carslot", true) == 0)
  5080. {
  5081. PlayerInfo[pID][pVehicleSlot] += amount;
  5082. LoadPlayerDisabledVehicles(pID);
  5083. format(string, sizeof(string), "AdmCmd: %s has given %s %d free car slot(s).", GetPlayerNameEx(playerid), GetPlayerNameEx(pID), amount);
  5084. ABroadCast(COLOR_LIGHTRED, string, 2);
  5085. format(string, sizeof(string), "You received %d free car slot(s) from %s.",amount, GetPlayerNameEx(playerid));
  5086. SendClientMessageEx(pID, COLOR_LIGHTBLUE, string);
  5087. format(string, sizeof(string), "You have given %s %d car slot(s).", GetPlayerNameEx(pID), amount);
  5088. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  5089. format(string, sizeof(string), "[Admin] %s(%d)(IP:%s) has given %s(%d)(IP:%s) %d free car slot(s).", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), GetPlayerNameEx(pID), GetPlayerSQLId(pID), GetPlayerIpEx(pID), amount);
  5090. Log("logs/adminrewards.log", string);
  5091. }
  5092. else if(strcmp(choice, "toyslot", true) == 0)
  5093. {
  5094. PlayerInfo[pID][pToySlot] += amount;
  5095. format(string, sizeof(string), "AdmCmd: %s has given %s %d free toy slot(s).", GetPlayerNameEx(playerid), GetPlayerNameEx(pID), amount);
  5096. ABroadCast(COLOR_LIGHTRED, string, 2);
  5097. format(string, sizeof(string), "You received %d free toy slot(s) from %s.",amount, GetPlayerNameEx(playerid));
  5098. SendClientMessageEx(pID, COLOR_LIGHTBLUE, string);
  5099. format(string, sizeof(string), "You have given %s %d toy slot(s).", GetPlayerNameEx(pID), amount);
  5100. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  5101. format(string, sizeof(string), "[Admin] %s(%d)(IP:%s) has given %s(%d)(IP:%s) %d free toy slot(s).", GetPlayerNameEx(playerid), GetPlayerIpEx(playerid), GetPlayerSQLId(playerid), GetPlayerNameEx(pID), GetPlayerSQLId(pID), GetPlayerIpEx(pID), amount);
  5102. Log("logs/adminrewards.log", string);
  5103. }
  5104. else if(strcmp(choice, "carvoucher", true) == 0)
  5105. {
  5106. PlayerInfo[pID][pVehVoucher] += amount;
  5107. format(string, sizeof(string), "AdmCmd: %s has given %s %d free car voucher(s).", GetPlayerNameEx(playerid), GetPlayerNameEx(pID), amount);
  5108. ABroadCast(COLOR_LIGHTRED, string, 2);
  5109. format(string, sizeof(string), "You received %d free car voucher(s) from %s.",amount, GetPlayerNameEx(playerid));
  5110. SendClientMessageEx(pID, COLOR_LIGHTBLUE, string);
  5111. format(string, sizeof(string), "You have given %s %d car voucher(s).", GetPlayerNameEx(pID), amount);
  5112. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  5113. format(string, sizeof(string), "[Admin] %s(%d)(IP:%s) has given %s(%d)(IP:%s) %d free car voucher(s).", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), GetPlayerNameEx(pID), GetPlayerSQLId(pID), GetPlayerIpEx(pID), amount);
  5114. Log("logs/adminrewards.log", string);
  5115. }
  5116. else if(strcmp(choice, "giftvoucher", true) == 0)
  5117. {
  5118. PlayerInfo[pID][pGiftVoucher] += amount;
  5119. format(string, sizeof(string), "AdmCmd: %s has given %s %d free gift reset voucher(s).", GetPlayerNameEx(playerid), GetPlayerNameEx(pID), amount);
  5120. ABroadCast(COLOR_LIGHTRED, string, 2);
  5121. format(string, sizeof(string), "You received %d free gift reset voucher(s) from %s.",amount, GetPlayerNameEx(playerid));
  5122. SendClientMessageEx(pID, COLOR_LIGHTBLUE, string);
  5123. format(string, sizeof(string), "You have given %s %d gift reset voucher(s).", GetPlayerNameEx(pID), amount);
  5124. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  5125. format(string, sizeof(string), "[Admin] %s(%d)(IP:%s) has given %s(%d)(IP:%s) %d free gift reset voucher(s).", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), GetPlayerNameEx(pID), GetPlayerSQLId(pID), GetPlayerIpEx(pID), amount);
  5126. Log("logs/adminrewards.log", string);
  5127. }
  5128. else
  5129. {
  5130. SendClientMessageEx(playerid, COLOR_GREY, "Invalid choice.");
  5131. }
  5132. }
  5133. else
  5134. {
  5135. new tmpName[24];
  5136. if(strcmp(choice, "carslot", true) == 0)
  5137. {
  5138. mysql_escape_string(PName, tmpName);
  5139. mysql_format(MainPipeline, string, sizeof(string), "UPDATE `accounts` SET `VehicleSlot` = `VehicleSlot`+%d WHERE `Username`='%s'",amount, tmpName);
  5140. mysql_tquery(MainPipeline, string, "OnStaffPrize", "i", playerid);
  5141. format(string, sizeof(string), "Attempting to give %s %d car slot(s)..", tmpName, amount);
  5142. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  5143. SetPVarString(playerid, "OnSPrizeType", "Car Slot(s)");
  5144. SetPVarString(playerid, "OnSPrizeName", tmpName);
  5145. SetPVarInt(playerid, "OnSPrizeAmount", amount);
  5146. }
  5147. else if(strcmp(choice, "toyslot", true) == 0)
  5148. {
  5149. mysql_escape_string(PName, tmpName);
  5150. mysql_format(MainPipeline, string, sizeof(string), "UPDATE `accounts` SET `ToySlot` = `ToySlot`+%d WHERE `Username`='%s'",amount, tmpName);
  5151. mysql_tquery(MainPipeline, string, "OnStaffPrize", "i", playerid);
  5152. format(string, sizeof(string), "Attempting to give %s %d toy slot(s)..", tmpName, amount);
  5153. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  5154. SetPVarString(playerid, "OnSPrizeType", "Toy Slot(s)");
  5155. SetPVarString(playerid, "OnSPrizeName", tmpName);
  5156. SetPVarInt(playerid, "OnSPrizeAmount", amount);
  5157. }
  5158. else if(strcmp(choice, "carvoucher", true) == 0)
  5159. {
  5160. mysql_escape_string(PName, tmpName);
  5161. mysql_format(MainPipeline, string, sizeof(string), "UPDATE `accounts` SET `VehVoucher` = `VehVoucher`+%d WHERE `Username`='%s'",amount, tmpName);
  5162. mysql_tquery(MainPipeline, string, "OnStaffPrize", "i", playerid);
  5163. format(string, sizeof(string), "Attempting to give %s %d car voucher(s)..", tmpName, amount);
  5164. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  5165. SetPVarString(playerid, "OnSPrizeType", "Car Voucher(s)");
  5166. SetPVarString(playerid, "OnSPrizeName", tmpName);
  5167. SetPVarInt(playerid, "OnSPrizeAmount", amount);
  5168. }
  5169. else if(strcmp(choice, "giftvoucher", true) == 0)
  5170. {
  5171. mysql_escape_string(PName, tmpName);
  5172. mysql_format(MainPipeline, string, sizeof(string), "UPDATE `accounts` SET `GiftVoucher` = `GiftVoucher`+%d WHERE `Username`='%s'",amount, tmpName);
  5173. mysql_tquery(MainPipeline, string, "OnStaffPrize", "i", playerid);
  5174. format(string, sizeof(string), "Attempting to give %s %d gift reset voucher(s)..", tmpName, amount);
  5175. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  5176. SetPVarString(playerid, "OnSPrizeType", "Gift Reset Voucher(s)");
  5177. SetPVarString(playerid, "OnSPrizeName", tmpName);
  5178. SetPVarInt(playerid, "OnSPrizeAmount", amount);
  5179. }
  5180. else
  5181. {
  5182. SendClientMessageEx(playerid, COLOR_GREY, "Invalid choice.");
  5183. }
  5184. }
  5185. return 1;
  5186. }
  5187. CMD:srelease(playerid, params[])
  5188. {
  5189. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  5190. {
  5191. new string[128], giveplayerid, reason[64];
  5192. if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /srelease [player] [reason]");
  5193. if(IsPlayerConnected(giveplayerid))
  5194. {
  5195. if(PlayerInfo[giveplayerid][pJailTime] == 0)
  5196. {
  5197. SendClientMessageEx(playerid, COLOR_GRAD1, "This player is not currently in prison!");
  5198. }
  5199. else
  5200. {
  5201. format(string, sizeof(string), "AdmCmd: %s(%d) has been silent released from prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), reason);
  5202. Log("logs/admin.log", string);
  5203. format(string, sizeof(string), "AdmCmd: %s has been silent released from prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
  5204. ABroadCast(COLOR_LIGHTRED, string, 2);
  5205. PhoneOnline[giveplayerid] = 0;
  5206. PlayerInfo[giveplayerid][pWantedLevel] = 0;
  5207. PlayerInfo[giveplayerid][pBeingSentenced] = 0;
  5208. SetPlayerToTeamColor(giveplayerid);
  5209. SetHealth(giveplayerid, 100);
  5210. SetPlayerWantedLevel(giveplayerid, 0);
  5211. PlayerInfo[giveplayerid][pJailTime] = 0;
  5212. SetPlayerPos(giveplayerid, 1529.6,-1691.2,13.3);
  5213. SetPlayerInterior(giveplayerid,0);
  5214. PlayerInfo[giveplayerid][pInt] = 0;
  5215. SetPlayerVirtualWorld(giveplayerid, 0);
  5216. PlayerInfo[giveplayerid][pVW] = 0;
  5217. strcpy(PlayerInfo[giveplayerid][pPrisonReason], "None", 128);
  5218. SetPlayerToTeamColor(giveplayerid);
  5219. }
  5220. }
  5221. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  5222. }
  5223. else
  5224. {
  5225. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  5226. }
  5227. return 1;
  5228. }
  5229. CMD:undercover(playerid, params[])
  5230. {
  5231. if(PlayerInfo[playerid][pAdmin] >= 1337)
  5232. {
  5233. if(!GetPVarType(playerid, "Undercover"))
  5234. {
  5235. SetPVarInt(playerid, "Undercover", 1);
  5236. SendClientMessageEx(playerid, COLOR_WHITE, "** You have went into undercover mode, your admin rank will no longer show up in /v or /fc.");
  5237. }
  5238. else
  5239. {
  5240. DeletePVar(playerid, "Undercover");
  5241. SendClientMessageEx(playerid, COLOR_WHITE, "** You have went out of undercover mode, your admin rank will now show up in /v or /fc.");
  5242. }
  5243. }
  5244. else return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not authorized to use this command!");
  5245. return true;
  5246. }
  5247. CMD:qs(playerid, params[]) return cmd_quickstats(playerid, params);
  5248. CMD:quickstats(playerid, params[])
  5249. {
  5250. new string[128], Float: health, Float: armor;
  5251. GetHealth(playerid, health);
  5252. GetArmour(playerid, armor);
  5253. format(string, sizeof(string), "---===== ** Stats of %s ** =====---", GetPlayerNameEx(playerid));
  5254. SendClientMessageEx(playerid, COLOR_GREEN, string);
  5255. format(string, sizeof(string), "** Level: %d | Bank: %s | Cash: %s | Radio Frequency: %dkhz | Warning: %d", PlayerInfo[playerid][pLevel],
  5256. number_format(PlayerInfo[playerid][pAccount]), number_format(PlayerInfo[playerid][pCash]), PlayerInfo[playerid][pRadioFreq], PlayerInfo[playerid][pWarns]);
  5257. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  5258. format(string, sizeof(string), "** Health: %d | Armour: %d", floatround(health), floatround(armor));
  5259. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  5260. SendClientMessageEx(playerid, COLOR_GREEN, "--------------------------------------------------------------------------------------------------------------------");
  5261. return 1;
  5262. }
  5263. CMD:fps(playerid, params[])
  5264. {
  5265. if(!Bit_State(arrPlayerBits[playerid], bitFPS))
  5266. {
  5267. ShowFPSCounter(playerid);
  5268. Bit_On(arrPlayerBits[playerid], bitFPS);
  5269. SendClientMessageEx(playerid, COLOR_WHITE, "You have toggled on your FPS Counter.");
  5270. }
  5271. else
  5272. {
  5273. HideFPSCounter(playerid);
  5274. Bit_Off(arrPlayerBits[playerid], bitFPS);
  5275. SendClientMessageEx(playerid, COLOR_WHITE, "You have toggled off your FPS Counter.");
  5276. }
  5277. return true;
  5278. }
  5279. CMD:akick(playerid, params[])
  5280. {
  5281. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1) return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not authorized to use this command!");
  5282. new giveplayerid, reason[64];
  5283. if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /akick [player] [reason]");
  5284. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  5285. new string[128];
  5286. if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
  5287. {
  5288. format(string, sizeof(string), "AdmCmd: %s has been auto-kicked, reason: Trying to /akick a higher admin.", GetPlayerNameEx(playerid));
  5289. ABroadCast(COLOR_YELLOW,string,2);
  5290. SetTimerEx("KickEx", 1000, 0, "i", playerid);
  5291. return 1;
  5292. }
  5293. format(string, sizeof(string), "AdmCmd: %s(%d) (IP:%s) was admin kicked by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerIpEx(giveplayerid), GetPlayerNameEx(playerid), reason);
  5294. Log("logs/kick.log", string);
  5295. format(string, sizeof(string), "AdmCmd: %s was admin kicked by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
  5296. ABroadCast(COLOR_LIGHTRED, string, 2);
  5297. StaffAccountCheck(giveplayerid, GetPlayerIpEx(giveplayerid));
  5298. format(string, sizeof(string), "AdmCmd: %s was admin kicked by a Admin, reason: %s", GetPlayerNameEx(giveplayerid), reason);
  5299. SendClientMessageEx(giveplayerid, COLOR_LIGHTRED, string);
  5300. SetTimerEx("KickEx", 1000, 0, "i", giveplayerid);
  5301. return 1;
  5302. }
  5303. CMD:togpasscomplexity(playerid, params[])
  5304. {
  5305. if(PlayerInfo[playerid][pAdmin] < 99999) return 1;
  5306. new string[128];
  5307. if(PassComplexCheck)
  5308. {
  5309. PassComplexCheck = 0;
  5310. format(string, sizeof(string), "AdmCmd: %s has disabled password complexity checks.", GetPlayerNameEx(playerid));
  5311. ABroadCast(COLOR_LIGHTRED, string, 2);
  5312. SendClientMessageEx(playerid, COLOR_GRAD2, "You have disabled password complexity checks.");
  5313. }
  5314. else
  5315. {
  5316. PassComplexCheck = 1;
  5317. format(string, sizeof(string), "AdmCmd: %s has enabled password complexity checks.", GetPlayerNameEx(playerid));
  5318. ABroadCast(COLOR_LIGHTRED, string, 2);
  5319. SendClientMessageEx(playerid, COLOR_GRAD2, "You have enabled password complexity checks.");
  5320. }
  5321. Misc_Save();
  5322. return 1;
  5323. }
  5324. CMD:coordinators(playerid, params[])
  5325. {
  5326. if(PlayerInfo[playerid][pSEC] < 1 && PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not authorized to use this command!");
  5327. new string[128];
  5328. SendClientMessageEx(playerid, COLOR_GRAD1, "Coordinators Online:");
  5329. foreach(new i : Player)
  5330. {
  5331. if(PlayerInfo[i][pSEC] > 0)
  5332. {
  5333. if(PlayerInfo[i][pSEC] == 1) format(string, sizeof(string), "Regular Coordinator %s (ID %i)", GetPlayerNameEx(i), i);
  5334. else if(PlayerInfo[i][pSEC] == 2) format(string, sizeof(string), "Senior Coordinator %s (ID %i)", GetPlayerNameEx(i), i);
  5335. else if(PlayerInfo[i][pSEC] == 3) format(string, sizeof(string), "Assistant Chairman %s (ID %i)", GetPlayerNameEx(i), i);
  5336. else if(PlayerInfo[i][pSEC] == 4) format(string, sizeof(string), "Deputy Chairman %s (ID %i)", GetPlayerNameEx(i), i);
  5337. else if(PlayerInfo[i][pSEC] == 5) format(string, sizeof(string), "Chairman %s (ID %i)", GetPlayerNameEx(i), i);
  5338. else format(string, sizeof(string), "Undefined Rank %s (ID %i)", GetPlayerNameEx(i), i);
  5339. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  5340. }
  5341. }
  5342. return 1;
  5343. }
  5344. CMD:makesec(playerid, params[])
  5345. {
  5346. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pPR] < 1 && PlayerInfo[playerid][pSEC] < 3 && PlayerInfo[playerid][pASM] < 1) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  5347. new ivalue, iTargetID;
  5348. if(sscanf(params, "ui", iTargetID, ivalue)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /makesec [player] [level]");
  5349. if(!IsPlayerConnected(iTargetID)) return SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
  5350. if(PlayerInfo[iTargetID][pSEC] == ivalue) return SendClientMessageEx(playerid, COLOR_GREY, "This person already has this SEC coordinator level.");
  5351. new szRank[128];
  5352. switch(ivalue) {
  5353. case 0: format(szRank, sizeof(szRank), "AdmCmd: %s(%d) has removed %s's(%d) coordinator rank.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerNameEx(iTargetID), GetPlayerSQLId(iTargetID));
  5354. case 1: format(szRank, sizeof(szRank), "AdmCmd: %s(%d) has made %s(%d) a Regular Coordinator.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerNameEx(iTargetID), GetPlayerSQLId(iTargetID));
  5355. case 2: format(szRank, sizeof(szRank), "AdmCmd: %s(%d) has made %s(%d) a Senior Coordinator.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerNameEx(iTargetID), GetPlayerSQLId(iTargetID));
  5356. case 3: format(szRank, sizeof(szRank), "AdmCmd: %s(%d) has made %s(%d) a Assistant Chairman.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerNameEx(iTargetID), GetPlayerSQLId(iTargetID));
  5357. case 4: format(szRank, sizeof(szRank), "AdmCmd: %s(%d) has made %s(%d) a Deputy Chairman.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerNameEx(iTargetID), GetPlayerSQLId(iTargetID));
  5358. case 5: format(szRank, sizeof(szRank), "AdmCmd: %s(%d) has made %s(%d) the Chairman.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerNameEx(iTargetID), GetPlayerSQLId(iTargetID));
  5359. default: format(szRank, sizeof(szRank), "AdmCmd: %s(%d) has made %s(%d) an undefined level(%d) SEC coordinator.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerNameEx(iTargetID), GetPlayerSQLId(iTargetID), ivalue);
  5360. }
  5361. PlayerInfo[iTargetID][pSEC] = ivalue;
  5362. Log("logs/makesec.log", szRank);
  5363. switch(ivalue) {
  5364. case 0: format(szRank, sizeof(szRank), "Your coordinator rank has been removed by %s.", GetPlayerNameEx(playerid));
  5365. case 1: format(szRank, sizeof(szRank), "You have been made a Regular Coordinator by %s.", GetPlayerNameEx(playerid));
  5366. case 2: format(szRank, sizeof(szRank), "You have been made a Senior Coordinator by %s.", GetPlayerNameEx(playerid));
  5367. case 3: format(szRank, sizeof(szRank), "You have been made a Assistant Chairman by %s.", GetPlayerNameEx(playerid));
  5368. case 4: format(szRank, sizeof(szRank), "You have been made a Deputy Chairman by %s.", GetPlayerNameEx(playerid));
  5369. case 5: format(szRank, sizeof(szRank), "You have been made the Chairman by %s.", GetPlayerNameEx(playerid));
  5370. default: format(szRank, sizeof(szRank), "You have been made an undefined level SEC coordinator by %s.", GetPlayerNameEx(playerid));
  5371. }
  5372. SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szRank);
  5373. switch(ivalue) {
  5374. case 0: format(szRank, sizeof(szRank), "You have removed %s's coordinator rank.", GetPlayerNameEx(iTargetID));
  5375. case 1: format(szRank, sizeof(szRank), "You have made %s a Regular Coordinator.", GetPlayerNameEx(iTargetID));
  5376. case 2: format(szRank, sizeof(szRank), "You have made %s a Senior Coordinator.", GetPlayerNameEx(iTargetID));
  5377. case 3: format(szRank, sizeof(szRank), "You have made %s a Assistant Chairman.", GetPlayerNameEx(iTargetID));
  5378. case 4: format(szRank, sizeof(szRank), "You have made %s a Deputy Chairman.", GetPlayerNameEx(iTargetID));
  5379. case 5: format(szRank, sizeof(szRank), "You have made %s the Chairman.", GetPlayerNameEx(iTargetID));
  5380. default: format(szRank, sizeof(szRank), "You have made %s an undefined level coordinator.", GetPlayerNameEx(iTargetID));
  5381. }
  5382. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szRank);
  5383. return 1;
  5384. }
  5385. CMD:sechelp(playerid, params[])
  5386. {
  5387. if(PlayerInfo[playerid][pSEC] >= 1)
  5388. {
  5389. SendClientMessageEx(playerid, COLOR_GRAD2, "--* SEC --* /eventstaff /sec /togsec /coordinators");
  5390. if(PlayerInfo[playerid][pSEC] >= 2) SendClientMessageEx(playerid, COLOR_GRAD2, "--* SEC --* /requestevent /eventhelp");
  5391. if(PlayerInfo[playerid][pSEC] >= 3) SendClientMessageEx(playerid, COLOR_GRAD2, "--* SEC --* /makesec");
  5392. }
  5393. return 1;
  5394. }
  5395. CMD:togsec(playerid, params[])
  5396. {
  5397. if(PlayerInfo[playerid][pSEC] < 1 && PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not authorized to use this command!");
  5398. if(GetPVarInt(playerid, "SECChat") == 1)
  5399. {
  5400. SendClientMessageEx(playerid, COLOR_GRAD1, "** You have disabled SEC chat.");
  5401. return SetPVarInt(playerid, "SECChat", 0);
  5402. }
  5403. else
  5404. {
  5405. SendClientMessageEx(playerid, COLOR_GRAD1, "** You have enabled SEC chat.");
  5406. return SetPVarInt(playerid, "SECChat", 1);
  5407. }
  5408. }
  5409. CMD:sec(playerid, params[])
  5410. {
  5411. if(PlayerInfo[playerid][pJailTime] && strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1) return SendClientMessageEx(playerid, COLOR_GREY, "OOC prisoners are restricted to only speak in /b");
  5412. if(PlayerInfo[playerid][pSEC] < 1 && PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not authorized to use this command!");
  5413. if(GetPVarInt(playerid, "SECChat") == 0) return SendClientMessageEx(playerid, COLOR_GREY, "You have SEC chat disabled - /togsec to enable it.");
  5414. if(isnull(params)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /sec [text]");
  5415. new szMessage[128];
  5416. if(PlayerInfo[playerid][pSEC] == 1) format(szMessage, sizeof(szMessage), "* Regular Coordinator %s: %s", GetPlayerNameEx(playerid), params);
  5417. else if(PlayerInfo[playerid][pSEC] == 2) format(szMessage, sizeof(szMessage), "* Senior Coordinator %s: %s", GetPlayerNameEx(playerid), params);
  5418. else if(PlayerInfo[playerid][pSEC] == 3) format(szMessage, sizeof(szMessage), "* Assistant Chairman %s: %s", GetPlayerNameEx(playerid), params);
  5419. else if(PlayerInfo[playerid][pSEC] == 4) format(szMessage, sizeof(szMessage), "* Deputy Chairman %s: %s", GetPlayerNameEx(playerid), params);
  5420. else if(PlayerInfo[playerid][pSEC] >= 5) format(szMessage, sizeof(szMessage), "* Chairman %s: %s", GetPlayerNameEx(playerid), params);
  5421. else if(PlayerInfo[playerid][pAdmin] >= 2) format(szMessage, sizeof(szMessage), "* %s %s: %s", GetAdminRankName(PlayerInfo[playerid][pAdmin]), GetPlayerNameEx(playerid), params);
  5422. else format(szMessage, sizeof(szMessage), "* Undefined Rank %s: %s", GetPlayerNameEx(playerid), params);
  5423. foreach(new i : Player)
  5424. {
  5425. if((PlayerInfo[i][pSEC] >= 1 || PlayerInfo[i][pAdmin] >= 2) && GetPVarInt(i, "SECChat") == 1)
  5426. {
  5427. SendClientMessageEx(i, 0x00FA9AFF, szMessage);
  5428. }
  5429. }
  5430. return 1;
  5431. }
  5432. CMD:specreset(playerid, params[])
  5433. {
  5434. if(PlayerInfo[playerid][pAdmin] >= 1337)
  5435. {
  5436. SendClientMessageEx(playerid, COLOR_GRAD2, "Resetting the special timer must be done through FTP, delete all the files in /stokens/ folder");
  5437. }
  5438. return 1;
  5439. }
  5440. CMD:pausespec(playerid, params[])
  5441. {
  5442. if(PlayerInfo[playerid][pAdmin] >= 1337)
  5443. {
  5444. if(SpecTimer == 1)
  5445. {
  5446. SpecTimer = 0;
  5447. new sString[41 + MAX_PLAYER_NAME];
  5448. format( sString, sizeof( sString ), "AdmCmd: %s has paused the special timer.", GetPlayerNameEx(playerid));
  5449. ABroadCast( COLOR_LIGHTRED, sString, 1338 );
  5450. }
  5451. else
  5452. {
  5453. SpecTimer = 1;
  5454. new sString[41 + MAX_PLAYER_NAME];
  5455. format( sString, sizeof( sString ), "AdmCmd: %s has enabled the special timer.", GetPlayerNameEx(playerid));
  5456. ABroadCast( COLOR_LIGHTRED, sString, 1338);
  5457. }
  5458. }
  5459. return 1;
  5460. }
  5461. CMD:checkwdcount(playerid, params[])
  5462. {
  5463. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1 || PlayerInfo[playerid][pWatchdog] >= 3)
  5464. {
  5465. new string[128], adminname[MAX_PLAYER_NAME], tdate[11];
  5466. if(sscanf(params, "s[24]s[11]", adminname, tdate)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /checkwdcount [watchdog name] [date (YYYY-MM-DD)]");
  5467. new giveplayerid = ReturnUser(adminname);
  5468. if(IsPlayerConnected(giveplayerid) && PlayerInfo[giveplayerid][pWatchdog] >= 1)
  5469. {
  5470. mysql_format(MainPipeline, string, sizeof(string), "SELECT SUM(count) FROM `tokens_wd` WHERE `playerid` = %d AND `date` = '%s'", GetPlayerSQLId(giveplayerid), tdate);
  5471. mysql_tquery(MainPipeline, string, "QueryCheckCountFinish", "issi", playerid, GetPlayerNameEx(giveplayerid), tdate, 4);
  5472. mysql_format(MainPipeline, string, sizeof(string), "SELECT `count`, `hour` FROM `tokens_wd` WHERE `playerid` = %d AND `date` = '%s' ORDER BY `hour` ASC", GetPlayerSQLId(giveplayerid), tdate);
  5473. mysql_tquery(MainPipeline, string, "QueryCheckCountFinish", "issi", playerid, GetPlayerNameEx(giveplayerid), tdate, 5);
  5474. }
  5475. else
  5476. {
  5477. new tmpName[MAX_PLAYER_NAME];
  5478. mysql_escape_string(adminname, tmpName);
  5479. mysql_format(MainPipeline, string, sizeof(string), "SELECT `id`, `Username` FROM `accounts` WHERE `Username` = '%s'", tmpName);
  5480. mysql_tquery(MainPipeline, string, "QueryUsernameCheck", "isi", playerid, tdate, 2);
  5481. }
  5482. }
  5483. return 1;
  5484. }
  5485. /*CMD:edit(playerid, params[])
  5486. {
  5487. if(PlayerInfo[playerid][pAdmin] < 4)
  5488. {
  5489. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command.");
  5490. return 1;
  5491. }
  5492. new string[128], choice[32], amount;
  5493. if(sscanf(params, "s[32]d", choice, amount))
  5494. {
  5495. SendClientMessageEx(playerid, COLOR_WHITE, "|__________________ Edit __________________|");
  5496. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /edit [name] [amount]");
  5497. SendClientMessageEx(playerid, COLOR_GREY, "Available names: Level, Price");
  5498. SendClientMessageEx(playerid, COLOR_WHITE, "|____________________________________________|");
  5499. return 1;
  5500. }
  5501. for(new i = 0; i < sizeof(HouseInfo); i++)
  5502. {
  5503. if (IsPlayerInRangeOfPoint(playerid,3,HouseInfo[i][hExteriorX], HouseInfo[i][hExteriorY], HouseInfo[i][hExteriorZ]) && GetPlayerInterior(playerid) == HouseInfo[i][hExtIW] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hExtVW])
  5504. {
  5505. format(string, sizeof(string), "House: %d", i);
  5506. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  5507. if(amount > 0)
  5508. {
  5509. if(strcmp(choice,"level",true) == 0)
  5510. {
  5511. HouseInfo[i][hLevel] = amount;
  5512. }
  5513. else if(strcmp(choice,"price",true) == 0)
  5514. {
  5515. HouseInfo[i][hValue] = amount;
  5516. }
  5517. }
  5518. ReloadHouseText(i);
  5519. }
  5520. }
  5521. return 1;
  5522. }*/
  5523. CMD:aimpound(playerid, params[]) {
  5524. if(PlayerInfo[playerid][pAdmin] >= 3) {
  5525. new iVehTowed, szMessage[128], veh = -1;
  5526. if(sscanf(params, "d", iVehTowed)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /aimpound [carid]");
  5527. if(!GetVehicleModel(iVehTowed)) return SendClientMessageEx(playerid, COLOR_GREY, "The vehicle your trying to impound has been desynced and therefore cannot be impounded.");
  5528. foreach(new i: Player) {
  5529. if((veh = GetPlayerVehicle(i, iVehTowed)) != -1) {
  5530. --PlayerCars;
  5531. VehicleSpawned[i]--;
  5532. PlayerVehicleInfo[i][veh][pvImpounded] = 1;
  5533. PlayerVehicleInfo[i][veh][pvSpawned] = 0;
  5534. PlayerVehicleInfo[i][veh][pvFuel] = VehicleFuel[iVehTowed];
  5535. GetVehicleHealth(PlayerVehicleInfo[i][veh][pvId], PlayerVehicleInfo[i][veh][pvHealth]);
  5536. DetachTrailerFromVehicle(iVehTowed);
  5537. DestroyVehicle(iVehTowed);
  5538. if(IsValidDynamicArea(iVehEnterAreaID[iVehTowed])) DestroyDynamicArea(iVehEnterAreaID[iVehTowed]);
  5539. PlayerVehicleInfo[i][veh][pvId] = INVALID_PLAYER_VEHICLE_ID;
  5540. g_mysql_SaveVehicle(playerid, veh);
  5541. format(szMessage, sizeof(szMessage),"* You have impounded %s's %s.", GetPlayerNameEx(i), VehicleName[PlayerVehicleInfo[i][veh][pvModelId] - 400]);
  5542. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
  5543. format(szMessage, sizeof(szMessage), "Your %s has been impounded by an admin. You may release it at the DMV in Dillimore.", VehicleName[PlayerVehicleInfo[i][veh][pvModelId] - 400]);
  5544. SendClientMessageEx(i, COLOR_LIGHTBLUE, szMessage);
  5545. break;
  5546. }
  5547. }
  5548. if((veh = IsDynamicCrateVehicle(iVehTowed)) != -1) {
  5549. if(ValidGroup(CrateVehicle[veh][cvGroupID])) {
  5550. new Float:vHealth;
  5551. GetVehicleHealth(CrateVehicle[veh][cvSpawnID], vHealth);
  5552. CrateVehicle[veh][cvHealth] = vHealth;
  5553. CrateVehicle[veh][cvFuel] = VehicleFuel[CrateVehicle[veh][cvSpawnID]];
  5554. CrateVehicle[veh][cvImpound] = 1;
  5555. DetachTrailerFromVehicle(iVehTowed);
  5556. if(CreateCount(veh) > 0) AnnounceRespawn(CrateVehicle[veh][cvGroupID], "impounded by an admin", veh, CreateCount(veh));
  5557. DestroyVehicle(CrateVehicle[veh][cvSpawnID]);
  5558. CrateVehicle[veh][cvSpawned] = 0;
  5559. CrateVehicle[veh][cvSpawnID] = INVALID_VEHICLE_ID;
  5560. CrateVehCheck(veh); // Ensure we check for crates!
  5561. SaveCrateVehicle(veh);
  5562. format(szMessage, sizeof(szMessage), "* Your %s has been impounded by an admin you can recover it from your garage. (( /cvstorage ))", VehicleName[CrateVehicle[veh][cvModel] - 400]);
  5563. foreach(new i: Player) {
  5564. if(PlayerInfo[i][pLeader] == CrateVehicle[veh][cvGroupID]) {
  5565. ChatTrafficProcess(i, arrGroupData[CrateVehicle[veh][cvGroupID]][g_hRadioColour] * 256 + 255, szMessage, 12);
  5566. }
  5567. }
  5568. format(szMessage, sizeof(szMessage),"* You have impounded %s's %s.", arrGroupData[CrateVehicle[veh][cvGroupID]][g_szGroupName], VehicleName[CrateVehicle[veh][cvModel] - 400]);
  5569. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
  5570. }
  5571. else veh = -1;
  5572. }
  5573. if(veh == -1) {
  5574. SendClientMessageEx(playerid, COLOR_GRAD1, "This vehicle can't be impounded it's been respawned instead.");
  5575. SetVehicleToRespawn(iVehTowed);
  5576. }
  5577. }
  5578. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  5579. return 1;
  5580. }
  5581. CMD:stats(playerid, params[]) {
  5582. if(gPlayerLogged{playerid} != 0) ShowStats(playerid, playerid);
  5583. return 1;
  5584. }
  5585. CMD:changepass(playerid, params[])
  5586. {
  5587. if (gPlayerLogged{playerid})
  5588. {
  5589. ShowPlayerDialogEx(playerid, DIALOG_CHANGEPASS, DIALOG_STYLE_INPUT, "Password Change", "Please enter your new password!", "Change", "Exit" );
  5590. }
  5591. return 1;
  5592. }
  5593. CMD:myangle(playerid, params[])
  5594. {
  5595. new myString[128], Float:a;
  5596. GetPlayerFacingAngle(playerid, a);
  5597. format(myString, sizeof(myString), "Your angle is: %0.2f", a);
  5598. SendClientMessageEx(playerid, 0xFFFFFFFF, myString);
  5599. new myString2[128], Float:x, Float:y, Float:z;
  5600. GetPlayerPos(playerid, x, y, z);
  5601. format(myString2, sizeof(myString), "Your position is: %f, %f, %f", x, y, z);
  5602. SendClientMessageEx(playerid, 0xFFFFFFFF, myString2);
  5603. return 1;
  5604. }
  5605. CMD:kcp(playerid, params[]) {
  5606. return cmd_killcheckpoint(playerid, params);
  5607. }
  5608. CMD:killcheckpoint(playerid, params[]) {
  5609. Player_KillCheckPoint(playerid);
  5610. return 1;
  5611. }
  5612. CMD:flipcoin(playerid, params[]) {
  5613. new
  5614. szMessage[124];
  5615. switch(random(200)) {
  5616. case 0 .. 98: format(szMessage, sizeof(szMessage), "* %s flips a coin that lands on heads.", GetPlayerNameEx(playerid));
  5617. case 100 .. 198: format(szMessage, sizeof(szMessage), "* %s flips a coin that lands on tails.", GetPlayerNameEx(playerid));
  5618. default: cmd_flipcoin(playerid, params);
  5619. }
  5620. return ProxDetector(5.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  5621. }
  5622. CMD:dice(playerid, params[])
  5623. {
  5624. new string[84];
  5625. if (PlayerInfo[playerid][pDice])
  5626. {
  5627. new rand = Random(1, 7); format(string, sizeof(string), "{FF8000}** {C2A2DA}%s rolls a dice that lands on %d.", GetPlayerNameEx(playerid), rand);
  5628. ProxDetector(9.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  5629. }
  5630. else
  5631. {
  5632. SendClientMessageEx(playerid, COLOR_GRAD2, "You don't have a dice.");
  5633. return 1;
  5634. }
  5635. return 1;
  5636. }
  5637. CMD:randomnumber(playerid, params[])
  5638. {
  5639. new iLower, iUpper;
  5640. if(sscanf(params, "dd", iLower, iUpper)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /randomnumber [minimum] [maximum]");
  5641. if(iLower < 2 || iUpper > 999999) return SendClientMessage(playerid, COLOR_GRAD2, "The minimum value must be 2 or above, and you cannot go above 999,999.");
  5642. if((iUpper - iLower) < 2) return SendClientMessage(playerid, COLOR_GRAD2, "There must be a difference of at least 2 between the min and max values.");
  5643. new val = randomEx(iLower, iUpper + 1);
  5644. format(szMiscArray, sizeof(szMiscArray), "{FF8000}** {C2A2DA}%s picks a random number - %s.", GetPlayerNameEx(playerid), number_format(val));
  5645. ProxDetector(9.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  5646. return 1;
  5647. }
  5648. CMD:randnum(playerid, params[]) return cmd_randomnumber(playerid, params);
  5649. CMD:card(playerid, params[]) {
  5650. new iDeck = Random(0, 3),
  5651. iNumber = Random (0, 12),
  5652. szTemp[6],
  5653. szTemp2[10];
  5654. szMiscArray[0] = 0;
  5655. switch(iDeck) {
  5656. case 0: szTemp2 = "hearts";
  5657. case 1: szTemp2 = "clubs";
  5658. case 2: szTemp2 = "spades";
  5659. case 3: szTemp2 = "diamonds";
  5660. }
  5661. switch(iNumber) {
  5662. case 0: szTemp = "Ace";
  5663. case 1 .. 9: {
  5664. valstr(szTemp, iNumber+1);
  5665. strcat(szMiscArray, szTemp);
  5666. }
  5667. case 10: szTemp = "jack";
  5668. case 11: szTemp = "queen";
  5669. case 12: szTemp = "king";
  5670. }
  5671. format(szMiscArray, sizeof(szMiscArray), "* %s has pulled the card %s of %s.", GetPlayerNameEx(playerid), szTemp, szTemp2);
  5672. ProxDetector(5.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE, 1);
  5673. return 1;
  5674. }
  5675. CMD:giveeventtokens(playerid, params[])
  5676. {
  5677. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1 || PlayerInfo[playerid][pPR])
  5678. {
  5679. new giveplayerid, amount;
  5680. if (sscanf(params, "ui", giveplayerid, amount)) return SendClientMessageEx(playerid, COLOR_WHITE, "Usage: /giveeventtokens [player] [amount]");
  5681. if (amount == 0) return SendClientMessageEx(playerid, COLOR_GRAD2, " Amount cannot be 0!");
  5682. szMiscArray[0] = 0;
  5683. if (amount < 0)
  5684. {
  5685. if(-amount > PlayerInfo[giveplayerid][pEventTokens]) return SendClientMessageEx(playerid, -1, "The amount stated is more than they have to take.");
  5686. format(szMiscArray, sizeof(szMiscArray), "You have taken %i of %s's tokens away.", -amount, GetPlayerNameEx(giveplayerid));
  5687. }
  5688. else
  5689. {
  5690. format(szMiscArray, sizeof(szMiscArray), "You have given %s %i tokens.", GetPlayerNameEx(giveplayerid), amount);
  5691. }
  5692. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  5693. PlayerInfo[giveplayerid][pEventTokens] += amount;
  5694. }
  5695. return 1;
  5696. }
  5697. CMD:reloadmapping(playerid, params[])
  5698. {
  5699. if(PlayerInfo[playerid][pAdmin] >= 1337)
  5700. {
  5701. SendClientMessageToAllEx(COLOR_LIGHTBLUE, "* The mapping filterscripts are currently being reloaded!");
  5702. for(new i, Float: fPlayerPos[3]; i < MAX_PLAYERS; i++)
  5703. {
  5704. GetPlayerPos(i, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
  5705. Player_StreamPrep(i, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2], FREEZE_TIME);
  5706. }
  5707. SendRconCommand("reloadfs mapping/Gang");
  5708. SendRconCommand("reloadfs mapping/PlayerExteriors");
  5709. SendRconCommand("reloadfs mapping/PlayerInteriors");
  5710. SendRconCommand("reloadfs mapping/Server");
  5711. }
  5712. return 1;
  5713. }
  5714. CMD:resetpgifts(playerid, params[])
  5715. {
  5716. if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use this command!");
  5717. new query[256];
  5718. format(szMiscArray, sizeof(szMiscArray), "{AA3333}AdmWarning{FFFF00}: %s reset everyones received gift to 0. (Login Event Gifts)", GetPlayerNameEx(playerid));
  5719. ABroadCast(COLOR_YELLOW, szMiscArray, 2);
  5720. foreach(new i: Player) {
  5721. PlayerInfo[i][pReceivedPrize] = 0;
  5722. }
  5723. mysql_format(MainPipeline, query, sizeof(query), "UPDATE `accounts` SET `ReceivedPrize` = 0 WHERE `ReceivedPrize` != 0");
  5724. mysql_tquery(MainPipeline, query, "OnQueryFinish", "i", SENDDATA_THREAD);
  5725. SendClientMessageEx(playerid, COLOR_CYAN, "You have reset everyones received gift they'll be able to get gifts upon login.");
  5726. format(szMiscArray, sizeof(szMiscArray), "%s has reset everyones received gift to 0. (Login Event Gifts)", GetPlayerNameEx(playerid));
  5727. Log("logs/admin.log", szMiscArray);
  5728. return 1;
  5729. }