callbacks.pwn 231 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. //--------------------------------[CALLBACKS.PWN]--------------------------------
  11. * Copyright (c) 2016, Next Generation Gaming, LLC
  12. *
  13. * All rights reserved.
  14. *
  15. * Redistribution and use in source and binary forms, with or without modification,
  16. * are not permitted in any case.
  17. *
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  22. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  23. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  24. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  25. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  26. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  27. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  28. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  29. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. //====================[Official SA:MP/Streamer Callbacks]============================
  32. public OnVehicleSpawn(vehicleid) {
  33. new Float:X, Float:Y, Float:Z;
  34. new Float:XB, Float:YB, Float:ZB;
  35. if(DynVeh[vehicleid] != -1)
  36. {
  37. DynVeh_Spawn(DynVeh[vehicleid]);
  38. }
  39. TruckContents{vehicleid} = 0;
  40. Vehicle_ResetData(vehicleid);
  41. new
  42. v;
  43. foreach(new i: Player)
  44. {
  45. if((v = GetPlayerVehicle(i, vehicleid)) != -1) {
  46. DestroyVehicle(vehicleid);
  47. new
  48. iVehicleID = CreateVehicle(PlayerVehicleInfo[i][v][pvModelId], PlayerVehicleInfo[i][v][pvPosX], PlayerVehicleInfo[i][v][pvPosY], PlayerVehicleInfo[i][v][pvPosZ], PlayerVehicleInfo[i][v][pvPosAngle],PlayerVehicleInfo[i][v][pvColor1], PlayerVehicleInfo[i][v][pvColor2], -1);
  49. SetVehicleVirtualWorld(iVehicleID, PlayerVehicleInfo[i][v][pvVW]);
  50. LinkVehicleToInterior(iVehicleID, PlayerVehicleInfo[i][v][pvInt]);
  51. switch(GetVehicleModel(iVehicleID)) {
  52. case 519, 553, 508: {
  53. iVehEnterAreaID[iVehicleID] = CreateDynamicSphere(PlayerVehicleInfo[i][v][pvPosX]+3.5, PlayerVehicleInfo[i][v][pvPosY], PlayerVehicleInfo[i][v][pvPosZ], 4, GetVehicleVirtualWorld(iVehicleID));
  54. AttachDynamicAreaToVehicle(iVehEnterAreaID[iVehicleID], iVehicleID);
  55. Streamer_SetIntData(STREAMER_TYPE_AREA, iVehEnterAreaID[iVehicleID], E_STREAMER_EXTRA_ID, iVehicleID);
  56. }
  57. }
  58. PlayerVehicleInfo[i][v][pvId] = iVehicleID;
  59. Vehicle_ResetData(iVehicleID);
  60. if(!isnull(PlayerVehicleInfo[i][v][pvPlate])) {
  61. SetVehicleNumberPlate(iVehicleID, PlayerVehicleInfo[i][v][pvPlate]);
  62. }
  63. if(PlayerVehicleInfo[i][v][pvLocked] == 1) LockPlayerVehicle(i, iVehicleID, PlayerVehicleInfo[i][v][pvLock]);
  64. ChangeVehiclePaintjob(iVehicleID, PlayerVehicleInfo[i][v][pvPaintJob]);
  65. ChangeVehicleColor(iVehicleID, PlayerVehicleInfo[i][v][pvColor1], PlayerVehicleInfo[i][v][pvColor2]);
  66. for(new m = 0; m < MAX_MODS; m++)
  67. {
  68. if (PlayerVehicleInfo[i][v][pvMods][m] >= 1000 && PlayerVehicleInfo[i][v][pvMods][m] <= 1193)
  69. {
  70. if (InvalidModCheck(PlayerVehicleInfo[i][v][pvModelId], PlayerVehicleInfo[i][v][pvMods][m]))
  71. {
  72. AddVehicleComponent(iVehicleID, PlayerVehicleInfo[i][v][pvMods][m]);
  73. }
  74. else
  75. {
  76. PlayerVehicleInfo[i][v][pvMods][m] = 0;
  77. }
  78. }
  79. }
  80. new zyear, zmonth, zday;
  81. getdate(zyear, zmonth, zday);
  82. if(zombieevent || (zmonth == 10 && zday == 31) || (zmonth == 11 && zday == 1)) SetVehicleHealth(iVehicleID, PlayerVehicleInfo[i][v][pvHealth]);
  83. new string[128];
  84. format(string, sizeof(string), "Your %s has been sent to the location at which you last parked it.", GetVehicleName(iVehicleID));
  85. SendClientMessageEx(i, COLOR_GRAD1, string);
  86. }
  87. }
  88. // Make sure no one is in the vehicle window if plane.
  89. foreach(new i: Player)
  90. {
  91. if(InsidePlane[i] == vehicleid)
  92. {
  93. TogglePlayerSpectating(i, 0);
  94. GetVehiclePos(InsidePlane[i], X, Y, Z);
  95. SetPlayerPos(i, X-4, Y-2.3, Z);
  96. GetVehiclePos(InsidePlane[i], XB, YB, ZB);
  97. if(ZB > 50.0)
  98. {
  99. PlayerInfo[i][pAGuns][GetWeaponSlot(46)] = 46;
  100. GivePlayerValidWeapon(i, 46);
  101. }
  102. PlayerInfo[i][pVW] = 0;
  103. SetPlayerVirtualWorld(i, 0);
  104. PlayerInfo[i][pInt] = 0;
  105. SetPlayerInterior(i, 0);
  106. InsidePlane[i] = INVALID_VEHICLE_ID;
  107. SendClientMessageEx(i, COLOR_WHITE, "The airplane has been damaged, you cannot be inside it!");
  108. }
  109. }
  110. }
  111. public OnVehicleMod(playerid, vehicleid, componentid)
  112. {
  113. for(new i = 0; i < sizeof(IsRim); i++)
  114. {
  115. if(IsRim[i] == componentid)
  116. {
  117. if(!legalRims(playerid, componentid, vehicleid))
  118. {
  119. if(HackingMods[playerid] < 3)
  120. {
  121. new szMessage[128];
  122. format(szMessage, sizeof(szMessage), "{AA3333}AdmWarning{FFFF00}: %s (ID: %d) may be hacking vehicle mods (%s (%d) %s to a %s (ID: %d))", GetPlayerNameEx(playerid), playerid, partName(componentid), componentid, partType(GetVehicleComponentType(componentid)), GetVehicleName(vehicleid), GetPlayerVehicleID(playerid));
  123. ABroadCast(COLOR_YELLOW, szMessage, 2);
  124. format(szMessage, sizeof(szMessage), "%s(%d) may be hacking vehicle mods (%s (%d) %s to a %s (ID: %d))", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), partName(componentid), componentid, partType(GetVehicleComponentType(componentid)), GetVehicleName(vehicleid), GetPlayerVehicleID(playerid));
  125. Log("logs/hack.log", szMessage);
  126. HackingMods[playerid]++;
  127. return 0;
  128. }
  129. else if(HackingMods[playerid] == 3)
  130. {
  131. CreateBan(INVALID_PLAYER_ID, PlayerInfo[playerid][pId], playerid, PlayerInfo[playerid][pIP], "Hacking Vehicle Mods", 180);
  132. HackingMods[playerid] = 0;
  133. Kick(playerid);
  134. TotalAutoBan++;
  135. return 0;
  136. }
  137. }
  138. }
  139. }
  140. if(!(1 <= GetPlayerInterior(playerid) <= 3) && !GetPVarType(playerid, "unMod")) {
  141. new
  142. szMessage[128];
  143. if(HackingMods[playerid] < 3)
  144. {
  145. format(szMessage, sizeof(szMessage), "{AA3333}AdmWarning{FFFF00}: %s (ID: %d) may be hacking vehicle mods (%s (%d) %s to a %s (ID: %d))", GetPlayerNameEx(playerid), playerid, partName(componentid), componentid, partType(GetVehicleComponentType(componentid)), GetVehicleName(vehicleid), GetPlayerVehicleID(playerid));
  146. ABroadCast(COLOR_YELLOW, szMessage, 2);
  147. format(szMessage, sizeof(szMessage), "%s(%d) may be hacking vehicle mods (%s (%d) %s to a %s (ID: %d))", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), partName(componentid), componentid, partType(GetVehicleComponentType(componentid)), GetVehicleName(vehicleid), GetPlayerVehicleID(playerid));
  148. Log("logs/hack.log", szMessage);
  149. HackingMods[playerid]++;
  150. return 0;
  151. }
  152. else if(HackingMods[playerid] == 3)
  153. {
  154. CreateBan(INVALID_PLAYER_ID, PlayerInfo[playerid][pId], playerid, PlayerInfo[playerid][pIP], "Hacking Vehicle Mods", 180);
  155. HackingMods[playerid] = 0;
  156. Kick(playerid);
  157. TotalAutoBan++;
  158. return 0;
  159. }
  160. }
  161. if(GetPVarType(playerid, "unMod")) DeletePVar(playerid, "unMod");
  162. return 1;
  163. }
  164. public OnVehicleStreamIn(vehicleid, forplayerid)
  165. {
  166. return 1;
  167. }
  168. public OnObjectMoved(objectid)
  169. {
  170. if(objectid != gFerrisWheel) return 0;
  171. defer RotateWheel();
  172. return 1;
  173. }
  174. public OnDynamicObjectMoved(objectid)
  175. {
  176. new Float:x, Float:y, Float:z;
  177. for(new i; i < sizeof(Obj_FloorDoors); i ++)
  178. {
  179. if(objectid == Obj_FloorDoors[i][0])
  180. {
  181. GetDynamicObjectPos(Obj_FloorDoors[i][0], x, y, z);
  182. if(x < X_DOOR_L_OPENED - 0.5) // Some floor doors have shut, move the elevator to next floor in queue:
  183. {
  184. Elevator_MoveToFloor(ElevatorQueue[0]);
  185. RemoveFirstQueueFloor();
  186. }
  187. }
  188. }
  189. if(objectid == Obj_Elevator) // The elevator reached the specified floor.
  190. {
  191. KillTimer(ElevatorBoostTimer); // Kills the timer, in case the elevator reached the floor before boost.
  192. FloorRequestedBy[ElevatorFloor] = INVALID_PLAYER_ID;
  193. Elevator_OpenDoors();
  194. Floor_OpenDoors(ElevatorFloor);
  195. GetDynamicObjectPos(Obj_Elevator, x, y, z);
  196. Label_Elevator = CreateDynamic3DTextLabel("Press '~k~~GROUP_CONTROL_BWD~' to use elevator", COLOR_YELLOW, 1784.9822, -1302.0426, z - 0.9, 4.0);
  197. ElevatorState = ELEVATOR_STATE_WAITING;
  198. SetTimer("Elevator_TurnToIdle", ELEVATOR_WAIT_TIME, 0);
  199. }
  200. if (objectid == BikeParkourObjects[0]) // container
  201. {
  202. switch (BikeParkourObjectStage[0])
  203. {
  204. case 0:
  205. {
  206. MoveDynamicObject(BikeParkourObjects[0], 2847.5302734, -2231.2675781, 99.0883789, 0.5, 0.0, 0.0, 179.7253418); // to end
  207. ++BikeParkourObjectStage[0];
  208. }
  209. case 1:
  210. {
  211. MoveDynamicObject(BikeParkourObjects[0], 2848.1015625, -2238.1552734, 99.0883789, 0.5, 0.0000000, 0.0000000, 90.0000000); // to middle
  212. BikeParkourObjectStage[0] = 2;
  213. }
  214. case 2:
  215. {
  216. MoveDynamicObject(BikeParkourObjects[0], 2848.1015625, -2243.1552734, 99.0883789, 0.5, 0.0, 0.0, 90.0000000); // to beginning
  217. BikeParkourObjectStage[0] = 3;
  218. }
  219. case 3:
  220. {
  221. MoveDynamicObject(BikeParkourObjects[0], 2848.1015625, -2238.1552734, 99.0883789, 0.5, 0.0, 0.0, 90.0000000); // to middle
  222. BikeParkourObjectStage[0] = 0;
  223. }
  224. }
  225. }
  226. }
  227. /*
  228. public OnPlayerEnterDynamicArea(playerid, areaid)
  229. {
  230. if(areaid == NGGShop)
  231. {
  232. SetPlayerArmedWeapon(playerid, 0);
  233. }
  234. foreach(new i: Player)
  235. {
  236. if(GetPVarType(i, "pBoomBoxArea"))
  237. {
  238. if(areaid == GetPVarInt(i, "pBoomBoxArea"))
  239. {
  240. new station[256];
  241. GetPVarString(i, "pBoomBoxStation", station, sizeof(station));
  242. if(!isnull(station))
  243. {
  244. PlayAudioStreamForPlayerEx(playerid, station, GetPVarFloat(i, "pBoomBoxX"), GetPVarFloat(i, "pBoomBoxY"), GetPVarFloat(i, "pBoomBoxZ"), 30.0, 1);
  245. }
  246. return 1;
  247. }
  248. }
  249. }
  250. if(areaid == audiourlid)
  251. {
  252. PlayAudioStreamForPlayerEx(playerid, audiourlurl, audiourlparams[0], audiourlparams[1], audiourlparams[2], audiourlparams[3], 1);
  253. }
  254. return 1;
  255. }
  256. public OnPlayerLeaveDynamicArea(playerid, areaid)
  257. {
  258. foreach(new i: Player)
  259. {
  260. if(GetPVarType(i, "pBoomBoxArea"))
  261. {
  262. if(areaid == GetPVarInt(i, "pBoomBoxArea"))
  263. {
  264. StopAudioStreamForPlayerEx(playerid);
  265. return 1;
  266. }
  267. }
  268. }
  269. if(areaid == audiourlid)
  270. {
  271. StopAudioStreamForPlayerEx(playerid);
  272. }
  273. if(areaid == NGGShop && GetPVarInt(playerid, "ShopTP") == 1)
  274. {
  275. if(GetPVarType(playerid, "PlayerCuffed") || GetPVarType(playerid, "Injured") || GetPVarType(playerid, "IsFrozen") || PlayerInfo[playerid][pHospital] || PlayerInfo[playerid][pJailTime] > 0)
  276. return DeletePVar(playerid, "ShopTP");
  277. RemovePlayerFromVehicle(playerid);
  278. Player_StreamPrep(playerid, GetPVarFloat(playerid, "tmpX"), GetPVarFloat(playerid, "tmpY"), GetPVarFloat(playerid, "tmpZ"), 2500);
  279. SetPlayerInterior(playerid, GetPVarInt(playerid, "tmpInt"));
  280. SetPlayerVirtualWorld(playerid, GetPVarInt(playerid, "tmpVW"));
  281. DeletePVar(playerid, "tmpX");
  282. DeletePVar(playerid, "tmpY");
  283. DeletePVar(playerid, "tmpZ");
  284. DeletePVar(playerid, "tmpInt");
  285. DeletePVar(playerid, "tmpVW");
  286. DeletePVar(playerid, "ShopTP");
  287. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Thanks for visiting our shop, come back soon!");
  288. }
  289. return 1;
  290. }
  291. */
  292. public OnPlayerUpdate(playerid)
  293. {
  294. // Do not put heavy cpu checks in here. Use the 1 second timer.
  295. new Float:health = GetHealth(playerid, health);
  296. if(health <= 0)
  297. {
  298. OnPlayerDeath(playerid, INVALID_PLAYER_ID, 0);
  299. }
  300. if(playerTabbed[playerid] >= 1)
  301. {
  302. playerTabbed[playerid] = 0;
  303. }
  304. playerSeconds[playerid] = gettime();
  305. new pCurWeap = GetPlayerWeapon(playerid);
  306. if(pCurWeap != pCurrentWeapon{playerid}) {
  307. OnPlayerChangeWeapon(playerid, pCurWeap);
  308. pCurrentWeapon{playerid} = pCurWeap;
  309. }
  310. /*
  311. switch(pCurWeap) {
  312. case 9, 16, 17, 18, 35, 36, 37, 38: {
  313. if(PlayerInfo[playerid][pGuns][GetWeaponSlot(pCurWeap)] != pCurWeap) {
  314. if(GetPVarType(playerid, "IsInArena") || GetPVarType(playerid, "EventToken")) return 1;
  315. GetWeaponName(pCurWeap, szMiscArray, sizeof(szMiscArray));
  316. format(szMiscArray, sizeof(szMiscArray), "[SYSTEM]: %s has given themself a client-sided weapon (%s). It was removed from the player.", GetPlayerNameEx(playerid), szMiscArray);
  317. ABroadCast(COLOR_YELLOW, szMiscArray, 2);
  318. SendClientMessageEx(playerid, COLOR_LIGHTRED, "[SYSTEM]: Client weapon detected. Admins were notified: refrain from doing it again.");
  319. SetPlayerWeaponsEx(playerid);
  320. }
  321. }
  322. }*/
  323. new drunknew = GetPlayerDrunkLevel(playerid);
  324. if(drunknew < 100) { // go back up, keep cycling.
  325. SetPlayerDrunkLevel(playerid, 2000);
  326. }
  327. else {
  328. if(pDrunkLevelLast[playerid] != drunknew) {
  329. new wfps = pDrunkLevelLast[playerid] - drunknew;
  330. if ((wfps > 0) && (wfps < 200))
  331. pFPS[playerid] = wfps;
  332. pDrunkLevelLast[playerid] = drunknew;
  333. }
  334. }
  335. if(acstruct[playerid][checkmaptp] == 1 && PlayerInfo[playerid][pAdmin] < 2) //blah
  336. {
  337. new Float:dis = GetPlayerDistanceFromPoint(playerid, acstruct[playerid][maptp][0], acstruct[playerid][maptp][1], acstruct[playerid][maptp][2]);
  338. if(dis < 5.0)
  339. {
  340. new Float:disd = GetPlayerDistanceFromPoint(playerid, acstruct[playerid][LastOnFootPosition][0], acstruct[playerid][LastOnFootPosition][1], acstruct[playerid][LastOnFootPosition][2]);
  341. if(disd > 25.0)
  342. {
  343. new srelay[256], Float:X, Float:Y, Float:Z;
  344. GetPlayerPos(playerid, X, Y, Z);
  345. format(srelay, sizeof(srelay), "[mapteleport] %s(%d) (%0.2f, %0.2f, %0.2f -> %0.2f, %0.2f, %0.2f [%0.2f, %0.2f, %0.2f]) (%f, %f)", GetPlayerNameExt(playerid), GetPlayerSQLId(playerid), \
  346. acstruct[playerid][LastOnFootPosition][0], acstruct[playerid][LastOnFootPosition][1], acstruct[playerid][LastOnFootPosition][2], \
  347. X, Y, Z, acstruct[playerid][maptp][0], acstruct[playerid][maptp][1], acstruct[playerid][maptp][2], disd, dis);
  348. format(srelay, sizeof(srelay), "%s (%d) (%d)", srelay, GetPlayerState(playerid), (GetTickCount()-acstruct[playerid][maptplastclick]));
  349. Log("logs/hack.log", srelay);
  350. CreateBan(INVALID_PLAYER_ID, PlayerInfo[playerid][pId], playerid, PlayerInfo[playerid][pIP], "TP Hacking", 180);
  351. TotalAutoBan++;
  352. }
  353. }
  354. acstruct[playerid][checkmaptp] = 0;
  355. }
  356. GetPlayerPos(playerid, acstruct[playerid][LastOnFootPosition][0], acstruct[playerid][LastOnFootPosition][1], acstruct[playerid][LastOnFootPosition][2]);
  357. new newkeys,
  358. updown,
  359. leftright;
  360. GetPlayerKeys(playerid, newkeys, updown, leftright); // playervar for phone.
  361. // night vision and thermal goggle fixes added by Dom
  362. if(GetPlayerWeapon(playerid) == 44 || GetPlayerWeapon(playerid) == 45) {
  363. if((newkeys & KEY_FIRE) && (!IsPlayerInAnyVehicle(playerid))) return 0;
  364. }
  365. if(updown == KEY_UP) {
  366. if(Bit_State(arrPlayerBits[playerid], phone_bitState)) {
  367. new iPMenuItem = GetPVarInt(playerid, "PMenuItem");
  368. if(iPMenuItem != 0) {
  369. SetPVarInt(playerid, "PMenuItem", iPMenuItem-1);
  370. PlayerTextDrawBoxColor(playerid, phone_PTextDraw[playerid][12 + iPMenuItem-1], 0x22222266);
  371. PlayerTextDrawBoxColor(playerid, phone_PTextDraw[playerid][12 + iPMenuItem], 0xFFFFFF00);
  372. PlayerTextDrawHide(playerid, phone_PTextDraw[playerid][12 + iPMenuItem-1]);
  373. PlayerTextDrawHide(playerid, phone_PTextDraw[playerid][12 + iPMenuItem]);
  374. PlayerTextDrawShow(playerid, phone_PTextDraw[playerid][12 + iPMenuItem-1]);
  375. PlayerTextDrawShow(playerid, phone_PTextDraw[playerid][12 + iPMenuItem]);
  376. }
  377. }
  378. }
  379. if(updown == KEY_DOWN) {
  380. if(Bit_State(arrPlayerBits[playerid], phone_bitState)) {
  381. new iPMenuItem = GetPVarInt(playerid, "PMenuItem");
  382. if(iPMenuItem < 9) { // max menu item
  383. SetPVarInt(playerid, "PMenuItem", GetPVarInt(playerid, "PMenuItem")+1);
  384. PlayerTextDrawBoxColor(playerid, phone_PTextDraw[playerid][12 + iPMenuItem+1], 0x22222266);
  385. PlayerTextDrawBoxColor(playerid, phone_PTextDraw[playerid][12 + iPMenuItem], 0xFFFFFF00);
  386. PlayerTextDrawHide(playerid, phone_PTextDraw[playerid][12 + iPMenuItem+1]);
  387. PlayerTextDrawHide(playerid, phone_PTextDraw[playerid][12 + iPMenuItem]);
  388. PlayerTextDrawShow(playerid, phone_PTextDraw[playerid][12 + iPMenuItem+1]);
  389. PlayerTextDrawShow(playerid, phone_PTextDraw[playerid][12 + iPMenuItem]);
  390. }
  391. }
  392. }
  393. return 1;
  394. }
  395. public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid,
  396. Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,
  397. Float:fRotX, Float:fRotY, Float:fRotZ,
  398. Float:fScaleX, Float:fScaleY, Float:fScaleZ)
  399. {
  400. if(response == EDIT_RESPONSE_FINAL)
  401. {
  402. if(fOffsetX > 1.4)
  403. {
  404. fOffsetX = 1.4;
  405. SendClientMessage(playerid, COLOR_WHITE, "Maximum X Offset exeeded, damped to maximum");
  406. }
  407. if(fOffsetY > 1.4) {
  408. fOffsetY = 1.4;
  409. SendClientMessage(playerid, COLOR_WHITE, "Maximum Y Offset exeeded, damped to maximum");
  410. }
  411. if(fOffsetZ > 1.4) {
  412. fOffsetZ = 1.4;
  413. SendClientMessage(playerid, COLOR_WHITE, "Maximum Z Offset exeeded, damped to maximum");
  414. }
  415. if(fOffsetX < -1.4) {
  416. fOffsetX = -1.4;
  417. SendClientMessage(playerid, COLOR_WHITE, "Maximum X Offset exeeded, damped to maximum");
  418. }
  419. if(fOffsetY < -1.4) {
  420. fOffsetY = -1.4;
  421. SendClientMessage(playerid, COLOR_WHITE, "Maximum Y Offset exeeded, damped to maximum");
  422. }
  423. if(fOffsetZ < -1.4) {
  424. fOffsetZ = -1.4;
  425. SendClientMessage(playerid, COLOR_WHITE, "Maximum Z Offset exeeded, damped to maximum");
  426. }
  427. if(fScaleX > 1.5) {
  428. fScaleX = 1.5;
  429. SendClientMessage(playerid, COLOR_WHITE, "Maximum X Scale exeeded, damped to maximum");
  430. }
  431. if(fScaleY > 1.5) {
  432. fScaleY = 1.5;
  433. SendClientMessage(playerid, COLOR_WHITE, "Maximum Y Scale exeeded, damped to maximum");
  434. }
  435. if(fScaleZ > 1.5) {
  436. fScaleZ = 1.5;
  437. SendClientMessage(playerid, COLOR_WHITE, "Maximum Z Scale exeeded, damped to maximum");
  438. }
  439. if(GetPVarType(playerid, "EditGToy")) {
  440. PlayerInfo[playerid][pGroupToy][0] = fOffsetX;
  441. PlayerInfo[playerid][pGroupToy][1] = fOffsetY;
  442. PlayerInfo[playerid][pGroupToy][2] = fOffsetZ;
  443. PlayerInfo[playerid][pGroupToy][3] = fRotX;
  444. PlayerInfo[playerid][pGroupToy][4] = fRotY;
  445. PlayerInfo[playerid][pGroupToy][5] = fRotZ;
  446. PlayerInfo[playerid][pGroupToy][6] = fScaleX;
  447. PlayerInfo[playerid][pGroupToy][7] = fScaleY;
  448. PlayerInfo[playerid][pGroupToy][8] = fScaleZ;
  449. RemovePlayerAttachedObject(playerid, 9);
  450. SetPlayerAttachedObject(playerid, 9, arrGroupData[PlayerInfo[playerid][pMember]][g_iGroupToyID], PlayerInfo[playerid][pGroupToyBone],
  451. PlayerInfo[playerid][pGroupToy][0], PlayerInfo[playerid][pGroupToy][1], PlayerInfo[playerid][pGroupToy][2],
  452. PlayerInfo[playerid][pGroupToy][3], PlayerInfo[playerid][pGroupToy][4], PlayerInfo[playerid][pGroupToy][5],
  453. PlayerInfo[playerid][pGroupToy][6], PlayerInfo[playerid][pGroupToy][7], PlayerInfo[playerid][pGroupToy][8]);
  454. DeletePVar(playerid, "EditGToy");
  455. g_mysql_SaveGroupToy(playerid);
  456. SendClientMessageEx(playerid, COLOR_GRAD1, "You have edited your group toy.");
  457. }
  458. else {
  459. new slotid = GetPVarInt(playerid, "ToySlot");
  460. PlayerToyInfo[playerid][slotid][ptPosX] = fOffsetX;
  461. PlayerToyInfo[playerid][slotid][ptPosY] = fOffsetY;
  462. PlayerToyInfo[playerid][slotid][ptPosZ] = fOffsetZ;
  463. PlayerToyInfo[playerid][slotid][ptRotX] = fRotX;
  464. PlayerToyInfo[playerid][slotid][ptRotY] = fRotY;
  465. PlayerToyInfo[playerid][slotid][ptRotZ] = fRotZ;
  466. PlayerToyInfo[playerid][slotid][ptScaleX] = fScaleX;
  467. PlayerToyInfo[playerid][slotid][ptScaleY] = fScaleY;
  468. PlayerToyInfo[playerid][slotid][ptScaleZ] = fScaleZ;
  469. g_mysql_SaveToys(playerid,slotid);
  470. ShowEditMenu(playerid);
  471. }
  472. }
  473. else
  474. {
  475. if(GetPVarType(playerid, "EditGToy")) {
  476. DeletePVar(playerid, "EditGToy");
  477. SendClientMessageEx(playerid, COLOR_GRAD1, "You have stopped editing your group toy.");
  478. }
  479. else {
  480. ShowEditMenu(playerid);
  481. SendClientMessageEx(playerid, COLOR_WHITE, "You have stopped yourself from editing the toy.");
  482. }
  483. }
  484. return 1;
  485. }
  486. public OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
  487. {
  488. if(gPlayerLogged{playerid} && GetPVarInt(playerid, "EventToken") == 0)
  489. {
  490. PlayerInfo[playerid][pInt] = newinteriorid;
  491. if(newinteriorid != 0)
  492. {
  493. SetPlayerWeather(playerid, 0);
  494. }
  495. else
  496. {
  497. SetPlayerWeather(playerid, gWeather);
  498. }
  499. }
  500. foreach(new i: Player)
  501. {
  502. if(Spectating[i] > 0 && Spectate[i] == playerid) {
  503. SetTimerEx("SpecUpdate", 1500, false, "i", i);
  504. }
  505. }
  506. }
  507. public OnPlayerPressButton(playerid, buttonid)
  508. {
  509. // New SASD interior.
  510. if(buttonid == SASDButtons[0] || buttonid == SASDButtons[3])
  511. {
  512. if(IsACop(playerid))
  513. {
  514. MoveDynamicObject(SASDDoors[0], 14.92530, 53.51950, 996.84857, 4, 0.00000, 0.00000, 180.00000);
  515. SetTimer("CloseSASDNew1", 2500, 0);
  516. }
  517. else
  518. {
  519. SendClientMessageEx(playerid, COLOR_GREY," Access denied.");
  520. return 1;
  521. }
  522. }
  523. if(buttonid == SASDButtons[2] || buttonid == SASDButtons[1])
  524. {
  525. if(IsACop(playerid))
  526. {
  527. MoveDynamicObject(SASDDoors[1], 8.70370, 57.32530, 991.03699, 4, 0.00000, 0.00000, 0.00000);
  528. SetTimer("CloseSASDNew2", 2500, 0);
  529. }
  530. else
  531. {
  532. SendClientMessageEx(playerid, COLOR_GREY," Access denied.");
  533. return 1;
  534. }
  535. }
  536. if(buttonid == sasdbtn1)
  537. {
  538. if(IsACop(playerid) && PlayerInfo[playerid][pRank] >= 5)
  539. {
  540. MoveDynamicObject(sasd1A,2510.65332031,-1697.00976562,561.79223633,4);
  541. MoveDynamicObject(sasd1B,2515.67211914,-1696.97485352,561.79223633,4);
  542. SetTimer("CloseSASD1", 2500, 0);
  543. }
  544. else
  545. {
  546. SendClientMessageEx(playerid,COLOR_GREY,"Access denied.");
  547. return 1;
  548. }
  549. }
  550. if(buttonid == sasdbtn2)
  551. {
  552. if(IsACop(playerid) && PlayerInfo[playerid][pRank] >= 3)
  553. {
  554. MoveDynamicObject(sasd5A,2523.86059570,-1660.07177734,561.80206299,4);
  555. MoveDynamicObject(sasd5B,2518.84228516,-1660.10888672,561.80004883,4);
  556. //2522.86059570,-1660.07177734,561.80206299
  557. //2519.84228516,-1660.10888672,561.80004883
  558. SetTimer("CloseSASD5", 2500, 0);
  559. }
  560. else
  561. {
  562. SendClientMessageEx(playerid,COLOR_GREY,"Access denied.");
  563. return 1;
  564. }
  565. }
  566. if(buttonid == sasdbtn3)
  567. {
  568. if(IsACop(playerid) && PlayerInfo[playerid][pRank] >= 5)
  569. {
  570. MoveDynamicObject(sasd3A,2521.15600586,-1697.01550293,561.79223633,4);
  571. MoveDynamicObject(sasd3B,2526.15893555,-1696.98010254,561.79223633,4);
  572. SetTimer("CloseSASD3", 2500, 0);
  573. }
  574. else
  575. {
  576. SendClientMessageEx(playerid,COLOR_GREY,"Access denied.");
  577. return 1;
  578. }
  579. }
  580. if(buttonid == sasdbtn4)
  581. {
  582. if(IsACop(playerid) && PlayerInfo[playerid][pRank] >= 5)
  583. {
  584. MoveDynamicObject(sasd2A,2515.87548828,-1697.01525879,561.79223633,4);
  585. MoveDynamicObject(sasd2B,2520.89257812,-1696.97509766,561.79223633,4);
  586. SetTimer("CloseSASD2", 2500, 0);
  587. }
  588. else
  589. {
  590. SendClientMessageEx(playerid,COLOR_GREY,"Access denied.");
  591. return 1;
  592. }
  593. }
  594. if(buttonid == sasdbtn5)
  595. {
  596. if(IsACop(playerid) && PlayerInfo[playerid][pRank] >= 3)
  597. {
  598. MoveDynamicObject(sasd4A,2510.84130859,-1660.08081055,561.79528809,4);
  599. MoveDynamicObject(sasd4B,2515.81982422,-1660.04650879,561.80004883,4);
  600. SetTimer("CloseSASD4", 2500, 0);
  601. }
  602. else
  603. {
  604. SendClientMessageEx(playerid,COLOR_GREY,"Access denied.");
  605. return 1;
  606. }
  607. }
  608. if(buttonid == westout)
  609. {
  610. if(!IsACop(playerid))
  611. {
  612. SendClientMessageEx(playerid,COLOR_GREY,"Access denied.");
  613. return 1;
  614. }
  615. MoveDynamicObject(westlobby1,239.71582031,115.09179688,1002.21502686,4);
  616. MoveDynamicObject(westlobby2,239.67968750,120.09960938,1002.21502686,4);
  617. SetTimer("CloseWestLobby", 2500, 0);
  618. }
  619. if(buttonid == eastout)
  620. {
  621. if(!IsACop(playerid))
  622. {
  623. SendClientMessageEx(playerid,COLOR_GREY,"Access denied.");
  624. return 1;
  625. }
  626. MoveDynamicObject(eastlobby1,253.14941406,111.59960938,1002.21502686,4);
  627. MoveDynamicObject(eastlobby2,253.18457031,106.59960938,1002.21502686,4);
  628. SetTimer("CloseEastLobby", 2500, 0);
  629. }
  630. if(buttonid == lockerin || buttonid == lockerout)
  631. {
  632. if(!IsACop(playerid))
  633. {
  634. SendClientMessageEx(playerid,COLOR_GREY,"Access denied.");
  635. return 1;
  636. }
  637. MoveDynamicObject(locker1,268.29980469,112.56640625,1003.61718750,4);
  638. MoveDynamicObject(locker2,263.29980469,112.52929688,1003.61718750,4);
  639. SetTimer("CloseLocker", 2500, 0);
  640. }
  641. if(buttonid == cctvin || buttonid == cctvout)
  642. {
  643. if(!IsACop(playerid))
  644. {
  645. SendClientMessageEx(playerid,COLOR_GREY,"Access denied.");
  646. return 1;
  647. }
  648. MoveDynamicObject(cctv1,263.44921875,115.79980469,1003.61718750,4);
  649. MoveDynamicObject(cctv2,268.46875000,115.83691406,1003.61718750,4);
  650. SetTimer("CloseCCTV", 2500, 0);
  651. }
  652. if(buttonid == chiefin || buttonid == chiefout)
  653. {
  654. if(!IsACop(playerid) || PlayerInfo[playerid][pRank] < 6)
  655. {
  656. SendClientMessageEx(playerid,COLOR_GREY,"Access denied.");
  657. return 1;
  658. }
  659. MoveDynamicObject(chief1,228.0,119.50000000,1009.21875000,4);
  660. MoveDynamicObject(chief2,230.0,119.53515625,1009.21875000,4);
  661. SetTimer("CloseChief", 2500, 0);
  662. }
  663. if(buttonid == elevator)
  664. {
  665. if(!IsACop(playerid))
  666. {
  667. SendClientMessageEx(playerid,COLOR_GREY,"Access denied.");
  668. return 1;
  669. }
  670. //else ShowPlayerDialogEx( playerid, ELEVATOR3, DIALOG_STYLE_LIST, "Elevator", "Rooftop\nGarage", "Select", "Cancel");
  671. else SendClientMessageEx(playerid, COLOR_GRAD1, "This elevator is out of service.");
  672. }
  673. if(buttonid == garagekey)
  674. {
  675. if(!IsACop(playerid))
  676. {
  677. SendClientMessageEx(playerid,COLOR_GREY,"Access denied.");
  678. return 1;
  679. }
  680. //else ShowPlayerDialogEx( playerid, ELEVATOR2, DIALOG_STYLE_LIST, "Elevator", "Rooftop\nInterior", "Select", "Cancel");
  681. else SendClientMessageEx(playerid, COLOR_GRAD1, "This elevator is out of service.");
  682. }
  683. if(buttonid == roofkey)
  684. {
  685. if(!IsACop(playerid))
  686. {
  687. SendClientMessageEx(playerid,COLOR_GREY,"Access denied.");
  688. return 1;
  689. }
  690. //else ShowPlayerDialogEx( playerid, ELEVATOR, DIALOG_STYLE_LIST, "Elevator", "Interior\nGarage", "Select", "Cancel");
  691. else SendClientMessageEx(playerid, COLOR_GRAD1, "This elevator is out of service.");
  692. }
  693. if(buttonid == westin)
  694. {
  695. MoveDynamicObject(westlobby1,239.71582031,115.09179688,1002.21502686,4);
  696. MoveDynamicObject(westlobby2,239.67968750,120.09960938,1002.21502686,4);
  697. SetTimer("CloseWestLobby", 2500, 0);
  698. }
  699. if(buttonid == eastin)
  700. {
  701. MoveDynamicObject(eastlobby1,253.14941406,111.59960938,1002.21502686,4);
  702. MoveDynamicObject(eastlobby2,253.18457031,106.59960938,1002.21502686,4);
  703. SetTimer("CloseEastLobby", 2500, 0);
  704. }
  705. for(new i = 0; i < sizeof(DocButton); i++) {
  706. if (buttonid == DocButton[i]) {
  707. if(IsADocGuard(playerid)) {
  708. OpenDocAreaDoors(i, 1);
  709. SetTimerEx("OpenDocAreaDoors", 5000, false, "ii", i, 0);
  710. }
  711. else {
  712. SendClientMessageEx(playerid, COLOR_GREY, "Access denied");
  713. break;
  714. }
  715. }
  716. }
  717. if(buttonid == DocCPButton[0] || buttonid == DocCPButton[1])
  718. {
  719. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "Access denied");
  720. ShowDocPrisonControls(playerid, 0);
  721. }
  722. if(buttonid == SFPDHighCMDButton[0]) // Chief
  723. {
  724. if(PlayerInfo[playerid][pLeader] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "Access denied");
  725. SFPDDoors(0, 1);
  726. SetTimerEx("SFPDDoors", 3000, false, "ii", 0, 0);
  727. }
  728. if(buttonid == SFPDHighCMDButton[1]) // Deputy Chief
  729. {
  730. if(PlayerInfo[playerid][pLeader] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "Access denied");
  731. SFPDDoors(1, 1);
  732. SetTimerEx("SFPDDoors", 3000, false, "ii", 1, 0);
  733. }
  734. if(buttonid == SFPDHighCMDButton[2]) // Commander
  735. {
  736. if(PlayerInfo[playerid][pLeader] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "Access denied");
  737. SFPDDoors(2, 1);
  738. SetTimerEx("SFPDDoors", 3000, false, "ii", 2, 0);
  739. }
  740. if(buttonid == SFPDLobbyButton[0])
  741. {
  742. if(!IsACop(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "Access denied");
  743. SFPDDoors(3, 1);
  744. SetTimerEx("SFPDDoors", 3000, false, "ii", 3, 0);
  745. }
  746. if(buttonid == SFPDLobbyButton[1])
  747. {
  748. if(!IsACop(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "Access denied");
  749. SFPDDoors(4, 1);
  750. SetTimerEx("SFPDDoors", 3000, false, "ii", 4, 0);
  751. }
  752. return false;
  753. }
  754. public OnEnterExitModShop( playerid, enterexit, interiorid ) {
  755. if(!enterexit && GetPlayerVehicle(playerid, GetPlayerVehicleID(playerid)) > -1) UpdatePlayerVehicleMods(playerid, GetPlayerVehicle(playerid, GetPlayerVehicleID(playerid)));
  756. if(!enterexit && DynVeh[GetPlayerVehicleID(playerid)] != -1) UpdateGroupVehicleMods(GetPlayerVehicleID(playerid));
  757. }
  758. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  759. {
  760. if(GetPlayerVehicle(playerid, vehicleid) > -1)
  761. {
  762. PlayerVehicleInfo[playerid][GetPlayerVehicle(playerid, vehicleid)][pvPaintJob] = paintjobid;
  763. }
  764. return 1;
  765. }
  766. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  767. {
  768. if(GetPlayerVehicle(playerid, vehicleid) > -1)
  769. {
  770. PlayerVehicleInfo[playerid][GetPlayerVehicle(playerid, vehicleid)][pvColor1] = color1;
  771. PlayerVehicleInfo[playerid][GetPlayerVehicle(playerid, vehicleid)][pvColor2] = color2;
  772. }
  773. return 1;
  774. }
  775. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  776. {
  777. return 1;
  778. }
  779. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  780. {
  781. new tableid = GetPVarInt(playerid, "pkrTableID")-1;
  782. if(playertextid == PlayerPokerUI[playerid][38])
  783. {
  784. switch(GetPVarInt(playerid, "pkrActionOptions"))
  785. {
  786. case 1: // Raise
  787. {
  788. PokerRaiseHand(playerid);
  789. PokerTable[tableid][pkrRotations] = 0;
  790. }
  791. case 2: // Call
  792. {
  793. PokerCallHand(playerid);
  794. }
  795. case 3: // Check
  796. {
  797. PokerCheckHand(playerid);
  798. PokerRotateActivePlayer(tableid);
  799. }
  800. }
  801. }
  802. if(playertextid == PlayerPokerUI[playerid][39])
  803. {
  804. switch(GetPVarInt(playerid, "pkrActionOptions"))
  805. {
  806. case 1: // Check
  807. {
  808. PokerCheckHand(playerid);
  809. PokerRotateActivePlayer(tableid);
  810. }
  811. case 2: // Raise
  812. {
  813. PokerRaiseHand(playerid);
  814. PokerTable[tableid][pkrRotations] = 0;
  815. }
  816. case 3: // Fold
  817. {
  818. PokerFoldHand(playerid);
  819. PokerRotateActivePlayer(tableid);
  820. }
  821. }
  822. }
  823. if(playertextid == PlayerPokerUI[playerid][40])
  824. {
  825. switch(GetPVarInt(playerid, "pkrActionOptions"))
  826. {
  827. case 1: // Fold
  828. {
  829. PokerFoldHand(playerid);
  830. PokerRotateActivePlayer(tableid);
  831. }
  832. case 2: // Fold
  833. {
  834. PokerFoldHand(playerid);
  835. PokerRotateActivePlayer(tableid);
  836. }
  837. }
  838. }
  839. if(playertextid == PlayerPokerUI[playerid][41]) // LEAVE
  840. {
  841. if(GetPVarType(playerid, "pkrTableID")) {
  842. LeavePokerTable(playerid);
  843. }
  844. }
  845. return 1;
  846. }
  847. public OnPlayerModelSelection(playerid, response, listid, modelid)
  848. {
  849. /*if(!response)
  850. {
  851. if(listid == CarList)
  852. {
  853. print("[ListReloaded]");
  854. ToyList = LoadModelSelectionMenu("ToyList.txt");
  855. CarList = LoadModelSelectionMenu("CarList.txt");
  856. PlaneList = LoadModelSelectionMenu("PlaneList.txt");
  857. BoatList = LoadModelSelectionMenu("BoatList.txt");
  858. SkinList = LoadModelSelectionMenu("SkinList.txt");
  859. }
  860. } */
  861. if(listid == ToyList2 || listid == ToyList)
  862. {
  863. if(response)
  864. {
  865. if(modelid == 18647)
  866. {
  867. ShowPlayerDialogEx(playerid, DIALOG_SHOPNEON, DIALOG_STYLE_LIST, "Neon Tubes", "Red Neon Tube\nBlue Neon Tube\nGreen Neon Tube\nYellow Neon Tube\nPink Neon Tube\nWhite Neon Tube", "Select", "Cancel");
  868. }
  869. else
  870. {
  871. szMiscArray[0] = 0;
  872. for(new z;z<MAX_PLAYERTOYS;z++)
  873. {
  874. new name[24];
  875. format(name, sizeof(name), "None");
  876. for(new i;i<sizeof(HoldingObjectsAll);i++)
  877. {
  878. if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][z][ptModelID])
  879. {
  880. format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
  881. }
  882. }
  883. format(szMiscArray, sizeof(szMiscArray), "%s(%d) %s (Bone: %s)\n", szMiscArray, z, name, HoldingBones[PlayerToyInfo[playerid][z][ptBone]]);
  884. }
  885. printf("MODELID: %d", modelid);
  886. ShowPlayerDialogEx(playerid, DIALOG_SHOPBUYTOYS, DIALOG_STYLE_LIST, "Select a Slot", szMiscArray, "Select", "Cancel");
  887. SetPVarInt(playerid, "ToyID", modelid);
  888. }
  889. }
  890. else SendClientMessage(playerid, COLOR_GREY, "You have closed the toy shop.");
  891. return 1;
  892. }
  893. if(listid == BoatList)
  894. {
  895. if(response)
  896. {
  897. new string[128];
  898. SetPVarInt(playerid, "VehicleID", modelid), SetPVarInt(playerid, "BoatShop", 1);
  899. format(string, sizeof(string), "Item: %s\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", VehicleName[modelid-400], number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[5][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[5][sItemPrice]));
  900. ShowPlayerDialogEx(playerid, DIALOG_CARSHOP, DIALOG_STYLE_MSGBOX, "Vehicle Shop", string, "Purchase", "Cancel");
  901. }
  902. }
  903. if(listid == PlaneList)
  904. {
  905. if(response)
  906. {
  907. new string[128];
  908. SetPVarInt(playerid, "VehicleID", modelid);
  909. format(string, sizeof(string), "Item: %s\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", VehicleName[modelid-400], number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[5][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[5][sItemPrice]));
  910. ShowPlayerDialogEx(playerid, DIALOG_CARSHOP, DIALOG_STYLE_MSGBOX, "Vehicle Shop", string, "Purchase", "Cancel");
  911. }
  912. }
  913. if(listid == CarList2 || listid == CarList)
  914. {
  915. if(response)
  916. {
  917. if(GetPVarInt(playerid, "PlayerCuffed") != 0) // Check to see if you're tazed or cuffed
  918. {
  919. DeletePVar(playerid, "voucherdialog");
  920. DeletePVar(playerid, "WhoIsThis");
  921. return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this while being cuffed or tazed.");
  922. }
  923. if(IsPlayerInAnyVehicle(playerid))
  924. {
  925. DeletePVar(playerid, "voucherdialog");
  926. DeletePVar(playerid, "WhoIsThis");
  927. return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this while being inside a vehicle.");
  928. }
  929. if(GetPVarInt(playerid, "voucherdialog") == 0)
  930. {
  931. if(!GetPVarType(playerid, "RentaCar"))
  932. {
  933. new string[128];
  934. SetPVarInt(playerid, "VehicleID", modelid);
  935. format(string, sizeof(string), "Item: %s\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", VehicleName[modelid-400], number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[5][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[5][sItemPrice]));
  936. ShowPlayerDialogEx(playerid, DIALOG_CARSHOP, DIALOG_STYLE_MSGBOX, "Vehicle Shop", string, "Purchase", "Cancel");
  937. }
  938. else
  939. {
  940. new string[128];
  941. SetPVarInt(playerid, "VehicleID", modelid);
  942. format(string, sizeof(string), "Item: %s\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", VehicleName[modelid-400], number_format(PlayerInfo[playerid][pCredits]),number_format(ShopItems[20][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[20][sItemPrice]));
  943. ShowPlayerDialogEx(playerid, DIALOG_RENTACAR, DIALOG_STYLE_MSGBOX, "Rent a Car", string, "Purchase", "Cancel");
  944. }
  945. }
  946. else if(GetPVarInt(playerid, "voucherdialog") == 1)
  947. {
  948. if(!vehicleCountCheck(playerid)) return DeletePVar(playerid, "voucherdialog"), DeletePVar(playerid, "WhoIsThis"), SendClientMessageEx(playerid, COLOR_GREY, "You cannot own anymore vehicles - You may purchase additional vehicle slots through /vstorage.");
  949. if(!vehicleSpawnCountCheck(playerid)) return DeletePVar(playerid, "voucherdialog"), DeletePVar(playerid, "WhoIsThis"), SendClientMessageEx(playerid, COLOR_GREY, "You have too many spawned vehicles, please despawn one.");
  950. if(PlayerInfo[playerid][pVehVoucher] <= 0) return DeletePVar(playerid, "voucherdialog"), DeletePVar(playerid, "WhoIsThis"), SendClientMessageEx(playerid, COLOR_GREY, "You don't have a car voucher.");
  951. new Float: arr_fPlayerPos[4], szLog[128], szString[128];
  952. GetPlayerPos(playerid, arr_fPlayerPos[0], arr_fPlayerPos[1], arr_fPlayerPos[2]);
  953. GetPlayerFacingAngle(playerid, arr_fPlayerPos[3]);
  954. CreatePlayerVehicle(playerid, GetPlayerFreeVehicleId(playerid), modelid, arr_fPlayerPos[0], arr_fPlayerPos[1], arr_fPlayerPos[2], arr_fPlayerPos[3], 0, 0, 2000000, 0, 0);
  955. SetPlayerVirtualWorld(playerid, 0);
  956. PlayerInfo[playerid][pVehVoucher]--;
  957. format(szString, sizeof(szString), "You have successfully used one of your car voucher(s), you have %d car voucher(s) left.", PlayerInfo[playerid][pVehVoucher]);
  958. SendClientMessageEx(playerid, COLOR_CYAN, szString);
  959. format(szLog, sizeof(szLog), "%s(%d) has used one of his car voucher(s) and has %d left.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), PlayerInfo[playerid][pVehVoucher]);
  960. Log("logs/vouchers.log", szLog);
  961. DeletePVar(playerid, "voucherdialog");
  962. DeletePVar(playerid, "WhoIsThis");
  963. DeletePVar(playerid, "ShopTP");
  964. }
  965. }
  966. DeletePVar(playerid, "voucherdialog");
  967. DeletePVar(playerid, "WhoIsThis");
  968. DeletePVar(playerid, "RentaCar");
  969. }
  970. if(listid == CarList3)
  971. {
  972. if(response)
  973. {
  974. new string[128];
  975. SetPVarInt(playerid, "VehicleID", modelid);
  976. format(string, sizeof(string), "Item: %s\nCost: 1 Restricted Car Voucher", VehicleName[modelid-400]);
  977. ShowPlayerDialogEx(playerid, DIALOG_CARSHOP2, DIALOG_STYLE_MSGBOX, "Restricted Vehicle Shop", string, "Purchase", "Cancel");
  978. }
  979. }
  980. if(listid == SkinList)
  981. {
  982. if(response)
  983. {
  984. ClearAnimationsEx(playerid);
  985. if(PlayerInfo[playerid][pDonateRank] >= 2)
  986. {
  987. if (PlayerInfo[playerid][pModel] == modelid)
  988. return SendClientMessageEx(playerid, COLOR_GREY, "You're already wearing those clothes.");
  989. PlayerInfo[playerid][pModel] = modelid;
  990. SetPlayerSkin(playerid, modelid);
  991. return SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have changed your clothes for free.");
  992. }
  993. if(IsValidSkin(modelid) == 0)
  994. {
  995. if(PlayerInfo[playerid][mInventory][13])
  996. {
  997. if(PlayerInfo[playerid][pModel] == modelid) return SendClientMessageEx(playerid, COLOR_GREY, "You're already wearing those clothes.");
  998. PlayerInfo[playerid][mInventory][13]--;
  999. PlayerInfo[playerid][pModel] = modelid;
  1000. SetPlayerSkin(playerid, modelid);
  1001. return SendClientMessageEx(playerid, COLOR_YELLOW, "You have used a Restricted Skin token to change your clothes.");
  1002. }
  1003. if(GetPVarInt(playerid, "freeSkin") == 1)
  1004. {
  1005. SendClientMessageEx(playerid, COLOR_GREY, "That skin ID is either invalid or restricted to a group / VIP!");
  1006. ShowModelSelectionMenu(playerid, SkinList, "Change your skin.");
  1007. }
  1008. else {
  1009. SendClientMessageEx(playerid, COLOR_GREY, "That skin ID is either invalid or restricted to a group / VIP!");
  1010. ShowModelSelectionMenu(playerid, SkinList, "Change your skin.");
  1011. }
  1012. }
  1013. else {
  1014. if (PlayerInfo[playerid][pModel] == modelid)
  1015. {
  1016. return SendClientMessageEx(playerid, COLOR_GREY, "You're already wearing those clothes.");
  1017. }
  1018. if(GetPVarInt(playerid, "freeSkin") == 1)
  1019. {
  1020. PlayerInfo[playerid][pModel] = modelid;
  1021. SetPlayerSkin(playerid, modelid);
  1022. SetPVarInt(playerid, "freeSkin", 0);
  1023. }
  1024. else
  1025. {
  1026. new
  1027. string[128],
  1028. iBusiness = InBusiness(playerid);
  1029. if(iBusiness == INVALID_BUSINESS_ID || Businesses[iBusiness][bType] != BUSINESS_TYPE_CLOTHING) return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not inside of a clothing shop!");
  1030. if(GetPlayerCash(playerid) < GetPVarInt(playerid, "SkinChangeCost")) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't afford these clothes!");
  1031. GameTextForPlayer(playerid, "~g~Clothes purchased!", 2000, 1);
  1032. PlayerInfo[playerid][pModel] = modelid;
  1033. SetPlayerSkin(playerid, modelid);
  1034. Businesses[iBusiness][bInventory]--;
  1035. Businesses[iBusiness][bTotalSales]++;
  1036. Businesses[iBusiness][bSafeBalance] += TaxSale(GetPVarInt(playerid, "SkinChangeCost"));
  1037. GivePlayerCash(playerid, -GetPVarInt(playerid, "SkinChangeCost"));
  1038. format(string, sizeof(string), "%s(%d) (IP: %s) has bought skin %d in %s (%d) for %d.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), modelid, Businesses[InBusiness(playerid)][bName],InBusiness(playerid),GetPVarInt(playerid, "SkinChangeCost"));
  1039. Log("logs/business.log", string);
  1040. DeletePVar(playerid, "SkinChangeCost");
  1041. }
  1042. }
  1043. }
  1044. }
  1045. /*
  1046. for(new i; i < sizeof(FurnitureList); ++i) {
  1047. if(listid == FurnitureList[i]) {
  1048. if(response) {
  1049. SetPVarInt(playerid, PVAR_FURNITURE_BUYMODEL, modelid);
  1050. format(szMiscArray, sizeof(szMiscArray), "Would you like to buy this %s for $%s and %s materials?", GetFurnitureName(modelid), number_format(GetFurniturePrice(modelid)), number_format(GetFurniturePrice(modelid) / 10));
  1051. ShowPlayerDialogEx(playerid, DIALOG_FURNITURE_BUYCONFIRM, DIALOG_STYLE_MSGBOX, "Furniture Menu | Confirm Purchase", szMiscArray, "Buy", "Cancel");
  1052. }
  1053. else {
  1054. FurnitureMenu(playerid, 0);
  1055. }
  1056. break;
  1057. }
  1058. }
  1059. */
  1060. return 1;
  1061. }
  1062. public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  1063. {
  1064. acstruct[playerid][checkmaptp] = 1; acstruct[playerid][maptplastclick] = GetTickCount();
  1065. acstruct[playerid][maptp][0] = fX; acstruct[playerid][maptp][1] = fY; acstruct[playerid][maptp][2] = fZ;
  1066. return 1;
  1067. }
  1068. public OnPlayerStreamIn(playerid, forplayerid)
  1069. {
  1070. switch(Backup[playerid]) {
  1071. case 1: {
  1072. if(PlayerInfo[playerid][pMember] == PlayerInfo[forplayerid][pMember])
  1073. {
  1074. new string[128];
  1075. if(GetPVarInt(playerid, "InRangeBackup") < 1)
  1076. {
  1077. SetPVarInt(playerid, "InRangeBackup", 30);
  1078. format(string, sizeof(string), "You are in range of %s's backup call (Code 3) (Blue marker on minimap)", GetPlayerNameEx(playerid));
  1079. SendClientMessageEx(forplayerid, DEPTRADIO, string);
  1080. }
  1081. SetPlayerMarkerForPlayer(forplayerid, playerid, 0x2641FEAA);
  1082. }
  1083. }
  1084. case 2: {
  1085. if(PlayerInfo[playerid][pMember] == PlayerInfo[forplayerid][pMember])
  1086. {
  1087. new string[128];
  1088. if(GetPVarInt(playerid, "InRangeBackup") < 1)
  1089. {
  1090. SetPVarInt(playerid, "InRangeBackup", 30);
  1091. format(string, sizeof(string), "You are in range of %s's backup call (Code 2) (Green marker on minimap)", GetPlayerNameEx(playerid));
  1092. SendClientMessageEx(forplayerid, DEPTRADIO, string);
  1093. }
  1094. SetPlayerMarkerForPlayer(forplayerid, playerid, 0x00FF33AA);
  1095. }
  1096. }
  1097. case 3: {
  1098. if(IsACop(forplayerid))
  1099. {
  1100. new string[128];
  1101. if(GetPVarInt(playerid, "InRangeBackup") < 1)
  1102. {
  1103. SetPVarInt(playerid, "InRangeBackup", 30);
  1104. format(string, sizeof(string), "You are in range of %s's backup call (Code 3) (Blue marker on minimap)", GetPlayerNameEx(playerid));
  1105. SendClientMessageEx(forplayerid, DEPTRADIO, string);
  1106. }
  1107. SetPlayerMarkerForPlayer(forplayerid, playerid, 0x2641FEAA);
  1108. }
  1109. }
  1110. }
  1111. return 1;
  1112. }
  1113. public OnPlayerStreamOut(playerid, forplayerid)
  1114. {
  1115. if(Backup[playerid] > 0) {
  1116. if(IsACop(forplayerid))
  1117. {
  1118. SetPlayerToTeamColor(playerid);
  1119. }
  1120. }
  1121. return 1;
  1122. }
  1123. public OnPlayerConnect(playerid)
  1124. {
  1125. if(IsPlayerNPC(playerid)) return 1;
  1126. g_arrQueryHandle{playerid} = random(256);
  1127. TotalConnect++;
  1128. if(Iter_Count(Player) > MaxPlayersConnected) {
  1129. MaxPlayersConnected = Iter_Count(Player);
  1130. getdate(MPYear,MPMonth,MPDay);
  1131. }
  1132. // RemoveVendingMachines(playerid);
  1133. SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
  1134. SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
  1135. SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
  1136. gPlayerUsingLoopingAnim[playerid] = 0;
  1137. gPlayerAnimLibsPreloaded[playerid] = 0;
  1138. SetPVarInt(playerid, "AOSlotPaintballFlag", -1);
  1139. DeletePVar(playerid, "TempLevel");
  1140. HackingMods[playerid] = 0;
  1141. PlayerInfo[playerid][pHitman] = -1;
  1142. pSpeed[playerid] = 0.0;
  1143. //SetTimerEx("HackingTimer", 1000, 0, "i", playerid);
  1144. for(new i = 0; i < 3; i++) {
  1145. StopaniFloats[playerid][i] = 0;
  1146. }
  1147. for(new i = 0; i < 3; i++) {
  1148. ConfigEventCPs[playerid][i] = 0;
  1149. }
  1150. ConfigEventCPId[playerid] = 0;
  1151. RCPIdCurrent[playerid] = 0;
  1152. for(new i = 0; i < 6; i++) {
  1153. EventFloats[playerid][i] = 0.0;
  1154. }
  1155. EventLastInt[playerid] = 0; EventLastVW[playerid] = 0;
  1156. for(new i = 0; i < MAX_PLAYERVEHICLES; ++i) {
  1157. PlayerVehicleInfo[playerid][i][pvModelId] = 0;
  1158. PlayerVehicleInfo[playerid][i][pvId] = INVALID_PLAYER_VEHICLE_ID;
  1159. PlayerVehicleInfo[playerid][i][pvSpawned] = 0;
  1160. PlayerVehicleInfo[playerid][i][pvSlotId] = 0;
  1161. PlayerVehicleInfo[playerid][i][pvBeingPickLocked] = 0;
  1162. PlayerVehicleInfo[playerid][i][pvAlarmTriggered] = 0;
  1163. PlayerVehicleInfo[playerid][i][pvBeingPickLockedBy] = INVALID_PLAYER_ID;
  1164. PlayerVehicleInfo[playerid][i][pvAllowedPlayerId] = INVALID_PLAYER_ID;
  1165. }
  1166. for(new i = 0; i < MAX_PLAYERTOYS; i++) {
  1167. PlayerToyInfo[playerid][i][ptID] = -1;
  1168. PlayerToyInfo[playerid][i][ptModelID] = 0;
  1169. PlayerToyInfo[playerid][i][ptBone] = 0;
  1170. PlayerToyInfo[playerid][i][ptSpecial] = 0;
  1171. }
  1172. for(new i = 0; i < 10; i++) {
  1173. PlayerHoldingObject[playerid][i] = 0;
  1174. }
  1175. for(new i = 0; i < 5; i++) {
  1176. LottoNumbers[playerid][i] = 0;
  1177. }
  1178. for(new i = 0; i < MAX_BUSINESSSALES; i++) {
  1179. Selected[playerid][i] = 0;
  1180. }
  1181. for(new x=0; x < mS_SELECTION_ITEMS; x++) {
  1182. gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
  1183. }
  1184. gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  1185. gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  1186. gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  1187. gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  1188. gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  1189. gCancelButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  1190. SpoofKill[playerid] = 0;
  1191. KillTime[playerid] = 0;
  1192. gItemAt[playerid] = 0;
  1193. TruckUsed[playerid] = INVALID_VEHICLE_ID;
  1194. pDrunkLevelLast[playerid] = 0;
  1195. pFPS[playerid] = 0;
  1196. BackupClearTimer[playerid] = 0;
  1197. Backup[playerid] = 0;
  1198. CarRadars[playerid] = 0;
  1199. PlayerInfo[playerid][pReg] = 0;
  1200. OrderAssignedTo[playerid] = INVALID_PLAYER_ID;
  1201. TruckUsed[playerid] = INVALID_VEHICLE_ID;
  1202. HouseOffer[playerid] = INVALID_PLAYER_ID;
  1203. House[playerid] = 0;
  1204. HousePrice[playerid] = 0;
  1205. playerTabbed[playerid] = 0;
  1206. playerAFK[playerid] = 0;
  1207. gBug{playerid} = 1;
  1208. TazerTimeout[playerid] = 0;
  1209. gRadio{playerid} = 1;
  1210. playerLastTyped[playerid] = 0;
  1211. pTazer{playerid} = 0;
  1212. pTazerReplace{playerid} = 0;
  1213. pCurrentWeapon{playerid} = 0;
  1214. MedicAccepted[playerid] = INVALID_PLAYER_ID;
  1215. DefendOffer[playerid] = INVALID_PLAYER_ID;
  1216. AppealOffer[playerid] = INVALID_PLAYER_ID;
  1217. AppealOfferAccepted[playerid] = 0;
  1218. PlayerInfo[playerid][pWantedLevel] = 0;
  1219. DefendPrice[playerid] = 0;
  1220. Spectating[playerid] = 0;
  1221. GettingSpectated[playerid] = INVALID_PLAYER_ID;
  1222. PlayerInfo[playerid][pPhonePrivacy] = 0;
  1223. NewbieTimer[playerid] = 0;
  1224. HlKickTimer[playerid] = 0;
  1225. HelperTimer[playerid] = 0;
  1226. VehicleOffer[playerid] = INVALID_PLAYER_ID;
  1227. VehiclePrice[playerid] = 0;
  1228. VehicleId[playerid] = -1;
  1229. NOPTrigger[playerid] = 0;
  1230. JustReported[playerid] = -1;
  1231. UsedCrack[playerid] = 0;
  1232. UsedWeed[playerid] = 0;
  1233. SexOffer[playerid] = INVALID_PLAYER_ID;
  1234. DrinkOffer[playerid] = INVALID_PLAYER_ID;
  1235. PotOffer[playerid] = INVALID_PLAYER_ID;
  1236. PotStorageID[playerid] = -1;
  1237. CrackOffer[playerid] = INVALID_PLAYER_ID;
  1238. CrackStorageID[playerid] = -1;
  1239. GunOffer[playerid] = INVALID_PLAYER_ID;
  1240. GunStorageID[playerid] = -1;
  1241. CraftOffer[playerid] = INVALID_PLAYER_ID;
  1242. RepairOffer[playerid] = INVALID_PLAYER_ID;
  1243. GuardOffer[playerid] = INVALID_PLAYER_ID;
  1244. LiveOffer[playerid] = INVALID_PLAYER_ID;
  1245. RefillOffer[playerid] = INVALID_PLAYER_ID;
  1246. MatsOffer[playerid] = INVALID_PLAYER_ID;
  1247. MatsStorageID[playerid] = -1;
  1248. MatsPrice[playerid] = 0;
  1249. MatsAmount[playerid] = 0;
  1250. BoxOffer[playerid] = INVALID_PLAYER_ID;
  1251. MarryWitnessOffer[playerid] = INVALID_PLAYER_ID;
  1252. ProposeOffer[playerid] = INVALID_PLAYER_ID;
  1253. DivorceOffer[playerid] = INVALID_PLAYER_ID;
  1254. HidePM[playerid] = 0;
  1255. PhoneOnline[playerid] = 0;
  1256. unbanip[playerid][0] = 0;
  1257. advisorchat[playerid] = 1;
  1258. ChosenSkin[playerid]=0;
  1259. SelectFChar[playerid]=0;
  1260. MatsHolding[playerid]=0;
  1261. MatDeliver[playerid]=-1;
  1262. MatDeliver2[playerid]=0;
  1263. szAdvert[playerid][0] = 0;
  1264. AdvertType[playerid] = 0;
  1265. SelectFCharPlace[playerid]=0;
  1266. GettingJob[playerid]=0;
  1267. GettingJob2[playerid]=0;
  1268. GettingJob3[playerid]=0;
  1269. GuardOffer[playerid]= INVALID_PLAYER_ID;
  1270. GuardPrice[playerid]=0;
  1271. ApprovedLawyer[playerid]=0;
  1272. CallLawyer[playerid]=0;
  1273. WantLawyer[playerid]=0;
  1274. CurrentMoney[playerid]=0;
  1275. UsedFind[playerid]=0;
  1276. CP[playerid]=0;
  1277. Condom[playerid]=0;
  1278. SexOffer[playerid]= INVALID_PLAYER_ID;
  1279. SexPrice[playerid]=0;
  1280. PlayerInfo[playerid][pAdmin]=0;
  1281. RepairOffer[playerid]= INVALID_PLAYER_ID;
  1282. RepairPrice[playerid]=0;
  1283. RepairCar[playerid]=0;
  1284. TalkingLive[playerid]=INVALID_PLAYER_ID;
  1285. LiveOffer[playerid]= INVALID_PLAYER_ID;
  1286. RefillOffer[playerid]= INVALID_PLAYER_ID;
  1287. RefillPrice[playerid]=0;
  1288. InsidePlane[playerid]=INVALID_VEHICLE_ID;
  1289. InsideMainMenu{playerid}=0;
  1290. InsideTut{playerid}=0;
  1291. CrackOffer[playerid]= INVALID_PLAYER_ID;
  1292. CrackStorageID[playerid]=-1;
  1293. PlayerCuffed[playerid]=0;
  1294. PlayerCuffedTime[playerid]=0;
  1295. PotPrice[playerid]=0;
  1296. CrackPrice[playerid]=0;
  1297. RegistrationStep[playerid]=0;
  1298. PotGram[playerid]=0;
  1299. CrackGram[playerid]=0;
  1300. PlayerInfo[playerid][pBanned]=0;
  1301. ConnectedToPC[playerid]=0;
  1302. OrderReady[playerid]=0;
  1303. GunId[playerid]=0;
  1304. GunMats[playerid]=0;
  1305. CraftId[playerid]=0;
  1306. CraftMats[playerid]=0;
  1307. HitOffer[playerid]= INVALID_PLAYER_ID;
  1308. HitToGet[playerid]= INVALID_PLAYER_ID;
  1309. InviteOffer[playerid]= INVALID_PLAYER_ID;
  1310. hInviteHouse[playerid]=INVALID_HOUSE_ID;
  1311. hInviteOffer[playerid]= INVALID_PLAYER_ID;
  1312. hInviteOfferTo[playerid]= INVALID_PLAYER_ID;
  1313. GotHit[playerid]=0;
  1314. GoChase[playerid]= INVALID_PLAYER_ID;
  1315. GetChased[playerid]= INVALID_PLAYER_ID;
  1316. CalledCops[playerid]=0;
  1317. CopsCallTime[playerid]=0;
  1318. BoxWaitTime[playerid]=0;
  1319. CalledMedics[playerid]=0;
  1320. TransportDuty[playerid]=0;
  1321. PlayerTied[playerid]=0;
  1322. MedicsCallTime[playerid]=0;
  1323. BusCallTime[playerid]=0;
  1324. TaxiCallTime[playerid]=0;
  1325. EMSCallTime[playerid]=0;
  1326. MedicCallTime[playerid]=0;
  1327. MechanicCallTime[playerid]=0;
  1328. FindTimePoints[playerid]=0;
  1329. FindingPlayer[playerid]=-1;
  1330. FindTime[playerid]=0;
  1331. JobDuty[playerid]=0;
  1332. Mobile[playerid]=INVALID_PLAYER_ID;
  1333. Music[playerid]=0;
  1334. BoxOffer[playerid]= INVALID_PLAYER_ID;
  1335. PlayerBoxing[playerid]=0;
  1336. Spectate[playerid]= INVALID_PLAYER_ID;
  1337. PlayerDrunk[playerid]=0;
  1338. PlayerDrunkTime[playerid]=0;
  1339. format(PlayerInfo[playerid][pPrisonReason],128,"None");
  1340. // FishCount[playerid]=0;
  1341. HelpingNewbie[playerid]= INVALID_PLAYER_ID;
  1342. courtjail[playerid]=0;
  1343. gLastCar[playerid]=0;
  1344. FirstSpawn[playerid]=0;
  1345. JetPack[playerid]=0;
  1346. PlayerInfo[playerid][pKills]=0;
  1347. PlayerInfo[playerid][pPaintTeam]=0;
  1348. TextSpamTimes[playerid] = 0;
  1349. TextSpamUnmute[playerid] = 0;
  1350. CommandSpamTimes[playerid] = 0;
  1351. CommandSpamUnmute[playerid] = 0;
  1352. gOoc[playerid] = 0;
  1353. arr_Towing[playerid] = INVALID_VEHICLE_ID;
  1354. gNews[playerid] = 0;
  1355. PlayerInfo[playerid][pToggledChats][0] = 1;
  1356. gPlayerLogged{playerid} = 0;
  1357. gPlayerLogTries[playerid] = 0;
  1358. IsSpawned[playerid] = 0;
  1359. SpawnKick[playerid] = 0;
  1360. PlayerStoned[playerid] = 0;
  1361. StartTime[playerid] = 0;
  1362. TicketOffer[playerid] = INVALID_PLAYER_ID;
  1363. TicketMoney[playerid] = 0;
  1364. PlayerInfo[playerid][pVehicleKeysFrom] = INVALID_PLAYER_ID;
  1365. ActiveChatbox[playerid] = 1;
  1366. TutStep[playerid] = 0;
  1367. PlayerInfo[playerid][pVehicleKeys] = INVALID_PLAYER_VEHICLE_ID;
  1368. TaxiAccepted[playerid] = INVALID_PLAYER_ID;
  1369. EMSAccepted[playerid] = INVALID_PLAYER_ID;
  1370. BusAccepted[playerid] = INVALID_PLAYER_ID;
  1371. HireCar[playerid] = 299;
  1372. TransportValue[playerid] = 0;
  1373. TransportMoney[playerid] = 0;
  1374. TransportTime[playerid] = 0;
  1375. TransportCost[playerid] = 0;
  1376. TransportDriver[playerid] = INVALID_PLAYER_ID;
  1377. Locator[playerid] = 0;
  1378. ReleasingMenu[playerid] = INVALID_PLAYER_ID;
  1379. Fishes[playerid][pLastFish] = 0;
  1380. Fishes[playerid][pFishID] = 0;
  1381. ProposeOffer[playerid] = INVALID_PLAYER_ID;
  1382. MarryWitness[playerid] = INVALID_PLAYER_ID;
  1383. MarryWitnessOffer[playerid] = INVALID_PLAYER_ID;
  1384. MarriageCeremoney[playerid] = 0;
  1385. ProposedTo[playerid] = INVALID_PLAYER_ID;
  1386. GotProposedBy[playerid] = INVALID_PLAYER_ID;
  1387. DivorceOffer[playerid] = INVALID_PLAYER_ID;
  1388. gBike[playerid] = 0;
  1389. gBikeRenting[playerid] = 0;
  1390. Fixr[playerid] = 0;
  1391. VehicleSpawned[playerid] = 0;
  1392. ReportCount[playerid] = 0;
  1393. ReportHourCount[playerid] = 0;
  1394. WDReportCount[playerid] = 0;
  1395. WDReportHourCount[playerid] = 0;
  1396. PlayerInfo[playerid][pServiceTime] = 0;
  1397. Homes[playerid] = 0;
  1398. sobeitCheckvar[playerid] = 0;
  1399. sobeitCheckIsDone[playerid] = 0;
  1400. IsPlayerFrozen[playerid] = 0;
  1401. strdel(PlayerInfo[playerid][pAutoTextReply], 0, 64);
  1402. rBigEarT[playerid] = 0;
  1403. aLastShot[playerid] = INVALID_PLAYER_ID;
  1404. aLastShotBone[playerid] = 0;
  1405. if(IsValidDynamic3DTextLabel(RFLTeamN3D[playerid])) {
  1406. DestroyDynamic3DTextLabel(RFLTeamN3D[playerid]);
  1407. RFLTeamN3D[playerid] = Text3D:-1;
  1408. }
  1409. SpecTime[playerid] = 0;
  1410. PlayerShots[playerid] = 0;
  1411. PlayerSniperShots[playerid] = 0;
  1412. PlayerKills[playerid] = 0;
  1413. // These need to be reset to prevent some bugs (DO NOT REMOVE)
  1414. PlayerInfo[playerid][pModel] = 0;
  1415. PlayerInfo[playerid][pLeader] = INVALID_GROUP_ID;
  1416. PlayerInfo[playerid][pMember] = INVALID_GROUP_ID;
  1417. PlayerInfo[playerid][pDivision] = INVALID_DIVISION;
  1418. strcpy(PlayerInfo[playerid][pBadge], "None", 9);
  1419. PlayerInfo[playerid][pRank] = INVALID_RANK;
  1420. PlayerInfo[playerid][pOrder] = 0;
  1421. PlayerInfo[playerid][pOrderConfirmed] = 0;
  1422. PlayerInfo[playerid][pBusiness] = INVALID_BUSINESS_ID;
  1423. acstruct[playerid][LastOnFootPosition][0] = 0.0; acstruct[playerid][LastOnFootPosition][1] = 0.0; acstruct[playerid][LastOnFootPosition][2] = 0.0;
  1424. acstruct[playerid][checkmaptp] = 0; acstruct[playerid][maptplastclick] = 0;
  1425. acstruct[playerid][maptp][0] = 0.0; acstruct[playerid][maptp][1] = 0.0; acstruct[playerid][maptp][2] = 0.0;
  1426. PlayerInfo[playerid][pLastPass][0] = 0;
  1427. PlayerInfo[playerid][pGroupToy][0] = 0.0;
  1428. PlayerInfo[playerid][pGroupToy][1] = 0.0;
  1429. PlayerInfo[playerid][pGroupToy][2] = 0.0;
  1430. PlayerInfo[playerid][pGroupToy][3] = 0.0;
  1431. PlayerInfo[playerid][pGroupToy][4] = 0.0;
  1432. PlayerInfo[playerid][pGroupToy][5] = 0.0;
  1433. PlayerInfo[playerid][pGroupToy][6] = 1.0;
  1434. PlayerInfo[playerid][pGroupToy][7] = 1.0;
  1435. PlayerInfo[playerid][pGroupToy][8] = 1.0;
  1436. PlayerInfo[playerid][pHolsteredWeapon] = 0;
  1437. IsDoingAnim[playerid] = 0;
  1438. GhostHacker[playerid][0] = 0;
  1439. GhostHacker[playerid][1] = gettime();
  1440. GhostHacker[playerid][2] = 0;
  1441. GhostHacker[playerid][3] = 0;
  1442. GhostHacker[playerid][4] = 0;
  1443. GhostHacker[playerid][5] = gettime();
  1444. GhostHacker[playerid][6] = gettime();
  1445. foreach(new x: Player)
  1446. {
  1447. ShotPlayer[playerid][x] = 0;
  1448. }
  1449. for(new s = 0; s < 12; s++) {
  1450. PlayerInfo[playerid][pAGuns][s] = 0;
  1451. PlayerInfo[playerid][pGuns][s] = 0;
  1452. }
  1453. for(new s = 0; s < 40; s++) {
  1454. ListItemReportId[playerid][s] = -1;
  1455. }
  1456. for(new s = 0; s < 20; s++) {
  1457. ListItemRCPId[playerid][s] = -1;
  1458. }
  1459. CancelReport[playerid] = -1;
  1460. GiveKeysTo[playerid] = INVALID_PLAYER_ID;
  1461. RocketExplosions[playerid] = -1;
  1462. // ClearFishes(playerid); no.
  1463. ClearMarriage(playerid);
  1464. // Crash Fix - GhoulSlayeR
  1465. if(!InvalidNameCheck(playerid)) {
  1466. return 1;
  1467. }
  1468. Format_PlayerName(playerid);
  1469. CheckAdminWhitelist(playerid);
  1470. CheckBanEx(playerid);
  1471. new string[128], serial[64];
  1472. gpci(playerid, serial, sizeof(serial));
  1473. format(string, sizeof(string), "%s/checks/gpci.php?g=%s&n=%s&i=%s", SAMP_WEB, serial, GetPlayerNameExt(playerid), GetPlayerIpEx(playerid));
  1474. HTTP(0, HTTP_HEAD, string, "", "");
  1475. // Main Menu Features
  1476. InsideMainMenu{playerid} = 0;
  1477. InsideTut{playerid} = 0;
  1478. ShowMainMenuGUI(playerid);
  1479. //SetPlayerJoinCamera(playerid);
  1480. ClearChatbox(playerid);
  1481. SetPlayerVirtualWorld(playerid, 1);
  1482. SetPlayerColor(playerid,TEAM_HIT_COLOR);
  1483. SendClientMessage( playerid, COLOR_WHITE, "SERVER: Welcome to Next Generation Roleplay." );
  1484. SyncPlayerTime(playerid);
  1485. ShowNoticeGUIFrame(playerid, 1);
  1486. logincheck[playerid] = SetTimerEx("LoginCheck", 120000, 0, "i", playerid);
  1487. SetTimerEx("LoginCheckEx", 5000, 0, "i", playerid);
  1488. gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
  1489. SetHealth(playerid, 100);
  1490. SetArmour(playerid, 0);
  1491. Bit_Off(arrPlayerBits[playerid], dr_bitUsedDrug);
  1492. Bit_Off(arrPlayerBits[playerid], dr_bitInDrugEffect);
  1493. Bit_Off(arrPlayerBits[playerid], phone_bitState);
  1494. Bit_Off(arrPlayerBits[playerid], phone_bitCamState);
  1495. Bit_Off(arrPlayerBits[playerid], phone_bitTraceState);
  1496. Bit_Off(arrPlayerBits[playerid], bitFPS);
  1497. Bit_Off(arrPlayerBits[playerid], pTurfRadar);
  1498. return 1;
  1499. }
  1500. public OnPlayerDisconnect(playerid, reason)
  1501. {
  1502. if(!isnull(unbanip[playerid]))
  1503. {
  1504. new string[26];
  1505. format(string, sizeof(string), "unbanip %s", unbanip[playerid]);
  1506. SendRconCommand(string);
  1507. }
  1508. KillTimer(logincheck[playerid]);
  1509. if(GetPVarType(playerid, "SpectatingWatch")) SetPVarInt(GetPVarInt(playerid, "SpectatingWatch"), "BeingSpectated", 0);
  1510. foreach(new i: Player)
  1511. {
  1512. if(Spectating[i] > 0 && Spectate[i] == playerid) {
  1513. SetPVarInt(i, "StartedWatching", 0);
  1514. SetPVarInt(i, "NextWatch", 0);
  1515. SetPVarInt(i, "SpecOff", 1);
  1516. Spectating[i] = 0;
  1517. SpecTime[i] = 0;
  1518. Spectate[i] = INVALID_PLAYER_ID;
  1519. GettingSpectated[playerid] = INVALID_PLAYER_ID;
  1520. TogglePlayerSpectating(i, false);
  1521. SetCameraBehindPlayer(i);
  1522. SendClientMessageEx(i, COLOR_WHITE, "The player you were spectating has left the server.");
  1523. }
  1524. if(GetPVarType(i, "_dCheck") && GetPVarInt(i, "_dCheck") == playerid) {
  1525. DeletePVar(i, "_dCheck");
  1526. SendClientMessageEx(i, COLOR_WHITE, "The player you were damage checking has left the server.");
  1527. }
  1528. if(GetPVarType(i, "sellbackpack") && GetPVarInt(i, "sellbackpack") == playerid) DeletePVar(i, "sellbackpack");
  1529. }
  1530. // Why save on people who haven't logged in!
  1531. if(gPlayerLogged{playerid} == 1)
  1532. {
  1533. if(TempNumber[playerid] == 1) {
  1534. PlayerInfo[playerid][pPnumber] = GetPVarInt(playerid, "oldnum");
  1535. TempNumber[playerid] = 0;
  1536. }
  1537. if(GetPVarType(playerid, "signID") && IsValidDynamicObject(GetPVarInt(playerid, "signID"))) DestroyDynamicObject(GetPVarInt(playerid, "signID"));
  1538. g_mysql_RemoveDumpFile(GetPlayerSQLId(playerid));
  1539. if(HungerPlayerInfo[playerid][hgInEvent] == 1)
  1540. {
  1541. if(hgActive == 2)
  1542. {
  1543. if(hgPlayerCount == 3)
  1544. {
  1545. new szmessage[128];
  1546. format(szmessage, sizeof(szmessage), "** %s has came in third place in the Hunger Games Event.", GetPlayerNameEx(playerid));
  1547. SendClientMessageToAll(COLOR_LIGHTBLUE, szmessage);
  1548. SetHealth(playerid, HungerPlayerInfo[playerid][hgLastHealth]);
  1549. SetArmour(playerid, HungerPlayerInfo[playerid][hgLastArmour]);
  1550. SetPlayerVirtualWorld(playerid, HungerPlayerInfo[playerid][hgLastVW]);
  1551. SetPlayerInterior(playerid, HungerPlayerInfo[playerid][hgLastInt]);
  1552. SetPlayerPos(playerid, HungerPlayerInfo[playerid][hgLastPosition][0], HungerPlayerInfo[playerid][hgLastPosition][1], HungerPlayerInfo[playerid][hgLastPosition][2]);
  1553. ResetPlayerWeapons(playerid);
  1554. HungerPlayerInfo[playerid][hgInEvent] = 0;
  1555. hgPlayerCount--;
  1556. HideHungerGamesTextdraw(playerid);
  1557. PlayerInfo[playerid][pRewardDrawChance] += 10;
  1558. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "** You have been given 10 Draw Chances for the Fall Into Fun Event.");
  1559. for(new w = 0; w < 12; w++)
  1560. {
  1561. PlayerInfo[playerid][pGuns][w] = HungerPlayerInfo[playerid][hgLastWeapon][w];
  1562. if(PlayerInfo[playerid][pGuns][w] > 0 && PlayerInfo[playerid][pAGuns][w] == 0)
  1563. {
  1564. GivePlayerValidWeapon(playerid, PlayerInfo[playerid][pGuns][w]);
  1565. }
  1566. }
  1567. }
  1568. else if(hgPlayerCount == 2)
  1569. {
  1570. new szmessage[128];
  1571. format(szmessage, sizeof(szmessage), "** %s has came in second place in the Hunger Games Event.", GetPlayerNameEx(playerid));
  1572. SendClientMessageToAll(COLOR_LIGHTBLUE, szmessage);
  1573. SetHealth(playerid, HungerPlayerInfo[playerid][hgLastHealth]);
  1574. SetArmour(playerid, HungerPlayerInfo[playerid][hgLastArmour]);
  1575. SetPlayerVirtualWorld(playerid, HungerPlayerInfo[playerid][hgLastVW]);
  1576. SetPlayerInterior(playerid, HungerPlayerInfo[playerid][hgLastInt]);
  1577. SetPlayerPos(playerid, HungerPlayerInfo[playerid][hgLastPosition][0], HungerPlayerInfo[playerid][hgLastPosition][1], HungerPlayerInfo[playerid][hgLastPosition][2]);
  1578. ResetPlayerWeapons(playerid);
  1579. HungerPlayerInfo[playerid][hgInEvent] = 0;
  1580. hgPlayerCount--;
  1581. HideHungerGamesTextdraw(playerid);
  1582. PlayerInfo[playerid][pRewardDrawChance] += 25;
  1583. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "** You have been given 25 Draw Chances for the Fall Into Fun Event.");
  1584. for(new w = 0; w < 12; w++)
  1585. {
  1586. PlayerInfo[playerid][pGuns][w] = HungerPlayerInfo[playerid][hgLastWeapon][w];
  1587. if(PlayerInfo[playerid][pGuns][w] > 0 && PlayerInfo[playerid][pAGuns][w] == 0)
  1588. {
  1589. GivePlayerValidWeapon(playerid, PlayerInfo[playerid][pGuns][w]);
  1590. }
  1591. }
  1592. foreach(new i: Player)
  1593. {
  1594. if(HungerPlayerInfo[i][hgInEvent] == 1)
  1595. {
  1596. format(szmessage, sizeof(szmessage), "** %s has came in first place in the Hunger Games Event.", GetPlayerNameEx(i));
  1597. SendClientMessageToAll(COLOR_LIGHTBLUE, szmessage);
  1598. SetHealth(i, HungerPlayerInfo[i][hgLastHealth]);
  1599. SetArmour(i, HungerPlayerInfo[i][hgLastArmour]);
  1600. SetPlayerVirtualWorld(i, HungerPlayerInfo[i][hgLastVW]);
  1601. SetPlayerInterior(i, HungerPlayerInfo[i][hgLastInt]);
  1602. SetPlayerPos(i, HungerPlayerInfo[i][hgLastPosition][0], HungerPlayerInfo[i][hgLastPosition][1], HungerPlayerInfo[i][hgLastPosition][2]);
  1603. ResetPlayerWeapons(i);
  1604. HungerPlayerInfo[i][hgInEvent] = 0;
  1605. hgPlayerCount--;
  1606. HideHungerGamesTextdraw(i);
  1607. PlayerInfo[i][pRewardDrawChance] += 50;
  1608. SendClientMessageEx(i, COLOR_LIGHTBLUE, "** You have been given 50 Draw Chances for the Fall Into Fun Event.");
  1609. hgActive = 0;
  1610. for(new w = 0; w < 12; w++)
  1611. {
  1612. PlayerInfo[i][pGuns][w] = HungerPlayerInfo[i][hgLastWeapon][w];
  1613. if(PlayerInfo[i][pGuns][w] > 0 && PlayerInfo[i][pAGuns][w] == 0)
  1614. {
  1615. GivePlayerValidWeapon(i, PlayerInfo[i][pGuns][w]);
  1616. }
  1617. }
  1618. }
  1619. }
  1620. for(new i = 0; i < 600; i++)
  1621. {
  1622. if(IsValidDynamic3DTextLabel(HungerBackpackInfo[i][hgBackpack3DText]))
  1623. {
  1624. DestroyDynamic3DTextLabel(HungerBackpackInfo[i][hgBackpack3DText]);
  1625. }
  1626. if(IsValidDynamicPickup(HungerBackpackInfo[i][hgBackpackPickupId]))
  1627. {
  1628. DestroyDynamicPickup(HungerBackpackInfo[i][hgBackpackPickupId]);
  1629. }
  1630. HungerBackpackInfo[i][hgActiveEx] = 0;
  1631. }
  1632. }
  1633. else if(hgPlayerCount > 3)
  1634. {
  1635. SetHealth(playerid, HungerPlayerInfo[playerid][hgLastHealth]);
  1636. SetArmour(playerid, HungerPlayerInfo[playerid][hgLastArmour]);
  1637. SetPlayerVirtualWorld(playerid, HungerPlayerInfo[playerid][hgLastVW]);
  1638. SetPlayerInterior(playerid, HungerPlayerInfo[playerid][hgLastInt]);
  1639. SetPlayerPos(playerid, HungerPlayerInfo[playerid][hgLastPosition][0], HungerPlayerInfo[playerid][hgLastPosition][1], HungerPlayerInfo[playerid][hgLastPosition][2]);
  1640. ResetPlayerWeapons(playerid);
  1641. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You have died and has been removed from the Hunger Games Event, better luck next time.");
  1642. HungerPlayerInfo[playerid][hgInEvent] = 0;
  1643. hgPlayerCount--;
  1644. HideHungerGamesTextdraw(playerid);
  1645. for(new w = 0; w < 12; w++)
  1646. {
  1647. PlayerInfo[playerid][pGuns][w] = HungerPlayerInfo[playerid][hgLastWeapon][w];
  1648. if(PlayerInfo[playerid][pGuns][w] > 0 && PlayerInfo[playerid][pAGuns][w] == 0)
  1649. {
  1650. GivePlayerValidWeapon(playerid, PlayerInfo[playerid][pGuns][w]);
  1651. }
  1652. }
  1653. }
  1654. new string[128];
  1655. format(string, sizeof(string), "Players in event: %d", hgPlayerCount);
  1656. foreach(new i: Player)
  1657. {
  1658. PlayerTextDrawSetString(i, HungerPlayerInfo[i][hgPlayerText], string);
  1659. }
  1660. return true;
  1661. }
  1662. }
  1663. if (GetPVarInt(playerid, "_BikeParkourStage") > 0)
  1664. {
  1665. new slot = GetPVarInt(playerid, "_BikeParkourSlot");
  1666. new biz = InBusiness(playerid);
  1667. DestroyDynamicPickup(GetPVarInt(playerid, "_BikeParkourPickup"));
  1668. Businesses[biz][bGymBikePlayers][slot] = INVALID_PLAYER_ID;
  1669. if (GetPVarInt(playerid, "_BikeParkourStage") > 1)
  1670. {
  1671. DestroyVehicle(Businesses[biz][bGymBikeVehicles][slot]);
  1672. Businesses[biz][bGymBikeVehicles][slot] = INVALID_VEHICLE_ID;
  1673. }
  1674. }
  1675. if(GetPVarType(playerid, "DeliveringVehicleTime")) {
  1676. if(GetPVarType(playerid, "LockPickVehicleSQLId")) {
  1677. new szQuery[128];
  1678. mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `vehicles` SET `pvFuel` = %0.5f WHERE `id` = '%d' AND `sqlID` = '%d'", VehicleFuel[GetPVarInt(playerid, "LockPickVehicle")], GetPVarInt(playerid, "LockPickVehicleSQLId"), GetPVarInt(playerid, "LockPickPlayerSQLId"));
  1679. mysql_tquery(MainPipeline, szQuery, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
  1680. }
  1681. else {
  1682. new slot = GetPlayerVehicle(GetPVarInt(playerid, "LockPickPlayer"), GetPVarInt(playerid, "LockPickVehicle")),
  1683. ownerid = GetPVarInt(playerid, "LockPickPlayer");
  1684. --PlayerCars;
  1685. VehicleSpawned[ownerid]--;
  1686. PlayerVehicleInfo[ownerid][slot][pvBeingPickLocked] = 0;
  1687. PlayerVehicleInfo[ownerid][slot][pvBeingPickLockedBy] = INVALID_PLAYER_ID;
  1688. PlayerVehicleInfo[ownerid][slot][pvAlarmTriggered] = 0;
  1689. PlayerVehicleInfo[ownerid][slot][pvSpawned] = 0;
  1690. PlayerVehicleInfo[ownerid][slot][pvFuel] = VehicleFuel[GetPVarInt(playerid, "LockPickVehicle")];
  1691. GetVehicleHealth(PlayerVehicleInfo[ownerid][slot][pvId], PlayerVehicleInfo[ownerid][slot][pvHealth]);
  1692. PlayerVehicleInfo[ownerid][slot][pvId] = INVALID_PLAYER_VEHICLE_ID;
  1693. g_mysql_SaveVehicle(ownerid, slot);
  1694. }
  1695. DestroyVehicle(GetPVarInt(playerid, "LockPickVehicle"));
  1696. DisablePlayerCheckpoint(playerid);
  1697. }
  1698. if(GetPVarType(playerid, "AttemptingLockPick")) {
  1699. if(GetPVarType(playerid, "LockPickVehicleSQLId")) {
  1700. DestroyVehicle(GetPVarInt(playerid, "LockPickVehicle"));
  1701. }
  1702. else {
  1703. new slot = GetPlayerVehicle(GetPVarInt(playerid, "LockPickPlayer"), GetPVarInt(playerid, "LockPickVehicle"));
  1704. PlayerVehicleInfo[GetPVarInt(playerid, "LockPickPlayer")][slot][pvBeingPickLocked] = 0;
  1705. PlayerVehicleInfo[GetPVarInt(playerid, "LockPickPlayer")][slot][pvBeingPickLockedBy] = INVALID_PLAYER_ID;
  1706. }
  1707. }
  1708. if(GetPVarType(playerid, "Gas_TrailerID"))
  1709. {
  1710. if(GetVehicleModel(GetPVarInt(playerid, "Gas_TrailerID")) == 584)
  1711. {
  1712. printf("Deleting Trailer. Veh ID %d Player %s", GetPVarInt(playerid, "Gas_TrailerID"), GetPlayerNameExt(playerid));
  1713. DestroyVehicle(GetPVarInt(playerid, "Gas_TrailerID"));
  1714. }
  1715. }
  1716. // added to prevent trucks holding shit after logging out. hotfix #1069
  1717. if(TruckUsed[playerid] != INVALID_VEHICLE_ID)
  1718. {
  1719. SetVehicleToRespawn(TruckUsed[playerid]);
  1720. }
  1721. if (GetPVarType(playerid, "_BoxingFight"))
  1722. {
  1723. new fighterid = GetPVarInt(playerid, "_BoxingFight") - 1;
  1724. DeletePVar(fighterid, "_BoxingFight");
  1725. SendClientMessageEx(fighterid, COLOR_GREY, "The person you were fighting left the arena.");
  1726. SetPVarInt(fighterid, "_BoxingFightOver", gettime() + 1);
  1727. new biz = InBusiness(fighterid);
  1728. if (Businesses[biz][bGymBoxingArena1][0] == fighterid || Businesses[biz][bGymBoxingArena1][1] == fighterid) // first arena
  1729. {
  1730. Businesses[biz][bGymBoxingArena1][0] = INVALID_PLAYER_ID;
  1731. Businesses[biz][bGymBoxingArena1][1] = INVALID_PLAYER_ID;
  1732. }
  1733. else if (Businesses[biz][bGymBoxingArena2][0] == fighterid || Businesses[biz][bGymBoxingArena2][1] == fighterid) // second arena
  1734. {
  1735. Businesses[biz][bGymBoxingArena2][0] = INVALID_PLAYER_ID;
  1736. Businesses[biz][bGymBoxingArena2][1] = INVALID_PLAYER_ID;
  1737. }
  1738. PlayerInfo[playerid][pPos_x] = 2913.2175;
  1739. PlayerInfo[playerid][pPos_y] = -2288.1914;
  1740. PlayerInfo[playerid][pPos_z] = 7.2543;
  1741. }
  1742. if(RocketExplosions[playerid] != -1)
  1743. {
  1744. DestroyDynamicObject(Rocket[playerid]);
  1745. DestroyDynamicObject(RocketLight[playerid]);
  1746. DestroyDynamicObject(RocketSmoke[playerid]);
  1747. }
  1748. if(GetPVarType(playerid, "pBoomBox"))
  1749. {
  1750. DestroyDynamicObject(GetPVarInt(playerid, "pBoomBox"));
  1751. DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, "pBoomBoxLabel"));
  1752. if(GetPVarType(playerid, "pBoomBoxArea"))
  1753. {
  1754. new string[128];
  1755. format(string, sizeof(string), "The boombox owner (%s) has logged off", GetPlayerNameEx(playerid));
  1756. foreach(new i: Player)
  1757. {
  1758. if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "pBoomBoxArea")))
  1759. {
  1760. StopAudioStreamForPlayerEx(i);
  1761. SendClientMessage(i, COLOR_PURPLE, string);
  1762. }
  1763. }
  1764. }
  1765. }
  1766. #if defined zombiemode
  1767. if(GetPVarType(playerid, "pZombieBit"))
  1768. {
  1769. MakeZombie(playerid);
  1770. }
  1771. #endif
  1772. if(GetPVarType(playerid, "RentedVehicle")) {
  1773. DestroyVehicle(GetPVarInt(playerid, "RentedVehicle"));
  1774. }
  1775. if(GetPVarType(playerid, "pkrTableID")) {
  1776. LeavePokerTable(playerid);
  1777. }
  1778. if(GetPVarType(playerid, "pTable")) {
  1779. DestroyPokerTable(GetPVarInt(playerid, "pTable"));
  1780. }
  1781. if(GetPVarType(playerid, "DraggingPlayer"))
  1782. {
  1783. DeletePVar(GetPVarInt(playerid, "DraggingPlayer"), "BeingDragged");
  1784. }
  1785. if(pTazer{playerid} == 1) GivePlayerValidWeapon(playerid,pTazerReplace{playerid});
  1786. if(GetPVarInt(playerid, "SpeedRadar") == 1) GivePlayerValidWeapon(playerid, GetPVarInt(playerid, "RadarReplacement"));
  1787. if(GetPVarType(playerid, "MovingStretcher")) {
  1788. KillTimer(GetPVarInt(playerid, "TickEMSMove"));
  1789. }
  1790. if(GetPVarInt(playerid, "Injured") == 1) {
  1791. PlayerInfo[playerid][pHospital] = 1;
  1792. ResetPlayerWeaponsEx(playerid);
  1793. }
  1794. KillEMSQueue(playerid);
  1795. if(GetPVarInt(playerid, "HeroinEffect")) {
  1796. KillTimer(GetPVarInt(playerid, "HeroinEffect"));
  1797. PlayerInfo[playerid][pHospital] = 1;
  1798. KillEMSQueue(playerid);
  1799. ResetPlayerWeaponsEx(playerid);
  1800. }
  1801. if(GetPVarInt(playerid, "AttemptPurify"))
  1802. {
  1803. Purification[0] = 0;
  1804. KillTimer(GetPVarInt(playerid, "AttemptPurify"));
  1805. }
  1806. if(control[playerid] == 1) {
  1807. control[playerid] = 0;
  1808. KillTimer(ControlTimer[playerid]);
  1809. }
  1810. if(PlayerInfo[playerid][pLockCar] != INVALID_VEHICLE_ID) {
  1811. vehicle_unlock_doors(PlayerInfo[playerid][pLockCar]);
  1812. PlayerInfo[playerid][pLockCar] = INVALID_VEHICLE_ID;
  1813. }
  1814. if(PlayerInfo[playerid][pVehicleKeysFrom] != INVALID_PLAYER_ID) {
  1815. PlayerVehicleInfo[PlayerInfo[playerid][pVehicleKeysFrom]][PlayerInfo[playerid][pVehicleKeys]][pvAllowedPlayerId] = INVALID_PLAYER_ID;
  1816. }
  1817. if(GetPVarType(playerid, "ttSeller"))
  1818. {
  1819. SendClientMessageEx(GetPVarInt(playerid, "ttSeller"), COLOR_GRAD2, "The buyer has disconnected from the server.");
  1820. DeletePVar(GetPVarInt(playerid, "ttSeller"), "ttBuyer");
  1821. DeletePVar(GetPVarInt(playerid, "ttSeller"), "ttCost");
  1822. DeletePVar(playerid, "ttSeller");
  1823. HideTradeToysGUI(playerid);
  1824. }
  1825. if(GetPVarType(playerid, "buyerVoucher"))
  1826. {
  1827. DeletePVar(GetPVarInt(playerid, "buyerVoucher"), "sellerVoucher");
  1828. }
  1829. if(GetPVarType(playerid, "sellerVoucher"))
  1830. {
  1831. DeletePVar(GetPVarInt(playerid, "sellerVoucher"), "buyerVoucher");
  1832. }
  1833. if(HackingMods[playerid] > 0) { HackingMods[playerid] = 0; }
  1834. if(gettime() >= PlayerInfo[playerid][pMechTime]) PlayerInfo[playerid][pMechTime] = 0;
  1835. if(gettime() >= PlayerInfo[playerid][pLawyerTime]) PlayerInfo[playerid][pLawyerTime] = 0;
  1836. if(gettime() >= PlayerInfo[playerid][pDrugsTime]) PlayerInfo[playerid][pDrugsTime] = 0;
  1837. if(gettime() >= PlayerInfo[playerid][pSexTime]) PlayerInfo[playerid][pSexTime] = 0;
  1838. if(GetPVarInt(playerid, "HidingKnife") == 1) PlayerInfo[playerid][pGuns][1] = 4;
  1839. //if(GetPVarType(playerid, "IsInArena")) LeavePaintballArena(playerid, GetPVarInt(playerid, "IsInArena"));
  1840. // Trucker revamp.
  1841. /*for(new i = 0; i < MAX_VEHICLES; i++)
  1842. {
  1843. if(TruckUsedBy[i] == playerid) TruckUsedBy[i] = -1; // Resets a truck if a player disconnects mid-route.
  1844. PlayerInfo[playerid][pUsingTruck] = -1;
  1845. }*/
  1846. new string[128];
  1847. switch(reason)
  1848. {
  1849. case 0:
  1850. {
  1851. if(PlayerInfo[playerid][pAdmin] >= 2 && Spectating[playerid] == 1)
  1852. {
  1853. PlayerInfo[playerid][pPos_x] = GetPVarFloat(playerid, "SpecPosX");
  1854. PlayerInfo[playerid][pPos_y] = GetPVarFloat(playerid, "SpecPosY");
  1855. PlayerInfo[playerid][pPos_z] = GetPVarFloat(playerid, "SpecPosZ");
  1856. PlayerInfo[playerid][pInt] = GetPVarInt(playerid, "SpecInt");
  1857. PlayerInfo[playerid][pVW] = GetPVarInt(playerid, "SpecVW");
  1858. DeletePVar(playerid, "SpecOff");
  1859. if(GetPVarType(playerid, "pGodMode"))
  1860. {
  1861. SetHealth(playerid, 0x7FB00000);
  1862. SetArmour(playerid, 0x7FB00000);
  1863. }
  1864. GettingSpectated[Spectate[playerid]] = INVALID_PLAYER_ID;
  1865. Spectate[playerid] = INVALID_PLAYER_ID;
  1866. }
  1867. else
  1868. {
  1869. format(string, sizeof(string), "%s has left the server (timeout).", GetPlayerNameEx(playerid));
  1870. ProxDetector(30.0, playerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  1871. }
  1872. format(string, sizeof(string), "%s (ID: %d | SQL ID: %d | Level: %d | IP: %s) has timed out.", GetPlayerNameExt(playerid), playerid, GetPlayerSQLId(playerid), PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pIP]);
  1873. Log("logs/login.log", string);
  1874. if(PlayerCuffed[playerid] != 0)
  1875. {
  1876. if(PlayerCuffed[playerid] == 2)
  1877. {
  1878. SetHealth(playerid, GetPVarFloat(playerid, "cuffhealth"));
  1879. SetArmour(playerid, GetPVarFloat(playerid, "cuffarmor"));
  1880. DeletePVar(playerid, "cuffhealth");
  1881. DeletePVar(playerid, "PlayerCuffed");
  1882. }
  1883. strcpy(PlayerInfo[playerid][pPrisonReason], "[IC] DMCF ((CWC))", 128);
  1884. strcpy(PlayerInfo[playerid][pPrisonedBy], "System - CWC", 128);
  1885. if(PlayerInfo[playerid][pWantedJailTime] != 0) PlayerInfo[playerid][pJailTime] += PlayerInfo[playerid][pWantedJailTime]*60; else PlayerInfo[playerid][pJailTime] += 120*60;
  1886. if(PlayerInfo[playerid][pWantedJailFine] != 0) GivePlayerCash(playerid, -PlayerInfo[playerid][pWantedJailFine]);
  1887. format(string, sizeof(string), "%s has crashed while cuffed. (ID: %d | SQLID: %D | JT: %d | F: %d | IP: %s)", GetPlayerNameExt(playerid), playerid, GetPlayerSQLId(playerid), PlayerInfo[playerid][pWantedJailTime], PlayerInfo[playerid][pWantedJailFine], PlayerInfo[playerid][pIP]);
  1888. Log("logs/login.log", string);
  1889. PlayerInfo[playerid][pBailPrice] = 15000000;
  1890. PlayerInfo[playerid][pWantedJailFine] = 0;
  1891. PlayerInfo[playerid][pWantedJailTime] = 0;
  1892. PlayerInfo[playerid][pWantedLevel] = 0;
  1893. }
  1894. if(((0 <= PlayerInfo[playerid][pMember] < MAX_GROUPS)) && (PlayerInfo[playerid][pAdmin] < 2 || (PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pTogReports])))
  1895. {
  1896. new badge[12], employer[GROUP_MAX_NAME_LEN], rank[GROUP_MAX_RANK_LEN], division[GROUP_MAX_DIV_LEN];
  1897. if(strcmp(PlayerInfo[playerid][pBadge], "None", true) != 0) format(badge, sizeof(badge), "[%s] ", PlayerInfo[playerid][pBadge]);
  1898. GetPlayerGroupInfo(playerid, rank, division, employer);
  1899. if(IsACop(playerid))
  1900. {
  1901. if(PlayerInfo[playerid][pDuty])
  1902. {
  1903. format(string, sizeof(string), "** %s%s %s is code 0 **", badge, rank, GetPlayerNameEx(playerid));
  1904. foreach(new i: Player)
  1905. {
  1906. if(PlayerInfo[i][pToggledChats][12] == 0)
  1907. {
  1908. if(PlayerInfo[i][pMember] == PlayerInfo[playerid][pMember]) SendClientMessageEx(i, arrGroupData[PlayerInfo[playerid][pMember]][g_hRadioColour] * 256 + 255, string);
  1909. }
  1910. }
  1911. }
  1912. format(string, sizeof string, "%s%s %s has timed out.", badge, rank, GetPlayerNameEx(playerid));
  1913. GroupLog(PlayerInfo[playerid][pMember], string);
  1914. }
  1915. else if((0 <= PlayerInfo[playerid][pMember] < MAX_GROUPS) && !IsACop(playerid))
  1916. {
  1917. if(PlayerInfo[playerid][pDuty] || arrGroupData[PlayerInfo[playerid][pMember]][g_iGroupType] == GROUP_TYPE_CRIMINAL)
  1918. {
  1919. format(string, sizeof(string), "** %s%s %s is no longer available (( lost connection )) **", badge, rank, GetPlayerNameEx(playerid));
  1920. foreach(new i: Player)
  1921. {
  1922. if(PlayerInfo[i][pToggledChats][12] == 0)
  1923. {
  1924. if(PlayerInfo[i][pMember] == PlayerInfo[playerid][pMember]) SendClientMessageEx(i, arrGroupData[PlayerInfo[playerid][pMember]][g_hRadioColour] * 256 + 255, string);
  1925. }
  1926. }
  1927. }
  1928. format(string, sizeof string, "%s%s %s has lost connection.", badge, rank, GetPlayerNameEx(playerid));
  1929. GroupLog(PlayerInfo[playerid][pMember], string);
  1930. }
  1931. }
  1932. }
  1933. case 1:
  1934. {
  1935. if(PlayerInfo[playerid][pAdmin] >= 2 && Spectating[playerid] == 1)
  1936. {
  1937. PlayerInfo[playerid][pPos_x] = GetPVarFloat(playerid, "SpecPosX");
  1938. PlayerInfo[playerid][pPos_y] = GetPVarFloat(playerid, "SpecPosY");
  1939. PlayerInfo[playerid][pPos_z] = GetPVarFloat(playerid, "SpecPosZ");
  1940. PlayerInfo[playerid][pInt] = GetPVarInt(playerid, "SpecInt");
  1941. PlayerInfo[playerid][pVW] = GetPVarInt(playerid, "SpecVW");
  1942. DeletePVar(playerid, "SpecOff");
  1943. if(GetPVarType(playerid, "pGodMode"))
  1944. {
  1945. SetHealth(playerid, 0x7FB00000);
  1946. SetArmour(playerid, 0x7FB00000);
  1947. }
  1948. GettingSpectated[Spectate[playerid]] = INVALID_PLAYER_ID;
  1949. Spectate[playerid] = INVALID_PLAYER_ID;
  1950. }
  1951. else
  1952. {
  1953. format(string, sizeof(string), "%s has left the server (leaving).", GetPlayerNameEx(playerid));
  1954. ProxDetector(30.0, playerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  1955. }
  1956. format(string, sizeof(string), "%s (ID: %d | SQL ID: %d | Level: %d | IP: %s) has disconnected.", GetPlayerNameExt(playerid), playerid, GetPlayerSQLId(playerid), PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pIP]);
  1957. Log("logs/login.log", string);
  1958. if(PlayerCuffed[playerid] != 0)
  1959. {
  1960. if(PlayerCuffed[playerid] == 2)
  1961. {
  1962. SetHealth(playerid, GetPVarFloat(playerid, "cuffhealth"));
  1963. SetArmour(playerid, GetPVarFloat(playerid, "cuffarmor"));
  1964. DeletePVar(playerid, "cuffhealth");
  1965. DeletePVar(playerid, "PlayerCuffed");
  1966. }
  1967. strcpy(PlayerInfo[playerid][pPrisonReason], "[IC] EBCF ((LWC))", 128);
  1968. strcpy(PlayerInfo[playerid][pPrisonedBy], "System - LWC", 128);
  1969. if(PlayerInfo[playerid][pWantedJailTime] != 0) PlayerInfo[playerid][pJailTime] += PlayerInfo[playerid][pWantedJailTime]*60; else PlayerInfo[playerid][pJailTime] += 120*60;
  1970. if(PlayerInfo[playerid][pWantedJailFine] != 0) GivePlayerCash(playerid, -PlayerInfo[playerid][pWantedJailFine]);
  1971. new szMessage[80+MAX_PLAYER_NAME];
  1972. format(szMessage, sizeof(szMessage), "{AA3333}AdmWarning{FFFF00}: %s has left (/q) the server while being cuffed.", GetPlayerNameEx(playerid));
  1973. ABroadCast(COLOR_YELLOW, szMessage, 2);
  1974. format(string, sizeof(string), "%s has left (/q) while cuffed. (ID: %d | SQLID: %D | JT: %d | F: %d | IP: %s)", GetPlayerNameExt(playerid), playerid, GetPlayerSQLId(playerid), PlayerInfo[playerid][pWantedJailTime], PlayerInfo[playerid][pWantedJailFine], PlayerInfo[playerid][pIP]);
  1975. Log("logs/login.log", string);
  1976. PlayerInfo[playerid][pBailPrice] = 15000000;
  1977. PlayerInfo[playerid][pWantedJailFine] = 0;
  1978. PlayerInfo[playerid][pWantedJailTime] = 0;
  1979. PlayerInfo[playerid][pWantedLevel] = 0;
  1980. }
  1981. else if(GetPVarType(playerid, "IsTackled"))
  1982. {
  1983. strcpy(PlayerInfo[playerid][pPrisonReason], "[IC] EBCF ((LWT))", 128);
  1984. strcpy(PlayerInfo[playerid][pPrisonedBy], "System - LWT", 128);
  1985. if(PlayerInfo[playerid][pWantedJailTime] != 0) PlayerInfo[playerid][pJailTime] += PlayerInfo[playerid][pWantedJailTime]*60; else PlayerInfo[playerid][pJailTime] += 120*60;
  1986. if(PlayerInfo[playerid][pWantedJailFine] != 0) GivePlayerCash(playerid, -PlayerInfo[playerid][pWantedJailFine]);
  1987. format(string, sizeof(string), "%s has left (/q) while tackled. (ID: %d | SQLID: %D | JT: %d | F: %d | IP: %s)", GetPlayerNameExt(playerid), playerid, GetPlayerSQLId(playerid), PlayerInfo[playerid][pWantedJailTime], PlayerInfo[playerid][pWantedJailFine], PlayerInfo[playerid][pIP]);
  1988. Log("logs/login.log", string);
  1989. PlayerInfo[playerid][pBailPrice] = 15000000;
  1990. PlayerInfo[playerid][pWantedJailFine] = 0;
  1991. PlayerInfo[playerid][pWantedJailTime] = 0;
  1992. PlayerInfo[playerid][pWantedLevel] = 0;
  1993. new szMessage[80+MAX_PLAYER_NAME];
  1994. format(szMessage, sizeof(szMessage), "{AA3333}AdmWarning{FFFF00}: %s has left (/q) the server while being tackled.", GetPlayerNameEx(playerid));
  1995. ABroadCast(COLOR_YELLOW, szMessage, 2);
  1996. }
  1997. if(((0 <= PlayerInfo[playerid][pMember] < MAX_GROUPS)) && (PlayerInfo[playerid][pAdmin] < 2 || (PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pTogReports])))
  1998. {
  1999. new badge[12], employer[GROUP_MAX_NAME_LEN], rank[GROUP_MAX_RANK_LEN], division[GROUP_MAX_DIV_LEN];
  2000. if(strcmp(PlayerInfo[playerid][pBadge], "None", true) != 0) format(badge, sizeof(badge), "[%s] ", PlayerInfo[playerid][pBadge]);
  2001. GetPlayerGroupInfo(playerid, rank, division, employer);
  2002. if(IsACop(playerid))
  2003. {
  2004. if(PlayerInfo[playerid][pDuty])
  2005. {
  2006. format(string, sizeof(string), "** %s%s %s is out of service **", badge, rank, GetPlayerNameEx(playerid));
  2007. foreach(new i: Player)
  2008. {
  2009. if(PlayerInfo[i][pToggledChats][12] == 0)
  2010. {
  2011. if(PlayerInfo[i][pMember] == PlayerInfo[playerid][pMember]) SendClientMessageEx(i, arrGroupData[PlayerInfo[playerid][pMember]][g_hRadioColour] * 256 + 255, string);
  2012. }
  2013. }
  2014. }
  2015. format(string, sizeof string, "%s%s %s has logged out.", badge, rank, GetPlayerNameEx(playerid));
  2016. GroupLog(PlayerInfo[playerid][pMember], string);
  2017. }
  2018. else if((0 <= PlayerInfo[playerid][pMember] < MAX_GROUPS) && !IsACop(playerid))
  2019. {
  2020. if(PlayerInfo[playerid][pDuty] || arrGroupData[PlayerInfo[playerid][pMember]][g_iGroupType] == GROUP_TYPE_CRIMINAL)
  2021. {
  2022. format(string, sizeof(string), "** %s%s %s is no longer available **", badge, rank, GetPlayerNameEx(playerid));
  2023. foreach(new i: Player)
  2024. {
  2025. if(PlayerInfo[i][pToggledChats][12] == 0)
  2026. {
  2027. if(PlayerInfo[i][pMember] == PlayerInfo[playerid][pMember]) SendClientMessageEx(i, arrGroupData[PlayerInfo[playerid][pMember]][g_hRadioColour] * 256 + 255, string);
  2028. }
  2029. }
  2030. }
  2031. format(string, sizeof string, "%s%s has logged out.", badge, GetPlayerNameEx(playerid));
  2032. GroupLog(PlayerInfo[playerid][pMember], string);
  2033. }
  2034. }
  2035. }
  2036. case 2:
  2037. {
  2038. if(PlayerInfo[playerid][pAdmin] >= 2 && Spectating[playerid] == 1)
  2039. {
  2040. PlayerInfo[playerid][pPos_x] = GetPVarFloat(playerid, "SpecPosX");
  2041. PlayerInfo[playerid][pPos_y] = GetPVarFloat(playerid, "SpecPosY");
  2042. PlayerInfo[playerid][pPos_z] = GetPVarFloat(playerid, "SpecPosZ");
  2043. PlayerInfo[playerid][pInt] = GetPVarInt(playerid, "SpecInt");
  2044. PlayerInfo[playerid][pVW] = GetPVarInt(playerid, "SpecVW");
  2045. DeletePVar(playerid, "SpecOff");
  2046. if(GetPVarType(playerid, "pGodMode"))
  2047. {
  2048. SetHealth(playerid, 0x7FB00000);
  2049. SetArmour(playerid, 0x7FB00000);
  2050. }
  2051. GettingSpectated[Spectate[playerid]] = INVALID_PLAYER_ID;
  2052. Spectate[playerid] = INVALID_PLAYER_ID;
  2053. }
  2054. else
  2055. {
  2056. format(string, sizeof(string), "%s has left the server (kicked/banned).", GetPlayerNameEx(playerid));
  2057. ProxDetector(30.0, playerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2058. }
  2059. format(string, sizeof(string), "%s (ID: %d | SQL ID: %d | Level: %d | IP: %s) has been kicked/banned.", GetPlayerNameExt(playerid), playerid, GetPlayerSQLId(playerid), PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pIP]);
  2060. Log("logs/login.log", string);
  2061. }
  2062. case 3:
  2063. {
  2064. if(PlayerInfo[playerid][pAdmin] < 2 && Spectating[playerid] != 1)
  2065. {
  2066. format(string, sizeof(string), "%s has left the server (Force Relog).", GetPlayerNameEx(playerid));
  2067. ProxDetector(30.0, playerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  2068. }
  2069. format(string, sizeof(string), "%s (ID: %d | SQL ID: %d | Level: %d | IP: %s) has been force relogged", GetPlayerNameExt(playerid), playerid, GetPlayerSQLId(playerid), PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pIP]);
  2070. Log("logs/login.log", string);
  2071. }
  2072. }
  2073. if(EventKernel[EventRequest] == playerid)
  2074. {
  2075. EventKernel[EventRequest] = INVALID_PLAYER_ID;
  2076. ABroadCast( COLOR_YELLOW, "{AA3333}AdmWarning{FFFF00}: The player that was requesting an event has disconnected/crashed.", 4 );
  2077. }
  2078. if(EventKernel[EventCreator] == playerid)
  2079. {
  2080. EventKernel[EventCreator] = INVALID_PLAYER_ID;
  2081. ABroadCast( COLOR_YELLOW, "{AA3333}AdmWarning{FFFF00}: The player that was creating an event has disconnected/crashed.", 4 );
  2082. }
  2083. for(new x; x < sizeof(EventKernel[EventStaff]); x++) {
  2084. if(EventKernel[EventStaff][x] == playerid) {
  2085. EventKernel[EventStaff][x] = INVALID_PLAYER_ID;
  2086. RemovePlayerWeapon(playerid, 38);
  2087. break;
  2088. }
  2089. }
  2090. if(GetPVarType(playerid, "IsInArena")) LeavePaintballArena(playerid, GetPVarInt(playerid, "IsInArena"), 1);
  2091. /*
  2092. if(GetPVarType(playerid, "IsInArena"))
  2093. {
  2094. LeavePaintballArena(playerid, GetPVarInt(playerid, "IsInArena"));
  2095. PlayerInfo[playerid][pInt] = GetPVarInt(playerid, "pbOldInt");
  2096. PlayerInfo[playerid][pVW] = GetPVarInt(playerid, "pbOldVW");
  2097. PlayerInfo[playerid][pPos_x] = 2012.500366;
  2098. PlayerInfo[playerid][pPos_y] = -1264.768554;
  2099. PlayerInfo[playerid][pPos_z] = 23.547389;
  2100. PlayerInfo[playerid][pHealth] = 100;
  2101. //PlayerInfo[playerid][pArmor] = GetPVarFloat(playerid, "pbOldArmor");
  2102. new szLog[128], Float: realarmor;
  2103. GetArmour(playerid, realarmor);
  2104. format(szLog, sizeof(szLog), "Player %s(%d) disconnects inside paintball with %f.2 armor, but has %f.2.", GetPlayerNameEx(playerid), playerid, PlayerInfo[playerid][pArmor], realarmor);
  2105. Log("logs/debug.log", szLog);
  2106. SetHealth(playerid,GetPVarFloat(playerid, "pbOldHealth"));
  2107. SetArmour(playerid,GetPVarFloat(playerid, "pbOldArmor"));
  2108. }*/
  2109. if(GetPVarInt(playerid, "EventToken") == 0 && !GetPVarType(playerid, "LoadingObjects"))
  2110. {
  2111. if(IsPlayerInRangeOfPoint(playerid, 1200, -1083.90002441,4289.70019531,7.59999990) && PlayerInfo[playerid][pMember] == INVALID_GROUP_ID)
  2112. {
  2113. PlayerInfo[playerid][pInt] = 0;
  2114. PlayerInfo[playerid][pVW] = 0;
  2115. GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPos_r]);
  2116. PlayerInfo[playerid][pPos_x] = 1529.6;
  2117. PlayerInfo[playerid][pPos_y] = -1691.2;
  2118. PlayerInfo[playerid][pPos_z] = 13.3;
  2119. }
  2120. else
  2121. {
  2122. new Float: x, Float: y, Float: z;
  2123. PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
  2124. PlayerInfo[playerid][pVW] = GetPlayerVirtualWorld(playerid);
  2125. GetPlayerPos(playerid, x, y, z);
  2126. GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPos_r]);
  2127. PlayerInfo[playerid][pPos_x] = x;
  2128. PlayerInfo[playerid][pPos_y] = y;
  2129. PlayerInfo[playerid][pPos_z] = z;
  2130. }
  2131. }
  2132. else
  2133. {
  2134. PlayerInfo[playerid][pInt] = EventLastInt[playerid];
  2135. PlayerInfo[playerid][pVW] = EventLastVW[playerid];
  2136. PlayerInfo[playerid][pPos_r] = EventFloats[playerid][0];
  2137. PlayerInfo[playerid][pPos_x] = EventFloats[playerid][1];
  2138. PlayerInfo[playerid][pPos_y] = EventFloats[playerid][2];
  2139. PlayerInfo[playerid][pPos_z] = EventFloats[playerid][3];
  2140. }
  2141. if(GetPVarInt(playerid, "WatchingTV"))
  2142. {
  2143. PlayerInfo[playerid][pInt] = BroadcastLastInt[playerid];
  2144. PlayerInfo[playerid][pVW] = BroadcastLastVW[playerid];
  2145. PlayerInfo[playerid][pPos_r] = BroadcastFloats[playerid][0];
  2146. PlayerInfo[playerid][pPos_x] = BroadcastFloats[playerid][1];
  2147. PlayerInfo[playerid][pPos_y] = BroadcastFloats[playerid][2];
  2148. PlayerInfo[playerid][pPos_z] = BroadcastFloats[playerid][3];
  2149. DeletePVar(playerid, "WatchingTV");
  2150. viewers--;
  2151. }
  2152. if(gBike[playerid] >= 0 && gBikeRenting[playerid] == 1)
  2153. {
  2154. gBike[playerid] = 0;
  2155. gBikeRenting[playerid] = 0;
  2156. KillTimer(GetPVarInt(playerid, "RentTime"));
  2157. }
  2158. PlayerTextDrawDestroy(playerid, GPS[playerid]);
  2159. if(PlayerInfo[playerid][pAdmin] >= 2) TextDrawDestroy(PriorityReport[playerid]);
  2160. if(InsidePlane[playerid] != INVALID_VEHICLE_ID)
  2161. {
  2162. if(!IsAPlane(InsidePlane[playerid]))
  2163. {
  2164. GivePlayerValidWeapon(playerid, 46);
  2165. PlayerInfo[playerid][pPos_x] = 0.000000;
  2166. PlayerInfo[playerid][pPos_y] = 0.000000;
  2167. PlayerInfo[playerid][pPos_z] = 420.000000;
  2168. }
  2169. else
  2170. {
  2171. new Float:X, Float:Y, Float:Z;
  2172. GetVehiclePos(InsidePlane[playerid], X, Y, Z);
  2173. PlayerInfo[playerid][pPos_x] = X;
  2174. PlayerInfo[playerid][pPos_y] = Y;
  2175. PlayerInfo[playerid][pPos_z] = Z;
  2176. if(Z > 50.0)
  2177. {
  2178. GivePlayerValidWeapon(playerid, 46);
  2179. }
  2180. }
  2181. PlayerInfo[playerid][pVW] = 0;
  2182. SetPlayerVirtualWorld(playerid, 0);
  2183. PlayerInfo[playerid][pInt] = 0;
  2184. SetPlayerInterior(playerid, 0);
  2185. InsidePlane[playerid] = INVALID_VEHICLE_ID;
  2186. }
  2187. if(GetPVarType(playerid, "Injured")) PlayerInfo[playerid][pHospital] = 1;
  2188. OnPlayerStatsUpdate(playerid);
  2189. if(reason == 0)
  2190. {
  2191. new Float:pos[4];
  2192. for(new v = 0; v < MAX_PLAYERVEHICLES; v++)
  2193. {
  2194. if(PlayerVehicleInfo[playerid][v][pvId] != INVALID_PLAYER_VEHICLE_ID)
  2195. {
  2196. GetVehiclePos(PlayerVehicleInfo[playerid][v][pvId], pos[0], pos[1], pos[2]);
  2197. GetVehicleZAngle(PlayerVehicleInfo[playerid][v][pvId], pos[3]);
  2198. if(PlayerVehicleInfo[playerid][v][pvPosX] != pos[0])
  2199. {
  2200. PlayerVehicleInfo[playerid][v][pvCrashFlag] = 1;
  2201. PlayerVehicleInfo[playerid][v][pvCrashVW] = GetVehicleVirtualWorld(PlayerVehicleInfo[playerid][v][pvId]);
  2202. PlayerVehicleInfo[playerid][v][pvCrashX] = pos[0];
  2203. PlayerVehicleInfo[playerid][v][pvCrashY] = pos[1];
  2204. PlayerVehicleInfo[playerid][v][pvCrashZ] = pos[2];
  2205. PlayerVehicleInfo[playerid][v][pvCrashAngle] = pos[3];
  2206. GetVehicleHealth(PlayerVehicleInfo[playerid][v][pvId], PlayerVehicleInfo[playerid][v][pvHealth]);
  2207. g_mysql_SaveVehicle(playerid, v);
  2208. }
  2209. }
  2210. }
  2211. }
  2212. UnloadPlayerVehicles(playerid, 1, reason);
  2213. g_mysql_AccountOnline(playerid, 0);
  2214. for(new i = 0; i < MAX_REPORTS; i++)
  2215. {
  2216. if(Reports[i][ReportFrom] == playerid)
  2217. {
  2218. Reports[i][ReportFrom] = INVALID_PLAYER_ID;
  2219. Reports[i][BeingUsed] = 0;
  2220. Reports[i][TimeToExpire] = 0;
  2221. Reports[i][ReportPriority] = 0;
  2222. Reports[i][ReportLevel] = 0;
  2223. }
  2224. }
  2225. for(new i = 0; i < MAX_CALLS; i++)
  2226. {
  2227. if(Calls[i][CallFrom] == playerid)
  2228. {
  2229. if(Calls[i][BeingUsed] == 1) DeletePVar(Calls[i][CallFrom], "Has911Call");
  2230. strmid(Calls[i][Area], "None", 0, 4, 4);
  2231. strmid(Calls[i][MainZone], "None", 0, 4, 4);
  2232. strmid(Calls[i][Description], "None", 0, 4, 4);
  2233. Calls[i][RespondingID] = INVALID_PLAYER_ID;
  2234. Calls[i][CallFrom] = INVALID_PLAYER_ID;
  2235. Calls[i][Type] = -1;
  2236. Calls[i][TimeToExpire] = 0;
  2237. }
  2238. }
  2239. foreach(new i: Player)
  2240. {
  2241. if (GetPVarType(i, "hFind") && GetPVarInt(i, "hFind") == playerid)
  2242. {
  2243. SendClientMessageEx(i, COLOR_GREY, "The person you were tracking has disconnected.");
  2244. DeletePVar(i, "hFind");
  2245. DisablePlayerCheckpoint(i);
  2246. }
  2247. if (GetPVarType(i, "Backup") && GetPVarInt(i, "Backup") == playerid)
  2248. {
  2249. SendClientMessageEx(i, COLOR_GREY, "The person who called for backup has disconnected.");
  2250. DeletePVar(i, "Backup");
  2251. }
  2252. if(TaxiAccepted[i] == playerid)
  2253. {
  2254. TaxiAccepted[i] = INVALID_PLAYER_ID;
  2255. GameTextForPlayer(i, "~w~Taxi Caller~n~~r~Left the game", 5000, 1);
  2256. TaxiCallTime[i] = 0;
  2257. DisablePlayerCheckpoint(i);
  2258. }
  2259. if(EMSAccepted[i] == playerid)
  2260. {
  2261. EMSAccepted[i] = INVALID_PLAYER_ID;
  2262. GameTextForPlayer(i, "~w~EMS Caller~n~~r~Left the game", 5000, 1);
  2263. EMSCallTime[i] = 0;
  2264. DisablePlayerCheckpoint(i);
  2265. }
  2266. if(BusAccepted[i] == playerid)
  2267. {
  2268. BusAccepted[i] = INVALID_PLAYER_ID;
  2269. GameTextForPlayer(i, "~w~Bus Caller~n~~r~Left the game", 5000, 1);
  2270. BusCallTime[i] = 0;
  2271. DisablePlayerCheckpoint(i);
  2272. }
  2273. if(MedicAccepted[i] == playerid)
  2274. {
  2275. TaxiAccepted[playerid] = INVALID_PLAYER_ID; BusAccepted[playerid] = INVALID_PLAYER_ID; MedicAccepted[playerid] = INVALID_PLAYER_ID;
  2276. GameTextForPlayer(i, "~w~Medic Caller~n~~r~Left the game", 5000, 1);
  2277. MedicCallTime[i] = 0;
  2278. DisablePlayerCheckpoint(i);
  2279. }
  2280. if(OrderAssignedTo[i] == playerid)
  2281. {
  2282. OrderAssignedTo[i] = INVALID_PLAYER_ID;
  2283. }
  2284. }
  2285. if(TransportCost[playerid] > 0 && TransportDriver[playerid] != INVALID_PLAYER_ID)
  2286. {
  2287. if(IsPlayerConnected(TransportDriver[playerid]))
  2288. {
  2289. TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
  2290. TransportTime[TransportDriver[playerid]] = 0;
  2291. TransportCost[TransportDriver[playerid]] = 0;
  2292. format(string, sizeof(string), "~w~Passenger left~n~~g~Earned $%d",TransportCost[playerid]);
  2293. GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
  2294. GivePlayerCashEx(playerid, TYPE_ONHAND, -TransportCost[playerid]);
  2295. TransportDriver[playerid] = INVALID_PLAYER_ID;
  2296. }
  2297. }
  2298. if(GotHit[playerid] > 0)
  2299. {
  2300. if(GetChased[playerid] != INVALID_PLAYER_ID)
  2301. {
  2302. if(IsPlayerConnected(GetChased[playerid]))
  2303. {
  2304. SendClientMessageEx(GetChased[playerid], COLOR_YELLOW, "Your hit has left the server.");
  2305. GoChase[GetChased[playerid]] = INVALID_PLAYER_ID;
  2306. }
  2307. }
  2308. }
  2309. if(GoChase[playerid] != INVALID_PLAYER_ID)
  2310. {
  2311. GetChased[GoChase[playerid]] = INVALID_PLAYER_ID;
  2312. GotHit[GoChase[playerid]] = INVALID_PLAYER_ID;
  2313. }
  2314. if(HireCar[playerid] != 299)
  2315. {
  2316. vehicle_unlock_doors(HireCar[playerid]);
  2317. }
  2318. if (gLastCar[playerid] > 0)
  2319. {
  2320. if(PlayerInfo[playerid][pPhousekey] != gLastCar[playerid]-1)
  2321. {
  2322. vehicle_unlock_doors(gLastCar[playerid]);
  2323. }
  2324. }
  2325. if(PlayerBoxing[playerid] > 0)
  2326. {
  2327. if(Boxer1 == playerid)
  2328. {
  2329. if(IsPlayerConnected(Boxer2))
  2330. {
  2331. if(IsPlayerInRangeOfPoint(PlayerBoxing[Boxer2], 20.0, 768.94, -70.87, 1001.56))
  2332. {
  2333. PlayerBoxing[Boxer2] = 0;
  2334. SetPlayerPos(Boxer2, 768.48, -73.66, 1000.57);
  2335. SetPlayerInterior(Boxer2, 7);
  2336. GameTextForPlayer(Boxer2, "~r~Match interupted", 5000, 1);
  2337. }
  2338. PlayerBoxing[Boxer2] = 0;
  2339. SetPlayerPos(Boxer2, 765.8433,3.2924,1000.7186);
  2340. SetPlayerInterior(Boxer2, 5);
  2341. GameTextForPlayer(Boxer2, "~r~Match interupted", 5000, 1);
  2342. }
  2343. }
  2344. else if(Boxer2 == playerid)
  2345. {
  2346. if(IsPlayerConnected(Boxer1))
  2347. {
  2348. if(IsPlayerInRangeOfPoint(PlayerBoxing[Boxer1],20.0,764.35, -66.48, 1001.56))
  2349. {
  2350. PlayerBoxing[Boxer1] = 0;
  2351. SetPlayerPos(Boxer1, 768.48, -73.66, 1000.57);
  2352. SetPlayerInterior(Boxer1, 7);
  2353. GameTextForPlayer(Boxer1, "~r~Match interupted", 5000, 1);
  2354. }
  2355. PlayerBoxing[Boxer1] = 0;
  2356. SetPlayerPos(Boxer1, 765.8433,3.2924,1000.7186);
  2357. SetPlayerInterior(Boxer1, 5);
  2358. GameTextForPlayer(Boxer1, "~r~Match interupted", 5000, 1);
  2359. }
  2360. }
  2361. InRing = 0;
  2362. RoundStarted = 0;
  2363. Boxer1 = INVALID_PLAYER_ID;
  2364. Boxer2 = INVALID_PLAYER_ID;
  2365. TBoxer = INVALID_PLAYER_ID;
  2366. }
  2367. if(GetPVarInt(playerid, "AdvisorDuty") == 1)
  2368. {
  2369. Advisors--;
  2370. }
  2371. if(TransportDuty[playerid] == 1)
  2372. {
  2373. TaxiDrivers -= 1;
  2374. }
  2375. else if(TransportDuty[playerid] == 2)
  2376. {
  2377. BusDrivers -= 1;
  2378. }
  2379. if(PlayerInfo[playerid][pJob] == 11 || PlayerInfo[playerid][pJob2] == 11 || PlayerInfo[playerid][pJob3] == 11)
  2380. {
  2381. if(JobDuty[playerid] == 1) { Medics -= 1; }
  2382. }
  2383. if(PlayerInfo[playerid][pJob] == 7 || PlayerInfo[playerid][pJob2] == 7 || PlayerInfo[playerid][pJob3] == 7)
  2384. {
  2385. if(GetPVarInt(playerid, "MechanicDuty") == 1) { Mechanics -= 1; }
  2386. }
  2387. if(PlayerInfo[playerid][pJob] == 11 || PlayerInfo[playerid][pJob2] == 11 || PlayerInfo[playerid][pJob3] == 11)
  2388. {
  2389. if(JobDuty[playerid] == 1) { Coastguard -= 1; }
  2390. }
  2391. new Float:health, Float:armor;
  2392. if(GetPVarType(playerid, "pGodMode") == 1)
  2393. {
  2394. health = GetPVarFloat(playerid, "pPreGodHealth");
  2395. SetHealth(playerid,health);
  2396. armor = GetPVarFloat(playerid, "pPreGodArmor");
  2397. SetArmour(playerid, armor);
  2398. DeletePVar(playerid, "pGodMode");
  2399. DeletePVar(playerid, "pPreGodHealth");
  2400. DeletePVar(playerid, "pPreGodArmor");
  2401. }
  2402. if(GetPVarInt(playerid, "ttSeller") >= 0)
  2403. {
  2404. DeletePVar(playerid, "ttSeller");
  2405. HideTradeToysGUI(playerid);
  2406. }
  2407. if(IsValidDynamic3DTextLabel(RFLTeamN3D[playerid])) {
  2408. DestroyDynamic3DTextLabel(RFLTeamN3D[playerid]);
  2409. RFLTeamN3D[playerid] = Text3D:-1;
  2410. }
  2411. pSpeed[playerid] = 0.0;
  2412. SetPVarInt(playerid, "PlayerOwnASurf", 0);
  2413. }
  2414. PlayerInfo[playerid][pWarrant][0] = 0;
  2415. DeletePVar(playerid, "pTmpEmail");
  2416. DeletePVar(playerid, "NullEmail");
  2417. DeletePVar(playerid, "ViewedPMOTD");
  2418. DeletePVar(playerid, "WatchdogChat");
  2419. DeletePVar(playerid, "vStaffChat");
  2420. DeletePVar(playerid, "SECChat");
  2421. DeletePVar(playerid, "aLvl");
  2422. DeletePVar(playerid, "hLvl");
  2423. DeletePVar(playerid, "fLvl");
  2424. DeletePVar(playerid, "gLvl");
  2425. DeletePVar(playerid, "Autoban");
  2426. DeletePVar(playerid, "ticketreason");
  2427. gPlayerLogged{playerid} = 0;
  2428. return 1;
  2429. }
  2430. public OnRconLoginAttempt(ip[], password[], success)
  2431. {
  2432. if(success)
  2433. {
  2434. new pip[16];
  2435. szMiscArray[0] = 0;
  2436. foreach(new i : Player)
  2437. {
  2438. GetPlayerIp(i, pip, sizeof(pip));
  2439. if(!strcmp(ip, pip, true))
  2440. {
  2441. if(PlayerInfo[i][pAdmin] < 1337)
  2442. {
  2443. CreateBan(INVALID_PLAYER_ID, PlayerInfo[i][pId], i, PlayerInfo[i][pIP], "Successful RCON Login - Not Head Admin", 9999);
  2444. format(szMiscArray, sizeof(szMiscArray), "{AA3333}AdmWarning{FFFF00}: %s(%s) has successfully logged into RCON without being a Head Admin, and has been perma-banned.", GetPlayerNameEx(i), ip);
  2445. ABroadCast(COLOR_YELLOW, szMiscArray, 2);
  2446. }
  2447. }
  2448. }
  2449. }
  2450. if(!success)
  2451. {
  2452. new pip[16];
  2453. foreach(new i : Player)
  2454. {
  2455. GetPlayerIp(i, pip, sizeof(pip));
  2456. if(!strcmp(ip, pip, true))
  2457. {
  2458. new logins = GetPVarInt(i, "RconFailedLogin")+1;
  2459. SetPVarInt(i, "RconFailedLogin", logins);
  2460. if(GetPVarInt(i, "RconFailedLogin") >= 3)
  2461. {
  2462. CreateBan(INVALID_PLAYER_ID, PlayerInfo[i][pId], i, PlayerInfo[i][pIP], "Excessive RCON Login Attempts", 365);
  2463. }
  2464. }
  2465. }
  2466. }
  2467. return 1;
  2468. }
  2469. public OnVehicleDeath(vehicleid) {
  2470. new Float:X, Float:Y, Float:Z;
  2471. new Float:XB, Float:YB, Float:ZB;
  2472. VehicleStatus{vehicleid} = 1;
  2473. TruckContents{vehicleid} = 0;
  2474. foreach(new i: Player)
  2475. {
  2476. if(TruckUsed[i] == vehicleid)
  2477. {
  2478. DeletePVar(i, "LoadTruckTime");
  2479. DeletePVar(i, "TruckDeliver");
  2480. TruckUsed[i] = INVALID_VEHICLE_ID;
  2481. gPlayerCheckpointStatus[i] = CHECKPOINT_NONE;
  2482. DisablePlayerCheckpoint(i);
  2483. }
  2484. if(InsidePlane[i] == vehicleid)
  2485. {
  2486. TogglePlayerSpectating(i, 0);
  2487. GetVehiclePos(InsidePlane[i], X, Y, Z);
  2488. SetPlayerPos(i, X-4, Y-2.3, Z);
  2489. GetVehiclePos(InsidePlane[i], XB, YB, ZB);
  2490. if(ZB > 50.0)
  2491. {
  2492. PlayerInfo[i][pAGuns][GetWeaponSlot(46)] = 46;
  2493. GivePlayerValidWeapon(i, 46);
  2494. }
  2495. PlayerInfo[i][pVW] = 0;
  2496. SetPlayerVirtualWorld(i, 0);
  2497. PlayerInfo[i][pInt] = 0;
  2498. SetPlayerInterior(i, 0);
  2499. InsidePlane[i] = INVALID_VEHICLE_ID;
  2500. SendClientMessageEx(i, COLOR_WHITE, "The airplane has been damaged, you cannot be inside it!");
  2501. }
  2502. if(GetPVarInt(i, "NGPassengerVeh") == vehicleid)
  2503. {
  2504. TogglePlayerSpectating(i, 0);
  2505. }
  2506. }
  2507. /*if(DynVeh[vehicleid] != -1)
  2508. {
  2509. DynVeh_Spawn(DynVeh[vehicleid]);
  2510. }*/
  2511. arr_Engine{vehicleid} = 0;
  2512. }
  2513. public OnPlayerSpawn(playerid)
  2514. {
  2515. if(IsPlayerNPC(playerid)) return 1;
  2516. if(!gPlayerLogged{playerid})
  2517. {
  2518. SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You are not logged in!");
  2519. SetTimerEx("KickEx", 1000, 0, "i", playerid);
  2520. return 1;
  2521. }
  2522. SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
  2523. SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
  2524. SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
  2525. PlayerIsDead[playerid] = false;
  2526. if(!gPlayerAnimLibsPreloaded[playerid])
  2527. {
  2528. PreloadAnimLib(playerid,"AIRPORT");
  2529. PreloadAnimLib(playerid,"Attractors");
  2530. PreloadAnimLib(playerid,"BAR");
  2531. PreloadAnimLib(playerid,"BASEBALL");
  2532. PreloadAnimLib(playerid,"BD_FIRE");
  2533. PreloadAnimLib(playerid,"benchpress");
  2534. PreloadAnimLib(playerid,"BF_injection");
  2535. PreloadAnimLib(playerid,"BIKED");
  2536. PreloadAnimLib(playerid,"BIKEH");
  2537. PreloadAnimLib(playerid,"BIKELEAP");
  2538. PreloadAnimLib(playerid,"BIKES");
  2539. PreloadAnimLib(playerid,"BIKEV");
  2540. PreloadAnimLib(playerid,"BIKE_DBZ");
  2541. PreloadAnimLib(playerid,"BMX");
  2542. PreloadAnimLib(playerid,"BOX");
  2543. PreloadAnimLib(playerid,"BSKTBALL");
  2544. PreloadAnimLib(playerid,"BUDDY");
  2545. PreloadAnimLib(playerid,"BUS");
  2546. PreloadAnimLib(playerid,"CAMERA");
  2547. PreloadAnimLib(playerid,"CAR");
  2548. PreloadAnimLib(playerid,"CAR_CHAT");
  2549. PreloadAnimLib(playerid,"CASINO");
  2550. PreloadAnimLib(playerid,"CHAINSAW");
  2551. PreloadAnimLib(playerid,"CHOPPA");
  2552. PreloadAnimLib(playerid,"CLOTHES");
  2553. PreloadAnimLib(playerid,"COACH");
  2554. PreloadAnimLib(playerid,"COLT45");
  2555. PreloadAnimLib(playerid,"COP_DVBYZ");
  2556. PreloadAnimLib(playerid,"CRIB");
  2557. PreloadAnimLib(playerid,"DAM_JUMP");
  2558. PreloadAnimLib(playerid,"DANCING");
  2559. PreloadAnimLib(playerid,"DILDO");
  2560. PreloadAnimLib(playerid,"DODGE");
  2561. PreloadAnimLib(playerid,"DOZER");
  2562. PreloadAnimLib(playerid,"DRIVEBYS");
  2563. PreloadAnimLib(playerid,"FAT");
  2564. PreloadAnimLib(playerid,"FIGHT_B");
  2565. PreloadAnimLib(playerid,"FIGHT_C");
  2566. PreloadAnimLib(playerid,"FIGHT_D");
  2567. PreloadAnimLib(playerid,"FIGHT_E");
  2568. PreloadAnimLib(playerid,"FINALE");
  2569. PreloadAnimLib(playerid,"FINALE2");
  2570. PreloadAnimLib(playerid,"Flowers");
  2571. PreloadAnimLib(playerid,"FOOD");
  2572. PreloadAnimLib(playerid,"Freeweights");
  2573. PreloadAnimLib(playerid,"GANGS");
  2574. PreloadAnimLib(playerid,"GHANDS");
  2575. PreloadAnimLib(playerid,"GHETTO_DB");
  2576. PreloadAnimLib(playerid,"goggles");
  2577. PreloadAnimLib(playerid,"GRAFFITI");
  2578. PreloadAnimLib(playerid,"GRAVEYARD");
  2579. PreloadAnimLib(playerid,"GRENADE");
  2580. PreloadAnimLib(playerid,"GYMNASIUM");
  2581. PreloadAnimLib(playerid,"HAIRCUTS");
  2582. PreloadAnimLib(playerid,"HEIST9");
  2583. PreloadAnimLib(playerid,"INT_HOUSE");
  2584. PreloadAnimLib(playerid,"INT_OFFICE");
  2585. PreloadAnimLib(playerid,"INT_SHOP");
  2586. PreloadAnimLib(playerid,"JST_BUISNESS");
  2587. PreloadAnimLib(playerid,"KART");
  2588. PreloadAnimLib(playerid,"KISSING");
  2589. PreloadAnimLib(playerid,"KNIFE");
  2590. PreloadAnimLib(playerid,"LAPDAN1");
  2591. PreloadAnimLib(playerid,"LAPDAN2");
  2592. PreloadAnimLib(playerid,"LAPDAN3");
  2593. PreloadAnimLib(playerid,"LOWRIDER");
  2594. PreloadAnimLib(playerid,"MD_CHASE");
  2595. PreloadAnimLib(playerid,"MEDIC");
  2596. PreloadAnimLib(playerid,"MD_END");
  2597. PreloadAnimLib(playerid,"MISC");
  2598. PreloadAnimLib(playerid,"MTB");
  2599. PreloadAnimLib(playerid,"MUSCULAR");
  2600. PreloadAnimLib(playerid,"NEVADA");
  2601. PreloadAnimLib(playerid,"ON_LOOKERS");
  2602. PreloadAnimLib(playerid,"OTB");
  2603. PreloadAnimLib(playerid,"PARACHUTE");
  2604. PreloadAnimLib(playerid,"PARK");
  2605. PreloadAnimLib(playerid,"PAULNMAC");
  2606. PreloadAnimLib(playerid,"PED");
  2607. PreloadAnimLib(playerid,"PLAYER_DVBYS");
  2608. PreloadAnimLib(playerid,"PLAYIDLES");
  2609. PreloadAnimLib(playerid,"POLICE");
  2610. PreloadAnimLib(playerid,"POOL");
  2611. PreloadAnimLib(playerid,"POOR");
  2612. PreloadAnimLib(playerid,"PYTHON");
  2613. PreloadAnimLib(playerid,"QUAD");
  2614. PreloadAnimLib(playerid,"QUAD_DBZ");
  2615. PreloadAnimLib(playerid,"RIFLE");
  2616. PreloadAnimLib(playerid,"RIOT");
  2617. PreloadAnimLib(playerid,"ROB_BANK");
  2618. PreloadAnimLib(playerid,"ROCKET");
  2619. PreloadAnimLib(playerid,"RUSTLER");
  2620. PreloadAnimLib(playerid,"RYDER");
  2621. PreloadAnimLib(playerid,"SCRATCHING");
  2622. PreloadAnimLib(playerid,"SHAMAL");
  2623. PreloadAnimLib(playerid,"SHOTGUN");
  2624. PreloadAnimLib(playerid,"SILENCED");
  2625. PreloadAnimLib(playerid,"SKATE");
  2626. PreloadAnimLib(playerid,"SPRAYCAN");
  2627. PreloadAnimLib(playerid,"STRIP");
  2628. PreloadAnimLib(playerid,"SUNBATHE");
  2629. PreloadAnimLib(playerid,"SWAT");
  2630. PreloadAnimLib(playerid,"SWEET");
  2631. PreloadAnimLib(playerid,"SWIM");
  2632. PreloadAnimLib(playerid,"SWORD");
  2633. PreloadAnimLib(playerid,"TANK");
  2634. PreloadAnimLib(playerid,"TATTOOS");
  2635. PreloadAnimLib(playerid,"TEC");
  2636. PreloadAnimLib(playerid,"TRAIN");
  2637. PreloadAnimLib(playerid,"TRUCK");
  2638. PreloadAnimLib(playerid,"UZI");
  2639. PreloadAnimLib(playerid,"VAN");
  2640. PreloadAnimLib(playerid,"VENDING");
  2641. PreloadAnimLib(playerid,"VORTEX");
  2642. PreloadAnimLib(playerid,"WAYFARER");
  2643. PreloadAnimLib(playerid,"WEAPONS");
  2644. PreloadAnimLib(playerid,"WUZI");
  2645. PreloadAnimLib(playerid,"SNM");
  2646. PreloadAnimLib(playerid,"BLOWJOBZ");
  2647. PreloadAnimLib(playerid,"SEX");
  2648. PreloadAnimLib(playerid,"BOMBER");
  2649. PreloadAnimLib(playerid,"RAPPING");
  2650. PreloadAnimLib(playerid,"SHOP");
  2651. PreloadAnimLib(playerid,"BEACH");
  2652. PreloadAnimLib(playerid,"SMOKING");
  2653. PreloadAnimLib(playerid,"FOOD");
  2654. PreloadAnimLib(playerid,"ON_LOOKERS");
  2655. PreloadAnimLib(playerid,"DEALER");
  2656. PreloadAnimLib(playerid,"CRACK");
  2657. PreloadAnimLib(playerid,"CARRY");
  2658. PreloadAnimLib(playerid,"COP_AMBIENT");
  2659. PreloadAnimLib(playerid,"PARK");
  2660. PreloadAnimLib(playerid,"INT_HOUSE");
  2661. PreloadAnimLib(playerid,"FOOD");
  2662. gPlayerAnimLibsPreloaded[playerid] = 1;
  2663. }
  2664. if(sobeitCheckvar[playerid] == 0)
  2665. {
  2666. if(PlayerInfo[playerid][pInt] == 0 && PlayerInfo[playerid][pVW] == 0)
  2667. {
  2668. if(sobeitCheckIsDone[playerid] == 0)
  2669. {
  2670. if(PlayerInfo[playerid][pAdmin] < 2)
  2671. {
  2672. if(PlayerInfo[playerid][pHospital] == 0)
  2673. {
  2674. sobeitCheckIsDone[playerid] = 1;
  2675. SetTimerEx("sobeitCheck", 10000, 0, "i", playerid);
  2676. TogglePlayerControllable(playerid, false);
  2677. }
  2678. }
  2679. }
  2680. }
  2681. }
  2682. if(GetPVarType(playerid, "WatchingTV")) return 1;
  2683. if(GetPVarInt(playerid, "NGPassenger") == 1)
  2684. {
  2685. new Float:X, Float:Y, Float:Z;
  2686. GetVehiclePos(GetPVarInt(playerid, "NGPassengerVeh"), X, Y, Z);
  2687. SetPlayerPos(playerid, (X-2.557), (Y-3.049), Z);
  2688. SetPlayerWeaponsEx(playerid);
  2689. GivePlayerValidWeapon(playerid, 46);
  2690. SetPlayerSkin(playerid, GetPVarInt(playerid, "NGPassengerSkin"));
  2691. SetHealth(playerid, GetPVarFloat(playerid, "NGPassengerHP"));
  2692. if(GetPVarFloat(playerid, "NGPassengerArmor") > 0) {
  2693. SetArmour(playerid, GetPVarFloat(playerid, "NGPassengerArmor"));
  2694. }
  2695. DeletePVar(playerid, "NGPassenger");
  2696. DeletePVar(playerid, "NGPassengerVeh");
  2697. DeletePVar(playerid, "NGPassengerArmor");
  2698. DeletePVar(playerid, "NGPassengerHP");
  2699. DeletePVar(playerid, "NGPassengerSkin");
  2700. return 1;
  2701. }
  2702. if(InsidePlane[playerid] != INVALID_VEHICLE_ID)
  2703. {
  2704. SetPlayerPos(playerid, GetPVarFloat(playerid, "air_Xpos"), GetPVarFloat(playerid, "air_Ypos"), GetPVarFloat(playerid, "air_Zpos"));
  2705. SetPlayerFacingAngle(playerid, GetPVarFloat(playerid, "air_Rpos"));
  2706. SetHealth(playerid, GetPVarFloat(playerid, "air_HP"));
  2707. if(GetPVarFloat(playerid, "air_Arm") > 0) {
  2708. SetArmour(playerid, GetPVarFloat(playerid, "air_Arm"));
  2709. }
  2710. SetPlayerWeaponsEx(playerid);
  2711. SetPlayerToTeamColor(playerid);
  2712. SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
  2713. SetPlayerInterior(playerid, GetPVarInt(playerid, "air_Int"));
  2714. DeletePVar(playerid, "air_Xpos");
  2715. DeletePVar(playerid, "air_Ypos");
  2716. DeletePVar(playerid, "air_Zpos");
  2717. DeletePVar(playerid, "air_Rpos");
  2718. DeletePVar(playerid, "air_HP");
  2719. DeletePVar(playerid, "air_Arm");
  2720. DeletePVar(playerid, "air_Mode");
  2721. DeletePVar(playerid, "air_Int");
  2722. SetCameraBehindPlayer(playerid);
  2723. SetPlayerVirtualWorld(playerid, InsidePlane[playerid]);
  2724. return 1;
  2725. }
  2726. SyncPlayerTime(playerid);
  2727. if(GetPVarType(playerid, "STD")) {
  2728. DeletePVar(playerid, "STD");
  2729. }
  2730. SetTeam(playerid, NO_TEAM);
  2731. SetPlayerSpawn(playerid);
  2732. SetPlayerWeapons(playerid);
  2733. SetPlayerToTeamColor(playerid);
  2734. IsSpawned[playerid] = 1;
  2735. SpawnKick[playerid] = 0;
  2736. SetPlayerArmedWeapon(playerid, 0); // making sure players spawn with their fists.
  2737. if(PlayerInfo[playerid][pTut] != -1)
  2738. {
  2739. if(PlayerInfo[playerid][pTut] < 14) PlayerInfo[playerid][pTut] = 0;
  2740. AdvanceTutorial(playerid);
  2741. }
  2742. if(PlayerInfo[playerid][pTut] == -1 && PlayerInfo[playerid][pNation] != 0 && PlayerInfo[playerid][pNation] != 1) ShowPlayerDialogEx(playerid, DIALOG_NATION_CHECK, DIALOG_STYLE_LIST, "Please chose a nation.", "San Andreas\nNew Robada", "Select", "<<");
  2743. return 1;
  2744. }
  2745. public OnPlayerLeaveCheckpoint(playerid)
  2746. {
  2747. if(GetPVarInt(playerid, "EventToken") == 1 && GetPVarInt(playerid, "InWaterStationRCP") == 1)
  2748. {
  2749. KillTimer(GetPVarInt(playerid, "WSRCPTimerId"));
  2750. SetPVarInt(playerid, "WSRCPTimerId", 0);
  2751. SetPVarInt(playerid, "InWaterStationRCP", 0);
  2752. RCPIdCurrent[playerid]++;
  2753. if(EventRCPT[RCPIdCurrent[playerid]] == 1) {
  2754. DisablePlayerCheckpoint(playerid);
  2755. SetPlayerCheckpoint(playerid, EventRCPX[RCPIdCurrent[playerid]], EventRCPY[RCPIdCurrent[playerid]], EventRCPZ[RCPIdCurrent[playerid]], EventRCPS[RCPIdCurrent[playerid]]);
  2756. }
  2757. else if(EventRCPT[RCPIdCurrent[playerid]] == 4) {
  2758. DisablePlayerCheckpoint(playerid);
  2759. SetPlayerCheckpoint(playerid, EventRCPX[RCPIdCurrent[playerid]], EventRCPY[RCPIdCurrent[playerid]], EventRCPZ[RCPIdCurrent[playerid]], EventRCPS[RCPIdCurrent[playerid]]);
  2760. } else {
  2761. DisablePlayerCheckpoint(playerid);
  2762. SetPlayerCheckpoint(playerid, EventRCPX[RCPIdCurrent[playerid]], EventRCPY[RCPIdCurrent[playerid]], EventRCPZ[RCPIdCurrent[playerid]], EventRCPS[RCPIdCurrent[playerid]]);
  2763. }
  2764. SendClientMessageEx(playerid, COLOR_WHITE, "You have exited the checkpoint, you are no longer getting rehydrated.");
  2765. return 1;
  2766. }
  2767. if(GetPVarType(playerid,"IsInArena"))
  2768. {
  2769. new arenaid = GetPVarInt(playerid, "IsInArena");
  2770. if(PaintBallArena[arenaid][pbGameType] == 4 || PaintBallArena[arenaid][pbGameType] == 5)
  2771. {
  2772. //SendAudioToPlayer(playerid, 24, 100);
  2773. }
  2774. return 1;
  2775. }
  2776. if(PlayerInfo[playerid][pTut] != -1)
  2777. {
  2778. if(PlayerInfo[playerid][pTut] < 14) PlayerInfo[playerid][pTut] = 0;
  2779. AdvanceTutorial(playerid);
  2780. }
  2781. return 1;
  2782. }
  2783. public OnPlayerEnterCheckpoint(playerid)
  2784. {
  2785. if(GetPVarInt(playerid, "EventToken") == 1)
  2786. {
  2787. if(EventKernel[EventFootRace] == 1 && IsPlayerInAnyVehicle(playerid))
  2788. {
  2789. return SendClientMessageEx(playerid, COLOR_WHITE, "You cannot be inside vehicles and participate in this event at the same time.");
  2790. }
  2791. if(EventRCPT[RCPIdCurrent[playerid]] == 3 && PlayerInfo[playerid][pHydration] < 60) {
  2792. SendClientMessageEx(playerid, COLOR_WHITE, "You have entered a Watering Station checkpoint, you need to stay here in order to get rehydrated again.");
  2793. SendClientMessageEx(playerid, COLOR_WHITE, "You may choose to leave at any point or wait until you get the message of fully rehydrated.");
  2794. SetPVarInt(playerid, "WSRCPTimerId", SetTimerEx("WateringStation", 4000, 1, "i", playerid));
  2795. SetPVarInt(playerid, "InWaterStationRCP", 1);
  2796. return 1;
  2797. }
  2798. else if(EventRCPT[RCPIdCurrent[playerid]] == 4) {
  2799. RCPIdCurrent[playerid] = 0;
  2800. PlayerInfo[playerid][pHydration] -= 4;
  2801. PlayerInfo[playerid][pRacePlayerLaps]++;
  2802. if(PlayerInfo[playerid][pRacePlayerLaps] % 10 == 0) {
  2803. GiftPlayer(MAX_PLAYERS, playerid);
  2804. }
  2805. else if(PlayerInfo[playerid][pRacePlayerLaps] == 25) {
  2806. PlayerInfo[playerid][pEXPToken]++;
  2807. SendClientMessageEx(playerid, COLOR_YELLOW, "You have been given a Double EXP Token for completing 25 laps");
  2808. }
  2809. if(toglapcount == 0 && rflstatus > 0) {
  2810. RaceTotalLaps++;
  2811. Misc_Save();
  2812. new query[128];
  2813. if(PlayerInfo[playerid][pRFLTeam] != -1) {
  2814. RFLInfo[PlayerInfo[playerid][pRFLTeam]][RFLlaps] +=1;
  2815. mysql_format(MainPipeline, query, sizeof(query), "UPDATE `rflteams` SET `laps` = %d WHERE `id` = %d;",
  2816. RFLInfo[PlayerInfo[playerid][pRFLTeam]][RFLlaps],
  2817. RFLInfo[PlayerInfo[playerid][pRFLTeam]][RFLsqlid]);
  2818. mysql_tquery(MainPipeline, query, "OnQueryFinish", "i", SENDDATA_THREAD);
  2819. }
  2820. mysql_format(MainPipeline, query, sizeof(query), "UPDATE `accounts` SET `RacePlayerLaps` = %d WHERE `id` = %d;", PlayerInfo[playerid][pRacePlayerLaps], GetPlayerSQLId(playerid));
  2821. mysql_tquery(MainPipeline, query, "OnQueryFinish", "i", SENDDATA_THREAD);
  2822. }
  2823. new string[128];
  2824. if(PlayerInfo[playerid][pRFLTeam] != -1) {
  2825. format(string, sizeof(string), "Lap successfully completed. Laps Completed: %d | Team Laps Completed: %d | Total Laps Completed: %d", PlayerInfo[playerid][pRacePlayerLaps], RFLInfo[PlayerInfo[playerid][pRFLTeam]][RFLlaps], RaceTotalLaps);
  2826. }
  2827. else {
  2828. format(string, sizeof(string), "Lap successfully completed. Laps Completed: %d | Total Laps Completed: %d", PlayerInfo[playerid][pRacePlayerLaps], RaceTotalLaps);
  2829. }
  2830. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2831. }
  2832. else
  2833. {
  2834. RCPIdCurrent[playerid]++;
  2835. PlayerInfo[playerid][pHydration] -= 4;
  2836. }
  2837. new string[128];
  2838. if(PlayerInfo[playerid][pHydration] > 60)
  2839. {
  2840. format(string, sizeof(string), "Hydration level normal(%d)", PlayerInfo[playerid][pHydration]);
  2841. SendClientMessageEx(playerid, COLOR_GREEN, string);
  2842. }
  2843. else if(PlayerInfo[playerid][pHydration] < 61 && PlayerInfo[playerid][pHydration] > 30)
  2844. {
  2845. format(string, sizeof(string), "Hydration level low(%d)", PlayerInfo[playerid][pHydration]);
  2846. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  2847. }
  2848. else if(PlayerInfo[playerid][pHydration] < 31 && PlayerInfo[playerid][pHydration] > 0)
  2849. {
  2850. format(string, sizeof(string), "Hydration level very low(%d)", PlayerInfo[playerid][pHydration]);
  2851. SendClientMessageEx(playerid, COLOR_RED, string);
  2852. }
  2853. else if(PlayerInfo[playerid][pHydration] < 0)
  2854. {
  2855. SendClientMessageEx(playerid, COLOR_WHITE, "You have fallen to the ground due to being dehydrated, FDSA is going to rescue you and take you to the First Aid Station.");
  2856. DeletePVar(playerid, "EventToken");
  2857. DisablePlayerCheckpoint(playerid);
  2858. PlayerInfo[playerid][pHydration] = 100;
  2859. if(IsValidDynamic3DTextLabel(RFLTeamN3D[playerid])) {
  2860. DestroyDynamic3DTextLabel(RFLTeamN3D[playerid]);
  2861. RFLTeamN3D[playerid] = Text3D:-1;
  2862. }
  2863. SetHealth(playerid, 0);
  2864. return 1;
  2865. }
  2866. if(EventRCPT[RCPIdCurrent[playerid]] == 1) {
  2867. DisablePlayerCheckpoint(playerid);
  2868. SetPlayerCheckpoint(playerid, EventRCPX[RCPIdCurrent[playerid]], EventRCPY[RCPIdCurrent[playerid]], EventRCPZ[RCPIdCurrent[playerid]], EventRCPS[RCPIdCurrent[playerid]]);
  2869. }
  2870. else if(EventRCPT[RCPIdCurrent[playerid]] == 4) {
  2871. DisablePlayerCheckpoint(playerid);
  2872. SetPlayerCheckpoint(playerid, EventRCPX[RCPIdCurrent[playerid]], EventRCPY[RCPIdCurrent[playerid]], EventRCPZ[RCPIdCurrent[playerid]], EventRCPS[RCPIdCurrent[playerid]]);
  2873. } else {
  2874. DisablePlayerCheckpoint(playerid);
  2875. SetPlayerCheckpoint(playerid, EventRCPX[RCPIdCurrent[playerid]], EventRCPY[RCPIdCurrent[playerid]], EventRCPZ[RCPIdCurrent[playerid]], EventRCPS[RCPIdCurrent[playerid]]);
  2876. }
  2877. return 1;
  2878. }
  2879. if(GetPVarType(playerid,"IsInArena"))
  2880. {
  2881. new arenaid = GetPVarInt(playerid, "IsInArena");
  2882. if(PaintBallArena[arenaid][pbGameType] == 4 || PaintBallArena[arenaid][pbGameType] == 5)
  2883. {
  2884. //SendAudioToPlayer(playerid, 23, 100);
  2885. }
  2886. return 1;
  2887. }
  2888. if(GetPVarInt(playerid, "ShopCheckpoint") != 0)
  2889. {
  2890. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2891. DisablePlayerCheckpoint(playerid);
  2892. DeletePVar(playerid, "ShopCheckpoint");
  2893. return 1;
  2894. }
  2895. if(GetPVarInt(playerid,"TrackCar") != 0)
  2896. {
  2897. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2898. DisablePlayerCheckpoint(playerid);
  2899. DeletePVar(playerid, "TrackCar");
  2900. return 1;
  2901. }
  2902. if(GetPVarType(playerid,"DeliveringVehicleTime"))
  2903. {
  2904. if(!IsPlayerInVehicle(playerid, GetPVarInt(playerid, "LockPickVehicle")))
  2905. return SendClientMessageEx(playerid, COLOR_WHITE, "You need to be inside the vehicle you are delivering!");
  2906. new szMessage[140];
  2907. new RandAmount;
  2908. switch(PlayerInfo[playerid][pCarLockPickSkill]) {
  2909. case 0 .. 49: RandAmount = Random(10000, 13000);
  2910. case 50 .. 124: RandAmount = Random(13000, 16000);
  2911. case 125 .. 224: RandAmount = Random(16000, 24000);
  2912. case 225 .. 349: RandAmount = Random(24000, 27000);
  2913. default: RandAmount = Random(27000, 33000);
  2914. }
  2915. if(!Bank_TransferCheck(RandAmount)) return 1;
  2916. PlayerInfo[playerid][pAccount] += RandAmount;
  2917. format(szMessage, sizeof(szMessage), "SMS: Thank you for delivering a %s(%d) your reward is $%s, money will be transferred to your account, sender: Unknown", GetVehicleName(GetPVarInt(playerid, "LockPickVehicle")), GetPVarInt(playerid, "LockPickVehicle"), number_format(RandAmount));
  2918. SendClientMessageEx(playerid, COLOR_YELLOW, szMessage);
  2919. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2920. new ip[MAX_PLAYER_NAME], ip2[MAX_PLAYER_NAME];
  2921. GetPlayerIp(playerid, ip, sizeof(ip));
  2922. if(GetPVarType(playerid, "LockPickVehicleSQLId")) {
  2923. mysql_format(MainPipeline, szMessage, sizeof(szMessage), "UPDATE `vehicles` SET `pvFuel` = %0.5f WHERE `id` = '%d' AND `sqlID` = '%d'", VehicleFuel[GetPVarInt(playerid, "LockPickVehicle")], GetPVarInt(playerid, "LockPickVehicleSQLId"), GetPVarInt(playerid, "LockPickPlayerSQLId"));
  2924. mysql_tquery(MainPipeline, szMessage, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
  2925. GetPVarString(playerid, "LockPickPlayerName", ip2, sizeof(ip2));
  2926. format(szMessage, sizeof(szMessage), "[LOCK PICK] %s(%d) (IP:%s) delivered a %s(VID:%d SQLId:%d) owned by %s(Offline SQLId %d)", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ip, GetVehicleName(GetPVarInt(playerid, "LockPickVehicle")), GetPVarInt(playerid, "LockPickVehicle"), GetPVarInt(playerid, "LockPickVehicleSQLId"), ip2, GetPVarInt(playerid, "LockPickPlayerSQLId"));
  2927. Log("logs/playervehicle.log", szMessage);
  2928. DeletePVar(playerid, "LockPickVehicleSQLId");
  2929. DeletePVar(playerid, "LockPickPlayerSQLId");
  2930. DeletePVar(playerid, "LockPickPlayerName");
  2931. }
  2932. else {
  2933. new ownerid = GetPVarInt(playerid, "LockPickPlayer"), slot = GetPlayerVehicle(GetPVarInt(playerid, "LockPickPlayer"), GetPVarInt(playerid, "LockPickVehicle"));
  2934. GetPlayerIp(ownerid, ip2, sizeof(ip2));
  2935. format(szMessage, sizeof(szMessage), "[LOCK PICK] %s(%d) (IP:%s) delivered a %s(VID:%d Slot %d) owned by %s(IP:%s)", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ip, GetVehicleName(PlayerVehicleInfo[ownerid][slot][pvId]), PlayerVehicleInfo[ownerid][slot][pvId], slot, GetPlayerNameEx(ownerid), ip2);
  2936. Log("logs/playervehicle.log", szMessage);
  2937. --PlayerCars;
  2938. VehicleSpawned[ownerid]--;
  2939. PlayerVehicleInfo[ownerid][slot][pvAlarmTriggered] = 0;
  2940. PlayerVehicleInfo[ownerid][slot][pvBeingPickLocked] = 0;
  2941. PlayerVehicleInfo[ownerid][slot][pvBeingPickLockedBy] = INVALID_PLAYER_ID;
  2942. PlayerVehicleInfo[ownerid][slot][pvSpawned] = 0;
  2943. GetVehicleHealth(PlayerVehicleInfo[ownerid][slot][pvId], PlayerVehicleInfo[ownerid][slot][pvHealth]);
  2944. PlayerVehicleInfo[ownerid][slot][pvId] = INVALID_PLAYER_VEHICLE_ID;
  2945. PlayerVehicleInfo[ownerid][slot][pvFuel] = VehicleFuel[GetPVarInt(playerid, "LockPickVehicle")];
  2946. g_mysql_SaveVehicle(ownerid, slot);
  2947. }
  2948. DestroyVehicle(GetPVarInt(playerid, "LockPickVehicle"));
  2949. DisablePlayerCheckpoint(playerid);
  2950. DeletePVar(playerid, "DeliveringVehicleTime");
  2951. DeletePVar(playerid, "LockPickVehicle");
  2952. DeletePVar(playerid, "LockPickPlayer");
  2953. return 1;
  2954. }
  2955. if(GetPVarInt(playerid,"DV_TrackCar") != 0)
  2956. {
  2957. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2958. DisablePlayerCheckpoint(playerid);
  2959. DeletePVar(playerid, "DV_TrackCar");
  2960. return 1;
  2961. }
  2962. if(GetPVarInt(playerid,"bpanic") != 0)
  2963. {
  2964. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2965. DisablePlayerCheckpoint(playerid);
  2966. DeletePVar(playerid, "bpanic");
  2967. return 1;
  2968. }
  2969. if(GetPVarInt(playerid,"igps") != 0)
  2970. {
  2971. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2972. DisablePlayerCheckpoint(playerid);
  2973. DeletePVar(playerid, "igps");
  2974. return 1;
  2975. }
  2976. if(GetPVarInt(playerid, "GiftBoxCP") == 1)
  2977. {
  2978. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2979. DisablePlayerCheckpoint(playerid);
  2980. DeletePVar(playerid, "GiftBoxCP");
  2981. return true;
  2982. }
  2983. // Dynamic Points System
  2984. if((0 <= MatDeliver[playerid] < MAX_POINTS)) {
  2985. new string[128], drugname[8];
  2986. if(IsPlayerInRangeOfPoint(playerid, 6.0, DynPoints[MatDeliver[playerid]][poPos2][0], DynPoints[MatDeliver[playerid]][poPos2][1], DynPoints[MatDeliver[playerid]][poPos2][2])) {
  2987. switch(DynPoints[MatDeliver[playerid]][poType])
  2988. {
  2989. case 1: drugname = "Pot";
  2990. case 2: drugname = "Crack";
  2991. case 3: drugname = "Meth";
  2992. case 4: drugname = "Ecstasy";
  2993. }
  2994. if(DynPoints[MatDeliver[playerid]][poBoat] && !IsABoat(GetPlayerVehicleID(playerid))) {
  2995. GameTextForPlayer(playerid, "~r~You are not in a boat!", 3000, 1);
  2996. return 1;
  2997. }
  2998. if(DynPoints[MatDeliver[playerid]][poType] == 0) { // Materials
  2999. SendClientMessageEx(playerid, COLOR_WHITE, "* The factory gave you %s materials for your materials packages.", number_format(MatsAmount[playerid]));
  3000. TransferStorage(playerid, -1, -1, -1, 4, MatsAmount[playerid], -1, 2);
  3001. }
  3002. if((1 <= DynPoints[MatDeliver[playerid]][poType] < 5)) {
  3003. SendClientMessageEx(playerid, COLOR_WHITE, "You have delivered the packages and gained %sg of %s", number_format(MatsAmount[playerid]), drugname);
  3004. PlayerInfo[playerid][pDrugs][DynPoints[MatDeliver[playerid]][poType]-1] += MatsAmount[playerid];
  3005. IncreaseSmugglerLevel(playerid);
  3006. }
  3007. if(GetPVarInt(playerid, "tpMatRunTimer") != 0)
  3008. {
  3009. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly teleport material/drug runs.", GetPlayerNameEx(playerid), playerid);
  3010. ABroadCast(COLOR_YELLOW, string, 2);
  3011. }
  3012. MatDeliver[playerid] = -1;
  3013. MatsAmount[playerid] = 0;
  3014. DisablePlayerCheckpoint(playerid);
  3015. }
  3016. }
  3017. if(GetPVarInt(playerid, "TruckDeliver") > 0 && gPlayerCheckpointStatus[playerid] != CHECKPOINT_RETURNTRUCK)
  3018. {
  3019. new vehicleid = GetPlayerVehicleID(playerid);
  3020. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
  3021. {
  3022. SendClientMessageEx(playerid, COLOR_WHITE, "You are not in a Truck!");
  3023. return 1;
  3024. }
  3025. if(TruckUsed[playerid] != INVALID_VEHICLE_ID && vehicleid != TruckUsed[playerid])
  3026. {
  3027. SendClientMessageEx(playerid, COLOR_WHITE, "This is not your Truck with the goods you are suppose to deliver!");
  3028. return 1;
  3029. }
  3030. if(!IsAtTruckDeliveryPoint(playerid))
  3031. {// In the case the player finds a way to exploit the checkpoint to different location
  3032. CancelTruckDelivery(playerid);
  3033. SendClientMessageEx(playerid, COLOR_REALRED, "ERROR: Wrong checkpoint entered. Truck delivery canceled completely.");
  3034. return 1;
  3035. }
  3036. if(GetPVarInt(playerid, "tpTruckRunTimer") != 0)
  3037. {
  3038. new string[128];
  3039. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly teleport truck/boat running.", GetPlayerNameEx(playerid), playerid);
  3040. ABroadCast( COLOR_YELLOW, string, 2 );
  3041. // format(string, sizeof(string), "%s (ID %d) is possibly teleport truckrunning.", GetPlayerNameEx(playerid), playerid);
  3042. // Log("logs/hack.log", string);
  3043. }
  3044. new truckdeliver = GetPVarInt(playerid, "TruckDeliver");
  3045. TruckContents{vehicleid} = 0;
  3046. if(truckdeliver == 1)
  3047. {
  3048. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You delivered the food & beverages, return the vehicle to the Docks to collect your pay.");
  3049. }
  3050. else if(truckdeliver == 2)
  3051. {
  3052. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You delivered the clothing, return the vehicle to the Docks to collect your pay.");
  3053. }
  3054. else if(truckdeliver == 3)
  3055. {
  3056. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You delivered the materials, return the vehicle to the Docks to collect your pay.");
  3057. }
  3058. else if(truckdeliver == 4)
  3059. {
  3060. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You delivered the 24/7 items, return the vehicle to the Docks to collect your pay.");
  3061. }
  3062. else if(truckdeliver == 5)
  3063. {
  3064. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You delivered the weapons, return the vehicle to the Docks to collect your pay.");
  3065. }
  3066. else if(truckdeliver == 6)
  3067. {
  3068. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You delivered the drugs, return the vehicle to the Docks to collect your pay.");
  3069. }
  3070. else if(truckdeliver == 7)
  3071. {
  3072. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You delivered the illegal materials, return the vehicle to the Docks to collect your pay.");
  3073. }
  3074. DisablePlayerCheckpoint(playerid);
  3075. gPlayerCheckpointStatus[playerid] = CHECKPOINT_RETURNTRUCK;
  3076. if(!IsABoat(vehicleid))
  3077. {
  3078. SetPlayerCheckpoint(playerid, -1548.087524, 123.590423, 3.554687, 5);
  3079. GameTextForPlayer(playerid, "~w~Waypoint set ~r~San Fierro Docks", 5000, 1);
  3080. SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Return to the San Fierro Docks (see checkpoint on radar).");
  3081. }
  3082. else
  3083. {
  3084. SetPlayerCheckpoint(playerid, 2098.6543,-104.3568,-0.4820, 5);
  3085. GameTextForPlayer(playerid, "~w~Waypoint set ~r~Palamino Docks", 5000, 1);
  3086. SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Return to the Palamino Docks (see checkpoint on radar).");
  3087. }
  3088. SetPVarInt(playerid, "tpTruckRunTimer", 30);
  3089. SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPTRUCKRUNTIMER);
  3090. return 1;
  3091. }
  3092. if(gPlayerCheckpointStatus[playerid] == CHECKPOINT_DELIVERY)
  3093. {
  3094. new vehicleid = GetPlayerVehicleID(playerid);
  3095. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
  3096. {
  3097. SendClientMessageEx(playerid, COLOR_WHITE, "You are not in a truck!");
  3098. return 1;
  3099. }
  3100. if(TruckUsed[playerid] != INVALID_VEHICLE_ID && vehicleid != TruckUsed[playerid])
  3101. {
  3102. SendClientMessageEx(playerid, COLOR_WHITE, "This is not your vehicle with the goods you are suppose to deliver!");
  3103. return 1;
  3104. }
  3105. new business = TruckDeliveringTo[vehicleid];
  3106. if (!IsPlayerInRangeOfPoint(playerid, 20.0, Businesses[business][bSupplyPos][0], Businesses[business][bSupplyPos][1], Businesses[business][bSupplyPos][2])) return 1;
  3107. if(GetPVarInt(playerid, "tpTruckRunTimer") != 0)
  3108. {
  3109. new string[128];
  3110. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly teleport truck/boat running.", GetPlayerNameEx(playerid), playerid);
  3111. ABroadCast( COLOR_YELLOW, string, 2 );
  3112. // format(string, sizeof(string), "%s (ID %d) is possibly teleport truckrunning.", GetPlayerNameEx(playerid), playerid);
  3113. // Log("logs/hack.log", string);
  3114. }
  3115. new string[128];
  3116. format(string, sizeof(string), "* You have delivered %s to %s. Return the truck to the San Fierro Docks to collect your pay.", GetInventoryType(business), Businesses[business][bName]);
  3117. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  3118. Businesses[business][bOrderState] = 3;
  3119. Businesses[business][bInventory] += Businesses[business][bOrderAmount];
  3120. foreach (new i: Player)
  3121. {
  3122. if (PlayerInfo[i][pBusiness] == business) SendClientMessageEx(i, COLOR_WHITE, "An order has just been delivered to your business.");
  3123. }
  3124. /*if (Businesses[business][bType] == BUSINESS_TYPE_NEWCARDEALERSHIP)
  3125. {
  3126. new iSlot = GetPVarInt(playerid, "CarryingSlot");
  3127. new iVehicle = GetPVarInt(playerid , "CarryingVehicle");
  3128. if (GetDistanceToCar(playerid, iVehicle) > 10.0) return SendClientMessageEx(playerid, COLOR_WHITE, "The vehicle is not with you.");
  3129. Businesses[business][DealershipVehStock][iSlot] = 1;
  3130. SetVehiclePos(iVehicle, Businesses[business][bParkPosX][iSlot], Businesses[business][bParkPosY][iSlot], Businesses[business][bParkPosZ][iSlot]);
  3131. SetVehicleZAngle(iVehicle, Businesses[business][bParkAngle][iSlot]);
  3132. DeletePVar(playerid, "CarryingSlot");
  3133. DeletePVar(playerid, "CarryingVehicle");
  3134. }*/
  3135. if (Businesses[business][bType] == BUSINESS_TYPE_GASSTATION)
  3136. {
  3137. for (new i; i < MAX_BUSINESS_GAS_PUMPS; i++)
  3138. {
  3139. Businesses[business][GasPumpGallons][i] = Businesses[business][GasPumpCapacity][i];
  3140. }
  3141. DestroyVehicle(GetVehicleTrailer(vehicleid));
  3142. DeletePVar(playerid, "Gas_TrailerID");
  3143. }
  3144. SaveBusiness(business);
  3145. DisablePlayerCheckpoint(playerid);
  3146. gPlayerCheckpointStatus[playerid] = CHECKPOINT_RETURNTRUCK;
  3147. SetPlayerCheckpoint(playerid, -1548.087524, 123.590423, 3.554687, 5);
  3148. GameTextForPlayer(playerid, "~w~Waypoint set ~r~San Fierro Docks", 5000, 1);
  3149. SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Return to the San Fierro Docks (see checkpoint on radar).");
  3150. //SetPVarInt(playerid, "tpTruckRunTimer", 30);
  3151. //SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPTRUCKRUNTIMER);
  3152. return 1;
  3153. }
  3154. // Pizza Delivery
  3155. if(GetPVarType(playerid, "Pizza") > 0 && GetPVarInt(playerid, "pizzaTimer") > 0 && IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorX], HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorY], HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorZ]) && GetPlayerInterior(playerid) == HouseInfo[GetPVarInt(playerid, "Pizza")][hExtIW] && GetPlayerVirtualWorld(playerid) == HouseInfo[GetPVarInt(playerid, "Pizza")][hExtVW])
  3156. {
  3157. new string[128];
  3158. if (GetPVarInt(playerid, "tpPizzaTimer") != 0)
  3159. {
  3160. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly teleport pizzarunning.", GetPlayerNameEx(playerid), playerid);
  3161. ABroadCast( COLOR_YELLOW, string, 2 );
  3162. // format(string, sizeof(string), "%s (ID %d) is possibly teleport pizzarunning.", GetPlayerNameEx(playerid), playerid);
  3163. // Log("logs/hack.log", string);
  3164. }
  3165. format(string, sizeof(string), "You have delivered the pizza to the destination! You have made $%d.", (GetPVarInt(playerid, "pizzaTimer") * 70));
  3166. Misc_Save();
  3167. GivePlayerCash(playerid, floatround((GetPVarInt(playerid, "pizzaTimer") * 70), floatround_round));
  3168. SendClientMessageEx(playerid, COLOR_WHITE, string);
  3169. DeletePVar(playerid, "Pizza");
  3170. DeletePVar(playerid, "pizzaTimer");
  3171. DisablePlayerCheckpoint(playerid);
  3172. }
  3173. if(GetPVarInt(playerid, "Finding")>=1)
  3174. {
  3175. DeletePVar(playerid, "Finding");
  3176. DisablePlayerCheckpoint(playerid);
  3177. GameTextForPlayer(playerid, "~w~Reached destination", 5000, 1);
  3178. }
  3179. if(TaxiCallTime[playerid] > 0 && TaxiAccepted[playerid] != INVALID_PLAYER_ID)
  3180. {
  3181. TaxiAccepted[playerid] = INVALID_PLAYER_ID;
  3182. GameTextForPlayer(playerid, "~w~Reached destination", 5000, 1);
  3183. TaxiCallTime[playerid] = 0;
  3184. DisablePlayerCheckpoint(playerid);
  3185. }
  3186. else if(EMSCallTime[playerid] > 0 && EMSAccepted[playerid] != INVALID_PLAYER_ID)
  3187. {
  3188. if(GetPVarInt(EMSAccepted[playerid], "Injured") == 1)
  3189. {
  3190. SendEMSQueue(EMSAccepted[playerid],2);
  3191. EMSAccepted[playerid] = INVALID_PLAYER_ID;
  3192. GameTextForPlayer(playerid, "~w~Reached destination", 5000, 1);
  3193. EMSCallTime[playerid] = 0;
  3194. DisablePlayerCheckpoint(playerid);
  3195. }
  3196. else
  3197. {
  3198. EMSAccepted[playerid] = INVALID_PLAYER_ID;
  3199. GameTextForPlayer(playerid, "~r~Patient has died", 5000, 1);
  3200. EMSCallTime[playerid] = 0;
  3201. DisablePlayerCheckpoint(playerid);
  3202. }
  3203. }
  3204. else if(BusCallTime[playerid] > 0 && BusAccepted[playerid] != INVALID_PLAYER_ID)
  3205. {
  3206. BusAccepted[playerid] = INVALID_PLAYER_ID;
  3207. GameTextForPlayer(playerid, "~w~Reached destination", 5000, 1);
  3208. BusCallTime[playerid] = 0;
  3209. DisablePlayerCheckpoint(playerid);
  3210. }
  3211. else if(MedicCallTime[playerid] > 0 && MedicAccepted[playerid] != INVALID_PLAYER_ID)
  3212. {
  3213. MedicAccepted[playerid] = INVALID_PLAYER_ID;
  3214. GameTextForPlayer(playerid, "~w~Reached patient", 5000, 1);
  3215. MedicCallTime[playerid] = 0;
  3216. DisablePlayerCheckpoint(playerid);
  3217. }
  3218. else
  3219. {
  3220. switch (gPlayerCheckpointStatus[playerid])
  3221. {
  3222. case CHECKPOINT_NOTHING: {
  3223. DisablePlayerCheckpoint(playerid);
  3224. gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
  3225. return 1;
  3226. }
  3227. case CHECKPOINT_HOME:
  3228. {
  3229. PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
  3230. new i = GetPVarInt(playerid, "hInviteHouse");
  3231. DisablePlayerCheckpoint(playerid);
  3232. gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
  3233. SetPlayerInterior(playerid,HouseInfo[i][hIntIW]);
  3234. SetPlayerPos(playerid,HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
  3235. GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
  3236. PlayerInfo[playerid][pInt] = HouseInfo[i][hIntIW];
  3237. PlayerInfo[playerid][pVW] = HouseInfo[i][hIntVW];
  3238. SetPlayerVirtualWorld(playerid,HouseInfo[i][hIntVW]);
  3239. if(HouseInfo[i][hCustomInterior] == 1) Player_StreamPrep(playerid, HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ], FREEZE_TIME);
  3240. }
  3241. case CHECKPOINT_LOADTRUCK:
  3242. {
  3243. if(IsPlayerInRangeOfPoint(playerid, 6, -1572.767822, 81.137527, 3.554687) || IsPlayerInRangeOfPoint(playerid, 6, 2098.6543,-104.3568,-0.4820))
  3244. {
  3245. new vehicleid = GetPlayerVehicleID(playerid);
  3246. if(IsATruckerCar(vehicleid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  3247. {
  3248. PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
  3249. DisablePlayerCheckpoint(playerid);
  3250. gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
  3251. TogglePlayerControllable(playerid, 0);
  3252. SetPVarInt(playerid, "IsFrozen", 1);
  3253. DisplayOrders(playerid);
  3254. }
  3255. else return SendClientMessageEx(playerid, COLOR_GREY, "You are not driving the correct Boat or Truck!");
  3256. }
  3257. }
  3258. case CHECKPOINT_RETURNTRUCK:
  3259. {
  3260. if(!IsPlayerInRangeOfPoint(playerid, 6, -1548.087524, 123.590423, 3.554687) && !IsPlayerInRangeOfPoint(playerid, 6, 2098.6543,-104.3568,-0.4820))
  3261. {// In the case the person finds a way to exploit the checkpoint to different location
  3262. CancelTruckDelivery(playerid);
  3263. SendClientMessageEx(playerid, COLOR_REALRED, "ERROR: Wrong checkpoint entered. Truck delivery canceled completely.");
  3264. return 1;
  3265. }
  3266. if(GetPVarInt(playerid, "tpTruckRunTimer") != 0)
  3267. {
  3268. new string[128];
  3269. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly teleport truck/boat running.", GetPlayerNameEx(playerid), playerid);
  3270. ABroadCast( COLOR_YELLOW, string, 2 );
  3271. // format(string, sizeof(string), "%s (ID %d) is possibly teleport truckrunning.", GetPlayerNameEx(playerid), playerid);
  3272. // Log("logs/hack.log", string);
  3273. }
  3274. new vehicleid = GetPlayerVehicleID(playerid);
  3275. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
  3276. {
  3277. SendClientMessageEx(playerid, COLOR_WHITE, "You are not in a Shipment Transport Vehicle!");
  3278. return 1;
  3279. }
  3280. if(TruckUsed[playerid] != INVALID_VEHICLE_ID && vehicleid != TruckUsed[playerid])
  3281. {
  3282. SendClientMessageEx(playerid, COLOR_WHITE, "This is not the vehicle you used, return the vehicle you used in order to receive your pay!");
  3283. return 1;
  3284. }
  3285. PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
  3286. DisablePlayerCheckpoint(playerid);
  3287. gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
  3288. new route = TruckRoute[vehicleid];
  3289. new string[128], payment;
  3290. new level = PlayerInfo[playerid][pTruckSkill];
  3291. switch(level) {
  3292. case 0 .. 50: payment = 4000;
  3293. case 51 .. 100: payment = 6250;
  3294. case 101 .. 200: payment = 8500;
  3295. case 201 .. 400: payment = 9750;
  3296. case 401: payment = 10500;
  3297. default: payment = 10500;
  3298. }
  3299. new Float:distancepay;
  3300. if(IsABoat(vehicleid))
  3301. {
  3302. distancepay = floatmul(GetDistanceBetweenPoints(2098.6543,-104.3568,-0.4820, BoatDropoffs[route][PosX], BoatDropoffs[route][PosY], BoatDropoffs[route][PosZ]), 1.5);
  3303. }
  3304. else
  3305. {
  3306. distancepay = floatmul(GetDistanceBetweenPoints(-1572.767822, 81.137527, 3.554687, TruckerDropoffs[route][PosX], TruckerDropoffs[route][PosY], TruckerDropoffs[route][PosZ]), 1.5);
  3307. }
  3308. payment += floatround(distancepay);
  3309. if(TruckDeliveringTo[vehicleid] != INVALID_BUSINESS_ID) {
  3310. new iBusiness = TruckDeliveringTo[vehicleid];
  3311. new Float: iDist = GetPlayerDistanceFromPoint(playerid, Businesses[iBusiness][bSupplyPos][0], Businesses[iBusiness][bSupplyPos][1], Businesses[iBusiness][bSupplyPos][2]);
  3312. payment = floatround(iDist / 3000 * payment);
  3313. if (payment > 25000) payment = 25000;
  3314. GivePlayerCash(playerid, payment);
  3315. format(string, sizeof(string), "* You were paid $%d for delivering the goods and returning the vehicle.", payment);
  3316. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  3317. SetVehicleToRespawn(vehicleid);
  3318. }
  3319. else {
  3320. DeletePVar(playerid, "LoadType");
  3321. new truckdeliver = GetPVarInt(playerid, "TruckDeliver");
  3322. TruckContents{vehicleid} = 0;
  3323. if(truckdeliver >= 1 && truckdeliver <= 5)
  3324. {
  3325. GivePlayerCash(playerid, payment);
  3326. format(string, sizeof(string), "* You were paid $%d for delivering the goods and returning the vehicle.", payment);
  3327. }
  3328. else if(truckdeliver >= 5 && truckdeliver <= 7)
  3329. {
  3330. payment = floatround(payment * 1.25);
  3331. GivePlayerCash(playerid, payment);
  3332. format(string, sizeof(string), "* You were paid $%d for delivering the goods and returning the vehicle.", payment);
  3333. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You received a 25 percent bonus for the additional risk from the cops.");
  3334. }
  3335. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  3336. if(truckdeliver == 5) // Weapons
  3337. {
  3338. if(PlayerInfo[playerid][pConnectHours] >= 2 && PlayerInfo[playerid][pWRestricted] <= 0)
  3339. {
  3340. switch(level) {
  3341. case 0 .. 49: GivePlayerValidWeapon(playerid, WEAPON_COLT45);
  3342. case 50 .. 100: ShowPlayerDialogEx(playerid, D_TRUCKDELIVER_WEPCHOICE, DIALOG_STYLE_LIST, "Select your reward", "9mm\nShotgun", "Select", "");
  3343. case 101 .. 200: ShowPlayerDialogEx(playerid, D_TRUCKDELIVER_WEPCHOICE, DIALOG_STYLE_LIST, "Select your reward", "9mm\nShotgun\nMP5", "Select", "");
  3344. case 201 .. 400: ShowPlayerDialogEx(playerid, D_TRUCKDELIVER_WEPCHOICE, DIALOG_STYLE_LIST, "Select your reward", "9mm\nShotgun\nMP5\nDeagle", "Select", "");
  3345. case 401: ShowPlayerDialogEx(playerid, D_TRUCKDELIVER_WEPCHOICE, DIALOG_STYLE_LIST, "Select your reward", "9mm\nShotgun\nMP5\nDeagle\nAK-47", "Select", "");
  3346. default: ShowPlayerDialogEx(playerid, D_TRUCKDELIVER_WEPCHOICE, DIALOG_STYLE_LIST, "Select your reward", "9mm\nShotgun\nMP5\nDeagle\nAK-47", "Select", "");
  3347. }
  3348. }
  3349. else
  3350. {
  3351. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You were not given a free weapon due to your weapon restriction.");
  3352. }
  3353. }
  3354. if(truckdeliver == 6) // Drugs
  3355. {
  3356. if(level >= 0 && level <= 50)
  3357. {
  3358. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You were also given 2 pot & 1 crack as a bonus for taking the risk of transporting illegal drugs.");
  3359. PlayerInfo[playerid][pDrugs][0] += 2;
  3360. PlayerInfo[playerid][pDrugs][1] += 1;
  3361. }
  3362. else if(level >= 51 && level <= 100)
  3363. {
  3364. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You were also given 4 pot & 2 crack as a bonus for taking the risk of transporting illegal drugs.");
  3365. PlayerInfo[playerid][pDrugs][0] += 4;
  3366. PlayerInfo[playerid][pDrugs][1] += 2;
  3367. }
  3368. else if(level >= 101 && level <= 200)
  3369. {
  3370. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You were also given 6 pot & 3 crack as a bonus for taking the risk of transporting illegal drugs.");
  3371. PlayerInfo[playerid][pDrugs][0] += 6;
  3372. PlayerInfo[playerid][pDrugs][1] += 3;
  3373. }
  3374. else if(level >= 201 && level <= 400)
  3375. {
  3376. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You were also given 8 pot & 4 crack as a bonus for taking the risk of transporting illegal drugs.");
  3377. PlayerInfo[playerid][pDrugs][0] += 8;
  3378. PlayerInfo[playerid][pDrugs][1] += 4;
  3379. }
  3380. else if(level >= 401)
  3381. {
  3382. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You were also given 10 pot & 5 crack as a bonus for taking the risk of transporting illegal drugs.");
  3383. PlayerInfo[playerid][pDrugs][0] += 10;
  3384. PlayerInfo[playerid][pDrugs][1] += 5;
  3385. }
  3386. }
  3387. if(truckdeliver == 7) // Illegal materials
  3388. {
  3389. if(level >= 0 && level <= 50)
  3390. {
  3391. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You were also given 100 materials as a bonus for taking the risk of transporting illegal materials.");
  3392. PlayerInfo[playerid][pMats] += 100;
  3393. }
  3394. else if(level >= 51 && level <= 100)
  3395. {
  3396. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You were also given 200 materials as a bonus for taking the risk of transporting illegal materials.");
  3397. PlayerInfo[playerid][pMats] += 200;
  3398. }
  3399. else if(level >= 101 && level <= 200)
  3400. {
  3401. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You were also given 400 materials as a bonus for taking the risk of transporting illegal materials.");
  3402. PlayerInfo[playerid][pMats] += 400;
  3403. }
  3404. else if(level >= 201 && level <= 400)
  3405. {
  3406. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You were also given 600 materials as a bonus for taking the risk of transporting illegal materials.");
  3407. PlayerInfo[playerid][pMats] += 600;
  3408. }
  3409. else if(level >= 401)
  3410. {
  3411. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You were also given 1000 materials as a bonus for taking the risk of transporting illegal materials.");
  3412. PlayerInfo[playerid][pMats] += 1000;
  3413. }
  3414. }
  3415. SetVehicleToRespawn(vehicleid);
  3416. }
  3417. if(PlayerInfo[playerid][pDoubleEXP] > 0)
  3418. {
  3419. format(string, sizeof(string), "You have gained 2 truck skill points instead of 1. You have %d hours left on the Double EXP token.", PlayerInfo[playerid][pDoubleEXP]);
  3420. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  3421. PlayerInfo[playerid][pTruckSkill] += 2;
  3422. }
  3423. else
  3424. {
  3425. PlayerInfo[playerid][pTruckSkill] += 1;
  3426. }
  3427. TruckUsed[playerid] = INVALID_VEHICLE_ID;
  3428. DeletePVar(playerid, "TruckDeliver");
  3429. new mypoint = -1;
  3430. for (new i=0; i<MAX_POINTS; i++)
  3431. {
  3432. if(strcmp(Points[i][Name], "San Fierro Docks", true) == 0)
  3433. {
  3434. mypoint = i;
  3435. }
  3436. }
  3437. for(new i = 0; i < MAX_GROUPS; i++)
  3438. {
  3439. if(strcmp(Points[mypoint][Owner], arrGroupData[i][g_szGroupName], true) == 0)
  3440. {
  3441. Misc_Save();
  3442. arrGroupData[i][g_iBudget] += 200;
  3443. }
  3444. }
  3445. }
  3446. }
  3447. }
  3448. if (GetPVarInt(playerid, "_SwimmingActivity") > 0)
  3449. {
  3450. new stage = GetPVarInt(playerid, "_SwimmingActivity");
  3451. switch (stage)
  3452. {
  3453. case 1:
  3454. {
  3455. SetPlayerCheckpoint(playerid, 2889.5471, -2269.0251, 0.2176, 2.0);
  3456. SetPVarInt(playerid, "_SwimmingActivity", 2);
  3457. }
  3458. case 2:
  3459. {
  3460. SetPlayerCheckpoint(playerid, 2839.7312, -2268.6123, -0.9815, 2.0);
  3461. SetPVarInt(playerid, "_SwimmingActivity", 3);
  3462. }
  3463. case 3:
  3464. {
  3465. SetPlayerCheckpoint(playerid, 2839.5469, -2281.9521, -0.8549, 2.0);
  3466. SetPVarInt(playerid, "_SwimmingActivity", 4);
  3467. }
  3468. case 4:
  3469. {
  3470. SetPlayerCheckpoint(playerid, 2888.1426, -2284.0317, 0.1347, 2.0);
  3471. SetPVarInt(playerid, "_SwimmingActivity", 5);
  3472. }
  3473. case 5:
  3474. {
  3475. SetPlayerCheckpoint(playerid, 2889.5471, -2269.0251, 0.2176, 2.0);
  3476. SetPVarInt(playerid, "_SwimmingActivity", 6);
  3477. }
  3478. case 6:
  3479. {
  3480. SendClientMessageEx(playerid, COLOR_WHITE, "Lap completed! Your fitness has increased slightly.");
  3481. if(PlayerInfo[playerid][mCooldown][4]) PlayerInfo[playerid][pFitness] += 5;
  3482. else PlayerInfo[playerid][pFitness] += 3;
  3483. if (PlayerInfo[playerid][pFitness] > 100) PlayerInfo[playerid][pFitness] = 100;
  3484. SendClientMessageEx(playerid, COLOR_WHITE, "If you have finished exercising, type /stopswimming.");
  3485. SetPVarInt(playerid, "_SwimmingActivity", 3);
  3486. SetPlayerCheckpoint(playerid, 2839.7312, -2268.6123, -0.9815, 2.0);
  3487. }
  3488. }
  3489. }
  3490. return 1;
  3491. }
  3492. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  3493. {
  3494. if(GetPVarInt(playerid, "Injured") == 1) return 1;
  3495. if(PlayerInfo[playerid][pHospital] > 0) return 1;
  3496. if(gPlayerUsingLoopingAnim[playerid] && IsKeyJustDown(KEY_SPRINT,newkeys,oldkeys))
  3497. {
  3498. StopLoopingAnim(playerid);
  3499. TextDrawHideForPlayer(playerid,txtAnimHelper);
  3500. }
  3501. if(newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP) && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED) ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff",4.1,0,1,1,0,0);
  3502. if(newkeys & KEY_SECONDARY_ATTACK)
  3503. {
  3504. new string[128];
  3505. if(!GetPVarType(playerid, "Tackling")) {
  3506. if(GetPVarInt(playerid, "TackleMode") == 1 && GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID && PlayerCuffed[GetPlayerTargetPlayer(playerid)] == 0 && ProxDetectorS(4.0, playerid, GetPlayerTargetPlayer(playerid)) && !IsPlayerNPC(GetPlayerTargetPlayer(playerid)))
  3507. {
  3508. if(GetPVarInt(playerid, "CopTackleCooldown") != 0)
  3509. {
  3510. format(string, sizeof(string), "You are exhausted! It will be %d seconds before you can tackle again.", GetPVarInt(playerid, "CopTackleCooldown"));
  3511. return SendClientMessageEx(playerid, COLOR_GRAD2, string);
  3512. }
  3513. if(PlayerInfo[GetPlayerTargetPlayer(playerid)][pAdmin] >= 2 && PlayerInfo[GetPlayerTargetPlayer(playerid)][pTogReports] != 1)
  3514. {
  3515. SendClientMessageEx(playerid, COLOR_GRAD2, "Admins can not be tackled!");
  3516. return 1;
  3517. }
  3518. if(IsPlayerInAnyVehicle(GetPlayerTargetPlayer(playerid)))
  3519. {
  3520. return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot tackle someone who is in a vehicle!");
  3521. }
  3522. if(IsPlayerInAnyVehicle(playerid))
  3523. {
  3524. return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot tackle someone while in a vehicle!");
  3525. }
  3526. if(GetPVarType(GetPlayerTargetPlayer(playerid), "IsTackled"))
  3527. {
  3528. return SendClientMessageEx(playerid, COLOR_GRAD2, "That person has already been tackled, stand next to them to assist!");
  3529. }
  3530. if(GetPVarInt(GetPlayerTargetPlayer(playerid), "CantBeTackledCount") > 0)
  3531. {
  3532. format(string, sizeof(string), "That player cannot be tackled for another %d seconds.", GetPVarInt(GetPlayerTargetPlayer(playerid), "CantBeTackledCount"));
  3533. return SendClientMessageEx(playerid, COLOR_GRAD2, string);
  3534. }
  3535. #if defined zombiemode
  3536. if(GetPVarInt(GetPlayerTargetPlayer(playerid), "pIsZombie"))
  3537. {
  3538. SendClientMessageEx(playerid, COLOR_GRAD2, "Zombies can not be tackled!");
  3539. return 1;
  3540. }
  3541. #endif
  3542. new tacklechance = random(10);
  3543. switch(tacklechance)
  3544. {
  3545. case 0..6: //success
  3546. {
  3547. TacklePlayer(playerid, GetPlayerTargetPlayer(playerid));
  3548. }
  3549. default: // fail
  3550. {
  3551. format(string, sizeof(string), "** %s leaps at %s attempting to tackle them but is not able.", GetPlayerNameEx(playerid), GetPlayerNameEx(GetPlayerTargetPlayer(playerid)));
  3552. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  3553. TogglePlayerControllable(playerid, 0);
  3554. SetTimerEx("CopGetUp", 2500, 0, "i", playerid);
  3555. ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.0, 1, 1, 1, 1, 0, 1);
  3556. }
  3557. }
  3558. }
  3559. }
  3560. }
  3561. if(newkeys & KEY_NO)
  3562. {
  3563. if(InsideTradeToys[playerid] == 1)
  3564. {
  3565. if(IsPlayerConnected(GetPVarInt(playerid, "ttSeller")))
  3566. {
  3567. new string[128];
  3568. format(string, sizeof(string), "%s has declined the toy offer.", GetPlayerNameEx(playerid));
  3569. SendClientMessageEx(GetPVarInt(playerid, "ttSeller"), COLOR_LIGHTBLUE, string);
  3570. SendClientMessageEx(playerid, COLOR_LIGHTRED, "You have declined the toy offer.");
  3571. DeletePVar(GetPVarInt(playerid, "ttSeller"), "ttBuyer");
  3572. DeletePVar(GetPVarInt(playerid, "ttSeller"), "ttCost");
  3573. DeletePVar(playerid, "ttSeller");
  3574. HideTradeToysGUI(playerid);
  3575. return 1;
  3576. }
  3577. else {
  3578. SendClientMessageEx(playerid, COLOR_LIGHTRED, "The seller has disconnected from the server, therefore you cannot proceed the trade.");
  3579. DeletePVar(playerid, "ttSeller");
  3580. HideTradeToysGUI(playerid);
  3581. }
  3582. }
  3583. }
  3584. if(newkeys & KEY_YES)
  3585. {
  3586. if(InsideTradeToys[playerid] == 1)
  3587. {
  3588. if(IsPlayerConnected(GetPVarInt(playerid, "ttSeller")))
  3589. {
  3590. ShowPlayerDialogEx(playerid, CONFIRMSELLTOY, DIALOG_STYLE_MSGBOX, "Please confirm your choice", "Are you sure you want to purchase this toy for the amount specified?", "Yes", "No");
  3591. }
  3592. else {
  3593. SendClientMessageEx(playerid, COLOR_LIGHTRED, "The seller has disconnected from the server, therefore you cannot proceed the trade.");
  3594. DeletePVar(playerid, "ttSeller");
  3595. HideTradeToysGUI(playerid);
  3596. }
  3597. }
  3598. if(GetPVarType(playerid, "Tackling")) {
  3599. ClearTackle(GetPVarInt(playerid, "Tackling"));
  3600. CopGetUp(playerid);
  3601. return 1;
  3602. }
  3603. if(GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID && ProxDetectorS(5.0, playerid, GetPlayerTargetPlayer(playerid)) && !IsPlayerNPC(GetPlayerTargetPlayer(playerid)))
  3604. {
  3605. if(GetPVarInt(playerid, "TackleMode") == 1) {
  3606. return 1;
  3607. }
  3608. Player_InteractMenu(playerid, GetPlayerTargetPlayer(playerid));
  3609. }
  3610. }
  3611. // If the client clicked the fire key and is currently injured
  3612. else if((newkeys && KEY_FIRE) && GetPVarInt(playerid, "Injured") == 1)
  3613. {
  3614. ClearAnimationsEx(playerid);
  3615. return 1;
  3616. }
  3617. else if((newkeys & KEY_FIRE) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && GetPlayerWeapon(playerid) == SPEEDGUN && GetPVarType(playerid, "SpeedRadar"))
  3618. {
  3619. if(GetPVarInt(playerid, "RadarTimeout") == 0)
  3620. {
  3621. new Float:x,Float:y,Float:z;
  3622. foreach(new i: Player)
  3623. {
  3624. if(IsPlayerStreamedIn(i, playerid))
  3625. {
  3626. GetPlayerPos(i,x,y,z);
  3627. if(IsPlayerAimingAt(playerid,x,y,z,10))
  3628. {
  3629. new string[68];
  3630. format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~b~License Plate: ~w~%d~n~~b~Speed: ~w~%.0f MPH", GetPlayerVehicleID(i), fVehSpeed[i]);
  3631. GameTextForPlayer(playerid, string,3500, 3);
  3632. format(string, sizeof(string), "License Plate: %d. Speed: %.0f MPH", GetPlayerVehicleID(i), fVehSpeed[i]);
  3633. SendClientMessageEx(playerid, COLOR_GRAD4, string);
  3634. SetPVarInt(playerid, "RadarTimeout", 1);
  3635. SetTimerEx("RadarCooldown", 3000, 0, "i", playerid);
  3636. return 1;
  3637. }
  3638. }
  3639. }
  3640. }
  3641. }
  3642. else if((newkeys & 16) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && PlayerCuffed[playerid] == 0 && PlayerInfo[playerid][pBeingSentenced] == 0 && GetPVarType(playerid,"UsingAnim") && !GetPVarType(playerid, "IsFrozen"))
  3643. {
  3644. ClearAnimationsEx(playerid);
  3645. DeletePVar(playerid,"UsingAnim");
  3646. }
  3647. else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_BEER && (newkeys & KEY_FIRE))
  3648. {
  3649. if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
  3650. {
  3651. new Float: cHealth;
  3652. GetHealth(playerid, cHealth);
  3653. if(cHealth < 100)
  3654. {
  3655. SetHealth(playerid, cHealth+5);
  3656. }
  3657. else
  3658. {
  3659. SendClientMessageEx(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
  3660. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  3661. SetHealth(playerid, 100);
  3662. }
  3663. DeletePVar(playerid, "DrinkCooledDown");
  3664. SetTimerEx("DrinkCooldown", 2500, 0, "i", playerid);
  3665. return 1;
  3666. }
  3667. }
  3668. else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_WINE && (newkeys & KEY_FIRE))
  3669. {
  3670. if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
  3671. {
  3672. new Float: cHealth;
  3673. GetHealth(playerid, cHealth);
  3674. if(cHealth < 100)
  3675. {
  3676. SetHealth(playerid, cHealth+8);
  3677. }
  3678. else
  3679. {
  3680. SendClientMessageEx(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
  3681. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  3682. SetHealth(playerid, 100);
  3683. }
  3684. DeletePVar(playerid, "DrinkCooledDown");
  3685. SetTimerEx("DrinkCooldown", 2500, 0, "i", playerid);
  3686. return 1;
  3687. }
  3688. }
  3689. else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_SPRUNK && (newkeys & KEY_FIRE))
  3690. {
  3691. if(GetPVarInt(playerid, "DrinkCooledDown") == 1 && GetPVarInt(playerid, "UsingSprunk") == 1)
  3692. {
  3693. new Float: cHealth;
  3694. GetHealth(playerid, cHealth);
  3695. if(cHealth < 100)
  3696. {
  3697. SetHealth(playerid, cHealth+2);
  3698. }
  3699. else
  3700. {
  3701. DeletePVar(playerid, "UsingSprunk");
  3702. SendClientMessageEx(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
  3703. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  3704. SetHealth(playerid, 100);
  3705. }
  3706. DeletePVar(playerid, "DrinkCooledDown");
  3707. SetTimerEx("DrinkCooldown", 2500, 0, "i", playerid);
  3708. return 1;
  3709. }
  3710. }
  3711. else if(IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys))
  3712. {
  3713. if(GetPVarInt(playerid, "NGPassenger") == 1)
  3714. {
  3715. TogglePlayerSpectating(playerid, 0);
  3716. }
  3717. if(GetPVarInt(playerid, "UsingSprunk"))
  3718. {
  3719. DeletePVar(playerid, "UsingSprunk");
  3720. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  3721. return 1;
  3722. }
  3723. }
  3724. /*else if(!IsPlayerInAnyVehicle(playerid) && PRESSED(KEY_HANDBRAKE))
  3725. {
  3726. if(GetPlayerWeapon(playerid) == WEAPON_ROCKETLAUNCHER || GetPlayerWeapon(playerid) == WEAPON_SNIPER
  3727. || GetPlayerWeapon(playerid) == WEAPON_CAMERA || GetPlayerWeapon(playerid) == WEAPON_HEATSEEKER)
  3728. {
  3729. for(new i = 0; i < 11; i++)
  3730. {
  3731. printf("Toy %d - %d", i, PlayerHoldingObject[playerid][i]);
  3732. if(i == 9 && PlayerInfo[playerid][pBEquipped])
  3733. {
  3734. RemovePlayerAttachedObject(playerid, 9);
  3735. break;
  3736. }
  3737. RemovePlayerAttachedObject(playerid, i);
  3738. }
  3739. }
  3740. }
  3741. else if(!IsPlayerInAnyVehicle(playerid) && RELEASED(KEY_HANDBRAKE))
  3742. {
  3743. for(new i = 1; i < 11; i++)
  3744. {
  3745. if(PlayerHoldingObject[playerid][i] != 0 || PlayerInfo[playerid][pBEquipped])
  3746. {
  3747. if(i == 10 && PlayerInfo[playerid][pBEquipped])
  3748. {
  3749. switch(PlayerInfo[playerid][pBackpack])
  3750. {
  3751. case 1: SetPlayerAttachedObject(playerid, 9, 371, 1, -0.002, -0.140999, -0.01, 8.69999, 88.8, -8.79993, 1.11, 0.963);
  3752. case 2: SetPlayerAttachedObject(playerid, 9, 371, 1, -0.002, -0.140999, -0.01, 8.69999, 88.8, -8.79993, 1.11, 0.963);
  3753. case 3: SetPlayerAttachedObject(playerid, 9, 3026, 1, -0.254999, -0.109, -0.022999, 10.6, -1.20002, 3.4, 1.265, 1.242, 1.062);
  3754. }
  3755. break;
  3756. }
  3757. new toy = i - 1;
  3758. printf("Toy %d - i: %d, PlayerHoldingObject: %d", toy, i, PlayerHoldingObject[playerid][i]);
  3759. SetPlayerAttachedObject(playerid, toy,
  3760. PlayerToyInfo[playerid][toy][ptModelID],
  3761. PlayerToyInfo[playerid][toy][ptBone],
  3762. PlayerToyInfo[playerid][toy][ptPosX],
  3763. PlayerToyInfo[playerid][toy][ptPosY],
  3764. PlayerToyInfo[playerid][toy][ptPosZ],
  3765. PlayerToyInfo[playerid][toy][ptRotX],
  3766. PlayerToyInfo[playerid][toy][ptRotY],
  3767. PlayerToyInfo[playerid][toy][ptRotZ],
  3768. PlayerToyInfo[playerid][toy][ptScaleX],
  3769. PlayerToyInfo[playerid][toy][ptScaleY],
  3770. PlayerToyInfo[playerid][toy][ptScaleZ]
  3771. );
  3772. }
  3773. }
  3774. }*/
  3775. /*else if(IsKeyJustDown(128, newkeys, oldkeys))
  3776. {
  3777. if(ConfigEventCPs[playerid][1] == 1 && ConfigEventCPs[playerid][0] == 1) {
  3778. SendClientMessageEx(playerid, COLOR_WHITE, "You have cancelled stage 1, you can't edit the checkpoint's position.");
  3779. ConfigEventCPs[playerid][1] = 0;
  3780. ConfigEventCPs[playerid][0] = 0;
  3781. ConfigEventCPs[playerid][2] = 0;
  3782. }
  3783. else if(ConfigEventCPs[playerid][1] == 2 && ConfigEventCPs[playerid][0] == 1) {
  3784. TogglePlayerControllable(playerid, true);
  3785. SendClientMessageEx(playerid, COLOR_WHITE, "You have cancelled stage 2, please choose another position. If you want to cancel stage 1(Edit CP Position) press the AIM button again.");
  3786. ConfigEventCPs[playerid][1] = 1;
  3787. }
  3788. if(GetPVarInt(playerid, "CreateGT") == 1)
  3789. {
  3790. DeletePVar(playerid, "CreateGT");
  3791. SendClientMessageEx(playerid, COLOR_GREY, "You have stopped creating a new gang tag.");
  3792. }
  3793. if(GetPVarInt(playerid, "gt_Edit") == 1)
  3794. {
  3795. DeletePVar(playerid, "gt_ID");
  3796. DeletePVar(playerid, "gt_Edit");
  3797. SendClientMessageEx(playerid, COLOR_GREY, "You have stopped editing the position.");
  3798. }
  3799. }*/
  3800. else if (IsKeyJustDown(KEY_FIRE, newkeys, oldkeys))
  3801. {
  3802. if(ConfigEventCPs[playerid][1] == 1 && ConfigEventCPs[playerid][0] == 1) {
  3803. TogglePlayerControllable(playerid, false);
  3804. new string[92], Float: x, Float: y, Float: z;
  3805. GetPlayerPos(playerid, x, y, z);
  3806. format(string, sizeof(string), "Position: X = %f.3 Y = %f.3 Z = %f.3", x, y, z);
  3807. SendClientMessageEx(playerid, COLOR_WHITE, "Are you sure this is the correct position? Please press the fire button again to confirm this, you can cancel by simply pressing the AIM button.");
  3808. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  3809. ConfigEventCPs[playerid][1] = 2;
  3810. }
  3811. else if(ConfigEventCPs[playerid][1] == 2 && ConfigEventCPs[playerid][0] == 1) {
  3812. TogglePlayerControllable(playerid, true);
  3813. new string[298];
  3814. GetPlayerPos(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]]);
  3815. format(string, sizeof(string), "You have successfuly created a race checkpoint. Position: X = %f.3 Y = %f.3 Z = %f.3 - ID:%d", EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], ConfigEventCPId[playerid]);
  3816. SendClientMessageEx(playerid, COLOR_WHITE, string);
  3817. if(ConfigEventCPs[playerid][2] == 1)
  3818. {
  3819. EventRCPU[ConfigEventCPId[playerid]] = 1;
  3820. EventRCPS[ConfigEventCPId[playerid]] = 10.0;
  3821. if(ConfigEventCPId[playerid] == 0) {
  3822. EventRCPT[ConfigEventCPId[playerid]] = 1;
  3823. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  3824. }
  3825. else {
  3826. EventRCPT[ConfigEventCPId[playerid]] = 2;
  3827. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  3828. }
  3829. ConfigEventCPs[playerid][1] = 3;
  3830. format(string,sizeof(string),"Race Checkpoint %d Size", ConfigEventCPId[playerid]);
  3831. ShowPlayerDialogEx(playerid,RCPSIZE,DIALOG_STYLE_INPUT,string,"You are now in stage 3, which means you will need to choose the size of the checkpoint\nYou now have a preview of the checkpoint(Step outside the checkpoint so you can see it)\nNote: Checkpoint is now made with the default settings,\nyou may choose not to continue checkpoint won't be affected.","Ok","Cancel");
  3832. }
  3833. else
  3834. {
  3835. if(EventRCPT[ConfigEventCPId[playerid]] == 1) {
  3836. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  3837. }
  3838. else if(EventRCPT[ConfigEventCPId[playerid]] == 4) {
  3839. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  3840. }
  3841. else {
  3842. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  3843. }
  3844. }
  3845. }
  3846. if( PlayerInfo[playerid][pC4Used] == 1 )
  3847. {
  3848. if(GoChase[playerid] != INVALID_PLAYER_ID)
  3849. {
  3850. if(IsPlayerInRangeOfPoint(GoChase[playerid], 12.0, GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z")))
  3851. {
  3852. if(PlayerInfo[GoChase[playerid]][pHeadValue] >= 1)
  3853. {
  3854. if (IsAHitman(playerid))
  3855. {
  3856. new string[128];
  3857. new takemoney = PlayerInfo[GoChase[playerid]][pHeadValue];
  3858. GivePlayerCash(playerid, floatround(takemoney * 0.9));
  3859. GivePlayerCash(GoChase[playerid], -takemoney);
  3860. format(string,sizeof(string),"Hitman %s has fulfilled the contract on %s and collected $%d",GetPlayerNameEx(playerid),GetPlayerNameEx(GoChase[playerid]),takemoney);
  3861. foreach(new i: Player) if(IsAHitman(i)) SendClientMessage(i, COLOR_YELLOW, string);
  3862. format(string,sizeof(string),"You have been critically injured by a Hitman and lost $%d!",takemoney);
  3863. ResetPlayerWeaponsEx(GoChase[playerid]);
  3864. // SpawnPlayer(GoChase[playerid]);
  3865. SendClientMessageEx(GoChase[playerid], COLOR_YELLOW, string);
  3866. PlayerInfo[GoChase[playerid]][pHeadValue] = 0;
  3867. PlayerInfo[playerid][pCHits] += 1;
  3868. SetHealth(GoChase[playerid], 0.0);
  3869. // KillEMSQueue(GoChase[playerid]);
  3870. GotHit[GoChase[playerid]] = 0;
  3871. GetChased[GoChase[playerid]] = INVALID_PLAYER_ID;
  3872. GoChase[playerid] = INVALID_PLAYER_ID;
  3873. new iHitPercent = floatround(takemoney * 0.10);
  3874. iHMASafe_Val += iHitPercent;
  3875. format(szMiscArray, sizeof szMiscArray, "[hit] %s (%d) has killed %s (%d) [C4] for $%s ($%s deposited to safe).", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerNameEx(GoChase[playerid]), GetPlayerSQLId(GoChase[playerid]), number_format(takemoney), number_format(iHitPercent));
  3876. Log("logs/hitman.log", szMiscArray);
  3877. }
  3878. }
  3879. }
  3880. }
  3881. PlayerInfo[playerid][pC4Used] = 0;
  3882. CreateExplosion(GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z"), 7, 8);
  3883. PickUpC4(playerid);
  3884. SendClientMessageEx(playerid, COLOR_YELLOW, " Bomb has been detonated!");
  3885. PlayerInfo[playerid][pC4Used] = 0;
  3886. return 1;
  3887. }
  3888. if(GetPVarType(playerid, "MovingStretcher"))
  3889. {
  3890. KillTimer(GetPVarInt(playerid, "TickEMSMove"));
  3891. MoveEMS(playerid);
  3892. return 1;
  3893. }
  3894. if(GetPVarType(playerid, "DraggingPlayer"))
  3895. {
  3896. new Float:dX, Float:dY, Float:dZ, string[128];
  3897. GetPlayerPos(playerid, dX, dY, dZ);
  3898. floatsub(dX, 0.4);
  3899. floatsub(dY, 0.4);
  3900. SetPVarFloat(GetPVarInt(playerid, "DraggingPlayer"), "DragX", dX);
  3901. SetPVarFloat(GetPVarInt(playerid, "DraggingPlayer"), "DragY", dY);
  3902. SetPVarFloat(GetPVarInt(playerid, "DraggingPlayer"), "DragZ", dZ);
  3903. SetPVarInt(GetPVarInt(playerid, "DraggingPlayer"), "DragWorld", GetPlayerVirtualWorld(playerid));
  3904. SetPVarInt(GetPVarInt(playerid, "DraggingPlayer"), "DragInt", GetPlayerInterior(playerid));
  3905. Streamer_UpdateEx(GetPVarInt(playerid, "DraggingPlayer"), dX, dY, dZ);
  3906. SetPlayerPos(GetPVarInt(playerid, "DraggingPlayer"), dX, dY, dZ);
  3907. SetPlayerInterior(GetPVarInt(playerid, "DraggingPlayer"), GetPlayerInterior(playerid));
  3908. SetPlayerVirtualWorld(GetPVarInt(playerid, "DraggingPlayer"), GetPlayerVirtualWorld(playerid));
  3909. ClearAnimationsEx(GetPVarInt(playerid, "DraggingPlayer"));
  3910. ApplyAnimation(GetPVarInt(playerid, "DraggingPlayer"), "ped","cower",1,1,0,0,0,0,1);
  3911. DeletePVar(GetPVarInt(playerid, "DraggingPlayer"), "BeingDragged");
  3912. format(string, sizeof(string), "* You have stopped dragging %s.", GetPlayerNameEx(GetPVarInt(playerid, "DraggingPlayer")));
  3913. DeletePVar(playerid, "DraggingPlayer");
  3914. SendClientMessage(playerid, COLOR_GRAD2, string);
  3915. }
  3916. }
  3917. else if((newkeys & KEY_SPRINT) && GetPlayerState(playerid) == 2)// Pressing the gas, detonates the bomb.
  3918. {
  3919. new string[128], vehicleid = GetPlayerVehicleID(playerid);
  3920. if(GetChased[playerid] != INVALID_PLAYER_ID && VehicleBomb{vehicleid} == 1)
  3921. {
  3922. if(PlayerInfo[playerid][pHeadValue] >= 1)
  3923. {
  3924. if (IsAHitman(GetChased[playerid]))
  3925. {
  3926. new Float:boomx, Float:boomy, Float:boomz;
  3927. GetPlayerPos(playerid,boomx, boomy, boomz);
  3928. CreateExplosion(boomx, boomy , boomz, 7, 1);
  3929. VehicleBomb{vehicleid} = 0;
  3930. PlacedVehicleBomb[GetChased[playerid]] = INVALID_VEHICLE_ID;
  3931. new takemoney = PlayerInfo[playerid][pHeadValue];//(PlayerInfo[playerid][pHeadValue] / 4) * 2;
  3932. GivePlayerCash(GetChased[playerid], floatround(takemoney * 0.9));
  3933. GivePlayerCash(playerid, -takemoney);
  3934. format(string,sizeof(string),"Hitman %s has fulfilled the contract on %s and collected $%d.",GetPlayerNameEx(GetChased[playerid]),GetPlayerNameEx(playerid),takemoney);
  3935. foreach(new i: Player) if(IsAHitman(i)) SendClientMessage(i, COLOR_YELLOW, string);
  3936. format(string,sizeof(string),"You have been critically injured by a hitman and lost $%d!",takemoney);
  3937. ResetPlayerWeaponsEx(playerid);
  3938. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  3939. PlayerInfo[playerid][pHeadValue] = 0;
  3940. PlayerInfo[GetChased[playerid]][pCHits] += 1;
  3941. SetHealth(playerid, 0.0);
  3942. GoChase[GetChased[playerid]] = INVALID_PLAYER_ID;
  3943. PlayerInfo[GetChased[playerid]][pC4Used] = 0;
  3944. PlayerInfo[GetChased[playerid]][pC4] = 0;
  3945. GotHit[playerid] = 0;
  3946. GetChased[playerid] = INVALID_PLAYER_ID;
  3947. new iHitPercent = floatround(takemoney * 0.10);
  3948. iHMASafe_Val += iHitPercent;
  3949. format(szMiscArray, sizeof szMiscArray, "[hit] %s (%d) has killed %s (%d) [car bomb] for $%s ($%s deposited to safe).", GetPlayerNameEx(GetChased[playerid]), GetPlayerSQLId(GetChased[playerid]), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), number_format(takemoney), number_format(iHitPercent));
  3950. Log("logs/hitman.log", szMiscArray);
  3951. return 1;
  3952. }
  3953. }
  3954. }
  3955. }
  3956. return 1;
  3957. }
  3958. public OnPlayerStateChange(playerid, newstate, oldstate)
  3959. {
  3960. if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
  3961. {
  3962. if(!IsPlayerEntering{playerid} && PlayerInfo[playerid][pAdmin] < 2)
  3963. {
  3964. if(GetPVarInt(playerid, "TeleportWarnings") == 3) {
  3965. new string[128];
  3966. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID: %d) may have just teleported into a vehicle.", GetPlayerNameEx(playerid), playerid);
  3967. ABroadCast(COLOR_YELLOW, string, 2);
  3968. DeletePVar(playerid, "TeleportWarnings");
  3969. if(!gPlayerLogged{playerid})
  3970. {
  3971. CreateBan(INVALID_PLAYER_ID, INVALID_PLAYER_ID, playerid, GetPlayerIpEx(playerid), "Hacking while !Logged", 99999);
  3972. }
  3973. }
  3974. else
  3975. {
  3976. SetPVarInt(playerid, "TeleportWarnings", GetPVarInt(playerid, "TeleportWarnings")+1);
  3977. }
  3978. }
  3979. if (CarRadars[playerid] > 0)
  3980. {
  3981. PlayerTextDrawShow(playerid, _crTextTarget[playerid]);
  3982. PlayerTextDrawShow(playerid, _crTextSpeed[playerid]);
  3983. PlayerTextDrawShow(playerid, _crTickets[playerid]);
  3984. DeletePVar(playerid, "_lastTicketWarning");
  3985. }
  3986. }
  3987. IsPlayerEntering{playerid} = false;
  3988. if(newstate == PLAYER_STATE_PASSENGER)
  3989. {
  3990. if (PlayerInfo[playerid][pSpeedo] != 0)
  3991. {
  3992. ShowVehicleHUDForPlayer(playerid);
  3993. }
  3994. }
  3995. if(newstate == PLAYER_STATE_DRIVER)
  3996. {
  3997. if (IsAtGym(playerid))
  3998. {
  3999. new biz = InBusiness(playerid);
  4000. new veh = GetPlayerVehicleID(playerid);
  4001. for (new it = 0; it < 10; ++it)
  4002. {
  4003. if (Businesses[biz][bGymBikeVehicles][it] == veh)
  4004. {
  4005. if (GetPVarInt(playerid, "_BikeParkourSlot") != it)
  4006. {
  4007. RemovePlayerFromVehicle(playerid);
  4008. SendClientMessageEx(playerid, COLOR_GRAD2, "That is not your bike!");
  4009. }
  4010. }
  4011. }
  4012. }
  4013. if (PlayerInfo[playerid][pSpeedo] != 0)
  4014. {
  4015. ShowVehicleHUDForPlayer(playerid);
  4016. }
  4017. if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
  4018. {
  4019. if(GetPlayerWeapon(playerid) == 24)
  4020. {
  4021. SetPlayerArmedWeapon(playerid, 0);
  4022. }
  4023. }
  4024. new vehicleid = GetPlayerVehicleID(playerid);
  4025. new Float: pX, Float: pY, Float: pZ;
  4026. GetPlayerPos(playerid, pX, pY, pZ);
  4027. if(GetPVarType(playerid, "IsInArena")) {
  4028. for(new i = 0; i < MAX_ARENAS; i++)
  4029. {
  4030. if(PaintBallArena[i][pbVeh1ID] == vehicleid && GetPVarInt(playerid, "IsInArena") != i)
  4031. {
  4032. SetPlayerPos(playerid, pX, pY, pZ);
  4033. }
  4034. if(PaintBallArena[i][pbVeh2ID] == vehicleid && GetPVarInt(playerid, "IsInArena") != i)
  4035. {
  4036. SetPlayerPos(playerid, pX, pY, pZ);
  4037. }
  4038. if(PaintBallArena[i][pbVeh3ID] == vehicleid && GetPVarInt(playerid, "IsInArena") != i)
  4039. {
  4040. SetPlayerPos(playerid, pX, pY, pZ);
  4041. }
  4042. if(PaintBallArena[i][pbVeh4ID] == vehicleid && GetPVarInt(playerid, "IsInArena") != i)
  4043. {
  4044. SetPlayerPos(playerid, pX, pY, pZ);
  4045. }
  4046. if(PaintBallArena[i][pbVeh5ID] == vehicleid && GetPVarInt(playerid, "IsInArena") != i)
  4047. {
  4048. SetPlayerPos(playerid, pX, pY, pZ);
  4049. }
  4050. if(PaintBallArena[i][pbVeh6ID] == vehicleid && GetPVarInt(playerid, "IsInArena") != i)
  4051. {
  4052. SetPlayerPos(playerid, pX, pY, pZ);
  4053. }
  4054. }
  4055. }
  4056. }
  4057. if(newstate != 2) NOPTrigger[playerid] = 0;
  4058. //Specating
  4059. if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_ONFOOT)
  4060. {
  4061. foreach(new i: Player)
  4062. {
  4063. if(PlayerInfo[i][pAdmin] >= 2 || GetPVarType(i, "StartedWatching")) {
  4064. if(Spectating[i] > 0 && Spectate[i] == playerid) {
  4065. if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) {
  4066. TogglePlayerSpectating(i, true);
  4067. new carid = GetPlayerVehicleID( playerid );
  4068. PlayerSpectateVehicle( i, carid );
  4069. }
  4070. else if(newstate == PLAYER_STATE_ONFOOT) {
  4071. TogglePlayerSpectating(i, true);
  4072. PlayerSpectatePlayer( i, playerid );
  4073. SetPlayerInterior( i, GetPlayerInterior( playerid ) );
  4074. }
  4075. }
  4076. }
  4077. }
  4078. }
  4079. if(newstate == PLAYER_STATE_ONFOOT)
  4080. {
  4081. StopAudioStreamForPlayerEx(playerid);
  4082. if(GetPVarType(playerid, "Siren"))
  4083. {
  4084. if(IsPlayerAttachedObjectSlotUsed(playerid, MAX_PLAYER_ATTACHED_OBJECTS - 3)) RemovePlayerAttachedObject(playerid, MAX_PLAYER_ATTACHED_OBJECTS - 3);
  4085. if(IsPlayerAttachedObjectSlotUsed(playerid, MAX_PLAYER_ATTACHED_OBJECTS - 2)) RemovePlayerAttachedObject(playerid, MAX_PLAYER_ATTACHED_OBJECTS - 2);
  4086. DeletePVar(playerid, "Siren");
  4087. }
  4088. /*if(GettingSpectated[playerid] != INVALID_PLAYER_ID && PlayerInfo[GettingSpectated[playerid]][pAdmin] >= 2) {
  4089. new spectator = GettingSpectated[playerid];
  4090. // Preventing possible buffer overflows with the arrays
  4091. TogglePlayerSpectating(spectator, true);
  4092. PlayerSpectatePlayer( spectator, playerid );
  4093. SetPlayerInterior( spectator, GetPlayerInterior( playerid ) );
  4094. SetPlayerInterior( spectator, GetPlayerInterior( playerid ) );
  4095. SetPlayerVirtualWorld( spectator, GetPlayerVirtualWorld( playerid ) );
  4096. }*/
  4097. if(oldstate == PLAYER_STATE_DRIVER)
  4098. {
  4099. new vehicleid = GetPlayerVehicleID(playerid);
  4100. if(IsAHelicopter(vehicleid))
  4101. {
  4102. new Float:vehPos[3];
  4103. GetVehiclePos(vehicleid, vehPos[0], vehPos[1], vehPos[2]);
  4104. foreach(new i: Player)
  4105. {
  4106. if(IsPlayerInRangeOfPoint(i, 50.0, vehPos[0], vehPos[1], vehPos[2]))
  4107. {
  4108. PlayerPlaySound(i, 1000, 0.0, 0.0, 0.0);
  4109. PlayerPlaySound(i, 1001, 0.0, 0.0, 0.0);
  4110. }
  4111. }
  4112. }
  4113. if (_vhudVisible[playerid] == 1)
  4114. {
  4115. HideVehicleHUDForPlayer(playerid); // incase vehicle despawns
  4116. }
  4117. if (CarRadars[playerid] > 0)
  4118. {
  4119. PlayerTextDrawHide(playerid, _crTextTarget[playerid]);
  4120. PlayerTextDrawHide(playerid, _crTextSpeed[playerid]);
  4121. PlayerTextDrawHide(playerid, _crTickets[playerid]);
  4122. DeletePVar(playerid, "_lastTicketWarning");
  4123. }
  4124. SetPlayerWeaponsEx(playerid);
  4125. }
  4126. else if(oldstate == PLAYER_STATE_PASSENGER) SetPlayerWeaponsEx(playerid);
  4127. if(ConnectedToPC[playerid] == 1337)//mdc
  4128. {
  4129. ConnectedToPC[playerid] = 0;
  4130. }
  4131. if(TransportDuty[playerid] > 0)
  4132. {
  4133. if(TransportDuty[playerid] == 1)
  4134. {
  4135. TaxiDrivers -= 1;
  4136. }
  4137. else if(TransportDuty[playerid] == 2)
  4138. {
  4139. BusDrivers -= 1;
  4140. }
  4141. TransportDuty[playerid] = 0;
  4142. new string[70]; // increased buf size as full message wasn't getting shown
  4143. format(string, sizeof(string), "* You are now off duty and earned $%d.", TransportMoney[playerid]);
  4144. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  4145. foreach(new i: Player)
  4146. {
  4147. if (TransportDriver[i] == playerid)
  4148. {
  4149. GivePlayerCash(i, -TransportCost[i]);
  4150. format(string, sizeof(string), "* Your driver left the vehicle and so you paid $%d.", TransportCost[i]);
  4151. TransportCost[i] = 0; // I've not used either of these two variables before, could be more that resetting
  4152. TransportDriver[i] = INVALID_PLAYER_ID;
  4153. SendClientMessageEx(i, COLOR_LIGHTBLUE, string);
  4154. }
  4155. }
  4156. GivePlayerCash(playerid, (TransportMoney[playerid] / 100 * 40));
  4157. if((0 <= PlayerInfo[playerid][pMember] < MAX_GROUPS)) arrGroupData[PlayerInfo[playerid][pMember]][g_iBudget] += TransportMoney[playerid];
  4158. if(TransportMoney[playerid]) format(szMiscArray, sizeof(szMiscArray), "%s is now off duty and earned $%s", GetPlayerNameEx(playerid), number_format(TransportMoney[playerid])), GroupLog(PlayerInfo[playerid][pMember], szMiscArray);
  4159. TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
  4160. if(!IsATaxiDriver(playerid)) { SetPlayerColor(playerid, TEAM_HIT_COLOR); }
  4161. TransportTime[playerid] = 0;
  4162. TransportCost[playerid] = 0;
  4163. }
  4164. if(TransportDriver[playerid] < MAX_PLAYERS)
  4165. {
  4166. new string[128];
  4167. TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
  4168. format(string, sizeof(string), "~w~The ride cost~n~~r~$%d",TransportCost[playerid]);
  4169. GameTextForPlayer(playerid, string, 5000, 3);
  4170. format(string, sizeof(string), "~w~Passenger left the taxi.~n~~g~Earned $%d",TransportCost[playerid]);
  4171. GameTextForPlayer(TransportDriver[playerid], string, 5000, 3);
  4172. GivePlayerCash(playerid, -TransportCost[playerid]);
  4173. if(TransportCost[playerid] >= 10000)
  4174. {
  4175. format(string, sizeof(string), "%s (IP:%s) has taxied %s (IP:%s) $%d in this session.", GetPlayerNameEx(playerid), GetPlayerIpEx(playerid), GetPlayerNameEx(TransportDriver[playerid]), GetPlayerIpEx(TransportDriver[playerid]), TransportCost[playerid]);
  4176. //Log("logs/pay.log", string);
  4177. ABroadCast(COLOR_YELLOW, string, 2);
  4178. }
  4179. TransportTime[TransportDriver[playerid]] = 0;
  4180. TransportCost[TransportDriver[playerid]] = 0;
  4181. TransportCost[playerid] = 0;
  4182. TransportTime[playerid] = 0;
  4183. TransportDriver[playerid] = INVALID_PLAYER_ID;
  4184. }
  4185. }
  4186. if(newstate == PLAYER_STATE_PASSENGER) // TAXI & BUSSES
  4187. {
  4188. #if defined zombiemode
  4189. if(zombieevent == 1 && GetPVarType(playerid, "pIsZombie"))
  4190. {
  4191. SendClientMessageEx(playerid, COLOR_GREY, "Zombies can't go into cars.");
  4192. new Float:X, Float:Y, Float:Z;
  4193. GetPlayerPos(playerid, X, Y, Z);
  4194. SetPlayerPos(playerid, X, Y, Z);
  4195. return 1;
  4196. }
  4197. #endif
  4198. fVehSpeed[playerid] = 0;
  4199. fVehHealth[playerid] = 0;
  4200. if(!isnull(stationidv[GetPlayerVehicleID(playerid)]))
  4201. {
  4202. PlayAudioStreamForPlayerEx(playerid, stationidv[GetPlayerVehicleID(playerid)]);
  4203. }
  4204. new vehicleid = GetPlayerVehicleID(playerid);
  4205. /*if(vehicleid == NGVehicles[12] ||
  4206. vehicleid == NGVehicles[13] ||
  4207. vehicleid == NGVehicles[14] ||
  4208. vehicleid == NGVehicles[15] ||
  4209. vehicleid == NGVehicles[16] ||
  4210. vehicleid == NGVehicles[17])
  4211. {
  4212. TogglePlayerSpectating(playerid, 1);
  4213. PlayerSpectateVehicle(playerid, vehicleid);
  4214. SetPVarInt(playerid, "NGPassenger", 1);
  4215. SetPVarInt(playerid, "NGPassengerVeh", vehicleid);
  4216. SetPVarInt(playerid, "NGPassengerSkin", GetPlayerSkin(playerid));
  4217. new Float:health, Float:armour;
  4218. GetHealth(playerid, health);
  4219. GetArmour(playerid, armour);
  4220. SetPVarFloat(playerid, "NGPassengerHP", health);
  4221. SetPVarFloat(playerid, "NGPassengerArmor", armour);
  4222. }*/
  4223. if(!IsADriveByWeapon(GetPlayerWeapon(playerid)) && !IsADriveByWeapon(GetPVarInt(playerid, "LastWeapon"))) SetPlayerArmedWeapon(playerid,0);
  4224. //if(PlayerInfo[playerid][pGuns][4] > 0) SetPlayerArmedWeapon(playerid,PlayerInfo[playerid][pGuns][4]);
  4225. //else SetPlayerArmedWeapon(playerid,0);
  4226. gLastCar[playerid] = vehicleid;
  4227. foreach(new i: Player)
  4228. {
  4229. if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
  4230. {
  4231. if(GetPlayerCash(playerid) < TransportValue[i])
  4232. {
  4233. new string[28];
  4234. format(string, sizeof(string), "* You need $%d to enter.", TransportValue[i]);
  4235. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  4236. RemovePlayerFromVehicle(playerid);
  4237. new Float:X, Float:Y, Float:Z;
  4238. GetPlayerPos(playerid, X, Y, Z);
  4239. SetPlayerPos(playerid, X, Y, Z+2);
  4240. TogglePlayerControllable(playerid, 1);
  4241. }
  4242. else
  4243. {
  4244. new string[35+MAX_PLAYER_NAME];
  4245. if(TransportDuty[i] == 1)
  4246. {
  4247. format(string, sizeof(string), "* You paid $%d to the taxi driver.", TransportValue[i]);
  4248. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  4249. format(string, sizeof(string), "* Passenger %s has entered your taxi.", GetPlayerNameEx(playerid));
  4250. SendClientMessageEx(i, COLOR_LIGHTBLUE, string);
  4251. TransportTime[i] = 1;
  4252. TransportTime[playerid] = 1;
  4253. TransportCost[playerid] = TransportValue[i];
  4254. TransportCost[i] = TransportValue[i];
  4255. TransportDriver[playerid] = i;
  4256. }
  4257. else if(TransportDuty[i] == 2)
  4258. {
  4259. format(string, sizeof(string), "* You paid $%d to the Taxi Driver.", TransportValue[i]);
  4260. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  4261. format(string, sizeof(string), "* Passenger %s has entered your Taxi.", GetPlayerNameEx(playerid));
  4262. SendClientMessageEx(i, COLOR_LIGHTBLUE, string);
  4263. }
  4264. GivePlayerCash(playerid, - TransportValue[i]);
  4265. TransportMoney[i] += TransportValue[i];
  4266. }
  4267. }
  4268. }
  4269. }
  4270. if(newstate == PLAYER_STATE_WASTED)
  4271. {
  4272. if(GetPVarInt(playerid, "EventToken") == 0)
  4273. {
  4274. SetPVarInt(playerid, "MedicBill", 1);
  4275. }
  4276. if(ConnectedToPC[playerid] == 1337)//mdc
  4277. {
  4278. ConnectedToPC[playerid] = 0;
  4279. }
  4280. Seatbelt[playerid] = 0;
  4281. if(GetPVarType(playerid, "HelmetOn"))
  4282. {
  4283. for(new i; i < 10; i++) {
  4284. if(PlayerHoldingObject[playerid][i] == GetPVarInt(playerid, "HelmetOn")) {
  4285. PlayerHoldingObject[playerid][i] = 0;
  4286. RemovePlayerAttachedObject(playerid, i);
  4287. DeletePVar(playerid, "HelmetOn");
  4288. break;
  4289. }
  4290. }
  4291. }
  4292. }
  4293. if(newstate == PLAYER_STATE_DRIVER)
  4294. {
  4295. #if defined zombiemode
  4296. if(zombieevent == 1 && GetPVarType(playerid, "pIsZombie"))
  4297. {
  4298. SendClientMessageEx(playerid, COLOR_GREY, "Zombies can't drive.");
  4299. new Float:X, Float:Y, Float:Z;
  4300. GetPlayerPos(playerid, X, Y, Z);
  4301. SetPlayerPos(playerid, X, Y, Z);
  4302. return 1;
  4303. }
  4304. #endif
  4305. fVehSpeed[playerid] = 0;
  4306. fVehHealth[playerid] = 0;
  4307. if(!isnull(stationidv[GetPlayerVehicleID(playerid)]))
  4308. {
  4309. PlayAudioStreamForPlayerEx(playerid, stationidv[GetPlayerVehicleID(playerid)]);
  4310. }
  4311. SetPlayerArmedWeapon(playerid, 0);
  4312. new
  4313. newcar = GetPlayerVehicleID(playerid),
  4314. engine, lights, alarm, doors, bonnet, boot, objective, v;
  4315. gLastCar[playerid] = newcar;
  4316. if(GetPVarInt(playerid, "EventToken") == 1) {
  4317. if(EventKernel[EventFootRace] == 1) {
  4318. new Float:X, Float:Y, Float:Z;
  4319. GetPlayerPos(playerid, X, Y, Z);
  4320. SetPlayerPos(playerid, X, Y, Z+1.3);
  4321. SendClientMessageEx(playerid, COLOR_WHITE, "You cannot be inside vehicles and participate in this event at the same time.");
  4322. return 1;
  4323. }
  4324. }
  4325. foreach(new i: Player)
  4326. {
  4327. v = GetPlayerVehicle(i, newcar);
  4328. if(v != -1) {
  4329. if(i == playerid) {
  4330. new
  4331. string[128];
  4332. format(string, sizeof(string),"You are the owner of this %s.", GetVehicleName(newcar));
  4333. SendClientMessageEx(playerid, COLOR_GREY, string);
  4334. if(PlayerVehicleInfo[i][v][pvTicket] != 0)
  4335. {
  4336. format(string, sizeof(string),"This vehicle has $%d unpaid tickets. You must pay the ticket at the DMV in Dilimore.", PlayerVehicleInfo[i][v][pvTicket]);
  4337. SendClientMessageEx(playerid, COLOR_GREY, string);
  4338. SendClientMessageEx(playerid, COLOR_GREY, "Failure to pay these tickets as soon as possible will result in further fines, vehicle impounding, or even an arrest.");
  4339. }
  4340. }
  4341. else if(i == PlayerInfo[playerid][pVehicleKeysFrom] && v == PlayerInfo[playerid][pVehicleKeys]) {
  4342. new
  4343. string[64 + MAX_PLAYER_NAME];
  4344. format(string, sizeof(string),"You have the keys for this %s from owner %s.", GetVehicleName(newcar), GetPlayerNameEx(i));
  4345. SendClientMessageEx(playerid, COLOR_GREY, string);
  4346. }
  4347. else if(PlayerVehicleInfo[i][v][pvLocked] == 1 && PlayerVehicleInfo[i][v][pvLock] == 1) {
  4348. GetVehicleParamsEx(newcar,engine,lights,alarm,doors,bonnet,boot,objective);
  4349. SetVehicleParamsEx(newcar,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
  4350. SetTimerEx("DisableVehicleAlarm", 20000, 0, "d", newcar);
  4351. }
  4352. else if(PlayerVehicleInfo[i][v][pvLocked] == 1 && PlayerVehicleInfo[i][v][pvLock] == 2 && PlayerVehicleInfo[i][v][pvLocksLeft] > 0) { // Electronic Lock System
  4353. new
  4354. string[49 + MAX_PLAYER_NAME];
  4355. if(PlayerInfo[playerid][pAdmin] < 2)
  4356. {
  4357. new Float:slx, Float:sly, Float:slz;
  4358. GetPlayerPos(playerid, slx, sly, slz);
  4359. SetPlayerPos(playerid, slx, sly, slz+1.3);
  4360. RemovePlayerFromVehicle(playerid);
  4361. defer NOPCheck(playerid);
  4362. }
  4363. else
  4364. {
  4365. format(string, sizeof(string), "Warning: This %s is owned by %s.", GetVehicleName(newcar), GetPlayerNameEx(i));
  4366. SendClientMessageEx(playerid, COLOR_GREY, string);
  4367. }
  4368. }
  4369. return 1;
  4370. }
  4371. }
  4372. new vehicleid = newcar;
  4373. if(IsVIPcar(vehicleid))
  4374. {
  4375. if(zombieevent)
  4376. {
  4377. RemovePlayerFromVehicle(playerid);
  4378. new Float:slx, Float:sly, Float:slz;
  4379. GetPlayerPos(playerid, slx, sly, slz);
  4380. SetPlayerPos(playerid, slx, sly, slz);
  4381. defer NOPCheck(playerid);
  4382. return SendClientMessageEx(playerid, -1, "You can't use this vehicle during the Zombie Event!");
  4383. }
  4384. if(PlayerInfo[playerid][pDonateRank] > 0)
  4385. {
  4386. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: This is a VIP vehicle from the VIP garage, therefore it has unlimited fuel.");
  4387. }
  4388. else
  4389. {
  4390. new Float:slx, Float:sly, Float:slz;
  4391. GetPlayerPos(playerid, slx, sly, slz);
  4392. SetPlayerPos(playerid, slx, sly, slz+1.3);
  4393. PlayerPlaySound(playerid, 1130, slx, sly, slz+1.3);
  4394. RemovePlayerFromVehicle(playerid);
  4395. defer NOPCheck(playerid);
  4396. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a VIP, this is a vehicle from the VIP Garage!");
  4397. }
  4398. }
  4399. else if(IsFamedVeh(vehicleid))
  4400. {
  4401. if(PlayerInfo[playerid][pFamed] < 1)
  4402. {
  4403. new Float:slx, Float:sly, Float:slz;
  4404. GetPlayerPos(playerid, slx, sly, slz);
  4405. SetPlayerPos(playerid, slx, sly, slz+1.3);
  4406. PlayerPlaySound(playerid, 1130, slx, sly, slz+1.3);
  4407. RemovePlayerFromVehicle(playerid);
  4408. defer NOPCheck(playerid);
  4409. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a Famed Member, this is a vehicle from the Famed Garage!");
  4410. }
  4411. else {
  4412. SendClientMessageEx(playerid, COLOR_YELLOW, "Famed: This is a Famed vehicle from the Famed garage, therefore it has unlimited fuel.");
  4413. }
  4414. }
  4415. else if(DynVeh[vehicleid] != -1)
  4416. {
  4417. new string[128], Float:slx, Float:sly, Float:slz;
  4418. GetPlayerPos(playerid, slx, sly, slz);
  4419. if(DynVehicleInfo[DynVeh[vehicleid]][gv_igID] != INVALID_GROUP_ID && (PlayerInfo[playerid][pMember] != DynVehicleInfo[DynVeh[vehicleid]][gv_igID]))
  4420. {
  4421. RemovePlayerFromVehicle(playerid);
  4422. SetPlayerPos(playerid, slx, sly, slz+1.3);
  4423. defer NOPCheck(playerid);
  4424. if(arrGroupData[DynVehicleInfo[DynVeh[vehicleid]][gv_igID]][g_iGroupType] != 2)
  4425. {
  4426. format(string, sizeof(string), "You need to be in %s to drive this vehicle.", arrGroupData[DynVehicleInfo[DynVeh[vehicleid]][gv_igID]][g_szGroupName]);
  4427. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  4428. }
  4429. }
  4430. else if(DynVehicleInfo[DynVeh[vehicleid]][gv_igDivID] != 0 && PlayerInfo[playerid][pDivision] != DynVehicleInfo[DynVeh[vehicleid]][gv_igDivID] && PlayerInfo[playerid][pMember] != PlayerInfo[playerid][pLeader])
  4431. {
  4432. if(PlayerInfo[playerid][pMember])
  4433. RemovePlayerFromVehicle(playerid);
  4434. SetPlayerPos(playerid, slx, sly, slz+1.3);
  4435. defer NOPCheck(playerid);
  4436. format(string, sizeof(string), "You need to be in %s's %s division to drive this vehicle.",
  4437. arrGroupData[DynVehicleInfo[DynVeh[vehicleid]][gv_igID]][g_szGroupName],
  4438. arrGroupDivisions[DynVehicleInfo[DynVeh[vehicleid]][gv_igID]][DynVehicleInfo[DynVeh[vehicleid]][gv_igDivID]]);
  4439. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  4440. }
  4441. else if(DynVehicleInfo[DynVeh[vehicleid]][gv_irID] != 0 && (PlayerInfo[playerid][pRank] < DynVehicleInfo[DynVeh[vehicleid]][gv_irID]))
  4442. {
  4443. RemovePlayerFromVehicle(playerid);
  4444. SetPlayerPos(playerid, slx, sly, slz+1.3);
  4445. defer NOPCheck(playerid);
  4446. format(string, sizeof(string), "You need to be rank %s(%d) or above to drive this vehicle.",
  4447. arrGroupRanks[DynVehicleInfo[DynVeh[vehicleid]][gv_igID]][DynVehicleInfo[DynVeh[vehicleid]][gv_irID]],
  4448. DynVehicleInfo[DynVeh[vehicleid]][gv_irID]);
  4449. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  4450. }
  4451. }
  4452. else if(IsAPlane(vehicleid))
  4453. {
  4454. if(PlayerInfo[playerid][pFlyLic] != 1)
  4455. {
  4456. if(GetPVarInt(playerid, "SprunkGuardLic") == 0)
  4457. {
  4458. RemovePlayerFromVehicle(playerid);
  4459. new Float:slx, Float:sly, Float:slz;
  4460. GetPlayerPos(playerid, slx, sly, slz);
  4461. SetPlayerPos(playerid, slx, sly, slz);
  4462. defer NOPCheck(playerid);
  4463. SendClientMessageEx(playerid,COLOR_GREY,"You don't have a pilot license!");
  4464. }
  4465. }
  4466. }
  4467. else if(IsAHelicopter(vehicleid))
  4468. {
  4469. PlayerInfo[playerid][pAGuns][GetWeaponSlot(46)] = 46;
  4470. GivePlayerValidWeapon(playerid, 46);
  4471. }
  4472. else if(IsAnTaxi(vehicleid) || IsAnBus(vehicleid))
  4473. {
  4474. if(PlayerInfo[playerid][pJob] == 17 || PlayerInfo[playerid][pJob2] == 17 || PlayerInfo[playerid][pJob3] == 17 || IsATaxiDriver(playerid) || PlayerInfo[playerid][pTaxiLicense] == 1)
  4475. {
  4476. }
  4477. else
  4478. {
  4479. for(new i = 0; i < GetPlayerVehicleSlots(playerid); i++)
  4480. {
  4481. if(IsAnTaxi(PlayerVehicleInfo[playerid][i][pvModelId]))
  4482. return 1;
  4483. }
  4484. SendClientMessageEx(playerid,COLOR_GREY," You are not a Taxi/Bus Driver!");
  4485. RemovePlayerFromVehicle(playerid);
  4486. new Float:slx, Float:sly, Float:slz;
  4487. GetPlayerPos(playerid, slx, sly, slz);
  4488. SetPlayerPos(playerid, slx, sly, slz);
  4489. defer NOPCheck(playerid);
  4490. }
  4491. }
  4492. if(GetCarBusiness(newcar) != INVALID_BUSINESS_ID && PlayerInfo[playerid][pAdmin] < 1337)
  4493. {
  4494. if(zombieevent)
  4495. {
  4496. RemovePlayerFromVehicle(playerid);
  4497. new Float:slx, Float:sly, Float:slz;
  4498. GetPlayerPos(playerid, slx, sly, slz);
  4499. SetPlayerPos(playerid, slx, sly, slz);
  4500. defer NOPCheck(playerid);
  4501. return SendClientMessageEx(playerid, -1, "You can't purchase a vehicle at any dealership during the Zombie Event!");
  4502. }
  4503. new
  4504. iBusiness = GetCarBusiness(newcar),
  4505. iSlot = GetBusinessCarSlot(newcar),
  4506. string[128];
  4507. if(Businesses[iBusiness][bInventory] == 0) {
  4508. SendClientMessageEx(playerid,COLOR_GREY,"This dealership is out of stock.");
  4509. RemovePlayerFromVehicle(playerid);
  4510. new Float:slx, Float:sly, Float:slz;
  4511. GetPlayerPos(playerid, slx, sly, slz);
  4512. SetPlayerPos(playerid, slx, sly, slz);
  4513. defer NOPCheck(playerid);
  4514. return 1;
  4515. }
  4516. format(string, sizeof(string), "Would you like to purchase this %s\nThis vehicle costs $%s.", GetVehicleName(newcar), number_format(Businesses[iBusiness][bPrice][iSlot]));
  4517. ShowPlayerDialogEx(playerid,DIALOG_CDBUY,DIALOG_STYLE_MSGBOX,"Buy Vehicle",string,"Buy","Cancel");
  4518. TogglePlayerControllable(playerid, false);
  4519. return 1;
  4520. }
  4521. if(DynVeh[vehicleid] != -1 && DynVehicleInfo[DynVeh[vehicleid]][gv_iType] == 1)
  4522. {
  4523. SendClientMessageEx(playerid, COLOR_GRAD1, "Crate Related Commands: /loadforklift /(un)loadplane /cargo /announcetakeoff /cgun /crates /destroycrate /cratelimit");
  4524. SendClientMessageEx(playerid, COLOR_GRAD1, " /(un)loadcrate /delivercrate");
  4525. }
  4526. GetVehicleParamsEx(newcar,engine,lights,alarm,doors,bonnet,boot,objective);
  4527. if((engine == VEHICLE_PARAMS_UNSET || engine == VEHICLE_PARAMS_OFF) && GetVehicleModel(newcar) != 509 && GetVehicleModel(newcar) != 481 && GetVehicleModel(newcar) != 510 && (DynVeh[newcar] != -1 && GetVehicleModel(newcar) == 592 && DynVehicleInfo[DynVeh[newcar]][gv_iType] != 1) ) {
  4528. SendClientMessageEx(playerid, COLOR_WHITE, "This vehicle's engine is not running - if you wish to start it, press ~k~~CONVERSATION_YES~.");
  4529. }
  4530. else if((engine == VEHICLE_PARAMS_UNSET || engine == VEHICLE_PARAMS_OFF) && (DynVeh[newcar] != -1 && GetVehicleModel(newcar) == 592 && DynVehicleInfo[DynVeh[newcar]][gv_iType] == 1))
  4531. {
  4532. SendClientMessageEx(playerid, COLOR_WHITE, "You must request clearance to take off. /announcetakeoff to put in the request.");
  4533. }
  4534. }
  4535. if((newstate == 2 || newstate == 3 || newstate == 7 || newstate == 9) && pTazer{playerid} == 1)
  4536. {
  4537. RemovePlayerWeapon(playerid, 23);
  4538. GivePlayerValidWeapon(playerid, pTazerReplace{playerid});
  4539. pTazer{playerid} = 0;
  4540. }
  4541. if(newstate == PLAYER_STATE_SPAWNED)
  4542. {
  4543. if(ConnectedToPC[playerid] == 1337)//mdc
  4544. {
  4545. ConnectedToPC[playerid] = 0;
  4546. }
  4547. }
  4548. if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
  4549. {
  4550. Seatbelt[playerid] = 0;
  4551. if(GetPVarType(playerid, "HelmetOn"))
  4552. {
  4553. for(new i; i < 10; i++) {
  4554. if(PlayerHoldingObject[playerid][i] == GetPVarInt(playerid, "HelmetOn")) {
  4555. PlayerHoldingObject[playerid][i] = 0;
  4556. RemovePlayerAttachedObject(playerid, i);
  4557. DeletePVar(playerid, "HelmetOn");
  4558. break;
  4559. }
  4560. }
  4561. }
  4562. }
  4563. return 1;
  4564. }
  4565. public OnPlayerExitVehicle(playerid, vehicleid)
  4566. {
  4567. if (_vhudVisible[playerid] == 1)
  4568. {
  4569. HideVehicleHUDForPlayer(playerid);
  4570. }
  4571. if (CarRadars[playerid] > 0)
  4572. {
  4573. PlayerTextDrawHide(playerid, _crTextTarget[playerid]);
  4574. PlayerTextDrawHide(playerid, _crTextSpeed[playerid]);
  4575. PlayerTextDrawHide(playerid, _crTickets[playerid]);
  4576. DeletePVar(playerid, "_lastTicketWarning");
  4577. }
  4578. switch(Seatbelt[playerid])
  4579. {
  4580. case 1:
  4581. {
  4582. new string[128];
  4583. SendClientMessageEx(playerid, COLOR_WHITE, "You have taken off your seatbelt.");
  4584. format(string, sizeof(string), "* %s reaches for their seatbelt and unbuckles it.", GetPlayerNameEx(playerid));
  4585. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  4586. Seatbelt[playerid] = 0;
  4587. }
  4588. case 2:
  4589. {
  4590. new string[128];
  4591. SendClientMessageEx(playerid, COLOR_WHITE, "You have taken off your helmet.");
  4592. format(string, sizeof(string), "* %s reaches for their helmet and takes it off.", GetPlayerNameEx(playerid));
  4593. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  4594. if(GetPVarType(playerid, "HelmetOn"))
  4595. {
  4596. for(new i; i < 10; i++) {
  4597. if(PlayerHoldingObject[playerid][i] == GetPVarInt(playerid, "HelmetOn")) {
  4598. PlayerHoldingObject[playerid][i] = 0;
  4599. RemovePlayerAttachedObject(playerid, i);
  4600. DeletePVar(playerid, "HelmetOn");
  4601. break;
  4602. }
  4603. }
  4604. }
  4605. Seatbelt[playerid] = 0;
  4606. }
  4607. }
  4608. if(GetPVarInt(playerid, "rccam") == 1)
  4609. {
  4610. DestroyVehicle(GetPVarInt(playerid, "rcveh"));
  4611. SetPlayerPos(playerid, GetPVarFloat(playerid, "rcX"), GetPVarFloat(playerid, "rcY"), GetPVarFloat(playerid, "rcZ"));
  4612. DeletePVar(playerid, "rccam");
  4613. KillTimer(GetPVarInt(playerid, "rccamtimer"));
  4614. }
  4615. return 1;
  4616. }
  4617. public OnPlayerRequestClass(playerid, classid)
  4618. {
  4619. if(IsPlayerNPC(playerid)) return 1;
  4620. if(gPlayerLogged{playerid} == 1)
  4621. {
  4622. TogglePlayerSpectating(playerid, 0);
  4623. SetTimerEx("ForceSpawn", 10, false, "i", playerid);
  4624. }
  4625. else
  4626. {
  4627. TogglePlayerSpectating(playerid, 1);
  4628. //SetPlayerJoinCamera(playerid);
  4629. }
  4630. return 1;
  4631. }
  4632. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  4633. {
  4634. // if(!success) SendClientMessageEx(playerid, COLOR_WHITE, "SERVER: Unknown command. Please use /help to list all available commands.");
  4635. if(!success) {
  4636. TextDrawShowForPlayer(playerid, TD_ServerError);
  4637. defer HideServerError(playerid);
  4638. }
  4639. return 1;
  4640. }
  4641. timer HideServerError[5000](playerid) {
  4642. TextDrawHideForPlayer(playerid, TD_ServerError);
  4643. return 1;
  4644. }
  4645. public OnPlayerCommandReceived(playerid, cmdtext[]) {
  4646. if(gPlayerLogged{playerid} != 1) {
  4647. SendClientMessageEx(playerid, COLOR_RED, "You are not logged in.");
  4648. return 0;
  4649. }
  4650. /*
  4651. arrAntiCheat[playerid][ac_iCommandCount]++;
  4652. switch(arrAntiCheat[playerid][ac_iCommandCount]) {
  4653. case 0 .. 6: {}
  4654. default: {
  4655. AC_Process(playerid, AC_CMDSPAM, arrAntiCheat[playerid][ac_iCommandCount]);
  4656. return 0;
  4657. }
  4658. }*/
  4659. playerLastTyped[playerid] = 0;
  4660. printf("[zcmd] [%s]: %s", GetPlayerNameEx(playerid), (strfind(cmdtext, "/changepass", true) == 0 ? ("/changepass") : cmdtext));
  4661. if(PlayerInfo[playerid][pForcePasswordChange] == 1) return ShowLoginDialogs(playerid, 0), 0;
  4662. if(PlayerInfo[playerid][pMuted] == 1) {
  4663. SendClientMessageEx(playerid, COLOR_GREY, "You cannot speak, you have been silenced!");
  4664. return 0;
  4665. }
  4666. if(CommandSpamUnmute[playerid] != 0) {
  4667. SendClientMessage(playerid, COLOR_WHITE, "You are muted from submitting commands right now.");
  4668. return 0;
  4669. }
  4670. if(GetPVarInt(playerid, "voucherdialog"))
  4671. {
  4672. if(GetPVarInt(playerid, "voucherdialog") == 1) return SendClientMessageEx(playerid, COLOR_GRAD2, "Please finalize your voucher transaction."), 0;
  4673. new string[128];
  4674. format(string,sizeof(string),"{AA3333}AdmWarning{FFFF00}: %s (ID: %d) may be attempting to exploit the voucher system. (CMD)", GetPlayerNameEx(playerid), playerid);
  4675. ABroadCast(COLOR_YELLOW, string, 2);
  4676. format(string,sizeof(string),"AdmWarning: %s(%d) (ID: %d) may be attempting to exploit the voucher system. (CMD)", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), playerid);
  4677. Log("logs/vouchers.log", string);
  4678. return 0;
  4679. }
  4680. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1)
  4681. {
  4682. if(++CommandSpamTimes[playerid] >= 5) {
  4683. CommandSpamTimes[playerid] = 0;
  4684. CommandSpamUnmute[playerid] = 10;
  4685. SendClientMessageEx(playerid, COLOR_YELLOW, "You have been muted automatically for spamming. Please wait 10 seconds and try again.");
  4686. SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_FLOODPROTECTION);
  4687. return 0;
  4688. }
  4689. }
  4690. if(strfind(cmdtext, "|") != -1 || strfind(cmdtext, "\n") != -1 || strfind(cmdtext, "\r") != -1) {
  4691. SendClientMessageEx(playerid, COLOR_GREY, "You cannot use non-standard characters in commands.");
  4692. return 0;
  4693. }
  4694. if (strcmp(GiftCode, "off") != 0 && strfind(cmdtext, "/giftcode") == -1)
  4695. {
  4696. if(strfind(cmdtext, GiftCode) != -1)
  4697. {
  4698. SendClientMessageEx(playerid, COLOR_GREY, "You can't tell other people the gift code.");
  4699. return 0;
  4700. }
  4701. }
  4702. if(PlayerInfo[playerid][pAdmin] < 2 && CheckServerAd(cmdtext))
  4703. {
  4704. new string[128];
  4705. format(string,sizeof(string),"{AA3333}AdmWarning{FFFF00}: %s (ID: %d) may be server advertising: '{AA3333}%s{FFFF00}'.", GetPlayerNameEx(playerid), playerid, cmdtext);
  4706. ABroadCast(COLOR_YELLOW, string, 2);
  4707. format(string,sizeof(string),"%s(%d) (IP: %s) may be server advertising: '%s'.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), cmdtext);
  4708. Log("logs/hack.log", string);
  4709. return 0;
  4710. }
  4711. return 1;
  4712. }
  4713. /*
  4714. public OnPlayerCommandText(playerid, cmdtext[])
  4715. {
  4716. return 1;
  4717. }
  4718. */
  4719. public OnPlayerText(playerid, text[])
  4720. {
  4721. szMiscArray[0] = 0;
  4722. text[0] = toupper(text[0]);
  4723. if(gPlayerLogged{playerid} != 1)
  4724. {
  4725. SendClientMessageEx(playerid, COLOR_RED, "You are not logged in.");
  4726. return 0;
  4727. }
  4728. if(PlayerInfo[playerid][pJailTime] && strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1) return SendClientMessageEx(playerid, COLOR_GREY, "OOC prisoners are restricted to only speak in /b"), 0;
  4729. new sendername[MAX_PLAYER_NAME];
  4730. new giveplayer[MAX_PLAYER_NAME];
  4731. new string[128];
  4732. playerLastTyped[playerid] = 0;
  4733. //if(strcmp("lol", text, true) == 0) return cmd_me(playerid, "laughs out loud."), 0;
  4734. if(TextSpamUnmute[playerid] != 0)
  4735. {
  4736. if(PlayerInfo[playerid][pAdmin] < 2)
  4737. {
  4738. SendClientMessage(playerid, COLOR_WHITE, "You are muted from submitting text right now.");
  4739. return 0;
  4740. }
  4741. }
  4742. if(PlayerInfo[playerid][pAdmin] < 2)
  4743. {
  4744. if(++TextSpamTimes[playerid] == 5)
  4745. {
  4746. TextSpamTimes[playerid] = 0;
  4747. TextSpamUnmute[playerid] = 10;
  4748. SendClientMessageEx(playerid, COLOR_YELLOW, "You have been muted automatically for spamming. Please wait 10 seconds and try again.");
  4749. SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_FLOODPROTECTION);
  4750. return 0;
  4751. }
  4752. }
  4753. /*Compares last string with current, if the same, alert the staff only on the 3rd command. (Expires after 5 secs)
  4754. if(PlayerInfo[playerid][pAdmin] < 2) {
  4755. new laststring[128];
  4756. if(GetPVarString(playerid, "LastText", laststring, 128)) {
  4757. if(!strcmp(laststring, text, true)) {
  4758. TextSpamTimes[playerid]++;
  4759. if(TextSpamTimes[playerid] == 2) {
  4760. TextSpamTimer[playerid] = 30;
  4761. TextSpamTimes[playerid] = 0;
  4762. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is spamming with: %s", GetPlayerNameEx(playerid), playerid, text);
  4763. ABroadCast(COLOR_YELLOW, string, 2);
  4764. }
  4765. }
  4766. }
  4767. SetPVarString(playerid, "LastText", text);
  4768. }*/
  4769. if(strfind(text, "|", true) != -1) {
  4770. SendClientMessageEx(playerid, COLOR_RED, "You cannot use the '|' character in text.");
  4771. return 0;
  4772. }
  4773. if(PlayerInfo[playerid][pMuted] == 1)
  4774. {
  4775. SendClientMessageEx(playerid, COLOR_GREY, "You cannot speak, you have been silenced!");
  4776. return 0;
  4777. }
  4778. if (strcmp(GiftCode, "off") != 0 && strfind(text, "/giftcode") == -1)
  4779. {
  4780. if(strfind(text, GiftCode) != -1)
  4781. {
  4782. SendClientMessageEx(playerid, COLOR_GREY, "You can't tell other people the gift code.");
  4783. return 0;
  4784. }
  4785. }
  4786. if(PlayerInfo[playerid][pAdmin] < 2 && CheckServerAd(text))
  4787. {
  4788. format(string,sizeof(string),"{AA3333}AdmWarning{FFFF00}: %s (ID: %d) may be server advertising: '{AA3333}%s{FFFF00}'.", GetPlayerNameEx(playerid), playerid, text);
  4789. ABroadCast(COLOR_YELLOW, string, 2);
  4790. format(string,sizeof(string),"%s(%d) (IP: %s) may be server advertising: '%s'.", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), text);
  4791. Log("logs/hack.log", string);
  4792. return 0;
  4793. }
  4794. if(MarriageCeremoney[playerid] > 0)
  4795. {
  4796. if (strcmp("yes", text, true) == 0)
  4797. {
  4798. if(GotProposedBy[playerid] != INVALID_PLAYER_ID)
  4799. {
  4800. if(IsPlayerConnected(GotProposedBy[playerid]))
  4801. {
  4802. GetPlayerName(playerid, sendername, sizeof(sendername));
  4803. GetPlayerName(GotProposedBy[playerid], giveplayer, sizeof(giveplayer));
  4804. format(string, sizeof(string), "Priest: %s do you take %s as your lovely wife? (Type 'yes' - anything else will reject the marriage).", giveplayer,sendername);
  4805. SendClientMessageEx(GotProposedBy[playerid], COLOR_WHITE, string);
  4806. MarriageCeremoney[GotProposedBy[playerid]] = 1;
  4807. MarriageCeremoney[playerid] = 0;
  4808. GotProposedBy[playerid] = INVALID_PLAYER_ID;
  4809. return 0; // Yeah... no more "YES DILDOS SEX RAPE LOL" broadcast to the whole server
  4810. }
  4811. else
  4812. {
  4813. MarriageCeremoney[playerid] = 0;
  4814. GotProposedBy[playerid] = INVALID_PLAYER_ID;
  4815. return 0;
  4816. }
  4817. }
  4818. else if(ProposedTo[playerid] != INVALID_PLAYER_ID)
  4819. {
  4820. if(IsPlayerConnected(ProposedTo[playerid]))
  4821. {
  4822. GetPlayerName(playerid, sendername, sizeof(sendername));
  4823. GetPlayerName(ProposedTo[playerid], giveplayer, sizeof(giveplayer));
  4824. if(PlayerInfo[playerid][pSex] == 1 && PlayerInfo[ProposedTo[playerid]][pSex] == 2)
  4825. {
  4826. format(string, sizeof(string), "Priest: %s and %s i pronounce you now... Husband & Wife, you may kiss the bride.", sendername, giveplayer);
  4827. SendClientMessageEx(playerid, COLOR_WHITE, string);
  4828. format(string, sizeof(string), "Priest: %s and %s i pronounce you now... Husband & Wife, you may kiss the groom.", giveplayer, sendername);
  4829. SendClientMessageEx(ProposedTo[playerid], COLOR_WHITE, string);
  4830. format(string, sizeof(string), "Marriage News: We have a new lovely couple! %s & %s have been married.", sendername, giveplayer);
  4831. OOCNews(COLOR_WHITE, string);
  4832. }
  4833. else if(PlayerInfo[playerid][pSex] == 1 && PlayerInfo[ProposedTo[playerid]][pSex] == 1)
  4834. {
  4835. format(string, sizeof(string), "Priest: %s and %s i pronounce you now... Husband & Husband, you may kiss the bride.", sendername, giveplayer);
  4836. SendClientMessageEx(playerid, COLOR_WHITE, string);
  4837. format(string, sizeof(string), "Priest: %s and %s i pronounce you now... Husband & Husband, you may kiss the groom.", giveplayer, sendername);
  4838. SendClientMessageEx(ProposedTo[playerid], COLOR_WHITE, string);
  4839. format(string, sizeof(string), "Marriage News: We have a new gay couple! %s & %s have been married.", sendername, giveplayer);
  4840. OOCNews(COLOR_WHITE, string);
  4841. }
  4842. else if(PlayerInfo[playerid][pSex] == 2 && PlayerInfo[ProposedTo[playerid]][pSex] == 2)
  4843. {
  4844. format(string, sizeof(string), "Priest: %s and %s i pronounce you now... Wife & Wife, you may kiss the Bride.", sendername, giveplayer);
  4845. SendClientMessageEx(playerid, COLOR_WHITE, string);
  4846. format(string, sizeof(string), "Priest: %s and %s i pronounce you now... Wife & Wife, you may kiss the Groom.", giveplayer, sendername);
  4847. SendClientMessageEx(ProposedTo[playerid], COLOR_WHITE, string);
  4848. format(string, sizeof(string), "Marriage News: We have a new lesbian couple! %s & %s have been married.", sendername, giveplayer);
  4849. OOCNews(COLOR_WHITE, string);
  4850. }
  4851. if(GetPVarInt(playerid, "marriagelastname") == 2)
  4852. {
  4853. new escapedName[MAX_PLAYER_NAME];
  4854. format(string, sizeof(string), "%s_%s", GetFirstName(playerid), GetLastName(ProposedTo[playerid]));
  4855. mysql_escape_string(string, escapedName);
  4856. SetPVarString(playerid, "NewNameRequest", escapedName);
  4857. mysql_format(MainPipeline, string, sizeof(string), "SELECT `Username` FROM `accounts` WHERE `Username`='%e'", string);
  4858. mysql_tquery(MainPipeline, string, "OnApproveName", "ii", playerid, playerid);
  4859. }
  4860. if(GetPVarInt(ProposedTo[playerid], "marriagelastname") == 2)
  4861. {
  4862. new escapedName[MAX_PLAYER_NAME];
  4863. format(string, sizeof(string), "%s_%s", GetFirstName(ProposedTo[playerid]), GetLastName(playerid));
  4864. mysql_escape_string(string, escapedName);
  4865. SetPVarString(ProposedTo[playerid], "NewNameRequest", escapedName);
  4866. mysql_format(MainPipeline, string, sizeof(string), "SELECT `Username` FROM `accounts` WHERE `Username`='%e'", string);
  4867. mysql_tquery(MainPipeline, string, "OnApproveName", "ii", ProposedTo[playerid], ProposedTo[playerid]);
  4868. }
  4869. //MarriageCeremoney[ProposedTo[playerid]] = 1;
  4870. MarriageCeremoney[ProposedTo[playerid]] = 0;
  4871. MarriageCeremoney[playerid] = 0;
  4872. PlayerInfo[ProposedTo[playerid]][pMarriedID] = GetPlayerSQLId(playerid);
  4873. format(PlayerInfo[ProposedTo[playerid]][pMarriedName], MAX_PLAYER_NAME, "%s", sendername);
  4874. PlayerInfo[playerid][pMarriedID] = GetPlayerSQLId(ProposedTo[playerid]);
  4875. format(PlayerInfo[playerid][pMarriedName], MAX_PLAYER_NAME, "%s", giveplayer);
  4876. GivePlayerCash(playerid, - 100000);
  4877. ProposedTo[playerid] = INVALID_PLAYER_ID;
  4878. MarriageCeremoney[playerid] = 0;
  4879. return 0;
  4880. }
  4881. else
  4882. {
  4883. MarriageCeremoney[playerid] = 0;
  4884. ProposedTo[playerid] = INVALID_PLAYER_ID;
  4885. return 0;
  4886. }
  4887. }
  4888. }
  4889. else
  4890. {
  4891. if(GotProposedBy[playerid] != INVALID_PLAYER_ID)
  4892. {
  4893. if(IsPlayerConnected(GotProposedBy[playerid]))
  4894. {
  4895. format(string, sizeof(string), "* You didn't want to marry %s, no 'yes' was said.", GetPlayerNameEx(GotProposedBy[playerid]));
  4896. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  4897. format(string, sizeof(string), "* %s didn't want to marry you, no 'yes' was said.",GetPlayerNameEx(playerid));
  4898. SendClientMessageEx(GotProposedBy[playerid], COLOR_YELLOW, string);
  4899. return 0;
  4900. }
  4901. else
  4902. {
  4903. MarriageCeremoney[playerid] = 0;
  4904. GotProposedBy[playerid] = INVALID_PLAYER_ID;
  4905. return 0;
  4906. }
  4907. }
  4908. else if(ProposedTo[playerid] != INVALID_PLAYER_ID)
  4909. {
  4910. if(IsPlayerConnected(ProposedTo[playerid]))
  4911. {
  4912. format(string, sizeof(string), "* You didn't want to marry %s, no 'yes' was said.",GetPlayerNameEx(ProposedTo[playerid]));
  4913. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  4914. format(string, sizeof(string), "* %s didn't want to marry you, no 'yes' was said.",GetPlayerNameEx(playerid));
  4915. SendClientMessageEx(ProposedTo[playerid], COLOR_YELLOW, string);
  4916. return 0;
  4917. }
  4918. else
  4919. {
  4920. MarriageCeremoney[playerid] = 0;
  4921. ProposedTo[playerid] = INVALID_PLAYER_ID;
  4922. return 0;
  4923. }
  4924. }
  4925. }
  4926. return 0;
  4927. }
  4928. if(CallLawyer[playerid] == 111)
  4929. {
  4930. if (strcmp("yes", text, true) == 0)
  4931. {
  4932. format(string, sizeof(string), "** %s is in jail, and needs a lawyer. Go to the Police Station.", GetPlayerNameEx(playerid));
  4933. SendJobMessage(2, TEAM_AZTECAS_COLOR, string);
  4934. SendJobMessage(2, TEAM_AZTECAS_COLOR, "* When you are at the Police Station, ask an officer to approve you with /accept lawyer.");
  4935. SendClientMessageEx(playerid, COLOR_LIGHTRED, "A message has been sent to all available lawyers, please wait.");
  4936. WantLawyer[playerid] = 0;
  4937. CallLawyer[playerid] = 0;
  4938. return 0;
  4939. }
  4940. else
  4941. {
  4942. SendClientMessageEx(playerid, COLOR_LIGHTRED, "There is no lawyer available to you anymore. Jail time has started.");
  4943. WantLawyer[playerid] = 0;
  4944. CallLawyer[playerid] = 0;
  4945. return 0;
  4946. }
  4947. }
  4948. if(TalkingLive[playerid] != INVALID_PLAYER_ID)
  4949. {
  4950. if(IsAReporter(playerid))
  4951. {
  4952. format(string, sizeof(string), "Live News Reporter %s: %s", GetPlayerNameEx(playerid), text);
  4953. OOCNews(COLOR_LIGHTGREEN, string);
  4954. format(szMiscArray, sizeof(szMiscArray), "[/LIVE] %s (%i): %s", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), text);
  4955. Log("logs/broadcast.log", szMiscArray);
  4956. }
  4957. else
  4958. {
  4959. format(string, sizeof(string), "Live Interview Guest %s: %s", GetPlayerNameEx(playerid), text);
  4960. OOCNews(COLOR_LIGHTGREEN, string);
  4961. format(szMiscArray, sizeof(szMiscArray), "[/LIVE] %s (%i): %s", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), text);
  4962. Log("logs/broadcast.log", szMiscArray);
  4963. }
  4964. return 0;
  4965. }
  4966. if(Mobile[playerid] != INVALID_PLAYER_ID)
  4967. {
  4968. if(GetPVarType(playerid, "PayPhone")) {
  4969. format(string, sizeof(string), "(payphone)(unknown) says: %s", text);
  4970. }
  4971. else format(string, sizeof(string), "(cellphone) %s says: %s", GetPlayerNameEx(playerid), text);
  4972. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  4973. if(IsPlayerConnected(Mobile[playerid]))
  4974. {
  4975. if(GetPVarInt(Mobile[playerid], "hCall") == playerid)
  4976. {
  4977. if(PlayerInfo[Mobile[playerid]][pSpeakerPhone] != 0)
  4978. {
  4979. format(string, sizeof(string), "(speakerphone) Unknown says: %s", text);
  4980. ProxDetector(20.0, Mobile[playerid], string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  4981. }
  4982. else
  4983. {
  4984. ChatTrafficProcess(Mobile[playerid], COLOR_YELLOW, string, 7);
  4985. }
  4986. if(PlayerInfo[playerid][pBugged] != INVALID_GROUP_ID)
  4987. {
  4988. format(string, sizeof(string), "{8D8DFF}(BUGGED) {CBCCCE}Unknown (cellphone): %s", text);
  4989. }
  4990. else if(PlayerInfo[Mobile[playerid]][pBugged] != INVALID_GROUP_ID){
  4991. format(string, sizeof(string), "{8D8DFF}(BUG ID %d) {CBCCCE}Unknown (cellphone): %s", Mobile[playerid], text);
  4992. }
  4993. SendBugMessage(playerid, PlayerInfo[playerid][pBugged], string);
  4994. }
  4995. else if(Mobile[Mobile[playerid]] == playerid)
  4996. {
  4997. if(PlayerInfo[Mobile[playerid]][pSpeakerPhone] != 0)
  4998. {
  4999. if(GetPVarType(playerid, "PayPhone")) {
  5000. format(string, sizeof(string), "(speakerphone)(unknown) says: %s", text);
  5001. }
  5002. else format(string, sizeof(string), "(speakerphone) %s says: %s", GetPlayerNameEx(playerid), text);
  5003. ProxDetector(20.0, Mobile[playerid], string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  5004. }
  5005. else
  5006. {
  5007. ChatTrafficProcess(Mobile[playerid], COLOR_YELLOW, string, 7);
  5008. }
  5009. if(PlayerInfo[playerid][pBugged] != INVALID_GROUP_ID)
  5010. {
  5011. format(string, sizeof(string), "{8D8DFF}(BUGGED) {CBCCCE}%s (cellphone): %s", GetPlayerNameEx(playerid), text);
  5012. }
  5013. else if(PlayerInfo[Mobile[playerid]][pBugged] != INVALID_GROUP_ID){
  5014. format(string, sizeof(string), "{8D8DFF}(BUG ID %d) {CBCCCE}%s (cellphone): %s", Mobile[playerid], GetPlayerNameEx(playerid), text);
  5015. }
  5016. SendBugMessage(playerid, PlayerInfo[playerid][pBugged], string);
  5017. }
  5018. }
  5019. else
  5020. {
  5021. SendClientMessageEx(playerid, COLOR_YELLOW,"There's nobody there!");
  5022. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  5023. RemovePlayerAttachedObject(playerid, 8);
  5024. Mobile[playerid] = INVALID_PLAYER_ID;
  5025. }
  5026. return 0;
  5027. }
  5028. sendername = GetPlayerNameEx(playerid);
  5029. if(GetPVarType(playerid, "IsInArena"))
  5030. {
  5031. new a = GetPVarInt(playerid, "IsInArena");
  5032. if(PaintBallArena[a][pbGameType] == 2 || PaintBallArena[a][pbGameType] == 3 || PaintBallArena[a][pbGameType] == 5)
  5033. {
  5034. if(PlayerInfo[playerid][pPaintTeam] == 1)
  5035. {
  5036. format(string, sizeof(string), "[Paintball Arena] ({FF0000}Red Team{FFFFFF}) %s says: %s", sendername, text);
  5037. }
  5038. if(PlayerInfo[playerid][pPaintTeam] == 2)
  5039. {
  5040. format(string, sizeof(string), "[Paintball Arena] ({0000FF}Blue Team{FFFFFF}) %s says: %s", sendername, text);
  5041. }
  5042. }
  5043. else
  5044. {
  5045. format(string, sizeof(string), "[Paintball Arena] %s says: %s", sendername, text);
  5046. }
  5047. SendPaintballArenaMessage(a, COLOR_WHITE, string);
  5048. return 0;
  5049. }
  5050. new accent[32];
  5051. switch(PlayerInfo[playerid][pAccent])
  5052. {
  5053. case 0, 1: accent = "";
  5054. case 2: accent = "(British accent) ";
  5055. case 3: accent = "(Japanese accent) ";
  5056. case 4: accent = "(Chinese accent) ";
  5057. case 5: accent = "(Korean accent) ";
  5058. case 6: accent = "(Scottish accent) ";
  5059. case 7: accent = "(Irish accent) ";
  5060. case 8: accent = "(Russian accent) ";
  5061. case 9: accent = "(American accent) ";
  5062. case 10, 12: accent = "(Spanish accent) ";
  5063. case 11: accent = "(Southern accent) ";
  5064. case 13: accent = "(Italian accent) ";
  5065. case 14: accent = "(Gangster accent) ";
  5066. case 15: accent = "(Australian accent) ";
  5067. case 16: accent = "(Arabic accent) ";
  5068. case 17: accent = "(Balkan accent) ";
  5069. case 18: accent = "(Canadian accent) ";
  5070. case 19: accent = "(Jamaican accent) ";
  5071. case 20: accent = "(Israeli accent) ";
  5072. case 21: accent = "(Dutch accent) ";
  5073. case 22: accent = "(Brazilian accent) ";
  5074. case 23: accent = "(German accent) ";
  5075. case 24: accent = "(Turkish accent) ";
  5076. case 25: accent = "(Kiwi accent) ";
  5077. case 26: accent = "(French accent) ";
  5078. case 27: accent = "(Korean accent) ";
  5079. case 28: accent = "(Thai accent) ";
  5080. case 29: accent = "(Swedish accent) ";
  5081. case 30: accent = "(Danish accent) ";
  5082. case 31: accent = "(Norwegian accent) ";
  5083. }
  5084. if(!GetPVarType(playerid, "WatchingTV")) {
  5085. new Float: f_playerPos[3];
  5086. GetPlayerPos(playerid, f_playerPos[0], f_playerPos[1], f_playerPos[2]);
  5087. new str[128];
  5088. foreach(new i: Player)
  5089. {
  5090. if((InsidePlane[playerid] == GetPlayerVehicleID(i) && GetPlayerState(i) == 2) || (InsidePlane[i] == GetPlayerVehicleID(playerid) && GetPlayerState(playerid) == 2) || (InsidePlane[playerid] != INVALID_VEHICLE_ID && InsidePlane[playerid] == InsidePlane[i])) {
  5091. //if(PlayerInfo[playerid][pDuty] || IsAHitman(playerid)) format(string, sizeof(string), "%s{%06x}%s{E6E6E6} says: %s", accent, GetPlayerColor(playerid), sendername, text);
  5092. format(string, sizeof(string), "%s%s says: %s", accent, sendername, text);
  5093. SendClientMessageEx(i, COLOR_FADE1, string);
  5094. }
  5095. else if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid)) {
  5096. if(IsPlayerInRangeOfPoint(i, 20.0 * 0.6, f_playerPos[0], f_playerPos[1], f_playerPos[2]) && PlayerInfo[i][pBugged] >= 0)
  5097. {
  5098. if(playerid == i)
  5099. {
  5100. format(string, sizeof(string), "%s%s says: %s", accent, sendername, text);
  5101. format(str, sizeof(str), "{8D8DFF}(BUGGED) {CBCCCE}%s", string);
  5102. }
  5103. else {
  5104. format(string, sizeof(string), "%s%s says: %s", accent, sendername, text);
  5105. format(str, sizeof(str), "{8D8DFF}(BUG ID %d) {CBCCCE}%s", i,string);
  5106. }
  5107. if(PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pTogReports] == 1 || PlayerInfo[playerid][pAdmin] < 2 || PlayerInfo[i][pAdmin] >= 2 && PlayerInfo[i][pTogReports] == 1 || PlayerInfo[i][pAdmin] < 2) SendBugMessage(i, PlayerInfo[i][pBugged], str);
  5108. }
  5109. if(IsPlayerInRangeOfPoint(i, 20.0, f_playerPos[0], f_playerPos[1], f_playerPos[2]) && PlayerInfo[playerid][pAccountRestricted] == 1)
  5110. {
  5111. format(string, sizeof(string), "[Restricted] %s: %s", GetPlayerNameEx(playerid), text);
  5112. SendClientMessageEx(i, COLOR_FADE5, string);
  5113. }
  5114. else if(IsPlayerInRangeOfPoint(i, 20.0 / 16, f_playerPos[0], f_playerPos[1], f_playerPos[2])) {
  5115. format(string, sizeof(string), "%s%s says: %s", accent, sendername, text);
  5116. SendClientMessageEx(i, COLOR_FADE1, string);
  5117. }
  5118. else if(IsPlayerInRangeOfPoint(i, 20.0 / 8, f_playerPos[0], f_playerPos[1], f_playerPos[2])) {
  5119. format(string, sizeof(string), "%s%s says: %s", accent, sendername, text);
  5120. SendClientMessageEx(i, COLOR_FADE2, string);
  5121. }
  5122. else if(IsPlayerInRangeOfPoint(i, 20.0 / 4, f_playerPos[0], f_playerPos[1], f_playerPos[2])) {
  5123. format(string, sizeof(string), "%s%s says: %s", accent, sendername, text);
  5124. SendClientMessageEx(i, COLOR_FADE3, string);
  5125. }
  5126. else if(IsPlayerInRangeOfPoint(i, 20.0 / 2, f_playerPos[0], f_playerPos[1], f_playerPos[2])) {
  5127. format(string, sizeof(string), "%s%s says: %s", accent, sendername, text);
  5128. SendClientMessageEx(i, COLOR_FADE4, string);
  5129. }
  5130. else if(IsPlayerInRangeOfPoint(i, 20.0, f_playerPos[0], f_playerPos[1], f_playerPos[2])) {
  5131. format(string, sizeof(string), "%s%s says: %s", accent, sendername, text);
  5132. SendClientMessageEx(i, COLOR_FADE5, string);
  5133. }
  5134. }
  5135. if(GetPVarInt(i, "BigEar") == 1 || GetPVarInt(i, "BigEar") == 6 && GetPVarInt(i, "BigEarPlayer") == playerid) {
  5136. format(string, sizeof(string), "%s%s says: %s", accent, sendername, text);
  5137. new string2[128] = "(BE) ";
  5138. strcat(string2,string, sizeof(string2));
  5139. SendClientMessageEx(i, COLOR_FADE1, string);
  5140. }
  5141. }
  5142. }
  5143. SetPlayerChatBubble(playerid, text, COLOR_WHITE, 20.0, 5000);
  5144. format(string, sizeof(string), "(BE) %s: %s", GetPlayerNameEx(playerid), text);
  5145. foreach(new i: Player)
  5146. {
  5147. if(PlayerInfo[i][pAdmin] > 1 && GetPVarInt(i, "BigEar") == 3)
  5148. {
  5149. SendClientMessageEx(i, COLOR_WHITE, string);
  5150. }
  5151. }
  5152. return 0;
  5153. }
  5154. public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
  5155. {
  5156. if(DynVeh[vehicleid] != -1)
  5157. {
  5158. new vw[1];
  5159. vw[0] = GetVehicleVirtualWorld(vehicleid);
  5160. if(DynVehicleObjInfo[DynVeh[vehicleid]][1][gv_iAttachedObjectModel] != INVALID_OBJECT_ID)
  5161. {
  5162. Streamer_SetArrayData(STREAMER_TYPE_OBJECT, DynVehicleObjInfo[DynVeh[vehicleid]][0][gv_iAttachedObjectID], E_STREAMER_WORLD_ID, vw[0]);
  5163. }
  5164. if(DynVehicleObjInfo[DynVeh[vehicleid]][0][gv_iAttachedObjectModel] != INVALID_OBJECT_ID)
  5165. {
  5166. Streamer_SetArrayData(STREAMER_TYPE_OBJECT, DynVehicleObjInfo[DynVeh[vehicleid]][1][gv_iAttachedObjectID], E_STREAMER_WORLD_ID, vw[0]);
  5167. }
  5168. }
  5169. return 0;
  5170. }
  5171. public OnPlayerModelSelectionEx(playerid, response, extraid, modelid, extralist_id) {
  5172. if(extraid == 1500 && response) {
  5173. new iGroup = PlayerInfo[playerid][pMember];
  5174. for(new i; i < MAX_BARRICADES; i++)
  5175. {
  5176. if(Barricades[iGroup][i][sX] == 0 && Barricades[iGroup][i][sY] == 0 && Barricades[iGroup][i][sZ] == 0)
  5177. {
  5178. new Float: f_TempAngle;
  5179. GetPlayerPos(playerid, Barricades[iGroup][i][sX], Barricades[iGroup][i][sY], Barricades[iGroup][i][sZ]);
  5180. GetPlayerFacingAngle(playerid, f_TempAngle);
  5181. switch(modelid)
  5182. {
  5183. case 981: {
  5184. Barricades[iGroup][i][sObjectID] = CreateDynamicObject(981, Barricades[iGroup][i][sX], Barricades[iGroup][i][sY], Barricades[iGroup][i][sZ], 0.0, 0.0, f_TempAngle);
  5185. SetPlayerPos(playerid, Barricades[iGroup][i][sX] + 2, Barricades[iGroup][i][sY] + 2, Barricades[iGroup][i][sZ] + 2);
  5186. }
  5187. case 4504: {
  5188. Barricades[iGroup][i][sObjectID] = CreateDynamicObject(4504, Barricades[iGroup][i][sX], Barricades[iGroup][i][sY], Barricades[iGroup][i][sZ] + 1.6996, 0.0, 0.0, f_TempAngle + 270);
  5189. SetPlayerPos(playerid, Barricades[iGroup][i][sX] + 10, Barricades[iGroup][i][sY] + 10, Barricades[iGroup][i][sZ] + 5);
  5190. }
  5191. case 4505: {
  5192. Barricades[iGroup][i][sObjectID] = CreateDynamicObject(4505, Barricades[iGroup][i][sX], Barricades[iGroup][i][sY], Barricades[iGroup][i][sZ] + 1.6996, 0.0, 0.0, f_TempAngle + 270);
  5193. SetPlayerPos(playerid, Barricades[iGroup][i][sX] + 10, Barricades[iGroup][i][sY] + 10, Barricades[iGroup][i][sZ] + 5);
  5194. }
  5195. case 4514: {
  5196. Barricades[iGroup][i][sObjectID] = CreateDynamicObject(4514, Barricades[iGroup][i][sX], Barricades[iGroup][i][sY], Barricades[iGroup][i][sZ] + 1.2394, 0.0, 0.0, f_TempAngle + 270);
  5197. SetPlayerPos(playerid, Barricades[iGroup][i][sX] + 10, Barricades[iGroup][i][sY] + 10, Barricades[iGroup][i][sZ] + 5);
  5198. }
  5199. case 4526: {
  5200. Barricades[iGroup][i][sObjectID] = CreateDynamicObject(4526, Barricades[iGroup][i][sX], Barricades[iGroup][i][sY], Barricades[iGroup][i][sZ] + 0.7227, 0.0, 0.0, f_TempAngle);
  5201. SetPlayerPos(playerid, Barricades[iGroup][i][sX] + 10, Barricades[iGroup][i][sY] + 10, Barricades[iGroup][i][sZ] + 5);
  5202. }
  5203. case 978: {
  5204. Barricades[iGroup][i][sObjectID] = CreateDynamicObject(978, Barricades[iGroup][i][sX], Barricades[iGroup][i][sY], Barricades[iGroup][i][sZ], 0.0, 0.0, f_TempAngle);
  5205. SetPlayerPos(playerid, Barricades[iGroup][i][sX] + 2, Barricades[iGroup][i][sY] + 2, Barricades[iGroup][i][sZ]);
  5206. }
  5207. case 979: {
  5208. Barricades[iGroup][i][sObjectID] = CreateDynamicObject(979, Barricades[iGroup][i][sX], Barricades[iGroup][i][sY], Barricades[iGroup][i][sZ], 0.0, 0.0, f_TempAngle);
  5209. SetPlayerPos(playerid, Barricades[iGroup][i][sX] + 2, Barricades[iGroup][i][sY] + 2, Barricades[iGroup][i][sZ]);
  5210. }
  5211. case 3091: {
  5212. Barricades[iGroup][i][sObjectID] = CreateDynamicObject(3091, Barricades[iGroup][i][sX], Barricades[iGroup][i][sY], Barricades[iGroup][i][sZ] - 0.30, 0.0, 0.0, f_TempAngle);
  5213. SetPlayerPos(playerid, Barricades[iGroup][i][sX] + 2, Barricades[iGroup][i][sY] + 2, Barricades[iGroup][i][sZ]);
  5214. }
  5215. case 1459: {
  5216. Barricades[iGroup][i][sObjectID] = CreateDynamicObject(1459, Barricades[iGroup][i][sX], Barricades[iGroup][i][sY], Barricades[iGroup][i][sZ] - 0.40, 0.0, 0.0, f_TempAngle);
  5217. SetPlayerPos(playerid, Barricades[iGroup][i][sX] + 2, Barricades[iGroup][i][sY] + 2, Barricades[iGroup][i][sZ]);
  5218. }
  5219. case 1423: {
  5220. Barricades[iGroup][i][sObjectID] = CreateDynamicObject(1423, Barricades[iGroup][i][sX], Barricades[iGroup][i][sY], Barricades[iGroup][i][sZ] - 0.35, 0.0, 0.0, f_TempAngle);
  5221. SetPlayerPos(playerid, Barricades[iGroup][i][sX] + 2, Barricades[iGroup][i][sY] + 2, Barricades[iGroup][i][sZ]);
  5222. }
  5223. case 1424: {
  5224. Barricades[iGroup][i][sObjectID] = CreateDynamicObject(1424, Barricades[iGroup][i][sX], Barricades[iGroup][i][sY], Barricades[iGroup][i][sZ] - 0.35, 0.0, 0.0, f_TempAngle);
  5225. SetPlayerPos(playerid, Barricades[iGroup][i][sX] + 2, Barricades[iGroup][i][sY] + 2, Barricades[iGroup][i][sZ]);
  5226. }
  5227. }
  5228. GetPlayer3DZone(playerid, Barricades[iGroup][i][sDeployedAt], MAX_ZONE_NAME);
  5229. Barricades[iGroup][i][sDeployedBy] = GetPlayerNameEx(playerid);
  5230. if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pTogReports] != 1) Barricades[iGroup][i][sDeployedByStatus] = 1;
  5231. else Barricades[iGroup][i][sDeployedByStatus] = 0;
  5232. format(szMiscArray, sizeof(szMiscArray), "Barricade ID: %d successfully created.", i);
  5233. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  5234. /*format(string, sizeof(string), "** HQ: A barricade has been deployed by %s at %s **", GetPlayerNameEx(playerid), Barricades[iGroup][i][sDeployedAt]);
  5235. foreach(new x: Player)
  5236. {
  5237. if(PlayerInfo[x][pToggledChats][12] == 0)
  5238. {
  5239. if(PlayerInfo[x][pMember] == iGroup) SendClientMessageEx(x, arrGroupData[iGroup][g_hRadioColour] * 256 + 255, string);
  5240. if(GetPVarInt(x, "BigEar") == 4 && GetPVarInt(x, "BigEarGroup") == iGroup)
  5241. {
  5242. new szBigEar[128];
  5243. format(szBigEar, sizeof(szBigEar), "(BE) %s", string);
  5244. SendClientMessageEx(x, arrGroupData[iGroup][g_hRadioColour] * 256 + 255, szBigEar);
  5245. }
  5246. }
  5247. }*/
  5248. return 1;
  5249. }
  5250. }
  5251. SendClientMessageEx(playerid, COLOR_WHITE, "Unable to spawn more barricades, limit is " #MAX_BARRICADES# ".");
  5252. return 1;
  5253. }
  5254. /*
  5255. if(extraid == 1505) {
  5256. if(response) {
  5257. SetPVarInt(playerid, PVAR_FURNITURE_BUYMODEL, modelid);
  5258. format(szMiscArray, sizeof(szMiscArray), "Would you like to buy this %s for $%s and %s materials?", GetFurnitureName(modelid), number_format(GetFurniturePrice(modelid)), number_format(GetFurniturePrice(modelid) / 10));
  5259. ShowPlayerDialogEx(playerid, DIALOG_FURNITURE_BUYCONFIRM, DIALOG_STYLE_MSGBOX, "Furniture Menu | Confirm Purchase", szMiscArray, "Buy", "Cancel");
  5260. }
  5261. else {
  5262. FurnitureMenu(playerid, 0);
  5263. }
  5264. }
  5265. */
  5266. if(extraid == DYNAMIC_FAMILY_CLOTHES)
  5267. {
  5268. if(response)
  5269. {
  5270. PlayerInfo[playerid][pModel] = modelid;
  5271. SetPlayerSkin(playerid, modelid);
  5272. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have changed your clothes.");
  5273. }
  5274. else
  5275. return SendClientMessageEx(playerid, COLOR_GRAD2, "You exit the clothes selection menu.");
  5276. }
  5277. else if(extraid == 1338)
  5278. {
  5279. if(response)
  5280. {
  5281. if(modelid == 1654) PlayerInfo[playerid][pC4] = CreateDynamicObject(modelid, GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z")-0.9, 0, 89.325012207031, 3.9700012207031);
  5282. else PlayerInfo[playerid][pC4] = CreateDynamicObject(modelid, GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z")-0.7, 0, 0, 0);
  5283. ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
  5284. ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
  5285. PlayerInfo[playerid][pBombs]--;
  5286. PlayerInfo[playerid][pC4Used] = 1;
  5287. SendClientMessageEx(playerid, COLOR_GREEN, "You have placed C4 on the ground, /pickupbomb to remove it.");
  5288. }
  5289. else
  5290. {
  5291. return SendClientMessageEx(playerid, COLOR_GRAD2, "You have exited the bomb selection menu.");
  5292. }
  5293. }
  5294. else if(extraid == 1339)
  5295. {
  5296. if(response)
  5297. {
  5298. if(GetSpecialPlayerToyCountEx(playerid, 2) > 7)
  5299. return SendClientMessageEx(playerid, COLOR_GRAD2, "You can only own up to 8 helmets.");
  5300. new i, string[144];
  5301. for(i = 0; i < MAX_PLAYERTOYS; i++)
  5302. {
  5303. if(PlayerToyInfo[playerid][i][ptModelID] == 0)
  5304. {
  5305. PlayerToyInfo[playerid][i][ptModelID] = modelid;
  5306. PlayerToyInfo[playerid][i][ptBone] = 2;
  5307. PlayerToyInfo[playerid][i][ptPosX] = 0.07;
  5308. PlayerToyInfo[playerid][i][ptPosY] = 0.0;
  5309. PlayerToyInfo[playerid][i][ptPosZ] = 0.0;
  5310. PlayerToyInfo[playerid][i][ptRotX] = 88.0;
  5311. PlayerToyInfo[playerid][i][ptRotY] = 75.0;
  5312. PlayerToyInfo[playerid][i][ptRotZ] = 0.0;
  5313. PlayerToyInfo[playerid][i][ptScaleX] = 0.0;
  5314. PlayerToyInfo[playerid][i][ptScaleY] = 0.0;
  5315. PlayerToyInfo[playerid][i][ptScaleZ] = 0.0;
  5316. PlayerToyInfo[playerid][i][ptTradable] = 1;
  5317. PlayerToyInfo[playerid][i][ptSpecial] = 2; // New special object with actual functionality
  5318. g_mysql_NewToy(playerid, i);
  5319. SetPVarInt(playerid, "ToySlot", i);
  5320. ShowEditMenu(playerid);
  5321. new iBusiness = GetPVarInt(playerid, "businessid");
  5322. new cost = GetPVarInt(playerid, "helcost");
  5323. new iItem = GetPVarInt(playerid, "item")-1;
  5324. Businesses[iBusiness][bInventory]-= StoreItemCost[iItem][ItemValue];
  5325. Businesses[iBusiness][bTotalSales]++;
  5326. Businesses[iBusiness][bSafeBalance] += TaxSale(cost);
  5327. //if(penalty) Businesses[iBusiness][bSafeBalance] -= floatround(cost * BIZ_PENALTY);
  5328. GivePlayerCash(playerid, -cost);
  5329. if (PlayerInfo[playerid][pBusiness] != InBusiness(playerid)) Businesses[iBusiness][bLevelProgress]++;
  5330. SaveBusiness(iBusiness);
  5331. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  5332. if (PlayerInfo[playerid][pDonateRank] >= 1)
  5333. {
  5334. format(string,sizeof(string),"VIP: You have received 20 percent off this product. Instead of paying $%s, you paid $%s.", number_format(Businesses[iBusiness][bItemPrices][iItem]), number_format(cost));
  5335. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  5336. }
  5337. format(string,sizeof(string),"%s(%d) (IP: %s) has bought a Helmet in %s (%d) for $%s.",GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), Businesses[iBusiness][bName], iBusiness, number_format(cost));
  5338. Log("logs/business.log", string);
  5339. format(string,sizeof(string),"* You have purchased a Helmet from %s for $%s, you can now put on your helmet with /helmet(/hm).", Businesses[iBusiness][bName], number_format(cost));
  5340. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  5341. new playersold = GetPVarInt(playerid, "playersold");
  5342. if(playersold)
  5343. {
  5344. DeletePVar(playerid, "Business_ItemType");
  5345. DeletePVar(playerid, "Business_ItemPrice");
  5346. DeletePVar(playerid, "Business_ItemOfferer");
  5347. DeletePVar(playerid, "Business_ItemOffererSQLId");
  5348. }
  5349. SendClientMessageEx(playerid, COLOR_RED, "Note: Please take note that this is an actual toy but with functionality, it does not affect your toy count and you may own multiple helmets.");
  5350. break;
  5351. }
  5352. }
  5353. if(i == MAX_PLAYERTOYS) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot have anymore toys, please delete one.");
  5354. }
  5355. else
  5356. return SendClientMessageEx(playerid, COLOR_GRAD2, "You have exited the helmet selection menu.");
  5357. }
  5358. else if(extraid == 2000)
  5359. {
  5360. if(response)
  5361. {
  5362. new toycount = GetFreeToySlot(playerid), string[144];
  5363. if(toycount == -1) return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot attach more than 10 objects, please detach one in order to use helmet.");
  5364. if(toycount == 9 && PlayerInfo[playerid][pBEquipped]) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot attach another toy to slot 10 since you have a backpack equipped.");
  5365. if(PlayerToyInfo[playerid][extralist_id][ptScaleX] == 0) {
  5366. PlayerToyInfo[playerid][extralist_id][ptScaleX] = 1.0;
  5367. PlayerToyInfo[playerid][extralist_id][ptScaleY] = 1.0;
  5368. PlayerToyInfo[playerid][extralist_id][ptScaleZ] = 1.0;
  5369. }
  5370. new name[24];
  5371. format(name, sizeof(name), "Unknown");
  5372. for(new i;i<sizeof(HoldingObjectsAll);i++)
  5373. {
  5374. if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][extralist_id][ptModelID])
  5375. {
  5376. format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
  5377. }
  5378. }
  5379. format(string, sizeof(string), "Successfully attached %s(%d) (Bone: %s) (Slot: %d)", name, PlayerToyInfo[playerid][extralist_id][ptModelID], HoldingBones[PlayerToyInfo[playerid][extralist_id][ptBone]], extralist_id);
  5380. SendClientMessageEx(playerid, COLOR_RED, string);
  5381. SetPVarInt(playerid, "HelmetOn", extralist_id);
  5382. PlayerHoldingObject[playerid][toycount] = extralist_id;
  5383. SetPlayerAttachedObject(playerid, toycount, PlayerToyInfo[playerid][extralist_id][ptModelID], PlayerToyInfo[playerid][extralist_id][ptBone], PlayerToyInfo[playerid][extralist_id][ptPosX], PlayerToyInfo[playerid][extralist_id][ptPosY], PlayerToyInfo[playerid][extralist_id][ptPosZ],
  5384. PlayerToyInfo[playerid][extralist_id][ptRotX], PlayerToyInfo[playerid][extralist_id][ptRotY], PlayerToyInfo[playerid][extralist_id][ptRotZ], PlayerToyInfo[playerid][extralist_id][ptScaleX], PlayerToyInfo[playerid][extralist_id][ptScaleY], PlayerToyInfo[playerid][extralist_id][ptScaleZ]);
  5385. Seatbelt[playerid] = 2;
  5386. format(string, sizeof(string), "{FF8000}** {C2A2DA}%s reaches for their helmet and puts it on.", GetPlayerNameEx(playerid));
  5387. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  5388. SendClientMessageEx(playerid, COLOR_WHITE, "You have put on your helmet.");
  5389. }
  5390. else
  5391. return SendClientMessageEx(playerid, COLOR_GRAD2, "You have exited the helmet selection menu.");
  5392. }
  5393. else if(extraid == DIALOG_STPATRICKSSHOP) // St Patrick's Day
  5394. {
  5395. if(!response) return 1;
  5396. new name[24] = "None";
  5397. for(new i; i < sizeof(HoldingObjectsAll); i++)
  5398. {
  5399. if(HoldingObjectsAll[i][holdingmodelid] == modelid)
  5400. {
  5401. format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
  5402. break;
  5403. }
  5404. }
  5405. format(szMiscArray, sizeof(szMiscArray),"Item: %s\nYour Credits: %s\nCost: {FFD700}150{A9C4E4}\nCredits Left: %s", name, number_format(PlayerInfo[playerid][pCredits]), number_format(PlayerInfo[playerid][pCredits]-150));
  5406. SetPVarInt(playerid, "StPatrickToy", modelid);
  5407. ShowPlayerDialogEx(playerid, DIALOG_STPATRICKSSHOP, DIALOG_STYLE_MSGBOX, "St Patrick's Day Shop", szMiscArray, "Purchase", "Exit");
  5408. }
  5409. else if(extraid == 0525) // Memorial's Day
  5410. {
  5411. if(!response) return 1;
  5412. new name[24] = "None";
  5413. for(new i; i < sizeof(HoldingObjectsAll); i++)
  5414. {
  5415. if(HoldingObjectsAll[i][holdingmodelid] == modelid)
  5416. {
  5417. format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
  5418. break;
  5419. }
  5420. }
  5421. format(szMiscArray, sizeof(szMiscArray),"Item: %s\nYour Credits: %s\nCost: {FFD700}150{A9C4E4}\nCredits Left: %s", name, number_format(PlayerInfo[playerid][pCredits]), number_format(PlayerInfo[playerid][pCredits]-150));
  5422. SetPVarInt(playerid, "MemorialToy", modelid);
  5423. ShowPlayerDialogEx(playerid, 0525, DIALOG_STYLE_MSGBOX, "Memorial's Day Shop", szMiscArray, "Purchase", "Exit");
  5424. }
  5425. /*
  5426. if(extraid == REGISTER_SKINMODEL)
  5427. {
  5428. if(response)
  5429. {
  5430. PlayerInfo[playerid][pModel] = modelid;
  5431. Register_CreatePlayer(playerid, modelid);
  5432. }
  5433. Register_MainMenu(playerid);
  5434. }
  5435. */
  5436. if(extraid == PRISON_SKINSELECT)
  5437. {
  5438. if(response)
  5439. {
  5440. if(GetPVarInt(playerid, "pPrisonSelectingSkin") == 1)
  5441. {
  5442. if(PlayerInfo[playerid][pPrisonCredits] >= 250)
  5443. {
  5444. PlayerInfo[playerid][pModel] = modelid;
  5445. PlayerInfo[playerid][pPrisonCredits] -= 250;
  5446. SetPlayerSkin(playerid, modelid);
  5447. SetPVarInt(playerid, "pPrisonSelectingSkin", 0);
  5448. SendClientMessageEx(playerid, COLOR_GREY, "You have purchased a pair of clothes from the prison shop for 500 credits.");
  5449. }
  5450. else return SendClientMessageEx(playerid, COLOR_GREY, " You do not have enough prison credits!");
  5451. }
  5452. else return 1;
  5453. }
  5454. else SetPVarInt(playerid, "pPrisonSelectingSkin", 0);
  5455. }
  5456. return 1;
  5457. }
  5458. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  5459. {
  5460. if((PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pSMod] >= 2) && source == CLICK_SOURCE_SCOREBOARD)
  5461. {
  5462. new szString[5], string[MAX_PLAYER_NAME+82];
  5463. format(szString, sizeof(szString), "%i", clickedplayerid);
  5464. format(string, sizeof(string), "Are you sure you want to offer %s a free namechange?", GetPlayerNameEx(clickedplayerid));
  5465. SetPVarString(playerid, "nrn", szString);
  5466. ShowPlayerDialogEx(playerid, DIALOG_NRNCONFIRM, DIALOG_STYLE_MSGBOX, "Confirm this NRN", string, "Yes", "No");
  5467. }
  5468. return true;
  5469. }