AC.inc 227 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979
  1. //Nex-AC by Nexius v1.9.23 (0.3.7-R2)
  2. #if defined _nex_ac_included
  3. #endinput
  4. #endif
  5. #define _nex_ac_included
  6. #include <a_samp>
  7. #if !defined GetConsoleVarAsInt
  8. #error Please download SA-MP 0.3.7 R2 server package!
  9. #endif
  10. #if !defined FILTERSCRIPT
  11. #define DEBUG
  12. #include <nex-ac_en.lang> //Localization
  13. #define NEX_AC_VERSION "1.9.23"
  14. #define AC_SERVER_VERSION "0.3.7-R2"
  15. #define AC_CONFIG_FILE "nex-ac_settings.cfg"
  16. #define AC_MAX_CLASSES 320
  17. #define AC_DEFAULT_COLOR -1
  18. #if !defined AC_USE_VENDING_MACHINES
  19. #define AC_USE_VENDING_MACHINES true
  20. #endif
  21. #if !defined AC_USE_TUNING_GARAGES
  22. #define AC_USE_TUNING_GARAGES true
  23. #endif
  24. #if !defined AC_USE_AMMUNATIONS
  25. #define AC_USE_AMMUNATIONS true
  26. #endif
  27. #if !defined AC_USE_RESTAURANTS
  28. #define AC_USE_RESTAURANTS true
  29. #endif
  30. #if !defined AC_USE_PAYNSPRAY
  31. #define AC_USE_PAYNSPRAY true
  32. #endif
  33. #if !defined AC_USE_CASINOS
  34. #define AC_USE_CASINOS true
  35. #endif
  36. #if !defined AC_USE_QUERY
  37. #define AC_USE_QUERY true
  38. #endif
  39. #if !defined AC_MAX_CONNECTS_FROM_IP
  40. #define AC_MAX_CONNECTS_FROM_IP 1
  41. #endif
  42. #if !defined AC_MAX_RCON_LOGIN_ATTEMPT
  43. #define AC_MAX_RCON_LOGIN_ATTEMPT 1
  44. #endif
  45. #if !defined AC_MAX_MSGS_REC_DIFF
  46. #define AC_MAX_MSGS_REC_DIFF 799
  47. #endif
  48. #if !defined AC_MAX_PING
  49. #define AC_MAX_PING 500
  50. #endif
  51. #if !defined AC_MIN_TIME_RECONNECT
  52. #define AC_MIN_TIME_RECONNECT 12 //In seconds
  53. #endif
  54. #if !defined AC_MAX_NOP_WARNINGS
  55. #define AC_MAX_NOP_WARNINGS 3
  56. #endif
  57. #if !defined AC_MAX_PING_WARNINGS
  58. #define AC_MAX_PING_WARNINGS 2
  59. #endif
  60. #if !defined AC_MAX_AIR_WARNINGS
  61. #define AC_MAX_AIR_WARNINGS 3
  62. #endif
  63. #if !defined AC_MAX_AIR_VEH_WARNINGS
  64. #define AC_MAX_AIR_VEH_WARNINGS 3
  65. #endif
  66. #if !defined AC_MAX_FLYHACK_VEH_WARNINGS
  67. #define AC_MAX_FLYHACK_VEH_WARNINGS 3
  68. #endif
  69. #if !defined AC_MAX_FLYHACK_B_WARNINGS
  70. #define AC_MAX_FLYHACK_B_WARNINGS 5
  71. #endif
  72. #if !defined AC_MAX_CARSHOT_WARNINGS
  73. #define AC_MAX_CARSHOT_WARNINGS 3
  74. #endif
  75. #if !defined AC_MAX_PRO_AIM_WARNINGS
  76. #define AC_MAX_PRO_AIM_WARNINGS 2
  77. #endif
  78. #if !defined AC_MAX_AFK_GHOST_WARNINGS
  79. #define AC_MAX_AFK_GHOST_WARNINGS 2
  80. #endif
  81. #if !defined AC_MAX_RAPID_FIRE_WARNINGS
  82. #define AC_MAX_RAPID_FIRE_WARNINGS 3
  83. #endif
  84. #if !defined AC_MAX_GODMODE_WARNINGS
  85. #define AC_MAX_GODMODE_WARNINGS 2
  86. #endif
  87. #if !defined AC_MAX_GODMODE_VEH_WARNINGS
  88. #define AC_MAX_GODMODE_VEH_WARNINGS 2
  89. #endif
  90. #if !defined AC_MAX_SILENT_AIM_WARNINGS
  91. #define AC_MAX_SILENT_AIM_WARNINGS 2
  92. #endif
  93. #if !defined AC_MAX_FLYHACK_WARNINGS
  94. #define AC_MAX_FLYHACK_WARNINGS 2
  95. #endif
  96. #define ac_fpublic%0(%1) forward %0(%1); public %0(%1)
  97. #define ac_abs(%1) (((%1) < 0) ? (-(%1)) : ((%1)))
  98. static bool:ac_ACAllow[] =
  99. {
  100. true, //0 Anti-AirBreak (onfoot)
  101. true, //1 Anti-AirBreak (in vehicle)
  102. true, //2 Anti-teleport hack (onfoot)
  103. true, //3 Anti-teleport hack (in vehicle)
  104. true, //4 Anti-teleport hack (into/between vehicles)
  105. true, //5 Anti-teleport hack (vehicle to player)
  106. true, //6 Anti-teleport hack (pickups)
  107. true, //7 Anti-FlyHack (onfoot)
  108. true, //8 Anti-FlyHack (in vehicle)
  109. true, //9 Anti-SpeedHack (onfoot)
  110. true, //10 Anti-SpeedHack (in vehicle)
  111. true, //11 Anti-Health hack (in vehicle)
  112. true, //12 Anti-Health hack (onfoot)
  113. true, //13 Anti-Armour hack
  114. true, //14 Anti-Money hack
  115. true, //15 Anti-Weapon hack
  116. true, //16 Anti-Ammo hack (add)
  117. true, //17 Anti-Ammo hack (infinite)
  118. true, //18 Anti-Special actions hack
  119. true, //19 Anti-GodMode from bullets (onfoot)
  120. true, //20 Anti-GodMode from bullets (in vehicle)
  121. true, //21 Anti-Invisible hack
  122. true, //22 Anti-lagcomp-spoof
  123. true, //23 Anti-Tuning hack
  124. false, //24 Anti-Parkour mod
  125. true, //25 Anti-Quick turn
  126. true, //26 Anti-Rapid fire
  127. true, //27 Anti-FakeSpawn
  128. true, //28 Anti-FakeKill
  129. true, //29 Anti-Pro Aim
  130. true, //30 Anti-CJ run
  131. true, //31 Anti-CarShot
  132. true, //32 Anti-CarJack
  133. false, //33 Anti-UnFreeze
  134. true, //34 Anti-AFK Ghost
  135. true, //35 Anti-Full Aiming
  136. false, //36 Anti-Fake NPC
  137. true, //37 Anti-Reconnect
  138. false, //38 Anti-High ping
  139. true, //39 Anti-Dialog hack
  140. true, //40 Protection from the sandbox
  141. true, //41 Protection against an invalid version
  142. true, //42 Anti-Rcon hack
  143. true, //43 Anti-Tuning crasher
  144. true, //44 Anti-Invalid seat crasher
  145. true, //45 Anti-Dialog crasher
  146. true, //46 Anti-Attached object crasher
  147. true, //47 Anti-Weapon Crasher
  148. true, //48 Flood protection connects to one slot
  149. true, //49 Anti-flood callback functions
  150. true, //50 Anti-flood change seat
  151. true, //51 Anti-Ddos
  152. false //52 Anti-NOP's
  153. };
  154. static const ac_Mtfc[][] =
  155. {
  156. {230, 5}, //0 OnDialogResponse
  157. {800, 2}, //1 OnEnterExitModShop
  158. {250, 3}, //2 OnPlayerClickMap
  159. {450, 3}, //3 OnPlayerClickPlayer
  160. {150, 5}, //4 OnPlayerClickTextDraw
  161. {400, 3}, //5 OnPlayerCommandText
  162. {150, 3}, //6 OnPlayerEnterVehicle
  163. {150, 3}, //7 OnPlayerExitVehicle
  164. {500, 8}, //8 OnPlayerPickUpPickup
  165. {150, 8}, //9 OnPlayerRequestClass
  166. {250, 5}, //10 OnPlayerSelectedMenuRow
  167. {600, 3}, //11 OnPlayerStateChange
  168. {530, 2}, //12 OnVehicleMod
  169. {530, 2}, //13 OnVehiclePaintjob
  170. {530, 2}, //14 OnVehicleRespray
  171. {300, 1}, //15 OnVehicleDeath
  172. {450, 2}, //16 OnPlayerText
  173. {500, 5}, //17 OnPlayerEnterCheckpoint
  174. {500, 5}, //18 OnPlayerLeaveCheckpoint
  175. {150, 3}, //19 OnPlayerRequestSpawn
  176. {250, 5}, //20 OnPlayerExitedMenu
  177. {500, 5}, //21 OnPlayerEnterRaceCheckpoint
  178. {500, 5}, //22 OnPlayerLeaveRaceCheckpoint
  179. {150, 5}, //23 OnPlayerClickPlayerTextDraw
  180. {51, 9}, //24 OnVehicleDamageStatusUpdate
  181. {150, 5}, //25 OnVehicleSirenStateChange
  182. {150, 5}, //26 OnPlayerSelectObject
  183. {150, 5} //27 Cross-public
  184. },
  185. ac_wSlot[] =
  186. {
  187. 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, 10,
  188. 10, 8, 8, 8, -1, -1, -1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5,
  189. 4, 6, 6, 7, 7, 7, 7, 8, 12, 9, 9, 9, 11, 11, 11
  190. },
  191. ac_wModel[] =
  192. {
  193. 0, 331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325,
  194. 326, 342, 343, 344, 0, 0, 0, 346, 347, 348, 349, 350, 351, 352, 353, 355, 356,
  195. 372, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 371
  196. },
  197. ac_vType[] =
  198. {
  199. 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0,
  200. 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 3, 3, 3, 0, 0,
  201. 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 3, 3, 0, 0, 2,
  202. 0, 0, 0, 0, 4, 0, 0, 3, 0, 0, 2, 2, 0, 0, 0, 0, 3, 0, 0, 0,
  203. 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 2, 2, 2, 0, 0, 0,
  204. 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  205. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0,
  206. 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  207. 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 3
  208. },
  209. ac_cPrice[] =
  210. {
  211. 400, 550, 200, 250, 100, 150, 80, 500, 500, 200, 1000, 220, 250, 100, 400,
  212. 500, 200, 500, 350, 300, 250, 200, 150, 350, 50, 1000, 480, 0, 770, 680, 0,
  213. 370, 170, 120, 790, 150, 500, 690, 190, 390, 0, 0, 1000, 500, 500, 510, 710,
  214. 670, 530, 810, 620, 0, 0, 130, 210, 230, 520, 430, 620, 720, 530, 180, 0, 0,
  215. 830, 850, 750, 250, 200, 550, 450, 0, 0, 1100, 1030, 980, 1560, 1620, 1200,
  216. 1030, 900, 1230, 820, 1560, 1350, 770, 100, 1500, 150, 650, 450, 100, 750,
  217. 350, 0, 0, 1000, 620, 1140, 0, 940, 0, 0, 3250, 1610, 1540, 780, 0, 780,
  218. 1610, 1540, 0, 0, 3340, 3250, 2130, 2050, 2040, 780, 940, 0, 0, 780, 860,
  219. 0, 1120, 3340, 3250, 3340, 1650, 3380, 3290, 1590, 830, 800, 1500, 1000, 0,
  220. 580, 470, 870, 980, 0, 150, 0, 100, 490, 600, 890, 1000, 1090, 840, 910,
  221. 1200, 1030, 1030, 920, 930, 550, 1050, 1050, 950, 650, 450, 550, 850, 950,
  222. 850, 950, 970, 880, 990, 900, 950, 1000, 900, 1000, 900, 2050, 2150, 2130,
  223. 2050, 2130, 2040, 2150, 2040, 2095, 2175, 2080, 2200, 1200, 1040, 940, 1100
  224. },
  225. ac_MaxPassengers[] =
  226. {
  227. 0x10331113, 0x11311131, 0x11331313, 0x10133301, 0x1311F110,
  228. 0x10311103, 0x10001F10, 0x11113311, 0x13113311, 0x31101100,
  229. 0x30002301, 0x11031311, 0x11111331, 0x10013111, 0x01131100,
  230. 0x11111110, 0x11100031, 0x11130221, 0x33113311, 0x11111101,
  231. 0x33101133, 0x101001F0, 0x03133111, 0xFF11113F, 0x13330111,
  232. 0xFF131111, 0x0000FF3F
  233. },
  234. ac_vMods[] =
  235. {
  236. 0x033C2700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x021A27FA, 0x00000000, 0x00FFFE00,
  237. 0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  238. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023B2785, 0x00000000, 0x00FFFE00,
  239. 0x00000007, 0x00000000, 0x00000000, 0x02BC4703, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  240. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  241. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  242. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x03BA278A, 0x00000000, 0x00FFFE00,
  243. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  244. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  245. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  246. 0x028E078A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  247. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  248. 0x02310744, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  249. 0x00000007, 0x00000000, 0x00000000, 0x0228073A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  250. 0x02BD4701, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023A2780, 0x00000000, 0x00FFFE00,
  251. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  252. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  253. 0x00000007, 0x00000000, 0x00000000, 0x0228077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  254. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  255. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  256. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  257. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  258. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  259. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  260. 0x027A27CA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  261. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  262. 0x0282278A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  263. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  264. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  265. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  266. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  267. 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  268. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  269. 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  270. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  271. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  272. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  273. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  274. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  275. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  276. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  277. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  278. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  279. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  280. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  281. 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  282. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  283. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  284. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  285. 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  286. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  287. 0x00000007, 0x00000000, 0x00000000, 0x023E07C0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  288. 0x03703730, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  289. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  290. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  291. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  292. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  293. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  294. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  295. 0x00000007, 0x00000000, 0x00000000, 0x031D2775, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  296. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02BE4788, 0x00000000, 0x00FFFE00,
  297. 0x00000007, 0x0003C000, 0x00000000, 0x02010771, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  298. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  299. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  300. 0x029A0FCE, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  301. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  302. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x03382700, 0x00000000, 0x00FFFE00,
  303. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  304. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  305. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  306. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  307. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  308. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  309. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  310. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  311. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  312. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  313. 0x00000007, 0x00000000, 0x00000000, 0x023F8795, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  314. 0x029F078C, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x029627EA, 0x00000000, 0x00FFFE00,
  315. 0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  316. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  317. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  318. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  319. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  320. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x0236C782, 0x00000000, 0x00FFFE00,
  321. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  322. 0x029E1FCA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  323. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  324. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  325. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0xFC000437, 0x00000000, 0x021C0000,
  326. 0x02000700, 0x00000000, 0x00FFFE00, 0x03FE6007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  327. 0x00001B87, 0x00000001, 0x01E00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  328. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  329. 0x00000007, 0x00000000, 0x00000000, 0x039E07D2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  330. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023CC700, 0x00000000, 0x00FFFE00,
  331. 0x00000007, 0x00030000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  332. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  333. 0x00000007, 0x00000000, 0x00000000, 0x038E07D6, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  334. 0x023D0709, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  335. 0x00000007, 0x00000000, 0x00000000, 0x029E1F8A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  336. 0x029C077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x02BD076C, 0x00000000, 0x00FFFE00,
  337. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  338. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  339. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  340. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  341. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0xFFFFFE00, 0x00000007, 0x00000000, 0x000001F8,
  342. 0x02000700, 0x00000000, 0x00FFFFFE, 0x00000007, 0xC0000000, 0x00002007, 0xFE000700, 0x00000003, 0x00FFFE00,
  343. 0x00000007, 0x00003C00, 0x00000600, 0xCE000700, 0xFF800000, 0x00FFFE01, 0x00000007, 0x3C000000, 0x00000000,
  344. 0x02000700, 0x000003FC, 0x00FFFE00, 0x00000007, 0x003C0000, 0x00001800, 0x02000700, 0x00000000, 0x00FFFE00,
  345. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  346. 0x02000700, 0x007FE000, 0x00FFFE00, 0x00000007, 0x03C00000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  347. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000047, 0x0000003E, 0x3C000000,
  348. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  349. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  350. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  351. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  352. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00001C00, 0x00FFFE00,
  353. 0x0000000F, 0x00000000, 0x0003C000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x000003C0, 0xC0000000,
  354. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  355. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  356. 0x029607C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  357. 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  358. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  359. 0x00000007, 0x00000000, 0x00000000, 0x03FFE7CF, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  360. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  361. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  362. 0x031727F1, 0x00000000, 0x00FFFE00, 0x00000007, 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  363. 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  364. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  365. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  366. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  367. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  368. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  369. 0x00000007, 0x00000000, 0x00000000, 0x025627F0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  370. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  371. 0x00000007, 0x00000000, 0x00000000, 0x039E07C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  372. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  373. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  374. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  375. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  376. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  377. 0x00000007, 0x00000000, 0x00000000
  378. },
  379. #if AC_USE_AMMUNATIONS
  380. ac_AmmuNationInfo[][] =
  381. {
  382. {200, 30}, {600, 30}, {1200, 10},
  383. {600, 15}, {800, 12}, {1000, 10},
  384. {500, 60}, {2000, 90}, {3500, 120},
  385. {4500, 90}, {300, 60}
  386. },
  387. Float:ac_AmmuNations[][] =
  388. {
  389. {296.5541, -38.5138, 1001.5156},
  390. {295.7008, -80.8109, 1001.5156},
  391. {290.1963, -109.7721, 1001.5156},
  392. {312.2592, -166.1385, 999.601}
  393. },
  394. #endif
  395. #if AC_USE_RESTAURANTS
  396. Float:ac_Restaurants[][] =
  397. {
  398. {374.0, -119.641, 1001.4922},
  399. {368.789, -6.857, 1001.8516},
  400. {375.566, -68.222, 1001.5151}
  401. },
  402. #endif
  403. #if AC_USE_PAYNSPRAY
  404. Float:ac_PayNSpray[][] =
  405. {
  406. {2064.2842, -1831.4736, 13.5469},
  407. {-2425.7822, 1022.1392, 50.3977},
  408. {-1420.5195, 2584.2305, 55.8433},
  409. {487.6401, -1739.9479, 11.1385},
  410. {1024.8651, -1024.087, 32.1016},
  411. {-1904.7019, 284.5968, 41.0469},
  412. {1975.2384, 2162.5088, 11.0703},
  413. {2393.4456, 1491.5537, 10.5616},
  414. {720.0854, -457.8807, 16.3359},
  415. {-99.9417, 1117.9048, 19.7417}
  416. },
  417. #endif
  418. #if AC_USE_VENDING_MACHINES
  419. Float:ac_vMachines[][] =
  420. {
  421. {-862.82, 1536.6, 21.98},
  422. {2271.72, -76.46, 25.96},
  423. {1277.83, 372.51, 18.95},
  424. {662.42, -552.16, 15.71},
  425. {201.01, -107.61, 0.89},
  426. {-253.74, 2597.95, 62.24},
  427. {-253.74, 2599.75, 62.24},
  428. {-76.03, 1227.99, 19.12},
  429. {-14.7, 1175.35, 18.95},
  430. {-1455.11, 2591.66, 55.23},
  431. {2352.17, -1357.15, 23.77},
  432. {2325.97, -1645.13, 14.21},
  433. {2139.51, -1161.48, 23.35},
  434. {2153.23, -1016.14, 62.23},
  435. {1928.73, -1772.44, 12.94},
  436. {1154.72, -1460.89, 15.15},
  437. {2480.85, -1959.27, 12.96},
  438. {2060.11, -1897.64, 12.92},
  439. {1729.78, -1943.04, 12.94},
  440. {1634.1, -2237.53, 12.89},
  441. {1789.21, -1369.26, 15.16},
  442. {-2229.18, 286.41, 34.7},
  443. {2319.99, 2532.85, 10.21},
  444. {2845.72, 1295.04, 10.78},
  445. {2503.14, 1243.69, 10.21},
  446. {2647.69, 1129.66, 10.21},
  447. {-2420.21, 984.57, 44.29},
  448. {-2420.17, 985.94, 44.29},
  449. {2085.77, 2071.35, 10.45},
  450. {1398.84, 2222.6, 10.42},
  451. {1659.46, 1722.85, 10.21},
  452. {1520.14, 1055.26, 10.0},
  453. {-1980.78, 142.66, 27.07},
  454. {-2118.96, -423.64, 34.72},
  455. {-2118.61, -422.41, 34.72},
  456. {-2097.27, -398.33, 34.72},
  457. {-2092.08, -490.05, 34.72},
  458. {-2063.27, -490.05, 34.72},
  459. {-2005.64, -490.05, 34.72},
  460. {-2034.46, -490.05, 34.72},
  461. {-2068.56, -398.33, 34.72},
  462. {-2039.85, -398.33, 34.72},
  463. {-2011.14, -398.33, 34.72},
  464. {-1350.11, 492.28, 10.58},
  465. {-1350.11, 493.85, 10.58},
  466. {2222.36, 1602.64, 1000.06},
  467. {2222.2, 1606.77, 1000.05},
  468. {2155.9, 1606.77, 1000.05},
  469. {2155.84, 1607.87, 1000.06},
  470. {2209.9, 1607.19, 1000.05},
  471. {2202.45, 1617.0, 1000.06},
  472. {2209.24, 1621.21, 1000.06},
  473. {2576.7, -1284.43, 1061.09},
  474. {330.67, 178.5, 1020.07},
  475. {331.92, 178.5, 1020.07},
  476. {350.9, 206.08, 1008.47},
  477. {361.56, 158.61, 1008.47},
  478. {371.59, 178.45, 1020.07},
  479. {374.89, 188.97, 1008.47},
  480. {-19.03, -57.83, 1003.63},
  481. {-36.14, -57.87, 1003.63},
  482. {316.87, -140.35, 998.58},
  483. {2225.2, -1153.42, 1025.9},
  484. {-15.1, -140.22, 1003.63},
  485. {-16.53, -140.29, 1003.63},
  486. {-35.72, -140.22, 1003.63},
  487. {373.82, -178.14, 1000.73},
  488. {379.03, -178.88, 1000.73},
  489. {495.96, -24.32, 1000.73},
  490. {500.56, -1.36, 1000.73},
  491. {501.82, -1.42, 1000.73},
  492. {-33.87, -186.76, 1003.63},
  493. {-32.44, -186.69, 1003.63},
  494. {-16.11, -91.64, 1003.63},
  495. {-17.54, -91.71, 1003.63}
  496. },
  497. #endif
  498. #if AC_USE_CASINOS
  499. Float:ac_Casinos[][] =
  500. {
  501. {2241.2878, 1617.1624, 1006.1797, 2.0},
  502. {2240.9736, 1604.6592, 1006.1797, 6.0},
  503. {2242.5427, 1592.8726, 1006.1836, 6.0},
  504. {2230.2124, 1592.1426, 1006.1832, 6.0},
  505. {2230.4717, 1604.484, 1006.186, 6.0},
  506. {2230.3298, 1616.9272, 1006.1799, 3.0},
  507. {2251.9407, 1586.1736, 1006.186, 1.0},
  508. {2218.6785, 1587.3448, 1006.1749, 1.0},
  509. {2219.2773, 1591.7467, 1006.1867, 1.0},
  510. {2218.5408, 1589.3229, 1006.184, 1.0},
  511. {2218.6477, 1593.6279, 1006.1797, 1.0},
  512. {2221.926, 1603.8285, 1006.1797, 1.0},
  513. {2218.5095, 1603.8385, 1006.1797, 1.0},
  514. {2219.9597, 1603.9216, 1006.1797, 1.0},
  515. {2216.3054, 1603.7996, 1006.1819, 1.0},
  516. {2218.731, 1619.8046, 1006.1794, 1.0},
  517. {2218.9407, 1617.8413, 1006.1821, 1.0},
  518. {2218.668, 1615.4681, 1006.1797, 1.0},
  519. {2218.6418, 1613.2629, 1006.1797, 1.0},
  520. {2252.4272, 1589.8412, 1006.1797, 5.0},
  521. {2252.4229, 1596.6169, 1006.1797, 5.0},
  522. {2255.1565, 1608.8784, 1006.186, 1.0},
  523. {2254.8496, 1610.8605, 1006.1797, 1.0},
  524. {2255.2917, 1612.9167, 1006.1797, 1.0},
  525. {2255.033, 1614.8892, 1006.1797, 1.0},
  526. {2255.1213, 1616.8284, 1006.1797, 1.0},
  527. {2255.2161, 1618.8005, 1006.1797, 1.0},
  528. {2268.5281, 1606.4894, 1006.1797, 1.0},
  529. {2270.4922, 1606.8539, 1006.1797, 1.0},
  530. {2272.5693, 1606.4473, 1006.1797, 1.0},
  531. {2274.5391, 1607.0122, 1006.1797, 1.0},
  532. {2271.8447, 1586.1633, 1006.1797, 1.0},
  533. {2261.4844, 1586.1724, 1006.1797, 1.0},
  534. {2257.4507, 1589.6555, 1006.1797, 5.0},
  535. {2267.8994, 1589.8672, 1006.1797, 5.0},
  536. {2262.8486, 1590.026, 1006.1797, 5.0},
  537. {2272.6458, 1589.7704, 1006.1797, 5.0},
  538. {2272.6533, 1596.5682, 1006.1797, 5.0},
  539. {2270.4895, 1596.4606, 1006.1797, 5.0},
  540. {2265.4441, 1596.4299, 1006.1797, 5.0},
  541. {2260.0308, 1596.7987, 1006.1797, 5.0},
  542. {2254.9907, 1596.241, 1006.1797, 5.0},
  543. {1956.9524, 988.2533, 992.4688, 2.0},
  544. {1961.6155, 993.0375, 992.4688, 2.0},
  545. {1963.7998, 998.4406, 992.4745, 2.0},
  546. {1936.2885, 987.1995, 992.4745, 2.0},
  547. {1944.9768, 986.3937, 992.4688, 2.0},
  548. {1940.7397, 990.9521, 992.4609, 2.0},
  549. {1940.0966, 1005.8996, 992.4688, 6.0},
  550. {1938.8785, 1014.1768, 992.4688, 6.0},
  551. {1938.8811, 1021.4434, 992.4688, 6.0},
  552. {1966.5975, 1006.6469, 992.4745, 6.0},
  553. {1966.5979, 1014.1024, 992.4688, 6.0},
  554. {1939.8351, 1029.912, 992.4688, 6.0},
  555. {1956.854, 1047.3718, 992.4688, 6.0},
  556. {1961.356, 1042.8112, 992.4688, 6.0},
  557. {1963.811, 1037.1263, 992.4745, 6.0},
  558. {1961.733, 1025.8929, 992.4688, 10.0},
  559. {1961.708, 1010.3194, 992.4688, 10.0},
  560. {1966.5989, 1029.7954, 992.4745, 6.0},
  561. {1961.4139, 1017.8281, 992.4688, 10.0},
  562. {1966.5985, 1021.7686, 992.4688, 6.0},
  563. {1128.7106, -1.9779, 1000.6797, 1.0},
  564. {1125.2388, 1.61, 1000.6797, 1.0},
  565. {1125.1249, -5.0489, 1000.6797, 1.0},
  566. {1127.4139, 3.0199, 1000.6797, 1.0},
  567. {1135.0634, -3.8695, 1000.6797, 1.0},
  568. {1135.0861, 0.6107, 1000.6797, 1.0},
  569. {1132.8943, -1.7139, 1000.6797, 1.0},
  570. {1125.3727, 3.0315, 1000.6797, 1.0},
  571. {1119.0272, -1.4916, 1000.6924, 1.0}
  572. },
  573. #endif
  574. ac_pAmmo[] =
  575. {
  576. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  577. 1, 1, 1, 8, 8, 8, 0, 0, 0, 30, 10, 10, 15,
  578. 10, 10, 60, 60, 80, 80, 60, 20, 10, 4, 3,
  579. 100, 100, 5, 1, 500, 200, 32, 1, 1, 1
  580. };
  581. enum acInfo
  582. {
  583. Float:acPosX,
  584. Float:acPosY,
  585. Float:acPosZ,
  586. Float:acDropJpX,
  587. Float:acDropJpY,
  588. Float:acDropJpZ,
  589. Float:acSetPosX,
  590. Float:acSetPosY,
  591. Float:acSetPosZ,
  592. Float:acSetVehHealth,
  593. Float:acSpeed,
  594. acHealth,
  595. acArmour,
  596. acMoney,
  597. acClassid,
  598. acLastShot,
  599. acLastWeapon,
  600. acEnterVehTime,
  601. acEnterVeh,
  602. acLastVeh,
  603. acVeh,
  604. acSeat,
  605. acDialog,
  606. acNextDialog,
  607. acAnim,
  608. acReload,
  609. acDmgRes,
  610. acSpecAct,
  611. acNextSpecAct,
  612. acLastSpecAct,
  613. acLastPickup,
  614. acShotTime,
  615. acSpawnTime,
  616. acLastUpdate,
  617. acSpawnWeapon1,
  618. acSpawnWeapon2,
  619. acSpawnWeapon3,
  620. acSpawnAmmo1,
  621. acSpawnAmmo2,
  622. acSpawnAmmo3,
  623. acSpawnRes,
  624. acTimerID,
  625. acKicked,
  626. acIp[16],
  627. acSet[15],
  628. acGtc[18],
  629. acWeapon[13],
  630. acAmmo[13],
  631. acSetWeapon[13],
  632. acGiveAmmo[13],
  633. acGtcSetWeapon[13],
  634. acGtcGiveAmmo[13],
  635. acNOPCount[11],
  636. acCheatCount[16],
  637. acCall[sizeof ac_Mtfc],
  638. acFloodCount[sizeof ac_Mtfc],
  639. bool:acACAllow[sizeof ac_ACAllow],
  640. bool:acStuntBonus,
  641. bool:acModShop,
  642. bool:acFreeze,
  643. bool:acOnline,
  644. bool:acLogged,
  645. bool:acDeathRes,
  646. bool:acVehDmgRes,
  647. bool:acDead,
  648. bool:acTpToZ,
  649. bool:acPicked,
  650. bool:acParachute,
  651. bool:acIntEnterExits,
  652. bool:acSpec
  653. }
  654. enum acVehInfo
  655. {
  656. Float:acVelX,
  657. Float:acVelY,
  658. Float:acVelZ,
  659. Float:acSpeedDiff,
  660. Float:acPosDiff,
  661. Float:acZAngle,
  662. Float:acHealth,
  663. acDriver,
  664. acInt,
  665. acPaintJob,
  666. bool:acSpawned
  667. }
  668. enum acPickInfo
  669. {
  670. Float:acPosX,
  671. Float:acPosY,
  672. Float:acPosZ,
  673. acType,
  674. acWeapon,
  675. bool:acIsStatic
  676. }
  677. enum acDPickInfo
  678. {
  679. Float:acPosX,
  680. Float:acPosY,
  681. Float:acPosZ,
  682. acType,
  683. acWeapon
  684. }
  685. static
  686. ac_sInfo[6],
  687. ac_Class[AC_MAX_CLASSES][3][2],
  688. ACInfo[MAX_PLAYERS][acInfo],
  689. ACVehInfo[MAX_VEHICLES][acVehInfo],
  690. ACPickInfo[MAX_PICKUPS][acPickInfo],
  691. ACDPickInfo[MAX_PICKUPS][acDPickInfo],
  692. bool:ac_IntEnterExits = true,
  693. bool:ac_StuntBonus = true,
  694. bool:ac_VehFriendlyFire,
  695. bool:ac_LagCompMode,
  696. #if !AC_USE_QUERY
  697. bool:ac_QueryEnable,
  698. #endif
  699. bool:ac_RconEnable,
  700. bool:ac_PedAnims;
  701. ac_fpublic ac_AddStaticVehicle(vehicleid)
  702. {
  703. ACVehInfo[vehicleid][acInt] = 0;
  704. ACVehInfo[vehicleid][acPaintJob] = 3;
  705. ACVehInfo[vehicleid][acSpawned] = true;
  706. ACVehInfo[vehicleid][acHealth] = 1000.0;
  707. ACVehInfo[vehicleid][acSpeedDiff] =
  708. ACVehInfo[vehicleid][acPosDiff] =
  709. ACVehInfo[vehicleid][acVelX] =
  710. ACVehInfo[vehicleid][acVelY] =
  711. ACVehInfo[vehicleid][acVelZ] = 0.0;
  712. ACVehInfo[vehicleid][acDriver] = 65535;
  713. return 1;
  714. }
  715. ac_fpublic ac_CreateVehicle(vehicleid, ac_vehicletype)
  716. {
  717. ACVehInfo[vehicleid][acInt] = 0;
  718. ACVehInfo[vehicleid][acPaintJob] = 3;
  719. ACVehInfo[vehicleid][acHealth] = 1000.0;
  720. ACVehInfo[vehicleid][acSpeedDiff] =
  721. ACVehInfo[vehicleid][acPosDiff] =
  722. ACVehInfo[vehicleid][acVelX] =
  723. ACVehInfo[vehicleid][acVelY] =
  724. ACVehInfo[vehicleid][acVelZ] = 0.0;
  725. if(!(569 <= ac_vehicletype <= 570)) ACVehInfo[vehicleid][acSpawned] = true;
  726. ACVehInfo[vehicleid][acDriver] = 65535;
  727. return 1;
  728. }
  729. ac_fpublic ac_AddPlayerClass(ac_classid, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)
  730. {
  731. if(ac_classid < AC_MAX_CLASSES)
  732. {
  733. ac_Class[ac_classid][0][0] = ac_weapon1;
  734. ac_Class[ac_classid][0][1] = ac_weapon1_ammo;
  735. ac_Class[ac_classid][1][0] = ac_weapon2;
  736. ac_Class[ac_classid][1][1] = ac_weapon2_ammo;
  737. ac_Class[ac_classid][2][0] = ac_weapon3;
  738. ac_Class[ac_classid][2][1] = ac_weapon3_ammo;
  739. }
  740. #undef AC_MAX_CLASSES
  741. return 1;
  742. }
  743. ac_fpublic ac_SetSpawnInfo(playerid, ac_team, ac_skin, Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_rotation, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)
  744. {
  745. if(SetSpawnInfo(playerid, ac_team, ac_skin, ac_x, ac_y, ac_z, ac_rotation, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo) == 0) return 0;
  746. ACInfo[playerid][acSpawnWeapon1] = ac_weapon1;
  747. ACInfo[playerid][acSpawnAmmo1] = ac_weapon1_ammo;
  748. ACInfo[playerid][acSpawnWeapon2] = ac_weapon2;
  749. ACInfo[playerid][acSpawnAmmo2] = ac_weapon2_ammo;
  750. ACInfo[playerid][acSpawnWeapon3] = ac_weapon3;
  751. ACInfo[playerid][acSpawnAmmo3] = ac_weapon3_ammo;
  752. return 1;
  753. }
  754. ac_fpublic ac_AddStaticPickup(pickupid, ac_model, ac_type, Float:ac_X, Float:ac_Y, Float:ac_Z)
  755. {
  756. ACPickInfo[pickupid][acWeapon] = 0;
  757. switch(ac_type)
  758. {
  759. case 2, 3, 15, 22:
  760. {
  761. switch(ac_model)
  762. {
  763. case 370: ACPickInfo[pickupid][acType] = 2;
  764. case 1240: ACPickInfo[pickupid][acType] = 3;
  765. case 1242: ACPickInfo[pickupid][acType] = 4;
  766. case 321..369, 371, 372:
  767. {
  768. for(new ac_i = 46; ac_i > -1; --ac_i)
  769. {
  770. if(ac_wModel[ac_i] == ac_model)
  771. {
  772. ACPickInfo[pickupid][acType] = 1;
  773. ACPickInfo[pickupid][acWeapon] = ac_i;
  774. break;
  775. }
  776. }
  777. }
  778. }
  779. }
  780. }
  781. ACPickInfo[pickupid][acIsStatic] = true;
  782. ACPickInfo[pickupid][acPosX] = ac_X;
  783. ACPickInfo[pickupid][acPosY] = ac_Y;
  784. ACPickInfo[pickupid][acPosZ] = ac_Z;
  785. return 1;
  786. }
  787. ac_fpublic ac_CreatePickup(pickupid, ac_model, ac_type, Float:ac_X, Float:ac_Y, Float:ac_Z)
  788. {
  789. ACPickInfo[pickupid][acWeapon] = 0;
  790. switch(ac_type)
  791. {
  792. case 2, 3, 15, 22:
  793. {
  794. switch(ac_model)
  795. {
  796. case 370: ACPickInfo[pickupid][acType] = 2;
  797. case 1240: ACPickInfo[pickupid][acType] = 3;
  798. case 1242: ACPickInfo[pickupid][acType] = 4;
  799. case 321..369, 371, 372:
  800. {
  801. for(new ac_i = 46; ac_i > -1; --ac_i)
  802. {
  803. if(ac_wModel[ac_i] == ac_model)
  804. {
  805. ACPickInfo[pickupid][acType] = 1;
  806. ACPickInfo[pickupid][acWeapon] = ac_i;
  807. break;
  808. }
  809. }
  810. }
  811. }
  812. }
  813. }
  814. ACPickInfo[pickupid][acIsStatic] = false;
  815. ACPickInfo[pickupid][acPosX] = ac_X;
  816. ACPickInfo[pickupid][acPosY] = ac_Y;
  817. ACPickInfo[pickupid][acPosZ] = ac_Z;
  818. return 1;
  819. }
  820. ac_fpublic ac_CreateDynamicPickup(pickupid, ac_modelid, ac_type, Float:ac_x, Float:ac_y, Float:ac_z)
  821. {
  822. if(pickupid < MAX_PICKUPS)
  823. {
  824. switch(ac_type)
  825. {
  826. case 2, 3, 15, 22:
  827. {
  828. switch(ac_modelid)
  829. {
  830. case 370: ACDPickInfo[pickupid][acType] = 2;
  831. case 1240: ACDPickInfo[pickupid][acType] = 3;
  832. case 1242: ACDPickInfo[pickupid][acType] = 4;
  833. case 321..369, 371, 372:
  834. {
  835. for(new ac_i = 46; ac_i > -1; --ac_i)
  836. {
  837. if(ac_wModel[ac_i] == ac_modelid)
  838. {
  839. ACDPickInfo[pickupid][acType] = 1;
  840. ACDPickInfo[pickupid][acWeapon] = ac_i;
  841. break;
  842. }
  843. }
  844. }
  845. }
  846. }
  847. }
  848. ACDPickInfo[pickupid][acPosX] = ac_x;
  849. ACDPickInfo[pickupid][acPosY] = ac_y;
  850. ACDPickInfo[pickupid][acPosZ] = ac_z;
  851. }
  852. return 1;
  853. }
  854. ac_fpublic ac_DestroyVehicle(vehicleid)
  855. {
  856. if(DestroyVehicle(vehicleid) == 0) return 0;
  857. ACVehInfo[vehicleid][acSpawned] = false;
  858. return 1;
  859. }
  860. ac_fpublic ac_DestroyPickup(pickupid)
  861. {
  862. if(DestroyPickup(pickupid) == 0) return 0;
  863. ACPickInfo[pickupid][acType] = 0;
  864. return 1;
  865. }
  866. #if defined DestroyDynamicPickup
  867. #if defined STREAMER_ENABLE_TAGS
  868. ac_fpublic ac_DestroyDynamicPickup(STREAMER_TAG_PICKUP pickupid)
  869. #else
  870. ac_fpublic ac_DestroyDynamicPickup(pickupid)
  871. #endif
  872. {
  873. if(DestroyDynamicPickup(pickupid) == 0) return 0;
  874. if(_:pickupid < MAX_PICKUPS) ACDPickInfo[_:pickupid][acType] = 0;
  875. return 1;
  876. }
  877. #endif
  878. #if defined DestroyAllDynamicPickups
  879. ac_fpublic ac_DestroyAllDynamicPickups()
  880. {
  881. if(DestroyAllDynamicPickups() == 0) return 0;
  882. #if defined STREAMER_ENABLE_TAGS
  883. new STREAMER_TAG_PICKUP ac_i;
  884. #if defined Streamer_GetUpperBound
  885. if((_:ac_i = Streamer_GetUpperBound(1)) >= MAX_PICKUPS) ac_i = STREAMER_TAG_PICKUP (MAX_PICKUPS - 1);
  886. #else
  887. ac_i = STREAMER_TAG_PICKUP (MAX_PICKUPS - 1);
  888. #endif
  889. #else
  890. new ac_i;
  891. #if defined Streamer_GetUpperBound
  892. if((ac_i = Streamer_GetUpperBound(1)) >= MAX_PICKUPS) ac_i = MAX_PICKUPS - 1;
  893. #else
  894. ac_i = MAX_PICKUPS - 1;
  895. #endif
  896. #endif
  897. for(; _:ac_i > -1; --ac_i) ACDPickInfo[_:ac_i][acType] = 0;
  898. return 1;
  899. }
  900. #endif
  901. ac_fpublic ac_DisableInteriorEnterExits()
  902. {
  903. ac_IntEnterExits = false;
  904. return DisableInteriorEnterExits();
  905. }
  906. ac_fpublic ac_UsePlayerPedAnims()
  907. {
  908. ac_PedAnims = true;
  909. return UsePlayerPedAnims();
  910. }
  911. ac_fpublic ac_EnableVehicleFriendlyFire()
  912. {
  913. ac_VehFriendlyFire = true;
  914. return EnableVehicleFriendlyFire();
  915. }
  916. ac_fpublic ac_EnableStuntBonusForAll(enable)
  917. {
  918. ac_StuntBonus = !!enable;
  919. #if defined foreach
  920. foreach(new ac_i : Player)
  921. #else
  922. for(new ac_i = GetPlayerPoolSize(); ac_i > -1; --ac_i)
  923. {
  924. if(IsPlayerConnected(ac_i))
  925. #endif
  926. {
  927. ACInfo[ac_i][acStuntBonus] = ac_StuntBonus;
  928. }
  929. #if !defined foreach
  930. }
  931. #endif
  932. return EnableStuntBonusForAll(enable);
  933. }
  934. ac_fpublic ac_EnableStuntBonusForPlayer(playerid, enable)
  935. {
  936. if(EnableStuntBonusForPlayer(playerid, enable) == 0) return 0;
  937. ACInfo[playerid][acStuntBonus] = !!enable;
  938. return 1;
  939. }
  940. ac_fpublic ac_ShowPlayerDialog(playerid, dialogid)
  941. {
  942. ACInfo[playerid][acDialog] = dialogid;
  943. return 1;
  944. }
  945. ac_fpublic ac_fs_ShowPlayerDialog(playerid, dialogid)
  946. {
  947. ACInfo[playerid][acNextDialog] = dialogid;
  948. return 1;
  949. }
  950. ac_fpublic ac_TogglePlayerControllable(playerid, toggle)
  951. {
  952. if(TogglePlayerControllable(playerid, toggle) == 0) return 0;
  953. ACInfo[playerid][acFreeze] = !!toggle;
  954. return 1;
  955. }
  956. ac_fpublic ac_TogglePlayerSpectating(playerid, toggle)
  957. {
  958. if(TogglePlayerSpectating(playerid, toggle) == 0) return 0;
  959. if(GetPlayerState(playerid) == 9)
  960. {
  961. if(toggle == 0)
  962. {
  963. ACInfo[playerid][acSpec] = false;
  964. ACInfo[playerid][acSet][7] = 1;
  965. ACInfo[playerid][acSpawnRes]++;
  966. ACInfo[playerid][acNOPCount][9] = 0;
  967. if(ACInfo[playerid][acSet][0] != -1) ACInfo[playerid][acSet][12] = ACInfo[playerid][acSet][0];
  968. ACInfo[playerid][acGtc][13] = GetTickCount();
  969. }
  970. }
  971. else if(toggle)
  972. {
  973. ACInfo[playerid][acSet][6] = 1;
  974. ACInfo[playerid][acNOPCount][8] = 0;
  975. ACInfo[playerid][acGtc][12] = GetTickCount();
  976. }
  977. return 1;
  978. }
  979. ac_fpublic ac_SpawnPlayer(playerid)
  980. {
  981. if(SpawnPlayer(playerid) == 0) return 0;
  982. ACInfo[playerid][acSet][7] = 2;
  983. ACInfo[playerid][acSpawnRes]++;
  984. ACInfo[playerid][acSpawnTime] =
  985. ACInfo[playerid][acNOPCount][9] = 0;
  986. if(ACInfo[playerid][acSet][0] != -1) ACInfo[playerid][acSet][12] = ACInfo[playerid][acSet][0];
  987. ACInfo[playerid][acGtc][13] = GetTickCount();
  988. return 1;
  989. }
  990. ac_fpublic ac_SetPlayerHealth(playerid, Float:ac_health)
  991. {
  992. if(SetPlayerHealth(playerid, ac_health) == 0) return 0;
  993. if(ac_health < 0.0) ac_health = 0.0;
  994. ACInfo[playerid][acNOPCount][3] = 0;
  995. ACInfo[playerid][acSet][1] = floatround(ac_health, floatround_tozero);
  996. ACInfo[playerid][acGtc][3] = GetTickCount();
  997. return 1;
  998. }
  999. ac_fpublic ac_SetPlayerArmour(playerid, Float:ac_armour)
  1000. {
  1001. if(SetPlayerArmour(playerid, ac_armour) == 0) return 0;
  1002. if(ac_armour < 0.0) ac_armour = 0.0;
  1003. ACInfo[playerid][acNOPCount][5] = 0;
  1004. ACInfo[playerid][acSet][2] = floatround(ac_armour, floatround_tozero);
  1005. ACInfo[playerid][acGtc][5] = GetTickCount();
  1006. return 1;
  1007. }
  1008. ac_fpublic ac_GivePlayerWeapon(playerid, ac_weaponid, ac_ammo)
  1009. {
  1010. if(0 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 46)
  1011. {
  1012. ACInfo[playerid][acNOPCount][0] = ACInfo[playerid][acNOPCount][1] = 0;
  1013. if(16 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 43)
  1014. {
  1015. if(ACInfo[playerid][acAmmo][ac_wSlot[ac_weaponid]] || ac_ammo)
  1016. {
  1017. if(3 <= ac_wSlot[ac_weaponid] <= 5 || (ACInfo[playerid][acSetWeapon][ac_wSlot[ac_weaponid]] == -1
  1018. ? ACInfo[playerid][acWeapon][ac_wSlot[ac_weaponid]] : ACInfo[playerid][acSetWeapon][ac_wSlot[ac_weaponid]]) == ac_weaponid)
  1019. {
  1020. ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_weaponid]] =
  1021. (ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_weaponid]] == -65535 ? ACInfo[playerid][acAmmo][ac_wSlot[ac_weaponid]]
  1022. : ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_weaponid]]) + ac_ammo;
  1023. }
  1024. else ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_weaponid]] = ac_ammo;
  1025. if(ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_weaponid]] < -32768) ac_ammo =
  1026. ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_weaponid]] = -32768;
  1027. else if(ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_weaponid]] > 32767) ac_ammo =
  1028. ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_weaponid]] = 32767;
  1029. ACInfo[playerid][acSetWeapon][ac_wSlot[ac_weaponid]] = ACInfo[playerid][acSet][3] = ac_weaponid;
  1030. }
  1031. }
  1032. else
  1033. {
  1034. ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_weaponid]] = -65535;
  1035. ACInfo[playerid][acSetWeapon][ac_wSlot[ac_weaponid]] = ACInfo[playerid][acSet][3] = ac_weaponid;
  1036. }
  1037. GivePlayerWeapon(playerid, ac_weaponid, ac_ammo);
  1038. ACInfo[playerid][acGtcGiveAmmo][ac_wSlot[ac_weaponid]] =
  1039. ACInfo[playerid][acGtcSetWeapon][ac_wSlot[ac_weaponid]] = ACInfo[playerid][acGtc][2] = GetTickCount() + 900;
  1040. }
  1041. return 1;
  1042. }
  1043. ac_fpublic ac_SetPlayerAmmo(playerid, ac_weaponslot, ac_ammo)
  1044. {
  1045. if(ac_ammo < -32768) ac_ammo = -32768;
  1046. else if(ac_ammo > 32767) ac_ammo = 32767;
  1047. SetPlayerAmmo(playerid, ac_weaponslot, ac_ammo);
  1048. if(16 <= ac_weaponslot <= 43 && (ACInfo[playerid][acWeapon][ac_wSlot[ac_weaponslot]] > 0 ||
  1049. ACInfo[playerid][acSetWeapon][ac_wSlot[ac_weaponslot]] > 0))
  1050. {
  1051. ACInfo[playerid][acNOPCount][1] = 0;
  1052. ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_weaponslot]] = ac_ammo;
  1053. ACInfo[playerid][acGtcGiveAmmo][ac_wSlot[ac_weaponslot]] = GetTickCount();
  1054. }
  1055. return 1;
  1056. }
  1057. ac_fpublic ac_SetPlayerArmedWeapon(playerid, ac_weaponid)
  1058. {
  1059. if(SetPlayerArmedWeapon(playerid, ac_weaponid) == 0) return 0;
  1060. if((0 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 46) &&
  1061. (ac_weaponid == ACInfo[playerid][acWeapon][ac_wSlot[ac_weaponid]] ||
  1062. ac_weaponid == ACInfo[playerid][acSetWeapon][ac_wSlot[ac_weaponid]]) &&
  1063. (ACInfo[playerid][acAmmo][ac_wSlot[ac_weaponid]] || ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_weaponid]]))
  1064. {
  1065. ACInfo[playerid][acNOPCount][0] = 0;
  1066. ACInfo[playerid][acSet][3] = ac_weaponid;
  1067. ACInfo[playerid][acGtc][2] = GetTickCount() + 900;
  1068. }
  1069. return 1;
  1070. }
  1071. ac_fpublic ac_ResetPlayerWeapons(playerid)
  1072. {
  1073. if(ResetPlayerWeapons(playerid) == 0) return 0;
  1074. for(new ac_i = 12; ac_i > -1; --ac_i)
  1075. {
  1076. ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acAmmo][ac_i] = 0;
  1077. ACInfo[playerid][acSetWeapon][ac_i] = -1;
  1078. ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  1079. }
  1080. ACInfo[playerid][acSet][3] = 0;
  1081. ACInfo[playerid][acGtc][7] = GetTickCount();
  1082. return 1;
  1083. }
  1084. ac_fpublic ac_GivePlayerMoney(playerid, ac_money)
  1085. {
  1086. if(GivePlayerMoney(playerid, ac_money) == 0) return 0;
  1087. ACInfo[playerid][acMoney] += ac_money;
  1088. return 1;
  1089. }
  1090. ac_fpublic ac_ResetPlayerMoney(playerid)
  1091. {
  1092. if(ResetPlayerMoney(playerid) == 0) return 0;
  1093. ACInfo[playerid][acMoney] = 0;
  1094. return 1;
  1095. }
  1096. static stock bad_GetPlayerMoney(playerid) return GetPlayerMoney(playerid);
  1097. ac_fpublic ac_GetPlayerMoney(playerid) return ACInfo[playerid][acMoney];
  1098. ac_fpublic ac_SetPlayerSpecialAction(playerid, ac_actionid)
  1099. {
  1100. if(SetPlayerSpecialAction(playerid, ac_actionid) == 0) return 0;
  1101. if(ac_actionid == 2 || ac_actionid == 11 || ac_actionid == 68 || 5 <= ac_actionid <= 8 ||
  1102. ac_actionid == 13 && ACInfo[playerid][acSpecAct] == 11 || (ac_actionid == 10 || 20 <= ac_actionid <= 25) && ACInfo[playerid][acSpecAct] != 3 ||
  1103. ac_actionid == 0 && ACInfo[playerid][acSpecAct] != 1 && ACInfo[playerid][acSpecAct] != 3 && ACInfo[playerid][acSpecAct] != 10)
  1104. {
  1105. ACInfo[playerid][acNOPCount][6] = 0;
  1106. if((ac_actionid == 68 || 10 <= ac_actionid <= 11 || 20 <= ac_actionid <= 25) && 5 <= ACInfo[playerid][acSpecAct] <= 8 ||
  1107. 20 <= ac_actionid <= 25 && ACInfo[playerid][acSpecAct] == 1) ACInfo[playerid][acNextSpecAct] = ac_actionid;
  1108. else
  1109. {
  1110. if(ac_actionid == 13) ac_actionid = 0;
  1111. else if(ac_actionid == 2) ACInfo[playerid][acNextSpecAct] = ACInfo[playerid][acSpecAct];
  1112. else ACInfo[playerid][acNextSpecAct] = -1;
  1113. ACInfo[playerid][acSet][4] = ac_actionid;
  1114. ACInfo[playerid][acGtc][6] = GetTickCount();
  1115. if(ACInfo[playerid][acSpecAct] == 11) ACInfo[playerid][acGtc][6] += 2500;
  1116. }
  1117. }
  1118. return 1;
  1119. }
  1120. ac_fpublic ac_SetPlayerInterior(playerid, ac_interiorid)
  1121. {
  1122. if(SetPlayerInterior(playerid, ac_interiorid) == 0) return 0;
  1123. if(ac_interiorid < 0) ac_interiorid %= 256;
  1124. if(ac_interiorid != ACInfo[playerid][acSet][14])
  1125. {
  1126. ACInfo[playerid][acNOPCount][2] = 0;
  1127. if(ACInfo[playerid][acDead]) ACInfo[playerid][acSet][12] = ac_interiorid;
  1128. else ACInfo[playerid][acSet][0] = ac_interiorid;
  1129. ACInfo[playerid][acSet][14] = ac_interiorid;
  1130. ACInfo[playerid][acGtc][0] = GetTickCount();
  1131. }
  1132. return 1;
  1133. }
  1134. ac_fpublic ac_SetPlayerPos(playerid, Float:ac_x, Float:ac_y, Float:ac_z)
  1135. {
  1136. if(SetPlayerPos(playerid, ac_x, ac_y, ac_z) == 0) return 0;
  1137. ACInfo[playerid][acSet][8] = 1;
  1138. ACInfo[playerid][acNOPCount][10] = 0;
  1139. ACInfo[playerid][acSetPosX] = ac_x;
  1140. ACInfo[playerid][acSetPosY] = ac_y;
  1141. ACInfo[playerid][acSetPosZ] = ac_z;
  1142. ACInfo[playerid][acGtc][11] = GetTickCount();
  1143. return 1;
  1144. }
  1145. ac_fpublic ac_SetPlayerPosFindZ(playerid, Float:ac_x, Float:ac_y, Float:ac_z)
  1146. {
  1147. if(SetPlayerPosFindZ(playerid, ac_x, ac_y, ac_z) == 0) return 0;
  1148. ACInfo[playerid][acSet][8] = 2;
  1149. ACInfo[playerid][acTpToZ] = true;
  1150. ACInfo[playerid][acNOPCount][10] = 0;
  1151. ACInfo[playerid][acSetPosX] = ac_x;
  1152. ACInfo[playerid][acSetPosY] = ac_y;
  1153. ACInfo[playerid][acGtc][11] = GetTickCount();
  1154. return 1;
  1155. }
  1156. ac_fpublic ac_SetPlayerVelocity(playerid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1157. {
  1158. if(SetPlayerVelocity(playerid, ac_X, ac_Y, ac_Z) == 0) return 0;
  1159. ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_X, ac_Y, ac_Z);
  1160. ACInfo[playerid][acGtc][10] = GetTickCount();
  1161. return 1;
  1162. }
  1163. ac_fpublic ac_PutPlayerInVehicle(playerid, ac_vehicleid, ac_seatid)
  1164. {
  1165. if(PutPlayerInVehicle(playerid, ac_vehicleid, ac_seatid) == 0) return 0;
  1166. if(!(5 <= ACInfo[playerid][acSpecAct] <= 8) && !(20 <= ACInfo[playerid][acSpecAct] <= 23) &&
  1167. ac_IsVehicleSeatOccupied(ac_vehicleid, ac_seatid) == 0)
  1168. {
  1169. new ac_model = GetVehicleModel(ac_vehicleid) - 400;
  1170. ACInfo[playerid][acNOPCount][7] = 0;
  1171. ACInfo[playerid][acSet][9] = ac_vehicleid;
  1172. if(ac_seatid > ac_MaxPassengers[ac_model >>> 3] >>> ((ac_model & 7) << 2) & 0xF) ACInfo[playerid][acSet][5] = -1;
  1173. else ACInfo[playerid][acSet][5] = ac_seatid;
  1174. ACInfo[playerid][acSet][11] = -1;
  1175. ACInfo[playerid][acGtc][1] = GetTickCount();
  1176. }
  1177. return 1;
  1178. }
  1179. ac_fpublic ac_RemovePlayerFromVehicle(playerid)
  1180. {
  1181. if(RemovePlayerFromVehicle(playerid) == 0) return 0;
  1182. ACInfo[playerid][acSet][11] = 1;
  1183. ACInfo[playerid][acGtc][8] = GetTickCount() + 3000;
  1184. return 1;
  1185. }
  1186. ac_fpublic ac_SetVehiclePos(vehicleid, Float:ac_x, Float:ac_y, Float:ac_z)
  1187. {
  1188. if(SetVehiclePos(vehicleid, ac_x, ac_y, ac_z) == 0) return 0;
  1189. ACVehInfo[vehicleid][acVelX] = ACVehInfo[vehicleid][acVelY] =
  1190. ACVehInfo[vehicleid][acVelZ] = 0.0;
  1191. if(ACVehInfo[vehicleid][acDriver] != 65535)
  1192. {
  1193. ACInfo[ACVehInfo[vehicleid][acDriver]][acSet][8] = 3;
  1194. ACInfo[ACVehInfo[vehicleid][acDriver]][acNOPCount][10] = 0;
  1195. ACInfo[ACVehInfo[vehicleid][acDriver]][acSetPosX] = ac_x;
  1196. ACInfo[ACVehInfo[vehicleid][acDriver]][acSetPosY] = ac_y;
  1197. ACInfo[ACVehInfo[vehicleid][acDriver]][acSetPosZ] = ac_z;
  1198. ACInfo[ACVehInfo[vehicleid][acDriver]][acGtc][11] =
  1199. ACInfo[ACVehInfo[vehicleid][acDriver]][acGtc][9] = GetTickCount();
  1200. }
  1201. return 1;
  1202. }
  1203. ac_fpublic ac_SetVehicleVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1204. {
  1205. if(SetVehicleVelocity(vehicleid, ac_X, ac_Y, ac_Z) == 0) return 0;
  1206. if(ACVehInfo[vehicleid][acDriver] != 65535)
  1207. {
  1208. ACVehInfo[vehicleid][acVelX] = ac_X;
  1209. ACVehInfo[vehicleid][acVelY] = ac_Y;
  1210. ACVehInfo[vehicleid][acVelZ] = ac_Z;
  1211. ACInfo[ACVehInfo[vehicleid][acDriver]][acGtc][9] = GetTickCount();
  1212. }
  1213. return 1;
  1214. }
  1215. ac_fpublic ac_SetVehicleAngularVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1216. {
  1217. if(SetVehicleAngularVelocity(vehicleid, ac_X, ac_Y, ac_Z) == 0) return 0;
  1218. if(ACVehInfo[vehicleid][acDriver] != 65535)
  1219. {
  1220. ACVehInfo[vehicleid][acVelX] = ac_X;
  1221. ACVehInfo[vehicleid][acVelY] = ac_Y;
  1222. ACVehInfo[vehicleid][acVelZ] = ac_Z;
  1223. ACInfo[ACVehInfo[vehicleid][acDriver]][acGtc][9] = GetTickCount();
  1224. }
  1225. return 1;
  1226. }
  1227. ac_fpublic ac_LinkVehicleToInterior(vehicleid, ac_interiorid)
  1228. {
  1229. if(LinkVehicleToInterior(vehicleid, ac_interiorid) == 0) return 0;
  1230. if(ac_interiorid < 0) ac_interiorid %= 256;
  1231. ACVehInfo[vehicleid][acInt] = ac_interiorid;
  1232. return 1;
  1233. }
  1234. ac_fpublic ac_ChangeVehiclePaintjob(vehicleid, ac_paintjobid)
  1235. {
  1236. if(ChangeVehiclePaintjob(vehicleid, ac_paintjobid) == 0) return 0;
  1237. ACVehInfo[vehicleid][acPaintJob] = ac_paintjobid;
  1238. return 1;
  1239. }
  1240. ac_fpublic ac_SetVehicleHealth(vehicleid, Float:ac_health)
  1241. {
  1242. if(SetVehicleHealth(vehicleid, ac_health) == 0) return 0;
  1243. if(ACVehInfo[vehicleid][acDriver] != 65535)
  1244. {
  1245. ACInfo[ACVehInfo[vehicleid][acDriver]][acNOPCount][4] = 0;
  1246. ACInfo[ACVehInfo[vehicleid][acDriver]][acSetVehHealth] = ac_health;
  1247. ACInfo[ACVehInfo[vehicleid][acDriver]][acGtc][4] = GetTickCount();
  1248. }
  1249. else ACVehInfo[vehicleid][acHealth] = ac_health;
  1250. return 1;
  1251. }
  1252. ac_fpublic ac_RepairVehicle(vehicleid)
  1253. {
  1254. if(RepairVehicle(vehicleid) == 0) return 0;
  1255. if(ACVehInfo[vehicleid][acDriver] != 65535)
  1256. {
  1257. ACInfo[ACVehInfo[vehicleid][acDriver]][acNOPCount][4] = 0;
  1258. ACInfo[ACVehInfo[vehicleid][acDriver]][acSetVehHealth] = 1000.0;
  1259. ACInfo[ACVehInfo[vehicleid][acDriver]][acGtc][4] = GetTickCount();
  1260. }
  1261. else ACVehInfo[vehicleid][acHealth] = 1000.0;
  1262. return 1;
  1263. }
  1264. ac_fpublic ac_SetVehicleToRespawn(vehicleid)
  1265. {
  1266. if(ACVehInfo[vehicleid][acDriver] != 65535) ACInfo[ACVehInfo[vehicleid][acDriver]][acGtc][9] = GetTickCount();
  1267. return SetVehicleToRespawn(vehicleid);
  1268. }
  1269. ac_fpublic ac_EnableAntiCheat(acid, enable)
  1270. {
  1271. if(!(0 <= acid < sizeof ac_ACAllow)) return 0;
  1272. if(acid == 42)
  1273. {
  1274. if(enable)
  1275. {
  1276. if(ac_ACAllow[acid] == false)
  1277. {
  1278. #if !AC_USE_QUERY
  1279. ac_QueryEnable = !!GetConsoleVarAsBool("query");
  1280. #endif
  1281. ac_RconEnable = !!GetConsoleVarAsBool("rcon");
  1282. }
  1283. #if !AC_USE_QUERY
  1284. SendRconCommand("query 0");
  1285. #endif
  1286. SendRconCommand("rcon 0");
  1287. }
  1288. else
  1289. {
  1290. static ac_strtmp[9];
  1291. #if !AC_USE_QUERY
  1292. format(ac_strtmp, sizeof ac_strtmp, "query %b", ac_QueryEnable);
  1293. SendRconCommand(ac_strtmp);
  1294. #endif
  1295. format(ac_strtmp, sizeof ac_strtmp, "rcon %b", ac_RconEnable);
  1296. SendRconCommand(ac_strtmp);
  1297. }
  1298. }
  1299. ac_ACAllow[acid] = !!enable;
  1300. #if defined foreach
  1301. foreach(new ac_i : Player)
  1302. #else
  1303. for(new ac_i = GetPlayerPoolSize(); ac_i > -1; --ac_i)
  1304. {
  1305. if(IsPlayerConnected(ac_i))
  1306. #endif
  1307. {
  1308. ACInfo[ac_i][acACAllow][acid] = ac_ACAllow[acid];
  1309. if(enable)
  1310. {
  1311. switch(acid)
  1312. {
  1313. case 7: ACInfo[ac_i][acCheatCount][15] = 0;
  1314. case 8: ACInfo[ac_i][acCheatCount][3] = 0;
  1315. case 15: ACInfo[ac_i][acCheatCount][10] = 0;
  1316. case 17: ACInfo[ac_i][acCheatCount][7] = 0;
  1317. case 19: ACInfo[ac_i][acCheatCount][9] = 0;
  1318. case 20: ACInfo[ac_i][acCheatCount][11] = 0;
  1319. case 23: ACInfo[ac_i][acCheatCount][12] = 0;
  1320. case 26: ACInfo[ac_i][acCheatCount][14] = ACInfo[ac_i][acCheatCount][8] = 0;
  1321. case 29: ACInfo[ac_i][acCheatCount][13] = ACInfo[ac_i][acCheatCount][6] = 0;
  1322. case 31: ACInfo[ac_i][acCheatCount][4] = 0;
  1323. case 34: ACInfo[ac_i][acCheatCount][5] = 0;
  1324. case 38: ACInfo[ac_i][acCheatCount][0] = 0;
  1325. }
  1326. }
  1327. }
  1328. #if !defined foreach
  1329. }
  1330. #endif
  1331. return 1;
  1332. }
  1333. ac_fpublic ac_EnableAntiCheatForPlayer(playerid, acid, enable)
  1334. {
  1335. if(!(0 <= acid < sizeof ac_ACAllow)) return 0;
  1336. ACInfo[playerid][acACAllow][acid] = !!enable;
  1337. if(enable)
  1338. {
  1339. switch(acid)
  1340. {
  1341. case 7: ACInfo[playerid][acCheatCount][15] = 0;
  1342. case 8: ACInfo[playerid][acCheatCount][3] = 0;
  1343. case 15: ACInfo[playerid][acCheatCount][10] = 0;
  1344. case 17: ACInfo[playerid][acCheatCount][7] = 0;
  1345. case 19: ACInfo[playerid][acCheatCount][9] = 0;
  1346. case 20: ACInfo[playerid][acCheatCount][11] = 0;
  1347. case 23: ACInfo[playerid][acCheatCount][12] = 0;
  1348. case 26: ACInfo[playerid][acCheatCount][14] = ACInfo[playerid][acCheatCount][8] = 0;
  1349. case 29: ACInfo[playerid][acCheatCount][13] = ACInfo[playerid][acCheatCount][6] = 0;
  1350. case 31: ACInfo[playerid][acCheatCount][4] = 0;
  1351. case 34: ACInfo[playerid][acCheatCount][5] = 0;
  1352. case 38: ACInfo[playerid][acCheatCount][0] = 0;
  1353. }
  1354. }
  1355. return 1;
  1356. }
  1357. ac_fpublic ac_IsAntiCheatEnabled(acid)
  1358. {
  1359. if(!(0 <= acid < sizeof ac_ACAllow)) return 0;
  1360. return ac_ACAllow[acid];
  1361. }
  1362. ac_fpublic ac_IsAntiCheatEnabledForPlayer(playerid, acid)
  1363. {
  1364. if(!(0 <= acid < sizeof ac_ACAllow)) return 0;
  1365. return ACInfo[playerid][acACAllow][acid];
  1366. }
  1367. ac_fpublic ac_AntiCheatGetAnimationIndex(playerid) return ACInfo[playerid][acAnim];
  1368. ac_fpublic ac_AntiCheatGetDialog(playerid) return ACInfo[playerid][acDialog];
  1369. ac_fpublic ac_AntiCheatGetMoney(playerid) return ACInfo[playerid][acMoney];
  1370. ac_fpublic ac_AntiCheatGetClass(playerid) return ACInfo[playerid][acClassid];
  1371. ac_fpublic ac_AntiCheatGetEnterVehicle(playerid) return ACInfo[playerid][acEnterVeh];
  1372. ac_fpublic ac_AntiCheatGetVehicleID(playerid) return ACInfo[playerid][acVeh];
  1373. ac_fpublic ac_AntiCheatGetWeapon(playerid) return ACInfo[playerid][acLastWeapon];
  1374. ac_fpublic ac_AntiCheatGetVehicleSeat(playerid) return ACInfo[playerid][acSeat];
  1375. ac_fpublic ac_AntiCheatGetSpecialAction(playerid) return ACInfo[playerid][acSpecAct];
  1376. ac_fpublic ac_AntiCheatGetLastSpecialActio(playerid) return ACInfo[playerid][acLastSpecAct];
  1377. ac_fpublic ac_AntiCheatGetLastShotWeapon(playerid) return ACInfo[playerid][acLastShot];
  1378. ac_fpublic ac_AntiCheatGetLastPickup(playerid) return ACInfo[playerid][acLastPickup];
  1379. ac_fpublic ac_AntiCheatGetLastUpdateTime(playerid) return ACInfo[playerid][acLastUpdate];
  1380. ac_fpublic ac_AntiCheatGetLastReloadTime(playerid) return ACInfo[playerid][acReload];
  1381. ac_fpublic ac_AntiCheatGetLastEnteredVehTi(playerid) return ACInfo[playerid][acEnterVehTime];
  1382. ac_fpublic ac_AntiCheatGetLastShotTime(playerid) return ACInfo[playerid][acShotTime];
  1383. ac_fpublic ac_AntiCheatGetLastSpawnTime(playerid) return ACInfo[playerid][acSpawnTime];
  1384. ac_fpublic ac_AntiCheatIntEnterExitsIsEnab(playerid) return ACInfo[playerid][acIntEnterExits];
  1385. ac_fpublic ac_AntiCheatStuntBonusIsEnabled(playerid) return ACInfo[playerid][acStuntBonus];
  1386. ac_fpublic ac_AntiCheatIsInModShop(playerid) return ACInfo[playerid][acModShop];
  1387. ac_fpublic ac_AntiCheatIsFrozen(playerid) return ACInfo[playerid][acFreeze];
  1388. ac_fpublic ac_AntiCheatIsDead(playerid) return ACInfo[playerid][acDead];
  1389. ac_fpublic ac_AntiCheatIsConnected(playerid) return ACInfo[playerid][acOnline];
  1390. ac_fpublic ac_AntiCheatGetNextDialog(playerid) return ACInfo[playerid][acNextDialog];
  1391. #endif
  1392. stock acc_AddStaticVehicle(ac_modelid, Float:ac_spawn_x, Float:ac_spawn_y, Float:ac_spawn_z, Float:ac_z_angle, ac_color1, ac_color2)
  1393. {
  1394. new ac_vehicleid = AddStaticVehicle(ac_modelid, ac_spawn_x, ac_spawn_y, ac_spawn_z, ac_z_angle, ac_color1, ac_color2);
  1395. if(ac_vehicleid != 65535)
  1396. {
  1397. #if defined FILTERSCRIPT
  1398. CallRemoteFunction("ac_AddStaticVehicle", "i", ac_vehicleid);
  1399. #else
  1400. ac_AddStaticVehicle(ac_vehicleid);
  1401. #endif
  1402. }
  1403. return ac_vehicleid;
  1404. }
  1405. #if defined _ALS_AddStaticVehicle
  1406. #undef AddStaticVehicle
  1407. #else
  1408. #define _ALS_AddStaticVehicle
  1409. #endif
  1410. #define AddStaticVehicle acc_AddStaticVehicle
  1411. stock acc_AddStaticVehicleEx(ac_modelid, Float:ac_spawn_x, Float:ac_spawn_y, Float:ac_spawn_z, Float:ac_z_angle, ac_color1, ac_color2, ac_respawn_delay, ac_addsiren = 0)
  1412. {
  1413. new ac_vehicleid = AddStaticVehicleEx(ac_modelid, ac_spawn_x, ac_spawn_y, ac_spawn_z, ac_z_angle, ac_color1, ac_color2, ac_respawn_delay, ac_addsiren);
  1414. if(ac_vehicleid != 65535)
  1415. {
  1416. #if defined FILTERSCRIPT
  1417. CallRemoteFunction("ac_AddStaticVehicle", "i", ac_vehicleid);
  1418. #else
  1419. ac_AddStaticVehicle(ac_vehicleid);
  1420. #endif
  1421. }
  1422. return ac_vehicleid;
  1423. }
  1424. #if defined _ALS_AddStaticVehicleEx
  1425. #undef AddStaticVehicleEx
  1426. #else
  1427. #define _ALS_AddStaticVehicleEx
  1428. #endif
  1429. #define AddStaticVehicleEx acc_AddStaticVehicleEx
  1430. stock acc_CreateVehicle(ac_vehicletype, Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_rotation, ac_color1, ac_color2, ac_respawn_delay, ac_addsiren = 0)
  1431. {
  1432. new ac_vehicleid = CreateVehicle(ac_vehicletype, ac_x, ac_y, ac_z, ac_rotation, ac_color1, ac_color2, ac_respawn_delay, ac_addsiren);
  1433. if(ac_vehicleid != 65535)
  1434. {
  1435. #if defined FILTERSCRIPT
  1436. CallRemoteFunction("ac_CreateVehicle", "ii", ac_vehicleid, ac_vehicletype);
  1437. #else
  1438. ac_CreateVehicle(ac_vehicleid, ac_vehicletype);
  1439. #endif
  1440. }
  1441. return ac_vehicleid;
  1442. }
  1443. #if defined _ALS_CreateVehicle
  1444. #undef CreateVehicle
  1445. #else
  1446. #define _ALS_CreateVehicle
  1447. #endif
  1448. #define CreateVehicle acc_CreateVehicle
  1449. stock acc_AddPlayerClass(ac_modelid, Float:ac_spawn_x, Float:ac_spawn_y, Float:ac_spawn_z, Float:ac_z_angle, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)
  1450. {
  1451. new ac_classid = AddPlayerClass(ac_modelid, ac_spawn_x, ac_spawn_y, ac_spawn_z, ac_z_angle, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo);
  1452. #if defined FILTERSCRIPT
  1453. CallRemoteFunction("ac_AddPlayerClass", "iiiiiii", ac_classid, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo);
  1454. #else
  1455. ac_AddPlayerClass(ac_classid, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo);
  1456. #endif
  1457. return ac_classid;
  1458. }
  1459. #if defined _ALS_AddPlayerClass
  1460. #undef AddPlayerClass
  1461. #else
  1462. #define _ALS_AddPlayerClass
  1463. #endif
  1464. #define AddPlayerClass acc_AddPlayerClass
  1465. stock acc_AddPlayerClassEx(ac_teamid, ac_modelid, Float:ac_spawn_x, Float:ac_spawn_y, Float:ac_spawn_z, Float:ac_z_angle, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)
  1466. {
  1467. new ac_classid = AddPlayerClassEx(ac_teamid, ac_modelid, ac_spawn_x, ac_spawn_y, ac_spawn_z, ac_z_angle, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo);
  1468. #if defined FILTERSCRIPT
  1469. CallRemoteFunction("ac_AddPlayerClass", "iiiiiii", ac_classid, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo);
  1470. #else
  1471. ac_AddPlayerClass(ac_classid, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo);
  1472. #endif
  1473. return ac_classid;
  1474. }
  1475. #if defined _ALS_AddPlayerClassEx
  1476. #undef AddPlayerClassEx
  1477. #else
  1478. #define _ALS_AddPlayerClassEx
  1479. #endif
  1480. #define AddPlayerClassEx acc_AddPlayerClassEx
  1481. stock acc_SetSpawnInfo(playerid, ac_team, ac_skin, Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_rotation, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)
  1482. {
  1483. #if defined FILTERSCRIPT
  1484. return CallRemoteFunction("ac_SetSpawnInfo", "iiiffffiiiiii", playerid, ac_team, ac_skin, ac_x, ac_y, ac_z, ac_rotation, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo);
  1485. #else
  1486. return ac_SetSpawnInfo(playerid, ac_team, ac_skin, ac_x, ac_y, ac_z, ac_rotation, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo);
  1487. #endif
  1488. }
  1489. #if defined _ALS_SetSpawnInfo
  1490. #undef SetSpawnInfo
  1491. #else
  1492. #define _ALS_SetSpawnInfo
  1493. #endif
  1494. #define SetSpawnInfo acc_SetSpawnInfo
  1495. stock acc_AddStaticPickup(ac_model, ac_type, Float:ac_X, Float:ac_Y, Float:ac_Z, ac_virtualworld = 0)
  1496. {
  1497. new ac_pickupid = CreatePickup(ac_model, ac_type, ac_X, ac_Y, ac_Z, ac_virtualworld);
  1498. if(ac_pickupid != -1)
  1499. {
  1500. #if defined FILTERSCRIPT
  1501. return CallRemoteFunction("ac_AddStaticPickup", "iiifff", ac_pickupid, ac_model, ac_type, ac_X, ac_Y, ac_Z);
  1502. #else
  1503. return ac_AddStaticPickup(ac_pickupid, ac_model, ac_type, ac_X, ac_Y, ac_Z);
  1504. #endif
  1505. }
  1506. return 0;
  1507. }
  1508. #if defined _ALS_AddStaticPickup
  1509. #undef AddStaticPickup
  1510. #else
  1511. #define _ALS_AddStaticPickup
  1512. #endif
  1513. #define AddStaticPickup acc_AddStaticPickup
  1514. stock acc_CreatePickup(ac_model, ac_type, Float:ac_X, Float:ac_Y, Float:ac_Z, ac_virtualworld = 0)
  1515. {
  1516. new ac_pickupid = CreatePickup(ac_model, ac_type, ac_X, ac_Y, ac_Z, ac_virtualworld);
  1517. if(ac_pickupid != -1)
  1518. {
  1519. #if defined FILTERSCRIPT
  1520. CallRemoteFunction("ac_CreatePickup", "iiifff", ac_pickupid, ac_model, ac_type, ac_X, ac_Y, ac_Z);
  1521. #else
  1522. ac_CreatePickup(ac_pickupid, ac_model, ac_type, ac_X, ac_Y, ac_Z);
  1523. #endif
  1524. }
  1525. return ac_pickupid;
  1526. }
  1527. #if defined _ALS_CreatePickup
  1528. #undef CreatePickup
  1529. #else
  1530. #define _ALS_CreatePickup
  1531. #endif
  1532. #define CreatePickup acc_CreatePickup
  1533. #if defined CreateDynamicPickup
  1534. #if defined STREAMER_ENABLE_TAGS
  1535. stock STREAMER_TAG_PICKUP acc_CreateDynamicPickup(ac_modelid, ac_type, Float:ac_x, Float:ac_y, Float:ac_z, ac_worldid = -1, ac_interiorid = -1, ac_playerid = -1, Float:ac_streamdistance = 200.0, STREAMER_TAG_AREA ac_areaid = STREAMER_TAG_AREA -1, ac_priority = 0)
  1536. {
  1537. new STREAMER_TAG_PICKUP ac_pickupid = CreateDynamicPickup(ac_modelid, ac_type, ac_x, ac_y, ac_z, ac_worldid, ac_interiorid, ac_playerid, ac_streamdistance, ac_areaid, ac_priority);
  1538. #else
  1539. stock acc_CreateDynamicPickup(ac_modelid, ac_type, Float:ac_x, Float:ac_y, Float:ac_z, ac_worldid = -1, ac_interiorid = -1, ac_playerid = -1, Float:ac_streamdistance = 200.0, ac_areaid = -1, ac_priority = 0)
  1540. {
  1541. new ac_pickupid = CreateDynamicPickup(ac_modelid, ac_type, ac_x, ac_y, ac_z, ac_worldid, ac_interiorid, ac_playerid, ac_streamdistance, ac_areaid, ac_priority);
  1542. #endif
  1543. if(_:ac_pickupid > 0)
  1544. {
  1545. #if defined FILTERSCRIPT
  1546. CallRemoteFunction("ac_CreateDynamicPickup", "iiifff", _:ac_pickupid, ac_modelid, ac_type, ac_x, ac_y, ac_z);
  1547. #else
  1548. ac_CreateDynamicPickup(_:ac_pickupid, ac_modelid, ac_type, ac_x, ac_y, ac_z);
  1549. #endif
  1550. }
  1551. return ac_pickupid;
  1552. }
  1553. #if defined _ALS_CreateDynamicPickup
  1554. #undef CreateDynamicPickup
  1555. #else
  1556. #define _ALS_CreateDynamicPickup
  1557. #endif
  1558. #define CreateDynamicPickup acc_CreateDynamicPickup
  1559. #endif
  1560. #if defined CreateDynamicPickupEx
  1561. #if defined STREAMER_ENABLE_TAGS
  1562. stock STREAMER_TAG_PICKUP acc_CreateDynamicPickupEx(ac_modelid, ac_type, Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_streamdistance = 200.0, ac_worlds[] = { -1 }, ac_interiors[] = { -1 }, ac_players[] = { -1 }, STREAMER_TAG_AREA ac_areas[] = { STREAMER_TAG_AREA -1 }, ac_priority = 0, ac_maxworlds = sizeof ac_worlds, ac_maxinteriors = sizeof ac_interiors, ac_maxplayers = sizeof ac_players, ac_maxareas = sizeof ac_areas)
  1563. {
  1564. new STREAMER_TAG_PICKUP ac_pickupid = CreateDynamicPickupEx(modelid, type, acx, acy, acz, streamdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas);
  1565. #else
  1566. stock acc_CreateDynamicPickupEx(ac_modelid, ac_type, Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_streamdistance = 200.0, ac_worlds[] = { -1 }, ac_interiors[] = { -1 }, ac_players[] = { -1 }, ac_areas[] = { -1 }, ac_priority = 0, ac_maxworlds = sizeof ac_worlds, ac_maxinteriors = sizeof ac_interiors, ac_maxplayers = sizeof ac_players, ac_maxareas = sizeof ac_areas)
  1567. {
  1568. new ac_pickupid = CreateDynamicPickupEx(ac_modelid, ac_type, ac_x, ac_y, ac_z, ac_streamdistance, ac_worlds, ac_interiors, ac_players, ac_areas, ac_priority, ac_maxworlds, ac_maxinteriors, ac_maxplayers, ac_maxareas);
  1569. #endif
  1570. if(_:ac_pickupid > 0)
  1571. {
  1572. #if defined FILTERSCRIPT
  1573. CallRemoteFunction("ac_CreateDynamicPickup", "iiifff", _:ac_pickupid, ac_modelid, ac_type, ac_x, ac_y, ac_z);
  1574. #else
  1575. ac_CreateDynamicPickup(_:ac_pickupid, ac_modelid, ac_type, ac_x, ac_y, ac_z);
  1576. #endif
  1577. }
  1578. return ac_pickupid;
  1579. }
  1580. #if defined _ALS_CreateDynamicPickupEx
  1581. #undef CreateDynamicPickupEx
  1582. #else
  1583. #define _ALS_CreateDynamicPickupEx
  1584. #endif
  1585. #define CreateDynamicPickupEx acc_CreateDynamicPickupEx
  1586. #endif
  1587. stock acc_DestroyVehicle(ac_vehicleid)
  1588. {
  1589. #if defined FILTERSCRIPT
  1590. return CallRemoteFunction("ac_DestroyVehicle", "i", ac_vehicleid);
  1591. #else
  1592. return ac_DestroyVehicle(ac_vehicleid);
  1593. #endif
  1594. }
  1595. #if defined _ALS_DestroyVehicle
  1596. #undef DestroyVehicle
  1597. #else
  1598. #define _ALS_DestroyVehicle
  1599. #endif
  1600. #define DestroyVehicle acc_DestroyVehicle
  1601. stock acc_DestroyPickup(ac_pickup)
  1602. {
  1603. #if defined FILTERSCRIPT
  1604. return CallRemoteFunction("ac_DestroyPickup", "i", ac_pickup);
  1605. #else
  1606. return ac_DestroyPickup(ac_pickup);
  1607. #endif
  1608. }
  1609. #if defined _ALS_DestroyPickup
  1610. #undef DestroyPickup
  1611. #else
  1612. #define _ALS_DestroyPickup
  1613. #endif
  1614. #define DestroyPickup acc_DestroyPickup
  1615. #if defined DestroyDynamicPickup
  1616. #if defined STREAMER_ENABLE_TAGS
  1617. stock acc_DestroyDynamicPickup(STREAMER_TAG_PICKUP ac_pickupid)
  1618. #else
  1619. stock acc_DestroyDynamicPickup(ac_pickupid)
  1620. #endif
  1621. {
  1622. #if defined FILTERSCRIPT
  1623. return CallRemoteFunction("ac_DestroyDynamicPickup", "i", _:ac_pickupid);
  1624. #else
  1625. return ac_DestroyDynamicPickup(_:ac_pickupid);
  1626. #endif
  1627. }
  1628. #if defined _ALS_DestroyDynamicPickup
  1629. #undef DestroyDynamicPickup
  1630. #else
  1631. #define _ALS_DestroyDynamicPickup
  1632. #endif
  1633. #define DestroyDynamicPickup acc_DestroyDynamicPickup
  1634. #endif
  1635. #if defined DestroyAllDynamicPickups
  1636. stock acc_DestroyAllDynamicPickups()
  1637. {
  1638. #if defined FILTERSCRIPT
  1639. return CallRemoteFunction("ac_DestroyAllDynamicPickups", "");
  1640. #else
  1641. return ac_DestroyAllDynamicPickups();
  1642. #endif
  1643. }
  1644. #if defined _ALS_DestroyAllDynamicPickups
  1645. #undef DestroyAllDynamicPickups
  1646. #else
  1647. #define _ALS_DestroyAllDynamicPickups
  1648. #endif
  1649. #define DestroyAllDynamicPickups acc_DestroyAllDynamicPickups
  1650. #endif
  1651. stock acc_DisableInteriorEnterExits()
  1652. {
  1653. #if defined FILTERSCRIPT
  1654. return CallRemoteFunction("ac_DisableInteriorEnterExits", "");
  1655. #else
  1656. return ac_DisableInteriorEnterExits();
  1657. #endif
  1658. }
  1659. #if defined _ALS_DisableInteriorEnterExits
  1660. #undef DisableInteriorEnterExits
  1661. #else
  1662. #define _ALS_DisableInteriorEnterExits
  1663. #endif
  1664. #define DisableInteriorEnterExits acc_DisableInteriorEnterExits
  1665. stock acc_UsePlayerPedAnims()
  1666. {
  1667. #if defined FILTERSCRIPT
  1668. return CallRemoteFunction("ac_UsePlayerPedAnims", "");
  1669. #else
  1670. return ac_UsePlayerPedAnims();
  1671. #endif
  1672. }
  1673. #if defined _ALS_UsePlayerPedAnims
  1674. #undef UsePlayerPedAnims
  1675. #else
  1676. #define _ALS_UsePlayerPedAnims
  1677. #endif
  1678. #define UsePlayerPedAnims acc_UsePlayerPedAnims
  1679. stock acc_EnableVehicleFriendlyFire()
  1680. {
  1681. #if defined FILTERSCRIPT
  1682. return CallRemoteFunction("ac_EnableVehicleFriendlyFire", "");
  1683. #else
  1684. return ac_EnableVehicleFriendlyFire();
  1685. #endif
  1686. }
  1687. #if defined _ALS_EnableVehicleFriendlyFire
  1688. #undef EnableVehicleFriendlyFire
  1689. #else
  1690. #define _ALS_EnableVehicleFriendlyFire
  1691. #endif
  1692. #define EnableVehicleFriendlyFire acc_EnableVehicleFriendlyFire
  1693. stock acc_EnableStuntBonusForAll(ac_enable)
  1694. {
  1695. #if defined FILTERSCRIPT
  1696. return CallRemoteFunction("ac_EnableStuntBonusForAll", "i", ac_enable);
  1697. #else
  1698. return ac_EnableStuntBonusForAll(ac_enable);
  1699. #endif
  1700. }
  1701. #if defined _ALS_EnableStuntBonusForAll
  1702. #undef EnableStuntBonusForAll
  1703. #else
  1704. #define _ALS_EnableStuntBonusForAll
  1705. #endif
  1706. #define EnableStuntBonusForAll acc_EnableStuntBonusForAll
  1707. stock acc_EnableStuntBonusForPlayer(playerid, ac_enable)
  1708. {
  1709. #if defined FILTERSCRIPT
  1710. return CallRemoteFunction("ac_EnableStuntBonusForPlayer", "ii", playerid, ac_enable);
  1711. #else
  1712. return ac_EnableStuntBonusForPlayer(playerid, ac_enable);
  1713. #endif
  1714. }
  1715. #if defined _ALS_EnableStuntBonusForPlayer
  1716. #undef EnableStuntBonusForPlayer
  1717. #else
  1718. #define _ALS_EnableStuntBonusForPlayer
  1719. #endif
  1720. #define EnableStuntBonusForPlayer acc_EnableStuntBonusForPlayer
  1721. #if defined _inc_y_dialog || defined _INC_y_dialog
  1722. stock ac_Dialog_Show(playerid, ac_style, string:ac_title[], string:ac_caption[], string:ac_button1[], string:ac_button2[] = "", ac_dialog = -1)
  1723. {
  1724. if(IsPlayerConnected(playerid))
  1725. {
  1726. #if defined FILTERSCRIPT
  1727. CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, ac_dialog);
  1728. #else
  1729. ac_ShowPlayerDialog(playerid, ac_dialog);
  1730. #endif
  1731. }
  1732. return Dialog_Show(playerid, ac_style, ac_title, ac_caption, ac_button1, ac_button2, ac_dialog);
  1733. }
  1734. #if defined _ALS_Dialog_Show
  1735. #undef Dialog_Show
  1736. #else
  1737. #define _ALS_Dialog_Show
  1738. #endif
  1739. #define Dialog_Show ac_Dialog_Show
  1740. #endif
  1741. stock acc_ShowPlayerDialog(playerid, ac_dialogid, ac_style, ac_caption[], ac_info[], ac_button1[], ac_button2[])
  1742. {
  1743. if(ShowPlayerDialog(playerid, ac_dialogid, ac_style, ac_caption, ac_info, ac_button1, ac_button2))
  1744. {
  1745. #if defined FILTERSCRIPT
  1746. return CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, ac_dialogid);
  1747. #else
  1748. return ac_ShowPlayerDialog(playerid, ac_dialogid);
  1749. #endif
  1750. }
  1751. return 0;
  1752. }
  1753. #if defined _ALS_ShowPlayerDialog
  1754. #undef ShowPlayerDialog
  1755. #else
  1756. #define _ALS_ShowPlayerDialog
  1757. #endif
  1758. #define ShowPlayerDialog acc_ShowPlayerDialog
  1759. stock acc_TogglePlayerControllable(playerid, ac_toggle)
  1760. {
  1761. #if defined FILTERSCRIPT
  1762. return CallRemoteFunction("ac_TogglePlayerControllable", "ii", playerid, ac_toggle);
  1763. #else
  1764. return ac_TogglePlayerControllable(playerid, ac_toggle);
  1765. #endif
  1766. }
  1767. #if defined _ALS_TogglePlayerControllable
  1768. #undef TogglePlayerControllable
  1769. #else
  1770. #define _ALS_TogglePlayerControllable
  1771. #endif
  1772. #define TogglePlayerControllable acc_TogglePlayerControllable
  1773. stock acc_TogglePlayerSpectating(playerid, ac_toggle)
  1774. {
  1775. #if defined FILTERSCRIPT
  1776. return CallRemoteFunction("ac_TogglePlayerSpectating", "ii", playerid, ac_toggle);
  1777. #else
  1778. return ac_TogglePlayerSpectating(playerid, ac_toggle);
  1779. #endif
  1780. }
  1781. #if defined _ALS_TogglePlayerSpectating
  1782. #undef TogglePlayerSpectating
  1783. #else
  1784. #define _ALS_TogglePlayerSpectating
  1785. #endif
  1786. #define TogglePlayerSpectating acc_TogglePlayerSpectating
  1787. stock acc_SpawnPlayer(playerid)
  1788. {
  1789. #if defined FILTERSCRIPT
  1790. return CallRemoteFunction("ac_SpawnPlayer", "i", playerid);
  1791. #else
  1792. return ac_SpawnPlayer(playerid);
  1793. #endif
  1794. }
  1795. #if defined _ALS_SpawnPlayer
  1796. #undef SpawnPlayer
  1797. #else
  1798. #define _ALS_SpawnPlayer
  1799. #endif
  1800. #define SpawnPlayer acc_SpawnPlayer
  1801. stock acc_SetPlayerHealth(playerid, Float:ac_health)
  1802. {
  1803. if(ac_health > 1048576.0) ac_health = 1048576.0;
  1804. #if defined FILTERSCRIPT
  1805. return CallRemoteFunction("ac_SetPlayerHealth", "if", playerid, ac_health);
  1806. #else
  1807. return ac_SetPlayerHealth(playerid, ac_health);
  1808. #endif
  1809. }
  1810. #if defined _ALS_SetPlayerHealth
  1811. #undef SetPlayerHealth
  1812. #else
  1813. #define _ALS_SetPlayerHealth
  1814. #endif
  1815. #define SetPlayerHealth acc_SetPlayerHealth
  1816. stock acc_SetPlayerArmour(playerid, Float:ac_armour)
  1817. {
  1818. if(ac_armour > 1048576.0) ac_armour = 1048576.0;
  1819. #if defined FILTERSCRIPT
  1820. return CallRemoteFunction("ac_SetPlayerArmour", "if", playerid, ac_armour);
  1821. #else
  1822. return ac_SetPlayerArmour(playerid, ac_armour);
  1823. #endif
  1824. }
  1825. #if defined _ALS_SetPlayerArmour
  1826. #undef SetPlayerArmour
  1827. #else
  1828. #define _ALS_SetPlayerArmour
  1829. #endif
  1830. #define SetPlayerArmour acc_SetPlayerArmour
  1831. stock acc_GivePlayerWeapon(playerid, ac_weaponid, ac_ammo)
  1832. {
  1833. if(IsPlayerConnected(playerid))
  1834. {
  1835. #if defined FILTERSCRIPT
  1836. return CallRemoteFunction("ac_GivePlayerWeapon", "iid", playerid, ac_weaponid, ac_ammo);
  1837. #else
  1838. return ac_GivePlayerWeapon(playerid, ac_weaponid, ac_ammo);
  1839. #endif
  1840. }
  1841. return 0;
  1842. }
  1843. #if defined _ALS_GivePlayerWeapon
  1844. #undef GivePlayerWeapon
  1845. #else
  1846. #define _ALS_GivePlayerWeapon
  1847. #endif
  1848. #define GivePlayerWeapon acc_GivePlayerWeapon
  1849. stock acc_SetPlayerAmmo(playerid, ac_weaponslot, ac_ammo)
  1850. {
  1851. if(IsPlayerConnected(playerid))
  1852. {
  1853. #if defined FILTERSCRIPT
  1854. return CallRemoteFunction("ac_SetPlayerAmmo", "iid", playerid, ac_weaponslot, ac_ammo);
  1855. #else
  1856. return ac_SetPlayerAmmo(playerid, ac_weaponslot, ac_ammo);
  1857. #endif
  1858. }
  1859. return 0;
  1860. }
  1861. #if defined _ALS_SetPlayerAmmo
  1862. #undef SetPlayerAmmo
  1863. #else
  1864. #define _ALS_SetPlayerAmmo
  1865. #endif
  1866. #define SetPlayerAmmo acc_SetPlayerAmmo
  1867. stock acc_SetPlayerArmedWeapon(playerid, ac_weaponid)
  1868. {
  1869. #if defined FILTERSCRIPT
  1870. return CallRemoteFunction("ac_SetPlayerArmedWeapon", "ii", playerid, ac_weaponid);
  1871. #else
  1872. return ac_SetPlayerArmedWeapon(playerid, ac_weaponid);
  1873. #endif
  1874. }
  1875. #if defined _ALS_SetPlayerArmedWeapon
  1876. #undef SetPlayerArmedWeapon
  1877. #else
  1878. #define _ALS_SetPlayerArmedWeapon
  1879. #endif
  1880. #define SetPlayerArmedWeapon acc_SetPlayerArmedWeapon
  1881. stock acc_ResetPlayerWeapons(playerid)
  1882. {
  1883. #if defined FILTERSCRIPT
  1884. return CallRemoteFunction("ac_ResetPlayerWeapons", "i", playerid);
  1885. #else
  1886. return ac_ResetPlayerWeapons(playerid);
  1887. #endif
  1888. }
  1889. #if defined _ALS_ResetPlayerWeapons
  1890. #undef ResetPlayerWeapons
  1891. #else
  1892. #define _ALS_ResetPlayerWeapons
  1893. #endif
  1894. #define ResetPlayerWeapons acc_ResetPlayerWeapons
  1895. stock acc_GivePlayerMoney(playerid, ac_money)
  1896. {
  1897. #if defined FILTERSCRIPT
  1898. return CallRemoteFunction("ac_GivePlayerMoney", "id", playerid, ac_money);
  1899. #else
  1900. return ac_GivePlayerMoney(playerid, ac_money);
  1901. #endif
  1902. }
  1903. #if defined _ALS_GivePlayerMoney
  1904. #undef GivePlayerMoney
  1905. #else
  1906. #define _ALS_GivePlayerMoney
  1907. #endif
  1908. #define GivePlayerMoney acc_GivePlayerMoney
  1909. stock acc_ResetPlayerMoney(playerid)
  1910. {
  1911. #if defined FILTERSCRIPT
  1912. return CallRemoteFunction("ac_ResetPlayerMoney", "i", playerid);
  1913. #else
  1914. return ac_ResetPlayerMoney(playerid);
  1915. #endif
  1916. }
  1917. #if defined _ALS_ResetPlayerMoney
  1918. #undef ResetPlayerMoney
  1919. #else
  1920. #define _ALS_ResetPlayerMoney
  1921. #endif
  1922. #define ResetPlayerMoney acc_ResetPlayerMoney
  1923. stock acc_GetPlayerMoney(playerid)
  1924. {
  1925. if(IsPlayerConnected(playerid))
  1926. {
  1927. #if defined FILTERSCRIPT
  1928. return CallRemoteFunction("ac_GetPlayerMoney", "i", playerid);
  1929. #else
  1930. return ac_GetPlayerMoney(playerid);
  1931. #endif
  1932. }
  1933. return 0;
  1934. }
  1935. #if defined _ALS_GetPlayerMoney
  1936. #undef GetPlayerMoney
  1937. #else
  1938. #define _ALS_GetPlayerMoney
  1939. #endif
  1940. #define GetPlayerMoney acc_GetPlayerMoney
  1941. stock acc_SetPlayerSpecialAction(playerid, ac_actionid)
  1942. {
  1943. #if defined FILTERSCRIPT
  1944. return CallRemoteFunction("ac_SetPlayerSpecialAction", "ii", playerid, ac_actionid);
  1945. #else
  1946. return ac_SetPlayerSpecialAction(playerid, ac_actionid);
  1947. #endif
  1948. }
  1949. #if defined _ALS_SetPlayerSpecialAction
  1950. #undef SetPlayerSpecialAction
  1951. #else
  1952. #define _ALS_SetPlayerSpecialAction
  1953. #endif
  1954. #define SetPlayerSpecialAction acc_SetPlayerSpecialAction
  1955. stock acc_SetPlayerInterior(playerid, ac_interiorid)
  1956. {
  1957. #if defined FILTERSCRIPT
  1958. return CallRemoteFunction("ac_SetPlayerInterior", "ii", playerid, ac_interiorid);
  1959. #else
  1960. return ac_SetPlayerInterior(playerid, ac_interiorid);
  1961. #endif
  1962. }
  1963. #if defined _ALS_SetPlayerInterior
  1964. #undef SetPlayerInterior
  1965. #else
  1966. #define _ALS_SetPlayerInterior
  1967. #endif
  1968. #define SetPlayerInterior acc_SetPlayerInterior
  1969. stock acc_SetPlayerPos(playerid, Float:ac_x, Float:ac_y, Float:ac_z)
  1970. {
  1971. #if defined FILTERSCRIPT
  1972. return CallRemoteFunction("ac_SetPlayerPos", "ifff", playerid, ac_x, ac_y, ac_z);
  1973. #else
  1974. return ac_SetPlayerPos(playerid, ac_x, ac_y, ac_z);
  1975. #endif
  1976. }
  1977. #if defined _ALS_SetPlayerPos
  1978. #undef SetPlayerPos
  1979. #else
  1980. #define _ALS_SetPlayerPos
  1981. #endif
  1982. #define SetPlayerPos acc_SetPlayerPos
  1983. stock acc_SetPlayerPosFindZ(playerid, Float:ac_x, Float:ac_y, Float:ac_z)
  1984. {
  1985. #if defined FILTERSCRIPT
  1986. return CallRemoteFunction("ac_SetPlayerPosFindZ", "ifff", playerid, ac_x, ac_y, ac_z);
  1987. #else
  1988. return ac_SetPlayerPosFindZ(playerid, ac_x, ac_y, ac_z);
  1989. #endif
  1990. }
  1991. #if defined _ALS_SetPlayerPosFindZ
  1992. #undef SetPlayerPosFindZ
  1993. #else
  1994. #define _ALS_SetPlayerPosFindZ
  1995. #endif
  1996. #define SetPlayerPosFindZ acc_SetPlayerPosFindZ
  1997. stock acc_SetPlayerVelocity(playerid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1998. {
  1999. #if defined FILTERSCRIPT
  2000. return CallRemoteFunction("ac_SetPlayerVelocity", "ifff", playerid, ac_X, ac_Y, ac_Z);
  2001. #else
  2002. return ac_SetPlayerVelocity(playerid, ac_X, ac_Y, ac_Z);
  2003. #endif
  2004. }
  2005. #if defined _ALS_SetPlayerVelocity
  2006. #undef SetPlayerVelocity
  2007. #else
  2008. #define _ALS_SetPlayerVelocity
  2009. #endif
  2010. #define SetPlayerVelocity acc_SetPlayerVelocity
  2011. stock acc_PutPlayerInVehicle(playerid, ac_vehicleid, ac_seatid)
  2012. {
  2013. #if defined FILTERSCRIPT
  2014. return CallRemoteFunction("ac_PutPlayerInVehicle", "iii", playerid, ac_vehicleid, ac_seatid);
  2015. #else
  2016. return ac_PutPlayerInVehicle(playerid, ac_vehicleid, ac_seatid);
  2017. #endif
  2018. }
  2019. #if defined _ALS_PutPlayerInVehicle
  2020. #undef PutPlayerInVehicle
  2021. #else
  2022. #define _ALS_PutPlayerInVehicle
  2023. #endif
  2024. #define PutPlayerInVehicle acc_PutPlayerInVehicle
  2025. stock acc_RemovePlayerFromVehicle(playerid)
  2026. {
  2027. #if defined FILTERSCRIPT
  2028. return CallRemoteFunction("ac_RemovePlayerFromVehicle", "i", playerid);
  2029. #else
  2030. return ac_RemovePlayerFromVehicle(playerid);
  2031. #endif
  2032. }
  2033. #if defined _ALS_RemovePlayerFromVehicle
  2034. #undef RemovePlayerFromVehicle
  2035. #else
  2036. #define _ALS_RemovePlayerFromVehicle
  2037. #endif
  2038. #define RemovePlayerFromVehicle acc_RemovePlayerFromVehicle
  2039. stock acc_SetVehiclePos(vehicleid, Float:ac_x, Float:ac_y, Float:ac_z)
  2040. {
  2041. #if defined FILTERSCRIPT
  2042. return CallRemoteFunction("ac_SetVehiclePos", "ifff", vehicleid, ac_x, ac_y, ac_z);
  2043. #else
  2044. return ac_SetVehiclePos(vehicleid, ac_x, ac_y, ac_z);
  2045. #endif
  2046. }
  2047. #if defined _ALS_SetVehiclePos
  2048. #undef SetVehiclePos
  2049. #else
  2050. #define _ALS_SetVehiclePos
  2051. #endif
  2052. #define SetVehiclePos acc_SetVehiclePos
  2053. stock acc_SetVehicleVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  2054. {
  2055. #if defined FILTERSCRIPT
  2056. return CallRemoteFunction("ac_SetVehicleVelocity", "ifff", vehicleid, ac_X, ac_Y, ac_Z);
  2057. #else
  2058. return ac_SetVehicleVelocity(vehicleid, ac_X, ac_Y, ac_Z);
  2059. #endif
  2060. }
  2061. #if defined _ALS_SetVehicleVelocity
  2062. #undef SetVehicleVelocity
  2063. #else
  2064. #define _ALS_SetVehicleVelocity
  2065. #endif
  2066. #define SetVehicleVelocity acc_SetVehicleVelocity
  2067. stock acc_SetVehicleAngularVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  2068. {
  2069. #if defined FILTERSCRIPT
  2070. return CallRemoteFunction("ac_SetVehicleAngularVelocity", "ifff", vehicleid, ac_X, ac_Y, ac_Z);
  2071. #else
  2072. return ac_SetVehicleAngularVelocity(vehicleid, ac_X, ac_Y, ac_Z);
  2073. #endif
  2074. }
  2075. #if defined _ALS_SetVehicleAngularVelocity
  2076. #undef SetVehicleAngularVelocity
  2077. #else
  2078. #define _ALS_SetVehicleAngularVelocity
  2079. #endif
  2080. #define SetVehicleAngularVelocity acc_SetVehicleAngularVelocity
  2081. stock acc_LinkVehicleToInterior(vehicleid, ac_interiorid)
  2082. {
  2083. #if defined FILTERSCRIPT
  2084. return CallRemoteFunction("ac_LinkVehicleToInterior", "ii", vehicleid, ac_interiorid);
  2085. #else
  2086. return ac_LinkVehicleToInterior(vehicleid, ac_interiorid);
  2087. #endif
  2088. }
  2089. #if defined _ALS_LinkVehicleToInterior
  2090. #undef LinkVehicleToInterior
  2091. #else
  2092. #define _ALS_LinkVehicleToInterior
  2093. #endif
  2094. #define LinkVehicleToInterior acc_LinkVehicleToInterior
  2095. stock acc_ChangeVehiclePaintjob(vehicleid, ac_paintjobid)
  2096. {
  2097. #if defined FILTERSCRIPT
  2098. return CallRemoteFunction("ac_ChangeVehiclePaintjob", "ii", vehicleid, ac_paintjobid);
  2099. #else
  2100. return ac_ChangeVehiclePaintjob(vehicleid, ac_paintjobid);
  2101. #endif
  2102. }
  2103. #if defined _ALS_ChangeVehiclePaintjob
  2104. #undef ChangeVehiclePaintjob
  2105. #else
  2106. #define _ALS_ChangeVehiclePaintjob
  2107. #endif
  2108. #define ChangeVehiclePaintjob acc_ChangeVehiclePaintjob
  2109. stock acc_SetVehicleHealth(vehicleid, Float:ac_health)
  2110. {
  2111. if(ac_health < 0.0) ac_health = 0.0;
  2112. #if defined FILTERSCRIPT
  2113. return CallRemoteFunction("ac_SetVehicleHealth", "if", vehicleid, ac_health);
  2114. #else
  2115. return ac_SetVehicleHealth(vehicleid, ac_health);
  2116. #endif
  2117. }
  2118. #if defined _ALS_SetVehicleHealth
  2119. #undef SetVehicleHealth
  2120. #else
  2121. #define _ALS_SetVehicleHealth
  2122. #endif
  2123. #define SetVehicleHealth acc_SetVehicleHealth
  2124. stock acc_RepairVehicle(vehicleid)
  2125. {
  2126. #if defined FILTERSCRIPT
  2127. return CallRemoteFunction("ac_RepairVehicle", "i", vehicleid);
  2128. #else
  2129. return ac_RepairVehicle(vehicleid);
  2130. #endif
  2131. }
  2132. #if defined _ALS_RepairVehicle
  2133. #undef RepairVehicle
  2134. #else
  2135. #define _ALS_RepairVehicle
  2136. #endif
  2137. #define RepairVehicle acc_RepairVehicle
  2138. stock acc_SetVehicleToRespawn(vehicleid)
  2139. {
  2140. if(GetVehicleModel(vehicleid) > 0)
  2141. {
  2142. #if defined FILTERSCRIPT
  2143. return CallRemoteFunction("ac_SetVehicleToRespawn", "i", vehicleid);
  2144. #else
  2145. return ac_SetVehicleToRespawn(vehicleid);
  2146. #endif
  2147. }
  2148. return 0;
  2149. }
  2150. #if defined _ALS_SetVehicleToRespawn
  2151. #undef SetVehicleToRespawn
  2152. #else
  2153. #define _ALS_SetVehicleToRespawn
  2154. #endif
  2155. #define SetVehicleToRespawn acc_SetVehicleToRespawn
  2156. stock EnableAntiCheat(acid, enable)
  2157. {
  2158. #if defined FILTERSCRIPT
  2159. return CallRemoteFunction("ac_EnableAntiCheat", "ii", acid, enable);
  2160. #else
  2161. return ac_EnableAntiCheat(acid, enable);
  2162. #endif
  2163. }
  2164. stock EnableAntiCheatForPlayer(playerid, acid, enable)
  2165. {
  2166. if(IsPlayerConnected(playerid) == 0) return 0;
  2167. #if defined FILTERSCRIPT
  2168. return CallRemoteFunction("ac_EnableAntiCheatForPlayer", "iii", playerid, acid, enable);
  2169. #else
  2170. return ac_EnableAntiCheatForPlayer(playerid, acid, enable);
  2171. #endif
  2172. }
  2173. stock IsAntiCheatEnabled(acid)
  2174. {
  2175. #if defined FILTERSCRIPT
  2176. return CallRemoteFunction("ac_IsAntiCheatEnabled", "i", acid);
  2177. #else
  2178. return ac_IsAntiCheatEnabled(acid);
  2179. #endif
  2180. }
  2181. stock IsAntiCheatEnabledForPlayer(playerid, acid)
  2182. {
  2183. if(IsPlayerConnected(playerid) == 0) return 0;
  2184. #if defined FILTERSCRIPT
  2185. return CallRemoteFunction("ac_IsAntiCheatEnabledForPlayer", "ii", playerid, acid);
  2186. #else
  2187. return ac_IsAntiCheatEnabledForPlayer(playerid, acid);
  2188. #endif
  2189. }
  2190. stock AntiCheatGetAnimationIndex(playerid)
  2191. {
  2192. if(IsPlayerConnected(playerid) == 0) return 0;
  2193. #if defined FILTERSCRIPT
  2194. return CallRemoteFunction("ac_AntiCheatGetAnimationIndex", "i", playerid);
  2195. #else
  2196. return ac_AntiCheatGetAnimationIndex(playerid);
  2197. #endif
  2198. }
  2199. stock AntiCheatGetDialog(playerid)
  2200. {
  2201. if(IsPlayerConnected(playerid) == 0) return 0;
  2202. #if defined FILTERSCRIPT
  2203. return CallRemoteFunction("ac_AntiCheatGetDialog", "i", playerid);
  2204. #else
  2205. return ac_AntiCheatGetDialog(playerid);
  2206. #endif
  2207. }
  2208. stock AntiCheatGetMoney(playerid)
  2209. {
  2210. if(IsPlayerConnected(playerid) == 0) return 0;
  2211. #if defined FILTERSCRIPT
  2212. return CallRemoteFunction("ac_AntiCheatGetMoney", "i", playerid);
  2213. #else
  2214. return ac_AntiCheatGetMoney(playerid);
  2215. #endif
  2216. }
  2217. stock AntiCheatGetClass(playerid)
  2218. {
  2219. if(IsPlayerConnected(playerid) == 0) return 0;
  2220. #if defined FILTERSCRIPT
  2221. return CallRemoteFunction("ac_AntiCheatGetClass", "i", playerid);
  2222. #else
  2223. return ac_AntiCheatGetClass(playerid);
  2224. #endif
  2225. }
  2226. stock AntiCheatGetEnterVehicle(playerid)
  2227. {
  2228. if(IsPlayerConnected(playerid) == 0) return 0;
  2229. #if defined FILTERSCRIPT
  2230. return CallRemoteFunction("ac_AntiCheatGetEnterVehicle", "i", playerid);
  2231. #else
  2232. return ac_AntiCheatGetEnterVehicle(playerid);
  2233. #endif
  2234. }
  2235. stock AntiCheatGetVehicleID(playerid)
  2236. {
  2237. if(IsPlayerConnected(playerid) == 0) return 0;
  2238. #if defined FILTERSCRIPT
  2239. return CallRemoteFunction("ac_AntiCheatGetVehicleID", "i", playerid);
  2240. #else
  2241. return ac_AntiCheatGetVehicleID(playerid);
  2242. #endif
  2243. }
  2244. stock AntiCheatGetWeapon(playerid)
  2245. {
  2246. if(IsPlayerConnected(playerid) == 0) return 0;
  2247. #if defined FILTERSCRIPT
  2248. return CallRemoteFunction("ac_AntiCheatGetWeapon", "i", playerid);
  2249. #else
  2250. return ac_AntiCheatGetWeapon(playerid);
  2251. #endif
  2252. }
  2253. stock AntiCheatGetVehicleSeat(playerid)
  2254. {
  2255. if(IsPlayerConnected(playerid) == 0) return 0;
  2256. #if defined FILTERSCRIPT
  2257. return CallRemoteFunction("ac_AntiCheatGetVehicleSeat", "i", playerid);
  2258. #else
  2259. return ac_AntiCheatGetVehicleSeat(playerid);
  2260. #endif
  2261. }
  2262. stock AntiCheatGetSpecialAction(playerid)
  2263. {
  2264. if(IsPlayerConnected(playerid) == 0) return 0;
  2265. #if defined FILTERSCRIPT
  2266. return CallRemoteFunction("ac_AntiCheatGetSpecialAction", "i", playerid);
  2267. #else
  2268. return ac_AntiCheatGetSpecialAction(playerid);
  2269. #endif
  2270. }
  2271. stock AntiCheatGetLastSpecialAction(playerid)
  2272. {
  2273. if(IsPlayerConnected(playerid) == 0) return 0;
  2274. #if defined FILTERSCRIPT
  2275. return CallRemoteFunction("ac_AntiCheatGetLastSpecialActio", "i", playerid);
  2276. #else
  2277. return ac_AntiCheatGetLastSpecialActio(playerid);
  2278. #endif
  2279. }
  2280. stock AntiCheatGetLastShotWeapon(playerid)
  2281. {
  2282. if(IsPlayerConnected(playerid) == 0) return 0;
  2283. #if defined FILTERSCRIPT
  2284. return CallRemoteFunction("ac_AntiCheatGetLastShotWeapon", "i", playerid);
  2285. #else
  2286. return ac_AntiCheatGetLastShotWeapon(playerid);
  2287. #endif
  2288. }
  2289. stock AntiCheatGetLastPickup(playerid)
  2290. {
  2291. if(IsPlayerConnected(playerid) == 0) return 0;
  2292. #if defined FILTERSCRIPT
  2293. return CallRemoteFunction("ac_AntiCheatGetLastPickup", "i", playerid);
  2294. #else
  2295. return ac_AntiCheatGetLastPickup(playerid);
  2296. #endif
  2297. }
  2298. stock AntiCheatGetLastUpdateTime(playerid)
  2299. {
  2300. if(IsPlayerConnected(playerid) == 0) return 0;
  2301. #if defined FILTERSCRIPT
  2302. return CallRemoteFunction("ac_AntiCheatGetLastUpdateTime", "i", playerid);
  2303. #else
  2304. return ac_AntiCheatGetLastUpdateTime(playerid);
  2305. #endif
  2306. }
  2307. stock AntiCheatGetLastReloadTime(playerid)
  2308. {
  2309. if(IsPlayerConnected(playerid) == 0) return 0;
  2310. #if defined FILTERSCRIPT
  2311. return CallRemoteFunction("ac_AntiCheatGetLastReloadTime", "i", playerid);
  2312. #else
  2313. return ac_AntiCheatGetLastReloadTime(playerid);
  2314. #endif
  2315. }
  2316. stock AntiCheatGetLastEnteredVehTime(playerid)
  2317. {
  2318. if(IsPlayerConnected(playerid) == 0) return 0;
  2319. #if defined FILTERSCRIPT
  2320. return CallRemoteFunction("ac_AntiCheatGetLastEnteredVehTi", "i", playerid);
  2321. #else
  2322. return ac_AntiCheatGetLastEnteredVehTi(playerid);
  2323. #endif
  2324. }
  2325. stock AntiCheatGetLastShotTime(playerid)
  2326. {
  2327. if(IsPlayerConnected(playerid) == 0) return 0;
  2328. #if defined FILTERSCRIPT
  2329. return CallRemoteFunction("ac_AntiCheatGetLastShotTime", "i", playerid);
  2330. #else
  2331. return ac_AntiCheatGetLastShotTime(playerid);
  2332. #endif
  2333. }
  2334. stock AntiCheatGetLastSpawnTime(playerid)
  2335. {
  2336. if(IsPlayerConnected(playerid) == 0) return 0;
  2337. #if defined FILTERSCRIPT
  2338. return CallRemoteFunction("ac_AntiCheatGetLastSpawnTime", "i", playerid);
  2339. #else
  2340. return ac_AntiCheatGetLastSpawnTime(playerid);
  2341. #endif
  2342. }
  2343. stock AntiCheatIntEnterExitsIsEnabled(playerid)
  2344. {
  2345. if(IsPlayerConnected(playerid) == 0) return 0;
  2346. #if defined FILTERSCRIPT
  2347. return CallRemoteFunction("ac_AntiCheatIntEnterExitsIsEnab", "i", playerid);
  2348. #else
  2349. return ac_AntiCheatIntEnterExitsIsEnab(playerid);
  2350. #endif
  2351. }
  2352. stock AntiCheatStuntBonusIsEnabled(playerid)
  2353. {
  2354. if(IsPlayerConnected(playerid) == 0) return 0;
  2355. #if defined FILTERSCRIPT
  2356. return CallRemoteFunction("ac_AntiCheatStuntBonusIsEnabled", "i", playerid);
  2357. #else
  2358. return ac_AntiCheatStuntBonusIsEnabled(playerid);
  2359. #endif
  2360. }
  2361. stock AntiCheatIsInModShop(playerid)
  2362. {
  2363. if(IsPlayerConnected(playerid) == 0) return 0;
  2364. #if defined FILTERSCRIPT
  2365. return CallRemoteFunction("ac_AntiCheatIsInModShop", "i", playerid);
  2366. #else
  2367. return ac_AntiCheatIsInModShop(playerid);
  2368. #endif
  2369. }
  2370. stock AntiCheatIsFrozen(playerid)
  2371. {
  2372. if(IsPlayerConnected(playerid) == 0) return 0;
  2373. #if defined FILTERSCRIPT
  2374. return CallRemoteFunction("ac_AntiCheatIsFrozen", "i", playerid);
  2375. #else
  2376. return ac_AntiCheatIsFrozen(playerid);
  2377. #endif
  2378. }
  2379. stock AntiCheatIsDead(playerid)
  2380. {
  2381. if(IsPlayerConnected(playerid) == 0) return 0;
  2382. #if defined FILTERSCRIPT
  2383. return CallRemoteFunction("ac_AntiCheatIsDead", "i", playerid);
  2384. #else
  2385. return ac_AntiCheatIsDead(playerid);
  2386. #endif
  2387. }
  2388. stock AntiCheatIsConnected(playerid)
  2389. {
  2390. if(IsPlayerConnected(playerid) == 0) return 0;
  2391. #if defined FILTERSCRIPT
  2392. return CallRemoteFunction("ac_AntiCheatIsConnected", "i", playerid);
  2393. #else
  2394. return ac_AntiCheatIsConnected(playerid);
  2395. #endif
  2396. }
  2397. #if defined _inc_y_hooks || defined _INC_y_hooks
  2398. DEFINE_HOOK_REPLACEMENT(SirenState, Siren);
  2399. #endif
  2400. #if defined FILTERSCRIPT
  2401. static stock fs_AntiCheatGetNextDialog(playerid)
  2402. {
  2403. if(IsPlayerConnected(playerid) == 0) return 0;
  2404. return CallRemoteFunction("ac_AntiCheatGetNextDialog", "i", playerid);
  2405. }
  2406. static stock fs_AntiCheatSetDialog(playerid, dialogid)
  2407. {
  2408. if(IsPlayerConnected(playerid) == 0) return 0;
  2409. return CallRemoteFunction("ac_ShowPlayerDialog", "ii", playerid, dialogid);
  2410. }
  2411. static stock fs_AntiCheatSetNextDialog(playerid, dialogid)
  2412. {
  2413. if(IsPlayerConnected(playerid) == 0) return 0;
  2414. return CallRemoteFunction("ac_fs_ShowPlayerDialog", "ii", playerid, dialogid);
  2415. }
  2416. #else
  2417. #if defined _inc_y_hooks || defined _INC_y_hooks
  2418. hook OnGameModeInit()
  2419. #else
  2420. public OnGameModeInit()
  2421. #endif
  2422. {
  2423. if(ac_LoadCfg() == 0) printf(CFG_OPENING_ERROR, AC_CONFIG_FILE);
  2424. if(ac_ACAllow[42])
  2425. {
  2426. #if !AC_USE_QUERY
  2427. ac_QueryEnable = !!GetConsoleVarAsBool("query");
  2428. SendRconCommand("query 0");
  2429. #endif
  2430. ac_RconEnable = !!GetConsoleVarAsBool("rcon");
  2431. SendRconCommand("rcon 0");
  2432. }
  2433. #if AC_MAX_CONNECTS_FROM_IP > 1
  2434. ac_ACAllow[37] = false;
  2435. #endif
  2436. ac_LagCompMode = !!GetConsoleVarAsInt("lagcompmode");
  2437. print(" ");
  2438. print("--------------------------------------");
  2439. print(LOADED_MSG_1);
  2440. printf(LOADED_MSG_2, NEX_AC_VERSION);
  2441. print(LOADED_MSG_3);
  2442. print("--------------------------------------\n");
  2443. new ac_a = 1;
  2444. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2445. && defined ac_OnGameModeInit
  2446. ac_a = ac_OnGameModeInit();
  2447. #endif
  2448. static ac_strtmp[10];
  2449. GetConsoleVarAsString("version", ac_strtmp, sizeof ac_strtmp);
  2450. if(strcmp(ac_strtmp, AC_SERVER_VERSION)) print(VERSION_WARNING);
  2451. #undef AC_SERVER_VERSION
  2452. return ac_a;
  2453. }
  2454. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2455. #if defined _ALS_OnGameModeInit
  2456. #undef OnGameModeInit
  2457. #else
  2458. #define _ALS_OnGameModeInit
  2459. #endif
  2460. #define OnGameModeInit ac_OnGameModeInit
  2461. #if defined ac_OnGameModeInit
  2462. forward ac_OnGameModeInit();
  2463. #endif
  2464. #endif
  2465. #if defined _inc_y_hooks || defined _INC_y_hooks
  2466. hook OnGameModeExit()
  2467. #else
  2468. public OnGameModeExit()
  2469. #endif
  2470. {
  2471. new ac_a = 1;
  2472. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2473. && defined ac_OnGameModeExit
  2474. ac_a = ac_OnGameModeExit();
  2475. #endif
  2476. print(" ");
  2477. print("--------------------------------------");
  2478. print(STATS_STRING_1);
  2479. print(STATS_STRING_2);
  2480. printf(STATS_STRING_3, ac_sInfo[0]);
  2481. printf(STATS_STRING_4, ac_sInfo[1]);
  2482. printf(STATS_STRING_5, ac_sInfo[2]);
  2483. printf(STATS_STRING_6, ac_sInfo[3]);
  2484. printf(STATS_STRING_7, ac_sInfo[4]);
  2485. printf(STATS_STRING_8, ac_sInfo[5]);
  2486. print("--------------------------------------\n");
  2487. return ac_a;
  2488. }
  2489. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2490. #if defined _ALS_OnGameModeExit
  2491. #undef OnGameModeExit
  2492. #else
  2493. #define _ALS_OnGameModeExit
  2494. #endif
  2495. #define OnGameModeExit ac_OnGameModeExit
  2496. #if defined ac_OnGameModeExit
  2497. forward ac_OnGameModeExit();
  2498. #endif
  2499. #endif
  2500. #if defined _inc_y_hooks || defined _INC_y_hooks
  2501. hook OnPlayerConnect(playerid)
  2502. #else
  2503. public OnPlayerConnect(playerid)
  2504. #endif
  2505. {
  2506. GetPlayerIp(playerid, ACInfo[playerid][acIp], 16);
  2507. if(IsPlayerNPC(playerid))
  2508. {
  2509. if(ac_ACAllow[36] && strcmp(ACInfo[playerid][acIp], "127.0.0.1")) ac_KickWithCode(playerid, "", 0, 36);
  2510. ACInfo[playerid][acTimerID] = -1;
  2511. }
  2512. else
  2513. {
  2514. if(ac_ACAllow[48] && ACInfo[playerid][acOnline]) ac_KickWithCode(playerid, "", 0, 48, 1);
  2515. if(ac_ACAllow[41])
  2516. {
  2517. static ac_version[8];
  2518. ac_version[0] = EOS;
  2519. GetPlayerVersion(playerid, ac_version, sizeof ac_version);
  2520. if(strcmp(ac_version, "unknown", true) == 0)
  2521. {
  2522. #if defined DEBUG
  2523. printf(DEBUG_CODE_2, playerid, ac_version);
  2524. #endif
  2525. ac_KickWithCode(playerid, "", 0, 41);
  2526. }
  2527. }
  2528. new ac_i = AC_MAX_CONNECTS_FROM_IP;
  2529. if(ac_ACAllow[40])
  2530. {
  2531. #if defined foreach
  2532. foreach(new ac_f : Player)
  2533. {
  2534. if(IsPlayerNPC(ac_f) == 0 && ac_f != playerid &&
  2535. strcmp(ACInfo[playerid][acIp], ACInfo[ac_f][acIp], false) == 0)
  2536. #else
  2537. for(new ac_f = GetPlayerPoolSize(); ac_f > -1; --ac_f)
  2538. {
  2539. if(IsPlayerConnected(ac_f) && IsPlayerNPC(ac_f) == 0 && ac_f != playerid &&
  2540. strcmp(ACInfo[playerid][acIp], ACInfo[ac_f][acIp], false) == 0)
  2541. #endif
  2542. {
  2543. ac_i--;
  2544. if(ac_i == 0)
  2545. {
  2546. #if defined DEBUG
  2547. printf(DEBUG_CODE_3, playerid, AC_MAX_CONNECTS_FROM_IP);
  2548. #endif
  2549. #undef AC_MAX_CONNECTS_FROM_IP
  2550. ac_KickWithCode(playerid, "", 0, 40);
  2551. break;
  2552. }
  2553. }
  2554. }
  2555. }
  2556. ACInfo[playerid][acSpec] =
  2557. ACInfo[playerid][acDeathRes] = false;
  2558. ACInfo[playerid][acDead] = true;
  2559. ACInfo[playerid][acIntEnterExits] = ac_IntEnterExits;
  2560. ACInfo[playerid][acStuntBonus] = ac_StuntBonus;
  2561. ACInfo[playerid][acCheatCount][0] =
  2562. ACInfo[playerid][acLastWeapon] =
  2563. ACInfo[playerid][acSpawnRes] =
  2564. ACInfo[playerid][acSet][14] =
  2565. ACInfo[playerid][acKicked] =
  2566. ACInfo[playerid][acMoney] = 0;
  2567. ACInfo[playerid][acSet][13] =
  2568. ACInfo[playerid][acSet][12] =
  2569. ACInfo[playerid][acSet][10] =
  2570. ACInfo[playerid][acSet][0] =
  2571. ACInfo[playerid][acNextDialog] =
  2572. ACInfo[playerid][acDialog] = -1;
  2573. ACInfo[playerid][acAnim] = -2;
  2574. for(ac_i = 12; ac_i > -1; --ac_i)
  2575. {
  2576. ACInfo[playerid][acSetWeapon][ac_i] = -1;
  2577. ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  2578. }
  2579. for(ac_i = 27; ac_i > -1; --ac_i) ACInfo[playerid][acFloodCount][ac_i] = 0;
  2580. ACInfo[playerid][acDropJpX] = ACInfo[playerid][acDropJpY] = ACInfo[playerid][acDropJpZ] = 20000.0;
  2581. memcpy(ACInfo[playerid][acACAllow], ac_ACAllow, 0, sizeof(ac_ACAllow) * 4, sizeof ac_ACAllow);
  2582. ACInfo[playerid][acTimerID] = SetTimerEx("ac_Timer", 1000, false, "i", playerid);
  2583. }
  2584. ACInfo[playerid][acOnline] = true;
  2585. ACInfo[playerid][acLogged] = false;
  2586. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2587. && defined ac_OnPlayerConnect
  2588. return ac_OnPlayerConnect(playerid);
  2589. #else
  2590. return 1;
  2591. #endif
  2592. }
  2593. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2594. #if defined _ALS_OnPlayerConnect
  2595. #undef OnPlayerConnect
  2596. #else
  2597. #define _ALS_OnPlayerConnect
  2598. #endif
  2599. #define OnPlayerConnect ac_OnPlayerConnect
  2600. #if defined ac_OnPlayerConnect
  2601. forward ac_OnPlayerConnect(playerid);
  2602. #endif
  2603. #endif
  2604. #if defined _inc_y_hooks || defined _INC_y_hooks
  2605. hook OnPlayerDisconnect(playerid, reason)
  2606. #else
  2607. public OnPlayerDisconnect(playerid, reason)
  2608. #endif
  2609. {
  2610. if(ACInfo[playerid][acOnline])
  2611. {
  2612. ACInfo[playerid][acOnline] = false;
  2613. if(IsPlayerNPC(playerid) == 0)
  2614. {
  2615. KillTimer(ACInfo[playerid][acTimerID]);
  2616. if(ACInfo[playerid][acACAllow][37]) BlockIpAddress(ACInfo[playerid][acIp],
  2617. (AC_MIN_TIME_RECONNECT * 1000) - (reason > 0 ? 0 : GetConsoleVarAsInt("playertimeout")));
  2618. #undef AC_MIN_TIME_RECONNECT
  2619. }
  2620. if(ACInfo[playerid][acLastVeh] > 0 &&
  2621. ACVehInfo[ACInfo[playerid][acLastVeh]][acDriver] == playerid) ACVehInfo[ACInfo[playerid][acLastVeh]][acDriver] = 65535;
  2622. if(ACInfo[playerid][acVeh] > 0 && ACVehInfo[ACInfo[playerid][acVeh]][acDriver] == playerid)
  2623. {
  2624. ACVehInfo[ACInfo[playerid][acVeh]][acDriver] = 65535;
  2625. if(ACInfo[playerid][acKicked] == 2)
  2626. {
  2627. LinkVehicleToInterior(ACInfo[playerid][acVeh], ACVehInfo[ACInfo[playerid][acVeh]][acInt]);
  2628. SetVehicleZAngle(ACInfo[playerid][acVeh], ACVehInfo[ACInfo[playerid][acVeh]][acZAngle]);
  2629. SetVehiclePos(ACInfo[playerid][acVeh], ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  2630. SetVehicleHealth(ACInfo[playerid][acVeh], ACVehInfo[ACInfo[playerid][acVeh]][acHealth]);
  2631. ChangeVehiclePaintjob(ACInfo[playerid][acVeh], ACVehInfo[ACInfo[playerid][acVeh]][acPaintJob]);
  2632. }
  2633. }
  2634. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2635. && defined ac_OnPlayerDisconnect
  2636. return ac_OnPlayerDisconnect(playerid, reason);
  2637. #endif
  2638. }
  2639. return 1;
  2640. }
  2641. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2642. #if defined _ALS_OnPlayerDisconnect
  2643. #undef OnPlayerDisconnect
  2644. #else
  2645. #define _ALS_OnPlayerDisconnect
  2646. #endif
  2647. #define OnPlayerDisconnect ac_OnPlayerDisconnect
  2648. #if defined ac_OnPlayerDisconnect
  2649. forward ac_OnPlayerDisconnect(playerid, reason);
  2650. #endif
  2651. #endif
  2652. #if defined _inc_y_hooks || defined _INC_y_hooks
  2653. hook OnPlayerSpawn(playerid)
  2654. #else
  2655. public OnPlayerSpawn(playerid)
  2656. #endif
  2657. {
  2658. if(ACInfo[playerid][acKicked]) return 0;
  2659. if(IsPlayerNPC(playerid) == 0)
  2660. {
  2661. new ac_i;
  2662. if(ACInfo[playerid][acSpec]) ACInfo[playerid][acSpec] = false;
  2663. else
  2664. {
  2665. ac_i = GetTickCount();
  2666. if(ACInfo[playerid][acACAllow][27] &&
  2667. (ACInfo[playerid][acSpawnRes] < 1 || ac_i < ACInfo[playerid][acSpawnTime] + 1000))
  2668. {
  2669. #if defined DEBUG
  2670. printf("[Nex-AC debug] Spawn res: %d, Respawn time: %d",
  2671. ACInfo[playerid][acSpawnRes], ac_i - ACInfo[playerid][acSpawnTime]);
  2672. #endif
  2673. ac_KickWithCode(playerid, "", 0, 27);
  2674. #if defined OnCheatDetected
  2675. ACInfo[playerid][acSpawnRes] = 1;
  2676. #endif
  2677. }
  2678. ACInfo[playerid][acSpawnRes]--;
  2679. }
  2680. for(ac_i = 11; ac_i > 0; --ac_i) ACInfo[playerid][acSet][ac_i] = -1;
  2681. for(ac_i = 12; ac_i > -1; --ac_i)
  2682. {
  2683. ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acAmmo][ac_i] = 0;
  2684. ACInfo[playerid][acSetWeapon][ac_i] = -1;
  2685. ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  2686. }
  2687. ACInfo[playerid][acParachute] =
  2688. ACInfo[playerid][acModShop] =
  2689. ACInfo[playerid][acPicked] =
  2690. ACInfo[playerid][acTpToZ] =
  2691. ACInfo[playerid][acDead] = false;
  2692. ACInfo[playerid][acFreeze] = true;
  2693. ACInfo[playerid][acNextSpecAct] =
  2694. ACInfo[playerid][acLastPickup] =
  2695. ACInfo[playerid][acSeat] = -1;
  2696. ACInfo[playerid][acCheatCount][14] =
  2697. ACInfo[playerid][acCheatCount][9] =
  2698. ACInfo[playerid][acLastSpecAct] =
  2699. ACInfo[playerid][acLastShot] =
  2700. ACInfo[playerid][acLastVeh] =
  2701. ACInfo[playerid][acSpecAct] =
  2702. ACInfo[playerid][acDmgRes] =
  2703. ACInfo[playerid][acVeh] = 0;
  2704. ACInfo[playerid][acSpeed] = 0.0;
  2705. SetPlayerHealth(playerid, 100.0);
  2706. SetPlayerArmour(playerid, 0.0);
  2707. if(ACInfo[playerid][acSpawnWeapon1] != -1)
  2708. {
  2709. ACInfo[playerid][acWeapon][ac_wSlot[ACInfo[playerid][acSpawnWeapon1]]] = ACInfo[playerid][acSpawnWeapon1];
  2710. ACInfo[playerid][acAmmo][ac_wSlot[ACInfo[playerid][acSpawnWeapon1]]] = ACInfo[playerid][acSpawnAmmo1];
  2711. }
  2712. if(ACInfo[playerid][acSpawnWeapon2] != -1)
  2713. {
  2714. ACInfo[playerid][acWeapon][ac_wSlot[ACInfo[playerid][acSpawnWeapon2]]] = ACInfo[playerid][acSpawnWeapon2];
  2715. ACInfo[playerid][acAmmo][ac_wSlot[ACInfo[playerid][acSpawnWeapon2]]] = ACInfo[playerid][acSpawnAmmo2];
  2716. }
  2717. if(ACInfo[playerid][acSpawnWeapon3] != -1)
  2718. {
  2719. ACInfo[playerid][acWeapon][ac_wSlot[ACInfo[playerid][acSpawnWeapon3]]] = ACInfo[playerid][acSpawnWeapon3];
  2720. ACInfo[playerid][acAmmo][ac_wSlot[ACInfo[playerid][acSpawnWeapon3]]] = ACInfo[playerid][acSpawnAmmo3];
  2721. }
  2722. }
  2723. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2724. && defined ac_OnPlayerSpawn
  2725. return ac_OnPlayerSpawn(playerid);
  2726. #else
  2727. return 1;
  2728. #endif
  2729. }
  2730. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2731. #if defined _ALS_OnPlayerSpawn
  2732. #undef OnPlayerSpawn
  2733. #else
  2734. #define _ALS_OnPlayerSpawn
  2735. #endif
  2736. #define OnPlayerSpawn ac_OnPlayerSpawn
  2737. #if defined ac_OnPlayerSpawn
  2738. forward ac_OnPlayerSpawn(playerid);
  2739. #endif
  2740. #endif
  2741. #if defined _inc_y_hooks || defined _INC_y_hooks
  2742. hook OnPlayerDeath(playerid, killerid, reason)
  2743. #else
  2744. public OnPlayerDeath(playerid, killerid, reason)
  2745. #endif
  2746. {
  2747. if(ACInfo[playerid][acKicked]) return 0;
  2748. if(ACInfo[playerid][acACAllow][28] &&
  2749. (ACInfo[playerid][acDead] || ACInfo[playerid][acDeathRes] == false &&
  2750. reason != 255 && (reason != 54 || killerid != 65535)))
  2751. {
  2752. #if defined DEBUG
  2753. printf("[Nex-AC debug] Is dead: %d, Death res: %d, killerid: %d, reason: %d",
  2754. ACInfo[playerid][acDead], ACInfo[playerid][acDeathRes], killerid, reason);
  2755. #endif
  2756. ac_KickWithCode(playerid, "", 0, 28);
  2757. }
  2758. ACInfo[playerid][acDeathRes] = false;
  2759. ACInfo[playerid][acSet][0] = -1;
  2760. ACInfo[playerid][acDead] = true;
  2761. ACInfo[playerid][acSpawnRes] = 1;
  2762. ACInfo[playerid][acSpawnTime] = GetTickCount();
  2763. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2764. && defined ac_OnPlayerDeath
  2765. return ac_OnPlayerDeath(playerid, killerid, reason);
  2766. #else
  2767. return 1;
  2768. #endif
  2769. }
  2770. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2771. #if defined _ALS_OnPlayerDeath
  2772. #undef OnPlayerDeath
  2773. #else
  2774. #define _ALS_OnPlayerDeath
  2775. #endif
  2776. #define OnPlayerDeath ac_OnPlayerDeath
  2777. #if defined ac_OnPlayerDeath
  2778. forward ac_OnPlayerDeath(playerid, killerid, reason);
  2779. #endif
  2780. #endif
  2781. #if defined _inc_y_hooks || defined _INC_y_hooks
  2782. hook OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  2783. #else
  2784. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  2785. #endif
  2786. {
  2787. if(ACInfo[playerid][acKicked]) return 1;
  2788. ACInfo[playerid][acDeathRes] = true;
  2789. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2790. && defined ac_OnPlayerTakeDamage
  2791. return ac_OnPlayerTakeDamage(playerid, issuerid, amount, weaponid, bodypart);
  2792. #else
  2793. return 0;
  2794. #endif
  2795. }
  2796. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2797. #if defined _ALS_OnPlayerTakeDamage
  2798. #undef OnPlayerTakeDamage
  2799. #else
  2800. #define _ALS_OnPlayerTakeDamage
  2801. #endif
  2802. #define OnPlayerTakeDamage ac_OnPlayerTakeDamage
  2803. #if defined ac_OnPlayerTakeDamage
  2804. forward ac_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
  2805. #endif
  2806. #endif
  2807. #endif
  2808. #if defined FILTERSCRIPT
  2809. #if defined _inc_y_hooks || defined _INC_y_hooks
  2810. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2811. #else
  2812. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2813. #endif
  2814. {
  2815. new ac_nd = fs_AntiCheatGetNextDialog(playerid);
  2816. if(dialogid != AntiCheatGetDialog(playerid) && dialogid == ac_nd) fs_AntiCheatSetDialog(playerid, ac_nd);
  2817. fs_AntiCheatSetNextDialog(playerid, -1);
  2818. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2819. && defined ac_fs_OnDialogResponse
  2820. return ac_fs_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  2821. #else
  2822. return 0;
  2823. #endif
  2824. }
  2825. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2826. #if defined _ALS_OnDialogResponse
  2827. #undef OnDialogResponse
  2828. #else
  2829. #define _ALS_OnDialogResponse
  2830. #endif
  2831. #define OnDialogResponse ac_fs_OnDialogResponse
  2832. #if defined ac_fs_OnDialogResponse
  2833. forward ac_fs_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  2834. #endif
  2835. #endif
  2836. #else
  2837. #if defined _inc_y_hooks || defined _INC_y_hooks
  2838. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2839. #else
  2840. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2841. #endif
  2842. {
  2843. if(ACInfo[playerid][acKicked]) return 1;
  2844. new ac_i = GetTickCount();
  2845. if(ACInfo[playerid][acACAllow][49])
  2846. {
  2847. if(ac_i < ACInfo[playerid][acCall][0] + ac_Mtfc[0][0]) ac_FloodDetect(playerid, 0);
  2848. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  2849. else ACInfo[playerid][acFloodCount][0] = ACInfo[playerid][acFloodCount][27] = 0;
  2850. }
  2851. if(ACInfo[playerid][acACAllow][39] && dialogid != ACInfo[playerid][acDialog])
  2852. {
  2853. #if defined DEBUG
  2854. printf("[Nex-AC debug] AC dialog: %d, dialogid: %d", ACInfo[playerid][acDialog], dialogid);
  2855. #endif
  2856. #if defined OnCheatDetected
  2857. ac_KickWithCode(playerid, "", 0, 39);
  2858. #else
  2859. ac_KickWithCode(playerid, "", 0, 39);
  2860. return 1;
  2861. #endif
  2862. }
  2863. ACInfo[playerid][acDialog] = -1;
  2864. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][0] = ac_i;
  2865. if(ACInfo[playerid][acACAllow][45])
  2866. {
  2867. for(ac_i = strlen(inputtext) - 1; ac_i > -1; --ac_i)
  2868. {
  2869. if(inputtext[ac_i] == '%') strdel(inputtext, ac_i, ac_i + 1);
  2870. }
  2871. }
  2872. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2873. && defined ac_OnDialogResponse
  2874. return ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  2875. #else
  2876. return 0;
  2877. #endif
  2878. }
  2879. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2880. #if defined _ALS_OnDialogResponse
  2881. #undef OnDialogResponse
  2882. #else
  2883. #define _ALS_OnDialogResponse
  2884. #endif
  2885. #define OnDialogResponse ac_OnDialogResponse
  2886. #if defined ac_OnDialogResponse
  2887. forward ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  2888. #endif
  2889. #endif
  2890. #if defined _inc_y_hooks || defined _INC_y_hooks
  2891. hook OnEnterExitModShop(playerid, enterexit, interiorid)
  2892. #else
  2893. public OnEnterExitModShop(playerid, enterexit, interiorid)
  2894. #endif
  2895. {
  2896. if(ACInfo[playerid][acKicked]) return 0;
  2897. #if !AC_USE_TUNING_GARAGES && !defined OnCheatDetected
  2898. return ac_KickWithCode(playerid, "", 0, 23, 1);
  2899. #else
  2900. #if !AC_USE_TUNING_GARAGES
  2901. ac_KickWithCode(playerid, "", 0, 23, 1);
  2902. #endif
  2903. new ac_i = GetTickCount();
  2904. if(ACInfo[playerid][acACAllow][49])
  2905. {
  2906. if(ac_i < ACInfo[playerid][acCall][1] + ac_Mtfc[1][0]) ac_FloodDetect(playerid, 1);
  2907. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  2908. else ACInfo[playerid][acFloodCount][1] = ACInfo[playerid][acFloodCount][27] = 0;
  2909. }
  2910. ACInfo[playerid][acSet][0] = interiorid;
  2911. ACInfo[playerid][acModShop] = !!enterexit;
  2912. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][1] = ac_i;
  2913. ACInfo[playerid][acGtc][11] = ac_i + 1500;
  2914. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2915. && defined ac_OnEnterExitModShop
  2916. return ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  2917. #else
  2918. return 1;
  2919. #endif
  2920. #endif
  2921. #undef AC_USE_TUNING_GARAGES
  2922. }
  2923. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2924. #if defined _ALS_OnEnterExitModShop
  2925. #undef OnEnterExitModShop
  2926. #else
  2927. #define _ALS_OnEnterExitModShop
  2928. #endif
  2929. #define OnEnterExitModShop ac_OnEnterExitModShop
  2930. #if defined ac_OnEnterExitModShop
  2931. forward ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  2932. #endif
  2933. #endif
  2934. #if defined _inc_y_hooks || defined _INC_y_hooks
  2935. hook OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  2936. #else
  2937. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  2938. #endif
  2939. {
  2940. if(IsPlayerConnected(playerid) == 0 || ACInfo[playerid][acKicked]) return 0;
  2941. new ac_vehid = GetPlayerVehicleID(playerid);
  2942. if(newinteriorid != ACInfo[playerid][acSet][0])
  2943. {
  2944. if(ac_vehid > 0)
  2945. {
  2946. if(ACInfo[playerid][acACAllow][3])
  2947. {
  2948. #if defined DEBUG
  2949. printf("[Nex-AC debug] AC interior: %d, newinteriorid: %d, vehicleid: %d",
  2950. ACInfo[playerid][acSet][0], newinteriorid, ac_vehid);
  2951. #endif
  2952. ac_KickWithCode(playerid, "", 0, 3, 1);
  2953. }
  2954. }
  2955. else if(ACInfo[playerid][acIntEnterExits])
  2956. {
  2957. GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  2958. ACInfo[playerid][acGtc][11] = GetTickCount() + 1500;
  2959. }
  2960. else if(ACInfo[playerid][acACAllow][2] && newinteriorid != ACInfo[playerid][acSet][12])
  2961. {
  2962. #if defined DEBUG
  2963. printf("[Nex-AC debug] AC interior: %d, AC next interior: %d, newinteriorid: %d",
  2964. ACInfo[playerid][acSet][0], ACInfo[playerid][acSet][12], newinteriorid);
  2965. #endif
  2966. ac_KickWithCode(playerid, "", 0, 2, 1);
  2967. }
  2968. }
  2969. if(ACInfo[playerid][acKicked] == 0 && ac_vehid > 0) ACVehInfo[ac_vehid][acInt] = newinteriorid;
  2970. if(ACInfo[playerid][acSet][12] == -1) ACInfo[playerid][acSet][0] = -1;
  2971. else ACInfo[playerid][acSet][12] = -1;
  2972. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2973. && defined ac_OnPlayerInteriorChange
  2974. return ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  2975. #else
  2976. return 1;
  2977. #endif
  2978. }
  2979. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2980. #if defined _ALS_OnPlayerInteriorChange
  2981. #undef OnPlayerInteriorChange
  2982. #else
  2983. #define _ALS_OnPlayerInteriorChange
  2984. #endif
  2985. #define OnPlayerInteriorChange ac_OnPlayerInteriorChange
  2986. #if defined ac_OnPlayerInteriorChange
  2987. forward ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  2988. #endif
  2989. #endif
  2990. #if defined _inc_y_hooks || defined _INC_y_hooks
  2991. hook OnRconLoginAttempt(ip[], password[], success)
  2992. #else
  2993. public OnRconLoginAttempt(ip[], password[], success)
  2994. #endif
  2995. {
  2996. if(ac_ACAllow[42])
  2997. {
  2998. static ac_iptables[MAX_PLAYERS][2], ac_ip_index;
  2999. new ac_i, ac_current_ip = ac_IpToInt(ip);
  3000. for(; ac_i < ac_ip_index && ac_i < sizeof ac_iptables; ++ac_i)
  3001. {
  3002. if(ac_iptables[ac_i][0] == ac_current_ip)
  3003. {
  3004. if(success) ac_iptables[ac_i][1] = 0;
  3005. else if(++ac_iptables[ac_i][1] > AC_MAX_RCON_LOGIN_ATTEMPT)
  3006. {
  3007. #if defined DEBUG
  3008. printf(DEBUG_CODE_4, ip, password);
  3009. #endif
  3010. ac_iptables[ac_i][1] = 0;
  3011. ac_KickWithCode(65535, ip, 1, 42, 1);
  3012. }
  3013. ac_i = -1;
  3014. break;
  3015. }
  3016. }
  3017. if(ac_i != -1 && success == 0)
  3018. {
  3019. ac_iptables[ac_ip_index][0] = ac_current_ip;
  3020. if(++ac_iptables[ac_ip_index][1] > AC_MAX_RCON_LOGIN_ATTEMPT)
  3021. {
  3022. #undef AC_MAX_RCON_LOGIN_ATTEMPT
  3023. #if defined DEBUG
  3024. printf(DEBUG_CODE_4, ip, password, ac_iptables[ac_ip_index][1]);
  3025. #endif
  3026. ac_iptables[ac_ip_index][1] = 0;
  3027. ac_KickWithCode(65535, ip, 1, 42, 2);
  3028. }
  3029. if(++ac_ip_index >= sizeof ac_iptables) ac_ip_index = 0;
  3030. ac_iptables[ac_ip_index][1] = 0;
  3031. }
  3032. }
  3033. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3034. && defined ac_OnRconLoginAttempt
  3035. return ac_OnRconLoginAttempt(ip, password, success);
  3036. #else
  3037. return 1;
  3038. #endif
  3039. }
  3040. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3041. #if defined _ALS_OnRconLoginAttempt
  3042. #undef OnRconLoginAttempt
  3043. #else
  3044. #define _ALS_OnRconLoginAttempt
  3045. #endif
  3046. #define OnRconLoginAttempt ac_OnRconLoginAttempt
  3047. #if defined ac_OnRconLoginAttempt
  3048. forward ac_OnRconLoginAttempt(ip[], password[], success);
  3049. #endif
  3050. #endif
  3051. #if defined _inc_y_hooks || defined _INC_y_hooks
  3052. hook OnPlayerUpdate(playerid)
  3053. #else
  3054. public OnPlayerUpdate(playerid)
  3055. #endif
  3056. {
  3057. if(ACInfo[playerid][acKicked]) return 0;
  3058. static ac_gtc, ac_gpp, bool:ac_ur;
  3059. ac_ur = false;
  3060. ac_gtc = GetTickCount();
  3061. if(IsPlayerNPC(playerid) == 0)
  3062. {
  3063. static ac_stateanim;
  3064. if((ac_stateanim = GetPlayerState(playerid)) != 9)
  3065. {
  3066. ac_gpp = GetPlayerPing(playerid) + 150;
  3067. static ac_w, ac_a;
  3068. ac_a = GetPlayerAmmo(playerid);
  3069. ac_w = GetPlayerWeapon(playerid);
  3070. if(ACInfo[playerid][acSet][3] != -1)
  3071. {
  3072. if(ACInfo[playerid][acSet][3] == ac_w)
  3073. {
  3074. ACInfo[playerid][acSet][3] =
  3075. ACInfo[playerid][acSetWeapon][ac_wSlot[ac_w]] = -1;
  3076. ACInfo[playerid][acWeapon][ac_wSlot[ac_w]] = ac_w;
  3077. }
  3078. else if(ACInfo[playerid][acGiveAmmo][ac_wSlot[ACInfo[playerid][acSet][3]]] == 0) ACInfo[playerid][acSet][3] = -1;
  3079. else if(ACInfo[playerid][acACAllow][52] &&
  3080. !(2 <= ac_stateanim <= 3) && ac_gtc > ACInfo[playerid][acGtc][2] + ac_gpp &&
  3081. ++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_WARNINGS)
  3082. {
  3083. #if defined DEBUG
  3084. printf(DEBUG_CODE_5, playerid, "GivePlayerWeapon");
  3085. printf("[Nex-AC debug] AC weapon: %d, weaponid: %d", ACInfo[playerid][acSet][3], ac_w);
  3086. #endif
  3087. #if defined OnCheatDetected
  3088. ac_KickWithCode(playerid, "", 0, 52, 1);
  3089. ACInfo[playerid][acSetWeapon][ac_wSlot[ac_w]] = ACInfo[playerid][acSet][3] = -1;
  3090. #else
  3091. return ac_KickWithCode(playerid, "", 0, 52, 1);
  3092. #endif
  3093. }
  3094. }
  3095. if(ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_w]] != -65535)
  3096. {
  3097. if(ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_w]] >= ac_a)
  3098. {
  3099. ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_w]] = -65535;
  3100. ACInfo[playerid][acAmmo][ac_wSlot[ac_w]] = ac_a;
  3101. }
  3102. else if(ACInfo[playerid][acACAllow][52] &&
  3103. ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_wSlot[ac_w]] + ac_gpp &&
  3104. ++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_WARNINGS)
  3105. {
  3106. #if defined DEBUG
  3107. printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
  3108. printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  3109. ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_w]], ac_a, ac_w);
  3110. #endif
  3111. #if defined OnCheatDetected
  3112. ac_KickWithCode(playerid, "", 0, 52, 2);
  3113. ACInfo[playerid][acGiveAmmo][ac_wSlot[ac_w]] = -65535;
  3114. #else
  3115. return ac_KickWithCode(playerid, "", 0, 52, 2);
  3116. #endif
  3117. }
  3118. }
  3119. static ac_m;
  3120. ac_m = bad_GetPlayerMoney(playerid);
  3121. if(ACInfo[playerid][acSet][10] != -1)
  3122. {
  3123. if(ac_m < ACInfo[playerid][acMoney] &&
  3124. ACInfo[playerid][acSet][10] <= (ACInfo[playerid][acMoney] - ac_m)) ACInfo[playerid][acSet][10] = -1;
  3125. else if(ACInfo[playerid][acACAllow][15] && ac_gtc > ACInfo[playerid][acGtc][15] + ac_gpp &&
  3126. ++ACInfo[playerid][acCheatCount][10] > AC_MAX_NOP_WARNINGS)
  3127. {
  3128. #if defined DEBUG
  3129. printf("[Nex-AC debug] Money: %d, old money: %d, price: %d",
  3130. ac_m, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][10]);
  3131. #endif
  3132. #if defined OnCheatDetected
  3133. ac_KickWithCode(playerid, "", 0, 15, 3);
  3134. ACInfo[playerid][acSet][10] = -1;
  3135. #else
  3136. return ac_KickWithCode(playerid, "", 0, 15, 3);
  3137. #endif
  3138. }
  3139. }
  3140. static ac_i;
  3141. ac_i = GetPlayerInterior(playerid);
  3142. if(ACInfo[playerid][acLastWeapon] != ac_w)
  3143. {
  3144. if(ACInfo[playerid][acWeapon][ac_wSlot[ac_w]] != ac_w)
  3145. {
  3146. if(ac_w == 40 || ac_w == 46 && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute])
  3147. {
  3148. ACInfo[playerid][acWeapon][ac_wSlot[ac_w]] = ac_w;
  3149. ACInfo[playerid][acAmmo][ac_wSlot[ac_w]] = ac_a;
  3150. }
  3151. #if AC_USE_AMMUNATIONS
  3152. else if(22 <= ac_w <= 32 && ac_InAmmuNation(playerid, ac_i))
  3153. {
  3154. if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 22][0];
  3155. else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 22][0];
  3156. ACInfo[playerid][acAmmo][ac_wSlot[ac_w]] = ac_AmmuNationInfo[ac_w - 22][1];
  3157. ACInfo[playerid][acCheatCount][10] = 0;
  3158. ACInfo[playerid][acWeapon][ac_wSlot[ac_w]] = ac_w;
  3159. ac_ur = true;
  3160. }
  3161. #endif
  3162. else if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS &&
  3163. ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  3164. ac_a <= (3 <= ac_wSlot[ac_w] <= 5 ? ACInfo[playerid][acAmmo][ac_wSlot[ac_w]] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
  3165. IsPlayerInRangeOfPoint(playerid, 8.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  3166. ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]))
  3167. {
  3168. ACInfo[playerid][acWeapon][ac_wSlot[ac_w]] = ac_w;
  3169. ACInfo[playerid][acAmmo][ac_wSlot[ac_w]] = ac_a;
  3170. }
  3171. else if(ACInfo[playerid][acLastPickup] > MAX_PICKUPS &&
  3172. ACDPickInfo[ACInfo[playerid][acLastPickup] - MAX_PICKUPS][acWeapon] == ac_w &&
  3173. ac_a <= (3 <= ac_wSlot[ac_w] <= 5 ? ACInfo[playerid][acAmmo][ac_wSlot[ac_w]] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
  3174. IsPlayerInRangeOfPoint(playerid, 8.0, ACDPickInfo[ACInfo[playerid][acLastPickup] - MAX_PICKUPS][acPosX],
  3175. ACDPickInfo[ACInfo[playerid][acLastPickup] - MAX_PICKUPS][acPosY],
  3176. ACDPickInfo[ACInfo[playerid][acLastPickup] - MAX_PICKUPS][acPosZ]))
  3177. {
  3178. ACInfo[playerid][acWeapon][ac_wSlot[ac_w]] = ac_w;
  3179. ACInfo[playerid][acAmmo][ac_wSlot[ac_w]] = ac_a;
  3180. }
  3181. else if(ACInfo[playerid][acACAllow][15] &&
  3182. ACInfo[playerid][acSetWeapon][ac_wSlot[ac_w]] == -1 && ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
  3183. {
  3184. #if defined DEBUG
  3185. printf("[Nex-AC debug] Weaponid: %d, ammo: %d", ac_w, ac_a);
  3186. #endif
  3187. #if defined OnCheatDetected
  3188. ac_KickWithCode(playerid, "", 0, 15, 1);
  3189. ACInfo[playerid][acWeapon][ac_wSlot[ac_w]] = ac_w;
  3190. #else
  3191. return ac_KickWithCode(playerid, "", 0, 15, 1);
  3192. #endif
  3193. }
  3194. }
  3195. }
  3196. else if(ACInfo[playerid][acAmmo][ac_wSlot[ac_w]] != ac_a)
  3197. {
  3198. switch(ac_w)
  3199. {
  3200. case 16..18, 35, 36, 39, 43:
  3201. {
  3202. if(ac_stateanim != 2)
  3203. {
  3204. if(ACInfo[playerid][acACAllow][16] &&
  3205. ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp && (ACInfo[playerid][acAmmo][ac_wSlot[ac_w]] == 0 ||
  3206. ACInfo[playerid][acAmmo][ac_wSlot[ac_w]] - 1 != ac_a))
  3207. {
  3208. #if defined DEBUG
  3209. printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  3210. ACInfo[playerid][acAmmo][ac_wSlot[ac_w]], ac_a, ac_w);
  3211. #endif
  3212. #if defined OnCheatDetected
  3213. ac_KickWithCode(playerid, "", 0, 16, 1);
  3214. ACInfo[playerid][acAmmo][ac_wSlot[ac_w]] = ac_a;
  3215. #else
  3216. return ac_KickWithCode(playerid, "", 0, 16, 1);
  3217. #endif
  3218. }
  3219. ACInfo[playerid][acAmmo][ac_wSlot[ac_w]]--;
  3220. }
  3221. }
  3222. }
  3223. }
  3224. static Float:ac_tmp, ac_hp;
  3225. GetPlayerHealth(playerid, ac_tmp);
  3226. ac_hp = floatround(ac_tmp, floatround_tozero);
  3227. if(ACInfo[playerid][acSet][1] != -1)
  3228. {
  3229. if(ACInfo[playerid][acSet][1] > 255)
  3230. {
  3231. while(ac_hp < ACInfo[playerid][acSet][1]) ac_hp += 256;
  3232. }
  3233. if(ACInfo[playerid][acSet][1] == ac_hp || ACInfo[playerid][acDmgRes] ||
  3234. ACInfo[playerid][acSet][1] >= ac_hp && ac_gtc > ACInfo[playerid][acGtc][3] + ac_gpp)
  3235. {
  3236. ACInfo[playerid][acSet][1] = -1;
  3237. ACInfo[playerid][acDmgRes] = 0;
  3238. }
  3239. else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtc][3] + ac_gpp &&
  3240. ++ACInfo[playerid][acNOPCount][3] > AC_MAX_NOP_WARNINGS)
  3241. {
  3242. #if defined DEBUG
  3243. printf(DEBUG_CODE_5, playerid, "SetPlayerHealth");
  3244. printf("[Nex-AC debug] AC health: %d, health: %d", ACInfo[playerid][acSet][1], ac_hp);
  3245. #endif
  3246. #if defined OnCheatDetected
  3247. ac_KickWithCode(playerid, "", 0, 52, 3);
  3248. ACInfo[playerid][acSet][1] = -1;
  3249. #else
  3250. return ac_KickWithCode(playerid, "", 0, 52, 3);
  3251. #endif
  3252. }
  3253. }
  3254. else if(ACInfo[playerid][acACAllow][12])
  3255. {
  3256. while(ACInfo[playerid][acHealth] > ac_hp + 255) ac_hp += 256;
  3257. if(ac_hp > ACInfo[playerid][acHealth])
  3258. {
  3259. #if AC_USE_RESTAURANTS
  3260. if(ac_hp > ACInfo[playerid][acHealth] + 70 || ac_InRestaurant(playerid, ac_i) == 0)
  3261. {
  3262. #endif
  3263. #if AC_USE_VENDING_MACHINES
  3264. if(ac_hp > ACInfo[playerid][acHealth] + 35 || ac_NearVendingMachine(playerid, ac_i) == 0)
  3265. {
  3266. #endif
  3267. #if defined DEBUG
  3268. printf("[Nex-AC debug] AC health: %d, health: %d", ACInfo[playerid][acHealth], ac_hp);
  3269. #endif
  3270. #if defined OnCheatDetected
  3271. ac_KickWithCode(playerid, "", 0, 12);
  3272. #else
  3273. return ac_KickWithCode(playerid, "", 0, 12);
  3274. #endif
  3275. #if AC_USE_VENDING_MACHINES
  3276. }
  3277. #endif
  3278. #if AC_USE_RESTAURANTS
  3279. }
  3280. #endif
  3281. }
  3282. }
  3283. static ac_ar;
  3284. GetPlayerArmour(playerid, ac_tmp);
  3285. ac_ar = floatround(ac_tmp, floatround_tozero);
  3286. if(ACInfo[playerid][acSet][2] != -1)
  3287. {
  3288. if(ACInfo[playerid][acSet][2] > 255)
  3289. {
  3290. while(ac_ar < ACInfo[playerid][acSet][2]) ac_ar += 256;
  3291. }
  3292. if(ACInfo[playerid][acSet][2] == ac_ar || ACInfo[playerid][acDmgRes] ||
  3293. ACInfo[playerid][acSet][2] >= ac_ar && ac_gtc > ACInfo[playerid][acGtc][5] + ac_gpp)
  3294. {
  3295. ACInfo[playerid][acSet][2] = -1;
  3296. ACInfo[playerid][acDmgRes] = 0;
  3297. }
  3298. else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtc][5] + ac_gpp &&
  3299. ++ACInfo[playerid][acNOPCount][5] > AC_MAX_NOP_WARNINGS)
  3300. {
  3301. #if defined DEBUG
  3302. printf(DEBUG_CODE_5, playerid, "SetPlayerArmour");
  3303. printf("[Nex-AC debug] AC armour: %d, armour: %d", ACInfo[playerid][acSet][2], ac_ar);
  3304. #endif
  3305. #if defined OnCheatDetected
  3306. ac_KickWithCode(playerid, "", 0, 52, 4);
  3307. ACInfo[playerid][acSet][2] = -1;
  3308. #else
  3309. return ac_KickWithCode(playerid, "", 0, 52, 4);
  3310. #endif
  3311. }
  3312. }
  3313. else if(ACInfo[playerid][acACAllow][13])
  3314. {
  3315. while(ACInfo[playerid][acArmour] > ac_ar + 255) ac_ar += 256;
  3316. if(ac_ar > ACInfo[playerid][acArmour])
  3317. {
  3318. #if AC_USE_AMMUNATIONS
  3319. if(ac_InAmmuNation(playerid, ac_i))
  3320. {
  3321. if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += 200;
  3322. else ACInfo[playerid][acSet][10] = 200;
  3323. ACInfo[playerid][acCheatCount][10] = 0;
  3324. ac_ur = true;
  3325. }
  3326. else
  3327. {
  3328. #endif
  3329. #if defined DEBUG
  3330. printf("[Nex-AC debug] AC armour: %d, armour: %d", ACInfo[playerid][acArmour], ac_ar);
  3331. #endif
  3332. #if defined OnCheatDetected
  3333. ac_KickWithCode(playerid, "", 0, 13);
  3334. #else
  3335. return ac_KickWithCode(playerid, "", 0, 13);
  3336. #endif
  3337. #if AC_USE_AMMUNATIONS
  3338. }
  3339. #endif
  3340. }
  3341. }
  3342. if(ACInfo[playerid][acACAllow][19])
  3343. {
  3344. if(ac_hp < ACInfo[playerid][acHealth] || ac_ar < ACInfo[playerid][acArmour])
  3345. {
  3346. ACInfo[playerid][acVehDmgRes] = false;
  3347. ACInfo[playerid][acCheatCount][9] =
  3348. ACInfo[playerid][acDmgRes] = 0;
  3349. }
  3350. else if(ACInfo[playerid][acDmgRes] && ac_gtc > ACInfo[playerid][acGtc][14] + ac_gpp)
  3351. {
  3352. ACInfo[playerid][acDmgRes] = 0;
  3353. ACInfo[playerid][acVehDmgRes] = false;
  3354. if(++ACInfo[playerid][acCheatCount][9] > AC_MAX_GODMODE_WARNINGS)
  3355. {
  3356. #if defined DEBUG
  3357. printf("[Nex-AC debug] AC health: %d, health: %d, AC armour: %d, armour: %d",
  3358. ACInfo[playerid][acHealth], ac_hp, ACInfo[playerid][acArmour], ac_ar);
  3359. #endif
  3360. #if defined OnCheatDetected
  3361. ac_KickWithCode(playerid, "", 0, 19);
  3362. ACInfo[playerid][acCheatCount][9] = 0;
  3363. #else
  3364. return ac_KickWithCode(playerid, "", 0, 19);
  3365. #endif
  3366. }
  3367. }
  3368. }
  3369. static ac_vehid;
  3370. ac_vehid = GetPlayerVehicleID(playerid);
  3371. if(ACInfo[playerid][acACAllow][14] && ac_m > ACInfo[playerid][acMoney] &&
  3372. !(ACInfo[playerid][acStuntBonus] && ac_vehid))
  3373. {
  3374. #if AC_USE_CASINOS
  3375. if(ac_InCasino(playerid, ac_i) == 0)
  3376. {
  3377. #endif
  3378. #if defined DEBUG
  3379. printf("[Nex-AC debug] AC money: %d, money: %d, Stunt Bonus: %d, vehicleid: %d",
  3380. ACInfo[playerid][acMoney], ac_m, ACInfo[playerid][acStuntBonus], ac_vehid);
  3381. #endif
  3382. #if defined OnCheatDetected
  3383. ac_KickWithCode(playerid, "", 0, 14);
  3384. ACInfo[playerid][acMoney] = ac_m;
  3385. #else
  3386. ac_m = ACInfo[playerid][acMoney];
  3387. ResetPlayerMoney(playerid);
  3388. GivePlayerMoney(playerid, ac_m);
  3389. #endif
  3390. #if AC_USE_CASINOS
  3391. }
  3392. #endif
  3393. }
  3394. if(ACInfo[playerid][acSet][13] != -1)
  3395. {
  3396. if(ac_m < ACInfo[playerid][acMoney] && ACInfo[playerid][acSet][13] <=
  3397. (ACInfo[playerid][acMoney] - ac_m)) ACInfo[playerid][acSet][13] = -1;
  3398. else if(ACInfo[playerid][acACAllow][23] && ac_gtc > ACInfo[playerid][acGtc][17] + ac_gpp &&
  3399. ++ACInfo[playerid][acCheatCount][12] > AC_MAX_NOP_WARNINGS)
  3400. {
  3401. #if defined DEBUG
  3402. printf("[Nex-AC debug] Money: %d, old money: %d, component price: %d",
  3403. ac_m, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][13]);
  3404. #endif
  3405. #if defined OnCheatDetected
  3406. ac_KickWithCode(playerid, "", 0, 23, 3);
  3407. ACInfo[playerid][acSet][13] = -1;
  3408. #else
  3409. return ac_KickWithCode(playerid, "", 0, 23, 3);
  3410. #endif
  3411. }
  3412. }
  3413. if(ACInfo[playerid][acACAllow][52])
  3414. {
  3415. if(ACInfo[playerid][acSet][0] != -1 && ACInfo[playerid][acSet][0] != ac_i &&
  3416. ac_gtc > ACInfo[playerid][acGtc][0] + ac_gpp && ++ACInfo[playerid][acNOPCount][2] > AC_MAX_NOP_WARNINGS)
  3417. {
  3418. #if defined DEBUG
  3419. printf(DEBUG_CODE_5, playerid, "SetPlayerInterior");
  3420. printf("[Nex-AC debug] AC interior: %d, interiorid: %d", ACInfo[playerid][acSet][0], ac_i);
  3421. #endif
  3422. #if defined OnCheatDetected
  3423. ac_KickWithCode(playerid, "", 0, 52, 5);
  3424. ACInfo[playerid][acSet][0] = -1;
  3425. #else
  3426. return ac_KickWithCode(playerid, "", 0, 52, 5);
  3427. #endif
  3428. }
  3429. if(ACInfo[playerid][acSet][6] != -1 && ac_gtc > ACInfo[playerid][acGtc][12] + ac_gpp &&
  3430. ++ACInfo[playerid][acNOPCount][8] > AC_MAX_NOP_WARNINGS)
  3431. {
  3432. #if defined DEBUG
  3433. printf(DEBUG_CODE_5, playerid, "TogglePlayerSpectating");
  3434. #endif
  3435. #if defined OnCheatDetected
  3436. ac_KickWithCode(playerid, "", 0, 52, 6);
  3437. ACInfo[playerid][acSet][6] = -1;
  3438. #else
  3439. return ac_KickWithCode(playerid, "", 0, 52, 6);
  3440. #endif
  3441. }
  3442. if(ACInfo[playerid][acSet][7] != -1 && ac_gtc > ACInfo[playerid][acGtc][13] + ac_gpp &&
  3443. ++ACInfo[playerid][acNOPCount][9] > AC_MAX_NOP_WARNINGS)
  3444. {
  3445. #if defined DEBUG
  3446. printf(DEBUG_CODE_5, playerid, "SpawnPlayer");
  3447. printf("[Nex-AC debug] acSet[7]: %d", ACInfo[playerid][acSet][7]);
  3448. #endif
  3449. #if defined OnCheatDetected
  3450. ac_KickWithCode(playerid, "", 0, 52, 7);
  3451. ACInfo[playerid][acSet][7] = -1;
  3452. #else
  3453. return ac_KickWithCode(playerid, "", 0, 52, 7);
  3454. #endif
  3455. }
  3456. if(ACInfo[playerid][acSet][11] != -1 && ac_vehid > 0 && ac_gtc > ACInfo[playerid][acGtc][8] + ac_gpp)
  3457. {
  3458. #if defined DEBUG
  3459. printf(DEBUG_CODE_5, playerid, "RemovePlayerFromVehicle");
  3460. printf("[Nex-AC debug] Veh model: %d", GetVehicleModel(ac_vehid));
  3461. #endif
  3462. #if defined OnCheatDetected
  3463. ac_KickWithCode(playerid, "", 0, 52, 8);
  3464. ACInfo[playerid][acSet][11] = -1;
  3465. #else
  3466. return ac_KickWithCode(playerid, "", 0, 52, 8);
  3467. #endif
  3468. }
  3469. }
  3470. static ac_s, Float:ac_X, Float:ac_Y, Float:ac_Z;
  3471. ac_s = GetPlayerVehicleSeat(playerid);
  3472. GetPlayerPos(playerid, ac_X, ac_Y, ac_Z);
  3473. if(ACInfo[playerid][acSet][9] != -1)
  3474. {
  3475. if(ACInfo[playerid][acSet][9] == ac_vehid && (ACInfo[playerid][acSet][5] == ac_s || ACInfo[playerid][acSet][5] == -1))
  3476. {
  3477. if(ACInfo[playerid][acVeh] > 0 &&
  3478. ACVehInfo[ACInfo[playerid][acVeh]][acDriver] == playerid) ACVehInfo[ACInfo[playerid][acVeh]][acDriver] = 65535;
  3479. if(ac_s == 0)
  3480. {
  3481. ACVehInfo[ac_vehid][acDriver] = playerid;
  3482. GetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]);
  3483. ACInfo[playerid][acSetVehHealth] = -1;
  3484. }
  3485. ACInfo[playerid][acCheatCount][11] = 0;
  3486. ACInfo[playerid][acVehDmgRes] = false;
  3487. ACInfo[playerid][acSet][11] =
  3488. ACInfo[playerid][acSet][9] =
  3489. ACInfo[playerid][acSet][8] =
  3490. ACInfo[playerid][acSet][5] = -1;
  3491. ACInfo[playerid][acSeat] = ac_s;
  3492. }
  3493. else if(GetVehicleModel(ACInfo[playerid][acSet][9]) == 0 ||
  3494. ACVehInfo[ACInfo[playerid][acSet][9]][acSpawned] == false || ACInfo[playerid][acSet][5] == -1)
  3495. {
  3496. ACInfo[playerid][acSet][9] =
  3497. ACInfo[playerid][acSet][5] = -1;
  3498. }
  3499. else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtc][1] + ac_gpp &&
  3500. ++ACInfo[playerid][acNOPCount][7] > AC_MAX_NOP_WARNINGS)
  3501. {
  3502. #if defined DEBUG
  3503. printf(DEBUG_CODE_5, playerid, "PutPlayerInVehicle");
  3504. printf("[Nex-AC debug] AC vehicle: %d, vehicleid: %d, AC seat: %d, seatid: %d",
  3505. ACInfo[playerid][acSet][9], ac_vehid, ACInfo[playerid][acSet][5], ac_s);
  3506. #endif
  3507. #if defined OnCheatDetected
  3508. ac_KickWithCode(playerid, "", 0, 52, 9);
  3509. ACInfo[playerid][acSet][9] = -1;
  3510. #else
  3511. return ac_KickWithCode(playerid, "", 0, 52, 9);
  3512. #endif
  3513. }
  3514. }
  3515. else
  3516. {
  3517. if(ACInfo[playerid][acSet][8] != -1)
  3518. {
  3519. if(IsPlayerInRangeOfPoint(playerid, 8.0, ACInfo[playerid][acSetPosX],
  3520. ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_Z : ACInfo[playerid][acSetPosZ])))
  3521. {
  3522. ACInfo[playerid][acSet][8] = -1;
  3523. ACInfo[playerid][acTpToZ] = false;
  3524. ACInfo[playerid][acPosX] = ac_X;
  3525. ACInfo[playerid][acPosY] = ac_Y;
  3526. ACInfo[playerid][acPosZ] = ac_Z;
  3527. }
  3528. else if(ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
  3529. {
  3530. if(ACInfo[playerid][acACAllow][52] && ++ACInfo[playerid][acNOPCount][10] > AC_MAX_NOP_WARNINGS)
  3531. {
  3532. #if defined DEBUG
  3533. printf(DEBUG_CODE_5, playerid, "SetPlayerPos");
  3534. printf("[Nex-AC debug] Distance: %f, acSet[8]: %d", GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX],
  3535. ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_Z : ACInfo[playerid][acSetPosZ])), ACInfo[playerid][acSet][8]);
  3536. #endif
  3537. #if defined OnCheatDetected
  3538. ac_KickWithCode(playerid, "", 0, 52, 10);
  3539. ACInfo[playerid][acSet][8] = -1;
  3540. #else
  3541. return ac_KickWithCode(playerid, "", 0, 52, 10);
  3542. #endif
  3543. }
  3544. ACInfo[playerid][acTpToZ] = false;
  3545. }
  3546. }
  3547. static Float:ac_vX, Float:ac_vY, Float:ac_vZ, Float:ac_vctsize, ac_specact;
  3548. ac_vctsize = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX],
  3549. ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  3550. ac_specact = GetPlayerSpecialAction(playerid);
  3551. if(ac_vehid > 0)
  3552. {
  3553. if(ACInfo[playerid][acVeh] == 0)
  3554. {
  3555. if(ACInfo[playerid][acACAllow][4] &&
  3556. (ACInfo[playerid][acEnterVeh] != ac_vehid || ac_gtc < ACInfo[playerid][acEnterVehTime] + 600))
  3557. {
  3558. #if defined DEBUG
  3559. printf("[Nex-AC debug] Entered vehicle: %d, vehicleid: %d, Enter time: %d",
  3560. ACInfo[playerid][acEnterVeh], ac_vehid, ac_gtc - ACInfo[playerid][acEnterVehTime]);
  3561. #endif
  3562. #if defined OnCheatDetected
  3563. ac_KickWithCode(playerid, "", 0, 4, 1);
  3564. #else
  3565. return ac_KickWithCode(playerid, "", 0, 4, 1);
  3566. #endif
  3567. }
  3568. }
  3569. else if(ACInfo[playerid][acVeh] != ac_vehid)
  3570. {
  3571. if(ACInfo[playerid][acACAllow][4])
  3572. {
  3573. #if defined DEBUG
  3574. printf("[Nex-AC debug] AC vehicle: %d, vehicleid: %d", ACInfo[playerid][acVeh], ac_vehid);
  3575. #endif
  3576. #if defined OnCheatDetected
  3577. ac_KickWithCode(playerid, "", 0, 4, 2);
  3578. #else
  3579. return ac_KickWithCode(playerid, "", 0, 4, 2);
  3580. #endif
  3581. }
  3582. }
  3583. else if(ACInfo[playerid][acACAllow][50] && ACInfo[playerid][acSeat] != ac_s)
  3584. {
  3585. #if defined DEBUG
  3586. printf("[Nex-AC debug] AC seat: %d, seatid: %d, vehicleid: %d", ACInfo[playerid][acSeat], ac_s, ac_vehid);
  3587. #endif
  3588. #if defined OnCheatDetected
  3589. ac_KickWithCode(playerid, "", 0, 50);
  3590. #else
  3591. return ac_KickWithCode(playerid, "", 0, 50);
  3592. #endif
  3593. }
  3594. if(ac_stateanim == 2)
  3595. {
  3596. if(ACInfo[playerid][acACAllow][32] &&
  3597. ACVehInfo[ac_vehid][acDriver] != 65535 && ACVehInfo[ac_vehid][acDriver] != playerid)
  3598. {
  3599. #if defined DEBUG
  3600. printf("[Nex-AC debug] AC driver: %d, driver: %d, vehicleid: %d",
  3601. ACVehInfo[ac_vehid][acDriver], playerid, ac_vehid);
  3602. #endif
  3603. #if defined OnCheatDetected
  3604. ac_KickWithCode(playerid, "", 0, 32);
  3605. #else
  3606. return ClearAnimations(playerid, 1);
  3607. #endif
  3608. }
  3609. if(ACInfo[playerid][acACAllow][35] && GetPlayerCameraMode(playerid) == 55)
  3610. {
  3611. #if defined OnCheatDetected
  3612. ac_KickWithCode(playerid, "", 0, 35);
  3613. #else
  3614. return ac_KickWithCode(playerid, "", 0, 35);
  3615. #endif
  3616. }
  3617. static Float:ac_vhealth;
  3618. GetVehicleHealth(ac_vehid, ac_vhealth);
  3619. if(ACInfo[playerid][acSetVehHealth] != -1)
  3620. {
  3621. if(ACInfo[playerid][acSetVehHealth] == ac_vhealth ||
  3622. ACInfo[playerid][acSetVehHealth] >= ac_vhealth && ac_gtc > ACInfo[playerid][acGtc][4] + ac_gpp)
  3623. {
  3624. ACInfo[playerid][acSetVehHealth] = -1;
  3625. ACInfo[playerid][acVehDmgRes] = false;
  3626. }
  3627. else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtc][4] + ac_gpp &&
  3628. ++ACInfo[playerid][acNOPCount][4] > AC_MAX_NOP_WARNINGS)
  3629. {
  3630. #if defined DEBUG
  3631. printf(DEBUG_CODE_5, playerid, "SetVehicleHealth");
  3632. printf("[Nex-AC debug] AC veh health: %f, veh health: %f, vehicleid: %d",
  3633. ACInfo[playerid][acSetVehHealth], ac_vhealth, ac_vehid);
  3634. #endif
  3635. #if defined OnCheatDetected
  3636. ac_KickWithCode(playerid, "", 0, 52, 11);
  3637. ACInfo[playerid][acSetVehHealth] = -1;
  3638. #else
  3639. return ac_KickWithCode(playerid, "", 0, 52, 11);
  3640. #endif
  3641. }
  3642. }
  3643. else if(ACInfo[playerid][acACAllow][11] &&
  3644. ac_vhealth > ACVehInfo[ac_vehid][acHealth] && ACInfo[playerid][acModShop] == false)
  3645. {
  3646. #if AC_USE_PAYNSPRAY
  3647. if(ac_InPayNSpray(playerid, ac_i) == 0)
  3648. {
  3649. #endif
  3650. #if defined DEBUG
  3651. printf("[Nex-AC debug] AC veh health: %f, veh health: %f, vehicleid: %d",
  3652. ACVehInfo[ac_vehid][acHealth], ac_vhealth, ac_vehid);
  3653. #endif
  3654. #if defined OnCheatDetected
  3655. ac_KickWithCode(playerid, "", 0, 11);
  3656. #endif
  3657. SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]);
  3658. #if AC_USE_PAYNSPRAY
  3659. }
  3660. #endif
  3661. }
  3662. if(ACInfo[playerid][acACAllow][20] && ACInfo[playerid][acVehDmgRes])
  3663. {
  3664. if(ac_vhealth < ACVehInfo[ac_vehid][acHealth])
  3665. {
  3666. ACInfo[playerid][acVehDmgRes] = false;
  3667. ACInfo[playerid][acCheatCount][11] =
  3668. ACInfo[playerid][acDmgRes] = 0;
  3669. }
  3670. else if(ac_gtc > ACInfo[playerid][acGtc][16] + ac_gpp)
  3671. {
  3672. ACInfo[playerid][acDmgRes] = 0;
  3673. ACInfo[playerid][acVehDmgRes] = false;
  3674. if(++ACInfo[playerid][acCheatCount][11] > AC_MAX_GODMODE_VEH_WARNINGS)
  3675. {
  3676. #if defined DEBUG
  3677. printf("[Nex-AC debug] AC veh health: %f, veh health: %f, vehicleid: %d",
  3678. ACVehInfo[ac_vehid][acHealth], ac_vhealth, ac_vehid);
  3679. #endif
  3680. #if defined OnCheatDetected
  3681. ac_KickWithCode(playerid, "", 0, 20);
  3682. ACInfo[playerid][acCheatCount][11] = 0;
  3683. #else
  3684. return ac_KickWithCode(playerid, "", 0, 20);
  3685. #endif
  3686. }
  3687. }
  3688. }
  3689. static Float:ac_zangle;
  3690. GetVehicleZAngle(ac_vehid, ac_zangle);
  3691. ac_zangle = floatround(ac_zangle, floatround_floor) % 360 + floatfract(ac_zangle);
  3692. GetVehicleVelocity(ac_vehid, ac_vX, ac_vY, ac_vZ);
  3693. if(ac_gtc > ACInfo[playerid][acGtc][9] + ac_gpp)
  3694. {
  3695. static Float:ac_vsp, Float:ac_spdiff;
  3696. ac_i = GetVehicleModel(ac_vehid) - 417;
  3697. ac_vsp = ac_GetSpeed(ac_vX, ac_vY, ac_vZ);
  3698. ac_spdiff = ac_vsp - ac_GetSpeed(ACVehInfo[ac_vehid][acVelX], ACVehInfo[ac_vehid][acVelY], ACVehInfo[ac_vehid][acVelZ]);
  3699. if(ACInfo[playerid][acACAllow][10] && ac_spdiff >= 20.0 && !((ac_i == 32 || 120 <= ac_i <= 121) && ac_spdiff < 65.0) &&
  3700. ACVehInfo[ac_vehid][acSpeedDiff] <= ac_spdiff &&
  3701. (64 <= ac_i <= 93 && ac_vType[ac_i] != 4 || floatabs(ac_vX) > 0.3 || floatabs(ac_vY) > 0.3 || floatabs(ac_vZ) > 0.3) &&
  3702. ACVehInfo[ac_vehid][acHealth] == ac_vhealth && ACVehInfo[ac_vehid][acHealth] > 220.0)
  3703. {
  3704. #if defined DEBUG
  3705. printf("[Nex-AC debug] Speed: %.1f, old speed: %.1f, veh model: %d",
  3706. ac_vsp, ac_vsp - ac_spdiff, ac_i + 417);
  3707. #endif
  3708. #if defined OnCheatDetected
  3709. ac_KickWithCode(playerid, "", 0, 10, 1);
  3710. #else
  3711. return ac_KickWithCode(playerid, "", 0, 10, 1);
  3712. #endif
  3713. }
  3714. if(ACInfo[playerid][acACAllow][25] && ac_vsp > 15.0 && floatabs(ac_spdiff) < 25.0 &&
  3715. floatround(floatabs(ac_zangle - ACVehInfo[ac_vehid][acZAngle])) == 180 && (ac_vX < 0.0) !=
  3716. (ACVehInfo[ac_vehid][acVelX] < 0.0) && (ac_vY < 0.0) != (ACVehInfo[ac_vehid][acVelY] < 0.0) &&
  3717. (ac_vZ < 0.0) != (ACVehInfo[ac_vehid][acVelZ] < 0.0))
  3718. {
  3719. #if defined DEBUG
  3720. printf("[Nex-AC debug] Speed: %.1f, speed diff: %.1f, z angle: %f, old z angle: %f, vehicleid: %d",
  3721. ac_vsp, ac_spdiff, ac_zangle, ACVehInfo[ac_vehid][acZAngle], ac_vehid);
  3722. #endif
  3723. #if defined OnCheatDetected
  3724. ac_KickWithCode(playerid, "", 0, 25);
  3725. #else
  3726. return ac_KickWithCode(playerid, "", 0, 25);
  3727. #endif
  3728. }
  3729. static Float:ac_zdiff;
  3730. ac_zdiff = ac_Z - ACInfo[playerid][acPosZ];
  3731. if(0 <= ac_i <= 176 && 1 <= ac_vType[ac_i] <= 2)
  3732. {
  3733. if(ACInfo[playerid][acACAllow][10] && ac_GetSpeed(ac_vX, ac_vY, ac_vZ, false) > 270)
  3734. {
  3735. #if defined DEBUG
  3736. printf("[Nex-AC debug] Speed (x, y): %d, veh model: %d",
  3737. ac_GetSpeed(ac_vX, ac_vY, ac_vZ, false), ac_i + 417);
  3738. #endif
  3739. #if defined OnCheatDetected
  3740. ac_KickWithCode(playerid, "", 0, 10, 2);
  3741. #else
  3742. return ac_KickWithCode(playerid, "", 0, 10, 2);
  3743. #endif
  3744. }
  3745. }
  3746. else if(ACInfo[playerid][acACAllow][8])
  3747. {
  3748. if(ac_vZ >= 0.1 && ac_vZ > ACVehInfo[ac_vehid][acVelZ] &&
  3749. floatabs(ACInfo[playerid][acPosX] - ac_X) < ac_zdiff &&
  3750. floatabs(ACInfo[playerid][acPosY] - ac_Y) < ac_zdiff)
  3751. {
  3752. if(++ACInfo[playerid][acCheatCount][3] > (64 <= ac_i <= 93 &&
  3753. ac_vType[ac_i] == 4 ? AC_MAX_FLYHACK_B_WARNINGS : AC_MAX_FLYHACK_VEH_WARNINGS))
  3754. {
  3755. #if defined DEBUG
  3756. printf("[Nex-AC debug] Vel z: %f, old vel z: %f, pos diff x: %f, pos diff y: %f, pos diff z: %f, vehicleid: %d",
  3757. ac_vZ, ACVehInfo[ac_vehid][acVelZ], ACInfo[playerid][acPosX] - ac_X, ACInfo[playerid][acPosY] - ac_Y, ac_zdiff, ac_vehid);
  3758. #endif
  3759. #if defined OnCheatDetected
  3760. ac_KickWithCode(playerid, "", 0, 8, 1);
  3761. ACInfo[playerid][acCheatCount][3] = 0;
  3762. #else
  3763. return ac_KickWithCode(playerid, "", 0, 8, 1);
  3764. #endif
  3765. }
  3766. }
  3767. else ACInfo[playerid][acCheatCount][3] = 0;
  3768. }
  3769. if(ac_vctsize > 0.8 && ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
  3770. {
  3771. if(ac_vctsize > 15.0 && ac_vctsize > ACVehInfo[ac_vehid][acPosDiff] + ((ac_vctsize / 3) * 1.5))
  3772. {
  3773. if(ACInfo[playerid][acACAllow][3] && ACInfo[playerid][acPosZ] > -97.0)
  3774. {
  3775. #if defined DEBUG
  3776. printf("[Nex-AC debug] Distance: %f, old pos diff: %f, vehicleid: %d",
  3777. ac_vctsize, ACVehInfo[ac_vehid][acPosDiff], ac_vehid);
  3778. #endif
  3779. #if defined OnCheatDetected
  3780. ac_KickWithCode(playerid, "", 0, 3, 2);
  3781. #else
  3782. return ac_KickWithCode(playerid, "", 0, 3, 2);
  3783. #endif
  3784. }
  3785. }
  3786. else if(ACInfo[playerid][acACAllow][1] && ac_vsp < 16.0 &&
  3787. ++ACInfo[playerid][acCheatCount][2] > AC_MAX_AIR_VEH_WARNINGS)
  3788. {
  3789. #undef AC_MAX_AIR_VEH_WARNINGS
  3790. #if defined DEBUG
  3791. printf("[Nex-AC debug] Speed: %.1f, distance: %f, vehicleid: %d", ac_vsp, ac_vctsize, ac_vehid);
  3792. #endif
  3793. #if defined OnCheatDetected
  3794. ac_KickWithCode(playerid, "", 0, 1);
  3795. ACInfo[playerid][acCheatCount][2] = 0;
  3796. #else
  3797. return ac_KickWithCode(playerid, "", 0, 1);
  3798. #endif
  3799. }
  3800. }
  3801. ACVehInfo[ac_vehid][acSpeedDiff] = ac_spdiff;
  3802. }
  3803. ACVehInfo[ac_vehid][acVelX] = ac_vX;
  3804. ACVehInfo[ac_vehid][acVelY] = ac_vY;
  3805. ACVehInfo[ac_vehid][acVelZ] = ac_vZ;
  3806. ACVehInfo[ac_vehid][acPosDiff] = ac_vctsize;
  3807. ACVehInfo[ac_vehid][acHealth] = ac_vhealth;
  3808. ACVehInfo[ac_vehid][acZAngle] = ac_zangle;
  3809. }
  3810. ACInfo[playerid][acSeat] = ac_s;
  3811. }
  3812. else
  3813. {
  3814. ac_stateanim = GetPlayerAnimationIndex(playerid);
  3815. GetPlayerVelocity(playerid, ac_vX, ac_vY, ac_vZ);
  3816. ac_vX = ac_GetSpeed(ac_vX, ac_vY, ac_vZ);
  3817. if(ACInfo[playerid][acAnim] != ac_stateanim)
  3818. {
  3819. switch(ac_stateanim)
  3820. {
  3821. case -1:
  3822. {
  3823. if(ACInfo[playerid][acACAllow][24])
  3824. {
  3825. #if defined OnCheatDetected
  3826. ac_KickWithCode(playerid, "", 0, 24);
  3827. #else
  3828. return ac_KickWithCode(playerid, "", 0, 24);
  3829. #endif
  3830. }
  3831. }
  3832. case 958..979:
  3833. {
  3834. if(ACInfo[playerid][acACAllow][7])
  3835. {
  3836. if(ac_w != 46)
  3837. {
  3838. if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_FLYHACK_WARNINGS)
  3839. {
  3840. #if defined DEBUG
  3841. printf("[Nex-AC debug] Anim: %d, old anim: %d, weaponid: %d",
  3842. ac_stateanim, ACInfo[playerid][acAnim], ac_w);
  3843. #endif
  3844. #if defined OnCheatDetected
  3845. ac_KickWithCode(playerid, "", 0, 7, 1);
  3846. ACInfo[playerid][acCheatCount][15] = 0;
  3847. #else
  3848. return ac_KickWithCode(playerid, "", 0, 7, 1);
  3849. #endif
  3850. }
  3851. }
  3852. else ACInfo[playerid][acCheatCount][15] = 0;
  3853. }
  3854. }
  3855. case 1058:
  3856. {
  3857. if(ACInfo[playerid][acACAllow][7])
  3858. {
  3859. #if defined OnCheatDetected
  3860. ac_KickWithCode(playerid, "", 0, 7, 2);
  3861. #else
  3862. return ac_KickWithCode(playerid, "", 0, 7, 2);
  3863. #endif
  3864. }
  3865. }
  3866. case 1231:
  3867. {
  3868. if(ACInfo[playerid][acACAllow][30])
  3869. {
  3870. ac_i = GetPlayerSkin(playerid);
  3871. if(ac_PedAnims == false && ac_i > 0 && ac_i != 74 && ac_w != 46)
  3872. {
  3873. #if defined DEBUG
  3874. printf("[Nex-AC debug] Skin: %d, old anim: %d, weaponid: %d",
  3875. ac_i, ACInfo[playerid][acAnim], ac_w);
  3876. #endif
  3877. #if defined OnCheatDetected
  3878. ac_KickWithCode(playerid, "", 0, 30);
  3879. #else
  3880. return ac_KickWithCode(playerid, "", 0, 30);
  3881. #endif
  3882. }
  3883. }
  3884. }
  3885. }
  3886. }
  3887. else if(ACInfo[playerid][acACAllow][7])
  3888. {
  3889. if(ac_vX > 31.0 && 1538 <= ac_stateanim <= 1544)
  3890. {
  3891. if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_FLYHACK_WARNINGS)
  3892. {
  3893. #if defined DEBUG
  3894. printf("[Nex-AC debug] Speed: %.1f, anim: %d", ac_vX, ac_stateanim);
  3895. #endif
  3896. #if defined OnCheatDetected
  3897. ac_KickWithCode(playerid, "", 0, 7, 3);
  3898. ACInfo[playerid][acCheatCount][15] = 0;
  3899. #else
  3900. return ac_KickWithCode(playerid, "", 0, 7, 3);
  3901. #endif
  3902. }
  3903. #undef AC_MAX_FLYHACK_WARNINGS
  3904. }
  3905. else ACInfo[playerid][acCheatCount][15] = 0;
  3906. }
  3907. if(ACInfo[playerid][acSet][4] != -1)
  3908. {
  3909. if(ac_specact == ACInfo[playerid][acSet][4]) ACInfo[playerid][acSet][4] = -1;
  3910. else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtc][6] + ac_gpp &&
  3911. ++ACInfo[playerid][acNOPCount][6] > AC_MAX_NOP_WARNINGS)
  3912. {
  3913. #if defined DEBUG
  3914. printf(DEBUG_CODE_5, playerid, "SetPlayerSpecialAction");
  3915. printf("[Nex-AC debug] AC spec act: %d, spec act: %d", ACInfo[playerid][acSet][4], ac_specact);
  3916. #endif
  3917. #if defined OnCheatDetected
  3918. ac_KickWithCode(playerid, "", 0, 52, 12);
  3919. ACInfo[playerid][acSet][4] = -1;
  3920. #else
  3921. return ac_KickWithCode(playerid, "", 0, 52, 12);
  3922. #endif
  3923. }
  3924. }
  3925. else if(ac_specact != ACInfo[playerid][acSpecAct])
  3926. {
  3927. if(ac_specact == ACInfo[playerid][acNextSpecAct]) ACInfo[playerid][acNextSpecAct] = -1;
  3928. else if(ACInfo[playerid][acACAllow][18])
  3929. {
  3930. switch(ac_specact)
  3931. {
  3932. case 0:
  3933. {
  3934. switch(ACInfo[playerid][acSpecAct])
  3935. {
  3936. case 11, 24, 25:
  3937. {
  3938. #if defined OnCheatDetected
  3939. ac_KickWithCode(playerid, "", 0, 18, 1);
  3940. #else
  3941. return ac_KickWithCode(playerid, "", 0, 18, 1);
  3942. #endif
  3943. }
  3944. }
  3945. }
  3946. case 1:
  3947. {
  3948. if(ACInfo[playerid][acSpecAct] > 0 && !(20 <= ACInfo[playerid][acSpecAct] <= 24))
  3949. {
  3950. #if defined OnCheatDetected
  3951. ac_KickWithCode(playerid, "", 0, 18, 2);
  3952. #else
  3953. return ac_KickWithCode(playerid, "", 0, 18, 2);
  3954. #endif
  3955. }
  3956. }
  3957. case 2:
  3958. {
  3959. if(IsPlayerInRangeOfPoint(playerid, 8.0, ACInfo[playerid][acDropJpX],
  3960. ACInfo[playerid][acDropJpY], ACInfo[playerid][acDropJpZ]) == 0)
  3961. {
  3962. #if defined DEBUG
  3963. printf("[Nex-AC debug] AC spec act: %d, spec act: %d, distance: %f",
  3964. ACInfo[playerid][acSpecAct], ac_specact, GetPlayerDistanceFromPoint(playerid,
  3965. ACInfo[playerid][acDropJpX], ACInfo[playerid][acDropJpY], ACInfo[playerid][acDropJpZ]));
  3966. #endif
  3967. #if defined OnCheatDetected
  3968. ac_KickWithCode(playerid, "", 0, 18, 3);
  3969. #else
  3970. return ac_KickWithCode(playerid, "", 0, 18, 3);
  3971. #endif
  3972. }
  3973. ACInfo[playerid][acDropJpX] = ACInfo[playerid][acDropJpY] =
  3974. ACInfo[playerid][acDropJpZ] = 20000.0;
  3975. }
  3976. case 3:
  3977. {
  3978. switch(ACInfo[playerid][acSpecAct])
  3979. {
  3980. case 2, 5..8, 11, 68:
  3981. {
  3982. #if defined OnCheatDetected
  3983. ac_KickWithCode(playerid, "", 0, 18, 4);
  3984. #else
  3985. return ac_KickWithCode(playerid, "", 0, 18, 4);
  3986. #endif
  3987. }
  3988. }
  3989. }
  3990. default:
  3991. {
  3992. if(!((20 <= ac_specact <= 24 && ACInfo[playerid][acSpecAct] == 1 ||
  3993. ACInfo[playerid][acSpecAct] == 3) && ac_specact == ACInfo[playerid][acLastSpecAct]) &&
  3994. (ACInfo[playerid][acVeh] == 0 || ac_specact != 4 && ac_specact != 11 && ac_specact != 24 && ac_specact != 25))
  3995. {
  3996. #if defined DEBUG
  3997. printf("[Nex-AC debug] AC spec act: %d, spec act: %d, Last spec act: %d, last vehicleid: %d",
  3998. ACInfo[playerid][acSpecAct], ac_specact, ACInfo[playerid][acLastSpecAct], ACInfo[playerid][acVeh]);
  3999. #endif
  4000. #if defined OnCheatDetected
  4001. ac_KickWithCode(playerid, "", 0, 18, 5);
  4002. #else
  4003. return ac_KickWithCode(playerid, "", 0, 18, 5);
  4004. #endif
  4005. }
  4006. }
  4007. }
  4008. }
  4009. ACInfo[playerid][acLastSpecAct] = ACInfo[playerid][acSpecAct];
  4010. }
  4011. if(ac_gtc > ACInfo[playerid][acGtc][10] + ac_gpp &&
  4012. GetPlayerSurfingVehicleID(playerid) == 65535 && GetPlayerSurfingObjectID(playerid) == 65535)
  4013. {
  4014. if(ACInfo[playerid][acACAllow][9] && ac_vX > 212.0 && ACInfo[playerid][acSpeed] < ac_vX)
  4015. {
  4016. #if defined DEBUG
  4017. printf("[Nex-AC debug] Speed: %.1f, old speed: %.1f", ac_vX, ACInfo[playerid][acSpeed]);
  4018. #endif
  4019. #if defined OnCheatDetected
  4020. ac_KickWithCode(playerid, "", 0, 9);
  4021. #else
  4022. return ac_KickWithCode(playerid, "", 0, 9);
  4023. #endif
  4024. }
  4025. if(ac_vctsize > 0.7 && ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
  4026. {
  4027. if(ac_vctsize > 30.0)
  4028. {
  4029. if(ACInfo[playerid][acACAllow][2] && ACInfo[playerid][acPosZ] > -97.0)
  4030. {
  4031. #if defined DEBUG
  4032. printf("[Nex-AC debug] Distance: %f, pos z: %f", ac_vctsize, ACInfo[playerid][acPosZ]);
  4033. #endif
  4034. #if defined OnCheatDetected
  4035. ac_KickWithCode(playerid, "", 0, 2, 2);
  4036. #else
  4037. return ac_KickWithCode(playerid, "", 0, 2, 2);
  4038. #endif
  4039. }
  4040. }
  4041. else if(ac_vX <= ac_vctsize * (ac_vctsize < 1.0 ? 30.0 : 5.0))
  4042. {
  4043. if(ac_vX < 3.0 && ac_vctsize > 5.0)
  4044. {
  4045. if(ACInfo[playerid][acACAllow][2])
  4046. {
  4047. #if defined DEBUG
  4048. printf("[Nex-AC debug] Speed: %.1f, distance: %f", ac_vX, ac_vctsize);
  4049. #endif
  4050. #if defined OnCheatDetected
  4051. ac_KickWithCode(playerid, "", 0, 2, 3);
  4052. #else
  4053. return ac_KickWithCode(playerid, "", 0, 2, 3);
  4054. #endif
  4055. }
  4056. }
  4057. else if(ACInfo[playerid][acACAllow][0] && ac_vX &&
  4058. ++ACInfo[playerid][acCheatCount][1] > AC_MAX_AIR_WARNINGS)
  4059. {
  4060. #if defined DEBUG
  4061. printf("[Nex-AC debug] Speed: %.1f, distance: %f", ac_vX, ac_vctsize);
  4062. #endif
  4063. #if defined OnCheatDetected
  4064. ac_KickWithCode(playerid, "", 0, 0);
  4065. ACInfo[playerid][acCheatCount][1] = 0;
  4066. #else
  4067. return ac_KickWithCode(playerid, "", 0, 0);
  4068. #endif
  4069. }
  4070. #undef AC_MAX_AIR_WARNINGS
  4071. }
  4072. }
  4073. ACInfo[playerid][acSpeed] = ac_vX;
  4074. }
  4075. ACInfo[playerid][acAnim] = ac_stateanim;
  4076. }
  4077. ACInfo[playerid][acSpecAct] = ac_specact;
  4078. ACInfo[playerid][acHealth] = ac_hp;
  4079. ACInfo[playerid][acArmour] = ac_ar;
  4080. }
  4081. ACInfo[playerid][acPosX] = ac_X;
  4082. ACInfo[playerid][acPosY] = ac_Y;
  4083. ACInfo[playerid][acPosZ] = ac_Z;
  4084. ACInfo[playerid][acLastWeapon] = ac_w;
  4085. ACInfo[playerid][acVeh] = ac_vehid;
  4086. ACInfo[playerid][acMoney] = ac_m;
  4087. }
  4088. }
  4089. ac_gpp = 1;
  4090. ACInfo[playerid][acLastUpdate] = ac_gtc;
  4091. if(ac_ur) ACInfo[playerid][acGtc][15] = ac_gtc + 1030;
  4092. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4093. && defined ac_OnPlayerUpdate
  4094. ac_gpp = ac_OnPlayerUpdate(playerid);
  4095. #endif
  4096. if(ACInfo[playerid][acACAllow][33] && ac_gpp) return ACInfo[playerid][acFreeze];
  4097. return ac_gpp;
  4098. }
  4099. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4100. #if defined _ALS_OnPlayerUpdate
  4101. #undef OnPlayerUpdate
  4102. #else
  4103. #define _ALS_OnPlayerUpdate
  4104. #endif
  4105. #define OnPlayerUpdate ac_OnPlayerUpdate
  4106. #if defined ac_OnPlayerUpdate
  4107. forward ac_OnPlayerUpdate(playerid);
  4108. #endif
  4109. #endif
  4110. #if defined _inc_y_hooks || defined _INC_y_hooks
  4111. hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  4112. #else
  4113. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  4114. #endif
  4115. {
  4116. if(ACInfo[playerid][acKicked]) return 0;
  4117. if((newkeys & 16) && ACInfo[playerid][acSpecAct] == 2 && GetPlayerSpecialAction(playerid) != 2)
  4118. {
  4119. ACInfo[playerid][acDropJpX] = ACInfo[playerid][acPosX];
  4120. ACInfo[playerid][acDropJpY] = ACInfo[playerid][acPosY];
  4121. ACInfo[playerid][acDropJpZ] = ACInfo[playerid][acPosZ];
  4122. }
  4123. if((newkeys & 2) && 24 <= GetPlayerWeapon(playerid) <= 25) ACInfo[playerid][acCheatCount][14] = 0;
  4124. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4125. && defined ac_OnPlayerKeyStateChange
  4126. return ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  4127. #else
  4128. return 1;
  4129. #endif
  4130. }
  4131. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4132. #if defined _ALS_OnPlayerKeyStateChange
  4133. #undef OnPlayerKeyStateChange
  4134. #else
  4135. #define _ALS_OnPlayerKeyStateChange
  4136. #endif
  4137. #define OnPlayerKeyStateChange ac_OnPlayerKeyStateChange
  4138. #if defined ac_OnPlayerKeyStateChange
  4139. forward ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  4140. #endif
  4141. #endif
  4142. #if defined _inc_y_hooks || defined _INC_y_hooks
  4143. hook OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  4144. #else
  4145. public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  4146. #endif
  4147. {
  4148. if(ACInfo[playerid][acKicked]) return 0;
  4149. new ac_i = GetTickCount();
  4150. if(ACInfo[playerid][acACAllow][49])
  4151. {
  4152. if(ac_i < ACInfo[playerid][acCall][2] + ac_Mtfc[2][0]) return ac_FloodDetect(playerid, 2);
  4153. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4154. else ACInfo[playerid][acFloodCount][2] = ACInfo[playerid][acFloodCount][27] = 0;
  4155. }
  4156. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][2] = ac_i;
  4157. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4158. && defined ac_OnPlayerClickMap
  4159. return ac_OnPlayerClickMap(playerid, fX, fY, fZ);
  4160. #else
  4161. return 1;
  4162. #endif
  4163. }
  4164. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4165. #if defined _ALS_OnPlayerClickMap
  4166. #undef OnPlayerClickMap
  4167. #else
  4168. #define _ALS_OnPlayerClickMap
  4169. #endif
  4170. #define OnPlayerClickMap ac_OnPlayerClickMap
  4171. #if defined ac_OnPlayerClickMap
  4172. forward ac_OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ);
  4173. #endif
  4174. #endif
  4175. #if defined _inc_y_hooks || defined _INC_y_hooks
  4176. hook OnPlayerClickPlayer(playerid, clickedplayerid, source)
  4177. #else
  4178. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  4179. #endif
  4180. {
  4181. if(ACInfo[playerid][acKicked]) return 0;
  4182. new ac_i = GetTickCount();
  4183. if(ACInfo[playerid][acACAllow][49])
  4184. {
  4185. if(ac_i < ACInfo[playerid][acCall][3] + ac_Mtfc[3][0]) return ac_FloodDetect(playerid, 3);
  4186. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4187. else ACInfo[playerid][acFloodCount][3] = ACInfo[playerid][acFloodCount][27] = 0;
  4188. }
  4189. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][3] = ac_i;
  4190. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4191. && defined ac_OnPlayerClickPlayer
  4192. return ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
  4193. #else
  4194. return 1;
  4195. #endif
  4196. }
  4197. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4198. #if defined _ALS_OnPlayerClickPlayer
  4199. #undef OnPlayerClickPlayer
  4200. #else
  4201. #define _ALS_OnPlayerClickPlayer
  4202. #endif
  4203. #define OnPlayerClickPlayer ac_OnPlayerClickPlayer
  4204. #if defined ac_OnPlayerClickPlayer
  4205. forward ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
  4206. #endif
  4207. #endif
  4208. #if defined _inc_y_hooks || defined _INC_y_hooks
  4209. hook OnPlayerClickTextDraw(playerid, Text:clickedid)
  4210. #else
  4211. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  4212. #endif
  4213. {
  4214. if(ACInfo[playerid][acKicked]) return 1;
  4215. new ac_i = GetTickCount();
  4216. if(ACInfo[playerid][acACAllow][49])
  4217. {
  4218. if(ac_i < ACInfo[playerid][acCall][4] + ac_Mtfc[4][0])
  4219. {
  4220. ac_FloodDetect(playerid, 4);
  4221. return 1;
  4222. }
  4223. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4224. else ACInfo[playerid][acFloodCount][4] = ACInfo[playerid][acFloodCount][27] = 0;
  4225. }
  4226. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][4] = ac_i;
  4227. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4228. && defined ac_OnPlayerClickTextDraw
  4229. return ac_OnPlayerClickTextDraw(playerid, clickedid);
  4230. #else
  4231. return 0;
  4232. #endif
  4233. }
  4234. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4235. #if defined _ALS_OnPlayerClickTextDraw
  4236. #undef OnPlayerClickTextDraw
  4237. #else
  4238. #define _ALS_OnPlayerClickTextDraw
  4239. #endif
  4240. #define OnPlayerClickTextDraw ac_OnPlayerClickTextDraw
  4241. #if defined ac_OnPlayerClickTextDraw
  4242. forward ac_OnPlayerClickTextDraw(playerid, Text:clickedid);
  4243. #endif
  4244. #endif
  4245. #if defined _inc_y_hooks || defined _INC_y_hooks
  4246. hook OnPlayerCommandText(playerid, cmdtext[])
  4247. #else
  4248. public OnPlayerCommandText(playerid, cmdtext[])
  4249. #endif
  4250. {
  4251. if(ACInfo[playerid][acKicked]) return 1;
  4252. new ac_i = GetTickCount();
  4253. if(ACInfo[playerid][acACAllow][49])
  4254. {
  4255. if(ac_i < ACInfo[playerid][acCall][5] + ac_Mtfc[5][0])
  4256. {
  4257. ac_FloodDetect(playerid, 5);
  4258. return 1;
  4259. }
  4260. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4261. else ACInfo[playerid][acFloodCount][5] = ACInfo[playerid][acFloodCount][27] = 0;
  4262. }
  4263. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][5] = ac_i;
  4264. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4265. && defined ac_OnPlayerCommandText
  4266. return ac_OnPlayerCommandText(playerid, cmdtext);
  4267. #else
  4268. return 0;
  4269. #endif
  4270. }
  4271. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4272. #if defined _ALS_OnPlayerCommandText
  4273. #undef OnPlayerCommandText
  4274. #else
  4275. #define _ALS_OnPlayerCommandText
  4276. #endif
  4277. #define OnPlayerCommandText ac_OnPlayerCommandText
  4278. #if defined ac_OnPlayerCommandText
  4279. forward ac_OnPlayerCommandText(playerid, cmdtext[]);
  4280. #endif
  4281. #endif
  4282. #if defined _inc_y_hooks || defined _INC_y_hooks
  4283. hook OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  4284. #else
  4285. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  4286. #endif
  4287. {
  4288. if(IsPlayerConnected(playerid) == 0 || ACInfo[playerid][acKicked]) return 0;
  4289. new bool:ac_ur;
  4290. if(IsPlayerNPC(playerid) == 0)
  4291. {
  4292. new ac_i = GetTickCount();
  4293. if(ACInfo[playerid][acACAllow][49])
  4294. {
  4295. if(ac_i < ACInfo[playerid][acCall][6] + ac_Mtfc[6][0]) return ac_FloodDetect(playerid, 6);
  4296. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4297. else ACInfo[playerid][acFloodCount][6] = ACInfo[playerid][acFloodCount][27] = 0;
  4298. }
  4299. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][6] = ac_i;
  4300. ac_i = GetVehicleModel(vehicleid) - 417;
  4301. if(ACInfo[playerid][acACAllow][44] && ac_i == -417) return ac_KickWithCode(playerid, "", 0, 44, 1);
  4302. if(ACInfo[playerid][acEnterVeh] == vehicleid) ac_ur = true;
  4303. else
  4304. {
  4305. new ac_tmpPrm1, ac_tmpPrm2;
  4306. GetVehicleParamsEx(vehicleid, ac_tmpPrm2, ac_tmpPrm2,
  4307. ac_tmpPrm2, ac_tmpPrm1, ac_tmpPrm2, ac_tmpPrm2, ac_tmpPrm2);
  4308. if(ispassenger || ac_tmpPrm1 != 1)
  4309. {
  4310. ACInfo[playerid][acEnterVeh] = vehicleid;
  4311. if(13 <= ac_i <= 178 && ac_vType[ac_i] == 3) ACInfo[playerid][acEnterVehTime] = 0, ac_ur = true;
  4312. }
  4313. }
  4314. }
  4315. if(ac_ur == false) ACInfo[playerid][acEnterVehTime] = ACInfo[playerid][acCall][27];
  4316. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4317. && defined ac_OnPlayerEnterVehicle
  4318. return ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  4319. #else
  4320. return 1;
  4321. #endif
  4322. }
  4323. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4324. #if defined _ALS_OnPlayerEnterVehicle
  4325. #undef OnPlayerEnterVehicle
  4326. #else
  4327. #define _ALS_OnPlayerEnterVehicle
  4328. #endif
  4329. #define OnPlayerEnterVehicle ac_OnPlayerEnterVehicle
  4330. #if defined ac_OnPlayerEnterVehicle
  4331. forward ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  4332. #endif
  4333. #endif
  4334. #if defined _inc_y_hooks || defined _INC_y_hooks
  4335. hook OnPlayerExitVehicle(playerid, vehicleid)
  4336. #else
  4337. public OnPlayerExitVehicle(playerid, vehicleid)
  4338. #endif
  4339. {
  4340. if(IsPlayerConnected(playerid) == 0 || ACInfo[playerid][acKicked]) return 0;
  4341. new ac_i = GetTickCount();
  4342. if(IsPlayerNPC(playerid) == 0 && ACInfo[playerid][acACAllow][49])
  4343. {
  4344. if(ac_i < ACInfo[playerid][acCall][7] + ac_Mtfc[7][0]) return ac_FloodDetect(playerid, 7);
  4345. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4346. else ACInfo[playerid][acFloodCount][7] = ACInfo[playerid][acFloodCount][27] = 0;
  4347. }
  4348. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][7] = ac_i;
  4349. ac_i = GetVehicleModel(ACInfo[playerid][acVeh]) - 417;
  4350. if(0 <= ac_i <= 176 && ac_vType[ac_i] == 2) ACInfo[playerid][acParachute] = true;
  4351. else ACInfo[playerid][acParachute] = false;
  4352. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4353. && defined ac_OnPlayerExitVehicle
  4354. return ac_OnPlayerExitVehicle(playerid, vehicleid);
  4355. #else
  4356. return 1;
  4357. #endif
  4358. }
  4359. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4360. #if defined _ALS_OnPlayerExitVehicle
  4361. #undef OnPlayerExitVehicle
  4362. #else
  4363. #define _ALS_OnPlayerExitVehicle
  4364. #endif
  4365. #define OnPlayerExitVehicle ac_OnPlayerExitVehicle
  4366. #if defined ac_OnPlayerExitVehicle
  4367. forward ac_OnPlayerExitVehicle(playerid, vehicleid);
  4368. #endif
  4369. #endif
  4370. #if defined OnPlayerPickUpDynamicPickup\
  4371. && defined IsValidDynamicPickup
  4372. #if defined _inc_y_hooks || defined _INC_y_hooks
  4373. #if defined STREAMER_ENABLE_TAGS
  4374. hook OnPlayerPickUpDynPickup(playerid, STREAMER_TAG_PICKUP pickupid)
  4375. #else
  4376. hook OnPlayerPickUpDynPickup(playerid, pickupid)
  4377. #endif
  4378. #else
  4379. #if defined STREAMER_ENABLE_TAGS
  4380. public OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP pickupid)
  4381. #else
  4382. public OnPlayerPickUpDynamicPickup(playerid, pickupid)
  4383. #endif
  4384. #endif
  4385. {
  4386. if(IsPlayerConnected(playerid) == 0 || ACInfo[playerid][acKicked] || IsValidDynamicPickup(pickupid) == 0) return 0;
  4387. new ac_i = GetTickCount();
  4388. if(ACInfo[playerid][acACAllow][49])
  4389. {
  4390. if(ac_i < ACInfo[playerid][acCall][8] + ac_Mtfc[8][0]) ac_FloodDetect(playerid, 8);
  4391. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4392. else ACInfo[playerid][acFloodCount][8] = ACInfo[playerid][acFloodCount][27] = 0;
  4393. }
  4394. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][8] = ac_i;
  4395. if(_:pickupid < MAX_PICKUPS)
  4396. {
  4397. if(ACInfo[playerid][acACAllow][6] && (ACInfo[playerid][acSet][8] == -1 ||
  4398. VectorSize(ACInfo[playerid][acSetPosX] - ACDPickInfo[_:pickupid][acPosX], ACInfo[playerid][acSetPosY] - ACDPickInfo[_:pickupid][acPosY], ACInfo[playerid][acSetPosZ] - ACDPickInfo[_:pickupid][acPosZ]) > 8.0) &&
  4399. IsPlayerInRangeOfPoint(playerid, 8.0, ACDPickInfo[_:pickupid][acPosX], ACDPickInfo[_:pickupid][acPosY], ACDPickInfo[_:pickupid][acPosZ]) == 0)
  4400. {
  4401. #if defined DEBUG
  4402. printf("[Nex-AC debug] Pickupid: %d, distance: %f",
  4403. _:pickupid, GetPlayerDistanceFromPoint(playerid, ACDPickInfo[_:pickupid][acPosX],
  4404. ACDPickInfo[_:pickupid][acPosY], ACDPickInfo[_:pickupid][acPosZ]));
  4405. #endif
  4406. #if defined OnCheatDetected
  4407. ac_KickWithCode(playerid, "", 0, 6, 2);
  4408. #else
  4409. return ac_KickWithCode(playerid, "", 0, 6, 2);
  4410. #endif
  4411. }
  4412. switch(ACDPickInfo[_:pickupid][acType])
  4413. {
  4414. case 1:
  4415. {
  4416. ac_i = ac_wSlot[ACDPickInfo[_:pickupid][acWeapon]];
  4417. if(3 <= ac_i <= 5 && ACInfo[playerid][acWeapon][ac_i] > 0 ||
  4418. ACInfo[playerid][acWeapon][ac_i] == ACDPickInfo[_:pickupid][acWeapon]) ACInfo[playerid][acAmmo][ac_i] +=
  4419. ac_pAmmo[ACDPickInfo[_:pickupid][acWeapon]];
  4420. }
  4421. case 2: ACInfo[playerid][acSpecAct] = 2;
  4422. case 3: ACInfo[playerid][acHealth] = 100;
  4423. case 4: ACInfo[playerid][acArmour] = 100;
  4424. }
  4425. }
  4426. ACInfo[playerid][acLastPickup] = _:pickupid + MAX_PICKUPS;
  4427. ACInfo[playerid][acPicked] = true;
  4428. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4429. && defined ac_OnPlayerPickUpDynamicPickup
  4430. return ac_OnPlayerPickUpDynamicPickup(playerid, pickupid);
  4431. #else
  4432. return 1;
  4433. #endif
  4434. }
  4435. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4436. #if defined _ALS_OnPlayerPickUpDynamicPicku\
  4437. || defined _ALS_OnPlayerPickUpDynamicPick || defined _ALS_OnPlayer\
  4438. PickUpDynamicPickup
  4439. #undef OnPlayerPickUpDynamicPickup
  4440. #else
  4441. #define _ALS_OnPlayerPickUpDynamicPickup
  4442. #endif
  4443. #define OnPlayerPickUpDynamicPickup ac_OnPlayerPickUpDynamicPickup
  4444. #if defined ac_OnPlayerPickUpDynamicPickup
  4445. #if defined STREAMER_ENABLE_TAGS
  4446. forward ac_OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP pickupid);
  4447. #else
  4448. forward ac_OnPlayerPickUpDynamicPickup(playerid, pickupid);
  4449. #endif
  4450. #endif
  4451. #endif
  4452. #endif
  4453. #if defined _inc_y_hooks || defined _INC_y_hooks
  4454. hook OnPlayerPickUpPickup(playerid, pickupid)
  4455. #else
  4456. public OnPlayerPickUpPickup(playerid, pickupid)
  4457. #endif
  4458. {
  4459. if(IsPlayerConnected(playerid) == 0 || ACInfo[playerid][acKicked] || !(0 <= pickupid < MAX_PICKUPS)) return 0;
  4460. if(ACInfo[playerid][acPicked] == false)
  4461. {
  4462. new ac_i = GetTickCount();
  4463. if(ACInfo[playerid][acACAllow][49])
  4464. {
  4465. if(ac_i < ACInfo[playerid][acCall][8] + ac_Mtfc[8][0]) ac_FloodDetect(playerid, 8);
  4466. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4467. else ACInfo[playerid][acFloodCount][8] = ACInfo[playerid][acFloodCount][27] = 0;
  4468. }
  4469. if(ACInfo[playerid][acACAllow][6] && (ACInfo[playerid][acSet][8] == -1 ||
  4470. VectorSize(ACInfo[playerid][acSetPosX] - ACPickInfo[pickupid][acPosX], ACInfo[playerid][acSetPosY] - ACPickInfo[pickupid][acPosY], ACInfo[playerid][acSetPosZ] - ACPickInfo[pickupid][acPosZ]) > 8.0) &&
  4471. IsPlayerInRangeOfPoint(playerid, 8.0, ACPickInfo[pickupid][acPosX], ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]) == 0)
  4472. {
  4473. #if defined DEBUG
  4474. printf("[Nex-AC debug] Pickupid: %d, distance: %f",
  4475. pickupid, GetPlayerDistanceFromPoint(playerid, ACPickInfo[pickupid][acPosX],
  4476. ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]));
  4477. #endif
  4478. #if defined OnCheatDetected
  4479. ac_KickWithCode(playerid, "", 0, 6, 1);
  4480. #else
  4481. return ac_KickWithCode(playerid, "", 0, 6, 1);
  4482. #endif
  4483. }
  4484. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][8] = ac_i;
  4485. switch(ACPickInfo[pickupid][acType])
  4486. {
  4487. case 1:
  4488. {
  4489. ac_i = ac_wSlot[ACPickInfo[pickupid][acWeapon]];
  4490. if(3 <= ac_i <= 5 && ACInfo[playerid][acWeapon][ac_i] > 0 ||
  4491. ACInfo[playerid][acWeapon][ac_i] == ACPickInfo[pickupid][acWeapon]) ACInfo[playerid][acAmmo][ac_i] +=
  4492. ac_pAmmo[ACPickInfo[pickupid][acWeapon]];
  4493. }
  4494. case 2: ACInfo[playerid][acSpecAct] = 2;
  4495. case 3: ACInfo[playerid][acHealth] = 100;
  4496. case 4: ACInfo[playerid][acArmour] = 100;
  4497. }
  4498. ACInfo[playerid][acLastPickup] = pickupid;
  4499. }
  4500. else ACInfo[playerid][acPicked] = false;
  4501. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4502. && defined ac_OnPlayerPickUpPickup
  4503. if(ACPickInfo[pickupid][acIsStatic] == false) return ac_OnPlayerPickUpPickup(playerid, pickupid);
  4504. return 1;
  4505. #else
  4506. return 1;
  4507. #endif
  4508. }
  4509. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4510. #if defined _ALS_OnPlayerPickUpPickup
  4511. #undef OnPlayerPickUpPickup
  4512. #else
  4513. #define _ALS_OnPlayerPickUpPickup
  4514. #endif
  4515. #define OnPlayerPickUpPickup ac_OnPlayerPickUpPickup
  4516. #if defined ac_OnPlayerPickUpPickup
  4517. forward ac_OnPlayerPickUpPickup(playerid, pickupid);
  4518. #endif
  4519. #endif
  4520. #if defined _inc_y_hooks || defined _INC_y_hooks
  4521. hook OnPlayerRequestClass(playerid, classid)
  4522. #else
  4523. public OnPlayerRequestClass(playerid, classid)
  4524. #endif
  4525. {
  4526. if(ACInfo[playerid][acKicked]) return 0;
  4527. new ac_i = GetTickCount();
  4528. if(ACInfo[playerid][acACAllow][49])
  4529. {
  4530. if(ac_i < ACInfo[playerid][acCall][9] + ac_Mtfc[9][0]) return ac_FloodDetect(playerid, 9);
  4531. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4532. else ACInfo[playerid][acFloodCount][9] = ACInfo[playerid][acFloodCount][27] = 0;
  4533. }
  4534. ACInfo[playerid][acLogged] = true;
  4535. ACInfo[playerid][acClassid] = classid;
  4536. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][9] = ac_i;
  4537. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4538. && defined ac_OnPlayerRequestClass
  4539. return ac_OnPlayerRequestClass(playerid, classid);
  4540. #else
  4541. return 1;
  4542. #endif
  4543. }
  4544. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4545. #if defined _ALS_OnPlayerRequestClass
  4546. #undef OnPlayerRequestClass
  4547. #else
  4548. #define _ALS_OnPlayerRequestClass
  4549. #endif
  4550. #define OnPlayerRequestClass ac_OnPlayerRequestClass
  4551. #if defined ac_OnPlayerRequestClass
  4552. forward ac_OnPlayerRequestClass(playerid, classid);
  4553. #endif
  4554. #endif
  4555. #if defined _inc_y_hooks || defined _INC_y_hooks
  4556. hook OnPlayerSelectedMenuRow(playerid, row)
  4557. #else
  4558. public OnPlayerSelectedMenuRow(playerid, row)
  4559. #endif
  4560. {
  4561. if(IsPlayerConnected(playerid) == 0 || ACInfo[playerid][acKicked]) return 0;
  4562. new ac_i = GetTickCount();
  4563. if(ACInfo[playerid][acACAllow][49])
  4564. {
  4565. if(ac_i < ACInfo[playerid][acCall][10] + ac_Mtfc[10][0]) ac_FloodDetect(playerid, 10);
  4566. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4567. else ACInfo[playerid][acFloodCount][10] = ACInfo[playerid][acFloodCount][27] = 0;
  4568. }
  4569. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][10] = ac_i;
  4570. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4571. && defined ac_OnPlayerSelectedMenuRow
  4572. return ac_OnPlayerSelectedMenuRow(playerid, row);
  4573. #else
  4574. return 1;
  4575. #endif
  4576. }
  4577. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4578. #if defined _ALS_OnPlayerSelectedMenuRow
  4579. #undef OnPlayerSelectedMenuRow
  4580. #else
  4581. #define _ALS_OnPlayerSelectedMenuRow
  4582. #endif
  4583. #define OnPlayerSelectedMenuRow ac_OnPlayerSelectedMenuRow
  4584. #if defined ac_OnPlayerSelectedMenuRow
  4585. forward ac_OnPlayerSelectedMenuRow(playerid, row);
  4586. #endif
  4587. #endif
  4588. #if defined _inc_y_hooks || defined _INC_y_hooks
  4589. hook OnPlayerStateChange(playerid, newstate, oldstate)
  4590. #else
  4591. public OnPlayerStateChange(playerid, newstate, oldstate)
  4592. #endif
  4593. {
  4594. if(ACInfo[playerid][acKicked]) return 0;
  4595. new ac_i = GetTickCount(), bool:ac_ur;
  4596. if(IsPlayerNPC(playerid) == 0)
  4597. {
  4598. if(ACInfo[playerid][acACAllow][49])
  4599. {
  4600. if(ac_i < ACInfo[playerid][acCall][11] + ac_Mtfc[11][0])
  4601. {
  4602. if(newstate != 1 || oldstate != 8)
  4603. {
  4604. new ac_model;
  4605. if(oldstate == 2) ac_model = GetVehicleModel(ACInfo[playerid][acVeh]) - 417;
  4606. else if(newstate == 2) ac_model = GetVehicleModel(GetPlayerVehicleID(playerid)) - 417;
  4607. if(!(13 <= ac_model <= 178 && ac_vType[ac_model] == 3)) ac_FloodDetect(playerid, 11);
  4608. }
  4609. }
  4610. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4611. else ACInfo[playerid][acFloodCount][11] = ACInfo[playerid][acFloodCount][27] = 0;
  4612. }
  4613. if(oldstate == 0)
  4614. {
  4615. if(!(8 <= newstate <= 9) && ACInfo[playerid][acLogged] == false)
  4616. {
  4617. #if defined DEBUG
  4618. printf("[Nex-AC debug] Newstate: %d", newstate);
  4619. #endif
  4620. ac_KickWithCode(playerid, "", 0, 48, 2);
  4621. }
  4622. }
  4623. else if(2 <= oldstate <= 3)
  4624. {
  4625. if(oldstate == 2)
  4626. {
  4627. new ammo;
  4628. if(ACVehInfo[ACInfo[playerid][acVeh]][acDriver] == playerid) ACVehInfo[ACInfo[playerid][acVeh]][acDriver] = 65535;
  4629. GetPlayerWeaponData(playerid, 4, ammo, ammo);
  4630. if(ammo < ACInfo[playerid][acAmmo][4]) ACInfo[playerid][acAmmo][4] = ammo;
  4631. }
  4632. new Float:ac_vX, Float:ac_vY, Float:ac_vZ;
  4633. GetPlayerVelocity(playerid, ac_vX, ac_vY, ac_vZ);
  4634. ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_vX, ac_vY, ac_vZ);
  4635. ac_ur = true;
  4636. }
  4637. switch(newstate)
  4638. {
  4639. case 1:
  4640. {
  4641. ACInfo[playerid][acSet][11] = -1;
  4642. ACInfo[playerid][acEnterVeh] = 0;
  4643. GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  4644. }
  4645. case 2:
  4646. {
  4647. ACInfo[playerid][acSet][11] = -1;
  4648. ac_i = GetPlayerVehicleID(playerid);
  4649. if(ACInfo[playerid][acACAllow][44])
  4650. {
  4651. new ac_seatid = GetPlayerVehicleSeat(playerid);
  4652. if(ac_seatid != 128)
  4653. {
  4654. new ac_model = GetVehicleModel(ac_i) - 400;
  4655. if(ac_seatid || ac_model < 0 || ac_MaxPassengers[ac_model >>> 3] >>> ((ac_model & 7) << 2) & 0xF == 15 &&
  4656. ACInfo[playerid][acSet][9] == -1)
  4657. {
  4658. #if defined DEBUG
  4659. printf("[Nex-AC debug] Veh model: %d, seatid: %d", ac_model + 400, ac_seatid);
  4660. #endif
  4661. ac_KickWithCode(playerid, "", 0, 44, 2);
  4662. }
  4663. }
  4664. }
  4665. if(ACInfo[playerid][acSet][9] == -1)
  4666. {
  4667. ACVehInfo[ac_i][acDriver] = playerid;
  4668. GetVehicleZAngle(ac_i, ACVehInfo[ac_i][acZAngle]);
  4669. GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  4670. ACInfo[playerid][acCheatCount][11] = 0;
  4671. ACInfo[playerid][acVehDmgRes] = false;
  4672. ACInfo[playerid][acSetVehHealth] = -1;
  4673. }
  4674. }
  4675. case 3:
  4676. {
  4677. ACInfo[playerid][acSet][11] = -1;
  4678. ACInfo[playerid][acCheatCount][4] = 0;
  4679. if(ACInfo[playerid][acACAllow][44] && (ac_i = GetPlayerVehicleSeat(playerid)) != 128)
  4680. {
  4681. new ac_model = GetVehicleModel(GetPlayerVehicleID(playerid)) - 400;
  4682. if(ac_model < 0)
  4683. {
  4684. #if defined DEBUG
  4685. printf("[Nex-AC debug] Veh model: %d, seatid: %d", ac_model + 400, ac_i);
  4686. #endif
  4687. ac_KickWithCode(playerid, "", 0, 44, 3);
  4688. }
  4689. else
  4690. {
  4691. new ac_maxseats = (ac_MaxPassengers[ac_model >>> 3] >>> ((ac_model & 7) << 2)) & 0xF;
  4692. if(ac_i < 1 || (ac_maxseats == 15 || ac_i > ac_maxseats) && ACInfo[playerid][acSet][9] == -1)
  4693. {
  4694. #if defined DEBUG
  4695. printf("[Nex-AC debug] Veh model: %d, max seats: %d, seatid: %d",
  4696. ac_model + 400, ac_maxseats, ac_i);
  4697. #endif
  4698. ac_KickWithCode(playerid, "", 0, 44, 4);
  4699. }
  4700. }
  4701. }
  4702. }
  4703. case 9:
  4704. {
  4705. if(ACInfo[playerid][acACAllow][21] && ACInfo[playerid][acSpec] == false &&
  4706. ACInfo[playerid][acSet][6] == -1) ac_KickWithCode(playerid, "", 0, 21);
  4707. ACInfo[playerid][acSet][6] = -1;
  4708. ACInfo[playerid][acSpawnTime] = 0;
  4709. ACInfo[playerid][acSpec] = true;
  4710. }
  4711. }
  4712. }
  4713. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][11] = GetTickCount();
  4714. if(ac_ur) ACInfo[playerid][acGtc][10] = ACInfo[playerid][acCall][27];
  4715. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4716. && defined ac_OnPlayerStateChange
  4717. return ac_OnPlayerStateChange(playerid, newstate, oldstate);
  4718. #else
  4719. return 1;
  4720. #endif
  4721. }
  4722. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4723. #if defined _ALS_OnPlayerStateChange
  4724. #undef OnPlayerStateChange
  4725. #else
  4726. #define _ALS_OnPlayerStateChange
  4727. #endif
  4728. #define OnPlayerStateChange ac_OnPlayerStateChange
  4729. #if defined ac_OnPlayerStateChange
  4730. forward ac_OnPlayerStateChange(playerid, newstate, oldstate);
  4731. #endif
  4732. #endif
  4733. #if defined _inc_y_hooks || defined _INC_y_hooks
  4734. hook OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  4735. #else
  4736. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  4737. #endif
  4738. {
  4739. if(ACInfo[playerid][acKicked]) return 0;
  4740. static ac_i, ac_gtc, bool:ac_ur, bool:ac_ur2;
  4741. ac_gtc = GetTickCount();
  4742. ac_ur = ac_ur2 = false;
  4743. if(IsPlayerNPC(playerid) == 0)
  4744. {
  4745. if(ACInfo[playerid][acACAllow][22] && ac_LagCompMode == false) return ac_KickWithCode(playerid, "", 0, 22);
  4746. if(!(0 <= hittype <= 4))
  4747. {
  4748. #if defined DEBUG
  4749. printf("[Nex-AC debug] Hittype: %d, hitid: %d, weaponid: %d", hittype, hitid, weaponid);
  4750. #endif
  4751. return ac_KickWithCode(playerid, "", 0, 47, 1);
  4752. }
  4753. static Float:ac_oX, Float:ac_oY, Float:ac_oZ, Float:ac_X, Float:ac_Y, Float:ac_Z;
  4754. GetPlayerLastShotVectors(playerid, ac_oX, ac_oY, ac_oZ, ac_X, ac_Y, ac_Z);
  4755. if(ACInfo[playerid][acACAllow][34])
  4756. {
  4757. if(IsPlayerInRangeOfPoint(playerid, 8.0, ac_oX, ac_oY, ac_oZ) == 0)
  4758. {
  4759. if(++ACInfo[playerid][acCheatCount][5] > AC_MAX_AFK_GHOST_WARNINGS)
  4760. {
  4761. #if defined DEBUG
  4762. printf("[Nex-AC debug] Distance: %f", GetPlayerDistanceFromPoint(playerid, ac_oX, ac_oY, ac_oZ));
  4763. #endif
  4764. #if defined OnCheatDetected
  4765. ac_KickWithCode(playerid, "", 0, 34);
  4766. ACInfo[playerid][acCheatCount][5] = 0;
  4767. #else
  4768. return ac_KickWithCode(playerid, "", 0, 34);
  4769. #endif
  4770. }
  4771. #undef AC_MAX_AFK_GHOST_WARNINGS
  4772. }
  4773. else ACInfo[playerid][acCheatCount][5] = 0;
  4774. }
  4775. if(ACInfo[playerid][acACAllow][29])
  4776. {
  4777. if(hittype > 0 && !fX && !fY && !fZ)
  4778. {
  4779. if(++ACInfo[playerid][acCheatCount][13] > AC_MAX_SILENT_AIM_WARNINGS)
  4780. {
  4781. #if defined DEBUG
  4782. printf("[Nex-AC debug] Hittype: %d, weaponid: %d", hittype, weaponid);
  4783. #endif
  4784. #if defined OnCheatDetected
  4785. ac_KickWithCode(playerid, "", 0, 29, 1);
  4786. ACInfo[playerid][acCheatCount][13] = 0;
  4787. #else
  4788. return ac_KickWithCode(playerid, "", 0, 29, 1);
  4789. #endif
  4790. }
  4791. #undef AC_MAX_SILENT_AIM_WARNINGS
  4792. }
  4793. else
  4794. {
  4795. ACInfo[playerid][acCheatCount][13] = 0;
  4796. if(hittype == 1 && ac_gtc < ACInfo[hitid][acLastUpdate] + 1500 && IsPlayerInAnyVehicle(hitid) == 0 &&
  4797. GetPlayerSurfingVehicleID(hitid) == 65535 && GetPlayerSurfingObjectID(hitid) == 65535)
  4798. {
  4799. if(IsPlayerInRangeOfPoint(hitid, 8.0, ac_X, ac_Y, ac_Z) == 0)
  4800. {
  4801. if(++ACInfo[playerid][acCheatCount][6] > AC_MAX_PRO_AIM_WARNINGS)
  4802. {
  4803. #if defined DEBUG
  4804. printf("[Nex-AC debug] Distance: %f", GetPlayerDistanceFromPoint(hitid, ac_X, ac_Y, ac_Z));
  4805. #endif
  4806. #if defined OnCheatDetected
  4807. ac_KickWithCode(playerid, "", 0, 29, 2);
  4808. ACInfo[playerid][acCheatCount][6] = 0;
  4809. #else
  4810. return ac_KickWithCode(playerid, "", 0, 29, 2);
  4811. #endif
  4812. }
  4813. #undef AC_MAX_PRO_AIM_WARNINGS
  4814. }
  4815. else ACInfo[playerid][acCheatCount][6] = 0;
  4816. }
  4817. }
  4818. }
  4819. static ac_t;
  4820. switch(hittype)
  4821. {
  4822. case 1:
  4823. {
  4824. if(ACInfo[hitid][acACAllow][19] && ACInfo[hitid][acFreeze] &&
  4825. GetPlayerSpecialAction(hitid) != 3)
  4826. {
  4827. ac_t = GetPlayerTeam(playerid);
  4828. ac_i = GetPlayerInterior(hitid);
  4829. if(ACInfo[hitid][acDead] == false && (ac_t == 255 || ac_t != GetPlayerTeam(hitid)))
  4830. {
  4831. #if AC_USE_RESTAURANTS
  4832. if(ac_InRestaurant(hitid, ac_i) == 0)
  4833. {
  4834. #endif
  4835. #if AC_USE_AMMUNATIONS
  4836. if(ac_InAmmuNation(hitid, ac_i) == 0)
  4837. {
  4838. #endif
  4839. #if AC_USE_CASINOS
  4840. if(ac_InCasino(hitid, ac_i) == 0)
  4841. {
  4842. #endif
  4843. ac_ur = true;
  4844. #if AC_USE_CASINOS
  4845. }
  4846. #endif
  4847. #if AC_USE_AMMUNATIONS
  4848. }
  4849. #endif
  4850. #if AC_USE_RESTAURANTS
  4851. }
  4852. #endif
  4853. }
  4854. }
  4855. }
  4856. case 2:
  4857. {
  4858. if(ACVehInfo[hitid][acDriver] != 65535 && ACInfo[ACVehInfo[hitid][acDriver]][acACAllow][20] &&
  4859. ACInfo[ACVehInfo[hitid][acDriver]][acFreeze] && ACVehInfo[hitid][acHealth] > 220.0)
  4860. {
  4861. ac_t = GetPlayerTeam(playerid);
  4862. if(ac_VehFriendlyFire == false || ac_t == 255 || ac_t != GetPlayerTeam(ACVehInfo[hitid][acDriver]))
  4863. {
  4864. static ac_m, Float:ac_Offset[9], Float:ac_Offset2[6];
  4865. ac_m = GetVehicleModel(hitid);
  4866. GetVehicleModelInfo(ac_m, 5, ac_Offset[0], ac_Offset[1], ac_Offset[2]);
  4867. ac_Offset2[0] = (floatsin((ACVehInfo[hitid][acZAngle] = 360 - ACVehInfo[hitid][acZAngle]), degrees) * ac_Offset[1]) + (floatcos(ACVehInfo[hitid][acZAngle], degrees) * -ac_Offset[0]);
  4868. ac_Offset2[1] = (floatcos(ACVehInfo[hitid][acZAngle], degrees) * ac_Offset[1]) - (floatsin(ACVehInfo[hitid][acZAngle], degrees) * -ac_Offset[0]);
  4869. GetVehicleModelInfo(ac_m, 6, ac_Offset[3], ac_Offset[4], ac_Offset[5]);
  4870. ac_Offset2[2] = (floatsin((ACVehInfo[hitid][acZAngle] = 360 - ACVehInfo[hitid][acZAngle]), degrees) * ac_Offset[4]) + (floatcos(ACVehInfo[hitid][acZAngle], degrees) * -ac_Offset[3]);
  4871. ac_Offset2[3] = (floatcos(ACVehInfo[hitid][acZAngle], degrees) * ac_Offset[4]) - (floatsin(ACVehInfo[hitid][acZAngle], degrees) * -ac_Offset[3]);
  4872. GetVehicleModelInfo(ac_m, 7, ac_Offset[6], ac_Offset[7], ac_Offset[8]);
  4873. ac_Offset2[4] = (floatsin((ACVehInfo[hitid][acZAngle] = 360 - ACVehInfo[hitid][acZAngle]), degrees) * ac_Offset[7]) + (floatcos(ACVehInfo[hitid][acZAngle], degrees) * -ac_Offset[6]);
  4874. ac_Offset2[5] = (floatcos(ACVehInfo[hitid][acZAngle], degrees) * ac_Offset[7]) - (floatsin(ACVehInfo[hitid][acZAngle], degrees) * -ac_Offset[6]);
  4875. if(VectorSize(ac_Offset[0] - fX, ac_Offset[1] - fY, ac_Offset[2] - fZ) > 2.5 &&
  4876. floatabs(VectorSize(ac_Offset2[0] - fX, ac_Offset2[1] - fY, ac_Offset[2] - fZ)) > 2.5 &&
  4877. VectorSize(ac_Offset[3] - fX, ac_Offset[4] - fY, ac_Offset[5] - fZ) > 2.5 &&
  4878. floatabs(VectorSize(ac_Offset2[2] - fX, ac_Offset2[3] - fY, ac_Offset[5] - fZ)) > 2.5 &&
  4879. (!ac_Offset[6] && !ac_Offset[7] && !ac_Offset[8] || VectorSize(ac_Offset[6] - fX, ac_Offset[7] - fY, ac_Offset[8] - fZ) > 2.5 &&
  4880. floatabs(VectorSize(ac_Offset2[4] - fX, ac_Offset2[5] - fY, ac_Offset[8] - fZ)) > 2.5)) ac_ur2 = true;
  4881. }
  4882. }
  4883. }
  4884. }
  4885. if((ac_t = GetPlayerState(playerid)) != 2)
  4886. {
  4887. static ac_s;
  4888. ac_s = GetPlayerWeapon(playerid);
  4889. if(ACInfo[playerid][acACAllow][47] && (ac_t != 3 && ac_s != weaponid || weaponid != 38 && !(22 <= weaponid <= 34)))
  4890. {
  4891. #if defined DEBUG
  4892. printf("[Nex-AC debug] Armed weapon: %d, weaponid: %d, state: %d", ac_s, weaponid, ac_t);
  4893. #endif
  4894. return ac_KickWithCode(playerid, "", 0, 47, 2);
  4895. }
  4896. ac_s = ac_wSlot[weaponid];
  4897. if(ACInfo[playerid][acACAllow][26])
  4898. {
  4899. ac_i = ac_gtc - ACInfo[playerid][acShotTime];
  4900. if(ACInfo[playerid][acLastShot] == weaponid)
  4901. {
  4902. if(weaponid != 38 && ac_t != 3)
  4903. {
  4904. if(ac_gtc < ACInfo[playerid][acReload] + 800)
  4905. {
  4906. #if defined DEBUG
  4907. printf("[Nex-AC debug] Weaponid: %d, Reload time: %d, state: %d",
  4908. weaponid, ac_gtc - ACInfo[playerid][acReload], ac_t);
  4909. #endif
  4910. #if defined OnCheatDetected
  4911. ac_KickWithCode(playerid, "", 0, 26, 4);
  4912. ACInfo[playerid][acReload] = 0;
  4913. #else
  4914. return ac_KickWithCode(playerid, "", 0, 26, 4);
  4915. #endif
  4916. }
  4917. else if(ac_i < 30 || ac_i < 50 && weaponid != 32 &&
  4918. !(28 <= weaponid <= 29) || ac_i < 386 && 33 <= weaponid <= 34)
  4919. {
  4920. if(++ACInfo[playerid][acCheatCount][8] > AC_MAX_RAPID_FIRE_WARNINGS)
  4921. {
  4922. #if defined DEBUG
  4923. printf("[Nex-AC debug] Fire rate: %d, weaponid: %d", ac_i, weaponid);
  4924. #endif
  4925. #if defined OnCheatDetected
  4926. ac_KickWithCode(playerid, "", 0, 26, 1);
  4927. ACInfo[playerid][acCheatCount][8] = 0;
  4928. #else
  4929. return ac_KickWithCode(playerid, "", 0, 26, 1);
  4930. #endif
  4931. }
  4932. }
  4933. else ACInfo[playerid][acCheatCount][8] = 0;
  4934. if((weaponid == 24 && ac_i < 600 || weaponid == 25 && ac_i < 800) &&
  4935. ++ACInfo[playerid][acCheatCount][14] > AC_MAX_RAPID_FIRE_WARNINGS)
  4936. {
  4937. #if defined DEBUG
  4938. printf("[Nex-AC debug] Fire rate: %d, weaponid: %d", ac_i, weaponid);
  4939. #endif
  4940. #if defined OnCheatDetected
  4941. ac_KickWithCode(playerid, "", 0, 26, 2);
  4942. ACInfo[playerid][acCheatCount][14] = 0;
  4943. #else
  4944. return ac_KickWithCode(playerid, "", 0, 26, 2);
  4945. #endif
  4946. }
  4947. }
  4948. }
  4949. else if(ac_i < 30)
  4950. {
  4951. #if defined DEBUG
  4952. printf("[Nex-AC debug] Fire rate: %d, weaponid: %d, last weapon: %d",
  4953. ac_i, weaponid, ACInfo[playerid][acLastShot]);
  4954. #endif
  4955. #if defined OnCheatDetected
  4956. ac_KickWithCode(playerid, "", 0, 26, 3);
  4957. #else
  4958. return ac_KickWithCode(playerid, "", 0, 26, 3);
  4959. #endif
  4960. }
  4961. if(GetPlayerWeaponState(playerid) == 1) ACInfo[playerid][acReload] = ac_gtc;
  4962. }
  4963. if(ACInfo[playerid][acACAllow][17] && ac_t != 3)
  4964. {
  4965. ac_t = GetPlayerAmmo(playerid);
  4966. if(ACInfo[playerid][acAmmo][ac_s] == 0)
  4967. {
  4968. if(ac_gtc > ACInfo[playerid][acGtc][7] + GetPlayerPing(playerid) + 150)
  4969. {
  4970. #if defined DEBUG
  4971. printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
  4972. weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  4973. #endif
  4974. #if defined OnCheatDetected
  4975. ac_KickWithCode(playerid, "", 0, 17, 1);
  4976. ACInfo[playerid][acAmmo][ac_s] = ac_t;
  4977. #else
  4978. return ac_KickWithCode(playerid, "", 0, 17, 1);
  4979. #endif
  4980. }
  4981. else return 0;
  4982. }
  4983. if((ac_i = ac_abs(ACInfo[playerid][acAmmo][ac_s] - ac_t)))
  4984. {
  4985. switch(weaponid)
  4986. {
  4987. case 23, 24:
  4988. {
  4989. if(ac_i > 2 || ++ACInfo[playerid][acCheatCount][7] > 2)
  4990. {
  4991. #if defined DEBUG
  4992. printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
  4993. weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  4994. #endif
  4995. #if defined OnCheatDetected
  4996. ac_KickWithCode(playerid, "", 0, 17, 2);
  4997. ACInfo[playerid][acCheatCount][7] = 0;
  4998. ACInfo[playerid][acAmmo][ac_s] = ac_t;
  4999. #else
  5000. return ac_KickWithCode(playerid, "", 0, 17, 2);
  5001. #endif
  5002. }
  5003. }
  5004. case 29:
  5005. {
  5006. if(ac_i > 2 || ++ACInfo[playerid][acCheatCount][7] > 3)
  5007. {
  5008. #if defined DEBUG
  5009. printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
  5010. weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  5011. #endif
  5012. #if defined OnCheatDetected
  5013. ac_KickWithCode(playerid, "", 0, 17, 3);
  5014. ACInfo[playerid][acCheatCount][7] = 0;
  5015. ACInfo[playerid][acAmmo][ac_s] = ac_t;
  5016. #else
  5017. return ac_KickWithCode(playerid, "", 0, 17, 3);
  5018. #endif
  5019. }
  5020. }
  5021. case 22, 26, 28, 30..32, 34:
  5022. {
  5023. if(ac_i > 3 && ACInfo[playerid][acAmmo][ac_s] < ac_t)
  5024. {
  5025. #if defined DEBUG
  5026. printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
  5027. weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  5028. #endif
  5029. #if defined OnCheatDetected
  5030. ac_KickWithCode(playerid, "", 0, 17, 4);
  5031. ACInfo[playerid][acCheatCount][7] = 0;
  5032. ACInfo[playerid][acAmmo][ac_s] = ac_t;
  5033. #else
  5034. return ac_KickWithCode(playerid, "", 0, 17, 4);
  5035. #endif
  5036. }
  5037. }
  5038. case 38:
  5039. {
  5040. if(++ACInfo[playerid][acCheatCount][7] > 8)
  5041. {
  5042. #if defined DEBUG
  5043. printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
  5044. weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  5045. #endif
  5046. #if defined OnCheatDetected
  5047. ac_KickWithCode(playerid, "", 0, 17, 5);
  5048. ACInfo[playerid][acCheatCount][7] = 0;
  5049. #else
  5050. return ac_KickWithCode(playerid, "", 0, 17, 5);
  5051. #endif
  5052. }
  5053. }
  5054. default:
  5055. {
  5056. #if defined DEBUG
  5057. printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
  5058. weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  5059. #endif
  5060. #if defined OnCheatDetected
  5061. ac_KickWithCode(playerid, "", 0, 17, 6);
  5062. ACInfo[playerid][acAmmo][ac_s] = ac_t;
  5063. #else
  5064. return ac_KickWithCode(playerid, "", 0, 17, 6);
  5065. #endif
  5066. }
  5067. }
  5068. }
  5069. else ACInfo[playerid][acCheatCount][7] = 0;
  5070. }
  5071. ACInfo[playerid][acAmmo][ac_s]--;
  5072. if(ACInfo[playerid][acAmmo][ac_s] < -32768) ACInfo[playerid][acAmmo][ac_s] += 65536;
  5073. else if(ACInfo[playerid][acAmmo][ac_s] == 0 && ACInfo[playerid][acSet][3] == weaponid) ACInfo[playerid][acSet][3] =
  5074. ACInfo[playerid][acSetWeapon][ac_s] = -1;
  5075. }
  5076. ACInfo[playerid][acLastShot] = weaponid;
  5077. }
  5078. ac_i = 1;
  5079. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5080. && defined ac_OnPlayerWeaponShot
  5081. ac_i = ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
  5082. #endif
  5083. ACInfo[playerid][acShotTime] = ac_gtc;
  5084. if(ac_i)
  5085. {
  5086. if(ac_ur)
  5087. {
  5088. if(ACInfo[hitid][acArmour] > 0) ACInfo[hitid][acDmgRes] = 2;
  5089. else ACInfo[hitid][acDmgRes] = 1;
  5090. ACInfo[hitid][acGtc][14] = ac_gtc;
  5091. }
  5092. if(ac_ur2)
  5093. {
  5094. ACInfo[ACVehInfo[hitid][acDriver]][acVehDmgRes] = true;
  5095. ACInfo[ACVehInfo[hitid][acDriver]][acGtc][16] = ac_gtc;
  5096. }
  5097. }
  5098. return ac_i;
  5099. }
  5100. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5101. #if defined _ALS_OnPlayerWeaponShot
  5102. #undef OnPlayerWeaponShot
  5103. #else
  5104. #define _ALS_OnPlayerWeaponShot
  5105. #endif
  5106. #define OnPlayerWeaponShot ac_OnPlayerWeaponShot
  5107. #if defined ac_OnPlayerWeaponShot
  5108. forward ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
  5109. #endif
  5110. #endif
  5111. #if defined _inc_y_hooks || defined _INC_y_hooks
  5112. hook OnVehicleMod(playerid, vehicleid, componentid)
  5113. #else
  5114. public OnVehicleMod(playerid, vehicleid, componentid)
  5115. #endif
  5116. {
  5117. if(ACInfo[playerid][acKicked]) return 0;
  5118. new ac_i = GetTickCount();
  5119. if(ACInfo[playerid][acACAllow][49])
  5120. {
  5121. if(ac_i < ACInfo[playerid][acCall][12] + ac_Mtfc[12][0]) return ac_FloodDetect(playerid, 12);
  5122. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5123. else ACInfo[playerid][acFloodCount][12] = ACInfo[playerid][acFloodCount][27] = 0;
  5124. }
  5125. if(ACInfo[playerid][acACAllow][23] && ACInfo[playerid][acModShop] == false)
  5126. {
  5127. #if defined OnCheatDetected
  5128. ac_KickWithCode(playerid, "", 0, 23, 2);
  5129. #else
  5130. return ac_KickWithCode(playerid, "", 0, 23, 2);
  5131. #endif
  5132. }
  5133. if(ACInfo[playerid][acACAllow][43] && ac_IsCompatible(GetVehicleModel(vehicleid), componentid) == 0)
  5134. {
  5135. #if defined DEBUG
  5136. printf("[Nex-AC debug] Veh model: %d, componentid: %d", GetVehicleModel(vehicleid), componentid);
  5137. #endif
  5138. return ac_KickWithCode(playerid, "", 0, 43, 1);
  5139. }
  5140. if(ACInfo[playerid][acSet][13] != -1) ACInfo[playerid][acSet][13] += ac_cPrice[componentid - 1000];
  5141. else ACInfo[playerid][acSet][13] = ac_cPrice[componentid - 1000];
  5142. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][12] = ac_i;
  5143. ACInfo[playerid][acGtc][17] = ac_i + 1500;
  5144. ACInfo[playerid][acCheatCount][12] = 0;
  5145. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5146. && defined ac_OnVehicleMod
  5147. return ac_OnVehicleMod(playerid, vehicleid, componentid);
  5148. #else
  5149. return 1;
  5150. #endif
  5151. }
  5152. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5153. #if defined _ALS_OnVehicleMod
  5154. #undef OnVehicleMod
  5155. #else
  5156. #define _ALS_OnVehicleMod
  5157. #endif
  5158. #define OnVehicleMod ac_OnVehicleMod
  5159. #if defined ac_OnVehicleMod
  5160. forward ac_OnVehicleMod(playerid, vehicleid, componentid);
  5161. #endif
  5162. #endif
  5163. #if defined _inc_y_hooks || defined _INC_y_hooks
  5164. hook OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  5165. #else
  5166. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  5167. #endif
  5168. {
  5169. if(ACInfo[playerid][acKicked]) return 0;
  5170. new ac_i = GetTickCount();
  5171. if(ACInfo[playerid][acACAllow][49])
  5172. {
  5173. if(ac_i < ACInfo[playerid][acCall][13] + ac_Mtfc[13][0]) ac_FloodDetect(playerid, 13);
  5174. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5175. else ACInfo[playerid][acFloodCount][13] = ACInfo[playerid][acFloodCount][27] = 0;
  5176. }
  5177. if(ACInfo[playerid][acACAllow][43] && !(0 <= paintjobid <= 2))
  5178. {
  5179. #if defined DEBUG
  5180. printf("[Nex-AC debug] Veh model: %d, paintjobid: %d", GetVehicleModel(vehicleid), paintjobid);
  5181. #endif
  5182. ac_KickWithCode(playerid, "", 0, 43, 2);
  5183. }
  5184. else if(ACInfo[playerid][acACAllow][23] && ACInfo[playerid][acModShop] == false) ac_KickWithCode(playerid, "", 0, 23, 4);
  5185. else ACVehInfo[vehicleid][acPaintJob] = paintjobid;
  5186. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][13] = ac_i;
  5187. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5188. && defined ac_OnVehiclePaintjob
  5189. return ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  5190. #else
  5191. return 1;
  5192. #endif
  5193. }
  5194. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5195. #if defined _ALS_OnVehiclePaintjob
  5196. #undef OnVehiclePaintjob
  5197. #else
  5198. #define _ALS_OnVehiclePaintjob
  5199. #endif
  5200. #define OnVehiclePaintjob ac_OnVehiclePaintjob
  5201. #if defined ac_OnVehiclePaintjob
  5202. forward ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  5203. #endif
  5204. #endif
  5205. #if defined _inc_y_hooks || defined _INC_y_hooks
  5206. hook OnVehicleRespray(playerid, vehicleid, color1, color2)
  5207. #else
  5208. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  5209. #endif
  5210. {
  5211. if(ACInfo[playerid][acKicked]) return 0;
  5212. new ac_i = GetTickCount();
  5213. if(ACInfo[playerid][acACAllow][49])
  5214. {
  5215. if(ac_i < ACInfo[playerid][acCall][14] + ac_Mtfc[14][0]) return ac_FloodDetect(playerid, 14);
  5216. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5217. else ACInfo[playerid][acFloodCount][14] = ACInfo[playerid][acFloodCount][27] = 0;
  5218. }
  5219. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][14] = ac_i;
  5220. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5221. && defined ac_OnVehicleRespray
  5222. return ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
  5223. #else
  5224. return 1;
  5225. #endif
  5226. }
  5227. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5228. #if defined _ALS_OnVehicleRespray
  5229. #undef OnVehicleRespray
  5230. #else
  5231. #define _ALS_OnVehicleRespray
  5232. #endif
  5233. #define OnVehicleRespray ac_OnVehicleRespray
  5234. #if defined ac_OnVehicleRespray
  5235. forward ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
  5236. #endif
  5237. #endif
  5238. #if defined _inc_y_hooks || defined _INC_y_hooks
  5239. hook OnVehicleSpawn(vehicleid)
  5240. #else
  5241. public OnVehicleSpawn(vehicleid)
  5242. #endif
  5243. {
  5244. ACVehInfo[vehicleid][acPaintJob] = 3;
  5245. ACVehInfo[vehicleid][acSpawned] = true;
  5246. ACVehInfo[vehicleid][acHealth] = 1000.0;
  5247. ACVehInfo[vehicleid][acSpeedDiff] =
  5248. ACVehInfo[vehicleid][acPosDiff] =
  5249. ACVehInfo[vehicleid][acVelX] =
  5250. ACVehInfo[vehicleid][acVelY] =
  5251. ACVehInfo[vehicleid][acVelZ] = 0.0;
  5252. ACVehInfo[vehicleid][acDriver] = 65535;
  5253. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5254. && defined ac_OnVehicleSpawn
  5255. return ac_OnVehicleSpawn(vehicleid);
  5256. #else
  5257. return 1;
  5258. #endif
  5259. }
  5260. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5261. #if defined _ALS_OnVehicleSpawn
  5262. #undef OnVehicleSpawn
  5263. #else
  5264. #define _ALS_OnVehicleSpawn
  5265. #endif
  5266. #define OnVehicleSpawn ac_OnVehicleSpawn
  5267. #if defined ac_OnVehicleSpawn
  5268. forward ac_OnVehicleSpawn(vehicleid);
  5269. #endif
  5270. #endif
  5271. #if defined _inc_y_hooks || defined _INC_y_hooks
  5272. hook OnVehicleDeath(vehicleid, killerid)
  5273. #else
  5274. public OnVehicleDeath(vehicleid, killerid)
  5275. #endif
  5276. {
  5277. if(killerid != 65535)
  5278. {
  5279. new ac_i = GetTickCount();
  5280. if(ACInfo[killerid][acACAllow][49])
  5281. {
  5282. if(ac_i < ACInfo[killerid][acCall][15] + ac_Mtfc[15][0]) ac_FloodDetect(killerid, 15);
  5283. else if(ac_i < ACInfo[killerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(killerid, 27);
  5284. else ACInfo[killerid][acFloodCount][15] = ACInfo[killerid][acFloodCount][27] = 0;
  5285. }
  5286. ACInfo[killerid][acCall][27] = ACInfo[killerid][acCall][15] = ac_i;
  5287. }
  5288. new Float:ac_vhealth;
  5289. GetVehicleHealth(vehicleid, ac_vhealth);
  5290. if(ac_vhealth < 250.0) ACVehInfo[vehicleid][acSpawned] = false;
  5291. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5292. && defined ac_OnVehicleDeath
  5293. return ac_OnVehicleDeath(vehicleid, killerid);
  5294. #else
  5295. return 1;
  5296. #endif
  5297. }
  5298. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5299. #if defined _ALS_OnVehicleDeath
  5300. #undef OnVehicleDeath
  5301. #else
  5302. #define _ALS_OnVehicleDeath
  5303. #endif
  5304. #define OnVehicleDeath ac_OnVehicleDeath
  5305. #if defined ac_OnVehicleDeath
  5306. forward ac_OnVehicleDeath(vehicleid, killerid);
  5307. #endif
  5308. #endif
  5309. #if defined _inc_y_hooks || defined _INC_y_hooks
  5310. hook OnPlayerText(playerid, text[])
  5311. #else
  5312. public OnPlayerText(playerid, text[])
  5313. #endif
  5314. {
  5315. if(ACInfo[playerid][acKicked]) return 0;
  5316. new ac_i = GetTickCount();
  5317. if(ACInfo[playerid][acACAllow][49])
  5318. {
  5319. if(ac_i < ACInfo[playerid][acCall][16] + ac_Mtfc[16][0]) return ac_FloodDetect(playerid, 16);
  5320. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5321. else ACInfo[playerid][acFloodCount][16] = ACInfo[playerid][acFloodCount][27] = 0;
  5322. }
  5323. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][16] = ac_i;
  5324. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5325. && defined ac_OnPlayerText
  5326. return ac_OnPlayerText(playerid, text);
  5327. #else
  5328. return 1;
  5329. #endif
  5330. }
  5331. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5332. #if defined _ALS_OnPlayerText
  5333. #undef OnPlayerText
  5334. #else
  5335. #define _ALS_OnPlayerText
  5336. #endif
  5337. #define OnPlayerText ac_OnPlayerText
  5338. #if defined ac_OnPlayerText
  5339. forward ac_OnPlayerText(playerid, text[]);
  5340. #endif
  5341. #endif
  5342. #if defined OnPlayerEnterDynamicCP
  5343. #if defined _inc_y_hooks || defined _INC_y_hooks
  5344. #if defined STREAMER_ENABLE_TAGS
  5345. hook OnPlayerEnterDynamicCP(playerid, STREAMER_TAG_CP checkpointid)
  5346. #else
  5347. hook OnPlayerEnterDynamicCP(playerid, checkpointid)
  5348. #endif
  5349. #else
  5350. #if defined STREAMER_ENABLE_TAGS
  5351. public OnPlayerEnterDynamicCP(playerid, STREAMER_TAG_CP checkpointid)
  5352. #else
  5353. public OnPlayerEnterDynamicCP(playerid, checkpointid)
  5354. #endif
  5355. #endif
  5356. {
  5357. if(ACInfo[playerid][acKicked]) return 0;
  5358. new ac_i = GetTickCount();
  5359. if(ACInfo[playerid][acACAllow][49])
  5360. {
  5361. if(ac_i < ACInfo[playerid][acCall][17] + ac_Mtfc[17][0]) ac_FloodDetect(playerid, 17);
  5362. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5363. else ACInfo[playerid][acFloodCount][17] = ACInfo[playerid][acFloodCount][27] = 0;
  5364. }
  5365. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][17] = ac_i;
  5366. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5367. && defined ac_OnPlayerEnterDynamicCP
  5368. return ac_OnPlayerEnterDynamicCP(playerid, checkpointid);
  5369. #else
  5370. return 1;
  5371. #endif
  5372. }
  5373. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5374. #if defined _ALS_OnPlayerEnterDynamicCP
  5375. #undef OnPlayerEnterDynamicCP
  5376. #else
  5377. #define _ALS_OnPlayerEnterDynamicCP
  5378. #endif
  5379. #define OnPlayerEnterDynamicCP ac_OnPlayerEnterDynamicCP
  5380. #if defined ac_OnPlayerEnterDynamicCP
  5381. #if defined STREAMER_ENABLE_TAGS
  5382. forward ac_OnPlayerEnterDynamicCP(playerid, STREAMER_TAG_CP checkpointid);
  5383. #else
  5384. forward ac_OnPlayerEnterDynamicCP(playerid, checkpointid);
  5385. #endif
  5386. #endif
  5387. #endif
  5388. #endif
  5389. #if defined _inc_y_hooks || defined _INC_y_hooks
  5390. hook OnPlayerEnterCheckpoint(playerid)
  5391. #else
  5392. public OnPlayerEnterCheckpoint(playerid)
  5393. #endif
  5394. {
  5395. if(ACInfo[playerid][acKicked]) return 0;
  5396. new ac_i = GetTickCount();
  5397. if(ACInfo[playerid][acACAllow][49])
  5398. {
  5399. if(ac_i < ACInfo[playerid][acCall][17] + ac_Mtfc[17][0]) ac_FloodDetect(playerid, 17);
  5400. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5401. else ACInfo[playerid][acFloodCount][17] = ACInfo[playerid][acFloodCount][27] = 0;
  5402. }
  5403. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][17] = ac_i;
  5404. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5405. && defined ac_OnPlayerEnterCheckpoint
  5406. return ac_OnPlayerEnterCheckpoint(playerid);
  5407. #else
  5408. return 1;
  5409. #endif
  5410. }
  5411. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5412. #if defined _ALS_OnPlayerEnterCheckpoint
  5413. #undef OnPlayerEnterCheckpoint
  5414. #else
  5415. #define _ALS_OnPlayerEnterCheckpoint
  5416. #endif
  5417. #define OnPlayerEnterCheckpoint ac_OnPlayerEnterCheckpoint
  5418. #if defined ac_OnPlayerEnterCheckpoint
  5419. forward ac_OnPlayerEnterCheckpoint(playerid);
  5420. #endif
  5421. #endif
  5422. #if defined OnPlayerLeaveDynamicCP
  5423. #if defined _inc_y_hooks || defined _INC_y_hooks
  5424. #if defined STREAMER_ENABLE_TAGS
  5425. hook OnPlayerLeaveDynamicCP(playerid, STREAMER_TAG_CP checkpointid)
  5426. #else
  5427. hook OnPlayerLeaveDynamicCP(playerid, checkpointid)
  5428. #endif
  5429. #else
  5430. #if defined STREAMER_ENABLE_TAGS
  5431. public OnPlayerLeaveDynamicCP(playerid, STREAMER_TAG_CP checkpointid)
  5432. #else
  5433. public OnPlayerLeaveDynamicCP(playerid, checkpointid)
  5434. #endif
  5435. #endif
  5436. {
  5437. if(ACInfo[playerid][acKicked]) return 0;
  5438. new ac_i = GetTickCount();
  5439. if(ACInfo[playerid][acACAllow][49])
  5440. {
  5441. if(ac_i < ACInfo[playerid][acCall][18] + ac_Mtfc[18][0]) ac_FloodDetect(playerid, 18);
  5442. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5443. else ACInfo[playerid][acFloodCount][18] = ACInfo[playerid][acFloodCount][27] = 0;
  5444. }
  5445. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][18] = ac_i;
  5446. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5447. && defined ac_OnPlayerLeaveDynamicCP
  5448. return ac_OnPlayerLeaveDynamicCP(playerid, checkpointid);
  5449. #else
  5450. return 1;
  5451. #endif
  5452. }
  5453. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5454. #if defined _ALS_OnPlayerLeaveDynamicCP
  5455. #undef OnPlayerLeaveDynamicCP
  5456. #else
  5457. #define _ALS_OnPlayerLeaveDynamicCP
  5458. #endif
  5459. #define OnPlayerLeaveDynamicCP ac_OnPlayerLeaveDynamicCP
  5460. #if defined ac_OnPlayerLeaveDynamicCP
  5461. #if defined STREAMER_ENABLE_TAGS
  5462. forward ac_OnPlayerLeaveDynamicCP(playerid, STREAMER_TAG_CP checkpointid);
  5463. #else
  5464. forward ac_OnPlayerLeaveDynamicCP(playerid, checkpointid);
  5465. #endif
  5466. #endif
  5467. #endif
  5468. #endif
  5469. #if defined _inc_y_hooks || defined _INC_y_hooks
  5470. hook OnPlayerLeaveCheckpoint(playerid)
  5471. #else
  5472. public OnPlayerLeaveCheckpoint(playerid)
  5473. #endif
  5474. {
  5475. if(ACInfo[playerid][acKicked]) return 0;
  5476. new ac_i = GetTickCount();
  5477. if(ACInfo[playerid][acACAllow][49])
  5478. {
  5479. if(ac_i < ACInfo[playerid][acCall][18] + ac_Mtfc[18][0]) ac_FloodDetect(playerid, 18);
  5480. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5481. else ACInfo[playerid][acFloodCount][18] = ACInfo[playerid][acFloodCount][27] = 0;
  5482. }
  5483. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][18] = ac_i;
  5484. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5485. && defined ac_OnPlayerLeaveCheckpoint
  5486. return ac_OnPlayerLeaveCheckpoint(playerid);
  5487. #else
  5488. return 1;
  5489. #endif
  5490. }
  5491. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5492. #if defined _ALS_OnPlayerLeaveCheckpoint
  5493. #undef OnPlayerLeaveCheckpoint
  5494. #else
  5495. #define _ALS_OnPlayerLeaveCheckpoint
  5496. #endif
  5497. #define OnPlayerLeaveCheckpoint ac_OnPlayerLeaveCheckpoint
  5498. #if defined ac_OnPlayerLeaveCheckpoint
  5499. forward ac_OnPlayerLeaveCheckpoint(playerid);
  5500. #endif
  5501. #endif
  5502. #if defined _inc_y_hooks || defined _INC_y_hooks
  5503. hook OnPlayerRequestSpawn(playerid)
  5504. #else
  5505. public OnPlayerRequestSpawn(playerid)
  5506. #endif
  5507. {
  5508. if(ACInfo[playerid][acKicked]) return 0;
  5509. new ac_i = GetTickCount();
  5510. if(ACInfo[playerid][acACAllow][49])
  5511. {
  5512. if(ac_i < ACInfo[playerid][acCall][19] + ac_Mtfc[19][0]) return ac_FloodDetect(playerid, 19);
  5513. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5514. else ACInfo[playerid][acFloodCount][19] = ACInfo[playerid][acFloodCount][27] = 0;
  5515. }
  5516. ACInfo[playerid][acSpawnWeapon1] = ac_Class[ACInfo[playerid][acClassid]][0][0];
  5517. ACInfo[playerid][acSpawnAmmo1] = ac_Class[ACInfo[playerid][acClassid]][0][1];
  5518. ACInfo[playerid][acSpawnWeapon2] = ac_Class[ACInfo[playerid][acClassid]][1][0];
  5519. ACInfo[playerid][acSpawnAmmo2] = ac_Class[ACInfo[playerid][acClassid]][1][1];
  5520. ACInfo[playerid][acSpawnWeapon3] = ac_Class[ACInfo[playerid][acClassid]][2][0];
  5521. ACInfo[playerid][acSpawnAmmo3] = ac_Class[ACInfo[playerid][acClassid]][2][1];
  5522. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][19] = ac_i;
  5523. ac_i = 1;
  5524. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5525. && defined ac_OnPlayerRequestSpawn
  5526. ac_i = ac_OnPlayerRequestSpawn(playerid);
  5527. #endif
  5528. if(ac_i)
  5529. {
  5530. ACInfo[playerid][acSet][7] = 3;
  5531. ACInfo[playerid][acSpawnRes]++;
  5532. }
  5533. return ac_i;
  5534. }
  5535. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5536. #if defined _ALS_OnPlayerRequestSpawn
  5537. #undef OnPlayerRequestSpawn
  5538. #else
  5539. #define _ALS_OnPlayerRequestSpawn
  5540. #endif
  5541. #define OnPlayerRequestSpawn ac_OnPlayerRequestSpawn
  5542. #if defined ac_OnPlayerRequestSpawn
  5543. forward ac_OnPlayerRequestSpawn(playerid);
  5544. #endif
  5545. #endif
  5546. #if defined _inc_y_hooks || defined _INC_y_hooks
  5547. hook OnPlayerExitedMenu(playerid)
  5548. #else
  5549. public OnPlayerExitedMenu(playerid)
  5550. #endif
  5551. {
  5552. if(IsPlayerConnected(playerid) == 0 || ACInfo[playerid][acKicked]) return 0;
  5553. new ac_i = GetTickCount();
  5554. if(ACInfo[playerid][acACAllow][49])
  5555. {
  5556. if(ac_i < ACInfo[playerid][acCall][20] + ac_Mtfc[20][0]) ac_FloodDetect(playerid, 20);
  5557. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5558. else ACInfo[playerid][acFloodCount][20] = ACInfo[playerid][acFloodCount][27] = 0;
  5559. }
  5560. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][20] = ac_i;
  5561. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5562. && defined ac_OnPlayerExitedMenu
  5563. return ac_OnPlayerExitedMenu(playerid);
  5564. #else
  5565. return 1;
  5566. #endif
  5567. }
  5568. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5569. #if defined _ALS_OnPlayerExitedMenu
  5570. #undef OnPlayerExitedMenu
  5571. #else
  5572. #define _ALS_OnPlayerExitedMenu
  5573. #endif
  5574. #define OnPlayerExitedMenu ac_OnPlayerExitedMenu
  5575. #if defined ac_OnPlayerExitedMenu
  5576. forward ac_OnPlayerExitedMenu(playerid);
  5577. #endif
  5578. #endif
  5579. #if defined OnPlayerEnterDynamicRaceCP
  5580. #if defined _inc_y_hooks || defined _INC_y_hooks
  5581. #if defined STREAMER_ENABLE_TAGS
  5582. hook OnPlayerEnterDynRaceCP(playerid, STREAMER_TAG_RACE_CP checkpointid)
  5583. #else
  5584. hook OnPlayerEnterDynRaceCP(playerid, checkpointid)
  5585. #endif
  5586. #else
  5587. #if defined STREAMER_ENABLE_TAGS
  5588. public OnPlayerEnterDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP checkpointid)
  5589. #else
  5590. public OnPlayerEnterDynamicRaceCP(playerid, checkpointid)
  5591. #endif
  5592. #endif
  5593. {
  5594. if(ACInfo[playerid][acKicked]) return 0;
  5595. new ac_i = GetTickCount();
  5596. if(ACInfo[playerid][acACAllow][49])
  5597. {
  5598. if(ac_i < ACInfo[playerid][acCall][21] + ac_Mtfc[21][0]) ac_FloodDetect(playerid, 21);
  5599. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5600. else ACInfo[playerid][acFloodCount][21] = ACInfo[playerid][acFloodCount][27] = 0;
  5601. }
  5602. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][21] = ac_i;
  5603. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5604. && defined ac_OnPlayerEnterDynamicRaceCP
  5605. return ac_OnPlayerEnterDynamicRaceCP(playerid, checkpointid);
  5606. #else
  5607. return 1;
  5608. #endif
  5609. }
  5610. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5611. #if defined _ALS_OnPlayerEnterDynamicRaceCP
  5612. #undef OnPlayerEnterDynamicRaceCP
  5613. #else
  5614. #define _ALS_OnPlayerEnterDynamicRaceCP
  5615. #endif
  5616. #define OnPlayerEnterDynamicRaceCP ac_OnPlayerEnterDynamicRaceCP
  5617. #if defined ac_OnPlayerEnterDynamicRaceCP
  5618. #if defined STREAMER_ENABLE_TAGS
  5619. forward ac_OnPlayerEnterDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP checkpointid);
  5620. #else
  5621. forward ac_OnPlayerEnterDynamicRaceCP(playerid, checkpointid);
  5622. #endif
  5623. #endif
  5624. #endif
  5625. #endif
  5626. #if defined _inc_y_hooks || defined _INC_y_hooks
  5627. hook OnPlayerEnterRaceCP(playerid)
  5628. #else
  5629. public OnPlayerEnterRaceCheckpoint(playerid)
  5630. #endif
  5631. {
  5632. if(ACInfo[playerid][acKicked]) return 0;
  5633. new ac_i = GetTickCount();
  5634. if(ACInfo[playerid][acACAllow][49])
  5635. {
  5636. if(ac_i < ACInfo[playerid][acCall][21] + ac_Mtfc[21][0]) ac_FloodDetect(playerid, 21);
  5637. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5638. else ACInfo[playerid][acFloodCount][21] = ACInfo[playerid][acFloodCount][27] = 0;
  5639. }
  5640. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][21] = ac_i;
  5641. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5642. && defined ac_OnPlayerEnterRaceCheckpoint
  5643. return ac_OnPlayerEnterRaceCheckpoint(playerid);
  5644. #else
  5645. return 1;
  5646. #endif
  5647. }
  5648. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5649. #if defined _ALS_OnPlayerEnterRaceCheckpoin\
  5650. || defined _ALS_OnPlayerEnterRaceCP || defined _ALS_OnPlayer\
  5651. EnterRaceCheckpoint
  5652. #undef OnPlayerEnterRaceCheckpoint
  5653. #else
  5654. #define _ALS_OnPlayerEnterRaceCheckpoint
  5655. #endif
  5656. #define OnPlayerEnterRaceCheckpoint ac_OnPlayerEnterRaceCheckpoint
  5657. #if defined ac_OnPlayerEnterRaceCheckpoint
  5658. forward ac_OnPlayerEnterRaceCheckpoint(playerid);
  5659. #endif
  5660. #endif
  5661. #if defined OnPlayerLeaveDynamicRaceCP
  5662. #if defined _inc_y_hooks || defined _INC_y_hooks
  5663. #if defined STREAMER_ENABLE_TAGS
  5664. hook OnPlayerLeaveDynRaceCP(playerid, STREAMER_TAG_RACE_CP checkpointid)
  5665. #else
  5666. hook OnPlayerLeaveDynRaceCP(playerid, checkpointid)
  5667. #endif
  5668. #else
  5669. #if defined STREAMER_ENABLE_TAGS
  5670. public OnPlayerLeaveDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP checkpointid)
  5671. #else
  5672. public OnPlayerLeaveDynamicRaceCP(playerid, checkpointid)
  5673. #endif
  5674. #endif
  5675. {
  5676. if(ACInfo[playerid][acKicked]) return 0;
  5677. new ac_i = GetTickCount();
  5678. if(ACInfo[playerid][acACAllow][49])
  5679. {
  5680. if(ac_i < ACInfo[playerid][acCall][22] + ac_Mtfc[22][0]) ac_FloodDetect(playerid, 22);
  5681. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5682. else ACInfo[playerid][acFloodCount][22] = ACInfo[playerid][acFloodCount][27] = 0;
  5683. }
  5684. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][22] = ac_i;
  5685. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5686. && defined ac_OnPlayerLeaveDynamicRaceCP
  5687. return ac_OnPlayerLeaveDynamicRaceCP(playerid, checkpointid);
  5688. #else
  5689. return 1;
  5690. #endif
  5691. }
  5692. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5693. #if defined _ALS_OnPlayerLeaveDynamicRaceCP
  5694. #undef OnPlayerLeaveDynamicRaceCP
  5695. #else
  5696. #define _ALS_OnPlayerLeaveDynamicRaceCP
  5697. #endif
  5698. #define OnPlayerLeaveDynamicRaceCP ac_OnPlayerLeaveDynamicRaceCP
  5699. #if defined ac_OnPlayerLeaveDynamicRaceCP
  5700. #if defined STREAMER_ENABLE_TAGS
  5701. forward ac_OnPlayerLeaveDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP checkpointid);
  5702. #else
  5703. forward ac_OnPlayerLeaveDynamicRaceCP(playerid, checkpointid);
  5704. #endif
  5705. #endif
  5706. #endif
  5707. #endif
  5708. #if defined _inc_y_hooks || defined _INC_y_hooks
  5709. hook OnPlayerLeaveRaceCP(playerid)
  5710. #else
  5711. public OnPlayerLeaveRaceCheckpoint(playerid)
  5712. #endif
  5713. {
  5714. if(ACInfo[playerid][acKicked]) return 0;
  5715. new ac_i = GetTickCount();
  5716. if(ACInfo[playerid][acACAllow][49])
  5717. {
  5718. if(ac_i < ACInfo[playerid][acCall][22] + ac_Mtfc[22][0]) ac_FloodDetect(playerid, 22);
  5719. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5720. else ACInfo[playerid][acFloodCount][22] = ACInfo[playerid][acFloodCount][27] = 0;
  5721. }
  5722. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][22] = ac_i;
  5723. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5724. && defined ac_OnPlayerLeaveRaceCheckpoint
  5725. return ac_OnPlayerLeaveRaceCheckpoint(playerid);
  5726. #else
  5727. return 1;
  5728. #endif
  5729. }
  5730. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5731. #if defined _ALS_OnPlayerLeaveRaceCheckpoin\
  5732. || defined _ALS_OnPlayerLeaveRaceCP || defined _ALS_OnPlayer\
  5733. LeaveRaceCheckpoint
  5734. #undef OnPlayerLeaveRaceCheckpoint
  5735. #else
  5736. #define _ALS_OnPlayerLeaveRaceCheckpoint
  5737. #endif
  5738. #define OnPlayerLeaveRaceCheckpoint ac_OnPlayerLeaveRaceCheckpoint
  5739. #if defined ac_OnPlayerLeaveRaceCheckpoint
  5740. forward ac_OnPlayerLeaveRaceCheckpoint(playerid);
  5741. #endif
  5742. #endif
  5743. #if defined _inc_y_hooks || defined _INC_y_hooks
  5744. hook OnPlayerClickPlayerTD(playerid, PlayerText:playertextid)
  5745. #else
  5746. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  5747. #endif
  5748. {
  5749. if(ACInfo[playerid][acKicked]) return 1;
  5750. new ac_i = GetTickCount();
  5751. if(ACInfo[playerid][acACAllow][49])
  5752. {
  5753. if(ac_i < ACInfo[playerid][acCall][23] + ac_Mtfc[23][0])
  5754. {
  5755. ac_FloodDetect(playerid, 23);
  5756. return 1;
  5757. }
  5758. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5759. else ACInfo[playerid][acFloodCount][23] = ACInfo[playerid][acFloodCount][27] = 0;
  5760. }
  5761. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][23] = ac_i;
  5762. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5763. && defined ac_OnPlayerClickPlayerTextDraw
  5764. return ac_OnPlayerClickPlayerTextDraw(playerid, playertextid);
  5765. #else
  5766. return 0;
  5767. #endif
  5768. }
  5769. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5770. #if defined _ALS_OnPlayerClickPlayerTextDra\
  5771. || defined _ALS_OnPlayerClickPlayerTD || defined _ALS_OnPlayer\
  5772. ClickPlayerTextDraw
  5773. #undef OnPlayerClickPlayerTextDraw
  5774. #else
  5775. #define _ALS_OnPlayerClickPlayerTD
  5776. #endif
  5777. #define OnPlayerClickPlayerTextDraw ac_OnPlayerClickPlayerTextDraw
  5778. #if defined ac_OnPlayerClickPlayerTextDraw
  5779. forward ac_OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
  5780. #endif
  5781. #endif
  5782. #if defined _inc_y_hooks || defined _INC_y_hooks
  5783. hook OnVehDamageStatusUpd(vehicleid, playerid)
  5784. #else
  5785. public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  5786. #endif
  5787. {
  5788. if(ACInfo[playerid][acKicked]) return 0;
  5789. new ac_i = GetTickCount();
  5790. if(ACInfo[playerid][acACAllow][49])
  5791. {
  5792. if(ac_i < ACInfo[playerid][acCall][24] + ac_Mtfc[24][0]) ac_FloodDetect(playerid, 24);
  5793. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5794. else ACInfo[playerid][acFloodCount][24] = ACInfo[playerid][acFloodCount][27] = 0;
  5795. }
  5796. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][24] = ac_i;
  5797. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5798. && defined ac_OnVehicleDamageStatusUpdate
  5799. return ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
  5800. #else
  5801. return 1;
  5802. #endif
  5803. }
  5804. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5805. #if defined _ALS_OnVehicleDamageStatusUpdat\
  5806. || defined _ALS_OnVehicleDamageStatusUpd || defined _ALS_OnVehicle\
  5807. DamageStatusUpdate
  5808. #undef OnVehicleDamageStatusUpdate
  5809. #else
  5810. #define _ALS_OnVehicleDamageStatusUpdate
  5811. #endif
  5812. #define OnVehicleDamageStatusUpdate ac_OnVehicleDamageStatusUpdate
  5813. #if defined ac_OnVehicleDamageStatusUpdate
  5814. forward ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
  5815. #endif
  5816. #endif
  5817. #if defined _inc_y_hooks || defined _INC_y_hooks
  5818. hook OnVehicleSirenChange(playerid, vehicleid, newstate)
  5819. #else
  5820. public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
  5821. #endif
  5822. {
  5823. if(ACInfo[playerid][acKicked]) return 0;
  5824. new ac_i = GetTickCount();
  5825. if(ACInfo[playerid][acACAllow][49])
  5826. {
  5827. if(ac_i < ACInfo[playerid][acCall][25] + ac_Mtfc[25][0]) ac_FloodDetect(playerid, 25);
  5828. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5829. else ACInfo[playerid][acFloodCount][25] = ACInfo[playerid][acFloodCount][27] = 0;
  5830. }
  5831. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][25] = ac_i;
  5832. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5833. && defined ac_OnVehicleSirenStateChange
  5834. return ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  5835. #else
  5836. return 1;
  5837. #endif
  5838. }
  5839. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5840. #if defined _ALS_OnVehicleSirenStateChange
  5841. #undef OnVehicleSirenStateChange
  5842. #else
  5843. #define _ALS_OnVehicleSirenStateChange
  5844. #endif
  5845. #define OnVehicleSirenStateChange ac_OnVehicleSirenStateChange
  5846. #if defined ac_OnVehicleSirenStateChange
  5847. forward ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  5848. #endif
  5849. #endif
  5850. #if defined OnPlayerSelectDynamicObject
  5851. #if defined _inc_y_hooks || defined _INC_y_hooks
  5852. #if defined STREAMER_ENABLE_TAGS
  5853. hook OnPlayerSelectDynObj(playerid, STREAMER_TAG_OBJECT objectid, modelid, Float:x, Float:y, Float:z)
  5854. #else
  5855. hook OnPlayerSelectDynObj(playerid, objectid, modelid, Float:x, Float:y, Float:z)
  5856. #endif
  5857. #else
  5858. #if defined STREAMER_ENABLE_TAGS
  5859. public OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT objectid, modelid, Float:x, Float:y, Float:z)
  5860. #else
  5861. public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
  5862. #endif
  5863. #endif
  5864. {
  5865. if(ACInfo[playerid][acKicked]) return 0;
  5866. new ac_i = GetTickCount();
  5867. if(ACInfo[playerid][acACAllow][49])
  5868. {
  5869. if(ac_i < ACInfo[playerid][acCall][26] + ac_Mtfc[26][0]) ac_FloodDetect(playerid, 26);
  5870. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5871. else ACInfo[playerid][acFloodCount][26] = ACInfo[playerid][acFloodCount][27] = 0;
  5872. }
  5873. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][26] = ac_i;
  5874. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5875. && defined ac_OnPlayerSelectDynamicObject
  5876. return ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, x, y, z);
  5877. #else
  5878. return 1;
  5879. #endif
  5880. }
  5881. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5882. #if defined _ALS_OnPlayerSelectDynamicObjec\
  5883. || defined _ALS_OnPlayerSelectDynamicObj || defined _ALS_OnPlayer\
  5884. SelectDynamicObject
  5885. #undef OnPlayerSelectDynamicObject
  5886. #else
  5887. #define _ALS_OnPlayerSelectDynamicObject
  5888. #endif
  5889. #define OnPlayerSelectDynamicObject ac_OnPlayerSelectDynamicObject
  5890. #if defined ac_OnPlayerSelectDynamicObject
  5891. forward ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z);
  5892. #endif
  5893. #endif
  5894. #endif
  5895. #if defined _inc_y_hooks || defined _INC_y_hooks
  5896. hook OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
  5897. #else
  5898. public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
  5899. #endif
  5900. {
  5901. if(ACInfo[playerid][acKicked]) return 0;
  5902. new ac_i = GetTickCount();
  5903. if(ACInfo[playerid][acACAllow][49])
  5904. {
  5905. if(ac_i < ACInfo[playerid][acCall][26] + ac_Mtfc[26][0]) ac_FloodDetect(playerid, 26);
  5906. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5907. else ACInfo[playerid][acFloodCount][26] = ACInfo[playerid][acFloodCount][27] = 0;
  5908. }
  5909. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][26] = ac_i;
  5910. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5911. && defined ac_OnPlayerSelectObject
  5912. return ac_OnPlayerSelectObject(playerid, type, objectid, modelid, fX, fY, fZ);
  5913. #else
  5914. return 1;
  5915. #endif
  5916. }
  5917. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5918. #if defined _ALS_OnPlayerSelectObject
  5919. #undef OnPlayerSelectObject
  5920. #else
  5921. #define _ALS_OnPlayerSelectObject
  5922. #endif
  5923. #define OnPlayerSelectObject ac_OnPlayerSelectObject
  5924. #if defined ac_OnPlayerSelectObject
  5925. forward ac_OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ);
  5926. #endif
  5927. #endif
  5928. #if defined _inc_y_hooks || defined _INC_y_hooks
  5929. hook OnUnoccupiedVehicleUpd(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
  5930. #else
  5931. public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
  5932. #endif
  5933. {
  5934. if(ACInfo[playerid][acKicked]) return 0;
  5935. static Float:ac_X, Float:ac_Y, Float:ac_Z, Float:ac_D;
  5936. GetVehiclePos(vehicleid, ac_X, ac_Y, ac_Z);
  5937. ac_D = GetVehicleDistanceFromPoint(vehicleid, new_x, new_y, new_z);
  5938. if(passenger_seat > 0)
  5939. {
  5940. static Float:ac_zdiff;
  5941. ac_zdiff = new_z - ac_Z;
  5942. if(ACInfo[playerid][acACAllow][31] && (floatabs(vel_x) >= floatabs(ACVehInfo[vehicleid][acVelX]) > 0.3 ||
  5943. floatabs(vel_y) >= floatabs(ACVehInfo[vehicleid][acVelY]) > 0.3 || floatabs(vel_x - ACVehInfo[vehicleid][acVelX]) > 25.0 ||
  5944. floatabs(vel_y - ACVehInfo[vehicleid][acVelY]) > 25.0) && ac_zdiff > -5.0)
  5945. {
  5946. if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS)
  5947. {
  5948. #if defined DEBUG
  5949. printf("[Nex-AC debug] Vel x: %f, old vel x: %f, vel y: %f, old vel y: %f, pos diff z: %f, vehicleid: %d",
  5950. vel_x, ACVehInfo[vehicleid][acVelX], vel_y, ACVehInfo[vehicleid][acVelY], ac_zdiff, vehicleid);
  5951. #endif
  5952. #if defined OnCheatDetected
  5953. ac_KickWithCode(playerid, "", 0, 31);
  5954. ACInfo[playerid][acCheatCount][4] = 0;
  5955. #else
  5956. return ac_KickWithCode(playerid, "", 0, 31);
  5957. #endif
  5958. }
  5959. #undef AC_MAX_CARSHOT_WARNINGS
  5960. }
  5961. else if(ACInfo[playerid][acACAllow][8] && vel_z >= 0.1 && vel_z > ACVehInfo[vehicleid][acVelZ] &&
  5962. floatabs(ac_X - new_x) < ac_zdiff && floatabs(ac_Y - new_y) < ac_zdiff)
  5963. {
  5964. if(++ACInfo[playerid][acCheatCount][3] > AC_MAX_FLYHACK_VEH_WARNINGS)
  5965. {
  5966. #if defined DEBUG
  5967. printf("[Nex-AC debug] Vel z: %f, old vel z: %f, pos diff x: %f, pos diff y: %f, pos diff z: %f, vehicleid: %d",
  5968. vel_z, ACVehInfo[vehicleid][acVelZ], ac_X - new_x, ac_Y - new_y, ac_zdiff, vehicleid);
  5969. #endif
  5970. #if defined OnCheatDetected
  5971. ac_KickWithCode(playerid, "", 0, 8, 2);
  5972. ACInfo[playerid][acCheatCount][3] = 0;
  5973. #else
  5974. return ac_KickWithCode(playerid, "", 0, 8, 2);
  5975. #endif
  5976. }
  5977. #undef AC_MAX_FLYHACK_VEH_WARNINGS
  5978. }
  5979. else ACInfo[playerid][acCheatCount][4] =
  5980. ACInfo[playerid][acCheatCount][3] = 0;
  5981. }
  5982. if(ACInfo[playerid][acACAllow][5] && ac_D > 15.0 && ac_Z > -70.0 &&
  5983. ac_D > ACVehInfo[vehicleid][acPosDiff] + ((ac_D / 3) * 1.5))
  5984. {
  5985. #if defined DEBUG
  5986. printf("[Nex-AC debug] Distance: %f, old pos diff: %f, pos z: %f, vehicleid: %d",
  5987. ac_D, ACVehInfo[vehicleid][acPosDiff], ac_Z, vehicleid);
  5988. #endif
  5989. #if defined OnCheatDetected
  5990. ac_KickWithCode(playerid, "", 0, 5);
  5991. #endif
  5992. GetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  5993. SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  5994. SetVehiclePos(vehicleid, ac_X, ac_Y, ac_Z);
  5995. return 0;
  5996. }
  5997. static ac_a;
  5998. ac_a = 1;
  5999. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6000. && defined ac_OnUnoccupiedVehicleUpdate
  6001. ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, new_x, new_y, new_z, vel_x, vel_y, vel_z);
  6002. #endif
  6003. if(ac_a)
  6004. {
  6005. ACVehInfo[vehicleid][acSpeedDiff] = ac_GetSpeed(vel_x, vel_y, vel_z) - ac_GetSpeed(ACVehInfo[vehicleid][acVelX], ACVehInfo[vehicleid][acVelY], ACVehInfo[vehicleid][acVelZ]);
  6006. ACVehInfo[vehicleid][acPosDiff] = ac_D;
  6007. ACVehInfo[vehicleid][acVelX] = vel_x;
  6008. ACVehInfo[vehicleid][acVelY] = vel_y;
  6009. ACVehInfo[vehicleid][acVelZ] = vel_z;
  6010. }
  6011. return ac_a;
  6012. }
  6013. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6014. #if defined _ALS_OnUnoccupiedVehicleUpdate
  6015. #undef OnUnoccupiedVehicleUpdate
  6016. #else
  6017. #define _ALS_OnUnoccupiedVehicleUpdate
  6018. #endif
  6019. #define OnUnoccupiedVehicleUpdate ac_OnUnoccupiedVehicleUpdate
  6020. #if defined ac_OnUnoccupiedVehicleUpdate
  6021. 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);
  6022. #endif
  6023. #endif
  6024. #if defined _inc_y_hooks || defined _INC_y_hooks
  6025. hook OnPlayerEditAttachedObj(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
  6026. #else
  6027. 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)
  6028. #endif
  6029. {
  6030. if(ACInfo[playerid][acKicked]) return 0;
  6031. if(ACInfo[playerid][acACAllow][46] && 384 <= modelid <= 393)
  6032. {
  6033. #if defined DEBUG
  6034. printf("[Nex-AC debug] Object modelid: %d", modelid);
  6035. #endif
  6036. return ac_KickWithCode(playerid, "", 0, 46);
  6037. }
  6038. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6039. && defined ac_OnPlayerEditAttachedObject
  6040. return ac_OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
  6041. #else
  6042. return 1;
  6043. #endif
  6044. }
  6045. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6046. #if defined _ALS_OnPlayerEditAttachedObject
  6047. #undef OnPlayerEditAttachedObject
  6048. #else
  6049. #define _ALS_OnPlayerEditAttachedObject
  6050. #endif
  6051. #define OnPlayerEditAttachedObject ac_OnPlayerEditAttachedObject
  6052. #if defined ac_OnPlayerEditAttachedObject
  6053. 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);
  6054. #endif
  6055. #endif
  6056. ac_fpublic ac_Timer(playerid)
  6057. {
  6058. if(IsPlayerConnected(playerid) == 0 || ACInfo[playerid][acKicked]) return 0;
  6059. if(ACInfo[playerid][acACAllow][51] && NetStats_MessagesRecvPerSecond(playerid) > AC_MAX_MSGS_REC_DIFF)
  6060. {
  6061. #if defined DEBUG
  6062. printf("[Nex-AC debug] Max msgs per sec: %d, msgs per sec: %d",
  6063. AC_MAX_MSGS_REC_DIFF, NetStats_MessagesRecvPerSecond(playerid));
  6064. #endif
  6065. ac_KickWithCode(playerid, "", 0, 51);
  6066. }
  6067. #undef AC_MAX_MSGS_REC_DIFF
  6068. static ac_gpp;
  6069. ac_gpp = GetPlayerPing(playerid);
  6070. if(ACInfo[playerid][acACAllow][38])
  6071. {
  6072. if(ac_gpp > AC_MAX_PING && ac_gpp != 65535)
  6073. {
  6074. if(++ACInfo[playerid][acCheatCount][0] > AC_MAX_PING_WARNINGS)
  6075. {
  6076. #if defined DEBUG
  6077. printf("[Nex-AC debug] Max ping: %d, ping: %d", AC_MAX_PING, ac_gpp);
  6078. #endif
  6079. ac_KickWithCode(playerid, "", 0, 38);
  6080. #if defined OnCheatDetected
  6081. ACInfo[playerid][acCheatCount][0] = 0;
  6082. #endif
  6083. }
  6084. #undef AC_MAX_PING_WARNINGS
  6085. }
  6086. else ACInfo[playerid][acCheatCount][0] = 0;
  6087. }
  6088. ac_gpp += 150;
  6089. static ac_gtc, bool:ac_ur;
  6090. ac_gtc = GetTickCount();
  6091. ac_ur = false;
  6092. if(ACInfo[playerid][acDead] == false && ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp &&
  6093. ac_gtc < ACInfo[playerid][acLastUpdate] + 1500)
  6094. {
  6095. for(new ac_i, ac_w, ac_a, bool:ac_cw, ac_s = ac_wSlot[GetPlayerWeapon(playerid)]; ac_i < 13; ++ac_i)
  6096. {
  6097. GetPlayerWeaponData(playerid, ac_i, ac_w, ac_a);
  6098. if(ac_w == 39) ac_cw = true;
  6099. if(ac_s != ac_i)
  6100. {
  6101. if(ACInfo[playerid][acSetWeapon][ac_i] != -1)
  6102. {
  6103. if(ACInfo[playerid][acSetWeapon][ac_i] == ac_w)
  6104. {
  6105. ACInfo[playerid][acSetWeapon][ac_i] = -1;
  6106. ACInfo[playerid][acWeapon][ac_i] = ac_w;
  6107. }
  6108. else if(ACInfo[playerid][acACAllow][52] &&
  6109. ac_gtc > ACInfo[playerid][acGtcSetWeapon][ac_i] + ac_gpp &&
  6110. ++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_WARNINGS)
  6111. {
  6112. #if defined DEBUG
  6113. printf(DEBUG_CODE_5, playerid, "GivePlayerWeapon");
  6114. printf("[Nex-AC debug] AC weapon: %d, weaponid: %d", ACInfo[playerid][acSetWeapon][ac_i], ac_w);
  6115. #endif
  6116. ac_KickWithCode(playerid, "", 0, 52, 13);
  6117. #if defined OnCheatDetected
  6118. ACInfo[playerid][acSetWeapon][ac_i] = -1;
  6119. #endif
  6120. }
  6121. }
  6122. else
  6123. {
  6124. if(ACInfo[playerid][acWeapon][ac_i] != ac_w)
  6125. {
  6126. if(ac_w == 0 || ac_w == 40 && ac_cw || ac_w == 46 &&
  6127. ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute])
  6128. {
  6129. ACInfo[playerid][acWeapon][ac_i] = ac_w;
  6130. ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6131. }
  6132. else if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS &&
  6133. ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  6134. ac_a <= (3 <= ac_i <= 5 ? ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
  6135. IsPlayerInRangeOfPoint(playerid, 8.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  6136. ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]))
  6137. {
  6138. ACInfo[playerid][acWeapon][ac_i] = ac_w;
  6139. ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6140. }
  6141. else if(ACInfo[playerid][acLastPickup] > MAX_PICKUPS &&
  6142. ACDPickInfo[ACInfo[playerid][acLastPickup] - MAX_PICKUPS][acWeapon] == ac_w &&
  6143. ac_a <= (3 <= ac_i <= 5 ? ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
  6144. IsPlayerInRangeOfPoint(playerid, 8.0, ACDPickInfo[ACInfo[playerid][acLastPickup] - MAX_PICKUPS][acPosX],
  6145. ACDPickInfo[ACInfo[playerid][acLastPickup] - MAX_PICKUPS][acPosY],
  6146. ACDPickInfo[ACInfo[playerid][acLastPickup] - MAX_PICKUPS][acPosZ]))
  6147. {
  6148. ACInfo[playerid][acWeapon][ac_i] = ac_w;
  6149. ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6150. }
  6151. else if(ACInfo[playerid][acACAllow][15] && !(16 <= ac_w <= 43 && ac_a == 0))
  6152. {
  6153. #if defined DEBUG
  6154. printf("[Nex-AC debug] Weaponid: %d, ammo: %d", ac_w, ac_a);
  6155. #endif
  6156. ac_KickWithCode(playerid, "", 0, 15, 2);
  6157. #if defined OnCheatDetected
  6158. ACInfo[playerid][acWeapon][ac_i] = ac_w;
  6159. ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6160. #endif
  6161. }
  6162. }
  6163. if(ACInfo[playerid][acGiveAmmo][ac_i] != -65535)
  6164. {
  6165. if(ACInfo[playerid][acGiveAmmo][ac_i] >= ac_a)
  6166. {
  6167. ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  6168. ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6169. }
  6170. else if(ACInfo[playerid][acACAllow][52] &&
  6171. ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_i] + ac_gpp)
  6172. {
  6173. if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_WARNINGS)
  6174. {
  6175. #undef AC_MAX_NOP_WARNINGS
  6176. #if defined DEBUG
  6177. printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
  6178. printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  6179. ACInfo[playerid][acGiveAmmo][ac_i], ac_a, ac_w);
  6180. #endif
  6181. ac_KickWithCode(playerid, "", 0, 52, 14);
  6182. #if defined OnCheatDetected
  6183. ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  6184. #endif
  6185. }
  6186. }
  6187. }
  6188. if(16 <= ac_w <= 43)
  6189. {
  6190. if(ac_a == 0) ACInfo[playerid][acAmmo][ac_i] = 0;
  6191. else if(ACInfo[playerid][acACAllow][16] &&
  6192. (ac_w != 40 && ac_a > ACInfo[playerid][acAmmo][ac_i] || ACInfo[playerid][acAmmo][ac_i] == 0 &&
  6193. ac_a > ACInfo[playerid][acAmmo][ac_i] && ACInfo[playerid][acWeapon][8] != 39))
  6194. {
  6195. #if defined DEBUG
  6196. printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  6197. ACInfo[playerid][acAmmo][ac_i], ac_a, ac_w);
  6198. #endif
  6199. ac_KickWithCode(playerid, "", 0, 16, 2);
  6200. #if defined OnCheatDetected
  6201. ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6202. #endif
  6203. }
  6204. }
  6205. }
  6206. }
  6207. else if(22 <= ac_w <= 32 || 41 <= ac_w <= 42 || ac_LagCompMode == false && (16 <= ac_w <= 39 || ac_w == 43))
  6208. {
  6209. if(ACInfo[playerid][acACAllow][16] &&
  6210. ac_a > ACInfo[playerid][acAmmo][ac_i] && ACInfo[playerid][acGiveAmmo][ac_i] == -65535)
  6211. {
  6212. #if AC_USE_AMMUNATIONS
  6213. if(22 <= ac_w <= 32 && ac_ur == false && ac_InAmmuNation(playerid, GetPlayerInterior(playerid)) &&
  6214. ac_AmmuNationInfo[ac_w - 22][1] == ac_abs(ac_a - ACInfo[playerid][acAmmo][ac_i]))
  6215. {
  6216. if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 22][0];
  6217. else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 22][0];
  6218. ACInfo[playerid][acAmmo][ac_i] += ac_AmmuNationInfo[ac_w - 22][1];
  6219. ACInfo[playerid][acCheatCount][10] = 0;
  6220. ac_ur = true;
  6221. }
  6222. else
  6223. {
  6224. #endif
  6225. if(ac_LagCompMode == false)
  6226. {
  6227. #if defined DEBUG
  6228. printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  6229. ACInfo[playerid][acAmmo][ac_i], ac_a, ac_w);
  6230. #endif
  6231. ac_KickWithCode(playerid, "", 0, 16, 3);
  6232. #if defined OnCheatDetected
  6233. ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6234. #endif
  6235. }
  6236. #if AC_USE_AMMUNATIONS
  6237. }
  6238. #endif
  6239. #undef ac_abs
  6240. }
  6241. else if(ACInfo[playerid][acAmmo][ac_i]) ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6242. }
  6243. }
  6244. }
  6245. ACInfo[playerid][acCheatCount][1] = ACInfo[playerid][acCheatCount][2] = 0;
  6246. if(ac_ur) ACInfo[playerid][acGtc][15] = ac_gtc + 1030;
  6247. ACInfo[playerid][acTimerID] = SetTimerEx("ac_Timer", 1000, false, "i", playerid);
  6248. return 1;
  6249. }
  6250. ac_fpublic ac_OnCheatDetected(playerid, ip_address[], type, code)
  6251. {
  6252. if(type) BlockIpAddress(ip_address, 0);
  6253. else
  6254. {
  6255. switch(code)
  6256. {
  6257. case 40: SendClientMessage(playerid, AC_DEFAULT_COLOR, MAX_CONNECTS_MSG);
  6258. case 41: SendClientMessage(playerid, AC_DEFAULT_COLOR, UNKNOWN_CLIENT_MSG);
  6259. default:
  6260. {
  6261. static ac_strtmp[sizeof KICK_MSG];
  6262. format(ac_strtmp, sizeof ac_strtmp, KICK_MSG, code);
  6263. SendClientMessage(playerid, AC_DEFAULT_COLOR, ac_strtmp);
  6264. #undef AC_DEFAULT_COLOR
  6265. }
  6266. }
  6267. new ac_vehid = GetPlayerVehicleID(playerid), ac_pping = GetPlayerPing(playerid) + 150;
  6268. SetTimerEx("ac_KickTimer", (ac_pping > AC_MAX_PING ? AC_MAX_PING : ac_pping), false, "i", playerid);
  6269. #undef AC_MAX_PING
  6270. if(ac_vehid > 0)
  6271. {
  6272. if(code == 4) ACInfo[playerid][acLastVeh] = ac_vehid;
  6273. ACInfo[playerid][acKicked] = 2;
  6274. }
  6275. else ACInfo[playerid][acKicked] = 1;
  6276. }
  6277. return 1;
  6278. }
  6279. ac_fpublic ac_KickTimer(playerid) return Kick(playerid);
  6280. #undef ac_fpublic
  6281. stock AntiCheatGetHealth(playerid, &Float:achealth)
  6282. {
  6283. if(IsPlayerConnected(playerid) == 0) return 0;
  6284. achealth = ACInfo[playerid][acHealth];
  6285. return 1;
  6286. }
  6287. stock AntiCheatGetArmour(playerid, &Float:acarmour)
  6288. {
  6289. if(IsPlayerConnected(playerid) == 0) return 0;
  6290. acarmour = ACInfo[playerid][acArmour];
  6291. return 1;
  6292. }
  6293. stock AntiCheatGetVehicleHealth(vehicleid, &Float:achealth)
  6294. {
  6295. if(GetVehicleModel(vehicleid) == 0) return 0;
  6296. achealth = ACVehInfo[vehicleid][acHealth];
  6297. return 1;
  6298. }
  6299. stock AntiCheatGetWeaponData(playerid, acslot, &acweapons, &acammo)
  6300. {
  6301. if(IsPlayerConnected(playerid) == 0) return 0;
  6302. acweapons = ACInfo[playerid][acWeapon][acslot];
  6303. acammo = ACInfo[playerid][acAmmo][acslot];
  6304. return 1;
  6305. }
  6306. stock AntiCheatGetSpawnWeapon(playerid, &acweapon1, &acweapon1_ammo, &acweapon2, &acweapon2_ammo, &acweapon3, &acweapon3_ammo)
  6307. {
  6308. if(IsPlayerConnected(playerid) == 0) return 0;
  6309. acweapon1 = ACInfo[playerid][acSpawnWeapon1];
  6310. acweapon1_ammo = ACInfo[playerid][acSpawnAmmo1];
  6311. acweapon2 = ACInfo[playerid][acSpawnWeapon2];
  6312. acweapon2_ammo = ACInfo[playerid][acSpawnAmmo2];
  6313. acweapon3 = ACInfo[playerid][acSpawnWeapon3];
  6314. acweapon3_ammo = ACInfo[playerid][acSpawnAmmo3];
  6315. return 1;
  6316. }
  6317. stock AntiCheatGetPos(playerid, &Float:acx, &Float:acy, &Float:acz)
  6318. {
  6319. if(IsPlayerConnected(playerid) == 0) return 0;
  6320. acx = ACInfo[playerid][acPosX];
  6321. acy = ACInfo[playerid][acPosY];
  6322. acz = ACInfo[playerid][acPosZ];
  6323. return 1;
  6324. }
  6325. stock AntiCheatGetSpeed(playerid, &Float:acspeed)
  6326. {
  6327. if(IsPlayerConnected(playerid) == 0) return 0;
  6328. acspeed = ACInfo[playerid][acSpeed];
  6329. return 1;
  6330. }
  6331. stock AntiCheatGetVehicleVelocity(vehicleid, &Float:acx, &Float:acy, &Float:acz)
  6332. {
  6333. if(GetVehicleModel(vehicleid) == 0) return 0;
  6334. acx = ACVehInfo[vehicleid][acVelX];
  6335. acy = ACVehInfo[vehicleid][acVelY];
  6336. acz = ACVehInfo[vehicleid][acVelZ];
  6337. return 1;
  6338. }
  6339. static ac_GetSpeed(Float:acX, Float:acY, Float:acZ, bool:speed3d = true)
  6340. {
  6341. if(speed3d) return floatround(VectorSize(acX, acY, acZ) * 179.28625);
  6342. return floatround(VectorSize(acX, acY, 0.0) * 179.28625);
  6343. }
  6344. static ac_IsVehicleSeatOccupied(vehicleid, seat)
  6345. {
  6346. #if defined foreach
  6347. foreach(new ac_i : Player)
  6348. #else
  6349. for(new ac_i = GetPlayerPoolSize(); ac_i > -1; --ac_i)
  6350. {
  6351. if(IsPlayerConnected(ac_i))
  6352. #endif
  6353. {
  6354. if(ACInfo[ac_i][acVeh] == vehicleid && ACInfo[ac_i][acSeat] == seat) return 1;
  6355. }
  6356. #if !defined foreach
  6357. }
  6358. #endif
  6359. return 0;
  6360. }
  6361. static stock ac_InRestaurant(playerid, interiorid)
  6362. {
  6363. #if AC_USE_RESTAURANTS
  6364. new ac_i;
  6365. switch(interiorid)
  6366. {
  6367. case 5: ac_i = 0;
  6368. case 9: ac_i = 1;
  6369. case 10: ac_i = 2;
  6370. default: return 0;
  6371. }
  6372. return IsPlayerInRangeOfPoint(playerid, 3.0, ac_Restaurants[ac_i][0], ac_Restaurants[ac_i][1], ac_Restaurants[ac_i][2]);
  6373. #else
  6374. #pragma unused playerid, interiorid
  6375. return 0;
  6376. #endif
  6377. #undef AC_USE_RESTAURANTS
  6378. }
  6379. static stock ac_InAmmuNation(playerid, interiorid)
  6380. {
  6381. #if AC_USE_AMMUNATIONS
  6382. new ac_i, ac_s;
  6383. switch(interiorid)
  6384. {
  6385. case 1: ac_i = 0, ac_s = -1;
  6386. case 4: ac_i = 1, ac_s = 0;
  6387. case 6: ac_i = 3, ac_s = 1;
  6388. default: return 0;
  6389. }
  6390. for(; ac_i > ac_s; --ac_i)
  6391. {
  6392. if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[ac_i][0],
  6393. ac_AmmuNations[ac_i][1], ac_AmmuNations[ac_i][2])) return 1;
  6394. }
  6395. #else
  6396. #pragma unused playerid, interiorid
  6397. #endif
  6398. #undef AC_USE_AMMUNATIONS
  6399. return 0;
  6400. }
  6401. static stock ac_InPayNSpray(playerid, interiorid)
  6402. {
  6403. #if AC_USE_PAYNSPRAY
  6404. if(interiorid == 0)
  6405. {
  6406. for(new ac_i = sizeof(ac_PayNSpray) - 1; ac_i > -1; --ac_i)
  6407. {
  6408. if(IsPlayerInRangeOfPoint(playerid, 7.5, ac_PayNSpray[ac_i][0],
  6409. ac_PayNSpray[ac_i][1], ac_PayNSpray[ac_i][2])) return 1;
  6410. }
  6411. }
  6412. #else
  6413. #pragma unused playerid, interiorid
  6414. #endif
  6415. #undef AC_USE_PAYNSPRAY
  6416. return 0;
  6417. }
  6418. static stock ac_NearVendingMachine(playerid, interiorid)
  6419. {
  6420. #if AC_USE_VENDING_MACHINES
  6421. new ac_i, ac_s;
  6422. switch(interiorid)
  6423. {
  6424. case 0: ac_i = 44, ac_s = -1;
  6425. case 1: ac_i = 51, ac_s = 44;
  6426. case 2: ac_i = 52, ac_s = 51;
  6427. case 3: ac_i = 58, ac_s = 52;
  6428. case 6: ac_i = 60, ac_s = 58;
  6429. case 7: ac_i = 61, ac_s = 60;
  6430. case 15: ac_i = 62, ac_s = 61;
  6431. case 16: ac_i = 65, ac_s = 62;
  6432. case 17: ac_i = 72, ac_s = 65;
  6433. case 18: ac_i = 74, ac_s = 72;
  6434. default: return 0;
  6435. }
  6436. for(; ac_i > ac_s; --ac_i)
  6437. {
  6438. if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[ac_i][0],
  6439. ac_vMachines[ac_i][1], ac_vMachines[ac_i][2])) return 1;
  6440. }
  6441. #else
  6442. #pragma unused playerid, interiorid
  6443. #endif
  6444. #undef AC_USE_VENDING_MACHINES
  6445. return 0;
  6446. }
  6447. static stock ac_InCasino(playerid, interiorid)
  6448. {
  6449. #if AC_USE_CASINOS
  6450. new ac_i, ac_s;
  6451. switch(interiorid)
  6452. {
  6453. case 1: ac_i = 41, ac_s = -1;
  6454. case 10: ac_i = 61, ac_s = 41;
  6455. case 12: ac_i = 70, ac_s = 61;
  6456. default: return 0;
  6457. }
  6458. for(; ac_i > ac_s; --ac_i)
  6459. {
  6460. if(IsPlayerInRangeOfPoint(playerid, ac_Casinos[ac_i][3], ac_Casinos[ac_i][0],
  6461. ac_Casinos[ac_i][1], ac_Casinos[ac_i][2])) return 1;
  6462. }
  6463. #else
  6464. #pragma unused playerid, interiorid
  6465. #endif
  6466. #undef AC_USE_CASINOS
  6467. return 0;
  6468. }
  6469. static ac_IsCompatible(modelid, componentid)
  6470. {
  6471. if(modelid > 0)
  6472. {
  6473. switch(componentid)
  6474. {
  6475. case 1000..1191:
  6476. {
  6477. componentid -= 1000;
  6478. if(ac_vMods[(modelid - 400) * 6 + (componentid >>> 5)] & 1 << (componentid & 0b00011111)) return 1;
  6479. }
  6480. case 1192, 1193:
  6481. {
  6482. if(modelid == 576) return 1;
  6483. }
  6484. }
  6485. }
  6486. return 0;
  6487. }
  6488. static ac_IpToInt(const s_szIP[])
  6489. {
  6490. new ac_aiBytes[1], ac_iPos;
  6491. ac_aiBytes{0} = strval(s_szIP[ac_iPos]);
  6492. while(ac_iPos < 15 && s_szIP[ac_iPos++] != '.'){}
  6493. ac_aiBytes{1} = strval(s_szIP[ac_iPos]);
  6494. while(ac_iPos < 15 && s_szIP[ac_iPos++] != '.'){}
  6495. ac_aiBytes{2} = strval(s_szIP[ac_iPos]);
  6496. while(ac_iPos < 15 && s_szIP[ac_iPos++] != '.'){}
  6497. ac_aiBytes{3} = strval(s_szIP[ac_iPos]);
  6498. return ac_aiBytes[0];
  6499. }
  6500. static ac_FloodDetect(playerid, publicid)
  6501. {
  6502. if(ACInfo[playerid][acKicked] == 0)
  6503. {
  6504. if(++ACInfo[playerid][acFloodCount][publicid] > ac_Mtfc[publicid][1])
  6505. {
  6506. #if defined DEBUG
  6507. printf(DEBUG_CODE_1, playerid, ac_Mtfc[publicid][1], publicid);
  6508. #undef DEBUG
  6509. #endif
  6510. #if defined OnCheatDetected
  6511. ac_KickWithCode(playerid, "", 0, 49, publicid);
  6512. ACInfo[playerid][acFloodCount][publicid] = ACInfo[playerid][acFloodCount][27] = 0;
  6513. #else
  6514. return ac_KickWithCode(playerid, "", 0, 49, publicid);
  6515. #endif
  6516. }
  6517. ACInfo[playerid][acCall][publicid] = ACInfo[playerid][acCall][27] = GetTickCount();
  6518. }
  6519. return 0;
  6520. }
  6521. static ac_KickWithCode(playerid, ip_address[], type, code, code2 = 0)
  6522. {
  6523. if(type == 0 && (IsPlayerConnected(playerid) == 0 || ACInfo[playerid][acKicked]) ||
  6524. !(0 <= code < sizeof ac_ACAllow)) return 0;
  6525. ac_sInfo[5]++;
  6526. switch(code)
  6527. {
  6528. case 0..35, 37, 39, 51: ac_sInfo[0]++;
  6529. case 36, 38, 40, 41, 50: ac_sInfo[4]++;
  6530. case 42: ac_sInfo[1]++;
  6531. case 47..49: ac_sInfo[3]++;
  6532. case 43..46: ac_sInfo[2]++;
  6533. }
  6534. static ac_strtmp[6];
  6535. ac_strtmp[0] = EOS;
  6536. if(code2) format(ac_strtmp, sizeof ac_strtmp, " (%d)", code2);
  6537. if(type) printf(SUSPICION_2, ip_address, code, ac_strtmp);
  6538. else printf(SUSPICION_1, playerid, code, ac_strtmp);
  6539. #if defined OnCheatDetected
  6540. OnCheatDetected(playerid, ip_address, type, code);
  6541. #else
  6542. ac_OnCheatDetected(playerid, ip_address, type, code);
  6543. #endif
  6544. return 0;
  6545. }
  6546. static ac_LoadCfg()
  6547. {
  6548. new ac_i, File:ac_cfgFile;
  6549. static ac_string[415], ac_strtmp[9];
  6550. ac_string[0] = EOS;
  6551. if(fexist(AC_CONFIG_FILE))
  6552. {
  6553. if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_read)))
  6554. {
  6555. #if defined sscanf
  6556. new ac_j;
  6557. #endif
  6558. while(fread(ac_cfgFile, ac_string) > 0)
  6559. {
  6560. #if defined sscanf
  6561. sscanf(ac_string, "i'//'i", ac_j, ac_i);
  6562. ac_ACAllow[ac_i] = !!ac_j;
  6563. #else
  6564. if((ac_i = strfind(ac_string, "//")) != -1)
  6565. {
  6566. strmid(ac_strtmp, ac_string, ac_i + 2, strlen(ac_string));
  6567. if(0 <= (ac_i = strval(ac_strtmp)) < sizeof ac_ACAllow) ac_ACAllow[ac_i] = !!strval(ac_string);
  6568. }
  6569. #endif
  6570. }
  6571. fclose(ac_cfgFile);
  6572. }
  6573. else return 0;
  6574. }
  6575. else if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_write)))
  6576. {
  6577. #undef AC_CONFIG_FILE
  6578. for(; ac_i < sizeof ac_ACAllow; ++ac_i)
  6579. {
  6580. format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_ACAllow[ac_i], ac_i);
  6581. strcat(ac_string, ac_strtmp);
  6582. }
  6583. fwrite(ac_cfgFile, ac_string);
  6584. fclose(ac_cfgFile);
  6585. }
  6586. else return 0;
  6587. return 1;
  6588. }
  6589. #endif