1
0

nex-ac.inc 236 KB

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