admins.pwn 261 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795
  1. //admin commands
  2. CMD:removeskin(playerid, params[]) return cmd_removeskin(playerid, params);
  3. CMD:rskin(playerid, params[])
  4. {
  5. if(!Logged{playerid}) return true;
  6. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  7. new playa = -1, slot;
  8. if(sscanf(params, "ui", playa, slot)) return SysMsg(playerid, "Usage: /rskin [playerid or name] [skin slot 1-5]");
  9. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  10. if(playa == playerid) return SysMsg(playerid, "Cannot be yourself.");
  11. if(slot > 5 || slot < 1) return SysMsg(playerid, "Invalid slot. Please enter 1-5.");
  12. slot --;
  13. if(Clothes[playa][slot] == 0) return SysMsg(playerid, "They do not have clothes in that slot.");
  14. if(Clothes[playa][slot] == cPlayersSkin[playa]) return SysMsg(playerid, "They are currently wearing that skin, get them to change it.");
  15. Clothes[playa][slot] = 0;
  16. slot ++;
  17. new str[10];
  18. format(str,sizeof(str),"SkinSet%i",slot);
  19. MySQLUpdateInt(SQLID[playa], str, Clothes[playa][slot-1], "players");
  20. SendClientMessageF(playerid, COLOR_RED, "You have removed %s's skin from slot %i.", NameEx(playa), slot);
  21. SendClientMessageF(playa, COLOR_RED, "Admin %s has removed your skin from slot %i.", NameEx(playerid), slot);
  22. return true;
  23. }
  24. CMD:viewskins(playerid, params[])
  25. {
  26. if(!Logged{playerid}) return true;
  27. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  28. new playa = -1;
  29. if(sscanf(params, "u", playa)) return SysMsg(playerid, "Usage: /viewskins [playerid or name]");
  30. if(InvalidPlayer(playerid)) return SysMsg(playerid, NOPLAYER);
  31. new tempstr[50];
  32. format(gstr, sizeof(gstr), "Inventory Clothes: ");
  33. for(new i = 0; i < 4; i++)
  34. {
  35. if(Clothes[playa][i] > 0)
  36. {
  37. format(tempstr, 50, "[Slot %i: %i] ", i+1, Clothes[playa][i]);
  38. strcat(gstr, tempstr);
  39. }
  40. else
  41. {
  42. format(tempstr, 50, "[Slot %i: Empty] ", i+1);
  43. strcat(gstr, tempstr);
  44. }
  45. }
  46. if(Clothes[playa][4] > 0)
  47. {
  48. format(tempstr, 50, "[Faction: %i] ", Clothes[playa][4]);
  49. strcat(gstr, tempstr);
  50. }
  51. else strcat(gstr, "[Faction: Empty] ");
  52. SendClientMessage(playerid, COLOR_WHITE, gstr);
  53. return true;
  54. }
  55. CMD:watchlist(playerid, params[])
  56. {
  57. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  58. if(isnull(params)) return SysMsg(playerid, "Usage: /watchlist [view/add/remove]");
  59. if(strcmp(params, "view", true) == 0)
  60. {
  61. mysql_pquery(conn, "SELECT * FROM watchlist", "ShowWatchlistInfo", "i", playerid);
  62. }
  63. else if(strfind(params, "add", true) != -1)
  64. {
  65. new option[12], maname[25], info[150];
  66. if(sscanf(params, "s[12]s[25]s[150]", option, maname, info)) return SysMsg(playerid, "Usage: /watchlist add [Master Account name] [information]");
  67. if(!strlen(maname)) return SysMsg(playerid, "Please enter a Master Account name.");
  68. if(!strlen(info)) return SysMsg(playerid, "You must enter information about the watchlist entry.");
  69. new sqlid = MySQLCheckMaster_AgainstName(maname);
  70. if(sqlid == 0) return SysMsg(playerid, "Unable to find an MA with that name");
  71. mysql_format(conn, mquery, sizeof(mquery), "SELECT NULL FROM watchlist WHERE Player = %i", sqlid);
  72. mysql_pquery(conn, mquery, "AddUserToWatchlist", "iiss", playerid, sqlid, maname, info);
  73. return true;
  74. }
  75. else if(strfind(params, "remove", true) != -1)
  76. {
  77. new option[12], id;
  78. if(sscanf(params, "s[12]i", option, id)) return SysMsg(playerid, "Usage: /watchlist remove [ID from /watchlist view]");
  79. mysql_format(conn, mquery, sizeof(mquery), "SELECT NULL FROM watchlist WHERE id = %i", id);
  80. mysql_pquery(conn, mquery, "ProcessWatchlistRemoval", "ii", playerid, id);
  81. }
  82. return true;
  83. }
  84. GREENSIDE::ShowWatchlistInfo(playerid)
  85. {
  86. if(!cache_num_rows()) return SysMsg(playerid, "The watchlist is currently empty.");
  87. SendClientMessage(playerid, COLOR_WHITE, "[Watchlist]");
  88. new reason[30][150], id[30], player[30];
  89. for(new i = 0, x = cache_num_rows(); i < x; i++)
  90. {
  91. id[i] = cache_get_field_content_int(i, "id");
  92. player[i] = cache_get_field_content_int(i, "Player");
  93. cache_get_field_content(i, "Reason", reason[i], conn, 150);
  94. }
  95. for(new i = 0, x = cache_num_rows(); i < x; i++)
  96. {
  97. SendSplitMessageF(playerid, COLOR_WHITE, "Entry %i: [%s - %s]", id[i], GetMasterName(player[i]), reason[i]);
  98. }
  99. return true;
  100. }
  101. GREENSIDE::ProcessWatchlistRemoval(playerid, id)
  102. {
  103. if(!cache_num_rows()) return SendClientMessage(playerid, COLOR_WHITE, "No watchlist entry found.");
  104. mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM watchlist WHERE id = %i", id);
  105. mysql_pquery(conn, mquery);
  106. SendClientMessage(playerid, COLOR_WHITE, "Watchlist entry removed.");
  107. return true;
  108. }
  109. GREENSIDE::AddUserToWatchlist(playerid, sqlid, maname[], info[])
  110. {
  111. if(cache_num_rows()) return SendClientMessage(playerid, COLOR_WHITE, "This user is already on the watchlist.");
  112. mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO watchlist (Player, Reason, AdminSQLID) VALUES (%i, '%e', %i)", sqlid, info, SQLID[playerid]);
  113. mysql_pquery(conn, mquery);
  114. SendClientMessageF(playerid, COLOR_WHITE, "You have added %s to the watchlist.", maname);
  115. return true;
  116. }
  117. CMD:usernote(playerid, params[])
  118. {
  119. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  120. new accountname[25], note[150];
  121. if(sscanf(params, "s[25]s[150]", accountname, note)) return SysMsg(playerid, "Usage: /usernote [Master Account Name] [Note]");
  122. if(!strlen(accountname)) return SysMsg(playerid, "You must enter an MA name");
  123. if(!strlen(note)) return SysMsg(playerid, "You must enter a note.");
  124. new sqlid = MySQLCheckMaster_AgainstName(accountname);
  125. if(sqlid == 0) return SysMsg(playerid, "Could not find an MA with that name");
  126. mysql_format(conn, mquery, sizeof(mquery), "UPDATE masters SET UserNote = '%e' WHERE id = %i", note, sqlid);
  127. mysql_pquery(conn, mquery);
  128. SendClientMessageF(playerid, COLOR_WHITE, "You have added a note to %s's account.", accountname);
  129. return true;
  130. }
  131. CMD:removeusernote(playerid, params[])
  132. {
  133. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  134. if(isnull(params)) return SysMsg(playerid, "Usage: /removeusernote [Master Account name]");
  135. new sqlid = MySQLCheckMaster_AgainstName(params);
  136. if(sqlid == 0) return SysMsg(playerid, "could not find an MA with that name.");
  137. mysql_format(conn, mquery, sizeof(mquery), "UPDATE masters SET UserNote = '' WHERE id = %i", sqlid);
  138. mysql_pquery(conn, mquery);
  139. SendClientMessageF(playerid, COLOR_WHITE, "You have removed the user note from %s's account.", params);
  140. return true;
  141. }
  142. /*CMD:reconnectbot(playerid)
  143. {
  144. if(!Logged{playerid}) return true;
  145. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  146. format(sgstr, sizeof(sgstr), "Admin %s is reconnecting the bot.", NameEx(playerid));
  147. IRC_Quit(IRCBot, sgstr);
  148. IRCBot = IRC_Connect("irc.tl", 6667, "RCRPBot", "The Holy Light of Hegebe", "Hegebe123", false);
  149. SendClientMessage(playerid, COLOR_RED, "[Admin] Bot reconnected.");
  150. return true;
  151. }*/
  152. CMD:downedplayers(playerid)
  153. {
  154. if(!Logged{playerid}) return true;
  155. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  156. new downedcount = 0;
  157. foreach(new i: Player)
  158. {
  159. if(Dead{i})
  160. {
  161. downedcount ++;
  162. SendClientMessageF(playerid, COLOR_WHITE, "%s (ID %i) is downed. Death timer: %i seconds.", NameEx(i), i, DeathTimer[i]);
  163. }
  164. }
  165. if(downedcount == 0) SendClientMessage(playerid, COLOR_WHITE, "No downed players currently.");
  166. return true;
  167. }
  168. CMD:paint(playerid)
  169. {
  170. if(!Logged{playerid}) return true;
  171. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, CMDFMSG);
  172. if(!UsingPaint{playerid})
  173. {
  174. if(ADuty[playerid] != 1) return SysMsg(playerid, "You must be on aduty to turn this on.");
  175. foreach(new i: Player)
  176. {
  177. if(Logged{i})
  178. {
  179. format(tgstr, sizeof(tgstr), "%s (%i)", NameEx(i), i);
  180. PaintLabels[playerid][i] = CreateDynamic3DTextLabel(tgstr, COLOR_ORANGE, PlayerPosX(i), PlayerPosY(i), PlayerPosZ(i), 500, i, INVALID_VEHICLE_ID, 0, -1, -1, playerid, 500.0);
  181. }
  182. }
  183. Streamer_Update(playerid);
  184. UsingPaint{playerid} = true;
  185. SendClientMessage(playerid, COLOR_RED, "[Admin] You have enabled text labels for all of the players.");
  186. }
  187. else
  188. {
  189. for(new x = 0; x < MAX_PLAYERS; x++)
  190. {
  191. if(PaintLabels[playerid][x] != Text3D:INVALID_3DTEXT_ID)
  192. {
  193. DestroyDynamic3DTextLabel(PaintLabels[playerid][x]);
  194. PaintLabels[playerid][x] = Text3D:INVALID_3DTEXT_ID;
  195. }
  196. }
  197. UsingPaint{playerid} = false;
  198. SendClientMessage(playerid, COLOR_RED, "[Admin] You have disabled text labels for all of the players.");
  199. }
  200. return true;
  201. }
  202. CMD:pvars(playerid)
  203. {
  204. new varname[128], varcount = GetPVarsUpperIndex(playerid);
  205. if(varcount == 0) return SendClientMessage(playerid, -1, "No PVars found on your playerid.");
  206. for(new i = 0; i < varcount; i++)
  207. {
  208. GetPVarNameAtIndex(playerid, i, varname, 128);
  209. switch(GetPVarType(playerid, varname))
  210. {
  211. case PLAYER_VARTYPE_NONE: format(sgstr, sizeof(sgstr), "pVar %i: {FF0000}UNUSED", i);
  212. case PLAYER_VARTYPE_INT: format(sgstr, sizeof(sgstr), "pVar %i: %s - %i", i, varname, GetPVarInt(playerid, varname));
  213. case PLAYER_VARTYPE_STRING:
  214. {
  215. new pvarstring[128];
  216. GetPVarString(playerid, varname, pvarstring, 128);
  217. format(sgstr, sizeof(sgstr), "pVar %i: %s - %s", i, varname, pvarstring);
  218. }
  219. case PLAYER_VARTYPE_FLOAT: format(sgstr, sizeof(sgstr), "pVar %i: %s - %f", i, varname, GetPVarFloat(playerid, varname));
  220. }
  221. SendSplitMessage(playerid, -1, sgstr);
  222. }
  223. return true;
  224. }
  225. CMD:reports(playerid, params[])
  226. {
  227. if(!Logged{playerid}) return true;
  228. if(IsPlayerAdminLevelOK(playerid, 1))
  229. {
  230. gstr[0] = EOS;
  231. for(new x = 0; x < MAX_REPORTS; x++)
  232. {
  233. if(strlen(Reports[x][ReporterName]))
  234. {
  235. format(sgstr, sizeof(sgstr), "Report from %s about %s. {FF0000}Click to view reason{FFFFFF}\n", Reports[x][ReporterName], Reports[x][ReportedName], Reports[x][ReportReason]);
  236. strcat(gstr, sgstr);
  237. }
  238. }
  239. if(!strlen(gstr)) return SysMsg(playerid, "No active reports.");
  240. Dialog_Show(playerid, ReportsList, DIALOG_STYLE_LIST, "Active Reports", gstr, "Details", "Close");
  241. }
  242. return true;
  243. }
  244. CMD:cleanupmdc(playerid, params[])
  245. {
  246. if(!IsPlayerAdmin(playerid)) return true;
  247. mysql_pquery(conn, "SELECT SuspectSQLID FROM mdc GROUP BY SuspectSQLID", "MDCCleanup", "d", playerid);
  248. return true;
  249. }
  250. GREENSIDE::MDCCleanup(playerid)
  251. {
  252. new c = 0, account1, account2;
  253. for(new x = 0, i = cache_num_rows(); x < i; x++)
  254. {
  255. account1 = cache_get_field_content_int(x, "SuspectSQLID");
  256. account2 = MySQLCheckAccountBanned(account1);
  257. if(account2 == 0)
  258. {
  259. mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM mdc WHERE SuspectSQLID = %i", account1);
  260. mysql_pquery(conn, mquery);
  261. c++;
  262. }
  263. }
  264. SysMsgF(playerid, "%i accounts removed from MDC.", c);
  265. return true;
  266. }
  267. CMD:ah(playerid)
  268. {
  269. if(!Logged{playerid}) return true;
  270. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  271. SendClientMessage(playerid, COLOR_RED, "Help > Admin Help");
  272. SendClientMessage(playerid, COLOR_WHITE, "Trial Admin Commands:");
  273. SendClientMessage(playerid, COLOR_ORANGE, "/aduty /a /kick /ban /tban /view(t|d)bans /dateban /(un)mute /dooc(un)mute /mutes /stats [id] /ip [id] /asay /aboombox /confirmname");
  274. SendClientMessage(playerid, COLOR_ORANGE, "/assist /assists /endassist /cars /togamsg /afklist /strangers /vehicles /vid /checkguns /checkplayer /checkaccount /removedateban");
  275. SendClientMessage(playerid, COLOR_ORANGE, "/ajail /acases /aunjail /getp /gotop /gotov /getv /spectate /spectateoff /rspec /vdamage /slap /slapdown /adminrecord /punish /tunban");
  276. SendClientMessage(playerid, COLOR_ORANGE, "/warn /warnings /ipcheck /vspec /reefer /a(un)lock /delv /ahangout /whospawned /whois /unban /setunbandate /acceptra /revive /removefires");
  277. SendClientMessage(playerid, COLOR_ORANGE, "/freeze /unfreeze /set /inventory [id] /gotoh /gotob /checkallguns /teleport /removemask /xyz /vget /acars /whospec /tpto /vget /acars");
  278. SendClientMessage(playerid, COLOR_ORANGE, "/whospec /tpto /ahide /arealookup /weaponlookup /vehiclelookup /accuracy /object /paint /downedplayers /clientid /guninfo /actionlog");
  279. SendClientMessage(playerid, COLOR_ORANGE, "/rskin");
  280. if(IsPlayerAdminLevelOK(playerid, 2))
  281. {
  282. SendClientMessage(playerid, COLOR_WHITE, "Admin Commands:");
  283. SendClientMessage(playerid, COLOR_ORANGE, "/disableaccount /enableaccount /v /flip /makehelper /disarm /ccash /createstillfire /fids /afrespawn");
  284. }
  285. if(IsPlayerAdminLevelOK(playerid, 3))
  286. {
  287. SendClientMessage(playerid, COLOR_WHITE, "Lead Admin Commands:");
  288. SendClientMessage(playerid, COLOR_ORANGE, "/an /kill [id] /bc /countdown /startevent /stopevent /gmx /cancelgmx /giveweapon /afix");
  289. SendClientMessage(playerid, COLOR_ORANGE, "/(un)freezeall /(give/remove)license /changepn /refunddrug");
  290. SendClientMessage(playerid, COLOR_ORANGE, "/(un)banip /disableaccid /doubleslap /createfire /tooc");
  291. }
  292. if(IsPlayerAdminLevelOK(playerid, 4))
  293. {
  294. SendClientMessage(playerid, COLOR_WHITE, "Management Commands:");
  295. SendClientMessage(playerid, COLOR_ORANGE, "/vehattach /settime /anim /fedit /cfv /dfv /rbanip /reloadfactions /refundcash /achangepass /pke /xyz /gtoghc /addfuel");
  296. SendClientMessage(playerid, COLOR_WHITE, "Additional commands via RCON can be found by using /rch");
  297. }
  298. SendClientMessage(playerid, COLOR_WHITE, "All commands below your rank can also be used.");
  299. return true;
  300. }
  301. CMD:adminhelp(playerid, params[]) return cmd_ah(playerid);
  302. CMD:ahelp(playerid, params[]) return cmd_ah(playerid);
  303. CMD:achangepass(playerid, params[])
  304. {
  305. //if(!IsPlayerAdminLevelOK(playerid, 4)) return SysMsg(playerid, AUTHMSG);
  306. new accountname[MAX_PLAYER_NAME], password[50], hashpass[150], sqlid;
  307. if(sscanf(params, "s[20]s[50]", accountname, password)) return SysMsg(playerid,"Usage: /achangepass [ma name] [new password]");
  308. sqlid = MySQLCheckMaster_AgainstName(accountname);
  309. if(sqlid <= 1) return SysMsg(playerid,"This name was not found.");
  310. WP_Hash(hashpass, 150, password);
  311. MySQLUpdateString(sqlid, "Password", hashpass, "masters");
  312. format(gstr, sizeof(gstr), "You have changed %s's password to '%s'", GetSQLName(sqlid), password);
  313. SendClientMessage(playerid, COLOR_RED, gstr);
  314. AdminLog(playerid, sqlid, accountname, "Changed an accounts password");
  315. return true;
  316. }
  317. CMD:addfuel(playerid, params[])
  318. {
  319. if(!Logged{playerid}) return true;
  320. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  321. new fuelamount, fuelplace[6], fueltype[7];
  322. if(sscanf(params, "s[6]s[7]i", fuelplace, fueltype, fuelamount)) return SysMsg(playerid,"Usage: /addfuel [mont,pc,dil,bce,bcw,elq,fc,ap,aps,flint,aper] [petrol/diesel] [amount]");
  323. new fidx = -1;
  324. if(!strcmp(fuelplace, "mont")) fidx = 0;
  325. else if(!strcmp(fuelplace, "pc")) fidx = 1;
  326. else if(!strcmp(fuelplace, "dil")) fidx = 2;
  327. else if(!strcmp(fuelplace, "fc")) fidx = 3;
  328. else if(!strcmp(fuelplace, "bce")) fidx = 4;
  329. else if(!strcmp(fuelplace, "elq")) fidx = 5;
  330. else if(!strcmp(fuelplace, "bcw")) fidx = 6;
  331. else if(!strcmp(fuelplace, "flint")) fidx = 7;
  332. else if(!strcmp(fuelplace, "aps")) fidx = 8;
  333. else if(!strcmp(fuelplace, "ap")) fidx = 9;
  334. else if(!strcmp(fuelplace, "aper")) fidx = 10;
  335. if(!strcmp(fueltype, "petrol"))
  336. {
  337. if(FuelStations[fidx][PetrolAmount] + fuelamount > FuelStations[fidx][PetrolAmountMax]) return SysMsg(playerid,"Station cannot hold this much fuel.");
  338. FuelStations[fidx][PetrolAmount] += fuelamount;
  339. UpdateFuelStationSign(fidx);
  340. format(gstr, sizeof(gstr), "Admin %s added %i gallons of Petrol to the %s gas station.", NameEx(playerid), fuelamount, FuelStations[fidx][StationDescription]);
  341. SendClientMessageToAllLogged(COLOR_OOC, gstr);
  342. format(gstr, sizeof(gstr), "Added %i petrol to %s gas station", fuelamount, FuelStations[fidx][StationDescription]);
  343. AdminLog(playerid, 0, "", gstr);
  344. return true;
  345. }
  346. else if(!strcmp(fueltype, "diesel"))
  347. {
  348. if(FuelStations[fidx][DieselAmount] + fuelamount > FuelStations[fidx][DieselAmountMax]) return SysMsg(playerid,"Station cannot hold this much fuel.");
  349. FuelStations[fidx][DieselAmount] += fuelamount;
  350. UpdateFuelStationSign(fidx);
  351. format(gstr, sizeof(gstr), "Admin %s added %i gallons of Diesel to the %s gas station.", NameEx(playerid), fuelamount, FuelStations[fidx][StationDescription]);
  352. SendClientMessageToAllLogged(COLOR_OOC, gstr);
  353. format(gstr, sizeof(gstr), "Added %i diesel to %s gas station", fuelamount, FuelStations[fidx][StationDescription]);
  354. AdminLog(playerid, 0, "", gstr);
  355. return true;
  356. }
  357. SysMsg(playerid,"Error with parameters.");
  358. return true;
  359. }
  360. CMD:gtogdooc(playerid)
  361. {
  362. if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
  363. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  364. GlobalDOOCMute = !GlobalDOOCMute;
  365. if(!GlobalDOOCMute) SendClientMessageToAllLogged(COLOR_DONATE, "The Donator OOC chat channel has been enabled.");
  366. else SendClientMessageToAllLogged(COLOR_DONATE, "The Donator OOC chat channel has been disabled.");
  367. return true;
  368. }
  369. CMD:togamsg(playerid)
  370. {
  371. if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
  372. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  373. if(ADuty[playerid] == 1) return SysMsg(playerid,"You may not modify this while on duty.");
  374. AdminMsgToggle{playerid} = !AdminMsgToggle{playerid};
  375. if(AdminMsgToggle{playerid}) SendClientMessage(playerid, COLOR_WHITE, "Certain Admin Messages are now enabled for you.");
  376. else SendClientMessage(playerid, COLOR_WHITE, "Certain Admin Messages are now disabled for you.");
  377. return true;
  378. }
  379. CMD:togip(playerid)
  380. {
  381. if(!Logged{playerid}) return true;
  382. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  383. IPTog{playerid} = !IPTog{playerid};
  384. if(IPTog{playerid}) SysMsg(playerid, "IP addresses will no longer show for you in joining messages.");
  385. else SysMsg(playerid, "IP addresses will now show for you in joining messages.");
  386. return true;
  387. }
  388. CMD:afklist(playerid)
  389. {
  390. if(!Logged{playerid}) return true;
  391. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  392. gstr[0] = EOS;
  393. foreach(new i: Player)
  394. {
  395. if(Logged{i} && IsAFK{i})
  396. {
  397. format(sgstr, sizeof(sgstr), "%s(%i) - %i minutes (Reason: %s)\n", NameEx(i), i, AwayMinutes[i], AFKReason[i]);
  398. strcat(gstr, sgstr);
  399. }
  400. }
  401. if(!strlen(gstr)) return SysMsg(playerid, "No AFK players.");
  402. else ShowMessage(playerid, "Server AFK List", gstr, "Ok");
  403. return true;
  404. }
  405. CMD:strangers(playerid)
  406. {
  407. if(!Logged{playerid}) return true;
  408. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  409. new sub[60], count = 0;
  410. gstr[0] = EOS;
  411. foreach(new i: Player)
  412. {
  413. if(Logged{i} && IsPlayerMasked{i} && MaskHideName{i})
  414. {
  415. if(count > 0) format(sub, sizeof(sub), "\nStranger_%i - %s(ID %i)", MaskLabelNumber[i], NameEx(i), i);
  416. else format(sub, sizeof(sub), "Stranger_%i - %s(ID %i)", MaskLabelNumber[i], NameEx(i), i);
  417. count ++;
  418. strcat(gstr, sub);
  419. }
  420. }
  421. if(count > 0) ShowMessage(playerid, "Server Mask List", gstr, "Ok");
  422. return true;
  423. }
  424. CMD:rch(playerid)
  425. {
  426. if(!Logged{playerid}) return true;
  427. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  428. SendClientMessage(playerid, COLOR_RED, "Help > RCON Admin Help");
  429. SendClientMessage(playerid, COLOR_WHITE, "RCON Commands:");
  430. SendClientMessage(playerid, COLOR_ORANGE, "/makedonator /dlevelup /selloldassets /sellbanassets /payday /setgravity");
  431. SendClientMessage(playerid, COLOR_ORANGE, "/kickall /healall /vlabel /delvlabel /gt /msgall /playsound /msgp /bone /sdo /plantbomb /explode /disarmbomb");
  432. SendClientMessage(playerid, COLOR_ORANGE, "/maths /attach /uberslap /burnmoney /stopburnmoney /blowup /setserverpass /tc /fach");
  433. SendClientMessage(playerid, COLOR_ORANGE, "/saction /fakeme /recordbot /stoprecord /makehouse /edithouse /reloadhouses /makeveh /editveh");
  434. SendClientMessage(playerid, COLOR_ORANGE, "/makepickup /makebizz /editbizz /reloadbizz /reloadpickups /croom /givexp /delacc /reloadweaponinfo");
  435. return true;
  436. }
  437. CMD:vehicles(playerid)
  438. {
  439. if(!Logged{playerid}) return true;
  440. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  441. new vehDone[212];
  442. gstr[0] = EOS;
  443. for(new vid = 1, x = GetVehiclePoolSize(); vid <= x; vid++)
  444. {
  445. if(IsVehicleSpawned(vid))
  446. {
  447. new model = GetVehicleModel(vid);
  448. new Count = 0;
  449. for(new v = 1, x2 = GetVehiclePoolSize(); v <= x2; v++)
  450. {
  451. if(GetVehicleModel(v) == model && vehDone[model-400] == 0)
  452. {
  453. Count++;
  454. }
  455. }
  456. if(Count > 0 && vehDone[model-400] == 0)
  457. {
  458. new subStr[128];
  459. if(Count == 1) format(subStr,128,"\n1 %s",GetVehicleNameEx(model));
  460. else format(subStr,128,"\n%i %s's",Count,GetVehicleNameEx(model));
  461. format(gstr, sizeof(gstr),"%s\n%s",gstr,subStr);
  462. }
  463. vehDone[model-400] = 1;
  464. }
  465. }
  466. Dialog_Show(playerid,DIALOG_NONE,DIALOG_STYLE_LIST,"Vehicle Data",gstr,"Done","");
  467. return true;
  468. }
  469. CMD:mysqlstats(playerid, params)
  470. {
  471. if(IsPlayerAdminLevelOK(playerid, 4))
  472. {
  473. gstr[0] = EOS;
  474. mysql_stat(gstr);
  475. SendSplitMessage(playerid, COLOR_WHITE, gstr);
  476. SendClientMessageF(playerid, COLOR_WHITE, "Unpro Queries: %i", mysql_unprocessed_queries());
  477. }
  478. else return SysMsg(playerid, CMDFMSG);
  479. return true;
  480. }
  481. CMD:v(playerid, params[])
  482. {
  483. if(!IsPlayerAdminLevelOK(playerid, 2)) return SysMsg(playerid, AUTHMSG);
  484. if(IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You cannot spawn another vehicle while you are inside of one.");
  485. new vehiclename[20];
  486. if(sscanf(params, "s[20]", vehiclename)) return SysMsg(playerid,"Usage: /v [model name] [Optional: Primary Color] [Optional: Secondary Color]");
  487. if(GetVehiclePoolSize()+1 > MAX_VEHICLES) return SysMsg(playerid,"Error: Approaching Vehicle Limit.");
  488. new Car = GetVehicleModelIdFromName(vehiclename);
  489. if(Car == -1)
  490. {
  491. Car = strval(vehiclename);
  492. if(Car < 400 || Car > 611) return SysMsg(playerid,"That does not appear to be a valid vehicle. Please use the model name or ID.");
  493. }
  494. if(!IsPlayerAdmin(playerid))
  495. {
  496. new restrictedModels[12] = {406, 425, 432, 447, 537, 538, 569, 570, 577, 590, 592, 520};
  497. for(new i = 0; i < sizeof(restrictedModels); i++) if(Car == restrictedModels[i]) return SysMsg(playerid, "Vehicle is on restricted spawn.");
  498. }
  499. new Float:X, Float:Y, Float:Z, Float:A, interior, vw;
  500. GetPlayerPos(playerid, X, Y, Z);
  501. GetPlayerFacingAngle(playerid, A);
  502. X += (5 * floatsin(-A, degrees));
  503. Y += (5 * floatcos(-A, degrees));
  504. interior = GetPlayerInterior(playerid);
  505. vw = GetPlayerVirtualWorld(playerid);
  506. new carid = CreateVehicleEx(Car, X, Y, Z, A, 7, 7, -1);
  507. aspawned{carid} = true;
  508. ToggleVehicleEngine(carid, 1);
  509. EngineStatus[carid] = 1;
  510. PutPlayerInVehicle(playerid, carid, 0);
  511. Locked{carid} = false;
  512. AdminLocked{carid} = false;
  513. foreach(new i: Player) Objective[carid][i] = 0;
  514. ToggleVehicleLock(carid, 0);
  515. if(interior > 0)
  516. {
  517. LinkVehicleToInteriorEx(carid, interior);
  518. }
  519. if(vw > 0)
  520. {
  521. SetVehicleVirtualWorld(carid, vw);
  522. }
  523. if(!VehicleHasEngine(carid))
  524. {
  525. EngineStatus[carid] = 1;
  526. Fuel[carid] = 100;
  527. }
  528. VehicleSpawnedBy[carid][0] = SQLID[playerid];
  529. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "Vehicle Spawned: {FFFFFF}%s{00FF00} (ID {FFFFFF}%i{00FF00}, Model {FFFFFF}%i{00FF00})", GetVehicleName(carid), carid, Car);
  530. format(sgstr, sizeof(sgstr), "Vehicle Spawned: %s (ID %i, Model %i)", GetVehicleName(carid), carid, Car);
  531. AdminLog(playerid, 0, "", sgstr);
  532. return true;
  533. }
  534. CMD:veh(playerid, params[]) return cmd_v(playerid, params);
  535. CMD:whospawned(playerid, params[])
  536. {
  537. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  538. new vehid = GetPlayerVehicleID(playerid);
  539. if(vehid == 0) if(sscanf(params, "i", vehid)) return SysMsg(playerid,"Usage: /whospawned [vehicle id] OR /whospawned if you're in a vehicle");
  540. new whospawned[MAX_PLAYER_NAME], h, m, diff = gettime() - VehicleSpawnedBy[vehid][1];
  541. if(VehicleSpawnedBy[vehid][0] == 0) format(whospawned, MAX_PLAYER_NAME, "the Server");
  542. else format(whospawned, MAX_PLAYER_NAME, GetSQLName(VehicleSpawnedBy[vehid][0]));
  543. while(diff > 3600)
  544. {
  545. diff -= 3600;
  546. h++;
  547. }
  548. while(diff > 60)
  549. {
  550. diff -= 60;
  551. m++;
  552. }
  553. SendClientMessageF(playerid, COLOR_WHITE, "[%s, ID %i] Spawned by %s %ih and %im ago.", GetVehicleName(vehid), vehid, whospawned, h, m);
  554. return true;
  555. }
  556. CMD:vehattach(playerid, params[])
  557. {
  558. if(!IsPlayerAdminLevelOK(playerid, 4)) return SysMsg(playerid, AUTHMSG);
  559. new Float:pX,Float:pY,Float:pZ;
  560. new Float:vX,Float:vY,Float:vZ;
  561. GetPlayerPos(playerid,pX,pY,pZ);
  562. new Found = 0;
  563. new vid = 1;
  564. new vehicleid = GetPlayerVehicleID(playerid);
  565. new x = GetVehiclePoolSize();
  566. while(vid <= x && !Found)
  567. {
  568. vid++;
  569. GetVehiclePos(vid,vX,vY,vZ);
  570. if(floatabs(pX-vX) < 7.0 && floatabs(pY-vY) < 7.0 && floatabs(pZ-vZ) < 7.0 && vid != vehicleid)
  571. {
  572. Found = 1;
  573. if(IsTrailerAttachedToVehicle(vehicleid)) DetachTrailerFromVehicle(vehicleid);
  574. else AttachTrailerToVehicle(vid,vehicleid);
  575. }
  576. }
  577. return true;
  578. }
  579. CMD:acars(playerid, params[])
  580. {
  581. new count = 0;
  582. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid,"You are not authorized to use that command.");
  583. gstr[0] = EOS;
  584. for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
  585. {
  586. if(VehicleSpawnedBy[v][0] != 0)
  587. {
  588. format(gstr, sizeof(gstr), "%s%i - %s - Spawned by: %s\n", gstr, v, GetVehicleName(v), GetSQLName(VehicleSpawnedBy[v][0]));
  589. count++;
  590. }
  591. }
  592. if(count == 0) return SysMsg(playerid,"There are no admin spawned vehicles at this time.");
  593. Dialog_Show(playerid, AdminCarList, DIALOG_STYLE_LIST, "Admin Vehicles", gstr, "Despawn", "Cancel");
  594. return true;
  595. }
  596. CMD:setvh(playerid, params[])
  597. {
  598. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  599. new vid = GetPlayerVehicleID(playerid);
  600. if(vid > 0)
  601. {
  602. SetVehicleHealthEx(vid, strval(params));
  603. SysMsgF(playerid, "Vehicle Health Set To %i.", strval(params));
  604. }
  605. return true;
  606. }
  607. CMD:ln(playerid, params[])
  608. {
  609. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  610. SendClientMessageF(playerid, COLOR_WHITE, "Draw: %i", WinningLotteryNumber);
  611. return true;
  612. }
  613. CMD:fl(playerid, params[])
  614. {
  615. if(!IsPlayerAdminLevelOK(playerid, 2)) return SysMsg(playerid, AUTHMSG);
  616. if(IsPlayerInAnyVehicle(playerid))
  617. {
  618. new id = GetPlayerVehicleID(playerid), Float:a;
  619. GetVehicleZAngle(id,a);
  620. SetVehicleZAngle(id,a);
  621. format(gstr, sizeof(gstr), "Vehicle Flipped: %s(%i)", GetVehicleName(id),id);
  622. SendClientMessage(playerid, COLOR_LIGHTGREEN, gstr);
  623. }
  624. else return SysMsg(playerid,"You are not in a vehicle.");
  625. return true;
  626. }
  627. CMD:flip(playerid, params[]) return cmd_fl(playerid, params);
  628. CMD:giveweapon(playerid, params[])
  629. {
  630. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  631. new playa = -1, gunid[30], reason[8];
  632. if(sscanf(params, "us[30]s[8]", playa, gunid, reason)) return SysMsg(playerid,"Usage: /giveweapon [player id or name] [weapon id/part of name] [event/refund/faction]");
  633. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  634. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  635. if(GetFreeWeaponObjectIndex(playa) == -1) return SysMsg(playerid, "That player can't carry another weapon right now, they have too many holstered.");
  636. new wid;
  637. if(!IsNumeric(gunid)) wid = GetWeaponIdFromName(gunid);
  638. else wid = strval(gunid);
  639. if(wid == -1) return SysMsg(playerid,"Invalid Weapon.");
  640. if(wid < 0 || wid > 47) return SysMsg(playerid,"Invalid Weapon.");
  641. if(wid == 19 || wid == 20 || wid == 21) return SysMsg(playerid,"Invalid Weapon.");
  642. new ammo = GetDefaultWeaponAmmo(wid);
  643. if(!IsPlayerAdmin(playa) && IsBanWeapon(wid)) return SysMsg(playerid,"That player can't have that weapon.");
  644. new wname[30];
  645. wname = GetWeaponNameFromID(wid);
  646. if(!WeaponCheck(playa, wid) && IsActualGun(wid)) return SysMsg(playerid, "This player cannot take this weapon. They either have two sidearms or one primary weapon plus a sidearm on their person.");
  647. if(WeaponData[playa][GetWeaponSlot(wid)][Weapon] >= 1) return SysMsg(playerid, "This player already has a weapon in that slot.");
  648. if(strcmp("refund", reason, true) == 0)
  649. {
  650. GivePlayerWeaponEx(playa, wid, ammo, 1, -1, 1, SQLID[playerid]);
  651. format(sgstr, sizeof(sgstr),"Admin %s refunded you a weapon: %s(Id:%i) Ammo: %i", NameEx(playerid), wname, wid, ammo);
  652. SendClientMessage(playa, COLOR_LIGHTGREEN, sgstr);
  653. format(sgstr, sizeof(sgstr),"[Admin] %s refunded %s a weapon: %s(Id:%i) Ammo: %i", NameEx(playerid), NameEx(playa), wname, wid, ammo);
  654. AdminBroadcast(sgstr, 1);
  655. format(sgstr, sizeof(sgstr), "Give weapon %s, ammo=%i, reason=Refund", wname, ammo);
  656. AdminLog(playerid, SQLID[playa], GetName(playa), sgstr);
  657. }
  658. else if(strcmp("event", reason, true) == 0)
  659. {
  660. GivePlayerWeapon(playa, wid, ammo);
  661. HasEventWeapon{playa} = true;
  662. format(sgstr, sizeof(sgstr),"Admin %s gave you a weapon for an event: %s(Id:%i) Ammo: %i", NameEx(playerid), wname, wid, ammo);
  663. SendClientMessage(playa, COLOR_LIGHTGREEN, sgstr);
  664. format(sgstr, sizeof(sgstr),"[Admin] %s gave %s a weapon for an event: %s(Id:%i) Ammo: %i", NameEx(playerid), NameEx(playa), wname, wid, ammo);
  665. AdminBroadcast(sgstr, 1);
  666. format(sgstr, sizeof(sgstr), "Give weapon %s, ammo=%i, reason=Event", wname, ammo);
  667. AdminLog(playerid, SQLID[playa], GetName(playa), sgstr);
  668. format(sgstr, sizeof(sgstr), "[%s] %s (%i) has been given %s with %i ammo. [EVENT]", GetServerTimeString(), NameEx(playa), playa, weaponstring[wid], ammo);
  669. }
  670. else if(strcmp("faction", reason, true) == 0)
  671. {
  672. GivePlayerWeaponEx(playa, wid, ammo, 3, -1, 1, SQLID[playerid]);
  673. format(sgstr, sizeof(sgstr),"Admin %s refunded you a faction weapon: %s(Id:%i) Ammo: %i", NameEx(playerid), wname, wid, ammo);
  674. SendClientMessage(playa, COLOR_LIGHTGREEN, sgstr);
  675. format(sgstr, sizeof(sgstr),"[Admin] %s refunded %s a faction weapon: %s(Id:%i) Ammo: %i", NameEx(playerid), NameEx(playa), wname, wid, ammo);
  676. AdminBroadcast(sgstr, 1);
  677. format(sgstr, sizeof(sgstr), "Give weapon %s, ammo=%i, reason=Faction Wep", wname, ammo);
  678. AdminLog(playerid, SQLID[playa], GetName(playa), sgstr);
  679. }
  680. else SysMsg(playerid,"Usage: /giveweapon [player id or name] [weapon id/part of name] [event/refund]");
  681. return true;
  682. }
  683. CMD:guninfo(playerid, params[])
  684. {
  685. if(!Logged{playerid}) return true;
  686. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  687. new playa = -1;
  688. if(sscanf(params, "u", playa)) return SysMsg(playerid, "Usage: /guninfo [playerid or name]");
  689. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  690. mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM weapons WHERE WeaponPossession = 1 AND OwnerSQLID = %i AND Deleted = 0", SQLID[playa]);
  691. mysql_pquery(conn, mquery, "ShowWeaponInfo", "i", playerid);
  692. return true;
  693. }
  694. GREENSIDE::ShowWeaponInfo(playerid)
  695. {
  696. if(!cache_num_rows()) return SysMsg(playerid, "This player does not have any weapons on their client.");
  697. new creator[15], timestamp[15], origin[15], weaponid[15], ammo[15], id[15], count;
  698. for(new i = 0, x = cache_num_rows(); i < x; i++)
  699. {
  700. id[i] = cache_get_field_content_int(i, "id");
  701. creator[i] = cache_get_field_content_int(i, "CreatorSQLID");
  702. timestamp[i] = cache_get_field_content_int(i, "Timestamp");
  703. origin[i] = cache_get_field_content_int(i, "WeaponOrigin");
  704. weaponid[i] = cache_get_field_content_int(i, "WeaponID");
  705. ammo[i] = cache_get_field_content_int(i, "WeaponAmmo");
  706. count ++;
  707. }
  708. for(new i = 0; i < count; i++)
  709. {
  710. SendSplitMessageF(playerid, COLOR_BLUE, "[Weapon ID %i (%s, %i ammo)] Creator name: %s, Origin: %s, Timestamp %s", id[i], GetWeaponNameFromID(weaponid[i]), ammo[i], GetSQLName(creator[i]), GetWeaponOrigin(origin[i]), UnixDate(timestamp[i], 0, 0));
  711. }
  712. return true;
  713. }
  714. stock GetWeaponOrigin(origin)
  715. {
  716. new worigin[32];
  717. switch(origin)
  718. {
  719. case 1: worigin = "Admin Refund";
  720. case 2: worigin = "Illegal Weapon";
  721. case 3: worigin = "Faction Weapon";
  722. case 4: worigin = "Licensed Weapon";
  723. case 7: worigin = "Storebought Item";
  724. }
  725. return worigin;
  726. }
  727. CMD:cg(playerid, params[]) return cmd_checkguns(playerid, params);
  728. CMD:checkguns(playerid, params[])
  729. {
  730. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  731. new playa = -1;
  732. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /checkguns [playerid/name]");
  733. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  734. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  735. new clientID, clientAmmo, wCount = 0;
  736. for(new w = 0; w < MAX_TOTAL_WEAPONS; w++)
  737. {
  738. GetPlayerWeaponData(playa, w, clientID, clientAmmo);
  739. if(clientID == WEAPON_SILENCED && HasTaser{playa}) continue;
  740. if(clientID > 0 || WeaponData[playa][w][Weapon] > 0)
  741. {
  742. if(clientID == WeaponData[playa][w][Weapon] && WeaponData[playa][w][WeaponID] != 0)
  743. {
  744. SendClientMessageF(playerid, 0x63FF2DFF, "[SERVER & CLIENT] %s(ID %i) Slot %i | %s(ID %i - %i C.Ammo - %i S.Ammo)", NameEx(playa), playa, w, GetWeaponNameFromID(clientID), clientID, clientAmmo, WeaponData[playa][w][WeaponAmmo]);
  745. wCount ++;
  746. }
  747. else if(clientID != WeaponData[playa][w][Weapon] && WeaponData[playa][w][Weapon] == 0 && clientAmmo > 0 && WeaponData[playa][w][WeaponID] == 0)
  748. {
  749. SendClientMessageF(playerid, 0xF2CD3BFF, "[CLIENT ONLY] %s(ID %i) Slot %i | %s(ID %i - %i C.Ammo - %i S.Ammo)", NameEx(playa), playa, w, GetWeaponNameFromID(clientID), clientID, clientAmmo, WeaponData[playa][w][WeaponAmmo]);
  750. wCount ++;
  751. }
  752. else if(clientID != WeaponData[playa][w][Weapon] && clientID == 0)
  753. {
  754. SendClientMessageF(playerid, 0xF2CD3BFF, "[SERVER ONLY] %s(ID %i) Slot %i | %s(ID %i - %i C.Ammo - %i S.Ammo)", NameEx(playa), playa, w, GetWeaponNameFromID(WeaponData[playa][w][Weapon]), WeaponData[playa][w][Weapon], clientAmmo, WeaponData[playa][w][WeaponAmmo]);
  755. wCount ++;
  756. }
  757. }
  758. }
  759. if(wCount == 0) SendClientMessage(playerid, COLOR_LIGHTBLUE, "This player has no weapons to show.");
  760. return true;
  761. }
  762. CMD:checkallguns(playerid, params[])
  763. {
  764. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  765. new w, clientID, clientAmmo;
  766. foreach(new i: Player)
  767. {
  768. if(IsPlayerNPC(i) || !Logged{i}) continue;
  769. for(w = 0; w < MAX_TOTAL_WEAPONS; w++)
  770. {
  771. GetPlayerWeaponData(i, w, clientID, clientAmmo);
  772. if(clientID == WEAPON_SILENCED && HasTaser{i}) continue;
  773. if(clientID > 0 && clientAmmo > 0)
  774. {
  775. if(WeaponData[i][w][Weapon] != clientID)
  776. {
  777. format(gstr, sizeof(gstr),"%s (ID %i) Possible Hack - Slot %i, Weapon %s(ID %i), %i Ammo", NameEx(i), i, w, GetWeaponNameFromID(clientID), clientID, clientAmmo);
  778. SendClientMessage(playerid, COLOR_DARKBLUE, gstr);
  779. }
  780. }
  781. }
  782. }
  783. SendClientMessage(playerid, COLOR_DARKBLUE, "Checked all players for hacked weapons.");
  784. return true;
  785. }
  786. CMD:refunddrug(playerid, params[])
  787. {
  788. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  789. new pname[MAX_PLAYER_NAME], playa = -1, drug[10], amount;
  790. if(sscanf(params, "s[24]s[10]i", pname, drug, amount)) return SysMsg(playerid,"Usage: /refunddrug [player id OR Full_Name] [weed/cocaine/moonshine] [amount]");
  791. new sqlid = -1;
  792. if(IsNumeric(pname))
  793. {
  794. if(!IsPlayerConnected(strval(pname)) || !Logged{strval(pname)}) return SysMsg(playerid, "Player ID was not connected and logged in.");
  795. playa = strval(pname);
  796. sqlid = SQLID[playa];
  797. }
  798. else
  799. {
  800. sqlid = MySQLCheckAccount(pname, playerid);
  801. if(sqlid <= 0) return SysMsg(playerid, "Name was not found. Please include first name, last name and an underscore OR use there current ingame ID.");
  802. }
  803. if(sqlid == -1) return SysMsg(playerid, "Name was not found. Please include first name, last name and an underscore OR use there current ingame ID.");
  804. if(sqlid == SQLID[playerid] && !IsPlayerAdmin(playerid)) return SysMsg(playerid, "Cannot be yourself.");
  805. if(playa >= 0)
  806. {
  807. if(strcmp("weed", drug, true) == 0)
  808. {
  809. if(amount < 1) return SysMsg(playerid,"That amount was invalid.");
  810. if(amount + Inventory[playa][Weed] > DRUG_MAX_WEED) return SysMsgF(playerid, "Invalid amount, %s wouldnt be able to carry that much Weed. You can give a maximum of %i grams.", NameEx(playa), DRUG_MAX_WEED - Inventory[playa][Weed]);
  811. Inventory[playa][Weed] += amount;
  812. MySQLUpdateInt(SQLID[playa], "Weed", Inventory[playa][Weed], "players");
  813. format(gstr, sizeof(gstr),"Admin %s has refunded you %i grams of Weed.", NameEx(playerid), amount);
  814. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  815. format(gstr, sizeof(gstr),"[Admin] %s has refunded %s %i grams of Weed.", NameEx(playerid), NameEx(playa), amount);
  816. AdminBroadcast(gstr, 0);
  817. format(gstr, sizeof(gstr), "Refund drug %i x %s", amount, drug);
  818. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  819. return true;
  820. }
  821. if(strcmp("cocaine", drug, true) == 0)
  822. {
  823. if(amount < 1) return SysMsg(playerid,"That amount was invalid.");
  824. if(amount + Inventory[playa][Cocaine] > DRUG_MAX_COCAINE) return SysMsgF(playerid, "Invalid amount, %s wouldnt be able to carry that much Cocaine. You can give a maximum of %i grams.", NameEx(playa), DRUG_MAX_COCAINE - Inventory[playa][Cocaine]);
  825. Inventory[playa][Cocaine] += amount;
  826. MySQLUpdateInt(SQLID[playa], "Cocaine", Inventory[playa][Cocaine], "players");
  827. format(gstr, sizeof(gstr),"Admin %s has refunded you %i grams of Cocaine.", NameEx(playerid), amount);
  828. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  829. format(gstr, sizeof(gstr),"[Admin] %s has refunded %s %i grams of Cocaine.", NameEx(playerid), NameEx(playa), amount);
  830. AdminBroadcast(gstr, 0);
  831. format(gstr, sizeof(gstr), "Refund drug %i x %s", amount, drug);
  832. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  833. return true;
  834. }
  835. if(strcmp("moonshine", drug, true) == 0)
  836. {
  837. if(amount < 1) return SysMsg(playerid,"That amount was invalid.");
  838. if(amount + Inventory[playa][MoonShine] > DRUG_MAX_MOONSHINE) return SysMsgF(playerid, "Invalid amount, %s wouldnt be able to carry that much MoonShine. You can give a maximum of %i litre(s).", NameEx(playa), DRUG_MAX_MOONSHINE - Inventory[playa][MoonShine]);
  839. Inventory[playa][MoonShine] += amount;
  840. MySQLUpdateInt(SQLID[playa], "MoonShine", Inventory[playa][MoonShine], "players");
  841. format(gstr, sizeof(gstr),"Admin %s has refunded you %i litre(s) of MoonShine.", NameEx(playerid), amount);
  842. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  843. format(gstr, sizeof(gstr),"[Admin] %s has refunded %s %i litre(s) of MoonShine.", NameEx(playerid), NameEx(playa), amount);
  844. AdminBroadcast(gstr, 0);
  845. format(gstr, sizeof(gstr), "Refund drug %i x %s", amount, drug);
  846. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  847. return true;
  848. }
  849. }
  850. else
  851. {
  852. foreach(new i: Player) if(sqlid == SQLID[i]) return SysMsg(playerid, "Full_Name cannot be an online player, use the player ID instead.");
  853. if(strcmp("weed", drug, true) == 0)
  854. {
  855. if(amount < 1) return SysMsg(playerid,"That amount was invalid.");
  856. mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Weed = Weed + %i WHERE id = %i", amount, sqlid);
  857. mysql_pquery(conn, mquery);
  858. format(gstr, sizeof(gstr),"[Admin] %s has refunded %s %i grams of Weed.", NameEx(playerid), GetSQLName(sqlid), amount);
  859. AdminBroadcast(gstr, 0);
  860. format(gstr, sizeof(gstr), "Refund drug %i x %s", amount, drug);
  861. AdminLog(playerid, sqlid, GetSQLName(sqlid), gstr);
  862. return true;
  863. }
  864. if(strcmp("cocaine", drug, true) == 0)
  865. {
  866. if(amount < 1) return SysMsg(playerid,"That amount was invalid.");
  867. mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Cocaine = Cocaine + %i WHERE id = %i", amount, sqlid);
  868. mysql_pquery(conn, mquery);
  869. format(gstr, sizeof(gstr),"[Admin] %s has refunded %s %i grams of Cocaine.", NameEx(playerid), GetSQLName(sqlid), amount);
  870. AdminBroadcast(gstr, 0);
  871. format(gstr, sizeof(gstr), "Refund drug %i x %s", amount, drug);
  872. AdminLog(playerid, sqlid, GetSQLName(sqlid), gstr);
  873. return true;
  874. }
  875. if(strcmp("moonshine", drug, true) == 0)
  876. {
  877. if(amount < 1) return SysMsg(playerid,"That amount was invalid.");
  878. mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET MoonShine = MonnShine + %i WHERE id = %i", amount, sqlid);
  879. mysql_pquery(conn, mquery);
  880. format(gstr, sizeof(gstr),"[Admin] %s has refunded %s %i litres of MoonShine.", NameEx(playerid), GetSQLName(sqlid), amount);
  881. AdminBroadcast(gstr, 0);
  882. format(gstr, sizeof(gstr), "Refund drug %i x %s", amount, drug);
  883. AdminLog(playerid, sqlid, GetSQLName(sqlid), gstr);
  884. return true;
  885. }
  886. }
  887. return true;
  888. }
  889. CMD:checkplayer(playerid, params[])
  890. {
  891. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  892. new playa = -1;
  893. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /checkplayer [playerid/name]");
  894. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  895. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  896. new id = playa;
  897. new Float:Health, Float:Armour, Float:X, Float:Y, Float:Z, Float:Ang, Interior, World, GPM = GetPlayerMoney(id), armedWeapon = GetPlayerWeapon(id), zone[MAX_ZONE_NAME], tutstatus[12];
  898. GetPlayerHealth(id, Health);
  899. GetPlayerArmour(id, Armour);
  900. GetPlayerPos(id, X, Y, Z);
  901. GetPlayerFacingAngle(id, Ang);
  902. Interior = GetPlayerInterior(id);
  903. World = GetPlayerVirtualWorld(id);
  904. GetPlayer3DZone(id, zone, MAX_ZONE_NAME);
  905. if(CompletedTutorial{id}) format(tutstatus, sizeof(tutstatus), "Yes");
  906. else format(tutstatus, sizeof(tutstatus), "No");
  907. SendClientMessageF(playerid, COLOR_LIGHTBLUE, "Player Data - %s ID:%i - State: %s - Completed Tutorial: %s",NameEx(id),id, GetPlayerStateEx(id), tutstatus);
  908. SendClientMessageF(playerid, COLOR_WHITE, "Health: %.0f(Server:%f) - Armour: %.0f(Server:%f) - Armed Weapon: %s(%i)",Health,HealthVar[id],Armour,ArmourVar[id],GetWeaponNameFromID(armedWeapon),armedWeapon);
  909. SendClientMessageF(playerid, COLOR_WHITE, "Cash Server: %i - Cash Client: %i",Cash[id],GPM);
  910. SendClientMessageF(playerid,COLOR_WHITE, "Location: %s (%f[X], %f[Y], %f[Z], %f[RA]) - Interior ID: %i - VW: %i", zone, X, Y, Z, Ang, Interior, World);
  911. if(IsPlayerInAnyVehicle(id)) SendClientMessageF(playerid, COLOR_WHITE, "Vehicle info: %s - %i", GetVehicleName(GetPlayerVehicleID(id)), GetPlayerVehicleID(id));
  912. return true;
  913. }
  914. CMD:cp(playerid, params[]) return cmd_checkplayer(playerid, params);
  915. CMD:givelicense(playerid, params[])
  916. {
  917. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  918. new playa = -1, licensename[6];
  919. if(sscanf(params, "us[6]", playa, licensename)) return SysMsg(playerid,"Usage: /givelicense [player id or name] [car/bike/boat/plane/heli/large]");
  920. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  921. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  922. new lic = -1, sqlname[24];
  923. if(strcmp("car", licensename, true) == 0) { lic = 0; sqlname = "LicenseCar"; }
  924. else if(strcmp("large", licensename, true) == 0) { lic = 1; sqlname = "LicenseLargeVehicle"; }
  925. else if(strcmp("bike", licensename, true) == 0) { lic = 2; sqlname = "LicenseBike"; }
  926. else if(strcmp("boat", licensename, true) == 0) { lic = 3; sqlname = "LicenseBoat"; }
  927. else if(strcmp("heli", licensename, true) == 0) { lic = 4; sqlname = "LicenseHelicopter"; }
  928. else if(strcmp("plane", licensename, true) == 0) { lic = 5; sqlname = "LicensePlane"; }
  929. else return SysMsg(playerid,"No such license.");
  930. if(Licenses[playa][lic] == 1) return SysMsg(playerid,"They already have this license.");
  931. Licenses[playa][lic] = 1;
  932. MySQLUpdateInt(SQLID[playa], sqlname, Licenses[playa][lic], "players");
  933. for(new tu = 0; tu < sizeof(licensename); tu++) licensename[tu] = toupper(licensename[tu]);
  934. format(gstr, sizeof(gstr),"Admin %s gave you a %s license.", NameEx(playerid), licensename);
  935. SendClientMessage(playa,COLOR_WHITE, gstr);
  936. format(gstr, sizeof(gstr),"You gave %s a %s license.", NameEx(playa), licensename);
  937. SendClientMessage(playerid,COLOR_WHITE, gstr);
  938. format(gstr, sizeof(gstr), "Give %s license", licensename);
  939. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  940. return true;
  941. }
  942. CMD:removelicense(playerid, params[])
  943. {
  944. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  945. new playa = -1, licensename[6];
  946. if(sscanf(params, "us[6]", playa, licensename)) return SysMsg(playerid,"Usage: /removelicense [player id or name] [car/bike/boat/plane/heli/large]");
  947. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  948. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  949. new lic = -1, sqlname[24];
  950. if(strcmp("car", licensename, true) == 0) { lic = 0; sqlname = "LicenseCar"; }
  951. else if(strcmp("large", licensename, true) == 0) { lic = 1; sqlname = "LicenseLargeVehicle"; }
  952. else if(strcmp("bike", licensename, true) == 0) { lic = 2; sqlname = "LicenseBike"; }
  953. else if(strcmp("boat", licensename, true) == 0) { lic = 3; sqlname = "LicenseBoat"; }
  954. else if(strcmp("heli", licensename, true) == 0) { lic = 4; sqlname = "LicenseHelicopter"; }
  955. else if(strcmp("plane", licensename, true) == 0) { lic = 5; sqlname = "LicensePlane"; }
  956. else return SysMsg(playerid,"No such license.");
  957. if(Licenses[playa][lic] == 0) return SysMsg(playerid,"They don't have this license.");
  958. Licenses[playa][lic] = 0;
  959. MySQLUpdateInt(SQLID[playa], sqlname, Licenses[playa][lic], "players");
  960. for(new tu = 0; tu < sizeof(licensename); tu++) licensename[tu] = toupper(licensename[tu]);
  961. SendClientMessageF(playa,COLOR_WHITE, "Admin %s has removed your %s license.", NameEx(playerid), licensename);
  962. SendClientMessageF(playerid,COLOR_WHITE, "You removed %s's %s license.", NameEx(playa), licensename);
  963. format(gstr, sizeof(gstr), "Remove %s license", licensename);
  964. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  965. return true;
  966. }
  967. CMD:checkaccount(playerid, params[])
  968. {
  969. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  970. if(isnull(params)) return SysMsg(playerid,"Usage: /checkaccount [Firstname_Lastname OR in-game id]");
  971. new sqlid = -1, maid = -1;
  972. if(IsNumeric(params))
  973. {
  974. new pid = strval(params);
  975. if(pid < 0 || pid >= MAX_PLAYERS) return SysMsg(playerid,"Invalid ID");
  976. if(!IsPlayerConnected(pid)) return SysMsg(playerid,"Player ID is not connected.");
  977. if(!Logged{pid}) return SysMsg(playerid,"Player ID is not logged in, SQLID could not be found.");
  978. sqlid = SQLID[pid];
  979. maid = MasterAccount[pid];
  980. }
  981. else
  982. {
  983. sqlid = MySQLCheckAccount(params, playerid);
  984. maid = MySQLCheckMaster_AgainstSQLID(sqlid);
  985. }
  986. if(sqlid <= 0) return SysMsg(playerid, "Name was not found. Please include first name, last name and an underscore or just use the in-game ID.");
  987. mysql_format(conn, mquery, sizeof(mquery), "SELECT RegisterDate, IP, RecentIP, RecentSerial, AccountDisabled, Online FROM players WHERE id = %i", sqlid);
  988. mysql_pquery(conn, mquery, "CheckAccountData", "iii", playerid, sqlid, maid);
  989. return true;
  990. }
  991. CMD:whois(playerid, params[])
  992. {
  993. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  994. if(isnull(params)) return SysMsg(playerid,"Usage: /whois [Firstname_Lastname / MA Name or in-game id]");
  995. new sqlid = -1;
  996. if(IsNumeric(params))
  997. {
  998. new pid = strval(params);
  999. if(pid < 0 || pid >= MAX_PLAYERS) return SysMsg(playerid,"Invalid ID");
  1000. if(!IsPlayerConnected(pid)) return SysMsg(playerid,"Player ID is not connected.");
  1001. if(!Logged{pid}) return SysMsg(playerid,"Player ID is not logged in, thus SQLID could not be found.");
  1002. sqlid = SQLID[pid];
  1003. }
  1004. else sqlid = MySQLCheckAccount(params, playerid);
  1005. new masterID;
  1006. if(sqlid <= 0) masterID = MySQLCheckMaster_AgainstName(params);
  1007. else masterID = MySQLCheckMaster_AgainstSQLID(sqlid);
  1008. if(masterID <= 0) return SysMsg(playerid, "Name was not found. Please include first name, last name and an underscore or just use the in-game ID.");
  1009. mysql_format(conn, mquery, sizeof(mquery), "SELECT Username,EMail,GeoDetails,RegTimeStamp FROM masters WHERE id=%i LIMIT 1", masterID);
  1010. mysql_pquery(conn, mquery, "WhoIsPrime", "ddd", playerid, sqlid, masterID);
  1011. return true;
  1012. }
  1013. CMD:aduty(playerid, params[])
  1014. {
  1015. if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
  1016. if(!IsPlayerAdminLevelOK(playerid, 1)) return true;
  1017. if(isnull(params)) return SysMsg(playerid,"Usage: /aduty ['on' / 'off' / 'dnd']");
  1018. if(strcmp("on",params,true) == 0)
  1019. {
  1020. if(ADuty[playerid] == 1) return SysMsg(playerid, "Admin Duty is already on.");
  1021. if(IsAFK{playerid}) return SysMsg(playerid, "You are AFK.");
  1022. if(AdminHidden[playerid]) return SysMsg(playerid, "You are incognito.");
  1023. if(!LocalOOCEnabled{playerid}) cmd_togb(playerid);
  1024. ADuty[playerid] = 1;
  1025. foreach(new i: Player)
  1026. {
  1027. if(IsPlayerMasked{i})
  1028. {
  1029. ShowPlayerNameTagForPlayer(playerid, i, 1);
  1030. FormatHealthLabelText(i, HealthVar[i], ArmourVar[i], 2);
  1031. }
  1032. }
  1033. AdminMsgToggle{playerid} = true;
  1034. SetPlayerColor(playerid, 0x00A6FF00);
  1035. SysMsg(playerid,"Admin Duty on.");
  1036. AdminLog(playerid, 0, "", "Admin duty on");
  1037. return true;
  1038. }
  1039. else if(strcmp("off",params,true) == 0)
  1040. {
  1041. if(ADuty[playerid] == 0) return SysMsg(playerid, "Admin Duty is already off.");
  1042. ADuty[playerid] = 0;
  1043. foreach(new i: Player)
  1044. {
  1045. if(IsPlayerMasked{i})
  1046. {
  1047. ShowPlayerNameTagForPlayer(playerid, i, 0);
  1048. FormatHealthLabelText(i, HealthVar[i], ArmourVar[i], 2);
  1049. }
  1050. }
  1051. if(UsingPaint{playerid}) cmd_paint(playerid);
  1052. SetPlayerColor(playerid, 0xFFFFFF00);
  1053. SysMsg(playerid,"Admin Duty off, enjoy your roleplay.");
  1054. AdminLog(playerid, 0, "", "Admin duty off");
  1055. return true;
  1056. }
  1057. else if(strcmp("dnd",params,true) == 0)
  1058. {
  1059. if(ADuty[playerid] == 1) cmd_aduty(playerid, "off");
  1060. if(ADuty[playerid] == 2) return SysMsg(playerid, "Admin Duty is already DND.");
  1061. ADuty[playerid] = 2;
  1062. SetPlayerColor(playerid, 0xFFFFFF00);
  1063. SysMsg(playerid,"Set to do not disturb.");
  1064. AdminLog(playerid, 0, "", "Admin duty DND");
  1065. return true;
  1066. }
  1067. SysMsg(playerid,"Usage: /aduty ['on' / 'off' / 'dnd']");
  1068. return true;
  1069. }
  1070. CMD:adminrecord(playerid, params[])
  1071. {
  1072. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1073. if(isnull(params)) return SysMsg(playerid,"Usage: /adminrecord [Firstname_Lastname OR Player ID]");
  1074. new sqlid = -1;
  1075. if(IsNumeric(params))
  1076. {
  1077. if(!IsPlayerConnected(strval(params)) || !Logged{strval(params)}) return SysMsg(playerid, "Player ID was not connected and logged in.");
  1078. sqlid = SQLID[strval(params)];
  1079. }
  1080. else
  1081. {
  1082. sqlid = MySQLCheckAccount(params, playerid);
  1083. }
  1084. if(sqlid <= 0) return SysMsg(playerid, "Name was not found. Please include first name, last name and an underscore OR use there current ingame ID.");
  1085. ViewAdminRecord[playerid] = sqlid;
  1086. Dialog_Show(playerid, AdminRecordMenu, DIALOG_STYLE_LIST, "Admin Record", "{FFFFFF}VIEW {FFCE2E}GENERAL{FFFFFF} RECORD\nView {FFCE2E}Kick{FFFFFF} Log\nView {FFCE2E}Perm Ban{FFFFFF} Log\nView {FFCE2E}Temp Ban{FFFFFF} Log\nView {FFCE2E}Date Ban{FFFFFF} Log\nView {FFCE2E}Admin Jail{FFFFFF} Log\nView {FFCE2E}Mute{FFFFFF} Log", "Select", "Cancel");
  1087. return true;
  1088. }
  1089. CMD:myadminrecord(playerid, params[])
  1090. {
  1091. if(!Logged{playerid}) return true;
  1092. mysql_format(conn, mquery, sizeof(mquery), "SELECT COUNT(*) AS punishments, RecordType FROM adminrecord WHERE PlayerSQLID = %i GROUP BY RecordType", SQLID[playerid]);
  1093. mysql_pquery(conn, mquery, "LoadMyAdminRecord", "i", playerid);
  1094. return true;
  1095. }
  1096. GREENSIDE::LoadMyAdminRecord(playerid)
  1097. {
  1098. gstr[0] = EOS;
  1099. new punishments[7];
  1100. for(new i = 0, r = cache_num_rows(); i < r; i++)
  1101. {
  1102. punishments[cache_get_field_content_int(i, "RecordType")] = cache_get_field_content_int(i, "punishments");
  1103. }
  1104. strcat(gstr, "{B42E26}MY ADMIN RECORD\n\n{FFFFFF}Below you can find a basic version of your Admin Record.\n");
  1105. strcat(gstr, "It does not include details such as reasons and dates since it is only intended to be a quick overview for joining factions etc.\n\n\n");
  1106. format(sgstr, sizeof(sgstr), "{FFFFFF}Total Times Kicked: {249CFF}%i\n", punishments[ADMIN_RECORD_TYPE_KICK]);
  1107. strcat(gstr, sgstr);
  1108. format(sgstr, sizeof(sgstr), "{FFFFFF}Total Times Perm Banned: {249CFF}%i\n", punishments[ADMIN_RECORD_TYPE_PERMBAN]);
  1109. strcat(gstr, sgstr);
  1110. format(sgstr, sizeof(sgstr), "{FFFFFF}Total Times Temp Banned: {249CFF}%i\n", punishments[ADMIN_RECORD_TYPE_TEMPBAN]);
  1111. strcat(gstr, sgstr);
  1112. format(sgstr, sizeof(sgstr), "{FFFFFF}Total Times Date Banned: {249CFF}%i\n", punishments[ADMIN_RECORD_TYPE_DATEBAN]);
  1113. strcat(gstr, sgstr);
  1114. format(sgstr, sizeof(sgstr), "{FFFFFF}Total Times Admin Jailed: {249CFF}%i\n", punishments[ADMIN_RECORD_TYPE_AJAIL]);
  1115. strcat(gstr, sgstr);
  1116. format(sgstr, sizeof(sgstr), "{FFFFFF}Total Times Muted: {249CFF}%i\n", punishments[ADMIN_RECORD_TYPE_MUTE]);
  1117. strcat(gstr, sgstr);
  1118. ShowMessage(playerid, "Admin Record", gstr, "OK");
  1119. return true;
  1120. }
  1121. CMD:warn(playerid, params[])
  1122. {
  1123. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1124. new playa = -1, reason[100];
  1125. if(sscanf(params, "us[100]", playa, reason)) return SysMsg(playerid,"Usage: /warn [player id or name] [reason]");
  1126. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  1127. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  1128. if(IsPlayerAdminLevelOK(playa, 1)) return SysMsg(playerid,"Cannot warn an Admin.");
  1129. if(SQLID[playa] > 0)
  1130. {
  1131. new datestring[12], y, m, d;
  1132. getdate(y, m, d);
  1133. format(datestring, sizeof(datestring), "%i/%i/%i", d, m, y);
  1134. mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO warnings (PlayerSQLID,AdminName,Reason,Datestamp) VALUES (%i,'%e','%e','%e')", SQLID[playa], NameEx(playerid), reason, datestring);
  1135. mysql_pquery(conn, mquery, "");
  1136. }
  1137. format(gstr, sizeof(gstr),"* ADMIN WARNING from %s: %s", NameEx(playerid), reason);
  1138. SendClientMessage(playa, COLOR_RED, gstr);
  1139. SendClientMessage(playa, COLOR_WHITE, "* Further breach of the server rules will force the admin team to take action.");
  1140. format(gstr, sizeof(gstr),"[Admin] %s warns %s (%s)", NameEx(playerid), NameEx(playa), reason);
  1141. AdminBroadcast(gstr, 1);
  1142. format(gstr, sizeof(gstr), "Warns for '%s'", reason);
  1143. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  1144. return true;
  1145. }
  1146. CMD:warnings(playerid, params[])
  1147. {
  1148. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1149. if(isnull(params)) return SysMsg(playerid,"Usage: /warnings [Firstname_Lastname OR Player ID]");
  1150. new sqlid = -1;
  1151. if(IsNumeric(params))
  1152. {
  1153. if(!IsPlayerConnected(strval(params)) || !Logged{strval(params)}) return SysMsg(playerid, "Player ID is not connected and logged in.");
  1154. sqlid = SQLID[strval(params)];
  1155. }
  1156. else
  1157. {
  1158. sqlid = MySQLCheckAccount(params, playerid);
  1159. }
  1160. if(sqlid <= 0) return SysMsg(playerid, "Name was not found. Please include first name, last name and an underscore OR use there current ingame ID.");
  1161. mysql_format(conn, mquery, sizeof(mquery), "SELECT AdminName,Datestamp,Reason FROM warnings WHERE PlayerSQLID = %i ORDER BY id DESC LIMIT 15", sqlid);
  1162. mysql_pquery(conn, mquery, "AdminWarnings", "dd", playerid, sqlid);
  1163. return true;
  1164. }
  1165. CMD:sqlid(playerid, params[])
  1166. {
  1167. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1168. if(isnull(params)) return SysMsg(playerid,"Usage: /sqlid [Firstname_Lastname OR Player ID]");
  1169. new sqlid = -1, playa;
  1170. if(IsNumeric(params))
  1171. {
  1172. playa = strval(params);
  1173. if(!IsPlayerConnected(playa) || !Logged{playa}) return SysMsg(playerid, "Player ID was not connected and logged in.");
  1174. sqlid = SQLID[playa];
  1175. format(gstr, sizeof(gstr), "%s(ID %i) SQLID %i", GetName(playa), playa, sqlid);
  1176. SendClientMessage(playerid, COLOR_WHITE, gstr);
  1177. }
  1178. else
  1179. {
  1180. sqlid = MySQLCheckAccount(params, playerid);
  1181. if(sqlid <= 0) return SysMsg(playerid, "Name was not found. Please include first name, last name and an underscore OR use there current ingame ID.");
  1182. format(gstr, sizeof(gstr), "%s SQLID %i", params, sqlid);
  1183. SendClientMessage(playerid, COLOR_WHITE, gstr);
  1184. }
  1185. return true;
  1186. }
  1187. CMD:reefer(playerid, params[])
  1188. {
  1189. if(!IsPlayerAdminLevelOK(playerid, 1) && !IsHelper{playerid}) return SysMsg(playerid, AUTHMSG);
  1190. new option[12];
  1191. if(sscanf(params, "s[12]", option))
  1192. {
  1193. SysMsg(playerid, "Usage: /reefer [option] | Available Options: Respawn, Spec");
  1194. SendClientMessageF(playerid, COLOR_WHITE, "Reefer ID {00CDC6}%i", ReeferID());
  1195. return true;
  1196. }
  1197. if(strmatch("respawn", option))
  1198. {
  1199. new Float:vP[3], vR = 0;
  1200. GetVehiclePos(ReeferID(), vP[0], vP[1], vP[2]);
  1201. foreach(new p: Player)
  1202. {
  1203. if(IsPlayerInRangeOfPoint(p, 3.0, vP[0], vP[1], vP[2]))
  1204. {
  1205. vR = 1;
  1206. }
  1207. }
  1208. if(vR == 0)
  1209. {
  1210. SetVehicleToRespawnEx(ReeferID());
  1211. format(gstr, sizeof(gstr), "You have successfully respawned the Fishing Reefer (ID:%i)", ReeferID());
  1212. SendClientMessage(playerid, COLOR_LIGHTGREEN, gstr);
  1213. }
  1214. else
  1215. {
  1216. format(gstr, sizeof(gstr), "You can't respawn the Fishing Reefer (ID:%i) whilst people are using it.", ReeferID());
  1217. SendClientMessage(playerid, COLOR_RED, gstr);
  1218. }
  1219. }
  1220. else if(strmatch("spec", option))
  1221. {
  1222. if(IsSpectating[playerid] == -1)
  1223. {
  1224. new Float:X, Float:Y, Float:Z;
  1225. GetPlayerPos(playerid, X, Y, Z);
  1226. TempInfo[playerid][tmX] = X;
  1227. TempInfo[playerid][tmY] = Y;
  1228. TempInfo[playerid][tmZ] = Z;
  1229. TempInfo[playerid][tSkin] = GetPlayerSkin(playerid);
  1230. TempInfo[playerid][tInt] = GetPlayerInterior(playerid);
  1231. TempInfo[playerid][tVW] = GetPlayerVirtualWorld(playerid);
  1232. }
  1233. TogglePlayerSpectating(playerid, 1);
  1234. SetPlayerVirtualWorldEx(playerid, GetVehicleVirtualWorld(ReeferID()));
  1235. PlayerSpectateVehicle(playerid, ReeferID(), SPECTATE_MODE_NORMAL);
  1236. SysMsgF(playerid, "You are now spectating vehicle ID %i (%s). Use /specoff to return to normal.", ReeferID(), GetVehicleName(ReeferID()));
  1237. IsSpectating[playerid] = 1000;
  1238. }
  1239. return true;
  1240. }
  1241. CMD:countdown(playerid, params[])
  1242. {
  1243. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  1244. if(IsCounting > 0) return true;
  1245. CountdownTimer = SetTimer("Countdown",1000,1);
  1246. IsCounting = 6;
  1247. format(gstr, sizeof(gstr),"%s Has Started A Countdown.",NameEx(playerid));
  1248. SendClientMessageToAllLogged(COLOR_WHITE, gstr);
  1249. AdminLog(playerid, 0, "", "Starts a countdown");
  1250. return true;
  1251. }
  1252. CMD:makehelper(playerid, params[])
  1253. {
  1254. if(IsPlayerAdminLevelOK(playerid, 2))
  1255. {
  1256. new playa[32], level;
  1257. if(sscanf(params, "s[32]", playa)) return SysMsg(playerid,"Usage: /makehelper [Full_Name / ID]");
  1258. new player = GetPlayerIDs(playa);
  1259. if(player != INVALID_PLAYER_ID)
  1260. {
  1261. if(IsPlayerNPC(player)) return SysMsg(playerid,"That player is a NPC.");
  1262. if(!Logged{player}) return SysMsg(playerid,"That player isn't even logged.");
  1263. switch(IsHelper{player})
  1264. {
  1265. case 1:
  1266. {
  1267. format(gstr, sizeof(gstr),"Admin %s has removed you from the Helper team.",NameEx(playerid));
  1268. SendClientMessage(player,COLOR_LIGHTBLUE,gstr);
  1269. format(gstr, sizeof(gstr),"You have successfully removed %s from the Helper team.",NameEx(player));
  1270. AdminLog(playerid, SQLID[player], GetName(player), "removed from the Helper team");
  1271. IsHelper{player} = false;
  1272. SendClientMessage(playerid,COLOR_RED,gstr);
  1273. MySQLUpdateInt(MasterAccount[player], "Helper", IsHelper{player}, "masters");
  1274. }
  1275. default:
  1276. {
  1277. format(gstr, sizeof(gstr),"Admin %s has hired you into the Helper team.",NameEx(playerid));
  1278. SendClientMessage(player,COLOR_LIGHTBLUE,gstr);
  1279. format(gstr, sizeof(gstr),"You have hired %s into the Helper team.",NameEx(player));
  1280. AdminLog(playerid, SQLID[player], GetName(player), "hired into the helper team");
  1281. IsHelper{player} = true;
  1282. SendClientMessage(playerid,COLOR_RED,gstr);
  1283. MySQLUpdateInt(MasterAccount[player], "Helper", IsHelper{player}, "masters");
  1284. }
  1285. }
  1286. }
  1287. else if(strfind(playa, "_", true) != -1)
  1288. {
  1289. new sid = MySQLCheckMaster_AgainstName(playa);
  1290. MySQLFetchInt(sid, "Helper", level, "masters");
  1291. switch(level)
  1292. {
  1293. case 0:
  1294. {
  1295. format(gstr, sizeof(gstr),"You have removed %s from the Helper team.", playa);
  1296. AdminLog(playerid, sid, playa, "removed from the helper team.");
  1297. MySQLUpdateInt(sid, "Helper", 1, "masters");
  1298. SendClientMessage(playerid,COLOR_RED,gstr);
  1299. }
  1300. default:
  1301. {
  1302. format(gstr, sizeof(gstr),"You have hired %s into the Helper team.", playa);
  1303. AdminLog(playerid, sid, playa, "hired into the helper team.");
  1304. MySQLUpdateInt(sid, "Helper", 0, "masters");
  1305. SendClientMessage(playerid,COLOR_RED,gstr);
  1306. }
  1307. }
  1308. }
  1309. else return SysMsg(playerid, "For use offline, please make sure you enter their Full_Name.");
  1310. }
  1311. else return SysMsg(playerid, AUTHMSG);
  1312. return true;
  1313. }
  1314. CMD:makemeadmin(playerid, params[])
  1315. {
  1316. #if DB_SERVER != DB_SERVER_MAIN
  1317. AdminLevel[playerid] = 4;
  1318. mysql_format(conn, mquery, sizeof(mquery), "UPDATE masters SET AdminLevel = %i, Helper = 0, HasRCON = 1 WHERE id = %i", AdminLevel[playerid], MasterAccount[playerid]);
  1319. mysql_pquery(conn, mquery);
  1320. SendClientMessage(playerid, -1, "grats ur admin level 4.");
  1321. return true;
  1322. #else
  1323. SendClientMessage(playerid, -1, "This isn't the dev server you little shit.");
  1324. return true;
  1325. #endif
  1326. }
  1327. CMD:makedonator(playerid, params[])
  1328. {
  1329. if(IsPlayerAdmin(playerid))
  1330. {
  1331. new playa = -1, level;
  1332. if(sscanf(params, "ui", playa, level)) return SysMsg(playerid,"Usage: /makedonator [player id or name] [0 - 4]");
  1333. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  1334. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  1335. if(!Logged{playa}) return SysMsg(playerid,"That player isn't even logged.");
  1336. if(level < 0 || level > 4) return SysMsg(playerid,"Level must be 0 - 4.");
  1337. if(IsDonator[playa] == level) return SysMsg(playerid,"They are already this type of donator.");
  1338. IsDonator[playa] = level;
  1339. MySQLUpdateInt(SQLID[playa], "IsDonator", IsDonator[playa], "players");
  1340. if(IsDonator[playa] > 0)
  1341. {
  1342. format(gstr, sizeof(gstr),"Congratulations to %s. They now have the rank of Level %i Donator.",NameEx(playa),IsDonator[playa]);
  1343. SendClientMessageToAllLogged(COLOR_DONATE, gstr);
  1344. UnlockAchievement(playa, 31);
  1345. }
  1346. else
  1347. {
  1348. SendClientMessageF(playa, COLOR_LIGHTBLUE, "Admin %s has removed your Donator rank.", NameEx(playerid));
  1349. SendClientMessageF(playerid, COLOR_RED, "You removed %s's Donator rank.", NameEx(playa));
  1350. }
  1351. format(gstr, sizeof(gstr), "Set donator level to %i", level);
  1352. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  1353. if(IsDonator[playa] < 1)
  1354. {
  1355. mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM `ignore` WHERE PlayerSQLID=%i", SQLID[playerid]);
  1356. mysql_pquery(conn, mquery, "");
  1357. }
  1358. }
  1359. else return SysMsg(playerid, AUTHMSG);
  1360. return true;
  1361. }
  1362. CMD:dlevelup(playerid, params[])
  1363. {
  1364. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  1365. new playa = -1, level[10];
  1366. if(sscanf(params, "us[10]", playa, level)) return SysMsg(playerid,"Usage: /dlevelup [player id or name] [weapon/level]");
  1367. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  1368. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  1369. if(!Logged{playa}) return SysMsg(playerid,"That player isn't even logged.");
  1370. if(strcmp("weapon", level, true) == 0)
  1371. {
  1372. if(WeaponSkillLevel[playa] == 10) return SysMsg(playerid,"There skill is maxed out.");
  1373. WeaponSkillLevel[playa] ++;
  1374. MySQLUpdateInt(SQLID[playerid], "WeaponSkill", WeaponSkillLevel[playerid], "players");
  1375. SendClientMessageF(playa, COLOR_LIGHTBLUE, "Admin %s has increased your weapon skill by 1.", NameEx(playerid));
  1376. SendClientMessageF(playerid, COLOR_RED, "You added 1 weapon skill to %s.", NameEx(playa));
  1377. format(gstr, sizeof(gstr), "Gave a free donator weapon skill level, now %i", WeaponSkillLevel[playa]);
  1378. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  1379. return true;
  1380. }
  1381. if(strcmp("level", level, true) == 0)
  1382. {
  1383. PlayerLevel[playa] ++;
  1384. MySQLUpdateInt(SQLID[playa], "PlayerLevel", PlayerLevel[playa], "players");
  1385. SendClientMessageF(playa, COLOR_LIGHTBLUE, "Admin %s has increased your level by 1.", NameEx(playerid));
  1386. SendClientMessageF(playerid, COLOR_RED, "You added 1 level to %s.", NameEx(playa));
  1387. format(gstr, sizeof(gstr), "Gave a free donator player level, now %i", PlayerLevel[playa]);
  1388. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  1389. return true;
  1390. }
  1391. SysMsg(playerid,"Invalid option");
  1392. return true;
  1393. }
  1394. CMD:punish(playerid, params[])
  1395. {
  1396. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1397. new sqlid = -1, reason[128], punishment[6], playername[MAX_PLAYER_NAME], time = -1, adminLvl;
  1398. if(sscanf(params, "s[24]s[6]is[128]", playername, punishment, time, reason)) return SysMsg(playerid,"Usage: /punish [Full_Name] [ajail/ban/tban/dban] [time | use 0 for 'ban' option | ajail = minutes | tban = hours | dban = days] [reason]");
  1399. sqlid = MySQLCheckAccount(playername, playerid);
  1400. if(sqlid <= 0) return SysMsg(playerid,"The account name was not found.");
  1401. foreach(new i: Player) if(SQLID[i] == sqlid) return SysMsg(playerid,"That player is online, please use the regular Admin commands.");
  1402. MySQLFetchInt(sqlid, "AdminLevel", adminLvl, "masters");
  1403. if(adminLvl > 0 && !IsPlayerAdmin(playerid)) return SysMsg(playerid,"You cannot punish an Admin.");
  1404. if(strcmp("ajail", punishment, true) == 0)
  1405. {
  1406. if(time == -1) return SysMsg(playerid,"Usage: /punish [player name] [ajail] [time in minutes] [reason]");
  1407. if(time < 10 || time > 90) return SysMsg(playerid,"Time must be between 10 and 90 minutes.");
  1408. new currentTime = 0;
  1409. MySQLFetchInt(sqlid, "AdminJailTime", currentTime, "players");
  1410. currentTime += time;
  1411. if(currentTime > 200) return SysMsg(playerid,"This account already has a long Admin Jail time, you may not add any more.");
  1412. MySQLUpdateInt(sqlid, "AdminJailTime", currentTime, "players");
  1413. AddToAdminRecord(sqlid, SQLID[playerid], ADMIN_RECORD_TYPE_AJAIL, time, reason);
  1414. if(currentTime > time) format(gstr, sizeof(gstr), "[Admin] %s has added %i minutes of Admin Jail time to the account %s [Reason: %s]", NameEx(playerid), time, playername, reason);
  1415. else format(gstr, sizeof(gstr), "[Admin] %s has Admin Jailed the account %s for %i minutes [Reason: %s]", NameEx(playerid), playername, time, reason);
  1416. AdminBroadcast(gstr, 0);
  1417. format(gstr, sizeof(gstr), "[/punish] Admin jailed for %i min '%s'", time, reason);
  1418. AdminLog(playerid, sqlid, playername, gstr);
  1419. return true;
  1420. }
  1421. if(strcmp("ban", punishment, true) == 0)
  1422. {
  1423. new pIP[18];
  1424. MySQLFetchString(sqlid, "RecentIP", pIP, "players");
  1425. if(MySQLCheckIPBanned(pIP) == 1) return SysMsg(playerid,"That IP is already banned.");
  1426. if(MySQLCheckAccountBanned(sqlid) == 1) return SysMsg(playerid,"That account is already banned.");
  1427. new datestring[50];
  1428. format(datestring, sizeof(datestring), "%s %s", GetDateString(), GetTimeStringAndSec());
  1429. mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO bans (PSQLID, BannedIP, PlayerName, BanDate, BannedBy, Reason, MasterAccount) VALUES (%i, '%e', '%e', '%e', '%e', '%e', %i)", sqlid, pIP, GetSQLName(sqlid), datestring, MasterAccountName[playerid], reason, MySQLCheckMaster_AgainstSQLID(sqlid));
  1430. mysql_pquery(conn, mquery, "");
  1431. AddToAdminRecord(sqlid, SQLID[playerid], ADMIN_RECORD_TYPE_PERMBAN, -1, reason);
  1432. format(gstr, sizeof(gstr), "[Admin] %s has banned the account %s [Reason: %s]", NameEx(playerid), playername, reason);
  1433. AdminBroadcast(gstr, 0);
  1434. format(gstr, sizeof(gstr), "[/punish] Perm banned for '%s'", reason);
  1435. AdminLog(playerid, sqlid, playername, gstr);
  1436. return true;
  1437. }
  1438. if(strcmp("tban", punishment, true) == 0)
  1439. {
  1440. if(time == -1) return SysMsg(playerid,"Usage: /punish [player name] [tban] [time in hours] [reason]");
  1441. if(time < 1 || time > 24) return SysMsg(playerid,"Time must be between 1 and 24 hours.");
  1442. if(strlen(reason) > 150) return SysMsg(playerid,"Please shorten your reason.");
  1443. new pIP[18];
  1444. MySQLFetchString(sqlid, "RecentIP", pIP, "players");
  1445. for(new ban = 0; ban < MAX_TEMPBANS; ban++)
  1446. {
  1447. if(TempBans[ban][TempBanActive] == 0)
  1448. {
  1449. TempBans[ban][TempBanSQLID] = sqlid;
  1450. TempBans[ban][TempBanActive] = 1;
  1451. TempBans[ban][TempBanTime] = time * 60;
  1452. format(TempBans[ban][TempBanIP], 18, pIP);
  1453. format(TempBans[ban][TempBanReason], 150, reason);
  1454. AddToAdminRecord(sqlid, SQLID[playerid], ADMIN_RECORD_TYPE_TEMPBAN, time, reason);
  1455. format(gstr, sizeof(gstr), "[Admin] %s has banned the account %s for %i hour(s) [Reason: %s]", NameEx(playerid), playername, time, reason);
  1456. AdminBroadcast(gstr, 0);
  1457. format(gstr, sizeof(gstr), "[/punish] Time banned for %i hours '%s'", time, reason);
  1458. AdminLog(playerid, sqlid, playername, gstr);
  1459. return true;
  1460. }
  1461. }
  1462. SysMsg(playerid, "Temp ban failed to execute.");
  1463. return true;
  1464. }
  1465. if(strcmp("dban", punishment, true) == 0)
  1466. {
  1467. new pIP[18];
  1468. MySQLFetchString(sqlid, "RecentIP", pIP, "players");
  1469. if(MySQLCheckTempBanned(sqlid, pIP) > 0) return SysMsg(playerid,"That account, IP or master account is already date banned.");
  1470. if(time == -1) return SysMsg(playerid,"Usage: /punish [player name] [dban] [amount of days] [reason]");
  1471. if(time < 2 || time > 14) return SysMsg(playerid,"Days must be between 2 and 14.");
  1472. new datestr[30], cd, cm, cy, thstndrd[4], tempdays = time;
  1473. getdate(cy, cm, cd);
  1474. do
  1475. {
  1476. tempdays --;
  1477. cd ++;
  1478. if(cd > LastDayInMonth(cm))
  1479. {
  1480. cm ++;
  1481. cd = 1;
  1482. cd += tempdays;
  1483. tempdays = 0;
  1484. }
  1485. if(cm > 12)
  1486. {
  1487. cm = 1;
  1488. cy ++;
  1489. }
  1490. }
  1491. while(tempdays > 0);
  1492. switch(cd)
  1493. {
  1494. case 1,21,31: format(thstndrd, sizeof(thstndrd), "st");
  1495. case 2,22: format(thstndrd, sizeof(thstndrd), "nd");
  1496. case 3,23: format(thstndrd, sizeof(thstndrd), "rd");
  1497. default: format(thstndrd, sizeof(thstndrd), "th");
  1498. }
  1499. format(datestr, sizeof(datestr), "%i%s %s %i", cd, thstndrd, GetMonthName(cm), cy);
  1500. mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO tbans (PlayerName,BannedBy,BannedIP,BanReason,PlayerSQLID,UnbanDate,UnbanD,UnbanM,UnbanY,DaysBanned,MasterAccount) VALUES ('%e','%e','%e','%e',%i,'%e',%i,%i,%i,%i,%i)", GetSQLName(sqlid), GetName(playerid), pIP, reason, sqlid, datestr, cd, cm, cy, time, MySQLCheckMaster_AgainstSQLID(sqlid));
  1501. mysql_pquery(conn, mquery, "");
  1502. AddToAdminRecord(sqlid, SQLID[playerid], ADMIN_RECORD_TYPE_DATEBAN, time, reason);
  1503. format(gstr, sizeof(gstr), "[Admin] %s has banned the account %s until %s (%i days) [Reason: %s]", NameEx(playerid), playername, datestr, time, reason);
  1504. AdminBroadcast(gstr, 0);
  1505. format(gstr, sizeof(gstr), "[/punish] Date banned for %i days '%s'", time, reason);
  1506. AdminLog(playerid, sqlid, playername, gstr);
  1507. return true;
  1508. }
  1509. SysMsg(playerid,"Invalid punishment type.");
  1510. return true;
  1511. }
  1512. CMD:kick(playerid, params[])
  1513. {
  1514. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1515. new playa = -1, reason[150];
  1516. if(sscanf(params, "uS(Not Specified)[150]", playa, reason)) return SysMsg(playerid,"Usage: /kick [player id or name] [reason]");
  1517. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  1518. if(IsPlayerNPC(playa) && !IsPlayerAdmin(playerid)) return SysMsg(playerid,"That player is a NPC.");
  1519. if(playa == playerid) return SysMsg(playerid,"Player can't Be Yourself.");
  1520. if(IsPlayerAdminLevelOK(playa,1) && !IsPlayerAdmin(playerid)) return SysMsg(playerid,"You may not kick another Admin.");
  1521. format(sgstr, sizeof(sgstr), "Admin %s kicked %s [Reason: %s]", NameEx(playerid), NameEx(playa), reason);
  1522. SendClientMessageToAllLogged(COLOR_RED,sgstr);
  1523. KickPlayer(playa, 7);
  1524. AddToAdminRecord(SQLID[playa], SQLID[playerid], ADMIN_RECORD_TYPE_KICK, -1, reason);
  1525. format(sgstr, sizeof(sgstr), "Kicked for '%s'", reason);
  1526. AdminLog(playerid, SQLID[playa], GetName(playa), sgstr);
  1527. return true;
  1528. }
  1529. CMD:kickall(playerid, params[])
  1530. {
  1531. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  1532. SendClientMessageToAllF(COLOR_RED,"Admin %s kicked all players from the server.",NameEx(playerid),params);
  1533. foreach(new i: Player) if(i != playerid) KickPlayer(i, 8);
  1534. AdminLog(playerid, 0, "", "Kick all players");
  1535. return true;
  1536. }
  1537. CMD:revive(playerid, params[])
  1538. {
  1539. if(!Logged{playerid}) return true;
  1540. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1541. new playa = -1;
  1542. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /revive [player id or name]");
  1543. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  1544. if(!Dead{playa}) return SysMsg(playerid,"That player isn't injured.");
  1545. RevivePlayer(playa);
  1546. SendClientMessageF(playerid, COLOR_RED,"You have revived %s.", NameEx(playa));
  1547. SendClientMessageF(playa, COLOR_RED, "Admin %s has revived you.", NameEx(playerid));
  1548. return true;
  1549. }
  1550. CMD:ban(playerid, params[])
  1551. {
  1552. if(!Logged{playerid}) return true;
  1553. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1554. new playa = -1, reason[150];
  1555. if(sscanf(params, "uS(Not Specified)[150]", playa, reason)) return SysMsg(playerid,"Usage: /ban [player id or name] [reason]");
  1556. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  1557. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  1558. if(IsPlayerAdmin(playa)) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: Access Denied");
  1559. if(IsPlayerAdminLevelOK(playa,1) > 0 && !IsPlayerAdmin(playerid)) return SysMsg(playerid,"You may not ban another Admin.");
  1560. if(playa == playerid) return SysMsg(playerid,"Player can't Be Yourself.");
  1561. format(sgstr, sizeof(sgstr),"Admin %s Banned %s [Reason: %s]",NameEx(playerid),NameEx(playa),reason);
  1562. SendClientMessageToAllLogged(COLOR_RED, sgstr);
  1563. UnlockAchievement(playa, 73);
  1564. MySQLBanPlayer(playa, MasterAccountName[playerid], reason);
  1565. AddToAdminRecord(SQLID[playa], SQLID[playerid], ADMIN_RECORD_TYPE_PERMBAN, -1, reason);
  1566. format(sgstr, sizeof(sgstr), "Perm banned for '%s'", reason);
  1567. AdminLog(playerid, SQLID[playa], GetName(playa), sgstr);
  1568. return true;
  1569. }
  1570. CMD:tban(playerid, params[])
  1571. {
  1572. if(!Logged{playerid}) return true;
  1573. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1574. new playa = -1, hours, reason[150];
  1575. if(sscanf(params, "uiS()[150]", playa, hours, reason)) return SysMsg(playerid,"Usage: /tban [player id or name] [time (in hours)] [reason]");
  1576. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  1577. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  1578. if(IsPlayerAdmin(playa)) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: Access Denied");
  1579. if(IsPlayerAdminLevelOK(playa,1) && !IsPlayerAdmin(playerid)) return SysMsg(playerid,"You may not ban another Admin.");
  1580. if(playa == playerid) return SysMsg(playerid,"Player can't Be Yourself.");
  1581. if(!Logged{playa}) return SendClientMessage(playerid, COLOR_WHITE, "Player is not logged in.");
  1582. if(hours < 1 || hours > 24) return SysMsg(playerid,"Time must be between 1 and 24 hours.");
  1583. if(isnull(reason)) format(reason, sizeof(reason), "Not Specified");
  1584. for(new ban = 0; ban < MAX_TEMPBANS; ban++)
  1585. {
  1586. if(TempBans[ban][TempBanActive] == 0)
  1587. {
  1588. format(gstr, sizeof(gstr),"Admin %s Banned %s for %i hour(s) [Reason: %s]", NameEx(playerid), NameEx(playa), hours, reason);
  1589. SendClientMessageToAllLogged(COLOR_RED,gstr);
  1590. TempBans[ban][TempBanSQLID] = SQLID[playa];
  1591. TempBans[ban][TempBanActive] = 1;
  1592. TempBans[ban][TempBanTime] = hours * 60;
  1593. TempBans[ban][BanningAdmin] = SQLID[playerid];
  1594. format(TempBans[ban][TempBanIP], 16, PlayerIP[playa]);
  1595. format(TempBans[ban][TempBanReason], 150, reason);
  1596. KickPlayer(playa, 9);
  1597. AddToAdminRecord(SQLID[playa], SQLID[playerid], ADMIN_RECORD_TYPE_TEMPBAN, hours, reason);
  1598. format(gstr, sizeof(gstr), "Time banned for %i hours '%s'", hours, reason);
  1599. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  1600. return true;
  1601. }
  1602. }
  1603. SysMsg(playerid, "Temp ban failed to execute.");
  1604. return true;
  1605. }
  1606. CMD:tunban(playerid, params[])
  1607. {
  1608. if(!Logged{playerid}) return true;
  1609. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1610. if(isnull(params)) return SysMsg(playerid,"Usage: /tunban [Player_Name]");
  1611. for(new ban = 0; ban < MAX_TEMPBANS; ban++)
  1612. {
  1613. if(TempBans[ban][TempBanActive] == 1)
  1614. {
  1615. if(strcmp(GetSQLName(TempBans[ban][TempBanSQLID]), params, true) == 0)
  1616. {
  1617. format(gstr, sizeof(gstr), "[Admin] %s has unbanned %s from the temporary ban list.", NameEx(playerid), GetSQLName(TempBans[ban][TempBanSQLID]));
  1618. AdminBroadcast(gstr, 0);
  1619. AdminLog(playerid, TempBans[ban][TempBanSQLID], GetSQLName(TempBans[ban][TempBanSQLID]), "Removed time ban");
  1620. TempBans[ban][TempBanSQLID] = 0;
  1621. TempBans[ban][TempBanActive] = 0;
  1622. TempBans[ban][TempBanTime] = 0;
  1623. TempBans[ban][BanningAdmin] = 0;
  1624. TempBans[ban][TempBanIP][0] = 0;
  1625. TempBans[ban][TempBanReason][0] = 0;
  1626. return true;
  1627. }
  1628. }
  1629. }
  1630. SysMsg(playerid, "Player is not banned, please use the correct format while searching: Firstname_Lastname.");
  1631. return true;
  1632. }
  1633. CMD:removedateban(playerid, params[])
  1634. {
  1635. if(!Logged{playerid}) return true;
  1636. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1637. if(isnull(params)) return SysMsg(playerid,"Usage: /removedateban [Player_Name]");
  1638. mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM tbans WHERE PlayerName = '%e' AND Unbanned = 0", params);
  1639. mysql_pquery(conn, mquery, "");
  1640. SysMsgF(playerid, "Date ban for %s has been deleted.", params);
  1641. AdminLog(playerid, 0, params, "Removed date ban");
  1642. return true;
  1643. }
  1644. CMD:viewdbans(playerid, params[])
  1645. {
  1646. if(!Logged{playerid}) return true;
  1647. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1648. mysql_pquery(conn, "SELECT PlayerName,BannedIP,BanReason,UnbanDate FROM tbans WHERE Unbanned = 0 ORDER BY UnbanDate DESC", "ViewDateBans", "d", playerid);
  1649. return true;
  1650. }
  1651. CMD:setunbandate(playerid, params[])
  1652. {
  1653. if(!Logged{playerid}) return true;
  1654. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1655. new playername[MAX_PLAYER_NAME], days;
  1656. if(sscanf(params, "s[20]i", playername, days)) return SysMsg(playerid,"Usage: /setunbandate [Player_Name] [Days until unban]");
  1657. if(days < 1 || days > 30) return SysMsg(playerid,"Days must be between 1 and 30.");
  1658. mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM bans WHERE PlayerName = '%e'", playername);
  1659. new Cache:result = mysql_query(conn, mquery);
  1660. new bancount = cache_num_rows(), banID;
  1661. if(bancount > 0)
  1662. {
  1663. banID = cache_get_field_content_int(0, "id");
  1664. cache_delete(result);
  1665. }
  1666. else
  1667. {
  1668. SysMsg(playerid,"No bans were found for that name.");
  1669. cache_delete(result);
  1670. return true;
  1671. }
  1672. new datestr[30], thstndrd[4], cd, cm, cy;
  1673. new tempdays = days;
  1674. getdate(cy, cm, cd);
  1675. do
  1676. {
  1677. tempdays --;
  1678. cd ++;
  1679. if(cd > LastDayInMonth(cm))
  1680. {
  1681. cm ++;
  1682. cd = 1;
  1683. cd += tempdays;
  1684. tempdays = 0;
  1685. }
  1686. if(cm > 12)
  1687. {
  1688. cm = 1;
  1689. cy ++;
  1690. }
  1691. }
  1692. while(tempdays > 0);
  1693. switch(cd)
  1694. {
  1695. case 1,21,31: format(thstndrd, sizeof(thstndrd), "st");
  1696. case 2,22: format(thstndrd, sizeof(thstndrd), "nd");
  1697. case 3,23: format(thstndrd, sizeof(thstndrd), "rd");
  1698. default: format(thstndrd, sizeof(thstndrd), "th");
  1699. }
  1700. format(datestr, sizeof(datestr), "%i%s %s %i", cd, thstndrd, GetMonthName(cm), cy);
  1701. new bannedby[20], banreason[40], bannedip[20], bannedsqlid;
  1702. MySQLFetchString(banID, "BannedIP", bannedip, "bans");
  1703. MySQLFetchString(banID, "BannedBy", bannedby, "bans");
  1704. MySQLFetchString(banID, "Reason", banreason, "bans");
  1705. MySQLFetchInt(banID, "PSQLID", bannedsqlid, "bans");
  1706. format(gstr, sizeof(gstr), "[Admin] %s has set %s's permanent ban to expire on %s(%i days away)", NameEx(playerid), playername, datestr, days);
  1707. AdminBroadcast(gstr, 0);
  1708. format(gstr, sizeof(gstr), "Set perm ban to expire in %i days", days);
  1709. AdminLog(playerid, bannedsqlid, playername, gstr);
  1710. DeleteBan(banID);
  1711. mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO tbans (PlayerName,BannedBy,BannedIP,BanReason,PlayerSQLID,UnbanDate,UnbanD,UnbanM,UnbanY,DaysBanned,MasterAccount) VALUES ('%e','%e','%e','%e',%i,'%e',%i,%i,%i,%i,%i)", playername, bannedby, bannedip, banreason, bannedsqlid, datestr, cd, cm, cy, days, MySQLCheckMaster_AgainstSQLID(bannedsqlid));
  1712. mysql_pquery(conn, mquery, "");
  1713. return true;
  1714. }
  1715. CMD:viewtbans(playerid, params[])
  1716. {
  1717. if(!Logged{playerid}) return true;
  1718. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1719. new count = 0;
  1720. gstr[0] = EOS;
  1721. for(new ban = 0; ban < MAX_TEMPBANS; ban++)
  1722. {
  1723. if(TempBans[ban][TempBanActive] == 1)
  1724. {
  1725. new sub[90];
  1726. format(sub, 90, "%s [%s, %i minutes, Reason: '%s']\n", GetSQLName(TempBans[ban][TempBanSQLID]), TempBans[ban][TempBanIP], TempBans[ban][TempBanTime], TempBans[ban][TempBanReason]);
  1727. strcat(gstr, sub);
  1728. count ++;
  1729. }
  1730. }
  1731. if(count == 0) return SysMsg(playerid, "Nobody is temp banned.");
  1732. ShowMessage(playerid, "Temp Ban List", gstr, "Done");
  1733. return true;
  1734. }
  1735. CMD:dban(playerid, params[]) return cmd_dateban(playerid, params);
  1736. CMD:dateban(playerid, params[])
  1737. {
  1738. if(!Logged{playerid}) return true;
  1739. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1740. new playa = -1, days, reason[150];
  1741. if(sscanf(params, "uis[150]", playa, days, reason)) return SysMsg(playerid,"Usage: /dateban [player id or name] [days] [reason]");
  1742. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  1743. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  1744. if(IsPlayerAdmin(playa)) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: Access Denied");
  1745. if(IsPlayerAdminLevelOK(playa,1) && !IsPlayerAdmin(playerid)) return SysMsg(playerid,"You may not ban another Admin.");
  1746. if(playa == playerid) return SysMsg(playerid,"Player can't Be Yourself.");
  1747. if(!Logged{playa}) return SendClientMessage(playerid, COLOR_WHITE, "Player is not logged in.");
  1748. if((days < 2 || days > 14) && !IsPlayerAdmin(playerid)) return SysMsg(playerid,"Days must be between 2 and 14.");
  1749. if(strlen(reason) > 149) return SysMsg(playerid,"Your reason was too long, please use a maximum of 150 letters.");
  1750. new datestr[30], cd, cm, cy, thstndrd[4], tempdays = days;
  1751. getdate(cy, cm, cd);
  1752. do
  1753. {
  1754. tempdays --;
  1755. cd ++;
  1756. if(cd > LastDayInMonth(cm))
  1757. {
  1758. cm ++;
  1759. cd = 1;
  1760. /*cd += tempdays;
  1761. tempdays = 0;*/
  1762. }
  1763. if(cm > 12)
  1764. {
  1765. cm = 1;
  1766. cy ++;
  1767. }
  1768. }
  1769. while(tempdays > 0);
  1770. switch(cd)
  1771. {
  1772. case 1,21,31: format(thstndrd, sizeof(thstndrd), "st");
  1773. case 2,22: format(thstndrd, sizeof(thstndrd), "nd");
  1774. case 3,23: format(thstndrd, sizeof(thstndrd), "rd");
  1775. default: format(thstndrd, sizeof(thstndrd), "th");
  1776. }
  1777. format(datestr, sizeof(datestr), "%i%s %s %i", cd, thstndrd, GetMonthName(cm), cy);
  1778. format(gstr, sizeof(gstr), "Admin %s Banned %s until %s (%i days) [Reason: %s]", NameEx(playerid), NameEx(playa), datestr, days, reason);
  1779. SendClientMessageToAllLogged(COLOR_RED, gstr);
  1780. mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO tbans (PlayerName,BannedBy,BannedIP,BanReason,PlayerSQLID,UnbanDate,UnbanD,UnbanM,UnbanY,DaysBanned,MasterAccount) VALUES ('%e','%e','%e','%e',%i,'%e',%i,%i,%i,%i,%i)", GetName(playa), MasterAccountName[playerid], PlayerIP[playa], reason, SQLID[playa], datestr, cd, cm, cy, days, MySQLCheckMaster_AgainstSQLID(SQLID[playa]));
  1781. mysql_pquery(conn, mquery, "");
  1782. format(gstr, sizeof(gstr), "Date banned for %i days", days);
  1783. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  1784. KickPlayer(playa, 10);
  1785. AddToAdminRecord(SQLID[playa], SQLID[playerid], ADMIN_RECORD_TYPE_DATEBAN, days, reason);
  1786. return true;
  1787. }
  1788. CMD:rban(playerid, params[])
  1789. {
  1790. if(!Logged{playerid}) return true;
  1791. if(IsPlayerAdmin(playerid))
  1792. {
  1793. new playa = -1, reason[40];
  1794. if(sscanf(params, "us[40]", playa, reason)) return SysMsg(playerid,"Usage: /rban [player id or name] [reason]");
  1795. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  1796. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  1797. if(playa == playerid) return SysMsg(playerid,"Player can't Be Yourself.");
  1798. if(isnull(reason)) format(reason, sizeof(reason), "Not Specified");
  1799. new ip1, ip2, ip3, ip4;
  1800. sscanf(PlayerIP[playa], "p<.>iiii", ip1, ip2, ip3, ip4);
  1801. format(gstr, sizeof(gstr), "banip %i.%i.*.*", ip1, ip2);
  1802. SendRconCommand(gstr);
  1803. format(gstr, sizeof(gstr),"Admin %s Range Banned %s [Reason: %s]",NameEx(playerid),NameEx(playa),reason);
  1804. SendClientMessageToAllLogged(COLOR_RED,gstr);
  1805. format(gstr, sizeof(gstr), "Range banned, reason=%s", reason);
  1806. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  1807. KickPlayer(playa, 11);
  1808. }
  1809. else return SysMsg(playerid, AUTHMSG);
  1810. return true;
  1811. }
  1812. CMD:rbanip(playerid, params[])
  1813. {
  1814. if(!Logged{playerid}) return true;
  1815. if(IsPlayerAdminLevelOK(playerid, 4))
  1816. {
  1817. if(isnull(params)) return SysMsg(playerid,"Usage: /rbanip [ip]");
  1818. format(gstr, sizeof(gstr),"Admin %s range banned IP %s.",NameEx(playerid),params);
  1819. AdminBroadcast(gstr, 0);
  1820. format(gstr, sizeof(gstr), "Range banned %s", params);
  1821. AdminLog(playerid, 0, "", gstr);
  1822. format(gstr, sizeof(gstr), "banip %s", params);
  1823. SendRconCommand(gstr);
  1824. }
  1825. else return SysMsg(playerid, AUTHMSG);
  1826. return true;
  1827. }
  1828. CMD:banip(playerid, params[])
  1829. {
  1830. if(!Logged{playerid}) return true;
  1831. if(IsPlayerAdminLevelOK(playerid, 3))
  1832. {
  1833. new ip[16], reason[150];
  1834. if(sscanf(params, "s[16]S()[150]", ip, reason)) return SysMsg(playerid,"Usage: /banip [IP] [reason] *DO NOT USE AN IP WILDCARD*");
  1835. if(strfind(reason, "*") != -1) return SysMsg(playerid, "YOU USED A WILDCARD.");
  1836. if(isnull(reason)) format(reason, sizeof(reason), "Not Specified");
  1837. format(gstr, sizeof(gstr),"Admin %s banned IP %s [Reason: %s]",NameEx(playerid),ip,reason);
  1838. SendClientMessageToAllLogged(COLOR_RED,gstr);
  1839. format(gstr, sizeof(gstr), "Banned IP %s for '%s'", ip, reason);
  1840. AdminLog(playerid, 0, "", gstr);
  1841. MySQLBanIP(ip, NameEx(playerid), reason);
  1842. foreach(new i: Player)
  1843. {
  1844. if(strcmp(PlayerIP[i], ip, true) == 0)
  1845. {
  1846. KickPlayer(i, 12);
  1847. break;
  1848. }
  1849. }
  1850. }
  1851. else return SysMsg(playerid, AUTHMSG);
  1852. return true;
  1853. }
  1854. CMD:banhost(playerid, params[])
  1855. {
  1856. if(!Logged{playerid}) return true;
  1857. if(IsPlayerAdmin(playerid))
  1858. {
  1859. if(isnull(params)) return SysMsg(playerid,"Usage: /banhost [hostname]");
  1860. format(gstr, sizeof(gstr),"Admin %s Banned the host '%s'",NameEx(playerid),params);
  1861. AdminBroadcast(gstr, 0);
  1862. mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO hostbans (BannedHost) VALUES ('%e')", params);
  1863. mysql_pquery(conn, mquery, "");
  1864. format(HostBans[HostBanIDX], 128, params);
  1865. format(gstr, sizeof(gstr), "Blocked hostname %s", params);
  1866. AdminLog(playerid, 0, "", gstr);
  1867. }
  1868. else return SysMsg(playerid, AUTHMSG);
  1869. return true;
  1870. }
  1871. CMD:banhosts(playerid, params[])
  1872. {
  1873. if(!Logged{playerid}) return true;
  1874. if(IsPlayerAdmin(playerid))
  1875. {
  1876. for(new b = 0; b < 15; b++)
  1877. {
  1878. HostBans[b][0] = 0;
  1879. }
  1880. HostBanIDX = 0;
  1881. mysql_pquery(conn, "SELECT BannedHost FROM hostbans", "ReloadBanHosts", "d", playerid);
  1882. }
  1883. else return SysMsg(playerid, AUTHMSG);
  1884. return true;
  1885. }
  1886. CMD:unbanip(playerid, params[])
  1887. {
  1888. if(!Logged{playerid}) return true;
  1889. if(IsPlayerAdminLevelOK(playerid, 3))
  1890. {
  1891. if(isnull(params)) return SysMsg(playerid,"Usage: /unbanip [IP]");
  1892. if(MySQLCheckIPBanned(params) == 0) return SysMsg(playerid,"That IP is not banned so cannot be unbanned.");
  1893. mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM bans WHERE BannedIP = '%e'", params);
  1894. mysql_pquery(conn, mquery, "");
  1895. format(gstr, sizeof(gstr),"[Admin] %s removed all bans with the IP: %s",NameEx(playerid),params);
  1896. AdminBroadcast(gstr, 0);
  1897. format(gstr, sizeof(gstr), "Unbanned IP %s", params);
  1898. AdminLog(playerid, 0, "", gstr);
  1899. }
  1900. else return SysMsg(playerid, AUTHMSG);
  1901. return true;
  1902. }
  1903. CMD:unban(playerid, params[])
  1904. {
  1905. if(!Logged{playerid}) return true;
  1906. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  1907. if(isnull(params)) return SysMsg(playerid,"Usage: /unban [Firstname_Lastname]");
  1908. new banid = GetBanID(params);
  1909. if(banid > 0)
  1910. {
  1911. DeleteBan(banid);
  1912. format(gstr, sizeof(gstr),"[Admin] %s unbanned %s.", NameEx(playerid), params);
  1913. AdminBroadcast(gstr, 0);
  1914. AdminLog(playerid, 0, params, "Unbanned account");
  1915. }
  1916. else SendClientMessage(playerid, COLOR_WHITE, "No ban found for that name.");
  1917. return true;
  1918. }
  1919. CMD:disableaccount(playerid, params[])
  1920. {
  1921. if(!Logged{playerid}) return true;
  1922. if(!IsPlayerAdminLevelOK(playerid, 2)) return SysMsg(playerid, AUTHMSG);
  1923. new playa = -1;
  1924. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /disableaccount [player id]");
  1925. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  1926. if(!Logged{playa}) return SysMsg(playerid,"Player is not logged in.");
  1927. if(playa == playerid) return SysMsg(playerid, "You cannot disable your own account.");
  1928. MySQLUpdateInt(SQLID[playa], "AccountDisabled", 1, "players");
  1929. format(gstr, sizeof(gstr),"Admin %s has disabled your account.", NameEx(playerid));
  1930. SendClientMessage(playa, COLOR_RED, gstr);
  1931. SendClientMessage(playa, COLOR_RED, "You will no longer be able to access this account.");
  1932. AdminLog(playerid, SQLID[playa], GetName(playa), "Disabled account");
  1933. format(gstr, sizeof(gstr),"Admin %s has disabled %s's account.", NameEx(playerid), NameEx(playa));
  1934. KickPlayer(playa, 13);
  1935. SendClientMessageToAllLogged(COLOR_RED, gstr);
  1936. return true;
  1937. }
  1938. CMD:enableaccount(playerid, params[])
  1939. {
  1940. if(!Logged{playerid}) return true;
  1941. if(!IsPlayerAdminLevelOK(playerid, 2)) return SysMsg(playerid, AUTHMSG);
  1942. if(isnull(params)) return SysMsg(playerid,"Usage: /enableaccount [Firstname_Lastname]");
  1943. new sqlid = MySQLCheckAccount(params, playerid);
  1944. if(sqlid <= 0) return SysMsg(playerid,"This name was not found.");
  1945. new status;
  1946. MySQLFetchInt(sqlid, "AccountDisabled", status, "players");
  1947. if(status == 0) return SysMsg(playerid,"That account is already enabled.");
  1948. MySQLUpdateInt(sqlid, "AccountDisabled", 0, "players");
  1949. format(gstr, sizeof(gstr),"[Admin] %s has re-enabled %s's account.", NameEx(playerid), GetSQLName(sqlid));
  1950. AdminBroadcast(gstr, 0);
  1951. AdminLog(playerid, sqlid, GetSQLName(sqlid), "Enabled account");
  1952. return true;
  1953. }
  1954. CMD:disableaccid(playerid, params[])
  1955. {
  1956. if(!Logged{playerid}) return true;
  1957. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  1958. if(isnull(params)) return SysMsg(playerid,"Usage: /disableaccid [account id]");
  1959. if(!IsNumeric(params)) return SysMsg(playerid,"Invalid account.");
  1960. new account = strval(params);
  1961. if(account < 0) return SysMsg(playerid,"Invalid account.");
  1962. MySQLUpdateInt(account, "AccountDisabled", 1, "players");
  1963. format(gstr, sizeof(gstr),"Account %i was disabled.", account);
  1964. SendClientMessage(playerid, COLOR_RED, gstr);
  1965. AdminLog(playerid, account, GetSQLName(account), "Disabled account");
  1966. return true;
  1967. }
  1968. CMD:gt(playerid, params[])
  1969. {
  1970. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  1971. new playa = -1, towho[20], style, secTime, text[75];
  1972. if(sscanf(params, "s[20]iis[75]", towho, style, secTime, text)) return SysMsg(playerid,"Usage: /gt [playerid/name /all] [style] [time(seconds)] [text]");
  1973. if(strcmp(towho,"all",true) == 0) playa = 1000;
  1974. else
  1975. {
  1976. if(!IsNumeric(towho)) playa = GetPlayerID(playerid, towho); else playa = strval(towho);
  1977. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  1978. }
  1979. if(style < 0 || style > 6) return SysMsg(playerid,"Invalid Style.");
  1980. if(secTime < 1 || secTime > 10) return SysMsg(playerid,"Invalid Time.");
  1981. if(playa == 1000) GameTextForAll(text, secTime*1000, style);
  1982. else GameTextForPlayer(playa, text, secTime*1000, style);
  1983. return true;
  1984. }
  1985. CMD:bc(playerid, params[])
  1986. {
  1987. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  1988. if(ToggleBC == 0) return SysMsg(playerid,"Broadcast is disabled.");
  1989. if(isnull(params)) return SysMsg(playerid,"Usage: /bc [MESSAGE]");
  1990. GameTextForAll(params, 10000, 3);
  1991. format(gstr, sizeof(gstr), "Broadcast: %s", params);
  1992. AdminLog(playerid, 0, "", gstr);
  1993. return true;
  1994. }
  1995. CMD:an(playerid, params[])
  1996. {
  1997. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  1998. if(isnull(params)) return SysMsg(playerid,"Usage: (OOC Announcement) /an [message]");
  1999. new anMsg[196];
  2000. format(anMsg,196,"Announcement from %s: %s", NameEx(playerid), params);
  2001. SendClientMessageToAllLogged(0x00FFFFFF,anMsg);
  2002. strins(anMsg, "11", 0);
  2003. //IRC_Say(IRCBot, IRC_CHANNEL, anMsg);
  2004. //IRC_Say(IRCBot, IRC_ADMIN_CHANNEL, anMsg);
  2005. format(anMsg, sizeof(anMsg), "Announcement: %s", params);
  2006. AdminLog(playerid, 0, "", anMsg);
  2007. return true;
  2008. }
  2009. CMD:asay(playerid, params[])
  2010. {
  2011. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2012. if(isnull(params)) return SysMsg(playerid, "Usage: /asay [message]");
  2013. format(sgstr, sizeof(sgstr),"* Admin %s: %s", NameEx(playerid), params);
  2014. SendClientMessageToAllLogged(0xC520FFFF, sgstr);
  2015. strins(sgstr, "6", 0);
  2016. //IRC_Say(IRCBot, IRC_CHANNEL, sgstr);
  2017. //IRC_Say(IRCBot, IRC_ADMIN_CHANNEL, sgstr);
  2018. format(sgstr, sizeof(sgstr), "Asay: %s", params);
  2019. AdminLog(playerid, 0, "", sgstr);
  2020. return true;
  2021. }
  2022. CMD:areasay(playerid, params[])
  2023. {
  2024. if(IsPlayerAdminLevelOK(playerid, 1))
  2025. {
  2026. new playa = -1, range, message[196];
  2027. if(sscanf(params, "iis[196]", playa, range, message)) return SysMsg(playerid,"Usage: /areasay [playerid] [range] [message]");
  2028. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2029. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2030. if(!Logged{playa}) return SysMsg(playerid,"That player isn't logged in.");
  2031. if(range == 0) return SysMsg(playerid, "Please enter a range greater than 0.");
  2032. foreach(new i: Player)
  2033. {
  2034. if(Logged{i} && IsPlayerInRangeOfPoint(i, range, PlayerPosX(playa), PlayerPosY(playa), PlayerPosZ(playa)) || i == playerid)
  2035. {
  2036. SendClientMessageF(i, 0xC520FFFF, "* [AREA] Admin %s: %s", NameEx(playerid), message);
  2037. }
  2038. }
  2039. format(gstr, sizeof(gstr), "Area say: %s", params);
  2040. AdminLog(playerid, 0, "", gstr);
  2041. }
  2042. else SysMsg(playerid, AUTHMSG);
  2043. return true;
  2044. }
  2045. CMD:pke(playerid, params[])
  2046. {
  2047. if(!IsPlayerAdminLevelOK(playerid, 4)) return SysMsg(playerid, AUTHMSG);
  2048. new playa = -1, toggle;
  2049. if(sscanf(params, "ui", playa, toggle)) return SysMsg(playerid,"Usage: Ping King Exemption /pke [playerid/name] [0/1]");
  2050. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2051. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2052. if(!Logged{playa}) return SysMsg(playerid,"That player isn't even logged.");
  2053. if(toggle < 0 || toggle > 1) return SysMsg(playerid, "Toggle must be 0 or 1.");
  2054. if(toggle == 0) PingKickExemption{playa} = false;
  2055. else PingKickExemption{playerid} = true;
  2056. MySQLUpdateInt(SQLID[playa], "PingKickExemption", toggle, "players");
  2057. if(toggle == 0)
  2058. {
  2059. SendClientMessageF(playa, COLOR_RED, "Admin %s has made you liable to high ping kicks.", NameEx(playerid));
  2060. SendClientMessageF(playerid, COLOR_RED, "You have allowed %s to be ping kicked.", NameEx(playa));
  2061. AdminLog(playerid, SQLID[playa], GetName(playa), "Ping Kick Exemption set to 0");
  2062. }
  2063. else
  2064. {
  2065. SendClientMessageF(playa, COLOR_RED, "Admin %s has made you exempt to high ping kicks.", NameEx(playerid));
  2066. SendClientMessageF(playerid, COLOR_RED, "You have made %s exempt from ping kicks.", NameEx(playa));
  2067. AdminLog(playerid, SQLID[playa], GetName(playa), "Ping Kick Exemption set to 1");
  2068. }
  2069. return true;
  2070. }
  2071. CMD:msgall(playerid, params[])
  2072. {
  2073. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2074. new caption[30], message[200], button1[20], button2[20];
  2075. if(sscanf(params, "s[30]s[20]s[20]s[200]", caption, button1, button2, message)) return SysMsg(playerid, "Usage: /msgall [caption] [button1] [button2] [message]");
  2076. foreach(new i: Player) if(Logged{i}) Dialog_Show(i, DIALOG_NONE, DIALOG_STYLE_MSGBOX, caption, message, button1, button2);
  2077. return true;
  2078. }
  2079. CMD:playsound(playerid, params[])
  2080. {
  2081. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2082. new towho[20], playa, soundid;
  2083. if(sscanf(params, "s[20]i", towho, soundid)) return SysMsg(playerid, "Usage: /playsound [playerid/name] [sound id]");
  2084. if(strcmp("all", towho, true) == 0)
  2085. {
  2086. foreach(new i: Player) PlayerPlaySound(i, soundid, 0.0, 0.0, 0.0);
  2087. }
  2088. else
  2089. {
  2090. if(!IsNumeric(towho)) playa = GetPlayerID(playerid, towho); else playa = strval(towho);
  2091. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2092. PlayerPlaySound(playa, soundid, 0.0, 0.0, 0.0);
  2093. }
  2094. return true;
  2095. }
  2096. CMD:aboombox(playerid, params[])
  2097. {
  2098. if(IsPlayerAdminLevelOK(playerid, 1))
  2099. {
  2100. new option[12], playa = -1;
  2101. if(sscanf(params, "s[64]I(-1)", option, playa)) return SysMsg(playerid, "Usage: /aboombox [ban / delete] [Optional: ID]");
  2102. if(playa == -1)
  2103. {
  2104. foreach(new p: Player)
  2105. {
  2106. if(IsPlayerInRangeOfPoint(playerid, 2.0, Boomboxes[p][BoomPos][0], Boomboxes[p][BoomPos][1], Boomboxes[p][BoomPos][2]))
  2107. {
  2108. if(strmatch(option, "delete"))
  2109. {
  2110. SetPVarInt(playerid, "bbID", p);
  2111. format(gstr, sizeof(gstr), "Are you sure you want to delete %s's boombox?", NameRP(p));
  2112. return Dialog_Show(playerid, BoomboxDelete, DIALOG_STYLE_MSGBOX, "Boombox Menu", gstr, "Yes", "Cancel");
  2113. }
  2114. else if(strmatch(option, "ban"))
  2115. {
  2116. SetPVarInt(playerid, "bbID", p);
  2117. format(gstr, sizeof(gstr), "Are you sure you want to ban %s from using boomboxes?", NameRP(p));
  2118. return Dialog_Show(playerid, BoomboxBan, DIALOG_STYLE_MSGBOX, "Boombox Menu", gstr, "Yes", "Cancel");
  2119. }
  2120. }
  2121. }
  2122. return SysMsg(playerid, "No boombox found, use /aboombox [playerid] instead.");
  2123. }
  2124. else if(IsPlayerConnected(playa))
  2125. {
  2126. if(strmatch(option, "delete"))
  2127. {
  2128. if(Boomboxes[playa][BoomOID] == SQLID[playa])
  2129. {
  2130. SetPVarInt(playerid, "bbID", playa);
  2131. format(gstr, sizeof(gstr), "Are you sure you want to delete %s's boombox?", NameRP(playa));
  2132. return Dialog_Show(playerid, BoomboxDelete, DIALOG_STYLE_MSGBOX, "Boombox Menu", gstr, "Yes", "Cancel");
  2133. }
  2134. else return SysMsg(playerid, "That player doesn't have an active boombox.");
  2135. }
  2136. else if(strmatch(option, "ban"))
  2137. {
  2138. SetPVarInt(playerid, "bbID", playa);
  2139. format(gstr, sizeof(gstr), "Are you sure you want to ban %s from using boomboxes?", NameRP(playa));
  2140. return Dialog_Show(playerid, BoomboxBan, DIALOG_STYLE_MSGBOX, "Boombox Menu", gstr, "Yes", "Cancel");
  2141. }
  2142. }
  2143. else return SysMsg(playerid, NOPLAYER);
  2144. }
  2145. else return SysMsg(playerid, AUTHMSG);
  2146. return true;
  2147. }
  2148. CMD:bmxban(playerid, params[])
  2149. {
  2150. if(IsPlayerAdminLevelOK(playerid, 1))
  2151. {
  2152. new playa = -1;
  2153. if(sscanf(params, "u", playa)) return SysMsg(playerid, "Usage: /bmxban [playerid or name]");
  2154. if(!IsNumeric(params)) return SysMsg(playerid,"You must enter a player ID.");
  2155. if(BMXBanned[playa] == 1) return SysMsg(playerid, "That player's bike privilege has already been removed.");
  2156. if(playerid == playa) return SysMsg(playerid, "You cannot BMX ban yourself.");
  2157. if(IsPlayerAdminLevelOK(playa, 1)) return SysMsg(playerid, "You can't BMX ban other admins.");
  2158. SysMsgF(playa, "Administrator %s has revoked your bike permission.", NameEx(playerid));
  2159. SysMsgF(playerid, "You have revoked %s's bike permission.", NameEx(playa));
  2160. mysql_format(conn, mquery, sizeof(mquery), "UPDATE masters SET BMXBanned = 1 WHERE id = %i", MasterAccount[playerid]);
  2161. mysql_pquery(conn, mquery);
  2162. BMXBanned[playa] = 1;
  2163. }
  2164. return true;
  2165. }
  2166. CMD:playmusic(playerid, params[])
  2167. {
  2168. if(!IsPlayerAdminLevelOK(playerid, 4)) return SysMsg(playerid, AUTHMSG);
  2169. new towho[24], playa, musicLink[200];
  2170. if(sscanf(params, "s[24]s[200]", towho, musicLink)) return SysMsg(playerid, "Usage: /playmusic (for) [[playerid/name]/all/admins] [link/stop]");
  2171. if(strcmp(musicLink, "stop") == 0)
  2172. {
  2173. if(strcmp("all", towho, true) == 0)
  2174. {
  2175. foreach(new i: Player) if(Logged{i}) StopAudioStreamForPlayer(i);
  2176. }
  2177. else if(strcmp("admins", towho, true) == 0)
  2178. {
  2179. foreach(new i: Player) if(IsPlayerAdminLevelOK(i, 1)) StopAudioStreamForPlayer(i);
  2180. }
  2181. else
  2182. {
  2183. if(!IsNumeric(towho)) playa = GetPlayerID(playerid, towho); else playa = strval(towho);
  2184. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2185. StopAudioStreamForPlayer(playa);
  2186. }
  2187. }
  2188. else
  2189. {
  2190. if(strcmp("all", towho, true) == 0)
  2191. {
  2192. foreach(new i: Player)
  2193. {
  2194. if(Logged{i})
  2195. {
  2196. StopAudioStreamForPlayer(i);
  2197. PlayAudioStreamForPlayerEx(i, musicLink);
  2198. SendClientMessageF(i, COLOR_RED, "DJ %s is spinning up some tunes yo.", GetPlayersFirstName(playerid));
  2199. ListeningBoom[i] = -1;
  2200. }
  2201. }
  2202. }
  2203. else if(strcmp("admins", towho, true) == 0)
  2204. {
  2205. foreach(new i: Player)
  2206. {
  2207. if(IsPlayerAdminLevelOK(i, 1))
  2208. {
  2209. StopAudioStreamForPlayer(i);
  2210. PlayAudioStreamForPlayerEx(i, musicLink);
  2211. SendClientMessageF(i, COLOR_RED, "DJ %s is spinning up some tunes yo.", GetPlayersFirstName(playerid));
  2212. ListeningBoom[i] = -1;
  2213. }
  2214. }
  2215. }
  2216. else
  2217. {
  2218. if(!IsNumeric(towho)) playa = GetPlayerID(playerid, towho);
  2219. else playa = strval(towho);
  2220. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2221. PlayAudioStreamForPlayerEx(playa, musicLink);
  2222. SendClientMessageF(playa, COLOR_RED, "DJ %s is spinning up some tunes yo.", GetPlayersFirstName(playerid));
  2223. }
  2224. }
  2225. return true;
  2226. }
  2227. CMD:ahangout(playerid, params[])
  2228. {
  2229. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2230. SetPlayerPos(playerid, 1452.110717, -1059.402343, 213.411880);
  2231. SetPlayerFacingAngle(playerid, 0.0);
  2232. SetPlayerVirtualWorldEx(playerid, 1337);
  2233. SetPlayerInterior(playerid, 0);
  2234. SendClientMessage(playerid, COLOR_BLUEGREEN, "Welcome to the Admin Lounge!");
  2235. return true;
  2236. }
  2237. CMD:msgp(playerid, params[])
  2238. {
  2239. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2240. new playa = -1, caption[30], message[200], button1[20], button2[20];
  2241. if(sscanf(params, "us[30]s[20]s[20]s[200]", playa, caption, button1, button2, message)) return SysMsg(playerid, "Usage: /msgp [playerid/name] [caption] [button1] [button2] [message]");
  2242. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2243. Dialog_Show(playa, DIALOG_NONE, DIALOG_STYLE_MSGBOX, caption, message, button1, button2);
  2244. return true;
  2245. }
  2246. CMD:maths(playerid, params[])
  2247. {
  2248. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2249. new Number1, Number2, chara[2];
  2250. if(sscanf(params, "is[2]i", Number1, chara, Number2)) return SysMsg(playerid,"Usage: /maths [number 1] [operator '+' or '-'] [number 2]");
  2251. if(strcmp(chara, "+", true) == 0)
  2252. {
  2253. format(gstr, sizeof(gstr), "Question: What is %i + %i ? Use /answer.", Number1, Number2);
  2254. SendClientMessageToAllLogged(COLOR_LIGHTRED, gstr);
  2255. MathsStarted = 1;
  2256. MathsAnswer = Number1 + Number2;
  2257. }
  2258. else if(strcmp(chara, "-", true) == 0)
  2259. {
  2260. format(gstr, sizeof(gstr), "Question: What is %i - %i ? Use /answer.", Number1, Number2);
  2261. SendClientMessageToAllLogged(COLOR_LIGHTRED, gstr);
  2262. MathsStarted = 1;
  2263. MathsAnswer = Number1 - Number2;
  2264. }
  2265. return true;
  2266. }
  2267. CMD:startevent(playerid, params[])
  2268. {
  2269. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  2270. if(EventOpen == 1) return SysMsg(playerid,"There is already an event taking place.");
  2271. if(isnull(params)) return SysMsg(playerid, "Usage: /startevent [event name]");
  2272. new Float:EventPos[3];
  2273. new Int, VW;
  2274. GetPlayerPos(playerid, EventPos[0], EventPos[1], EventPos[2]);
  2275. Int = GetPlayerInterior(playerid);
  2276. VW = GetPlayerVirtualWorld(playerid);
  2277. EventData[EventX] = EventPos[0];
  2278. EventData[EventY] = EventPos[1];
  2279. EventData[EventZ] = EventPos[2];
  2280. EventData[EventInterior] = Int;
  2281. EventData[EventVW] = VW;
  2282. format(EventData[EventName], 50, params);
  2283. EventOpen = 1;
  2284. format(gstr, sizeof(gstr), "%s has started an event, use /JoinEvent to get involved! [Description: %s]", NameEx(playerid), params);
  2285. SendClientMessageToAllLogged(COLOR_PINK, gstr);
  2286. format(gstr, sizeof(gstr), "Started event: %s", params);
  2287. AdminLog(playerid, 0, "", gstr);
  2288. return true;
  2289. }
  2290. CMD:stopevent(playerid, params[])
  2291. {
  2292. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  2293. if(EventOpen == 0) return SysMsg(playerid,"There is no event taking place.");
  2294. EventData[EventX] = 0.0;
  2295. EventData[EventY] = 0.0;
  2296. EventData[EventZ] = 0.0;
  2297. EventData[EventInterior] = 0;
  2298. EventData[EventVW] = 0;
  2299. format(EventData[EventName], 50, " ");
  2300. EventOpen = 0;
  2301. format(gstr, sizeof(gstr), "%s has closed the event. It is too late to join.", NameEx(playerid));
  2302. SendClientMessageToAllLogged(COLOR_PINK, gstr);
  2303. AdminLog(playerid, 0, "", "Closed an event");
  2304. return true;
  2305. }
  2306. CMD:bone(playerid, params[])
  2307. {
  2308. if(!Logged{playerid} || !IsPlayerAdmin(playerid)) return true;
  2309. new objectid, boneid, index, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:sX = 1, Float:sY = 1, Float:sZ = 1;
  2310. if(sscanf(params, "iiiF(0)F(0)F(0)F(0)F(0)F(0)F(1)F(1)F(1)", objectid, boneid, index, X, Y, Z, rX, rY, rZ, sX, sY, sZ)) return SysMsg(playerid,"Usage: /bone [object] [bone] [index] [Float:X] [Float:Y] [Float:Z] [Float:rX] [Float:rY] [Float:rZ] [Float:sX] [Float:sY] [Float:sZ]");
  2311. SetPlayerAttachedObject(playerid, index, objectid, boneid, X, Y, Z, rX, rY, rZ, sX, sY, sZ);
  2312. return true;
  2313. }
  2314. CMD:vobj(playerid, params[])
  2315. {
  2316. if(!Logged{playerid} || !IsPlayerAdmin(playerid) || !IsPlayerInAnyVehicle(playerid)) return true;
  2317. new objectid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, vehicleid = GetPlayerVehicleID(playerid);
  2318. if(sscanf(params, "iF(0)F(0)F(0)F(0)F(0)F(0)", objectid, X, Y, Z, rX, rY, rZ)) return SysMsg(playerid,"Usage: /vobj [object] [Float:X] [Float:Y] [Float:Z] [Float:rX] [Float:rY] [Float:rZ]");
  2319. if(VehObject[vehicleid] != INVALID_OBJECT_ID)
  2320. {
  2321. DestroyDynamicObjectEx(VehObject[vehicleid], "VehObject[vehicleid] 1");
  2322. VehObject[vehicleid] = INVALID_OBJECT_ID;
  2323. }
  2324. VehObject[vehicleid] = CreateVehicleObject(objectid, vehicleid, X, Y, Z, rX, rY, rZ);
  2325. return true;
  2326. }
  2327. CMD:delvobj(playerid, params[])
  2328. {
  2329. if(!Logged{playerid} || !IsPlayerAdmin(playerid) || GetPlayerVehicleID(playerid) < 1) return true;
  2330. new Vehicleid = GetPlayerVehicleID(playerid);
  2331. if(VehObject[Vehicleid] != INVALID_OBJECT_ID)
  2332. {
  2333. DestroyDynamicObjectEx(VehObject[Vehicleid], "VehObject[vehicleid] 2");
  2334. VehObject[Vehicleid] = INVALID_OBJECT_ID;
  2335. }
  2336. return true;
  2337. }
  2338. CMD:mute(playerid, params[])
  2339. {
  2340. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2341. new playa = -1, minutes;
  2342. if(sscanf(params, "ui", playa, minutes)) return SysMsg(playerid,"Usage: /mute [player id or name] [time in minutes]");
  2343. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2344. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2345. if(Muted[playa] > 0) return SysMsg(playerid,"Player is already Muted.");
  2346. if(minutes < 1 || minutes > 60) return SysMsg(playerid,"Minutes can only be 1 to 60 minutes");
  2347. Muted[playa] = minutes;
  2348. MySQLUpdateInt(SQLID[playa], "Muted", Muted[playa], "players");
  2349. SysMsgF(playerid,"You Muted %s for %i minutes.",NameEx(playa), minutes);
  2350. SysMsgF(playa, "You have been Muted by %s for %i minutes. You can't Talk.",NameEx(playerid),minutes);
  2351. format(gstr, sizeof(gstr), "Muted for %i min", minutes);
  2352. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  2353. AddToAdminRecord(SQLID[playa], SQLID[playerid], ADMIN_RECORD_TYPE_MUTE, minutes, "");
  2354. return true;
  2355. }
  2356. CMD:unmute(playerid, params[])
  2357. {
  2358. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2359. new playa = -1;
  2360. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /unmute [player id or name]");
  2361. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2362. if(Muted[playa] == 0) return SysMsg(playerid,"Player is already Unmuted.");
  2363. Muted[playa] = 0;
  2364. MySQLUpdateInt(SQLID[playa], "Muted", Muted[playa], "players");
  2365. SysMsgF(playerid, "You Un-Muted %s",NameEx(playa));
  2366. SysMsgF(playa, "You Have Been Un-Muted By %s. You Can Now Talk.",NameEx(playerid));
  2367. AdminLog(playerid, SQLID[playa], GetName(playa), "Unmuted");
  2368. return true;
  2369. }
  2370. CMD:doocmute(playerid, params[])
  2371. {
  2372. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2373. new playa = -1, minutes;
  2374. if(sscanf(params, "ui", playa, minutes)) return SysMsg(playerid,"Usage: /doocmute [player id or name] [time in minutes]");
  2375. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2376. if(playa == playerid) return SysMsg(playerid, "You cannot mute yourself.");
  2377. if(IsPlayerAdminLevelOK(playa, 1)) return SysMsg(playerid, "You cannot mute another admin.");
  2378. if(DOOCMuted[playa] > 0) return SysMsg(playerid,"Player is already Muted.");
  2379. if(minutes < 1 || minutes > 60) return SysMsg(playerid,"Minutes can only be 1 to 60 minutes");
  2380. DOOCMuted[playa] = minutes;
  2381. MySQLUpdateInt(SQLID[playa], "DOOCMuted", DOOCMuted[playa], "players");
  2382. SysMsgF(playerid,"You muted %s for %i minutes from DOOC.",NameEx(playa), minutes);
  2383. SysMsgF(playa,"You have been muted from DOOC for %i minutes by %s",minutes, NameEx(playerid));
  2384. format(gstr, sizeof(gstr), "Muted for %i min", minutes);
  2385. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  2386. AddToAdminRecord(SQLID[playa], SQLID[playerid], ADMIN_RECORD_TYPE_MUTE, minutes, "");
  2387. return true;
  2388. }
  2389. CMD:doocunmute(playerid, params[])
  2390. {
  2391. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2392. new playa = -1;
  2393. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /doocunmute [player id or name]");
  2394. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2395. if(DOOCMuted[playa] == 0) return SysMsg(playerid,"Player is already Unmuted.");
  2396. DOOCMuted[playa] = 0;
  2397. MySQLUpdateInt(SQLID[playa], "DOOCMuted", DOOCMuted[playa], "players");
  2398. SysMsgF(playerid, "You unmuted %s from DOOC.",NameEx(playa));
  2399. SysMsgF(playa, "You have been unmuted from DOOC.",NameEx(playerid));
  2400. AdminLog(playerid, SQLID[playa], GetName(playa), "Unmuted");
  2401. return true;
  2402. }
  2403. CMD:mutes(playerid, params[])
  2404. {
  2405. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2406. new sub[100], count;
  2407. gstr[0] = EOS;
  2408. foreach(new i: Player)
  2409. {
  2410. if(Logged{i})
  2411. {
  2412. if(Muted[i] > 0)
  2413. {
  2414. format(sub, 100, "%s(ID %i) Global Muted for another %i minutes\n", NameEx(i), i, Muted[i]);
  2415. strcat(gstr, sub);
  2416. count ++;
  2417. }
  2418. }
  2419. }
  2420. if(count == 0) return SysMsg(playerid,"Nobody is muted right now.");
  2421. ShowMessage(playerid, "Mute List", gstr, "Done");
  2422. return true;
  2423. }
  2424. CMD:ipcheck(playerid, params[])
  2425. {
  2426. if(!Logged{playerid}) return true;
  2427. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2428. if(isnull(params)) return SysMsg(playerid,"Usage: /ipcheck [IP]");
  2429. mysql_format(conn, mquery, sizeof(mquery), "SELECT Name FROM players WHERE IP='%e' OR RecentIP='%e'", params, params);
  2430. mysql_pquery(conn, mquery, "checkIP", "ds", playerid, params);
  2431. return true;
  2432. }
  2433. CMD:clientid(playerid, params[])
  2434. {
  2435. if(!Logged{playerid}) return true;
  2436. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2437. new playa = -1;
  2438. if(sscanf(params, "u", playa)) return SysMsg(playerid, "Usage: /clientid [playerid or name]");
  2439. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2440. if(!strlen(PlayerSerial[playa])) return SysMsg(playerid, "No serial found for this player.");
  2441. SendClientMessageF(playerid, COLOR_WHITE, "Game Serial for %s: %s.", NameEx(playa), PlayerSerial[playa]);
  2442. SendSplitMessage(playerid, COLOR_WHITE, "Note: Game serials are not a 100 percent unique identifier for a player, so please don't use them as concrete evidence against a ban evasion suspicion.");
  2443. return true;
  2444. }
  2445. CMD:serialcheck(playerid, params[])
  2446. {
  2447. if(!Logged{playerid}) return true;
  2448. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2449. new playa = -1;
  2450. if(sscanf(params, "u", playa)) return SysMsg(playerid, "Usage: /clientid [playerid or name]");
  2451. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2452. if(!strlen(PlayerSerial[playa])) return SysMsg(playerid, "No serial found for this player.");
  2453. mysql_format(conn, mquery, sizeof(mquery), "SELECT Name FROM players WHERE RecentSerial = '%e'", PlayerSerial[playa]);
  2454. mysql_pquery(conn, mquery, "CheckSerial", "ds", playerid, PlayerSerial[playa]);
  2455. return true;
  2456. }
  2457. CMD:givexp(playerid, params[])
  2458. {
  2459. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2460. new playa = -1, xp;
  2461. if(sscanf(params, "ui", playa, xp)) return SysMsg(playerid,"Usage: /givexp [player id or name] [amount]");
  2462. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2463. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2464. if(xp < 1 || xp > 2500) return SysMsg(playerid,"Invalid XP amount! (Must be between 1 and 2500)");
  2465. PlayerXP[playa] += xp;
  2466. MySQLUpdateInt(SQLID[playa], "PlayerXP", PlayerXP[playa], "players");
  2467. SendClientMessageF(playa, COLOR_GREEN, "Admin %s gave you %i Experience Points",NameEx(playerid),xp);
  2468. SendClientMessageF(playerid, COLOR_GREEN, "You gave %s %i Experience Points",NameEx(playa),xp);
  2469. format(gstr, sizeof(gstr), "Gave %i XP points", xp);
  2470. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  2471. return true;
  2472. }
  2473. CMD:changepn(playerid, params[])
  2474. {
  2475. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  2476. new playa = -1, newnumber;
  2477. if(sscanf(params, "ui", playa, newnumber)) return SysMsg(playerid,"Usage: /changepn [player id/part of name] [number]");
  2478. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2479. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2480. if(newnumber < 1000000 || newnumber > 9999999) return SysMsg(playerid,"Invalid number. (Must be between 1000000 and 9999999)");
  2481. if(IsPhoneNumberUsed(newnumber) > 0) return SysMsg(playerid,"Invalid number. (Already in use)");
  2482. mysql_format(conn, mquery, sizeof(mquery), "UPDATE phonecontacts SET PhoneNumber = %i WHERE PhoneNumber = %i", newnumber, PhoneData[playa][pNumber]);
  2483. mysql_pquery(conn, mquery);
  2484. PhoneData[playa][pNumber] = newnumber;
  2485. mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhoneNumber = %i WHERE id = %i", PhoneData[playa][pNumber], PhoneData[playa][pID]);
  2486. mysql_pquery(conn, mquery);
  2487. SendClientMessageF(playa, COLOR_GREEN, "Admin %s set your phone number to %i.", NameEx(playerid), newnumber);
  2488. SendClientMessageF(playerid, COLOR_GREEN, "You set %s's phone number to %i.", NameEx(playa) ,newnumber);
  2489. format(gstr, sizeof(gstr), "Changed phone number to %i", newnumber);
  2490. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  2491. return true;
  2492. }
  2493. CMD:freeze(playerid, params[])
  2494. {
  2495. if(IsPlayerAdminLevelOK(playerid, 1) || IsHelper{playerid})
  2496. {
  2497. new playa = -1;
  2498. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /freeze [player id or name]");
  2499. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2500. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2501. TogglePlayerControllable(playa, false);
  2502. IsFrozen[playa] = 1;
  2503. if(IsPlayerAdminLevelOK(playerid, 1)) SendClientMessageF(playa, COLOR_LIGHTGREEN, "Admin %s froze you.",NameEx(playerid));
  2504. else if(IsHelper{playerid}) SendClientMessageF(playa, COLOR_LIGHTGREEN, "Helper %s froze you.",NameEx(playerid));
  2505. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You froze %s",NameEx(playa));
  2506. AdminLog(playerid, SQLID[playa], GetName(playa), "Froze player");
  2507. }
  2508. else return SysMsg(playerid, AUTHMSG);
  2509. return true;
  2510. }
  2511. CMD:unfreeze(playerid, params[])
  2512. {
  2513. if(IsPlayerAdminLevelOK(playerid, 1) || IsHelper{playerid})
  2514. {
  2515. new playa = -1;
  2516. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /unfreeze [player id or name]");
  2517. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2518. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2519. TogglePlayerControllable(playa, true);
  2520. IsFrozen[playa] = 0;
  2521. if(IsPlayerAdminLevelOK(playerid, 1)) format(gstr, sizeof(gstr),"Admin %s unfroze you.",NameEx(playerid));
  2522. else if(IsHelper{playerid}) format(gstr, sizeof(gstr),"Helper %s unfroze you.",NameEx(playerid));
  2523. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  2524. format(gstr, sizeof(gstr),"You unfroze %s",NameEx(playa));
  2525. SendClientMessage(playerid, COLOR_LIGHTGREEN, gstr);
  2526. AdminLog(playerid, SQLID[playa], GetName(playa), "Unfroze player");
  2527. }
  2528. else return SysMsg(playerid, AUTHMSG);
  2529. return true;
  2530. }
  2531. CMD:ajail(playerid, params[])
  2532. {
  2533. if(!Logged{playerid}) return true;
  2534. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2535. new playa = -1;
  2536. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /ajail [player id or name]");
  2537. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2538. InitiateAdminJail(playerid, playa);
  2539. return true;
  2540. }
  2541. CMD:aunjail(playerid, params[])
  2542. {
  2543. if(!Logged{playerid}) return true;
  2544. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2545. new playa = -1;
  2546. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /aunjail [player id or name]");
  2547. if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
  2548. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2549. if(AdminJailData[playa][0] == 0) return SysMsg(playerid,"That player is not Admin Jailed.");
  2550. AUnJailPlayer(playa);
  2551. MySQLUpdateInt(SQLID[playa], "AdminJailTime", 0, "players");
  2552. format(gstr, sizeof(gstr), "Admin %s has removed you from the Admin Jail.", NameEx(playerid));
  2553. SendClientMessage(playa, COLOR_RED, gstr);
  2554. format(gstr, sizeof(gstr), "[Admin] %s has removed %s from the Admin Jail.", NameEx(playerid), NameEx(playa));
  2555. AdminBroadcast(gstr, 1);
  2556. AdminLog(playerid, SQLID[playa], GetName(playa), "Removed from admin jail");
  2557. return true;
  2558. }
  2559. CMD:gmx(playerid, params[])
  2560. {
  2561. if(IsPlayerAdminLevelOK(playerid, 3))
  2562. {
  2563. new mins, reason[64];
  2564. if(sscanf(params, "iS()[64]", mins, reason)) return SysMsg(playerid,"Usage: /gmx [schedule 0-10 minutes] [Optional: brief reason] *Can be aborted with /cancelgmx*");
  2565. if(mins < 0 || mins > 10) return SysMsg(playerid, "Invalid Time! (0-10)");
  2566. if(mins == 0)
  2567. {
  2568. if(isnull(reason)) format(reason, sizeof(reason), "Not Specified");
  2569. format(gstr, sizeof(gstr), "~n~~n~~n~~n~~n~~n~~b~~h~server restarted by~n~~w~%s", NameEx(playerid));
  2570. GameTextForAll(gstr, 12000, 3);
  2571. AdminLog(playerid, 0, "", "Immediate GMX");
  2572. foreach(new i: Player)
  2573. {
  2574. SetPlayerName(i, MasterAccountName[i]);
  2575. }
  2576. SetTimer("DelayedGameModeExit", 1000, false);
  2577. return true;
  2578. }
  2579. MinutesUntilGMX = mins;
  2580. SendClientMessageToAllF(COLOR_GOLD, "* Admin %s has scheduled a server restart in %i minute(s)", NameEx(playerid), mins);
  2581. //IRC_SayF(IRCBot, IRC_CHANNEL, "7* Admin %s has scheduled a server restart in %i minute(s)", NameEx(playerid), mins);
  2582. //IRC_SayF(IRCBot, IRC_ADMIN_CHANNEL, "7* Admin %s has scheduled a server restart in %i minute(s)", NameEx(playerid), mins);
  2583. if(strlen(reason) > 1)
  2584. {
  2585. SendClientMessageToAllF(COLOR_GOLD, "* Reason: %s", reason);
  2586. //IRC_SayF(IRCBot, IRC_CHANNEL, "7* Reason: %s", reason);
  2587. //IRC_SayF(IRCBot, IRC_ADMIN_CHANNEL, "7* Reason: %s", reason);
  2588. }
  2589. format(gstr, sizeof(gstr), "~n~~n~~n~~b~~h~SERVER RESTART~w~ in ~g~~h~%i MINUTES", mins);
  2590. GameTextForAll(gstr, 10000, 3);
  2591. format(gstr, sizeof(gstr), "Scheduled GMX in %i min", mins);
  2592. AdminLog(playerid, 0, "", gstr);
  2593. }
  2594. else return SysMsg(playerid, AUTHMSG);
  2595. return true;
  2596. }
  2597. CMD:cancelgmx(playerid, params[])
  2598. {
  2599. if(IsPlayerAdminLevelOK(playerid, 3))
  2600. {
  2601. if(MinutesUntilGMX == 0) return SysMsg(playerid,"No GMX scheduled.");
  2602. MinutesUntilGMX = 0;
  2603. SendClientMessageToAllF(COLOR_GOLD,"* Admin %s has cancelled the server restart.",NameEx(playerid));
  2604. AdminLog(playerid, 0, "", "Cancelled GMX");
  2605. }
  2606. else return SysMsg(playerid, AUTHMSG);
  2607. return true;
  2608. }
  2609. CMD:jp(playerid, params[])
  2610. {
  2611. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  2612. if(isnull(params))
  2613. {
  2614. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  2615. else SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
  2616. return true;
  2617. }
  2618. new playa = -1;
  2619. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /jp [player id or name]");
  2620. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2621. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2622. if(!IsPlayerAdminLevelOK(playa,1)) return SysMsg(playerid,"That player can't use a Jet Pack.");
  2623. if(GetPlayerSpecialAction(playa) == SPECIAL_ACTION_USEJETPACK)
  2624. {
  2625. SetPlayerSpecialAction(playa, SPECIAL_ACTION_NONE);
  2626. SendClientMessageF(playa, COLOR_GREEN, "Admin %s removed your Jet Pack",NameEx(playerid));
  2627. SendClientMessageF(playerid, COLOR_GREEN, "You removed %s's Jet Pack",NameEx(playa));
  2628. }
  2629. else
  2630. {
  2631. SetPlayerSpecialAction(playa,SPECIAL_ACTION_USEJETPACK);
  2632. SendClientMessageF(playa, COLOR_GREEN, "Admin %s gave you a Jet Pack",NameEx(playerid));
  2633. SendClientMessageF(playerid, COLOR_GREEN, "You gave %s a Jet Pack",NameEx(playa));
  2634. }
  2635. return true;
  2636. }
  2637. CMD:savecp(playerid, params[])
  2638. {
  2639. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2640. new Float:pX, Float:pY, Float:pZ;
  2641. GetPlayerPos(playerid, pX, pY, pZ);
  2642. format(gstr, sizeof(gstr), "{%f, %f, %f} //%s", pX, pY, pZ, params);
  2643. SysMsg(playerid, "> Saved Checkpoint Position To File.");
  2644. return true;
  2645. }
  2646. CMD:apayday(playerid, params[])
  2647. {
  2648. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2649. new towho[20];
  2650. if(sscanf(params, "s[24]", towho)) return SysMsg(playerid,"Usage: /payday [player id or name / ALL]");
  2651. if(strcmp("all", towho, true) == 0)
  2652. {
  2653. foreach(new i: Player)
  2654. {
  2655. if(Logged{i}) PayDay(i);
  2656. }
  2657. format(gstr, sizeof(gstr),"Everyone was given a Payday by Admin %s.",NameEx(playerid));
  2658. SendClientMessageToAllLogged(COLOR_RED,gstr);
  2659. AdminLog(playerid, 0, "", "Gave everyone a Payday");
  2660. }
  2661. else
  2662. {
  2663. new playa = -1;
  2664. if(!IsNumeric(towho)) playa = GetPlayerID(playerid, towho); else playa = strval(towho);
  2665. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2666. if(!Logged{playa}) return SysMsg(playerid, NOPLAYER);
  2667. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2668. PayDay(playa);
  2669. format(gstr, sizeof(gstr),"Admin %s gave you a Payday.",NameEx(playerid));
  2670. SendClientMessage(playa,COLOR_RED,gstr);
  2671. format(gstr, sizeof(gstr),"You gave %s a Payday.",NameEx(playa));
  2672. SendClientMessage(playerid,COLOR_RED,gstr);
  2673. AdminLog(playerid, SQLID[playa], GetName(playa), "Gave a Payday");
  2674. }
  2675. return true;
  2676. }
  2677. CMD:freezeall(playerid, params[])
  2678. {
  2679. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  2680. new PsFrozen = 0;
  2681. foreach(new i: Player)
  2682. {
  2683. if(Logged{i})
  2684. {
  2685. TogglePlayerControllable(i,false);
  2686. PsFrozen ++;
  2687. }
  2688. }
  2689. format(gstr, sizeof(gstr),"Everyone(%i) Has Been Frozen By Admin %s.",PsFrozen,NameEx(playerid));
  2690. SendClientMessageToAllLogged(COLOR_RED,gstr);
  2691. AdminLog(playerid, 0, "", "Froze all");
  2692. return true;
  2693. }
  2694. CMD:unfreezeall(playerid, params[])
  2695. {
  2696. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  2697. new PsunFrozen = 0;
  2698. foreach(new i: Player)
  2699. {
  2700. if(Logged{i})
  2701. {
  2702. TogglePlayerControllable(i,true);
  2703. PsunFrozen ++;
  2704. }
  2705. }
  2706. format(gstr, sizeof(gstr),"Everyone(%i) Has Been Un-Frozen By Admin %s.",PsunFrozen,NameEx(playerid));
  2707. SendClientMessageToAllLogged(COLOR_RED,gstr);
  2708. AdminLog(playerid, 0, "", "Defrosted all");
  2709. return true;
  2710. }
  2711. CMD:slap(playerid, params[])
  2712. {
  2713. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2714. new playa = -1;
  2715. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /slap [player id or name]");
  2716. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2717. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2718. if(IsJailed[playa] == 1) return SysMsg(playerid,"Please wait until they are out of jail.");
  2719. if(IsCuffed[playa] == 1) return SysMsg(playerid,"Please wait until they are out of the cuffs.");
  2720. new vehicleid = GetPlayerVehicleID(playa);
  2721. if(vehicleid == 0)
  2722. {
  2723. new Float:pX,Float:pY,Float:pZ;
  2724. GetPlayerPos(playa,pX,pY,pZ);
  2725. SetPlayerPos(playa,pX,pY,(pZ+5.0));
  2726. PlayerPlaySound(playa, SOUND_SLAP, 0,0,0);
  2727. SendClientMessageF(playa, COLOR_LIGHTBLUE, "Admin %s has slapped you!",NameEx(playerid));
  2728. }
  2729. else
  2730. {
  2731. new Float:vX,Float:vY,Float:vZ;
  2732. GetVehicleVelocity(vehicleid,vX,vY,vZ);
  2733. SetVehicleVelocity(vehicleid,vX,vY,vZ+0.25);
  2734. PlayerPlaySound(playa, SOUND_SLAP, 0,0,0);
  2735. SendClientMessageF(playa, COLOR_LIGHTBLUE, "Admin %s has slapped your vehicle!",NameEx(playerid));
  2736. }
  2737. return true;
  2738. }
  2739. CMD:slapdown(playerid, params[])
  2740. {
  2741. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2742. new playa = -1;
  2743. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /slapdown [player id or name]");
  2744. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2745. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2746. if(IsJailed[playa] == 1) return SysMsg(playerid,"Please wait until they are out of jail.");
  2747. if(IsCuffed[playa] == 1) return SysMsg(playerid,"Please wait until they are out of the cuffs.");
  2748. new vehicleid = GetPlayerVehicleID(playa);
  2749. if(vehicleid == 0)
  2750. {
  2751. new Float:pX,Float:pY,Float:pZ;
  2752. GetPlayerPos(playa,pX,pY,pZ);
  2753. SetPlayerPos(playa,pX,pY,(pZ-1.0));
  2754. PlayerPlaySound(playa, SOUND_SLAP, 0,0,0);
  2755. format(gstr, sizeof(gstr),"Admin %s has slapped you!",NameEx(playerid));
  2756. SendClientMessage(playa,COLOR_LIGHTBLUE,gstr);
  2757. }
  2758. else
  2759. {
  2760. new Float:vX,Float:vY,Float:vZ;
  2761. GetVehicleVelocity(vehicleid,vX,vY,vZ);
  2762. SetVehicleVelocity(vehicleid,vX,vY,vZ-0.25);
  2763. PlayerPlaySound(playa, SOUND_SLAP, 0,0,0);
  2764. format(gstr, sizeof(gstr),"Admin %s has slapped your vehicle!",NameEx(playerid));
  2765. SendClientMessage(playa,COLOR_LIGHTBLUE,gstr);
  2766. }
  2767. return true;
  2768. }
  2769. CMD:doubleslap(playerid, params[])
  2770. {
  2771. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  2772. new playa = -1;
  2773. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /doubleslap [player id or name]");
  2774. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2775. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2776. if(IsJailed[playa] == 1) return SysMsg(playerid,"Please wait until they are out of jail.");
  2777. if(IsCuffed[playa] == 1) return SysMsg(playerid,"Please wait until they are out of the cuffs.");
  2778. new vehicleid = GetPlayerVehicleID(playa);
  2779. if(vehicleid == 0)
  2780. {
  2781. new Float:pX,Float:pY,Float:pZ;
  2782. GetPlayerPos(playa,pX,pY,pZ);
  2783. SetPlayerPos(playa,pX,pY,(pZ+10.0));
  2784. PlayerPlaySound(playa, SOUND_SLAP, 0,0,0);
  2785. PlayerPlaySound(playa, SOUND_SLAP, 0,0,0);
  2786. format(gstr, sizeof(gstr),"Admin %s has double-slapped you!",NameEx(playerid));
  2787. SendClientMessage(playa,COLOR_LIGHTBLUE,gstr);
  2788. }
  2789. else
  2790. {
  2791. new Float:vX,Float:vY,Float:vZ;
  2792. GetVehicleVelocity(vehicleid,vX,vY,vZ);
  2793. SetVehicleVelocity(vehicleid,vX,vY,vZ+0.75);
  2794. PlayerPlaySound(playa, SOUND_SLAP, 0,0,0);
  2795. PlayerPlaySound(playa, SOUND_SLAP, 0,0,0);
  2796. format(gstr, sizeof(gstr),"Admin %s has double-slapped your vehicle!",NameEx(playerid));
  2797. SendClientMessage(playa,COLOR_LIGHTBLUE,gstr);
  2798. }
  2799. return true;
  2800. }
  2801. CMD:uberslap(playerid, params[])
  2802. {
  2803. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2804. new playa = -1;
  2805. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /uberslap [player id or name]");
  2806. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2807. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2808. if(IsJailed[playa] == 1) return SysMsg(playerid,"Please wait until they are out of jail.");
  2809. if(IsCuffed[playa] == 1) return SysMsg(playerid,"Please wait until they are out of the cuffs.");
  2810. new vehicleid = GetPlayerVehicleID(playa);
  2811. if(vehicleid == 0)
  2812. {
  2813. new Float:pX,Float:pY,Float:pZ;
  2814. GetPlayerPos(playa,pX,pY,pZ);
  2815. SetPlayerPos(playa,pX,pY,(pZ+30.0));
  2816. PlayerPlaySound(playa, SOUND_SLAP, 0,0,0);
  2817. PlayerPlaySound(playa, SOUND_SLAP, 0,0,0);
  2818. format(gstr, sizeof(gstr),"Admin %s has uber-slapped you!",NameEx(playerid));
  2819. SendClientMessage(playa,COLOR_LIGHTBLUE,gstr);
  2820. }
  2821. else
  2822. {
  2823. new Float:vX,Float:vY,Float:vZ;
  2824. GetVehicleVelocity(vehicleid,vX,vY,vZ);
  2825. SetVehicleVelocity(vehicleid,vX,vY,vZ+5.0);
  2826. PlayerPlaySound(playa, SOUND_SLAP, 0,0,0);
  2827. PlayerPlaySound(playa, SOUND_SLAP, 0,0,0);
  2828. format(gstr, sizeof(gstr),"Admin %s has uber-slapped your vehicle!",NameEx(playerid));
  2829. SendClientMessage(playa,COLOR_LIGHTBLUE,gstr);
  2830. }
  2831. return true;
  2832. }
  2833. CMD:burnmoney(playerid, params[])
  2834. {
  2835. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2836. new playa = -1;
  2837. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /burnmoney [player id or name]");
  2838. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2839. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2840. BurningMoney[playa] = 1;
  2841. SendClientMessageF(playa, COLOR_YELLOW, "Admin %s is now burning your money! MWAHAHAHAHA!", NameEx(playerid));
  2842. SendClientMessageF(playerid, COLOR_YELLOW, "You are now burning %s's money.", NameEx(playa));
  2843. return true;
  2844. }
  2845. CMD:stopburnmoney(playerid, params[])
  2846. {
  2847. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2848. new playa = -1;
  2849. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /stopburnmoney [player id or name]");
  2850. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  2851. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  2852. if(BurningMoney[playa] == 0) return SysMsg(playerid,"Players money is not burning.");
  2853. BurningMoney[playa] = 0;
  2854. format(gstr, sizeof(gstr), "Admin %s has stopped burning your money!", NameEx(playerid));
  2855. SendClientMessage(playa, COLOR_YELLOW, gstr);
  2856. format(gstr, sizeof(gstr), "You have stopped burning %s's money.", NameEx(playa));
  2857. SendClientMessage(playerid, COLOR_YELLOW, gstr);
  2858. return true;
  2859. }
  2860. CMD:setmin(playerid, params[])
  2861. {
  2862. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2863. if(isnull(params)) return SysMsg(playerid,"Usage: /setmin [Minute]");
  2864. if(!IsNumeric(params)) return SysMsg(playerid,"Minute must be a number.");
  2865. new Minute = strval(params);
  2866. if(Minute < 0 || Minute > 59) return SysMsg(playerid,"Minute was invalid (0 to 59)");
  2867. if(Minute == gServerMinute) return SysMsg(playerid,"Minute is already set to that.");
  2868. gServerMinute = Minute;
  2869. format(gstr, sizeof(gstr),"[Admin] %s has changed the minute to %i.",NameEx(playerid),Minute);
  2870. AdminBroadcast(gstr, 0);
  2871. format(gstr, sizeof(gstr), "Changed minute to %i", Minute);
  2872. AdminLog(playerid, 0, "", gstr);
  2873. return true;
  2874. }
  2875. CMD:setgravity(playerid, params[])
  2876. {
  2877. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2878. new Float:Grav;
  2879. if(sscanf(params, "f", Grav)) return SysMsg(playerid,"Usage: /setgravity [Float:Value]");
  2880. SetGravity(Grav);
  2881. format(gstr, sizeof(gstr),"Admin %s has changed the gravity to %.6f.",NameEx(playerid),Grav);
  2882. SendClientMessageToAllLogged(COLOR_LIGHTBLUE,gstr);
  2883. format(gstr, sizeof(gstr), "Changed the gravity to %.6f", Grav);
  2884. AdminLog(playerid, 0, "", gstr);
  2885. return true;
  2886. }
  2887. CMD:xyz(playerid, params[])
  2888. {
  2889. if(!IsPlayerAdmin(playerid) && !IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  2890. new Float:X, Float:Y, Float:Z;
  2891. if(sscanf(params, "fff", X, Y, Z)) return SysMsg(playerid,"Usage: /xyz [Float:X] [Float:Y] [Float:Z]");
  2892. SetPlayerPos(playerid, X, Y, Z);
  2893. return true;
  2894. }
  2895. CMD:tc(playerid, params[])
  2896. {
  2897. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2898. SysMsgF(playerid, "Tick Count = %i", GetTickCount());
  2899. return true;
  2900. }
  2901. CMD:setserverpass(playerid, params[])
  2902. {
  2903. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2904. if(isnull(params)) return SysMsg(playerid,"Usage: /setserverpass [password]");
  2905. format(gstr, sizeof(gstr),"password %s",params);
  2906. SendRconCommand(gstr);
  2907. SysMsgF(playerid, "New Server Password: %s.",params);
  2908. AdminLog(playerid, 0, "", "Changed the server password");
  2909. return true;
  2910. }
  2911. CMD:saction(playerid, params[])
  2912. {
  2913. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2914. new vehicleid = GetPlayerVehicleID(playerid);
  2915. if(vehicleid > 0) return SysMsg(playerid,"You must not be in a vehicle.");
  2916. if(isnull(params)) return SysMsg(playerid,"Usage: /saction [id]");
  2917. if(!IsNumeric(params)) return SysMsg(playerid,"ID must be a number.");
  2918. SetPlayerSpecialAction(playerid, strval(params));
  2919. return true;
  2920. }
  2921. CMD:anim(playerid, params[])
  2922. {
  2923. if(!IsPlayerAdminLevelOK(playerid, 4)) return SysMsg(playerid, AUTHMSG);
  2924. new lib[30], aname[30];
  2925. if(sscanf(params, "s[30]s[30]", lib, aname)) return SysMsg(playerid,"Usage: /anim [library] [name]");
  2926. OnePlayAnim(playerid, lib, aname, 3.5, 1, 0, 0, 0, 0);
  2927. return true;
  2928. }
  2929. CMD:tooc(playerid, params[])
  2930. {
  2931. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  2932. if(ToggleOOC == 0)
  2933. {
  2934. ToggleOOC = 1;
  2935. SendClientMessageToAllLogged(COLOR_WHITE, "Global OOC Chat Enabled By An Admin.");
  2936. AdminLog(playerid, 0, "", "Enabled global OOC");
  2937. }
  2938. else
  2939. {
  2940. ToggleOOC = 0;
  2941. SendClientMessageToAllLogged(COLOR_WHITE, "Global OOC Chat Disabled By An Admin.");
  2942. AdminLog(playerid, 0, "", "Disabled global OOC");
  2943. }
  2944. return true;
  2945. }
  2946. CMD:tbc(playerid, params[])
  2947. {
  2948. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  2949. if(ToggleBC == 0)
  2950. {
  2951. ToggleBC = 1;
  2952. AdminBroadcast("[Admin] Broadcasting Enabled By An Admin.", 1);
  2953. AdminLog(playerid, 0, "", "Enabled broadcasts");
  2954. }
  2955. else
  2956. {
  2957. ToggleBC = 0;
  2958. AdminBroadcast("[Admin] Broadcasting Disabled By An Admin.", 1);
  2959. AdminLog(playerid, 0, "", "Disabled broadcasts");
  2960. }
  2961. return true;
  2962. }
  2963. CMD:refreshfcars(playerid, params[])
  2964. {
  2965. if(!Logged{playerid}) return true;
  2966. if(!IsPlayerAdminLevelOK(playerid, 4)) return SysMsg(playerid, AUTHMSG);
  2967. new fid;
  2968. if(sscanf(params, "i", fid)) return SysMsg(playerid, "Usage: /refreshfcars [faction ID]");
  2969. if(fid <= 0 || fid > MAX_FACTIONS-1) return SysMsg(playerid,"Invalid faction number (check /fids)");
  2970. for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
  2971. {
  2972. if(FVehicleData[v][FVFaction] == fid)
  2973. {
  2974. DestroyVehicleEx(v, "v 2");
  2975. ClearVehicleData(v);
  2976. }
  2977. }
  2978. mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM fveh WHERE Faction = %i", fid);
  2979. mysql_pquery(conn, mquery, "LoadFactionVehicles");
  2980. foreach(new i: Player)
  2981. {
  2982. if(IsPlayerAdminLevelOK(i, 1) || Faction[i] == fid)
  2983. {
  2984. SendClientMessageF(i, COLOR_RED, "Admin %s has refreshed the faction vehicles of %s", NameEx(playerid), FACTIONS[fid][FactionName]);
  2985. }
  2986. }
  2987. return true;
  2988. }
  2989. CMD:afrespawn(playerid, params[])
  2990. {
  2991. if(!Logged{playerid}) return true;
  2992. if(!IsPlayerAdminLevelOK(playerid, 2)) return SysMsg(playerid, AUTHMSG);
  2993. new vehicle[10], option[10];
  2994. if(sscanf(params, "s[10]S(-1)[10]", vehicle, option)) return SysMsg(playerid,"Usage: /afrespawn [vehicle id OR all] [faction id if respawning all]");
  2995. if(strcmp("all", vehicle, true) == 0 && strcmp("all", option, true) == 0)
  2996. {
  2997. for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
  2998. {
  2999. if(IsVehicleSpawned(v) && FVehicleData[v][FVFaction] != 0)
  3000. {
  3001. if(VehicleBeingTowed(v)) continue;
  3002. if(VehicleIsOccupied(v)) continue;
  3003. RespawnFactionCar(v);
  3004. }
  3005. }
  3006. SendClientMessageToAllLoggedF(COLOR_RED, "Admin %s has respawned ALL unoccupied faction vehicles.", NameEx(playerid));
  3007. }
  3008. else if(strcmp("all", vehicle, true) == 0)
  3009. {
  3010. if(strcmp(option, "-1", true) == 0 || !IsNumeric(option)) return SysMsg(playerid,"Usage: /afrespawn all [faction id]");
  3011. new fid = strval(option);
  3012. if(fid <= 0 || fid > MAX_FACTIONS-1) return SysMsg(playerid,"Invalid faction number (check /fids)");
  3013. new vcount = 0, tcount = 0;
  3014. for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
  3015. {
  3016. if(IsVehicleSpawned(v) && FVehicleData[v][FVFaction] == fid && !FVehicleData[v][FImpounded])
  3017. {
  3018. tcount ++;
  3019. if(VehicleBeingTowed(v)) continue;
  3020. if(VehicleIsOccupied(v)) continue;
  3021. vcount ++;
  3022. RespawnFactionCar(v);
  3023. }
  3024. }
  3025. foreach(new i: Player) if(Logged{i} && Faction[i] == fid || playerid == i) SendClientMessageF(i, COLOR_ORANGE, "[Faction Message] %s has respawned %i out of %i faction vehicles.", NameEx(playerid), vcount, tcount);
  3026. }
  3027. else
  3028. {
  3029. new v = strval(vehicle);
  3030. if(IsVehicleSpawned(v) && FVehicleData[v][FVFaction] >= 1)
  3031. {
  3032. if(VehicleBeingTowed(v)) return SysMsg(playerid, "You can't respawn a vehicle that is being towed.");
  3033. if(VehicleIsOccupied(v)) return SysMsg(playerid, "You can't respawn a vehicle that is occupied.");
  3034. if(FVehicleData[v][FImpounded]) return SysMsg(playerid, "You can't frespawn a vehicle that is impounded.");
  3035. RespawnFactionCar(v);
  3036. SendClientMessage(playerid, COLOR_ORANGE, "Vehicle has been respawned.");
  3037. }
  3038. }
  3039. return true;
  3040. }
  3041. CMD:vid(playerid, params[])
  3042. {
  3043. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3044. new VehId = GetPlayerVehicleID(playerid), Model = GetVehicleModel(VehId), Float:Pos[4], SurfingID = GetPlayerSurfingVehicleID(playerid), SeatID = GetPlayerVehicleSeat(playerid), cols[2];
  3045. GetVehiclePos(VehId,Pos[0],Pos[1],Pos[2]);
  3046. GetVehicleZAngle(VehId,Pos[3]);
  3047. GetVehicleColors(VehId, cols[0], cols[1]);
  3048. SysMsgF(playerid,"Vehicle ID: %i (Surfing ID: %i) | Model ID: %i | My Seat ID: %i | Pos: [X]%f, [Y]%f, [Z]%f, [ZA]%f",VehId,SurfingID,Model,SeatID,Pos[0],Pos[1],Pos[2],Pos[3]);
  3049. if(VehId > 0) SysMsgF(playerid,"%s: Windows: %i(State: %i), Engine: %i(State: %i), Trunk: %i, Seats: %i, Color: %i,%i", GetVehicleName(VehId),VehicleHasWindows(VehId),WindowState{VehId},VehicleHasEngine(VehId),EngineStatus[VehId],VehicleHasTrunk(VehId),GetVehicleSeatCount(VehId),cols[0],cols[1]);
  3050. return true;
  3051. }
  3052. CMD:vdamage(playerid, params[])
  3053. {
  3054. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3055. if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You must be in a vehicle.");
  3056. new VehId = GetPlayerVehicleID(playerid);
  3057. new panels, doors, lights, tires;
  3058. GetVehicleDamageStatus(VehId, panels, doors, lights, tires);
  3059. SysMsgF(playerid,"[%s damage] Panels: %i, Doors: %i, Lights: %i, Tires: %i", GetVehicleName(VehId), panels, doors, lights, tires);
  3060. return true;
  3061. }
  3062. CMD:alock(playerid, params[])
  3063. {
  3064. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3065. new VehId = GetPlayerVehicleID(playerid);
  3066. if(VehId == 0) return SysMsg(playerid,"You must be in a vehicle to lock it.");
  3067. if(Locked{VehId}) return SysMsgF(playerid,"[%s] Already Locked.",GetVehicleName(VehId));
  3068. Locked{VehId} = true;
  3069. AdminLocked{VehId} = true;
  3070. ToggleVehicleLock(VehId, 1);
  3071. SendClientMessage(playerid, COLOR_GREEN, "> Vehicle Locked. (Admin)");
  3072. return true;
  3073. }
  3074. CMD:aunlock(playerid, params[])
  3075. {
  3076. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3077. new VehId = GetPlayerVehicleID(playerid);
  3078. if(VehId > 0)
  3079. {
  3080. if(!Locked{VehId}) return SysMsgF(playerid,"[%s] Already Unlocked.",GetVehicleName(VehId));
  3081. Locked{VehId} = false;
  3082. AdminLocked{VehId} = false;
  3083. ToggleVehicleLock(VehId, 0);
  3084. SendClientMessage(playerid, COLOR_GREEN, "> Vehicle Unlocked. (Admin)");
  3085. }
  3086. else if(VehId == 0)
  3087. {
  3088. new v = GetClosestVehicle(playerid);
  3089. if(AdminLocked{v})
  3090. {
  3091. new Float:vPos[3];
  3092. GetVehiclePos(v, vPos[0], vPos[1], vPos[2]);
  3093. if(IsPlayerInRangeOfPoint(playerid, 10.0, vPos[0], vPos[1], vPos[2]))
  3094. {
  3095. Locked{v} = false;
  3096. AdminLocked{v} = false;
  3097. ToggleVehicleLock(v, 0);
  3098. SendClientMessage(playerid, COLOR_GREEN, "> Vehicle Unlocked. (Admin)");
  3099. }
  3100. }
  3101. }
  3102. return true;
  3103. }
  3104. CMD:cars(playerid, params[])
  3105. {
  3106. if(!IsPlayerAdminLevelOK(playerid, 1) && !IsHelper{playerid}) return SysMsg(playerid, AUTHMSG);
  3107. new playa;
  3108. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /cars [player id or name]");
  3109. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  3110. new lockedTxt[9], Vcount = 0, sub[100];
  3111. gstr[0] = EOS;
  3112. for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
  3113. {
  3114. if(Vcount < MAX_VEH_PER_PLAYER)
  3115. {
  3116. if(VehicleData[v][VehicleOwnerSQLID] == SQLID[playa])
  3117. {
  3118. if(VehicleData[v][IdVehicle] > 0)
  3119. {
  3120. if(Locked{v}) lockedTxt = "Locked";
  3121. else lockedTxt = "Unlocked";
  3122. if(VehicleData[v][Hotwired] == 1) lockedTxt = "Stolen";
  3123. Vcount ++;
  3124. format(sub, sizeof(sub), "%s - %s (ID: %i Slot: %i Reg: %s)\n", GetVehicleNameEx(VehicleData[v][VehicleModel]), lockedTxt, VehicleData[v][IdVehicle], v, VehicleData[v][RegPlate]);
  3125. strcat(gstr, sub);
  3126. }
  3127. }
  3128. else if(ImpoundData[v][iOwnerSQLID] == SQLID[playa])
  3129. {
  3130. if(ImpoundData[v][iImpoundTime] < 1) ImpoundData[v][iImpoundTime] = 0;
  3131. if(ImpoundData[v][iImpoundTime] == 0) format(sub, sizeof(sub), "%s - Currently Impounded (Awaiting Collection)\n", GetVehicleNameEx(ImpoundData[v][iModel]));
  3132. else format(sub, sizeof(sub), "%s - Currently Impounded (%i minutes left)\n", GetVehicleNameEx(ImpoundData[v][iModel]), ImpoundData[v][iImpoundTime]);
  3133. Vcount++;
  3134. strcat(gstr, sub);
  3135. }
  3136. if(RepairData[v][rOwnerSQLID] == SQLID[playa])
  3137. {
  3138. if(RepairData[v][rTime] < gettime()) format(sub, sizeof(sub), "%s - Being worked on at the %s (Awaiting Collection)\n", GetVehicleNameEx(RepairData[v][rModel]), GetRepairGarageName(RepairData[v][rGarage]));
  3139. else format(sub, sizeof(sub), "%s - Being worked on at the %s\n", GetVehicleNameEx(RepairData[v][rModel]), GetRepairGarageName(RepairData[v][rGarage]));
  3140. Vcount++;
  3141. strcat(gstr, sub);
  3142. }
  3143. }
  3144. }
  3145. mysql_format(conn, mquery, sizeof(mquery), "SELECT VehicleModel FROM vehicles WHERE NeedsRecovery = 1 AND OwnerSQLID = %i", SQLID[playa]);
  3146. mysql_pquery(conn, mquery, "TheirCarsRecovery", "iisi", playerid, playa, gstr, Vcount);
  3147. return true;
  3148. }
  3149. CMD:gof(playerid, params[])
  3150. {
  3151. if(!Logged{playerid}) return true;
  3152. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3153. new Float:Dist, playa = -1;
  3154. if(sscanf(params, "fU(-1)", Dist, playa)) Dist = 3.0;
  3155. if(InvalidPlayer(playa)) playa = playerid;
  3156. new Float:X, Float:Y, Float:Z, Float:Ang;
  3157. GetPlayerPos(playa, X, Y, Z);
  3158. Ang = GetXYInFrontOfPlayer(playa, X, Y, Dist);
  3159. SetPlayerPos(playa, X, Y, Z);
  3160. SetPlayerFacingAngle(playa, Ang);
  3161. return true;
  3162. }
  3163. CMD:goup(playerid, params[])
  3164. {
  3165. if(!Logged{playerid}) return true;
  3166. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3167. new Float:Dist, playa = -1;
  3168. if(sscanf(params, "fU(-1)", Dist, playa)) Dist = 3.0;
  3169. if(InvalidPlayer(playa)) playa = playerid;
  3170. SetPlayerPos(playa, PlayerPosX(playa), PlayerPosY(playa), PlayerPosZ(playa) + Dist);
  3171. return true;
  3172. }
  3173. CMD:godown(playerid, params[])
  3174. {
  3175. if(!Logged{playerid}) return true;
  3176. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3177. new Float:Dist, playa = -1;
  3178. if(sscanf(params, "fU(-1)", Dist, playa)) Dist = 3.0;
  3179. if(InvalidPlayer(playa)) playa = playerid;
  3180. SetPlayerPos(playa, PlayerPosX(playa), PlayerPosY(playa), PlayerPosZ(playa) - Dist);
  3181. return true;
  3182. }
  3183. CMD:tele(playerid, params[]) return cmd_teleport(playerid, params);
  3184. CMD:tp(playerid, params[]) return cmd_teleport(playerid, params);
  3185. CMD:teleport(playerid, params[])
  3186. {
  3187. gstr[0] = EOS;
  3188. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3189. new playa = -1;
  3190. if(sscanf(params, "u", playa))
  3191. {
  3192. for(new i = 0; i < sizeof(Teleports); i++)
  3193. {
  3194. format(tgstr, sizeof(tgstr), "%s\n", Teleports[i][TPName]);
  3195. strcat(gstr, tgstr);
  3196. }
  3197. new vehicleid = GetPlayerVehicleID(playerid);
  3198. if(vehicleid != 0) SetPVarInt(playerid, "tpVID", vehicleid);
  3199. SetPVarInt(playerid, "tpID", playerid);
  3200. Dialog_Show(playerid, TPList, DIALOG_STYLE_LIST, "TP yourself to ...", gstr, "Teleport", "Cancel");
  3201. return true;
  3202. }
  3203. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  3204. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  3205. if(IsJailed[playa] == 1) return SysMsg(playerid,"That player is in jail.");
  3206. if(IsCuffed[playa] == 1) return SysMsg(playerid,"That player is in cuffs.");
  3207. new vehicleid = GetPlayerVehicleID(playa);
  3208. if(vehicleid != 0) SetPVarInt(playerid, "tpVID", vehicleid);
  3209. SetPVarInt(playerid, "tpID", playa);
  3210. for(new i = 0; i < sizeof(Teleports); i++)
  3211. {
  3212. format(tgstr, sizeof(tgstr), "%s\n", Teleports[i][TPName]);
  3213. strcat(gstr, tgstr);
  3214. }
  3215. Dialog_Show(playerid, TPList, DIALOG_STYLE_LIST, "TP player to ...", gstr, "Teleport", "Cancel");
  3216. return true;
  3217. }
  3218. CMD:tpto(playerid, params[])
  3219. {
  3220. if(!Logged{playerid}) return true;
  3221. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3222. if(isnull(params)) return SysMsg(playerid, "Usage: /tpto [teleport name from /tp list] *Use /tptop for other players*");
  3223. new p = -1;
  3224. for(new x = 0; x < sizeof(Teleports); x++)
  3225. {
  3226. if(strfind(Teleports[x][TPName], params, true) != -1)
  3227. {
  3228. p = x;
  3229. break;
  3230. }
  3231. }
  3232. if(p == -1) return SysMsg(playerid, "Unable to find teleport name.");
  3233. if(IsPlayerInAnyVehicle(playerid))
  3234. {
  3235. new v = GetPlayerVehicleID(playerid);
  3236. SetVehiclePos(v, Teleports[p][TPx],Teleports[p][TPy],Teleports[p][TPz]);
  3237. foreach(new i: Player)
  3238. {
  3239. if(IsPlayerInVehicle(i, v))
  3240. {
  3241. SetPlayerVirtualWorldEx(i ,Teleports[p][TPVw]);
  3242. SetPlayerInterior(i, Teleports[p][TPInt]);
  3243. }
  3244. }
  3245. LinkVehicleToInteriorEx(v, Teleports[p][TPInt]);
  3246. SetVehicleVirtualWorld(v, Teleports[p][TPVw]);
  3247. if(IsInHouseID[playerid] != -1) IsInHouseID[playerid] = -1;
  3248. if(IsInBizzID[playerid] != -1) IsInBizzID[playerid] = -1;
  3249. if(IsInGarageID[playerid] != -1) IsInGarageID[playerid] = -1;
  3250. SendClientMessageF(playerid, COLOR_LIGHTBLUE, "Admin %s has teleported you to %s.",NameEx(playerid),Teleports[p][TPName]);
  3251. format(gstr, sizeof(gstr),"[Admin] %s has teleported %s to %s", NameEx(playerid),NameEx(playerid),Teleports[p][TPName]);
  3252. AdminBroadcast(gstr, 1);
  3253. format(gstr, sizeof(gstr), "Teleported to %s", Teleports[p][TPName]);
  3254. AdminLog(playerid, SQLID[playerid], GetName(playerid), gstr);
  3255. return true;
  3256. }
  3257. else
  3258. {
  3259. SetPlayerPos(playerid,Teleports[p][TPx],Teleports[p][TPy],Teleports[p][TPz]);
  3260. SetPlayerFacingAngle(playerid,Teleports[p][TPa]);
  3261. SetPlayerInterior(playerid,Teleports[p][TPInt]);
  3262. SetPlayerVirtualWorldEx(playerid,Teleports[p][TPVw]);
  3263. if(IsInHouseID[playerid] != -1) IsInHouseID[playerid] = -1;
  3264. if(IsInBizzID[playerid] != -1) IsInBizzID[playerid] = -1;
  3265. if(IsInGarageID[playerid] != -1) IsInGarageID[playerid] = -1;
  3266. JourneyInterior[playerid] = 0;
  3267. ShamalInterior[playerid] = 0;
  3268. TropicInterior[playerid] = 0;
  3269. TrailerInterior[playerid] = 0;
  3270. SendClientMessageF(playerid,COLOR_LIGHTBLUE, "Admin %s has teleported you to %s.",NameEx(playerid), Teleports[p][TPName]);
  3271. format(gstr, sizeof(gstr),"[Admin] %s has teleported %s to %s.",NameEx(playerid),NameEx(playerid), Teleports[p][TPName]);
  3272. AdminBroadcast(gstr, 1);
  3273. format(gstr, sizeof(gstr), "Teleported to %s", Teleports[p][TPName]);
  3274. AdminLog(playerid, SQLID[playerid], GetName(playerid), gstr);
  3275. return true;
  3276. }
  3277. }
  3278. CMD:tptop(playerid, params[])
  3279. {
  3280. if(!Logged{playerid}) return true;
  3281. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3282. new loc[32], player = -1;
  3283. if(sscanf(params, "us[32]", player, loc)) return SysMsg(playerid, "Usage: /tptop [player ID or name] [teleport name from /tp list]");
  3284. if(InvalidPlayer(player)) return SysMsg(playerid, NOPLAYER);
  3285. new p = -1;
  3286. for(new x = 0; x < sizeof(Teleports); x++)
  3287. {
  3288. if(strfind(Teleports[x][TPName], loc, true) != -1)
  3289. {
  3290. p = x;
  3291. break;
  3292. }
  3293. }
  3294. if(p == -1) return SysMsg(playerid, "Unable to find teleport name.");
  3295. if(IsPlayerInAnyVehicle(player))
  3296. {
  3297. new v = GetPlayerVehicleID(player);
  3298. SetVehiclePos(v, Teleports[p][TPx],Teleports[p][TPy],Teleports[p][TPz]);
  3299. foreach(new i: Player)
  3300. {
  3301. if(IsPlayerInVehicle(i, v))
  3302. {
  3303. SetPlayerVirtualWorldEx(i ,Teleports[p][TPVw]);
  3304. SetPlayerInterior(i, Teleports[p][TPInt]);
  3305. }
  3306. }
  3307. LinkVehicleToInteriorEx(v, Teleports[p][TPInt]);
  3308. SetVehicleVirtualWorld(v, Teleports[p][TPVw]);
  3309. if(IsInHouseID[player] != -1) IsInHouseID[player] = -1;
  3310. if(IsInBizzID[player] != -1) IsInBizzID[player] = -1;
  3311. if(IsInGarageID[player] != -1) IsInGarageID[player] = -1;
  3312. SendClientMessageF(player, COLOR_LIGHTBLUE, "Admin %s has teleported you to %s.",NameEx(playerid),Teleports[p][TPName]);
  3313. format(gstr, sizeof(gstr),"[Admin] %s has teleported %s to %s", NameEx(playerid),NameEx(player),Teleports[p][TPName]);
  3314. AdminBroadcast(gstr, 1);
  3315. format(gstr, sizeof(gstr), "Teleported to %s", Teleports[p][TPName]);
  3316. AdminLog(playerid, SQLID[player], GetName(player), gstr);
  3317. return true;
  3318. }
  3319. else
  3320. {
  3321. SetPlayerPos(player,Teleports[p][TPx],Teleports[p][TPy],Teleports[p][TPz]);
  3322. SetPlayerFacingAngle(player,Teleports[p][TPa]);
  3323. SetPlayerInterior(player,Teleports[p][TPInt]);
  3324. SetPlayerVirtualWorldEx(player,Teleports[p][TPVw]);
  3325. if(IsInHouseID[player] != -1) IsInHouseID[player] = -1;
  3326. if(IsInBizzID[player] != -1) IsInBizzID[player] = -1;
  3327. if(IsInGarageID[player] != -1) IsInGarageID[player] = -1;
  3328. JourneyInterior[player] = 0;
  3329. ShamalInterior[player] = 0;
  3330. TropicInterior[player] = 0;
  3331. TrailerInterior[player] = 0;
  3332. SendClientMessageF(player,COLOR_LIGHTBLUE, "Admin %s has teleported you to %s.",NameEx(playerid), Teleports[p][TPName]);
  3333. format(gstr, sizeof(gstr),"[Admin] %s has teleported %s to %s.",NameEx(playerid),NameEx(player), Teleports[p][TPName]);
  3334. AdminBroadcast(gstr, 1);
  3335. format(gstr, sizeof(gstr), "Teleported to %s", Teleports[p][TPName]);
  3336. AdminLog(playerid, SQLID[player], GetName(player), gstr);
  3337. return true;
  3338. }
  3339. }
  3340. CMD:getp(playerid, params[])
  3341. {
  3342. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3343. if(IsJailed[playerid] == 1) return SysMsg(playerid,"Please wait until you are out of jail.");
  3344. if(IsCuffed[playerid] == 1) return SysMsg(playerid,"This action cannot be performed while you are in handcuffs.");
  3345. new playa = -1;
  3346. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /getp [player id or name]");
  3347. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  3348. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  3349. if(IsJailed[playa] == 1) return SysMsg(playerid,"That player is in jail.");
  3350. if(IsSpectating[playa] >= 0) return SysMsg(playerid,"You can't get a person who is spectating.");
  3351. new Float:pX,Float:pY,Float:pZ;
  3352. new InteriorId,VirtualWorldId;
  3353. GetPlayerPos(playerid,pX,pY,pZ);
  3354. InteriorId = GetPlayerInterior(playerid);
  3355. VirtualWorldId = GetPlayerVirtualWorld(playerid);
  3356. if(!IsPlayerInAnyVehicle(playa)) Teleport(playa, pX + 1.0, pY + 1.0, pZ + 2.0, 0.0, InteriorId, VirtualWorldId);
  3357. else
  3358. {
  3359. new TargetsVehicleId = GetPlayerVehicleID(playa);
  3360. SetVehiclePos(TargetsVehicleId, pX + 2.0, pY + 2.0, pZ + 5.0);
  3361. SetVehicleVirtualWorld(TargetsVehicleId, VirtualWorldId);
  3362. LinkVehicleToInteriorEx(TargetsVehicleId, InteriorId);
  3363. SetPlayerVirtualWorldEx(playa, VirtualWorldId);
  3364. SetPlayerInterior(playa, InteriorId);
  3365. }
  3366. if(IsInHouseID[playa] != -1)
  3367. {
  3368. if(HouseData[IsInHouseID[playa]][HMusicPlaying] == 1)
  3369. {
  3370. StopAudioStreamForPlayer(playa);
  3371. }
  3372. }
  3373. if(IsInHouseID[playerid] != -1)
  3374. {
  3375. IsInHouseID[playa] = IsInHouseID[playerid];
  3376. if(HouseData[IsInHouseID[playerid]][HMusicPlaying] == 1)
  3377. {
  3378. StopAudioStreamForPlayer(playa);
  3379. PlayAudioStreamForPlayerEx(playa, HouseData[IsInHouseID[playerid]][HMusic]);
  3380. ListeningBoom[playa] = -1;
  3381. }
  3382. }
  3383. if(IsInBizzID[playa] != -1)
  3384. {
  3385. if(BizzData[IsInBizzID[playa]][BMusicPlaying] == 1)
  3386. {
  3387. StopAudioStreamForPlayer(playa);
  3388. }
  3389. }
  3390. if(IsInBizzID[playerid] != -1)
  3391. {
  3392. IsInBizzID[playa] = IsInBizzID[playerid];
  3393. if(BizzData[IsInBizzID[playerid]][BMusicPlaying] == 1)
  3394. {
  3395. StopAudioStreamForPlayer(playa);
  3396. PlayAudioStreamForPlayerEx(playa, BizzData[IsInBizzID[playerid]][BMusic]);
  3397. ListeningBoom[playa] = -1;
  3398. }
  3399. }
  3400. if(IsInGarageID[playerid] != -1)
  3401. {
  3402. IsInGarageID[playa] = IsInGarageID[playerid];
  3403. }
  3404. JourneyInterior[playa] = JourneyInterior[playerid];
  3405. ShamalInterior[playa] = ShamalInterior[playerid];
  3406. TropicInterior[playa] = TropicInterior[playerid];
  3407. TrailerInterior[playa] = TrailerInterior[playerid];
  3408. SendClientMessageF(playa, COLOR_LIGHTBLUE, "Admin %s has teleported you to them",NameEx(playerid));
  3409. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You have teleported %s to your position.",NameEx(playa));
  3410. AdminLog(playerid, SQLID[playa], GetName(playa), "Get player");
  3411. return true;
  3412. }
  3413. CMD:vget(playerid, params[])
  3414. {
  3415. new vehicleid, player;
  3416. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3417. if(sscanf(params, "ii", player, vehicleid)) return SysMsg(playerid, "Usage: /vget [playerid] [vehicleid]");
  3418. if(InvalidPlayer(player)) return SysMsg(playerid,"Invalid ID.");
  3419. if(IsPlayerNPC(player)) return SysMsg(playerid,"That player is a NPC.");
  3420. if(!Logged{player}) return SysMsg(playerid,"Not logged in.");
  3421. if(vehicleid < 1 || vehicleid > MAX_VEHICLES || !IsVehicleSpawned(vehicleid)) return SysMsg(playerid, "You have specified an invalid vehicle ID.");
  3422. if(IsPlayerInAnyVehicle(player)) return SysMsg(playerid, "That player is already in a vehicle.");
  3423. new seatid = GetVehicleAvailableSeat(vehicleid);
  3424. if(seatid == -1) return SysMsg(playerid, "There are no seats left to enter.");
  3425. PutPlayerInVehicle(player, vehicleid, seatid);
  3426. return true;
  3427. }
  3428. CMD:gotop(playerid, params[])
  3429. {
  3430. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3431. new playa = -1, playa2 = -1;
  3432. if(sscanf(params, "uU(-1)", playa, playa2)) return SysMsg(playerid,"Usage: /gotop [ID Teleporting to] [Optional: Player being teleported]");
  3433. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  3434. if(IsSpectating[playa] >= 0) return SysMsg(playerid, "You cannot teleport to someone while they're spectating another player.");
  3435. if(!Logged{playa}) return SysMsg(playerid, "This player has not logged in.");
  3436. new Float:pX, Float:pY, Float:pZ;
  3437. if(playa2 == -1)
  3438. {
  3439. GetPlayerPos(playa,pX,pY,pZ);
  3440. if(IsSpectating[playerid] >= 0) cmd_spectateoff(playerid);
  3441. if(IsPlayerInAnyVehicle(playerid))
  3442. {
  3443. SetVehiclePos(GetPlayerVehicleID(playerid),pX + 3.5,pY + 3.5,pZ);
  3444. SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(playa));
  3445. LinkVehicleToInteriorEx(GetPlayerVehicleID(playerid), GetPlayerInterior(playa));
  3446. SetPlayerInterior(playerid,GetPlayerInterior(playa));
  3447. SetPlayerVirtualWorldEx(playerid,GetPlayerVirtualWorld(playa));
  3448. }
  3449. else Teleport(playerid, pX+2, pY+2, pZ, 0.0, GetPlayerInterior(playa), GetPlayerVirtualWorld(playa));
  3450. SendClientMessageF(playerid, COLOR_LIGHTGREEN,"You have teleported to %s", NameEx(playa));
  3451. SendClientMessageF(playa, COLOR_SKYBLUE, "Admin %s has teleported to your position.", NameEx(playerid));
  3452. IsInHouseID[playerid] = IsInHouseID[playa];
  3453. IsInBizzID[playerid] = IsInBizzID[playa];
  3454. IsInGarageID[playerid] = IsInGarageID[playa];
  3455. if(IsInHouseID[playa] != -1)
  3456. {
  3457. StopAudioStreamForPlayer(playerid);
  3458. if(HouseData[IsInHouseID[playa]][HMusicPlaying] == 1) PlayAudioStreamForPlayerEx(playerid, HouseData[IsInHouseID[playa]][HMusic]);
  3459. }
  3460. if(IsInBizzID[playa] != -1)
  3461. {
  3462. StopAudioStreamForPlayer(playerid);
  3463. if(BizzData[IsInBizzID[playa]][BMusicPlaying] == 1) PlayAudioStreamForPlayerEx(playerid, BizzData[IsInBizzID[playa]][BMusic]);
  3464. }
  3465. JourneyInterior[playerid] = 0;
  3466. ShamalInterior[playerid] = 0;
  3467. TropicInterior[playerid] = 0;
  3468. TrailerInterior[playerid] = 0;
  3469. format(gstr, sizeof(gstr), "Teleported player", GetName(playa));
  3470. AdminLog(playerid, SQLID[playa], GetName(playa), "Teleported player");
  3471. }
  3472. else if(IsPlayerConnected(playa2))
  3473. {
  3474. GetPlayerPos(playa,pX,pY,pZ);
  3475. if(IsSpectating[playa2] >= 0) cmd_spectateoff(playa2);
  3476. if(IsPlayerInAnyVehicle(playa2))
  3477. {
  3478. SetVehiclePos(GetPlayerVehicleID(playa2),pX + 3.5,pY + 3.5,pZ);
  3479. SetVehicleVirtualWorld(GetPlayerVehicleID(playa2),GetPlayerVirtualWorld(playa));
  3480. LinkVehicleToInteriorEx(GetPlayerVirtualWorld(playa2), GetPlayerInterior(playa));
  3481. }
  3482. else SetPlayerPos(playa2,pX+2,pY+2,pZ);
  3483. SetPlayerInterior(playa2,GetPlayerInterior(playa));
  3484. SetPlayerVirtualWorldEx(playa2,GetPlayerVirtualWorld(playa));
  3485. IsInHouseID[playa2] = IsInHouseID[playa];
  3486. IsInBizzID[playa2] = IsInBizzID[playa];
  3487. IsInGarageID[playa2] = IsInGarageID[playa];
  3488. if(IsInHouseID[playa] != -1)
  3489. {
  3490. StopAudioStreamForPlayer(playa2);
  3491. if(HouseData[IsInHouseID[playa]][HMusicPlaying] == 1) PlayAudioStreamForPlayerEx(playa2, HouseData[IsInHouseID[playa]][HMusic]);
  3492. }
  3493. if(IsInBizzID[playa] != -1)
  3494. {
  3495. StopAudioStreamForPlayer(playa2);
  3496. if(BizzData[IsInBizzID[playa]][BMusicPlaying] == 1) PlayAudioStreamForPlayerEx(playa2, BizzData[IsInBizzID[playa]][BMusic]);
  3497. }
  3498. JourneyInterior[playa] = JourneyInterior[playa2];
  3499. ShamalInterior[playa] = ShamalInterior[playa2];
  3500. TropicInterior[playa] = TropicInterior[playa2];
  3501. TrailerInterior[playa] = TrailerInterior[playa2];
  3502. if(IsJailed[playa2] == 1) return SysMsg(playerid,"That player is currently in jail.");
  3503. if(IsCuffed[playa2] == 1) return SysMsg(playerid,"That player is currently cuffed.");
  3504. if(IsSpectating[playa2] >= 0) return SysMsg(playerid,"That player is currently spectating");
  3505. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You have teleported %s[ID %i] to %s[ID %i]", NameEx(playa2), playa2, NameEx(playa), playa);
  3506. SendClientMessageF(playa2, COLOR_TURQUOISE, "Admin %s has teleported you to %s's position.", NameEx(playerid), NameEx(playa));
  3507. format(gstr, sizeof(gstr), "Teleported player to %s", GetName(playa));
  3508. AdminLog(playerid, SQLID[playa2], GetName(playa2), gstr);
  3509. }
  3510. return true;
  3511. }
  3512. CMD:gotoh(playerid, params[])
  3513. {
  3514. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3515. new hname[32],h;
  3516. if(sscanf(params, "s[32]", hname)) return SysMsg(playerid,"Usage: /gotoh [House Name]");
  3517. h = GetHouseLocation(hname);
  3518. new vehid_P = GetPlayerVehicleID(playerid);
  3519. new vw = 0;
  3520. if(h != -1)
  3521. {
  3522. if(strfind(HouseData[h][HouseDescription], "Flat") != -1) vw = 2;
  3523. if(vehid_P == 0)
  3524. {
  3525. SetPlayerPos(playerid, HouseData[h][oPosX],HouseData[h][oPosY],HouseData[h][oPosZ]);
  3526. SetPlayerVirtualWorldEx(playerid, HouseData[h][HouseExtVW]);
  3527. SetPlayerInterior(playerid, vw);
  3528. IsInHouseID[playerid] = -1;
  3529. IsInGarageID[playerid] = -1;
  3530. IsInBizzID[playerid] = -1;
  3531. }
  3532. else
  3533. {
  3534. SetVehiclePos(vehid_P, HouseData[h][oPosX],HouseData[h][oPosY],HouseData[h][oPosZ]);
  3535. SetVehicleVirtualWorld(vehid_P,HouseData[h][HouseExtVW]);
  3536. LinkVehicleToInteriorEx(vehid_P,vw);
  3537. SetPlayerInterior(playerid,vw);
  3538. IsInHouseID[playerid] = -1;
  3539. IsInGarageID[playerid] = -1;
  3540. IsInBizzID[playerid] = -1;
  3541. }
  3542. }
  3543. else return SysMsg(playerid, "Invalid House Address");
  3544. return true;
  3545. }
  3546. CMD:gotob(playerid, params[])
  3547. {
  3548. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3549. new hname[32],h;
  3550. if(sscanf(params, "s[32]", hname)) return SysMsg(playerid,"Usage: /gotob [Business Name]");
  3551. h = GetBizzLocation(hname);
  3552. new vehid_P = GetPlayerVehicleID(playerid);
  3553. if(h != -1)
  3554. {
  3555. if(vehid_P == 0)
  3556. {
  3557. SetPlayerPos(playerid, BizzData[h][oPosX],BizzData[h][oPosY],BizzData[h][oPosZ]);
  3558. SetPlayerVirtualWorldEx(playerid,0);
  3559. SetPlayerInterior(playerid, 0);
  3560. IsInHouseID[playerid] = -1;
  3561. IsInGarageID[playerid] = -1;
  3562. IsInBizzID[playerid] = -1;
  3563. }
  3564. else
  3565. {
  3566. SetVehiclePos(vehid_P, BizzData[h][oPosX],BizzData[h][oPosY],BizzData[h][oPosZ]);
  3567. SetVehicleVirtualWorld(vehid_P,0);
  3568. LinkVehicleToInteriorEx(vehid_P, 0);
  3569. SetPlayerVirtualWorldEx(playerid, 0);
  3570. SetPlayerInterior(playerid, 0);
  3571. IsInHouseID[playerid] = -1;
  3572. IsInGarageID[playerid] = -1;
  3573. IsInBizzID[playerid] = -1;
  3574. }
  3575. }
  3576. else return SysMsg(playerid, "Invalid Business Address");
  3577. return true;
  3578. }
  3579. CMD:gotov(playerid, params[])
  3580. {
  3581. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3582. if(IsJailed[playerid] == 1) return SysMsg(playerid,"Please wait until you are out of jail.");
  3583. if(IsCuffed[playerid] == 1) return SysMsg(playerid,"This action cannot be performed while you are in handcuffs.");
  3584. new vid, id;
  3585. if(sscanf(params, "iI(-1)", vid, id)) return SysMsg(playerid,"Usage: /gotov [Vehicle ID] [Optional: Player being teleported]");
  3586. if(!IsVehicleSpawned(vid)) return SysMsg(playerid,"No such vehicle ID spawned.");
  3587. new Float:vX, Float:vY, Float:vZ;
  3588. GetVehiclePos(vid, vX, vY, vZ);
  3589. new vehid = GetPlayerVehicleID(playerid);
  3590. if(id == -1)
  3591. {
  3592. if(IsSpectating[playerid] >= 0) cmd_spectateoff(playerid);
  3593. if(IsInHouseID[playerid] != -1) IsInHouseID[playerid] = -1;
  3594. if(IsInBizzID[playerid] != -1) IsInBizzID[playerid] = -1;
  3595. if(vehid == 0)
  3596. {
  3597. SetPlayerPos(playerid, vX, vY, vZ + 4.0);
  3598. SetPlayerVirtualWorldEx(playerid, GetVehicleVirtualWorld(vid));
  3599. if(FVehicleData[vid][FVSQLID] > 0) SetPlayerInterior(playerid, FVehicleData[vid][TempFVInterior]);
  3600. else SetPlayerInterior(playerid, 0);
  3601. }
  3602. else
  3603. {
  3604. SetVehiclePos(vehid, vX + 4.0, vY + 4.0, vZ + 4.0);
  3605. SetVehicleVirtualWorld(vehid, GetVehicleVirtualWorld(vid));
  3606. if(FVehicleData[vid][FVSQLID] > 0)
  3607. {
  3608. LinkVehicleToInteriorEx(vehid, FVehicleData[vid][TempFVInterior]);
  3609. if(IsFactionVehicle(vehid)) FVehicleData[vehid][TempFVInterior] = FVehicleData[vid][TempFVInterior];
  3610. }
  3611. else LinkVehicleToInterior(vehid, 0);
  3612. }
  3613. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You have teleported to a %s [ID %i]", GetVehicleName(vid), vid);
  3614. }
  3615. else if(IsPlayerConnected(id))
  3616. {
  3617. if(IsSpectating[id] >= 0) cmd_spectateoff(id);
  3618. if(IsInHouseID[id] != -1) IsInHouseID[id] = -1;
  3619. if(IsInBizzID[id] != -1) IsInBizzID[id] = -1;
  3620. if(vehid == 0)
  3621. {
  3622. SetPlayerPos(id, vX, vY, vZ + 4.0);
  3623. SetPlayerVirtualWorldEx(id, GetVehicleVirtualWorld(vid));
  3624. if(FVehicleData[vid][FVSQLID] > 0) SetPlayerInterior(id, FVehicleData[vid][TempFVInterior]);
  3625. else SetPlayerInterior(id, 0);
  3626. }
  3627. else
  3628. {
  3629. SetVehiclePos(vehid, vX + 4.0, vY + 4.0, vZ + 4.0);
  3630. SetVehicleVirtualWorld(vehid, GetVehicleVirtualWorld(vid));
  3631. if(FVehicleData[vid][FVSQLID] > 0)
  3632. {
  3633. LinkVehicleToInteriorEx(vehid, FVehicleData[vid][TempFVInterior]);
  3634. if(IsFactionVehicle(vehid)) FVehicleData[vehid][TempFVInterior] = FVehicleData[vid][TempFVInterior];
  3635. }
  3636. else LinkVehicleToInterior(vehid, 0);
  3637. }
  3638. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You have teleported %s to a %s [ID %i]", NameEx(id), GetVehicleName(vid), vid);
  3639. SendClientMessageF(id, COLOR_TURQUOISE, "Admin %s has teleported you to a %s [ID %i]", NameEx(playerid), GetVehicleName(vid), vid);
  3640. }
  3641. return true;
  3642. }
  3643. CMD:getv(playerid, params[])
  3644. {
  3645. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3646. if(IsJailed[playerid] == 1) return SysMsg(playerid,"Please wait until you are out of jail.");
  3647. if(IsCuffed[playerid] == 1) return SysMsg(playerid,"This action cannot be performed while you are in handcuffs.");
  3648. if(isnull(params)) return SysMsg(playerid,"Usage: /getv [vehicle id]");
  3649. if(!IsNumeric(params)) return SysMsg(playerid,"Vehicle ID must be a number.");
  3650. new vehicleid = strval(params);
  3651. if(vehicleid < 1) return SysMsg(playerid,"Invalid vehicle.");
  3652. if(!IsVehicleSpawned(vehicleid)) return SysMsg(playerid,"No such vehicle ID spawned.");
  3653. new Float:x, Float:y, Float:z;
  3654. GetPlayerPos(playerid, x, y, z);
  3655. LinkVehicleToInteriorEx(vehicleid, GetPlayerInterior(playerid));
  3656. SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
  3657. SetVehiclePos(vehicleid, x+4, y+4, z+4);
  3658. return true;
  3659. }
  3660. CMD:blowup(playerid, params[])
  3661. {
  3662. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  3663. if(IsJailed[playerid] == 1) return SysMsg(playerid,"Please wait until you are out of jail.");
  3664. if(IsCuffed[playerid] == 1) return SysMsg(playerid,"This action cannot be performed while you are in handcuffs.");
  3665. new playa = -1;
  3666. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /blowup [player id or name]");
  3667. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  3668. if(IsJailed[playa] == 1) return SysMsg(playerid,"That player is in jail.");
  3669. new Float:pX,Float:pY,Float:pZ;
  3670. GetPlayerPos(playa,pX,pY,pZ);
  3671. CreateExplosion(pX,pY,pZ,0,10);
  3672. CreateExplosion(pX,pY,pZ,0,10);
  3673. CreateExplosion(pX,pY,pZ,0,10);
  3674. AdminLog(playerid, SQLID[playa], GetName(playa), "Blows up");
  3675. return true;
  3676. }
  3677. CMD:fakeme(playerid, params[])
  3678. {
  3679. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  3680. new playa = -1, action[128];
  3681. if(sscanf(params, "us[128]", playa, action)) return SysMsg(playerid,"Usage: /fakeme [playerid/name] [action]");
  3682. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  3683. format(gstr, sizeof(gstr), "%s %s",NameEx(playa),action);
  3684. ProxDetector(20.0,playa,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
  3685. return true;
  3686. }
  3687. CMD:fakedo(playerid, params[])
  3688. {
  3689. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  3690. new playa = -1, action[128];
  3691. if(sscanf(params, "us[128]", playa, action)) return SysMsg(playerid,"Usage: /fakedo [playerid/name] [action]");
  3692. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  3693. format(gstr, sizeof(gstr), "%s ((%s))",action,NameRP(playa));
  3694. ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
  3695. return true;
  3696. }
  3697. CMD:disarm(playerid, params[])
  3698. {
  3699. if(!IsPlayerAdminLevelOK(playerid, 2)) return SysMsg(playerid, AUTHMSG);
  3700. new playa = -1;
  3701. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /disarm [player id or name]");
  3702. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  3703. ResetPlayerWeaponsEx(playa);
  3704. SyncPlayerWeapons(playa);
  3705. format(gstr, sizeof(gstr),"Admin %s has disarmed you.",NameEx(playerid));
  3706. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  3707. format(gstr, sizeof(gstr),"You have disarmed %s.",NameEx(playa));
  3708. SendClientMessage(playerid, COLOR_LIGHTGREEN, gstr);
  3709. AdminLog(playerid, SQLID[playa], GetName(playa), "Disarmed");
  3710. return true;
  3711. }
  3712. CMD:rspec(playerid)
  3713. {
  3714. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3715. new str[10], rand = GetRandomOnlinePlayer();
  3716. while(rand != playerid && Logged{rand} && IsSpectating[rand] != -1)
  3717. {
  3718. rand = GetRandomOnlinePlayer();
  3719. }
  3720. format(str, sizeof(str), "%i", rand);
  3721. cmd_spectate(playerid, str);
  3722. return true;
  3723. }
  3724. CMD:spec(playerid, params[]) return cmd_spectate(playerid, params);
  3725. CMD:spectate(playerid, params[])
  3726. {
  3727. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3728. new playa = -1;
  3729. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /spectate [player id or name]");
  3730. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  3731. if(playa == playerid) return SysMsg(playerid,"You can't spectate yourself.");
  3732. if(!Logged{playa}) return SysMsg(playerid, "This player has not logged in. Please wait until they have logged in to spectate them.");
  3733. if(IsSpectating[playa] >= 0) return SysMsg(playerid,"You can't spectate a person who is also spectating.");
  3734. if(PfSpec[playa][FlySpec] == 1) return SysMsg(playerid, "You can't spectate a person who is using /fly.");
  3735. if(MasterAccount[playa] == 29469 && MasterAccount[playerid] == 19025) return SysMsg(playerid, "Nice try, buddy. Love, Emmalee");
  3736. if(IsSpectating[playerid] == -1)
  3737. {
  3738. new Float:X, Float:Y, Float:Z;
  3739. GetPlayerPos(playerid, X, Y, Z);
  3740. TempInfo[playerid][tmX] = X;
  3741. TempInfo[playerid][tmY] = Y;
  3742. TempInfo[playerid][tmZ] = Z;
  3743. TempInfo[playerid][tSkin] = GetPlayerSkin(playerid);
  3744. TempInfo[playerid][tInt] = GetPlayerInterior(playerid);
  3745. TempInfo[playerid][tVW] = GetPlayerVirtualWorld(playerid);
  3746. }
  3747. if(PfSpec[playerid][FlySpec] == 1)
  3748. {
  3749. PfSpec[playerid][FlySpec] = 0;
  3750. TogglePlayerSpectating(playerid, false);
  3751. if(IsValidObject(PfSpec[playerid][fsobj]))
  3752. DestroyPlayerObject(playerid, PfSpec[playerid][fsobj]);
  3753. }
  3754. TogglePlayerSpectating(playerid, 1);
  3755. SetPlayerInterior(playerid, GetPlayerInterior(playa));
  3756. SetPlayerVirtualWorldEx(playerid, GetPlayerVirtualWorld(playa));
  3757. new tVehId = GetPlayerVehicleID(playa);
  3758. if(tVehId > 0)
  3759. {
  3760. PlayerSpectateVehicle(playerid, tVehId, SPECTATE_MODE_NORMAL);
  3761. SysMsgF(playerid, "You are now spectating %s (in vehicle) Use /specoff to return to normal.",NameEx(playa));
  3762. IsSpectating[playerid] = playa;
  3763. PlayerTextDrawShow(playerid, pSpecTD[playerid]);
  3764. format(gstr, sizeof(gstr), "Spectating ~P~%s (%i)", NameEx(playa), playa);
  3765. PlayerTextDrawSetString(playerid, pSpecTD[playerid], gstr);
  3766. }
  3767. else
  3768. {
  3769. PlayerSpectatePlayer(playerid, playa, SPECTATE_MODE_NORMAL);
  3770. SysMsgF(playerid, "You are now spectating %s (on foot) Use /specoff to return to normal.",NameEx(playa));
  3771. IsSpectating[playerid] = playa;
  3772. PlayerTextDrawShow(playerid, pSpecTD[playerid]);
  3773. format(gstr, sizeof(gstr), "Spectating ~P~%s (%i)", NameEx(playa), playa);
  3774. PlayerTextDrawSetString(playerid, pSpecTD[playerid], gstr);
  3775. }
  3776. AdminLog(playerid, SQLID[playa], GetName(playa), "Spectate");
  3777. return true;
  3778. }
  3779. CMD:fly(playerid, params[])
  3780. {
  3781. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3782. if(PfSpec[playerid][FlySpec] == 0) StartFlyEditor(playerid);
  3783. else if(PfSpec[playerid][FlySpec] == 1) EndFlyEditor(playerid);
  3784. return true;
  3785. }
  3786. CMD:vspec(playerid, params[])
  3787. {
  3788. if(!IsPlayerAdminLevelOK(playerid, 1) && !IsHelper{playerid}) return SysMsg(playerid, AUTHMSG);
  3789. new vehicleid = 0;
  3790. if(isnull(params)) return SysMsg(playerid,"Usage: /vspec [vehicle id]");
  3791. if(!IsNumeric(params) && strval(params) > 0) return SysMsg(playerid,"Usage: /vspec [vehicle id]");
  3792. vehicleid = strval(params);
  3793. if(vehicleid > MAX_VEHICLES) return SysMsg(playerid, "Invalid vehicle.");
  3794. if(!IsPlayerAdminLevelOK(playerid, 1) && !IsHelper{playerid}) return SysMsg(playerid, AUTHMSG);
  3795. if(!IsVehicleSpawned(vehicleid)) return SysMsg(playerid,"Invalid Vehicle ID.");
  3796. if(IsSpectating[playerid] == -1)
  3797. {
  3798. new Float:X, Float:Y, Float:Z;
  3799. GetPlayerPos(playerid, X, Y, Z);
  3800. TempInfo[playerid][tmX] = X;
  3801. TempInfo[playerid][tmY] = Y;
  3802. TempInfo[playerid][tmZ] = Z;
  3803. TempInfo[playerid][tSkin] = GetPlayerSkin(playerid);
  3804. TempInfo[playerid][tInt] = GetPlayerInterior(playerid);
  3805. TempInfo[playerid][tVW] = GetPlayerVirtualWorld(playerid);
  3806. }
  3807. TogglePlayerSpectating(playerid, 1);
  3808. SetPlayerVirtualWorldEx(playerid, GetVehicleVirtualWorld(vehicleid));
  3809. if(FVehicleData[vehicleid][FVSQLID] > 0) SetPlayerInterior(playerid, FVehicleData[vehicleid][TempFVInterior]);
  3810. PlayerSpectateVehicle(playerid, vehicleid, SPECTATE_MODE_NORMAL);
  3811. SysMsgF(playerid, "You are now spectating vehicle ID %i (%s). Use /specoff to return to normal.",vehicleid,GetVehicleNameEx(GetVehicleModel(vehicleid)));
  3812. IsSpectating[playerid] = 1000;
  3813. return true;
  3814. }
  3815. CMD:specoff(playerid) return cmd_spectateoff(playerid);
  3816. CMD:spectateoff(playerid)
  3817. {
  3818. if(!IsPlayerAdminLevelOK(playerid, 1) && !IsHelper{playerid}) return SysMsg(playerid, AUTHMSG);
  3819. if(IsSpectating[playerid] == -1) return SysMsg(playerid,"You are not spectating.");
  3820. TogglePlayerSpectating(playerid, 0);
  3821. SetPlayerPos(playerid, TempInfo[playerid][tmX], TempInfo[playerid][tmY], TempInfo[playerid][tmZ]);
  3822. SetPlayerInterior(playerid, TempInfo[playerid][tInt]);
  3823. SetPlayerVirtualWorldEx(playerid, TempInfo[playerid][tVW]);
  3824. SetPlayerSkinEx(playerid, TempInfo[playerid][tSkin]);
  3825. IsSpectating[playerid] = -1;
  3826. SyncPlayerWeapons(playerid);
  3827. SetTimerEx("UnFreezePlayer", 200, 0, "d", playerid);
  3828. ClearTempInfo(playerid);
  3829. if(PfSpec[playerid][FlySpec] == 1) PfSpec[playerid][FlySpec] = 0;
  3830. for(new ao = 0; ao < 10; ao++)
  3831. {
  3832. if(AttachedObjects[playerid][ao][aoModelID] > 0)
  3833. {
  3834. SetPlayerAttachedObject(playerid, ao, AttachedObjects[playerid][ao][aoModelID], AttachedObjects[playerid][ao][aoBone], AttachedObjects[playerid][ao][aoOffset][0], AttachedObjects[playerid][ao][aoOffset][1],
  3835. AttachedObjects[playerid][ao][aoOffset][2], AttachedObjects[playerid][ao][aoRot][0], AttachedObjects[playerid][ao][aoRot][1], AttachedObjects[playerid][ao][aoRot][2], AttachedObjects[playerid][ao][aoScale][0],
  3836. AttachedObjects[playerid][ao][aoScale][1], AttachedObjects[playerid][ao][aoScale][2], AttachedObjects[playerid][ao][aoColor], AttachedObjects[playerid][ao][aoColor]);
  3837. }
  3838. }
  3839. PlayerTextDrawHide(playerid, pSpecTD[playerid]);
  3840. //TextDrawHideForPlayer(playerid, SpeedText[IsSpectating[playerid]]);
  3841. return true;
  3842. }
  3843. CMD:whospec(playerid, params[])
  3844. {
  3845. new count = 0;
  3846. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3847. foreach(new i: Player)
  3848. {
  3849. if(IsSpectating[i] != -1 && AdminLevel[i] >= 1 && IsSpectating[i] != 1000)
  3850. {
  3851. SendClientMessageF(playerid, COLOR_WHITE, "Administrator %s is spectating %s.", NameEx(i), NameEx(IsSpectating[i]));
  3852. count++;
  3853. }
  3854. }
  3855. if(count == 0) return SysMsg(playerid, "Nobody is spectating.");
  3856. return true;
  3857. }
  3858. CMD:fach(playerid, params[])
  3859. {
  3860. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  3861. new playa = -1, achievID;
  3862. if(sscanf(params, "ui", playa, achievID)) return SysMsg(playerid,"Usage: /fach [player id or name] [achievement id]");
  3863. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  3864. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  3865. if(!Logged{playa}) return SysMsg(playerid,"Player Id is not logged in.");
  3866. if(achievID < 1 || achievID >= MAX_ACHS) return SysMsg(playerid,"Invalid Achievement.");
  3867. UnlockAchievement(playa, achievID);
  3868. SendClientMessageF(playa, COLOR_LIGHTGREEN, "Admin %s has unlocked achievement %i for you.", NameEx(playerid), achievID);
  3869. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You unlocked achievement %i for %s.", achievID, NameEx(playa));
  3870. format(gstr, sizeof(gstr), "Unlocked achievement %i", achievID);
  3871. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  3872. return true;
  3873. }
  3874. CMD:vehiclelookup(playerid, params[])
  3875. {
  3876. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3877. if(isnull(params)) return SysMsg(playerid, "Usage: /vehiclelookup [vehicle model name]");
  3878. new v = GetVehicleModelIdFromName(params), count = 0;
  3879. gstr[0] = EOS;
  3880. foreach(new i: Player)
  3881. {
  3882. if(GetVehicleModel(GetPlayerVehicleID(i)) == v)
  3883. {
  3884. new zone[MAX_ZONE_NAME];
  3885. GetPlayer3DZone(i, zone, MAX_ZONE_NAME);
  3886. format(gstr, sizeof(gstr), "%s%s (ID: %i, Loc: %s) - %s, %i\n", gstr, NameEx(i), i, zone, GetVehicleNameEx(v), GetPlayerVehicleID(i));
  3887. count++;
  3888. }
  3889. }
  3890. if(count == 0) return SysMsgF(playerid, "Could not find any players driving a(n) %s", params);
  3891. ShowMessage(playerid, "Players in that vehicle", gstr, "Done");
  3892. return true;
  3893. }
  3894. CMD:weaponlookup(playerid, params[])
  3895. {
  3896. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3897. if(isnull(params)) return SysMsg(playerid, "Usage: /weaponlookup [weapon name]");
  3898. new wid = GetWeaponIdFromName(params), count = 0;
  3899. if(wid == -1) return SysMsg(playerid, "Invalid weapon.");
  3900. gstr[0] = EOS;
  3901. foreach(new i: Player)
  3902. {
  3903. if(GetPlayerWeapon(i) == wid)
  3904. {
  3905. new wep, ammo, zone[MAX_ZONE_NAME];
  3906. GetPlayerWeaponData(i, GetWeaponSlot(wid), wep, ammo);
  3907. GetPlayer3DZone(i, zone, MAX_ZONE_NAME);
  3908. format(sgstr, sizeof(sgstr), "%s (ID: %i, Loc: %s) - %s, %i ammo\n", NameEx(i), i, zone, GetWeaponNameFromID(wid), ammo);
  3909. strcat(gstr, sgstr);
  3910. count++;
  3911. }
  3912. }
  3913. if(count == 0) return SysMsgF(playerid, "Could not find any players holding %s", weaponstring[wid]);
  3914. ShowMessage(playerid, "Players holding that weapon", gstr, "Done");
  3915. return true;
  3916. }
  3917. CMD:arealookup(playerid, params[])
  3918. {
  3919. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3920. if(isnull(params))
  3921. {
  3922. SysMsg(playerid, "Usage: /arealookup [area of interest. e.g, montgomery]");
  3923. SysMsg(playerid, "Note: Area name must MATCH one of the zones ingame, otherwise no players will be found.");
  3924. return true;
  3925. }
  3926. new count = 0;
  3927. gstr[0] = EOS;
  3928. foreach(new i: Player)
  3929. {
  3930. new zone[MAX_ZONE_NAME];
  3931. GetPlayer3DZone(i, zone, MAX_ZONE_NAME);
  3932. if(strmatch(zone, params))
  3933. {
  3934. format(gstr, sizeof(gstr), "%s%s (ID: %i) - %s\n", gstr, NameEx(i), i, zone);
  3935. count++;
  3936. }
  3937. }
  3938. if(count == 0) return SysMsgF(playerid, "Could not find any players in %s", params);
  3939. ShowMessage(playerid, "Players found in that zone", gstr, "Done");
  3940. return true;
  3941. }
  3942. CMD:setmotd(playerid, params[])
  3943. {
  3944. new motdid;
  3945. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3946. if(sscanf(params, "is[128]", motdid, gstr)) return SysMsg(playerid,"Usage: /setmotd [motd id] [message]") && SysMsg(playerid, "MOTD IDs are 1: Admin, 2: Helper, 3: Player");
  3947. if(motdid < 1 || motdid > 3) return SysMsg(playerid, "You must enter a valid MOTD ID. Available MOTD IDs are 1: Admin, 2: Helper, 3: Player");
  3948. if(motdid == 1) //Admin MOTD
  3949. {
  3950. if(!IsPlayerAdminLevelOK(playerid, 4)) return SysMsg(playerid, "You are not the appropriate admin rank to modify this MOTD");
  3951. mysql_format(conn, mquery, sizeof(mquery), "UPDATE motd SET message = '%e' WHERE motdid = %i", gstr, motdid-1);
  3952. mysql_pquery(conn, mquery);
  3953. SendClientMessageF(playerid, COLOR_WHITE, "You have set the Admin MOTD to %s", gstr);
  3954. AdminLog(playerid, 0, gstr, "Changed Admin MOTD");
  3955. return true;
  3956. }
  3957. if(motdid == 2) //Helper MOTD
  3958. {
  3959. if(!IsPlayerAdminLevelOK(playerid, 2)) return SysMsg(playerid, "You are not the appropriate admin rank to modify this MOTD");
  3960. mysql_format(conn, mquery, sizeof(mquery), "UPDATE motd SET message = '%e' WHERE motdid = %i", gstr, motdid-1);
  3961. mysql_pquery(conn, mquery);
  3962. SendClientMessageF(playerid, COLOR_WHITE, "You have set the Helper MOTD to %s", gstr);
  3963. AdminLog(playerid, 0, gstr, "Changed Helper MOTD");
  3964. return true;
  3965. }
  3966. if(motdid == 3) //Player MOTD
  3967. {
  3968. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, "You are not the appropriate admin rank to modify this MOTD");
  3969. mysql_format(conn, mquery, sizeof(mquery), "UPDATE motd SET message = '%e' WHERE motdid = %i", gstr, motdid-1);
  3970. mysql_pquery(conn, mquery);
  3971. SendClientMessageF(playerid, COLOR_WHITE, "You have set the Player MOTD to %s", gstr);
  3972. AdminLog(playerid, 0, gstr, "Changed Player MOTD");
  3973. return true;
  3974. }
  3975. return true;
  3976. }
  3977. CMD:set(playerid, params[])
  3978. {
  3979. new playa, pname[32], option[24], Value[32], Value2[32];
  3980. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  3981. if(sscanf(params, "s[32]s[24]S(None)[32]S(None)[32]", pname, option, Value, Value2))
  3982. {
  3983. SysMsg(playerid,"Usage: /set [Player ID/Vehicle ID] [option] [value]");
  3984. SysMsg(playerid,"Options: VW, Interior, HP, Armour");
  3985. if(IsPlayerAdminLevelOK(playerid, 2)) SysMsg(playerid, "Options: Skin, Fuel, Weather");
  3986. if(IsPlayerAdminLevelOK(playerid, 3))
  3987. {
  3988. SysMsg(playerid, "Options: Faction, Rank, Job, Name, Fightstyle");
  3989. SysMsg(playerid, "Options: Drunk, Weaponskill, vh");
  3990. }
  3991. if(IsPlayerAdminLevelOK(playerid, 4)) SysMsg(playerid, "Options: AdminLevel, Time");
  3992. return true;
  3993. }
  3994. if(strmatch("fuel", pname))
  3995. {
  3996. new playerState = GetPlayerState(playerid);
  3997. if(!IsPlayerAdminLevelOK(playerid, 2)) return SysMsg(playerid, AUTHMSG);
  3998. if(!IsNumeric(option)) return SysMsg(playerid,"Amount must be a number.");
  3999. if(strval(option) < 0 || strval(option) > 100) return SysMsg(playerid,"Amount must be 0 to 100.");
  4000. new vid = GetPlayerVehicleID(playerid);
  4001. if(vid == 0) return SysMsg(playerid,"Not in a vehicle.");
  4002. Fuel[vid] = floatstr(option);
  4003. // UpdateFuelText(vid, gstr);
  4004. // PlayerTextDrawSetString(playerid, FuelText[playerid], gstr);
  4005. //TextDrawShowForPlayer(playerid,FuelText[playerid]);
  4006. if(playerState == PLAYER_STATE_PASSENGER) SendClientMessageF(playerid, COLOR_LIGHTGREEN, "Fuel Set To %i In This %s(%i)", strval(option),GetVehicleName(vid),vid);
  4007. else if(playerState == PLAYER_STATE_DRIVER && Fuel[vid] >= 10)
  4008. {
  4009. //PlayerTextDrawShow(playerid, FuelText[playerid]);
  4010. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "Fuel Set To %i In This %s(%i)", strval(option),GetVehicleName(vid),vid);
  4011. }
  4012. else if(Fuel[vid] < 10 && playerState == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid, LowFuelText);
  4013. TextDrawHideForPlayer(playerid, LowFuelText);
  4014. return true;
  4015. }
  4016. else if(strmatch("vh", pname))
  4017. {
  4018. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  4019. new vid = GetPlayerVehicleID(playerid);
  4020. if(vid > 0)
  4021. {
  4022. SetVehicleHealthEx(vid, strval(option));
  4023. SysMsgF(playerid, "Vehicle Health Set To %i.", strval(option));
  4024. }
  4025. return true;
  4026. }
  4027. else if(strmatch("weather", pname))
  4028. {
  4029. if(!IsPlayerAdminLevelOK(playerid, 2)) return SysMsg(playerid, AUTHMSG);
  4030. foreach(new i: Player)
  4031. {
  4032. if(GetPlayerInterior(i) == 0 && GetPlayerVirtualWorld(i) == 0)
  4033. {
  4034. SetPlayerWeather(i, strval(option));
  4035. }
  4036. }
  4037. gServerWeather = strval(option);
  4038. format(gstr, sizeof(gstr),"[Admin] %s has changed the weather to ID %i(%s).",NameEx(playerid),strval(option),GetWeatherName(strval(option)));
  4039. AdminBroadcast(gstr, 0);
  4040. format(gstr, sizeof(gstr), "Changed weather to %i", strval(option));
  4041. AdminLog(playerid, 0, "", gstr);
  4042. return true;
  4043. }
  4044. else if(strmatch("time", pname))
  4045. {
  4046. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  4047. gServerHour = strval(option);
  4048. foreach(new i: Player)
  4049. {
  4050. if(IsInHouseID[i] == -1 && IsInBizzID[i] == -1)
  4051. {
  4052. SetPlayerTime(i, gServerHour, gServerMinute);
  4053. }
  4054. }
  4055. format(gstr, sizeof(gstr),"[Admin] %s has changed the time to %i.",NameEx(playerid),strval(option));
  4056. AdminBroadcast(gstr, 0);
  4057. format(gstr, sizeof(gstr), "Changed time to %i", strval(option));
  4058. AdminLog(playerid, 0, "", gstr);
  4059. return true;
  4060. }
  4061. playa = GetPlayerIDs(pname);
  4062. if(InvalidPlayer(playa)) return SysMsg(playerid,"Invalid player or option.");
  4063. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  4064. if(!Logged{playa}) return SysMsg(playerid,"Player ID is not logged in.");
  4065. if(strmatch("int", option) || strmatch("interior", option))
  4066. {
  4067. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  4068. if(!IsNumeric(Value)) return SysMsg(playerid, "The value needs to be a number.");
  4069. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You have successfully set %s's [ID:%i] interior world ID to %i.", NameEx(playa), playa, strval(Value));
  4070. SendClientMessageF(playa, COLOR_LIGHTGREEN, "Admin %s has set your interior world to ID %i.", NameEx(playerid), strval(Value));
  4071. SetPlayerInterior(playa, strval(Value));
  4072. }
  4073. else if(strmatch("vw", option) || strmatch("virtual", option))
  4074. {
  4075. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  4076. if(!IsNumeric(Value)) return SysMsg(playerid, "The value needs to be a number.");
  4077. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You have successfully set %s's [ID:%i] virtual world ID to %i.", NameEx(playa), playa, strval(Value));
  4078. SendClientMessageF(playa, COLOR_LIGHTGREEN, "Admin %s has set your virtual world to ID %i.", NameEx(playerid), strval(Value));
  4079. SetPlayerVirtualWorldEx(playa, strval(Value));
  4080. }
  4081. else if(strcmp("faction",option,true) == 0)
  4082. {
  4083. if(IsPlayerAdminLevelOK(playerid, 3))
  4084. {
  4085. if(strval(Value) < 0) return SysMsg(playerid,"Invalid value! (No Such Faction Number)");
  4086. if(strval(Value) > MAX_FACTIONS-1) return SysMsg(playerid,"Invalid value! (No Such Faction Number)");
  4087. if(strval(Value) == Faction[playa]) return SysMsg(playerid,"Invalid value! (Already Set To That value)");
  4088. if(strval(Value) == FACTION_PROP && !CanSetST(playerid)) return SysMsg(playerid,"That faction is invite only!");
  4089. if(Faction[playa] > 0 && strval(Value) == 0) MySpawnID[playa] = 1;
  4090. if(Faction[playa] == 0 && strval(Value) > 0) MySpawnID[playa] = 2;
  4091. Faction[playa] = strval(Value);
  4092. FactionRank[playa] = 1;
  4093. SubFactionSpawn[playerid] = 1;
  4094. //GivePlayerWeapons(playa);
  4095. Duty[playerid] = 0;
  4096. mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET FactionRank = %i, Faction = %i, SubFactionSpawn = %i, MySpawnID = %i WHERE id = %i", FactionRank[playa], Faction[playa], SubFactionSpawn[playa], MySpawnID[playa], SQLID[playa]);
  4097. mysql_pquery(conn, mquery);
  4098. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You have set %s's faction to %s(%i).",NameEx(playa),GetFactionNameFromId(strval(Value)),strval(Value));
  4099. SendClientMessageF(playa, COLOR_LIGHTGREEN, "Admin %s has set your faction to %s(%i).",NameEx(playerid),GetFactionNameFromId(strval(Value)),strval(Value));
  4100. format(gstr, sizeof(gstr), "Set faction to %i", strval(Value));
  4101. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4102. UnlockAchievement(playerid, 5);
  4103. }
  4104. else return SysMsg(playerid, "You are not a high enough rank to use this option.");
  4105. }
  4106. else if(strcmp("rank",option,true) == 0)
  4107. {
  4108. if(IsPlayerAdminLevelOK(playerid, 3))
  4109. {
  4110. if(strval(Value) < 1 || strval(Value) > 15) return SysMsg(playerid,"Invalid value! (No Such Rank Number)");
  4111. if(strval(Value) > FACTIONS[Faction[playa]][FactionUberLeaderRank]) return SysMsg(playerid,"That rank does not exist in that faction.");
  4112. if(strval(Value) == FactionRank[playa]) return SysMsg(playerid,"Invalid value! (Already Set To That value)");
  4113. FactionRank[playa] = strval(Value);
  4114. MySQLUpdateInt(SQLID[playa], "FactionRank", FactionRank[playa], "players");
  4115. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You have set %s's faction rank to %s(%i).",NameEx(playa),GetFactionRankName(Faction[playa], FactionRank[playa]),strval(Value));
  4116. SendClientMessageF(playa, COLOR_LIGHTGREEN, "Admin %s has set your faction rank to %s(%i).",NameEx(playerid),GetFactionRankName(Faction[playa], FactionRank[playa]),strval(Value));
  4117. format(gstr, sizeof(gstr), "Set faction rank to %i", strval(Value));
  4118. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4119. }
  4120. else return SysMsg(playerid, "You are not a high enough rank to use this option.");
  4121. }
  4122. else if(strcmp("job",option,true) == 0)
  4123. {
  4124. if(IsPlayerAdminLevelOK(playerid, 3))
  4125. {
  4126. if(strval(Value) < 0 || strval(Value) > MAX_JOBS) return SysMsg(playerid,"Invalid value! (No Such Job)");
  4127. if(strval(Value) == Job[playa]) return SysMsg(playerid,"Invalid value! (Already Set To That value)");
  4128. if(strval(Value) == 3) return SysMsg(playerid, "This job is no longer available.");
  4129. Job[playa] = strval(Value);
  4130. MySQLUpdateInt(SQLID[playa], "Job", Job[playa], "players");
  4131. new JName[25];
  4132. switch(Job[playa])
  4133. {
  4134. case 0: JName = "None";
  4135. case JOB_MECHANIC: JName = "Mechanic";
  4136. case JOB_DRUGDEALER: JName = "Drug Dealer";
  4137. case JOB_TAXI: JName = "Taxi Driver";
  4138. }
  4139. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You have set %s's job to %s(%i).",NameEx(playa),JName,strval(Value));
  4140. SendClientMessageF(playa, COLOR_LIGHTGREEN, "Admin %s has set your job to %s(%i).",NameEx(playerid),JName,strval(Value));
  4141. format(gstr, sizeof(gstr), "Set job to %i(%s)", strval(Value), JName);
  4142. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4143. }
  4144. else return SysMsg(playerid, "You are not a high enough rank to use this option.");
  4145. return true;
  4146. }
  4147. else if(strmatch("hp", option) || strmatch("health", option))
  4148. {
  4149. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid,"You are not a high enough rank to use this option.");
  4150. if(strval(Value) < 0) return SysMsg(playerid,"Invalid health points! (0-100 only)");
  4151. if(strval(Value) > 100 && !IsPlayerAdmin(playerid)) return SysMsg(playerid,"Invalid health points! (0-100 only)");
  4152. if(strval(Value) >= 50) ClearInjuriesForPlayer(playa);
  4153. if(Dead{playa} && strval(Value) >= 50)
  4154. {
  4155. RevivePlayer(playa);
  4156. }
  4157. SetPlayerHealthEx(playa, strval(Value));
  4158. if(IsPlayerMasked{playa}) FormatHealthLabelText(playa, HealthVar[playa], ArmourVar[playa], 2);
  4159. IsDead[playerid] = 0;
  4160. DeathTimer[playerid] = 0;
  4161. SendClientMessageF(playa, COLOR_LIGHTBLUE, "Your health has been set to %i by %s",strval(Value),NameEx(playerid));
  4162. SendClientMessageF(playerid, COLOR_RED, "You have set %s's health to %i",NameEx(playa),strval(Value));
  4163. format(gstr, sizeof(gstr), "Set health to %i", strval(Value));
  4164. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4165. }
  4166. else if(strmatch("armour", option) || strmatch("armor", option))
  4167. {
  4168. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  4169. if(strval(Value) < 0 || strval(Value) > 100) return SysMsg(playerid,"Invalid armour amount! (0-100 only)");
  4170. SetPlayerArmourEx(playa, strval(Value), 1);
  4171. SendClientMessageF(playa, COLOR_LIGHTBLUE, "Your armour has been set to %i by %s",strval(Value),NameEx(playerid));
  4172. SendClientMessageF(playerid, COLOR_RED, "You have set %s's armour to %i",NameEx(playa),strval(Value));
  4173. format(gstr, sizeof(gstr), "Set armour to %i", strval(Value));
  4174. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4175. if(IsPlayerMasked{playa}) FormatHealthLabelText(playa, HealthVar[playa], ArmourVar[playa], 2);
  4176. }
  4177. else if(strmatch("name", option))
  4178. {
  4179. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  4180. if(strcmp(GetName(playa),Value,false) == 0) return SysMsg(playerid,"That player already has that name.");
  4181. if(!IsValidRoleplayName(Value)) return SysMsg(playerid,"That name isn't deemed roleplay.");
  4182. if(MySQLCheckAccount(Value, playerid) != 0) return SysMsg(playerid,"That name is already taken in the database.");
  4183. if(strlen(Value) > 24) return SysMsg(playerid,"Error: SAMP only allows names with 24 or less letters.");
  4184. if(hmData[playa][hmActive] == 1) return SysMsg(playerid, "This player is currently aliased. Please contact them personally if you need to change their name");
  4185. new oldname[MAX_PLAYER_NAME];
  4186. format(oldname, MAX_PLAYER_NAME, GetName(playa));
  4187. if(SetPlayerName(playa, Value) != 1) return SysMsg(playerid, "That name is too short, too long, in use, the same or contains invalid letters.");
  4188. MySQLUpdateString(SQLID[playa], "Name", Value, "players");
  4189. mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET OwnerName = '%e' WHERE OwnerSQLID = %i", Value, SQLID[playa]);
  4190. mysql_pquery(conn, mquery);
  4191. format(PhoneData[playa][pOwnerName], 25, "%s", Value);
  4192. SendClientMessageF(playa,COLOR_DARKBLUE,"Admin %s has changed your name to %s.", GetName(playerid), Value);
  4193. SendClientMessageF(playerid, COLOR_RED, "You changed %s's name to %s.", oldname, Value);
  4194. format(sgstr, sizeof(sgstr), "Changed %s's name to %s", oldname, Value);
  4195. AdminLog(playerid, SQLID[playa], GetName(playa), sgstr);
  4196. for(new b = 0; b < MAX_BIZZ_PER_PLAYER; b++)
  4197. {
  4198. if(PlayerBizzID[playa][b] != -1)
  4199. {
  4200. new h = PlayerBizzID[playa][b];
  4201. UpdateBizzLabel(h);
  4202. }
  4203. }
  4204. foreach(new i: Player)
  4205. {
  4206. if(UsingPaint{i})
  4207. {
  4208. format(tgstr, sizeof(tgstr), "%s (%i)", NameEx(playa), playa);
  4209. UpdateDynamic3DTextLabelText(PaintLabels[i][playa], COLOR_ORANGE, tgstr);
  4210. }
  4211. }
  4212. }
  4213. else if(strmatch("skin", option))
  4214. {
  4215. if(!IsPlayerAdminLevelOK(playerid, 2)) return SysMsg(playerid, AUTHMSG);
  4216. //if(IsPlayerInAnyVehicle(playa)) return SysMsg(playerid,"That player is currently in a vehicle, please ask them to exit before setting their skin.");
  4217. if(GetPlayerSpecialAction(playa) == SPECIAL_ACTION_ENTER_VEHICLE || GetPlayerSpecialAction(playa) == SPECIAL_ACTION_EXIT_VEHICLE) return SysMsg(playerid, "You cannot do this while the player is entering/exiting a vehicle.");
  4218. if(GetPlayerSpecialAction(playa) == SPECIAL_ACTION_DUCK) return SysMsg(playerid,"You cannot change a skin when they are crouched.");
  4219. if(GetPlayerVehicleID(playa) > 0) return SysMsg(playerid,"You cannot change a skin when they are in a vehicle.");
  4220. if(strval(Value) < 1 || strval(Value) > 311 || strval(Value) == 74) return SysMsg(playerid,"Skin ID was invalid.");
  4221. new oldskin = GetPlayerSkin(playerid);
  4222. for(new i = 0; i < 4; i++)
  4223. {
  4224. if(Clothes[playa][i] == oldskin)
  4225. {
  4226. Clothes[playa][i] = strval(Value);
  4227. new str[10];
  4228. format(str,sizeof(str),"SkinSet%i",i+1);
  4229. MySQLUpdateInt(SQLID[playa], str, Clothes[playa][i], "players");
  4230. break;
  4231. }
  4232. }
  4233. SetPlayerSkinEx(playa, strval(Value));
  4234. cPlayersSkin[playa] = strval(Value);
  4235. MySQLUpdateInt(SQLID[playa], "Skin", cPlayersSkin[playa], "players");
  4236. format(gstr, sizeof(gstr), "Set skin to %i", strval(Value));
  4237. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4238. }
  4239. else if(strmatch("fightstyle", option) || strmatch("fight", option))
  4240. {
  4241. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  4242. if(strmatch("None", Value))
  4243. {
  4244. SysMsg(playerid,"Usage: /set [player id or name] fightstyle [style id/name]");
  4245. SysMsg(playerid,"Style Types: 0-Normal, 1-Boxer, 2-Kungfu");
  4246. return true;
  4247. }
  4248. new StyleType = -1;
  4249. if(IsNumeric(Value))
  4250. {
  4251. if(strval(Value) < 0 || strval(Value) > 2) return SysMsg(playerid,"Invalid Style (0-2).");
  4252. StyleType = strval(Value);
  4253. }
  4254. if(StyleType == 0 || strcmp("normal",Value,true) == 0)
  4255. {
  4256. if(GetPlayerFightingStyle(playa) == FIGHT_STYLE_NORMAL) return SysMsg(playerid,"Error: Already that fighting style.");
  4257. SetPlayerFightingStyle(playa, FIGHT_STYLE_NORMAL);
  4258. UsingFightStyle{playa} = FIGHT_STYLE_NORMAL;
  4259. MySQLUpdateInt(SQLID[playa], "FightStyle", FIGHT_STYLE_NORMAL, "players");
  4260. format(gstr, sizeof(gstr),"Admin %s set your fighting style to normal.",NameEx(playerid));
  4261. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4262. format(gstr, sizeof(gstr),"You set %s's fighting style to normal.",NameEx(playa));
  4263. SendClientMessage(playerid,COLOR_RED, gstr);
  4264. return true;
  4265. }
  4266. if(StyleType == 1 || strcmp("boxer",Value,true) == 0)
  4267. {
  4268. if(GetPlayerFightingStyle(playa) == FIGHT_STYLE_BOXING) return SysMsg(playerid,"Error: Already that fighting style.");
  4269. SetPlayerFightingStyle(playa, FIGHT_STYLE_BOXING);
  4270. UsingFightStyle{playa} = FIGHT_STYLE_BOXING;
  4271. if(!FightStyleLearned[playa]{FS_BOXING})
  4272. {
  4273. FightStyleLearned[playa]{FS_BOXING} = true;
  4274. MySQLUpdateInt(SQLID[playa], "FightStyleLearnedBoxing", 1, "players");
  4275. }
  4276. MySQLUpdateInt(SQLID[playa], "FightStyle", FIGHT_STYLE_BOXING, "players");
  4277. format(gstr, sizeof(gstr),"Admin %s set your fighting style to boxer.",NameEx(playerid));
  4278. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4279. format(gstr, sizeof(gstr),"You set %s's fighting style to boxer.",NameEx(playa));
  4280. SendClientMessage(playerid,COLOR_RED, gstr);
  4281. return true;
  4282. }
  4283. if(StyleType == 2 || strcmp("kungfu",Value,true) == 0)
  4284. {
  4285. if(GetPlayerFightingStyle(playa) == FIGHT_STYLE_KUNGFU) return SysMsg(playerid,"Error: Already that fighting style.");
  4286. SetPlayerFightingStyle(playa, FIGHT_STYLE_KUNGFU);
  4287. UsingFightStyle{playa} = FIGHT_STYLE_KUNGFU;
  4288. if(!FightStyleLearned[playa]{FS_KUNGFU})
  4289. {
  4290. FightStyleLearned[playa]{FS_KUNGFU} = true;
  4291. MySQLUpdateInt(SQLID[playa], "FightStyleLearnedKungFu", 1, "players");
  4292. }
  4293. MySQLUpdateInt(SQLID[playa], "FightStyle", FIGHT_STYLE_KUNGFU, "players");
  4294. format(gstr, sizeof(gstr),"Admin %s set your fighting style to kung-fu.",NameEx(playerid));
  4295. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4296. format(gstr, sizeof(gstr),"You set %s's your fighting style to kung-fu.",NameEx(playa));
  4297. SendClientMessage(playerid,COLOR_RED, gstr);
  4298. return true;
  4299. }
  4300. format(gstr, sizeof(gstr), "Set fight style to %i/%s", StyleType, Value);
  4301. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4302. }
  4303. else if(strmatch("drunk", option))
  4304. {
  4305. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  4306. new DLevel = strval(Value);
  4307. if(isnull(Value)) return SysMsg(playerid, "Usage: /set [ID] drunk [0-50000]");
  4308. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  4309. if(DLevel < 0 || DLevel > 50000) return SysMsg(playerid,"Invalid Drunk Level. (0-50000)");
  4310. SetPlayerDrunkLevel(playa, DLevel);
  4311. DrunkLevel[playerid] = DLevel;
  4312. format(gstr, sizeof(gstr),"Admin %s has changed your drunkenness to %i",NameEx(playerid),DLevel);
  4313. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4314. format(gstr, sizeof(gstr),"You set %s's drunkenness to %i",NameEx(playa),DLevel);
  4315. SendClientMessage(playerid,COLOR_RED, gstr);
  4316. format(gstr, sizeof(gstr), "Set drunk level to %i", DLevel);
  4317. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4318. }
  4319. else if(strmatch("weaponskill", option))
  4320. {
  4321. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  4322. new skill = strval(Value2);
  4323. if(strmatch("None", Value))
  4324. {
  4325. SysMsg(playerid,"Usage: /set [player id or name] weaponskill [weapon type/name] [skill level]");
  4326. SysMsg(playerid,"Weapon Type: 0-9mm, 1-Silenced 9mm, 2-D.Eagle, 3-Shotgun, 4-Sawn-off, 5-SPAS, 6-Micro UZI");
  4327. SysMsg(playerid,"Weapon Type: 7-MP5, 8-AK47, 9-M4, 10-Sniper, *11-ALL WEAPONS*");
  4328. return true;
  4329. }
  4330. new wtype = -1;
  4331. if(IsNumeric(Value))
  4332. {
  4333. if(strval(Value) < 0 || strval(Value) > 11) return SysMsg(playerid,"Invalid Gun Type.");
  4334. wtype = strval(Value);
  4335. }
  4336. if(skill < 0 || skill > 10) return SysMsg(playerid,"Invalid Skill Level. (0 - 10)");
  4337. MySQLUpdateInt(SQLID[playa], "WeaponSkill", skill, "players");
  4338. if(wtype == 0 || strcmp("9mm",Value,true) == 0)
  4339. {
  4340. SetPlayerSkillLevel(playa, WEAPONSKILL_PISTOL, (skill * 100) - 10);
  4341. WeaponSkillLevel[playa] = skill;
  4342. format(gstr, sizeof(gstr),"Admin %s set your 9mm Pistol skill to %i",NameEx(playerid),(skill * 100) - 1);
  4343. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4344. format(gstr, sizeof(gstr),"You set %s's 9mm Pistol skill to %i",NameEx(playa),(skill * 100) - 1);
  4345. SendClientMessage(playerid,COLOR_RED, gstr);
  4346. format(gstr, sizeof(gstr), "Set 9mm weapon skill to %i", (skill * 100) - 1);
  4347. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4348. return true;
  4349. }
  4350. if(wtype == 1 || strcmp("silenced9mm",Value,true) == 0)
  4351. {
  4352. SetPlayerSkillLevel(playa, WEAPONSKILL_PISTOL_SILENCED, (skill * 100) - 1);
  4353. WeaponSkillLevel[playa] = skill;
  4354. format(gstr, sizeof(gstr),"Admin %s set your Silenced 9mm Pistol skill to %i",NameEx(playerid),(skill * 100) - 1);
  4355. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4356. format(gstr, sizeof(gstr),"You set %s's Silenced 9mm Pistol skill to %i",NameEx(playa),(skill * 100) - 1);
  4357. SendClientMessage(playerid,COLOR_RED, gstr);
  4358. format(gstr, sizeof(gstr), "Set silenced 9mm weapon skill to %i", (skill * 100) - 1);
  4359. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4360. return true;
  4361. }
  4362. if(wtype == 2 || strcmp("deagle",Value,true) == 0)
  4363. {
  4364. SetPlayerSkillLevel(playa, WEAPONSKILL_DESERT_EAGLE, (skill * 100) - 1);
  4365. WeaponSkillLevel[playa] = skill;
  4366. format(gstr, sizeof(gstr),"Admin %s set your Desert Eagle skill to %i",NameEx(playerid),(skill * 100) - 1);
  4367. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4368. format(gstr, sizeof(gstr),"You set %s's Desert Eagle skill to %i",NameEx(playa),(skill * 100) - 1);
  4369. SendClientMessage(playerid,COLOR_RED, gstr);
  4370. format(gstr, sizeof(gstr), "Set d.eagles weapon skill to %i", (skill * 100) - 1);
  4371. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4372. return true;
  4373. }
  4374. if(wtype == 3 || strcmp("Shotgun",Value,true) == 0)
  4375. {
  4376. SetPlayerSkillLevel(playa, WEAPONSKILL_SHOTGUN, (skill * 100) - 1);
  4377. WeaponSkillLevel[playa] = skill;
  4378. format(gstr, sizeof(gstr),"Admin %s set your Shotgun skill to %i",NameEx(playerid),(skill * 100) - 1);
  4379. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4380. format(gstr, sizeof(gstr),"You set %s's Shotgun skill to %i",NameEx(playa),(skill * 100) - 1);
  4381. SendClientMessage(playerid,COLOR_RED, gstr);
  4382. format(gstr, sizeof(gstr), "Set shotgun weapon skill to %i", (skill * 100) - 1);
  4383. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4384. return true;
  4385. }
  4386. if(wtype == 4 || strcmp("sawnoff",Value,true) == 0)
  4387. {
  4388. SetPlayerSkillLevel(playa, WEAPONSKILL_SAWNOFF_SHOTGUN, (skill * 100) - 1);
  4389. WeaponSkillLevel[playa] = skill;
  4390. format(gstr, sizeof(gstr),"Admin %s set your Sawn-off Shotgun skill to %i",NameEx(playerid),(skill * 100) - 1);
  4391. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4392. format(gstr, sizeof(gstr),"You set %s's Sawn-off Shotgun skill to %i",NameEx(playa),(skill * 100) - 1);
  4393. SendClientMessage(playerid,COLOR_RED, gstr);
  4394. format(gstr, sizeof(gstr), "Set sawn-off weapon skill to %i", (skill * 100) - 1);
  4395. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4396. return true;
  4397. }
  4398. if(wtype == 5 || strcmp("spas",Value,true) == 0)
  4399. {
  4400. SetPlayerSkillLevel(playa, WEAPONSKILL_SPAS12_SHOTGUN, (skill * 100) - 1);
  4401. WeaponSkillLevel[playa] = skill;
  4402. format(gstr, sizeof(gstr),"Admin %s set your SPAS12 skill to %i",NameEx(playerid),(skill * 100) - 1);
  4403. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4404. format(gstr, sizeof(gstr),"You set %s's SPAS12 skill to %i",NameEx(playa),(skill * 100) - 1);
  4405. SendClientMessage(playerid,COLOR_RED, gstr);
  4406. format(gstr, sizeof(gstr), "Set spas12 weapon skill to %i", (skill * 100) - 1);
  4407. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4408. return true;
  4409. }
  4410. if(wtype == 6 || strcmp("uzi",Value,true) == 0)
  4411. {
  4412. SetPlayerSkillLevel(playa, WEAPONSKILL_MICRO_UZI, (skill * 100) - 1);
  4413. WeaponSkillLevel[playa] = skill;
  4414. format(gstr, sizeof(gstr),"Admin %s set your Micro UZI skill to %i",NameEx(playerid),(skill * 100) - 1);
  4415. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4416. format(gstr, sizeof(gstr),"You set %s's Micro UZI skill to %i",NameEx(playa),(skill * 100) - 1);
  4417. SendClientMessage(playerid,COLOR_RED, gstr);
  4418. format(gstr, sizeof(gstr), "Set micro UZI weapon skill to %i", (skill * 100) - 1);
  4419. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4420. return true;
  4421. }
  4422. if(wtype == 7 || strcmp("mp5",Value,true) == 0)
  4423. {
  4424. SetPlayerSkillLevel(playa, WEAPONSKILL_MP5, (skill * 100) - 1);
  4425. WeaponSkillLevel[playa] = skill;
  4426. format(gstr, sizeof(gstr),"Admin %s set your MP5 skill to %i",NameEx(playerid),(skill * 100) - 1);
  4427. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4428. format(gstr, sizeof(gstr),"You set %s's MP5 skill to %i",NameEx(playa),(skill * 100) - 1);
  4429. SendClientMessage(playerid,COLOR_RED, gstr);
  4430. format(gstr, sizeof(gstr), "Set MP5 weapon skill to %i", (skill * 100) - 1);
  4431. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4432. return true;
  4433. }
  4434. if(wtype == 8 || strcmp("ak47",Value,true) == 0)
  4435. {
  4436. SetPlayerSkillLevel(playa, WEAPONSKILL_AK47, (skill * 100) - 1);
  4437. WeaponSkillLevel[playa] = skill;
  4438. format(gstr, sizeof(gstr),"Admin %s set your AK-47 skill to %i",NameEx(playerid),(skill * 100) - 1);
  4439. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4440. format(gstr, sizeof(gstr),"You set %s's AK-47 skill to %i",NameEx(playa),(skill * 100) - 1);
  4441. SendClientMessage(playerid,COLOR_RED, gstr);
  4442. format(gstr, sizeof(gstr), "Set AK47 weapon skill to %i", (skill * 100) - 1);
  4443. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4444. return true;
  4445. }
  4446. if(wtype == 9 || strcmp("M4",Value,true) == 0)
  4447. {
  4448. SetPlayerSkillLevel(playa, WEAPONSKILL_M4, (skill * 100) - 1);
  4449. WeaponSkillLevel[playa] = skill;
  4450. format(gstr, sizeof(gstr),"Admin %s set your M4 skill to %i",NameEx(playerid),(skill * 100) - 1);
  4451. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4452. format(gstr, sizeof(gstr),"You set %s's M4 skill to %i",NameEx(playa),(skill * 100) - 1);
  4453. SendClientMessage(playerid,COLOR_RED, gstr);
  4454. format(gstr, sizeof(gstr), "Set M4 weapon skill to %i", (skill * 100) - 1);
  4455. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4456. return true;
  4457. }
  4458. if(wtype == 10 || strcmp("sniper",Value,true) == 0)
  4459. {
  4460. SetPlayerSkillLevel(playa, WEAPONSKILL_SNIPERRIFLE, (skill * 100) - 1);
  4461. WeaponSkillLevel[playa] = skill;
  4462. format(gstr, sizeof(gstr),"Admin %s set your Sniper skill to %i",NameEx(playerid),(skill * 100) - 1);
  4463. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  4464. format(gstr, sizeof(gstr),"You set %s's Sniper to %i",NameEx(playa),(skill * 100) - 1);
  4465. SendClientMessage(playerid,COLOR_RED, gstr);
  4466. format(gstr, sizeof(gstr), "Set Sniper weapon skill to %i", (skill * 100) - 1);
  4467. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4468. return true;
  4469. }
  4470. if(wtype == 11 || strcmp("all",Value,true) == 0)
  4471. {
  4472. SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL,(skill * 100) - 10);
  4473. SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED,(skill * 100) - 1);
  4474. SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE,(skill * 100) - 1);
  4475. SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN,(skill * 100) - 1);
  4476. SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN,(skill * 100) - 1);
  4477. SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN,(skill * 100) - 1);
  4478. SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI,(skill * 100) - 1);
  4479. SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5,(skill * 100) - 1);
  4480. SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47,(skill * 100) - 1);
  4481. SetPlayerSkillLevel(playerid, WEAPONSKILL_M4,(skill * 100) - 1);
  4482. SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE,(skill * 100) - 1);
  4483. WeaponSkillLevel[playa] = skill;
  4484. SendClientMessageF(playa, COLOR_LIGHTGREEN, "Admin %s set all you weapon skills to %i",NameEx(playerid),(skill * 100) - 1);
  4485. SendClientMessageF(playerid,COLOR_RED, "You set all of %s's weapon skills to %i",NameEx(playa),(skill * 100) - 1);
  4486. format(gstr, sizeof(gstr), "Set ALL weapon skill to %i", (skill * 100) - 1);
  4487. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4488. }
  4489. }
  4490. else if(strmatch("admin", option) || strmatch("adminlevel", option))
  4491. {
  4492. if(!IsPlayerAdminLevelOK(playerid, 4)) return SysMsg(playerid, AUTHMSG);
  4493. if(isnull(Value)) SysMsg(playerid, "Usage: /set [Player ID or Full_Name] adminlevel [level 0-4]");
  4494. if(IsPlayerConnected(playa) || !Logged{playa})
  4495. {
  4496. if(playa == playerid) return SysMsg(playerid, "Cannot be yourself.");
  4497. if(strval(Value) < 0 || strval(Value) > 4) return SysMsg(playerid,"Admin level must be between 0 and 4.");
  4498. AdminLevel[playa] = strval(Value);
  4499. if(IsHelper{playa}) IsHelper{playa} = false;
  4500. mysql_format(conn, mquery, sizeof(mquery), "UPDATE masters SET AdminLevel = %i, Helper = %i WHERE id = %i", AdminLevel[playa], IsHelper{playa}, MasterAccount[playa]);
  4501. mysql_pquery(conn, mquery);
  4502. if(strval(Value) > AdminLevel[playa]) return PlaySoundForPlayer(playa, 31205);
  4503. SendClientMessageF(playa,COLOR_LIGHTBLUE, "Admin %s has changed your admin level to %i.",NameEx(playerid),AdminLevel[playa]);
  4504. SendClientMessageF(playerid,COLOR_RED, "You changed %s's admin level to %i.",NameEx(playa),AdminLevel[playa]);
  4505. format(gstr, sizeof(gstr), "Set admin level to %i", strval(Value));
  4506. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  4507. }
  4508. else if(strfind(pname, "_") != -1)
  4509. {
  4510. new sqlid = MySQLCheckMaster_AgainstName(pname);
  4511. if(sqlid <= 1) return SysMsg(playerid, "Name was not found. Please include first name, last name and an underscore OR use there current ingame ID.");
  4512. if(sqlid == SQLID[playerid]) return SysMsg(playerid, "Cannot be yourself.");
  4513. if(strval(Value) < 0 || strval(Value) > 4) return SysMsg(playerid,"Admin level must be between 0 and 4.");
  4514. mysql_format(conn, mquery, sizeof(mquery), "UPDATE masters SET AdminLevel = %i, Helper = 0 WHERE id = %i", strval(Value), sqlid);
  4515. mysql_pquery(conn, mquery);
  4516. SendClientMessageF(playerid,COLOR_RED, "You changed %s's admin level to %i.",GetSQLName(sqlid),strval(Value));
  4517. format(gstr, sizeof(gstr), "Set admin level to %i", strval(Value));
  4518. AdminLog(playerid, sqlid, GetSQLName(sqlid), gstr);
  4519. }
  4520. }
  4521. else return SysMsg(playerid, "You are not authorized to use this command or you have entered an invalid option.");
  4522. return true;
  4523. }
  4524. CMD:recordbot(playerid, params[])
  4525. {
  4526. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  4527. if(isnull(params)) return SysMsg(playerid,"Usage: /record [name *1 WORD*]");
  4528. new VehID = GetPlayerVehicleID(playerid);
  4529. if(VehID > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) StartRecordingPlayerData(playerid, PLAYER_RECORDING_TYPE_DRIVER, params);
  4530. else StartRecordingPlayerData(playerid, PLAYER_RECORDING_TYPE_ONFOOT, params);
  4531. GameTextForPlayer(playerid,"~n~~n~~n~~n~~r~~>~REC",5000,3);
  4532. return true;
  4533. }
  4534. CMD:stoprecord(playerid, params[])
  4535. {
  4536. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  4537. StopRecordingPlayerData(playerid);
  4538. SendClientMessage(playerid, COLOR_WHITE, ">> The Recording Has Been Saved.");
  4539. return true;
  4540. }
  4541. CMD:object(playerid, params[])
  4542. {
  4543. if(!Logged{playerid}) return true;
  4544. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  4545. new option[24], modelid[24], purpose[64];
  4546. if(sscanf(params, "s[24]S(-1)[24]S()[64]", option, modelid, purpose)) return SysMsg(playerid, "Usage: /object [spawn/destroy/goto/edit/view/export]");
  4547. if(strmatch(option, "spawn"))
  4548. {
  4549. if(strval(modelid) == -1) return SysMsg(playerid, "Please enter a valid model ID.");
  4550. if(!strlen(purpose)) return SysMsg(playerid, "Please enter a purpose for the object.");
  4551. if(GetFreeTempObjectSlot() == -1) return SysMsg(playerid, "There are no free object slots at the moment.");
  4552. if(IsValidModel(strval(modelid))) return SysMsg(playerid, "Invalid model ID.");
  4553. new slot = GetFreeTempObjectSlot();
  4554. GetPlayerPos(playerid, TempObjects[slot][ObjectPosX], TempObjects[slot][ObjectPosY], TempObjects[slot][ObjectPosZ]);
  4555. GetPlayerFacingAngle(playerid, TempObjects[slot][ObjectPosRZ]);
  4556. GetXYInFrontOfPlayer(playerid, TempObjects[slot][ObjectPosX], TempObjects[slot][ObjectPosY], 1.5);
  4557. TempObjects[slot][ObjectID] = CreateDynamicObject(strval(modelid), TempObjects[slot][ObjectPosX], TempObjects[slot][ObjectPosY], TempObjects[slot][ObjectPosZ], 0.0, 0.0, TempObjects[slot][ObjectPosRZ], GetPlayerVirtualWorld(playerid));
  4558. TempObjects[slot][ObjectModel] = strval(modelid);
  4559. TempObjects[slot][ObjectVW] = GetPlayerVirtualWorld(playerid);
  4560. TempObjects[slot][ObjectPosRX] = 0.0;
  4561. TempObjects[slot][ObjectPosRY] = 0.0;
  4562. TempObjects[slot][ObjectPurpose] = purpose;
  4563. TempObjects[slot][SpawnedBy] = SQLID[playerid];
  4564. EditingTempObject[playerid] = slot;
  4565. EditDynamicObject(playerid, TempObjects[slot][ObjectID]);
  4566. format(gstr, sizeof(gstr), "Spawned temporary object. (%i)", strval(modelid));
  4567. AdminLog(playerid, 0, "", gstr);
  4568. return true;
  4569. }
  4570. else if(strmatch(option, "destroy"))
  4571. {
  4572. if(strval(modelid) == -1) return SysMsg(playerid, "Please enter a slot.");
  4573. if(strval(modelid) < 0 || strval(modelid) > MAX_TEMPOBJECTS) return SysMsgF(playerid, "Object slot must be from 0-%i", MAX_TEMPOBJECTS);
  4574. if(TempObjects[strval(modelid)][ObjectID] == INVALID_OBJECT_ID) return SysMsg(playerid, "No object found in this slot.");
  4575. new slot = strval(modelid);
  4576. DestroyDynamicObjectEx(TempObjects[slot][ObjectID], "TempObjects[slot][ObjectID]");
  4577. TempObjects[slot][ObjectID] = INVALID_OBJECT_ID;
  4578. TempObjects[slot][ObjectModel] = 0;
  4579. TempObjects[slot][ObjectVW] = 0;
  4580. TempObjects[slot][ObjectPosX] = 0;
  4581. TempObjects[slot][ObjectPosY] = 0;
  4582. TempObjects[slot][ObjectPosZ] = 0;
  4583. TempObjects[slot][ObjectPosRX] = 0;
  4584. TempObjects[slot][ObjectPosRY] = 0;
  4585. TempObjects[slot][ObjectPosRZ] = 0;
  4586. TempObjects[slot][ObjectPurpose][0] = EOS;
  4587. TempObjects[slot][SpawnedBy] = 0;
  4588. SendClientMessageF(playerid, COLOR_RED, "You have destroyed object %i.", slot);
  4589. return true;
  4590. }
  4591. else if(strmatch(option, "goto"))
  4592. {
  4593. if(strval(modelid) == -1) return SysMsg(playerid, "Please enter a slot.");
  4594. if(strval(modelid) < 0 || strval(modelid) > MAX_TEMPOBJECTS) return SysMsgF(playerid, "Object slot must be from 0-%i", MAX_TEMPOBJECTS);
  4595. if(TempObjects[strval(modelid)][ObjectID] == INVALID_OBJECT_ID) return SysMsg(playerid, "No object found in this slot.");
  4596. new slot = strval(modelid);
  4597. SetPlayerPos(playerid, TempObjects[slot][ObjectPosX], TempObjects[slot][ObjectPosY], TempObjects[slot][ObjectPosZ] + 2);
  4598. SetPlayerVirtualWorld(playerid, TempObjects[slot][ObjectVW]);
  4599. SendClientMessageF(playerid, COLOR_RED, "You have teleported to object %i.", slot);
  4600. return true;
  4601. }
  4602. else if(strmatch(option, "edit"))
  4603. {
  4604. if(strval(modelid) == -1) return SysMsg(playerid, "Please enter a slot.");
  4605. if(strval(modelid) < 0 || strval(modelid) > MAX_TEMPOBJECTS) return SysMsgF(playerid, "Object slot must be from 0-%i", MAX_TEMPOBJECTS);
  4606. if(TempObjects[strval(modelid)][ObjectID] == INVALID_OBJECT_ID) return SysMsg(playerid, "No object found in this slot.");
  4607. new slot = strval(modelid);
  4608. if(!IsPlayerInRangeOfPoint(playerid, 50.0, TempObjects[slot][ObjectPosX], TempObjects[slot][ObjectPosY], TempObjects[slot][ObjectPosZ])) return SysMsg(playerid, "You must be closer to the object to edit it.");
  4609. EditingTempObject[playerid] = slot;
  4610. EditDynamicObject(playerid, TempObjects[slot][ObjectID]);
  4611. }
  4612. else if(strmatch(option, "view"))
  4613. {
  4614. new bigstr[3000], count = 0;
  4615. strcat(bigstr, "Slot\tModel\tPurpose\tSpawned By\n");
  4616. for(new x = 0; x < MAX_TEMPOBJECTS; x++)
  4617. {
  4618. if(TempObjects[x][ObjectID] != INVALID_OBJECT_ID)
  4619. {
  4620. format(sgstr, sizeof(sgstr), "%i\t%i\t%s\t%s\n", x, TempObjects[x][ObjectModel], TempObjects[x][ObjectPurpose], GetSQLName(TempObjects[x][SpawnedBy]));
  4621. strcat(bigstr, sgstr);
  4622. count ++;
  4623. }
  4624. }
  4625. if(count == 0) return SysMsg(playerid, "There are no objects spawned at the moment.");
  4626. Dialog_Show(playerid, ObjectTeleport, DIALOG_STYLE_TABLIST_HEADERS, "Current Temporary Objects", bigstr, "Teleport", "Close");
  4627. }
  4628. else if(strmatch(option, "export"))
  4629. {
  4630. if(sscanf(params, "s[24]s[32]", option, modelid)) return SysMsg(playerid, "Usage: /object export [filename] *MUST INCLUDE .TXT*");
  4631. new File:f = fopen(modelid, io_write);
  4632. for(new x = 0; x < MAX_TEMPOBJECTS; x++)
  4633. {
  4634. if(TempObjects[x][ObjectID] != INVALID_OBJECT_ID)
  4635. {
  4636. format(sgstr, sizeof(sgstr), "CreateDynamicObject(%i, %f, %f, %f, %f, %f, %f); //%s (%s)\r\n",TempObjects[x][ObjectModel], TempObjects[x][ObjectPosX],TempObjects[x][ObjectPosY],
  4637. TempObjects[x][ObjectPosZ], TempObjects[x][ObjectPosRX], TempObjects[x][ObjectPosRY], TempObjects[x][ObjectPosRZ], TempObjects[x][ObjectPurpose], GetSQLName(TempObjects[x][SpawnedBy]));
  4638. fwrite(f, sgstr);
  4639. }
  4640. }
  4641. fclose(f);
  4642. }
  4643. else cmd_object(playerid, "");
  4644. return true;
  4645. }
  4646. CMD:tagban(playerid, params[])
  4647. {
  4648. if(!Logged{playerid}) return true;
  4649. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  4650. new playa = -1;
  4651. if(sscanf(params, "u", playa)) return SysMsg(playerid, "Usage: /tagban [playerid or name] *THIS CANNOT BE REMOVED*");
  4652. if(TagBanned{playa}) return SysMsg(playerid, "This user is already tag banned.");
  4653. mysql_format(conn, mquery, sizeof(mquery), "UPDATE masters SET TagBanned = 1 WHERE id = %i", MasterAccount[playa]);
  4654. mysql_pquery(conn, mquery);
  4655. TagBanned{playa} = true;
  4656. SendClientMessageF(playerid, COLOR_RED, "[Admin] You have banned %s from using tag labels.", NameEx(playa));
  4657. SendClientMessageF(playa, COLOR_RED, "Admin %s has banned you from using tag labels.", NameEx(playerid));
  4658. return true;
  4659. }
  4660. CMD:tag(playerid, params[])
  4661. {
  4662. if(!Logged{playerid}) return true;
  4663. if(TagBanned{playerid}) return SysMsg(playerid, "You are banned from using this feature.");
  4664. if(PlayerLevel[playerid] < 4 && !IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, "You must be at least level 4 to use this feature.");
  4665. new option[24], value[150];
  4666. if(sscanf(params, "s[24]S()[150]", option, value)) return SysMsg(playerid, "Usage: /tag [create/destroy/id/edit]");
  4667. if(strcmp(option, "create", true) == 0)
  4668. {
  4669. if(isnull(value)) return SysMsg(playerid, "Usage: /tag create [description]");
  4670. if(PlayerHasLabel(playerid) && !IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, "You've already created a descriptive tag. Please contact an admin to create more.");
  4671. if(Dead{playerid}) return SysMsg(playerid, "You cannot used this feature while downed.");
  4672. if(strlen(value) > 140) return SysMsg(playerid, "Your tag message is too long. Please shorten it.");
  4673. new temptext[150];
  4674. temptext = value;
  4675. if(strlen(temptext) > 100) strins(temptext, "\n", 101);
  4676. SetPVarString(playerid, "PendingLabelText", value);
  4677. format(sgstr, sizeof(sgstr), "Are you sure you wish to create a tag with the following text?\n\n%s", temptext);
  4678. Dialog_Show(playerid, LabelCreate, DIALOG_STYLE_MSGBOX, "Are you sure?", sgstr, "Yes", "No");
  4679. return true;
  4680. }
  4681. else if(strcmp(option, "destroy", true) == 0)
  4682. {
  4683. if(!IsPlayerAdminLevelOK(playerid, 1))
  4684. {
  4685. for(new x = 0; x < MAX_LABELS; x++)
  4686. {
  4687. if(RPLabels[x][LabelOwner] == SQLID[playerid])
  4688. {
  4689. DestroyRPLabel(x);
  4690. SendClientMessage(playerid, COLOR_RED, "You have removed your label.");
  4691. return true;
  4692. }
  4693. }
  4694. SysMsg(playerid, "Could not find a tag created by you.");
  4695. return true;
  4696. }
  4697. if(isnull(value)) return SysMsg(playerid, "Usage: /tag destroy [tag id] *Use /tag id near a tag to get its ID.*");
  4698. if(!IsNumeric(value)) return SysMsg(playerid, "Tag ID must be numeric.");
  4699. new id = strval(value);
  4700. if(id < 0 || id >= MAX_LABELS) return SysMsgF(playerid, "Value must be greater than 0 and less than %i.", MAX_LABELS);
  4701. if(!RPLabels[id][LabelUsed]) return SysMsg(playerid, "This label ID is currently not in use.");
  4702. DestroyRPLabel(id);
  4703. SendClientMessageF(playerid, COLOR_RED, "You have removed label %i.", id);
  4704. return true;
  4705. }
  4706. else if(strcmp(option, "id", true) == 0)
  4707. {
  4708. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  4709. for(new x = 0; x < MAX_LABELS; x++)
  4710. {
  4711. if(IsPlayerInRangeOfPoint(playerid, 2.5, RPLabels[x][LabelX], RPLabels[x][LabelY], RPLabels[x][LabelZ]))
  4712. {
  4713. SendClientMessageF(playerid, COLOR_RED, "This label is owned by %s and its label ID is %i.", GetSQLName(RPLabels[x][LabelOwner]), x);
  4714. return true;
  4715. }
  4716. }
  4717. SysMsg(playerid, "You are not near any labels.");
  4718. return true;
  4719. }
  4720. else if(strcmp(option, "edit", true) == 0)
  4721. {
  4722. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  4723. new value2[150];
  4724. if(sscanf(params, "s[24]s[150]s[150]", option, value, value2))
  4725. if(!IsNumeric(value)) return SysMsg(playerid, "Tag ID must be numeric.");
  4726. if(strval(value) < 0 || strval(value) >= MAX_LABELS) return SysMsgF(playerid, "Value must be greater than 0 and less than %i.", MAX_LABELS);
  4727. if(!RPLabels[strval(value)][LabelUsed]) return SysMsg(playerid, "That label ID is currently not in use.");
  4728. if(strlen(value2) > 140) return SysMsg(playerid, "Your tag message is too long. Please shorten it.");
  4729. new id = strval(value);
  4730. UpdateDynamic3DTextLabelText(RPLabels[id][LabelID], COLOR_WHITE, value2);
  4731. SendSplitMessageF(playerid, COLOR_RED, "You have updated the label text to '%s'", value2);
  4732. return true;
  4733. }
  4734. return true;
  4735. }
  4736. stock PlayerHasLabel(playerid)
  4737. {
  4738. for(new x = 0; x < MAX_LABELS; x++)
  4739. {
  4740. if(RPLabels[x][LabelOwner] == SQLID[playerid]) return true;
  4741. }
  4742. return false;
  4743. }
  4744. stock CreateRPLabel(playerid, text[])
  4745. {
  4746. new x = GetFreeRPLabelID();
  4747. if(x == -1) return SysMsg(playerid, "There are currently no label slots available.");
  4748. GetPlayerPos(playerid, RPLabels[x][LabelX], RPLabels[x][LabelY], RPLabels[x][LabelZ]);
  4749. RPLabels[x][LabelID] = CreateDynamic3DTextLabel(text, COLOR_WHITE, RPLabels[x][LabelX], RPLabels[x][LabelY], RPLabels[x][LabelZ], 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, GetPlayerVirtualWorld(playerid));
  4750. RPLabels[x][LabelUsed] = true;
  4751. RPLabels[x][LabelOwner] = SQLID[playerid];
  4752. SendClientMessage(playerid, COLOR_WHITE, "You have successfully created a descriptive tag.");
  4753. return true;
  4754. }
  4755. stock DestroyRPLabel(id)
  4756. {
  4757. DestroyDynamic3DTextLabel(RPLabels[id][LabelID]);
  4758. RPLabels[id][LabelID] = Text3D:INVALID_3DTEXT_ID;
  4759. RPLabels[id][LabelX] = 0.0;
  4760. RPLabels[id][LabelY] = 0.0;
  4761. RPLabels[id][LabelZ] = 0.0;
  4762. RPLabels[id][LabelUsed] = false;
  4763. RPLabels[id][LabelOwner] = 0;
  4764. return true;
  4765. }
  4766. stock GetFreeRPLabelID()
  4767. {
  4768. for(new x = 0; x < MAX_LABELS; x++)
  4769. {
  4770. if(!RPLabels[x][LabelUsed]) return x;
  4771. }
  4772. return -1;
  4773. }
  4774. CMD:aspray(playerid, params[])
  4775. {
  4776. if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to use this feature.");
  4777. if(!IsPlayerAdminLevelOK(playerid, 2)) return SysMsg(playerid, AUTHMSG);
  4778. if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You must be in a vehicle to re-spray.");
  4779. new color1, color2;
  4780. if(sscanf(params, "iI(-1)", color1, color2)) return SysMsg(playerid,"Usage: /spray [Primary color] [Optional: Secondary color]");
  4781. if(color1 < 0 || color1 > 255) return SysMsg(playerid,"Primary color must be between 0 and 255.");
  4782. if(color2 == -1) color2 = color1;
  4783. else if(color2 < 0 || color2 > 255) return SysMsg(playerid,"Secondary color 2 must be between 0 and 255.");
  4784. new v = GetPlayerVehicleID(playerid);
  4785. if(v == INVALID_VEHICLE_ID) return SysMsg(playerid, "You are not in a vehicle.");
  4786. if(FVehicleData[v][FVFaction] > 0)
  4787. {
  4788. mysql_format(conn, mquery, sizeof(mquery), "UPDATE fveh SET Col1 = %i, Col2 = %i WHERE id = %i", color1, color2, FVehicleData[v][FVSQLID]);
  4789. mysql_pquery(conn, mquery);
  4790. FVehicleData[v][FVCol1] = color1;
  4791. FVehicleData[v][FVCol2] = color2;
  4792. ChangeVehicleColorEx(v, color1, color2);
  4793. ShowInfoText(playerid,"~G~R~R~E~B~S~Y~P~P~R~W~A~G~Y",3000);
  4794. SendClientMessageF(playerid, COLOR_WHITE, "Faction vehicle color changed to: %s(%i) & %s(%i)", VehicleColors[color1], color1, VehicleColors[color2], color2);
  4795. return true;
  4796. }
  4797. else if(VehicleData[v][VehicleOwnerSQLID] > 0)
  4798. {
  4799. mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET Color1 = %i, Color2 = %i WHERE id = %i", color1, color2, VehicleData[v][VehSQLID]);
  4800. mysql_pquery(conn, mquery);
  4801. VehicleData[v][vColor1] = color1;
  4802. VehicleData[v][vColor2] = color2;
  4803. ChangeVehicleColorEx(v, color1, color2);
  4804. ShowInfoText(playerid,"~G~R~R~E~B~S~Y~P~P~R~W~A~G~Y",3000);
  4805. SendClientMessageF(playerid, COLOR_WHITE, "Owned vehicle color changed to: %s(%i) & %s(%i)", VehicleColors[color1], color1, VehicleColors[color2], color2);
  4806. return true;
  4807. }
  4808. else if(aspawned{v})
  4809. {
  4810. ChangeVehicleColorEx(v, color1, color2);
  4811. SendClientMessageF(playerid, COLOR_WHITE, "Admin spawned vehicle color changed to: %s(%i) & %s(%i)", VehicleColors[color1], color1, VehicleColors[color2], color2);
  4812. return true;
  4813. }
  4814. return true;
  4815. }
  4816. CMD:afix(playerid, params[])
  4817. {
  4818. if(!Logged{playerid}) return true;
  4819. if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
  4820. new id;
  4821. if(IsPlayerInAnyVehicle(playerid) && sscanf(params, "i", id)) id = GetPlayerVehicleID(playerid);
  4822. else if(sscanf(params, "i", id)) return SysMsg(playerid, "Usage: /afix [vehicleid]");
  4823. if(id > GetVehiclePoolSize()) return SysMsg(playerid, "No such vehicle.");
  4824. VehicleBroke[id] = 0;
  4825. FuelTypeAfterRefuel[id] = 0;
  4826. PlayerPlaySound(playerid, SOUND_CAR_MOD, 0, 0, 0);
  4827. RepairVehicleEx(id);
  4828. format(gstr, sizeof(gstr), "[Admin] Admin %s has admin fixed an %s [ID %i].", NameEx(playerid), GetVehicleName(id), id);
  4829. AdminBroadcast(gstr, 1, 4);
  4830. return true;
  4831. }
  4832. CMD:acases(playerid, params[])
  4833. {
  4834. if(!Logged{playerid}) return true;
  4835. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  4836. new count = 0;
  4837. SendClientMessage(playerid, COLOR_WHITE, "Currently Admin Jailed ");
  4838. foreach(new i: Player)
  4839. {
  4840. if(Logged{i})
  4841. {
  4842. if(AdminJailData[i][0] == 1)
  4843. {
  4844. SendClientMessageF(playerid, COLOR_LIGHTBLUE, "%s (%i) - %i minute(s) remaining.", NameEx(i), i, AdminJailData[i][1]);
  4845. count++;
  4846. }
  4847. }
  4848. }
  4849. if(count == 0) SendClientMessage(playerid, COLOR_LIGHTBLUE, "None");
  4850. return true;
  4851. }
  4852. CMD:clearstingers(playerid, params[])
  4853. {
  4854. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  4855. foreach(new i: Player)
  4856. {
  4857. if(StingerObjectID[i] >= 1)
  4858. {
  4859. DestroyDynamicObjectEx(StingerObjectID[i], "StingerObjectID[i] 0");
  4860. StingerObjectID[i] = INVALID_OBJECT_ID;
  4861. DestroyDynamicArea(StingerAreaID[i]);
  4862. StingerAreaID[i] = -1;
  4863. }
  4864. }
  4865. SendClientMessage(playerid, COLOR_LIGHTBLUE, "All stingers cleared.");
  4866. return true;
  4867. }
  4868. CMD:removefires(playerid, params[])
  4869. {
  4870. if(!Logged{playerid}) return true;
  4871. if((Faction[playerid] == FACTION_SACFD && FactionRank[playerid] > 8) || IsPlayerAdminLevelOK(playerid, 1))
  4872. {
  4873. new count = 0;
  4874. for(new i = 0; i < MAX_FIRES; i++)
  4875. {
  4876. if(Flame[i][Spawned] == 1)
  4877. {
  4878. count ++;
  4879. RemoveFire(i);
  4880. }
  4881. }
  4882. SendClientMessageF(playerid, COLOR_WHITE, "%i fires have been extinguished", count);
  4883. }
  4884. else SysMsg(playerid, AUTHMSG);
  4885. return true;
  4886. }
  4887. CMD:togengine(playerid, params[])
  4888. {
  4889. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  4890. new vehicleid, status[5];
  4891. if(sscanf(params, "is[5]", vehicleid, status)) return SysMsg(playerid, "Usage: /togengine [vehicle ID] [on/off]");
  4892. if(vehicleid == INVALID_VEHICLE_ID) return SysMsg(playerid, "Invalid vehicle.");
  4893. if(strmatch(status, "on"))
  4894. {
  4895. SendClientMessageF(playerid, COLOR_RED, "You have enabled the engine of this %s (%i)", GetVehicleName(vehicleid), vehicleid);
  4896. ToggleVehicleEngine(vehicleid, 1);
  4897. }
  4898. if(strmatch(status, "off"))
  4899. {
  4900. SendClientMessageF(playerid, COLOR_RED, "You have disable the engine of this %s (%i)", GetVehicleName(vehicleid), vehicleid);
  4901. ToggleVehicleEngine(vehicleid, 0);
  4902. }
  4903. return true;
  4904. }
  4905. CMD:makehouse(playerid, params[])
  4906. {
  4907. if(!Logged{playerid}) return true;
  4908. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  4909. if(GetFreeHouseArraySlot() == -1) return SysMsg(playerid, "No free house slots. (MAX_HOUSES reached)");
  4910. new NewHouseCost, NewInsideID, Description[30];
  4911. if(sscanf(params, "iis[30]", NewHouseCost, NewInsideID, Description)) return SysMsg(playerid,"Usage: /makehouse [cost] [inside option] [desc]");
  4912. if(NewHouseCost < 1) return SysMsg(playerid,"Cost must be > 0");
  4913. if(NewInsideID < 1 || NewInsideID > 29) return SysMsg(playerid,"No such InsideID.");
  4914. mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO houses (Description,oPosX,oPosY,oPosZ) VALUES ('%e',%f,%f,%f)", Description, PlayerPosX(playerid), PlayerPosY(playerid), PlayerPosZ(playerid));
  4915. mysql_pquery(conn, mquery, "InsertHouse", "ddds", playerid, NewHouseCost, NewInsideID, Description);
  4916. return true;
  4917. }
  4918. CMD:makegarage(playerid, params[])
  4919. {
  4920. new GarageType, GarageHouse, Float:pos[3], Float:angle;
  4921. if(!IsPlayerAdminLevelOK(playerid, 4)) return SysMsg(playerid, AUTHMSG);
  4922. if(sscanf(params, "iif", GarageType, GarageHouse, angle)) return SysMsg(playerid,"Usage: /makegarage [garage type] [house ID(use /checkid at house)] [vehicle exit angle]");
  4923. GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  4924. mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO garages (HouseSQLID, GarageType, OutsideX, OutsideY, OutsideZ, InsideVW, OutsideVAngle) VALUES (%i, %i, %f, %f, %f, %i, %f)", GarageHouse, GarageType, pos[0], pos[1], pos[2], GarageHouse+60000, angle);
  4925. mysql_pquery(conn, mquery, "InsertHouseGarage", "iiifffif", GarageHouse, GarageType, pos[0], pos[1], pos[2], GarageHouse+60000, angle);
  4926. return true;
  4927. }
  4928. GREENSIDE::InsertHouseGarage(playerid, GarageHouse, GarageType, Float:x, Float:y, Float:z, VW, Float:angle)
  4929. {
  4930. new g = GetFreeGarageArraySlot();
  4931. GarageData[g][gID] = cache_insert_id();
  4932. GarageData[g][gHouseID] = GetHouseIDFromSQLID(GarageHouse);
  4933. GarageData[g][gType] = GarageType;
  4934. GarageData[g][oPosX] = x;
  4935. GarageData[g][oPosY] = y;
  4936. GarageData[g][oPosZ] = z;
  4937. GarageData[g][iPosX] = 0.0;
  4938. GarageData[g][iPosY] = 0.0;
  4939. GarageData[g][iPosZ] = 0.0;
  4940. GarageData[g][iAngle] = 0.0;
  4941. GarageData[g][oAngle] = 0.0;
  4942. GarageData[g][oVehicleAngle] = angle;
  4943. GarageData[g][iVehicleAngle] = 0.0;
  4944. GarageData[g][iVirtualWorld] = VW;
  4945. GarageData[g][oVirtualWorld] = 0;
  4946. GarageData[g][GaragePickup] = CreateDynamicPickup(1318, 23, GarageData[g][oPosX], GarageData[g][oPosY], GarageData[g][oPosZ], 0, 0, -1, 10);
  4947. SysMsg(playerid, "Garage has been created.");
  4948. return true;
  4949. }
  4950. GREENSIDE::InsertHouse(playerid, NewHouseCost, NewInsideID, Desc[])
  4951. {
  4952. new houseID = cache_insert_id(), vw = houseID+20000;
  4953. mysql_format(conn, mquery, sizeof(mquery), "UPDATE houses SET Price = %i, InsideID = %i, HouseVW = %i, OwnerSQLID = 0 WHERE id = %i", NewHouseCost, NewInsideID, vw, houseID);
  4954. mysql_pquery(conn, mquery);
  4955. mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM houses WHERE id = %i LIMIT 1", houseID);
  4956. mysql_pquery(conn, mquery, "LoadHouses", "d", 1);
  4957. format(gstr, sizeof(gstr), "Created house '%s' for $%i", Desc, NewHouseCost);
  4958. AdminLog(playerid, 0, "", gstr);
  4959. return true;
  4960. }
  4961. CMD:edithouse(playerid, params[])
  4962. {
  4963. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  4964. new houseid = -1;
  4965. for(new h = 0; h < MAX_HOUSES; h++)
  4966. {
  4967. if(IsPlayerInRangeOfPoint(playerid,DOOR_PROXIMITY,HouseData[h][oPosX],HouseData[h][oPosY],HouseData[h][oPosZ]) && GetPlayerVirtualWorld(playerid) == HouseData[h][HouseExtVW])
  4968. {
  4969. houseid = h;
  4970. break;
  4971. }
  4972. }
  4973. if(houseid == -1) return SysMsg(playerid,"You are not near any house.");
  4974. new element[10], value[30];
  4975. if(sscanf(params, "s[10]s[30]", element, value)) return SysMsg(playerid,"Usage: /edithouse [element] [value] Elements: Cost, Owner, InsideID, Name, Steamdist");
  4976. if(strcmp("cost", element, true) == 0)
  4977. {
  4978. if(!IsNumeric(value)) return SysMsg(playerid,"Cost must be a number.");
  4979. new NewHouseCost = strval(value);
  4980. if(NewHouseCost < 1) return SysMsg(playerid,"Cost must be > 0");
  4981. MySQLUpdateInt(HouseData[houseid][HouseSQLID], "Price", NewHouseCost, "houses");
  4982. HouseData[houseid][HousePrice] = NewHouseCost;
  4983. SysMsgF(playerid, "House Price Is Now $%i.", HouseData[houseid][HousePrice]);
  4984. format(gstr, sizeof(gstr), "Edited house #%i price to $%i", HouseData[houseid][HouseSQLID], NewHouseCost);
  4985. AdminLog(playerid, 0, "", gstr);
  4986. return true;
  4987. }
  4988. else if(strcmp("insideid", element, true) == 0)
  4989. {
  4990. if(!IsNumeric(value)) return SysMsg(playerid,"Inside ID must be a number.");
  4991. new NewInsideID = strval(value);
  4992. if(NewInsideID < 1 || NewInsideID > 35) return SysMsg(playerid,"Invalid Inside ID.");
  4993. if(NewInsideID == HouseData[houseid][HouseInterior]) return SysMsgF(playerid, "InsideID is already %i", NewInsideID);
  4994. if(NewInsideID == 11)
  4995. {
  4996. new Float:X, Float:Y, Float:Z, houseint;
  4997. if(sscanf(params, "s[10]ifffi", element, NewInsideID, X, Y, Z, houseint)) return SysMsg(playerid,"Usage: /edithouse InsideID 11 [x] [y] [z] [interior]");
  4998. mysql_format(conn, mquery, sizeof(mquery), "UPDATE houses SET intPosX = %f, intPosY = %f, intPosZ = %f, InsideID = 11, HouseInterior = %i WHERE id = %i", X, Y, Z, houseint, HouseData[houseid][HouseSQLID]);
  4999. mysql_pquery(conn, mquery);
  5000. HouseData[houseid][InsideID] = NewInsideID;
  5001. HouseData[houseid][HouseInterior] = houseint;
  5002. HouseData[houseid][intPosX] = X;
  5003. HouseData[houseid][intPosY] = Y;
  5004. HouseData[houseid][intPosZ] = Z;
  5005. SysMsgF(playerid, "House Inside ID Is Now %i. [%f, %f, %f, interior %i]", HouseData[houseid][InsideID], X, Y, Z, houseint);
  5006. return true;
  5007. }
  5008. mysql_format(conn, mquery, sizeof(mquery), "UPDATE houses SET intPosX = 0.0, intPosY = 0.0, intPosZ = 0.0, InsideID = %i WHERE id = %i", NewInsideID, HouseData[houseid][HouseSQLID]);
  5009. mysql_pquery(conn, mquery);
  5010. HouseData[houseid][InsideID] = NewInsideID;
  5011. HouseData[houseid][intPosX] = 0.0;
  5012. HouseData[houseid][intPosY] = 0.0;
  5013. HouseData[houseid][intPosZ] = 0.0;
  5014. SysMsgF(playerid, "House Inside ID Is Now %i.", HouseData[houseid][InsideID]);
  5015. format(gstr, sizeof(gstr), "Edited house #%i inside ID to %i", houseid, NewInsideID);
  5016. AdminLog(playerid, 0, "", gstr);
  5017. return true;
  5018. }
  5019. else if(strcmp("owner", element, true) == 0)
  5020. {
  5021. if(strcmp(value, "None", false) == 0)
  5022. {
  5023. foreach(new i: Player)
  5024. {
  5025. if(HouseData[houseid][HouseOwnerSQLID] == SQLID[i])
  5026. {
  5027. HasHouseKey[i][0] = -1;
  5028. HasHouseKey[i][1] = -1;
  5029. ProcessHouseKey(i);
  5030. break;
  5031. }
  5032. }
  5033. HouseData[houseid][HouseOwnerSQLID] = 0;
  5034. HouseData[houseid][HouseLocked] = 0;
  5035. UpdateHousePickup(houseid);
  5036. MySQLUpdateInt(HouseData[houseid][HouseSQLID], "OwnerSQLID", 0, "houses");
  5037. format(sgstr, sizeof(sgstr), "Edited house #%i owner to NONE", houseid);
  5038. AdminLog(playerid, 0, "", sgstr);
  5039. return true;
  5040. }
  5041. new accid = MySQLCheckAccount(value, playerid);
  5042. if(accid == 0) return SysMsg(playerid, "No player account found.");
  5043. MySQLUpdateInt(HouseData[houseid][HouseSQLID], "OwnerSQLID", accid, "houses");
  5044. foreach(new i: Player)
  5045. {
  5046. if(HouseData[houseid][HouseOwnerSQLID] == SQLID[i])
  5047. {
  5048. HasHouseKey[i][0] = -1;
  5049. HasHouseKey[i][1] = -1;
  5050. ProcessHouseKey(i);
  5051. break;
  5052. }
  5053. }
  5054. HouseData[houseid][HouseOwnerSQLID] = accid;
  5055. SysMsgF(playerid, "House Owner Is Now %s.", GetSQLName(HouseData[houseid][HouseOwnerSQLID]));
  5056. format(gstr, sizeof(gstr), "Edited house #%i owner to %s", GetSQLName(HouseData[houseid][HouseOwnerSQLID]));
  5057. AdminLog(playerid, 0, "", gstr);
  5058. return true;
  5059. }
  5060. else if(strcmp("name", element, true) == 0)
  5061. {
  5062. MySQLUpdateString(HouseData[houseid][HouseSQLID], "Description", value, "houses");
  5063. format(HouseData[houseid][HouseDescription], 60, value);
  5064. UpdateHouseLabel(houseid);
  5065. SysMsgF(playerid, "House Name Is Now %s.", HouseData[houseid][HouseDescription]);
  5066. format(gstr, sizeof(gstr), "Edited house #%i name to %s", HouseData[houseid][HouseSQLID], HouseData[houseid][HouseDescription]);
  5067. AdminLog(playerid, 0, "", gstr);
  5068. return true;
  5069. }
  5070. else if(strcmp("streamdist", element, true) == 0)
  5071. {
  5072. if(!IsNumeric(value)) return SysMsg(playerid, "Usage: /edithouse streamdist [value] *Must be numeric*");
  5073. new distance = strval(value);
  5074. if(distance > 25) return SysMsg(playerid, "Distance must be 25 or greater.");
  5075. HouseData[houseid][ExtStreamDist] = float(distance);
  5076. mysql_format(conn, mquery, sizeof(mquery), "UPDATE houses SET ExteriorStreamDistance = %f WHERE id = %i", float(distance), HouseData[houseid][HouseSQLID]);
  5077. mysql_pquery(conn, mquery);
  5078. SysMsgF(playerid, "House exterior furniture distance set to %i", distance);
  5079. return true;
  5080. }
  5081. SysMsg(playerid,"*Usage: /edithouse [element] [value] Elements: Cost, Owner, InsideID, Name");
  5082. return true;
  5083. }
  5084. CMD:editveh(playerid, params[])
  5085. {
  5086. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  5087. if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a vehicle.");
  5088. new vehicle = GetPlayerVehicleID(playerid), element[10], value[30];
  5089. if(sscanf(params, "s[10]S()[30]", element, value)) return SysMsg(playerid,"Usage: /editveh [element] [value] Elements: Cost, Pos, Locked, Regplate");
  5090. if(strcmp("cost", element, true) == 0)
  5091. {
  5092. if(vehicle == VehicleData[vehicle][IdVehicle])
  5093. {
  5094. if(isnull(value)) return SysMsg(playerid,"Usage: /editveh Cost [value]");
  5095. if(!IsNumeric(value)) return SysMsg(playerid,"Cost must be a number.");
  5096. new NewVehicleCost = strval(value);
  5097. if(NewVehicleCost < 1) return SysMsg(playerid,"Cost must be > 0");
  5098. mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET Price = %i WHERE id = %i", NewVehicleCost, VehicleData[vehicle][VehSQLID]);
  5099. mysql_pquery(conn, mquery);
  5100. VehicleData[vehicle][VehiclePrice] = NewVehicleCost;
  5101. SysMsgF(playerid, "Vehicle price is now $%i.", VehicleData[vehicle][VehiclePrice]);
  5102. return true;
  5103. }
  5104. return SysMsg(playerid,"You are not in any vehicle (owned).");
  5105. }
  5106. else if(strcmp("pos", element, true) == 0)
  5107. {
  5108. if(VehicleData[vehicle][IdVehicle] > 0) return SysMsg(playerid,"You are not in any vehicle (owned).");
  5109. new Float:vPos[4];
  5110. GetVehiclePos(vehicle, vPos[0], vPos[1], vPos[2]);
  5111. GetVehicleZAngle(vehicle, vPos[3]);
  5112. mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET LastX = %f, LastY = %f, LastZ = %f, LastRot = %f WHERE id = %i", vPos[0], vPos[1], vPos[2], vPos[3], VehicleData[vehicle][VehSQLID]);
  5113. mysql_pquery(conn, mquery);
  5114. VehicleData[vehicle][LastX] = vPos[0];
  5115. VehicleData[vehicle][LastY] = vPos[1];
  5116. VehicleData[vehicle][LastZ] = vPos[2];
  5117. VehicleData[vehicle][LastRot] = vPos[3];
  5118. SysMsg(playerid, "Vehicle Position Updated.");
  5119. return true;
  5120. }
  5121. else if(strcmp("regplate", element, true) == 0)
  5122. {
  5123. if(vehicle == 0) return SysMsg(playerid,"You are not in any vehicle.");
  5124. if(vehicle == VehicleData[vehicle][IdVehicle])
  5125. {
  5126. if(isnull(value)) return SysMsg(playerid,"Usage: /editveh Regplate [plate]");
  5127. if(strlen(value) > MAX_REG_PLATE-1) return SysMsg(playerid,"Regplate was too long.");
  5128. mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET RegPlate = '%e' WHERE id = %i", value, VehicleData[vehicle][VehSQLID]);
  5129. mysql_pquery(conn, mquery);
  5130. format(VehicleData[vehicle][RegPlate], MAX_REG_PLATE, value);
  5131. SysMsgF(playerid,"Vehicle reg plate is now '%s'.", VehicleData[vehicle][RegPlate]);
  5132. return true;
  5133. }
  5134. }
  5135. SysMsg(playerid,"*Usage: /editveh [element] [value] Elements: Cost, Pos, Locked, Delete, Regplate");
  5136. return true;
  5137. }
  5138. CMD:reloadgates(playerid)
  5139. {
  5140. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  5141. SendRconCommand("reloadfs Doors_And_Gates");
  5142. SendClientMessage(playerid, COLOR_WHITE, "All gates and doors {44C300}reloaded.");
  5143. return true;
  5144. }
  5145. CMD:reloadmaps(playerid)
  5146. {
  5147. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  5148. SendRconCommand("reloadfs Maps");
  5149. SendClientMessage(playerid, COLOR_WHITE, "All maps {44C300}reloaded.");
  5150. return true;
  5151. }
  5152. CMD:reloadfactions(playerid, params[])
  5153. {
  5154. new hof;
  5155. MySQLFetchInt(MasterAccount[playerid], "HoF", hof, "masters");
  5156. if(!IsPlayerAdminLevelOK(playerid, 4) && hof == 0) return SysMsg(playerid, AUTHMSG);
  5157. for(new f = 0; f > 20; f++)
  5158. {
  5159. FACTIONS[f][FactionId] = 0;
  5160. FACTIONS[f][FactionName][0] = 0;
  5161. FACTIONS[f][FNameShort][0] = 0;
  5162. FACTIONS[f][FactionSpawn1][0] = 0;
  5163. FACTIONS[f][FactionSpawn1][1] = 0;
  5164. FACTIONS[f][FactionSpawn1][2] = 0;
  5165. FACTIONS[f][FactionSpawn1][3] = 0;
  5166. FACTIONS[f][FactionSpawn2][0] = 0;
  5167. FACTIONS[f][FactionSpawn2][1] = 0;
  5168. FACTIONS[f][FactionSpawn2][2] = 0;
  5169. FACTIONS[f][FactionSpawn2][3] = 0;
  5170. FACTIONS[f][FactionSpawn3][0] = 0;
  5171. FACTIONS[f][FactionSpawn3][1] = 0;
  5172. FACTIONS[f][FactionSpawn3][2] = 0;
  5173. FACTIONS[f][FactionSpawn3][3] = 0;
  5174. FACTIONS[f][FactionSpawn4][0] = 0;
  5175. FACTIONS[f][FactionSpawn4][1] = 0;
  5176. FACTIONS[f][FactionSpawn4][2] = 0;
  5177. FACTIONS[f][FactionSpawn4][3] = 0;
  5178. FACTIONS[f][FactionSpawn5][0] = 0;
  5179. FACTIONS[f][FactionSpawn5][1] = 0;
  5180. FACTIONS[f][FactionSpawn5][2] = 0;
  5181. FACTIONS[f][FactionSpawn5][3] = 0;
  5182. FACTIONS[f][FactionSpawnVW][0] = 0;
  5183. FACTIONS[f][FactionSpawnVW][1] = 0;
  5184. FACTIONS[f][FactionSpawnVW][2] = 0;
  5185. FACTIONS[f][FactionSpawnVW][3] = 0;
  5186. FACTIONS[f][FactionSpawnVW][4] = 0;
  5187. FACTIONS[f][FactionSpawnInt][0] = 0;
  5188. FACTIONS[f][FactionSpawnInt][1] = 0;
  5189. FACTIONS[f][FactionSpawnInt][2] = 0;
  5190. FACTIONS[f][FactionSpawnInt][3] = 0;
  5191. FACTIONS[f][FactionSpawnInt][4] = 0;
  5192. FACTIONS[f][FactionSpawn1Name][0] = 0;
  5193. FACTIONS[f][FactionSpawn2Name][0] = 0;
  5194. FACTIONS[f][FactionSpawn3Name][0] = 0;
  5195. FACTIONS[f][FactionIsGang] = 0;
  5196. FACTIONS[f][FactionIsActive] = 0;
  5197. FACTIONS[f][FactionBankBalance] = 0;
  5198. FACTIONS[f][FactionRadioChannel] = 0;
  5199. FACTIONS[f][FactionRankPay][0] = 0;
  5200. FACTIONS[f][FactionRankPay][1] = 0;
  5201. FACTIONS[f][FactionRankPay][2] = 0;
  5202. FACTIONS[f][FactionRankPay][3] = 0;
  5203. FACTIONS[f][FactionRankPay][4] = 0;
  5204. FACTIONS[f][FactionRankPay][5] = 0;
  5205. FACTIONS[f][FactionRankPay][6] = 0;
  5206. FACTIONS[f][FactionRankPay][7] = 0;
  5207. FACTIONS[f][FactionRankPay][8] = 0;
  5208. FACTIONS[f][FactionRankPay][9] = 0;
  5209. FACTIONS[f][FactionRankPay][10] = 0;
  5210. FACTIONS[f][FactionRankPay][11] = 0;
  5211. FACTIONS[f][FactionRankPay][12] = 0;
  5212. FACTIONS[f][FactionRankPay][13] = 0;
  5213. FACTIONS[f][FactionRankPay][14] = 0;
  5214. FACTIONS[f][FactionPayDayTax] = 0;
  5215. FACTIONS[f][FactionSkins][0] = 0;
  5216. FACTIONS[f][FactionSkins][1] = 0;
  5217. FACTIONS[f][FactionSkins][2] = 0;
  5218. FACTIONS[f][FactionSkins][3] = 0;
  5219. FACTIONS[f][FactionSkins][4] = 0;
  5220. FACTIONS[f][FactionSkins][5] = 0;
  5221. FACTIONS[f][FactionSkins][6] = 0;
  5222. FACTIONS[f][FactionSkins][7] = 0;
  5223. FACTIONS[f][FactionSkins][8] = 0;
  5224. FACTIONS[f][FactionSkins][9] = 0;
  5225. FACTIONS[f][FactionSkins][10] = 0;
  5226. FACTIONS[f][FactionSkins][11] = 0;
  5227. FACTIONS[f][FactionSkins][12] = 0;
  5228. FACTIONS[f][FactionSkins][13] = 0;
  5229. FACTIONS[f][FactionSkins][14] = 0;
  5230. FACTIONS[f][FactionLeaderRank] = 0;
  5231. FACTIONS[f][FactionUberLeaderRank] = 0;
  5232. for(new x = 0; x < 15; x++)
  5233. {
  5234. FactionRanks[f][x][0] = EOS;
  5235. }
  5236. }
  5237. mysql_pquery(conn, "SELECT * FROM factions ORDER BY id ASC", "LoadFactions");
  5238. SendClientMessage(playerid, COLOR_WHITE, "All Factions {44C300}reloaded.");
  5239. AdminLog(playerid, 0, "", "Reloaded all factions from database");
  5240. return true;
  5241. }
  5242. CMD:reloadgarages(playerid, params[])
  5243. {
  5244. if(!IsPlayerAdminLevelOK(playerid, 4)) return SysMsg(playerid, AUTHMSG);
  5245. for(new i = 0; i < MAX_GARAGES; i++)
  5246. {
  5247. GarageData[i][gID] = 0;
  5248. GarageData[i][gHouseID] = -1;
  5249. GarageData[i][gType] = 0;
  5250. GarageData[i][oPosX] = 0;
  5251. GarageData[i][oPosY] = 0;
  5252. GarageData[i][oPosZ] = 0;
  5253. GarageData[i][iPosX] = 0;
  5254. GarageData[i][iPosY] = 0;
  5255. GarageData[i][iPosZ] = 0;
  5256. GarageData[i][iAngle] = 0;
  5257. GarageData[i][oAngle] = 0;
  5258. GarageData[i][oVehicleAngle] = 0;
  5259. GarageData[i][iVehicleAngle] = 0;
  5260. GarageData[i][iVirtualWorld] = 0;
  5261. GarageData[i][oVirtualWorld] = 0;
  5262. GarageData[i][InsideInt] = 0;
  5263. DestroyDynamicPickup(GarageData[i][GaragePickup]);
  5264. GarageData[i][GaragePickup] = 0;
  5265. GarageData[i][UseHouse] = false;
  5266. }
  5267. mysql_pquery(conn, "SELECT * FROM garages", "LoadGarages");
  5268. SendClientMessage(playerid, COLOR_WHITE, "All garages {44C300}reloaded.");
  5269. return true;
  5270. }
  5271. CMD:reloadhouse(playerid, params[]) return cmd_reloadhouses(playerid, params);
  5272. CMD:reloadhouses(playerid, params[])
  5273. {
  5274. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  5275. if(isnull(params)) return SysMsg(playerid, "Usage: /reloadhouse [all / house address]");
  5276. if(strcmp(params, "all", true) == 0)
  5277. {
  5278. for(new b = 0; b < MAX_HOUSES; b++)
  5279. {
  5280. if(HouseData[b][HouseSQLID] >= 1)
  5281. {
  5282. DestroyDynamicPickup(HouseData[b][HousePickup]);
  5283. DeleteHouseLabel(b);
  5284. ClearHouseFuritureVariables(b);
  5285. ClearOutdoorFurnitureVariables(b);
  5286. HouseData[b][HouseSQLID] = 0;
  5287. HouseData[b][oPosX] = 0;
  5288. HouseData[b][oPosY] = 0;
  5289. HouseData[b][oPosZ] = 0;
  5290. HouseData[b][intPosX] = 0;
  5291. HouseData[b][intPosY] = 0;
  5292. HouseData[b][intPosZ] = 0;
  5293. HouseData[b][HouseInterior] = 0;
  5294. HouseData[b][HouseExtVW] = 0;
  5295. HouseData[b][HousePrice] = 0;
  5296. HouseData[b][HouseOwnerSQLID] = 0;
  5297. HouseData[b][HouseDescription][0] = EOS;
  5298. HouseData[b][HouseLocked] = 0;
  5299. HouseData[b][InsideID] = 0;
  5300. HouseData[b][StoredCash] = 0;
  5301. HouseData[b][StoredWeed] = 0;
  5302. HouseData[b][StoredCocaine] = 0;
  5303. HouseData[b][StoredMoonShine] = 0;
  5304. HouseData[b][StoredPhone] = 0;
  5305. HouseData[b][DoorNoteMessage][0] = 0;
  5306. HouseData[b][HouseVW] = 0;
  5307. HouseData[b][HousePickup] = 0;
  5308. HouseData[b][HouseLabel] = Text3D:INVALID_3DTEXT_ID;
  5309. HouseData[b][HouseLights] = false;
  5310. }
  5311. }
  5312. mysql_tquery(conn, "SELECT * FROM houses", "LoadHouses", "d", 0);
  5313. mysql_tquery(conn, "SELECT * FROM hfurniture ORDER BY HouseSQLID ASC", "LoadHouseFurniture");
  5314. mysql_tquery(conn, "SELECT * FROM efurniture ORDER BY HouseSQLID ASC", "LoadExteriorHouseFurniture");
  5315. SetTimer("ProcessHKeys", 1000, 0);
  5316. SendClientMessage(playerid, COLOR_WHITE, "All houses {44C300}reloaded.");
  5317. AdminLog(playerid, 0, "", "Reloaded all houses from database");
  5318. }
  5319. else
  5320. {
  5321. new h = GetHouseLocation(params), sql;
  5322. if(h < 0 || h >= MAX_HOUSES) return SysMsg(playerid, "House is not valid.");
  5323. SendClientMessageF(playerid,COLOR_WHITE, "%s (ID %i) {44C300}reloaded", HouseData[h][HouseDescription], HouseData[h][HouseSQLID]);
  5324. DestroyDynamicPickup(HouseData[h][HousePickup]);
  5325. DeleteHouseLabel(h);
  5326. ClearHouseFuritureVariables(h);
  5327. ClearOutdoorFurnitureVariables(h);
  5328. sql = HouseData[h][HouseSQLID];
  5329. HouseData[h][HouseSQLID] = 0;
  5330. HouseData[h][oPosX] = 0;
  5331. HouseData[h][oPosY] = 0;
  5332. HouseData[h][oPosZ] = 0;
  5333. HouseData[h][intPosX] = 0;
  5334. HouseData[h][intPosY] = 0;
  5335. HouseData[h][intPosZ] = 0;
  5336. HouseData[h][HouseInterior] = 0;
  5337. HouseData[h][HouseExtVW] = 0;
  5338. HouseData[h][HousePrice] = 0;
  5339. HouseData[h][HouseOwnerSQLID] = 0;
  5340. HouseData[h][HouseDescription][0] = EOS;
  5341. HouseData[h][HouseLocked] = 0;
  5342. HouseData[h][InsideID] = 0;
  5343. HouseData[h][StoredCash] = 0;
  5344. HouseData[h][StoredWeed] = 0;
  5345. HouseData[h][StoredCocaine] = 0;
  5346. HouseData[h][StoredMoonShine] = 0;
  5347. HouseData[h][StoredPhone] = 0;
  5348. HouseData[h][DoorNoteMessage][0] = 0;
  5349. HouseData[h][HouseVW] = 0;
  5350. HouseData[h][HousePickup] = 0;
  5351. HouseData[h][HouseLabel] = Text3D:INVALID_3DTEXT_ID;
  5352. HouseData[h][HouseLights] = false;
  5353. mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM houses WHERE id = %i LIMIT 1", sql);
  5354. mysql_pquery(conn, mquery, "LoadHouses", "d", 1);
  5355. mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM hfurniture WHERE HouseSQLID = %i", sql);
  5356. mysql_pquery(conn, mquery, "LoadHouseFurniture");
  5357. mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM efurniture WHERE HouseSQLID = %i", sql);
  5358. mysql_pquery(conn, mquery, "LoadExteriorHouseFurniture");
  5359. format(tgstr, sizeof(tgstr), "Reloaded house %i", h);
  5360. AdminLog(playerid, 0, "", tgstr);
  5361. }
  5362. return true;
  5363. }
  5364. CMD:reloadinteriors(playerid, params[])
  5365. {
  5366. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  5367. for(new i = 0; i < MAX_INTERIORS; i++)
  5368. {
  5369. Interiors[i][interiorID] = 0;
  5370. Interiors[i][oPosX] = 0;
  5371. Interiors[i][oPosY] = 0;
  5372. Interiors[i][oPosZ] = 0;
  5373. Interiors[i][iPosX] = 0;
  5374. Interiors[i][iPosY] = 0;
  5375. Interiors[i][iPosZ] = 0;
  5376. Interiors[i][iAngle] = 0;
  5377. Interiors[i][oAngle] = 0;
  5378. Interiors[i][iInteriorID] = 0;
  5379. Interiors[i][oInteriorID] = 0;
  5380. Interiors[i][iVirtualWorld] = 0;
  5381. Interiors[i][oVirtualWorld] = 0;
  5382. Interiors[i][InteriorNavTo] = 0;
  5383. Interiors[i][IntFaction] = 0;
  5384. Interiors[i][IntFactionRank] = 0;
  5385. Interiors[i][InteriorName][0] = 0;
  5386. }
  5387. mysql_pquery(conn, "SELECT * FROM interiors", "LoadInteriors");
  5388. SendClientMessage(playerid, COLOR_WHITE, "All interiors {44C300}reloaded.");
  5389. return true;
  5390. }
  5391. CMD:reloadpickups(playerid, params[])
  5392. {
  5393. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  5394. for(new i = 0; i < MAX_SQLPICKUPS; i++)
  5395. {
  5396. DestroyDynamicPickup(PickupData[i][IGPickupID]);
  5397. PickupData[i][IGPickupID] = 0;
  5398. PickupData[i][PickupText][0] = 0;
  5399. PickupData[i][Xpos] = 0;
  5400. PickupData[i][Ypos] = 0;
  5401. PickupData[i][Zpos] = 0;
  5402. PickupData[i][PickupModel] = 0;
  5403. PickupData[i][WorldID] = 0;
  5404. PickupData[i][PickupType] = 0;
  5405. }
  5406. mysql_pquery(conn, "SELECT * FROM pickups", "LoadAllPickups");
  5407. SendClientMessage(playerid, COLOR_WHITE, "All pickups {44C300}reloaded.");
  5408. return true;
  5409. }
  5410. CMD:reloadrentalcars(playerid, params[])
  5411. {
  5412. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  5413. foreach(new i: Player)
  5414. {
  5415. if(RentalCar[i] >= 1) return SysMsg(playerid, "A player is currently renting a rental car. As such you cannot reload them.");
  5416. }
  5417. for(new v = 0, x = GetVehiclePoolSize(); v <= x; v++)
  5418. {
  5419. if(RentalData[v][CarID] != 0)
  5420. {
  5421. DestroyVehicleEx(RentalData[v][CarID], "RentalData[v][CarID]");
  5422. RentalData[v][CarSQLID] = 0;
  5423. RentalData[v][CarID] = 0;
  5424. RentalData[v][CarModel] = 0;
  5425. RentalData[v][rColor1] = 0;
  5426. RentalData[v][rColor2] = 0;
  5427. RentalData[v][CarMileage] = 0.0;
  5428. RentalData[v][rPosX] = 0.0;
  5429. RentalData[v][rPosY] = 0.0;
  5430. RentalData[v][rPosZ] = 0.0;
  5431. RentalData[v][rRot] = 0.0;
  5432. RentalData[v][RentalPrice] = 0;
  5433. RentalData[v][RentalPlate][0] = 0;
  5434. }
  5435. }
  5436. mysql_pquery(conn, "SELECT * FROM `rentals`", "LoadRentalCars");
  5437. SendClientMessage(playerid, COLOR_WHITE, "All rental vehicles {44C300}reloaded.");
  5438. return true;
  5439. }
  5440. CMD:makerentalcar(playerid, params[])
  5441. {
  5442. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  5443. if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a vehicle to use this command.");
  5444. if(VehicleData[GetPlayerVehicleID(playerid)][VehSQLID] >= 1) return SysMsg(playerid, "You cannot make owned vehicles into rental cars.");
  5445. if(FVehicleData[GetPlayerVehicleID(playerid)][FVSQLID] >= 1) return SysMsg(playerid, "You cannot make faction vehicles into rental cars.");
  5446. new cost;
  5447. if(sscanf(params, "i", cost)) return SysMsg(playerid, "Usage: /makerentalcar [cost] *Please ensure the vehicle is in the correct position and has the correct colors.*");
  5448. new pos[64], Float:vpos[4], v = GetPlayerVehicleID(playerid), col[2], plate[12], model;
  5449. GetVehiclePos(v, vpos[0], vpos[1], vpos[2]);
  5450. GetVehicleZAngle(v, vpos[3]);
  5451. GetVehicleColors(v, col[0], col[1]);
  5452. model = GetVehicleModel(v);
  5453. format(pos, sizeof(pos), "%f,%f,%f,%f", vpos[0], vpos[1], vpos[2], vpos[3]);
  5454. format(plate, sizeof(plate), "%s", GetNewRegPlate());
  5455. DestroyVehicleEx(v, "v 3");
  5456. ClearVehicleData(v);
  5457. mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO rentals (Model, Color1, Color2, Position, Price, RegPlate) VALUES (%i, %i, %i, '%e', %i, '%e')", model, col[0], col[1], pos, cost, plate);
  5458. mysql_pquery(conn, mquery, "LoadNewRentalCar", "d", playerid);
  5459. return true;
  5460. }
  5461. CMD:makeveh(playerid, params[])
  5462. {
  5463. if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
  5464. new vid;
  5465. new NewVehCost, NewC1, NewC2, donator, ownerSQLID = -1, mileage, lastoiled;
  5466. vid = GetPlayerVehicleID(playerid);
  5467. if(!vid) return SysMsg(playerid,"You must be in a vehicle first.");
  5468. if(sscanf(params, "iiiiiii", NewVehCost, NewC1, NewC2, donator, mileage, lastoiled, ownerSQLID)) return SysMsg(playerid,"Usage: /makeveh [cost] [col1] [col2] [donator 1/0] [mileage] [last oiled] [owner sqlid or 0]");
  5469. if(NewVehCost < 1) return SysMsg(playerid,"Cost must be > 0");
  5470. if(NewC1 < 0 || NewC1 > 255) return SysMsg(playerid,"Colors must be between 0-255");
  5471. if(NewC2 < 0 || NewC2 > 255) return SysMsg(playerid,"Colors must be between 0-255");
  5472. mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM vehicles WHERE OwnerSQLID = %i", ownerSQLID);
  5473. mysql_pquery(conn, mquery, "MakeVeh", "dddddddd", playerid, NewVehCost, NewC1, NewC2, donator, mileage, lastoiled, ownerSQLID);
  5474. return true;
  5475. }
  5476. CMD:cfv(playerid, params[])
  5477. {
  5478. new hof;
  5479. MySQLFetchInt(MasterAccount[playerid], "HoF", hof, "masters");
  5480. if(!IsPlayerAdminLevelOK(playerid, 4) && hof != 1) return SysMsg(playerid, AUTHMSG);
  5481. new Float:X, Float:Y, Float:Z, Float:Rot, model, vid, NewC1, NewC2, inter, faction, confirm[12], j;
  5482. vid = GetPlayerVehicleID(playerid);
  5483. if(!vid) return SysMsg(playerid,"You must be in a vehicle first.");
  5484. model = GetVehicleModel(vid);
  5485. new t = 0;
  5486. for(j = 0; j < sizeof(AllowedFactionVehs); j++)
  5487. {
  5488. if(model == AllowedFactionVehs[j][0])
  5489. {
  5490. t = 1;
  5491. break;
  5492. }
  5493. }
  5494. if(t == 0) return SysMsg(playerid, "This vehicle is not an approved faction vehicle.");
  5495. if(model != AllowedFactionVehs[j][0]) return SysMsg(playerid, "This vehicle is not an approved faction vehicle.");
  5496. if(sscanf(params, "iS(none)[12]", faction, confirm)) return SysMsg(playerid, "Usage: /cfv [Faction ID]");
  5497. if(faction < 1 || faction > MAX_FACTIONS) return SysMsg(playerid,"Faction must be more than 0.");
  5498. if(FACTIONS[faction][FactionId] == 0) return SysMsg(playerid, "Faction must be valid.");
  5499. if(strmatch("none", confirm)) SendSplitMessageF(playerid, COLOR_LIGHTGREEN, "[CFV] Setting this %s into the faction %s [ID %i] will cost a total of $%s, type /cfv %i confirm to complete the transaction.", GetVehicleNameEx(AllowedFactionVehs[j][0]), GetFactionNameFromId(faction), faction, format_cash(AllowedFactionVehs[j][1]), faction);
  5500. else if(strmatch("confirm", confirm))
  5501. {
  5502. if(model != AllowedFactionVehs[j][0]) return SysMsg(playerid, "This vehicle is not an approved faction vehicle.");
  5503. if(Cash[playerid] < AllowedFactionVehs[j][1]) return SysMsg(playerid, "You don't have enough cash to perform this command.");
  5504. new plate[8];
  5505. GetVehiclePos(vid,X,Y,Z);
  5506. GetVehicleZAngle(vid,Rot);
  5507. GetVehicleColors(vid, NewC1, NewC2);
  5508. inter = GetPlayerInterior(playerid);
  5509. format(plate, MAX_REG_PLATE, GetNewRegPlate());
  5510. DestroyVehicleEx(vid, "vid 0");
  5511. mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO fveh (Model, Col1, Col2, Faction, RegPlate, MinRank, LocationX, LocationY, LocationZ, LocationR, Interior, VWorld, Creator) VALUES (%i, %i, %i, %i, '%e', 1, %f, %f, %f, %f, %i, %i, %i)",
  5512. model, NewC1, NewC2, faction, plate, X, Y, Z, Rot, inter, GetPlayerVirtualWorld(playerid), SQLID[playerid]);
  5513. mysql_pquery(conn, mquery, "CreateFVeh");
  5514. GivePlayerCash(playerid, -AllowedFactionVehs[j][1]);
  5515. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You have successfully set a %s into faction %s[ID %i] at the cost of $%s.", GetVehicleNameEx(AllowedFactionVehs[j][0]), GetFactionNameFromId(faction), faction, format_cash(AllowedFactionVehs[j][1]));
  5516. format(sgstr, sizeof(sgstr), "Created f.veh for %s(fid %i), %s", GetFactionNameFromId(faction), faction, GetVehicleName(vid));
  5517. AdminLog(playerid, 0, "", sgstr);
  5518. }
  5519. return true;
  5520. }
  5521. CMD:dfv(playerid)
  5522. {
  5523. new hof;
  5524. MySQLFetchInt(MasterAccount[playerid], "HoF", hof, "masters");
  5525. if(!IsPlayerAdminLevelOK(playerid, 4) && hof != 1) return SysMsg(playerid, AUTHMSG);
  5526. if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You must be in a vehicle first.");
  5527. if(!IsFactionVehicle(GetPlayerVehicleID(playerid))) return SysMsg(playerid, "You must be in a faction vehicle.");
  5528. new vid = GetPlayerVehicleID(playerid);
  5529. mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM fveh WHERE id=%i LIMIT 1", FVehicleData[vid][FVSQLID]);
  5530. mysql_pquery(conn, mquery);
  5531. format(sgstr, sizeof(sgstr), "Deleted f.veh for %s(fid %i), %s", GetFactionNameFromId(FVehicleData[vid][FVFaction]), FVehicleData[vid][FVFaction], GetVehicleName(vid));
  5532. AdminLog(playerid, 0, "", sgstr);
  5533. ClearVehicleData(vid);
  5534. DestroyVehicleEx(vid, "vid 1");
  5535. SysMsgF(playerid, "Faction Vehicle ID %i has been deleted.", vid);
  5536. return true;
  5537. }
  5538. CMD:fids(playerid, params[])
  5539. {
  5540. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  5541. gstr[0] = EOS;
  5542. new fname[35];
  5543. for(new i = 1; i < MAX_FACTIONS; i++)
  5544. {
  5545. if(FACTIONS[i][FactionId] >= 1)
  5546. {
  5547. format(fname, sizeof(fname), "%i - %s\n", FACTIONS[i][FactionId], FACTIONS[i][FactionName]);
  5548. strcat(gstr, fname);
  5549. }
  5550. }
  5551. ShowMessage(playerid, "Faction ID's", gstr, "OK");
  5552. return true;
  5553. }
  5554. CMD:fedit(playerid, params[])
  5555. {
  5556. new hof, header[64];
  5557. MySQLFetchInt(MasterAccount[playerid], "HoF", hof, "masters");
  5558. if(IsPlayerAdminLevelOK(playerid, 4) || hof == 1)
  5559. {
  5560. if(isnull(params)) return SysMsg(playerid, "Usage: /fedit [Faction ID]");
  5561. if(!IsNumeric(params)) return SysMsg(playerid, "Usage: /fedit [Faction ID]");
  5562. if(strval(params) >= MAX_FACTIONS) return SysMsg(playerid, "Faction ID exceeds max factions.");
  5563. if(FACTIONS[strval(params)][FactionId] == 0) return SysMsg(playerid, "Invalid faction.");
  5564. new f = strval(params);
  5565. new isgang[8], isactive[8];
  5566. if(FACTIONS[f][FactionIsGang] == 1) format(isgang, 8, "YES");
  5567. else format(isgang, 8, "NO");
  5568. if(FACTIONS[f][FactionIsActive] == 1) format(isactive, 8, "YES");
  5569. else format(isactive, 8, "NO");
  5570. format(gstr, sizeof(gstr), "{FFFFFF}Edit Faction Name\nEdit Faction Abv. [Current: {D9D925}%s{FFFFFF}]\nEdit Uber Rank [Current: {D9D925}%s [%i]{ffffff}]\nEdit Leader Rank [Current: {D9D925}%s [%i]{FFFFFF}]\nEdit Leader [Current: {D9D925}%s{FFFFFF}]\nEdit Radio Freq [Current: {D9D925}%i MHz{FFFFFF}]\nIs Gang [{D9D925}%s{FFFFFF}]\nIs Active [{D9D925}%s{FFFFFF}]", FACTIONS[f][FNameShort],
  5571. GetFactionRankName(f, FACTIONS[f][FactionUberLeaderRank]), FACTIONS[f][FactionUberLeaderRank], GetFactionRankName(f, FACTIONS[f][FactionLeaderRank]), FACTIONS[f][FactionLeaderRank], GetSQLName(FACTIONS[f][FactionLeader]), FACTIONS[f][FactionRadioChannel], isgang, isactive);
  5572. SetPVarInt(playerid, "fEditf", f);
  5573. format(header, sizeof(header), "Faction Edit Menu - %s [ID %i]", GetFactionNameFromId(f), f);
  5574. Dialog_Show(playerid, FactionEditMenu, DIALOG_STYLE_LIST, header, gstr, "Select", "Cancel");
  5575. }
  5576. else return SysMsg(playerid, AUTHMSG);
  5577. return true;
  5578. }
  5579. CMD:accuracy(playerid, params[])
  5580. {
  5581. if(!Logged{playerid}) return true;
  5582. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  5583. new playa = -1;
  5584. if(sscanf(params, "u", playa)) return SysMsg(playerid, "Usage: /accuracy [playerid or name]");
  5585. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  5586. if(ShotsFired[playa] == 0) return SysMsg(playerid, "This player hasn't fired any bullets.");
  5587. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "Viewing the hit accuracy of {FFFFFF}%s!", NameEx(playa));
  5588. SendClientMessageF(playerid, COLOR_WHITE, "Number of bullets fired in current session: %i. Number of bullets hit in current session: %i. Numbers of headshots in current session: %i.", ShotsFired[playa], ShotsHit[playa], HeadshotsHit[playa]);
  5589. SendClientMessageF(playerid, COLOR_WHITE, "Total Hit Accuracy: %.2f. Headshot Percentage: %.2f", GetHitAccuracy(playa), GetHeadshotAccuracy(playa));
  5590. return true;
  5591. }
  5592. CMD:actionlog(playerid, params[])
  5593. {
  5594. if(!Logged{playerid}) return true;
  5595. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  5596. new playa = -1, page;
  5597. if(sscanf(params, "ui", playa, page)) return SysMsg(playerid, "Usage: /actionlog [playerid or name] [page 1 or 2]");
  5598. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  5599. if(MasterAccount[playa] == 29469 && MasterAccount[playerid] == 19025) return SysMsg(playerid, "Nice try, buddy. Love, Emmalee");
  5600. if(page != 1 && page != 2) return SysMsg(playerid, "Invalid page. Please enter 1 or 2.");
  5601. new bigstring[3000];
  5602. sgstr[0] = EOS;
  5603. if(page == 1)
  5604. {
  5605. for(new x = 24; x != -1; x--)
  5606. {
  5607. if(strlen(ActionLog[playa][x]))
  5608. {
  5609. strunpack(sgstr, ActionLog[playa][x], sizeof(sgstr));
  5610. strcat(bigstring, sgstr);
  5611. strcat(bigstring, "\n");
  5612. }
  5613. }
  5614. }
  5615. else
  5616. {
  5617. for(new x = 49; x != 24; x--)
  5618. {
  5619. if(strlen(ActionLog[playa][x]))
  5620. {
  5621. strunpack(sgstr, ActionLog[playa][x], sizeof(sgstr));
  5622. strcat(bigstring, sgstr);
  5623. strcat(bigstring, "\n");
  5624. }
  5625. }
  5626. }
  5627. if(!strlen(bigstring)) return SysMsg(playerid, "Could not find an action log for this player.");
  5628. new sub[32];
  5629. format(sub, 32, "Action log of %s", NameEx(playa));
  5630. ShowMessage(playerid, sub, bigstring, "Neat!");
  5631. return true;
  5632. }
  5633. CMD:ccash(playerid, params[])
  5634. {
  5635. if(!Logged{playerid}) return true;
  5636. if(!IsPlayerAdminLevelOK(playerid, 2)) return SysMsg(playerid, AUTHMSG);
  5637. new playa = -1;
  5638. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /ccash [player id or name]");
  5639. if(InvalidPlayer(playa)) return SysMsg(playerid,"That player is not connected.");
  5640. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  5641. if(!Logged{playa}) return SysMsg(playerid,"That player is not logged in.");
  5642. SendClientMessageF(playerid, COLOR_WHITE, "Financial Details For %s: Cash In Hand: $%s, Bank Balance: $%s",NameEx(playa), format_cash(Cash[playa]), format_cash(BankBalance[playa]));
  5643. return true;
  5644. }
  5645. CMD:skiphosp(playerid, params[])
  5646. {
  5647. if(!Logged{playerid}) return true;
  5648. if(!IsPlayerAdminLevelOK(playerid, 1)) return true;
  5649. if(isnull(params))
  5650. {
  5651. ReleaseHospitalizedPlayer(playerid);
  5652. AdminLog(playerid, 0, "", "Skipped hospital");
  5653. }
  5654. else
  5655. {
  5656. new playa = -1;
  5657. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /skiphosp [playerid id or name]");
  5658. if(!IsInHospital{playa}) return SysMsg(playerid, "That player is not in the hospital.");
  5659. ReleaseHospitalizedPlayer(playa);
  5660. SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You have successfully skipped %s[ID %i]'s hospital time.", NameEx(playa), playa);
  5661. format(gstr, sizeof(gstr), "[Admin] Admin %s has skipped %s[ID %i]'s hospital.", NameEx(playerid), NameEx(playa), playa);
  5662. AdminBroadcast(gstr, 1, 3);
  5663. SendClientMessage(playa, COLOR_LIGHTRED, "You have been discharged from hospital. Have a nice day and be careful out there!");
  5664. AdminLog(playerid, 0, "", "Skipped hospital for a player");
  5665. }
  5666. return true;
  5667. }
  5668. /* CMD:ip(playerid, params[])
  5669. {
  5670. if(isnull(params))
  5671. {
  5672. SendClientMessageF(playerid, COLOR_WHITE, "IP Address: %s", PlayerIP[playerid]);
  5673. SendClientMessageF(playerid, COLOR_WHITE, "Server Latency: %ims", GetPlayerPing(playerid));
  5674. }
  5675. else
  5676. {
  5677. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  5678. new playa = -1;
  5679. if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /ip [player id or name]");
  5680. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  5681. //SendClientMessageF(playerid, COLOR_WHITE, "IP Address: %s, Server Latency: %ims", PlayerIP[playa], GetPlayerPing(playa));
  5682. SendClientMessageF(playerid, COLOR_WHITE, "IP Address: %s, Country: %s, Area: %s", PlayerIP[playa], GetPlayerCountryName(playa), GetPlayerCountryRegion(playa));
  5683. SendClientMessageF(playerid, COLOR_WHITE, "Server Latency: %ims, ISP: %s", GetPlayerPing(playa), GetPlayerISP(playa));
  5684. }
  5685. return true;
  5686. } */
  5687. CMD:refundcash(playerid, params[])
  5688. {
  5689. if(!IsPlayerAdminLevelOK(playerid, 4)) return false;
  5690. new pname[MAX_PLAYER_NAME], playa = -1, amount, sqlid = -1;
  5691. if(sscanf(params, "s[24]i", pname, amount)) return SysMsg(playerid,"Usage: /refundcash [player id OR Full_Name ONLY] [amount]");
  5692. if(IsNumeric(pname))
  5693. {
  5694. if(!IsPlayerConnected(strval(pname)) || !Logged{strval(pname)}) return SysMsg(playerid, "Player ID was not connected and logged in.");
  5695. playa = strval(pname);
  5696. sqlid = SQLID[playa];
  5697. }
  5698. else
  5699. {
  5700. sqlid = MySQLCheckAccount(pname, playerid);
  5701. if(sqlid <= 0) return SysMsg(playerid, "Name was not found. Please include first name, last name and an underscore OR use there current ingame ID.");
  5702. }
  5703. if(sqlid == -1) return SysMsg(playerid, "Name was not found. Please include first name, last name and an underscore OR use there current ingame ID.");
  5704. if(sqlid == SQLID[playerid] && !IsPlayerAdmin(playerid)) return SysMsg(playerid, "Cannot be yourself.");
  5705. if(amount < 1 || amount > 10000000) return SysMsg(playerid,"Amount must be more than 0 and 10,000,000 or less.");
  5706. if(playa >= 0)
  5707. {
  5708. GivePlayerCash(playa, amount);
  5709. MySQLUpdateInt(SQLID[playa], "Cash", Cash[playa], "players");
  5710. format(gstr, sizeof(gstr),"Admin %s has refunded you $%s.", NameEx(playerid), format_cash(amount));
  5711. SendClientMessage(playa, COLOR_LIGHTGREEN, gstr);
  5712. format(gstr, sizeof(gstr),"[Admin] %s has refunded %s $%s.", NameEx(playerid), NameEx(playa), format_cash(amount));
  5713. AdminBroadcast(gstr, 0);
  5714. format(gstr, sizeof(gstr),"[%s] Player %s(%i) has been refunded $%i from Admin %s(%i). (Total: $%i)", GetServerTimeString(), NameEx(playa), playa, amount, NameEx(playerid), playerid, Cash[playa]);
  5715. format(gstr, sizeof(gstr), "Refund cash $%i", amount);
  5716. AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
  5717. }
  5718. else
  5719. {
  5720. foreach(new i: Player) if(sqlid == SQLID[i]) return SysMsg(playerid, "Full_Name cannot be an online player, use the player ID instead.");
  5721. new tempval;
  5722. MySQLFetchInt(sqlid, "Cash", tempval, "players");
  5723. tempval += amount;
  5724. MySQLUpdateInt(sqlid, "Cash", tempval, "players");
  5725. format(gstr, sizeof(gstr),"[Admin] %s has refunded %s $%s.", NameEx(playerid), GetSQLName(sqlid), format_cash(amount));
  5726. AdminBroadcast(gstr, 0);
  5727. format(gstr, sizeof(gstr),"[%s] Offline player %s has been refunded $%i from Admin %s(%i). (Total: $%i)", GetServerTimeString(), GetSQLName(sqlid), amount, NameEx(playerid), playerid, tempval);
  5728. format(gstr, sizeof(gstr), "Refund cash $%i", amount);
  5729. AdminLog(playerid, sqlid, GetSQLName(sqlid), gstr);
  5730. }
  5731. return true;
  5732. }
  5733. CMD:delacc(playerid, params[])
  5734. {
  5735. if(!IsPlayerAdmin(playerid)) return false;
  5736. new sqlid = -1;
  5737. if(isnull(params)) return SysMsg(playerid,"Usage: /delacc [Full_Name ONLY] *Will delete an account*");
  5738. sqlid = MySQLCheckAccount(params, playerid);
  5739. if(sqlid <= 1) return SysMsg(playerid, "Name was not found. Please include first name, last name and an underscore.");
  5740. if(sqlid == SQLID[playerid]) return SysMsg(playerid, "Cannot be yourself.");
  5741. foreach(new p: Player)
  5742. {
  5743. if(sqlid == SQLID[p] && Logged{p})
  5744. {
  5745. SendClientMessageToAllF(COLOR_RED, "Admin %s has permanently deleted %s's account.", NameEx(playerid), NameEx(p));
  5746. KickPlayer(p, 15);
  5747. }
  5748. }
  5749. format(gstr, sizeof(gstr),"[Admin] %s has deleted the account '%s' from the database.", NameEx(playerid), GetSQLName(sqlid));
  5750. AdminBroadcast(gstr, 0);
  5751. format(gstr, sizeof(gstr), "Deleted account %s(SQLID %i)", GetSQLName(sqlid), sqlid);
  5752. AdminLog(playerid, 0, "", gstr);
  5753. mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM players WHERE id = %i LIMIT 1", sqlid);
  5754. mysql_pquery(conn, mquery);
  5755. return true;
  5756. }
  5757. CMD:boomboxid(playerid, params[])
  5758. {
  5759. if(!Logged{playerid}) return true;
  5760. foreach(new p: Player)
  5761. {
  5762. if(IsPlayerInDynamicArea(playerid, Boomboxes[p][BoomArea]) && IsValidDynamicArea(Boomboxes[p][BoomArea]))
  5763. {
  5764. return SendClientMessageF(playerid, COLOR_OOC, "The ID of this boombox is ID %i.", p);
  5765. }
  5766. }
  5767. SysMsg(playerid, "You are not near any boomboxes, move closer to the boombox and try again.");
  5768. return true;
  5769. }
  5770. CMD:fcarlist(playerid, params[])
  5771. {
  5772. for(new j = 0; j < sizeof(AllowedFactionVehs); j++)
  5773. {
  5774. printf("%s - $%s", GetVehicleNameEx(AllowedFactionVehs[j][0]), format_cash(AllowedFactionVehs[j][1]));
  5775. }
  5776. return true;
  5777. }
  5778. CMD:ahide(playerid, params[])
  5779. {
  5780. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, CMDFMSG);
  5781. AdminHidden[playerid] = !AdminHidden[playerid];
  5782. if(ADuty[playerid] == 1)
  5783. {
  5784. ADuty[playerid] = 0;
  5785. SetPlayerColor(playerid, 0xFFFFFF00);
  5786. SysMsg(playerid,"Admin Duty has been turned off automatically.");
  5787. if(UsingPaint{playerid}) cmd_paint(playerid);
  5788. }
  5789. if(AdminHidden[playerid]) SysMsg(playerid, "You are now hidden from /admins.");
  5790. else SysMsg(playerid, "You are no longer hidden from /admins.");
  5791. return true;
  5792. }
  5793. CMD:stranger(playerid, params[])
  5794. {
  5795. if(!Logged{playerid}) return true;
  5796. if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
  5797. new stranger, playa = -1;
  5798. if(sscanf(params, "i", stranger)) return SysMsg(playerid,"Usage: /stranger [stranger ID]");
  5799. foreach(new i: Player)
  5800. {
  5801. if(Logged{i} && IsPlayerMasked{i} && MaskLabelNumber[i] == stranger)
  5802. {
  5803. playa = i;
  5804. break;
  5805. }
  5806. }
  5807. if(playa == -1) return SysMsg(playerid,"There are no players currently using that Stranger ID");
  5808. SendClientMessageF(playerid,COLOR_YELLOW, "*Stranger %i(%s ID %i)", stranger, NameEx(playa), playa);
  5809. return true;
  5810. }
  5811. CMD:report(playerid, params[])
  5812. {
  5813. if(!Logged{playerid}) return true;
  5814. new AdminCount = 0;
  5815. foreach(new i: Player) if(IsPlayerAdminLevelOK(i, 1)) AdminCount ++;
  5816. if(AdminCount == 0) return SysMsg(playerid, "Nobody is available to answer your report.");
  5817. new playa = -1, reason[150], name[MAX_PLAYER_NAME];
  5818. if(sscanf(params, "s[24]s[150]", name, reason))
  5819. {
  5820. SysMsg(playerid,"Usage: /report [player id or name] [reason *Max 50 Length*]");
  5821. return SysMsg(playerid, "Reminder: This command is for reporting other players for breaking rules. Use /assistance if you have a question or require admin assistance.");
  5822. }
  5823. if(strval(name) >= 500)
  5824. {
  5825. foreach(new p: Player)
  5826. {
  5827. if(MaskLabelNumber[p] == strval(name))
  5828. {
  5829. playa = p;
  5830. }
  5831. }
  5832. }
  5833. else playa = GetPlayerIDs(name);
  5834. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  5835. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  5836. if(playa == playerid) return SysMsg(playerid,"You can't report yourself.");
  5837. SendReport(playerid, playa, reason);
  5838. foreach(new i: Player)
  5839. {
  5840. if(IsPlayerAdminLevelOK(i, 1))
  5841. {
  5842. SendSplitMessageF(i,COLOR_YELLOW,"* Report from %s(%i) about %s(%i): %s", NameEx(playerid), playerid, NameEx(playa), playa, reason);
  5843. }
  5844. }
  5845. SendClientMessage(playerid, COLOR_ORANGE, "Report submitted to all online Admins to be reviewed. Use /cancelreport if you no longer need us.");
  5846. return true;
  5847. }
  5848. CMD:cancelreport(playerid, params[])
  5849. {
  5850. if(!Logged{playerid}) return true;
  5851. new name[24], playa = -1;
  5852. if(sscanf(params, "s[24]", name)) return SysMsg(playerid,"Usage: /cancelreport [player id or name]");
  5853. if(strval(name) >= 500)
  5854. {
  5855. foreach(new p: Player)
  5856. {
  5857. if(MaskLabelNumber[p] == strval(name))
  5858. {
  5859. playa = p;
  5860. }
  5861. }
  5862. }
  5863. else playa = GetPlayerIDs(name);
  5864. if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
  5865. if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
  5866. if(playa == playerid) return SysMsg(playerid,"You can't report yourself.");
  5867. new reportcancelled = 0;
  5868. for(new x = 0; x < MAX_REPORTS; x++)
  5869. {
  5870. if(strmatch(Reports[x][ReportedName], NameEx(playa)))
  5871. {
  5872. Reports[x][ReporterName][0] = EOS;
  5873. Reports[x][ReportedName][0] = EOS;
  5874. Reports[x][ReportReason][0] = EOS;
  5875. Reports[x][ReportTime] = 0;
  5876. reportcancelled = 1;
  5877. }
  5878. }
  5879. if(reportcancelled == 0) SendClientMessage(playerid, COLOR_ORANGE, "Could not find a report on that player.");
  5880. else SendClientMessageF(playerid, COLOR_ORANGE, "You have cancelled your report on %s.", NameRP(playa));
  5881. return true;
  5882. }
  5883. CMD:joinevent(playerid, params[])
  5884. {
  5885. if(!Logged{playerid}) return true;
  5886. if(EventOpen == 0) return SysMsg(playerid,"There is no event taking place.");
  5887. if(IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You can't join in a vehicle.");
  5888. if(LastEventPos[playerid][0] != -1.0) return SysMsg(playerid,"You are already in the event.");
  5889. GetPlayerPos(playerid, LastEventPos[playerid][0], LastEventPos[playerid][1], LastEventPos[playerid][2]);
  5890. LastEventIDs[playerid][0] = GetPlayerInterior(playerid);
  5891. LastEventIDs[playerid][1] = GetPlayerVirtualWorld(playerid);
  5892. SetPlayerPos(playerid, EventData[EventX], EventData[EventY], EventData[EventZ]);
  5893. SetPlayerInterior(playerid, EventData[EventInterior]);
  5894. SetPlayerVirtualWorldEx(playerid, EventData[EventVW]);
  5895. format(gstr, sizeof(gstr), "You have joined the event: %s. Use /ExitEvent to quit from it.", EventData[EventName]);
  5896. SendClientMessage(playerid, COLOR_ORANGE, gstr);
  5897. UnlockAchievement(playerid, 67);
  5898. return true;
  5899. }
  5900. CMD:exitevent(playerid, params[])
  5901. {
  5902. if(!Logged{playerid}) return true;
  5903. if(IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You can't exit in a vehicle.");
  5904. if(LastEventPos[playerid][0] == -1.0) return SysMsg(playerid,"You are not in an event.");
  5905. SetPlayerPos(playerid, LastEventPos[playerid][0], LastEventPos[playerid][1], LastEventPos[playerid][2]);
  5906. SetPlayerInterior(playerid, LastEventIDs[playerid][0]);
  5907. SetPlayerVirtualWorldEx(playerid, LastEventIDs[playerid][1]);
  5908. LastEventPos[playerid][0] = -1.0;
  5909. LastEventPos[playerid][1] = -1.0;
  5910. LastEventPos[playerid][2] = -1.0;
  5911. LastEventIDs[playerid][0] = 0;
  5912. LastEventIDs[playerid][1] = 0;
  5913. SendClientMessage(playerid, COLOR_ORANGE, "You have quit the event.");
  5914. return true;
  5915. }