nex-ac.inc 167 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004
  1. //Nex-AC by Nexius v1.2 (0.3.7-R1)
  2. #if defined _nex_ac_included
  3. #endinput
  4. #endif
  5. #define _nex_ac_included
  6. #include <a_samp>
  7. #if !defined FILTERSCRIPT
  8. //#define DEBUG
  9. #include <nex-ac_es.lang> //Localization
  10. #if !defined _nex_ac_lang_included
  11. #error Anticheat Nex-AC requires the installation of localization!
  12. #endif
  13. #define NEX_AC_VERSION "1.2"
  14. #define SERVER_VERSION "0.3.7"
  15. #define CONFIG_FILE "nex-ac_settings.cfg"
  16. #define MAX_CLASSES 319
  17. #define DEFAULT_COLOR -1
  18. #define USE_VENDING_MACHINES true
  19. #define USE_TUNING_GARAGES true
  20. #define USE_AMMUNATIONS true
  21. #define USE_RESTAURANTS true
  22. #define USE_PAYNSPRAY true
  23. #define USE_CASINOS true
  24. #define MAX_CONNECTS_FROM_IP 1
  25. #define MAX_RCON_LOGIN_ATTEMPT 1
  26. #define MAX_MSGS_REC_DIFF 799
  27. #define MAX_PING 500
  28. #define MIN_TIME_RECONNECT 12 //In seconds
  29. #define MAX_NOP_WARNINGS 1
  30. #define MAX_PING_WARNINGS 1
  31. #define MAX_AIR_WARNINGS 2
  32. #define MAX_AIR_VEH_WARNINGS 2
  33. #define MAX_FLYHACK_VEH_WARNINGS 2
  34. #define MAX_CARSHOT_WARNINGS 3
  35. #define MAX_PRO_AIM_WARNINGS 1
  36. #define MAX_AFK_GHOST_WARNINGS 2
  37. #define MAX_RAPID_FIRE_WARNINGS 1
  38. #define GetSpeed(%0,%1,%2) floatround(VectorSize(%0, %1, %2) * 179.28625)
  39. #define fpublic:%0(%1) forward %0(%1); public %0(%1)
  40. #define abs(%1) (((%1) < 0) ? (-(%1)) : ((%1)))
  41. static bool:ACAllow[] =
  42. {
  43. true, //0 Anti-AirBreak (onfoot)
  44. true, //1 Anti-AirBreak (in vehicle)
  45. true, //2 Anti-teleport hack (onfoot)
  46. true, //3 Anti-teleport hack (in vehicle)
  47. true, //4 Anti-teleport hack (into/between vehicles)
  48. true, //5 Anti-teleport hack (vehicle to player)
  49. true, //6 Anti-teleport hack (pickups)
  50. true, //7 Anti-FlyHack (onfoot)
  51. true, //8 Anti-FlyHack (in vehicle)
  52. true, //9 Anti-SpeedHack (onfoot)
  53. true, //10 Anti-SpeedHack (in vehicle)
  54. true, //11 Anti-Health hack (in vehicle)
  55. true, //12 Anti-Health hack (onfoot)
  56. true, //13 Anti-Armour hack
  57. true, //14 Anti-Money hack
  58. true, //15 Anti-Weapon hack
  59. true, //16 Anti-Ammo hack (add)
  60. true, //17 Anti-Ammo hack (infinite)
  61. true, //18 Anti-Special actions hack
  62. true, //19 Anti-GodMode from bullets (onfoot)
  63. true, //20 Anti-GodMode from bullets (in vehicle)
  64. true, //21 Anti-Invisible hack
  65. true, //22 Anti-lagcomp-spoof
  66. true, //23 Anti-Tuning hack
  67. true, //24 Anti-Parkour mod
  68. true, //25 Anti-Quick turn
  69. true, //26 Anti-Rapid fire
  70. true, //27 Anti-FakeSpawn
  71. true, //28 Anti-FakeKill
  72. true, //29 Anti-Pro Aim
  73. true, //30 Anti-CJ run
  74. true, //31 Anti-CarShot
  75. true, //32 Anti-CarJack
  76. true, //33 Anti-UnFreeze
  77. true, //34 Anti-AFK Ghost
  78. true, //35 Anti-Full Aiming
  79. true, //36 Anti-Fake NPC
  80. true, //37 Anti-Reconnect
  81. true, //38 Anti-High ping
  82. true, //39 Anti-Dialog hack
  83. true, //40 Protection from the sandbox
  84. true, //41 Protection against an invalid version
  85. true, //42 Anti-Rcon hack
  86. true, //43 Anti-Tuning crasher
  87. true, //44 Anti-Invalid seat crasher
  88. true, //45 Anti-Dialog crasher
  89. true, //46 Anti-Attached object crasher
  90. true, //47 Anti-Weapon Crasher
  91. true, //48 Flood protection connects to one slot
  92. true, //49 Anti-flood callback functions
  93. true, //50 Anti-flood change seat
  94. true, //51 Anti-Ddos
  95. true //52 Anti-NOP's
  96. };
  97. static const Mtfc[][] =
  98. {
  99. {250, 3}, //0 OnDialogResponse
  100. {800, 2}, //1 OnEnterExitModShop
  101. {250, 3}, //2 OnPlayerClickMap
  102. {450, 2}, //3 OnPlayerClickPlayer
  103. {150, 3}, //4 OnPlayerClickTextDraw
  104. {400, 3}, //5 OnPlayerCommandText
  105. {150, 3}, //6 OnPlayerEnterVehicle
  106. {150, 3}, //7 OnPlayerExitVehicle
  107. {800, 2}, //8 OnPlayerPickUpPickup
  108. {150, 3}, //9 OnPlayerRequestClass
  109. {250, 3}, //10 OnPlayerSelectedMenuRow
  110. {600, 3}, //11 OnPlayerStateChange
  111. {530, 2}, //12 OnVehicleMod
  112. {530, 2}, //13 OnVehiclePaintjob
  113. {530, 2}, //14 OnVehicleRespray
  114. {300, 1}, //15 OnVehicleDeath
  115. {450, 2}, //16 OnPlayerText
  116. {500, 2}, //17 OnPlayerEnterCheckpoint
  117. {500, 2}, //18 OnPlayerLeaveCheckpoint
  118. {150, 3}, //19 OnPlayerRequestSpawn
  119. {250, 3}, //20 OnPlayerExitedMenu
  120. {500, 2}, //21 OnPlayerEnterRaceCheckpoint
  121. {500, 2}, //22 OnPlayerLeaveRaceCheckpoint
  122. {150, 3}, //23 OnPlayerClickPlayerTextDraw
  123. {51, 9}, //24 OnVehicleDamageStatusUpdate
  124. {180, 3}, //25 OnVehicleSirenStateChange
  125. {150, 3}, //26 OnPlayerSelectObject
  126. {150, 3} //27 Cross-public
  127. },
  128. WeaponSlots[] =
  129. {
  130. 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, 10,
  131. 10, 8, 8, 8, 0, 0, 0, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5,
  132. 4, 6, 6, 7, 7, 7, 7, 8, 12, 9, 9, 9, 11, 11, 11
  133. },
  134. WeaponModels[] =
  135. {
  136. 0, 331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325,
  137. 326, 342, 343, 344, 0, 0, 0, 346, 347, 348, 349, 350, 351, 352, 353, 355, 356,
  138. 372, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 371
  139. },
  140. VehicleTypes[] =
  141. {
  142. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0,
  143. 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 3, 3,
  144. 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 3, 0, 0, 1, 0, 0, 0, 0,
  145. 2, 0, 0, 3, 0, 0, 1, 1, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  146. 0, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  147. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
  148. 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  149. 0, 0, 0, 1, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  150. },
  151. MaxPassengers[] =
  152. {
  153. 0x10331113, 0x11311131, 0x11331313, 0x80133301, 0x1381F110,
  154. 0x10311103, 0x10001F10, 0x11113311, 0x13113311, 0x31101100,
  155. 0x30001301, 0x11031311, 0x11111331, 0x10013111, 0x01131100,
  156. 0x11111110, 0x11100031, 0x11130221, 0x33113311, 0x11111101,
  157. 0x33101133, 0x101001F0, 0x03133111, 0xFF11113F, 0x13330111,
  158. 0xFF131111, 0x0000FF3F
  159. },
  160. VehicleMods[] =
  161. {
  162. 0x033C2700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  163. 0x021A27FA, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  164. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  165. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  166. 0x023B2785, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  167. 0x02BC4703, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  168. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  169. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  170. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  171. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  172. 0x03BA278A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  173. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  174. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  175. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  176. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  177. 0x028E078A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  178. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  179. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  180. 0x02310744, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  181. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  182. 0x0228073A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  183. 0x02BD4701, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  184. 0x023A2780, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  185. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  186. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  187. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  188. 0x0228077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  189. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  190. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  191. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  192. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  193. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  194. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  195. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  196. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  197. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  198. 0x027A27CA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  199. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  200. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  201. 0x0282278A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  202. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  203. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  204. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  205. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  206. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  207. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  208. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  209. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  210. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  211. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  212. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  213. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  214. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  215. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  216. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  217. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  218. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  219. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  220. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  221. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  222. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  223. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  224. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  225. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  226. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  227. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  228. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  229. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  230. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  231. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  232. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  233. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  234. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  235. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  236. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  237. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  238. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  239. 0x023E07C0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  240. 0x03703730, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  241. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  242. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  243. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  244. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  245. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  246. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  247. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  248. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  249. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  250. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  251. 0x031D2775, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  252. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  253. 0x02BE4788, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  254. 0x02010771, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  255. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  256. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  257. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  258. 0x029A0FCE, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000,
  259. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  260. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  261. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  262. 0x03382700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  263. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  264. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  265. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  266. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  267. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  268. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  269. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  270. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  271. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  272. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  273. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  274. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  275. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  276. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  277. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  278. 0x023F8795, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  279. 0x029F078C, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  280. 0x029627EA, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  281. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  282. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  283. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  284. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  285. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  286. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  287. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  288. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  289. 0x0236C782, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  290. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  291. 0x029E1FCA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  292. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  293. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  294. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  295. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  296. 0x02000700, 0x00000000, 0x00FFFE00, 0xFC000437, 0x00000000, 0x021C0000,
  297. 0x02000700, 0x00000000, 0x00FFFE00, 0x03FE6007, 0x00000000, 0x00000000,
  298. 0x02000700, 0x00000000, 0x00FFFE00, 0x00001B87, 0x00000001, 0x01E00000,
  299. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  300. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  301. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  302. 0x039E07D2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  303. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  304. 0x023CC700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00030000, 0x00000000,
  305. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  306. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  307. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  308. 0x038E07D6, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  309. 0x023D0709, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000,
  310. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  311. 0x029E1F8A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  312. 0x029C077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  313. 0x02BD076C, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  314. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  315. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  316. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  317. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  318. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  319. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  320. 0x02000700, 0x00000000, 0xFFFFFE00, 0x00000007, 0x00000000, 0x000001F8,
  321. 0x02000700, 0x00000000, 0x00FFFFFE, 0x00000007, 0xC0000000, 0x00002007,
  322. 0xFE000700, 0x00000003, 0x00FFFE00, 0x00000007, 0x00003C00, 0x00000600,
  323. 0xCE000700, 0xFF800000, 0x00FFFE01, 0x00000007, 0x3C000000, 0x00000000,
  324. 0x02000700, 0x000003FC, 0x00FFFE00, 0x00000007, 0x003C0000, 0x00001800,
  325. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  326. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  327. 0x02000700, 0x007FE000, 0x00FFFE00, 0x00000007, 0x03C00000, 0x00000000,
  328. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  329. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000047, 0x0000003E, 0x3C000000,
  330. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  331. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  332. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  333. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  334. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  335. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  336. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  337. 0x02000700, 0x00001C00, 0x00FFFE00, 0x0000000F, 0x00000000, 0x0003C000,
  338. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x000003C0, 0xC0000000,
  339. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  340. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  341. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  342. 0x029607C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  343. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  344. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  345. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  346. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  347. 0x03FFE7CD, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  348. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  349. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  350. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  351. 0x031727F1, 0x00000000, 0x00FFFE00, 0x00000007, 0x00030000, 0x00000000,
  352. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  353. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  354. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  355. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  356. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  357. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  358. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  359. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  360. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  361. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  362. 0x025627F0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  363. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  364. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  365. 0x039E07C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  366. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  367. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  368. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  369. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  370. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  371. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  372. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  373. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000
  374. },
  375. #if USE_AMMUNATIONS
  376. AmmuNationInfo[][] =
  377. {
  378. {200, 30}, //22 9mm
  379. {600, 30}, //23 Silenced 9mm
  380. {1200, 10}, //24 Desert Eagle
  381. {600, 15}, //25 Shotgun
  382. {800, 12}, //26 Sawnoff Shotgun
  383. {1000, 10}, //27 Combat Shotgun
  384. {500, 60}, //28 Micro SMG/Uzi
  385. {2000, 90}, //29 MP5
  386. {3500, 120},//30 AK-47
  387. {4500, 90}, //31 M4
  388. {300, 60} //32 Tec-9
  389. },
  390. Float:AmmuNations[][] =
  391. {
  392. {296.5541, -38.5138, 1001.5156},
  393. {295.7008, -80.8109, 1001.5156},
  394. {290.1963, -109.7721, 1001.5156},
  395. {312.2592, -166.1385, 999.601}
  396. },
  397. #endif
  398. #if USE_RESTAURANTS
  399. Float:Restaurants[][] =
  400. {
  401. {374.0, -119.641, 1001.4922},
  402. {368.789, -6.857, 1001.8516},
  403. {375.566, -68.222, 1001.5151}
  404. },
  405. #endif
  406. #if USE_PAYNSPRAY
  407. Float:PayNSpray[][] =
  408. {
  409. {2064.2842, -1831.4736, 13.5469},
  410. {-2425.7822, 1022.1392, 50.3977},
  411. {-1420.5195, 2584.2305, 55.8433},
  412. {487.6401, -1739.9479, 11.1385},
  413. {1024.8651, -1024.087, 32.1016},
  414. {-1904.7019, 284.5968, 41.0469},
  415. {1975.2384, 2162.5088, 11.0703},
  416. {2393.4456, 1491.5537, 10.5616},
  417. {720.0854, -457.8807, 16.3359},
  418. {-99.9417, 1117.9048, 19.7417}
  419. },
  420. #endif
  421. #if USE_VENDING_MACHINES
  422. Float:VendingMachines[][] =
  423. {
  424. {-862.82, 1536.6, 21.98},
  425. {2271.72, -76.46, 25.96},
  426. {1277.83, 372.51, 18.95},
  427. {662.42, -552.16, 15.71},
  428. {201.01, -107.61, 0.89},
  429. {-253.74, 2597.95, 62.24},
  430. {-253.74, 2599.75, 62.24},
  431. {-76.03, 1227.99, 19.12},
  432. {-14.7, 1175.35, 18.95},
  433. {-1455.11, 2591.66, 55.23},
  434. {2352.17, -1357.15, 23.77},
  435. {2325.97, -1645.13, 14.21},
  436. {2139.51, -1161.48, 23.35},
  437. {2153.23, -1016.14, 62.23},
  438. {1928.73, -1772.44, 12.94},
  439. {1154.72, -1460.89, 15.15},
  440. {2480.85, -1959.27, 12.96},
  441. {2060.11, -1897.64, 12.92},
  442. {1729.78, -1943.04, 12.94},
  443. {1634.1, -2237.53, 12.89},
  444. {1789.21, -1369.26, 15.16},
  445. {-2229.18, 286.41, 34.7},
  446. {2319.99, 2532.85, 10.21},
  447. {2845.72, 1295.04, 10.78},
  448. {2503.14, 1243.69, 10.21},
  449. {2647.69, 1129.66, 10.21},
  450. {-2420.21, 984.57, 44.29},
  451. {-2420.17, 985.94, 44.29},
  452. {2085.77, 2071.35, 10.45},
  453. {1398.84, 2222.6, 10.42},
  454. {1659.46, 1722.85, 10.21},
  455. {1520.14, 1055.26, 10.0},
  456. {-1980.78, 142.66, 27.07},
  457. {-2118.96, -423.64, 34.72},
  458. {-2118.61, -422.41, 34.72},
  459. {-2097.27, -398.33, 34.72},
  460. {-2092.08, -490.05, 34.72},
  461. {-2063.27, -490.05, 34.72},
  462. {-2005.64, -490.05, 34.72},
  463. {-2034.46, -490.05, 34.72},
  464. {-2068.56, -398.33, 34.72},
  465. {-2039.85, -398.33, 34.72},
  466. {-2011.14, -398.33, 34.72},
  467. {-1350.11, 492.28, 10.58},
  468. {-1350.11, 493.85, 10.58},
  469. {2222.36, 1602.64, 1000.06},
  470. {2222.2, 1606.77, 1000.05},
  471. {2155.9, 1606.77, 1000.05},
  472. {2155.84, 1607.87, 1000.06},
  473. {2209.9, 1607.19, 1000.05},
  474. {2202.45, 1617.0, 1000.06},
  475. {2209.24, 1621.21, 1000.06},
  476. {2576.7, -1284.43, 1061.09},
  477. {330.67, 178.5, 1020.07},
  478. {331.92, 178.5, 1020.07},
  479. {350.9, 206.08, 1008.47},
  480. {361.56, 158.61, 1008.47},
  481. {371.59, 178.45, 1020.07},
  482. {374.89, 188.97, 1008.47},
  483. {-19.03, -57.83, 1003.63},
  484. {-36.14, -57.87, 1003.63},
  485. {316.87, -140.35, 998.58},
  486. {2225.2, -1153.42, 1025.9},
  487. {-15.1, -140.22, 1003.63},
  488. {-16.53, -140.29, 1003.63},
  489. {-35.72, -140.22, 1003.63},
  490. {373.82, -178.14, 1000.73},
  491. {379.03, -178.88, 1000.73},
  492. {495.96, -24.32, 1000.73},
  493. {500.56, -1.36, 1000.73},
  494. {501.82, -1.42, 1000.73},
  495. {-33.87, -186.76, 1003.63},
  496. {-32.44, -186.69, 1003.63},
  497. {-16.11, -91.64, 1003.63},
  498. {-17.54, -91.71, 1003.63}
  499. },
  500. #endif
  501. #if USE_CASINOS
  502. Float:Casinos[][] =
  503. {
  504. {2241.2878, 1617.1624, 1006.1797, 2.0},
  505. {2240.9736, 1604.6592, 1006.1797, 6.0},
  506. {2242.5427, 1592.8726, 1006.1836, 6.0},
  507. {2230.2124, 1592.1426, 1006.1832, 6.0},
  508. {2230.4717, 1604.484, 1006.186, 6.0},
  509. {2230.3298, 1616.9272, 1006.1799, 3.0},
  510. {2251.9407, 1586.1736, 1006.186, 1.0},
  511. {2218.6785, 1587.3448, 1006.1749, 1.0},
  512. {2219.2773, 1591.7467, 1006.1867, 1.0},
  513. {2218.5408, 1589.3229, 1006.184, 1.0},
  514. {2218.6477, 1593.6279, 1006.1797, 1.0},
  515. {2221.926, 1603.8285, 1006.1797, 1.0},
  516. {2218.5095, 1603.8385, 1006.1797, 1.0},
  517. {2219.9597, 1603.9216, 1006.1797, 1.0},
  518. {2216.3054, 1603.7996, 1006.1819, 1.0},
  519. {2218.731, 1619.8046, 1006.1794, 1.0},
  520. {2218.9407, 1617.8413, 1006.1821, 1.0},
  521. {2218.668, 1615.4681, 1006.1797, 1.0},
  522. {2218.6418, 1613.2629, 1006.1797, 1.0},
  523. {2252.4272, 1589.8412, 1006.1797, 5.0},
  524. {2252.4229, 1596.6169, 1006.1797, 5.0},
  525. {2255.1565, 1608.8784, 1006.186, 1.0},
  526. {2254.8496, 1610.8605, 1006.1797, 1.0},
  527. {2255.2917, 1612.9167, 1006.1797, 1.0},
  528. {2255.033, 1614.8892, 1006.1797, 1.0},
  529. {2255.1213, 1616.8284, 1006.1797, 1.0},
  530. {2255.2161, 1618.8005, 1006.1797, 1.0},
  531. {2268.5281, 1606.4894, 1006.1797, 1.0},
  532. {2270.4922, 1606.8539, 1006.1797, 1.0},
  533. {2272.5693, 1606.4473, 1006.1797, 1.0},
  534. {2274.5391, 1607.0122, 1006.1797, 1.0},
  535. {2271.8447, 1586.1633, 1006.1797, 1.0},
  536. {2261.4844, 1586.1724, 1006.1797, 1.0},
  537. {2257.4507, 1589.6555, 1006.1797, 5.0},
  538. {2267.8994, 1589.8672, 1006.1797, 5.0},
  539. {2262.8486, 1590.026, 1006.1797, 5.0},
  540. {2272.6458, 1589.7704, 1006.1797, 5.0},
  541. {2272.6533, 1596.5682, 1006.1797, 5.0},
  542. {2270.4895, 1596.4606, 1006.1797, 5.0},
  543. {2265.4441, 1596.4299, 1006.1797, 5.0},
  544. {2260.0308, 1596.7987, 1006.1797, 5.0},
  545. {2254.9907, 1596.241, 1006.1797, 5.0},
  546. {1956.9524, 988.2533, 992.4688, 2.0},
  547. {1961.6155, 993.0375, 992.4688, 2.0},
  548. {1963.7998, 998.4406, 992.4745, 2.0},
  549. {1936.2885, 987.1995, 992.4745, 2.0},
  550. {1944.9768, 986.3937, 992.4688, 2.0},
  551. {1940.7397, 990.9521, 992.4609, 2.0},
  552. {1940.0966, 1005.8996, 992.4688, 6.0},
  553. {1938.8785, 1014.1768, 992.4688, 6.0},
  554. {1938.8811, 1021.4434, 992.4688, 6.0},
  555. {1966.5975, 1006.6469, 992.4745, 6.0},
  556. {1966.5979, 1014.1024, 992.4688, 6.0},
  557. {1939.8351, 1029.912, 992.4688, 6.0},
  558. {1956.854, 1047.3718, 992.4688, 6.0},
  559. {1961.356, 1042.8112, 992.4688, 6.0},
  560. {1963.811, 1037.1263, 992.4745, 6.0},
  561. {1961.733, 1025.8929, 992.4688, 10.0},
  562. {1961.708, 1010.3194, 992.4688, 10.0},
  563. {1966.5989, 1029.7954, 992.4745, 6.0},
  564. {1961.4139, 1017.8281, 992.4688, 10.0},
  565. {1966.5985, 1021.7686, 992.4688, 6.0},
  566. {1128.7106, -1.9779, 1000.6797, 1.0},
  567. {1125.2388, 1.61, 1000.6797, 1.0},
  568. {1125.1249, -5.0489, 1000.6797, 1.0},
  569. {1127.4139, 3.0199, 1000.6797, 1.0},
  570. {1135.0634, -3.8695, 1000.6797, 1.0},
  571. {1135.0861, 0.6107, 1000.6797, 1.0},
  572. {1132.8943, -1.7139, 1000.6797, 1.0},
  573. {1125.3727, 3.0315, 1000.6797, 1.0},
  574. {1119.0272, -1.4916, 1000.6924, 1.0}
  575. },
  576. #endif
  577. PickupAmmo[] =
  578. {
  579. 1, //0 Fist
  580. 1, //1 Brass Knuckles
  581. 1, //2 Golf Club
  582. 1, //3 Nightstick
  583. 1, //4 Knife
  584. 1, //5 Baseball Bat
  585. 1, //6 Shovel
  586. 1, //7 Pool Cue
  587. 1, //8 Katana
  588. 1, //9 Chainsaw
  589. 1, //10 Purple Dildo
  590. 1, //11 Dildo
  591. 1, //12 Vibrator
  592. 1, //13 Silver Vibrator
  593. 1, //14 Flowers
  594. 1, //15 Cane
  595. 8, //16 Grenade
  596. 8, //17 Tear Gas
  597. 8, //18 Molotov Cocktail
  598. 0, //19
  599. 0, //20
  600. 0, //21
  601. 30, //22 9mm
  602. 10, //23 Silenced 9mm
  603. 10, //24 Desert Eagle
  604. 15, //25 Shotgun
  605. 10, //26 Sawnoff Shotgun
  606. 10, //27 Combat Shotgun
  607. 60, //28 Micro SMG/Uzi
  608. 60, //29 MP5
  609. 80, //30 AK-47
  610. 80, //31 M4
  611. 60, //32 Tec-9
  612. 20, //33 Country Rifle
  613. 10, //34 Sniper Rifle
  614. 4, //35 RPG
  615. 3, //36 HS Rocket
  616. 100, //37 Flamethrower
  617. 100, //38 Minigun
  618. 5, //39 Satchel Charge
  619. 1, //40 Detonator
  620. 500, //41 Spraycan
  621. 200, //42 Fire Extinguisher
  622. 32, //43 Camera
  623. 1, //44 Night Vis Goggles
  624. 1, //45 Thermal Goggles
  625. 1 //46 Parachute
  626. };
  627. enum ACInfo
  628. {
  629. Float:pPos[3],
  630. Float:pDropJP[3],
  631. Float:pSetPos[3],
  632. Float:pSetVehHealth,
  633. Float:pSpeed,
  634. pHealth,
  635. pArmour,
  636. pMoney,
  637. pClassid,
  638. pLastWeapon,
  639. pEnterVeh,
  640. pEnterVehTime,
  641. pVeh,
  642. pSeat,
  643. pDialog,
  644. pAnim,
  645. pDmgRes,
  646. pSpecAct,
  647. pNextSpecAct,
  648. pLastSpecAct,
  649. pLastPickup,
  650. pShotTime,
  651. pSpawnTime,
  652. pLastUpdate,
  653. pTimerID,
  654. pKicked,
  655. pIp[16],
  656. pSet[13],
  657. pGtc[17],
  658. pWeapon[13],
  659. pAmmo[13],
  660. pSetWeapon[13],
  661. pGiveAmmo[13],
  662. pSpawnWeapon[3],
  663. pSpawnAmmo[3],
  664. pGtcSetWeapon[13],
  665. pGtcGiveAmmo[13],
  666. pNOPCount[11],
  667. pCheatCount[12],
  668. pCall[sizeof Mtfc],
  669. pFloodCount[sizeof Mtfc],
  670. bool:pACAllow[sizeof ACAllow],
  671. bool:pStuntBonus,
  672. bool:pModShop,
  673. bool:pFreeze,
  674. bool:pOnline,
  675. bool:pSpawnRes,
  676. bool:pDeathRes,
  677. bool:pVehDmgRes,
  678. bool:pDead,
  679. bool:pShot,
  680. bool:pTpToZ,
  681. bool:pPicked,
  682. bool:pParachute,
  683. bool:pIntEnterExits
  684. }
  685. enum ACVehInfo
  686. {
  687. Float:vVel[3],
  688. Float:vSpeedDiff,
  689. Float:vPosDiff,
  690. Float:vZAngle,
  691. Float:vHealth,
  692. vDriver,
  693. vInt,
  694. vPaintJob,
  695. bool:vSpawned
  696. }
  697. enum ACPickInfo
  698. {
  699. Float:pPos[3],
  700. pType,
  701. pWeapon,
  702. bool:pIsStatic
  703. }
  704. static
  705. StatsInfo[6],
  706. Class[MAX_CLASSES][3][2],
  707. AntiCheatInfo[MAX_PLAYERS][ACInfo],
  708. AntiCheatVehInfo[MAX_VEHICLES][ACVehInfo],
  709. AntiCheatPickInfo[MAX_PICKUPS][ACPickInfo],
  710. bool:IntEnterExits = true,
  711. bool:StuntBonus = true,
  712. bool:VehFriendlyFire,
  713. bool:LagCompMode,
  714. bool:PedAnims;
  715. fpublic: ac_AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
  716. {
  717. new vehicleid = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
  718. if(vehicleid != 65535)
  719. {
  720. AntiCheatVehInfo[vehicleid][vInt] = 0;
  721. AntiCheatVehInfo[vehicleid][vPaintJob] = 3;
  722. AntiCheatVehInfo[vehicleid][vSpawned] = true;
  723. AntiCheatVehInfo[vehicleid][vHealth] = 1000.0;
  724. AntiCheatVehInfo[vehicleid][vSpeedDiff] =
  725. AntiCheatVehInfo[vehicleid][vPosDiff] =
  726. AntiCheatVehInfo[vehicleid][vVel][0] =
  727. AntiCheatVehInfo[vehicleid][vVel][1] =
  728. AntiCheatVehInfo[vehicleid][vVel][2] = 0.0;
  729. AntiCheatVehInfo[vehicleid][vDriver] = 65535;
  730. }
  731. return vehicleid;
  732. }
  733. fpublic: ac_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren)
  734. {
  735. new vehicleid = AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay, addsiren);
  736. if(vehicleid != 65535)
  737. {
  738. AntiCheatVehInfo[vehicleid][vInt] = 0;
  739. AntiCheatVehInfo[vehicleid][vPaintJob] = 3;
  740. AntiCheatVehInfo[vehicleid][vSpawned] = true;
  741. AntiCheatVehInfo[vehicleid][vHealth] = 1000.0;
  742. AntiCheatVehInfo[vehicleid][vSpeedDiff] =
  743. AntiCheatVehInfo[vehicleid][vPosDiff] =
  744. AntiCheatVehInfo[vehicleid][vVel][0] =
  745. AntiCheatVehInfo[vehicleid][vVel][1] =
  746. AntiCheatVehInfo[vehicleid][vVel][2] = 0.0;
  747. AntiCheatVehInfo[vehicleid][vDriver] = 65535;
  748. }
  749. return vehicleid;
  750. }
  751. fpublic: ac_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren)
  752. {
  753. new vehicleid = CreateVehicle(vehicletype, x, y, z, rotation, color1, color2, respawn_delay, addsiren);
  754. if(vehicleid != 65535)
  755. {
  756. AntiCheatVehInfo[vehicleid][vInt] = 0;
  757. AntiCheatVehInfo[vehicleid][vPaintJob] = 3;
  758. AntiCheatVehInfo[vehicleid][vHealth] = 1000.0;
  759. AntiCheatVehInfo[vehicleid][vSpeedDiff] =
  760. AntiCheatVehInfo[vehicleid][vPosDiff] =
  761. AntiCheatVehInfo[vehicleid][vVel][0] =
  762. AntiCheatVehInfo[vehicleid][vVel][1] =
  763. AntiCheatVehInfo[vehicleid][vVel][2] = 0.0;
  764. if(!(568 < vehicletype < 571)) AntiCheatVehInfo[vehicleid][vSpawned] = true;
  765. AntiCheatVehInfo[vehicleid][vDriver] = 65535;
  766. }
  767. return vehicleid;
  768. }
  769. fpublic: ac_AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  770. {
  771. new classid = AddPlayerClass(modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  772. if(classid < MAX_CLASSES)
  773. {
  774. Class[classid][0][0] = weapon1;
  775. Class[classid][0][1] = weapon1_ammo;
  776. Class[classid][1][0] = weapon2;
  777. Class[classid][1][1] = weapon2_ammo;
  778. Class[classid][2][0] = weapon3;
  779. Class[classid][2][1] = weapon3_ammo;
  780. }
  781. return classid;
  782. }
  783. fpublic: ac_AddPlayerClassEx(teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  784. {
  785. new classid = AddPlayerClassEx(teamid, modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  786. if(classid < MAX_CLASSES)
  787. {
  788. #undef MAX_CLASSES
  789. Class[classid][0][0] = weapon1;
  790. Class[classid][0][1] = weapon1_ammo;
  791. Class[classid][1][0] = weapon2;
  792. Class[classid][1][1] = weapon2_ammo;
  793. Class[classid][2][0] = weapon3;
  794. Class[classid][2][1] = weapon3_ammo;
  795. }
  796. return classid;
  797. }
  798. fpublic: ac_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  799. {
  800. if(!SetSpawnInfo(playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)) return 0;
  801. AntiCheatInfo[playerid][pSpawnWeapon][0] = weapon1;
  802. AntiCheatInfo[playerid][pSpawnAmmo][0] = weapon1_ammo;
  803. AntiCheatInfo[playerid][pSpawnWeapon][1] = weapon2;
  804. AntiCheatInfo[playerid][pSpawnAmmo][1] = weapon2_ammo;
  805. AntiCheatInfo[playerid][pSpawnWeapon][2] = weapon3;
  806. AntiCheatInfo[playerid][pSpawnAmmo][2] = weapon3_ammo;
  807. return 1;
  808. }
  809. fpublic: ac_AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld)
  810. {
  811. new pickupid = CreatePickup(model, type, X, Y, Z, virtualworld);
  812. if(pickupid == -1) return 0;
  813. AntiCheatPickInfo[pickupid][pWeapon] = 0;
  814. switch(type)
  815. {
  816. case 2, 3, 15, 22:
  817. {
  818. switch(model)
  819. {
  820. case 370: AntiCheatPickInfo[pickupid][pType] = 2;
  821. case 1240: AntiCheatPickInfo[pickupid][pType] = 3;
  822. case 1242: AntiCheatPickInfo[pickupid][pType] = 4;
  823. case 321..369, 371, 372:
  824. {
  825. for(new i = 46; i != -1; --i)
  826. {
  827. if(WeaponModels[i] == model)
  828. {
  829. AntiCheatPickInfo[pickupid][pType] = 1;
  830. AntiCheatPickInfo[pickupid][pWeapon] = i;
  831. break;
  832. }
  833. }
  834. }
  835. }
  836. }
  837. }
  838. AntiCheatPickInfo[pickupid][pIsStatic] = true;
  839. AntiCheatPickInfo[pickupid][pPos][0] = X;
  840. AntiCheatPickInfo[pickupid][pPos][1] = Y;
  841. AntiCheatPickInfo[pickupid][pPos][2] = Z;
  842. return 1;
  843. }
  844. fpublic: ac_CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld)
  845. {
  846. new pickupid = CreatePickup(model, type, X, Y, Z, virtualworld);
  847. if(pickupid != -1)
  848. {
  849. AntiCheatPickInfo[pickupid][pWeapon] = 0;
  850. switch(type)
  851. {
  852. case 2, 3, 15, 22:
  853. {
  854. switch(model)
  855. {
  856. case 370: AntiCheatPickInfo[pickupid][pType] = 2;
  857. case 1240: AntiCheatPickInfo[pickupid][pType] = 3;
  858. case 1242: AntiCheatPickInfo[pickupid][pType] = 4;
  859. case 321..369, 371, 372:
  860. {
  861. for(new i = 46; i != -1; --i)
  862. {
  863. if(WeaponModels[i] == model)
  864. {
  865. AntiCheatPickInfo[pickupid][pType] = 1;
  866. AntiCheatPickInfo[pickupid][pWeapon] = i;
  867. break;
  868. }
  869. }
  870. }
  871. }
  872. }
  873. }
  874. AntiCheatPickInfo[pickupid][pIsStatic] = false;
  875. AntiCheatPickInfo[pickupid][pPos][0] = X;
  876. AntiCheatPickInfo[pickupid][pPos][1] = Y;
  877. AntiCheatPickInfo[pickupid][pPos][2] = Z;
  878. }
  879. return pickupid;
  880. }
  881. #if defined CreateDynamicPickup\
  882. || defined CreateDynamicPickupEx
  883. fpublic: STREAMER_TAG_PICKUP ac_CreateDynamicPickup(pickupid, modelid, type, Float:x, Float:y, Float:z)
  884. {
  885. switch(type)
  886. {
  887. case 2, 3, 15, 22:
  888. {
  889. switch(modelid)
  890. {
  891. case 370: AntiCheatPickInfo[pickupid][pType] = 2;
  892. case 1240: AntiCheatPickInfo[pickupid][pType] = 3;
  893. case 1242: AntiCheatPickInfo[pickupid][pType] = 4;
  894. case 321..369, 371, 372:
  895. {
  896. for(new i = 46; i != -1; --i)
  897. {
  898. if(WeaponModels[i] == modelid)
  899. {
  900. AntiCheatPickInfo[pickupid][pType] = 1;
  901. AntiCheatPickInfo[pickupid][pWeapon] = i;
  902. break;
  903. }
  904. }
  905. }
  906. }
  907. }
  908. }
  909. AntiCheatPickInfo[pickupid][pIsStatic] = false;
  910. AntiCheatPickInfo[pickupid][pPos][0] = x;
  911. AntiCheatPickInfo[pickupid][pPos][1] = y;
  912. AntiCheatPickInfo[pickupid][pPos][2] = z;
  913. }
  914. #endif
  915. fpublic: ac_DestroyVehicle(vehicleid)
  916. {
  917. if(!DestroyVehicle(vehicleid)) return 0;
  918. AntiCheatVehInfo[vehicleid][vSpawned] = false;
  919. return 1;
  920. }
  921. fpublic: ac_DestroyPickup(pickup)
  922. {
  923. if(!DestroyPickup(pickup)) return 0;
  924. AntiCheatPickInfo[pickup][pType] = 0;
  925. return 1;
  926. }
  927. #if defined DestroyDynamicPickup
  928. fpublic: ac_DestroyDynamicPickup(STREAMER_TAG_PICKUP pickupid)
  929. {
  930. if(!DestroyDynamicPickup(pickupid)) return 0;
  931. AntiCheatPickInfo[pickupid][pType] = 0;
  932. return 1;
  933. }
  934. #endif
  935. #if defined DestroyAllDynamicPickups\
  936. && defined IsValidDynamicPickup
  937. fpublic: ac_DestroyAllDynamicPickups()
  938. {
  939. if(!DestroyAllDynamicPickups()) return 0;
  940. for(new STREAMER_TAG_PICKUP i = MAX_PICKUPS - 1; i != -1; --i)
  941. {
  942. if(IsValidDynamicPickup(i)) AntiCheatPickInfo[i][pType] = 0;
  943. }
  944. return 1;
  945. }
  946. #endif
  947. fpublic: ac_DisableInteriorEnterExits()
  948. {
  949. IntEnterExits = false;
  950. return DisableInteriorEnterExits();
  951. }
  952. fpublic: ac_UsePlayerPedAnims()
  953. {
  954. PedAnims = true;
  955. return UsePlayerPedAnims();
  956. }
  957. fpublic: ac_EnableVehicleFriendlyFire()
  958. {
  959. VehFriendlyFire = true;
  960. return EnableVehicleFriendlyFire();
  961. }
  962. fpublic: ac_EnableStuntBonusForAll(enable)
  963. {
  964. StuntBonus = !!enable;
  965. #if defined foreach
  966. foreach(Player, i) AntiCheatInfo[i][pStuntBonus] = StuntBonus;
  967. #else
  968. for(new i = GetPlayerPoolSize(); i != -1; --i)
  969. {
  970. if(IsPlayerConnected(i)) AntiCheatInfo[i][pStuntBonus] = StuntBonus;
  971. }
  972. #endif
  973. return EnableStuntBonusForAll(enable);
  974. }
  975. fpublic: ac_EnableStuntBonusForPlayer(playerid, enable)
  976. {
  977. if(!EnableStuntBonusForPlayer(playerid, enable)) return 0;
  978. AntiCheatInfo[playerid][pStuntBonus] = !!enable;
  979. return 1;
  980. }
  981. fpublic: ac_ShowPlayerDialog(playerid, dialogid)
  982. {
  983. if(IsPlayerConnected(playerid)) AntiCheatInfo[playerid][pDialog] = dialogid;
  984. return 1;
  985. }
  986. fpublic: ac_TogglePlayerControllable(playerid, toggle)
  987. {
  988. if(!TogglePlayerControllable(playerid, toggle)) return 0;
  989. AntiCheatInfo[playerid][pFreeze] = !!toggle;
  990. return 1;
  991. }
  992. fpublic: ac_TogglePlayerSpectating(playerid, toggle)
  993. {
  994. if(!TogglePlayerSpectating(playerid, toggle)) return 0;
  995. AntiCheatInfo[playerid][pSet][6] = 1;
  996. AntiCheatInfo[playerid][pNOPCount][8] = 0;
  997. AntiCheatInfo[playerid][pGtc][12] = GetTickCount();
  998. if(!toggle)
  999. {
  1000. AntiCheatInfo[playerid][pSet][7] = 1;
  1001. AntiCheatInfo[playerid][pNOPCount][9] = 0;
  1002. AntiCheatInfo[playerid][pGtc][13] = AntiCheatInfo[playerid][pGtc][12];
  1003. }
  1004. return 1;
  1005. }
  1006. fpublic: ac_SpawnPlayer(playerid)
  1007. {
  1008. if(!SpawnPlayer(playerid)) return 0;
  1009. AntiCheatInfo[playerid][pSet][7] = 1;
  1010. AntiCheatInfo[playerid][pNOPCount][9] = 0;
  1011. AntiCheatInfo[playerid][pGtc][13] = GetTickCount();
  1012. return 1;
  1013. }
  1014. fpublic: ac_SetPlayerHealth(playerid, Float:health)
  1015. {
  1016. if(health > 16777250.0) health = 16777250.0;
  1017. if(!SetPlayerHealth(playerid, health)) return 0;
  1018. if(health < 0.0) health = 0.0;
  1019. AntiCheatInfo[playerid][pNOPCount][3] = 0;
  1020. AntiCheatInfo[playerid][pSet][1] = floatround(health, floatround_tozero);
  1021. AntiCheatInfo[playerid][pGtc][3] = GetTickCount();
  1022. return 1;
  1023. }
  1024. fpublic: ac_SetPlayerArmour(playerid, Float:armour)
  1025. {
  1026. if(armour > 16777250.0) armour = 16777250.0;
  1027. if(!SetPlayerArmour(playerid, armour)) return 0;
  1028. if(armour < 0.0) armour = 0.0;
  1029. AntiCheatInfo[playerid][pNOPCount][5] = 0;
  1030. AntiCheatInfo[playerid][pSet][2] = floatround(armour, floatround_tozero);
  1031. AntiCheatInfo[playerid][pGtc][5] = GetTickCount();
  1032. return 1;
  1033. }
  1034. fpublic: ac_GivePlayerWeapon(playerid, weaponid, ammo)
  1035. {
  1036. if(!IsPlayerConnected(playerid)) return 0;
  1037. if(!(!AntiCheatInfo[playerid][pAmmo][WeaponSlots[weaponid]] && !ammo))
  1038. {
  1039. AntiCheatInfo[playerid][pNOPCount][0] =
  1040. AntiCheatInfo[playerid][pNOPCount][1] = 0;
  1041. if(15 < weaponid < 44)
  1042. {
  1043. if(2 < WeaponSlots[weaponid] < 6
  1044. || (AntiCheatInfo[playerid][pSetWeapon][WeaponSlots[weaponid]] ==
  1045. -1 ? AntiCheatInfo[playerid][pWeapon][WeaponSlots[weaponid]]
  1046. : AntiCheatInfo[playerid][pSetWeapon][WeaponSlots[weaponid]])
  1047. == weaponid)
  1048. {
  1049. AntiCheatInfo[playerid][pGiveAmmo][WeaponSlots[weaponid]] =
  1050. (AntiCheatInfo[playerid][pGiveAmmo][WeaponSlots[weaponid]] == -65535
  1051. ? AntiCheatInfo[playerid][pAmmo][WeaponSlots[weaponid]]
  1052. : AntiCheatInfo[playerid][pGiveAmmo][WeaponSlots[weaponid]]) + ammo;
  1053. }
  1054. else AntiCheatInfo[playerid][pGiveAmmo][WeaponSlots[weaponid]] = ammo;
  1055. if(AntiCheatInfo[playerid][pGiveAmmo][WeaponSlots[weaponid]] < -32768) ammo =
  1056. AntiCheatInfo[playerid][pGiveAmmo][WeaponSlots[weaponid]] = -32768;
  1057. else if(AntiCheatInfo[playerid][pGiveAmmo][WeaponSlots[weaponid]] > 32767) ammo =
  1058. AntiCheatInfo[playerid][pGiveAmmo][WeaponSlots[weaponid]] = 32767;
  1059. if(weaponid == 40 && ammo >
  1060. 0) AntiCheatInfo[playerid][pGiveAmmo][WeaponSlots[weaponid]] = ammo = 1;
  1061. }
  1062. AntiCheatInfo[playerid][pSet][3] =
  1063. AntiCheatInfo[playerid][pSetWeapon][WeaponSlots[weaponid]] = weaponid;
  1064. }
  1065. GivePlayerWeapon(playerid, weaponid, ammo);
  1066. AntiCheatInfo[playerid][pGtcGiveAmmo][WeaponSlots[weaponid]]
  1067. = AntiCheatInfo[playerid][pGtcSetWeapon][WeaponSlots[weaponid]] =
  1068. AntiCheatInfo[playerid][pGtc][2] = GetTickCount();
  1069. return 1;
  1070. }
  1071. fpublic: ac_SetPlayerAmmo(playerid, weaponslot, ammo)
  1072. {
  1073. if(!IsPlayerConnected(playerid)) return 0;
  1074. if(ammo < -32768) ammo = -32768;
  1075. else if(ammo > 32767) ammo = 32767;
  1076. if(weaponslot == 40 && ammo) ammo = 1;
  1077. SetPlayerAmmo(playerid, weaponslot, ammo);
  1078. if(15 < weaponslot < 44
  1079. && AntiCheatInfo[playerid][pWeapon][WeaponSlots[weaponslot]])
  1080. {
  1081. AntiCheatInfo[playerid][pNOPCount][1] = 0;
  1082. AntiCheatInfo[playerid][pGiveAmmo][WeaponSlots[weaponslot]] = ammo;
  1083. AntiCheatInfo[playerid][pGtcGiveAmmo][WeaponSlots[weaponslot]] = GetTickCount();
  1084. }
  1085. return 1;
  1086. }
  1087. fpublic: ac_SetPlayerArmedWeapon(playerid, weaponid)
  1088. {
  1089. if(!SetPlayerArmedWeapon(playerid, weaponid)) return 0;
  1090. if(weaponid == AntiCheatInfo[playerid][pWeapon][WeaponSlots[weaponid]])
  1091. {
  1092. AntiCheatInfo[playerid][pNOPCount][0] = 0;
  1093. AntiCheatInfo[playerid][pSet][3] = weaponid;
  1094. AntiCheatInfo[playerid][pGtc][2] = GetTickCount();
  1095. }
  1096. return 1;
  1097. }
  1098. fpublic: ac_ResetPlayerWeapons(playerid)
  1099. {
  1100. if(!ResetPlayerWeapons(playerid)) return 0;
  1101. for(new i = 12; i != -1; --i)
  1102. {
  1103. AntiCheatInfo[playerid][pWeapon][i] =
  1104. AntiCheatInfo[playerid][pAmmo][i] = 0;
  1105. AntiCheatInfo[playerid][pSetWeapon][i] = -1;
  1106. AntiCheatInfo[playerid][pGiveAmmo][i] = -65535;
  1107. }
  1108. AntiCheatInfo[playerid][pSet][3] = 0;
  1109. AntiCheatInfo[playerid][pGtc][7] = GetTickCount();
  1110. return 1;
  1111. }
  1112. fpublic: ac_GivePlayerMoney(playerid, money)
  1113. {
  1114. if(!GivePlayerMoney(playerid, money)) return 0;
  1115. AntiCheatInfo[playerid][pMoney] += money;
  1116. return 1;
  1117. }
  1118. fpublic: ac_ResetPlayerMoney(playerid)
  1119. {
  1120. if(!ResetPlayerMoney(playerid)) return 0;
  1121. AntiCheatInfo[playerid][pMoney] = 0;
  1122. return 1;
  1123. }
  1124. fpublic: ac_GetPlayerMoney(playerid) return (IsPlayerConnected(playerid) ? AntiCheatInfo[playerid][pMoney] : 0);
  1125. fpublic: ac_SetPlayerSpecialAction(playerid, actionid)
  1126. {
  1127. if(!SetPlayerSpecialAction(playerid, actionid)) return 0;
  1128. if(actionid == 2 || actionid == 68 || 4 < actionid < 9
  1129. || 9 < actionid < 12 || 19 < actionid < 26 || !actionid
  1130. && AntiCheatInfo[playerid][pSpecAct] != 10 || actionid ==
  1131. 13 && AntiCheatInfo[playerid][pSpecAct] == 11)
  1132. {
  1133. AntiCheatInfo[playerid][pNOPCount][6] = 0;
  1134. if((actionid == 68 || 9 < actionid < 12 || 19 <
  1135. actionid < 26) && 4 < AntiCheatInfo[playerid][pSpecAct] <
  1136. 9) AntiCheatInfo[playerid][pNextSpecAct] = actionid;
  1137. else
  1138. {
  1139. if(actionid == 13) actionid = 0;
  1140. else if(actionid == 2) AntiCheatInfo[playerid][pNextSpecAct] =
  1141. AntiCheatInfo[playerid][pSpecAct];
  1142. else AntiCheatInfo[playerid][pNextSpecAct] = -1;
  1143. AntiCheatInfo[playerid][pSet][4] = actionid;
  1144. AntiCheatInfo[playerid][pGtc][6] = GetTickCount();
  1145. if(AntiCheatInfo[playerid][pSpecAct] ==
  1146. 11) AntiCheatInfo[playerid][pGtc][6] += 2500;
  1147. }
  1148. }
  1149. return 1;
  1150. }
  1151. fpublic: ac_SetPlayerInterior(playerid, interiorid)
  1152. {
  1153. if(!SetPlayerInterior(playerid, interiorid)) return 0;
  1154. while(interiorid < 0) interiorid += 256;
  1155. if(interiorid != GetPlayerInterior(playerid))
  1156. {
  1157. AntiCheatInfo[playerid][pNOPCount][2] = 0;
  1158. if(AntiCheatInfo[playerid][pDead]) AntiCheatInfo[playerid][pSet][12] = interiorid;
  1159. else AntiCheatInfo[playerid][pSet][0] = interiorid;
  1160. AntiCheatInfo[playerid][pGtc][0] = GetTickCount();
  1161. }
  1162. return 1;
  1163. }
  1164. fpublic: ac_SetPlayerPos(playerid, Float:x, Float:y, Float:z)
  1165. {
  1166. if(!SetPlayerPos(playerid, x, y, z)) return 0;
  1167. AntiCheatInfo[playerid][pSet][8] = 1;
  1168. AntiCheatInfo[playerid][pNOPCount][10] = 0;
  1169. AntiCheatInfo[playerid][pSetPos][0] = AntiCheatInfo[playerid][pPos][0] = x;
  1170. AntiCheatInfo[playerid][pSetPos][1] = AntiCheatInfo[playerid][pPos][1] = y;
  1171. AntiCheatInfo[playerid][pSetPos][2] = AntiCheatInfo[playerid][pPos][2] = z;
  1172. AntiCheatInfo[playerid][pGtc][11] = GetTickCount();
  1173. return 1;
  1174. }
  1175. fpublic: ac_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z)
  1176. {
  1177. if(!SetPlayerPosFindZ(playerid, x, y, z)) return 0;
  1178. AntiCheatInfo[playerid][pSet][8] = 1;
  1179. AntiCheatInfo[playerid][pTpToZ] = true;
  1180. AntiCheatInfo[playerid][pNOPCount][10] = 0;
  1181. AntiCheatInfo[playerid][pSetPos][0] = AntiCheatInfo[playerid][pPos][0] = x;
  1182. AntiCheatInfo[playerid][pSetPos][1] = AntiCheatInfo[playerid][pPos][1] = y;
  1183. AntiCheatInfo[playerid][pGtc][11] = GetTickCount();
  1184. return 1;
  1185. }
  1186. fpublic: ac_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z)
  1187. {
  1188. if(!SetPlayerVelocity(playerid, X, Y, Z)) return 0;
  1189. AntiCheatInfo[playerid][pSpeed] = GetSpeed(X,Y,Z);
  1190. AntiCheatInfo[playerid][pGtc][10] = GetTickCount();
  1191. return 1;
  1192. }
  1193. fpublic: ac_PutPlayerInVehicle(playerid, vehicleid, seatid)
  1194. {
  1195. if(!PutPlayerInVehicle(playerid, vehicleid, seatid)) return 0;
  1196. if(AntiCheatVehInfo[vehicleid][vSpawned])
  1197. {
  1198. new model = GetVehicleModel(vehicleid) - 400;
  1199. AntiCheatInfo[playerid][pNOPCount][7] = 0;
  1200. AntiCheatInfo[playerid][pSet][9] = vehicleid;
  1201. if(seatid > MaxPassengers[model >>> 3] >>> ((model
  1202. & 7) << 2) & 0xF) AntiCheatInfo[playerid][pSet][5] = -1;
  1203. else AntiCheatInfo[playerid][pSet][5] = seatid;
  1204. AntiCheatInfo[playerid][pGtc][1] = GetTickCount();
  1205. }
  1206. return 1;
  1207. }
  1208. fpublic: ac_RemovePlayerFromVehicle(playerid)
  1209. {
  1210. if(!RemovePlayerFromVehicle(playerid)) return 0;
  1211. AntiCheatInfo[playerid][pSet][11] = 1;
  1212. AntiCheatInfo[playerid][pGtc][8] = GetTickCount();
  1213. return 1;
  1214. }
  1215. fpublic: ac_SetVehiclePos(vehicleid, Float:x, Float:y, Float:z)
  1216. {
  1217. if(!SetVehiclePos(vehicleid, x, y, z)) return 0;
  1218. AntiCheatVehInfo[vehicleid][vVel][0] =
  1219. AntiCheatVehInfo[vehicleid][vVel][1] =
  1220. AntiCheatVehInfo[vehicleid][vVel][2] = 0.0;
  1221. if(AntiCheatVehInfo[vehicleid][vDriver] != 65535)
  1222. {
  1223. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pSet][8] = 1;
  1224. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pNOPCount][10] = 0;
  1225. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pSetPos][0] =
  1226. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pPos][0] = x;
  1227. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pSetPos][1] =
  1228. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pPos][1] = y;
  1229. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pSetPos][2] =
  1230. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pPos][2] = z;
  1231. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pGtc][11] =
  1232. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pGtc][9] = GetTickCount();
  1233. }
  1234. return 1;
  1235. }
  1236. fpublic: ac_SetVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z)
  1237. {
  1238. if(!SetVehicleVelocity(vehicleid, X, Y, Z)) return 0;
  1239. if(AntiCheatVehInfo[vehicleid][vDriver] != 65535)
  1240. {
  1241. AntiCheatVehInfo[vehicleid][vVel][0] = X;
  1242. AntiCheatVehInfo[vehicleid][vVel][1] = Y;
  1243. AntiCheatVehInfo[vehicleid][vVel][2] = Z;
  1244. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pGtc][9] = GetTickCount();
  1245. }
  1246. return 1;
  1247. }
  1248. fpublic: ac_SetVehicleAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z)
  1249. {
  1250. if(!SetVehicleAngularVelocity(vehicleid, X, Y, Z)) return 0;
  1251. if(AntiCheatVehInfo[vehicleid][vDriver] != 65535)
  1252. {
  1253. AntiCheatVehInfo[vehicleid][vVel][0] = X;
  1254. AntiCheatVehInfo[vehicleid][vVel][1] = Y;
  1255. AntiCheatVehInfo[vehicleid][vVel][2] = Z;
  1256. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pGtc][9] = GetTickCount();
  1257. }
  1258. return 1;
  1259. }
  1260. fpublic: ac_ChangeVehiclePaintjob(vehicleid, paintjobid)
  1261. {
  1262. if(!ChangeVehiclePaintjob(vehicleid, paintjobid)) return 0;
  1263. AntiCheatVehInfo[vehicleid][vPaintJob] = paintjobid;
  1264. return 1;
  1265. }
  1266. fpublic: ac_SetVehicleHealth(vehicleid, Float:health)
  1267. {
  1268. if(health < 0.0) health = 0.0;
  1269. if(!SetVehicleHealth(vehicleid, health)) return 0;
  1270. if(AntiCheatVehInfo[vehicleid][vDriver] != 65535)
  1271. {
  1272. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pNOPCount][4] = 0;
  1273. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pSetVehHealth] = health;
  1274. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pGtc][4] = GetTickCount();
  1275. }
  1276. return 1;
  1277. }
  1278. fpublic: ac_RepairVehicle(vehicleid)
  1279. {
  1280. if(!RepairVehicle(vehicleid)) return 0;
  1281. if(AntiCheatVehInfo[vehicleid][vDriver] != 65535)
  1282. {
  1283. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pNOPCount][4] = 0;
  1284. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pSetVehHealth] = 1000.0;
  1285. AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pGtc][4] = GetTickCount();
  1286. }
  1287. return 1;
  1288. }
  1289. #endif
  1290. stock acc_AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
  1291. return CallRemoteFunction("ac_AddStaticVehicle", "iffffii", modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
  1292. #if defined _ALS_AddStaticVehicle
  1293. #undef AddStaticVehicle
  1294. #else
  1295. #define _ALS_AddStaticVehicle
  1296. #endif
  1297. #define AddStaticVehicle acc_AddStaticVehicle
  1298. stock acc_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren = 0)
  1299. return CallRemoteFunction("ac_AddStaticVehicleEx", "iffffiid", modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay, addsiren);
  1300. #if defined _ALS_AddStaticVehicleEx
  1301. #undef AddStaticVehicleEx
  1302. #else
  1303. #define _ALS_AddStaticVehicleEx
  1304. #endif
  1305. #define AddStaticVehicleEx acc_AddStaticVehicleEx
  1306. stock acc_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren = 0)
  1307. return CallRemoteFunction("ac_CreateVehicle", "iffffiid", vehicletype, x, y, z, rotation, color1, color2, respawn_delay, addsiren);
  1308. #if defined _ALS_CreateVehicle
  1309. #undef CreateVehicle
  1310. #else
  1311. #define _ALS_CreateVehicle
  1312. #endif
  1313. #define CreateVehicle acc_CreateVehicle
  1314. stock acc_AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  1315. return CallRemoteFunction("ac_AddPlayerClass", "iffffiiiiii", modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1316. #if defined _ALS_AddPlayerClass
  1317. #undef AddPlayerClass
  1318. #else
  1319. #define _ALS_AddPlayerClass
  1320. #endif
  1321. #define AddPlayerClass acc_AddPlayerClass
  1322. stock acc_AddPlayerClassEx(teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  1323. return CallRemoteFunction("ac_AddPlayerClassEx", "iiffffiiiiii", teamid, modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1324. #if defined _ALS_AddPlayerClassEx
  1325. #undef AddPlayerClassEx
  1326. #else
  1327. #define _ALS_AddPlayerClassEx
  1328. #endif
  1329. #define AddPlayerClassEx acc_AddPlayerClassEx
  1330. stock acc_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  1331. return CallRemoteFunction("ac_SetSpawnInfo", "iiiffffiiiiii", playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1332. #if defined _ALS_SetSpawnInfo
  1333. #undef SetSpawnInfo
  1334. #else
  1335. #define _ALS_SetSpawnInfo
  1336. #endif
  1337. #define SetSpawnInfo acc_SetSpawnInfo
  1338. stock acc_AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0) return CallRemoteFunction("ac_AddStaticPickup", "iifffd", model, type, X, Y, Z, virtualworld);
  1339. #if defined _ALS_AddStaticPickup
  1340. #undef AddStaticPickup
  1341. #else
  1342. #define _ALS_AddStaticPickup
  1343. #endif
  1344. #define AddStaticPickup acc_AddStaticPickup
  1345. stock acc_CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0) return CallRemoteFunction("ac_CreatePickup", "iifffd", model, type, X, Y, Z, virtualworld);
  1346. #if defined _ALS_CreatePickup
  1347. #undef CreatePickup
  1348. #else
  1349. #define _ALS_CreatePickup
  1350. #endif
  1351. #define CreatePickup acc_CreatePickup
  1352. #if defined CreateDynamicPickup
  1353. stock STREAMER_TAG_PICKUP acc_CreateDynamicPickup(modelid, type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0)
  1354. {
  1355. new STREAMER_TAG_PICKUP pickupid = CreateDynamicPickup(modelid, type, x, y, z, worldid, interiorid, playerid, streamdistance);
  1356. if(pickupid > 0) CallRemoteFunction("ac_CreateDynamicPickup", "iiifff", pickupid, modelid, type, x, y, z);
  1357. return pickupid;
  1358. }
  1359. #if defined _ALS_CreateDynamicPickup
  1360. #undef CreateDynamicPickup
  1361. #else
  1362. #define _ALS_CreateDynamicPickup
  1363. #endif
  1364. #define CreateDynamicPickup acc_CreateDynamicPickup
  1365. #endif
  1366. #if defined CreateDynamicPickupEx
  1367. stock STREAMER_TAG_PICKUP acc_CreateDynamicPickupEx(modelid, type, Float:x, Float:y, Float:z, Float:streamdistance = 100.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players)
  1368. {
  1369. new STREAMER_TAG_PICKUP pickupid = CreateDynamicPickupEx(modelid, type, x, y, z, streamdistance, worlds, interiors, players, maxworlds, maxinteriors, maxplayers);
  1370. if(pickupid > 0) CallRemoteFunction("ac_CreateDynamicPickup", "iiifff", pickupid, modelid, type, x, y, z);
  1371. return pickupid;
  1372. }
  1373. #if defined _ALS_CreateDynamicPickupEx
  1374. #undef CreateDynamicPickupEx
  1375. #else
  1376. #define _ALS_CreateDynamicPickupEx
  1377. #endif
  1378. #define CreateDynamicPickupEx acc_CreateDynamicPickupEx
  1379. #endif
  1380. stock acc_DestroyVehicle(vehicleid) return CallRemoteFunction("ac_DestroyVehicle", "i", vehicleid);
  1381. #if defined _ALS_DestroyVehicle
  1382. #undef DestroyVehicle
  1383. #else
  1384. #define _ALS_DestroyVehicle
  1385. #endif
  1386. #define DestroyVehicle acc_DestroyVehicle
  1387. stock acc_DestroyPickup(pickup) return CallRemoteFunction("ac_DestroyPickup", "i", pickup);
  1388. #if defined _ALS_DestroyPickup
  1389. #undef DestroyPickup
  1390. #else
  1391. #define _ALS_DestroyPickup
  1392. #endif
  1393. #define DestroyPickup acc_DestroyPickup
  1394. #if defined DestroyDynamicPickup
  1395. stock acc_DestroyDynamicPickup(STREAMER_TAG_PICKUP pickupid) return CallRemoteFunction("ac_DestroyDynamicPickup", "i", pickupid);
  1396. #if defined _ALS_DestroyDynamicPickup
  1397. #undef DestroyDynamicPickup
  1398. #else
  1399. #define _ALS_DestroyDynamicPickup
  1400. #endif
  1401. #define DestroyDynamicPickup acc_DestroyDynamicPickup
  1402. #endif
  1403. #if defined DestroyAllDynamicPickups
  1404. stock acc_DestroyAllDynamicPickups() return CallRemoteFunction("ac_DestroyAllDynamicPickups", "");
  1405. #if defined _ALS_DestroyAllDynamicPickups
  1406. #undef DestroyAllDynamicPickups
  1407. #else
  1408. #define _ALS_DestroyAllDynamicPickups
  1409. #endif
  1410. #define DestroyAllDynamicPickups acc_DestroyAllDynamicPickups
  1411. #endif
  1412. stock acc_DisableInteriorEnterExits() return CallRemoteFunction("ac_DisableInteriorEnterExits", "");
  1413. #if defined _ALS_DisableInteriorEnterExits
  1414. #undef DisableInteriorEnterExits
  1415. #else
  1416. #define _ALS_DisableInteriorEnterExits
  1417. #endif
  1418. #define DisableInteriorEnterExits acc_DisableInteriorEnterExits
  1419. stock acc_UsePlayerPedAnims() return CallRemoteFunction("ac_UsePlayerPedAnims", "");
  1420. #if defined _ALS_UsePlayerPedAnims
  1421. #undef UsePlayerPedAnims
  1422. #else
  1423. #define _ALS_UsePlayerPedAnims
  1424. #endif
  1425. #define UsePlayerPedAnims acc_UsePlayerPedAnims
  1426. stock acc_EnableVehicleFriendlyFire() return CallRemoteFunction("ac_EnableVehicleFriendlyFire", "");
  1427. #if defined _ALS_EnableVehicleFriendlyFire
  1428. #undef EnableVehicleFriendlyFire
  1429. #else
  1430. #define _ALS_EnableVehicleFriendlyFire
  1431. #endif
  1432. #define EnableVehicleFriendlyFire acc_EnableVehicleFriendlyFire
  1433. stock acc_EnableStuntBonusForAll(enable) return CallRemoteFunction("ac_EnableStuntBonusForAll", "i", enable);
  1434. #if defined _ALS_EnableStuntBonusForAll
  1435. #undef EnableStuntBonusForAll
  1436. #else
  1437. #define _ALS_EnableStuntBonusForAll
  1438. #endif
  1439. #define EnableStuntBonusForAll acc_EnableStuntBonusForAll
  1440. stock acc_EnableStuntBonusForPlayer(playerid, enable) return CallRemoteFunction("ac_EnableStuntBonusForPlayer", "ii", playerid, enable);
  1441. #if defined _ALS_EnableStuntBonusForPlayer
  1442. #undef EnableStuntBonusForPlayer
  1443. #else
  1444. #define _ALS_EnableStuntBonusForPlayer
  1445. #endif
  1446. #define EnableStuntBonusForPlayer acc_EnableStuntBonusForPlayer
  1447. #if defined Dialog_Show
  1448. stock ac_Dialog_Show(playerid, style, string:title[], string:caption[], string:button1[], string:button2[] = "", dialog = -1)
  1449. return CallRemoteFunction("ac_ShowPlayerDialog", "id", playerid, dialog),
  1450. Dialog_Show(playerid, style, title, caption, button1, button2, dialog);
  1451. #if defined _ALS_Dialog_Show
  1452. #undef Dialog_Show
  1453. #else
  1454. #define _ALS_Dialog_Show
  1455. #endif
  1456. #define Dialog_Show ac_Dialog_Show
  1457. #endif
  1458. stock acc_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[])
  1459. return CallRemoteFunction("ac_ShowPlayerDialog", "id", playerid, dialogid),
  1460. ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2);
  1461. #if defined _ALS_ShowPlayerDialog
  1462. #undef ShowPlayerDialog
  1463. #else
  1464. #define _ALS_ShowPlayerDialog
  1465. #endif
  1466. #define ShowPlayerDialog acc_ShowPlayerDialog
  1467. stock acc_TogglePlayerControllable(playerid, toggle) return CallRemoteFunction("ac_TogglePlayerControllable", "ii", playerid, toggle);
  1468. #if defined _ALS_TogglePlayerControllable
  1469. #undef TogglePlayerControllable
  1470. #else
  1471. #define _ALS_TogglePlayerControllable
  1472. #endif
  1473. #define TogglePlayerControllable acc_TogglePlayerControllable
  1474. stock acc_TogglePlayerSpectating(playerid, toggle) return CallRemoteFunction("ac_TogglePlayerSpectating", "ii", playerid, toggle);
  1475. #if defined _ALS_TogglePlayerSpectating
  1476. #undef TogglePlayerSpectating
  1477. #else
  1478. #define _ALS_TogglePlayerSpectating
  1479. #endif
  1480. #define TogglePlayerSpectating acc_TogglePlayerSpectating
  1481. stock acc_SpawnPlayer(playerid) return CallRemoteFunction("ac_SpawnPlayer", "i", playerid);
  1482. #if defined _ALS_SpawnPlayer
  1483. #undef SpawnPlayer
  1484. #else
  1485. #define _ALS_SpawnPlayer
  1486. #endif
  1487. #define SpawnPlayer acc_SpawnPlayer
  1488. stock acc_SetPlayerHealth(playerid, Float:health) return CallRemoteFunction("ac_SetPlayerHealth", "if", playerid, health);
  1489. #if defined _ALS_SetPlayerHealth
  1490. #undef SetPlayerHealth
  1491. #else
  1492. #define _ALS_SetPlayerHealth
  1493. #endif
  1494. #define SetPlayerHealth acc_SetPlayerHealth
  1495. stock acc_SetPlayerArmour(playerid, Float:armour) return CallRemoteFunction("ac_SetPlayerArmour", "if", playerid, armour);
  1496. #if defined _ALS_SetPlayerArmour
  1497. #undef SetPlayerArmour
  1498. #else
  1499. #define _ALS_SetPlayerArmour
  1500. #endif
  1501. #define SetPlayerArmour acc_SetPlayerArmour
  1502. stock acc_GivePlayerWeapon(playerid, weaponid, ammo) return CallRemoteFunction("ac_GivePlayerWeapon", "iid", playerid, weaponid, ammo);
  1503. #if defined _ALS_GivePlayerWeapon
  1504. #undef GivePlayerWeapon
  1505. #else
  1506. #define _ALS_GivePlayerWeapon
  1507. #endif
  1508. #define GivePlayerWeapon acc_GivePlayerWeapon
  1509. stock acc_SetPlayerAmmo(playerid, weaponslot, ammo) return CallRemoteFunction("ac_SetPlayerAmmo", "iid", playerid, weaponslot, ammo);
  1510. #if defined _ALS_SetPlayerAmmo
  1511. #undef SetPlayerAmmo
  1512. #else
  1513. #define _ALS_SetPlayerAmmo
  1514. #endif
  1515. #define SetPlayerAmmo acc_SetPlayerAmmo
  1516. stock acc_SetPlayerArmedWeapon(playerid, weaponid) return CallRemoteFunction("ac_SetPlayerArmedWeapon", "ii", playerid, weaponid);
  1517. #if defined _ALS_SetPlayerArmedWeapon
  1518. #undef SetPlayerArmedWeapon
  1519. #else
  1520. #define _ALS_SetPlayerArmedWeapon
  1521. #endif
  1522. #define SetPlayerArmedWeapon acc_SetPlayerArmedWeapon
  1523. stock acc_ResetPlayerWeapons(playerid) return CallRemoteFunction("ac_ResetPlayerWeapons", "i", playerid);
  1524. #if defined _ALS_ResetPlayerWeapons
  1525. #undef ResetPlayerWeapons
  1526. #else
  1527. #define _ALS_ResetPlayerWeapons
  1528. #endif
  1529. #define ResetPlayerWeapons acc_ResetPlayerWeapons
  1530. stock acc_GivePlayerMoney(playerid, money) return CallRemoteFunction("ac_GivePlayerMoney", "id", playerid, money);
  1531. #if defined _ALS_GivePlayerMoney
  1532. #undef GivePlayerMoney
  1533. #else
  1534. #define _ALS_GivePlayerMoney
  1535. #endif
  1536. #define GivePlayerMoney acc_GivePlayerMoney
  1537. stock acc_ResetPlayerMoney(playerid) return CallRemoteFunction("ac_ResetPlayerMoney", "i", playerid);
  1538. #if defined _ALS_ResetPlayerMoney
  1539. #undef ResetPlayerMoney
  1540. #else
  1541. #define _ALS_ResetPlayerMoney
  1542. #endif
  1543. #define ResetPlayerMoney acc_ResetPlayerMoney
  1544. static stock bad_GetPlayerMoney(playerid) return GetPlayerMoney(playerid);
  1545. stock acc_GetPlayerMoney(playerid) return CallRemoteFunction("ac_GetPlayerMoney", "i", playerid);
  1546. #if defined _ALS_GetPlayerMoney
  1547. #undef GetPlayerMoney
  1548. #else
  1549. #define _ALS_GetPlayerMoney
  1550. #endif
  1551. #define GetPlayerMoney acc_GetPlayerMoney
  1552. stock acc_SetPlayerSpecialAction(playerid, actionid) return CallRemoteFunction("ac_SetPlayerSpecialAction", "ii", playerid, actionid);
  1553. #if defined _ALS_SetPlayerSpecialAction
  1554. #undef SetPlayerSpecialAction
  1555. #else
  1556. #define _ALS_SetPlayerSpecialAction
  1557. #endif
  1558. #define SetPlayerSpecialAction acc_SetPlayerSpecialAction
  1559. stock acc_SetPlayerInterior(playerid, interiorid) return CallRemoteFunction("ac_SetPlayerInterior", "ii", playerid, interiorid);
  1560. #if defined _ALS_SetPlayerInterior
  1561. #undef SetPlayerInterior
  1562. #else
  1563. #define _ALS_SetPlayerInterior
  1564. #endif
  1565. #define SetPlayerInterior acc_SetPlayerInterior
  1566. stock acc_SetPlayerPos(playerid, Float:x, Float:y, Float:z) return CallRemoteFunction("ac_SetPlayerPos", "ifff", playerid, x, y, z);
  1567. #if defined _ALS_SetPlayerPos
  1568. #undef SetPlayerPos
  1569. #else
  1570. #define _ALS_SetPlayerPos
  1571. #endif
  1572. #define SetPlayerPos acc_SetPlayerPos
  1573. stock acc_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z) return CallRemoteFunction("ac_SetPlayerPosFindZ", "ifff", playerid, x, y, z);
  1574. #if defined _ALS_SetPlayerPosFindZ
  1575. #undef SetPlayerPosFindZ
  1576. #else
  1577. #define _ALS_SetPlayerPosFindZ
  1578. #endif
  1579. #define SetPlayerPosFindZ acc_SetPlayerPosFindZ
  1580. stock acc_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z) return CallRemoteFunction("ac_SetPlayerVelocity", "ifff", playerid, X, Y, Z);
  1581. #if defined _ALS_SetPlayerVelocity
  1582. #undef SetPlayerVelocity
  1583. #else
  1584. #define _ALS_SetPlayerVelocity
  1585. #endif
  1586. #define SetPlayerVelocity acc_SetPlayerVelocity
  1587. stock acc_PutPlayerInVehicle(playerid, vehicleid, seatid) return CallRemoteFunction("ac_PutPlayerInVehicle", "iii", playerid, vehicleid, seatid);
  1588. #if defined _ALS_PutPlayerInVehicle
  1589. #undef PutPlayerInVehicle
  1590. #else
  1591. #define _ALS_PutPlayerInVehicle
  1592. #endif
  1593. #define PutPlayerInVehicle acc_PutPlayerInVehicle
  1594. stock acc_RemovePlayerFromVehicle(playerid) return CallRemoteFunction("ac_RemovePlayerFromVehicle", "i", playerid);
  1595. #if defined _ALS_RemovePlayerFromVehicle
  1596. #undef RemovePlayerFromVehicle
  1597. #else
  1598. #define _ALS_RemovePlayerFromVehicle
  1599. #endif
  1600. #define RemovePlayerFromVehicle acc_RemovePlayerFromVehicle
  1601. stock acc_SetVehiclePos(vehicleid, Float:x, Float:y, Float:z) return CallRemoteFunction("ac_SetVehiclePos", "ifff", vehicleid, x, y, z);
  1602. #if defined _ALS_SetVehiclePos
  1603. #undef SetVehiclePos
  1604. #else
  1605. #define _ALS_SetVehiclePos
  1606. #endif
  1607. #define SetVehiclePos acc_SetVehiclePos
  1608. stock acc_SetVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z) return CallRemoteFunction("ac_SetVehicleVelocity", "ifff", vehicleid, X, Y, Z);
  1609. #if defined _ALS_SetVehicleVelocity
  1610. #undef SetVehicleVelocity
  1611. #else
  1612. #define _ALS_SetVehicleVelocity
  1613. #endif
  1614. #define SetVehicleVelocity acc_SetVehicleVelocity
  1615. stock acc_SetVehicleAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z) return CallRemoteFunction("ac_SetVehicleAngularVelocity", "ifff", vehicleid, X, Y, Z);
  1616. #if defined _ALS_SetVehicleAngularVelocity
  1617. #undef SetVehicleAngularVelocity
  1618. #else
  1619. #define _ALS_SetVehicleAngularVelocity
  1620. #endif
  1621. #define SetVehicleAngularVelocity acc_SetVehicleAngularVelocity
  1622. stock acc_ChangeVehiclePaintjob(vehicleid, paintjobid) return CallRemoteFunction("ac_ChangeVehiclePaintjob", "ii", vehicleid, paintjobid);
  1623. #if defined _ALS_ChangeVehiclePaintjob
  1624. #undef ChangeVehiclePaintjob
  1625. #else
  1626. #define _ALS_ChangeVehiclePaintjob
  1627. #endif
  1628. #define ChangeVehiclePaintjob acc_ChangeVehiclePaintjob
  1629. stock acc_SetVehicleHealth(vehicleid, Float:health) return CallRemoteFunction("ac_SetVehicleHealth", "if", vehicleid, health);
  1630. #if defined _ALS_SetVehicleHealth
  1631. #undef SetVehicleHealth
  1632. #else
  1633. #define _ALS_SetVehicleHealth
  1634. #endif
  1635. #define SetVehicleHealth acc_SetVehicleHealth
  1636. stock acc_RepairVehicle(vehicleid) return CallRemoteFunction("ac_RepairVehicle", "i", vehicleid);
  1637. #if defined _ALS_RepairVehicle
  1638. #undef RepairVehicle
  1639. #else
  1640. #define _ALS_RepairVehicle
  1641. #endif
  1642. #define RepairVehicle acc_RepairVehicle
  1643. #if !defined FILTERSCRIPT
  1644. #if defined _inc_y_hooks
  1645. Hook:ac_OnGameModeInit()
  1646. #else
  1647. public OnGameModeInit()
  1648. #endif
  1649. {
  1650. if(!LoadCfg()) printf(CFG_OPENING_ERROR, CONFIG_FILE);
  1651. if(ACAllow[42]) SendRconCommand("rcon 0");
  1652. LagCompMode = !!GetServerVarAsInt("lagcompmode");
  1653. print(" ");
  1654. print("--------------------------------------");
  1655. print(LOADED_MSG_1);
  1656. printf(LOADED_MSG_2, NEX_AC_VERSION);
  1657. #undef NEX_AC_VERSION
  1658. print(LOADED_MSG_3);
  1659. print("--------------------------------------\n");
  1660. new a = 1;
  1661. #if !defined _inc_y_hooks\
  1662. && defined ac_OnGameModeInit
  1663. a = ac_OnGameModeInit();
  1664. #endif
  1665. new strtmp[10];
  1666. GetServerVarAsString("version", strtmp, sizeof strtmp);
  1667. if(strcmp(strtmp, SERVER_VERSION)) print(VERSION_WARNING);
  1668. #undef SERVER_VERSION
  1669. return a;
  1670. }
  1671. #if !defined _inc_y_hooks
  1672. #if defined _ALS_OnGameModeInit
  1673. #undef OnGameModeInit
  1674. #else
  1675. #define _ALS_OnGameModeInit
  1676. #endif
  1677. #define OnGameModeInit ac_OnGameModeInit
  1678. #if defined ac_OnGameModeInit
  1679. forward ac_OnGameModeInit();
  1680. #endif
  1681. #endif
  1682. #if defined _inc_y_hooks
  1683. Hook:ac_OnGameModeExit()
  1684. #else
  1685. public OnGameModeExit()
  1686. #endif
  1687. {
  1688. new a = 1;
  1689. #if !defined _inc_y_hooks\
  1690. && defined ac_OnGameModeExit
  1691. a = ac_OnGameModeExit();
  1692. #endif
  1693. print(" ");
  1694. print("--------------------------------------");
  1695. print(STATS_STRING_1);
  1696. print(STATS_STRING_2);
  1697. printf(STATS_STRING_3, StatsInfo[0]);
  1698. printf(STATS_STRING_4, StatsInfo[1]);
  1699. printf(STATS_STRING_5, StatsInfo[2]);
  1700. printf(STATS_STRING_6, StatsInfo[3]);
  1701. printf(STATS_STRING_7, StatsInfo[4]);
  1702. printf(STATS_STRING_8, StatsInfo[5]);
  1703. print("--------------------------------------\n");
  1704. return a;
  1705. }
  1706. #if !defined _inc_y_hooks
  1707. #if defined _ALS_OnGameModeExit
  1708. #undef OnGameModeExit
  1709. #else
  1710. #define _ALS_OnGameModeExit
  1711. #endif
  1712. #define OnGameModeExit ac_OnGameModeExit
  1713. #if defined ac_OnGameModeExit
  1714. forward ac_OnGameModeExit();
  1715. #endif
  1716. #endif
  1717. #if defined _inc_y_hooks
  1718. Hook:ac_OnPlayerConnect(playerid)
  1719. #else
  1720. public OnPlayerConnect(playerid)
  1721. #endif
  1722. {
  1723. GetPlayerIp(playerid, AntiCheatInfo[playerid][pIp], 16);
  1724. if(IsPlayerNPC(playerid))
  1725. {
  1726. if(ACAllow[36] && strcmp(AntiCheatInfo[playerid][pIp],
  1727. "127.0.0.1")) KickWithCode(playerid, "", 0, 36);
  1728. AntiCheatInfo[playerid][pTimerID] = -1;
  1729. }
  1730. else
  1731. {
  1732. if(ACAllow[48] && AntiCheatInfo[playerid][pOnline]) KickWithCode(playerid, "", 0, 48);
  1733. if(ACAllow[41])
  1734. {
  1735. new version[8];
  1736. GetPlayerVersion(playerid, version, sizeof version);
  1737. if(!strcmp(version, "unknown", true))
  1738. {
  1739. #if defined DEBUG
  1740. printf(DEBUG_CODE_2, playerid, version);
  1741. #endif
  1742. KickWithCode(playerid, "", 0, 41);
  1743. }
  1744. }
  1745. new i;
  1746. if(ACAllow[40])
  1747. {
  1748. new f = MAX_CONNECTS_FROM_IP;
  1749. #if defined foreachex
  1750. foreachex(Player, i)
  1751. {
  1752. if(!IsPlayerNPC(i) && i != playerid
  1753. && !strcmp(AntiCheatInfo[playerid][pIp], AntiCheatInfo[i][pIp], false))
  1754. #else
  1755. for(i = GetPlayerPoolSize(); i != -1; --i)
  1756. {
  1757. if(IsPlayerConnected(i) && !IsPlayerNPC(i) && i != playerid
  1758. && !strcmp(AntiCheatInfo[playerid][pIp], AntiCheatInfo[i][pIp], false))
  1759. #endif
  1760. {
  1761. f--;
  1762. if(!f)
  1763. {
  1764. #if defined DEBUG
  1765. printf(DEBUG_CODE_3, playerid, MAX_CONNECTS_FROM_IP);
  1766. #endif
  1767. #undef MAX_CONNECTS_FROM_IP
  1768. KickWithCode(playerid, "", 0, 40);
  1769. }
  1770. }
  1771. }
  1772. }
  1773. AntiCheatInfo[playerid][pDead] = true;
  1774. AntiCheatInfo[playerid][pSpawnRes] =
  1775. AntiCheatInfo[playerid][pDeathRes] = false;
  1776. AntiCheatInfo[playerid][pIntEnterExits] = IntEnterExits;
  1777. AntiCheatInfo[playerid][pStuntBonus] = StuntBonus;
  1778. AntiCheatInfo[playerid][pCheatCount][0] =
  1779. AntiCheatInfo[playerid][pLastWeapon] =
  1780. AntiCheatInfo[playerid][pKicked] =
  1781. AntiCheatInfo[playerid][pMoney] = 0;
  1782. AntiCheatInfo[playerid][pSet][12] =
  1783. AntiCheatInfo[playerid][pSet][0] =
  1784. AntiCheatInfo[playerid][pDialog] = -1;
  1785. AntiCheatInfo[playerid][pAnim] = -2;
  1786. for(i = 12; i != -1; --i)
  1787. {
  1788. AntiCheatInfo[playerid][pSetWeapon][i] = -1;
  1789. AntiCheatInfo[playerid][pGiveAmmo][i] = -65535;
  1790. }
  1791. for(i = 27; i != -1; --i) AntiCheatInfo[playerid][pFloodCount][i] = 0;
  1792. AntiCheatInfo[playerid][pDropJP][0] = AntiCheatInfo[playerid][pDropJP][1] =
  1793. AntiCheatInfo[playerid][pDropJP][2] = 20001.0;
  1794. memcpy(AntiCheatInfo[playerid][pACAllow], ACAllow, 0, sizeof(ACAllow) * 4, sizeof ACAllow);
  1795. AntiCheatInfo[playerid][pTimerID] = SetTimerEx("acTimer", 1000, false, "i", playerid);
  1796. }
  1797. AntiCheatInfo[playerid][pOnline] = true;
  1798. #if !defined _inc_y_hooks\
  1799. && defined ac_OnPlayerConnect
  1800. return ac_OnPlayerConnect(playerid);
  1801. #else
  1802. return 1;
  1803. #endif
  1804. }
  1805. #if !defined _inc_y_hooks
  1806. #if defined _ALS_OnPlayerConnect
  1807. #undef OnPlayerConnect
  1808. #else
  1809. #define _ALS_OnPlayerConnect
  1810. #endif
  1811. #define OnPlayerConnect ac_OnPlayerConnect
  1812. #if defined ac_OnPlayerConnect
  1813. forward ac_OnPlayerConnect(playerid);
  1814. #endif
  1815. #endif
  1816. #if defined _inc_y_hooks
  1817. Hook:ac_OnPlayerDisconnect(playerid, reason)
  1818. #else
  1819. public OnPlayerDisconnect(playerid, reason)
  1820. #endif
  1821. {
  1822. if(AntiCheatInfo[playerid][pOnline])
  1823. {
  1824. AntiCheatInfo[playerid][pOnline] = false;
  1825. if(!IsPlayerNPC(playerid))
  1826. {
  1827. KillTimer(AntiCheatInfo[playerid][pTimerID]);
  1828. if(!reason) Kick(playerid);
  1829. if(AntiCheatInfo[playerid][pACAllow][37]) BlockIpAddress(AntiCheatInfo[playerid][pIp],
  1830. (MIN_TIME_RECONNECT * 1000) - (reason ? 0 : GetServerVarAsInt("playertimeout")));
  1831. #undef MIN_TIME_RECONNECT
  1832. }
  1833. if(AntiCheatInfo[playerid][pVeh]
  1834. && AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver] == playerid)
  1835. {
  1836. AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver] = 65535;
  1837. if(AntiCheatInfo[playerid][pKicked] == 2)
  1838. {
  1839. LinkVehicleToInterior(AntiCheatInfo[playerid][pVeh],
  1840. AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vInt]);
  1841. SetVehicleZAngle(AntiCheatInfo[playerid][pVeh],
  1842. AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vZAngle]);
  1843. SetVehiclePos(AntiCheatInfo[playerid][pVeh], AntiCheatInfo[playerid][pPos][0],
  1844. AntiCheatInfo[playerid][pPos][1], AntiCheatInfo[playerid][pPos][2]);
  1845. SetVehicleHealth(AntiCheatInfo[playerid][pVeh],
  1846. AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vHealth]);
  1847. ChangeVehiclePaintjob(AntiCheatInfo[playerid][pVeh],
  1848. AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vPaintJob]);
  1849. }
  1850. }
  1851. #if !defined _inc_y_hooks\
  1852. && defined ac_OnPlayerDisconnect
  1853. return ac_OnPlayerDisconnect(playerid, reason);
  1854. #endif
  1855. }
  1856. return 1;
  1857. }
  1858. #if !defined _inc_y_hooks
  1859. #if defined _ALS_OnPlayerDisconnect
  1860. #undef OnPlayerDisconnect
  1861. #else
  1862. #define _ALS_OnPlayerDisconnect
  1863. #endif
  1864. #define OnPlayerDisconnect ac_OnPlayerDisconnect
  1865. #if defined ac_OnPlayerDisconnect
  1866. forward ac_OnPlayerDisconnect(playerid, reason);
  1867. #endif
  1868. #endif
  1869. #if defined _inc_y_hooks
  1870. Hook:ac_OnPlayerSpawn(playerid)
  1871. #else
  1872. public OnPlayerSpawn(playerid)
  1873. #endif
  1874. {
  1875. if(AntiCheatInfo[playerid][pKicked]) return 0;
  1876. if(!IsPlayerNPC(playerid))
  1877. {
  1878. if(AntiCheatInfo[playerid][pACAllow][27] && AntiCheatInfo[playerid][pSet][7] == -1
  1879. && (!AntiCheatInfo[playerid][pSpawnRes] || GetTickCount() < AntiCheatInfo[playerid][pSpawnTime]
  1880. + 1000)) KickWithCode(playerid, "", 0, 27);
  1881. new i;
  1882. for(i = 10; i != 0; --i) AntiCheatInfo[playerid][pSet][i] = -1;
  1883. for(i = 12; i != -1; --i)
  1884. {
  1885. AntiCheatInfo[playerid][pWeapon][i] =
  1886. AntiCheatInfo[playerid][pAmmo][i] = 0;
  1887. AntiCheatInfo[playerid][pSetWeapon][i] = -1;
  1888. AntiCheatInfo[playerid][pGiveAmmo][i] = -65535;
  1889. }
  1890. AntiCheatInfo[playerid][pParachute] =
  1891. AntiCheatInfo[playerid][pVehDmgRes] =
  1892. AntiCheatInfo[playerid][pSpawnRes] =
  1893. AntiCheatInfo[playerid][pModShop] =
  1894. AntiCheatInfo[playerid][pPicked] =
  1895. AntiCheatInfo[playerid][pTpToZ] =
  1896. AntiCheatInfo[playerid][pDead] = false;
  1897. AntiCheatInfo[playerid][pFreeze] = true;
  1898. AntiCheatInfo[playerid][pNextSpecAct] =
  1899. AntiCheatInfo[playerid][pLastPickup] =
  1900. AntiCheatInfo[playerid][pSeat] = -1;
  1901. AntiCheatInfo[playerid][pLastSpecAct] =
  1902. AntiCheatInfo[playerid][pSpecAct] =
  1903. AntiCheatInfo[playerid][pDmgRes] =
  1904. AntiCheatInfo[playerid][pVeh] = 0;
  1905. AntiCheatInfo[playerid][pSpeed] = 0.0;
  1906. SetPlayerHealth(playerid, 100.0);
  1907. SetPlayerArmour(playerid, 0.0);
  1908. for(i = 2; i != -1; --i)
  1909. {
  1910. if(AntiCheatInfo[playerid][pSpawnWeapon][i] != -1)
  1911. {
  1912. AntiCheatInfo[playerid][pWeapon][WeaponSlots[AntiCheatInfo[playerid]
  1913. [pSpawnWeapon][i]]] = AntiCheatInfo[playerid][pSpawnWeapon][i];
  1914. AntiCheatInfo[playerid][pAmmo][WeaponSlots[AntiCheatInfo[playerid]
  1915. [pSpawnWeapon][i]]] = AntiCheatInfo[playerid][pSpawnAmmo][i];
  1916. }
  1917. }
  1918. }
  1919. #if !defined _inc_y_hooks\
  1920. && defined ac_OnPlayerSpawn
  1921. return ac_OnPlayerSpawn(playerid);
  1922. #else
  1923. return 1;
  1924. #endif
  1925. }
  1926. #if !defined _inc_y_hooks
  1927. #if defined _ALS_OnPlayerSpawn
  1928. #undef OnPlayerSpawn
  1929. #else
  1930. #define _ALS_OnPlayerSpawn
  1931. #endif
  1932. #define OnPlayerSpawn ac_OnPlayerSpawn
  1933. #if defined ac_OnPlayerSpawn
  1934. forward ac_OnPlayerSpawn(playerid);
  1935. #endif
  1936. #endif
  1937. #if defined _inc_y_hooks
  1938. Hook:ac_OnPlayerDeath(playerid, killerid, reason)
  1939. #else
  1940. public OnPlayerDeath(playerid, killerid, reason)
  1941. #endif
  1942. {
  1943. if(AntiCheatInfo[playerid][pKicked]) return 0;
  1944. if(AntiCheatInfo[playerid][pACAllow][28] && (AntiCheatInfo[playerid][pDead]
  1945. || !AntiCheatInfo[playerid][pDeathRes] && reason != 255 && (reason != 54
  1946. || killerid != 65535))) KickWithCode(playerid, "", 0, 28);
  1947. AntiCheatInfo[playerid][pDeathRes] = false;
  1948. AntiCheatInfo[playerid][pSet][0] = -1;
  1949. AntiCheatInfo[playerid][pSpawnRes] =
  1950. AntiCheatInfo[playerid][pDead] = true;
  1951. AntiCheatInfo[playerid][pSpawnTime] = GetTickCount();
  1952. #if !defined _inc_y_hooks\
  1953. && defined ac_OnPlayerDeath
  1954. return ac_OnPlayerDeath(playerid, killerid, reason);
  1955. #else
  1956. return 1;
  1957. #endif
  1958. }
  1959. #if !defined _inc_y_hooks
  1960. #if defined _ALS_OnPlayerDeath
  1961. #undef OnPlayerDeath
  1962. #else
  1963. #define _ALS_OnPlayerDeath
  1964. #endif
  1965. #define OnPlayerDeath ac_OnPlayerDeath
  1966. #if defined ac_OnPlayerDeath
  1967. forward ac_OnPlayerDeath(playerid, killerid, reason);
  1968. #endif
  1969. #endif
  1970. #if defined _inc_y_hooks
  1971. Hook:ac_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  1972. #else
  1973. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  1974. #endif
  1975. {
  1976. AntiCheatInfo[playerid][pDeathRes] = true;
  1977. #if !defined _inc_y_hooks\
  1978. && defined ac_OnPlayerTakeDamage
  1979. return ac_OnPlayerTakeDamage(playerid, issuerid, amount, weaponid, bodypart);
  1980. #else
  1981. return 1;
  1982. #endif
  1983. }
  1984. #if !defined _inc_y_hooks
  1985. #if defined _ALS_OnPlayerTakeDamage
  1986. #undef OnPlayerTakeDamage
  1987. #else
  1988. #define _ALS_OnPlayerTakeDamage
  1989. #endif
  1990. #define OnPlayerTakeDamage ac_OnPlayerTakeDamage
  1991. #if defined ac_OnPlayerTakeDamage
  1992. forward ac_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
  1993. #endif
  1994. #endif
  1995. #if defined _inc_y_hooks
  1996. Hook:ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1997. #else
  1998. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1999. #endif
  2000. {
  2001. if(AntiCheatInfo[playerid][pKicked]) return 0;
  2002. new i = GetTickCount();
  2003. if(AntiCheatInfo[playerid][pACAllow][49])
  2004. {
  2005. if(i < AntiCheatInfo[playerid][pCall][0] + Mtfc[0][0]) FloodDetect(playerid, 0);
  2006. else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2007. else AntiCheatInfo[playerid][pFloodCount][0] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2008. }
  2009. if(AntiCheatInfo[playerid][pACAllow][39] && dialogid
  2010. != AntiCheatInfo[playerid][pDialog]) return KickWithCode(playerid, "", 0, 39);
  2011. AntiCheatInfo[playerid][pDialog] = -1;
  2012. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][0] = i;
  2013. if(AntiCheatInfo[playerid][pACAllow][45])
  2014. {
  2015. while((i = strfind(inputtext, "%")) != -1) strdel(inputtext, i, i + 1);
  2016. }
  2017. #if !defined _inc_y_hooks\
  2018. && defined ac_OnDialogResponse
  2019. return ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  2020. #else
  2021. return 1;
  2022. #endif
  2023. }
  2024. #if !defined _inc_y_hooks
  2025. #if defined _ALS_OnDialogResponse
  2026. #undef OnDialogResponse
  2027. #else
  2028. #define _ALS_OnDialogResponse
  2029. #endif
  2030. #define OnDialogResponse ac_OnDialogResponse
  2031. #if defined ac_OnDialogResponse
  2032. forward ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  2033. #endif
  2034. #endif
  2035. #if defined _inc_y_hooks
  2036. Hook:ac_OnEnterExitModShop(playerid, enterexit, interiorid)
  2037. #else
  2038. public OnEnterExitModShop(playerid, enterexit, interiorid)
  2039. #endif
  2040. {
  2041. if(AntiCheatInfo[playerid][pKicked]) return 0;
  2042. #if !USE_TUNING_GARAGES
  2043. return KickWithCode(playerid, "", 0, 23, 1);
  2044. #else
  2045. new i = GetTickCount();
  2046. if(AntiCheatInfo[playerid][pACAllow][49])
  2047. {
  2048. if(i < AntiCheatInfo[playerid][pCall][1] + Mtfc[1][0]) FloodDetect(playerid, 1);
  2049. else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2050. else AntiCheatInfo[playerid][pFloodCount][1] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2051. }
  2052. AntiCheatInfo[playerid][pSet][0] = interiorid;
  2053. AntiCheatInfo[playerid][pModShop] = !!enterexit;
  2054. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][1] = i;
  2055. #if !defined _inc_y_hooks\
  2056. && defined ac_OnEnterExitModShop
  2057. return ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  2058. #else
  2059. return 1;
  2060. #endif
  2061. #endif
  2062. #undef USE_TUNING_GARAGES
  2063. }
  2064. #if !defined _inc_y_hooks
  2065. #if defined _ALS_OnEnterExitModShop
  2066. #undef OnEnterExitModShop
  2067. #else
  2068. #define _ALS_OnEnterExitModShop
  2069. #endif
  2070. #define OnEnterExitModShop ac_OnEnterExitModShop
  2071. #if defined ac_OnEnterExitModShop
  2072. forward ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  2073. #endif
  2074. #endif
  2075. #if defined _inc_y_hooks
  2076. Hook:ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  2077. #else
  2078. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  2079. #endif
  2080. {
  2081. if(!IsPlayerConnected(playerid)
  2082. || AntiCheatInfo[playerid][pKicked]) return 0;
  2083. new i = GetPlayerVehicleID(playerid);
  2084. if(newinteriorid != AntiCheatInfo[playerid][pSet][0])
  2085. {
  2086. if(i)
  2087. {
  2088. if(AntiCheatInfo[playerid][pACAllow][3]) KickWithCode(playerid, "", 0, 3, 1);
  2089. }
  2090. else if(AntiCheatInfo[playerid][pACAllow][2] && !AntiCheatInfo[playerid][pIntEnterExits]
  2091. && newinteriorid != AntiCheatInfo[playerid][pSet][12]) KickWithCode(playerid, "", 0, 2, 1);
  2092. GetPlayerPos(playerid, AntiCheatInfo[playerid][pPos][0],
  2093. AntiCheatInfo[playerid][pPos][1], AntiCheatInfo[playerid][pPos][2]);
  2094. }
  2095. if(!AntiCheatInfo[playerid][pKicked] && i) AntiCheatVehInfo[i][vInt] = newinteriorid;
  2096. if(AntiCheatInfo[playerid][pSet][12] == -1) AntiCheatInfo[playerid][pSet][0] = -1;
  2097. else AntiCheatInfo[playerid][pSet][12] = -1;
  2098. AntiCheatInfo[playerid][pGtc][11] = GetTickCount() + 1400;
  2099. #if !defined _inc_y_hooks\
  2100. && defined ac_OnPlayerInteriorChange
  2101. return ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  2102. #else
  2103. return 1;
  2104. #endif
  2105. }
  2106. #if !defined _inc_y_hooks
  2107. #if defined _ALS_OnPlayerInteriorChange
  2108. #undef OnPlayerInteriorChange
  2109. #else
  2110. #define _ALS_OnPlayerInteriorChange
  2111. #endif
  2112. #define OnPlayerInteriorChange ac_OnPlayerInteriorChange
  2113. #if defined ac_OnPlayerInteriorChange
  2114. forward ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  2115. #endif
  2116. #endif
  2117. #if defined _inc_y_hooks
  2118. Hook:ac_OnRconLoginAttempt(ip[], password[], success)
  2119. #else
  2120. public OnRconLoginAttempt(ip[], password[], success)
  2121. #endif
  2122. {
  2123. if(ACAllow[42])
  2124. {
  2125. static iptables[MAX_PLAYERS][2], ip_index;
  2126. new i, current_ip = IpToInt(ip);
  2127. for(; i < ip_index && i < sizeof iptables; ++i)
  2128. {
  2129. if(iptables[i][0] == current_ip)
  2130. {
  2131. if(success) iptables[i][1] = 0;
  2132. else
  2133. {
  2134. if(++iptables[i][1] > MAX_RCON_LOGIN_ATTEMPT)
  2135. {
  2136. #if defined DEBUG
  2137. printf(DEBUG_CODE_4, ip, password);
  2138. #endif
  2139. iptables[i][1] = 0;
  2140. KickWithCode(65535, ip, 1, 42, 1);
  2141. }
  2142. }
  2143. i = -1;
  2144. break;
  2145. }
  2146. }
  2147. if(i == -1 && !success)
  2148. {
  2149. iptables[ip_index][0] = current_ip;
  2150. if(++iptables[ip_index][1] > MAX_RCON_LOGIN_ATTEMPT)
  2151. {
  2152. #undef MAX_RCON_LOGIN_ATTEMPT
  2153. #if defined DEBUG
  2154. printf(DEBUG_CODE_4, ip, password, iptables[ip_index][1]);
  2155. #endif
  2156. iptables[ip_index][1] = 0;
  2157. KickWithCode(65535, ip, 1, 42, 2);
  2158. }
  2159. if(++ip_index > sizeof(iptables) - 1) ip_index = 0;
  2160. iptables[ip_index][1] = 0;
  2161. }
  2162. }
  2163. #if !defined _inc_y_hooks\
  2164. && defined ac_OnRconLoginAttempt
  2165. return ac_OnRconLoginAttempt(ip, password, success);
  2166. #else
  2167. return 1;
  2168. #endif
  2169. }
  2170. #if !defined _inc_y_hooks
  2171. #if defined _ALS_OnRconLoginAttempt
  2172. #undef OnRconLoginAttempt
  2173. #else
  2174. #define _ALS_OnRconLoginAttempt
  2175. #endif
  2176. #define OnRconLoginAttempt ac_OnRconLoginAttempt
  2177. #if defined ac_OnRconLoginAttempt
  2178. forward ac_OnRconLoginAttempt(ip[], password[], success);
  2179. #endif
  2180. #endif
  2181. #if defined _inc_y_hooks
  2182. Hook:ac_OnPlayerUpdate(playerid)
  2183. #else
  2184. public OnPlayerUpdate(playerid)
  2185. #endif
  2186. {
  2187. if(AntiCheatInfo[playerid][pKicked]) return 0;
  2188. static gpp, bool:ur;
  2189. ur = false;
  2190. if(!IsPlayerNPC(playerid))
  2191. {
  2192. gpp = GetPlayerPing(playerid);
  2193. if(AntiCheatInfo[playerid][pACAllow][38])
  2194. {
  2195. if(gpp > MAX_PING)
  2196. {
  2197. if(++AntiCheatInfo[playerid][pCheatCount][0] >
  2198. MAX_PING_WARNINGS) return KickWithCode(playerid, "", 0, 38);
  2199. #undef MAX_PING_WARNINGS
  2200. }
  2201. else AntiCheatInfo[playerid][pCheatCount][0] = 0;
  2202. }
  2203. static stateanim;
  2204. if((stateanim = GetPlayerState(playerid)) != 9)
  2205. {
  2206. gpp += 100;
  2207. static gtc, w, a;
  2208. gtc = GetTickCount();
  2209. a = GetPlayerAmmo(playerid);
  2210. w = GetPlayerWeapon(playerid);
  2211. if(AntiCheatInfo[playerid][pSet][3] != -1)
  2212. {
  2213. if(AntiCheatInfo[playerid][pSet][3] == w)
  2214. {
  2215. AntiCheatInfo[playerid][pSet][3] =
  2216. AntiCheatInfo[playerid][pSetWeapon][WeaponSlots[w]] = -1;
  2217. AntiCheatInfo[playerid][pWeapon][WeaponSlots[w]] = w;
  2218. }
  2219. else if(AntiCheatInfo[playerid][pACAllow][52] && !(1 < stateanim < 4)
  2220. && gtc > AntiCheatInfo[playerid][pGtc][2] + gpp
  2221. && ++AntiCheatInfo[playerid][pNOPCount][0] > MAX_NOP_WARNINGS)
  2222. {
  2223. #if defined DEBUG
  2224. printf(DEBUG_CODE_5, playerid, "GivePlayerWeapon");
  2225. #endif
  2226. return KickWithCode(playerid, "", 0, 52, 1);
  2227. }
  2228. }
  2229. if(AntiCheatInfo[playerid][pGiveAmmo][WeaponSlots[w]] != -65535)
  2230. {
  2231. if(AntiCheatInfo[playerid][pGiveAmmo][WeaponSlots[w]] == a)
  2232. {
  2233. AntiCheatInfo[playerid][pGiveAmmo][WeaponSlots[w]] = -65535;
  2234. AntiCheatInfo[playerid][pAmmo][WeaponSlots[w]] = a;
  2235. }
  2236. else if(AntiCheatInfo[playerid][pACAllow][52] && gtc >
  2237. AntiCheatInfo[playerid][pGtcGiveAmmo][WeaponSlots[w]] + gpp
  2238. && ++AntiCheatInfo[playerid][pNOPCount][1] > MAX_NOP_WARNINGS)
  2239. {
  2240. #if defined DEBUG
  2241. printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
  2242. #endif
  2243. return KickWithCode(playerid, "", 0, 52, 2);
  2244. }
  2245. }
  2246. static i;
  2247. i = GetPlayerInterior(playerid);
  2248. if(AntiCheatInfo[playerid][pLastWeapon] != w)
  2249. {
  2250. if(AntiCheatInfo[playerid][pWeapon][WeaponSlots[w]] != w)
  2251. {
  2252. if(w == 40 || w == 46 && AntiCheatInfo[playerid][pVeh]
  2253. && AntiCheatInfo[playerid][pParachute])
  2254. {
  2255. AntiCheatInfo[playerid][pWeapon][WeaponSlots[w]] = w;
  2256. AntiCheatInfo[playerid][pAmmo][WeaponSlots[w]] = a;
  2257. }
  2258. else if(21 < w < 33 && IsPlayerInAmmuNation(playerid, i))
  2259. {
  2260. if(AntiCheatInfo[playerid][pSet][10]
  2261. != -1) AntiCheatInfo[playerid][pSet][10] += AmmuNationInfo[w-22][0];
  2262. else AntiCheatInfo[playerid][pSet][10] = AmmuNationInfo[w-22][0];
  2263. AntiCheatInfo[playerid][pAmmo][WeaponSlots[w]] = AmmuNationInfo[w-22][1];
  2264. AntiCheatInfo[playerid][pCheatCount][10] = 0;
  2265. AntiCheatInfo[playerid][pWeapon][WeaponSlots[w]] = w;
  2266. ur = true;
  2267. }
  2268. else if(AntiCheatInfo[playerid][pLastPickup] > -1
  2269. && AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pWeapon] == w
  2270. && a == PickupAmmo[AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pWeapon]]
  2271. && IsPlayerInRangeOfPoint(playerid, 5.0, AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pPos][0],
  2272. AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pPos][1],
  2273. AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pPos][2]))
  2274. {
  2275. AntiCheatInfo[playerid][pWeapon][WeaponSlots[w]] = w;
  2276. if(2 < WeaponSlots[AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pWeapon]] <
  2277. 6) AntiCheatInfo[playerid][pAmmo][WeaponSlots[w]] +=
  2278. PickupAmmo[AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pWeapon]];
  2279. else AntiCheatInfo[playerid][pAmmo][WeaponSlots[w]] =
  2280. PickupAmmo[AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pWeapon]];
  2281. }
  2282. else if(AntiCheatInfo[playerid][pACAllow][15]
  2283. && AntiCheatInfo[playerid][pSetWeapon][WeaponSlots[w]] == -1
  2284. && gtc > AntiCheatInfo[playerid][pGtc][7]
  2285. + gpp) return KickWithCode(playerid, "", 0, 15, 1);
  2286. }
  2287. AntiCheatInfo[playerid][pShot] = false;
  2288. }
  2289. else if(AntiCheatInfo[playerid][pAmmo][WeaponSlots[w]] != a)
  2290. {
  2291. switch(w)
  2292. {
  2293. case 16, 17, 18, 35, 36, 39, 43:
  2294. {
  2295. if(AntiCheatInfo[playerid][pACAllow][16] && (!AntiCheatInfo[playerid][pAmmo][WeaponSlots[w]]
  2296. || AntiCheatInfo[playerid][pAmmo][WeaponSlots[w]] - 1 != a)) return KickWithCode(playerid, "", 0, 16, 1);
  2297. AntiCheatInfo[playerid][pAmmo][WeaponSlots[w]]--;
  2298. }
  2299. }
  2300. }
  2301. static Float:health;
  2302. GetPlayerHealth(playerid, health);
  2303. if(AntiCheatInfo[playerid][pSet][1] != -1)
  2304. {
  2305. if(AntiCheatInfo[playerid][pSet][1] > 255)
  2306. {
  2307. while(health < AntiCheatInfo[playerid][pSet][1]) health += 256;
  2308. }
  2309. if(AntiCheatInfo[playerid][pSet][1] == health) AntiCheatInfo[playerid][pSet][1] = -1;
  2310. else if(AntiCheatInfo[playerid][pACAllow][52] && gtc > AntiCheatInfo[playerid][pGtc][3]
  2311. + gpp && ++AntiCheatInfo[playerid][pNOPCount][3] > MAX_NOP_WARNINGS)
  2312. {
  2313. #if defined DEBUG
  2314. printf(DEBUG_CODE_5, playerid, "SetPlayerHealth");
  2315. #endif
  2316. return KickWithCode(playerid, "", 0, 52, 3);
  2317. }
  2318. }
  2319. else if(AntiCheatInfo[playerid][pACAllow][12])
  2320. {
  2321. while(AntiCheatInfo[playerid][pHealth] > health + 255) health += 256;
  2322. if(health > AntiCheatInfo[playerid][pHealth] && !(health <= AntiCheatInfo[playerid][pHealth] + 70.0
  2323. && IsPlayerInRestaurant(playerid, i)) && !(health <= AntiCheatInfo[playerid][pHealth] + 35.0
  2324. && IsPlayerNearVendingMachine(playerid, i))) return KickWithCode(playerid, "", 0, 12);
  2325. }
  2326. static Float:armour;
  2327. GetPlayerArmour(playerid, armour);
  2328. if(AntiCheatInfo[playerid][pSet][2] != -1)
  2329. {
  2330. if(AntiCheatInfo[playerid][pSet][2] > 255)
  2331. {
  2332. while(armour < AntiCheatInfo[playerid][pSet][2]) armour += 256;
  2333. }
  2334. if(AntiCheatInfo[playerid][pSet][2] == armour) AntiCheatInfo[playerid][pSet][2] = -1;
  2335. else if(AntiCheatInfo[playerid][pACAllow][52] && gtc > AntiCheatInfo[playerid][pGtc][5]
  2336. + gpp && ++AntiCheatInfo[playerid][pNOPCount][5] > MAX_NOP_WARNINGS)
  2337. {
  2338. #if defined DEBUG
  2339. printf(DEBUG_CODE_5, playerid, "SetPlayerArmour");
  2340. #endif
  2341. return KickWithCode(playerid, "", 0, 52, 4);
  2342. }
  2343. }
  2344. else if(AntiCheatInfo[playerid][pACAllow][13])
  2345. {
  2346. while(AntiCheatInfo[playerid][pArmour] > armour + 255) armour += 256;
  2347. if(armour > AntiCheatInfo[playerid][pArmour])
  2348. {
  2349. if(IsPlayerInAmmuNation(playerid, i))
  2350. {
  2351. if(AntiCheatInfo[playerid][pSet][10]
  2352. != -1) AntiCheatInfo[playerid][pSet][10] += 200;
  2353. else AntiCheatInfo[playerid][pSet][10] = 200;
  2354. AntiCheatInfo[playerid][pCheatCount][10] = 0;
  2355. ur = true;
  2356. }
  2357. else return KickWithCode(playerid, "", 0, 13);
  2358. }
  2359. }
  2360. if(AntiCheatInfo[playerid][pACAllow][19] && AntiCheatInfo[playerid][pDmgRes])
  2361. {
  2362. if(AntiCheatInfo[playerid][pDmgRes] == 1 && health < AntiCheatInfo[playerid][pHealth]
  2363. || armour < AntiCheatInfo[playerid][pArmour]) AntiCheatInfo[playerid][pDmgRes] = 0;
  2364. else if(gtc > AntiCheatInfo[playerid][pGtc][14] + gpp * 2 && ++AntiCheatInfo[playerid][pCheatCount][9] >
  2365. MAX_NOP_WARNINGS) return KickWithCode(playerid, "", 0, 19);
  2366. }
  2367. static vehid;
  2368. vehid = GetPlayerVehicleID(playerid);
  2369. a = bad_GetPlayerMoney(playerid);
  2370. if(AntiCheatInfo[playerid][pACAllow][14] && a > AntiCheatInfo[playerid][pMoney])
  2371. {
  2372. if(!(AntiCheatInfo[playerid][pStuntBonus] && vehid)
  2373. && !IsPlayerInCasino(playerid, i))
  2374. {
  2375. a = AntiCheatInfo[playerid][pMoney];
  2376. ResetPlayerMoney(playerid);
  2377. GivePlayerMoney(playerid, a);
  2378. }
  2379. }
  2380. else if(AntiCheatInfo[playerid][pSet][10] != -1 && a < AntiCheatInfo[playerid][pMoney])
  2381. {
  2382. if(AntiCheatInfo[playerid][pSet][10] ==
  2383. (AntiCheatInfo[playerid][pMoney] - a)) AntiCheatInfo[playerid][pSet][10] = -1;
  2384. else if(AntiCheatInfo[playerid][pACAllow][15] && gtc > AntiCheatInfo[playerid][pGtc][15]
  2385. + 1030 && ++AntiCheatInfo[playerid][pCheatCount][10] >
  2386. MAX_NOP_WARNINGS) return KickWithCode(playerid, "", 0, 15, 3);
  2387. }
  2388. if(AntiCheatInfo[playerid][pACAllow][52])
  2389. {
  2390. if(AntiCheatInfo[playerid][pSet][0] != -1 && gtc > AntiCheatInfo[playerid][pGtc][0]
  2391. + gpp && ++AntiCheatInfo[playerid][pNOPCount][2] > MAX_NOP_WARNINGS)
  2392. {
  2393. #if defined DEBUG
  2394. printf(DEBUG_CODE_5, playerid, "SetPlayerInterior");
  2395. #endif
  2396. return KickWithCode(playerid, "", 0, 52, 5);
  2397. }
  2398. if(AntiCheatInfo[playerid][pSet][6] != -1 && gtc > AntiCheatInfo[playerid][pGtc][12]
  2399. + gpp && ++AntiCheatInfo[playerid][pNOPCount][8] > MAX_NOP_WARNINGS)
  2400. {
  2401. #if defined DEBUG
  2402. printf(DEBUG_CODE_5, playerid, "TogglePlayerSpectating");
  2403. #endif
  2404. return KickWithCode(playerid, "", 0, 52, 6);
  2405. }
  2406. if(AntiCheatInfo[playerid][pSet][7] != -1 && gtc > AntiCheatInfo[playerid][pGtc][13]
  2407. + gpp && ++AntiCheatInfo[playerid][pNOPCount][9] > MAX_NOP_WARNINGS)
  2408. {
  2409. #if defined DEBUG
  2410. printf(DEBUG_CODE_5, playerid, "SpawnPlayer");
  2411. #endif
  2412. return KickWithCode(playerid, "", 0, 52, 7);
  2413. }
  2414. if(AntiCheatInfo[playerid][pSet][11] != -1 && vehid
  2415. && gtc > AntiCheatInfo[playerid][pGtc][8] + gpp + 3000)
  2416. {
  2417. #if defined DEBUG
  2418. printf(DEBUG_CODE_5, playerid, "RemovePlayerFromVehicle");
  2419. #endif
  2420. return KickWithCode(playerid, "", 0, 52, 8);
  2421. }
  2422. }
  2423. static s, Float:ppos[3];
  2424. s = GetPlayerVehicleSeat(playerid);
  2425. GetPlayerPos(playerid, ppos[0], ppos[1], ppos[2]);
  2426. if(AntiCheatInfo[playerid][pSet][9] != -1)
  2427. {
  2428. if(AntiCheatInfo[playerid][pSet][9] == vehid
  2429. && (AntiCheatInfo[playerid][pSet][5] == s
  2430. || AntiCheatInfo[playerid][pSet][5] == -1))
  2431. {
  2432. if(AntiCheatInfo[playerid][pVeh]
  2433. && AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver] == playerid)
  2434. {
  2435. if(GetVehicleModel(AntiCheatInfo[playerid][pVeh]) == 457
  2436. && !AntiCheatInfo[playerid][pWeapon][1]) AntiCheatInfo[playerid][pWeapon][1] = 2;
  2437. AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver] = 65535;
  2438. }
  2439. if(!s)
  2440. {
  2441. AntiCheatVehInfo[vehid][vDriver] = playerid;
  2442. GetVehicleZAngle(vehid, AntiCheatVehInfo[vehid][vZAngle]);
  2443. AntiCheatInfo[playerid][pSetVehHealth] = -1;
  2444. }
  2445. AntiCheatInfo[playerid][pVehDmgRes] = false;
  2446. AntiCheatInfo[playerid][pSet][11] =
  2447. AntiCheatInfo[playerid][pSet][9] =
  2448. AntiCheatInfo[playerid][pSet][8] =
  2449. AntiCheatInfo[playerid][pSet][5] = -1;
  2450. AntiCheatInfo[playerid][pSeat] = s;
  2451. }
  2452. else if(AntiCheatInfo[playerid][pACAllow][52] && gtc > AntiCheatInfo[playerid][pGtc][1]
  2453. + gpp && ++AntiCheatInfo[playerid][pNOPCount][7] > MAX_NOP_WARNINGS)
  2454. {
  2455. #if defined DEBUG
  2456. printf(DEBUG_CODE_5, playerid, "PutPlayerInVehicle");
  2457. #endif
  2458. return KickWithCode(playerid, "", 0, 52, 9);
  2459. }
  2460. }
  2461. else
  2462. {
  2463. if(AntiCheatInfo[playerid][pSet][8] != -1)
  2464. {
  2465. if(IsPlayerInRangeOfPoint(playerid, 5.0, AntiCheatInfo[playerid][pSetPos][0],
  2466. AntiCheatInfo[playerid][pSetPos][1], (AntiCheatInfo[playerid][pTpToZ]
  2467. ? ppos[2] : AntiCheatInfo[playerid][pSetPos][2])))
  2468. {
  2469. AntiCheatInfo[playerid][pSet][8] = -1;
  2470. AntiCheatInfo[playerid][pGtc][11] = 0;
  2471. AntiCheatInfo[playerid][pTpToZ] = false;
  2472. AntiCheatInfo[playerid][pPos][0] = ppos[0];
  2473. AntiCheatInfo[playerid][pPos][1] = ppos[1];
  2474. AntiCheatInfo[playerid][pPos][2] = ppos[2];
  2475. }
  2476. else if(gtc > AntiCheatInfo[playerid][pGtc][11] + gpp)
  2477. {
  2478. AntiCheatInfo[playerid][pTpToZ] = false;
  2479. if(AntiCheatInfo[playerid][pACAllow][52]
  2480. && ++AntiCheatInfo[playerid][pNOPCount][10] >
  2481. MAX_NOP_WARNINGS)
  2482. {
  2483. #if defined DEBUG
  2484. printf(DEBUG_CODE_5, playerid, "SetPlayerPos");
  2485. #endif
  2486. return KickWithCode(playerid, "", 0, 52, 10);
  2487. }
  2488. }
  2489. }
  2490. static Float:pvel[3], Float:vctsize, specact;
  2491. vctsize = GetPlayerDistanceFromPoint(playerid, AntiCheatInfo[playerid][pPos][0],
  2492. AntiCheatInfo[playerid][pPos][1], AntiCheatInfo[playerid][pPos][2]);
  2493. specact = GetPlayerSpecialAction(playerid);
  2494. if(vehid)
  2495. {
  2496. if(!AntiCheatInfo[playerid][pVeh])
  2497. {
  2498. if(AntiCheatInfo[playerid][pACAllow][4] && (AntiCheatInfo[playerid][pEnterVeh] != vehid
  2499. || gtc < AntiCheatInfo[playerid][pEnterVehTime] + 600)) return KickWithCode(playerid, "", 0, 4, 1);
  2500. }
  2501. else if(AntiCheatInfo[playerid][pVeh] != vehid)
  2502. {
  2503. if(AntiCheatInfo[playerid][pACAllow][4]) return KickWithCode(playerid, "", 0, 4, 2);
  2504. }
  2505. else if(AntiCheatInfo[playerid][pACAllow][50]
  2506. && AntiCheatInfo[playerid][pSeat]
  2507. != s) return KickWithCode(playerid, "", 0, 50);
  2508. if(stateanim == 2)
  2509. {
  2510. if(AntiCheatInfo[playerid][pACAllow][32] && AntiCheatVehInfo[vehid][vDriver] != 65535
  2511. && AntiCheatVehInfo[vehid][vDriver] != playerid) return ClearAnimations(playerid, 1);
  2512. if(AntiCheatInfo[playerid][pACAllow][35] && GetPlayerCameraMode(playerid) ==
  2513. 55) return KickWithCode(playerid, "", 0, 35);
  2514. static Float:vhealth;
  2515. GetVehicleHealth(vehid, vhealth);
  2516. if(AntiCheatInfo[playerid][pSetVehHealth] != -1)
  2517. {
  2518. if(vhealth == AntiCheatInfo[playerid][pSetVehHealth]) AntiCheatInfo[playerid][pSetVehHealth] = -1;
  2519. else if(AntiCheatInfo[playerid][pACAllow][52] && gtc > AntiCheatInfo[playerid][pGtc][4]
  2520. + gpp && ++AntiCheatInfo[playerid][pNOPCount][4] > MAX_NOP_WARNINGS)
  2521. {
  2522. #if defined DEBUG
  2523. printf(DEBUG_CODE_5, playerid, "SetVehicleHealth");
  2524. #endif
  2525. return KickWithCode(playerid, "", 0, 52, 11);
  2526. }
  2527. }
  2528. else if(AntiCheatInfo[playerid][pACAllow][11] && vhealth >
  2529. AntiCheatVehInfo[vehid][vHealth] && !AntiCheatInfo[playerid][pModShop]
  2530. && !IsPlayerInPayNSpray(playerid, i)) return KickWithCode(playerid, "", 0, 11);
  2531. if(AntiCheatInfo[playerid][pACAllow][20] && AntiCheatInfo[playerid][pVehDmgRes])
  2532. {
  2533. if(vhealth < AntiCheatVehInfo[vehid][vHealth]) AntiCheatInfo[playerid][pVehDmgRes] = false;
  2534. else if(gtc > AntiCheatInfo[playerid][pGtc][16] + gpp * 2 && ++AntiCheatInfo[playerid][pCheatCount][11] >
  2535. MAX_NOP_WARNINGS) return KickWithCode(playerid, "", 0, 20);
  2536. }
  2537. static Float:zangle;
  2538. GetVehicleZAngle(vehid, zangle);
  2539. while(zangle < 0.0) zangle += 360.0;
  2540. while(zangle > 360.0) zangle -= 360.0;
  2541. GetVehicleVelocity(vehid, pvel[0], pvel[1], pvel[2]);
  2542. if(gtc > AntiCheatInfo[playerid][pGtc][9] + gpp)
  2543. {
  2544. i = GetVehicleModel(vehid) - 400;
  2545. static Float:vsp, Float:spdiff;
  2546. vsp = GetSpeed(pvel[0],pvel[1],pvel[2]);
  2547. spdiff = vsp - GetSpeed(AntiCheatVehInfo[vehid][vVel][0],AntiCheatVehInfo[vehid][vVel][1],AntiCheatVehInfo[vehid][vVel][2]);
  2548. if(AntiCheatInfo[playerid][pACAllow][10] && spdiff >= 20.0 && AntiCheatVehInfo[vehid][vHealth] ==
  2549. vhealth && AntiCheatVehInfo[vehid][vSpeedDiff] <= spdiff && (i < 0 || VehicleTypes[i] != 2 || floatabs(pvel[0]) >
  2550. 0.3 || floatabs(pvel[1]) > 0.3 || floatabs(pvel[2]) > 0.3)) return KickWithCode(playerid, "", 0, 10, 1);
  2551. if(AntiCheatInfo[playerid][pACAllow][25] && vsp > 15.0 && floatabs(spdiff) < 25.0
  2552. && floatround(floatabs(zangle - AntiCheatVehInfo[vehid][vZAngle])) == 180 && (pvel[0] < 0.0)
  2553. != (AntiCheatVehInfo[vehid][vVel][0] < 0.0) && (pvel[1] < 0.0) != (AntiCheatVehInfo[vehid][vVel][1] < 0.0)
  2554. && (pvel[2] < 0.0) != (AntiCheatVehInfo[vehid][vVel][2] < 0.0)) return KickWithCode(playerid, "", 0, 25);
  2555. static Float:zdiff;
  2556. zdiff = ppos[2] - AntiCheatInfo[playerid][pPos][2];
  2557. if(i > -1 && VehicleTypes[i] == 1)
  2558. {
  2559. if(AntiCheatInfo[playerid][pACAllow][10] && vsp > 269.0) return KickWithCode(playerid, "", 0, 10, 2);
  2560. }
  2561. else if(AntiCheatInfo[playerid][pACAllow][8] && pvel[2] >= 0.1 && pvel[2] >
  2562. AntiCheatVehInfo[vehid][vVel][2] && floatabs(AntiCheatInfo[playerid][pPos][0] - ppos[0]) <
  2563. zdiff * 1.2 && floatabs(AntiCheatInfo[playerid][pPos][1] - ppos[1]) < zdiff * 1.2)
  2564. {
  2565. if(++AntiCheatInfo[playerid][pCheatCount][3] >
  2566. MAX_FLYHACK_VEH_WARNINGS) return KickWithCode(playerid, "", 0, 8, 1);
  2567. }
  2568. else AntiCheatInfo[playerid][pCheatCount][3] = 0;
  2569. if(vctsize > 0.4 && gtc > AntiCheatInfo[playerid][pGtc][11] + gpp)
  2570. {
  2571. if(vctsize > 15.0 && vctsize > AntiCheatVehInfo[vehid][vPosDiff] + ((vctsize / 3) * 1.5))
  2572. {
  2573. if(AntiCheatInfo[playerid][pACAllow][3] && AntiCheatInfo[playerid][pPos][2] >
  2574. -97.0) return KickWithCode(playerid, "", 0, 3, 2);
  2575. }
  2576. else if(AntiCheatInfo[playerid][pACAllow][1] && vsp < 16.0 && vctsize > 0.8)
  2577. {
  2578. if(++AntiCheatInfo[playerid][pCheatCount][2] >
  2579. MAX_AIR_VEH_WARNINGS) return KickWithCode(playerid, "", 0, 1);
  2580. #undef MAX_AIR_VEH_WARNINGS
  2581. }
  2582. else AntiCheatInfo[playerid][pCheatCount][2] = 0;
  2583. }
  2584. AntiCheatVehInfo[vehid][vSpeedDiff] = spdiff;
  2585. }
  2586. AntiCheatVehInfo[vehid][vVel][0] = pvel[0];
  2587. AntiCheatVehInfo[vehid][vVel][1] = pvel[1];
  2588. AntiCheatVehInfo[vehid][vVel][2] = pvel[2];
  2589. AntiCheatVehInfo[vehid][vPosDiff] = vctsize;
  2590. AntiCheatVehInfo[vehid][vHealth] = vhealth;
  2591. AntiCheatVehInfo[vehid][vZAngle] = zangle;
  2592. }
  2593. AntiCheatInfo[playerid][pSeat] = s;
  2594. }
  2595. else
  2596. {
  2597. if(AntiCheatInfo[playerid][pACAllow][47]
  2598. && GetPlayerCameraMode(playerid) == 53)
  2599. {
  2600. GetPlayerCameraPos(playerid, pvel[0], pvel[1], pvel[2]);
  2601. if(floatabs(pvel[0]) > 50000.0 || floatabs(pvel[1]) > 50000.0
  2602. || floatabs(pvel[2]) > 50000.0) return KickWithCode(playerid, "", 0, 47, 1);
  2603. }
  2604. stateanim = GetPlayerAnimationIndex(playerid);
  2605. GetPlayerVelocity(playerid, pvel[0], pvel[1], pvel[2]);
  2606. pvel[0] = GetSpeed(pvel[0],pvel[1],pvel[2]);
  2607. if(AntiCheatInfo[playerid][pAnim] != stateanim)
  2608. {
  2609. switch(stateanim)
  2610. {
  2611. case -1:
  2612. {
  2613. if(AntiCheatInfo[playerid][pACAllow][24]) return KickWithCode(playerid, "", 0, 24);
  2614. }
  2615. case 958..979:
  2616. {
  2617. if(AntiCheatInfo[playerid][pACAllow][7]
  2618. && w != 46) return KickWithCode(playerid, "", 0, 7, 1);
  2619. }
  2620. case 1058:
  2621. {
  2622. if(AntiCheatInfo[playerid][pACAllow][7]) return KickWithCode(playerid, "", 0, 7, 2);
  2623. }
  2624. case 1231:
  2625. {
  2626. if(AntiCheatInfo[playerid][pACAllow][30])
  2627. {
  2628. i = GetPlayerSkin(playerid);
  2629. if(!PedAnims && i && i != 74) return KickWithCode(playerid, "", 0, 30);
  2630. }
  2631. }
  2632. }
  2633. }
  2634. else if(AntiCheatInfo[playerid][pACAllow][7] && pvel[0] > 30.0
  2635. && 1537 < stateanim < 1545) return KickWithCode(playerid, "", 0, 7, 3);
  2636. if(AntiCheatInfo[playerid][pSet][4] != -1)
  2637. {
  2638. if(specact == AntiCheatInfo[playerid][pSet][4])
  2639. {
  2640. AntiCheatInfo[playerid][pSet][4] = -1;
  2641. AntiCheatInfo[playerid][pSpecAct] = specact;
  2642. }
  2643. else if(AntiCheatInfo[playerid][pACAllow][52] && gtc > AntiCheatInfo[playerid][pGtc][6]
  2644. + gpp && ++AntiCheatInfo[playerid][pNOPCount][6] > MAX_NOP_WARNINGS)
  2645. {
  2646. #if defined DEBUG
  2647. printf(DEBUG_CODE_5, playerid, "SetPlayerSpecialAction");
  2648. #endif
  2649. return KickWithCode(playerid, "", 0, 52, 12);
  2650. }
  2651. }
  2652. else if(specact != AntiCheatInfo[playerid][pSpecAct])
  2653. {
  2654. if(specact == AntiCheatInfo[playerid][pNextSpecAct]) AntiCheatInfo[playerid][pNextSpecAct] = -1;
  2655. else if(AntiCheatInfo[playerid][pACAllow][18])
  2656. {
  2657. switch(specact)
  2658. {
  2659. case 0:
  2660. {
  2661. switch(AntiCheatInfo[playerid][pSpecAct])
  2662. {
  2663. case 11, 24, 25: return KickWithCode(playerid, "", 0, 18, 1);
  2664. }
  2665. }
  2666. case 1:
  2667. {
  2668. if(AntiCheatInfo[playerid][pSpecAct]
  2669. && !(19 < AntiCheatInfo[playerid][pSpecAct] <
  2670. 25)) return KickWithCode(playerid, "", 0, 18, 2);
  2671. }
  2672. case 2:
  2673. {
  2674. if(!IsPlayerInRangeOfPoint(playerid, 5.0,
  2675. AntiCheatInfo[playerid][pDropJP][0], AntiCheatInfo[playerid][pDropJP][1],
  2676. AntiCheatInfo[playerid][pDropJP][2])) return KickWithCode(playerid, "", 0, 18, 3);
  2677. AntiCheatInfo[playerid][pDropJP][0] = AntiCheatInfo[playerid][pDropJP][1] =
  2678. AntiCheatInfo[playerid][pDropJP][2] = 20001.0;
  2679. }
  2680. case 3:
  2681. {
  2682. switch(AntiCheatInfo[playerid][pSpecAct])
  2683. {
  2684. case 2, 5..8, 11, 68: return KickWithCode(playerid, "", 0, 18, 4);
  2685. }
  2686. }
  2687. default:
  2688. {
  2689. if(!(19 < specact < 25 && AntiCheatInfo[playerid][pSpecAct] == 1 && specact ==
  2690. AntiCheatInfo[playerid][pLastSpecAct]) && !((specact == 4 || specact == 11 || specact == 24
  2691. || specact == 25) && AntiCheatInfo[playerid][pVeh]) && !(AntiCheatInfo[playerid][pSpecAct] == 3
  2692. && specact == AntiCheatInfo[playerid][pLastSpecAct])) return KickWithCode(playerid, "", 0, 18, 5);
  2693. }
  2694. }
  2695. }
  2696. AntiCheatInfo[playerid][pLastSpecAct] = AntiCheatInfo[playerid][pSpecAct];
  2697. }
  2698. if(gtc > AntiCheatInfo[playerid][pGtc][10] + gpp && GetPlayerSurfingVehicleID(playerid) ==
  2699. 65535 && GetPlayerSurfingObjectID(playerid) == 65535)
  2700. {
  2701. if(AntiCheatInfo[playerid][pACAllow][9] && pvel[0] > 211.0
  2702. && AntiCheatInfo[playerid][pSpeed] < pvel[0]) return KickWithCode(playerid, "", 0, 9);
  2703. if(vctsize > 0.5 && gtc > AntiCheatInfo[playerid][pGtc][11] + gpp)
  2704. {
  2705. if(vctsize > 30.0)
  2706. {
  2707. if(AntiCheatInfo[playerid][pACAllow][2]
  2708. && AntiCheatInfo[playerid][pPos][2] >
  2709. -97.0) return KickWithCode(playerid, "", 0, 2, 2);
  2710. }
  2711. else if(pvel[0] <= vctsize * (vctsize < 1.0 ? 30.0 : 5.0))
  2712. {
  2713. if(pvel[0] < 3.0 && vctsize > 3.0)
  2714. {
  2715. if(AntiCheatInfo[playerid][pACAllow][2]) return KickWithCode(playerid, "", 0, 2, 3);
  2716. }
  2717. else if(AntiCheatInfo[playerid][pACAllow][0] && pvel[0]
  2718. && ++AntiCheatInfo[playerid][pCheatCount][1] >
  2719. MAX_AIR_WARNINGS) return KickWithCode(playerid, "", 0, 0);
  2720. #undef MAX_AIR_WARNINGS
  2721. }
  2722. }
  2723. AntiCheatInfo[playerid][pSpeed] = pvel[0];
  2724. }
  2725. AntiCheatInfo[playerid][pAnim] = stateanim;
  2726. }
  2727. AntiCheatInfo[playerid][pSpecAct] = specact;
  2728. AntiCheatInfo[playerid][pHealth] = floatround(health, floatround_tozero);
  2729. AntiCheatInfo[playerid][pArmour] = floatround(armour, floatround_tozero);
  2730. }
  2731. AntiCheatInfo[playerid][pPos][0] = ppos[0];
  2732. AntiCheatInfo[playerid][pPos][1] = ppos[1];
  2733. AntiCheatInfo[playerid][pPos][2] = ppos[2];
  2734. AntiCheatInfo[playerid][pLastWeapon] = w;
  2735. AntiCheatInfo[playerid][pVeh] = vehid;
  2736. AntiCheatInfo[playerid][pMoney] = a;
  2737. }
  2738. }
  2739. gpp = 1;
  2740. #if !defined _inc_y_hooks\
  2741. && defined ac_OnPlayerUpdate
  2742. gpp = ac_OnPlayerUpdate(playerid);
  2743. #endif
  2744. AntiCheatInfo[playerid][pLastUpdate] = GetTickCount();
  2745. if(ur) AntiCheatInfo[playerid][pGtc][15] = AntiCheatInfo[playerid][pLastUpdate];
  2746. if(AntiCheatInfo[playerid][pACAllow][33] && gpp) return AntiCheatInfo[playerid][pFreeze];
  2747. return gpp;
  2748. }
  2749. #if !defined _inc_y_hooks
  2750. #if defined _ALS_OnPlayerUpdate
  2751. #undef OnPlayerUpdate
  2752. #else
  2753. #define _ALS_OnPlayerUpdate
  2754. #endif
  2755. #define OnPlayerUpdate ac_OnPlayerUpdate
  2756. #if defined ac_OnPlayerUpdate
  2757. forward ac_OnPlayerUpdate(playerid);
  2758. #endif
  2759. #endif
  2760. #if defined _inc_y_hooks
  2761. Hook:ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2762. #else
  2763. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2764. #endif
  2765. {
  2766. if(newkeys & 16 && AntiCheatInfo[playerid][pSpecAct] ==
  2767. 2 && GetPlayerSpecialAction(playerid) != 2)
  2768. {
  2769. AntiCheatInfo[playerid][pDropJP][0] = AntiCheatInfo[playerid][pPos][0];
  2770. AntiCheatInfo[playerid][pDropJP][1] = AntiCheatInfo[playerid][pPos][1];
  2771. AntiCheatInfo[playerid][pDropJP][2] = AntiCheatInfo[playerid][pPos][2];
  2772. }
  2773. #if !defined _inc_y_hooks\
  2774. && defined ac_OnPlayerKeyStateChange
  2775. return ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  2776. #else
  2777. return 1;
  2778. #endif
  2779. }
  2780. #if !defined _inc_y_hooks
  2781. #if defined _ALS_OnPlayerKeyStateChange
  2782. #undef OnPlayerKeyStateChange
  2783. #else
  2784. #define _ALS_OnPlayerKeyStateChange
  2785. #endif
  2786. #define OnPlayerKeyStateChange ac_OnPlayerKeyStateChange
  2787. #if defined ac_OnPlayerKeyStateChange
  2788. forward ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  2789. #endif
  2790. #endif
  2791. #if defined _inc_y_hooks
  2792. Hook:ac_OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  2793. #else
  2794. public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  2795. #endif
  2796. {
  2797. if(AntiCheatInfo[playerid][pKicked]) return 0;
  2798. new i = GetTickCount();
  2799. if(AntiCheatInfo[playerid][pACAllow][49])
  2800. {
  2801. if(i < AntiCheatInfo[playerid][pCall][2] + Mtfc[2][0]) return FloodDetect(playerid, 2);
  2802. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2803. else AntiCheatInfo[playerid][pFloodCount][2] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2804. }
  2805. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][2] = i;
  2806. #if !defined _inc_y_hooks\
  2807. && defined ac_OnPlayerClickMap
  2808. return ac_OnPlayerClickMap(playerid, fX, fY, fZ);
  2809. #else
  2810. return 1;
  2811. #endif
  2812. }
  2813. #if !defined _inc_y_hooks
  2814. #if defined _ALS_OnPlayerClickMap
  2815. #undef OnPlayerClickMap
  2816. #else
  2817. #define _ALS_OnPlayerClickMap
  2818. #endif
  2819. #define OnPlayerClickMap ac_OnPlayerClickMap
  2820. #if defined ac_OnPlayerClickMap
  2821. forward ac_OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ);
  2822. #endif
  2823. #endif
  2824. #if defined _inc_y_hooks
  2825. Hook:ac_OnPlayerClickPlayer(playerid, clickedplayerid, source)
  2826. #else
  2827. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  2828. #endif
  2829. {
  2830. if(AntiCheatInfo[playerid][pKicked]) return 0;
  2831. new i = GetTickCount();
  2832. if(AntiCheatInfo[playerid][pACAllow][49])
  2833. {
  2834. if(i < AntiCheatInfo[playerid][pCall][3] + Mtfc[3][0]) return FloodDetect(playerid, 3);
  2835. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2836. else AntiCheatInfo[playerid][pFloodCount][3] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2837. }
  2838. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][3] = i;
  2839. #if !defined _inc_y_hooks\
  2840. && defined ac_OnPlayerClickPlayer
  2841. return ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
  2842. #else
  2843. return 1;
  2844. #endif
  2845. }
  2846. #if !defined _inc_y_hooks
  2847. #if defined _ALS_OnPlayerClickPlayer
  2848. #undef OnPlayerClickPlayer
  2849. #else
  2850. #define _ALS_OnPlayerClickPlayer
  2851. #endif
  2852. #define OnPlayerClickPlayer ac_OnPlayerClickPlayer
  2853. #if defined ac_OnPlayerClickPlayer
  2854. forward ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
  2855. #endif
  2856. #endif
  2857. #if defined _inc_y_hooks
  2858. Hook:ac_OnPlayerClickTextDraw(playerid, Text:clickedid)
  2859. #else
  2860. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  2861. #endif
  2862. {
  2863. if(AntiCheatInfo[playerid][pKicked]) return 0;
  2864. new i = GetTickCount();
  2865. if(AntiCheatInfo[playerid][pACAllow][49])
  2866. {
  2867. if(i < AntiCheatInfo[playerid][pCall][4] + Mtfc[4][0]) return FloodDetect(playerid, 4);
  2868. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2869. else AntiCheatInfo[playerid][pFloodCount][4] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2870. }
  2871. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][4] = i;
  2872. #if !defined _inc_y_hooks\
  2873. && defined ac_OnPlayerClickTextDraw
  2874. return ac_OnPlayerClickTextDraw(playerid, clickedid);
  2875. #else
  2876. return 1;
  2877. #endif
  2878. }
  2879. #if !defined _inc_y_hooks
  2880. #if defined _ALS_OnPlayerClickTextDraw
  2881. #undef OnPlayerClickTextDraw
  2882. #else
  2883. #define _ALS_OnPlayerClickTextDraw
  2884. #endif
  2885. #define OnPlayerClickTextDraw ac_OnPlayerClickTextDraw
  2886. #if defined ac_OnPlayerClickTextDraw
  2887. forward ac_OnPlayerClickTextDraw(playerid, Text:clickedid);
  2888. #endif
  2889. #endif
  2890. #if defined _inc_y_hooks
  2891. Hook:ac_OnPlayerCommandText(playerid, cmdtext[])
  2892. #else
  2893. public OnPlayerCommandText(playerid, cmdtext[])
  2894. #endif
  2895. {
  2896. if(AntiCheatInfo[playerid][pKicked]) return 1;
  2897. new i = GetTickCount();
  2898. if(AntiCheatInfo[playerid][pACAllow][49])
  2899. {
  2900. if(i < AntiCheatInfo[playerid][pCall][5] + Mtfc[5][0])
  2901. {
  2902. FloodDetect(playerid, 5);
  2903. return 1;
  2904. }
  2905. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2906. else AntiCheatInfo[playerid][pFloodCount][5] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2907. }
  2908. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][5] = i;
  2909. #if !defined _inc_y_hooks\
  2910. && defined ac_OnPlayerCommandText
  2911. return ac_OnPlayerCommandText(playerid, cmdtext);
  2912. #else
  2913. return 0;
  2914. #endif
  2915. }
  2916. #if !defined _inc_y_hooks
  2917. #if defined _ALS_OnPlayerCommandText
  2918. #undef OnPlayerCommandText
  2919. #else
  2920. #define _ALS_OnPlayerCommandText
  2921. #endif
  2922. #define OnPlayerCommandText ac_OnPlayerCommandText
  2923. #if defined ac_OnPlayerCommandText
  2924. forward ac_OnPlayerCommandText(playerid, cmdtext[]);
  2925. #endif
  2926. #endif
  2927. #if defined _inc_y_hooks
  2928. Hook:ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  2929. #else
  2930. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  2931. #endif
  2932. {
  2933. if(!IsPlayerConnected(playerid)
  2934. || AntiCheatInfo[playerid][pKicked]) return 0;
  2935. new bool:ur;
  2936. if(!IsPlayerNPC(playerid))
  2937. {
  2938. new i = GetTickCount();
  2939. if(AntiCheatInfo[playerid][pACAllow][49])
  2940. {
  2941. if(i < AntiCheatInfo[playerid][pCall][6] + Mtfc[6][0]) return FloodDetect(playerid, 6);
  2942. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2943. else AntiCheatInfo[playerid][pFloodCount][6] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2944. }
  2945. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][6] = i;
  2946. i = GetVehicleModel(vehicleid);
  2947. if(AntiCheatInfo[playerid][pACAllow][44]
  2948. && i == -1) return KickWithCode(playerid, "", 0, 44, 1);
  2949. new Float:TmpPos[3];
  2950. GetVehiclePos(vehicleid, TmpPos[0], TmpPos[1], TmpPos[2]);
  2951. TmpPos[0] = VectorSize(AntiCheatInfo[playerid][pPos][0]
  2952. - TmpPos[0], AntiCheatInfo[playerid][pPos][1] - TmpPos[1],
  2953. AntiCheatInfo[playerid][pPos][2] - TmpPos[2]);
  2954. if(AntiCheatInfo[playerid][pACAllow][4] && (!(i == 577 || i == 592) && TmpPos[0] >
  2955. 15.0 || TmpPos[0] > 40.0)) return KickWithCode(playerid, "", 0, 4, 3);
  2956. if(AntiCheatInfo[playerid][pEnterVeh] == vehicleid) ur = true;
  2957. else
  2958. {
  2959. new TmpPrm1, TmpPrm2;
  2960. GetVehicleParamsEx(vehicleid, TmpPrm2, TmpPrm2,
  2961. TmpPrm2, TmpPrm1, TmpPrm2, TmpPrm2, TmpPrm2);
  2962. if(TmpPrm1)
  2963. {
  2964. AntiCheatInfo[playerid][pEnterVeh] = vehicleid;
  2965. if(VehicleTypes[i-400] == 3) AntiCheatInfo[playerid][pEnterVehTime] = 0, ur = true;
  2966. }
  2967. }
  2968. }
  2969. if(!ur) AntiCheatInfo[playerid][pEnterVehTime] = AntiCheatInfo[playerid][pCall][27];
  2970. #if !defined _inc_y_hooks\
  2971. && defined ac_OnPlayerEnterVehicle
  2972. return ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  2973. #else
  2974. return 1;
  2975. #endif
  2976. }
  2977. #if !defined _inc_y_hooks
  2978. #if defined _ALS_OnPlayerEnterVehicle
  2979. #undef OnPlayerEnterVehicle
  2980. #else
  2981. #define _ALS_OnPlayerEnterVehicle
  2982. #endif
  2983. #define OnPlayerEnterVehicle ac_OnPlayerEnterVehicle
  2984. #if defined ac_OnPlayerEnterVehicle
  2985. forward ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  2986. #endif
  2987. #endif
  2988. #if defined _inc_y_hooks
  2989. Hook:ac_OnPlayerExitVehicle(playerid, vehicleid)
  2990. #else
  2991. public OnPlayerExitVehicle(playerid, vehicleid)
  2992. #endif
  2993. {
  2994. if(!IsPlayerConnected(playerid)
  2995. || AntiCheatInfo[playerid][pKicked]) return 0;
  2996. new i = GetTickCount();
  2997. if(!IsPlayerNPC(playerid) && AntiCheatInfo[playerid][pACAllow][49])
  2998. {
  2999. if(i < AntiCheatInfo[playerid][pCall][7] + Mtfc[7][0]) return FloodDetect(playerid, 7);
  3000. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3001. else AntiCheatInfo[playerid][pFloodCount][7] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3002. }
  3003. switch(GetVehicleModel(AntiCheatInfo[playerid][pVeh]))
  3004. {
  3005. case 417, 425, 447, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520,
  3006. 548, 553, 563, 577, 592, 593: AntiCheatInfo[playerid][pParachute] = true;
  3007. default: AntiCheatInfo[playerid][pParachute] = false;
  3008. }
  3009. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][7] = i;
  3010. #if !defined _inc_y_hooks\
  3011. && defined ac_OnPlayerExitVehicle
  3012. return ac_OnPlayerExitVehicle(playerid, vehicleid);
  3013. #else
  3014. return 1;
  3015. #endif
  3016. }
  3017. #if !defined _inc_y_hooks
  3018. #if defined _ALS_OnPlayerExitVehicle
  3019. #undef OnPlayerExitVehicle
  3020. #else
  3021. #define _ALS_OnPlayerExitVehicle
  3022. #endif
  3023. #define OnPlayerExitVehicle ac_OnPlayerExitVehicle
  3024. #if defined ac_OnPlayerExitVehicle
  3025. forward ac_OnPlayerExitVehicle(playerid, vehicleid);
  3026. #endif
  3027. #endif
  3028. #if defined OnPlayerPickUpDynamicPickup\
  3029. && defined IsValidDynamicPickup
  3030. #if defined _inc_y_hooks
  3031. Hook:ac_OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP pickupid)
  3032. #else
  3033. public OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP pickupid)
  3034. #endif
  3035. {
  3036. if(!IsPlayerConnected(playerid) || AntiCheatInfo[playerid][pKicked]
  3037. || !IsValidDynamicPickup(pickupid)) return 0;
  3038. new i = GetTickCount();
  3039. if(AntiCheatInfo[playerid][pACAllow][49])
  3040. {
  3041. if(i < AntiCheatInfo[playerid][pCall][8] + Mtfc[8][0]) FloodDetect(playerid, 8);
  3042. else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3043. else AntiCheatInfo[playerid][pFloodCount][8] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3044. }
  3045. if(AntiCheatInfo[playerid][pACAllow][6] && !IsPlayerInRangeOfPoint(playerid, 5.0,
  3046. AntiCheatPickInfo[pickupid][pPos][0], AntiCheatPickInfo[pickupid][pPos][1],
  3047. AntiCheatPickInfo[pickupid][pPos][2])) return KickWithCode(playerid, "", 0, 6, 2);
  3048. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][8] = i;
  3049. switch(AntiCheatPickInfo[pickupid][pType])
  3050. {
  3051. case 1:
  3052. {
  3053. i = WeaponSlots[AntiCheatPickInfo[pickupid][pWeapon]];
  3054. if(AntiCheatInfo[playerid][pWeapon][i] ==
  3055. AntiCheatPickInfo[pickupid][pWeapon]) AntiCheatInfo[playerid][pAmmo][i] +=
  3056. PickupAmmo[AntiCheatPickInfo[pickupid][pWeapon]];
  3057. }
  3058. case 2: AntiCheatInfo[playerid][pSpecAct] = 2;
  3059. case 3: AntiCheatInfo[playerid][pHealth] = 100;
  3060. case 4: AntiCheatInfo[playerid][pArmour] = 100;
  3061. }
  3062. AntiCheatInfo[playerid][pLastPickup] = pickupid;
  3063. AntiCheatInfo[playerid][pPicked] = true;
  3064. #if !defined _inc_y_hooks\
  3065. && defined ac_OnPlayerPickUpDynamicPickup
  3066. return ac_OnPlayerPickUpDynamicPickup(playerid, pickupid);
  3067. #else
  3068. return 1;
  3069. #endif
  3070. }
  3071. #if !defined _inc_y_hooks
  3072. #if defined _ALS_OnPlayerPick\
  3073. UpDynamicPickup
  3074. #undef OnPlayerPickUpDynamicPickup
  3075. #else
  3076. #define _ALS_OnPlayerPickUpDynamicPickup
  3077. #endif
  3078. #define OnPlayerPickUpDynamicPickup ac_OnPlayerPickUpDynamicPickup
  3079. #if defined ac_OnPlayerPickUpDynamicPickup
  3080. forward ac_OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP pickupid);
  3081. #endif
  3082. #endif
  3083. #endif
  3084. #if defined _inc_y_hooks
  3085. Hook:ac_OnPlayerPickUpPickup(playerid, pickupid)
  3086. #else
  3087. public OnPlayerPickUpPickup(playerid, pickupid)
  3088. #endif
  3089. {
  3090. if(!IsPlayerConnected(playerid)
  3091. || AntiCheatInfo[playerid][pKicked]) return 0;
  3092. if(!AntiCheatInfo[playerid][pPicked])
  3093. {
  3094. new i = GetTickCount();
  3095. if(AntiCheatInfo[playerid][pACAllow][49])
  3096. {
  3097. if(i < AntiCheatInfo[playerid][pCall][8] + Mtfc[8][0]) FloodDetect(playerid, 8);
  3098. else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3099. else AntiCheatInfo[playerid][pFloodCount][8] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3100. }
  3101. if(AntiCheatInfo[playerid][pACAllow][6]
  3102. && (!(-1 < pickupid < MAX_PICKUPS) || !IsPlayerInRangeOfPoint(playerid,
  3103. 5.0, AntiCheatPickInfo[pickupid][pPos][0], AntiCheatPickInfo[pickupid][pPos][1],
  3104. AntiCheatPickInfo[pickupid][pPos][2]))) return KickWithCode(playerid, "", 0, 6, 1);
  3105. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][8] = i;
  3106. switch(AntiCheatPickInfo[pickupid][pType])
  3107. {
  3108. case 1:
  3109. {
  3110. i = WeaponSlots[AntiCheatPickInfo[pickupid][pWeapon]];
  3111. if(AntiCheatInfo[playerid][pWeapon][i] ==
  3112. AntiCheatPickInfo[pickupid][pWeapon]) AntiCheatInfo[playerid][pAmmo][i] +=
  3113. PickupAmmo[AntiCheatPickInfo[pickupid][pWeapon]];
  3114. }
  3115. case 2: AntiCheatInfo[playerid][pSpecAct] = 2;
  3116. case 3: AntiCheatInfo[playerid][pHealth] = 100;
  3117. case 4: AntiCheatInfo[playerid][pArmour] = 100;
  3118. }
  3119. AntiCheatInfo[playerid][pLastPickup] = pickupid;
  3120. }
  3121. else AntiCheatInfo[playerid][pPicked] = false;
  3122. #if !defined _inc_y_hooks\
  3123. && defined ac_OnPlayerPickUpPickup
  3124. if(!AntiCheatPickInfo[pickupid][pIsStatic]) return ac_OnPlayerPickUpPickup(playerid, pickupid);
  3125. return 1;
  3126. #else
  3127. return 1;
  3128. #endif
  3129. }
  3130. #if !defined _inc_y_hooks
  3131. #if defined _ALS_OnPlayerPickUpPickup
  3132. #undef OnPlayerPickUpPickup
  3133. #else
  3134. #define _ALS_OnPlayerPickUpPickup
  3135. #endif
  3136. #define OnPlayerPickUpPickup ac_OnPlayerPickUpPickup
  3137. #if defined ac_OnPlayerPickUpPickup
  3138. forward ac_OnPlayerPickUpPickup(playerid, pickupid);
  3139. #endif
  3140. #endif
  3141. #if defined _inc_y_hooks
  3142. Hook:ac_OnPlayerRequestClass(playerid, classid)
  3143. #else
  3144. public OnPlayerRequestClass(playerid, classid)
  3145. #endif
  3146. {
  3147. if(AntiCheatInfo[playerid][pKicked]) return 0;
  3148. new i = GetTickCount();
  3149. if(AntiCheatInfo[playerid][pACAllow][49])
  3150. {
  3151. if(i < AntiCheatInfo[playerid][pCall][9] + Mtfc[9][0]) return FloodDetect(playerid, 9);
  3152. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3153. else AntiCheatInfo[playerid][pFloodCount][9] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3154. }
  3155. AntiCheatInfo[playerid][pClassid] = classid;
  3156. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][9] = i;
  3157. #if !defined _inc_y_hooks\
  3158. && defined ac_OnPlayerRequestClass
  3159. return ac_OnPlayerRequestClass(playerid, classid);
  3160. #else
  3161. return 1;
  3162. #endif
  3163. }
  3164. #if !defined _inc_y_hooks
  3165. #if defined _ALS_OnPlayerRequestClass
  3166. #undef OnPlayerRequestClass
  3167. #else
  3168. #define _ALS_OnPlayerRequestClass
  3169. #endif
  3170. #define OnPlayerRequestClass ac_OnPlayerRequestClass
  3171. #if defined ac_OnPlayerRequestClass
  3172. forward ac_OnPlayerRequestClass(playerid, classid);
  3173. #endif
  3174. #endif
  3175. #if defined _inc_y_hooks
  3176. Hook:ac_OnPlayerSelectedMenuRow(playerid, row)
  3177. #else
  3178. public OnPlayerSelectedMenuRow(playerid, row)
  3179. #endif
  3180. {
  3181. if(!IsPlayerConnected(playerid)
  3182. || AntiCheatInfo[playerid][pKicked]) return 0;
  3183. new i = GetTickCount();
  3184. if(AntiCheatInfo[playerid][pACAllow][49])
  3185. {
  3186. if(i < AntiCheatInfo[playerid][pCall][10] + Mtfc[10][0]) FloodDetect(playerid, 10);
  3187. else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3188. else AntiCheatInfo[playerid][pFloodCount][10] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3189. }
  3190. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][10] = i;
  3191. #if !defined _inc_y_hooks\
  3192. && defined ac_OnPlayerSelectedMenuRow
  3193. return ac_OnPlayerSelectedMenuRow(playerid, row);
  3194. #else
  3195. return 1;
  3196. #endif
  3197. }
  3198. #if !defined _inc_y_hooks
  3199. #if defined _ALS_OnPlayerSelectedMenuRow
  3200. #undef OnPlayerSelectedMenuRow
  3201. #else
  3202. #define _ALS_OnPlayerSelectedMenuRow
  3203. #endif
  3204. #define OnPlayerSelectedMenuRow ac_OnPlayerSelectedMenuRow
  3205. #if defined ac_OnPlayerSelectedMenuRow
  3206. forward ac_OnPlayerSelectedMenuRow(playerid, row);
  3207. #endif
  3208. #endif
  3209. #if defined _inc_y_hooks
  3210. Hook:ac_OnPlayerStateChange(playerid, newstate, oldstate)
  3211. #else
  3212. public OnPlayerStateChange(playerid, newstate, oldstate)
  3213. #endif
  3214. {
  3215. if(AntiCheatInfo[playerid][pKicked]) return 0;
  3216. new i = GetTickCount(), bool:ur;
  3217. if(!IsPlayerNPC(playerid))
  3218. {
  3219. if(AntiCheatInfo[playerid][pACAllow][49])
  3220. {
  3221. if(i < AntiCheatInfo[playerid][pCall][11] + Mtfc[11][0])
  3222. {
  3223. if(newstate != 1 || oldstate != 8) FloodDetect(playerid, 11);
  3224. }
  3225. else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3226. else AntiCheatInfo[playerid][pFloodCount][11] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3227. }
  3228. if(1 < oldstate < 4)
  3229. {
  3230. switch(oldstate)
  3231. {
  3232. case 2:
  3233. {
  3234. if(AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver] ==
  3235. playerid) AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver] = 65535;
  3236. if(GetVehicleModel(AntiCheatInfo[playerid][pVeh]) == 457
  3237. && !AntiCheatInfo[playerid][pWeapon][1]) AntiCheatInfo[playerid][pWeapon][1] = 2;
  3238. AntiCheatInfo[playerid][pVehDmgRes] = false;
  3239. }
  3240. case 3:
  3241. {
  3242. if(AntiCheatInfo[playerid][pACAllow][2]
  3243. && newstate == 1 && !IsPlayerInRangeOfPoint(playerid, 15.0,
  3244. AntiCheatInfo[playerid][pPos][0], AntiCheatInfo[playerid][pPos][1],
  3245. AntiCheatInfo[playerid][pPos][2]) && !(AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver]
  3246. != 65535 && i > AntiCheatInfo[AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver]][pLastUpdate]
  3247. + 2000)) KickWithCode(playerid, "", 0, 2, 4);
  3248. }
  3249. }
  3250. new Float:TmpVel[3];
  3251. GetPlayerVelocity(playerid, TmpVel[0], TmpVel[1], TmpVel[2]);
  3252. AntiCheatInfo[playerid][pSpeed] = GetSpeed(TmpVel[0],TmpVel[1],TmpVel[2]);
  3253. ur = true;
  3254. }
  3255. switch(newstate)
  3256. {
  3257. case 1:
  3258. {
  3259. AntiCheatInfo[playerid][pSet][11] = -1;
  3260. AntiCheatInfo[playerid][pEnterVeh] = 0;
  3261. GetPlayerPos(playerid, AntiCheatInfo[playerid][pPos][0],
  3262. AntiCheatInfo[playerid][pPos][1], AntiCheatInfo[playerid][pPos][2]);
  3263. }
  3264. case 2:
  3265. {
  3266. i = GetPlayerVehicleID(playerid);
  3267. if(AntiCheatInfo[playerid][pACAllow][44])
  3268. {
  3269. new seatid;
  3270. if((seatid = GetPlayerVehicleSeat(playerid)) != 128)
  3271. {
  3272. new model = GetVehicleModel(i) - 400;
  3273. if(seatid || model < 0 || MaxPassengers[model >>> 3] >>> ((model & 7) << 2) & 0xF == 15
  3274. && AntiCheatInfo[playerid][pSet][9] == -1) KickWithCode(playerid, "", 0, 44, 2);
  3275. }
  3276. }
  3277. if(AntiCheatInfo[playerid][pSet][9] == -1)
  3278. {
  3279. AntiCheatVehInfo[i][vDriver] = playerid;
  3280. GetVehicleZAngle(i, AntiCheatVehInfo[i][vZAngle]);
  3281. GetPlayerPos(playerid, AntiCheatInfo[playerid][pPos][0],
  3282. AntiCheatInfo[playerid][pPos][1], AntiCheatInfo[playerid][pPos][2]);
  3283. AntiCheatInfo[playerid][pSetVehHealth] = -1;
  3284. }
  3285. }
  3286. case 3:
  3287. {
  3288. AntiCheatInfo[playerid][pCheatCount][4] = 0;
  3289. if(AntiCheatInfo[playerid][pACAllow][44] && (i = GetPlayerVehicleSeat(playerid)) != 128)
  3290. {
  3291. if(GetVehicleModel(GetPlayerVehicleID(playerid)) ==
  3292. -1) KickWithCode(playerid, "", 0, 44, 3);
  3293. else
  3294. {
  3295. new model = (MaxPassengers[model >>> 3] >>> ((model & 7) << 2)) & 0xF;
  3296. if(i < 1 || (model == 15 || i > model)
  3297. && AntiCheatInfo[playerid][pSet][9] ==
  3298. -1) KickWithCode(playerid, "", 0, 44, 4);
  3299. }
  3300. }
  3301. }
  3302. case 9:
  3303. {
  3304. if(AntiCheatInfo[playerid][pACAllow][21]
  3305. && AntiCheatInfo[playerid][pSet][6] ==
  3306. -1) KickWithCode(playerid, "", 0, 21);
  3307. AntiCheatInfo[playerid][pSet][6] = -1;
  3308. AntiCheatInfo[playerid][pSpawnRes] = true;
  3309. AntiCheatInfo[playerid][pSpawnTime] = 0;
  3310. }
  3311. }
  3312. }
  3313. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][11] = GetTickCount();
  3314. if(ur) AntiCheatInfo[playerid][pGtc][10] = AntiCheatInfo[playerid][pCall][27];
  3315. #if !defined _inc_y_hooks\
  3316. && defined ac_OnPlayerStateChange
  3317. return ac_OnPlayerStateChange(playerid, newstate, oldstate);
  3318. #else
  3319. return 1;
  3320. #endif
  3321. }
  3322. #if !defined _inc_y_hooks
  3323. #if defined _ALS_OnPlayerStateChange
  3324. #undef OnPlayerStateChange
  3325. #else
  3326. #define _ALS_OnPlayerStateChange
  3327. #endif
  3328. #define OnPlayerStateChange ac_OnPlayerStateChange
  3329. #if defined ac_OnPlayerStateChange
  3330. forward ac_OnPlayerStateChange(playerid, newstate, oldstate);
  3331. #endif
  3332. #endif
  3333. #if defined _inc_y_hooks
  3334. Hook:ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  3335. #else
  3336. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  3337. #endif
  3338. {
  3339. if(AntiCheatInfo[playerid][pKicked]) return 0;
  3340. static i, bool:ur, bool:ur2;
  3341. i = GetTickCount();
  3342. ur = ur2 = false;
  3343. if(!IsPlayerNPC(playerid))
  3344. {
  3345. if(AntiCheatInfo[playerid][pACAllow][22]
  3346. && !LagCompMode) return KickWithCode(playerid, "", 0, 22);
  3347. if(AntiCheatInfo[playerid][pACAllow][34] && i >
  3348. AntiCheatInfo[playerid][pLastUpdate] + 3000)
  3349. {
  3350. if(++AntiCheatInfo[playerid][pCheatCount][5] >
  3351. MAX_AFK_GHOST_WARNINGS) return KickWithCode(playerid, "", 0, 34);
  3352. #undef MAX_AFK_GHOST_WARNINGS
  3353. }
  3354. else AntiCheatInfo[playerid][pCheatCount][5] = 0;
  3355. if(AntiCheatInfo[playerid][pACAllow][29] && hittype == 1 && i <
  3356. AntiCheatInfo[hitid][pLastUpdate] + 1500 && !IsPlayerInAnyVehicle(hitid)
  3357. && GetPlayerSurfingVehicleID(hitid) == 65535 && GetPlayerSurfingObjectID(hitid) == 65535)
  3358. {
  3359. static Float:fPos[4];
  3360. GetPlayerLastShotVectors(playerid, fPos[3], fPos[3], fPos[3], fPos[0], fPos[1], fPos[2]);
  3361. if(!IsPlayerInRangeOfPoint(hitid, 5.0, fPos[0], fPos[1], fPos[2]))
  3362. {
  3363. if(++AntiCheatInfo[playerid][pCheatCount][6] >
  3364. MAX_PRO_AIM_WARNINGS) return KickWithCode(playerid, "", 0, 29);
  3365. #undef MAX_PRO_AIM_WARNINGS
  3366. }
  3367. else AntiCheatInfo[playerid][pCheatCount][6] = 0;
  3368. }
  3369. else AntiCheatInfo[playerid][pCheatCount][6] = 0;
  3370. switch(hittype)
  3371. {
  3372. case 1:
  3373. {
  3374. if(AntiCheatInfo[playerid][pACAllow][19]
  3375. && AntiCheatInfo[hitid][pFreeze]
  3376. && i > AntiCheatInfo[hitid][pGtc][14]
  3377. + GetPlayerPing(hitid) + 100)
  3378. {
  3379. static t, j;
  3380. t = GetPlayerTeam(playerid);
  3381. j = GetPlayerInterior(hitid);
  3382. if((t == 255 || t != GetPlayerTeam(hitid))
  3383. && !IsPlayerInRestaurant(hitid, j)
  3384. && !IsPlayerInAmmuNation(hitid, j)
  3385. && !IsPlayerInCasino(hitid, j))
  3386. {
  3387. if(AntiCheatInfo[hitid][pArmour]) AntiCheatInfo[hitid][pDmgRes] = 2;
  3388. else AntiCheatInfo[hitid][pDmgRes] = 1;
  3389. AntiCheatInfo[hitid][pCheatCount][9] = 0;
  3390. ur = true;
  3391. }
  3392. }
  3393. }
  3394. case 2:
  3395. {
  3396. if(AntiCheatInfo[playerid][pACAllow][20]
  3397. && AntiCheatVehInfo[hitid][vDriver] != 65535
  3398. && AntiCheatInfo[AntiCheatVehInfo[hitid][vDriver]][pFreeze])
  3399. {
  3400. static t;
  3401. t = GetPlayerTeam(playerid);
  3402. if(!VehFriendlyFire || t == 255
  3403. || t != GetPlayerTeam(AntiCheatVehInfo[hitid][vDriver]))
  3404. {
  3405. AntiCheatInfo[AntiCheatVehInfo[hitid][vDriver]][pCheatCount][11] = 0;
  3406. ur2 = true;
  3407. }
  3408. }
  3409. }
  3410. }
  3411. static s;
  3412. s = GetPlayerState(playerid);
  3413. if(s != 2)
  3414. {
  3415. if(AntiCheatInfo[playerid][pACAllow][47] && (s != 3 && GetPlayerWeapon(playerid) != weaponid
  3416. || weaponid != 38 && !(21 < weaponid < 35))) return KickWithCode(playerid, "", 0, 47, 2);
  3417. i -= AntiCheatInfo[playerid][pShotTime];
  3418. if(AntiCheatInfo[playerid][pShot])
  3419. {
  3420. if(AntiCheatInfo[playerid][pACAllow][26] && weaponid != 38)
  3421. {
  3422. if(weaponid == 28 || weaponid == 32)
  3423. {
  3424. if(i < 30 && ++AntiCheatInfo[playerid][pCheatCount][8] >
  3425. MAX_RAPID_FIRE_WARNINGS) return KickWithCode(playerid, "", 0, 26, 1);
  3426. }
  3427. else if(i < 70 || 32 < weaponid < 35 && i < 386)
  3428. {
  3429. if(++AntiCheatInfo[playerid][pCheatCount][8] >
  3430. MAX_RAPID_FIRE_WARNINGS) return KickWithCode(playerid, "", 0, 26, 2);
  3431. }
  3432. else AntiCheatInfo[playerid][pCheatCount][8] = 0;
  3433. }
  3434. }
  3435. else
  3436. {
  3437. if(AntiCheatInfo[playerid][pACAllow][26] && i <
  3438. 30) return KickWithCode(playerid, "", 0, 26, 3);
  3439. AntiCheatInfo[playerid][pCheatCount][8] = 0;
  3440. AntiCheatInfo[playerid][pShot] = true;
  3441. }
  3442. if(AntiCheatInfo[playerid][pACAllow][17])
  3443. {
  3444. if(!AntiCheatInfo[playerid][pAmmo][WeaponSlots[weaponid]]) return KickWithCode(playerid, "", 0, 17, 1);
  3445. if((i = abs(AntiCheatInfo[playerid][pAmmo][WeaponSlots[weaponid]] - GetPlayerAmmo(playerid))))
  3446. {
  3447. switch(weaponid)
  3448. {
  3449. case 26:
  3450. {
  3451. if(i > 2 || ++AntiCheatInfo[playerid][pCheatCount][7] >
  3452. 2) return KickWithCode(playerid, "", 0, 17, 2);
  3453. }
  3454. case 22, 29..31:
  3455. {
  3456. if(i > 1 || ++AntiCheatInfo[playerid][pCheatCount][7] >
  3457. 1) return KickWithCode(playerid, "", 0, 17, 3);
  3458. }
  3459. case 28, 32:
  3460. {
  3461. if(i > 8) return KickWithCode(playerid, "", 0, 17, 4);
  3462. }
  3463. case 38:
  3464. {
  3465. if(++AntiCheatInfo[playerid][pCheatCount][7] >
  3466. 6) return KickWithCode(playerid, "", 0, 17, 5);
  3467. }
  3468. default: return KickWithCode(playerid, "", 0, 17, 6);
  3469. }
  3470. }
  3471. else AntiCheatInfo[playerid][pCheatCount][7] = 0;
  3472. }
  3473. AntiCheatInfo[playerid][pAmmo][WeaponSlots[weaponid]]--;
  3474. if(AntiCheatInfo[playerid][pAmmo][WeaponSlots[weaponid]] <
  3475. -32768) AntiCheatInfo[playerid][pAmmo][WeaponSlots[weaponid]] += 65536;
  3476. else if(!AntiCheatInfo[playerid][pAmmo][WeaponSlots[weaponid]]
  3477. && AntiCheatInfo[playerid][pSet][3] == weaponid) AntiCheatInfo[playerid][pSet][3] =
  3478. AntiCheatInfo[playerid][pSetWeapon][WeaponSlots[weaponid]] = -1;
  3479. }
  3480. }
  3481. i = 1;
  3482. #if !defined _inc_y_hooks\
  3483. && defined ac_OnPlayerWeaponShot
  3484. i = ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
  3485. #endif
  3486. AntiCheatInfo[playerid][pShotTime] = GetTickCount();
  3487. if(i)
  3488. {
  3489. if(ur) AntiCheatInfo[hitid][pGtc][14] = AntiCheatInfo[playerid][pShotTime];
  3490. if(ur2)
  3491. {
  3492. AntiCheatInfo[AntiCheatVehInfo[hitid][vDriver]][pVehDmgRes] = true;
  3493. AntiCheatInfo[AntiCheatVehInfo[hitid][vDriver]][pGtc][16] =
  3494. AntiCheatInfo[playerid][pShotTime];
  3495. }
  3496. }
  3497. return i;
  3498. }
  3499. #if !defined _inc_y_hooks
  3500. #if defined _ALS_OnPlayerWeaponShot
  3501. #undef OnPlayerWeaponShot
  3502. #else
  3503. #define _ALS_OnPlayerWeaponShot
  3504. #endif
  3505. #define OnPlayerWeaponShot ac_OnPlayerWeaponShot
  3506. #if defined ac_OnPlayerWeaponShot
  3507. forward ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
  3508. #endif
  3509. #endif
  3510. #if defined _inc_y_hooks
  3511. Hook:ac_OnVehicleMod(playerid, vehicleid, componentid)
  3512. #else
  3513. public OnVehicleMod(playerid, vehicleid, componentid)
  3514. #endif
  3515. {
  3516. if(AntiCheatInfo[playerid][pKicked]) return 0;
  3517. new i = GetTickCount();
  3518. if(AntiCheatInfo[playerid][pACAllow][49])
  3519. {
  3520. if(i < AntiCheatInfo[playerid][pCall][12] + Mtfc[12][0]) FloodDetect(playerid, 12);
  3521. else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3522. else AntiCheatInfo[playerid][pFloodCount][12] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3523. }
  3524. if(AntiCheatInfo[playerid][pACAllow][23] && !AntiCheatInfo[playerid][pModShop]) return KickWithCode(playerid, "", 0, 23, 2);
  3525. if(AntiCheatInfo[playerid][pACAllow][43] && !IsComponentidCompatible(GetVehicleModel(vehicleid),
  3526. componentid)) return KickWithCode(playerid, "", 0, 43, 1);
  3527. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][12] = i;
  3528. #if !defined _inc_y_hooks\
  3529. && defined ac_OnVehicleMod
  3530. return ac_OnVehicleMod(playerid, vehicleid, componentid);
  3531. #else
  3532. return 1;
  3533. #endif
  3534. }
  3535. #if !defined _inc_y_hooks
  3536. #if defined _ALS_OnVehicleMod
  3537. #undef OnVehicleMod
  3538. #else
  3539. #define _ALS_OnVehicleMod
  3540. #endif
  3541. #define OnVehicleMod ac_OnVehicleMod
  3542. #if defined ac_OnVehicleMod
  3543. forward ac_OnVehicleMod(playerid, vehicleid, componentid);
  3544. #endif
  3545. #endif
  3546. #if defined _inc_y_hooks
  3547. Hook:ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  3548. #else
  3549. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  3550. #endif
  3551. {
  3552. if(AntiCheatInfo[playerid][pKicked]) return 0;
  3553. new i = GetTickCount();
  3554. if(AntiCheatInfo[playerid][pACAllow][49])
  3555. {
  3556. if(i < AntiCheatInfo[playerid][pCall][13] + Mtfc[13][0]) FloodDetect(playerid, 13);
  3557. else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3558. else AntiCheatInfo[playerid][pFloodCount][13] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3559. }
  3560. if(AntiCheatInfo[playerid][pACAllow][23] && !AntiCheatInfo[playerid][pModShop]) KickWithCode(playerid, "", 0, 23, 3);
  3561. else if(AntiCheatInfo[playerid][pACAllow][43] && !(-1 < paintjobid < 3)) KickWithCode(playerid, "", 0, 43, 2);
  3562. else AntiCheatVehInfo[vehicleid][vPaintJob] = paintjobid;
  3563. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][13] = i;
  3564. #if !defined _inc_y_hooks\
  3565. && defined ac_OnVehiclePaintjob
  3566. return ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  3567. #else
  3568. return 1;
  3569. #endif
  3570. }
  3571. #if !defined _inc_y_hooks
  3572. #if defined _ALS_OnVehiclePaintjob
  3573. #undef OnVehiclePaintjob
  3574. #else
  3575. #define _ALS_OnVehiclePaintjob
  3576. #endif
  3577. #define OnVehiclePaintjob ac_OnVehiclePaintjob
  3578. #if defined ac_OnVehiclePaintjob
  3579. forward ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  3580. #endif
  3581. #endif
  3582. #if defined _inc_y_hooks
  3583. Hook:ac_OnVehicleRespray(playerid, vehicleid, color1, color2)
  3584. #else
  3585. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  3586. #endif
  3587. {
  3588. if(AntiCheatInfo[playerid][pKicked]) return 0;
  3589. new i = GetTickCount();
  3590. if(AntiCheatInfo[playerid][pACAllow][49])
  3591. {
  3592. if(i < AntiCheatInfo[playerid][pCall][14] + Mtfc[14][0]) FloodDetect(playerid, 14);
  3593. else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3594. else AntiCheatInfo[playerid][pFloodCount][14] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3595. }
  3596. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][14] = i;
  3597. #if !defined _inc_y_hooks\
  3598. && defined ac_OnVehicleRespray
  3599. return ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
  3600. #else
  3601. return 1;
  3602. #endif
  3603. }
  3604. #if !defined _inc_y_hooks
  3605. #if defined _ALS_OnVehicleRespray
  3606. #undef OnVehicleRespray
  3607. #else
  3608. #define _ALS_OnVehicleRespray
  3609. #endif
  3610. #define OnVehicleRespray ac_OnVehicleRespray
  3611. #if defined ac_OnVehicleRespray
  3612. forward ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
  3613. #endif
  3614. #endif
  3615. #if defined _inc_y_hooks
  3616. Hook:ac_OnVehicleSpawn(vehicleid)
  3617. #else
  3618. public OnVehicleSpawn(vehicleid)
  3619. #endif
  3620. {
  3621. AntiCheatVehInfo[vehicleid][vPaintJob] = 3;
  3622. AntiCheatVehInfo[vehicleid][vSpawned] = true;
  3623. AntiCheatVehInfo[vehicleid][vHealth] = 1000.0;
  3624. AntiCheatVehInfo[vehicleid][vSpeedDiff] =
  3625. AntiCheatVehInfo[vehicleid][vPosDiff] =
  3626. AntiCheatVehInfo[vehicleid][vVel][0] =
  3627. AntiCheatVehInfo[vehicleid][vVel][1] =
  3628. AntiCheatVehInfo[vehicleid][vVel][2] = 0.0;
  3629. AntiCheatVehInfo[vehicleid][vDriver] = 65535;
  3630. #if !defined _inc_y_hooks\
  3631. && defined ac_OnVehicleSpawn
  3632. return ac_OnVehicleSpawn(vehicleid);
  3633. #else
  3634. return 1;
  3635. #endif
  3636. }
  3637. #if !defined _inc_y_hooks
  3638. #if defined _ALS_OnVehicleSpawn
  3639. #undef OnVehicleSpawn
  3640. #else
  3641. #define _ALS_OnVehicleSpawn
  3642. #endif
  3643. #define OnVehicleSpawn ac_OnVehicleSpawn
  3644. #if defined ac_OnVehicleSpawn
  3645. forward ac_OnVehicleSpawn(vehicleid);
  3646. #endif
  3647. #endif
  3648. #if defined _inc_y_hooks
  3649. Hook:ac_OnVehicleDeath(vehicleid, killerid)
  3650. #else
  3651. public OnVehicleDeath(vehicleid, killerid)
  3652. #endif
  3653. {
  3654. if(killerid != 65535)
  3655. {
  3656. new i = GetTickCount();
  3657. if(AntiCheatInfo[killerid][pACAllow][49])
  3658. {
  3659. if(i < AntiCheatInfo[killerid][pCall][15] + Mtfc[15][0]) FloodDetect(killerid, 15);
  3660. else if(i < AntiCheatInfo[killerid][pCall][27] + Mtfc[27][0]) FloodDetect(killerid, 27);
  3661. else AntiCheatInfo[killerid][pFloodCount][15] = AntiCheatInfo[killerid][pFloodCount][27] = 0;
  3662. }
  3663. AntiCheatInfo[killerid][pCall][27] = AntiCheatInfo[killerid][pCall][15] = i;
  3664. }
  3665. AntiCheatVehInfo[vehicleid][vSpawned] = false;
  3666. #if !defined _inc_y_hooks\
  3667. && defined ac_OnVehicleDeath
  3668. return ac_OnVehicleDeath(vehicleid, killerid);
  3669. #else
  3670. return 1;
  3671. #endif
  3672. }
  3673. #if !defined _inc_y_hooks
  3674. #if defined _ALS_OnVehicleDeath
  3675. #undef OnVehicleDeath
  3676. #else
  3677. #define _ALS_OnVehicleDeath
  3678. #endif
  3679. #define OnVehicleDeath ac_OnVehicleDeath
  3680. #if defined ac_OnVehicleDeath
  3681. forward ac_OnVehicleDeath(vehicleid, killerid);
  3682. #endif
  3683. #endif
  3684. #if defined _inc_y_hooks
  3685. Hook:ac_OnPlayerText(playerid, text[])
  3686. #else
  3687. public OnPlayerText(playerid, text[])
  3688. #endif
  3689. {
  3690. if(AntiCheatInfo[playerid][pKicked]) return 0;
  3691. new i = GetTickCount();
  3692. if(AntiCheatInfo[playerid][pACAllow][49])
  3693. {
  3694. if(i < AntiCheatInfo[playerid][pCall][16] + Mtfc[16][0]) return FloodDetect(playerid, 16);
  3695. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3696. else AntiCheatInfo[playerid][pFloodCount][16] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3697. }
  3698. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][16] = i;
  3699. #if !defined _inc_y_hooks\
  3700. && defined ac_OnPlayerText
  3701. return ac_OnPlayerText(playerid, text);
  3702. #else
  3703. return 1;
  3704. #endif
  3705. }
  3706. #if !defined _inc_y_hooks
  3707. #if defined _ALS_OnPlayerText
  3708. #undef OnPlayerText
  3709. #else
  3710. #define _ALS_OnPlayerText
  3711. #endif
  3712. #define OnPlayerText ac_OnPlayerText
  3713. #if defined ac_OnPlayerText
  3714. forward ac_OnPlayerText(playerid, text[]);
  3715. #endif
  3716. #endif
  3717. #if defined OnPlayerEnterDynamicCP
  3718. #if defined _inc_y_hooks
  3719. Hook:ac_OnPlayerEnterDynamicCP(playerid, STREAMER_TAG_CP checkpointid)
  3720. #else
  3721. public OnPlayerEnterDynamicCP(playerid, STREAMER_TAG_CP checkpointid)
  3722. #endif
  3723. {
  3724. if(AntiCheatInfo[playerid][pKicked]) return 0;
  3725. new i = GetTickCount();
  3726. if(AntiCheatInfo[playerid][pACAllow][49])
  3727. {
  3728. if(i < AntiCheatInfo[playerid][pCall][17] + Mtfc[17][0]) return FloodDetect(playerid, 17);
  3729. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3730. else AntiCheatInfo[playerid][pFloodCount][17] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3731. }
  3732. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][17] = i;
  3733. #if !defined _inc_y_hooks\
  3734. && defined ac_OnPlayerEnterDynamicCP
  3735. return ac_OnPlayerEnterDynamicCP(playerid, checkpointid);
  3736. #else
  3737. return 1;
  3738. #endif
  3739. }
  3740. #if !defined _inc_y_hooks
  3741. #if defined _ALS_OnPlayerEnterDynamicCP
  3742. #undef OnPlayerEnterDynamicCP
  3743. #else
  3744. #define _ALS_OnPlayerEnterDynamicCP
  3745. #endif
  3746. #define OnPlayerEnterDynamicCP ac_OnPlayerEnterDynamicCP
  3747. #if defined ac_OnPlayerEnterDynamicCP
  3748. forward ac_OnPlayerEnterDynamicCP(playerid, STREAMER_TAG_CP checkpointid);
  3749. #endif
  3750. #endif
  3751. #else
  3752. #if defined _inc_y_hooks
  3753. Hook:ac_OnPlayerEnterCheckpoint(playerid)
  3754. #else
  3755. public OnPlayerEnterCheckpoint(playerid)
  3756. #endif
  3757. {
  3758. if(AntiCheatInfo[playerid][pKicked]) return 0;
  3759. new i = GetTickCount();
  3760. if(AntiCheatInfo[playerid][pACAllow][49])
  3761. {
  3762. if(i < AntiCheatInfo[playerid][pCall][17] + Mtfc[17][0]) return FloodDetect(playerid, 17);
  3763. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3764. else AntiCheatInfo[playerid][pFloodCount][17] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3765. }
  3766. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][17] = i;
  3767. #if !defined _inc_y_hooks\
  3768. && defined ac_OnPlayerEnterCheckpoint
  3769. return ac_OnPlayerEnterCheckpoint(playerid);
  3770. #else
  3771. return 1;
  3772. #endif
  3773. }
  3774. #if !defined _inc_y_hooks
  3775. #if defined _ALS_OnPlayerEnterCheckpoint
  3776. #undef OnPlayerEnterCheckpoint
  3777. #else
  3778. #define _ALS_OnPlayerEnterCheckpoint
  3779. #endif
  3780. #define OnPlayerEnterCheckpoint ac_OnPlayerEnterCheckpoint
  3781. #if defined ac_OnPlayerEnterCheckpoint
  3782. forward ac_OnPlayerEnterCheckpoint(playerid);
  3783. #endif
  3784. #endif
  3785. #endif
  3786. #if defined OnPlayerLeaveDynamicCP
  3787. #if defined _inc_y_hooks
  3788. Hook:ac_OnPlayerLeaveDynamicCP(playerid, STREAMER_TAG_CP checkpointid)
  3789. #else
  3790. public OnPlayerLeaveDynamicCP(playerid, STREAMER_TAG_CP checkpointid)
  3791. #endif
  3792. {
  3793. if(AntiCheatInfo[playerid][pKicked]) return 0;
  3794. new i = GetTickCount();
  3795. if(AntiCheatInfo[playerid][pACAllow][49])
  3796. {
  3797. if(i < AntiCheatInfo[playerid][pCall][18] + Mtfc[18][0]) return FloodDetect(playerid, 18);
  3798. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3799. else AntiCheatInfo[playerid][pFloodCount][18] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3800. }
  3801. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][18] = i;
  3802. #if !defined _inc_y_hooks\
  3803. && defined ac_OnPlayerLeaveDynamicCP
  3804. return ac_OnPlayerLeaveDynamicCP(playerid, checkpointid);
  3805. #else
  3806. return 1;
  3807. #endif
  3808. }
  3809. #if !defined _inc_y_hooks
  3810. #if defined _ALS_OnPlayerLeaveDynamicCP
  3811. #undef OnPlayerLeaveDynamicCP
  3812. #else
  3813. #define _ALS_OnPlayerLeaveDynamicCP
  3814. #endif
  3815. #define OnPlayerLeaveDynamicCP ac_OnPlayerLeaveDynamicCP
  3816. #if defined ac_OnPlayerLeaveDynamicCP
  3817. forward ac_OnPlayerLeaveDynamicCP(playerid, STREAMER_TAG_CP checkpointid);
  3818. #endif
  3819. #endif
  3820. #else
  3821. #if defined _inc_y_hooks
  3822. Hook:ac_OnPlayerLeaveCheckpoint(playerid)
  3823. #else
  3824. public OnPlayerLeaveCheckpoint(playerid)
  3825. #endif
  3826. {
  3827. if(AntiCheatInfo[playerid][pKicked]) return 0;
  3828. new i = GetTickCount();
  3829. if(AntiCheatInfo[playerid][pACAllow][49])
  3830. {
  3831. if(i < AntiCheatInfo[playerid][pCall][18] + Mtfc[18][0]) return FloodDetect(playerid, 18);
  3832. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3833. else AntiCheatInfo[playerid][pFloodCount][18] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3834. }
  3835. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][18] = i;
  3836. #if !defined _inc_y_hooks\
  3837. && defined ac_OnPlayerLeaveCheckpoint
  3838. return ac_OnPlayerLeaveCheckpoint(playerid);
  3839. #else
  3840. return 1;
  3841. #endif
  3842. }
  3843. #if !defined _inc_y_hooks
  3844. #if defined _ALS_OnPlayerLeaveCheckpoint
  3845. #undef OnPlayerLeaveCheckpoint
  3846. #else
  3847. #define _ALS_OnPlayerLeaveCheckpoint
  3848. #endif
  3849. #define OnPlayerLeaveCheckpoint ac_OnPlayerLeaveCheckpoint
  3850. #if defined ac_OnPlayerLeaveCheckpoint
  3851. forward ac_OnPlayerLeaveCheckpoint(playerid);
  3852. #endif
  3853. #endif
  3854. #endif
  3855. #if defined _inc_y_hooks
  3856. Hook:ac_OnPlayerRequestSpawn(playerid)
  3857. #else
  3858. public OnPlayerRequestSpawn(playerid)
  3859. #endif
  3860. {
  3861. if(AntiCheatInfo[playerid][pKicked]) return 0;
  3862. new i = GetTickCount();
  3863. if(AntiCheatInfo[playerid][pACAllow][49])
  3864. {
  3865. if(i < AntiCheatInfo[playerid][pCall][19] + Mtfc[19][0]) return FloodDetect(playerid, 19);
  3866. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3867. else AntiCheatInfo[playerid][pFloodCount][19] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3868. }
  3869. AntiCheatInfo[playerid][pSpawnWeapon][0] = Class[AntiCheatInfo[playerid][pClassid]][0][0];
  3870. AntiCheatInfo[playerid][pSpawnAmmo][0] = Class[AntiCheatInfo[playerid][pClassid]][0][1];
  3871. AntiCheatInfo[playerid][pSpawnWeapon][1] = Class[AntiCheatInfo[playerid][pClassid]][1][0];
  3872. AntiCheatInfo[playerid][pSpawnAmmo][1] = Class[AntiCheatInfo[playerid][pClassid]][1][1];
  3873. AntiCheatInfo[playerid][pSpawnWeapon][2] = Class[AntiCheatInfo[playerid][pClassid]][2][0];
  3874. AntiCheatInfo[playerid][pSpawnAmmo][2] = Class[AntiCheatInfo[playerid][pClassid]][2][1];
  3875. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][19] = i;
  3876. i = 1;
  3877. #if !defined _inc_y_hooks\
  3878. && defined ac_OnPlayerRequestSpawn
  3879. i = ac_OnPlayerRequestSpawn(playerid);
  3880. #endif
  3881. if(i) AntiCheatInfo[playerid][pSet][7] = 1;
  3882. return i;
  3883. }
  3884. #if !defined _inc_y_hooks
  3885. #if defined _ALS_OnPlayerRequestSpawn
  3886. #undef OnPlayerRequestSpawn
  3887. #else
  3888. #define _ALS_OnPlayerRequestSpawn
  3889. #endif
  3890. #define OnPlayerRequestSpawn ac_OnPlayerRequestSpawn
  3891. #if defined ac_OnPlayerRequestSpawn
  3892. forward ac_OnPlayerRequestSpawn(playerid);
  3893. #endif
  3894. #endif
  3895. #if defined _inc_y_hooks
  3896. Hook:ac_OnPlayerExitedMenu(playerid)
  3897. #else
  3898. public OnPlayerExitedMenu(playerid)
  3899. #endif
  3900. {
  3901. if(!IsPlayerConnected(playerid)
  3902. || AntiCheatInfo[playerid][pKicked]) return 0;
  3903. new i = GetTickCount();
  3904. if(AntiCheatInfo[playerid][pACAllow][49])
  3905. {
  3906. if(i < AntiCheatInfo[playerid][pCall][20] + Mtfc[20][0]) FloodDetect(playerid, 20);
  3907. else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3908. else AntiCheatInfo[playerid][pFloodCount][20] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3909. }
  3910. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][20] = i;
  3911. #if !defined _inc_y_hooks\
  3912. && defined ac_OnPlayerExitedMenu
  3913. return ac_OnPlayerExitedMenu(playerid);
  3914. #else
  3915. return 1;
  3916. #endif
  3917. }
  3918. #if !defined _inc_y_hooks
  3919. #if defined _ALS_OnPlayerExitedMenu
  3920. #undef OnPlayerExitedMenu
  3921. #else
  3922. #define _ALS_OnPlayerExitedMenu
  3923. #endif
  3924. #define OnPlayerExitedMenu ac_OnPlayerExitedMenu
  3925. #if defined ac_OnPlayerExitedMenu
  3926. forward ac_OnPlayerExitedMenu(playerid);
  3927. #endif
  3928. #endif
  3929. #if defined OnPlayerEnterDynamicRaceCP
  3930. #if defined _inc_y_hooks
  3931. Hook:ac_OnPlayerEnterDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP checkpointid)
  3932. #else
  3933. public OnPlayerEnterDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP checkpointid)
  3934. #endif
  3935. {
  3936. if(AntiCheatInfo[playerid][pKicked]) return 0;
  3937. new i = GetTickCount();
  3938. if(AntiCheatInfo[playerid][pACAllow][49])
  3939. {
  3940. if(i < AntiCheatInfo[playerid][pCall][21] + Mtfc[21][0]) return FloodDetect(playerid, 21);
  3941. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3942. else AntiCheatInfo[playerid][pFloodCount][21] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3943. }
  3944. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][21] = i;
  3945. #if !defined _inc_y_hooks\
  3946. && defined ac_OnPlayerEnterDynamicRaceCP
  3947. return ac_OnPlayerEnterDynamicRaceCP(playerid, checkpointid);
  3948. #else
  3949. return 1;
  3950. #endif
  3951. }
  3952. #if !defined _inc_y_hooks
  3953. #if defined _ALS_OnPlayerEnterDynamicRaceCP
  3954. #undef OnPlayerEnterDynamicRaceCP
  3955. #else
  3956. #define _ALS_OnPlayerEnterDynamicRaceCP
  3957. #endif
  3958. #define OnPlayerEnterDynamicRaceCP ac_OnPlayerEnterDynamicRaceCP
  3959. #if defined ac_OnPlayerEnterDynamicRaceCP
  3960. forward ac_OnPlayerEnterDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP checkpointid);
  3961. #endif
  3962. #endif
  3963. #else
  3964. #if defined _inc_y_hooks
  3965. Hook:ac_OnPlayerEnterRaceCheckpoint(playerid)
  3966. #else
  3967. public OnPlayerEnterRaceCheckpoint(playerid)
  3968. #endif
  3969. {
  3970. if(AntiCheatInfo[playerid][pKicked]) return 0;
  3971. new i = GetTickCount();
  3972. if(AntiCheatInfo[playerid][pACAllow][49])
  3973. {
  3974. if(i < AntiCheatInfo[playerid][pCall][21] + Mtfc[21][0]) return FloodDetect(playerid, 21);
  3975. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3976. else AntiCheatInfo[playerid][pFloodCount][21] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3977. }
  3978. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][21] = i;
  3979. #if !defined _inc_y_hooks\
  3980. && defined ac_OnPlayerEnterRaceCheckpoint
  3981. return ac_OnPlayerEnterRaceCheckpoint(playerid);
  3982. #else
  3983. return 1;
  3984. #endif
  3985. }
  3986. #if !defined _inc_y_hooks
  3987. #if defined _ALS_OnPlayerEnter\
  3988. RaceCheckpoint
  3989. #undef OnPlayerEnterRaceCheckpoint
  3990. #elseif defined _ALS_OnPlayerEnterRaceCP
  3991. #undef OnPlayerEnterRaceCheckpoint
  3992. #else
  3993. #define _ALS_OnPlayerEnterRaceCheckpoint
  3994. #endif
  3995. #define OnPlayerEnterRaceCheckpoint ac_OnPlayerEnterRaceCheckpoint
  3996. #if defined ac_OnPlayerEnterRaceCheckpoint
  3997. forward ac_OnPlayerEnterRaceCheckpoint(playerid);
  3998. #endif
  3999. #endif
  4000. #endif
  4001. #if defined OnPlayerLeaveDynamicRaceCP
  4002. #if defined _inc_y_hooks
  4003. Hook:ac_OnPlayerLeaveDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP checkpointid)
  4004. #else
  4005. public OnPlayerLeaveDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP checkpointid)
  4006. #endif
  4007. {
  4008. if(AntiCheatInfo[playerid][pKicked]) return 0;
  4009. new i = GetTickCount();
  4010. if(AntiCheatInfo[playerid][pACAllow][49])
  4011. {
  4012. if(i < AntiCheatInfo[playerid][pCall][22] + Mtfc[22][0]) return FloodDetect(playerid, 22);
  4013. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  4014. else AntiCheatInfo[playerid][pFloodCount][22] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  4015. }
  4016. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][22] = i;
  4017. #if !defined _inc_y_hooks\
  4018. && defined ac_OnPlayerLeaveDynamicRaceCP
  4019. return ac_OnPlayerLeaveDynamicRaceCP(playerid, checkpointid);
  4020. #else
  4021. return 1;
  4022. #endif
  4023. }
  4024. #if !defined _inc_y_hooks
  4025. #if defined _ALS_OnPlayerLeaveDynamicRaceCP
  4026. #undef OnPlayerLeaveDynamicRaceCP
  4027. #else
  4028. #define _ALS_OnPlayerLeaveDynamicRaceCP
  4029. #endif
  4030. #define OnPlayerLeaveDynamicRaceCP ac_OnPlayerLeaveDynamicRaceCP
  4031. #if defined ac_OnPlayerLeaveDynamicRaceCP
  4032. forward ac_OnPlayerLeaveDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP checkpointid);
  4033. #endif
  4034. #endif
  4035. #else
  4036. #if defined _inc_y_hooks
  4037. Hook:ac_OnPlayerLeaveRaceCheckpoint(playerid)
  4038. #else
  4039. public OnPlayerLeaveRaceCheckpoint(playerid)
  4040. #endif
  4041. {
  4042. if(AntiCheatInfo[playerid][pKicked]) return 0;
  4043. new i = GetTickCount();
  4044. if(AntiCheatInfo[playerid][pACAllow][49])
  4045. {
  4046. if(i < AntiCheatInfo[playerid][pCall][22] + Mtfc[22][0]) return FloodDetect(playerid, 22);
  4047. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  4048. else AntiCheatInfo[playerid][pFloodCount][22] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  4049. }
  4050. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][22] = i;
  4051. #if !defined _inc_y_hooks\
  4052. && defined ac_OnPlayerLeaveRaceCheckpoint
  4053. return ac_OnPlayerLeaveRaceCheckpoint(playerid);
  4054. #else
  4055. return 1;
  4056. #endif
  4057. }
  4058. #if !defined _inc_y_hooks
  4059. #if defined _ALS_OnPlayerLeave\
  4060. RaceCheckpoint
  4061. #undef OnPlayerLeaveRaceCheckpoint
  4062. #elseif defined _ALS_OnPlayerLeaveRaceCP
  4063. #undef OnPlayerLeaveRaceCheckpoint
  4064. #else
  4065. #define _ALS_OnPlayerLeaveRaceCheckpoint
  4066. #endif
  4067. #define OnPlayerLeaveRaceCheckpoint ac_OnPlayerLeaveRaceCheckpoint
  4068. #if defined ac_OnPlayerLeaveRaceCheckpoint
  4069. forward ac_OnPlayerLeaveRaceCheckpoint(playerid);
  4070. #endif
  4071. #endif
  4072. #endif
  4073. #if defined _inc_y_hooks
  4074. Hook:ac_OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  4075. #else
  4076. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  4077. #endif
  4078. {
  4079. if(AntiCheatInfo[playerid][pKicked]) return 0;
  4080. new i = GetTickCount();
  4081. if(AntiCheatInfo[playerid][pACAllow][49])
  4082. {
  4083. if(i < AntiCheatInfo[playerid][pCall][23] + Mtfc[23][0]) return FloodDetect(playerid, 23);
  4084. if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  4085. else AntiCheatInfo[playerid][pFloodCount][23] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  4086. }
  4087. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][23] = i;
  4088. #if !defined _inc_y_hooks\
  4089. && defined ac_OnPlayerClickPlayerTextDraw
  4090. return ac_OnPlayerClickPlayerTextDraw(playerid, playertextid);
  4091. #else
  4092. return 1;
  4093. #endif
  4094. }
  4095. #if !defined _inc_y_hooks
  4096. #if defined _ALS_OnPlayerClick\
  4097. PlayerTextDraw
  4098. #undef OnPlayerClickPlayerTextDraw
  4099. #elseif defined _ALS_OnPlayerClickPlayerTD
  4100. #undef OnPlayerClickPlayerTextDraw
  4101. #else
  4102. #define _ALS_OnPlayerClickPlayerTextDraw
  4103. #endif
  4104. #define OnPlayerClickPlayerTextDraw ac_OnPlayerClickPlayerTextDraw
  4105. #if defined ac_OnPlayerClickPlayerTextDraw
  4106. forward ac_OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
  4107. #endif
  4108. #endif
  4109. #if defined _inc_y_hooks
  4110. Hook:ac_OnVehicleDamageStatusUpdate(vehicleid, playerid)
  4111. #else
  4112. public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  4113. #endif
  4114. {
  4115. new i = GetTickCount();
  4116. if(AntiCheatInfo[playerid][pACAllow][49])
  4117. {
  4118. if(i < AntiCheatInfo[playerid][pCall][24] + Mtfc[24][0]) FloodDetect(playerid, 24);
  4119. else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  4120. else AntiCheatInfo[playerid][pFloodCount][24] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  4121. }
  4122. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][24] = i;
  4123. #if !defined _inc_y_hooks\
  4124. && defined ac_OnVehicleDamageStatusUpdate
  4125. return ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
  4126. #else
  4127. return 1;
  4128. #endif
  4129. }
  4130. #if !defined _inc_y_hooks
  4131. #if defined _ALS_OnVehicleDamage\
  4132. StatusUpdate
  4133. #undef OnVehicleDamageStatusUpdate
  4134. #elseif defined _ALS_OnVehicleDamageStatusUpd
  4135. #undef OnVehicleDamageStatusUpdate
  4136. #else
  4137. #define _ALS_OnVehicleDamageStatusUpdate
  4138. #endif
  4139. #define OnVehicleDamageStatusUpdate ac_OnVehicleDamageStatusUpdate
  4140. #if defined ac_OnVehicleDamageStatusUpdate
  4141. forward ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
  4142. #endif
  4143. #endif
  4144. #if defined _inc_y_hooks
  4145. Hook:ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate)
  4146. #else
  4147. public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
  4148. #endif
  4149. {
  4150. if(AntiCheatInfo[playerid][pKicked]) return 0;
  4151. new i = GetTickCount();
  4152. if(AntiCheatInfo[playerid][pACAllow][49])
  4153. {
  4154. if(i < AntiCheatInfo[playerid][pCall][25] + Mtfc[25][0]) FloodDetect(playerid, 25);
  4155. else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  4156. else AntiCheatInfo[playerid][pFloodCount][25] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  4157. }
  4158. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][25] = i;
  4159. #if !defined _inc_y_hooks\
  4160. && defined ac_OnVehicleSirenStateChange
  4161. return ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  4162. #else
  4163. return 1;
  4164. #endif
  4165. }
  4166. #if !defined _inc_y_hooks
  4167. #if defined _ALS_OnVehicleSirenStateChange
  4168. #undef OnVehicleSirenStateChange
  4169. #else
  4170. #define _ALS_OnVehicleSirenStateChange
  4171. #endif
  4172. #define OnVehicleSirenStateChange ac_OnVehicleSirenStateChange
  4173. #if defined ac_OnVehicleSirenStateChange
  4174. forward ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  4175. #endif
  4176. #endif
  4177. #if defined OnPlayerSelectDynamicObject
  4178. #if defined _inc_y_hooks
  4179. Hook:ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
  4180. #else
  4181. public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
  4182. #endif
  4183. {
  4184. if(AntiCheatInfo[playerid][pKicked]) return 0;
  4185. new i = GetTickCount();
  4186. if(AntiCheatInfo[playerid][pACAllow][49])
  4187. {
  4188. if(i < AntiCheatInfo[playerid][pCall][26] + Mtfc[26][0]) FloodDetect(playerid, 26);
  4189. else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  4190. else AntiCheatInfo[playerid][pFloodCount][26] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  4191. }
  4192. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][26] = i;
  4193. #if !defined _inc_y_hooks\
  4194. && defined ac_OnPlayerSelectDynamicObject
  4195. return ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, x, y, z);
  4196. #else
  4197. return 1;
  4198. #endif
  4199. }
  4200. #if !defined _inc_y_hooks
  4201. #if defined _ALS_OnPlayerSelect\
  4202. DynamicObject
  4203. #undef OnPlayerSelectDynamicObject
  4204. #else
  4205. #define _ALS_OnPlayerSelectDynamicObject
  4206. #endif
  4207. #define OnPlayerSelectDynamicObject ac_OnPlayerSelectDynamicObject
  4208. #if defined ac_OnPlayerSelectDynamicObject
  4209. forward ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z);
  4210. #endif
  4211. #endif
  4212. #else
  4213. #if defined _inc_y_hooks
  4214. Hook:ac_OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
  4215. #else
  4216. public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
  4217. #endif
  4218. {
  4219. if(AntiCheatInfo[playerid][pKicked]) return 0;
  4220. new i = GetTickCount();
  4221. if(AntiCheatInfo[playerid][pACAllow][49])
  4222. {
  4223. if(i < AntiCheatInfo[playerid][pCall][26] + Mtfc[26][0]) FloodDetect(playerid, 26);
  4224. else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  4225. else AntiCheatInfo[playerid][pFloodCount][26] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  4226. }
  4227. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][26] = i;
  4228. #if !defined _inc_y_hooks\
  4229. && defined ac_OnPlayerSelectObject
  4230. return ac_OnPlayerSelectObject(playerid, type, objectid, modelid, fX, fY, fZ);
  4231. #else
  4232. return 1;
  4233. #endif
  4234. }
  4235. #if !defined _inc_y_hooks
  4236. #if defined _ALS_OnPlayerSelectObject
  4237. #undef OnPlayerSelectObject
  4238. #else
  4239. #define _ALS_OnPlayerSelectObject
  4240. #endif
  4241. #define OnPlayerSelectObject ac_OnPlayerSelectObject
  4242. #if defined ac_OnPlayerSelectObject
  4243. forward ac_OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ);
  4244. #endif
  4245. #endif
  4246. #endif
  4247. #if defined _inc_y_hooks
  4248. Hook:ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
  4249. #else
  4250. public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
  4251. #endif
  4252. {
  4253. if(AntiCheatInfo[playerid][pKicked]) return 0;
  4254. static Float:vpos[4];
  4255. GetVehiclePos(vehicleid, vpos[0], vpos[1], vpos[2]);
  4256. vpos[3] = GetVehicleDistanceFromPoint(vehicleid, new_x, new_y, new_z);
  4257. if(passenger_seat)
  4258. {
  4259. static Float:zdiff;
  4260. zdiff = new_z - vpos[2];
  4261. if(AntiCheatInfo[playerid][pACAllow][31] && (floatabs(vel_x) > 0.3 && floatabs(vel_x) >=
  4262. floatabs(AntiCheatVehInfo[vehicleid][vVel][0]) || floatabs(vel_y) > 0.3 && floatabs(vel_y) >=
  4263. floatabs(AntiCheatVehInfo[vehicleid][vVel][1])) && zdiff > -5.0)
  4264. {
  4265. if(++AntiCheatInfo[playerid][pCheatCount][4] >
  4266. MAX_CARSHOT_WARNINGS) return KickWithCode(playerid, "", 0, 31);
  4267. #undef MAX_CARSHOT_WARNINGS
  4268. }
  4269. else if(AntiCheatInfo[playerid][pACAllow][8] && vel_z >= 0.1 && vel_z >
  4270. AntiCheatVehInfo[vehicleid][vVel][2] && floatabs(vpos[0] - new_x) <
  4271. zdiff * 1.2 && floatabs(vpos[1] - new_y) < zdiff * 1.2)
  4272. {
  4273. if(++AntiCheatInfo[playerid][pCheatCount][3] >
  4274. MAX_FLYHACK_VEH_WARNINGS) return KickWithCode(playerid, "", 0, 8, 2);
  4275. #undef MAX_FLYHACK_VEH_WARNINGS
  4276. }
  4277. else AntiCheatInfo[playerid][pCheatCount][4] =
  4278. AntiCheatInfo[playerid][pCheatCount][3] = 0;
  4279. }
  4280. if(AntiCheatInfo[playerid][pACAllow][5] && vpos[3] > 15.0 && vpos[2] > -70.0
  4281. && vpos[3] > AntiCheatVehInfo[vehicleid][vPosDiff] + ((vpos[3] / 3) * 1.5))
  4282. {
  4283. GetVehicleZAngle(vehicleid, AntiCheatVehInfo[vehicleid][vZAngle]);
  4284. SetVehicleZAngle(vehicleid, AntiCheatVehInfo[vehicleid][vZAngle]);
  4285. SetVehiclePos(vehicleid, vpos[0], vpos[1], vpos[2]);
  4286. return 0;
  4287. }
  4288. static a;
  4289. a = 1;
  4290. #if !defined _inc_y_hooks\
  4291. && defined ac_OnUnoccupiedVehicleUpdate
  4292. a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, new_x, new_y, new_z, vel_x, vel_y, vel_z);
  4293. #endif
  4294. if(a)
  4295. {
  4296. AntiCheatVehInfo[vehicleid][vSpeedDiff] =
  4297. GetSpeed(vel_x,vel_y,vel_z)
  4298. - GetSpeed(AntiCheatVehInfo[vehicleid][vVel][0],AntiCheatVehInfo[vehicleid][vVel][1],AntiCheatVehInfo[vehicleid][vVel][2]);
  4299. AntiCheatVehInfo[vehicleid][vPosDiff] = vpos[3];
  4300. AntiCheatVehInfo[vehicleid][vVel][0] = vel_x;
  4301. AntiCheatVehInfo[vehicleid][vVel][1] = vel_y;
  4302. AntiCheatVehInfo[vehicleid][vVel][2] = vel_z;
  4303. }
  4304. return a;
  4305. }
  4306. #if !defined _inc_y_hooks
  4307. #if defined _ALS_OnUnoccupiedVehicleUpdate
  4308. #undef OnUnoccupiedVehicleUpdate
  4309. #else
  4310. #define _ALS_OnUnoccupiedVehicleUpdate
  4311. #endif
  4312. #define OnUnoccupiedVehicleUpdate ac_OnUnoccupiedVehicleUpdate
  4313. #if defined ac_OnUnoccupiedVehicleUpdate
  4314. forward ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z);
  4315. #endif
  4316. #endif
  4317. #if defined _inc_y_hooks
  4318. Hook:ac_OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
  4319. #else
  4320. public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
  4321. #endif
  4322. {
  4323. if(AntiCheatInfo[playerid][pKicked]) return 0;
  4324. if(AntiCheatInfo[playerid][pACAllow][46] && 383 < modelid < 394) return KickWithCode(playerid, "", 0, 46);
  4325. #if !defined _inc_y_hooks\
  4326. && defined ac_OnPlayerEditAttachedObject
  4327. return ac_OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
  4328. #else
  4329. return 1;
  4330. #endif
  4331. }
  4332. #if !defined _inc_y_hooks
  4333. #if defined _ALS_OnPlayerEditAttachedObject
  4334. #undef OnPlayerEditAttachedObject
  4335. #else
  4336. #define _ALS_OnPlayerEditAttachedObject
  4337. #endif
  4338. #define OnPlayerEditAttachedObject ac_OnPlayerEditAttachedObject
  4339. #if defined ac_OnPlayerEditAttachedObject
  4340. forward ac_OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ);
  4341. #endif
  4342. #endif
  4343. fpublic: acTimer(playerid)
  4344. {
  4345. if(!IsPlayerConnected(playerid) || AntiCheatInfo[playerid][pKicked]) return 0;
  4346. if(AntiCheatInfo[playerid][pACAllow][51] && NetStats_MessagesRecvPerSecond(playerid) >
  4347. MAX_MSGS_REC_DIFF) KickWithCode(playerid, "", 0, 51);
  4348. #undef MAX_MSGS_REC_DIFF
  4349. static gtc, gpp, bool:ur;
  4350. gtc = GetTickCount();
  4351. ur = false;
  4352. gpp = GetPlayerPing(playerid) + 100;
  4353. if(gtc > AntiCheatInfo[playerid][pGtc][7] + gpp)
  4354. {
  4355. for(new i, w, a, bool:cw, s = WeaponSlots[GetPlayerWeapon(playerid)]; i < 13; ++i)
  4356. {
  4357. GetPlayerWeaponData(playerid, i, w, a);
  4358. if(w == 39) cw = true;
  4359. if(s != i)
  4360. {
  4361. if(AntiCheatInfo[playerid][pSetWeapon][i] != -1)
  4362. {
  4363. if(AntiCheatInfo[playerid][pSetWeapon][i] == w)
  4364. {
  4365. AntiCheatInfo[playerid][pSetWeapon][i] = -1;
  4366. AntiCheatInfo[playerid][pWeapon][i] = w;
  4367. }
  4368. else if(AntiCheatInfo[playerid][pACAllow][52]
  4369. && gtc > AntiCheatInfo[playerid][pGtcSetWeapon][i] + gpp
  4370. && ++AntiCheatInfo[playerid][pNOPCount][0] > MAX_NOP_WARNINGS)
  4371. {
  4372. #if defined DEBUG
  4373. printf(DEBUG_CODE_5, playerid, "GivePlayerWeapon");
  4374. #endif
  4375. KickWithCode(playerid, "", 0, 52, 13);
  4376. }
  4377. }
  4378. else
  4379. {
  4380. if(AntiCheatInfo[playerid][pWeapon][i] != w)
  4381. {
  4382. if(!w)
  4383. {
  4384. AntiCheatInfo[playerid][pWeapon][i] = 0;
  4385. AntiCheatInfo[playerid][pAmmo][i] = a;
  4386. }
  4387. else if(w == 40 && cw || w == 46 && AntiCheatInfo[playerid][pVeh]
  4388. && AntiCheatInfo[playerid][pParachute])
  4389. {
  4390. AntiCheatInfo[playerid][pWeapon][i] = w;
  4391. AntiCheatInfo[playerid][pAmmo][i] = a;
  4392. }
  4393. else if(AntiCheatInfo[playerid][pLastPickup] > -1
  4394. && AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pWeapon] == w
  4395. && a == PickupAmmo[AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pWeapon]]
  4396. && IsPlayerInRangeOfPoint(playerid, 5.0, AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pPos][0],
  4397. AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pPos][1],
  4398. AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pPos][2]))
  4399. {
  4400. AntiCheatInfo[playerid][pWeapon][i] = w;
  4401. if(2 < i < 6) AntiCheatInfo[playerid][pAmmo][i] +=
  4402. PickupAmmo[AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pWeapon]];
  4403. else AntiCheatInfo[playerid][pAmmo][i] =
  4404. PickupAmmo[AntiCheatPickInfo[AntiCheatInfo[playerid][pLastPickup]][pWeapon]];
  4405. }
  4406. else if(AntiCheatInfo[playerid][pACAllow][15] && !((15 < w < 40
  4407. || 40 < w < 44) && !a)) KickWithCode(playerid, "", 0, 15, 2);
  4408. }
  4409. if(AntiCheatInfo[playerid][pGiveAmmo][i] != -65535)
  4410. {
  4411. if(AntiCheatInfo[playerid][pGiveAmmo][i] == a)
  4412. {
  4413. AntiCheatInfo[playerid][pGiveAmmo][i] = -65535;
  4414. AntiCheatInfo[playerid][pAmmo][i] = a;
  4415. }
  4416. else if(AntiCheatInfo[playerid][pACAllow][52] && gtc >
  4417. AntiCheatInfo[playerid][pGtcGiveAmmo][i] + gpp)
  4418. {
  4419. if(++AntiCheatInfo[playerid][pNOPCount][1] > MAX_NOP_WARNINGS)
  4420. {
  4421. #undef MAX_NOP_WARNINGS
  4422. #if defined DEBUG
  4423. printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
  4424. #endif
  4425. KickWithCode(playerid, "", 0, 52, 14);
  4426. }
  4427. }
  4428. }
  4429. if(15 < w < 44)
  4430. {
  4431. if(w == 40 && !a) AntiCheatInfo[playerid][pAmmo][i] = 0;
  4432. else if(AntiCheatInfo[playerid][pACAllow][16] && a >
  4433. AntiCheatInfo[playerid][pAmmo][i]) KickWithCode(playerid, "", 0, 16, 2);
  4434. }
  4435. }
  4436. }
  4437. else if(21 < w < 33 || 40 < w < 43
  4438. || !LagCompMode && (15 < w < 40 || w == 43))
  4439. {
  4440. if(AntiCheatInfo[playerid][pACAllow][16] && a > AntiCheatInfo[playerid][pAmmo][i]
  4441. && AntiCheatInfo[playerid][pGiveAmmo][i] == -65535)
  4442. {
  4443. if(21 < w < 33 && !ur && IsPlayerInAmmuNation(playerid,
  4444. GetPlayerInterior(playerid)) && AmmuNationInfo[w-22][1] ==
  4445. abs(a - AntiCheatInfo[playerid][pAmmo][i]))
  4446. {
  4447. #undef abs
  4448. if(AntiCheatInfo[playerid][pSet][10]
  4449. != -1) AntiCheatInfo[playerid][pSet][10] += AmmuNationInfo[w-22][0];
  4450. else AntiCheatInfo[playerid][pSet][10] = AmmuNationInfo[w-22][0];
  4451. AntiCheatInfo[playerid][pAmmo][i] += AmmuNationInfo[w-22][1];
  4452. AntiCheatInfo[playerid][pCheatCount][10] = 0;
  4453. ur = true;
  4454. }
  4455. else if(!LagCompMode) KickWithCode(playerid, "", 0, 16, 3);
  4456. }
  4457. else if(AntiCheatInfo[playerid][pAmmo][i]
  4458. && !LagCompMode) AntiCheatInfo[playerid][pAmmo][i] = a;
  4459. }
  4460. }
  4461. }
  4462. AntiCheatInfo[playerid][pCheatCount][1] =
  4463. AntiCheatInfo[playerid][pCheatCount][2] = 0;
  4464. if(ur) AntiCheatInfo[playerid][pGtc][15] = gtc;
  4465. AntiCheatInfo[playerid][pTimerID] = SetTimerEx("acTimer", 1000, false, "i", playerid);
  4466. return 1;
  4467. }
  4468. fpublic: ac_OnCheatDetected(playerid, ip_address[], type, code)
  4469. {
  4470. if(type) BlockIpAddress(ip_address, 0);
  4471. else
  4472. {
  4473. switch(code)
  4474. {
  4475. case 40: SendClientMessage(playerid, DEFAULT_COLOR, MAX_CONNECTS_MSG);
  4476. case 41: SendClientMessage(playerid, DEFAULT_COLOR, UNKNOWN_CLIENT_MSG);
  4477. default:
  4478. {
  4479. new strtmp[70];
  4480. format(strtmp, sizeof strtmp, KICK_MSG, code);
  4481. SendClientMessage(playerid, DEFAULT_COLOR, strtmp);
  4482. #undef DEFAULT_COLOR
  4483. }
  4484. }
  4485. new pping = GetPlayerPing(playerid) + 100;
  4486. SetTimerEx("ac_KickTimer", (pping > MAX_PING ? MAX_PING : pping), false, "i", playerid);
  4487. #undef MAX_PING
  4488. if(GetPlayerState(playerid) == 2) AntiCheatInfo[playerid][pKicked] = 2;
  4489. else AntiCheatInfo[playerid][pKicked] = 1;
  4490. }
  4491. return 1;
  4492. }
  4493. fpublic: ac_KickTimer(playerid) return Kick(playerid);
  4494. #undef fpublic
  4495. stock EnableAntiCheat(acid, enable)
  4496. {
  4497. if(!(-1 < acid < sizeof ACAllow)) return 0;
  4498. ACAllow[acid] = !!enable;
  4499. #if defined foreachex
  4500. foreachex(Player, enable) AntiCheatInfo[enable][pACAllow][acid] = ACAllow[acid];
  4501. #else
  4502. for(enable = GetPlayerPoolSize(); enable != -1; --enable)
  4503. {
  4504. if(IsPlayerConnected(enable)) AntiCheatInfo[enable][pACAllow][acid] = ACAllow[acid];
  4505. }
  4506. #endif
  4507. return 1;
  4508. }
  4509. stock EnableAntiCheatForPlayer(playerid, acid, enable)
  4510. {
  4511. if(!IsPlayerConnected(playerid) || !(-1 < acid < sizeof ACAllow)) return 0;
  4512. AntiCheatInfo[playerid][pACAllow][acid] = !!enable;
  4513. return 1;
  4514. }
  4515. static IsPlayerInRestaurant(playerid, interiorid)
  4516. {
  4517. #if USE_RESTAURANTS
  4518. new i;
  4519. switch(interiorid)
  4520. {
  4521. case 5: i = 0;
  4522. case 9: i = 1;
  4523. case 10: i = 2;
  4524. default: return false;
  4525. }
  4526. return IsPlayerInRangeOfPoint(playerid, 2.5, Restaurants[i][0],
  4527. Restaurants[i][1], Restaurants[i][2]);
  4528. #else
  4529. return false;
  4530. #endif
  4531. #undef USE_RESTAURANTS
  4532. }
  4533. static IsPlayerInAmmuNation(playerid, interiorid)
  4534. {
  4535. #if USE_AMMUNATIONS
  4536. new i, s;
  4537. switch(interiorid)
  4538. {
  4539. case 1: i = 0, s = -1;
  4540. case 4: i = 1, s = 0;
  4541. case 6: i = 3, s = 1;
  4542. default: return false;
  4543. }
  4544. for(; i != s; --i)
  4545. {
  4546. if(IsPlayerInRangeOfPoint(playerid, 2.5, AmmuNations[i][0],
  4547. AmmuNations[i][1], AmmuNations[i][2])) return true;
  4548. }
  4549. #endif
  4550. #undef USE_AMMUNATIONS
  4551. return false;
  4552. }
  4553. static IsPlayerInPayNSpray(playerid, interiorid)
  4554. {
  4555. #if USE_PAYNSPRAY
  4556. if(!interiorid)
  4557. {
  4558. for(new i = sizeof(PayNSpray) - 1; i != -1; --i)
  4559. {
  4560. if(IsPlayerInRangeOfPoint(playerid, 7.5, PayNSpray[i][0],
  4561. PayNSpray[i][1], PayNSpray[i][2])) return true;
  4562. }
  4563. }
  4564. #endif
  4565. #undef USE_PAYNSPRAY
  4566. return false;
  4567. }
  4568. static IsPlayerNearVendingMachine(playerid, interiorid)
  4569. {
  4570. #if USE_VENDING_MACHINES
  4571. new i, s;
  4572. switch(interiorid)
  4573. {
  4574. case 0: i = 44, s = -1;
  4575. case 1: i = 51, s = 44;
  4576. case 2: i = 52, s = 51;
  4577. case 3: i = 58, s = 52;
  4578. case 6: i = 60, s = 58;
  4579. case 7: i = 61, s = 60;
  4580. case 15: i = 62, s = 61;
  4581. case 16: i = 65, s = 62;
  4582. case 17: i = 72, s = 65;
  4583. case 18: i = 74, s = 72;
  4584. default: return false;
  4585. }
  4586. for(; i != s; --i)
  4587. {
  4588. if(IsPlayerInRangeOfPoint(playerid, 1.5, VendingMachines[i][0],
  4589. VendingMachines[i][1], VendingMachines[i][2])) return true;
  4590. }
  4591. #endif
  4592. #undef USE_VENDING_MACHINES
  4593. return false;
  4594. }
  4595. static IsPlayerInCasino(playerid, interiorid)
  4596. {
  4597. #if USE_CASINOS
  4598. new i, s;
  4599. switch(interiorid)
  4600. {
  4601. case 1: i = 41, s = -1;
  4602. case 10: i = 61, s = 41;
  4603. case 12: i = 70, s = 61;
  4604. default: return false;
  4605. }
  4606. for(; i != s; --i)
  4607. {
  4608. if(IsPlayerInRangeOfPoint(playerid, Casinos[i][3], Casinos[i][0],
  4609. Casinos[i][1], Casinos[i][2])) return true;
  4610. }
  4611. #endif
  4612. #undef USE_CASINOS
  4613. return false;
  4614. }
  4615. static IsComponentidCompatible(modelid, componentid)
  4616. {
  4617. if(modelid != -1)
  4618. {
  4619. switch(componentid)
  4620. {
  4621. case 1000..1191:
  4622. {
  4623. componentid -= 1000;
  4624. if(VehicleMods[(modelid - 400) * 6 + (componentid >>> 5)]
  4625. & 1 << (componentid & 0b00011111)) return true;
  4626. }
  4627. case 1192, 1193:
  4628. {
  4629. if(modelid == 576) return true;
  4630. }
  4631. }
  4632. }
  4633. return false;
  4634. }
  4635. static IpToInt(const s_szIP[])
  4636. {
  4637. new aiBytes[1], iPos;
  4638. aiBytes{0} = strval(s_szIP[iPos]);
  4639. while(iPos < 15 && s_szIP[iPos++] != '.'){}
  4640. aiBytes{1} = strval(s_szIP[iPos]);
  4641. while(iPos < 15 && s_szIP[iPos++] != '.'){}
  4642. aiBytes{2} = strval(s_szIP[iPos]);
  4643. while(iPos < 15 && s_szIP[iPos++] != '.'){}
  4644. aiBytes{3} = strval(s_szIP[iPos]);
  4645. return aiBytes[0];
  4646. }
  4647. static FloodDetect(playerid, publicid)
  4648. {
  4649. if(!AntiCheatInfo[playerid][pKicked])
  4650. {
  4651. if(++AntiCheatInfo[playerid][pFloodCount][publicid] > Mtfc[publicid][1])
  4652. {
  4653. #if defined DEBUG
  4654. printf(DEBUG_CODE_1, playerid, Mtfc[publicid][1], publicid);
  4655. #undef DEBUG
  4656. #endif
  4657. return KickWithCode(playerid, "", 0, 49, publicid);
  4658. }
  4659. AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][publicid] = GetTickCount();
  4660. }
  4661. return 0;
  4662. }
  4663. static KickWithCode(playerid, ip_address[], type, code, code2 = 0)
  4664. {
  4665. if(!type && (!IsPlayerConnected(playerid)
  4666. || AntiCheatInfo[playerid][pKicked])
  4667. || !(-1 < code < sizeof ACAllow)) return 0;
  4668. StatsInfo[5]++;
  4669. switch(code)
  4670. {
  4671. case 0..35, 37, 39, 52: StatsInfo[0]++;
  4672. case 36, 38, 40, 41, 51: StatsInfo[4]++;
  4673. case 42: StatsInfo[1]++;
  4674. case 48..50: StatsInfo[3]++;
  4675. case 43..47: StatsInfo[2]++;
  4676. }
  4677. new strtmp[6];
  4678. if(code2) format(strtmp, sizeof strtmp, " (%d)", code2);
  4679. if(type) printf(SUSPICION_2, ip_address, code, strtmp);
  4680. else printf(SUSPICION_1, playerid, code, strtmp);
  4681. #if defined OnCheatDetected
  4682. OnCheatDetected(playerid, ip_address, type, code);
  4683. #else
  4684. ac_OnCheatDetected(playerid, ip_address, type, code);
  4685. #endif
  4686. return 0;
  4687. }
  4688. static LoadCfg()
  4689. {
  4690. new i, File:cfgFile, string[415], strtmp[9];
  4691. if(fexist(CONFIG_FILE))
  4692. {
  4693. if((cfgFile = fopen(CONFIG_FILE, io_read)))
  4694. {
  4695. while(fread(cfgFile, string))
  4696. {
  4697. if((i = strfind(string, "//")) != -1)
  4698. {
  4699. strmid(string, strtmp, i + 2, i + 3);
  4700. string[i] = '\0';
  4701. if(-1 < (i = strval(strtmp)) < sizeof ACAllow) ACAllow[i] = !!strval(string);
  4702. }
  4703. }
  4704. fclose(cfgFile);
  4705. }
  4706. else return 0;
  4707. }
  4708. else if((cfgFile = fopen(CONFIG_FILE, io_write)))
  4709. {
  4710. #undef CONFIG_FILE
  4711. for(; i < sizeof ACAllow; ++i)
  4712. {
  4713. format(strtmp, sizeof strtmp, "%d //%d\r\n", ACAllow[i], i);
  4714. strcat(string, strtmp);
  4715. }
  4716. fwrite(cfgFile, string);
  4717. fclose(cfgFile);
  4718. }
  4719. else return 0;
  4720. return 1;
  4721. }
  4722. #endif