| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074560755607656077560785607956080560815608256083560845608556086560875608856089560905609156092560935609456095560965609756098560995610056101561025610356104561055610656107561085610956110561115611256113561145611556116561175611856119561205612156122561235612456125561265612756128561295613056131561325613356134561355613656137561385613956140561415614256143561445614556146561475614856149561505615156152561535615456155561565615756158561595616056161561625616356164561655616656167561685616956170561715617256173561745617556176561775617856179561805618156182561835618456185561865618756188561895619056191561925619356194561955619656197561985619956200562015620256203562045620556206562075620856209562105621156212562135621456215562165621756218562195622056221562225622356224562255622656227562285622956230562315623256233562345623556236562375623856239562405624156242562435624456245562465624756248562495625056251562525625356254562555625656257562585625956260562615626256263562645626556266562675626856269562705627156272562735627456275562765627756278562795628056281562825628356284562855628656287562885628956290562915629256293562945629556296562975629856299563005630156302563035630456305563065630756308563095631056311563125631356314563155631656317563185631956320563215632256323563245632556326563275632856329563305633156332563335633456335563365633756338563395634056341563425634356344563455634656347563485634956350563515635256353563545635556356563575635856359563605636156362563635636456365563665636756368563695637056371563725637356374563755637656377563785637956380563815638256383563845638556386563875638856389563905639156392563935639456395563965639756398563995640056401564025640356404564055640656407564085640956410564115641256413564145641556416564175641856419564205642156422564235642456425564265642756428564295643056431564325643356434564355643656437564385643956440564415644256443564445644556446564475644856449564505645156452564535645456455564565645756458564595646056461564625646356464564655646656467564685646956470564715647256473564745647556476564775647856479564805648156482564835648456485564865648756488564895649056491564925649356494564955649656497564985649956500565015650256503565045650556506565075650856509565105651156512565135651456515565165651756518565195652056521565225652356524565255652656527565285652956530565315653256533565345653556536565375653856539565405654156542565435654456545565465654756548565495655056551565525655356554565555655656557565585655956560565615656256563565645656556566565675656856569565705657156572565735657456575565765657756578565795658056581565825658356584565855658656587565885658956590565915659256593565945659556596565975659856599566005660156602566035660456605566065660756608566095661056611566125661356614566155661656617566185661956620566215662256623566245662556626566275662856629566305663156632566335663456635566365663756638566395664056641566425664356644566455664656647566485664956650566515665256653566545665556656566575665856659566605666156662566635666456665566665666756668566695667056671566725667356674566755667656677566785667956680566815668256683566845668556686566875668856689566905669156692566935669456695566965669756698566995670056701567025670356704567055670656707567085670956710567115671256713567145671556716567175671856719567205672156722567235672456725567265672756728567295673056731567325673356734567355673656737567385673956740567415674256743567445674556746567475674856749567505675156752567535675456755567565675756758567595676056761567625676356764567655676656767567685676956770567715677256773567745677556776567775677856779567805678156782567835678456785567865678756788567895679056791567925679356794567955679656797567985679956800568015680256803568045680556806568075680856809568105681156812568135681456815568165681756818568195682056821568225682356824568255682656827568285682956830568315683256833568345683556836568375683856839568405684156842568435684456845568465684756848568495685056851568525685356854568555685656857568585685956860568615686256863568645686556866568675686856869568705687156872568735687456875568765687756878568795688056881568825688356884568855688656887568885688956890568915689256893568945689556896568975689856899569005690156902569035690456905569065690756908569095691056911569125691356914569155691656917569185691956920569215692256923569245692556926569275692856929569305693156932569335693456935569365693756938569395694056941569425694356944569455694656947569485694956950569515695256953569545695556956569575695856959569605696156962569635696456965569665696756968569695697056971569725697356974569755697656977569785697956980569815698256983569845698556986569875698856989569905699156992569935699456995569965699756998569995700057001570025700357004570055700657007570085700957010570115701257013570145701557016570175701857019570205702157022570235702457025570265702757028570295703057031570325703357034570355703657037570385703957040570415704257043570445704557046570475704857049570505705157052570535705457055570565705757058570595706057061570625706357064570655706657067570685706957070570715707257073570745707557076570775707857079570805708157082570835708457085570865708757088570895709057091570925709357094570955709657097570985709957100571015710257103571045710557106571075710857109571105711157112571135711457115571165711757118571195712057121571225712357124571255712657127571285712957130571315713257133571345713557136571375713857139571405714157142571435714457145571465714757148571495715057151571525715357154571555715657157571585715957160571615716257163571645716557166571675716857169571705717157172571735717457175571765717757178571795718057181571825718357184571855718657187571885718957190571915719257193571945719557196571975719857199572005720157202572035720457205572065720757208572095721057211572125721357214572155721657217572185721957220572215722257223572245722557226572275722857229572305723157232572335723457235572365723757238572395724057241572425724357244572455724657247572485724957250572515725257253572545725557256572575725857259572605726157262572635726457265572665726757268572695727057271572725727357274572755727657277572785727957280572815728257283572845728557286572875728857289572905729157292572935729457295572965729757298572995730057301573025730357304573055730657307573085730957310573115731257313573145731557316573175731857319573205732157322573235732457325573265732757328573295733057331573325733357334573355733657337573385733957340573415734257343573445734557346573475734857349573505735157352573535735457355573565735757358573595736057361573625736357364573655736657367573685736957370573715737257373573745737557376573775737857379573805738157382573835738457385573865738757388573895739057391573925739357394573955739657397573985739957400574015740257403574045740557406574075740857409574105741157412574135741457415574165741757418574195742057421574225742357424574255742657427574285742957430574315743257433574345743557436574375743857439574405744157442574435744457445574465744757448574495745057451574525745357454574555745657457574585745957460574615746257463574645746557466574675746857469574705747157472574735747457475574765747757478574795748057481574825748357484574855748657487574885748957490574915749257493574945749557496574975749857499575005750157502575035750457505575065750757508575095751057511575125751357514575155751657517575185751957520575215752257523575245752557526575275752857529575305753157532575335753457535575365753757538575395754057541575425754357544575455754657547575485754957550575515755257553575545755557556575575755857559575605756157562575635756457565575665756757568575695757057571575725757357574575755757657577575785757957580575815758257583575845758557586575875758857589575905759157592575935759457595575965759757598575995760057601576025760357604576055760657607576085760957610576115761257613576145761557616576175761857619576205762157622576235762457625576265762757628576295763057631576325763357634576355763657637576385763957640576415764257643576445764557646576475764857649576505765157652576535765457655576565765757658576595766057661576625766357664576655766657667576685766957670576715767257673576745767557676576775767857679576805768157682576835768457685576865768757688576895769057691576925769357694576955769657697576985769957700577015770257703577045770557706577075770857709577105771157712577135771457715577165771757718577195772057721577225772357724577255772657727577285772957730577315773257733577345773557736577375773857739577405774157742577435774457745577465774757748577495775057751577525775357754577555775657757577585775957760577615776257763577645776557766577675776857769577705777157772577735777457775577765777757778577795778057781577825778357784577855778657787577885778957790577915779257793577945779557796577975779857799578005780157802578035780457805578065780757808578095781057811578125781357814578155781657817578185781957820578215782257823578245782557826578275782857829578305783157832578335783457835578365783757838578395784057841578425784357844578455784657847578485784957850578515785257853578545785557856578575785857859578605786157862578635786457865578665786757868578695787057871578725787357874578755787657877578785787957880578815788257883578845788557886578875788857889578905789157892578935789457895578965789757898578995790057901579025790357904579055790657907579085790957910579115791257913579145791557916579175791857919579205792157922579235792457925579265792757928579295793057931579325793357934579355793657937579385793957940579415794257943579445794557946579475794857949579505795157952579535795457955579565795757958579595796057961579625796357964579655796657967579685796957970579715797257973579745797557976579775797857979579805798157982579835798457985579865798757988579895799057991579925799357994579955799657997579985799958000580015800258003580045800558006580075800858009580105801158012580135801458015580165801758018580195802058021580225802358024580255802658027580285802958030580315803258033580345803558036580375803858039580405804158042580435804458045580465804758048580495805058051580525805358054580555805658057580585805958060580615806258063580645806558066580675806858069580705807158072580735807458075580765807758078580795808058081580825808358084580855808658087580885808958090580915809258093580945809558096580975809858099581005810158102581035810458105581065810758108581095811058111581125811358114581155811658117581185811958120581215812258123581245812558126581275812858129581305813158132581335813458135581365813758138581395814058141581425814358144581455814658147581485814958150581515815258153581545815558156581575815858159581605816158162581635816458165581665816758168581695817058171581725817358174581755817658177581785817958180581815818258183581845818558186581875818858189581905819158192581935819458195581965819758198581995820058201582025820358204582055820658207582085820958210582115821258213582145821558216582175821858219582205822158222582235822458225582265822758228582295823058231582325823358234582355823658237582385823958240582415824258243582445824558246582475824858249582505825158252582535825458255582565825758258582595826058261582625826358264582655826658267582685826958270582715827258273582745827558276582775827858279582805828158282582835828458285582865828758288582895829058291582925829358294582955829658297582985829958300583015830258303583045830558306583075830858309583105831158312583135831458315583165831758318583195832058321583225832358324583255832658327583285832958330583315833258333583345833558336583375833858339583405834158342583435834458345583465834758348583495835058351583525835358354583555835658357583585835958360583615836258363583645836558366583675836858369583705837158372583735837458375583765837758378583795838058381583825838358384583855838658387583885838958390583915839258393583945839558396583975839858399584005840158402584035840458405584065840758408584095841058411584125841358414584155841658417584185841958420584215842258423584245842558426584275842858429584305843158432584335843458435584365843758438584395844058441584425844358444584455844658447584485844958450584515845258453584545845558456584575845858459584605846158462584635846458465584665846758468584695847058471584725847358474584755847658477584785847958480584815848258483584845848558486584875848858489584905849158492584935849458495584965849758498584995850058501585025850358504585055850658507585085850958510585115851258513585145851558516585175851858519585205852158522585235852458525585265852758528585295853058531585325853358534585355853658537585385853958540585415854258543585445854558546585475854858549585505855158552585535855458555585565855758558585595856058561585625856358564585655856658567585685856958570585715857258573585745857558576585775857858579585805858158582585835858458585585865858758588585895859058591585925859358594585955859658597585985859958600586015860258603586045860558606586075860858609586105861158612586135861458615586165861758618586195862058621586225862358624586255862658627586285862958630586315863258633586345863558636586375863858639586405864158642586435864458645586465864758648586495865058651586525865358654586555865658657586585865958660586615866258663586645866558666586675866858669586705867158672586735867458675586765867758678586795868058681586825868358684586855868658687586885868958690586915869258693586945869558696586975869858699587005870158702587035870458705587065870758708587095871058711587125871358714587155871658717587185871958720587215872258723587245872558726587275872858729587305873158732587335873458735587365873758738587395874058741587425874358744587455874658747587485874958750587515875258753587545875558756587575875858759587605876158762587635876458765587665876758768587695877058771587725877358774587755877658777587785877958780587815878258783587845878558786587875878858789587905879158792587935879458795587965879758798587995880058801588025880358804588055880658807588085880958810588115881258813588145881558816588175881858819588205882158822588235882458825588265882758828588295883058831588325883358834588355883658837588385883958840588415884258843588445884558846588475884858849588505885158852588535885458855588565885758858588595886058861588625886358864588655886658867588685886958870588715887258873588745887558876588775887858879588805888158882588835888458885588865888758888588895889058891588925889358894588955889658897588985889958900589015890258903589045890558906589075890858909589105891158912589135891458915589165891758918589195892058921589225892358924589255892658927589285892958930589315893258933589345893558936589375893858939589405894158942589435894458945589465894758948589495895058951589525895358954589555895658957589585895958960589615896258963589645896558966589675896858969589705897158972589735897458975589765897758978589795898058981589825898358984589855898658987589885898958990589915899258993589945899558996589975899858999590005900159002590035900459005590065900759008590095901059011590125901359014590155901659017590185901959020590215902259023590245902559026590275902859029590305903159032590335903459035590365903759038590395904059041590425904359044590455904659047590485904959050590515905259053590545905559056590575905859059590605906159062590635906459065590665906759068590695907059071590725907359074590755907659077590785907959080590815908259083590845908559086590875908859089590905909159092590935909459095590965909759098590995910059101591025910359104591055910659107591085910959110591115911259113591145911559116591175911859119591205912159122591235912459125591265912759128591295913059131591325913359134591355913659137591385913959140591415914259143591445914559146591475914859149591505915159152591535915459155591565915759158591595916059161591625916359164591655916659167591685916959170591715917259173591745917559176591775917859179591805918159182591835918459185591865918759188591895919059191591925919359194591955919659197591985919959200592015920259203592045920559206592075920859209592105921159212592135921459215592165921759218592195922059221592225922359224592255922659227592285922959230592315923259233592345923559236592375923859239592405924159242592435924459245592465924759248592495925059251592525925359254592555925659257592585925959260592615926259263592645926559266592675926859269592705927159272592735927459275592765927759278592795928059281592825928359284592855928659287592885928959290592915929259293592945929559296592975929859299593005930159302593035930459305593065930759308593095931059311593125931359314593155931659317593185931959320593215932259323593245932559326593275932859329593305933159332593335933459335593365933759338593395934059341593425934359344593455934659347593485934959350593515935259353593545935559356593575935859359593605936159362593635936459365593665936759368593695937059371593725937359374593755937659377593785937959380593815938259383593845938559386593875938859389593905939159392593935939459395593965939759398593995940059401594025940359404594055940659407594085940959410594115941259413594145941559416594175941859419594205942159422594235942459425594265942759428594295943059431594325943359434594355943659437594385943959440594415944259443594445944559446594475944859449594505945159452594535945459455594565945759458594595946059461594625946359464594655946659467594685946959470594715947259473594745947559476594775947859479594805948159482594835948459485594865948759488594895949059491594925949359494594955949659497594985949959500595015950259503595045950559506595075950859509595105951159512595135951459515595165951759518595195952059521595225952359524595255952659527595285952959530595315953259533595345953559536595375953859539595405954159542595435954459545595465954759548595495955059551595525955359554595555955659557595585955959560595615956259563595645956559566595675956859569595705957159572595735957459575595765957759578595795958059581595825958359584595855958659587595885958959590595915959259593595945959559596595975959859599596005960159602596035960459605596065960759608596095961059611596125961359614596155961659617596185961959620596215962259623596245962559626596275962859629596305963159632596335963459635596365963759638596395964059641596425964359644596455964659647596485964959650596515965259653596545965559656596575965859659596605966159662596635966459665596665966759668596695967059671596725967359674596755967659677596785967959680596815968259683596845968559686596875968859689596905969159692596935969459695596965969759698596995970059701597025970359704597055970659707597085970959710597115971259713597145971559716597175971859719597205972159722597235972459725597265972759728597295973059731597325973359734597355973659737597385973959740597415974259743597445974559746597475974859749597505975159752597535975459755597565975759758597595976059761597625976359764597655976659767597685976959770597715977259773597745977559776597775977859779597805978159782597835978459785597865978759788597895979059791597925979359794597955979659797597985979959800598015980259803598045980559806598075980859809598105981159812598135981459815598165981759818598195982059821598225982359824598255982659827598285982959830598315983259833598345983559836598375983859839598405984159842598435984459845598465984759848598495985059851598525985359854598555985659857598585985959860598615986259863598645986559866598675986859869598705987159872598735987459875598765987759878598795988059881598825988359884598855988659887598885988959890598915989259893598945989559896598975989859899599005990159902599035990459905599065990759908599095991059911599125991359914599155991659917599185991959920599215992259923599245992559926599275992859929599305993159932599335993459935599365993759938599395994059941599425994359944599455994659947599485994959950599515995259953599545995559956599575995859959599605996159962599635996459965599665996759968599695997059971599725997359974599755997659977599785997959980599815998259983599845998559986599875998859989599905999159992599935999459995599965999759998599996000060001600026000360004600056000660007600086000960010600116001260013600146001560016600176001860019600206002160022600236002460025600266002760028600296003060031600326003360034600356003660037600386003960040600416004260043600446004560046600476004860049600506005160052600536005460055600566005760058600596006060061600626006360064600656006660067600686006960070600716007260073600746007560076600776007860079600806008160082600836008460085600866008760088600896009060091600926009360094600956009660097600986009960100601016010260103601046010560106601076010860109601106011160112601136011460115601166011760118601196012060121601226012360124601256012660127601286012960130601316013260133601346013560136601376013860139601406014160142601436014460145601466014760148601496015060151601526015360154601556015660157601586015960160601616016260163601646016560166601676016860169601706017160172601736017460175601766017760178601796018060181601826018360184601856018660187601886018960190601916019260193601946019560196601976019860199602006020160202602036020460205602066020760208602096021060211602126021360214602156021660217602186021960220602216022260223602246022560226602276022860229602306023160232602336023460235602366023760238602396024060241602426024360244602456024660247602486024960250602516025260253602546025560256602576025860259602606026160262602636026460265602666026760268602696027060271602726027360274602756027660277602786027960280602816028260283602846028560286602876028860289602906029160292602936029460295602966029760298602996030060301603026030360304603056030660307603086030960310603116031260313603146031560316603176031860319603206032160322603236032460325603266032760328603296033060331603326033360334603356033660337603386033960340603416034260343603446034560346603476034860349603506035160352603536035460355603566035760358603596036060361603626036360364603656036660367603686036960370603716037260373603746037560376603776037860379603806038160382603836038460385603866038760388603896039060391603926039360394603956039660397603986039960400604016040260403604046040560406604076040860409604106041160412604136041460415604166041760418604196042060421604226042360424604256042660427604286042960430604316043260433604346043560436604376043860439604406044160442604436044460445604466044760448604496045060451604526045360454604556045660457604586045960460604616046260463604646046560466604676046860469604706047160472604736047460475604766047760478604796048060481604826048360484604856048660487604886048960490604916049260493604946049560496604976049860499605006050160502605036050460505605066050760508605096051060511605126051360514605156051660517605186051960520605216052260523605246052560526605276052860529605306053160532605336053460535605366053760538605396054060541605426054360544605456054660547605486054960550605516055260553605546055560556605576055860559605606056160562605636056460565605666056760568605696057060571605726057360574605756057660577605786057960580605816058260583605846058560586605876058860589605906059160592605936059460595605966059760598605996060060601606026060360604606056060660607606086060960610606116061260613606146061560616606176061860619606206062160622606236062460625606266062760628606296063060631606326063360634606356063660637606386063960640606416064260643606446064560646606476064860649606506065160652606536065460655606566065760658606596066060661606626066360664606656066660667606686066960670606716067260673606746067560676606776067860679606806068160682606836068460685606866068760688606896069060691606926069360694606956069660697606986069960700607016070260703607046070560706607076070860709607106071160712607136071460715607166071760718607196072060721607226072360724607256072660727607286072960730607316073260733607346073560736607376073860739607406074160742607436074460745607466074760748607496075060751607526075360754607556075660757607586075960760607616076260763607646076560766607676076860769607706077160772607736077460775607766077760778607796078060781607826078360784607856078660787607886078960790607916079260793607946079560796607976079860799608006080160802608036080460805608066080760808608096081060811608126081360814608156081660817608186081960820608216082260823608246082560826608276082860829608306083160832608336083460835608366083760838608396084060841608426084360844608456084660847608486084960850608516085260853608546085560856608576085860859608606086160862608636086460865608666086760868608696087060871608726087360874608756087660877608786087960880608816088260883608846088560886608876088860889608906089160892608936089460895608966089760898608996090060901609026090360904609056090660907609086090960910609116091260913609146091560916609176091860919609206092160922609236092460925609266092760928609296093060931609326093360934609356093660937609386093960940609416094260943609446094560946609476094860949609506095160952609536095460955609566095760958609596096060961609626096360964609656096660967609686096960970609716097260973609746097560976609776097860979609806098160982609836098460985609866098760988609896099060991609926099360994609956099660997609986099961000610016100261003610046100561006610076100861009610106101161012610136101461015610166101761018610196102061021610226102361024610256102661027610286102961030610316103261033610346103561036610376103861039610406104161042610436104461045610466104761048610496105061051610526105361054610556105661057610586105961060610616106261063610646106561066610676106861069610706107161072610736107461075610766107761078610796108061081610826108361084610856108661087610886108961090610916109261093610946109561096610976109861099611006110161102611036110461105611066110761108611096111061111611126111361114611156111661117611186111961120611216112261123611246112561126611276112861129611306113161132611336113461135611366113761138611396114061141611426114361144611456114661147611486114961150611516115261153611546115561156611576115861159611606116161162611636116461165611666116761168611696117061171611726117361174611756117661177611786117961180611816118261183611846118561186611876118861189611906119161192611936119461195611966119761198611996120061201612026120361204612056120661207612086120961210612116121261213612146121561216612176121861219612206122161222612236122461225612266122761228612296123061231612326123361234612356123661237612386123961240612416124261243612446124561246612476124861249612506125161252612536125461255612566125761258612596126061261612626126361264612656126661267612686126961270612716127261273612746127561276612776127861279612806128161282612836128461285612866128761288612896129061291612926129361294612956129661297612986129961300613016130261303613046130561306613076130861309613106131161312613136131461315613166131761318613196132061321613226132361324613256132661327613286132961330613316133261333613346133561336613376133861339613406134161342613436134461345613466134761348613496135061351613526135361354613556135661357613586135961360613616136261363613646136561366613676136861369613706137161372613736137461375613766137761378613796138061381613826138361384613856138661387613886138961390613916139261393613946139561396613976139861399614006140161402614036140461405614066140761408614096141061411614126141361414614156141661417614186141961420614216142261423614246142561426614276142861429614306143161432614336143461435614366143761438614396144061441614426144361444614456144661447614486144961450614516145261453614546145561456614576145861459614606146161462614636146461465614666146761468614696147061471614726147361474614756147661477614786147961480614816148261483614846148561486614876148861489614906149161492614936149461495614966149761498614996150061501615026150361504615056150661507615086150961510615116151261513615146151561516615176151861519615206152161522615236152461525615266152761528615296153061531615326153361534615356153661537615386153961540615416154261543615446154561546615476154861549615506155161552615536155461555615566155761558615596156061561615626156361564615656156661567615686156961570615716157261573615746157561576615776157861579615806158161582615836158461585615866158761588615896159061591615926159361594615956159661597615986159961600616016160261603616046160561606616076160861609616106161161612616136161461615616166161761618616196162061621616226162361624616256162661627616286162961630616316163261633616346163561636616376163861639616406164161642616436164461645616466164761648616496165061651616526165361654616556165661657616586165961660616616166261663616646166561666616676166861669616706167161672616736167461675616766167761678616796168061681616826168361684616856168661687616886168961690616916169261693616946169561696616976169861699617006170161702617036170461705617066170761708617096171061711617126171361714617156171661717617186171961720617216172261723617246172561726617276172861729617306173161732617336173461735617366173761738617396174061741617426174361744617456174661747617486174961750617516175261753617546175561756617576175861759617606176161762617636176461765617666176761768617696177061771617726177361774617756177661777617786177961780617816178261783617846178561786617876178861789617906179161792617936179461795617966179761798617996180061801618026180361804618056180661807618086180961810618116181261813618146181561816618176181861819618206182161822618236182461825618266182761828618296183061831618326183361834618356183661837618386183961840618416184261843618446184561846618476184861849618506185161852618536185461855618566185761858618596186061861618626186361864618656186661867618686186961870618716187261873618746187561876618776187861879618806188161882618836188461885618866188761888618896189061891618926189361894618956189661897618986189961900619016190261903619046190561906619076190861909619106191161912619136191461915619166191761918619196192061921619226192361924619256192661927619286192961930619316193261933619346193561936619376193861939619406194161942619436194461945619466194761948619496195061951619526195361954619556195661957619586195961960619616196261963619646196561966619676196861969619706197161972619736197461975619766197761978619796198061981619826198361984619856198661987619886198961990619916199261993619946199561996619976199861999620006200162002620036200462005620066200762008620096201062011620126201362014620156201662017620186201962020620216202262023620246202562026620276202862029620306203162032620336203462035620366203762038620396204062041620426204362044620456204662047620486204962050620516205262053620546205562056620576205862059620606206162062620636206462065620666206762068620696207062071620726207362074620756207662077620786207962080620816208262083620846208562086620876208862089620906209162092620936209462095620966209762098620996210062101621026210362104621056210662107621086210962110621116211262113621146211562116621176211862119621206212162122621236212462125621266212762128621296213062131621326213362134621356213662137621386213962140621416214262143621446214562146621476214862149621506215162152621536215462155621566215762158621596216062161621626216362164621656216662167621686216962170621716217262173621746217562176621776217862179621806218162182621836218462185621866218762188621896219062191621926219362194621956219662197621986219962200622016220262203622046220562206622076220862209622106221162212622136221462215622166221762218622196222062221622226222362224622256222662227622286222962230622316223262233622346223562236622376223862239622406224162242622436224462245622466224762248622496225062251622526225362254622556225662257622586225962260622616226262263622646226562266622676226862269622706227162272622736227462275622766227762278622796228062281622826228362284622856228662287622886228962290622916229262293622946229562296622976229862299623006230162302623036230462305623066230762308623096231062311623126231362314623156231662317623186231962320623216232262323623246232562326623276232862329623306233162332623336233462335623366233762338623396234062341623426234362344623456234662347623486234962350623516235262353623546235562356623576235862359623606236162362623636236462365623666236762368623696237062371623726237362374623756237662377623786237962380623816238262383623846238562386623876238862389623906239162392623936239462395623966239762398623996240062401624026240362404624056240662407624086240962410624116241262413624146241562416624176241862419624206242162422624236242462425624266242762428624296243062431624326243362434624356243662437624386243962440624416244262443624446244562446624476244862449624506245162452624536245462455624566245762458624596246062461624626246362464624656246662467624686246962470624716247262473624746247562476624776247862479624806248162482624836248462485624866248762488624896249062491624926249362494624956249662497624986249962500625016250262503625046250562506625076250862509625106251162512625136251462515625166251762518625196252062521625226252362524625256252662527625286252962530625316253262533625346253562536625376253862539625406254162542625436254462545625466254762548625496255062551625526255362554625556255662557625586255962560625616256262563625646256562566625676256862569625706257162572625736257462575625766257762578625796258062581625826258362584625856258662587625886258962590625916259262593625946259562596625976259862599626006260162602626036260462605626066260762608626096261062611626126261362614626156261662617626186261962620626216262262623626246262562626626276262862629626306263162632626336263462635626366263762638626396264062641626426264362644626456264662647626486264962650626516265262653626546265562656626576265862659626606266162662626636266462665626666266762668626696267062671626726267362674626756267662677626786267962680626816268262683626846268562686626876268862689626906269162692626936269462695626966269762698626996270062701627026270362704627056270662707627086270962710627116271262713627146271562716627176271862719627206272162722627236272462725627266272762728627296273062731627326273362734627356273662737627386273962740627416274262743627446274562746627476274862749627506275162752627536275462755627566275762758627596276062761627626276362764627656276662767627686276962770627716277262773627746277562776627776277862779627806278162782627836278462785627866278762788627896279062791627926279362794627956279662797627986279962800628016280262803628046280562806628076280862809628106281162812628136281462815628166281762818628196282062821628226282362824628256282662827628286282962830628316283262833628346283562836628376283862839628406284162842628436284462845628466284762848628496285062851628526285362854628556285662857628586285962860628616286262863628646286562866628676286862869628706287162872628736287462875628766287762878628796288062881628826288362884628856288662887628886288962890628916289262893628946289562896628976289862899629006290162902629036290462905629066290762908629096291062911629126291362914629156291662917629186291962920629216292262923629246292562926629276292862929629306293162932629336293462935629366293762938629396294062941629426294362944629456294662947629486294962950629516295262953629546295562956629576295862959629606296162962629636296462965629666296762968629696297062971629726297362974629756297662977629786297962980629816298262983629846298562986629876298862989629906299162992629936299462995629966299762998629996300063001630026300363004630056300663007630086300963010630116301263013630146301563016630176301863019630206302163022630236302463025630266302763028630296303063031630326303363034630356303663037630386303963040630416304263043630446304563046630476304863049630506305163052630536305463055630566305763058630596306063061630626306363064630656306663067630686306963070630716307263073630746307563076630776307863079630806308163082630836308463085630866308763088630896309063091630926309363094630956309663097630986309963100631016310263103631046310563106631076310863109631106311163112631136311463115631166311763118631196312063121631226312363124631256312663127631286312963130631316313263133631346313563136631376313863139631406314163142631436314463145631466314763148631496315063151631526315363154631556315663157631586315963160631616316263163631646316563166631676316863169631706317163172631736317463175631766317763178631796318063181631826318363184631856318663187631886318963190631916319263193631946319563196631976319863199632006320163202632036320463205632066320763208632096321063211632126321363214632156321663217632186321963220632216322263223632246322563226632276322863229632306323163232632336323463235632366323763238632396324063241632426324363244632456324663247632486324963250632516325263253632546325563256632576325863259632606326163262632636326463265632666326763268632696327063271632726327363274632756327663277632786327963280632816328263283632846328563286632876328863289632906329163292632936329463295632966329763298632996330063301633026330363304633056330663307633086330963310633116331263313633146331563316633176331863319633206332163322633236332463325633266332763328633296333063331633326333363334633356333663337633386333963340633416334263343633446334563346633476334863349633506335163352633536335463355633566335763358633596336063361633626336363364633656336663367633686336963370633716337263373633746337563376633776337863379633806338163382633836338463385633866338763388633896339063391633926339363394633956339663397633986339963400634016340263403634046340563406634076340863409634106341163412634136341463415634166341763418634196342063421634226342363424634256342663427634286342963430634316343263433634346343563436634376343863439634406344163442634436344463445634466344763448634496345063451634526345363454634556345663457634586345963460634616346263463634646346563466634676346863469634706347163472634736347463475634766347763478634796348063481634826348363484634856348663487634886348963490634916349263493634946349563496634976349863499635006350163502635036350463505635066350763508635096351063511635126351363514635156351663517635186351963520635216352263523635246352563526635276352863529635306353163532635336353463535635366353763538635396354063541635426354363544635456354663547635486354963550635516355263553635546355563556635576355863559635606356163562635636356463565635666356763568635696357063571635726357363574635756357663577635786357963580635816358263583635846358563586635876358863589635906359163592635936359463595635966359763598635996360063601636026360363604636056360663607636086360963610636116361263613636146361563616636176361863619636206362163622636236362463625636266362763628636296363063631636326363363634636356363663637636386363963640636416364263643636446364563646636476364863649636506365163652636536365463655636566365763658636596366063661636626366363664636656366663667636686366963670636716367263673636746367563676636776367863679636806368163682636836368463685636866368763688636896369063691636926369363694636956369663697636986369963700637016370263703637046370563706637076370863709637106371163712637136371463715637166371763718637196372063721637226372363724637256372663727637286372963730637316373263733637346373563736637376373863739637406374163742637436374463745637466374763748637496375063751637526375363754637556375663757637586375963760637616376263763637646376563766637676376863769637706377163772637736377463775637766377763778637796378063781637826378363784637856378663787637886378963790637916379263793637946379563796637976379863799638006380163802638036380463805638066380763808638096381063811638126381363814638156381663817638186381963820638216382263823638246382563826638276382863829638306383163832638336383463835638366383763838638396384063841638426384363844638456384663847638486384963850638516385263853638546385563856638576385863859638606386163862638636386463865638666386763868638696387063871638726387363874638756387663877638786387963880638816388263883638846388563886638876388863889638906389163892638936389463895638966389763898638996390063901639026390363904639056390663907639086390963910639116391263913639146391563916639176391863919639206392163922639236392463925639266392763928639296393063931639326393363934639356393663937639386393963940639416394263943639446394563946639476394863949639506395163952639536395463955639566395763958639596396063961639626396363964639656396663967639686396963970639716397263973639746397563976639776397863979639806398163982639836398463985639866398763988639896399063991639926399363994639956399663997639986399964000640016400264003640046400564006640076400864009640106401164012640136401464015640166401764018640196402064021640226402364024640256402664027640286402964030640316403264033640346403564036640376403864039640406404164042640436404464045640466404764048640496405064051640526405364054640556405664057640586405964060640616406264063640646406564066640676406864069640706407164072640736407464075640766407764078640796408064081640826408364084640856408664087640886408964090640916409264093640946409564096640976409864099641006410164102641036410464105641066410764108641096411064111641126411364114641156411664117641186411964120641216412264123641246412564126641276412864129641306413164132641336413464135641366413764138641396414064141641426414364144641456414664147641486414964150641516415264153641546415564156641576415864159641606416164162641636416464165641666416764168641696417064171641726417364174641756417664177641786417964180641816418264183641846418564186641876418864189641906419164192641936419464195641966419764198641996420064201642026420364204642056420664207642086420964210642116421264213642146421564216642176421864219642206422164222642236422464225642266422764228642296423064231642326423364234642356423664237642386423964240642416424264243642446424564246642476424864249642506425164252642536425464255642566425764258642596426064261642626426364264642656426664267642686426964270642716427264273642746427564276642776427864279642806428164282642836428464285642866428764288642896429064291642926429364294642956429664297642986429964300643016430264303643046430564306643076430864309643106431164312643136431464315643166431764318643196432064321643226432364324643256432664327643286432964330643316433264333643346433564336643376433864339643406434164342643436434464345643466434764348643496435064351643526435364354643556435664357643586435964360643616436264363643646436564366643676436864369643706437164372643736437464375643766437764378643796438064381643826438364384643856438664387643886438964390643916439264393643946439564396643976439864399644006440164402644036440464405644066440764408644096441064411644126441364414644156441664417644186441964420644216442264423644246442564426644276442864429644306443164432644336443464435644366443764438644396444064441644426444364444644456444664447644486444964450644516445264453644546445564456644576445864459644606446164462644636446464465644666446764468644696447064471644726447364474644756447664477644786447964480644816448264483644846448564486644876448864489644906449164492644936449464495644966449764498644996450064501645026450364504645056450664507645086450964510645116451264513645146451564516645176451864519645206452164522645236452464525645266452764528645296453064531645326453364534645356453664537645386453964540645416454264543645446454564546645476454864549645506455164552645536455464555645566455764558645596456064561645626456364564 |
- //================================================================================//
- // ____ ____ _____ _____ _ _ ____ ___ ____ _____
- // / ___| | _ \ | ____| | ____| | \ | | / ___| |_ _| | _ \ | ____|
- // | | _ | |_) | | _| | _| | \| | \___ \ | | | | | | | _|
- // | |_| | | _ < | |___ | |___ | |\ | ___) | | | | |_| | | |___
- // \____| |_| \_\ |_____| |_____| |_| \_| |____/ |___| |____/ |_____|
- //================================================================================//
- #include <a_samp>
- #undef MAX_PLAYERS
- #define MAX_PLAYERS (50 + 1) //+1 for NPC bot, i like to separate the two values for easier reading or something.
- #include <streamer>
- #include <sscanf2>
- #include <foreach>
- #include <a_mysql>
- #include <zcmd>
- #include <easyDialog>
- #include <fade>
- #include <sort>
- #include <tommyb_lookup>
- #include <eSelection>
- #include <d-connector>
- // Database Servers
- #define DB_SERVER_LOCAL 0
- #define DB_SERVER_DEV 1
- #define DB_SERVER_MAIN 2
- #define DB_SERVER DB_SERVER_DEV
- // Dynamic memory (in cells) allocated for the script
- #pragma dynamic 1450000
- //-- Colors ------------------------------------------------------------------
- #define COL_NICEGREEN "{6EF83C}"
- #define LRED "{E3496F}"
- #define COL_WHITE "{FFFFFF}"
- #define COL_NICERED "{FF0606}"
- #define COL_GREY "{C3C3C3}"
- #define COL_FURNGREEN "{BCDCBC}"
- #define COL_MONEYGREEN "{4BB74C}"
- #define ECOLOR_OOC "{A2C8DC}"
- #define COLOR_STAT1 0xE0FFFFAA
- #define COLOR_STAT2 0xCCE6E6FF
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_GRAD2 0xBFC0C2FF
- #define COLOR_RED 0xFF0000FF
- #define COLOR_LIGHTRED 0xFF4753FF
- #define COLOR_BLUE 0x2735FFFF
- #define COLOR_LIGHTBLUE 0x009FFBFF
- #define COLOR_GREEN 0x009000FF
- #define COLOR_LIGHTGREEN 0x00FF00FF
- #define COLOR_YELLOW 0xFBFF00FF
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_PURPLE 0x6B00FFFF
- #define COLOR_BLACK 0x000000FF
- #define COLOR_TURQUOISE 0x00CDC6FF
- #define COLOR_GOLD 0xFFD700FF
- #define COLOR_EMOTE 0xC2A2DAAA
- #define COLOR_MAGENTA 0xFF00FBFF
- #define COLOR_GREY 0x636A76FF
- #define COLOR_OOC 0xA2C8DCFF
- #define COLOR_ORANGE 0xFFA900FF
- #define COLOR_SYSTEM 0xEFEFF7AA
- #define COLOR_PINK 0xFF72DBFF
- #define COLOR_FADE1 0xE6E6E6E6
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_FADE3 0xAAAAAAAA
- #define COLOR_FADE4 0x8C8C8C8C
- #define COLOR_FADE5 0x6E6E6E6E
- #define COLOR_DONATE 0xE0BA2A00
- #define COLOR_PM 0xFFFF5FFF
- #define COLOR_DARKBLUE 0x004FE7FF
- #define COLOR_SKYBLUE 0x6896F1FF
- #define COLOR_SIGN 0xDDDFDCFF
- #define COLOR_BLUEGREEN 0x71D19CFF
- #define COLOR_WEED 0x50C878FF
- #define SendClientMessageF(%1,%2,%3) SendClientMessage(%1, %2, (format(sgstr, sizeof(sgstr), %3), sgstr))
- #define SendClientMessageToAllF(%1,%2) SendClientMessageToAll(%1, (format(sgstr, sizeof(sgstr), %2), sgstr))
- #define SysMsgF(%1,%2) SysMsg(%1, (format(sgstr, sizeof(sgstr), %2), sgstr))
- #define SendSplitMessageF(%1,%2,%3) SendSplitMessage(%1, %2, (format(sgstr, sizeof(sgstr), %3), sgstr))
- #define SendClientMessageToAllLoggedF(%1,%2) SendClientMessageToAllLogged(%1, (format(sgstr, sizeof(sgstr), %2), sgstr))
- //#define IRC_SayF(%1,%2,%3) IRC_Say(%1, %2, (format(sgstr, sizeof(sgstr), %3), sgstr))
- //#define SysMsgIRCF(%1,%2,%3) SysMsgIRC(%1, %2, (format(sgstr, sizeof(sgstr), %3), sgstr))
- #define mysql_pqueryf(%1,%2) mysql_pquery(%1, (mysql_format(conn, mquery, sizeof(mquery), %2), mquery))
- #define mysql_queryf(%1,%2) mysql_query(%1, (mysql_format(conn, mquery, sizeof(mquery), %2), mquery))
- #define GREENSIDE::%0(%1) forward %0(%1); public %0(%1)
- #define COLOR_RGB(%1,%2,%3,%4) (((((%1) & 0xff) << 24) | (((%2) & 0xff) << 16) | (((%3) & 0xff) << 8) | ((%4) & 0xff)))
- //-- Factions ------------------------------------------------------------------
- #define FACTION_NONE (0)
- #define FACTION_COP (1)
- //2 unused
- #define FACTION_PROP (3)
- //4 unused
- //5 unused
- #define FACTION_NEWS (6)
- #define FACTION_RESEARCH (7)
- #define FACTION_SACFD (10)
- //11 unused
- #define FACTION_TRUCKING (13)
- #define JOB_MECHANIC (1)
- #define JOB_DRUGDEALER (2)
- #define JOB_TAXI (3)
- #define DRUG_MAX_WEED (1000)
- #define DRUG_PRICE_WEED (150)
- #define DRUG_MAX_COCAINE (1000)
- #define DRUG_PRICE_COCAINE (300)
- #define DRUG_MAX_MOONSHINE (10)
- #define DRUG_PRICE_MOONSHINE (200)
- #define WEED_OBJECT_POT (2203)
- #define WEED_OBJECT_GROWN (2241)
- //-- Server Information --------------------------------------------------------
- #define GAMEMODE "G"
- #define VERSION "1.0"
- #define MYSQL_DEBUG_MODE true
- #define SERVER_LOGS_ON true
- #define DEBUG_OBJECT_DELETE false
- #define DEBUG_VEHICLE_DELETE false
- //Messages, etc
- #define AUTHMSG "You are not authorized to use this command."
- #define CMDFMSG "The command you entered was not recognized. You can get assistance with commands in /help or use /assistance to contact a helper."
- #define NOPLAYER "The player you tried to find is not connected to the server."
- #define FURNEDITSTR "Edit Placement\nEdit Texture\nRemove Texture\nEdit Texture Color\nRemove Texture Color\nSnap an Object\nDuplicate\nAlign\nNudge\nPut Away"
- #define WEEDSTR "Plant Weed\nCheck Weed\nHarvest Weed\nWater Weed"
- #define OFURNEDITSTR "Edit Placement\nSnap an Object\nDuplicate\nAlign\nPut Away"
- #define WEEDEDITSTR (FURNEDITSTR "\n \n" WEEDSTR)
- //-- Misc Stuff ----------------------------------------------------------------
- #undef MAX_VEHICLES
- #define MAX_WEAPON_HITS (50)
- #define PHONE_TEXT_COST (1)
- #define PHONE_CALL_COST (2)
- #define MAX_HOUSES (800)
- #define MAX_GARAGES (150)
- #define MAX_FURNITURE (1200)
- #define MAX_EHFURNITURE (5)
- #define MAX_HFURNITURE (500)
- #define MAX_TEXTURESLOTS (3)
- #define MAX_BIZZ (220)
- #define MAX_VEH_PER_PLAYER (5)
- #define MAX_BIZZ_PER_PLAYER (2)
- #define MAX_HOUSE_PER_PLAYER (2)
- #define MAX_BUYVEHS (MAX_PLAYERS)
- #define MAX_SQLPICKUPS (240)
- #define MAX_ACHS (75)
- #define MAX_BUSSTOPS (56)
- #define MAX_INTERIORS (125)
- #define MAX_MOTELROOMS (125)
- #define MAX_MOTELS (9)
- #define MAX_LITTER (180)
- #define MAX_TEMPBANS (15)
- #define MAX_ZONE_NAME (28)
- #define MAX_REG_PLATE (8)
- #define MAX_FUEL_STATIONS (13)
- #define MAX_SERVER_CARS (4)
- #define MAX_VEHICLES (MAX_BUYVEHS + MAX_FVEHICLES + MAX_SERVER_CARS + 10)
- #define MAX_PLAYERROADBLOCKS (30)
- #define MAX_FIRES (121)
- #define MAX_GUNS (200)
- #define MAX_FACTIONS (20)
- #define MAX_FACTION_DOORS (25)
- #define MAX_JOBS (5)
- #define MAX_FVEHICLES (400)
- #define MAX_TOYS (100)
- #define MAX_APB (20)
- #define MAX_ACTORANIMS (44)
- #define MAX_TEMPCLOTHES (67)
- #define MAX_TOTAL_WEAPONS (12)
- #define MAX_ROLLINGPAPER (20)
- #define MAX_WEEDSEED (50)
- #define MAX_WEED_PLANTS (15)
- #define MAX_TEMPOBJECTS (100)
- #define MAX_REPORTS (25)
- #define MAX_PHONECONTACTS (30)
- #define MAX_LABELS (MAX_PLAYERS + 50)
- #define MAX_FISHCRATES (MAX_PLAYERS)
- #define MAX_PAYPHONES (30)
- #define MAX_DRUGS (MAX_PLAYERS * 2)
- #define MAX_INGREDIENTS (MAX_PLAYERS * 2)
- #define DOOR_PROXIMITY 2.0
- #define TIMEOFFSET (4)
- #define WEAPON_HEAVYARMOR (21)
- #define MODEL_FURNITURE_SNAP 0
- #define MODEL_REMOVE_FURNITURE 1
- #define MODEL_SELECTION_CLOTHES 2
- #define MODEL_SELECTION_FURNITURE 3
- #define MODEL_SELECTION_SFURNITURE 4
- #define MODEL_SELECTION_MODS 5
- #define MODEL_SELECTION_WHEELS 6
- #define MODEL_SELECTION_EFURNITURE 7
- #define MODEL_SELECTION_SEFURNITURE 8
- #define MODEL_EFURNITURE_SNAP 9
- #define MODEL_REMOVE_EFURNITURE 10
- #define MODEL_SELECTION_ROADBLOCK 11
- #define MODEL_SELECTION_PFURNITURE 12
- #define MODEL_SELECTION_ACESSORY 13
- #define MODEL_SACSO_SKINS 31
- #define MODEL_SACFD_SKINS 32
- #define BIZZ_TYPE_STATIC 0
- #define BIZZ_TYPE_GENERALSHOP_S 1
- #define BIZZ_TYPE_CLOTHES_BINCO 2
- #define BIZZ_TYPE_WEAPONS_1FLOOR 3
- #define BIZZ_TYPE_CAFE 4
- #define BIZZ_TYPE_PIZZA 5
- #define BIZZ_TYPE_RESTUARANT 6
- #define BIZZ_TYPE_CLUCKINBELL 7
- #define BIZZ_TYPE_GENERALSHOP_M 8
- #define BIZZ_TYPE_GENERALSHOP_L 9
- #define BIZZ_TYPE_CLOTHES_SUBU 10
- #define BIZZ_TYPE_CLOTHES_RICH 11
- #define BIZZ_TYPE_WEAPONS_2FLOOR 12
- #define BIZZ_TYPE_BARBERS 13
- #define BIZZ_TYPE_CLOTHES_PROLAPS 14
- #define BIZZ_TYPE_ELECTRONICS 15
- #define BIZZ_TYPE_SEX 16
- #define BIZZ_TYPE_PLEASUREDOME 17
- #define BIZZ_TYPE_DRUGSHOP 18
- #define BIZZ_TYPE_CASINO 19
- #define BIZZ_TYPE_STRIPCLUB 20
- #define BIZZ_TYPE_POSTOFFICE 21
- #define BIZZ_TYPE_FURNITURE 22
- #define BIZZ_TYPE_CLOTHES_ZIP 23
- #define CHECKPOINT_VEH 10
- #define AMMOBOX_PISTOL 0
- #define AMMOBOX_SHOTGUN 1
- #define AMMOBOX_SMG 2
- #define AMMOBOX_RIFLE 3
- #define AMMOBOX_ASSAULT 4
- #define LICENSE_CAR 0
- #define LICENSE_LGV 1
- #define LICENSE_BIKE 2
- #define LICENSE_BOAT 3
- #define LICENSE_HELI 4
- #define LICENSE_PLANE 5
- #define DMV_TEST_LAST_CP (26)
- #define ADMIN_RECORD_TYPE_KICK (1)
- #define ADMIN_RECORD_TYPE_PERMBAN (2)
- #define ADMIN_RECORD_TYPE_TEMPBAN (3)
- #define ADMIN_RECORD_TYPE_DATEBAN (4)
- #define ADMIN_RECORD_TYPE_MUTE (5)
- #define ADMIN_RECORD_TYPE_AJAIL (6)
- #define HOLD_OBJECT_MISC (3)
- #define SOUND_LOCK_CAR_DOOR (24600)
- #define SOUND_LOGIN_START (1185)
- #define SOUND_LOGIN_END (1186)
- #define SOUND_DMV_PASS_START (1187)
- #define SOUND_DMV_PASS_END (1188)
- #define SOUND_SLAP (1190)
- #define SOUND_CAR_MOD (1133)
- #define SOUND_CHECKPOINT (1138)
- #define SOUND_FUEL_DECREASE (1131)
- #define SOUND_FIREALARM_START (3401)
- #define SOUND_FIREALARM_END (3402)
- #define MDC_ERROR (21001)
- #define MDC_SELECT (21000)
- #define MDC_OPEN (45400)
- #define MDC_TYPE_JAIL (1)
- #define MDC_TYPE_FINE (2)
- #define MDC_TYPE_TICKET (3)
- #define MDC_TYPE_SPEED (4)
- #define MDC_TYPE_STAR (5)
- #define MDC_TYPE_WARN (6)
- #define MDC_TYPE_PRISON (7)
- #define KeyPressed(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- #define KeyRelease(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
- #define KeyHeld(%0) ((newkeys & (%0)) == (%0))
- // FIX: Define KEY_AIM
- #if !defined KEY_AIM
- #define KEY_AIM KEY_HANDBRAKE
- #endif
- // Time in MS that submission key needs to be held for to toggle lights
- #define LIGHT_TOGGLE_DELAY 500
- #define FUEL_NONE 0
- #define FUEL_GASOLINA 1
- #define FUEL_DIESEL 2
- #define WINDOWS_CLOSED false
- #define WINDOWS_OPEN true
- #define FS_BOXING 0
- #define FS_KUNGFU 1
- #define SPECIAL_ACTION_PISSING 68
- #define COORD_CONC_DONATE 1289.5115,249.5039,19.4075
- // Whirlpool hash
- native WP_Hash(buffer[], len, const str[]);
- native gpci(playerid, serial[], len);
- new BannedWeapons[6] = {35, 36, 37, 38, 39, 40};
- new VehicleNames[][] =
- {
- "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster",
- "Stretch", "Manana", "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
- "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer",
- "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Ocks", "Hotknife", "Trailer", "Previon", "Coach",
- "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo", "Seasparrow",
- "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair",
- "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic",
- "Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", "Walton",
- "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper", "Rancher",
- "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking", "Blista Compact", "Police Maverick",
- "Boxville", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher",
- "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt", "Tanker", "Roadtrain",
- "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck",
- "Fortune", "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan",
- "Blade", "Freight", "Streak", "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder",
- "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite", "Windsor", "Monster", "Monster",
- "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
- "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30",
- "Huntley", "Stafford", "BF-400", "Newsvan", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
- "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "LSPD Cruiser", "SFPD Cruiser", "LVPD Cruiser",
- "Police Ranger", "Picador", "S.W.A.T Van", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs",
- "Boxville", "Tiller", "Utility Trailer"
- };
- new VehicleColors[][] =
- {
- "Black", "White", "Light Blue", "Red", "Dark Green", "Pink", "Yellow", "Light Blue", "Silver", "Grey", "Grey", "Dark Grey", "Silver",
- "Dark Grey", "Light Brown", "Light Brown", "Green", "Red", "Light Red", "Brown", "Light Blue", "Light Red", "Light Red", "Brown",
- "Grey", "Dark Grey", "Light Brown", "Dark Brown", "Light Blue", "Light Brown", "Maroon", "Light Red", "Silver", "Light Brown", "Brown",
- "Brown", "Dark Brown", "Dark Green", "Very Light Green", "Grey", "Dark Brown", "Brown", "Light Red", "Dark Red", "Green", "Red",
- "Sandy Brown", "Light Brown", "Very Light Brown", "Pale Brown", "Brown", "Green", "Dark Green", "Very Dark Blue", "Purple",
- "Brown", "Silver", "Light Brown", "Red", "Light Blue", "Grey", "Tan", "Maroon", "Silver", "Silver", "Olive Green", "Maroon", "Light Blue",
- "Grey", "Grey", "Red", "Light Blue", "Dark Grey", "Very Light Green", "Dark Green", "Very Dark Blue", "Grey", "Grey", "Red", "Blue", "Maroon", "Olive", "Red",
- "Very Dark Green", "Brown", "Magenta", "Bright Green", "Sky Blue", "Maroon", "Grey", "Silver", "Dark Blue", "Grey", "Bright Blue", "Light Blue",
- "Dark Blue", "Grey", "Light Blue", "Light Blue", "Tan", "Light Blue", "Very Dark Blue", "Tan", "Blue", "Brown", "Grey", "Blue", "Brown",
- "Blue", "Dark Grey", "Light Grey", "Brown", "Light Blue", "Brown", "Green", "Bright Red", "Blue", "Red", "Silver", "Brown", "Tan", "Maroon",
- "Grey", "Bright Brown", "Red", "Bright Blue", "Pink", "Black", "Green", "Burgandy", "Cyan", "Gold", "Light Red", "Dark Green", "Blue", "Light Blue",
- "Violet", "Lime Green", "White", "Blue", "Silver", "Light Brown", "Light Yellow", "Light Purple", "Purple", "Light Green", "Pink", "Purple", "Brown", "Brown",
- "Dark Green", "Dark Green", "Blue", "Green", "Green", "Cyan", "Cream", "Blue", "Orange", "Brown", "Green", "Light Pink", "Blue", "Light Blue", "Dark Green", "Light Blue",
- "Blue", "Purple", "Brown", "Light Purple", "Light Purple", "Purple", "Olive Green", "Brown", "Brown", "Light Orange", "Purple", "Light Purple", "Pink", "Purple", "Brown",
- "Orange", "Brown", "Orange", "Pink", "Silver", "Dark Green", "Dark Green", "Dark Green", "Dark Green", "Pink", "Light Green", "Silver",
- "Silver", "Yellow", "Light Yellow", "Silver", "Yellow", "Dark Blue", "Olive Green", "Light Brown", "Dark Blue", "Dark Green", "Dark Blue", "Blue", "Dark Blue", "Dark Blue",
- "Blue", "Blue", "Blue", "Dark Blue", "Purple", "Orange", "Silver", "Olive Green", "Dark Green", "Light Brown", "Light Blue", "Light Brown", "Orange", "Pink",
- "Cream", "Orange", "Dark Blue", "Burgandy", "Olive Green","Lime Green","Dark Green","Yellow","Green","Red","Gold", "Purple", "Purple", "Green",
- "Light Green", "Light Blue", "Light Pink", "Light Brown", "Light Orange", "Cyan", "Lime Green", "Dark Pink", "Light Green", "Brown", "Dark Green",
- "Blue", "Light Blue", "Burgandy", "Burgandy", "Grey", "Grey", "Grey", "Grey", "Grey", "Blue"
- };
- new dropObjectID[] = {
- 1575, 331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325, 326, 342, 343, 344, -1, -1 , -1,
- 346, 347, 348, 349, 350, 351, 352, 353, 355, 356, 372, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367,
- 368, 369, 371
- };
- new unholsterWeap[] =
- {
- 1, 2, 5, 6, 7, 9, 10, 11, 12, 13, 14, 16, 17, 18, 35, 36, 37, 38, 39, 40, 42, 44, 45, 46
- };
- new HolsterTog[] =
- {
- 22, 23, 24, 28, 32, 41, 42, 43, 44, 45, 46, 40, 18, 17, 16, 15, 14, 12, 11, 10, 4, 3, 1
- };
- new Float:DefaultHolster[][] =
- {
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {-0.004, 0.032, -0.034, 150.4, 85.2, -89.5, 1.0, 1.0, 1.0},//nitestick
- {-0.159, 0.071999, 0.081, 49.0, 43.8, -21.3, 1.0, 1.0, 1.0},//knife
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {-0.148, -0.14999, -0.032999, 0.4999, 56.1, 13.2,1.0,1.0,1.0},//katana
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {-0.001, 0.030999, -0.044, -129.1, 86.3001, 78.3, 1.0, 1.0, 1.0},//cane
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {-0.04799,0.0, 0.103999, -108.0, 0.0, 0.0,1.0,1.0,1.0},//9mm
- {-0.075999, -0.03, 0.101999, -100.3, 11.3, -3.8,1.0,1.0,1.0},//silenced
- {-0.052, 0.0, 0.117, -106.6,0.0, 3.3, 1.0, 1.0, 1.0},//desert
- {-0.107999,-0.139999,-0.157999,5.5,9.1,11.6,1.0,1.0,1.0},//shotgun
- {-0.108,-0.025,0.10599,-98.2, 0.0,0.0,1.0,1.0,1.0},//sawnoff
- {-0.028099, -0.157, 0.0, 0.0, 0.0, 5.7,1.0,1.0,1.0}, //spas
- {-0.02199, 0.192, 0.042999, 0.0, 119.5, 0.0,1.0,1.0,1.0},//uzi
- {0.119,0.11,0.177,11.3,148.3,19.9,1.0,1.0,1.0},//mp5
- {0.0,-0.105999,0.011999,5.29999,1.4,5.9,1.0,1.0,1.0}, //ak
- {0.0,-0.126999,0.0,0.0,0.0,0.0,1.0,1.0,1.0}, // m4
- {0.0, 0.177, 0.0, -5.5999, 116.5, 1.2,1.0,1.0,1.0},//Tec9
- {-0.165999, -0.145999, -0.15199, 0.0, -0.4999, 8.9,1.0,1.0,1.0},
- {-0.051999, -0.17, -0.148, 0.0, 0.0, 7.8,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {-0.05899, -0.26899, 0.1, -11.9, -94.8, -6.5,1.0,1.0,1.0},//spray
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.20699, 0.18, -0.126999, 87.4001, 179.8, 1.5,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0},
- {0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0}
- };
- new DefaultHolsterBone[] = {1,1,1, 7, 7, 1,1,1, 1, 1,1,1,1,1,1, 7, 1,1,1,1,1,1, 8, 8, 8, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1, 7, 1, 1, 1,1,1};
- new weaponstring[][] =
- {
- {"a Fist"}, {"Brass Knuckles"}, {"a Golf Club"}, {"a Nightstick"}, {"a Knife"},
- {"a Baseball Bat"}, {"a Shovel"}, {"a Pool Cue"}, {"a Katana"}, {"a Chainsaw"},
- {"a Purple Dildo"}, {"a Small White Vibrator"}, {"a Big White Vibrator"},
- {"a Small Silver Vibrator"}, {"a bunch of Flowers"}, {"a Cane"}, {"some Grenades"}, {"some Teargas"},
- {"some Molotov Cocktails"}, {" "}, {" "}, {"a Heavy Armor Vest"}, {"a 9mm"}, {"a Silenced Pistol"},
- {"a Desert Eagle"}, {"a Shotgun"}, {"a Sawn-off Shotgun"},
- {"a Combat Shotgun"}, {"a Micro Uzi"}, {"an MP5"}, {"an AK-47"}, {"an M4"}, {"a Tec9"},
- {"a Country Rifle"},{"a Sniper Rifle"}, {"a Rocket Launcher (RPG)"},
- {"a Heat-Seeking Rocket Launcher"},{"a Flamethrower"}, {"a Minigun"},
- {"some Satchel Charges"}, {"a Detonator"},{"a Spray Can"}, {"a Fire Extinguisher"},
- {"a Camera"}, {"a pair of Night Vision Goggles"}, {"a pair of Thermal Goggles"},
- {"a Parachute"}, {" "}, {"WHATWEAPONISTHIS?"}, {"a Vehicle"}, {"Helicopter Blades"}, {"an Explosion"}
- };
- new WeaponNames[][] =
- {
- {"Fist"}, {"Brass Knuckles"}, {"Golf Club"}, {"Nightstick"}, {"Knife"},
- {"Baseball Bat"}, {"Shovel"}, {"Pool Cue"}, {"Katana"}, {"Chainsaw"},
- {"Purple Dildo"}, {"Small White Vibrator"}, {"Big White Vibrator"},
- {"Small Silver Vibrator"}, {"Flowers"}, {"Cane"}, {"Grenade"}, {"Teargas"},
- {"Molotov Cocktail"}, {" "}, {" "}, {" "}, {"9mm"}, {"Silenced Pistol"},
- {"Desert Eagle"}, {"Shotgun"}, {"Sawn-off Shotgun"},
- {"SPAS-12"}, {"Micro Uzi (Mac 10)"}, {"MP5"}, {"AK-47"}, {"M4"}, {"Tec9"},
- {"Country Rifle"},{"Sniper Rifle"}, {"Rocket Launcher (RPG)"},
- {"Heat-Seeking Rocket Launcher"},{"Flamethrower"}, {"Minigun"},
- {"Satchel Charges"}, {"Detonator"},{"Spray Can"}, {"Fire Extinguisher"},
- {"Camera"}, {"Night Vision Goggles"}, {"Thermal Goggles"},
- {"Parachute"}
- };
- new ComponentTypes[][] =
- {
- {"Spoiler"}, {"Hood"}, {"Roof"}, {"Sideskirt"}, {"Light"}, {"Nitrous"}, {"Exhaust"}, {"Wheels"},
- {"Stereo"}, {"Hydraulics"}, {"Front Bumper"}, {"Rear Bumper"}, {"Right Vent"}, {"Left Vent"}
- };
- new WeaponObjects[51] =
- {
- 1575, 331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325, 326, 342, 343, 344, -1, -1 , -1,
- 346, 347, 348, 349, 350, 351, 352, 353, 355, 356, 372, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367,
- 368, 369, 371, 330
- };
- new Float:PaytollPos[4][3] =
- {
- {-192.713165, 261.420501, 12.078125},
- {-195.031082, 276.638671, 12.078125},
- {619.448425, 335.838897, 19.345317},
- {604.062805, 347.936614, 18.929687}
- };
- new PaytollNames[4][12] = {"Bone County", "Red County", "Bone County", "Red County"};
- new DoctorNames[][] =
- {
- "Dr Steven OConners", "Dr. Adam Jones", "Dr. Adam Larris", "Dr. Anna Recksiek", "Dr. Barry Soap",
- "Dr. Ben Dover", "Dr. Bill Board", "Dr. Brodie Amal", "Dr. Callum Hickey", "Dr. Carrie Oakey",
- "Dr. Charles Danielson", "Dr. Chris Thomson", "Dr. Daniel Towns", "Dr. Darren Bush", "Dr. David Roslin",
- "Dr. Derrick Borjene", "Dr. Evan Daniels", "Dr. Garry Butler", "Dr. George Brown", "Dr. Glen Patterson",
- "Dr. Hamilton Felter", "Dr. Hanah Gillespee", "Dr. Harry Belkalk", "Dr. Howard Bellendnet", "Dr. Jamal Simpson",
- "Dr. James Dowling", "Dr. James Smith", "Dr. Jamie Stewert", "Dr. Joe Kerr", "Dr. John Patterson", "Dr. Jones Dacorah",
- "Dr. Justin Felker", "Dr. Keiran Harris", "Dr. Kyle Forsyth", "Dr. Lea Robertson", "Dr. Luke Spalding", "Dr. Mark Longing",
- "Dr. Mike Oxlong", "Dr. Minhas Muhammed Atkar", "Dr. Muhammad Yunus", "Dr. Ola Bulger", "Dr. Omar Williums",
- "Dr. Patrick Lee", "Dr. Paul Gratings", "Dr. Phill McRackin", "Dr. Ray Tardkris", "Dr. Ryan Morgan", "Dr. Scott Watson",
- "Dr. Sophie Clark", "Dr. Steven Rentar", "Dr. Steven Willard", "Dr. Stewart Fotheringham", "Dr. Thomas Turkey",
- "Dr. Tom B Ecksdee", "Dr. Tom Burns","Dr. Tom Robinson","Dr. Trey Linski","Dr. William Jenkins",
- "Enfermeira Alanah Dierro", "Enfermeira Alice Sutherland", "Enfermeira Amy Lauder", "Enfermeira Annie Brown", "Enfermeira Asheligh Harrison", "Enfermeira Ashley Jones",
- "Enfermeira Betty Burns", "Enfermeiro Biggus Deeus", "Enfermeira Caroline Shaw", "Enfermeira Carolyn Beard", "Enfermeira Elizabeth Cockinson",
- "Enfermeira Fiona Waterfall", "Enfermeiro Gayner White", "Enfermeira Helen Smith", "Enfermeira Hexallina Joshua", "Enfermeira Holly Bush", "Enfermeira Jennifer Smith",
- "Enfermeiro Jodie Steepel", "Enfermeiro Josef Kaney", "Enfermeiro Kristan Willing", "Enfermeira Laura Stafford", "Enfermeira Lauren Wellings", "Enfermeira Lola Justins",
- "Enfermeira Michelle Johnston", "Enfermeira Natalie Jenkins", "Enfermeira Rachel Maine", "Enfermeira Rebecca Furby", "Enfermeiro Rhiann Braxton",
- "Enfermeira Ruth Gardiner", "Enfermeira Shelly Anderson", "Enfermeira Victoria Henderson", "Prof. Squeaky Hawkingtons", "Cirurgião Montell Darko", "Estagiário Nicholai Smelldrone"
- };
- enum TELEPORT_DATA
- {
- TPName[32],
- Float:TPx,
- Float:TPy,
- Float:TPz,
- Float:TPa,
- TPInt,
- TPVw
- }
- new Teleports[][TELEPORT_DATA] =
- {
- {"Montgomery", 1286.065795, 259.397888, 19.546892, 247.222427, 0, 0},
- {"Palomino Creek", 2286.5813, -15.4796, 26.4844, 272.2236, 0, 0},
- {"Dillimore", 702.0617, -469.7100, 16.3359, 181.1477, 0, 0},
- {"Blueberry", 220.249404, -154.039321, 1.578125, 270.986877, 0, 0},
- {"Fort Carson", -136.034286, 1214.920288, 19.74, 0.0, 0, 0},
- {"Angel Pine", -2131.383789, -2412.833496, 30.625, 0.0, 0, 0},
- {"Pescaria", 2152.0325, -95.3101, 2.6956, 0.0, 0, 0},
- {"Bayside", -2442.044189, 2324.293945, 4.984375, 0.0, 0, 0},
- {"El Quebrados", -1410.3293, 2612.6653, 55.8359, 88.8133, 0, 0},
- {"Las Barrancas", -852.036499, 1543.056640, 22.854631, 270.0, 0, 0},
- {"Las Payasadas", -242.2057, 2683.0261, 62.6804, 68.2640, 0, 0},
- {"Elite Trucking", 599.1758, 1653.0250, 6.9922, 34.1044, 0, 0},
- {"Bone County Prison", 262.1924, 1405.8936, 10.4992, 90.0, 0, 0},
- {"Los Santos", 1183.4312, -1324.5529, 13.5772, 264.7505, 0, 0},
- {"San Fierro", -2028.9001, 173.9227, 28.8359, 267.0274, 0, 0},
- {"Las Venturas", 2166.3525, 1683.4303, 10.8203, 91.2637, 0, 0},
- {"LS Tower", 1541.081054, -1364.230834, 329.796875, 357.439239, 0, 0},
- {"SF Tower", -1753.774169, 885.215759, 295.875000, 357.91381, 0, 0},
- {"Area 51", 77.2566, 1919.5846, 17.6406, 0.0, 0, 0},
- {"Boneyard", 351.9080, 2496.6165, 16.4844, 178.5574, 0, 0},
- {"Hilltop Farm", 1034.0928, -336.2662, 73.9922, 0.0, 0, 0},
- {"Taxi HQ", 1235.911987, 187.018402, 19.554687, 0.0, 0, 0},
- {"Hospital", 1243.4813, 330.6503, 19.5547, 339.0066, 0, 0},
- {"Dillimore Automotive", 643.090332, -503.772155, 16.335937, 0.0, 0, 0},
- {"Gant Bridge", -2666.669189, 1595.062866, 217.273895, 0.0, 0, 0},
- {"Admin Jail", 268.5122, 84.1522, 1001.0391, 180.0, 6, 0},
- {"Bloodring Stadium", -1394.2, 987.62, 1023.96, 0.0, 15, 0},
- {"8 Track Stadium", -1395.958, -208.197, 1051.170, 0.0, 7, 0},
- {"Dirt Track Stadium", -1424.9319, -664.5869, 1059.8585, 0.0, 4, 0},
- {"RC Battlefield", -1079.99, 1061.58, 1343.04, 0.0, 10, 0},
- {"Big Ear", -297.2155, 1530.0469, 75.3594, 0.0, 0, 0},
- {"Palomino Creek Townhall", 2279.6270, -80.6795, 26.5356, 89.7161, 0, 0},
- {"Palomino Creek Garage", 2428.9744, 110.4881, 26.4689, 273.9619, 0, 0},
- {"Fisher's Lagoon", 2155.6021, -96.6893, 2.7278, 57.7928, 0, 0},
- {"Dillimore Police Department", 650.5731, -613.9204, 16.3359, 356.2127, 0, 0},
- {"SACFD Station 49", 1463.2152, 415.1849, 20.2617, 156.5134, 0, 0},
- {"County Rentals", 1403.7343, 404.3691, 19.7578, 156.3592, 0, 0},
- {"Fort Carson Mall", 104.9788, 1099.9265, 13.6094, 269.5034, 0, 0},
- {"Bone County Docks", 150.7258, 660.2635, 5.0328, 283.6165, 0, 0},
- {"RS Haul", -109.1080, -1122.4072, 2.0526, 258.5106, 0, 0},
- {"Mount Chiliad", -2292.3567, -1666.7966, 482.7730, 46.4071, 0, 0},
- {"Lake Hollow", -821.3415, -1896.7317, 11.0879, 199.0963, 0, 0},
- {"Northstar Rock", 2371.4080, -650.5092, 127.5305, 89.4399, 0, 0},
- {"Richman", 355.9613, -1159.7986, 78.0146, 230.0479, 0, 0},
- {"LS Airport", 1859.1118, -2393.2073, 13.5547, 179.1602, 0, 0}
- };
- /*//===== [ SACSO ] ====
- static SACSO_Uniformes[7] = {
- 20050, 20051, 20052, 20053, 20054, 20055, 20056
- };
- //===== [ FD ] ====
- static SACFD_Uniformes[9] = {
- 20020, 20021, 20022, 20023, 20024, 20025, 20026, 20027, 20028
- };*/
- new RandomDriverData[50][2][MAX_PLAYER_NAME] =
- {
- {"Taylor Graham", "T5AGK10"},
- {"Eddy McLaughlin", "J3HGUOI"},
- {"Tony Bowerman", "T683SPN"},
- {"Alan Grifford", "HD540QP"},
- {"Norman McGuiness", "TNATDP1"},
- {"Alice Walker", "U37PQRT"},
- {"Sprunk Corporation", "JG94GH2"},
- {"Edgar Mumford", "BU469P8"},
- {"Oscar Dufraine", "JT769MH"},
- {"Kenny Hartfield", "KENNYH1"},
- {"Quinten Cunningham", "LD57KNB"},
- {"Sally McQuad", "WI04TWS"},
- {"Harry MacKenzie", "ASHL24T"},
- {"Patryk Broadfield", "MY28LTD"},
- {"Declan McHumphrey", "JF54971"},
- {"Edward McTavish", "EDDYB0Y"},
- {"Marcus Connors", "IP35U8A"},
- {"Bryan ONeil", "BSIW6N2"},
- {"Stewart Murray", "N0UPCRT"},
- {"Grace Becker", "KA49NTR"},
- {"Pauline Stafford", "HWP0MNY"},
- {"Monica Steller", "M0NICAS"},
- {"Lisa McDarryl", "JTR29RY"},
- {"Jack Davis", "NDHW81E"},
- {"Susan Somerville", "LAWE481"},
- {"Transport Department", "TEP0NBX"},
- {"Transport Department", "KSE3L9X"},
- {"Kiera Dawson", "B9WRIQP"},
- {"Eric McFarline", "K8WH0VK"},
- {"Vince Stoman", "BDIP0L2"},
- {"Pete Coalman", "HDT08R5"},
- {"Sharon King", "KA890PQ"},
- {"Gerald Melono", "IBO07HI"},
- {"Willy Bridgetown", "AB54924"},
- {"Francessca McAbe", "IW36HTT"},
- {"Steven Kelso", "G7WM118"},
- {"Garry Carlson", "CU39PSP"},
- {"Ralph Dunsmore", "G2G4JLP"},
- {"Michael York", "CJL99DF"},
- {"Aaron Farrell", "BUU29L1"},
- {"Yohann Shfinzer", "GAU3P0A"},
- {"Shannon McTeer", "SHANN0N"},
- {"Stacey Dunlop", "JAW9P02"},
- {"Christopher Bradshaw", "QNSI913"},
- {"Thomas Mooney", "CUI3PPS"},
- {"Jamie Underbow", "LS8HB34"},
- {"Donald Richardson", "BIGD85A"},
- {"Fred Hay", "JN56FYV"},
- {"Christopher Wood", "4HJ9NHR"},
- {"Mary-Beth Maybell", "KROSE86"}
- };
- /*new PCountry[240][2][46] =
- {
- {"AALAND ISLANDS", "AX"},
- {"AFGHANISTAN", "AF"},
- {"ALBANIA", "AL"},
- {"ALGERIA", "DZ"},
- {"AMERICAN SAMOA", "AS"},
- {"ANDORRA", "AD"},
- {"ANGOLA", "AO"},
- {"ANGUILLA", "AI"},
- {"ANTARCTICA", "AQ"},
- {"ANTIGUA AND BARBUDA", "AG"},
- {"ARGENTINA", "AR"},
- {"ARMENIA", "AM"},
- {"ARUBA", "AW"},
- {"AUSTRALIA", "AU"},
- {"AUSTRIA", "AT"},
- {"AZERBAIJAN", "AZ"},
- {"BAHAMAS", "BS"},
- {"BAHRAIN", "BH"},
- {"BANGLADESH", "BD"},
- {"BARBADOS", "BB"},
- {"BELARUS", "BY"},
- {"BELGIUM", "BE"},
- {"BELIZE", "BZ"},
- {"BENIN", "BJ"},
- {"BERMUDA", "BM"},
- {"BHUTAN", "BT"},
- {"BOLIVIA", "BO"},
- {"BOSNIA AND HERZEGOWINA", "BA"},
- {"BOTSWANA", "BW"},
- {"BOUVET ISLAND", "BV"},
- {"BRAZIL", "BR"},
- {"BRITISH INDIAN OCEAN TERRITORY", "IO"},
- {"BRUNEI DARUSSALAM", "BN"},
- {"BULGARIA", "BG"},
- {"BURKINA FASO", "BF"},
- {"BURUNDI", "BI"},
- {"CAMBODIA", "KH"},
- {"CAMEROON", "CM"},
- {"CANADA", "CA"},
- {"CAPE VERDE", "CV"},
- {"CAYMAN ISLANDS", "KY"},
- {"CENTRAL AFRICAN REPUBLIC", "CF"},
- {"CHAD", "TD"},
- {"CHILE", "CL"},
- {"CHINA", "CN"},
- {"CHRISTMAS ISLAND", "CX"},
- {"COCOS (KEELING) ISLANDS", "CC"},
- {"COLOMBIA", "CO"},
- {"COMOROS", "KM"},
- {"CONGO, Democratic Republic of (was Zaire)", "CD"},
- {"CONGO, Republic of", "CG"},
- {"COOK ISLANDS", "CK"},
- {"COSTA RICA", "CR"},
- {"COTE D'IVOIRE", "CI"},
- {"CROATIA (local name: Hrvatska)", "HR"},
- {"CUBA", "CU"},
- {"CYPRUS", "CY"},
- {"CZECH REPUBLIC", "CZ"},
- {"DENMARK", "DK"},
- {"DJIBOUTI", "DJ"},
- {"DOMINICA", "DM"},
- {"DOMINICAN REPUBLIC", "DO"},
- {"ECUADOR", "EC"},
- {"EGYPT", "EG"},
- {"EL SALVADOR", "SV"},
- {"EQUATORIAL GUINEA", "GQ"},
- {"ERITREA", "ER"},
- {"ESTONIA", "EE"},
- {"ETHIOPIA", "ET"},
- {"FALKLAND ISLANDS (MALVINAS)", "FK"},
- {"FAROE ISLANDS", "FO"},
- {"FIJI", "FJ"},
- {"FINLAND", "FI"},
- {"FRANCE", "FR"},
- {"FRENCH GUIANA", "GF"},
- {"FRENCH POLYNESIA", "PF"},
- {"FRENCH SOUTHERN TERRITORIES", "TF"},
- {"GABON", "GA"},
- {"GAMBIA", "GM"},
- {"GEORGIA", "GE"},
- {"GERMANY", "DE"},
- {"GHANA", "GH"},
- {"GIBRALTAR", "GI"},
- {"GREECE", "GR"},
- {"GREENLAND", "GL"},
- {"GRENADA", "GD"},
- {"GUADELOUPE", "GP"},
- {"GUAM", "GU"},
- {"GUATEMALA", "GT"},
- {"GUINEA", "GN"},
- {"GUINEA-BISSAU", "GW"},
- {"GUYANA", "GY"},
- {"HAITI", "HT"},
- {"HEARD AND MC DONALD ISLANDS", "HM"},
- {"HONDURAS", "HN"},
- {"HONG KONG", "HK"},
- {"HUNGARY", "HU"},
- {"ICELAND", "IS"},
- {"INDIA", "IN"},
- {"INDONESIA", "ID"},
- {"IRAN (ISLAMIC REPUBLIC OF)", "IR"},
- {"IRAQ", "IQ"},
- {"IRELAND", "IE"},
- {"ISRAEL", "IL"},
- {"ITALY", "IT"},
- {"JAMAICA", "JM"},
- {"JAPAN", "JP"},
- {"JORDAN", "JO"},
- {"KAZAKHSTAN", "KZ"},
- {"KENYA", "KE"},
- {"KIRIBATI", "KI"},
- {"KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF", "KP"},
- {"KOREA, REPUBLIC OF", "KR"},
- {"KUWAIT", "KW"},
- {"KYRGYZSTAN", "KG"},
- {"LAO PEOPLE'S DEMOCRATIC REPUBLIC", "LA"},
- {"LATVIA", "LV"},
- {"LEBANON", "LB"},
- {"LESOTHO", "LS"},
- {"LIBERIA", "LR"},
- {"LIBYAN ARAB JAMAHIRIYA", "LY"},
- {"LIECHTENSTEIN", "LI"},
- {"LITHUANIA", "LT"},
- {"LUXEMBOURG", "LU"},
- {"MACAU", "MO"},
- {"MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF", "MK"},
- {"MADAGASCAR", "MG"},
- {"MALAWI", "MW"},
- {"MALAYSIA", "MY"},
- {"MALDIVES", "MV"},
- {"MALI", "ML"},
- {"MALTA", "MT"},
- {"MARSHALL ISLANDS", "MH"},
- {"MARTINIQUE", "MQ"},
- {"MAURITANIA", "MR"},
- {"MAURITIUS", "MU"},
- {"MAYOTTE", "YT"},
- {"MEXICO", "MX"},
- {"MICRONESIA, FEDERATED STATES OF", "FM"},
- {"MOLDOVA, REPUBLIC OF", "MD"},
- {"MONACO", "MC"},
- {"MONGOLIA", "MN"},
- {"MONTSERRAT", "MS"},
- {"MOROCCO", "MA"},
- {"MOZAMBIQUE", "MZ"},
- {"MYANMAR", "MM"},
- {"NAMIBIA", "NA"},
- {"NAURU", "NR"},
- {"NEPAL", "NP"},
- {"NETHERLANDS ANTILLES", "AN"},
- {"NETHERLANDS, THE", "NL"},
- {"NEW CALEDONIA", "NC"},
- {"NEW ZEALAND", "NZ"},
- {"NICARAGUA", "NI"},
- {"NIGER", "NE"},
- {"NIGERIA", "NG"},
- {"NIUE", "NU"},
- {"NORFOLK ISLAND", "NF"},
- {"NORTHERN MARIANA ISLANDS", "MP"},
- {"NORWAY", "NO"},
- {"OMAN", "OM"},
- {"PAKISTAN", "PK"},
- {"PALAU", "PW"},
- {"PALESTINIAN TERRITORY, Occupied", "PS"},
- {"PANAMA", "PA"},
- {"PAPUA NEW GUINEA", "PG"},
- {"PARAGUAY", "PY"},
- {"PERU", "PE"},
- {"PHILIPPINES", "PH"},
- {"PITCAIRN", "PN"},
- {"POLAND", "PL"},
- {"PORTUGAL", "PT"},
- {"PUERTO RICO", "PR"},
- {"QATAR", "QA"},
- {"REUNION", "RE"},
- {"ROMANIA", "RO"},
- {"RUSSIAN FEDERATION", "RU"},
- {"RWANDA", "RW"},
- {"SAINT HELENA", "SH"},
- {"SAINT KITTS AND NEVIS", "KN"},
- {"SAINT LUCIA", "LC"},
- {"SAINT PIERRE AND MIQUELON", "PM"},
- {"SAINT VINCENT AND THE GRENADINES", "VC"},
- {"SAMOA", "WS"},
- {"SAN MARINO", "SM"},
- {"SAO TOME AND PRINCIPE", "ST"},
- {"SAUDI ARABIA", "SA"},
- {"SENEGAL", "SN"},
- {"SERBIA AND MONTENEGRO", "CS"},
- {"SEYCHELLES", "SC"},
- {"SIERRA LEONE", "SL"},
- {"SINGAPORE", "SG"},
- {"SLOVAKIA", "SK"},
- {"SLOVENIA", "SI"},
- {"SOLOMON ISLANDS", "SB"},
- {"SOMALIA", "SO"},
- {"SOUTH AFRICA", "ZA"},
- {"SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS", "GS"},
- {"SPAIN", "ES"},
- {"SRI LANKA", "LK"},
- {"SUDAN", "SD"},
- {"SURINAME", "SR"},
- {"SVALBARD AND JAN MAYEN ISLANDS", "SJ"},
- {"SWAZILAND", "SZ"},
- {"SWEDEN", "SE"},
- {"SWITZERLAND", "CH"},
- {"SYRIAN ARAB REPUBLIC", "SY"},
- {"TAIWAN", "TW"},
- {"TAJIKISTAN", "TJ"},
- {"TANZANIA, UNITED REPUBLIC OF", "TZ"},
- {"THAILAND", "TH"},
- {"TIMOR-LESTE", "TL"},
- {"TOGO", "TG"},
- {"TOKELAU", "TK"},
- {"TONGA", "TO"},
- {"TRINIDAD AND TOBAGO", "TT"},
- {"TUNISIA", "TN"},
- {"TURKEY", "TR"},
- {"TURKMENISTAN", "TM"},
- {"TURKS AND CAICOS ISLANDS", "TC"},
- {"TUVALU", "TV"},
- {"UGANDA", "UG"},
- {"UKRAINE", "UA"},
- {"UNITED ARAB EMIRATES", "AE"},
- {"UNITED KINGDOM", "GB"},
- {"UNITED STATES MINOR OUTLYING ISLANDS", "UM"},
- {"UNITED STATES", "US"},
- {"URUGUAY", "UY"},
- {"UZBEKISTAN", "UZ"},
- {"VANUATU", "VU"},
- {"VATICAN CITY STATE (HOLY SEE)", "VA"},
- {"VENEZUELA", "VE"},
- {"VIET NAM", "VN"},
- {"VIRGIN ISLANDS (BRITISH)", "VG"},
- {"VIRGIN ISLANDS (US)", "VI"},
- {"WALLIS AND FUTUNA ISLANDS", "WF"},
- {"WESTERN SAHARA", "EH"},
- {"YEMEN", "YE"},
- {"ZAMBIA", "ZM"},
- {"ZIMBABWE", "ZW"}
- };*/
- new FishNames[13][11] =
- {
- "Carp", "Cat Fish", "Cod", "Conger Eel", "Dog Fish", "Herring",
- "Pollack", "Salmon", "Sardine", "Shark", "Swordfish", "Trout", "Turtle"
- };
- new AllowedFactionVehs[174][2] =
- {
- // Model Price
- {400, 50000}, //Landstalker
- {401, 46000}, //Bravura
- {402, 300000}, //Buffalo
- {403, 50000}, //Linerunner
- {404, 34000}, //Perenial
- {405, 50000}, //Sentinel
- {407, 50000}, // Firetruck
- {408, 100000}, //Trashmaster
- {409, 250000}, //Stretch
- {410, 30000}, //Manana
- {411, 3000000}, //Infernus
- {412, 40000}, //VooDoo
- {413, 60000}, //Pony
- {414, 75000}, //Mule
- {415, 1500000}, //Cheetah
- {416, 50000}, //Ambulance
- {417, 350000}, //Leviathan
- {418, 40000}, //Moonbeam
- {419, 54000}, //Esperanto
- {420, 35000}, //Taxi
- {421, 200000}, //Washington
- {422, 48000}, //Bobcat
- {423, 350000}, //Mr Whoopee
- {424, 750000}, //BF-Injection
- {426, 100000}, //Premier
- {427, 50000}, //Enforcer
- {428, 100000}, //Securicar
- {429, 3000000}, //Banshee
- {430, 50000}, //Predator
- {431, 75000}, //Bus
- {433, 50000}, //Barracks
- {434, 750000}, //Hotknife
- {435, 10000}, //Artigo Trailer
- {436, 35000}, //Previon
- {437, 75000}, //Coach
- {438, 30000}, //Cabbie
- {439, 250000}, //Stallion
- {440, 60000}, //Rumpo
- {442, 75000}, //Romero
- {443, 200000}, //Packer
- {445, 60000}, //Admiral
- {446, 750000}, //Squalo
- {448, 35000}, //Pizza Boy
- {450, 10000}, //Artigo Trailer 2
- {451, 1000000}, //Turismo
- {452, 650000}, //Speeder
- {453, 45000}, //Reefer
- {454, 55000}, //Tropic
- {455, 75000}, //Flatbed
- {456, 75000}, //Yankee
- {457, 25000}, //Caddy
- {458, 60000}, //Solair
- {459, 60000}, //Topfun Van (Berkley's RC)
- {460, 1000000}, //Skimmer
- {461, 50000}, //PCJ-600
- {462, 12000}, //Faggio
- {463, 39000}, //Freeway
- {466, 38000}, //Glendale
- {467, 50500}, //Oceanic
- {468, 30000}, //Sanchez
- {469, 125000}, //Sparrow
- {470, 500000}, //Patriot
- {471, 20000}, //Quad
- {472, 300000}, //Coastguard
- {473, 200000}, //Dinghy
- {474, 48000}, //Hermes
- {475, 56000}, //Sabre
- {476, 200000}, //Rustler
- {477, 700000}, //ZR-350
- {478, 20000}, //Walton
- {479, 40000}, //Regina
- {480, 3000000}, //Comet
- {481, 10000}, //BMX
- {482, 54000}, //Burrito
- {483, 75000}, //Camper
- {484, 1000000}, //Marquis
- {486, 250000}, //Dozer
- {487, 100000}, //Maverick
- {488, 75000}, //SAN Maverick
- {489, 52000}, //Rancher
- {490, 50000}, //FBI Rancher
- {491, 46500}, //Virgo
- {492, 46000}, //Greenwood
- {493, 700000}, //Jetmax
- {495, 850000}, //Sandking
- {496, 42000}, //BlistaC
- {497, 50000}, //Police Maverick
- {498, 75000}, //Boxville
- {499, 75000}, //Benson
- {500, 54000}, //Mesa
- {504, 750000}, //Bloodring Banger
- {506, 2000000}, //Super GT
- {507, 114000}, //Elegant
- {508, 150000}, //Journey
- {509, 10000}, //Bike
- {510, 10000}, //Mountain Bike
- {511, 2000000}, //Beagle
- {512, 1000000}, //Cropduster
- {513, 1000000}, //Stunt Plane
- {514, 50000}, //Tanker
- {515, 50000}, //Roadtrain
- {516, 38000}, //Nebula
- {517, 40500}, //Majestic
- {518, 42000}, //Buccaneer
- {519, 2500000}, //Shamal
- {521, 150000}, //FCR
- {523, 50000}, //HPV (Police)
- {524, 200000}, //Cement Truck
- {525, 50000}, //Towtruck
- {526, 39500}, //Fortune
- {527, 28500}, //Cadrona
- {528, 50000}, //FBI Truck
- {529, 50000}, //Willard
- {530, 50000}, //Forklift
- {531, 35000}, //Tractor
- {532, 100000}, //Combine Harvester
- {533, 200000}, //Feltzer
- {534, 66000}, //Remington
- {535, 125000}, //Slamvan
- {536, 54000}, //Blade
- {540, 90000}, //Vincent
- {541, 3000000}, //Bullet
- {542, 19000}, //Clover
- {543, 30000}, //Sadler
- {544, 50000}, //Firetruck LA
- {545, 1250000}, //Hustler
- {546, 45500}, //Intruder
- {547, 44500}, //Primo
- {548, 175000}, //Cargobob
- {549, 19500}, //Tampa
- {550, 100000}, //Sunrise
- {551, 44000}, //Merit
- {552, 50000}, //Utility Van
- {553, 1000000}, //Nevada
- {554, 58000}, //Yosemite
- {555, 2000000}, //Windsor
- {558, 250000}, //Uranus
- {559, 320000}, //Jester
- {560, 250000}, //Sultan
- {561, 250000}, //Stratum
- {562, 300000}, //Elegy
- {563, 150000}, //Raindance
- {565, 250000}, //Flash
- {566, 48000}, //Tahoma
- {567, 50000}, //Savanna
- {568, 200000}, //Bandito
- {571, 100000}, //Kart
- {572, 35000}, //Mower
- {575, 800000}, //Broadway
- {576, 36000}, //Tornado
- {578, 75000}, //DFT-300
- {579, 70000}, //Huntley
- {580, 2000000}, //Stafford
- {581, 50000}, //BF-400
- {582, 50000}, //Newsvan
- {584, 10000}, //Petrol Trailer
- {585, 80000}, //Emperor
- {586, 35000}, //Wayfarer
- {587, 140000}, //Euros
- {588, 350000}, //Hotdog
- {589, 63000}, //Club
- {591, 10000}, //Artigo Trailer 3
- {593, 1000000}, //Dodo
- {595, 300000}, //Launch
- {596, 50000}, //LSPD Cruiser
- {597, 50000}, //SFPD Cruiser
- {598, 50000}, //LVPD Cruiser
- {599, 50000}, //Police Ranger
- {600, 44000}, //Picador
- {601, 50000}, //S.W.A.T.
- {602, 60500}, //Alpha
- {603, 700000}, //Phoenix
- {604, 30000}, //Glendale Shit
- {605, 17500} //Sadler Shit
- };
- new MicksVehicleData[76][2] =
- {
- // Model Price
- {400, 50000}, //Landstalker
- {401, 1500}, //Bravura
- {402, 25750}, //Buffalo
- {404, 1700}, //Perenial
- {410, 1300}, //Manana
- {412, 5500}, //VooDoo
- {418, 2000}, //Moonbeam
- {419, 5500}, //Esperanto
- {420, 11000}, //Taxi
- {421, 9650}, //Washington
- {422, 2200}, //Bobcat
- {426, 10000}, //Premier
- {436, 2100}, //Previon
- {438, 9000}, //Cabbie
- {439, 18000}, //Stallion
- {445, 4700}, //Admiral
- {451, 1000000}, //Turismo
- {458, 4500}, //Solair
- {466, 4800}, //Glendale
- {467, 4300}, //Oceanic
- {474, 4000}, //Hermes
- {475, 19000}, //Sabre
- {477, 160000}, //ZR-350
- {478, 3100}, //Walton
- {479, 6000}, //Regina
- {480, 98000}, //Comet
- {482, 12000}, //Burrito
- {483, 3000}, //Camper
- {489, 19000}, //Rancher
- {491, 5650}, //Virgo
- {492, 7000}, //Greenwood
- {496, 15700}, //BlistaC
- {500, 6775}, //Mesa
- {506, 49800}, //Super GT
- {507, 10600}, //Elegant
- {508, 60000}, //Journey
- {516, 3700}, //Nebula
- {517, 6350}, //Majestic
- {518, 6000}, //Buccaneer
- {525, 4700}, //Towtruck
- {526, 14000}, //Fortune
- {527, 6300}, //Cadrona
- {529, 3950}, //Willard
- {533, 20200}, //Feltzer
- {534, 17900}, //Remington
- {535, 16200}, //Slamvan
- {536, 15850}, //Blade
- {540, 6300}, //Vincent
- {542, 3100}, //Clover
- {543, 1800}, //Sadler
- {545, 16200}, //Hustler
- {546, 4350}, //Intruder
- {547, 4400}, //Primo
- {549, 3100}, //Tampa
- {550, 3600}, //Sunrise
- {551, 4950}, //Merit
- {554, 11000}, //Yosemite
- {555, 9000}, //Windsor
- {558, 21325}, //Uranus
- {559, 63200}, //Jester
- {560, 149900}, //Sultan
- {561, 19600}, //Stratum
- {562, 74550}, //Elegy
- {565, 51330}, //Flash
- {566, 31550}, //Tahoma
- {567, 30200}, //Savanna
- {575, 33300}, //Broadway
- {576, 45200}, //Tornado
- {579, 139900}, //Huntley
- {580, 59000}, //Stafford
- {585, 3800}, //Emperor
- {587, 74600}, //Euros
- {589, 63000}, //Club
- {600, 58300}, //Picador
- {602, 42500}, //Alpha
- {603, 80000} //Phoenix
- };
- new BuyBoatData[7][2] =
- {
- // Model Price
- {446, 80000}, //Squalo
- {452, 75000}, //Speeder
- {453, 65000}, //Reefer
- {454, 98000}, //Tropic
- {472, 50000}, //Coastguard
- {473, 3000}, //Dinghy
- {484, 100500} //Marquis
- };
- new BuyMotorbikeData[7][2] =
- {
- // Model Price
- {461, 50000}, //PCJ-600
- {462, 800}, //Faggio
- {463, 7900}, //Freeway
- {468, 6000}, //Sanchez
- {471, 6000}, //Quad
- {581, 50000}, //BF-400
- {586, 8500} //Wayfarer
- };
- new dvLevel3[3][2] =
- {
- // Model Price
- {521, 27900}, //FCR-900
- {487, 1200000}, //Maverick
- {541, 390000} //Bullet
- };
- new dvLevel4[3][2] =
- {
- // Model Price
- {429, 265000}, //Banshee
- {411, 100000}, //Infernus
- {495, 250000} //Sandking
- };
- enum E_VEHICLE_CORE_DATA
- {
- bool:vdata_windows,
- vdata_seatcount,
- vdata_fueltype,
- vdata_trunklimit
- }
- new CoreVehicleData[212][E_VEHICLE_CORE_DATA] =
- {
- //Windows Seats Fuel Type Trunk Limit
- {true, 4, FUEL_DIESEL, 5}, //Landstalker
- {true, 2, FUEL_GASOLINA, 4}, //Bravura
- {true, 2, FUEL_GASOLINA, 3}, //Buffalo
- {true, 2, FUEL_DIESEL, 0}, //Linerunner
- {true, 4, FUEL_GASOLINA, 5}, //Perenial
- {true, 4, FUEL_GASOLINA, 4}, //Sentinel
- {true, 1, FUEL_DIESEL, 0}, //Dumper
- {true, 2, FUEL_DIESEL, 8}, //Firetruck
- {true, 2, FUEL_DIESEL, 8}, //Trashmaster
- {true, 4, FUEL_GASOLINA, 4}, //Stretch
- {true, 2, FUEL_GASOLINA, 3}, //Manana
- {true, 2, FUEL_GASOLINA, 2}, //Infernus
- {true, 2, FUEL_GASOLINA, 3}, //Voodoo
- {true, 4, FUEL_DIESEL, 10}, //Pony
- {true, 2, FUEL_DIESEL, 10}, //Mule
- {true, 2, FUEL_GASOLINA, 2}, //Cheetah
- {true, 4, FUEL_DIESEL, 8}, //Ambulance
- {true, 2, FUEL_GASOLINA, 10}, //Leviathan
- {true, 4, FUEL_GASOLINA, 9}, //Moonbeam
- {true, 2, FUEL_GASOLINA, 4}, //Esperanto
- {true, 4, FUEL_GASOLINA, 3}, //Taxi
- {true, 4, FUEL_GASOLINA, 3}, //Washington
- {true, 2, FUEL_DIESEL, 6}, //Bobcat
- {true, 2, FUEL_DIESEL, 8}, //Mr Whoopee
- {false, 2, FUEL_DIESEL, 1}, //BF Injection
- {true, 1, FUEL_GASOLINA, 0}, //Hunter
- {true, 4, FUEL_GASOLINA, 3}, //Premier
- {true, 4, FUEL_DIESEL, 9}, //Enforcer
- {true, 4, FUEL_DIESEL, 9}, //Securicar
- {true, 2, FUEL_GASOLINA, 2}, //Banshee
- {false, 1, FUEL_GASOLINA, 0}, //Predator
- {false, 8, FUEL_DIESEL, 8}, //Bus
- {false, 1, FUEL_DIESEL, 0}, //Rhino
- {true, 2, FUEL_DIESEL, 10}, //Barracks
- {true, 2, FUEL_GASOLINA, 2}, //Hotknife
- {false, 1, FUEL_NONE, 10}, //Artigo Trailer
- {true, 2, FUEL_GASOLINA, 3}, //Previon
- {false, 8, FUEL_DIESEL, 8}, //Coach
- {true, 4, FUEL_GASOLINA, 3}, //Cabbie
- {true, 2, FUEL_GASOLINA, 3}, //Stallion
- {true, 4, FUEL_DIESEL, 9}, //Rumpo
- {false, 1, FUEL_GASOLINA, 0}, //RC Bandit
- {true, 2, FUEL_GASOLINA, 8}, //Romero
- {true, 2, FUEL_DIESEL, 0}, //Packer
- {true, 2, FUEL_DIESEL, 7}, //Monster
- {true, 4, FUEL_GASOLINA, 4}, //Admiral
- {false, 1, FUEL_GASOLINA, 0}, //Squallo
- {true, 2, FUEL_GASOLINA, 0}, //Seasparrow
- {false, 1, FUEL_GASOLINA, 1}, //Pizzaboy
- {false, 1, FUEL_GASOLINA, 0}, //Tram
- {false, 1, FUEL_NONE, 10}, //Artigo Trailer 2
- {true, 2, FUEL_GASOLINA, 2}, //Turismo
- {false, 1, FUEL_GASOLINA, 0}, //Speeder
- {false, 1, FUEL_GASOLINA, 0}, //Reefer
- {false, 1, FUEL_GASOLINA, 0}, //Tropic
- {true, 2, FUEL_DIESEL, 10}, //Flatbed
- {true, 2, FUEL_DIESEL, 10}, //Yankee
- {false, 2, FUEL_GASOLINA, 1}, //Caddy
- {true, 4, FUEL_GASOLINA, 4}, //Solair
- {true, 4, FUEL_DIESEL, 8}, //Berkley's RC Van
- {true, 2, FUEL_GASOLINA, 0}, //Skimmer
- {false, 1, FUEL_GASOLINA, 1}, //PCJ-600
- {false, 1, FUEL_GASOLINA, 1}, //Faggio
- {false, 1, FUEL_GASOLINA, 1}, //Freeway
- {false, 1, FUEL_GASOLINA, 0}, //RC Baron
- {false, 1, FUEL_GASOLINA, 0}, //RC Raider
- {true, 4, FUEL_GASOLINA, 3}, //Glendale
- {true, 4, FUEL_GASOLINA, 3}, //Oceanic
- {false, 1, FUEL_GASOLINA, 1}, //Sanchez
- {true, 2, FUEL_GASOLINA, 0}, //Sparrow
- {true, 4, FUEL_DIESEL, 7}, //Patriot
- {false, 2, FUEL_GASOLINA, 1}, //Quad
- {false, 1, FUEL_GASOLINA, 0}, //Coastguard
- {false, 1, FUEL_GASOLINA, 0}, //Dinghy
- {true, 2, FUEL_GASOLINA, 3}, //Hermes
- {true, 2, FUEL_GASOLINA, 2}, //Sabre
- {false, 1, FUEL_GASOLINA, 0}, //Rustler
- {true, 2, FUEL_GASOLINA, 2}, //ZR-350
- {true, 2, FUEL_DIESEL, 5}, //Walton
- {true, 4, FUEL_DIESEL, 4}, //Regina
- {true, 2, FUEL_GASOLINA, 2}, //Comet
- {false, 1, FUEL_NONE, 0}, //BMX
- {true, 4, FUEL_DIESEL, 10}, //Burrito
- {true, 3, FUEL_DIESEL, 9}, //Camper
- {false, 1, FUEL_GASOLINA, 0}, //Marquis
- {false, 1, FUEL_GASOLINA, 0}, //Baggage
- {false, 1, FUEL_DIESEL, 0}, //Dozer
- {true, 4, FUEL_GASOLINA, 5}, //Maverick
- {true, 2, FUEL_GASOLINA, 4}, //SAN News Maverick
- {true, 2, FUEL_DIESEL, 4}, //Rancher
- {true, 4, FUEL_DIESEL, 7}, //FBI Rancher
- {true, 2, FUEL_GASOLINA, 3}, //Virgo
- {true, 4, FUEL_GASOLINA, 3}, //Greenwood
- {false, 1, FUEL_GASOLINA, 0}, //Jetmax
- {false, 2, FUEL_GASOLINA, 2}, //Hotring Racer
- {true, 2, FUEL_DIESEL, 4}, //Sandking
- {true, 2, FUEL_GASOLINA, 3}, //Blista Compact
- {true, 4, FUEL_GASOLINA, 5}, //Police Maverick
- {true, 4, FUEL_DIESEL, 8}, //Boxville
- {true, 2, FUEL_DIESEL, 8}, //Benson
- {true, 2, FUEL_DIESEL, 2}, //Mesa
- {false, 1, FUEL_GASOLINA, 0}, //RC Goblin
- {false, 2, FUEL_GASOLINA, 2}, //Hotring Racer
- {false, 2, FUEL_GASOLINA, 2}, //Hotring Racer
- {false, 2, FUEL_GASOLINA, 3}, //Bloodring Banger
- {true, 2, FUEL_DIESEL, 4}, //Rancher
- {true, 2, FUEL_GASOLINA, 2}, //Super GT
- {true, 4, FUEL_GASOLINA, 4}, //Elegant
- {true, 2, FUEL_DIESEL, 10}, //Journey
- {false, 1, FUEL_NONE, 0}, //Bike
- {false, 1, FUEL_NONE, 0}, //Mountain Bike
- {true, 2, FUEL_GASOLINA, 0}, //Beagle
- {true, 1, FUEL_GASOLINA, 0}, //Cropduster
- {true, 1, FUEL_GASOLINA, 0}, //Stuntplane
- {true, 2, FUEL_DIESEL, 0}, //Tanker
- {true, 2, FUEL_DIESEL, 0}, //Roadtrain
- {true, 4, FUEL_GASOLINA, 3}, //Nebula
- {true, 2, FUEL_GASOLINA, 3}, //Majestic
- {true, 2, FUEL_GASOLINA, 3}, //Buccaneer
- {false, 1, FUEL_GASOLINA, 0}, //Shamal
- {false, 1, FUEL_GASOLINA, 0}, //Hydra
- {false, 2, FUEL_GASOLINA, 1}, //FCR-900
- {false, 2, FUEL_GASOLINA, 1}, //NRG-500
- {false, 2, FUEL_GASOLINA, 1}, //Cop Bike HPV1000
- {true, 2, FUEL_DIESEL, 0}, //Cement Truck
- {true, 2, FUEL_DIESEL, 0}, //Towtruck
- {true, 2, FUEL_GASOLINA, 2}, //Fortune
- {true, 2, FUEL_GASOLINA, 2}, //Cadrona
- {true, 2, FUEL_DIESEL, 6}, //FBI Truck
- {true, 4, FUEL_GASOLINA, 3}, //Willard
- {false, 1, FUEL_DIESEL, 0}, //Forklift
- {false, 1, FUEL_DIESEL, 0}, //Tractor
- {true, 1, FUEL_DIESEL, 0}, //Combine Harvester
- {true, 2, FUEL_GASOLINA, 3}, //Feltzer
- {true, 2, FUEL_GASOLINA, 4}, //Remington
- {true, 2, FUEL_DIESEL, 4}, //Slamvan
- {true, 2, FUEL_GASOLINA, 3}, //Blade
- {false, 1, FUEL_DIESEL, 0}, //Freight (Train)
- {false, 1, FUEL_DIESEL, 0}, //Brownstreak (Train)
- {false, 1, FUEL_GASOLINA, 0}, //Vortex
- {true, 4, FUEL_GASOLINA, 3}, //Vincent
- {true, 2, FUEL_GASOLINA, 2}, //Bullet
- {true, 2, FUEL_GASOLINA, 3}, //Clover
- {true, 2, FUEL_DIESEL, 5}, //Sadler
- {true, 2, FUEL_DIESEL, 10}, //Firetruck LA
- {true, 2, FUEL_GASOLINA, 3}, //Hustler
- {true, 4, FUEL_GASOLINA, 3}, //Intruder
- {true, 4, FUEL_GASOLINA, 3}, //Primo
- {false, 2, FUEL_GASOLINA, 10}, //Cargobob
- {true, 2, FUEL_GASOLINA, 3}, //Tampa
- {true, 4, FUEL_GASOLINA, 3}, //Sunrise
- {true, 4, FUEL_GASOLINA, 3}, //Merit
- {true, 2, FUEL_DIESEL, 6}, //Utility Van
- {false, 1, FUEL_GASOLINA, 8}, //Nevada
- {true, 2, FUEL_DIESEL, 6}, //Yosemite
- {true, 2, FUEL_GASOLINA, 2}, //Windsor
- {true, 2, FUEL_DIESEL, 5}, //Monster "A"
- {true, 2, FUEL_DIESEL, 5}, //Monster "B"
- {true, 2, FUEL_GASOLINA, 3}, //Uranus
- {true, 2, FUEL_GASOLINA, 3}, //Jester
- {true, 4, FUEL_GASOLINA, 4}, //Sultan
- {true, 4, FUEL_GASOLINA, 4}, //Stratum
- {true, 2, FUEL_GASOLINA, 3}, //Elegy
- {false, 2, FUEL_GASOLINA, 10}, //Raindance
- {false, 1, FUEL_GASOLINA, 0}, //RC Tiger
- {true, 2, FUEL_GASOLINA, 3}, //Flash
- {true, 4, FUEL_GASOLINA, 3}, //Tahoma
- {true, 4, FUEL_GASOLINA, 3}, //Savanna
- {false, 1, FUEL_GASOLINA, 0}, //Bandito
- {false, 1, FUEL_NONE, 0}, //Freight Flat Trailer (Train)
- {false, 4, FUEL_NONE, 0}, //Streak Trailer (Train)
- {false, 1, FUEL_GASOLINA, 0}, //Kart
- {false, 1, FUEL_DIESEL, 0}, //Mower
- {true, 2, FUEL_DIESEL, 8}, //Dune
- {true, 1, FUEL_DIESEL, 0}, //varrerer
- {true, 2, FUEL_GASOLINA, 3}, //Broadway
- {true, 2, FUEL_GASOLINA, 3}, //Tornado
- {false, 1, FUEL_GASOLINA, 8}, //AT400
- {true, 2, FUEL_DIESEL, 0}, //DFT-30
- {true, 4, FUEL_DIESEL, 5}, //Huntley
- {true, 4, FUEL_GASOLINA, 4}, //Stafford
- {false, 1, FUEL_GASOLINA, 1}, //BF-400
- {true, 4, FUEL_DIESEL, 7}, //Newsvan
- {true, 1, FUEL_GASOLINA, 0}, //Tug
- {false, 1, FUEL_NONE, 0}, //Petrol Trailer
- {true, 4, FUEL_GASOLINA, 3}, //Emperor
- {false, 2, FUEL_GASOLINA, 1}, //Wayfarer
- {true, 2, FUEL_GASOLINA, 2}, //Euros
- {true, 2, FUEL_DIESEL, 5}, //Hotdog
- {true, 2, FUEL_GASOLINA, 3}, //Club
- {false, 1, FUEL_NONE, 0}, //Freight Box Trailer (Train)
- {false, 1, FUEL_NONE, 10}, //Artigo Trailer 3
- {false, 1, FUEL_GASOLINA, 10}, //Andromada
- {true, 2, FUEL_GASOLINA, 2}, //Dodo
- {false, 1, FUEL_GASOLINA, 0}, //RC Cam
- {false, 1, FUEL_GASOLINA, 0}, //Launch
- {true, 4, FUEL_GASOLINA, 4}, //Police Car (LSPD)
- {true, 4, FUEL_GASOLINA, 4}, //Police Car (SFPD)
- {true, 4, FUEL_GASOLINA, 4}, //Police Car (LVPD)
- {true, 2, FUEL_DIESEL, 5}, //Police Ranger
- {true, 2, FUEL_GASOLINA, 3}, //Picador
- {false, 2, FUEL_DIESEL, 5}, //S.W.A.T.
- {true, 2, FUEL_GASOLINA, 2}, //Alpha
- {true, 2, FUEL_GASOLINA, 2}, //Phoenix
- {true, 4, FUEL_GASOLINA, 3}, //Glendale Shit
- {true, 4, FUEL_GASOLINA, 4}, //Sadler Shit
- {false, 1, FUEL_NONE, 0}, //Baggage Trailer "A"
- {false, 1, FUEL_NONE, 0}, //Baggage Trailer "B"
- {false, 1, FUEL_NONE, 0}, //Tug Stairs Trailer
- {true, 4, FUEL_DIESEL, 8}, //Boxville
- {false, 1, FUEL_NONE, 0}, //Farm Trailer
- {false, 1, FUEL_NONE, 0} //Utility Trailer
- };
- new Float:VehiclePetrolCapPos[][4] =
- {
- {400.0, -1.10, -2.06, -0.07},
- {401.0, 1.09, -0.94, 0.00},
- {402.0, 1.04, -1.92, 0.14},
- {403.0, -1.45, 0.07, -0.80},
- {404.0, -0.94, -2.36, -0.01},
- {405.0, -1.04, -2.18, -0.04},
- {407.0, -1.11, -3.66, -0.54},
- {408.0, -1.23, 1.30, -0.66},
- {409.0, -0.98, -2.83, 0.12},
- {410.0, -1.02, -1.67, 0.21},
- {411.0, 1.09, -2.10, 0.09},
- {412.0, 0.0, -3.55, -0.17},
- {413.0, -1.05, 0.34, -0.53},
- {414.0, -0.92, -0.74, -0.70},
- {415.0, -1.13, -2.07, 0.02},
- {416.0, -1.35, -2.74, -0.19},
- {418.0, -1.18, -1.77, -0.02},
- {418.0, 1.21, -1.57, -0.08},
- {419.0, -1.08, -1.99, 0.03},
- {420.0, -1.10, -2.15, 0.10},
- {421.0, -1.07, -2.44, -0.17},
- {422.0, -1.08, -0.42, -0.20},
- {423.0, -1.17, -1.90, -0.32},
- {424.0, 0.18, 1.08, 0.43},
- {426.0, -1.10, -2.15, 0.09},
- {427.0, -1.27, -3.20, -0.16},
- {428.0, -1.01, -3.06, -0.49},
- {429.0, 0.99, -2.14, 0.14},
- {431.0, -1.45, -5.47, -0.13},
- {433.0, -1.52, 0.16, -0.68},
- {434.0, -0.73, -1.58, 0.29},
- {436.0, -1.07, -1.82, 0.14},
- {437.0, -1.49, -4.97, -0.50},
- {438.0, -1.09, -1.93, -0.02},
- {439.0, -1.11, -1.51, 0.06},
- {440.0, -1.09, -0.46, -0.42},
- {442.0, -1.21, -2.21, 0.06},
- {443.0, -1.53, 1.24, -0.90},
- {444.0, 0.0, -2.60, -0.06},
- {445.0, -1.04, -1.94, 0.13},
- {446.0, -1.30, -3.0, 1.2},
- {451.0, 1.06, -1.22, -0.04},
- {452.0, -1.0, -2.50, 1.20},
- {453.0, 0.0, 5.80, 2.0},
- {454.0, 1.4, -4.1, 1.0},
- {455.0, -1.53, -0.01, -0.76},
- {456.0, 0.79, -0.05, -0.61},
- {458.0, -1.11, -2.05, -0.11},
- {459.0, -0.82, -2.39, -0.48},
- {459.0, -1.05, -2.29, 0.22},
- {461.0, 0.0, 0.14, 0.54},
- {463.0, 0.0, 0.17, 0.47},
- {466.0, 0.0, -3.00, -0.13},
- {467.0, -1.07, -2.30, 0.12},
- {468.0, 0.0, 0.01, 0.41},
- {470.0, -1.26, -2.38, 0.24},
- {472.0, -0.5, -2.3, 0.5},
- {473.0, -0.5, -1.0, 1.0},
- {475.0, -1.07, -1.60, 0.13},
- {477.0, -1.20, -1.53, 0.24},
- {478.0, 1.09, -0.34, 0.23},
- {479.0, -1.09, -1.97, 0.03},
- {480.0, -1.00, -0.88, 0.10},
- {482.0, 1.07, -2.19, 0.00},
- {483.0, 0.93, -2.51, -0.04},
- {484.0, -1.5, -6.0, 1.8},
- {485.0, -0.89, 0.72, 0.02},
- {486.0, -0.70, -3.17, 0.58},
- {489.0, 1.16, -0.74, 0.00},
- {490.0, 1.37, -1.25, 0.00},
- {491.0, -1.07, -2.18, 0.00},
- {492.0, -0.98, -2.24, 0.12},
- {494.0, -1.02, -2.20, 0.12},
- {495.0, 1.21, -1.91, -0.10},
- {496.0, 1.06, -1.86, 0.15},
- {498.0, -1.30, -0.01, 0.09},
- {499.0, -1.11, -1.07, -0.35},
- {500.0, -0.98, -1.71, -0.07},
- {502.0, -1.08, -1.88, 0.14},
- {503.0, -1.10, -2.05, 0.03},
- {504.0, 0.0, -3.00, -0.13},
- {504.0, -1.16, -1.83, 0.11},
- {505.0, 1.16, -0.74, 0.00},
- {506.0, 1.05, -1.11, -0.05},
- {507.0, -1.17, -2.30, 0.11},
- {508.0, -1.38, -3.05, -0.67},
- {514.0, 1.43, 0.38, -0.65},
- {515.0, -1.45, 0.48, -1.31},
- {516.0, -1.10, -2.45, -0.03},
- {517.0, -1.18, -1.95, 0.07},
- {518.0, 1.21, -2.19, -0.07},
- {521.0, 0.0, 0.13, 0.61},
- {522.0, 0.0, 0.14, 0.61},
- {523.0, 0.0, 0.15, 0.55},
- {524.0, 1.53, 0.48, -0.99},
- {525.0, -1.39, -0.51, -0.09},
- {526.0, -0.99, -1.96, 0.06},
- {527.0, -1.14, -1.69, 0.14},
- {528.0, -1.09, -2.03, 0.12},
- {529.0, -1.20, -2.22, 0.20},
- {531.0, -0.01, 0.82, 0.43},
- {533.0, 1.02, -1.96, 0.14},
- {534.0, -1.04, -0.82, -0.20},
- {535.0, -1.20, -0.56, 0.27},
- {536.0, -1.07, -1.69, 0.09},
- {540.0, -1.17, -2.52, -0.02},
- {541.0, 1.01, -1.99, 0.15},
- {542.0, -1.12, -1.92, 0.31},
- {543.0, -1.10, -0.95, 0.00},
- {544.0, -1.30, 2.07, 0.32},
- {545.0, 0.0, -2.22, -0.32},
- {546.0, 1.09, -2.03, 0.15},
- {547.0, -1.17, -2.01, 0.12},
- {549.0, -1.08, -1.18, 0.22},
- {550.0, -1.07, -2.49, 0.04},
- {551.0, -1.15, -2.67, 0.09},
- {552.0, -1.29, -0.96, 0.49},
- {554.0, 1.21, -2.39, 0.12},
- {555.0, -0.79, -1.50, 0.18},
- {557.0, 1.19, -2.57, 0.85},
- {558.0, -1.09, -1.94, 0.27},
- {559.0, -1.08, -1.71, 0.27},
- {560.0, 1.14, -1.90, 0.13},
- {561.0, 1.11, -2.30, 0.11},
- {562.0, 1.04, -0.70, 0.07},
- {565.0, 0.91, -0.87, 0.03},
- {566.0, 1.08, -2.44, 0.02},
- {567.0, 0.0, -2.86, -0.46},
- {568.0, -0.50, -0.66, 0.38},
- {571.0, 0.0, 0.19, 0.02},
- {572.0, -0.38, -0.97, 0.16},
- {573.0, -1.18, 0.48, -0.48},
- {574.0, -0.75, -0.97, 0.28},
- {575.0, 0.0, -2.78, -0.05},
- {576.0, 0.0, -3.16, -0.25},
- {578.0, -1.24, 2.91, -0.02},
- {579.0, 1.22, -2.30, 0.17},
- {580.0, 1.19, -1.82, 0.24},
- {581.0, 0.0, 0.13, 0.54},
- {582.0, -1.06, 0.14, -0.28},
- {583.0, -0.76, 0.41, -0.06},
- {584.0, 0.0, 0.0, 0.00},
- {585.0, 1.14, -2.30, 0.20},
- {587.0, -1.23, -1.22, 0.10},
- {588.0, -1.46, -2.16, 0.22},
- {589.0, 0.98, -0.89, 0.12},
- {596.0, -1.11, -2.16, 0.10},
- {597.0, -1.10, -2.15, 0.10},
- {598.0, -1.08, -1.96, 0.16},
- {599.0, 1.16, -0.74, 0.00},
- {600.0, 1.09, -2.03, 0.08},
- {601.0, -1.33, -1.69, 0.92},
- {602.0, 1.09, -1.99, 0.11},
- {603.0, 1.18, -2.19, -0.08},
- {604.0, 0.0, -3.00, -0.13},
- {605.0, -1.10, -0.95, 0.00},
- {609.0, -1.30, 0.0, 0.10}
- };
- new Float:VehicleEnginePos[][2] =
- {
- {400.0, 1.544},
- {401.0, 1.77},
- {402.0, 1.47},
- {403.0, 3.30},
- {404.0, 1.61},
- {405.0, 1.721},
- {406.0, 4.97},
- {407.0, 3.958},
- {408.0, 4.406},
- {409.0, 2.73},
- {410.0, 1.55},
- {411.0, 1.82},
- {412.0, 1.64},
- {413.0, 2.161},
- {414.0, 2.36},
- {415.0, -1.603},
- {416.0, 2.54},
- {417.0, 1.55},
- {418.0, 2.00},
- {419.0, 1.53},
- {420.0, 1.61},
- {421.0, 2.001},
- {422.0, 1.711},
- {423.0, 2.04},
- {424.0, -1.606},
- {426.0, 1.61},
- {427.0, 2.65},
- {428.0, 2.36},
- {429.0, 1.37},
- {431.0, -5.4801},
- {433.0, 2.98},
- {434.0, 1.657},
- {436.0, 1.884},
- {437.0, -5.1385},
- {438.0, 1.82},
- {439.0, 1.54},
- {440.0, 2.018},
- {442.0, 1.984},
- {443.0, 5.17},
- {444.0, 1.95},
- {445.0, 1.65},
- {446.0, -2.706},
- {448.0, -0.8922},
- {451.0, -1.531},
- {453.0, 3.42},
- {454.0, -4.710},
- {455.0, 3.68},
- {456.0, 3.11},
- {457.0, 0.96},
- {458.0, 1.810},
- {459.0, 2.161},
- {460.0, 2.48},
- {461.0, 0.00},
- {462.0, -0.8922},
- {463.0, 0.22},
- {466.0, 1.62},
- {467.0, 1.72},
- {468.0, 0.18},
- {470.0, 1.48},
- {472.0, -3.493},
- {474.0, 1.62},
- {475.0, 1.54},
- {476.0, 2.135},
- {477.0, 1.556},
- {478.0, 1.56},
- {479.0, 1.70},
- {480.0, 1.30},
- {482.0, 2.049},
- {483.0, -2.7454},
- {485.0, 1.21},
- {486.0, -3.191},
- {489.0, 1.72},
- {490.0, 2.26},
- {491.0, 1.493},
- {492.0, 1.64},
- {493.0, -2.662},
- {494.0, 1.626},
- {495.0, 1.68},
- {496.0, 1.51},
- {498.0, 2.76},
- {499.0, 1.90},
- {500.0, 1.439},
- {502.0, 1.623},
- {503.0, 1.463},
- {504.0, 1.62},
- {505.0, 1.72},
- {506.0, 1.227},
- {507.0, 1.78},
- {508.0, 2.72},
- {511.0, 0.52},
- {513.0, 1.80},
- {514.0, 3.32},
- {515.0, 3.83},
- {516.0, 1.82},
- {517.0, 1.786},
- {518.0, 1.81},
- {519.0, -5.459},
- {520.0, -2.3402},
- {521.0, 0.11},
- {522.0, 0.17},
- {523.0, 0.11},
- {524.0, 2.85},
- {525.0, 2.35},
- {526.0, 1.53},
- {527.0, 1.73},
- {528.0, 1.69},
- {529.0, 1.73},
- {530.0, -0.9601},
- {531.0, 0.89},
- {532.0, -1.843},
- {533.0, 1.67},
- {534.0, 1.861},
- {535.0, 1.72},
- {536.0, 1.69},
- {540.0, 1.807},
- {541.0, -0.985},
- {542.0, 1.513},
- {543.0, 1.58},
- {544.0, 3.48},
- {545.0, 0.98},
- {546.0, 1.75},
- {547.0, 1.631},
- {549.0, 1.746},
- {550.0, 1.87},
- {551.0, 1.991},
- {552.0, 2.26},
- {553.0, 5.619},
- {554.0, 1.67},
- {555.0, 1.533},
- {557.0, 1.81},
- {558.0, 1.355},
- {559.0, 1.51},
- {560.0, 1.73},
- {561.0, 1.97},
- {562.0, 1.92},
- {563.0, -2.443},
- {565.0, 1.738},
- {566.0, 1.71},
- {567.0, 1.99},
- {568.0, -0.985},
- {571.0, -0.4714},
- {572.0, 0.55},
- {573.0, 3.14},
- {574.0, -0.613},
- {575.0, 1.61},
- {576.0, 1.59},
- {578.0, 4.483},
- {579.0, 1.58},
- {580.0, 2.18},
- {581.0, 0.14},
- {582.0, 2.08},
- {583.0, 0.73},
- {583.0, 1.47},
- {585.0, 2.28},
- {586.0, 0.14},
- {587.0, 1.461},
- {588.0, -4.0714},
- {589.0, 1.81},
- {593.0, 2.45},
- {595.0, -3.570},
- {596.0, 1.61},
- {597.0, 1.61},
- {598.0, 1.57},
- {600.0, 1.834},
- {601.0, -2.590},
- {602.0, 1.52},
- {603.0, 1.609},
- {604.0, 1.62},
- {605.0, 1.58},
- {609.0, 2.76}
- };
- new TestData_Speeds[6][] =
- {
- {40, 40, 40, 40, 40, 60, 60, 60, 60, 60, 60, 60, 40, 40, 40, 100, 100, 100, 100, 100, 60, 60, 60, 60, 40, 40, 40}, //Car
- {60, 60, 60, 60, 60, 40, 30, 30, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 40, 40, 40, 40}, // Large veh
- {40, 40, 40, 40, 60, 60, 40, 40, 40, 40, 40, 40, 60, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40}, // Bike
- {70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70}, // Boat
- {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, //Heli
- {150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150} //Plane
- };
- new Float:TestData_Points[6][26][3] =
- {
- {
- {1253.279296, 159.712432, 19.481626}, //30
- {1348.547607, 220.720062, 19.406250}, //30
- {1336.380249, 307.492401, 19.410152}, //30
- {1297.849853, 274.317291, 19.406250}, //30
- {1215.037109, 321.561981, 19.406250}, //30
- {1094.978881, 445.021545, 24.542070}, //70
- {810.709655, 338.197143, 19.890584}, //70
- {526.414367, 38.386974, 21.241977}, //70
- {775.031433, -167.662368, 18.508840}, //70
- {1230.040161, -283.893493, 15.605036}, //70
- {1598.603759, -322.488739, 16.190290}, //70
- {1981.954467, 37.291904, 31.965709}, //70
- {2226.518798, 119.537902, 26.335937}, //30
- {2291.460693, 118.979820, 26.335937}, //30
- {2345.670654, 121.959236, 26.335937}, //30
- {2375.644531, 401.088287, 28.734138}, //100
- {1929.878173, 308.924285, 31.993343}, //100
- {1596.357421, 361.049346, 24.516471}, //100
- {1558.575439, 275.965393, 21.020668}, //100
- {2295.876464, 289.829254, 30.887174}, //70
- {2238.797607, 221.400894, 14.686321}, //70
- {1900.270385, 358.955078, 20.290184}, //70
- {1429.453613, 422.602752, 19.890598}, //30
- {1323.500976, 331.995788, 19.408132}, //30
- {1269.169677, 208.953903, 19.406250}, //30
- {1251.048339, 120.717147, 20.361856} //0
- },
- {
- {1234.689941, 66.684043, 22.600194}, //60
- {1215.809692, -141.543563, 39.616107}, //70
- {750.693603, -160.286087, 18.581966}, //70
- {502.050750, -262.327850, 39.385219}, //60
- {268.112915, -372.900665, 8.713446}, //30
- {190.056106, -316.374237, 1.448557}, //20
- {140.264999, -262.696472, 1.452970}, //20
- {32.869297, -206.673736, 1.351778}, //60
- {-281.919860, -221.144729, 0.953270}, //60
- {-494.853729, -270.027526, 49.481170}, //60
- {-938.981323, -207.675643, 40.882438}, //60
- {-669.101196, -10.072995, 71.190605}, //60
- {-878.105224, -23.663892, 33.118957}, //60
- {-669.0, 82.945991, 26.015283}, //60
- {-680.696166, 247.362106, 1.953194}, //60
- {-353.165466, 269.714172, 1.953104}, //60
- {-193.049484, 260.973388, 11.953095}, //60
- {-154.917007, 403.593933, 11.953198}, //70
- {-78.918869, 546.030456, 7.049720}, //70
- {173.339904, 701.057861, 6.002284}, //70
- {473.065093, 534.144165, 18.800695}, //60
- {880.227172, 351.548034, 19.761680}, //60
- {1119.297973, 418.185302, 26.772655}, //30
- {1292.119506, 323.161590, 19.281248}, //30
- {1298.762329, 275.274139, 19.281284}, //30
- {1242.619506, 141.190917, 19.663064} //30
- },
- {
- {1237.370727, 116.746482, 20.140504}, //30
- {1197.363891, 55.334690, 32.789356}, //50
- {1011.118957, -4.742921, 91.528015}, //50
- {614.692077, -74.196609, 16.962862}, //50
- {524.248779, 139.466522, 23.379089}, //60
- {303.107788, 73.814811, 2.361259}, //30
- {230.406616, -44.578464, 1.099050}, //30
- {307.276855, -73.672424, 1.099109}, //30
- {330.188446, -163.301712, 0.998622}, //30
- {257.034454, -209.536087, 1.101479}, //30
- {-29.166482, -201.361297, 1.273066}, //30
- {-278.591369, -227.274673, 0.747675}, //70
- {37.627002, -531.002746, 9.779790}, //70
- {99.235527, -679.631713, 5.583945}, //70
- {353.754974, -576.252502, 39.787429}, //70
- {649.115661, -662.528137, 16.445812}, //30
- {684.221252, -587.995849, 15.854187}, //30
- {692.363281, -487.384857, 15.861055}, //30
- {764.527832, -532.431335, 15.856140}, //30
- {805.706298, -597.183410, 15.856494}, //30
- {973.753845, -495.654876, 46.391864}, //70
- {1245.927612, -312.233032, 9.441629}, //70
- {1357.029907, -33.404705, 34.155536}, //70
- {1403.778076, 201.228713, 19.173013}, //30
- {1277.191528, 227.276855, 19.406250}, //30
- {1246.317260, 153.071853, 19.254339} //30
- },
- {
- {2032.763549, -141.704177, 0.0}, //0
- {1903.601318, -51.722095, 0.0}, //1
- {1876.952758, -72.852195, 0.0}, //2
- {1863.566162, -36.855712, 0.0}, //3
- {1745.359130, -20.377025, 0.0}, //4
- {1634.117187, -3.680907, 0.0}, //5
- {1591.023925, -140.777221, 0.0}, //6
- {1435.534545, -247.643569, 0.0}, //7
- {1415.453369, -273.604766, 0.0}, //8
- {1348.204101, -247.988189, 0.0}, //9
- {1256.197143, -187.631835, 0.0}, //10
- {1236.540283, -157.754821, 0.0}, //11
- {1156.716308, -111.494827, 0.0}, //12
- {946.624694, -120.516479, 0.0}, //13
- {800.343505, -162.588012, 0.0}, //14
- {733.453918, -211.961822, 0.0}, //15
- {722.430725, -201.109603, 0.0}, //16
- {629.344238, -227.980056, 0.0}, //17
- {487.909393, -253.900451, 0.0}, //18
- {374.905548, -298.425781, 0.0}, //19
- {286.331268, -348.986419, 0.0}, //20
- {280.276062, -377.610595, 0.0}, //21
- {204.130798, -412.941802, 0.0}, //22
- {52.006771, -513.547973, 0.0}, //23
- {-58.177913, -587.004272, 0.0}, //24
- {-326.921569, -461.499267, 0.0} //25
- },
- {
- {288.113647, 2502.708496, 36.165565}, //HeliDMV
- {45.668056, 2427.631103, 55.895317}, //HeliDMV
- {-116.628852, 2316.501220, 86.201423}, //HeliDMV
- {-253.150512, 2233.591796, 80.766868}, //HeliDMV
- {-401.515594, 2136.604003, 75.548027}, //HeliDMV
- {-529.032043, 2081.748779, 85.881576}, //HeliDMV
- {-651.535217, 2123.420410, 49.055259}, //HeliDMV
- {-787.485290, 2118.696777, 48.000366}, //HeliDMV
- {-912.257934, 2152.714355, 61.863826}, //HeliDMV
- {-1056.443481, 2182.326904, 71.205299}, //HeliDMV
- {-1237.967651, 2141.029296, 63.998222}, //HeliDMV
- {-1546.709228, 2135.215820, 119.253021}, //HeliDMV
- {-1926.933349, 2201.380615, 66.379951}, //HeliDMV
- {-2124.384277, 2274.249755, 33.951011}, //HeliDMV
- {-2228.705078, 2326.380859, 7.557880}, //HeliDMV
- {-2223.583984, 2344.642089, 36.809825}, //HeliDMV
- {-2086.193847, 2493.559326, 71.993087}, //HeliDMV
- {-1852.676025, 2579.475097, 95.765739}, //HeliDMV
- {-1631.302612, 2656.908935, 96.830108}, //HeliDMV
- {-1237.802490, 2714.008789, 80.278579}, //HeliDMV
- {-819.214294, 2707.595458, 82.890762}, //HeliDMV
- {-554.495422, 2624.213623, 106.742851}, //HeliDMV
- {-427.424652, 2506.665527, 124.314620}, //HeliDMV
- {-276.033477, 2460.294433, 93.464996}, //HeliDMV
- {145.019638, 2473.969482, 40.453781}, //HeliDMV
- {384.393768, 2537.514160, 18.859704} //HeliDMV
- },
- {
- {209.468429, 2503.270263, 16.938016}, //PlaneDMV
- {77.840866, 2504.757568, 23.816213}, //PlaneDMV
- {-202.071853, 2507.939941, 89.873214}, //PlaneDMV
- {-415.495208, 2508.040039, 128.980484}, //PlaneDMV
- {-794.363525, 2480.334716, 131.508239}, //PlaneDMV
- {-1052.210083, 2376.559326, 123.012329}, //PlaneDMV
- {-1308.836059, 2052.088867, 101.294204}, //PlaneDMV
- {-1402.076782, 1777.898803, 100.363945}, //PlaneDMV
- {-1327.087768, 1407.222534, 59.498603}, //PlaneDMV
- {-1187.872070, 1071.517456, 27.005626}, //PlaneDMV
- {-1050.593017, 922.253784, 16.970924}, //PlaneDMV
- {-776.171325, 781.234863, 61.757137}, //12
- {-475.480377, 1056.377197, 17.202199}, //13
- {-448.609222, 1214.974609, 16.467258}, //14
- {-356.437133, 1438.854492, 94.323654}, //15
- {-272.268127, 1631.997680, 105.140449}, //16
- {-213.937515, 1894.308837, 78.327537}, //17
- {-36.439117, 2238.674804, 68.471153}, //18
- {-100.063148, 2637.113525, 50.593143}, //19
- {-55.997966, 2793.968750, 91.764480}, //20
- {258.134918, 2878.197753, 96.522811}, //21
- {584.841186, 2746.077636, 95.435096}, //22
- {530.313598, 2509.010742, 67.416152}, //23
- {369.488067, 2508.447998, 36.158592}, //24
- {264.002838, 2508.075927, 23.220172}, //25
- {100.263999, 2507.374267, 16.486967} //26
- }
- };
- enum TRUCK_ROUTES_MAIN
- {
- TruckRouteStart[50],
- TruckRouteEnd[50],
- TruckRouteLoad[25],
- TruckRouteTrailerID,
- Float:TruckRoutePoints[6]
- };
- new TruckRoutes[][TRUCK_ROUTES_MAIN] =
- {
- // Start Location End Location Item TrailerID Coordinates (StartXYZ + EndXYZ)
- {"Angel Pine Warehouse", "Blueberry Brewery", "Hops", 450, {-2096.2075,-2243.8098,30.6250, -182.6316,-279.1250,1.4297}},
- {"Bone County Airstrip", "Dillimore Police Department", "Weapons and Uniforms", 591, {382.6058,2539.4209,16.5391, 617.7202,-535.4534,16.3359}},
- {"Bone County Airstrip", "Easter Basin Military Docks", "Military Rations", 435, {382.6058,2539.4209,16.5391, -1568.0803,371.8923,7.1875}},
- {"Bone County Sanitation Center", "The Junk Yard", "Waste", 450, {661.880432,1260.257812,11.460937, -1888.648193,-1711.435302,21.75}},
- {"Clowns Pocket Casino", "Willowfield Junk Yard", "Trash", 450, {2350.5405,1887.8649,10.7673, 2100.0115,-2016.2137,13.5544}},
- {"Easter Basin Docks", "SACFD Station 49", "Medical Supplies", 435, {-1724.2080,-124.4791,3.5391, 1486.2872,421.3242,20.2344}},
- {"Easter Basin Docks", "The Las Venturas Shopping Center", "Clothing", 435, {-1730.56726,122.623855,3.554687, 2790.565917,2588.198974,10.820312}},
- {"Flint Trucking & Logistics", "The Angel Pine Warehouse", "Furniture", 435, {-520.128295,-487.375518,25.523437, -1975.571533,-2443.841796,30.625}},
- {"Fort Carson Docks", "All Saints Hospital", "Medical Supplies", 435, {139.3249,493.5935,3.5082, 1136.7213,-1326.6429,13.5778}},
- {"LVA Freight Depot", "Foster Valley Loading Bay", "Computers & Hardware", 591, {1696.647583,1039.302490,10.820312, -1945.413085,-1079.389404,30.773437}},
- {"Las Venturas Airport", "Bayside", "Luxury Furniture", 435, {1646.304809,1607.219116,10.820312, -2450.2854,2233.165771,4.84375}},
- {"Linden Train Station", "Bayside", "Fishing Equipment", 591, {2783.483154,1294.444213,10.75, -2450.2854,2233.165771,4.84375}},
- {"Linden Train Station", "SANews Montgomery", "Stationary Equipment", 435, {2783.483154,1294.444213,10.75, 1206.4874,271.6524,19.5547}},
- {"Los Santos Docks", "Angel Pine Warehouse", "Raw Materials", 450, {2763.783691,-2449.661865,13.517338, -2094.907226,-2241.582763,30.6459998}},
- {"Los Santos Docks", "Dohery Construction Site", "Building Supplies", 450, {2608.298583,-2204.923095,13.546875, -2105.527343,208.266586,35.256069}},
- {"Ocean Docks Warehouse", "Las Venturas Superstore", "Consumables", 435, {2201.825195,-2301.990478,14.764669, 2551.020263,2006.57666,10.815847}},
- {"Panopticon", "Final Build Construction", "Lumber", 450, {-544.9472,-87.9012,63.3266, 2467.8865,1923.4766,9.7656}},
- {"Redsands Warehouse", "San Fierro Superstore", "Consumables", 435, {1626.93103,2332.428466,10.820312, -2470.575195,787.204162,35.171875}},
- {"Rockshore Warehouse", "Easter Basin Military Docks", "TOP SECRET", 584, {2863.607421,917.590637,10.75, -1568.0803,371.8923,7.1875}},
- {"San Fierro Docks", "L.S. Movie Studios", "Film Props", 591, {-1736.784912,143.049972,3.554687, 872.160522,-1215.897338,16.983539}},
- {"Spinybed Warehouse", "Flint Trucking & Logistics", "Consumables", 435, {2347.503662,2765.970214,10.820312, -523.790588,-555.657775,25.523437}},
- //{"Unity Train Station", "R.S. Haul", "Car Parts", 591, {1791.9257,-1926.1145,13.3896, -51.0572,-1138.9005,1.0781}},
- {"Wang Cars", "Dillimore Automotive Dealership", "Vehicles", 591, {-1917.5502,286.8438,41.0469, 624.8757,-489.9417,16.1875}},
- {"Whitewood Warehouse", "Solarin Industries", "Electronics", 591, {1134.578002,1920.179443,10.820312, -1846.028686,128.008407,15.117187}},
- {"Willowfield Storage Warehouse", "L.V. Cluckin Bell", "Raw Chicken", 435, {2085.1333,-2017.315185,13.546875, 2621.190185,1675.805541,10.820312}}
- };
- new Float:BusRoute[][] =
- {
- {-228.403884, -285.622985, 1.078125},
- {-131.622238, -191.208740, 1.849783},
- {164.217758, -213.688644, 1.430387},
- {235.394531, -152.039733, 1.42968},
- {235.474594, -56.307128, 1.430064},
- {-164.442337, 816.654785, 22.082742},
- {-847.315917, 1454.637939, 15.031031},
- {-848.403930, 1597.598876, 26.494239},
- {-1178.447875, 1825.680908, 41.371154},
- {-1338.848266, 2065.722412, 52.134159},
- {-1412.294677, 2603.687011, 55.662963},
- {-1478.622436, 2604.251708, 55.689414},
- {-1543.537109, 2638.400878, 55.687500},
- {-1453.431396, 2668.079589, 55.687500},
- {-1294.282226, 2655.356201, 49.653182},
- {-840.353027, 2724.603271, 45.705070},
- {-737.858703, 2726.650146, 46.800842},
- {-278.544616, 2627.899414, 62.708717},
- {810.602416, 1944.512084, 6.645121},
- {795.623718, 1135.431762, 28.337678},
- {392.146484, 1022.401245, 28.337120},
- {27.957468, 889.401367, 24.194349},
- {-187.980194, 1002.445312, 19.576869},
- {-302.348327, 1065.377685, 19.593750},
- {-217.845458, 1096.183715, 19.599971},
- {-188.048034, 1126.168945, 19.593921},
- {-113.574974, 1179.611083, 19.593362},
- {-37.183288, 1196.169799, 19.210937},
- {71.949043, 1196.100830, 18.583633},
- {170.101333, 1146.850097, 14.266582},
- {217.701858, 981.708740, 28.282075},
- {759.291625, 321.776458, 19.882812},
- {1221.299804, 276.698333, 19.406250},
- {1233.108520, 194.707977, 19.406250},
- {1285.038085, 232.425994, 19.406690},
- {1357.883911, 274.942779, 19.406558},
- {1368.071289, 420.724761, 19.406250},
- {2341.695068, 164.867050, 26.335937},
- {2341.633789, 55.920166, 26.335937},
- {2342.135742, -59.934383, 26.335937},
- {2296.469726, -4.258635, 26.335937},
- {2236.847167, 44.191310, 26.333230},
- {1545.254028, 117.008514, 29.428464},
- {804.042907, -528.324707, 16.187500},
- {679.055786, -557.417480, 16.187500},
- {679.336486, -637.764221, 16.187500},
- {644.035888, -584.289123, 16.187500},
- {684.197326, -503.917236, 16.187500},
- {645.763427, -451.520904, 16.187500},
- {235.517974, -231.606216, 1.430044},
- {159.087524, -209.654357, 1.429687},
- {-108.361679, -190.546813, 1.791817},
- {-261.603576, -253.297897, 1.462630},
- {-15.731720, -336.545257, 5.429687}
- };
- enum GPSDATA
- {
- Float:LocX,
- Float:LocY,
- Float:LocZ,
- LocName[120],
- LocType[24]
- };
- new GPSLocations[][GPSDATA] =
- {
- {603.1079, 1221.6053, 11.7188, "Bone County Waste Management (Side Job: Trash Collection)", "Job"},
- {-27.4859, -311.4808, 5.4229, "Red County Transport Co. (Side Job: Bus Driver)", "Job"},
- {1233.7037, 194.6645, 19.4063, "Royal Taxi Co. (Job: Taxi Driver)", "Job"},
- {846.9821, 857.8008, 13.2993, "Bone County Coal Mine (Side Job: Coal Mining)", "Job"},
- {1359.2754, 251.9335, 19.5669, "Montgomery Pizza Stack (Side Job: Pizza Delivery)", "Job"},
- {2260.4395, 28.9557, 26.4229, "Red County Sweeping Co. (Side Job: Sweeper)", "Job"},
- {67.6431, -251.9409, 1.5781, "Red County Trucking Co. (Side Job: Trucking)", "Job"},
- {-2145.9917, -2411.0684, 30.4765, "Angel Pine", "Town"},
- {-2466.2871, 2330.8267, 4.8359, "Bayside", "Town"},
- {232.2069, -141.5532, 1.4297, "Blueberry", "Town"},
- {681.5998, -529.7137, 16.18782, "Dillimore", "Town"},
- {-1495.9103, 2601.3962, 55.6871, "El Quebrados", "Town"},
- {-192.6108, 1098.6211, 19.5938, "Fort Carson", "Town"},
- {-844.3931, 1527.6359, 21.4996, "Las Barrancas", "Town"},
- {-257.1376, 2701.0754, 62.5391, "Las Payasadas", "Town"},
- {1289.4039, 249.4133, 19.4076, "Montgomery", "Town"},
- {2293.9597, 6.3699, 26.3359, "Palomino Creek", "Town"},
- {-2491.3416, 2401.3184, 15.9514, "Bayside Church", "Community"},
- {2256.8237, -30.3129, 26.3359, "Palomino Creek Church", "Community"},
- {-2173.4724, -2302.3923, 30.4688, "Angel Pine Town Hall", "Community"},
- {-197.6946, 1119.4453, 19.59799, "Fort Carson Town Hall", "Community"},
- {2261.3452, -95.9025, 26.3359, "Palomino Creek Town Hall", "Community"},
- {639.5711, -571.4268, 16.1875, "Dillimore Police Station", "Community"},
- {1280.9777, 235.3988, 19.4063, "Montgomery Police Station", "Community"},
- {1248.9348, 341.1573, 19.4063, "Montgomery Hospital", "Community"},
- {1313.0361, 240.9047, 19.4129, "Montgomery Park", "Community"},
- {1463.1729, 407.5950, 19.8828, "Red County Station 49", "Community"},
- {107.3445, -209.2860, 1.4297, "Blueberry Skate Park", "Community"},
- {-213.0466, 994.2524, 19.5634, "Fort Carson Police Headquarters", "Community"},
- {-314.5852, 1063.6080, 19.5938, "Fort Carson Hospital", "Community"},
- {339.7744, 2499.7676, 16.4844, "Verdant Meadows Hangar", "Community"},
- {-1515.5302, 2536.3357, 55.6875, "El Quebrados Hospital", "Community"},
- {1230.7103, 243.7639, 19.4063, "San Andreas News Network Headquarters", "Community"},
- {-96.6311, 1089.6289, 19.7422, "Fort Carson News Office", "Community"},
- {-1408.4028, 2640.4922, 55.6875, "El Quebrados Police Station", "Community"},
- {211.9892, -209.2762, 1.4297, "Blueberry Pizza Stack", "Dining"},
- {-1204.6321, 1823.0421, 41.7188, "Bone County Cluckin' Bell", "Dining"},
- {165.2714, 1187.1331, 14.7578, "Fort Carson Cluckin' Bell", "Dining"},
- {-143.7724, 1214.9647, 19.7352, "Fort Carson King Ring", "Dining"},
- {2342.0564, 74.9897, 26.3359, "Palomino Creek Pizza Stack", "Dining"},
- {-178.6542, 1100.8311, 19.5906, "Fort Carson Smalls Club", "Social"},
- {-84.0109, 1358.2048, 10.3901, "Lil' Probe Inn Bar", "Social"},
- {1320.8062, 233.0541, 19.4063, "Montgomery Club - Club Insomnia", "Social"},
- {178.5866, -147.1687, 1.4297, "Blueberry Bar - The Rat's Pack", "Social"},
- {681.6264, -482.5179, 16.1875, "Dillimore Bar - The Welcome Pump", "Social"},
- {1363.0126, 409.1690, 19.4063, "Montgomery Casino - Casa Blancas", "Social"},
- {260.0380, -151.0100, 1.5703, "Lilly's Club", "Social"},
- {226.0350, 82.7864, 3.8906, "Blueberry Scrap Yard", "Vehicles"},
- {635.4008, -487.4061, 16.1875, "Dillimore Automotive Dealership", "Vehicles"},
- {651.5057, -564.6310, 16.3265, "Dillimore Gas Station", "Vehicles"},
- {1380.9268, 456.7123, 19.9070, "Montgomery Gas Station", "Vehicles"},
- {701.6638, -528.2155, 16.1875, "Motorcycle Dealership - Mr Grant's Bike Shed", "Vehicles"},
- {2440.2795, 113.4148, 26.4771, "Palomino Creek Garage", "Vehicles"},
- {2278.4524, 32.9015, 26.4844, "Palomino Creek Gas Station", "Vehicles"},
- {1246.8138, 140.0072, 19.8108, "Montgomery DMV", "Vehicles"},
- {2146.4175, -84.1789, 2.7818, "Fishing & Docks", "Vehicles"},
- {720.1399, -469.2735, 16.3437, "Dillimore Repair Garage", "Vehicles"},
- {74.7425, 1200.9868, 18.5559, "Fort Carson Car Wash", "Vehicles"},
- {-242.2282, 1200.5997, 19.5938, "Fort Carson Gas Station", "Vehicles"},
- {-1312.1665, 2685.3904, 50.0625, "El Quebrados Gas Station", "Vehicles"},
- {-1420.8513, 2598.8823, 55.6875, "El Quebrados Repair Garage", "Vehicles"},
- {-2226.5100, -2321.7517, 30.6094, "Angel Pine Repair Garage", "Vehicles"},
- {-2268.8130, 2348.3782, 4.8202, "Bayside Docks", "Vehicles"},
- {135.2973, -199.3713, 1.4282, "Blueberry General Store", "Stores"},
- {683.9312, -583.5223, 16.1875, "Dillimore General Store", "Stores"},
- {1343.4174, 222.7929, 19.4063, "Montgomery General Store", "Stores"},
- {2318.7642, -96.0884, 26.3359, "Palomino Creek General Store", "Stores"},
- {-254.6761, 2729.9355, 62.5391, "Las Payasadas Flea Market", "Stores"},
- {-188.0483, 1133.0492, 19.5906, "Fort Carson Bank", "Banks"},
- {-207.9267, 2703.7703, 62.5391, "Las Payasadas Bank", "Banks"},
- {1307.1477, 320.5228, 19.4069, "Montgomery Bank", "Banks"}
- };
- new LitterPlaced[MAX_LITTER];
- new LitterObjects[9] = {2837, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 2677};
- new Float:LitterSpawns[MAX_LITTER][3] = // -= 0.975
- {
- // MONTGOMERY
- {1225.847534, 361.662536, 18.646},
- {1236.861206, 358.277465, 18.646},
- {1254.182495, 348.228546, 18.646},
- {1260.515991, 347.994812, 18.646},
- {1271.184204, 347.472229, 18.646},
- {1270.432006, 358.401916, 18.646},
- {1283.298095, 372.864929, 18.646},
- {1286.481201, 385.211303, 18.646},
- {1302.524169, 381.480560, 18.646},
- {1315.692871, 376.586822, 18.646},
- {1329.069946, 370.357482, 18.646},
- {1334.440673, 371.284515, 18.646},
- {1342.016479, 383.921020, 18.646},
- {1346.587646, 396.525512, 18.646},
- {1369.796752, 409.847747, 18.646},
- {1365.009277, 391.824615, 18.646},
- {1351.626708, 370.961486, 18.646},
- {1341.249511, 349.476989, 18.646},
- {1331.825927, 324.745666, 18.646},
- {1316.262817, 330.530395, 18.646},
- {1324.437866, 346.400024, 18.646},
- {1320.309936, 357.240051, 18.646},
- {1301.889648, 367.590118, 18.646},
- {1291.716186, 356.375762, 18.646},
- {1284.504638, 335.161987, 18.646},
- {1299.706420, 330.001464, 18.646},
- {1267.124389, 327.850097, 18.646},
- {1296.404785, 313.304870, 18.646},
- {1304.270996, 299.219390, 18.646},
- {1292.857666, 276.184478, 18.646},
- {1283.880249, 259.051483, 18.646},
- {1264.948364, 269.423339, 18.646},
- {1235.863769, 281.187377, 18.646},
- {1210.319946, 291.872589, 18.646},
- {1218.416503, 314.138458, 18.646},
- {1227.604125, 337.568603, 18.646},
- {1323.662841, 302.041595, 18.646},
- {1345.123657, 293.382904, 18.646},
- {1344.775878, 270.762084, 18.646},
- {1332.959594, 241.871170, 18.646},
- {1313.675048, 247.284393, 18.646},
- {1301.423950, 259.281707, 18.646},
- {1315.206665, 286.230590, 18.646},
- {1275.917480, 246.198745, 18.646},
- {1257.965087, 254.956237, 18.646},
- {1241.306030, 242.435592, 18.646},
- {1229.119995, 221.100692, 18.646},
- {1240.010864, 203.933013, 18.646},
- {1261.996337, 203.827316, 18.646},
- {1271.615478, 229.241790, 18.646},
- {1289.635742, 225.272750, 18.646},
- {1274.861206, 196.331893, 18.646},
- {1303.693847, 233.616653, 18.646},
- {1326.005126, 225.063461, 18.646},
- {1348.068603, 213.988143, 18.646},
- {1370.124145, 204.796707, 18.646},
- {1356.740112, 232.044464, 18.646},
- {1349.364868, 238.936187, 18.646},
- {1357.532714, 256.151489, 18.646},
- {1368.598144, 259.726959, 18.646},
- {1371.129394, 278.504791, 18.646},
- {1391.491821, 271.053985, 18.646},
- {1405.763549, 280.489593, 18.646},
- {1371.574218, 298.803314, 18.646},
- //BLUEBERRY
- {221.708709, -14.586134, 0.603125},
- {221.708709, -14.586134, 0.603125},
- {217.920532, -28.724985, 0.603125},
- {225.850143, -51.546657, 0.603125},
- {239.216751, -34.616436, 0.603125},
- {240.172790, -59.636524, 0.603125},
- {248.885437, -64.719894, 0.603125},
- {217.736587, -87.605529, 0.603125},
- {209.013992, -94.190910, 0.603125},
- {225.502868, -110.734031, 0.603125},
- {242.413970, -132.711410, 0.603125},
- {246.326492, -157.443389, 0.603125},
- {252.157943, -149.928909, 0.603125},
- {239.618286, -175.557754, 0.603125},
- {225.484359, -188.425567, 0.603125},
- {221.027313, -204.402160, 0.603125},
- {211.249282, -219.516998, 0.603125},
- {203.312225, -204.887588, 0.603125},
- {168.747970, -204.310546, 0.603125},
- {139.828369, -191.890502, 0.603125},
- {146.902114, -165.987106, 0.603125},
- {154.105972, -148.560958, 0.603125},
- {175.925521, -160.076248, 0.603125},
- {190.768081, -148.886245, 0.603125},
- {209.973373, -148.726531, 0.603125},
- {275.436065, -161.613174, 0.603125},
- {290.295227, -176.085113, 0.603125},
- {292.471710, -184.658279, 0.603125},
- {289.910034, -191.025360, 0.603125},
- {275.481750, -198.541854, 0.603125},
- {306.833496, -204.586044, 0.603125},
- //DILLIMORE
- {649.241027, -475.476593, 15.360937},
- {662.165710, -473.277221, 15.360937},
- {685.790466, -477.789428, 15.360937},
- {719.905517, -475.958251, 15.360937},
- {714.234375, -508.990997, 15.360937},
- {706.893981, -538.385620, 15.360937},
- {689.380310, -555.996765, 15.360937},
- {674.812072, -576.466064, 15.360937},
- {695.115234, -592.792663, 15.360937},
- {705.281494, -622.102966, 15.360937},
- {688.429565, -614.682067, 15.360937},
- {674.668334, -637.416259, 15.360937},
- {658.249206, -639.048645, 15.360937},
- {653.799865, -592.322448, 15.360937},
- {634.187072, -561.128906, 15.360937},
- {658.530029, -549.704589, 15.360937},
- {662.763366, -522.484313, 15.360937},
- {688.619934, -509.882873, 15.360937},
- {799.000183, -555.859069, 15.360937},
- {811.473815, -587.597473, 15.360937},
- {816.933105, -563.703552, 15.360937},
- {824.510925, -551.561523, 15.360937},
- //PALOMINO CREEK
- {2213.673583, 48.988529, 25.509375},
- {2251.904541, 49.559085, 25.509375},
- {2273.591552, 34.588325, 25.509375},
- {2282.284667, 64.240005, 25.509375},
- {2301.133789, 72.846076, 25.509375},
- {2277.800537, 84.319953, 25.509375},
- {2317.791992, 99.279380, 25.509375},
- {2336.845703, 81.632102, 25.509375},
- {2335.380859, 75.514045, 25.509375},
- {2336.487792, 66.746452, 25.509375},
- {2337.102294, 45.442428, 25.509375},
- {2335.426757, 34.386077, 25.509375},
- {2336.933105, 4.2536300, 25.509375},
- {2336.135253, -12.48980, 25.509375},
- {2308.647705, -35.15418, 25.509375},
- {2350.773681, -59.96532, 25.509375},
- {2329.032226, -90.69293, 25.509375},
- {2275.890625, -79.61488, 25.509375},
- {2300.986328, -46.97204, 25.509375},
- {2301.502929, 6.9110000, 25.509375},
- //LIL PROBE INN
- {-91.008926, 1362.397705, 9.298437},
- {-83.768058, 1375.010009, 9.298437},
- {-87.639038, 1382.492431, 9.298437},
- //FORT CARSON
- {-183.552551, 1015.704895, 18.767187},
- {-214.668258, 1025.483886, 18.767187},
- {-202.960128, 1041.923339, 18.767187},
- {-183.205795, 1076.389282, 18.767187},
- {-214.276687, 1075.339599, 18.767187},
- {-209.436080, 1090.506347, 18.767187},
- {-166.997024, 1089.021484, 18.767187},
- {-175.942153, 1105.682495, 18.767187},
- {-213.588577, 1132.314453, 18.767187},
- {-203.134033, 1171.659912, 18.767187},
- {-209.324768, 1205.870483, 18.767187},
- {-256.920562, 1214.776611, 18.767187},
- {-263.090820, 1211.242675, 18.767187},
- {-163.492645, 1205.954833, 18.767187},
- {-150.261093, 1222.187866, 18.767187},
- {-139.135086, 1218.685302, 18.767187},
- {-107.792510, 1190.465576, 18.767187},
- {-48.731735, 1190.312255, 18.767187},
- {-26.945911, 1175.642456, 18.767187},
- {-72.891960, 1158.907836, 18.767187},
- //LAS PAYASADAS
- {-197.726654, 2709.762207, 61.7125},
- {-225.948913, 2707.186523, 61.7125},
- {-242.415222, 2693.497802, 61.7125},
- {-264.410919, 2719.595214, 61.7125},
- {-279.350341, 2692.571533, 61.7125},
- {-301.318725, 2692.693603, 61.7125},
- {-264.790985, 2654.152343, 61.7125},
- {-249.311920, 2599.184814, 61.7125},
- //EL QUEBRADOS
- {-1432.101440, 2593.559326, 54.860937},
- {-1457.303588, 2608.620361, 54.860937},
- {-1473.457275, 2593.819335, 54.860937},
- {-1486.138549, 2593.575195, 54.860937},
- {-1503.332763, 2574.390869, 54.860937},
- {-1538.280639, 2577.232666, 54.860937},
- {-1527.624267, 2608.039062, 54.860937},
- {-1488.727661, 2614.101562, 54.860937},
- {-1507.245727, 2634.090576, 54.860937},
- {-1478.171020, 2660.888916, 54.860937},
- {-1434.808715, 2642.224121, 54.860937},
- {-1418.026000, 2629.454345, 54.860937}
- };
- //apostaamaster
- enum SAZONE_MAIN
- {
- SAZONE_NAME[28],
- Float:SAZONE_AREA[6]
- };
- static const gSAZones[][SAZONE_MAIN] = // Majority of names and area coordinates adopted from Mabako's 'Zones Script' v0.2
- {
- // NAME AREA (Xmin,Ymin,Zmin,Xmax,Ymax,Zmax)
- {"Aldea Malvada", {-1372.10,2498.50,0.00,-1277.50,2615.30,200.00}},
- {"Angel Pine", {-2324.90,-2584.20,-6.10,-1964.20,-2212.10,200.00}},
- {"Arco del Oeste", {-901.10,2221.80,0.00,-592.00,2571.90,200.00}},
- {"Avispa Country Club", {-2361.50,-417.10,0.00,-2270.00,-355.40,200.00}},
- {"Avispa Country Club", {-2470.00,-355.40,0.00,-2270.00,-318.40,46.10}},
- {"Avispa Country Club", {-2550.00,-355.40,0.00,-2470.00,-318.40,39.70}},
- {"Avispa Country Club", {-2646.40,-355.40,0.00,-2270.00,-222.50,200.00}},
- {"Avispa Country Club", {-2667.80,-302.10,-28.80,-2646.40,-262.30,71.10}},
- {"Avispa Country Club", {-2831.80,-430.20,-6.10,-2646.40,-222.50,200.00}},
- {"Back o Beyond", {-1166.90,-2641.10,0.00,-321.70,-1856.00,200.00}},
- {"Battery Point", {-2741.00,1268.40,-4.50,-2533.00,1490.40,200.00}},
- {"Bayside Marina", {-2353.10,2275.70,0.00,-2153.10,2475.70,200.00}},
- {"Bayside", {-2741.00,2175.10,0.00,-2353.10,2722.70,200.00}},
- {"Beacon Hill", {-399.60,-1075.50,-1.40,-319.00,-977.50,198.50}},
- {"Blackfield Chapel", {1325.60,596.30,-89.00,1375.60,795.00,110.90}},
- {"Blackfield Chapel", {1375.60,596.30,-89.00,1558.00,823.20,110.90}},
- {"Blackfield Section", {1166.50,795.00,-89.00,1375.60,1044.60,110.90}},
- {"Blackfield Section", {1197.30,1044.60,-89.00,1277.00,1163.30,110.90}},
- {"Blackfield Section", {1277.00,1044.60,-89.00,1315.30,1087.60,110.90}},
- {"Blackfield Section", {1375.60,823.20,-89.00,1457.30,919.40,110.90}},
- {"Blackfield", {964.30,1203.20,-89.00,1197.30,1403.20,110.90}},
- {"Blackfield", {964.30,1403.20,-89.00,1197.30,1726.20,110.90}},
- {"Blueberry Acres", {-319.60,-220.10,0.00,104.50,293.30,200.00}},
- {"Blueberry", {104.50,-220.10,2.30,349.60,152.20,200.00}},
- {"Blueberry", {19.60,-404.10,3.80,349.60,-220.10,200.00}},
- {"Caligula's Palace", {2087.30,1543.20,-89.00,2437.30,1703.20,110.90}},
- {"Caligula's Palace", {2137.40,1703.20,-89.00,2437.30,1783.20,110.90}},
- {"Calton Heights", {-2274.10,744.10,-6.10,-1982.30,1358.90,200.00}},
- {"Castillo del Diablo", {-208.50,2123.00,-7.60,114.00,2337.10,200.00}},
- {"Castillo del Diablo", {-208.50,2337.10,0.00,8.40,2487.10,200.00}},
- {"Castillo del Diablo", {-464.50,2217.60,0.00,-208.50,2580.30,200.00}},
- {"Chinatown", {-2274.10,578.30,-7.60,-2078.60,744.10,200.00}},
- {"City Hall", {-2867.80,277.40,-9.10,-2593.40,458.40,200.00}},
- {"Come-A-Lot", {2087.30,943.20,-89.00,2623.10,1203.20,110.90}},
- {"Commerce", {1323.90,-1722.20,-89.00,1440.90,-1577.50,110.90}},
- {"Commerce", {1323.90,-1842.20,-89.00,1701.90,-1722.20,110.90}},
- {"Commerce", {1370.80,-1577.50,-89.00,1463.90,-1384.90,110.90}},
- {"Commerce", {1463.90,-1577.50,-89.00,1667.90,-1430.80,110.90}},
- {"Commerce", {1583.50,-1722.20,-89.00,1758.90,-1577.50,110.90}},
- {"Commerce", {1667.90,-1577.50,-89.00,1812.60,-1430.80,110.90}},
- {"Conference Center", {1046.10,-1804.20,-89.00,1323.90,-1722.20,110.90}},
- {"Conference Center", {1073.20,-1842.20,-89.00,1323.90,-1804.20,110.90}},
- {"Cranberry Station", {-2007.80,56.30,0.00,-1922.00,224.70,100.00}},
- {"Creek", {2749.90,1937.20,-89.00,2921.60,2669.70,110.90}},
- {"Dillimore", {580.70,-674.80,-9.50,861.00,-404.70,200.00}},
- {"Doherty", {-2270.00,-324.10,-0.00,-1794.90,-222.50,200.00}},
- {"Doherty", {-2173.00,-222.50,-0.00,-1794.90,265.20,200.00}},
- {"Downtown Los Santos", {1370.80,-1170.80,-89.00,1463.90,-1130.80,110.90}},
- {"Downtown Los Santos", {1370.80,-1384.90,-89.00,1463.90,-1170.80,110.90}},
- {"Downtown Los Santos", {1378.30,-1130.80,-89.00,1463.90,-1026.30,110.90}},
- {"Downtown Los Santos", {1391.00,-1026.30,-89.00,1463.90,-926.90,110.90}},
- {"Downtown Los Santos", {1463.90,-1290.80,-89.00,1724.70,-1150.80,110.90}},
- {"Downtown Los Santos", {1463.90,-1430.80,-89.00,1724.70,-1290.80,110.90}},
- {"Downtown Los Santos", {1507.50,-1385.20,110.90,1582.50,-1325.30,335.90}},
- {"Downtown Los Santos", {1724.70,-1250.90,-89.00,1812.60,-1150.80,110.90}},
- {"Downtown Los Santos", {1724.70,-1430.80,-89.00,1812.60,-1250.90,110.90}},
- {"Downtown", {-1580.00,744.20,-6.10,-1499.80,1025.90,200.00}},
- {"Downtown", {-1700.00,744.20,-6.10,-1580.00,1176.50,200.00}},
- {"Downtown", {-1871.70,1176.40,-4.50,-1620.30,1274.20,200.00}},
- {"Downtown", {-1982.30,744.10,-6.10,-1871.70,1274.20,200.00}},
- {"Downtown", {-1993.20,265.20,-9.10,-1794.90,578.30,200.00}},
- {"Downtown", {-2078.60,578.30,-7.60,-1499.80,744.20,200.00}},
- {"East Beach", {2632.80,-1668.10,-89.00,2747.70,-1393.40,110.90}},
- {"East Beach", {2632.80,-1852.80,-89.00,2959.30,-1668.10,110.90}},
- {"East Beach", {2747.70,-1498.60,-89.00,2959.30,-1120.00,110.90}},
- {"East Beach", {2747.70,-1668.10,-89.00,2959.30,-1498.60,110.90}},
- {"East Los Santos", {2222.50,-1628.50,-89.00,2421.00,-1494.00,110.90}},
- {"East Los Santos", {2266.20,-1494.00,-89.00,2381.60,-1372.00,110.90}},
- {"East Los Santos", {2281.40,-1372.00,-89.00,2381.60,-1135.00,110.90}},
- {"East Los Santos", {2381.60,-1454.30,-89.00,2462.10,-1135.00,110.90}},
- {"East Los Santos", {2381.60,-1494.00,-89.00,2421.00,-1454.30,110.90}},
- {"East Los Santos", {2421.00,-1628.50,-89.00,2632.80,-1454.30,110.90}},
- {"East Los Santos", {2462.10,-1454.30,-89.00,2581.70,-1135.00,110.90}},
- {"Easter Basin", {-1794.90,-50.00,-0.00,-1499.80,249.90,200.00}},
- {"Easter Basin", {-1794.90,249.90,-9.10,-1242.90,578.30,200.00}},
- {"Easter Bay Airport", {-1213.90,-50.00,-4.50,-947.90,578.30,200.00}},
- {"Easter Bay Airport", {-1213.90,-730.10,0.00,-1132.80,-50.00,200.00}},
- {"Easter Bay Airport", {-1242.90,-50.00,0.00,-1213.90,578.30,200.00}},
- {"Easter Bay Airport", {-1315.40,-405.30,15.40,-1264.40,-209.50,25.40}},
- {"Easter Bay Airport", {-1354.30,-287.30,15.40,-1315.40,-209.50,25.40}},
- {"Easter Bay Airport", {-1490.30,-209.50,15.40,-1264.40,-148.30,25.40}},
- {"Easter Bay Airport", {-1499.80,-50.00,-0.00,-1242.90,249.90,200.00}},
- {"Easter Bay Airport", {-1794.90,-730.10,-3.00,-1213.90,-50.00,200.00}},
- {"Easter Bay Chemical", {-1132.80,-768.00,0.00,-956.40,-578.10,200.00}},
- {"Easter Bay Chemical", {-1132.80,-787.30,0.00,-956.40,-768.00,200.00}},
- {"El Corona", {1692.60,-2179.20,-89.00,1812.60,-1842.20,110.90}},
- {"El Corona", {1812.60,-2179.20,-89.00,1970.60,-1852.80,110.90}},
- {"El Quebrados", {-1645.20,2498.50,0.00,-1372.10,2777.80,200.00}},
- {"Esplanade East", {-1499.80,578.30,-79.60,-1339.80,1274.20,20.30}},
- {"Esplanade East", {-1580.00,1025.90,-6.10,-1499.80,1274.20,200.00}},
- {"Esplanade East", {-1620.30,1176.50,-4.50,-1580.00,1274.20,200.00}},
- {"Esplanade North", {-1982.30,1274.20,-4.50,-1524.20,1358.90,200.00}},
- {"Esplanade North", {-1996.60,1358.90,-4.50,-1524.20,1592.50,200.00}},
- {"Esplanade North", {-2533.00,1358.90,-4.50,-1996.60,1501.20,200.00}},
- {"Fallen Tree", {-792.20,-698.50,-5.30,-452.40,-380.00,200.00}},
- {"Fallow Bridge", {434.30,366.50,0.00,603.00,555.60,200.00}},
- {"Fern Ridge", {508.10,-139.20,0.00,1306.60,119.50,200.00}},
- {"Financial", {-1871.70,744.10,-6.10,-1701.30,1176.40,300.00}},
- {"Fisher's Lagoon", {1916.90,-233.30,-100.00,2131.70,13.80,200.00}},
- {"Flint Intersection", {-187.70,-1596.70,-89.00,17.00,-1276.60,110.90}},
- {"Flint Range", {-594.10,-1648.50,0.00,-187.70,-1276.60,200.00}},
- {"Fort Carson", {-376.20,826.30,-3.00,123.70,1220.40,200.00}},
- {"Foster Valley", {-2178.60,-1115.50,0.00,-1794.90,-599.80,200.00}},
- {"Foster Valley", {-2178.60,-1250.90,0.00,-1794.90,-1115.50,200.00}},
- {"Foster Valley", {-2178.60,-599.80,-0.00,-1794.90,-324.10,200.00}},
- {"Foster Valley", {-2270.00,-430.20,-0.00,-2178.60,-324.10,200.00}},
- {"Four Dragons Casino", {1817.30,863.20,-89.00,2027.30,1083.20,110.90}},
- {"Frederick Bridge", {2759.20,296.50,0.00,2774.20,594.70,200.00}},
- {"Gant Bridge", {-2741.00,1490.40,-6.10,-2616.40,1659.60,200.00}},
- {"Gant Bridge", {-2741.40,1659.60,-6.10,-2616.40,2175.10,200.00}},
- {"Ganton", {2222.50,-1722.30,-89.00,2632.80,-1628.50,110.90}},
- {"Ganton", {2222.50,-1852.80,-89.00,2632.80,-1722.30,110.90}},
- {"Garcia", {-2395.10,-222.50,-5.30,-2354.00,-204.70,200.00}},
- {"Garcia", {-2411.20,-222.50,-0.00,-2173.00,265.20,200.00}},
- {"Garver Bridge", {-1213.90,950.00,-89.00,-1087.90,1178.90,110.90}},
- {"Garver Bridge", {-1339.80,828.10,-89.00,-1213.90,1057.00,110.90}},
- {"Garver Bridge", {-1499.80,696.40,-179.60,-1339.80,925.30,20.30}},
- {"Glen Park", {1812.60,-1100.80,-89.00,1994.30,-973.30,110.90}},
- {"Glen Park", {1812.60,-1350.70,-89.00,2056.80,-1100.80,110.90}},
- {"Glen Park", {1812.60,-1449.60,-89.00,1996.90,-1350.70,110.90}},
- {"Green Palms", {176.50,1305.40,-3.00,338.60,1520.70,200.00}},
- {"Greenglass College", {964.30,1044.60,-89.00,1197.30,1203.20,110.90}},
- {"Greenglass College", {964.30,930.80,-89.00,1166.50,1044.60,110.90}},
- {"Hampton Barns", {603.00,264.30,0.00,761.90,366.50,200.00}},
- {"Hankypanky Point", {2576.90,62.10,0.00,2759.20,385.50,200.00}},
- {"Harry Gold Parkway", {1777.30,863.20,-89.00,1817.30,2342.80,110.90}},
- {"Hashbury", {-2593.40,-222.50,-0.00,-2411.20,54.70,200.00}},
- {"Hilltop Farm", {967.30,-450.30,-3.00,1176.70,-217.90,200.00}},
- {"Hunter Quarry", {337.20,710.80,-115.20,860.50,1031.70,203.70}},
- {"Idlewood", {1812.60,-1602.30,-89.00,2124.60,-1449.60,110.90}},
- {"Idlewood", {1812.60,-1742.30,-89.00,1951.60,-1602.30,110.90}},
- {"Idlewood", {1812.60,-1852.80,-89.00,1971.60,-1742.30,110.90}},
- {"Idlewood", {1951.60,-1742.30,-89.00,2124.60,-1602.30,110.90}},
- {"Idlewood", {1971.60,-1852.80,-89.00,2222.50,-1742.30,110.90}},
- {"Idlewood", {2124.60,-1742.30,-89.00,2222.50,-1494.00,110.90}},
- {"Jefferson", {1996.90,-1449.60,-89.00,2056.80,-1350.70,110.90}},
- {"Jefferson", {2056.80,-1210.70,-89.00,2185.30,-1126.30,110.90}},
- {"Jefferson", {2056.80,-1372.00,-89.00,2281.40,-1210.70,110.90}},
- {"Jefferson", {2056.80,-1449.60,-89.00,2266.20,-1372.00,110.90}},
- {"Jefferson", {2124.60,-1494.00,-89.00,2266.20,-1449.60,110.90}},
- {"Jefferson", {2185.30,-1210.70,-89.00,2281.40,-1154.50,110.90}},
- {"Julius Thruway East", {2536.40,2442.50,-89.00,2685.10,2542.50,110.90}},
- {"Julius Thruway East", {2623.10,943.20,-89.00,2749.90,1055.90,110.90}},
- {"Julius Thruway East", {2625.10,2202.70,-89.00,2685.10,2442.50,110.90}},
- {"Julius Thruway East", {2685.10,1055.90,-89.00,2749.90,2626.50,110.90}},
- {"Julius Thruway North", {1377.30,2433.20,-89.00,1534.50,2507.20,110.90}},
- {"Julius Thruway North", {1534.50,2433.20,-89.00,1848.40,2583.20,110.90}},
- {"Julius Thruway North", {1704.50,2342.80,-89.00,1848.40,2433.20,110.90}},
- {"Julius Thruway North", {1848.40,2478.40,-89.00,1938.80,2553.40,110.90}},
- {"Julius Thruway North", {1938.80,2508.20,-89.00,2121.40,2624.20,110.90}},
- {"Julius Thruway North", {2121.40,2508.20,-89.00,2237.40,2663.10,110.90}},
- {"Julius Thruway North", {2237.40,2542.50,-89.00,2498.20,2663.10,110.90}},
- {"Julius Thruway North", {2498.20,2542.50,-89.00,2685.10,2626.50,110.90}},
- {"Julius Thruway South", {1457.30,823.20,-89.00,2377.30,863.20,110.90}},
- {"Julius Thruway South", {2377.30,788.80,-89.00,2537.30,897.90,110.90}},
- {"Julius Thruway West", {1197.30,1163.30,-89.00,1236.60,2243.20,110.90}},
- {"Julius Thruway West", {1236.60,2142.80,-89.00,1297.40,2243.20,110.90}},
- {"Juniper Hill", {-2533.00,578.30,-7.60,-2274.10,968.30,200.00}},
- {"Juniper Hollow", {-2533.00,968.30,-6.10,-2274.10,1358.90,200.00}},
- {"KACC Military Fuels", {2498.20,2626.50,-89.00,2749.90,2861.50,110.90}},
- {"Kincaid Bridge", {-1087.90,855.30,-89.00,-961.90,986.20,110.90}},
- {"Kincaid Bridge", {-1213.90,721.10,-89.00,-1087.90,950.00,110.90}},
- {"Kincaid Bridge", {-1339.80,599.20,-89.00,-1213.90,828.10,110.90}},
- {"King's", {-2253.50,373.50,-9.10,-1993.20,458.40,200.00}},
- {"King's", {-2329.30,458.40,-7.60,-1993.20,578.30,200.00}},
- {"King's", {-2411.20,265.20,-9.10,-1993.20,373.50,200.00}},
- {"LS International", {1249.60,-2394.30,-89.00,1852.00,-2179.20,110.90}},
- {"LS International", {1382.70,-2730.80,-89.00,2201.80,-2394.30,110.90}},
- {"LS International", {1400.90,-2669.20,-39.00,2189.80,-2597.20,60.90}},
- {"LS International", {1852.00,-2394.30,-89.00,2089.00,-2179.20,110.90}},
- {"LS International", {1974.60,-2394.30,-39.00,2089.00,-2256.50,60.90}},
- {"LS International", {2051.60,-2597.20,-39.00,2152.40,-2394.30,60.90}},
- {"LVA Freight Depot", {1236.60,1163.40,-89.00,1277.00,1203.20,110.90}},
- {"LVA Freight Depot", {1277.00,1087.60,-89.00,1375.60,1203.20,110.90}},
- {"LVA Freight Depot", {1315.30,1044.60,-89.00,1375.60,1087.60,110.90}},
- {"LVA Freight Depot", {1375.60,919.40,-89.00,1457.30,1203.20,110.90}},
- {"LVA Freight Depot", {1457.30,863.20,-89.00,1777.40,1143.20,110.90}},
- {"Las Barrancas", {-926.10,1398.70,-3.00,-719.20,1634.60,200.00}},
- {"Las Brujas", {-365.10,2123.00,-3.00,-208.50,2217.60,200.00}},
- {"Las Colinas", {1994.30,-1100.80,-89.00,2056.80,-920.80,110.90}},
- {"Las Colinas", {2056.80,-1126.30,-89.00,2126.80,-920.80,110.90}},
- {"Las Colinas", {2126.80,-1126.30,-89.00,2185.30,-934.40,110.90}},
- {"Las Colinas", {2185.30,-1154.50,-89.00,2281.40,-934.40,110.90}},
- {"Las Colinas", {2281.40,-1135.00,-89.00,2632.70,-945.00,110.90}},
- {"Las Colinas", {2632.70,-1135.00,-89.00,2747.70,-945.00,110.90}},
- {"Las Colinas", {2747.70,-1120.00,-89.00,2959.30,-945.00,110.90}},
- {"Las Payasadas", {-354.30,2580.30,2.00,-133.60,2816.80,200.00}},
- {"Las Venturas Airport", {1236.60,1203.20,-89.00,1457.30,1883.10,110.90}},
- {"Las Venturas Airport", {1457.30,1143.20,-89.00,1777.40,1203.20,110.90}},
- {"Las Venturas Airport", {1457.30,1203.20,-89.00,1777.30,1883.10,110.90}},
- {"Las Venturas Airport", {1515.80,1586.40,-12.50,1729.90,1714.50,87.50}},
- {"Last Dime Motel", {1823.00,596.30,-89.00,1997.20,823.20,110.90}},
- {"Leafy Hollow", {-1166.90,-1856.00,0.00,-815.60,-1602.00,200.00}},
- {"Liberty City", {-1000.00,400.00,1300.00,-700.00,600.00,1400.00}},
- {"Lil' Probe Inn", {-90.20,1286.80,-3.00,153.80,1554.10,200.00}},
- {"Linden Side", {2749.90,943.20,-89.00,2923.30,1198.90,110.90}},
- {"Linden Station", {2749.90,1198.90,-89.00,2923.30,1548.90,110.90}},
- {"Linden Station", {2811.20,1229.50,-39.50,2861.20,1407.50,60.40}},
- {"Little Mexico", {1701.90,-1842.20,-89.00,1812.60,-1722.20,110.90}},
- {"Little Mexico", {1758.90,-1722.20,-89.00,1812.60,-1577.50,110.90}},
- {"Los Flores", {2581.70,-1393.40,-89.00,2747.70,-1135.00,110.90}},
- {"Los Flores", {2581.70,-1454.30,-89.00,2632.80,-1393.40,110.90}},
- {"Marina", {647.70,-1577.50,-89.00,807.90,-1416.20,110.90}},
- {"Marina", {647.70,-1804.20,-89.00,851.40,-1577.50,110.90}},
- {"Marina", {807.90,-1577.50,-89.00,926.90,-1416.20,110.90}},
- {"Market Station", {787.40,-1410.90,-34.10,866.00,-1310.20,65.80}},
- {"Market", {1072.60,-1416.20,-89.00,1370.80,-1130.80,110.90}},
- {"Market", {787.40,-1416.20,-89.00,1072.60,-1310.20,110.90}},
- {"Market", {926.90,-1577.50,-89.00,1370.80,-1416.20,110.90}},
- {"Market", {952.60,-1310.20,-89.00,1072.60,-1130.80,110.90}},
- {"Martin Bridge", {-222.10,293.30,0.00,-122.10,476.40,200.00}},
- {"Missionary Hill", {-2994.40,-811.20,0.00,-2178.60,-430.20,200.00}},
- {"Montgomery Section", {1546.60,208.10,0.00,1745.80,347.40,200.00}},
- {"Montgomery Section", {1582.40,347.40,0.00,1664.60,401.70,200.00}},
- {"Montgomery", {1119.50,119.50,-3.00,1451.40,493.30,200.00}},
- {"Montgomery", {1451.40,347.40,-6.10,1582.40,420.80,200.00}},
- {"Mulholland Section", {1463.90,-1150.80,-89.00,1812.60,-768.00,110.90}},
- {"Mulholland", {1096.40,-910.10,-89.00,1169.10,-768.00,110.90}},
- {"Mulholland", {1169.10,-910.10,-89.00,1318.10,-768.00,110.90}},
- {"Mulholland", {1269.10,-768.00,-89.00,1414.00,-452.40,110.90}},
- {"Mulholland", {1281.10,-452.40,-89.00,1641.10,-290.90,110.90}},
- {"Mulholland", {1318.10,-910.10,-89.00,1357.00,-768.00,110.90}},
- {"Mulholland", {1357.00,-926.90,-89.00,1463.90,-768.00,110.90}},
- {"Mulholland", {1414.00,-768.00,-89.00,1667.60,-452.40,110.90}},
- {"Mulholland", {687.80,-860.60,-89.00,911.80,-768.00,110.90}},
- {"Mulholland", {737.50,-768.00,-89.00,1142.20,-674.80,110.90}},
- {"Mulholland", {768.60,-954.60,-89.00,952.60,-860.60,110.90}},
- {"Mulholland", {861.00,-674.80,-89.00,1156.50,-600.80,110.90}},
- {"Mulholland", {911.80,-860.60,-89.00,1096.40,-768.00,110.90}},
- {"Mulholland", {952.60,-937.10,-89.00,1096.40,-860.60,110.90}},
- {"North Rock", {2285.30,-768.00,0.00,2770.50,-269.70,200.00}},
- {"Ocean Docks", {2089.00,-2394.30,-89.00,2201.80,-2235.80,110.90}},
- {"Ocean Docks", {2201.80,-2418.30,-89.00,2324.00,-2095.00,110.90}},
- {"Ocean Docks", {2201.80,-2730.80,-89.00,2324.00,-2418.30,110.90}},
- {"Ocean Docks", {2324.00,-2145.10,-89.00,2703.50,-2059.20,110.90}},
- {"Ocean Docks", {2324.00,-2302.30,-89.00,2703.50,-2145.10,110.90}},
- {"Ocean Docks", {2373.70,-2697.00,-89.00,2809.20,-2330.40,110.90}},
- {"Ocean Docks", {2703.50,-2302.30,-89.00,2959.30,-2126.90,110.90}},
- {"Ocean Flats", {-2994.40,-222.50,-0.00,-2593.40,277.40,200.00}},
- {"Ocean Flats", {-2994.40,-430.20,-0.00,-2831.80,-222.50,200.00}},
- {"Ocean Flats", {-2994.40,277.40,-9.10,-2867.80,458.40,200.00}},
- {"Octane Springs", {338.60,1228.50,0.00,664.30,1655.00,200.00}},
- {"Old Venturas Strip", {2162.30,2012.10,-89.00,2685.10,2202.70,110.90}},
- {"Palisades", {-2994.40,458.40,-6.10,-2741.00,1339.60,200.00}},
- {"Palomino Creek", {2160.20,-149.00,0.00,2576.90,228.30,200.00}},
- {"Paradiso", {-2741.00,793.40,-6.10,-2533.00,1268.40,200.00}},
- {"Pershing Square", {1440.90,-1722.20,-89.00,1583.50,-1577.50,110.90}},
- {"Pilgrim", {2437.30,1383.20,-89.00,2624.40,1783.20,110.90}},
- {"Pilgrim", {2624.40,1383.20,-89.00,2685.10,1783.20,110.90}},
- {"Pilson Intersection", {1098.30,2243.20,-89.00,1377.30,2507.20,110.90}},
- {"Pirates in Men's Pants", {1817.30,1469.20,-89.00,2027.40,1703.20,110.90}},
- {"Playa del Seville", {2703.50,-2126.90,-89.00,2959.30,-1852.80,110.90}},
- {"Prickle Pine", {1117.40,2507.20,-89.00,1534.50,2723.20,110.90}},
- {"Prickle Pine", {1534.50,2583.20,-89.00,1848.40,2863.20,110.90}},
- {"Prickle Pine", {1848.40,2553.40,-89.00,1938.80,2863.20,110.90}},
- {"Prickle Pine", {1938.80,2624.20,-89.00,2121.40,2861.50,110.90}},
- {"Queens", {-2411.20,373.50,0.00,-2253.50,458.40,200.00}},
- {"Queens", {-2533.00,458.40,0.00,-2329.30,578.30,200.00}},
- {"Queens", {-2593.40,54.70,0.00,-2411.20,458.40,200.00}},
- {"Randolph Ind. Estate", {1558.00,596.30,-89.00,1823.00,823.20,110.90}},
- {"Redsands East", {1817.30,2011.80,-89.00,2106.70,2202.70,110.90}},
- {"Redsands East", {1817.30,2202.70,-89.00,2011.90,2342.80,110.90}},
- {"Redsands East", {1848.40,2342.80,-89.00,2011.90,2478.40,110.90}},
- {"Redsands West", {1236.60,1883.10,-89.00,1777.30,2142.80,110.90}},
- {"Redsands West", {1297.40,2142.80,-89.00,1777.30,2243.20,110.90}},
- {"Redsands West", {1377.30,2243.20,-89.00,1704.50,2433.20,110.90}},
- {"Redsands West", {1704.50,2243.20,-89.00,1777.30,2342.80,110.90}},
- {"Regular Tom", {-405.70,1712.80,-3.00,-276.70,1892.70,200.00}},
- {"Richman", {225.10,-1292.00,-89.00,466.20,-1235.00,110.90}},
- {"Richman", {225.10,-1369.60,-89.00,334.50,-1292.00,110.90}},
- {"Richman", {321.30,-1044.00,-89.00,647.50,-860.60,110.90}},
- {"Richman", {321.30,-1235.00,-89.00,647.50,-1044.00,110.90}},
- {"Richman", {321.30,-768.00,-89.00,700.70,-674.80,110.90}},
- {"Richman", {321.30,-860.60,-89.00,687.80,-768.00,110.90}},
- {"Richman", {647.50,-1118.20,-89.00,787.40,-954.60,110.90}},
- {"Richman", {647.50,-954.60,-89.00,768.60,-860.60,110.90}},
- {"Richman", {72.60,-1235.00,-89.00,321.30,-1008.10,110.90}},
- {"Richman", {72.60,-1404.90,-89.00,225.10,-1235.00,110.90}},
- {"Robada Section", {-1119.00,1178.90,-89.00,-862.00,1351.40,110.90}},
- {"Roca Escalante", {2237.40,2202.70,-89.00,2536.40,2542.50,110.90}},
- {"Roca Escalante", {2536.40,2202.70,-89.00,2625.10,2442.50,110.90}},
- {"Rockshore East", {2537.30,676.50,-89.00,2902.30,943.20,110.90}},
- {"Rockshore West", {1997.20,596.30,-89.00,2377.30,823.20,110.90}},
- {"Rockshore West", {2377.30,596.30,-89.00,2537.30,788.80,110.90}},
- {"Rodeo", {225.10,-1501.90,-89.00,334.50,-1369.60,110.90}},
- {"Rodeo", {225.10,-1684.60,-89.00,312.80,-1501.90,110.90}},
- {"Rodeo", {312.80,-1684.60,-89.00,422.60,-1501.90,110.90}},
- {"Rodeo", {334.50,-1406.00,-89.00,466.20,-1292.00,110.90}},
- {"Rodeo", {334.50,-1501.90,-89.00,422.60,-1406.00,110.90}},
- {"Rodeo", {422.60,-1570.20,-89.00,466.20,-1406.00,110.90}},
- {"Rodeo", {422.60,-1684.60,-89.00,558.00,-1570.20,110.90}},
- {"Rodeo", {466.20,-1385.00,-89.00,647.50,-1235.00,110.90}},
- {"Rodeo", {466.20,-1570.20,-89.00,558.00,-1385.00,110.90}},
- {"Rodeo", {558.00,-1684.60,-89.00,647.50,-1384.90,110.90}},
- {"Rodeo", {72.60,-1544.10,-89.00,225.10,-1404.90,110.90}},
- {"Rodeo", {72.60,-1684.60,-89.00,225.10,-1544.10,110.90}},
- {"Royal Casino", {2087.30,1383.20,-89.00,2437.30,1543.20,110.90}},
- {"San Andreas Sound", {2450.30,385.50,-100.00,2759.20,562.30,200.00}},
- {"Santa Flora", {-2741.00,458.40,-7.60,-2533.00,793.40,200.00}},
- {"Santa Maria Beach", {342.60,-2173.20,-89.00,647.70,-1684.60,110.90}},
- {"Santa Maria Beach", {72.60,-2173.20,-89.00,342.60,-1684.60,110.90}},
- {"Shady Cabin", {-1632.80,-2263.40,-3.00,-1601.30,-2231.70,200.00}},
- {"Shady Creeks", {-1820.60,-2643.60,-8.00,-1226.70,-1771.60,200.00}},
- {"Shady Creeks", {-2030.10,-2174.80,-6.10,-1820.60,-1771.60,200.00}},
- {"Sobell Rail Yards", {2749.90,1548.90,-89.00,2923.30,1937.20,110.90}},
- {"Spinybed", {2121.40,2663.10,-89.00,2498.20,2861.50,110.90}},
- {"Starfish Casino", {2162.30,1883.20,-89.00,2437.30,2012.10,110.90}},
- {"Starfish Casino", {2437.30,1783.20,-89.00,2685.10,2012.10,110.90}},
- {"Starfish Casino", {2437.30,1858.10,-39.00,2495.00,1970.80,60.90}},
- {"Temple", {1096.40,-1026.30,-89.00,1252.30,-910.10,110.90}},
- {"Temple", {1096.40,-1130.80,-89.00,1252.30,-1026.30,110.90}},
- {"Temple", {1252.30,-1026.30,-89.00,1391.00,-926.90,110.90}},
- {"Temple", {1252.30,-1130.80,-89.00,1378.30,-1026.30,110.90}},
- {"Temple", {1252.30,-926.90,-89.00,1357.00,-910.10,110.90}},
- {"Temple", {952.60,-1130.80,-89.00,1096.40,-937.10,110.90}},
- {"The Camel's Toe", {2087.30,1203.20,-89.00,2640.40,1383.20,110.90}},
- {"The Clown's Pocket", {2162.30,1783.20,-89.00,2437.30,1883.20,110.90}},
- {"The Emerald Isle", {2011.90,2202.70,-89.00,2237.40,2508.20,110.90}},
- {"The Farm", {-1209.60,-1317.10,114.90,-908.10,-787.30,251.90}},
- {"The High Roller", {1817.30,1283.20,-89.00,2027.30,1469.20,110.90}},
- {"The Mako Span", {1664.60,401.70,0.00,1785.10,567.20,200.00}},
- {"The Panopticon", {-947.90,-304.30,-1.10,-319.60,327.00,200.00}},
- {"The Pink Swan", {1817.30,1083.20,-89.00,2027.30,1283.20,110.90}},
- {"The Sherman Dam", {-968.70,1929.40,-3.00,-481.10,2155.20,200.00}},
- {"The Strip", {2027.40,1703.20,-89.00,2137.40,1783.20,110.90}},
- {"The Strip", {2027.40,1783.20,-89.00,2162.30,1863.20,110.90}},
- {"The Strip", {2027.40,863.20,-89.00,2087.30,1703.20,110.90}},
- {"The Strip", {2106.70,1863.20,-89.00,2162.30,2202.70,110.90}},
- {"The Visage", {1817.30,1703.20,-89.00,2027.40,1863.20,110.90}},
- {"The Visage", {1817.30,1863.20,-89.00,2106.70,2011.80,110.90}},
- {"Unity Station", {1692.60,-1971.80,-20.40,1812.60,-1932.80,79.50}},
- {"Valle Ocultado", {-936.60,2611.40,2.00,-715.90,2847.90,200.00}},
- {"Verdant Bluffs", {1073.20,-2006.70,-89.00,1249.60,-1842.20,110.90}},
- {"Verdant Bluffs", {1249.60,-2179.20,-89.00,1692.60,-1842.20,110.90}},
- {"Verdant Bluffs", {930.20,-2488.40,-89.00,1249.60,-2006.70,110.90}},
- {"Verdant Meadows", {37.00,2337.10,-3.00,435.90,2677.90,200.00}},
- {"Verona Beach", {1046.10,-1722.20,-89.00,1161.50,-1577.50,110.90}},
- {"Verona Beach", {1161.50,-1722.20,-89.00,1323.90,-1577.50,110.90}},
- {"Verona Beach", {647.70,-2173.20,-89.00,930.20,-1804.20,110.90}},
- {"Verona Beach", {851.40,-1804.20,-89.00,1046.10,-1577.50,110.90}},
- {"Verona Beach", {930.20,-2006.70,-89.00,1073.20,-1804.20,110.90}},
- {"Vinewood", {647.50,-1227.20,-89.00,787.40,-1118.20,110.90}},
- {"Vinewood", {647.70,-1416.20,-89.00,787.40,-1227.20,110.90}},
- {"Vinewood", {787.40,-1130.80,-89.00,952.60,-954.60,110.90}},
- {"Vinewood", {787.40,-1310.20,-89.00,952.60,-1130.80,110.90}},
- {"Whitewood Estates", {1098.30,1726.20,-89.00,1197.30,2243.20,110.90}},
- {"Whitewood Estates", {883.30,1726.20,-89.00,1098.30,2507.20,110.90}},
- {"Willowfield", {1970.60,-2179.20,-89.00,2089.00,-1852.80,110.90}},
- {"Willowfield", {2089.00,-1989.90,-89.00,2324.00,-1852.80,110.90}},
- {"Willowfield", {2089.00,-2235.80,-89.00,2201.80,-1989.90,110.90}},
- {"Willowfield", {2201.80,-2095.00,-89.00,2324.00,-1989.90,110.90}},
- {"Willowfield", {2324.00,-2059.20,-89.00,2541.70,-1852.80,110.90}},
- {"Willowfield", {2541.70,-1941.40,-89.00,2703.50,-1852.80,110.90}},
- {"Willowfield", {2541.70,-2059.20,-89.00,2703.50,-1941.40,110.90}},
- {"Yellow Bell Station", {1377.40,2600.40,-21.90,1492.40,2687.30,78.00}},
- {"The Big Ear", {-410.00,1403.30,-3.00,-137.90,1681.20,200.00}},
- // Main Zones
- {"Bone County", {-480.50,596.30,-242.90,869.40,2993.80,900.00}},
- {"Flint County", {-1213.90,-2892.90,-242.90,44.60,-768.00,900.00}},
- {"Las Venturas", {869.40,596.30,-242.90,2997.00,2993.80,900.00}},
- {"Los Santos", {44.60,-2892.90,-242.90,2997.00,-768.00,900.00}},
- {"Red County", {-1213.90,-768.00,-242.90,2997.00,596.30,900.00}},
- {"San Fierro", {-2997.40,-1115.50,-242.90,-1213.90,1659.60,900.00}},
- {"Tierra Robada", {-1213.90,596.30,-242.90,-480.50,1659.60,900.00}},
- {"Tierra Robada", {-2997.40,1659.60,-242.90,-480.50,2993.80,900.00}},
- {"Whetstone", {-2997.40,-2892.90,-242.90,-1213.90,-1115.50,900.00}}
- };
- new Float:PrisonDoors[13][8] = // The doors in the walls which don't actually move.
- {
- {-1348.0691,-38.5054,14.2559,360.0, -1348.2301,-40.1830,14.2559,180.0},
- {-1332.5757,-36.2619,14.2559,360.0, -1332.4076,-38.1879,14.2529,180.0},
- {-1334.0663,-33.3880,17.7439,360.0, -1334.0234,-35.4010,17.7449,180.0},
- {-1344.2449,-63.5132,14.2539,270.0, -1345.9430,-64.8987,14.2549,80.0},
- {-1344.3245,-70.7916,14.253, 360.0, -1343.9180,-72.6758,14.2539,180.0},
- {-1340.8444,-70.9008,14.2539,360.0, -1340.7605,-72.7168,14.2539,180.0},
- {-1339.9564,-64.7962,14.2539,90.0, -1338.1248,-64.8185,14.2539,270.0},
- {-1340.0204,-61.5371,14.2539,90.0, -1337.9425,-61.6006,14.2539,270.0},
- {-1356.6853,-59.0986,14.2549,180.0, -1356.5496,-57.4523,14.2539,360.0},
- {-1349.2107,-60.3277,14.2549,80.0, -1347.4084,-59.5917,14.2549,270.0},
- {-1357.1915,-73.7678,14.2509,270.0, -1341.6388,-78.4411,14.2529,90.0},
- {-1374.6914,-70.6896,14.2529,270.0, -699.1069,2187.0488,3836.8000,180.0},
- {-677.9042,2187.1104,3836.8000,180.0, -1366.9058,-55.2733,14.2539,270.0}
- };
- new PrisonWorldsOut[13] = {6161, 6161, 6161, 6162, 6162, 6162, 6162, 6162, 6165, 6165, 6164, 6166, 6163};
- new PrisonWorldsIn[13] = {6164, 6164, 6164, 6164, 6162, 6162, 6162, 6162, 6164, 6164, 6166, 6163, 6164};
- new Float:PrisonCellsOut[16][3] =
- {
- {-1326.5046, -72.0196, 14.2529},
- {-1320.9116, -69.9818, 14.2529},
- {-1316.2842, -66.2137, 14.2529},
- {-1313.5074, -61.1261, 14.2529},
- {-1313.5067, -49.7493, 14.2529},
- {-1316.3357, -44.6696, 14.2529},
- {-1320.7437, -40.6969, 14.2529},
- {-1326.2512, -38.7378, 14.2529},
- {-1325.8904, -75.2943, 17.7449},
- {-1319.0911, -72.5848, 17.7559},
- {-1313.8562, -68.4220, 17.7449},
- {-1310.4923, -62.2628, 17.7559},
- {-1310.2072, -48.6184, 17.7559},
- {-1313.7145, -42.5214, 17.7559},
- {-1319.1606, -38.0359, 17.7559},
- {-1325.5183, -35.5168, 17.7449}
- };
- new Float:PrisonCellsIn[16][3] =
- {
- {-1325.8804,-74.3088,14.2529},
- {-1319.7340,-71.7242,14.2529},
- {-1314.8529,-67.3873,14.2529},
- {-1311.5145,-61.7944,14.2529},
- {-1311.6497,-48.7612,14.2529},
- {-1314.1737,-42.7624,14.2529},
- {-1319.8838,-38.9411,14.2529},
- {-1326.0568,-36.5832,14.2519},
- {-1325.4275,-77.4061,17.7449},
- {-1318.2346,-74.5037,17.7559},
- {-1312.4871,-69.4823,17.7449},
- {-1308.4513,-62.8875,17.7559},
- {-1308.5527,-47.7566,17.7559},
- {-1312.4196,-41.1709,17.7449},
- {-1318.2623,-36.1037,17.7559},
- {-1325.3212,-33.6756,17.7449}
- };
- new Float:IsoCellsIn[4][4] =
- {
- {-1338.3519, -61.5579, 14.2539},
- {-1338.1248, -64.8185, 14.2539},
- {-1340.7605, -72.7168, 14.2539},
- {-1343.9180, -72.6758, 14.2539}
- };
- new Float:IsoInAngles[4] = {270.0, 270.0, 180.0, 180.0};
- new Text3D:PrisonCellsText[16];
- new PrisonCellsLock[16];
- new PrisonDoorsLock[13];
- new mquery[2056];
- new tgstr[64];
- new ttgstr[64];
- new sgstr[256];
- new gstr[2056];
- new BotVehicle;
- new DCC_Channel: D_ChatID;
- #define NAMETAG_DISTANCE 15.0
- //player variables
- new PlayerCheckpointID[MAX_PLAYERS];
- new AFKSeconds[MAX_PLAYERS];
- new Text3D:NameTag[MAX_PLAYERS];
- new SkinBeforeSwat[MAX_PLAYERS];
- new Text3D:LabelFerido[MAX_PLAYERS];
- new ACPauseTimer[MAX_PLAYERS];
- new ADuty[MAX_PLAYERS];
- new AFKReason[MAX_PLAYERS][64];
- new AJailingPlayer[MAX_PLAYERS];
- new AJailingTime[MAX_PLAYERS];
- new Accent[MAX_PLAYERS][12];
- new AchievementPoints[MAX_PLAYERS];
- new ActionLog[MAX_PLAYERS][50][200 char];
- new AdminHidden[MAX_PLAYERS];
- new AdminJailData[MAX_PLAYERS][2];
- new AdminLevel[MAX_PLAYERS];
- new AdvertSpamTime[MAX_PLAYERS];
- new Appearance[MAX_PLAYERS][128];
- new AwaitingSpray[MAX_PLAYERS];
- new AwayMinutes[MAX_PLAYERS];
- new BMXBanned[MAX_PLAYERS];
- new BackupLocation[MAX_PLAYERS][MAX_ZONE_NAME];
- new BackupType[MAX_PLAYERS];
- new BankBalance[MAX_PLAYERS];
- new BeingAssistedBy[MAX_PLAYERS];
- new BeingHealed[MAX_PLAYERS];
- new BiggestFish[MAX_PLAYERS];
- new BizzSpawn[MAX_PLAYERS];
- new HasInjured[MAX_PLAYERS];
- new Blindfolded[MAX_PLAYERS];
- new BloodDrugLevels[MAX_PLAYERS][4];
- new BoatTestObjects[MAX_PLAYERS][75];
- new BodyBagIndex[MAX_PLAYERS];
- new BrowseMaskType[MAX_PLAYERS];
- new BurningMoney[MAX_PLAYERS];
- new BusRouteIndex[MAX_PLAYERS];
- new BusStopTimer[MAX_PLAYERS];
- new BuyFurnFrom[MAX_PLAYERS];
- new BuyProperty[MAX_PLAYERS][2];
- new CallInfo[MAX_PLAYERS][64];
- new CallType[MAX_PLAYERS];
- new CallerID[MAX_PLAYERS] = {-1, ...};
- new CallerService[MAX_PLAYERS] = {-1, ...};
- new CampfirePlaced[MAX_PLAYERS] = {INVALID_OBJECT_ID, ...};
- new CarryingCrate[MAX_PLAYERS];
- new Cash[MAX_PLAYERS];
- new ChangeOilVehID[MAX_PLAYERS];
- new CharSelectFaction[MAX_PLAYERS][4];
- new CharSelectLevel[MAX_PLAYERS][4];
- new CharSelectSQL[MAX_PLAYERS][4];
- new CharSelectSkin[MAX_PLAYERS][4];
- new CheckNumber[MAX_PLAYERS];
- new ClothesShop[MAX_PLAYERS];
- new Clothes[MAX_PLAYERS][5];
- new ClothingSelected[MAX_PLAYERS][MAX_TOYS];
- new CoalmineIndex[MAX_PLAYERS];
- new CoalmineLevel[MAX_PLAYERS];
- new CoalmineSpamTime[MAX_PLAYERS];
- new CoalmineStat[MAX_PLAYERS];
- new CombineDrugID[MAX_PLAYERS];
- new ConnectedTime[MAX_PLAYERS];
- new ConsumingMoney[MAX_PLAYERS];
- new ContactsSMSNumber[MAX_PLAYERS];
- new CreatingDrugs[MAX_PLAYERS][3]; //drug comment
- new CurrentWeapon[MAX_PLAYERS];
- new DMV_CanEndTest[MAX_PLAYERS];
- new DMV_ChosenTest[MAX_PLAYERS];
- new DMV_Index[MAX_PLAYERS];
- new DMV_SpeedLimit[MAX_PLAYERS];
- new DMV_TestVehicle[MAX_PLAYERS];
- new DMV_Testing[MAX_PLAYERS];
- new DMV_TimeTaken[MAX_PLAYERS];
- new DOOCMuted[MAX_PLAYERS];
- new DeathTimer[MAX_PLAYERS];
- new DeiveringFuelAmount[MAX_PLAYERS];
- new DeiveringFuelType[MAX_PLAYERS];
- new DeliverIndex[MAX_PLAYERS];
- new DeliverLevel[MAX_PLAYERS];
- new DeliverSpamTime[MAX_PLAYERS];
- new DeliverStat[MAX_PLAYERS];
- new DeliverStockList[MAX_PLAYERS][3];
- new DeliveringAtStop[MAX_PLAYERS];
- new DeliveringFuelVeh[MAX_PLAYERS][2];
- new DeliveringFuel[MAX_PLAYERS];
- new DeliveringStock[MAX_PLAYERS];
- new DeliveryTimer[MAX_PLAYERS];
- new DrugBadEffects[MAX_PLAYERS][2];
- new DrugCombineData[MAX_PLAYERS][20];
- new DrugLevel[MAX_PLAYERS];
- new DrugSelectionOffset[MAX_PLAYERS];
- new DrugSpamTimer[MAX_PLAYERS];
- new DrugsTaken[MAX_PLAYERS][10];
- new DrunkLevel[MAX_PLAYERS];
- new Duty[MAX_PLAYERS];
- new ET_GetOutTime[MAX_PLAYERS];
- new EditContactID[MAX_PLAYERS];
- new EditingAttachedObject[MAX_PLAYERS];
- new EditingHouseFurn[MAX_PLAYERS];
- new EditingRoadblock[MAX_PLAYERS];
- new EditingTempObject[MAX_PLAYERS];
- new EngineStartDelay[MAX_PLAYERS];
- new ExpTimer[MAX_PLAYERS];
- new ExploTimer[MAX_PLAYERS];
- new ExtTimer[MAX_PLAYERS] = {-1, ...};
- new FactionCustomRank[MAX_PLAYERS][16];
- new FactionRank[MAX_PLAYERS];
- new Faction[MAX_PLAYERS];
- new FilledForm[MAX_PLAYERS];
- new FishName[MAX_PLAYERS][5][12];
- new FishSpamTime[MAX_PLAYERS];
- new FishWeight[MAX_PLAYERS][5];
- new FishingRodHealth[MAX_PLAYERS];
- new Float:DrugWeaponEffects[MAX_PLAYERS][2];
- new FuelFillingTimer[MAX_PLAYERS];
- new FuelJobData[MAX_PLAYERS][2];
- new GoingToSprayVehicleID[MAX_PLAYERS];
- new GoldToggle[MAX_PLAYERS];
- new GuestHouseID[MAX_PLAYERS];
- new HasBet[MAX_PLAYERS];
- new HasGPSMount[MAX_PLAYERS];
- new HasGPSWaypoint[MAX_PLAYERS];
- new HasHouseKey[MAX_PLAYERS][2];
- new HasJustDied[MAX_PLAYERS];
- new HasUnlockedAchievement[MAX_PLAYERS][MAX_ACHS];
- new HeadshotsHit[MAX_PLAYERS];
- new HealID[MAX_PLAYERS];
- new HealSpamTime[MAX_PLAYERS];
- new HealedBy[MAX_PLAYERS];
- new Healing[MAX_PLAYERS];
- new HelperMsgTog[MAX_PLAYERS];
- new HitCount[MAX_PLAYERS];
- new HospitalTimer[MAX_PLAYERS];
- new Hotwiring[MAX_PLAYERS][2];
- new InCarCharging[MAX_PLAYERS];
- new InOwnedVehicle[MAX_PLAYERS];
- new InvitedToJoinFactionBy[MAX_PLAYERS];
- new InvitedToJoinFaction[MAX_PLAYERS];
- new IsBoomBanned[MAX_PLAYERS];
- //new IsBrowsingMasks[MAX_PLAYERS];
- new IsCoalmining[MAX_PLAYERS];
- new IsCuffed[MAX_PLAYERS];
- new IsDead[MAX_PLAYERS];
- new IsDelivering[MAX_PLAYERS];
- new IsDonator[MAX_PLAYERS];
- new IsDragging[MAX_PLAYERS];
- new IsEditingHolster[MAX_PLAYERS];
- new IsFrozen[MAX_PLAYERS];
- new IsHolsterTogged[MAX_PLAYERS][MAX_TOTAL_WEAPONS];
- new IsHolstered[MAX_PLAYERS][MAX_TOTAL_WEAPONS];
- new IsInBizzID[MAX_PLAYERS];
- new IsInFactionCar[MAX_PLAYERS];
- new IsInGarageID[MAX_PLAYERS];
- new IsInHouseID[MAX_PLAYERS];
- new IsInMotel[MAX_PLAYERS];
- new IsJailed[MAX_PLAYERS];
- new IsPhoneRinging[MAX_PLAYERS];
- new IsPlayerRefilling[MAX_PLAYERS];
- new IsSpectating[MAX_PLAYERS] = {-1, ...};
- new IsTied[MAX_PLAYERS];
- new IsTrashMan[MAX_PLAYERS];
- new IsTrucking[MAX_PLAYERS];
- new Isolated[MAX_PLAYERS];
- new IsolationTime[MAX_PLAYERS];
- new JailCell[MAX_PLAYERS];
- new JailTime[MAX_PLAYERS];
- new JobDuty[MAX_PLAYERS];
- new JobSpamTime[MAX_PLAYERS];
- new Job[MAX_PLAYERS];
- new JourneyInterior[MAX_PLAYERS];
- new JourneyTimerPlayer[MAX_PLAYERS];
- new JustEnteredVehicle[MAX_PLAYERS];
- new LastEventIDs[MAX_PLAYERS][2];
- new LastLogout[MAX_PLAYERS];
- new LastNumber[MAX_PLAYERS];
- new LastSMSNumber[MAX_PLAYERS];
- new LicenseSuspendTime[MAX_PLAYERS][8];
- new Licenses[MAX_PLAYERS][8];
- new ListeningBoom[MAX_PLAYERS];
- new LoginScreenID[MAX_PLAYERS][2];
- new LotteryNumber[MAX_PLAYERS];
- new MaskLabelNumber[MAX_PLAYERS];
- new MasterAccountName[MAX_PLAYERS][24];
- new MasterAccountPass[MAX_PLAYERS][129];
- new MasterAccount[MAX_PLAYERS];
- new MechanicCall[MAX_PLAYERS][128 char];
- new MedKitActionPlayer[MAX_PLAYERS];
- new MedKitAction[MAX_PLAYERS];
- new MemberBrowsing[MAX_PLAYERS];
- new MemberListIndex[MAX_PLAYERS];
- new MemberNameForAction[MAX_PLAYERS][MAX_PLAYER_NAME];
- new MobileSpeaker[MAX_PLAYERS];
- new ModQueue[MAX_PLAYERS][14];
- new MotelWaypoint[MAX_PLAYERS];
- new Muted[MAX_PLAYERS];
- new MyCharacters[MAX_PLAYERS][4];
- new MyDeaths[MAX_PLAYERS];
- new MyFareCharge[MAX_PLAYERS];
- new MyKills[MAX_PLAYERS];
- new MySpawnID[MAX_PLAYERS];
- new MyTaxiCar[MAX_PLAYERS];
- new NameChangeReason[MAX_PLAYERS][50];
- new NameChange[MAX_PLAYERS][MAX_PLAYER_NAME];
- new NearestHospital[MAX_PLAYERS];
- new NeedsAssistance[MAX_PLAYERS];
- new NewContactName[MAX_PLAYERS][30];
- new NoobSpawnID[MAX_PLAYERS];
- new NotepadText[MAX_PLAYERS][5][70];
- new OOCToggle[MAX_PLAYERS];
- new OfferedMoveinFrom[MAX_PLAYERS][2];
- new OilTextToggle[MAX_PLAYERS];
- new OrderCost[MAX_PLAYERS];
- new OrderingWeaponsIndex[MAX_PLAYERS];
- new OrderingWeapons[MAX_PLAYERS];
- new OverdoseWaitEffect[MAX_PLAYERS][7];
- new PMReplyID[MAX_PLAYERS];
- new PMSpamTime[MAX_PLAYERS];
- new PasswordTries[MAX_PLAYERS];
- new PauseTick[MAX_PLAYERS];
- new TimerDisconnect[MAX_PLAYERS];
- new PendingPaintjob[MAX_PLAYERS];
- new PizzaHomes[MAX_PLAYERS][10];
- new PizzaIndex[MAX_PLAYERS];
- new PizzaMarkers[MAX_PLAYERS][10];
- new PlayerBizzID[MAX_PLAYERS][MAX_BIZZ_PER_PLAYER];
- new PlayerBuyFurniture[MAX_PLAYERS][2];
- new PlayerBuyOutdoorFurniture[MAX_PLAYERS][2];
- new PlayerCalledTaxi[MAX_PLAYERS];
- new PlayerChecks[MAX_PLAYERS][3];
- new PlayerEditFurniture[MAX_PLAYERS];
- new PlayerEditOutdoorFurniture[MAX_PLAYERS];
- new PlayerIP[MAX_PLAYERS][16];
- new PlayerLevel[MAX_PLAYERS];
- new PlayerLightToggleTick[MAX_PLAYERS];
- new PlayerPaused[MAX_PLAYERS];
- new PlayerPlaceFurniture[MAX_PLAYERS] = {INVALID_OBJECT_ID, ...};
- new PlayerPlaceOutdoorFurniture[MAX_PLAYERS] = {INVALID_OBJECT_ID, ...};
- new PlayerRequest[MAX_PLAYERS];
- new PlayerRubber[MAX_PLAYERS];
- new PlayerSerial[MAX_PLAYERS][64];
- new PlayerTased[MAX_PLAYERS];
- new PlayerToBeDetainedSeat[MAX_PLAYERS];
- new PlayerToBeDetained[MAX_PLAYERS];
- new PlayerXP[MAX_PLAYERS];
- new PoliceFineAmount[MAX_PLAYERS];
- new PreTaserAmmo[MAX_PLAYERS];
- new PreTaserWeapon[MAX_PLAYERS];
- new PrisonTime[MAX_PLAYERS];
- new QuitFromFaction[MAX_PLAYERS];
- new RadioFrequency[MAX_PLAYERS];
- new RadioPoweredOn[MAX_PLAYERS];
- new RadioSlotUsed[MAX_PLAYERS];
- new RadioSlot[MAX_PLAYERS][3];
- new ReleasingImpoundedVehicle[MAX_PLAYERS];
- new RelogSpawnInfo[MAX_PLAYERS][2];
- new RelogSpawnSaved[MAX_PLAYERS];
- new RentRoom[MAX_PLAYERS];
- new RentalCar[MAX_PLAYERS];
- new RentalTime[MAX_PLAYERS];
- new RequestedToBlindfold[MAX_PLAYERS];
- new RequestedToFShake[MAX_PLAYERS];
- new RequestedToFrisk[MAX_PLAYERS];
- new RequestedToKiss[MAX_PLAYERS];
- new RequestedToShake[MAX_PLAYERS];
- new RequestingAdmin[MAX_PLAYERS];
- new ResettingMask[MAX_PLAYERS];
- new RoadBlockCount[MAX_PLAYERS];
- new RoadBlockObjects[MAX_PLAYERS][MAX_PLAYERROADBLOCKS];
- new RoadBlockTimer[MAX_PLAYERS][MAX_PLAYERROADBLOCKS];
- new SQLID[MAX_PLAYERS];
- new ScrapTimer[MAX_PLAYERS];
- new SellingAsset[MAX_PLAYERS][6];
- new ShamalInterior[MAX_PLAYERS];
- new ShotsFired[MAX_PLAYERS];
- new ShotsHit[MAX_PLAYERS];
- new SidejobDamage[MAX_PLAYERS];
- new SpawnAtHouse[MAX_PLAYERS];
- new SpawnCheckTimer[MAX_PLAYERS];
- new SpeedCameraCooldown[MAX_PLAYERS];
- new SpeedFormat[MAX_PLAYERS];
- new SpeedoActive[MAX_PLAYERS];
- new StingerAreaID[MAX_PLAYERS];
- new StingerObjectID[MAX_PLAYERS];
- new StretcherEquipped[MAX_PLAYERS];
- new StretcherHolding[MAX_PLAYERS];
- new StretcherPlayerID[MAX_PLAYERS];
- new StretcherTimer[MAX_PLAYERS];
- new SubFactionSpawn[MAX_PLAYERS];
- new SwatMode[MAX_PLAYERS];
- new TakeGunPlayer[MAX_PLAYERS];
- new TaxiFareID[MAX_PLAYERS];
- new TaxiFare[MAX_PLAYERS];
- new TaxiForceFare[MAX_PLAYERS];
- new TaxiMeter[MAX_PLAYERS];
- new TeleportTimer[MAX_PLAYERS];
- new TextTimer[MAX_PLAYERS];
- new TimeOnline[MAX_PLAYERS];
- new TotalTimePlayed[MAX_PLAYERS];
- new ToyBeingEdited[MAX_PLAYERS];
- new TrailerInterior[MAX_PLAYERS];
- new TransferingMoneyTo[MAX_PLAYERS];
- new TrashIndex[MAX_PLAYERS];
- new TrashLevel[MAX_PLAYERS];
- new TrashMissionData[MAX_PLAYERS][3];
- new TrashSpamTime[MAX_PLAYERS];
- new TrashStat[MAX_PLAYERS];
- new TropicInterior[MAX_PLAYERS];
- new TruckIndex[MAX_PLAYERS];
- new TruckLevel[MAX_PLAYERS];
- new TruckRouteId[MAX_PLAYERS];
- new TruckSpamTime[MAX_PLAYERS];
- new TruckStat[MAX_PLAYERS];
- new TruckingCallMsg[MAX_PLAYERS][128 char];
- new TruckingJobData[MAX_PLAYERS][2];
- new TruckingTrailer[MAX_PLAYERS];
- new TutorialIndex[MAX_PLAYERS];
- new UsingAccent[MAX_PLAYERS];
- new UsingFightStyle[MAX_PLAYERS char];
- new UsingFuelCan[MAX_PLAYERS][2];
- new UsingPayPhone[MAX_PLAYERS];
- new VSelectID[MAX_PLAYERS][5];
- new VSelectOffset[MAX_PLAYERS];
- new VehicleBorrowKeyTime[MAX_PLAYERS];
- new VehicleBorrowKey[MAX_PLAYERS];
- new VehicleShareOffer[MAX_PLAYERS][3];
- new VestType[MAX_PLAYERS];
- new ViewAdminRecord[MAX_PLAYERS];
- new ViewingBikeID[MAX_PLAYERS];
- new ViewingBoatID[MAX_PLAYERS];
- new ViewingBuyBikes[MAX_PLAYERS];
- new ViewingBuyBoats[MAX_PLAYERS];
- new ViewingBuyableCar[MAX_PLAYERS];
- new ViewingMicksCarID[MAX_PLAYERS];
- new ViewingMicksCar[MAX_PLAYERS];
- new ViewingBuyDV3[MAX_PLAYERS];
- new ViewingDV3ID[MAX_PLAYERS];
- new ViewingBuyDV4[MAX_PLAYERS];
- new ViewingDV4ID[MAX_PLAYERS];
- new ViewingTextID[MAX_PLAYERS][20];
- new VisibleObjects[MAX_PLAYERS];
- new WaitingForTruckTrailer[MAX_PLAYERS];
- new WantsNameChange[MAX_PLAYERS][2];
- new WantsRescue[MAX_PLAYERS];
- new WeaponLicense[MAX_PLAYERS];
- new WeaponSkillLevel[MAX_PLAYERS];
- new WeaponsOrdered[MAX_PLAYERS][5];
- new cPlayersSkin[MAX_PLAYERS];
- new mdcName[MAX_PLAYERS][MAX_PLAYER_NAME];
- new mdcPlate[MAX_PLAYERS][10];
- new nameshidden[MAX_PLAYERS];
- new pDrunkLevelLast[MAX_PLAYERS];
- new pFPS[MAX_PLAYERS];
- new pRefilling[MAX_PLAYERS];
- new pSpecLimit[MAX_PLAYERS];
- new pTCount[MAX_PLAYERS];
- new pTimerCount[MAX_PLAYERS];
- new scba[MAX_PLAYERS];
- new smask[MAX_PLAYERS];
- //Bools
- new bool:AcceptPM[MAX_PLAYERS char];
- new bool:AdminMsgToggle[MAX_PLAYERS char];
- new bool:AdvertsToggle[MAX_PLAYERS char];
- new bool:AudioToggle[MAX_PLAYERS char];
- new bool:BeingBanned[MAX_PLAYERS char];
- new bool:BeingTeleported[MAX_PLAYERS char];
- new bool:CanPlayerChoke[MAX_PLAYERS char];
- new bool:CheckReady[MAX_PLAYERS char];
- new bool:CompletedTutorial[MAX_PLAYERS char];
- new bool:Dead[MAX_PLAYERS char];
- new bool:FightStyleLearned[MAX_PLAYERS][2 char];
- new bool:HasActiveMechanicCall[MAX_PLAYERS char];
- new bool:HasActiveTruckingCall[MAX_PLAYERS char];
- new bool:HasBodyBag[MAX_PLAYERS char];
- new bool:HasEventWeapon[MAX_PLAYERS char];
- new bool:HasLaser[MAX_PLAYERS char];
- new bool:HasPizza[MAX_PLAYERS char];
- new bool:HasRubberBullets[MAX_PLAYERS char];
- new bool:HasTaser[MAX_PLAYERS char];
- new bool:HelperTog[MAX_PLAYERS char];
- new bool:HintToggle[MAX_PLAYERS char];
- new bool:IPTog[MAX_PLAYERS char];
- new bool:IsAFK[MAX_PLAYERS char];
- new bool:IsChangingSkin[MAX_PLAYERS char];
- new bool:IsDrivingBus[MAX_PLAYERS char];
- new bool:IsESU[MAX_PLAYERS char];
- new bool:IsHelper[MAX_PLAYERS char];
- new bool:IsInHospital[MAX_PLAYERS char];
- new bool:IsPlayerMasked[MAX_PLAYERS char];
- new bool:IsPlayingLottery[MAX_PLAYERS char];
- new bool:JustDeletedVehicle[MAX_PLAYERS char];
- new bool:JustSpawned[MAX_PLAYERS char];
- new bool:LillyCage[MAX_PLAYERS char] = {false, ...};
- new bool:LocalOOCEnabled[MAX_PLAYERS char];
- new bool:Logged[MAX_PLAYERS char];
- new bool:MaskHideName[MAX_PLAYERS char];
- new bool:MasterAccountLogged[MAX_PLAYERS char];
- new bool:NewsToggle[MAX_PLAYERS char];
- new bool:PagerStatus[MAX_PLAYERS char];
- new bool:PaycheckDisplayed[MAX_PLAYERS char];
- new bool:PingKickExemption[MAX_PLAYERS char];
- new bool:PlayerChoking[MAX_PLAYERS char];
- new bool:PlayerImprisoned[MAX_PLAYERS char];
- new bool:PlayerSelectedCharacter[MAX_PLAYERS char];
- new bool:ptogf[MAX_PLAYERS char];
- new bool:RemovingRoadblock[MAX_PLAYERS char];
- new bool:RentalRevoked[MAX_PLAYERS char];
- new bool:RestrictedVest[MAX_PLAYERS char];
- new bool:SelectingRoadblock[MAX_PLAYERS char];
- new bool:ShoutAnimToggle[MAX_PLAYERS char];
- new bool:TagBanned[MAX_PLAYERS char];
- new bool:TalkAnimToggle[MAX_PLAYERS char];
- new bool:ToggleDOOC[MAX_PLAYERS char];
- new bool:UsingATM[MAX_PLAYERS char];
- new bool:UsingCCTV[MAX_PLAYERS char];
- new bool:UsingPaint[MAX_PLAYERS char];
- new bool:WaitingAtStop[MAX_PLAYERS char];
- new bool:WeaponCheatAlerted[MAX_TOTAL_WEAPONS][MAX_PLAYERS char];
- new bool:WeaponsToBeSynced[MAX_PLAYERS char];
- new TimeIsDisplayed[MAX_PLAYERS char];
- //Floats
- new Float:ArmourVar[MAX_PLAYERS];
- new Float:BuyFurnPos[MAX_PLAYERS][6];
- new Float:ChangeOilPos[MAX_PLAYERS][3];
- new Float:CurrentArmourVar[MAX_PLAYERS];
- new Float:CurrentHealthVar[MAX_PLAYERS];
- new Float:FurnPosX[MAX_PLAYERS];
- new Float:FurnPosY[MAX_PLAYERS];
- new Float:FurnPosZ[MAX_PLAYERS];
- new Float:FurnRotX[MAX_PLAYERS];
- new Float:FurnRotY[MAX_PLAYERS];
- new Float:FurnRotZ[MAX_PLAYERS];
- new Float:HealthVar[MAX_PLAYERS];
- new Float:LastEventPos[MAX_PLAYERS][3];
- new Float:LastPlayerPos[MAX_PLAYERS][3];
- new Float:MovementSpeed[MAX_PLAYERS][2];
- new Float:PlayerHealth[MAX_PLAYERS];
- new Float:RefuelStandPos[MAX_PLAYERS][3];
- new Float:RelogSpawnPos[MAX_PLAYERS][3];
- new Float:SavedWaypoint[MAX_PLAYERS][3];
- new Float:SFRadius[MAX_PLAYERS];
- //Text labels
- new Text3D:AFK_Label[MAX_PLAYERS];
- new Text3D:DeliveringFuelLabel[MAX_PLAYERS];
- new Text3D:MaskLabel[MAX_PLAYERS];
- new Text3D:PaintLabels[MAX_PLAYERS][MAX_PLAYERS];
- // END OF PLAYER VARIABLES
- //=======================//
- //PICKUPS - REVOLTS
- new extmonthosp[1]; //coração /helmet FD
- //=====================================//
- // - Padrão pickups
- new pickup5[2]; // /banco palomino creek
- new pickup1[1]; //coração /helmet FD
- new pickup2[1]; // /FD armário /skin
- new pickup3[2]; // /FD - entrada principal
- new pickup4[1]; // /FD - entrada para garagem -int
- //new pickup5[1]; // /FD - entrada para garagem -ext
- new pickusilvert[1]; //SA Trading
- new pickupbanco[1]; //banco
- new comprardrogasID[1];//parei aqui Moonshine: -753.07,-131.56,65.82 e -416.35,-1760.50,5.77 : Icon :1254 e 1313
- //====================//
- new eltruck[1];
- new eltruck1[1];
- new pickworkjob[1];
- new prefeiturapal[1];
- new prefeiturafor[1];
- new prefeituraangel[1];
- new anprepalo1[2];
- new ansannews[1];
- new paydaypalomino[3];
- new jobinfopick[3];
- new pescapick[1];
- new eltpick[1];
- new destruirveiculopk[1];
- new pescapick2[1];
- new pedagiopagar[4];
- //=======================//
- new apostapick[1];
- new pegajobPickupID[1];
- new pegajob1PickupID[1];
- new pegajob2PickupID[1];
- //=======================//police
- new helthAduty[4];
- new pickAduty[2];
- new cctvPick[1];
- new swatPick[1];
- new copskinPick[1];
- //=======================//
- new BusPickupID[MAX_BUSSTOPS];
- new BusStopDescription[MAX_BUSSTOPS][50] =
- {
- {"The Panopticon Cutoff (Início do serviço)"},
- {"EasterBoard Farm, Blueberry Acres"},
- {"South Blueberry"},
- {"Blueberry Ammunation"},
- {"North Blueberry"},
- {"Fort Carson Trailer Park"},
- {"Las Barrancas South"},
- {"Las Barrancas North"},
- {"Tierra Robada (Cluckin' Bell)"},
- {"Tierra Robada (Fishing Shop)"},
- {"El Quebrados East"},
- {"El Quebrados Central"},
- {"El Quebrados West"},
- {"El Quebrados North"},
- {"El Quebrados (Gas Station)"},
- {"Valle Ocultado West"},
- {"Valle Ocultado East"},
- {"Las Payasadas"},
- {"The West (Bone County)"},
- {"Hunter Quarry (Entrance)"},
- {"Hunter Quarry (Works)"},
- {"Fort Carson Trailer Park"},
- {"South Fort Carson"},
- {"Fort Carson Hospital"},
- {"Fort Carson Town Center"},
- {"Fort Carson Town Center (Bank)"},
- {"North Fort Carson"},
- {"Fort Carson Diner"},
- {"East Fort Carson"},
- {"Fort Carson Cluckin Bell"},
- {"Outer Fort Carson"},
- {"Hampton Barns"},
- {"Montgomery Hospital"},
- {"Taxi Company, Montgomery"},
- {"Central Montgomery"},
- {"Pizza Stack, Montgomery"},
- {"Montgomery Casino"},
- {"North Palomino Creek"},
- {"North Main Street, Palomino Creek"},
- {"South Main Street, Palomino Creek"},
- {"Bank, Palomino Creek"},
- {"West Palomino Creek"},
- {"Montgomery Cutoff"},
- {"East Dillimore"},
- {"Central Dillimore"},
- {"South Dillimore"},
- {"Dillimore Gas Station"},
- {"North Dillimore"},
- {"The Welcome Pump, Dillimore"},
- {"South Blueberry"},
- {"South-West Blueberry"},
- {"EasterBoard Farm, Blueberry Acres"},
- {"The Panopticon Cutoff"},
- {"Bus Station (END OF SERVICE)"},
- {"Bus Station (END OF SERVICE)"},
- {"Bus Station (END OF SERVICE)"}
- };
- new DropObject[MAX_GUNS];
- //Vehicle variables
- new bool:AdminLocked[MAX_VEHICLES+1 char];
- new bool:aspawned[MAX_VEHICLES+1 char];
- new bool:BeingScrapped[MAX_VEHICLES+1 char];
- new bool:ELMs[MAX_VEHICLES+1 char];
- new bool:Locked[MAX_VEHICLES+1 char];
- new bool:Siren[MAX_VEHICLES+1 char];
- new bool:SnowPlow[MAX_VEHICLES+1 char] = {false, ...};
- new bool:vMusicPlaying[MAX_VEHICLES+1 char];
- new bool:WindowState[MAX_VEHICLES+1 char];
- new CarColor[MAX_VEHICLES+1][2];
- new DMVCarForPlayer[MAX_VEHICLES+1];
- new EmergencyLights[MAX_VEHICLES+1];
- new EngineStatus[MAX_VEHICLES+1];
- new FuelTypeAfterRefuel[MAX_VEHICLES+1];
- new MechanicSpray[MAX_VEHICLES+1][6];
- new Objective[MAX_VEHICLES+1][MAX_PLAYERS];
- new VCPauseTimer[MAX_VEHICLES+1];
- new VehicleBoots[MAX_VEHICLES+1][2];
- new VehicleBroke[MAX_VEHICLES+1];
- new VehicleBurning[MAX_VEHICLES+1];
- new VehicleCanBurn[MAX_VEHICLES+1];
- new VehicleLights[MAX_VEHICLES+1];
- new VehicleOnFire[MAX_VEHICLES+1];
- new VehicleSpawnedBy[MAX_VEHICLES+1][2];
- new VehObject[MAX_VEHICLES+1] = {INVALID_OBJECT_ID, ...};
- new vMusicLink[MAX_VEHICLES+1][256 char];
- new vTaxiSign[MAX_VEHICLES+1] = {INVALID_OBJECT_ID, ...};
- //Dynamic Areas
- new APArea;
- new GarageAreas[7];
- new PCArea;
- new SilverRectangle;
- new SpeedCameraAreas[6];
- //Object Variables
- new FDGate[6];
- new ApertureBA = 0;
- new ApertureSAMS = 1;
- new ARCount = 0;
- new AssistCount;
- new AtmObjectID[17];
- new AtmPickupID[18];
- new CompraPickupID[7];
- new CompraPickup1ID[6];
- new ConcessID[1];
- new garagenID[1];
- new dmvpickup[1];
- new centerinfoID[1];
- new dmvcomandopickup[1];//onde usa o comando /dmv
- new customdmvpickup[1];//onde usa o comando custom placa
- new dilimoreMotosID[1];
- //pickup para center info
- new picklinfoID[1];
- new picklinfo1ID[2];
- new picklinfo2ID[1];
- new picklinfo3ID[1];
- new picklinfo4ID[1];
- new picklinfo5ID[1];
- //Pickups lojas de roupas
- new bincopickupID[1];
- new prolapspickupID[1];
- new deidepickupID[1];
- new suburbanpickupID[1];
- new sasdpcki[1];
- //new ConcessMotoID[1];
- new ConceBarcosID[1];
- new BlindZone;
- new BusStopObjectIDStart;
- new CountdownTimer;
- new CurrentMotelEnumID = 1;
- new FadvertSpamTime;
- new FuelDecreaseCounter;
- new gLitterCount = 0;
- new gOOCDelay = 0;
- new gServerHour;
- new gServerMinute;
- new gServerSecond;
- new gServerUpcomingWeather = -1;
- new gServerUptime = 0;
- new gServerWeather;
- new gServerWeatherDelay = 0;
- new gServerYear;
- new HostBanIDX = 0;
- new HostBans[15][128];
- new Interviewer = -1;
- new InterviewName[25];
- new InterviewPlayer = -1;
- new TalkshowPlayer = -1;
- new TalkshowHost = -1;
- new TalkshowCallers[5] = {-1, ...};
- new bool:SANCallers = false;
- //new IRCBot, IRCTestBot;
- new IsCounting;
- new LotteryJackpot = 5000;
- new MaskStrangerNumber = 1000;
- new MathsAnswer = 0;
- new MathsStarted = 0;
- new MinutesUntilGMX = 0;
- new OneMinTimerCount;
- new OneSecondTimer;
- new OneSecTimerCount;
- new PayPhoneInUse[MAX_PAYPHONES];
- new PrisonLockdown = 0;
- new QuickCountTimer;
- new TextdrawCount = 0;
- new ToggleBC = 1;
- new ToggleOOC = 0;
- new TotalOwnedVehicles = 0;
- new WinningLotteryNumber;
- new totalchat;
- new totalmes;
- new totalcmds;
- //Faction rank array
- new FactionRanks[MAX_FACTIONS][15][32];
- //bools
- new bool:GlobalDOOCMute = false;
- new bool:GlobalHelperChatTog = false;
- //Floats
- new Float:Fuel[MAX_VEHICLES+1];
- //Textdraw variables
- new Text:DigiHP[MAX_PLAYERS];
- new Text:DigiAP[MAX_PLAYERS];
- //player textdraws
- new PlayerText:BlindfoldEffect[MAX_PLAYERS];
- new PlayerText:CharSelInfoTD[MAX_PLAYERS][4][4];
- new PlayerText:CharSelWelcome[MAX_PLAYERS];
- new PlayerText:DMV[MAX_PLAYERS];
- new PlayerText:DeathText[MAX_PLAYERS];
- new PlayerText:DrugCombineP[MAX_PLAYERS][5];
- //new PlayerText:FuelText[MAX_PLAYERS];
- //new PlayerText:vidaTxd[MAX_PLAYERS];
- //new PlayerText:coleteTxd[MAX_PLAYERS];
- //Colete & Vida
- new Text:Textdraw0;
- new Text:Textdraw1;
- new PlayerText:textdrawBateria0[MAX_PLAYERS];
- new PlayerText:textdrawBateria20[MAX_PLAYERS];
- new PlayerText:textdrawBateria40[MAX_PLAYERS];
- new PlayerText:textdrawBateria60[MAX_PLAYERS];
- new PlayerText:textdrawBateria80[MAX_PLAYERS];
- new PlayerText:textdrawBateria100[MAX_PLAYERS];
- new PlayerText:InfoText[MAX_PLAYERS];
- //new PlayerText:MaskHelpText[MAX_PLAYERS];
- new PlayerText:NewDrugTDP[MAX_PLAYERS];
- new PlayerText:Signcheck[MAX_PLAYERS];
- new PlayerText:SpeedText[MAX_PLAYERS];
- new PlayerText:SpeedTextM[MAX_PLAYERS];
- new PlayerText:VSelectOptions[MAX_PLAYERS][5];
- new PlayerText:pSpecTD[MAX_PLAYERS];
- // SAMP 0.3DL
- new PlayerText:Speedo3dl[MAX_PLAYERS];
- new PlayerText:Speedo3dl10[MAX_PLAYERS];
- new PlayerText:Speedo3dl20[MAX_PLAYERS];
- new PlayerText:Speedo3dl30[MAX_PLAYERS];
- new PlayerText:Speedo3dl40[MAX_PLAYERS];
- new PlayerText:Speedo3dl50[MAX_PLAYERS];
- new PlayerText:Speedo3dl60[MAX_PLAYERS];
- new PlayerText:Speedo3dl70[MAX_PLAYERS];
- new PlayerText:Speedo3dl80[MAX_PLAYERS];
- new PlayerText:Speedo3dl90[MAX_PLAYERS];
- //global textdraws
- new Text:AdminRequestTD;
- new Text:AdminRequestTD3dl;
- new Text:AssistTD;
- new Text:AssistTD3dl;
- new Text:CCTV;
- new Text:CharSelBackground;
- new Text:CharSelHeader;
- new Text:CharSelX;
- new Text:DrugCombine[8];
- new Text:EngineOilTextR;
- new Text:EngineOilTextY;
- new Text:LowFuelText;
- //Fuel 0.3dl
- new Text:fuel3dl12;
- new Text:fuel3dl25;
- new Text:fuel3dl37;
- new Text:fuel3dl50;
- new Text:fuel3dl65;
- new Text:fuel3dl75;
- new Text:fuel3dl87;
- new Text:fuel3dl100;
- new Text:fuel3dl;
- //Car textdraw 0.3dl
- //Milhas textdraw
- new Text:texmilhas3dl;
- new Text:texmilhas3dl1;
- new Text:luzesTxD3dl;
- new Text:unlockedTxD3dl;
- new Text:lockedTxD3dl;
- //
- new Text:NewDrugTD[3];
- new Text:TimeText24;
- new Text:TimeText;
- new Text:URAFK2;
- new Text:URAFK3;
- //new Text:VSelectBackground;
- //new Text:VSelectDown;
- //new Text:VSelectHeader;
- //new Text:VSelectUp;
- new Text:VehicleEngineText;
- new Text:Website;
- new Text:WeedEffect;
- //Backgound selecionar carros -
- new Text:backgoundvcar12;
- //3d text label variables
- new Text3D:MotelLabels[MAX_MOTELS];
- new Text3D:reefer[MAX_VEHICLES+1];
- //gates and stuff
- new PayTolls[6][2], PayTollTimer[6] = {-1, ...};
- new PizzaCar1, PizzaCar2, Dumper1, Dumper2, MaintTruck1, MaintTruck2;
- new PaytollCloseTimer[6];
- enum FURNI_DATA
- {
- fModel,
- fuName[50],
- fPrice,
- fCategory,
- fSubCategory,
- bool:fExteriorAllow
- }
- enum PHONE_DATA
- {
- pID,
- pNumber,
- pOwnerSQLID,
- pPosessorID,
- Float:pBattery,
- pCredit,
- pPower,
- pOwnerName[24],
- PhonePossession,
- bool:ShowPhonebook
- }
- enum CONTACTS_DATA
- {
- cID,
- ContactName[30],
- ContactNumber
- };
- enum FURNITURE_DETAILS
- {
- textureDescription[150],
- textureObjectID,
- furnitureTexture[150],
- furnitureTexture2[150],
- textureCategory[150],
- };
- new FurnitureTextures[][FURNITURE_DETAILS] =
- {
- #define PCOLORS "Plain Colors"
- {"Purple", 8839, "vgsecarshow", "lightpurple2_32", PCOLORS},
- {"Blue", 5774, "garag3_lawn", "bluestucco1", PCOLORS},
- {"Bright Blue", 8839, "vgsecarshow", "lightblue2_32", PCOLORS},
- {"Bright Green", 8839, "vgsecarshow", "lightgreen2_32", PCOLORS},
- {"Green", 19271, "MapMarkers", "green-2", PCOLORS},
- {"Lime Green", 18749, "MatTextures", "lime", PCOLORS},
- {"Yellow", 5168, "lashops6_las2", "yellow2_128", PCOLORS},
- {"Brighter Yellow", 18245, "cw_junkyardmachin", "Was_scrpyd_light_yellow", PCOLORS},
- {"Orange", 18250, "cw_junkbuildcs_t", "Was_scrpyd_baler_locker", PCOLORS},
- {"Orange 2", 18749, "MatTextures", "SAMPOrange", PCOLORS},
- {"Pink", 3267, "milbase", "lightred2_32", PCOLORS},
- {"Red", 18856, "MatTextures", "SAMPRed", PCOLORS},
- {"Darker Red", 19184, "MapMarkers", "red-2", PCOLORS},
- {"Deep Red", 5142, "lashops1b_las2", "snpdwhit2", PCOLORS},
- {"Pitch Black", 13816, "lahills_safe1", "black16", PCOLORS},
- {"Smoky Black", 11088, "crackfactdem_sfs", "ws_altz_wall7_top_burn", PCOLORS},
- {"Light Gray", 8839, "vgsecarshow", "lightblue_64", PCOLORS},
- {"Happy Gray", 16109, "des_se1", "parking2plain", PCOLORS},
- {"Eggshell", 8675, "wddngchpl02", "vgschapelwall01_64", PCOLORS},
- {"White", 4833, "airprtrunway_las", "white", PCOLORS},
- #define PFABRICS "Printed Fabrics"
- {"Varied Green Stripes", 17511, "stadium_lae2", "stadt_banner1", PFABRICS},
- {"Varied Purple and Green Stripes", 17511, "stadium_lae2", "stadt_banner2", PFABRICS},
- {"Varied White, Brown and Green Stripes", 17511, "stadium_lae2", "stadt_banner3", PFABRICS},
- {"Blue, White and Red Stripes", 9583, "bigshap_sfw", "boatfunnel1_128", PFABRICS},
- {"Blue and White Stripes", 12850, "cunte_block1", "ablusrip", PFABRICS},
- {"Blue, Green, White and Yellow Stripes", 5142, "lashops1b_las2", "sanpedshpito", PFABRICS},
- {"Red And White Stripes", 3039, "ct_salx", "ct_stall1", PFABRICS},
- {"Black, Gray, Yellow, Red", 3990, "lanroad", "lakerbcol", PFABRICS},
- {"Red and Green Tartan", 3060, "paracx", "parachute_e", PFABRICS},
- {"Multi-colored Squares", 3922, "bistro", "Tablecloth", PFABRICS},
- {"Spongy Red", 10412, "hotel1", "carpet_red_256", PFABRICS},
- {"Spongy Maroon", 14808, "lee_strip2", "WH_carpet1", PFABRICS},
- {"Spongy Blue", 5392, "eastshops1_lae", "blueshop2_LAe", PFABRICS},
- {"Yellow Tartan", 13003, "ce_racestart", "CJ_TARTAN", PFABRICS},
- {"Blue Camouflage", 10631, "queensammo_sfs", "ammu_camo1", PFABRICS},
- {"Blue Patterns", 10226, "sfeship1", "CJ_CUSHION2", PFABRICS},
- {"Blue Patterns 2", 19447, "all_walls", "vgsn_scrollsgn256", PFABRICS},
- {"Brown Flower Pattern", 15034, "genhotelsave", "cj_cushion1", PFABRICS},
- {"Brown Sheets", 16150, "ufo_bar", "Gen_Sacki", PFABRICS},
- {"Floral Print", 2680, "cj_chris", "CJ_Floral", PFABRICS},
- {"White and Blue Mattress", 12954, "sw_furniture", "CJ_MATRESS2", PFABRICS},
- {"Used Mattress", 1637, "od_beachstuff", "lounger_matress", PFABRICS},
- {"Plain Matress", 2575, "cj_hotel_poor", "CJ_mattress", PFABRICS},
- {"Rainbow Stripes", 3853, "gay_xref", "ws_gayflag1", PFABRICS},
- {"American Flag", 12853, "cunte_gas01", "starspangban1_256", PFABRICS},
- {"American Flag 2", 14782, "intring_gymint3", "star_spang", PFABRICS},
- {"Confederate Flag", 12853, "cunte_gas01", "cj_flag2", PFABRICS},
- {"Italian Flag", 5111, "ground2_las2", "sanpedpawn1a", PFABRICS},
- {"Black Carpet", 17946, "carter_mainmap", "mp_carter_carpet", PFABRICS},
- {"Gray Carpet", 14475, "ganghoos", "mp_burn_carpet", PFABRICS},
- {"Red Carpet", 14506, "imy_motel", "mp_motel_carpet1", PFABRICS},
- {"Red Carpet 2", 8463, "vgseland", "triadcarpet2", PFABRICS},
- {"Black Carpet 2", 14700, "vgshs2int2", "carpet-tile", PFABRICS},
- {"Dark Carpet", 14838, "lee_stripclub", "cl_floornew_256", PFABRICS},
- {"Worn Gray Carpet", 14701, "lahss2int2", "HS1_carpet1", PFABRICS},
- {"Blue Rug", 11704, "bdupsnew", "Bdup2_carpet", PFABRICS},
- {"Light Blue Fabric", 14707, "labig3int2", "HS2_3Wall10", PFABRICS},
- {"Light Purple Fabric", 14707, "labig3int2", "HS2_3Wall7", PFABRICS},
- {"Pink Fabric", 14707, "labig3int2", "HS2_3Wall9", PFABRICS},
- {"Old White Fabric", 14756, "smallsfhs", "wall6", PFABRICS},
- {"White Carpet", 14672, "genintintsex", "mp_cop_floor2", PFABRICS},
- {"Black Carpet 3", 14808, "lee_strip2", "strip_carpet2", PFABRICS},
- {"Yellow Carpet", 14590, "mafcastopfoor", "ab_carpet01", PFABRICS},
- {"Old Black Carpet", 18028, "cj_bar2", "GB_nastybar10", PFABRICS},
- {"Dark Carpet 2", 14431, "dr_gsnew", "mp_gs_carpet", PFABRICS},
- {"Light Carpet", 14581, "ab_mafiasuitea", "carp01S", PFABRICS},
- {"Zebra Stripes", 14838, "lee_stripclub", "zebra_skin", PFABRICS},
- {"Light Blue Carpet", 14708, "labig1int2", "GB_rug01", PFABRICS},
- {"Fancy Rug", 11704, "bdupsnew", "Bdup2_Rug", PFABRICS},
- {"Pink Curtain", 11707, "cuntcuts", "AH_pinkcurtain", PFABRICS},
- {"Brown Curtain", 14710, "vgshm3int2", "ah_curtains1", PFABRICS},
- {"Blue Curtain", 14701, "lahss2int2", "HS2_Curt1", PFABRICS},
- {"Light Blue Curtain", 14702, "masmall3int2", "HS2_Curt2", PFABRICS},
- {"Light Blue Curtain 2", 2559, "hospital", "CJ_H_CURTAIN1", PFABRICS},
- {"Orange Curtain", 14701, "lahss2int2", "HS2_Curt4", PFABRICS},
- {"Purple Curtain", 14701, "lahss2int2", "HS2_Curt5", PFABRICS},
- {"Red Curtain", 14808, "lee_strip2", "Strip_curtain", PFABRICS},
- #define WOODS "Wood"
- {"The Standard", 19400, "all_walls", "mp_diner_woodwall", WOODS},
- {"Classy Wood", 16150, "ufo_bar", "sa_wood08_128", WOODS},
- {"Brown Wood", 14581, "ab_mafiasuitea", "walp45S", WOODS},
- {"Red Wood", 13681, "lahillshilhs1e", "woodboards2", WOODS},
- {"Reclaimed Wood", 6094, "canalsg_law", "ws_sheetwood_clean", WOODS},
- {"Light Wood 1", 3881, "apsecurity_sfxrf", "CJ_WOOD1", WOODS},
- {"Light Wood 2", 13003, "ce_racestart", "sa_wood07_128", WOODS},
- {"Light Wood 3", 16377, "des_byofficeint", "CJ_LIGHTWOOD", WOODS},
- {"Dark Wood 1", 1515, "dsfs", "CJ_WOOD6", WOODS},
- {"Dark Wood 2", 11631, "mp_ranchcut", "mpCJ_WOOD_DARK", WOODS},
- {"Dark, Ugly Wood", 18250, "cw_junkbuildcs_t", "Was_scrpyd_shack_wall", WOODS},
- {"Dull, Dark Wood", 17925, "lae2fake_int", "ab_wood1", WOODS},
- {"Rotting Painted Wood 1", 17566, "contachou1_lae2", "comptwall26", WOODS},
- {"Rotting Painted Wood 2", 3193, "cxref_desert", "des_bywall1", WOODS},
- {"Rotting Painted Wood 3", 3355, "cxref_savhus", "des_bywall2", WOODS},
- {"Rotting Painted Wood 4", 14700, "vgshs2int2", "ah_CRAKPLNK", WOODS},
- {"Very Old Wood", 12976, "sw_diner1", "telepole128", WOODS},
- {"Tatty Wood", 5149, "lasground2_las2", "tatty_wood_1", WOODS},
- {"'Fence' Wood", 5122, "ground3_las2", "fence1", WOODS},
- {"Fancy Diner Flooring", 3919, "librest", "DinerFloor", WOODS},
- {"Sleek Wood Flooring", 14771, "int_brothelint3", "GB_nastybar12", WOODS},
- {"Cheap Wood Flooring", 14825, "genintint2_gym", "gym_floor5", WOODS},
- {"Cheap, Scratched Flooring", 14709, "lamidint2", "mp_apt1_floor", WOODS},
- {"Fine Parquet", 14581, "ab_mafiasuitea", "wood02S", WOODS},
- {"Wooden Mosaic", 4004, "civic07_lan", "cityhallroof", WOODS},
- {"Wood Square Panels", 13007, "sw_bankint", "woodfloor1", WOODS},
- {"Wood Planks", 16322, "a51_stores", "des_ghotwood1", WOODS},
- {"Aged Planks", 1219, "woodpanels", "planks01", WOODS},
- {"White Planks", 10152, "sfvictorian2", "pier69_ground1", WOODS},
- {"White Planks 2", 12960, "sw_church", "ws_vic_wood1", WOODS},
- {"White Planks 3", 12911, "sw_farm1", "sw_barnwood1", WOODS},
- {"Old White Planks", 12911, "sw_farm1", "sw_barnwood2", WOODS},
- {"Old White Planks 2", 4849, "ground3_las", "pierboards_la", WOODS},
- {"Gray Planks", 3310, "sw_poorhouse", "GB_nastybar08", WOODS},
- {"Old Gray Planks", 4820, "ground4_las", "adet", WOODS},
- {"Boardwalk", 13809, "lahillsground4", "boardwalk_la" , WOODS},
- {"Wood Boards", 5134, "wasteland_las2", "floorboard256128" , WOODS},
- {"Light Wood Pattern", 3306, "cunte_house1", "des_ntwnwall1", WOODS},
- {"Dark Brown Planks", 17298, "weefarmcuntw", "sjmbigold2", WOODS},
- {"Creepy Planks", 12937, "sw_oldshack", "sw_cabinwall01", WOODS},
- {"Blue Planks", 5766, "capitol_lawn", "lasjmscruffwall3", WOODS},
- {"Bright Blue Planks", 5135, "groundb_las2", "sanpedock8", WOODS},
- {"Bright Yellow Planks", 5113, "lasground_las2", "sanpedpawn1", WOODS},
- {"White and Red Wood", 4830, "airport2", "sw_shedwall02", WOODS},
- {"White and Blue Wood", 12925, "sw_sheds", "sw_shedwall03", WOODS},
- {"Dull Wood Logs", 17067, "cw2_logcabins", "cw2_logwall", WOODS},
- {"Light Wood Logs", 11490, "des_ranch", "des_logwall", WOODS},
- {"Flat Logs", 13711, "mullho03_lahills", "des_flatlogs", WOODS},
- {"Wood Slats", 11501, "des_farmstuff", "des_woodslats1", WOODS},
- {"Walnut 1", 14581, "ab_mafiasuitea", "ab_walnut", WOODS},
- {"Walnut 2", 14581, "ab_mafiasuitea", "ab_walnutLite", WOODS},
- {"Brown Wood Paneling", 9583, "bigshap_sfw", "bridge_walls2_sfw", WOODS},
- {"Tiki Reed", 8536, "tikisign", "tikireed01_128", WOODS},
- {"Bamboo", 3595, "dingbat01_la", "bambowal1_LA", WOODS},
- {"Old Barn", 16146, "des_ufoinn", "shackdoor01", WOODS},
- #define TILES "Tile and Mosaic"
- {"Shiny White", 10023, "bigwhitesfe", "recessed_light_SF", TILES},
- {"White and Blue", 12841, "cos_pizzaplace", "swimpoolside1_128", TILES},
- {"Yellow and Blue", 5408, "tempstuff_lae", "examball1_LAe", TILES},
- {"Blue Pool Tiles", 13675, "lahillsgrounds", "bevpool", TILES},
- {"Better Times", 4004, "civic07_lan", "Bow_sub_wallshine", TILES},
- {"Small White Tiles", 12853, "cunte_gas01", "sw_floor1", TILES},
- {"Thin Wall Tiles", 17049, "cuntwf", "sw_walltile", TILES},
- {"Thick Wall Tiles", 4558, "lanlacmab_lan2", "sl_gallerywall1", TILES},
- {"Dirty Wall Tiles", 14700, "vgshs2int2", "ah_whitiles", TILES},
- {"The Classic", 3961, "lee_kitch", "dinerfloor01_128", TILES},
- {"The Classic 2", 14771, "int_brothelint3", "bwtilebroth", TILES},
- {"The Classic 3", 18082, "cj_barb", "CJ_TILES_5", TILES},
- {"Aged Classic", 13724, "docg01_lahills", "marbletile8b", TILES},
- {"Classy Blue", 10871, "blacksky_sfse", "ws_slatetiles", TILES},
- {"Dark Blue", 6351, "rodeo02_law2", "helmutwall1_LAw", TILES},
- {"Classic White", 3904, "libertyfar", "subplat", TILES},
- {"Aged Fancy Tiles", 5772, "stationtunnel", "mp_apt1_bathfloor1", TILES},
- {"Fancy Black Tiles", 14388, "dr_gsnew", "mp_gs_kitchfloor", TILES},
- {"Modern White Tiles", 10932, "station_sfse", "ws_stationfloor", TILES},
- {"Modern Yellow Tiles", 10973, "mall_sfse", "mallfloor3", TILES},
- {"Blue And Yellow Tiles", 1594, "chairsntable", "mallfloor6", TILES},
- {"Tile Stone", 1677, "wshxrefhse2", "tilestone256", TILES},
- {"Dirty Tiles", 11389, "hubint1_sfse", "ab_ceiling1", TILES},
- {"Stone Tiles", 16639, "a51_labs", "dam_terazzo" , TILES},
- {"Old Black Tiles", 5815, "lawngrnd", "man_cellarfloor128", TILES},
- {"Dark Tiles", 14700, "vgshs2int2", "AH_rykitiles", TILES},
- {"Terra Cotta Tile", 18020, "genintintfastb2", "ws_terratiles", TILES},
- {"Gray Tiles", 14706, "labig2int2", "ab_tile1", TILES},
- {"Brown/Olive Green Bricks", 14756, "smallsfhs", "mp_carter_tilewall", TILES},
- {"Brown Tiles", 14709, "lamidint2", "mp_apt1_kitchfloor", TILES},
- {"Brown Tiles 2", 18029, "genintintsmallrest", "GB_restaursmll06", TILES},
- {"Light Green Tiles", 18029, "genintintsmallrest", "GB_restaursmll07", TILES},
- {"Dull Red Tiles", 14388, "dr_gsnew", "AH_flroortile12", TILES},
- {"Red Stones", 13675, "lahillsgrounds", "sjmlahus29", TILES},
- {"Blue Mosaic", 17562, "coast_apts", "otb_floor1", TILES},
- {"Green Mosaic", 3595, "dingbat01_la", "mosaic1_LAwn", TILES},
- {"Hexagon Tile Pattern", 14506, "imy_motel", "ab_tilehex2", TILES},
- {"Green Formica", 11704, "cj_kitchen", "FORMICA2", TILES},
- #define MARB "Marble, Stone, Bricks, Concrete"
- {"Black Marble", 3922, "bistro", "Marble", MARB},
- {"Black Marble 2", 10969, "scum_sfse", "Was_scrpyd_floor_hangar", MARB},
- {"Gray Marble", 4830, "airport2", "LASLACMA96", MARB},
- {"White Marble", 3922, "bistro", "Marble2", MARB},
- {"Yellow Marble", 3922, "bistro", "rest_wall4", MARB},
- {"White Marble Block", 16023, "des_trainstuff", "ws_stoneblock", MARB},
- {"Stone Wall 1", 18202, "w_towncs_t", "hatwall256hi", MARB},
- {"Stone Wall 2", 13724, "docg01_lahills", "des_ranchwall1", MARB},
- {"Stone Wall 3", 8839, "vgsecarshow", "sw_wallbrick_06", MARB},
- {"Stone Wall 4", 8565, "vgsebuild01", "ws_stonewall", MARB},
- {"Stone Wall 5", 6056, "venice_law", "stonewall_la", MARB},
- {"Stone Wall 6", 6057, "venicegb02_law", "stonewall3_la", MARB},
- {"Fancy Stones", 5113, "lasground_las2", "adeta", MARB},
- {"Dark Stones", 18029, "genintintsmallrest", "GB_restaursmll05", MARB},
- {"Yellow Stones", 16136, "des_telescopestuff", "stoneclad1", MARB},
- {"White Brick Wall", 8399, "vgs_shops", "vgsclubwall05_128", MARB},
- {"Gray Stone Wall", 8645, "vegashsetx", "badhousewall01_128", MARB},
- {"Concrete Pattern", 4849, "ground3_las", "ws_bigstones", MARB},
- {"Gray Brick Wall", 13823, "lahillsground4cye", "GB_nastybar03", MARB},
- {"Fancy White Bricks", 13675, "lahillsgrounds", "bevr03b_law", MARB},
- {"Red Brick Wall", 8531, "officeground", "ws_redbrickold", MARB},
- {"Old Red Brick Wall", 5180, "lashops93_las2", "ws_oldredbrick", MARB},
- {"Old Red Brick Wall 2", 10864, "bridgeland_sfse", "ws_altz_wall1", MARB},
- {"Brick Wall 1", 8839, "vgsecarshow", "sw_brewbrick01", MARB},
- {"Brick Wall 2", 8390, "vegasemulticar", "ws_mixedbrick", MARB},
- {"Brick Wall 3", 13015, "sw_genstore", "sw_wallbrick_03", MARB},
- {"Brick Wall 4", 12959, "sw_library", "sw_brick05", MARB},
- {"Brick Wall 5", 17049, "cuntwf", "sw_brick04", MARB},
- {"Brick Wall 6", 12853, "cunte_gas01", "sw_brick03", MARB},
- {"Brick Wall 7", 4552, "ammu_lan2", "sl_lavicdtwall1", MARB},
- {"Brick Wall 8", 10769, "docks2_sfse", "ws_sandstone1", MARB},
- {"Brick Wall 9", 9683, "goldengate_sfw", "stonesandkb2_128", MARB},
- {"Brick Wall 10", 5418, "idlewood3_lae", "ws_sandstone2", MARB},
- {"Brick Wall 11", 12988, "sw_fact02", "ws_sandstone2b", MARB},
- {"Brick Wall 12", 18018, "genintintbarb", "GB_midbar01", MARB},
- {"Black Concrete", 3975, "lanbloke", "p_floor3", MARB},
- {"Black Concrete 2", 14771, "int_brothelint3", "GB_midbar15", MARB},
- {"Dark Stone Wall", 17545, "burnsground", "newall1-1128", MARB},
- {"White Concrete", 11089, "cf_metals_sfse", "ws_altz_wall8_top", MARB},
- {"Gray Concrete", 6052, "law_doontoon", "carpark_256128", MARB},
- {"Gray Concrete 2", 14783, "intgarage2aint3", "Bow_Abattoir_Conc2", MARB},
- {"Concrete Block", 1214, "metal", "BLOCK2low", MARB},
- {"Cracked Yellow Concrete", 14700, "vgshs2int2", "ah_yelbadwall", MARB},
- {"Metal Pattern", 12984, "sw_block11", "sw_stairs1", MARB},
- {"Rusted Concrete", 10375, "subshops_sfs", "ws_rooftarmac1", MARB},
- #define METALS "Metals"
- {"Silver Metal", 1560, "7_11_door", "cj_sheetmetal2", METALS},
- {"Red Metal", 2130, "cj_kitchen", "CJ_RED", METALS},
- {"Scratched Metal", 16640, "a51", "scratchedmetal", METALS},
- {"Blue Paneling", 16067, "des_stownmots1", "corugwall1", METALS},
- {"Red Paneling", 16067, "des_stownmots1", "corugwallnew6_128", METALS},
- {"Yellow Paneling", 18265, "w_town3cs_t", "corugwall_sandy", METALS},
- {"Old Purple Metal", 5126, "imrancomp_las2", "ws_oldpaintedblue", METALS},
- {"Old Gray Metal", 12858, "wiresnshit", "ws_oldpainted", METALS},
- {"Old White Metal", 10820, "roadbridge_sfse", "ws_oldpainted2", METALS},
- {"Rusty White Metal", 10820, "roadbridge_sfse", "ws_oldpainted2rusty", METALS},
- {"Dull Green Metal", 1257, "bustopm", "CJ_GREENMETAL", METALS},
- {"Green Metal", 10770, "carrier_sfse", "ws_floor2", METALS},
- {"Gray Metal", 10770, "carrier_sfse", "ws_shipmetal1", METALS},
- {"Black Metal", 10770, "carrier_sfse", "ws_shipmetal3", METALS},
- {"White Metal", 10770, "carrier_sfse", "ws_shipmetal4", METALS},
- {"Light Blue Metal", 11145, "carrierint_sfs", "ws_shipmetal5", METALS},
- {"White Metal Tiles", 3262, "privatesign", "ws_metalpanel1", METALS},
- {"Black Metal Tiles", 9362, "sfn_byofficeint", "CJ_Black_metal", METALS},
- {"Dark Metal", 970, "fences", "blackmetal", METALS},
- {"Light Metal Banding", 12960, "sw_church", "banding3_64HV", METALS},
- {"Brown Metal Banding", 5408, "tempstuff_lae", "sl_metalbndrust1", METALS},
- {"Scratched Metal 2", 3961, "lee_kitch", "metal5", METALS},
- {"Scratched Metal 3", 3961, "lee_kitch", "metal6", METALS},
- {"Clean Metal Plate", 9361, "sfn_office", "des_facmetal", METALS},
- {"Silver Metal 2", 1214, "metal", "CJ_FRAME_Glass", METALS},
- {"Sleek Metal", 14581, "ab_mafiasuitea", "barbersmir1", METALS},
- {"Bolted White Metal Panel", 10820, "roadbridge_sfse", "banding9_64HV", METALS},
- {"Bolted Yellow Metal Panel", 5126, "imrancomp_las2", "banding5_64HV", METALS},
- {"Bolted Brown Metal Panel", 3080, "adjumpx", "rustyboltpanel", METALS},
- {"Bolted Black Metal", 16322, "a51_stores", "girder2_grey_64HV", METALS},
- {"Bolted Red Metal", 5126, "imrancomp_las2", "girder2_red_64HV", METALS},
- {"New Bolted White Metal Panel", 16322, "a51_stores", "dish_panel_a", METALS},
- {"Metal Plate", 915, "airconext", "CJ_plating", METALS},
- {"Gray Metal 2", 4833, "airprtrunway_las", "cj_sheetmetal", METALS},
- {"Old Red Metal", 5123, "chemgrnd_las2", "redmetal", METALS},
- {"Old Dark Red Metal", 946, "bskball_standext", "drkbrownmetal", METALS},
- {"Old Brown Metal", 11145, "carrierint_sfs", "Metalox64", METALS},
- {"Brown Rust", 12937, "sw_oldshack", "rustc256128", METALS},
- {"Orange Rust", 11395, "corvinsign_sfse", "rustb256128", METALS},
- {"Red Rust 1", 18247, "cw_junkyarddigcs_t", "Was_scrpyd_rustmetal", METALS},
- {"Red Rust 2", 10844, "genwhse_sfse", "Gen_Gantry_Rust", METALS},
- {"Rusty Sheet", 10140, "frieghter2sfe", "sw_olddrum1", METALS},
- {"Old Light Blue Metal", 4821, "union_las", "bluemetal03", METALS},
- {"Old Dark Blue Metal", 5126, "imrancomp_las2", "bluemetal02", METALS},
- {"Old Gray Metal 2", 9029, "vgetrainfnce", "Metal1_128", METALS},
- {"Rusty Gray Metal", 17001, "factorycuntw", "Gen_Metal", METALS},
- {"Corrugated Sheet", 3246, "cxref_oldwest", "corr_roof1", METALS},
- {"Corrugated Sheet 2", 3925, "weemap", "corrRoof_64HV", METALS},
- {"Old Corrugated Sheet", 5775, "sunset01_lawn", "ws_corr_metal2", METALS},
- {"Rusty Corrugated Sheet", 9680, "tramstatsfw", "ws_corr_metal1", METALS},
- {"Tin Roof Pattern", 16071, "des_quarrybelts", "des_oldtinroof", METALS},
- {"Strange Metal Pattern", 16322, "a51_stores", "a51_metal1", METALS},
- {"Rusty Metal Pattern", 16322, "a51_stores", "Gen_Freight", METALS},
- {"Rusty Metal Pattern 2", 10281, "michgar", "Metal2_256128", METALS},
- {"White and Blue Metal", 3961, "lee_kitch", "metal2", METALS},
- {"Metal Walkway Pattern", 16640, "a51", "sl_metalwalk", METALS},
- {"Perforated Metal Plate", 8954, "vgsespras", "sf_spray_floor2", METALS},
- {"Checker Plate", 9583, "bigshap_sfw", "shipfloor_sfw", METALS},
- {"Checker Plate 2", 5138, "ground_las2", "metpat64" , METALS},
- {"Checker Plate 3", 964, "cj_crate_will", "CJ_FLIGHT_CASE", METALS},
- #define POSTERS "Poster, Paintings and Murals"
- {"The Discharger", 13761, "lahills_whisky", "discharger", POSTERS},
- {"Slam It In", 4833, "airprtrunway_las", "bobo_2", POSTERS},
- {"MC Club", 5733, "melrose08_lawn", "base5_1", POSTERS},
- {"Mad Dog", 6357, "sunstrans_law2", "dogbill01", POSTERS},
- {"Love Fist Poster", 6354, "sunset03_law2", "billLA01", POSTERS},
- {"Dandell Poster", 6354, "sunset03_law2", "billLA02", POSTERS},
- {"Map of San Andreas", 16644, "a51_detailstuff", "a51_map", POSTERS},
- {"Candy Suxxx", 6357, "sunstrans_law2", "SunBillB05", POSTERS},
- {"Candy Suxxx 2", 2254, "picture_frame_clip", "CJ_PAINTING9", POSTERS},
- {"Inquisitive Man", 1583, "targets", "target1", POSTERS},
- {"Inquisitive Woman", 1583, "targets", "target2", POSTERS},
- {"Inquisitive Woman 2", 1583, "targets", "target3", POSTERS},
- {"Summer Sky", 3925, "weemap", "skyclouds", POSTERS},
- {"Jesus Saves", 17700, "gangblok1_lae2", "mural01_LA", POSTERS},
- {"Gant Bridge", 10434, "hashblock2b_sfs", "ws_mural2", POSTERS},
- {"San Fierro Skyline", 10439, "hashblock3_sfs", "ws_mural1", POSTERS},
- {"Black And White Mural", 5142, "lashops1b_las2", "mural03_LA", POSTERS},
- {"Colored Mural", 5134, "wasteland_las2", "mural05_LA", POSTERS},
- {"Gant Bridge 2", 2254, "picture_frame_clip", "CJ_PAINTING24", POSTERS},
- {"SF Pointy Building", 11631, "mp_ranchcut", "CJ_PAINTING20", POSTERS},
- {"Santa Maria Lifeguard", 2254, "picture_frame_clip", "CJ_PAINTING12", POSTERS},
- {"Seaside Painting", 11631, "mp_ranchcut", "CJ_PAINTING6", POSTERS},
- {"Bone County", 2254, "picture_frame_clip", "CJ_PAINTING26", POSTERS},
- {"Aircraft Photos", 16407, "des_airfieldhus", "plane_photos1", POSTERS},
- {"Yellow Car", 2254, "picture_frame_clip", "CJ_PAINTING2", POSTERS},
- {"Los Santos", 2254, "picture_frame_clip", "CJ_PAINTING3", POSTERS},
- {"Pier Lights", 2254, "picture_frame_clip", "CJ_PAINTING4", POSTERS},
- {"San Fierro", 2267, "picture_frame", "CJ_PAINTING14", POSTERS},
- {"Sunset Bridge", 2267, "picture_frame", "CJ_PAINTING30", POSTERS},
- {"San Fierro Bridge", 2267, "picture_frame", "CJ_PAINTING28", POSTERS},
- {"Landscape 1", 2267, "picture_frame", "CJ_PAINTING11", POSTERS},
- {"Landscape 2", 2267, "picture_frame", "CJ_PAINTING23", POSTERS},
- {"Landscape 3", 2267, "picture_frame", "CJ_PAINTING35", POSTERS},
- {"Landscape 4", 2267, "picture_frame", "CJ_PAINTING37", POSTERS},
- {"Palms", 2254, "picture_frame_clip", "CJ_PAINTING8", POSTERS},
- {"Bowling", 2254, "picture_frame_clip", "CJ_PAINTING27", POSTERS},
- {"Sailships", 2267, "picture_frame", "CJ_PAINTING34", POSTERS},
- {"Ship", 2267, "picture_frame", "CJ_PAINTING19", POSTERS},
- {"Ship 2", 2267, "picture_frame", "CJ_PAINTING36", POSTERS},
- {"Beach Sunset", 14803, "BDupsNew", "Bdup2_poster", POSTERS},
- {"Tropical 1", 11707, "cuntcuts", "GB_canvas17", POSTERS},
- {"Tropical 2", 11707, "cuntcuts", "GB_canvas18", POSTERS},
- {"Water Droplet", 14708, "labig1int2", "GB_restaursmll53", POSTERS},
- {"College Friends", 14708, "labig1int2", "GB_photo01", POSTERS},
- {"Casually Dressed Woman", 14708, "labig1int2", "GB_photo02", POSTERS},
- {"Cat 1", 2267, "picture_frame", "CJ_PAINTING1", POSTERS},
- {"Cat 2", 2267, "picture_frame", "CJ_PAINTING7", POSTERS},
- {"Flowers 1", 2267, "picture_frame", "CJ_PAINTING18", POSTERS},
- {"Flowers 2", 2267, "picture_frame", "CJ_PAINTING29", POSTERS},
- {"Leafs", 2267, "picture_frame", "CJ_PAINTING21", POSTERS},
- {"Strange Mosaic Art", 2267, "picture_frame", "CJ_PAINTING16", POSTERS},
- {"Modern Art", 2254, "picture_frame_clip", "CJ_PAINTING15", POSTERS},
- {"Modern Art 2", 14708, "labig1int2", "HS_art", POSTERS},
- {"Unknown Text", 11631, "mp_ranchcut", "CJ_PAINTING22", POSTERS},
- #define WALLPAPERS "Wallpapers"
- {"Purple Wallpaper", 17925, "lae2fake_int", "burglry_wall4", WALLPAPERS},
- {"Turquoise Wallpaper", 5706, "ci_studio5", "tw@t_wall1", WALLPAPERS},
- {"White Wall With Blue Border", 8391, "ballys01", "ballywall01_64", WALLPAPERS},
- {"Dirty White Wall", 5135, "groundb_las2", "snpedwar2", WALLPAPERS},
- {"Yellow and Orange Wall", 8639, "chinatownmall", "ctmall15_128", WALLPAPERS},
- {"Cheap Blue Paint", 5787, "melrose02_lawn", "LAbluewall", WALLPAPERS},
- {"Cheap Green Paint", 5787, "melrose02_lawn", "LAgreenwall", WALLPAPERS},
- {"Cheap Red Paint", 5787, "melrose02_lawn", "LAredwall", WALLPAPERS},
- {"White Concrete Wall", 8675, "wddngchpl02", "vgschapelwall01_64", WALLPAPERS},
- {"Pink Concrete wall", 8401, "vgshpground", "vegaspawnwall_128", WALLPAPERS},
- {"Brown Concrete wall", 16150, "ufo_bar", "brwall_128", WALLPAPERS},
- {"Grey Concrete wall", 6286, "santamonhus1", "studwalltop_law", WALLPAPERS},
- {"Light Gray Concrete Wall", 4981, "wiresetc2_las", "lasunion7", WALLPAPERS},
- {"Peeling Paint 1", 11389, "hubint1_sfse", "ws_peeling_ceiling1_BIG", WALLPAPERS},
- {"Peeling Paint 2", 17566, "contachou1_lae2", "comptwall27", WALLPAPERS},
- {"Peeling Paint 3", 17566, "contachou1_lae2", "ws_peeling2", WALLPAPERS},
- {"Peeling Paint 4", 11092, "burgalrystore_sfse", "ws_peeling_ceiling2", WALLPAPERS},
- {"Painted Concrete 1", 14783, "intgarage2aint3", "comptwall3", WALLPAPERS},
- {"Painted Concrete 2", 14700, "vgshs2int2", "ah_BADCEIL", WALLPAPERS},
- {"Painted Concrete 3", 14700, "vgshs2int2", "ah_RFPLSTR", WALLPAPERS},
- {"Painted Concrete 4", 14700, "vgshs2int2", "ah_grnplstr", WALLPAPERS},
- {"Painted Tiles", 14701, "lahss2int2", "HS1_Kwall2", WALLPAPERS},
- {"Low Wood Paneling", 14708, "labig1int2", "GB_restaursmll32", WALLPAPERS},
- {"Low Green Tile Paneling", 14709, "lamidint2", "mp_apt1_bathtiles", WALLPAPERS},
- {"Wood Paneling 1", 14709, "lamidint2", "mp_apt1_roomwall", WALLPAPERS},
- {"Wood Paneling 2", 14709, "lamidint2", "mp_apt1_woodpanel", WALLPAPERS},
- {"Wood Paneling 3", 14777, "int_casinoint3", "GB_midbar09", WALLPAPERS},
- {"Wood Paneling 4", 18029, "genintintsmallrest", "GB_restaursmll09", WALLPAPERS},
- {"Crosses w/ Wood Border", 18018, "genintintbarb", "GB_midbar07", WALLPAPERS},
- {"Fancy Paneling", 14431, "dr_gsnew", "mp_gs_wall", WALLPAPERS},
- {"Painted Concrete 5", 14388, "dr_gsnew", "mp_gs_wall1", WALLPAPERS},
- {"Dark Bordered Wallpaper", 14388, "dr_gsnew", "mp_gs_libwall", WALLPAPERS},
- {"Orange Wallaper", 14710, "vgshm3int2", "HSV_2carpet1", WALLPAPERS},
- {"Red Wallpaper", 14703, "vghsb3int2", "HS2_3Carpet1", WALLPAPERS},
- {"Bright Artex Pattern", 11704, "bdupsnew", "Bdup2_Artex", WALLPAPERS},
- {"Fancy Red Dragon Design", 3533, "triadprops_lvs", "walpaper_dragn", WALLPAPERS},
- {"Slight Purple Artex Pattern", 14710, "vgshm3int2", "HS2_Artex2", WALLPAPERS},
- {"Green Artex Pattern", 14701, "lahss2int2", "HS2_Artex6", WALLPAPERS},
- {"White Artex Pattern", 14701, "lahss2int2", "HS2_Artex3", WALLPAPERS},
- {"Green Stripes", 1675, "wshxrefhse", "washdecowall3256", WALLPAPERS},
- {"Wallpaper 1", 11704, "bdupsnew", "Bdup2_wallpaper", WALLPAPERS},
- {"Wallpaper 2", 11704, "bdupsnew", "Bdup2_wallpaperB", WALLPAPERS},
- {"Wallpaper 3", 11707, "cuntcuts", "GB_tile01", WALLPAPERS},
- {"Wallpaper 4", 14710, "vgshm3int2", "HSV_3wall3", WALLPAPERS},
- {"Wallpaper 5", 14701, "lahss2int2", "HS1_wall2", WALLPAPERS},
- {"Wallpaper 6", 14701, "lahss2int2", "HS1_wall3", WALLPAPERS},
- {"Wallpaper 7", 14701, "lahss2int2", "HS1_wall4", WALLPAPERS},
- {"Wallpaper 8", 14712, "lahss2bint2", "HS3_wall2", WALLPAPERS},
- {"Wallpaper 9", 14712, "lahss2bint2", "HS1_2Wall2", WALLPAPERS},
- {"Wallpaper 10", 14702, "masmall3int2", "HS3_wall3", WALLPAPERS},
- {"Wallpaper 11", 14702, "masmall3int2", "HS3_wall5", WALLPAPERS},
- {"Wallpaper 12", 14702, "masmall3int2", "HS3_wall6", WALLPAPERS},
- {"Wallpaper 13", 14703, "vghsb3int2", "HS2_2Wall2", WALLPAPERS},
- {"Wallpaper 14", 14703, "vghsb3int2", "HS2_3Wall1", WALLPAPERS},
- {"Wallpaper 15", 14703, "vghsb3int2", "HS4_Wall7", WALLPAPERS},
- {"Wallpaper 16", 14709, "lamidint2", "mp_apt1_kitchwallpaper", WALLPAPERS},
- {"Wallpaper 17", 14707, "labig3int2", "WH_walls", WALLPAPERS},
- {"Wallpaper 18", 14711, "vgshm2int2", "HS2_4wall1", WALLPAPERS},
- {"Wallpaper 19", 15034, "genhotelsave", "HS2_2Wall4", WALLPAPERS},
- {"Wallpaper 20", 14590, "mafcastopfoor", "donut_wall1", WALLPAPERS},
- {"Wallpaper 21", 5727, "sunrise04_lawn", "fredwall2_LAwN", WALLPAPERS},
- {"Wallpaper 22", 14702, "masmall3int2", "HS3_wall4", WALLPAPERS},
- #define MISC "Miscellaneous"
- {"Fading Yellow", 9494, "chinatownsfe", "chtown4_sf", MISC},
- {"Fading Blue", 9494, "chinatownsfe", "chtown6_sf", MISC},
- {"Fading Green", 9494, "chinatownsfe", "chtown8_sf", MISC},
- {"Hay", 12911, "sw_farm1", "forestfloorbranch256", MISC},
- {"Hay and Wood", 12911, "sw_farm1", "sw_barnfloor1", MISC},
- {"Garage Door", 5138, "ground_las2", "alleydoor8", MISC},
- {"Flamingos", 8488, "flamingo1", "flmngo01_256", MISC},
- {"Wood Framed Windows", 14771, "int_brothelint3", "GB_nastybar13", MISC},
- {"White Framed Windows", 14710, "vgshm3int2", "kit_windo_12", MISC},
- {"Creepy Old Window", 14700, "vgshs2int2", "ah_FLKWIN", MISC},
- {"Fancy Window", 14710, "vgshm3int2", "windo_blinds", MISC},
- {"Blue Material", 14770, "genintgenintint3", "GB_midbar04", MISC},
- {"Blue Material 2", 14771, "int_brothelint3", "GB_midbar10", MISC},
- {"Black Material", 15046, "svcunthoose", "csGarageTrolley01psd", MISC},
- {"Bordered Black Material", 15046, "svcunthoose", "csheistbox01", MISC},
- {"Red Cushions", 14838, "lee_stripclub", "Strip_bar_wall1", MISC},
- {"Funky 1", 14808, "lee_strip2", "strip_neon_Curtain", MISC},
- {"Funky 2", 14808, "lee_strip2", "strip_neon_flat", MISC},
- {"Glass Wall 1", 16639, "a51_labs", "ws_trainstationwin1", MISC},
- {"Glass Wall 2", 10973, "mall_sfse", "ws_trainstationwin2", MISC},
- {"Glass 1", 1649, "wglass", "carshowwin2", MISC},
- {"Glass 2", 5722, "sunrise01_lawn", "plainglass", MISC},
- {"Water", 3947, "rczero_track", "waterclear256", MISC},
- {"Snow", 3914, "snow", "mp_snow", MISC},
- {"Blank", 1337, "none", "none", MISC},
- {"Classic Window", 15048, "labigsave", "AH_windows", "Test Misc"},
- {"Wood Framed Simple Window", 14661, "int_tatoo", "mp_shop_window", "Test Misc"},
- {"Metal Framed Window", 14495, "sweetshall", "mcstraps_window", "Test Misc"},
- {"Metal Framed Black Windows", 14736, "whorerooms", "AH_cheapwindow", "Test Misc"},
- {"Door 'Males Only'", 18008, "intclothesa", "CJ_VICT_DOOR", "Test Misc"},
- {"Door 'Females Only'", 18008, "intclothesa", "CJ_VICT_DOOR2", "Test Misc"},
- {"Gold", 14707, "labig3int2", "gold128", "Test Misc"},
- {"Gold 2", 14607, "triad_main", "buddha_gold", "Test Misc"},
- {"Booger Green ", 19527, "Cauldron1", "AlienLiquid1", "Test Misc"},
- {"Fading Dark Blue", 14639, "traidman", "ab_aquarium", "Test Misc"},
- {"Glass 3", 14755, "sfhss2", "CJ_FRAME_Glass", "Test Misc"},
- {"Glass 4", 1978, "kbroul1", "shelf_glas", "Test Misc"},
- {"Dirty Glass", 914, "industrialext", "CJ_GEN_GLASS2", "Test Misc"},
- {"Dirty Glass 2", 10713, "gayclub_sfs", "CJ_GEN_GLASS2", "Test Misc"},
- {"Black Rubber", 18018, "genintintbarb", "CJ_BLACK_RUB2", "Test Misc"},
- {"White Formica", 1770, "cj_tables", "FORMICA1", "Test Misc"},
- {"Water 2", 18742, "MatTextures", "waterclear256", "Test Misc"},
- {"Water 3", 19841, "vegaswaterfall", "newaterfal1_256", "Test Misc"},
- {"Unnamed Mesh", 3280, "country_breakable", "ws_castironwalk", "Test Misc"},
- {"Camouflage Net", 2068, "cj_ammo_net", "CJ_cammonet", "Test Misc"},
- {"Fading Yellow Glass" , 19197,"EnExMarkers", "enex", "Test Misc"},
- {"Basket Pattern 1", 8534, "tikimotel", "sa_wood01_128", "Test Misc"},
- {"Basket Pattern 2", 8534, "tikimotel", "sa_wood03_128", "Test Misc"},
- {"Basket Pattern 3", 8534, "tikimotel", "sa_wood04_128", "Test Misc"},
- {"Transperancy", 18888, "ForceFields", "white", "Test Misc"},
- {"Unnamed Ceiling 1", 11312, "carshow_sfse", "ws_officy_ceiling", "Test Questionable"},
- {"Unnamed Ceiling 2", 18007, "int_cutbar3", "ceilingtile1_128", "Test Questionable"},
- {"Unnamed Ceiling 3", 18026, "scummy", "ceiling_256", "Test Questionable"},
- {"Unnamed Ceiling 4", 18038, "vegas_munation", "gun_ceiling1", "Test Questionable"},
- {"Unnamed Ceiling 5", 18038, "vegas_munation", "gun_ceiling2", "Test Questionable"},
- {"Unnamed Ceiling 6", 18038, "vegas_munation", "gun_ceiling3", "Test Questionable"},
- {"Unnamed Ceiling 7", 14534, "ab_wooziea", "dt_office_roof", "Test Questionable"},
- {"Unnamed Ceiling 8", 14526, "sweetsmain", "ah_whitpanelceil", "Test Questionable"},
- {"Unnamed Ceiling 9", 15042, "svsfsm", "AH_walltile2", "Test Questionable"},
- {"Unnamed Ceiling 10", 18045, "gen_munation", "mp_diner_ceilingdirt", "Test Questionable"},
- {"Dark Wood Border", 14431, "dr_gsnew", "mp_gs_border", "Test Questionable"},
- {"Light Wood Border", 14431, "dr_gsnew", "mp_gs_border1", "Test Questionable"},
- {"Old Wood Panel", 14700, "vgshs2int2", "AH_oldwdpan", "Test Questionable"},
- {"Wood Panel", 14431, "dr_gsnew", "mp_gs_woodpanel", "Test Questionable"},
- {"Wood Panel 2", 14750, "sfhsm2", "ah_pnwainscot3", "Test Questionable"},
- {"Wood Panel 3", 15048, "labigsave", "AH_barpanelM", "Test Questionable"},
- {"Wood Panel 4", 14748, "sfhsm1", "ah_pnwainscot", "Test Questionable"},
- {"Wood Panel 5", 14735, "newcrak", "AH_wdpanscum", "Test Questionable"},
- {"Wood Panel 6", 14853, "gen_pol_vegas", "mp_cop_panel", "Test Questionable"},
- {"Wood Panel 7", 14789, "ab_sfgymmain", "ab_panelWall1", "Test Questionable"},
- {"Wood Panel 8", 14789, "ab_sfgymmain", "ab_panelWall2", "Test Questionable"},
- {"Perforated Wood", 18026, "scummy", "CJ_BACK_BOARD", "Test Questionable"},
- {"Funky 3", 14832, "lee_stripclub", "mirror_ref1", "Test Questionable"},
- {"Unnamed something 2", 1389, "cranes_dyn2", "ws_sheetsteel", "Test Questionable"},
- {"Unnamed something 3", 1824, "gamingtble", "crapside_128", "Test Questionable"},
- {"Unnamed Something 4", 2788, "pizza_furn", "CJ_CORD", "Test Questionable"},
- {"Black Leather", 1753, "cj_sofa", "CJ-COUCHL2", "Test Questionable"},
- {"Brown Leather", 1753, "cj_sofa", "CJ-COUCHL1", "Test Questionable"},
- {"Red Leather", 1770, "cj_tables", "CJ_RED_LEATHER", "Test Questionable"},
- {"Pink 'Leather'", 2487, "rc_shop_hanger", "CJ_kite2", "Test Questionable"},
- {"Blue 'Leather'", 2487, "rc_shop_hanger", "CJ_kite3", "Test Questionable"},
- {"Unnamed Concrete Wall 1", 17925, "lae2fake_int", "ab_wall3", "Test Questionable"},
- {"Unnamed Concrete Wall 2", 18060, "mp_diner2", "mp_diner_wall", "Test Questionable"},
- {"Unnamed Material", 13594, "kickstart", "ah_bluBADWL", "Test Questionable"},
- {"Red Square", 1898, "kb_wheel1", "wheel_o_2", "Test Questionable"},
- {"Green Square", 1898, "kb_wheel1", "wheel_o_2f", "Test Questionable"},
- {"Light Green Square", 1898, "kb_wheel1", "wheel_o_2b", "Test Questionable"},
- {"Blue Square", 1898, "kb_wheel1", "wheel_o_2c", "Test Questionable"},
- {"Light Blue Square", 1898, "kb_wheel1", "wheel_o_2d", "Test Questionable"},
- {"Yellow Square", 1898, "kb_wheel1", "wheel_o_2e", "Test Questionable"},
- {"Unnamed Asian Wall", 14620, "triad_bar", "triad_decor1", "Test Questionable"},
- {"Unnamed Red Something", 6989, "vgnfremnt1", "casinolights4_128", "Test Questionable"},
- {"Unnamed Blue Something", 6989, "vgnfremnt1", "casinolightsblu_128", "Test Questionable"},
- {"Unnamed Yellow Something", 6989, "vgnfremnt1", "casinolightsyel_128", "Test Questionable"},
- {"Funky Red Tiles", 6989, "vgnfremnt1", "casinolights9_256", "Test Questionable"},
- {"Unnamed PC Screen 1", 9822, "ship_brijsfw", "ship_screen1sfw", "Test Questionable"},
- {"Unnamed PC Screen 2", 9822, "ship_brijsfw", "ship_greenscreen1", "Test Questionable"},
- {"TV Screen", 1781, "cj_tv", "CJ_TV_SCREEN", "Test Questionable"},
- {"TV Noise", 14640, "chinese_furn", "ab_tv_noise", "Test Questionable"},
- {"Empty Golden Frame", 6989, "vgnfremnt1", "goldframe_256", "Test Questionable"},
- {"Blood", 19836, "particle", "bloodpool_64", "Test Questionable"},
- {"Blood 2", 18067, "intclothes_acc", "mp_cloth_vicrug", "Test Questionable"},
- {"Unnamed Creepy Concrete", 14888, "gf6", "mp_gimp_basewall", "Test Questionable"},
- {"Seeing Eye", 14839, "lee_strippriv", "Strip_Sign12", "Test Questionable"},
- {"Unnamed Glass 1", 2176, "casino_props", "flameOptic", "Test Questionable"},
- {"Unnamed Glass 2", 2176, "casino_props", "tubelite", "Test Questionable"}
- };
- enum WeaponDamageInfo
- {
- WeaponID,
- Float:WepDamage,
- };
- new WeaponDamage[][WeaponDamageInfo] =
- {
- // WeaponID WeaponDamage
- {0, 7.0}, //Unarmed
- {1, 18.0}, //Brass Knuckles
- {2, 18.0}, //Golf Club
- {3, 18.0}, //Nite Stick
- {4, 30.0}, //Knife
- {5, 18.0}, //Baseball Bat
- {6, 18.0}, //Shovel
- {7, 18.0}, //Pool Cue
- {8, 30.0}, //Katana
- {9, 0.0}, //Chainsaw
- {10, 1.0}, //Purple Dildo
- {12, 1.0}, //Vibrato branco grander
- {11, 1.0}, //Small White Vibrator
- {13, 1.0}, //Vibrador de prata
- {14, 0.0}, //Flowers
- {15, 5.0}, //Cane
- {16, 0.0}, //Grenade
- {17, 0.0}, //Tear Gas
- {18, 10.0}, //Molotov Coctail
- {19, 0.0}, //Arma inválida
- {20, 0.0}, //Arma inválida
- {11, 0.0}, //Arma inválida
- {22, 40.0}, //Colt 9mm
- {23, 40.0}, //Silenced Colt 9mm
- {24, 60.0}, //Desert Eagle
- {25, 85.0}, //Shotgun
- {26, 65.0}, //Sawn-off Shotgun
- {27, 35.0}, //Combat Shotgun
- {28, 40.0}, //Micro SMG
- {29, 45.0}, //MP5
- {30, 65.0}, //AK-47
- {31, 60.0}, //M4
- {32, 40.0}, //Tec9
- {33, 80.0}, //Country Rifle
- {34, 100.0}, //Sniper Rifle
- {35, 0.0}, //Rocket Launcher
- {36, 0.0}, //HS Rocket Launcher
- {37, 0.0}, //Flamethrower
- {38, 0.0}, //Minigun
- {39, 0.0}, //Satchel Charge
- {40, 2.0}, //Satchel Detonator
- {41, 0.0}, //Spraycan
- {42, 0.0}, //Fire Extinguisher
- {43, 0.0}, //Camera
- {44, 0.0}, //Nightvision Goggles
- {45, 0.0}, //Thermal Goggles
- {46, 0.0}, //Thermal Goggles
- {47, 0.0}, //Fake Pistol
- {48, 0.0}, //Arma inválida
- {49, 15.0}, //Vehicle
- {50, 0.0}, //Heli-Blades
- {51, 100.0}, //Explosion
- {52, 0.0}, //Arma inválida
- {53, 5.0}, //Drowned
- {54, 0.0} //Splat
- };
- enum ACHIEVEMENT_DATA
- {
- Info[150],
- Name[30],
- PointValue
- }
- enum BIZZ_DATA
- {
- BizzSQLID,
- BizzPrice,
- Payout,
- BizzType,
- EnterFee,
- BizzEarnings,
- BizzStock,
- BizzRequestStock,
- BizzETDelivering,
- BizzOccupants,
- bool:BizzLocked,
- BizzOwnerSQLID,
- BizzDescription[50],
- Float:oPosX,
- Float:oPosY,
- Float:oPosZ,
- IsSpecial,
- InteriorID,
- Float:iPosX,
- Float:iPosY,
- Float:iPosZ,
- BizzPickup,
- Text3D:Bizz3DText,
- BMusic[200],
- BMusicPlaying,
- BizzVW,
- ExitVW,
- Text3D:BizzLabel,
- BizzActor[4],
- BizzActorSpawned[4],
- BizzActorSkin[4],
- Float:BizzActorX[4],
- Float:BizzActorY[4],
- Float:BizzActorZ[4],
- Float:BizzActorAngle[4],
- BizzActorAnim[4],
- bool:BizzLights
- };
- enum HOUSE_DATA
- {
- HouseSQLID,
- HousePrice,
- HouseOwnerSQLID,
- HouseLocked,
- HouseDescription[60],
- HousePhoneNumber,
- HouseOccupants,
- Float:oPosX,
- Float:oPosY,
- Float:oPosZ,
- Float:intPosX,
- Float:intPosY,
- Float:intPosZ,
- HouseInterior,
- InsideID,
- HousePickup,
- HouseExtVW,
- DoorNoteMessage[128],
- StoredCash,
- StoredWeed,
- StoredCocaine,
- StoredMoonShine,
- StoredPhone,
- HMusic[200],
- HMusicPlaying,
- HouseVW,
- Text3D:HouseLabel,
- bool:HouseLights,
- Float:ExtStreamDist,
- FurnSQLID[MAX_HFURNITURE],
- FurnModel[MAX_HFURNITURE],
- FurnPlaced[MAX_HFURNITURE],
- FurnObject[MAX_HFURNITURE],
- bool:DoorOpen[MAX_HFURNITURE],
- bool:DoorLocked[MAX_HFURNITURE],
- Float:ZAdjust[MAX_HFURNITURE],
- DrugTimer[MAX_HFURNITURE]
- };
- enum WEED_DATA
- {
- PlantGrowth,
- PlantWater,
- PlantSQLID,
- PlantPotObj,
- PlantFurnIndex,
- };
- enum GARAGE_DATA
- {
- gID,
- gHouseID,
- gType,
- Float:iPosX,
- Float:iPosY,
- Float:iPosZ,
- Float:oPosX,
- Float:oPosY,
- Float:oPosZ,
- Float:iAngle,
- Float:oAngle,
- Float:oVehicleAngle,
- Float:iVehicleAngle,
- iInteriorID,
- oInteriorID,
- iVirtualWorld,
- oVirtualWorld,
- InsideInt,
- GaragePickup,
- GarageLocked,
- bool:UseHouse
- };
- enum VEHICLE_DATA
- {
- VehSQLID,
- IdVehicle,
- VehicleModel,
- VehicleOwnerSQLID,
- Float:LastX,
- Float:LastY,
- Float:LastZ,
- Float:LastRot,
- vColor1,
- vColor2,
- Float:FuelRemaining,
- Float:Mileage,
- Float:LastOilMileage,
- bool:Impounded,
- ImpoundedBy,
- ImpoundTime,
- ImpoundFee,
- ImpoundReason[32],
- TicketAmount,
- VehiclePrice,
- VirtualWorld,
- VehicleInterior,
- bool:DonatorCar,
- RegPlate[MAX_REG_PLATE],
- TrunkCash,
- TrunkWeed,
- TrunkCocaine,
- TrunkMoonShine,
- TrunkPhone,
- bool:ForSale,
- ForSalePrice,
- Text3D:ForSaleLabel,
- bool:NeedsRecovery,
- GarageRepairID,
- GarageCollectTime,
- VehicleMod[14],
- Hotwired,
- HotwireTime,
- bool:PlateToggle,
- VehiclePaintjob
- }
- enum e_FacDoor
- {
- fdID,
- Float:fdPosA[4],
- Float:fdPosF[4],
- fdModel,
- fdStatus
- }
- enum FACTION_DATA
- {
- FactionId,
- FactionName[35],
- FNameShort[20],
- Float:FactionSpawn1[4],
- Float:FactionSpawn2[4],
- Float:FactionSpawn3[4],
- Float:FactionSpawn4[4],
- Float:FactionSpawn5[4],
- FactionSpawnVW[5],
- FactionSpawnInt[5],
- FactionSpawn1Name[40],
- FactionSpawn2Name[40],
- FactionSpawn3Name[40],
- FactionSpawn4Name[40],
- FactionSpawn5Name[40],
- FactionIsGang,
- FactionIsActive,
- FactionBankBalance,
- FactionRadioChannel,
- FactionRankPay[15],
- FactionLeaderRank,
- FactionLeader,
- FactionUberLeaderRank,
- FactionPayDayTax,
- FactionSkins[15],
- FactionWeaponTime,
- FactionOrderingWeapons,
- FactionChatToggleOff,
- FactionDoors[MAX_FACTION_DOORS],
- FMOTD[128]
- };
- enum FACTION_CARS
- {
- FVSQLID,
- FactionVehID,
- FVModel,
- FVCol2,
- FVCol1,
- FVFaction,
- FVMinRank,
- bool:FVLocked,
- Float:LocationX,
- Float:LocationY,
- Float:LocationZ,
- Float:LocationR,
- FVInterior,
- TempFVInterior,
- FVWorld,
- FTrunkCash,
- FTrunkWeed,
- FTrunkCocaine,
- FTrunkMoonShine,
- FTrunkPhone,
- LastDriver,
- LastDriverTime,
- FVMod[14],
- FVRegPlate[MAX_REG_PLATE],
- FVGovUnit[12],
- Text3D:FVGovUnit3DText,
- FImpoundTime,
- FImpoundedBy,
- bool:FImpounded,
- FImpoundFee,
- FImpoundReason[32],
- FVGovUnitTog
- }
- enum PLAYER_CARS
- {
- CarSQLID,
- CarModel,
- CarCol1,
- CarCol2,
- bool:CarSpawned,
- Float:CarPosX,
- Float:CarPosY,
- Float:CarPosZ
- }
- /*
- enum object
- {
- SQLID,
- ObjectID,
- Name[32],
- Model,
- Float:PosX,
- Float:PosY,
- Float:PosZ,
- Float:AngX,
- Float:AngY,
- Float:AngZ,
- World,
- Interior,
- Movable,
- Float:NewX,
- Float:NewY,
- Float:NewZ,
- Float:aNewX,
- Float:aNewY,
- Float:aNewZ,
- Faction
- };
- */
- enum IMPOUND_DATA
- {
- iModel,
- iSQLID,
- iRegPlate[MAX_REG_PLATE],
- iImpoundTime,
- iImpoundFee,
- iImpoundedBy,
- iVehType,
- iFaction,
- iOwnerSQLID,
- iImpoundReason[64],
- iColor1,
- iColor2
- }
- enum REPAIR_DATA
- {
- rModel,
- rSQLID,
- rRegPlate[MAX_REG_PLATE],
- rOwnerSQLID,
- rFaction,
- rTime,
- rGarage,
- rColor1,
- rColor2,
- OwnerNotified,
- }
- enum INVENTORY_DATA
- {
- Phonebook,
- Dice,
- FishingRod,
- FishingPermit,
- FishingBait,
- Radio,
- FuelCan[2],
- Mask,
- Watch,
- Fags,
- Lighter,
- GPS,
- Weed,
- MoonShine,
- Cocaine,
- AmmoBox[6],
- Rope,
- MobilePhone,
- Notepad,
- Paper,
- Pen,
- CarAdapter,
- Checks,
- RollingPaper,
- Bong,
- Calculator,
- MedKit,
- Toolbox,
- EngineOil,
- WeedSeed,
- Water,
- Boombox,
- Blindfold,
- Logs,
- };
- new EventOpen = 0;
- enum EVENT_DATA
- {
- Float:EventX,
- Float:EventY,
- Float:EventZ,
- EventInterior,
- EventVW,
- EventName[50]
- }
- enum WEAPONHIT_DATA
- {
- pWeaponID,
- pBodypart,
- };
- enum CONTRACT_DATA
- {
- HitSQLID,
- Status,
- AssignedTo,
- Hit,
- Money,
- RequestedBy
- };
- enum TEMP_INGRED
- {
- ingID[10],
- ingType[10],
- ingAmount[10],
- ingModel[10],
- };
- enum MOTEL_DATA
- {
- MotelID,
- Float:RoomX,
- Float:RoomY,
- Float:RoomZ,
- RoomLocked,
- RoomOwner,
- RoomDaysLeft,
- RoomPickupID
- };
- enum TEMP_BAN_DATA
- {
- TempBanActive,
- TempBanTime,
- TempBanReason[128],
- TempBanIP[18],
- TempBanSQLID,
- BanningAdmin
- };
- enum GAS_STATION_DATA
- {
- StationID,
- PetrolAmount,
- DieselAmount,
- PetrolAmountMax,
- DieselAmountMax,
- StationDescription[30],
- Float:SignX,
- Float:SignY,
- Float:SignZ,
- Text3D:SignLabel
- };
- enum ATTACHED_MASK_DATA
- {
- ao_model,
- Float:ao_x,
- Float:ao_y,
- Float:ao_z,
- Float:ao_rx,
- Float:ao_ry,
- Float:ao_rz,
- Float:ao_sx,
- Float:ao_sy,
- Float:ao_sz
- };
- enum FLAME_DATA
- {
- FID,
- Spawned,
- Float:F_Pos[3],
- FlameInterior[2],
- AfterSmoke[5],
- Smoke[2],
- bool:CanSpread,
- SpreadTimer,
- Size
- };
- enum WEAPON_DROP_DATA
- {
- Type,
- DropModel,
- DropAmmo,
- DropWeaponID,
- Float:wX,
- Float:wY,
- Float:wZ,
- DropvWorld,
- DropInt,
- gSpawned,
- PhoneID,
- DropPhonePower,
- DropPhoneNumber
- };
- enum TEMP_DATA
- {
- tSkin,
- tInt,
- tVW,
- tVehID,
- tSeatID,
- Float:tmX,
- Float:tmY,
- Float:tmZ
- };
- enum FLY_SPEC_DATA
- {
- Float:CamPos[3],
- cObject,
- mdir,
- updownold,
- leftrightold,
- FlySpec,
- lastmove,
- fsobj,
- fspeed
- };
- enum BOOM_DATA
- {
- BoomObj,
- Float:BoomPos[4],
- BoomOID,
- BoomType,
- BoomRange,
- BoomStation[256],
- bool:BoomIsPlaying,
- BoomArea
- };
- enum HITMEN_DATA
- {
- hmActive,
- hmOldName[MAX_PLAYER_NAME],
- hmNewName[MAX_PLAYER_NAME]
- };
- enum DRUG_TAKEN
- {
- effSQLID,
- effActive,
- effActivated,
- effDrugType,
- effTakenBy,
- Float:effType[6],
- Float:effAmount[6],
- Float:cmdAmount[6],
- Float:cmdType[6],
- Float:ovrAmount[6],
- Float:ovrType[6],
- cmdStart,
- effTimeTo,
- effDuration,
- ovrMax,
- ovrDuration,
- drugVW,
- drugInt,
- Float:drugPos[3],
- Float:drugRot[3],
- drugEffects[84],
- drugComedown[84],
- drugOverdose[84],
- drugsQuality,
- drugObj
- };
- enum INGRED_DATA
- {
- ingredSQLID,
- ingredName[64],
- ingredType,
- ingredAmount,
- Float:ingredPos[3],
- ingredObj,
- ingredVW,
- ingredInt,
- ingredModel
- };
- enum apb_Data
- {
- apbString[128],
- apbBy[MAX_PLAYER_NAME],
- apbRank[32],
- apbSQLID,
- apbTime,
- apbListItem,
- };
- //weapon system enums
- enum WeaponLocationInfo
- {
- LocationName[128],
- Float:LocPosX,
- Float:LocPosY,
- Float:LocPosZ
- };
- enum WEAPON_DATA
- {
- WeaponID,
- WeaponPossession,
- wCreatorSQLID,
- wOwnerSQLID,
- WeaponType,
- Weapon,
- WeaponAmmo,
- WeaponOrigin,
- WeaponTimestamp
- };
- new WeaponData[MAX_PLAYERS][12][WEAPON_DATA];
- //end of weapon system enums
- //enums for bizz actor system
- enum ACTOR_ANIMS
- {
- AnimName[64],
- AnimLibrary[64],
- AnimationName[64],
- Float:AnimDelta,
- AnimLoop,
- AnimLockX,
- AnimLockY,
- AnimFreeze,
- AnimTime
- };
- new AnimData[MAX_ACTORANIMS][ACTOR_ANIMS] =
- {
- {"/handsup", "ROB_BANK","SHP_HandsUp_Scr", 4.0, 0, 1, 1, 1, 0},
- {"/crossarms", "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1},
- {"/lay", "BEACH", "bather", 4.0, 1, 0, 0, 0, 0},
- {"/hide", "ped", "cower", 3.0, 1, 0, 0, 0, 0},
- {"/wave", "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0},
- {"/crack", "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0},
- {"/wounded", "CRACK", "crckidle1", 4.0, 1, 0, 0, 0, 0},
- {"/sleep", "CRACK", "crckidle2", 4.0, 1, 0, 0, 0, 0},
- {"/smoke 1", "SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0},
- {"/smoke 2", "SMOKING", "F_smklean_loop", 4.0, 1, 0, 0, 0, 0},
- {"/smoke 3", "SMOKING","M_smkstnd_loop", 4.0, 1, 0, 0, 0, 0},
- {"/smoke 4", "SMOKING","M_smk_out", 4.0, 1, 0, 0, 0, 0},
- {"/gro (/groundsit)", "BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0},
- {"/chat", "PED","IDLE_CHAT",4.0,1,0,0,1,1},
- {"/sit", "PED","SEAT_down",4.1,0,0,0,1,0},
- {"/fsit", "SUNBATHE","SBATHE_F_LieB2Sit",4.1,0,0,0,1,0},
- {"/fall", "PED","KO_skid_front",4.1,0,1,1,1,0},
- {"/fall2", "PED", "BIKE_fall_off",4.1,0,1,1,1,0},
- {"/fallback", "PED","FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0},
- {"/injured", "SWEET", "Sweet_injuredloop", 4.0, 1, 0, 0, 0, 0},
- {"/exhaust", "FAT","IDLE_tired",3.0,1,0,0,0,0},
- {"/lay2", "SUNBATHE","Lay_Bac_in",3.0,0,1,1,1,0},
- {"/chant", "RIOT","RIOT_CHANT",4.0,1,1,1,1,0},
- {"/dealstance", "DEALER","DEALER_IDLE",4.0,1,0,0,0,0},
- {"/lean 1", "GANGS","leanIDLE",4.0,0,1,1,1,0},
- {"/lean 2", "MISC","Plyrlean_loop",4.0,0,1,1,1,0},
- {"/lean 3", "RYDER","Van_Lean_R",4.0,0,1,1,1,0},
- {"/strip 1", "STRIP", "strip_A", 4.1, 1, 1, 1, 1, 1},
- {"/strip 2", "STRIP", "strip_B", 4.1, 1, 1, 1, 1, 1},
- {"/strip 3", "STRIP", "strip_C", 4.1, 1, 1, 1, 1, 1},
- {"/strip 4", "STRIP", "strip_D", 4.1, 1, 1, 1, 1, 1},
- {"/strip 5", "STRIP", "strip_E", 4.1, 1, 1, 1, 1, 1},
- {"/strip 6", "STRIP", "strip_F", 4.1, 1, 1, 1, 1, 1},
- {"/strip 7", "STRIP", "strip_G", 4.1, 1, 1, 1, 1, 1},
- {"/dance 1", "DANCING", "DAN_Loop_A", 4.1, 1, 1, 1, 1, 1},
- {"/dance 2", "DANCING", "dnce_M_a", 4.1, 1, 1, 1, 1, 1},
- {"/dance 3", "DANCING", "dnce_M_b", 4.1, 1, 1, 1, 1, 1},
- {"/dance 4", "DANCING", "dnce_M_c", 4.1, 1, 1, 1, 1, 1},
- {"/dance 5", "DANCING", "dnce_M_d", 4.1, 1, 1, 1, 1, 1},
- {"/dance 6", "DANCING", "dnce_M_e", 4.1, 1, 1, 1, 1, 1},
- {"/dance 7", "DANCING", "bd_clap1", 4.1, 1, 1, 1, 1, 1},
- {"/relax", "BAR", "BARman_idle", 4.0, 1, 0, 0, 0, 0},
- {"/angry", "RIOT", "RIOT_ANGRY", 4.0, 1, 0, 0, 0, 0},
- {"/cheer", "RIOT", "RIOT_ANGRY_B", 4.0, 1, 0, 0, 0, 0}
- };
- //end of enum for bizz actor system
- enum Temp_Objects
- {
- ObjectID,
- ObjectModel,
- ObjectVW,
- Float:ObjectPosX,
- Float:ObjectPosZ,
- Float:ObjectPosY,
- Float:ObjectPosRX,
- Float:ObjectPosRY,
- Float:ObjectPosRZ,
- ObjectPurpose[64],
- SpawnedBy,
- };
- enum REPORT_DATA
- {
- ReporterName[MAX_PLAYER_NAME + 1],
- ReportedName[MAX_PLAYER_NAME + 1],
- ReportReason[150],
- ReportTime
- };
- enum aoData
- {
- aoToyID,
- aoModelID,
- Float:aoOffset[3],
- Float:aoRot[3],
- Float:aoScale[3],
- aoBone,
- aoIndex,
- aoColor,
- aoRemoved,
- };
- enum toyData
- {
- tID,
- tModelID,
- Float:tOffset[3],
- Float:tRot[3],
- Float:tScale[3],
- tOptional,
- tBone,
- tMask,
- FactionMask,
- bool:MaskWorn,
- tColor,
- bool:tSpawn,
- };
- enum INTERIOR_DATA
- {
- interiorID,
- Float:iPosX,
- Float:iPosY,
- Float:iPosZ,
- Float:oPosX,
- Float:oPosY,
- Float:oPosZ,
- Float:iAngle,
- Float:oAngle,
- iInteriorID,
- oInteriorID,
- iVirtualWorld,
- oVirtualWorld,
- InteriorName[50],
- IntFactionRank,
- IntFaction,
- InteriorNavTo
- };
- enum PICKUP_DATA
- {
- PickupSQLID,
- IGPickupID,
- Float:Xpos,
- Float:Ypos,
- Float:Zpos,
- PickupModel,
- WorldID,
- PickupText[150],
- PickupType
- }
- enum RENTDATA
- {
- CarSQLID,
- CarID,
- CarModel,
- rColor1,
- rColor2,
- Float:CarMileage,
- Float:rPosX,
- Float:rPosY,
- Float:rPosZ,
- Float:rRot,
- RentalPrice,
- RentalPlate[12],
- };
- enum MAT_COLORS
- {
- ColorHex,
- ColorName[32]
- };
- enum LABEL_DATA
- {
- bool:LabelUsed,
- LabelOwner,
- Text3D:LabelID,
- Float:LabelX,
- Float:LabelY,
- Float:LabelZ
- };
- enum EFURN_DATA
- {
- EFurnSQLID[MAX_EHFURNITURE],
- EFurnModel[MAX_EHFURNITURE],
- bool:EFurnPlaced[MAX_EHFURNITURE],
- EFurnObject[MAX_EHFURNITURE]
- };
- enum FISHING_CRATES
- {
- CrateID,
- FishingCrateObject,
- CrateOwner,
- CrateType,
- CrateVehicle,
- Float:CrateLocX,
- Float:CrateLocY,
- Float:CrateLocZ,
- };
- enum DRUG_INGRED
- {
- ingName[64],
- ingUsedBase,
- Float:ingType[5],
- Float:ingEffects[20],
- };
- enum BASE_INGRED
- {
- baseName[64],
- Float:baseEffect1[20],
- Float:baseEffect2[20],
- Float:baseEffect3[20],
- Float:baseEffect4[20],
- Float:baseComedown[17],
- Float:baseOverdose[17],
- };
- enum TRIP_INFO
- {
- Float:tPos[3],
- tVW,
- tInterior,
- };
- enum RB_DATA
- {
- RBModel,
- Float:RBDist,
- Float:RBZDiff
- };
- new AchievementData[MAX_ACHS][ACHIEVEMENT_DATA];
- new apbData[MAX_APB][apb_Data];
- new AttachedObjects[MAX_PLAYERS][10][aoData];
- new BizzData[MAX_BIZZ][BIZZ_DATA];
- new Boomboxes[MAX_PLAYERS][BOOM_DATA];
- new CorpseInjuries[1][MAX_WEAPON_HITS][WEAPONHIT_DATA];
- new DrugTakenData[MAX_DRUGS][DRUG_TAKEN];
- new EFurnData[MAX_HOUSES][EFURN_DATA];
- new EventData[EVENT_DATA];
- new FACTIONS[MAX_FACTIONS][FACTION_DATA];
- new FacDoor[MAX_FACTIONS*MAX_FACTION_DOORS][e_FacDoor];
- new FishingCrates[MAX_FISHCRATES][FISHING_CRATES];
- new Flame[MAX_FIRES][FLAME_DATA];
- new FuelStations[MAX_FUEL_STATIONS][GAS_STATION_DATA];
- new FurniData[MAX_FURNITURE][FURNI_DATA];
- new FurniDrugInfo[MAX_HOUSES][MAX_HFURNITURE][20];
- new FurnitureIndex[MAX_HOUSES][MAX_HFURNITURE][MAX_TEXTURESLOTS];
- new FVehicleData[MAX_VEHICLES+1][FACTION_CARS];
- new GarageData[MAX_GARAGES][GARAGE_DATA];
- new hmData[MAX_PLAYERS][HITMEN_DATA];
- new HouseData[MAX_HOUSES][HOUSE_DATA];
- new ImpoundData[MAX_VEHICLES+1][IMPOUND_DATA];
- new IngredientsData[MAX_INGREDIENTS][INGRED_DATA];
- new Injuries[MAX_PLAYERS][MAX_WEAPON_HITS][WEAPONHIT_DATA];
- new Interiors[MAX_INTERIORS][INTERIOR_DATA];
- new Inventory[MAX_PLAYERS][INVENTORY_DATA];
- new MotelData[MAX_MOTELROOMS][MOTEL_DATA];
- new PfSpec[MAX_PLAYERS][FLY_SPEC_DATA];
- new PhoneContacts[MAX_PLAYERS][MAX_PHONECONTACTS][CONTACTS_DATA];
- new PhoneData[MAX_PLAYERS][PHONE_DATA];
- new PickupData[MAX_SQLPICKUPS][PICKUP_DATA];
- new PlayerCars[MAX_PLAYERS][MAX_VEH_PER_PLAYER][PLAYER_CARS];
- new RentalData[MAX_VEHICLES+1][RENTDATA];
- new RepairData[MAX_VEHICLES+1][REPAIR_DATA];
- new Reports[MAX_REPORTS][REPORT_DATA];
- new RPLabels[MAX_LABELS][LABEL_DATA];
- new TempBans[MAX_TEMPBANS][TEMP_BAN_DATA];
- new TempInfo[MAX_PLAYERS][TEMP_DATA];
- new TempIngData[MAX_PLAYERS][TEMP_INGRED];
- new TempObjects[MAX_TEMPOBJECTS][Temp_Objects];
- new ToyInfo[MAX_PLAYERS][MAX_TOYS][toyData];
- new VehicleData[MAX_VEHICLES+1][VEHICLE_DATA];
- new WeaponDrop[MAX_GUNS][WEAPON_DROP_DATA];
- new WeedData[MAX_HOUSES][WEED_DATA][MAX_WEED_PLANTS];
- new MaterialColors[][MAT_COLORS] =
- {
- {0xFFF0F8FF, "Alice Blue"},
- {0xFFFAEBD7, "Antique White"},
- {0xFF00FFFF, "Aqua"},
- {0xFF7FFFD4, "Aquamarine"},
- {0xFFF0FFFF, "Azure"},
- {0xFFF5F5DC, "Beige"},
- {0xFFFFE4C4, "Bisque"},
- {0xFF000000, "Black"},
- {0xFFFFEBCD, "Blanched Almond"},
- {0xFF0000FF, "Blue"},
- {0xFF8A2BE2, "Blue Violet"},
- {0xFFA52A2A, "Brown"},
- {0xFFDEB887, "Burly Wood"},
- {0xFF5F9EA0, "Cadet Blue"},
- {0xFF7FFF00, "Chartreuse"},
- {0xFFD2691E, "Chocolate"},
- {0xFFFF7F50, "Coral"},
- {0xFF6495ED, "Cornflower Blue"},
- {0xFFFFF8DC, "Cornsilk"},
- {0xFFDC143C, "Crimson"},
- {0xFF00FFFF, "Cyan"},
- {0xFF00008B, "Dark Blue"},
- {0xFF008B8B, "Dark Cyan"},
- {0xFFB8860B, "Dark Goldenrod"},
- {0xFFA9A9A9, "Dark Gray"},
- {0xFF006400, "Dark Green"},
- {0xFFBDB76B, "Dark Khaki"},
- {0xFF8B008B, "Dark Magenta"},
- {0xFF556B2F, "Dark Olive Green"},
- {0xFFFF8C00, "Dark Orange"},
- {0xFF9932CC, "Dark Orchid"},
- {0xFF8B0000, "Dark Red"},
- {0xFFE9967A, "Dark Salmon"},
- {0xFF8FBC8F, "Dark Sea Green"},
- {0xFF483D8B, "Dark Slate Blue"},
- {0xFF2F4F4F, "Dark Slate Gray"},
- {0xFF00CED1, "Dark Turquoise"},
- {0xFF9400D3, "Dark Violet"},
- {0xFFFF1493, "Deep Pink"},
- {0xFF00BFFF, "Deep Sky Blue"},
- {0xFF696969, "Dim Gray"},
- {0xFF1E90FF, "Dodger Blue"},
- {0xFFB22222, "Firebrick"},
- {0xFFFFFAF0, "Floral White"},
- {0xFF228B22, "Forest Green"},
- {0xFFFF00FF, "Fuchsia"},
- {0xFFDCDCDC, "Gainsboro"},
- {0xFFF8F8FF, "Ghost White"},
- {0xFFFFD700, "Gold"},
- {0xFFDAA520, "Goldenrod"},
- {0xFF808080, "Gray"},
- {0xFF008000, "Green"},
- {0xFFADFF2F, "Green Yellow"},
- {0xFFF0FFF0, "Honeydew"},
- {0xFFFF69B4, "Hot Pink"},
- {0xFFCD5C5C, "Indian Red"},
- {0xFF4B0082, "Indigo"},
- {0xFFFFFFF0, "Ivory"},
- {0xFFF0E68C, "Khaki"},
- {0xFFE6E6FA, "Lavender"},
- {0xFFFFF0F5, "Lavender Blush"},
- {0xFF7CFC00, "Lawn Green"},
- {0xFFFFFACD, "Lemon Chiffon"},
- {0xFFADD8E6, "Light Blue"},
- {0xFFF08080, "Light Coral"},
- {0xFFE0FFFF, "Light Cyan"},
- {0xFFFAFAD2, "Light Goldenrod Yellow"},
- {0xFFD3D3D3, "Light Gray"},
- {0xFF90EE90, "Light Green"},
- {0xFFFFB6C1, "Light Pink"},
- {0xFFFFA07A, "Light Salmon"},
- {0xFF20B2AA, "Light Sea Green"},
- {0xFF87CEFA, "Light Sky Blue"},
- {0xFF778899, "Light Slate Gray"},
- {0xFFB0C4DE, "Light Steel Blue"},
- {0xFFFFFFE0, "Light Yellow"},
- {0xFF00FF00, "Lime"},
- {0xFF32CD32, "Lime Green"},
- {0xFFFAF0E6, "Linen"},
- {0xFFFF00FF, "Magenta"},
- {0xFF800000, "Maroon"},
- {0xFF66CDAA, "Medium Aquamarine"},
- {0xFF0000CD, "Medium Blue"},
- {0xFFBA55D3, "Medium Orchid"},
- {0xFF9370DB, "Medium Purple"},
- {0xFF3CB371, "Medium Sea Green"},
- {0xFF7B68EE, "Medium Slate Blue"},
- {0xFF00FA9A, "Medium Spring Green"},
- {0xFF48D1CC, "Medium Turquoise"},
- {0xFFC71585, "Medium Violet Red"},
- {0xFF191970, "Midnight Blue"},
- {0xFFF5FFFA, "Mint Cream"},
- {0xFFFFE4E1, "Misty Rose"},
- {0xFFFFE4B5, "Moccasin"},
- {0xFFFFDEAD, "Navajo White"},
- {0xFF000080, "Navy"},
- {0xFFFDF5E6, "Old Lace"},
- {0xFF808000, "Olive"},
- {0xFF6B8E23, "Olive Drab"},
- {0xFFFFA500, "Orange"},
- {0xFFFF4500, "Orange Red"},
- {0xFFDA70D6, "Orchid"},
- {0xFFEEE8AA, "Pale Goldenrod"},
- {0xFF98FB98, "Pale Green"},
- {0xFFAFEEEE, "Pale Turquoise"},
- {0xFFDB7093, "Pale Violet Red"},
- {0xFFFFEFD5, "Papaya Whip"},
- {0xFFFFDAB9, "Peach Puff"},
- {0xFFCD853F, "Peru"},
- {0xFFFFC0CB, "Pink"},
- {0xFFDDA0DD, "Plum"},
- {0xFFB0E0E6, "Powder Blue"},
- {0xFF800080, "Purple"},
- {0xFFFF0000, "Red"},
- {0xFFBC8F8F, "Rosy Brown"},
- {0xFF4169E1, "Royal Blue"},
- {0xFF8B4513, "Saddle Brown"},
- {0xFFFA8072, "Salmon"},
- {0xFFF4A460, "Sandy Brown"},
- {0xFF2E8B57, "Sea Green"},
- {0xFFFFF5EE, "SeaShell"},
- {0xFFA0522D, "Sienna"},
- {0xFFC0C0C0, "Silver"},
- {0xFF87CEEB, "Sky Blue"},
- {0xFF6A5ACD, "Slate Blue"},
- {0xFF708090, "Slate Gray"},
- {0xFFFFFAFA, "Snow"},
- {0xFF00FF7F, "Spring Green"},
- {0xFF4682B4, "Steel Blue"},
- {0xFFD2B48C, "Tan"},
- {0xFF008080, "Teal"},
- {0xFFD8BFD8, "Thistle"},
- {0xFFFF6347, "Tomato"},
- {0xFF40E0D0, "Turquoise"},
- {0xFFEE82EE, "Violet"},
- {0xFFF5DEB3, "Wheat"},
- {0xFFFFFFFF, "White"},
- {0xFFF5F5F5, "White Smoke"},
- {0xFFFFFF00, "Yellow"},
- {0xFF9ACD32, "Yellow Green"}
- };
- new RBData[][RB_DATA] =
- {
- {1238, 1.0, 0.65},
- {1423, 2.0, 0.35},
- {1459, 2.0, 0.5},
- {1427, 2.0, 0.5},
- {18728, 0.0, 2.5},
- {19834, 2.0, 0.0},
- {1425, 2.0, 1.0},
- {19972, 2.0, 1.0},
- {1437, 2.0, 1.0}
- };
- /*new Messages[][] =
- {
- "[mensagem] Visite o nosso site ({44C300}greensiderp.com{FFFFFF}) para encontrar o fórum, changelog, relatórios de erros, banlist e mais.",
- "[mensagem] Se você encontrar um outro jogador, trapaceando ou usando hack, use {44C300}/reportar ID e ajude melhorar a comunidade.",
- "[mensagem] Se você precisar de assistência (por exemplo, você está congelado), use o comando /assistencia.",
- "[mensagem] Para pescar, você precisará de {44C300}iscas{FFFFFF}, {44C300}permição de pesca{FFFFFF} e uma {44C300}vara{FFFFFF}, todos são encontrados em uma {44C300}Loja de pesca.",
- "[mensagem] Para aumentar o nível de seu personagem use {44C300}/levelup.{FFFFFF}",
- "[mensagem] Numeros úteis: Serviços de emergência: {44C300}911,{FFFFFF} Taxi: {44C300}444.",
- "[mensagem] Se precisar de ajuda, tente olhar para no {44C300}/ajuda.{FFFFFF} caso não consiga, use {44C300}/assistencia.",
- "[mensagem] Escreva {44C300}/conquistas{FFFFFF} para acessar o sistema de conquistas.",
- "[mensagem] Sistema AFK: comando {44C300}/afk [razão(se quiser)]{FFFFFF} e {44C300}/voltar{FFFFFF} para voltar. Verifique o status de um jogador: {44C300}/isafk",
- "[mensagem] Se você comprar uma empresa (ícone de casa azul) Você receberá um pagamento definido em cada dia de pagamento.",
- "[mensagem] Pouco dinheiro? Experimente um trabalho secundário. Olhe no seu mini-mapa para ícones da bandeira vermelha.",
- "[mensagem] Mude as configurações do seu velocímetro com {44C300}/velocimetro.",
- "[mensagem] Quer uma mudança de nome? Usar {44C300}/mudarmeunome.{FFFFFF} isso custa {44C300}$25,000{FFFFFF} e um administrador terá que confirmar isso.",
- "[mensagem] Você pode identificar o tipo de combustível do seu veículo usando {44C300}/minfo.",
- "[mensagem] Se você deseja mudar o seu local Newbie Spawn, use {44C300}/mudarspawniniciante",
- "[mensagem] Se você quiser mudar sua localização de Spawn, use {44C300}/mudarspawn",
- "[mensagem] Precisa de uma carteira de motorista? Dirija-se ao {44C300}Montgomery DMV{FFFFFF} para fazer um teste.",
- "[mensagem] Você pode verificar os detalhes da data de nascimento usando o comando {44C300}/idade.",
- "[mensagem] Se você receber cheques em branco do banco, você pode {44C300}/asscheque{FFFFFF} para alguém e eles podem ser depositados em um banco.",
- "[mensagem] Visitar o {44C300}Montgomery DMV{FFFFFF} para obter uma placa de registo personalizada para o seu veículo.",
- "[mensagem] Para gerênciar seu celular, use {44C300}/phone.",
- "[mensagem] Você pode usar {44C300}/faconline{FFFFFF} para mostrar membros da facção online para uma facção específica.",
- "[mensagem] Verifique o changelog para todas as atualizações recentes e alterações - {44C300}http://redcountyrp.com/changelog/server",
- "[mensagem] Junte-se ao nosso servidor TeamSpeak 3 no endereço {44C300}ts.redcountyrp.com:5000",
- "[mensagem] Para ver uma lista de administradores que estão usando online {44C300}/admins{FFFFFF} e para ver uma lista de ajudantes você pode usar {44C300}/helpers.",
- "[mensagem] Use {44C300}/vluzes{FFFFFF} para acender ou apagar as luzes do Veículo, ou apenas precione pressionar {44C300}~k~~TOGGLE_SUBMISSIONS~.",
- "[mensagem] Se uma parte de mobília em sua casa/empresa desaparece, você pode usar-se {44C300}/recarregarmobilia{FFFFFF} para corrigir o problema.",
- "[mensagem] Descobriu um bug/falha? Por favor, ajude-nos através da apresentação de um {44C300}reporte de bug{FFFFFF} em nosso fórum.",
- "[mensagem] Sofrendo de fps baixo? Tente usar o {44C300}/setvisibleobjects{FFFFFF} comando para diminuir a quantidade de objetos que podem ser transmitidos ao seu cliente SAMP.",
- "[mensagem] Use {44C300}/hotkeys{FFFFFF} para ver teclas que pode ser usadas como comando",
- "[mensagem] Temos um canal de IRC! Visite {44C300}http://redcountyrp.com/irc{FFFFFF} para entrar!"
- };
- */
- new IngredName[][] = //drug comment
- {
- "Stimulant Base Agent 1",
- "Stimulant Base Agent 2",
- "Stimulant Base Agent 3",
- "Depressant Base Agent 1",
- "Depressant Base Agent 2",
- "Depressant Base Agent 3",
- "Hallucinogen Base Agent 1",
- "Hallucinogen Base Agent 2",
- "Hallucinogen Base Agent 3",
- "Ingredient 1",
- "Ingredient 2",
- "Ingredient 3",
- "Ingredient 4",
- "Ingredient 5",
- "Ingredient 6",
- "Ingredient 7",
- "Ingredient 8",
- "Ingredient 9",
- "Ingredient 10",
- "Ingredient 11"
- };
- /* Drug Effect Types -
- 1 Health Boost
- 2 Armour Boost
- 4 Movement Speed
- 5 Drunk Level
- 6 Weapon Damage Reduction
- 7 Melee Damage increase
- 8 Blackouts
- 9 Death chance
- 10 Auditory Effects
- 11 Double Effect time
- 12 Vomiting
- */
- /*Ingredient Multiplier Effect Types
- SubClass 1 - Single benefit boosters
- 1 Health Only
- 2 Armour Only
- 4 Movement Speed
- 5 Drunk Level
- 6 Weapon damage mitigation
- 7 Melee Damage
- 8 Blackouts
- 9 Death Chance
- 10 Auditory Effects
- 11 Double Effect time
- 12 Vomiting
- Sub Class 2 - Dual Benefit Boosters
- refer to list above
- SubClass 3 - Mix and match up to 4
- refer to list above
- */
- new Float:DrugLevelEffects[] =
- {0.64, 0.6, 0.7, 0.18, 0.5, 0.6, 0.07, 0.4, 0.5, 0.05, 0.35, 0.4, 0.04, 0.3, 0.35};
- new HexTransparency[10] = {0x00001A, 0x000033, 0x00004D, 0x000066, 0x000080, 0x000099, 0x0000B3, 0x0000CC, 0x0000E6, 0x0000FF};
- new BlackoutSeq[100] = {6, 5, 4, 5, 6, 6, 5, 4, 4, 5, 4, 5, 6, 5, 6, 5, 4, 5, 6, 7, 8, 7, 8, 8, 9, 9, 9, 9, 8, 7, 5, 5, 8, 8, 6, 5, 4, 4, 4, 4, 4, 5, 8, 9, 9, 9, 9, 9, 7,
- 5, 4, 5, 6, 6, 5, 7, 7, 8, 4, 3, 7, 8, 6, 7, 4, 9, 9, 9, 9, 9, 9, 9, 4, 5, 8, 6, 7, 6, 4, 4, 4, 4, 4, 5, 5, 4, 6, 4, 4, 3, 6, 7, 5, 3, 4, 9, 9, 9, 9, 9};
- new Float:tripMapLocs[4][7] =
- {
- {359.5341,-2091.5117,1009.0767, 359.6086,-2084.1726, 1007.8359, 66.0},
- {7.2362,1528.8179,31.4118, -14.3648,1511.6681,49.0896, 578.0},
- {1784.9462,1220.0194,27.9306, 1806.9814,1158.9652,29.5985, 3.0},
- {270.9916,-583.4470,1041.3904, 270.7592,-545.7708,1041.3904, 7.0}
- };
- new IngColors[6][32] = {"drugs1", "drugs2", "drugs3", "drugs4", "drugs5", "drugs6"};
- enum TEST_POS
- {
- Float:tePos[3],
- teDrugType
- };
- new TestIngred[8][TEST_POS] =
- {
- {{1295.5278,247.6914,18.4106}, 0},
- {{1293.5278,247.6914,18.4106}, 3},
- {{1291.5278,247.6914,18.4106}, 9},
- {{1289.5278,247.6914,18.4106}, 10},
- {{1287.5278,247.6914,18.4106}, 11},
- {{1285.5278,247.6914,18.4106}, 12},
- {{1283.5278,247.6914,18.4106}, 13},
- {{1281.5278,247.6914,18.4106}, 14}
- };
- new IngredEffects[19][DRUG_INGRED] =
- {
- {"no", 0, {0.0,0.0,0.0,0.0,0.0}, {0.68, 0.79, 0.47, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 1", 0, {2.0,0.0,0.0,0.0,0.0}, {0.68, 0.84, 0.47, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 1", 3, {1.0,2.0,5.0,12.0,0.0}, {1.0, -1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 0.6, 0.6, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 1", 6, {2.0, 13.0, 0.0, 0.0, 0.0}, {0.2, 0.8, 0.0, 0.9, 67, 67, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 2", 0, {1.0,0.0,0.0,0.0,0.0}, {0.56, 0.77, 0.39, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 2", 3, {1.0,2.0,5.0,4.0,11.0}, {1.0, 0.75, 0.75, 1.0, 0.75, 0.75, 1.0, 0.6, 0.6, 1.0, 0.5, 0.5, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 2", 6, {1.0,4.0,0.0,0.0,0.0}, {0.45, 1.0, 0.23, 0.75, 0.75, 0.15, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- //Dangerous, rare ingredient
- {"Ingredient 3", 0, {1.0,7.0,9.0,0.0,0.0}, {0.6, 1.2, 0.5, 0.65, 0.7, 0.2, 0.2, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 3", 3, {4.0,6.0,9.0,0.0,0.0}, {0.65, -0.75, -0.2, 0.6, 0.8, 0.2, 0.25, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 3", 6, {8.0,10.0,13.0,0.0,0.0}, {0.8, 0.5, 0.09, 0.7, 0.9, 0.4, 0.5, 232, 232, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- //Dud ingredient
- {"Ingredient 4", 0, {12.0,0.0,0.0,0.0,0.0}, {0.5, 0.4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 4", 3, {5.0,0.0,0.0,0.0,0.0}, {0.6, 0.5, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 4", 6, {5.0,0.0,0.0,0.0,0.0}, {0.2, 0.7, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- //Very rare ingredient
- {"Ingredient 5", 0, {1.0,2.0,4.0,6.0,9.0}, {0.7, 0.8, 0.4, 0.65, 0.7, 0.35, 0.8, 0.7, 0.3, 0.6, 0.6, 0.2, 0.08, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 5", 3, {6.0,7.0,9.0,11.0,0.0}, {0.65, 0.75, 0.25, 0.6, 0.8, 0.2, 0.06, 1.0, 0.0, 0.3, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 5", 6, {1.0,4.0,6.0,8.0,10.0}, {0.7, 0.8, 0.4, 0.7, 0.65, 0.2, 0.6, 0.6, 0.2, 0.2, 0.6, 0.1, 0.8, 0.7, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 6", 0, {4.0,8.0,12.0,0.0,0.0}, {0.6, 0.8, 0.2, 0.2, 0.8, 0.0, 0.2, 0.8, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 6", 3, {1.0,4.0,8.0,0.0,0.0}, {0.6, -0.8, -0.2, 0.8, -0.8, -0.2, 0.2, 0.4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
- {"Ingredient 6", 6, {1.0,4.0,10.0,13.0,0.0}, {0.4, -0.5, -0.1, 0.6, 0.8, 0.1, 0.5, 0.9, 0.25, 0.6, 228, 228, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}}
- };
- new BaseEffects[4][BASE_INGRED] =
- {
- {"Stimulant Base Agent 1",
- {0.56, 16.0, 6.0, 8.0, 1.0, 4.5, 5.25, 2.0, 0.13, 0.13, 4.0, 0.04, 0.04, 6.0, 0.04, 0.04, 7.0, 1500.0, 1500.0, 5.0},
- {0.29, 10.0, 7.25, 8.5, 1.0, 5.0, 5.75, 2.0, 0.14, 0.14, 4.0, 0.04, 0.04, 6.0, 0.04, 0.04, 7.0, 1600.0, 1600.0, 5.0},
- {0.11, 6.0, 8.0, 9.75, 1.0, 6.0, 7.0, 2.0, 0.16, 0.16, 4.0, 0.05, 0.05, 6.0, 0.05, 0.05, 7.0, 1700.0, 1700.0, 5.0},
- {0.04, 6.0, 9.75, 11.25, 1.0, 6.75, 8.25, 2.0, 0.17, 0.17, 4.0, 0.05, 0.05, 6.0, 0.05, 0.05, 7.0, 1800.0, 1800.0, 5.0},
- {100.0, 40.0, 0.0, 0.5, 2.0, 1.0, 4.0, 1.0, 6.0, 1.0, 7.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
- {250.0, 5.0, 0.0, 0.6, 1.0, 1.0, 2.0, 0.1, 8.0, 0.1, 12.0, 0.05, 9.0, 0.035, 5.0, 0.0, 0.0}},
- {"Stimulant Base Agent 2",
- {0.56, 16.0, 6.0, 8.0, 1.0, 4.5, 5.25, 2.0, 0.13, 0.13, 4.0, 0.04, 0.04, 6.0, 0.04, 0.04, 7.0, 1500.0, 1500.0, 5.0},
- {0.29, 10.0, 7.25, 8.5, 1.0, 5.0, 5.75, 2.0, 0.14, 0.14, 4.0, 0.04, 0.04, 6.0, 0.04, 0.04, 7.0, 1600.0, 1600.0, 5.0},
- {0.11, 6.0, 8.0, 9.75, 1.0, 6.0, 7.0, 2.0, 0.16, 0.16, 4.0, 0.05, 0.05, 6.0, 0.05, 0.05, 7.0, 1700.0, 1700.0, 5.0},
- {0.04, 6.0, 9.75, 11.25, 1.0, 6.75, 8.25, 2.0, 0.17, 0.17, 4.0, 0.05, 0.05, 6.0, 0.05, 0.05, 7.0, 1800.0, 1800.0, 5.0},
- {100.0, 40.0, 0.0, 0.5, 2.0, 1.0, 4.0, 1.0, 6.0, 1.0, 7.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
- {300.0, 5.0, 0.0, 0.6, 1.0, 1.0, 2.0, 0.2, 8.0, 0.2, 12.0, 0.2, 9.0, 0.0, 0.0, 0.0, 0.0}},
- {"Stimulant Base Agent 3",
- {0.56, 16.0, 6.0, 8.0, 1.0, 4.5, 5.25, 2.0, 0.13, 0.13, 4.0, 0.04, 0.04, 6.0, 0.04, 0.04, 7.0, 1500.0, 1500.0, 5.0},
- {0.29, 10.0, 7.25, 8.5, 1.0, 5.0, 5.75, 2.0, 0.14, 0.14, 4.0, 0.04, 0.04, 6.0, 0.04, 0.04, 7.0, 1600.0, 1600.0, 5.0},
- {0.11, 6.0, 8.0, 9.75, 1.0, 6.0, 7.0, 2.0, 0.16, 0.16, 4.0, 0.05, 0.05, 6.0, 0.05, 0.05, 7.0, 1700.0, 1700.0, 5.0},
- {0.04, 6.0, 9.75, 11.25, 1.0, 6.75, 8.25, 2.0, 0.17, 0.17, 4.0, 0.05, 0.05, 6.0, 0.05, 0.05, 7.0, 1800.0, 1800.0, 5.0},
- {100.0, 40.0, 0.0, 0.5, 2.0, 1.0, 4.0, 1.0, 6.0, 1.0, 7.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
- {300.0, 5.0, 0.0, 0.6, 1.0, 1.0, 2.0, 0.2, 8.0, 0.2, 12.0, 0.2, 9.0, 0.0, 0.0, 0.0, 0.0}},
- {"Depressant Base Agent 1",
- {0.59, 60.0, 10.25, 11.5, 1.0, 7.75, 9.25, 2.0, 0.075, 0.075, 4.0, 0.07, 0.07, 6.0, 2900.0, 2900.0, 5.0, 0.0, 0.0, 0.0},
- {0.23, 55.0, 11.0, 12.25, 1.0, 8.75, 10.0, 2.0, 0.08, 0.08, 4.0, 0.07, 0.07, 6.0, 3100.0, 3100.0, 5.0, 0.0, 0.0, 0.0},
- {0.13, 45.0, 11.75, 13.25, 1.0, 9.5, 11.25, 2.0, 0.08, 0.08, 4.0, 0.07, 0.07, 6.0, 3300.0, 3300.0, 5.0, 0.0, 0.0, 0.0},
- {0.05, 40.0, 12.75, 14.75, 1.0, 11.0, 12.5, 2.0, 0.09, 0.09, 4.0, 0.07, 0.07, 6.0, 3500.0, 3500.0, 5.0, 0.0, 0.0, 0.0},
- {200.0, 60.0, 0.0, 0.5, 1.0, 0.5, 2.0, 1.0, 4.0, 1.0, 6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
- {350.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}}
- };
- enum HOUSE_INSIDEIDS
- {
- Float:InsideX,
- Float:InsideY,
- Float:InsideZ,
- Float:InsideAng,
- InsideInt,
- };
- //Interior casas
- new InsideIDs[][HOUSE_INSIDEIDS] =
- {
- {2292.5903, -830.9219, 1052.1843, 259.5161, 10},
- {2298.9944, -847.8549, 1051.9645, 92.0504, 10},
- {2365.161865, -1135.018554, 1050.875000, 0.0, 8}, //Ja adicionado 3
- {2299.2598, -882.5173, 1051.9840, 92.1937, 2},
- {2308.77, -1212.94, 1049.02, 0.0, 6}, //Ja adicionado 5 não funciona ainda
- {2293.2346, -911.5627, 1052.4652, 0.3641, 12},
- {2317.780273, -1025.810302, 1050.217773, 0.0, 9}, //Ja adicionado 7
- {2295.3811, -923.6696, 1052.3685, 262.5797, 2},
- {2324.4160, -1147.5400, 1050.7101, 0.0, 12}, //Ja adicionado 9
- {1298.597900, -796.083007, 1084.0, 0.0, 5}, //10 = Mansão
- {0.0, 0.0, 0.0, 0.0, 0}, //11 sem interior
- {2294.0823, -957.0029, 1052.4189, 82.4581, 7},
- {2261.9021, -963.2805, 1052.7327, 353.7606, 1},
- {2236.8645, -971.0087, 1052.0117, 358.8213, 15},
- {2218.5022, -933.6071, 1051.9653, 355.9540, 10},
- {2218.2827, -888.1257, 1051.9922, 184.5824, 6},
- {2292.2253, -898.4724, 1051.9847, 351.3243, 1},
- {2513.4404, -1729.3276, 778.6371, 86.0734, 1}, //Interior do Trailer
- {2224.0750, -864.3496, 1052.0115, 267.5184, 3},
- {2228.0486, -840.1512, 1052.1335, 89.0380, 16},
- {2232.8574, -822.5994, 1052.0206, 89.9314, 16},
- {2249.9409, -817.2494, 1052.6451, 3.7875, 16},
- {2278.2224, -819.0201, 1052.0648, 184.3160, 3},
- {2272.6812, -943.5061, 1052.1133, 358.1942, 6},
- {2257.5852, -877.2102, 1052.1798, 356.9644, 5},
- {2246.6370, -856.2880, 1052.0812, 356.6508, 6},
- {2249.7605, -919.6628, 1051.9634, 89.3754, 9},
- {2258.5437, -984.4504, 1099.4713, 109.7187, 10},
- {2272.0364, -1003.6768, 1099.9410, 95.3045, 10},
- {2271.8667, -1020.7911, 1099.4163, 90.6751, 7},
- {2260.5376, -1078.7478, 1099.5891, 264.1927, 1},
- {225.4886, 1022.1478, 1084.0156, 0.0, 1}, //interior 32 não usar
- {2225.9946, -1014.3513, 1099.3920, 265.4466, 1},
- {2215.6143, -1030.7712, 1100.2734, 248.4797, 2},
- {2204.6697, -997.8024, 1099.5510, 0.4109, 20},
- {237.6881, 242.8275, 999.2313, 177.3522, 20},//36
- {2434.9097, -1622.0392, 1568.9280, 359.1342, 20},//37
- {2214.0254, -1066.6053, 1102.3536, 131.3857, 20}//38 interior custom (Armazen para fazer do 0)
- };
- enum BIZZ_INSIDEIDS
- {
- Float:InsideX,
- Float:InsideY,
- Float:InsideZ,
- Float:InsideAng,
- InsideInt,
- };
- new BInsideIDs[][BIZZ_INSIDEIDS] =
- {
- {0.0, 0.0, 0.0, 0.0, 0},
- {-27.052526, -57.420722, 1003.546875, 0.0, 6},
- {207.6833, -111.0292, 1005.1328, 0.0, 15},
- {316.383026, -169.421737, 999.601013, 0.0, 6},
- {458.724395, -88.930130, 999.554687, 90.0, 4},
- {372.505096,-132.490219,1001.492187, 0.0, 5},
- {-794.861999,490.243164,1376.195312, 0.0, 1},
- {364.753112, -11.040649, 1001.851562, 0.0, 9},
- {-30.763067,-90.936744,1003.546875, 0.0, 18},
- {5.724245, -30.789926, 1003.549438, 0.0, 10},
- {203.788482, -50.328407, 1001.804687, 0.0, 1},
- {204.443695, -168.207473, 1000.523437, 0.0, 14},
- {315.800170, -143.094589, 999.601562, 0.0, 7},
- {411.599578, -22.816562, 1001.804687, 0.0, 2},
- {207.037445, -139.872100, 1003.507812, 0.0, 3},
- {-2240.708496, 128.532684, 1035.414062, 270.0, 6},
- {-100.490547, -24.422285, 1000.718750, 0.0, 3},
- {-2640.762939,1406.682006,906.460937, 270.0, 3},
- {744.310668, 1436.872070, 1102.703125, 0.0, 6},
- {1133.1426,-15.2270,1000.6797, 270.0, 12},
- {1205.2546, -12.6349, 1000.921, 270.0, 2},
- {673.218, -501.597, 1932.92, 0.0, 1},
- {0.0, 0.0, 0.0, 0.0, 0},
- {161.5087, -96.6108, 1001.8046, 0.0, 18},
- {1234.5778, 189.2405, 2091.3677, 0.0, 19}//centro de informações
- };
- new Float:GInsideIDs[4][3] =
- {
- {1452.6890, -2516.3198, 13.5749},
- {1840.130981, -2436.8566, 13.5859},
- {2086.1669, -2476.5585, 13.5859},
- {1571.6641, -2567.9624, 13.5988}
- };
- new gPlayerUsingLoopingAnim[MAX_PLAYERS];
- new gPlayerAnimLibsPreloaded[MAX_PLAYERS];
- new Text:txtAnimHelper;
- new Float:ClassSelectionData[13][12] =
- {
- {1439.0410, -221.8372, 22.7985, 1440.0046, -221.5518, 22.6933, 1636.5062, -66.9961, 70.3919, 1635.6693, -66.4367, 70.2167},
- {180.9195, 1138.8217, 27.7668, 181.3019, 1139.7499, 27.6417, -270.1440, 1205.6362, 46.1036, -271.0848, 1205.2869, 45.9885},
- {-174.8245, 341.1865, 16.5733, -174.5815, 342.1605, 16.4633, -210.2901, -118.1688, 46.9579, -209.3116, -117.9448, 46.6678},
- {182.8430, -404.5717, 14.6186, 183.8444, -404.6406, 14.5386, 427.5617, -154.8631, 41.8298, 426.5782, -154.6632, 41.4898},
- {1004.3258, -376.9207, 94.2813, 1005.0281, -376.2045, 93.9662, 1312.7808, 79.5683, 59.5385, 1312.6805, 80.5663, 59.2334},
- {1317.0122, 477.7603, 29.6383, 1317.8527, 477.2135, 29.6082, 1454.9969, 225.1299, 50.8671, 1453.9943, 225.1293, 50.6120},
- {1833.4757, -130.9368, 50.2288, 1834.3181, -130.3933, 50.0187, 2347.2859, 224.9401, 63.6775, 2347.0322, 223.9702, 63.2974},
- {2248.0591, 453.6871, 21.3100, 2247.5483, 452.8203, 21.3448, 2076.9285, -166.3638, 29.7962, 2077.4338, -165.4950, 29.5760},
- {932.2772, -574.8990, 116.6781, 932.6947, -573.9850, 116.3879, 597.8068, -477.2111, 42.7448, 598.6305, -477.7866, 42.3495},
- {-69.3941, 302.7461, 13.7824, -70.2654, 302.2455, 13.7571, -477.1172, -199.8384, 95.6078, -477.7337, -199.0445, 95.3326},
- {-1486.9976, 755.0239, 62.4289, -1486.0818, 755.4375, 62.3287, -319.6878, 1481.4557, 107.3692, -319.9124, 1480.4750, 107.0441},
- {416.0463, 2537.4595, 19.3093, 415.3760, 2536.7065, 19.2141, 82.3415, 2306.4563, 50.6167, 81.5734, 2307.1150, 50.5914},
- {-2048.1794, -2572.1389, 38.6077, -2048.5913, -2571.2131, 38.5520, -2250.4536, -1491.6262, 690.8711, -2250.4121, -1492.6443, 690.0442}
- };
- new Float:motelcords[][] =
- {
- {89.125534, 1182.618896, 18.664062},
- {13.593950, 1188.600219, 19.320938},//2
- {-9.583352, 1209.571655, 19.352746},//3
- {-103.805709, 1210.550415, 19.735198},//4
- {-779.544311, 2744.700439, 45.682723},//5
- {-2201.568359, -2264.570556, 30.625},//6
- {-1623.976562, -2693.890869, 48.74266},//7
- {-818.3351, -1897.9431, 10.8704},//8
- {-2343.6165, -1626.9683, 483.7802}//9 mont chil
- };
- new conn;
- // clothing store.
- new Clothing_Objects[MAX_PLAYERS][MAX_TEMPCLOTHES];
- new Clothing_Masks[] = {18974, 19036, 19037, 19038, 19163, 19801, 19557, 11704};
- new Clothing_Bandanas[] = {18911, 18912, 18913, 18914, 18915, 18916, 18917, 18918, 18919, 18920, 18891, 18892, 18893, 18894, 18895, 18896, 18897, 18898, 18899, 18900, 18901, 18902, 18903, 18904, 18905, 18906, 18907, 18908, 18909, 18910};
- new Clothing_Hats[] = {18921, 18922, 18923, 18924, 18925, 18926, 18927, 18928, 18929, 18930, 18931, 18932, 18933, 18934, 18935, 18939, 18940, 18941, 18942, 18943, 18944, 18945, 18946, 18947, 18948, 18949, 18950, 18951, 19488, 18953, 18954, 18955, 18956, 18957, 18958, 18959, 18960, 18961, 18964, 18965, 18966, 18967, 18968, 18969, 18971, 18972, 18973, 19067, 19068, 19069, 18639, 18970, 19095, 18962, 19096, 19097, 19098, 19352, 19487, 19520, 2054, 19528, 19553, 19554, 19558, 19094, 19137}; //67 items
- new Clothing_Helmets[] = {18645, 18976, 18977, 18978, 18979, 19101, 19102, 19103, 19104, 19105, 19106, 19107, 19108, 19109, 19110, 19111, 19112, 18936, 18937, 18938, 2052 , 2053 , 19114, 19115, 19116, 19117, 19118, 19119, 19120, 18638, 19093, 19160};
- new Clothing_Hair[] = {18640, 18975, 19077, 19136, 19274, 19519, 19516, 19517, 19518, 19350, 19351};
- new Clothing_Sunglasses[] = {19006, 19007, 19008, 19009, 19010, 19011, 19012, 19013, 19014, 19015, 19016, 19017, 19018, 19019, 19020, 19021, 19022, 19023, 19024, 19025, 19026, 19027, 19028, 19029, 19030, 19031, 19032, 19033, 19034, 19035};
- new Clothing_Watches[] = {19039, 19040, 19041, 19042, 19043, 19044, 19045, 19046, 19047, 19048, 19049, 19050, 19051, 19052, 19053};
- new Clothing_Misc[] = {19421, 19422, 19423, 19424, 19085, 19349, 19469, 19591, 19348, 18875, 18641, 19090, 19091, 19092, 18952, 19555, 19556, 1210 , 19624, 19921, 11745, 371, 3026, 19559, 19623, 19878, 19317, 19318, 19319, 19610, 19893, 19894, 19904, 19773, 19078, 11712, 19088};
- new Clothing_Police[] = {19161, 19162, 19521, 18636, 19099, 19100, 19200, 19141, 18637, 19514, 19347, 19774, 19775, 19778, 19779, 19780, 19781, 19782, 19783, 19784, 19785, 19138, 19139, 19140, 19472, 18641, 18642, 19418};
- new Clothing_Tools[] = {18632, 18633, 18634, 18635, 18644, 18890, 19622, 19631};
- new Clothing_FD[] = {19330, 19331};
- main() {}
- /*
- new SERVER_DOWNLOAD[] = "http://greensiderp.com.br/forum/models";
- public OnPlayerRequestDownload(playerid, type, crc)
- {
- if(!IsPlayerConnected(playerid))
- return 0;
-
- new filename[64], filefound, url_final[256];
-
- if(type == DOWNLOAD_REQUEST_TEXTURE_FILE)
- filefound = FindTextureFileNameFromCRC(crc, filename, sizeof(filename));
- else if(type == DOWNLOAD_REQUEST_MODEL_FILE)
- filefound = FindModelFileNameFromCRC(crc, filename, sizeof(filename));
-
- if(filefound)
- {
- format(url_final, sizeof(url_final), "%s/%s", SERVER_DOWNLOAD, filename);
- RedirectDownload(playerid, url_final);
- }
- return 1;
- }*/
- public OnGameModeInit()
- {
- print("----------------------------------------------------------------------------");
- printf("\n Greenside Role Play - Versao %s", VERSION);
- print("\n Loading...");
- new InitialTicks = GetTickCount();
- //-- server --------------------------------------------------------------------
- // mySQL Connection
- #if DB_SERVER == DB_SERVER_DEV
- conn = mysql_connect(
- "127.0.0.1", // Host
- "root", // User
- "gs193", // Database
- "", // Password
- 3306, true, 10
- );
- #elseif DB_SERVER == DB_SERVER_MAIN
- //IRCBot = IRC_Connect("irc.tl", 6667, "RCRPBot", "The Holy Light of Hegebe", "Hegebe123", false); // essa � pra descomentar se add IRC
- conn = mysql_connect(
- "greenside.co3urwuxniff.us-east-1.rds.amazonaws.com", // Host
- "uumaster", // User
- "greenside", // Database
- "sDsslk8S6D4vn64fd58%4d09",
- 3306, true, 10
- );
- #elseif DB_SERVER == DB_SERVER_LOCAL
- //IRCTestBot = IRC_Connect("irc.tl", 6667, "RCRPTestBot", "The Holy Light of Hegebe", "Hegebe123", false); // j� tava assim
- conn = mysql_connect(
- "greenside.co3urwuxniff.us-east-1.rds.amazonaws.com", // Host
- "uumaster", // User
- "greenside", // Database
- "sDsslk8S6D4vn64fd58%4d09",
- 3306, true, 10
- );
- #else
- // DB_SERVER needs to equal one of the defined servers
- #error Unspecified or invalid DB_SERVER.
- #endif
- D_ChatID = DCC_FindChannelById("481293493717827594");
- SetGameModeText(""GAMEMODE" "VERSION"");
- AddPlayerClass(1, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
- new hr, mn, sec, y, m, d;
- gettime(hr, mn, sec);
- getdate(y, m, d);
- #if DB_SERVER != DB_SERVER_DEV
- gServerHour = hr - TIMEOFFSET;
- #else
- gServerHour = hr;
- #endif
- gServerMinute = mn;
- gServerSecond = sec;
- gServerYear = y;
- AssistCount = 0;
- SetWorldTime(gServerHour);
- if(gServerMinute > 55) WinningLotteryNumber = random(99) + 1;
- for(new x = 0; x < MAX_HOUSES; x++)
- {
- if(x < MAX_FIRES)
- {
- Flame[x][FID] = INVALID_OBJECT_ID;
- Flame[x][AfterSmoke][0] = INVALID_OBJECT_ID;
- Flame[x][AfterSmoke][1] = INVALID_OBJECT_ID;
- Flame[x][AfterSmoke][2] = INVALID_OBJECT_ID;
- Flame[x][AfterSmoke][3] = INVALID_OBJECT_ID;
- Flame[x][AfterSmoke][4] = INVALID_OBJECT_ID;
- Flame[x][Smoke][1] = INVALID_OBJECT_ID;
- }
- if(x < MAX_PLAYERS)
- {
- PlayerBuyFurniture[x][0] = INVALID_OBJECT_ID;
- PlayerBuyFurniture[x][1] = -1;
- PlayerBuyOutdoorFurniture[x][0] = INVALID_OBJECT_ID;
- PlayerBuyOutdoorFurniture[x][1] = -1;
- }
- for(new f = 0; f < MAX_HFURNITURE; f++)
- {
- for(new i = 0; i < MAX_TEXTURESLOTS; i++)
- {
- FurnitureIndex[x][f][i] = -1;
- }
- }
- }
- for(new i; i != MAX_FACTIONS; i++) {
- for(new k; k != MAX_FACTION_DOORS; k++) {
- FACTIONS[i][FactionDoors][k] = -1;
- }
- }
- mysql_pquery(conn, "UPDATE `players` SET `Online` = 0 WHERE `Online` = 1");
- ///////////////////// ------------------------------------ /////////////////////
- mysql_tquery(conn, "SELECT * FROM `factions` ORDER BY `id` ASC", "LoadFactions");
- mysql_tquery(conn, "SELECT * FROM `factiondoors` ORDER BY `id` ASC", "LoadFactionDoors");
- mysql_tquery(conn, "SELECT * FROM `fveh` ORDER BY `Faction`, `Model` ASC", "LoadFactionVehicles");
- mysql_tquery(conn, "SELECT * FROM pickups", "LoadAllPickups");
- mysql_tquery(conn, "SELECT * FROM `houses` ORDER BY `id` ASC", "LoadHouses", "i", 0);
- mysql_tquery(conn, "SELECT * FROM `furniture` ORDER BY `Name` ASC", "LoadFurniture");
- mysql_tquery(conn, "SELECT * FROM `bizz` ORDER BY `id` ASC", "LoadBizzes", "");
- mysql_tquery(conn, "SELECT * FROM `motel`", "LoadMotels", "");
- mysql_tquery(conn, "SELECT * FROM `interiors`", "LoadInteriors");
- mysql_tquery(conn, "SELECT * FROM `apbs` WHERE `apbDeleted` = 0 ORDER BY `apbTimestamp` DESC LIMIT 20", "LoadAPBS");
- mysql_tquery(conn, "SELECT * FROM `achievements`", "LoadAchievements");
- mysql_tquery(conn, "SELECT * FROM `fuel`", "LoadFuelStations");
- mysql_tquery(conn, "SELECT * FROM `garages`", "LoadGarages");
- mysql_tquery(conn, "SELECT * FROM `weaponinfo` WHERE `id` = 1", "LoadWeaponInfo");
- mysql_tquery(conn, "SELECT * FROM `rentals`", "LoadRentalCars");
- mysql_tquery(conn, "SELECT * FROM `efurniture` ORDER BY `HouseSQLID` ASC", "LoadExteriorHouseFurniture");
- mysql_tquery(conn, "SELECT * FROM `hfurniture` ORDER BY `HouseSQLID` ASC", "LoadHouseFurniture");
- mysql_pquery(conn, "SELECT * FROM `drugs` WHERE drugOwnerType = 'D' AND drugOwner = -1", "LoadDroppedDrugs"); //drug comment
- mysql_pquery(conn, "SELECT * FROM `ingredients` WHERE ingOwnerType = 'D' AND ingOwner = -1", "LoadDroppedIngred");
- ///////////////////// ------------------------------------ /////////////////////
- //LoadAchievements();
- CreateDynamic3DTextLabel("Red County to Bone County Toll\nFee: $5\n(( /paytoll ))", COLOR_WHITE, -193.996093, 269.474182, 13.380057, 30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 30);
- CreateDynamic3DTextLabel("Red County to Bone County Toll\nFee: $5\n(( /paytoll ))", COLOR_WHITE, 611.747741, 342.626190, 20.251445, 30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 30);
- CreateDynamic3DTextLabel("WELCOME TO\nAngel Pine Service Station\n\nParking, Toilets\nFood & Motel", COLOR_SIGN, -1550.062011, -2772.879638, 52.315998, 30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 30);
- CreateDynamic3DTextLabel("THANKS FOR VISITING\nAngel Pine Service Station\n\nCome back soon!", COLOR_SIGN, -1631.236938, -2714.048828, 55.129655, 30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 30);
- CreateDynamic3DTextLabel("1. You shall have no other gods before Me.\n2. You shall not make for yourself a carved image.\n3. You shall not take the name of the LORD your God in vain.\n4. Remember the Sabbath day, to keep it holy.\n5. Honor your father and your mother.\n6. You shall not murder.\n7. You shall not commit adultery.\n8. You shall not steal.\n9. You shall not bear false witness against your neighbor.\n10. You shall not covet your neighbor's belongings.",
- COLOR_SIGN, 1964.020019, -373.459991, 1100.0, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 30);
- BlindZone = GangZoneCreate(-3203.2327,2895.8423, 3127.0122,-2623.3064);
- SilverRectangle = CreateDynamicRectangle(-1803.1433, 1997.7676, -1835.1952, 2075.1992, 0, 0); //area for mine house XD
- GarageAreas[0] = CreateDynamicRectangle(2455.7649, 107.0694, 2414.8035, 129.7895, 0, 0); //pc
- GarageAreas[1] = CreateDynamicRectangle(726.4166, -475.3159, 715.0319, -462.8468, 0, 0); //dil
- GarageAreas[2] = CreateDynamicRectangle(-75.7559, 1107.9041, -92.2019, 1138.6776, 0, 0); //fort carson
- GarageAreas[3] = CreateDynamicRectangle(-1426.0576, 2596.4397, -1415.3944, 2591.6462, 0, 0); //el q
- GarageAreas[4] = CreateDynamicRectangle(322.1735, 2507.0776, 355.3174, 2492.5596, 0, 0); //airstrip
- GarageAreas[5] = CreateDynamicSphere(-2229.9500, 2422.6121, -0.5429, 30, 0, 0); //bayside
- GarageAreas[6] = CreateDynamicRectangle(-2216.2405,-2323.7209, -2241.2866,-2319.1719, 0, 0); //angel pine
- PCArea = CreateDynamicRectangle(2284.3208, -63.6326, 2246.9553, -87.9116, 0, 0); //PC townhall area, used to prevent players from saving their vehicles there.
- for(new i; i != sizeof FDGate; i++) {
- FDGate[i] = CreateDynamicObject(5856, 2363.00, 261.27 - i*5.21, 27.42, 0.00, 0.00, 0.00);
- SetDynamicObjectMaterial(FDGate[i], 0, 11008, "firehouse_sfse", "ws_rollerdoor_fire"); }
- SpeedCameraAreas[0] = CreateDynamicRectangle(1365.9178, -13.4586, 1382.0728, -16.1080, 0, 0); //Montgomery View Speed Cameras
- SpeedCameraAreas[1] = CreateDynamicRectangle(835.9043, -176.8756, 818.6830, -162.2820, 0, 0); //Highway 48 Cameras (near blueberry)
- SpeedCameraAreas[2] = CreateDynamicRectangle(400.8653, 148.5499, 414.0700, 140.1884, 0, 0); //Fern Ridge Speed Cameras
- SpeedCameraAreas[3] = CreateDynamicRectangle(331.3141, 1375.9227, 343.7094, 1367.5349, 0, 0); //Route 7 Speed Cameras (near the oil refinery in BC)
- SpeedCameraAreas[4] = CreateDynamicRectangle(1841.5540, 377.3627, 1829.8674, 367.6920, 0, 0); //Highway 48 Cameras (between monty and PC)
- SpeedCameraAreas[5] = CreateDynamicRectangle(2059.6011, 48.5921, 2045.7181, 32.7503, 0, 0); //PC Red Bridge Cameras
- APArea = CreateDynamicRectangle(-134.4251,1597.4268, 385.427581,2158.114501, 0, 0); //Aperture Base area
- // Motel Data
- mysql_pquery(conn, "SELECT (SELECT COUNT(*) FROM motel WHERE OwnerSQLID = 0 AND MotelID = 1) AS freerooms, (SELECT COUNT(*) FROM motel WHERE MotelID = 1) AS totalrooms", "LoadMotelInfo", "ii", 0, 1);
- mysql_pquery(conn, "SELECT (SELECT COUNT(*) FROM motel WHERE OwnerSQLID = 0 AND MotelID = 2) AS freerooms, (SELECT COUNT(*) FROM motel WHERE MotelID = 2) AS totalrooms", "LoadMotelInfo", "ii", 1, 1);
- mysql_pquery(conn, "SELECT (SELECT COUNT(*) FROM motel WHERE OwnerSQLID = 0 AND MotelID = 3) AS freerooms, (SELECT COUNT(*) FROM motel WHERE MotelID = 3) AS totalrooms", "LoadMotelInfo", "ii", 2, 1);
- mysql_pquery(conn, "SELECT (SELECT COUNT(*) FROM motel WHERE OwnerSQLID = 0 AND MotelID = 4) AS freerooms, (SELECT COUNT(*) FROM motel WHERE MotelID = 4) AS totalrooms", "LoadMotelInfo", "ii", 3, 1);
- mysql_pquery(conn, "SELECT (SELECT COUNT(*) FROM motel WHERE OwnerSQLID = 0 AND MotelID = 5) AS freerooms, (SELECT COUNT(*) FROM motel WHERE MotelID = 5) AS totalrooms", "LoadMotelInfo", "ii", 4, 1);
- mysql_pquery(conn, "SELECT (SELECT COUNT(*) FROM motel WHERE OwnerSQLID = 0 AND MotelID = 6) AS freerooms, (SELECT COUNT(*) FROM motel WHERE MotelID = 6) AS totalrooms", "LoadMotelInfo", "ii", 5, 1);
- mysql_pquery(conn, "SELECT (SELECT COUNT(*) FROM motel WHERE OwnerSQLID = 0 AND MotelID = 7) AS freerooms, (SELECT COUNT(*) FROM motel WHERE MotelID = 7) AS totalrooms", "LoadMotelInfo", "ii", 6, 1);
- mysql_pquery(conn, "SELECT (SELECT COUNT(*) FROM motel WHERE OwnerSQLID = 0 AND MotelID = 8) AS freerooms, (SELECT COUNT(*) FROM motel WHERE MotelID = 8) AS totalrooms", "LoadMotelInfo", "ii", 7, 1);
- mysql_pquery(conn, "SELECT (SELECT COUNT(*) FROM motel WHERE OwnerSQLID = 0 AND MotelID = 9) AS freerooms, (SELECT COUNT(*) FROM motel WHERE MotelID = 9) AS totalrooms", "LoadMotelInfo", "ii", 8, 1);
- //-- enables/disables ----------------------------------------------------------
- new w = random(12);
- EnableStuntBonusForAll(false);
- AllowInteriorWeapons(true);
- DisableInteriorEnterExits();
- ShowNameTags(0);
- SetNameTagDrawDistance(20.0);
- ShowPlayerMarkers(true);
- SetWeather(w);
- gServerWeather = w;
- ManualVehicleEngineAndLights();
- //==============================================================================//
- // Mapas - não modificar mais
- // Loja_Eletronicos();
- // StripClub_New();
- //==============================================================================//
- // pickups
- //CreateBlueberry();
- pickupsCoor();
- //==============================================================================//
- //==============================================================================//
- //Streamer_TickRate(20);
- Streamer_SetVisibleItems(STREAMER_TYPE_OBJECT, 750);
- //-- timers --------------------------------------------------------------------
- OneSecondTimer = SetTimer("OneSecTimer", 1000, 1);
- QuickCountTimer = SetTimer("QuickCount", 250, 1);
- //-- map icons -----------------------------------------------------------------
- /*
- CreateDynamicMapIcon(623.3233, -495.0916, 16.359, 55, 0, 0, 0, -1, 250.0); // MickMotors
- CreateDynamicMapIcon(627.8405, -585.0328, 16.517, 30, 0, 0, 0, -1, 250.0); // DilPolice
- CreateDynamicMapIcon(681.8500, -473.3602, 16.533, 49, 0, 0, 0, -1, 250.0); // WelcomePump
- CreateDynamicMapIcon(1226.2977, 311.6379, 19.778, 22, 0, 0, 0, -1, 250.0); // Hospital
- CreateDynamicMapIcon(2303.8245, -15.6330, 26.484, 52, 0, 0, 0, -1, 250.0); // Bank
- CreateDynamicMapIcon(213.1980, 1897.2472, 16.765, 35, 0, 0, 0, -1, 250.0); // Area51
- CreateDynamicMapIcon(1282.2416, 247.9742, 19.402, 30, 0, 0, 0, -1, 250.0); // MontPolice
- CreateDynamicMapIcon(1311.5684, 329.6601, 19.914, 52, 0, 0, 0, -1, 250.0); // MontBank
- CreateDynamicMapIcon(1372.7568, 405.8102, 19.955, 25, 0, 0, 0, -1, 250.0); // Casino
- CreateDynamicMapIcon(2246.477, 30.09772, 26.5009, 19, 0, 0, 0, -1, 250.0); // Sweeping
- CreateDynamicMapIcon(66.75766, -256.393, 1.57867, 19, 0, 0, 0, -1, 250.0); // Trucking
- CreateDynamicMapIcon(163.9551, -23.53521, 1.5781, 55, 0, 0, 0, -1, 250.0); // Garage
- CreateDynamicMapIcon(2111.0520, -98.3380, 2.1039, 9, 0, 0, 0, -1, 250.0); // Fishing
- CreateDynamicMapIcon(-796.9949, -1922.7526, 6.4559, 9, 0, 0, 0, -1, 250.0); // Fishing 2
- CreateDynamicMapIcon(2253.9270, -87.4724, 26.490, 35, 0, 0, 0, -1, 250.0); // Library
- CreateDynamicMapIcon(1340.5526, 216.4873, 19.554, 36, 0, 0, 0, -1, 250.0); // MontGenSt
- CreateDynamicMapIcon(2318.7448, -88.8309, 26.484, 36, 0, 0, 0, -1, 250.0); // PCGenSt
- CreateDynamicMapIcon(139.6290, -204.7275, 1.5781, 36, 0, 0, 0, -1, 250.0); // BBGenSt
- CreateDynamicMapIcon(691.3930, -583.4483, 16.328, 36, 0, 0, 0, -1, 250.0); // DilGenSt
- CreateDynamicMapIcon(1245.7813, 209.1916, 23.055, 50, 0, 0, 0, -1, 250.0); // Cafe1
- CreateDynamicMapIcon(171.088745, -149.37268, 1.5, 49, 0, 0, 0, -1, 250.0); // Bar
- CreateDynamicMapIcon(811.90844, -564.53918, 16.3, 49, 0, 0, 0, -1, 250.0); // DilStripClub
- CreateDynamicMapIcon(273.170745, -195.58639, 1.5, 54, 0, 0, 0, -1, 250.0); // Gym
- CreateDynamicMapIcon(-27.282365, -309.18091, 5.4, 19, 0, 0, 0, -1, 250.0); // BusStation
- CreateDynamicMapIcon(1374.115966, 234.063827, 20.038631, 19, 0, 0, 0, -1, 250.0); // DeliveryJob
- CreateDynamicMapIcon(1454.206054, 421.273559, 20.297800, 20, 0, 0, 0, -1, 250.0); // FireStation
- CreateDynamicMapIcon(226.0848, 88.7306, 3.8906, 11, 0, 0, 0, -1, 250.0); // JunkYard
- CreateDynamicMapIcon(-1576.935, -2732.776, 48.53, 51, 0, 0, 0, -1, 250.0); // Angel Services
- CreateDynamicMapIcon(1318.34741, 225.9011, 19.54, 48, 0, 0, 0, -1, 250.0); // MontClub
- CreateDynamicMapIcon(-320.282, 1049.31701, 20.34, 22, 0, 0, 0, -1, 250.0); // FCHospital
- CreateDynamicMapIcon(-181.4130, 1034.7399, 19.74, 36, 0, 0, 0, -1, 250.0); // FCGeneralStore
- CreateDynamicMapIcon(-180.19126, 1087.878, 19.74, 49, 0, 0, 0, -1, 250.0); // FCBar
- CreateDynamicMapIcon(-180.57946, 1133.041, 19.74, 52, 0, 0, 0, -1, 250.0); // FCBank
- CreateDynamicMapIcon(-144.1260, 1223.1865, 19.89, 17, 0, 0, 0, -1, 250.0); // FCKingRing
- CreateDynamicMapIcon(-180.19126, 1087.878, 19.74, 49, 0, 0, 0, -1, 250.0); // FCBar
- CreateDynamicMapIcon(827.632690, 858.9190, 12.32, 19, 0, 0, 0, -1, 250.0); // QuarryJob
- CreateDynamicMapIcon(-92.14196, 1353.8935, 10.23, 50, 0, 0, 0, -1, 250.0); // LilProbeInn
- CreateDynamicMapIcon(-310.6282, 1303.5039, 53.66, 56, 0, 0, 0, -1, 250.0); // ExecLounge
- CreateDynamicMapIcon(-828.09100, 1502.724, 19.53, 52, 0, 0, 0, -1, 250.0); // LasB Bank
- CreateDynamicMapIcon(-818.1983, 1561.4216, 29.77, 49, 0, 0, 0, -1, 250.0); // LasB Bar
- CreateDynamicMapIcon(-1363.525, 2083.7634, 48.44, 9, 0, 0, 0, -1, 250.0); // BCFishing
- CreateDynamicMapIcon(-1401.8240, 2639.042, 55.68, 30, 0, 0, 0, -1, 250.0); // ElQCop
- CreateDynamicMapIcon(-1514.6279, 2521.992, 55.84, 22, 0, 0, 0, -1, 250.0); // ElQEMS
- CreateDynamicMapIcon(391.942749, 2494.397, 16.48, 5, 0, 0, 0, -1, 250.0); // VerdantMeadows
- CreateDynamicMapIcon(627.41082, 862.7775, -42.96, 11, 0, 0, 0, -1, 250.0); // Quarry
- CreateDynamicMapIcon(693.651306, 1964.0576, 5.53, 21, 0, 0, 0, -1, 250.0); // BigSpreadRanch
- CreateDynamicMapIcon(-1938.920, 2380.7043, 49.49, 50, 0, 0, 0, -1, 250.0); // JaysDiner
- CreateDynamicMapIcon(-1465.7082, 1873.289, 32.63, 51, 0, 0, 0, -1, 250.0); // BCTruckStopW
- CreateDynamicMapIcon(-1267.7772, 2711.960, 50.07, 51, 0, 0, 0, -1, 250.0); // BCTruckStopN
- CreateDynamicMapIcon(663.220825, 1713.963, 10.91, 51, 0, 0, 0, -1, 250.0); // BCTruckStopE
- CreateDynamicMapIcon(-1536.4343, 2564.1311, 55.8, 52, 0, 0, 0, -1, 250.0); // ElqBank
- CreateDynamicMapIcon(-1479.5596, 2592.1013, 55.8, 36, 0, 0, 0, -1, 250.0); // ElqGeneralStore
- CreateDynamicMapIcon(632.84924, 1228.3055, 11.71, 19, 0, 0, 0, -1, 250.0); // TrashManJob
- CreateDynamicMapIcon(-208.198, 2712.69506, 62.97, 52, 0, 0, 0, -1, 250.0); // las payasadas FBank
- CreateDynamicMapIcon(1252.0914, 134.7150, 19.970, 55, 0, 0, 0, -1, 250.0); // DMV Center
- CreateDynamicMapIcon(-2136.117, -2308.788, 30.62, 52, 0, 0, 0, -1, 250.0); // Angel Bank
- CreateDynamicMapIcon(-2171.010, -2291.547, 30.62, 36, 0, 0, 0, -1, 250.0); // Angel Shop
- CreateDynamicMapIcon(177.546569, 1169.8415, 14.7, 14, 0, 0, 0, -1, 250.0); // CluckinBell_FC
- CreateDynamicMapIcon(-1208.9654, 1823.7528, 41.7, 14, 0, 0, 0, -1, 250.0); // CluckinBell_BC
- CreateDynamicMapIcon(-2154.2941, -2459.438, 30.8, 14, 0, 0, 0, -1, 250.0); // CluckinBell_AP
- CreateDynamicMapIcon(2434.0678, 120.92222, 26.46, 55, 0, 0, 0, -1, 250.0); // PC Garage */
- //CreateLockedVehicle(444,633.931152,-497.722290,21.478458,315.601165,-1,-1,600); //Monster(Micks)
- //-- pickups -------------------------------------------------------------------
- print("\n");
- //FLAT Montgomery Block 5
- CreateDynamicPickup(1314, 23, 1281.402954, 281.201782, 19.554687, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Montgomery Block 1", COLOR_WHITE, 1281.402954, 281.201782, 19.554687+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Montgomery Block 6
- CreateDynamicPickup(1314, 23, 1279.798339, 284.047851, 19.554687, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Montgomery Block 2", COLOR_WHITE, 1279.798339, 284.047851, 19.554687+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Montgomery Block 7
- CreateDynamicPickup(1314, 23, 1288.918579, 304.358001, 19.554687, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Montgomery Block 3", COLOR_WHITE, 1288.918579, 304.358001, 19.554687+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Montgomery Block 8
- CreateDynamicPickup(1314, 23, 1292.398803, 311.850219, 19.554687, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Montgomery Block 4", COLOR_WHITE, 1292.398803, 311.850219, 19.554687+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Montgomery Block 9
- CreateDynamicPickup(1314, 23, 1281.293823, 305.315216, 19.554687, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Montgomery Block 5", COLOR_WHITE, 1281.293823, 305.315216, 19.554687+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Montgomery Block 10
- CreateDynamicPickup(1314, 23, 1272.095458, 309.294860, 19.554687, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Montgomery Block 6", COLOR_WHITE, 1272.095458, 309.294860, 19.554687+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- CreateDynamicPickup(1314, 23, 1309.502441, 381.615783, 19.562463, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Montgomery Block 7", COLOR_WHITE, 1309.502441, 381.615783, 19.562463+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Montgomery Block 15
- CreateDynamicPickup(1314, 23, 1323.619628, 375.249053, 19.562463, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Montgomery Block 8", COLOR_WHITE, 1323.619628, 375.249053, 19.562463+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Palomino Block 1
- CreateDynamicPickup(1314, 23, 2302.805664, -64.426986, 26.484375, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Palomino Block 1", COLOR_WHITE, 2302.805664, -64.426986, 26.484375+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Palomino Block 2
- CreateDynamicPickup(1314, 23, 2302.609619, -53.959472, 26.484375, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Palomino Block 2", COLOR_WHITE, 2302.609619, -53.959472, 26.484375+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Palomino Block 3
- CreateDynamicPickup(1314, 23, 2303.233398, -42.333538, 26.484375, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Palomino Block 3", COLOR_WHITE, 2303.233398, -42.333538, 26.484375+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Palomino Block 4
- CreateDynamicPickup(1314, 23, 2284.671386, 71.927307, 26.484375, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Palomino Block 4", COLOR_WHITE, 2284.671386, 71.927307, 26.484375+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Palomino Block 5
- CreateDynamicPickup(1314, 23, 2281.882080, 61.459354, 26.484375, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Palomino Block 5", COLOR_WHITE, 2281.882080, 61.459354, 26.484375+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Palomino Block 6
- CreateDynamicPickup(1314, 23, 2275.542968, 65.760444, 26.484375, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Palomino Block 6", COLOR_WHITE, 2275.542968, 65.760444, 26.484375+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Palomino Block 7
- CreateDynamicPickup(1314, 23, 2264.061523, 59.807678, 26.484375, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Palomino Block 7", COLOR_WHITE, 2264.061523, 59.807678, 26.484375+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Palomino Block 8
- CreateDynamicPickup(1314, 23, 2259.631591, 63.273849, 26.484375, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Palomino Block 8", COLOR_WHITE, 2259.631591, 63.273849, 26.484375+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Palomino Block 9
- CreateDynamicPickup(1314, 23, 2258.036376, 79.447029, 26.484375, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Palomino Block 9", COLOR_WHITE, 2258.036376, 79.447029, 26.484375+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Palomino Block 10
- CreateDynamicPickup(1314, 23, 2238.231933, 67.319778, 26.484375, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Palomino Block 10", COLOR_WHITE, 2238.231933, 67.319778, 26.484375+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Dillimore Block 1
- CreateDynamicPickup(1314, 23, 660.139831, -521.095031, 16.335937, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Dillimore Block 1", COLOR_WHITE, 660.139831, -521.095031, 16.335937+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Dillimore Block 2
- CreateDynamicPickup(1314, 23, 658.974426, -626.319641, 16.335937, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Dillimore Block 2", COLOR_WHITE, 658.974426, -626.319641, 16.335937+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Dillimore Block 3
- CreateDynamicPickup(1314, 23, 659.044860, -634.605712, 16.335937, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Dillimore Block 3", COLOR_WHITE, 659.044860, -634.605712, 16.335937+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Dillimore Block 4
- CreateDynamicPickup(1314, 23, 659.157104, -649.098327, 16.335937, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Dillimore Block 4", COLOR_WHITE, 659.157104, -649.098327, 16.335937+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Dillimore Block 5
- CreateDynamicPickup(1314, 23, 672.736328, -632.164062, 16.335937, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Dillimore Block 5", COLOR_WHITE, 672.736328, -632.164062, 16.335937+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Dillimore Block 6
- CreateDynamicPickup(1314, 23, 661.580749, -651.580078, 16.433948, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Dillimore Block 6", COLOR_WHITE, 661.580749, -651.580078, 16.433948+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Dillimore Block 7
- CreateDynamicPickup(1314, 23, 691.147338, -636.244934, 16.324340, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Dillimore Block 7", COLOR_WHITE, 691.147338, -636.244934, 16.324340+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Dillimore Block 8
- CreateDynamicPickup(1314, 23, 690.380676, -625.662719, 16.335937, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Dillimore Block 8", COLOR_WHITE, 690.380676, -625.662719, 16.335937+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Dillimore Block 9
- CreateDynamicPickup(1314, 23, 701.781188, -609.439697, 16.335937, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Dillimore Block 9", COLOR_WHITE, 701.781188, -609.439697, 16.335937+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Dillimore Block 10
- CreateDynamicPickup(1314, 23, 704.610168, -611.516906, 16.335937, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Dillimore Block 10", COLOR_WHITE, 704.610168, -611.516906, 16.335937+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Dillimore Block 11
- CreateDynamicPickup(1314, 23, 704.340576, -633.647766, 16.335937, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Dillimore Block 11", COLOR_WHITE, 704.340576, -633.647766, 16.335937+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- //FLAT Dillimore Block 12
- CreateDynamicPickup(1314, 23, 704.358337, -642.135253, 16.335937, 0, -1, -1, 20);
- CreateDynamic3DTextLabel("Dillimore Block 12", COLOR_WHITE, 704.358337, -642.135253, 16.335937+0.4, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20);
- /* for(new testdrug = 0; testdrug < sizeof(TestIngred); testdrug++)
- {
- new drugKrup = CreateDynamicObject(1279, TestIngred[testdrug][tePos][0], TestIngred[testdrug][tePos][1], TestIngred[testdrug][tePos][2], 0.0, 0.0, 0.0, 0, 0);
- SetDynamicObjectMaterial(drugKrup, 0, 1279, "craigpackage", "drugs");
- }*/
- //-- objects -------------------------------------------------------------------
- CreateAllObjects();
- //-- COLETE E VIDA TEXTDRAW -----------------------------------------------------------------
- /* Textdraw0 = TextDrawCreate(608.444946, 58.240032, "Coração");
- TextDrawAlignment(Textdraw0, 2);
- TextDrawBackgroundColor(Textdraw0, 0x00000000);
- TextDrawFont(Textdraw0, 5);
- TextDrawLetterSize(Textdraw0, 0.449999, 1.600000);
- TextDrawColor(Textdraw0, -1);
- TextDrawSetOutline(Textdraw0, 0);
- TextDrawSetProportional(Textdraw0, 1);
- TextDrawSetShadow(Textdraw0, 1);
- TextDrawUseBox(Textdraw0, 1);
- TextDrawBoxColor(Textdraw0, 0x00000000);
- TextDrawTextSize(Textdraw0, 20.444442, 22.897781);
- TextDrawSetPreviewModel(Textdraw0, 1240);
- TextDrawSetPreviewRot(Textdraw0, 0.000000, 0.000000, -10.000000, 1.000000);
- TextDrawSetSelectable(Textdraw0, 0);
- Textdraw1 = TextDrawCreate(604.556274, 35.346710, "Colete"); //colete
- TextDrawAlignment(Textdraw1, 2);
- TextDrawBackgroundColor(Textdraw1, 0x00000000);
- TextDrawFont(Textdraw1, 5);
- TextDrawLetterSize(Textdraw1, 0.449999, 1.600000);
- TextDrawColor(Textdraw1, -1);
- TextDrawSetOutline(Textdraw1, 0);
- TextDrawSetProportional(Textdraw1, 1);
- TextDrawSetShadow(Textdraw1, 1);
- TextDrawUseBox(Textdraw1, 1);
- TextDrawBoxColor(Textdraw1, 0x00000000);
- TextDrawTextSize(Textdraw1, 28.444637, 22.897750);
- TextDrawSetPreviewModel(Textdraw1, 19515);
- TextDrawSetPreviewRot(Textdraw1, 0.000000, -90.000000, 0.000000, 1.000000);*/
- //TextDrawSetSelectable(Textdraw1, 0);
- //-- menus/tds -----------------------------------------------------------------
- //-- teste mdc ----------------------------------------------------------------- AdminRequestTD
- //-- Lights 0.3dl -----------------------------------------------------------------
- //-- teste mdc -----------------------------------------------------------------
- AdminRequestTD = TextDrawCreate(472.444702, 39.822231, "0");
- TextDrawLetterSize(AdminRequestTD, 0.473555, 1.545244);
- TextDrawTextSize(AdminRequestTD, 3.555555, -12.444445);
- TextDrawAlignment(AdminRequestTD, 2);
- TextDrawColor(AdminRequestTD, 0xE9B704FF);
- TextDrawSetShadow(AdminRequestTD, 0);
- TextDrawSetOutline(AdminRequestTD, 0);
- TextDrawBackgroundColor(AdminRequestTD, 51);
- TextDrawFont(AdminRequestTD, 2);
- TextDrawSetProportional(AdminRequestTD, 1);
- AdminRequestTD3dl = TextDrawCreate(472.888793, 38.826675, "mdl-2000:AdminRequest");
- TextDrawLetterSize(AdminRequestTD3dl, 0.000000, 0.000000);
- TextDrawTextSize(AdminRequestTD3dl, 20.444458, 27.875549);
- TextDrawAlignment(AdminRequestTD3dl, 2);
- TextDrawColor(AdminRequestTD3dl, -1);
- TextDrawSetShadow(AdminRequestTD3dl, 0);
- TextDrawSetOutline(AdminRequestTD3dl, 0);
- TextDrawFont(AdminRequestTD3dl, 4);
- AssistTD = TextDrawCreate(472.444702, 39.822231, "0");
- TextDrawLetterSize(AssistTD, 0.473555, 1.545244);
- TextDrawTextSize(AssistTD, 3.555555, -12.444445);
- TextDrawAlignment(AssistTD, 2);
- TextDrawColor(AssistTD, 0xE9B704FF);
- TextDrawSetShadow(AssistTD, 0);
- TextDrawSetOutline(AssistTD, 0);
- TextDrawBackgroundColor(AssistTD, 51);
- TextDrawFont(AssistTD, 2);
- TextDrawSetProportional(AssistTD, 1);
- AssistTD3dl = TextDrawCreate(472.888793, 38.826675, "mdl-2000:Assistance");
- TextDrawLetterSize(AssistTD3dl, 0.000000, 0.000000);
- TextDrawTextSize(AssistTD3dl, 20.444458, 27.875549);
- TextDrawAlignment(AssistTD3dl, 2);
- TextDrawColor(AssistTD3dl, -1);
- TextDrawSetShadow(AssistTD3dl, 0);
- TextDrawSetOutline(AssistTD3dl, 0);
- TextDrawFont(AssistTD3dl, 4);
- txtAnimHelper = TextDrawCreate(431.0,370.0,"~b~~k~~PED_LOCK_TARGET~ ~w~para parar a anim");
- TextDrawAlignment(txtAnimHelper,0);
- TextDrawBackgroundColor(txtAnimHelper,0x000000FF);
- TextDrawFont(txtAnimHelper,2);
- TextDrawLetterSize(txtAnimHelper,0.299999,1.1);
- TextDrawColor(txtAnimHelper,COLOR_WHITE);
- TextDrawSetOutline(txtAnimHelper,1);
- TextDrawSetProportional(txtAnimHelper,1);
- TextDrawSetShadow(txtAnimHelper,1);
- TextdrawCount ++;
- WeedEffect = TextDrawCreate(0.0, 0.0, "_");
- TextDrawFont(WeedEffect, 1);
- TextDrawLetterSize(WeedEffect, 0.0, 50.0);
- TextDrawUseBox(WeedEffect, true);
- TextDrawColor(WeedEffect, 0);
- TextDrawBoxColor(WeedEffect, COLOR_LIGHTGREEN+50);
- TextdrawCount ++;
- Website = TextDrawCreate(36.0,429.0,"WWW.GREENSIDERP.COM.BR");
- TextDrawAlignment(Website,0);
- TextDrawBackgroundColor(Website,0x000000FF);
- TextDrawFont(Website,2);
- TextDrawLetterSize(Website,0.199999,1.0);
- TextDrawColor(Website, 0x999999FF);
- TextDrawSetOutline(Website,1);
- TextDrawSetProportional(Website,1);
- TextDrawSetShadow(Website,1);
- TextdrawCount ++;
- CCTV = TextDrawCreate(338.0,372.0,"~>~ SA-02 CCTV-NET ~r~LIVE");
- TextDrawAlignment(CCTV,0);
- TextDrawBackgroundColor(CCTV,0x000000ff);
- TextDrawFont(CCTV,2);
- TextDrawLetterSize(CCTV,0.499999,2.0);
- TextDrawColor(CCTV,COLOR_WHITE);
- TextDrawSetOutline(CCTV,1);
- TextDrawSetProportional(CCTV,1);
- TextDrawSetShadow(CCTV,1);
- TextdrawCount ++;
- VehicleEngineText = TextDrawCreate(318.500000, 420.000000,"~w~Use ~g~/motor~w~ ou pressione ~g~~k~~VEHICLE_HANDBRAKE~~w~ para ligar o veiculo.");//aqui
- TextDrawLetterSize(VehicleEngineText, 0.260000, 1.000625);
- TextDrawAlignment(VehicleEngineText, 2);
- TextDrawBackgroundColor(VehicleEngineText,0x000000FF);
- TextDrawFont(VehicleEngineText,1);
- //TextDrawLetterSize(VehicleEngineText,0.199999,1.1);
- TextDrawColor(VehicleEngineText,0xFFFFFF);
- TextDrawSetOutline(VehicleEngineText,1);
- TextDrawSetProportional(VehicleEngineText,1);
- TextDrawSetShadow(VehicleEngineText,1);
- TextdrawCount ++;
- EngineOilTextY = TextDrawCreate(521.0, 381.0, "~y~OLEO DE MOTOR");
- TextDrawAlignment(EngineOilTextY, 0);
- TextDrawBackgroundColor(EngineOilTextY, 0x000000FF);
- TextDrawFont(EngineOilTextY, 2);
- TextDrawLetterSize(EngineOilTextY, 0.399999, 2.0);
- TextDrawColor(EngineOilTextY, COLOR_WHITE);
- TextDrawSetProportional(EngineOilTextY, 1);
- TextDrawSetShadow(EngineOilTextY, 0);
- TextdrawCount ++;
- EngineOilTextR = TextDrawCreate(521.0, 381.0, "~r~OLEO DE MOTOR");
- TextDrawAlignment(EngineOilTextR, 0);
- TextDrawBackgroundColor(EngineOilTextR, 0x000000FF);
- TextDrawFont(EngineOilTextR, 2);
- TextDrawLetterSize(EngineOilTextR, 0.399999, 2.0);
- TextDrawColor(EngineOilTextR, COLOR_WHITE);
- TextDrawSetProportional(EngineOilTextR, 1);
- TextDrawSetShadow(EngineOilTextR, 0);
- TextdrawCount ++;
- //Milhas
- texmilhas3dl = TextDrawCreate(559.000000, 303.187500, "mdl-2000:Mileage");
- TextDrawLetterSize(texmilhas3dl, 0.000000, 0.000000);
- TextDrawTextSize(texmilhas3dl, 78.000000, 85.750000);
- TextDrawAlignment(texmilhas3dl, 1);
- TextDrawColor(texmilhas3dl, -1);
- TextDrawSetShadow(texmilhas3dl, 0);
- TextDrawSetOutline(texmilhas3dl, 0);
- TextDrawFont(texmilhas3dl, 4);
-
- luzesTxD3dl = TextDrawCreate(506.666809, 377.315521, "mdl-2000:Lights");
- TextDrawLetterSize(luzesTxD3dl, 0.000000, 0.000000);
- TextDrawTextSize(luzesTxD3dl, 16.000030, 15.431106);
- TextDrawAlignment(luzesTxD3dl, 1);
- TextDrawColor(luzesTxD3dl, -1);
- TextDrawSetShadow(luzesTxD3dl, 0);
- TextDrawSetOutline(luzesTxD3dl, 0);
- TextDrawFont(luzesTxD3dl, 4);
- unlockedTxD3dl = TextDrawCreate(521.500000, 362.250000, "mdl-2000:Locks-Unlocked"); //fechadura aberta
- TextDrawLetterSize(unlockedTxD3dl, 0.000000, 0.000000);
- TextDrawTextSize(unlockedTxD3dl, 15.500000, 13.125000);
- TextDrawAlignment(unlockedTxD3dl, 2);
- TextDrawColor(unlockedTxD3dl, -1);
- TextDrawSetShadow(unlockedTxD3dl, 0);
- TextDrawSetOutline(unlockedTxD3dl, 0);
- TextDrawFont(unlockedTxD3dl, 4);
- lockedTxD3dl = TextDrawCreate(521.500000, 362.250000, "mdl-2000:Locks-Locked");
- TextDrawLetterSize(lockedTxD3dl, 0.000000, 0.000000);
- TextDrawTextSize(lockedTxD3dl, 15.500000, 13.125000);
- TextDrawAlignment(lockedTxD3dl, 2);
- TextDrawColor(lockedTxD3dl, -1);
- TextDrawSetShadow(lockedTxD3dl, 0);
- TextDrawSetOutline(lockedTxD3dl, 0);
- TextDrawFont(lockedTxD3dl, 4);
-
- texmilhas3dl1 = TextDrawCreate(597.333557, 334.008850, "MILHAS");
- TextDrawLetterSize(texmilhas3dl1, 0.200666, 0.967821);
- TextDrawAlignment(texmilhas3dl1, 2);
- TextDrawColor(texmilhas3dl1, -1);
- TextDrawSetShadow(texmilhas3dl1, 0);
- TextDrawSetOutline(texmilhas3dl1, 1);
- TextDrawBackgroundColor(texmilhas3dl1, 51);
- TextDrawFont(texmilhas3dl1, 1);
- TextDrawSetProportional(texmilhas3dl1, 1);
-
- //Global
- fuel3dl = TextDrawCreate(573.000000, 364.000000, "mdl-2000:Fuel-0");
- TextDrawLetterSize(fuel3dl, 0.000000, 0.000000);
- TextDrawTextSize(fuel3dl, 76.500000, 73.062500);
- TextDrawAlignment(fuel3dl, 1);
- TextDrawColor(fuel3dl, -1);
- TextDrawSetShadow(fuel3dl, 0);
- TextDrawSetOutline(fuel3dl, 0);
- TextDrawFont(fuel3dl, 4);
- fuel3dl12 = TextDrawCreate(573.000000, 364.000000, "mdl-2000:Fuel-12");
- TextDrawLetterSize(fuel3dl12, 0.000000, 0.000000);
- TextDrawTextSize(fuel3dl12, 76.500000, 73.062500);
- TextDrawAlignment(fuel3dl12, 1);
- TextDrawColor(fuel3dl12, -1);
- TextDrawSetShadow(fuel3dl12, 0);
- TextDrawSetOutline(fuel3dl12, 0);
- TextDrawFont(fuel3dl12, 4);
- fuel3dl25 = TextDrawCreate(573.000000, 364.000000, "mdl-2000:Fuel-25");
- TextDrawLetterSize(fuel3dl25, 0.000000, 0.000000);
- TextDrawTextSize(fuel3dl25, 76.500000, 73.062500);
- TextDrawAlignment(fuel3dl25, 1);
- TextDrawColor(fuel3dl25, -1);
- TextDrawSetShadow(fuel3dl25, 0);
- TextDrawSetOutline(fuel3dl25, 0);
- TextDrawFont(fuel3dl25, 4);
- fuel3dl37 = TextDrawCreate(573.000000, 364.000000, "mdl-2000:Fuel-37");
- TextDrawLetterSize(fuel3dl37, 0.000000, 0.000000);
- TextDrawTextSize(fuel3dl37, 76.500000, 73.062500);
- TextDrawAlignment(fuel3dl37, 1);
- TextDrawColor(fuel3dl37, -1);
- TextDrawSetShadow(fuel3dl37, 0);
- TextDrawSetOutline(fuel3dl37, 0);
- TextDrawFont(fuel3dl37, 4);
- fuel3dl50 = TextDrawCreate(573.000000, 364.000000, "mdl-2000:Fuel-50");
- TextDrawLetterSize(fuel3dl50, 0.000000, 0.000000);
- TextDrawTextSize(fuel3dl50, 76.500000, 73.062500);
- TextDrawAlignment(fuel3dl50, 1);
- TextDrawColor(fuel3dl50, -1);
- TextDrawSetShadow(fuel3dl50, 0);
- TextDrawSetOutline(fuel3dl50, 0);
- TextDrawFont(fuel3dl50, 4);
- fuel3dl65 = TextDrawCreate(573.000000, 364.000000, "mdl-2000:Fuel-65");
- TextDrawLetterSize(fuel3dl65, 0.000000, 0.000000);
- TextDrawTextSize(fuel3dl65, 76.500000, 73.062500);
- TextDrawAlignment(fuel3dl65, 1);
- TextDrawColor(fuel3dl65, -1);
- TextDrawSetShadow(fuel3dl65, 0);
- TextDrawSetOutline(fuel3dl65, 0);
- TextDrawFont(fuel3dl65, 4);
- fuel3dl75 = TextDrawCreate(573.000000, 364.000000, "mdl-2000:Fuel-75");
- TextDrawLetterSize(fuel3dl75, 0.000000, 0.000000);
- TextDrawTextSize(fuel3dl75, 76.500000, 73.062500);
- TextDrawAlignment(fuel3dl75, 1);
- TextDrawColor(fuel3dl75, -1);
- TextDrawSetShadow(fuel3dl75, 0);
- TextDrawSetOutline(fuel3dl75, 0);
- TextDrawFont(fuel3dl75, 4);
- fuel3dl87 = TextDrawCreate(573.000000, 364.000000, "mdl-2000:Fuel-87");
- TextDrawLetterSize(fuel3dl87, 0.000000, 0.000000);
- TextDrawTextSize(fuel3dl87, 76.500000, 73.062500);
- TextDrawAlignment(fuel3dl87, 1);
- TextDrawColor(fuel3dl87, -1);
- TextDrawSetShadow(fuel3dl87, 0);
- TextDrawSetOutline(fuel3dl87, 0);
- TextDrawFont(fuel3dl87, 4);
- fuel3dl100 = TextDrawCreate(573.000000, 364.000000, "mdl-2000:Fuel-100");
- TextDrawLetterSize(fuel3dl100, 0.000000, 0.000000);
- TextDrawTextSize(fuel3dl100, 76.500000, 73.062500);
- TextDrawAlignment(fuel3dl100, 1);
- TextDrawColor(fuel3dl100, -1);
- TextDrawSetShadow(fuel3dl100, 0);
- TextDrawSetOutline(fuel3dl100, 0);
- TextDrawFont(fuel3dl100, 4);
- LowFuelText = TextDrawCreate(521.0, 368.0, "~r~GAL");
- TextDrawAlignment(LowFuelText, 0);
- TextDrawBackgroundColor(LowFuelText, 0x000000FF);
- TextDrawFont(LowFuelText, 2);
- TextDrawLetterSize(LowFuelText, 0.399999, 2.0);
- TextDrawColor(LowFuelText, COLOR_WHITE);
- TextDrawSetProportional(LowFuelText, 1);
- TextDrawSetShadow(LowFuelText, 0);
- TextdrawCount ++;
- URAFK3 = TextDrawCreate(320.000000, 320.000000, "AFK~N~~N~");
- TextDrawAlignment(URAFK3, 2);
- TextDrawBackgroundColor(URAFK3, 255);
- TextDrawFont(URAFK3, 1);
- TextDrawLetterSize(URAFK3, 0.340000, 1.399999);
- TextDrawColor(URAFK3, -1);
- TextDrawSetOutline(URAFK3, 0);
- TextDrawSetProportional(URAFK3, 1);
- TextDrawSetShadow(URAFK3, 1);
- TextDrawUseBox(URAFK3, 1);
- TextDrawBoxColor(URAFK3, 1768516095);
- TextDrawTextSize(URAFK3, 0.000000, 118.000000);
- TextdrawCount ++;
- URAFK2 = TextDrawCreate(320.000000, 336.000000, "ESCREVA ~Y~/VOLTAR~W~ PARA VOLTAR");
- TextDrawAlignment(URAFK2, 2);
- TextDrawBackgroundColor(URAFK2, 255);
- TextDrawFont(URAFK2, 1);
- TextDrawLetterSize(URAFK2, 0.340000, 1.399999);
- TextDrawColor(URAFK2, -1);
- TextDrawSetOutline(URAFK2, 0);
- TextDrawSetProportional(URAFK2, 1);
- TextDrawSetShadow(URAFK2, 1);
- TextDrawUseBox(URAFK2, 1);
- TextDrawBoxColor(URAFK2, 255);
- TextDrawTextSize(URAFK2, 0.000000, 118.000000);
- TextdrawCount ++;
- TimeText = TextDrawCreate(504.095275, 3.546700, "00:00:00");
- TextDrawAlignment(TimeText, 2);
- TextDrawBackgroundColor(TimeText, 0x000000FF);
- TextDrawFont(TimeText, 2);
- TextDrawLetterSize(TimeText, 0.319999, 1.100000);
- TextDrawColor(TimeText, 0xFFFFFFFF);
- TextDrawSetOutline(TimeText, 2);
- TextDrawSetProportional(TimeText, 1);
- TimeText24 = TextDrawCreate(504.095275, 3.546700, "00:00:00");
- TextDrawAlignment(TimeText24, 2);
- TextDrawBackgroundColor(TimeText24, 0x000000FF);
- TextDrawFont(TimeText24, 2);
- TextDrawLetterSize(TimeText24, 0.319999, 1.100000);
- TextDrawColor(TimeText24, 0xFFFFFFFF);
- TextDrawSetOutline(TimeText24, 2);
- TextDrawSetProportional(TimeText24, 1);
- CharSelBackground = TextDrawCreate(157.500000, 0.437500, "mdl-2001:overlay");
- TextDrawLetterSize(CharSelBackground, 0.000000, 0.000000);
- TextDrawTextSize(CharSelBackground, 319.000000, 295.750000);
- TextDrawAlignment(CharSelBackground, 1);
- TextDrawColor(CharSelBackground, -1);
- TextDrawSetShadow(CharSelBackground, 0);
- TextDrawSetOutline(CharSelBackground, 0);
- TextDrawFont(CharSelBackground, 4);
- CharSelHeader = TextDrawCreate(320.000000, 94.592613, "~n~");
- TextDrawLetterSize(CharSelHeader, 0.400000, 1.600000);
- TextDrawTextSize(CharSelHeader, 0.000000, 222.000000);
- TextDrawAlignment(CharSelHeader, 2);
- TextDrawColor(CharSelHeader, -1);
- TextDrawUseBox(CharSelHeader, 1);
- TextDrawBoxColor(CharSelHeader, 255);
- TextDrawSetShadow(CharSelHeader, 0);
- TextDrawSetOutline(CharSelHeader, 0);
- TextDrawBackgroundColor(CharSelHeader, 255);
- TextDrawFont(CharSelHeader, 1);
- TextDrawSetProportional(CharSelHeader, 1);
- TextDrawSetShadow(CharSelHeader, 0);
- CharSelX = TextDrawCreate(396.888885, 260.337829, "mdl-2002:logout");
- TextDrawLetterSize(CharSelX, 0.000000, 0.000000);
- TextDrawTextSize(CharSelX, 36.444458, 15.431110);
- TextDrawAlignment(CharSelX, 1);
- TextDrawColor(CharSelX, -1);
- TextDrawSetShadow(CharSelX, 0);
- TextDrawSetOutline(CharSelX, 0);
- TextDrawFont(CharSelX, 4);
- TextDrawSetSelectable(CharSelX, true);
- backgoundvcar12 = TextDrawCreate(143.000000, 103.250000, "mdl-2005:vmenu2");
- TextDrawLetterSize(backgoundvcar12, 0.021500, 0.262499);
- TextDrawTextSize(backgoundvcar12, 356.000000, 227.937500);
- TextDrawAlignment(backgoundvcar12, 2);
- TextDrawColor(backgoundvcar12, -1);
- TextDrawUseBox(backgoundvcar12, true);
- TextDrawBoxColor(backgoundvcar12, 0);
- TextDrawSetShadow(backgoundvcar12, 0);
- TextDrawSetOutline(backgoundvcar12, 0);
- TextDrawFont(backgoundvcar12, 4);
-
- /*
- backgoundvcar12 = TextDrawCreate(181.000000, 89.250000, "Meus veiculos");
- TextDrawLetterSize(backgoundvcar12, 0.322499, 1.586874);
- TextDrawAlignment(backgoundvcar12, 1);
- TextDrawColor(backgoundvcar12, -1);
- TextDrawSetShadow(backgoundvcar12, 0);
- TextDrawSetOutline(backgoundvcar12, 1);
- TextDrawBackgroundColor(backgoundvcar12, 51);
- TextDrawFont(backgoundvcar12, 2);
- TextDrawSetProportional(backgoundvcar12, 1);
- */
- DrugCombine[0] = TextDrawCreate(320.333251, 307.807800, "box"); //drug comment
- TextDrawLetterSize(DrugCombine[0], 0.000000, 8.499990);
- TextDrawTextSize(DrugCombine[0], 0.000000, 162.666839);
- TextDrawAlignment(DrugCombine[0], 2);
- TextDrawColor(DrugCombine[0], -1);
- TextDrawUseBox(DrugCombine[0], 1);
- TextDrawBoxColor(DrugCombine[0], -1061109505);
- TextDrawSetShadow(DrugCombine[0], 0);
- TextDrawSetOutline(DrugCombine[0], 0);
- TextDrawBackgroundColor(DrugCombine[0], 255);
- TextDrawFont(DrugCombine[0], 1);
- TextDrawSetProportional(DrugCombine[0], 1);
- TextDrawSetShadow(DrugCombine[0], 0);
- DrugCombine[1] = TextDrawCreate(242.000106, 316.103759, "box");
- TextDrawLetterSize(DrugCombine[1], 0.000000, 4.899991);
- TextDrawTextSize(DrugCombine[1], 276.666168, 0.000000);
- TextDrawAlignment(DrugCombine[1], 1);
- TextDrawColor(DrugCombine[1], -1);
- TextDrawUseBox(DrugCombine[1], 1);
- TextDrawBoxColor(DrugCombine[1], -2139062017);
- TextDrawSetShadow(DrugCombine[1], 0);
- TextDrawSetOutline(DrugCombine[1], 0);
- TextDrawBackgroundColor(DrugCombine[1], 255);
- TextDrawFont(DrugCombine[1], 3);
- TextDrawSetProportional(DrugCombine[1], 1);
- TextDrawSetShadow(DrugCombine[1], 0);
- DrugCombine[2] = TextDrawCreate(282.333282, 316.103698, "box");
- TextDrawLetterSize(DrugCombine[2], 0.000000, 4.899991);
- TextDrawTextSize(DrugCombine[2], 316.999481, 0.000000);
- TextDrawAlignment(DrugCombine[2], 1);
- TextDrawColor(DrugCombine[2], -1);
- TextDrawUseBox(DrugCombine[2], 1);
- TextDrawBoxColor(DrugCombine[2], -2139062017);
- TextDrawSetShadow(DrugCombine[2], 0);
- TextDrawSetOutline(DrugCombine[2], 0);
- TextDrawBackgroundColor(DrugCombine[2], 255);
- TextDrawFont(DrugCombine[2], 3);
- TextDrawSetProportional(DrugCombine[2], 1);
- TextDrawSetShadow(DrugCombine[2], 0);
- DrugCombine[3] = TextDrawCreate(322.999969, 316.103668, "box");
- TextDrawLetterSize(DrugCombine[3], 0.000000, 4.899991);
- TextDrawTextSize(DrugCombine[3], 357.666168, 0.000000);
- TextDrawAlignment(DrugCombine[3], 1);
- TextDrawColor(DrugCombine[3], -1);
- TextDrawUseBox(DrugCombine[3], 1);
- TextDrawBoxColor(DrugCombine[3], -2139062017);
- TextDrawSetShadow(DrugCombine[3], 0);
- TextDrawSetOutline(DrugCombine[3], 0);
- TextDrawBackgroundColor(DrugCombine[3], 255);
- TextDrawFont(DrugCombine[3], 3);
- TextDrawSetProportional(DrugCombine[3], 1);
- TextDrawSetShadow(DrugCombine[3], 0);
- DrugCombine[4] = TextDrawCreate(363.666778, 316.103729, "box");
- TextDrawLetterSize(DrugCombine[4], 0.000000, 4.899991);
- TextDrawTextSize(DrugCombine[4], 398.332977, 0.000000);
- TextDrawAlignment(DrugCombine[4], 1);
- TextDrawColor(DrugCombine[4], -1);
- TextDrawUseBox(DrugCombine[4], 1);
- TextDrawBoxColor(DrugCombine[4], -2139062017);
- TextDrawSetShadow(DrugCombine[4], 0);
- TextDrawSetOutline(DrugCombine[4], 0);
- TextDrawBackgroundColor(DrugCombine[4], 255);
- TextDrawFont(DrugCombine[4], 3);
- TextDrawSetProportional(DrugCombine[4], 1);
- TextDrawSetShadow(DrugCombine[4], 0);
- DrugCombine[5] = TextDrawCreate(350.000152, 374.592742, "combina");
- TextDrawLetterSize(DrugCombine[5], 0.190666, 1.040001);
- TextDrawTextSize(DrugCombine[5], 377.333190, 10.000000);
- TextDrawAlignment(DrugCombine[5], 1);
- TextDrawColor(DrugCombine[5], -1);
- TextDrawUseBox(DrugCombine[5], 1);
- TextDrawBoxColor(DrugCombine[5], -256);
- TextDrawSetShadow(DrugCombine[5], 0);
- TextDrawSetOutline(DrugCombine[5], 1);
- TextDrawBackgroundColor(DrugCombine[5], -2139062017);
- TextDrawFont(DrugCombine[5], 1);
- TextDrawSetProportional(DrugCombine[5], 1);
- TextDrawSetShadow(DrugCombine[5], 0);
- TextDrawSetSelectable(DrugCombine[5], true);
- DrugCombine[6] = TextDrawCreate(380.333526, 374.592742, "Cancelar");
- TextDrawLetterSize(DrugCombine[6], 0.190666, 1.040001);
- TextDrawTextSize(DrugCombine[6], 400.666687, 10.000000);
- TextDrawAlignment(DrugCombine[6], 1);
- TextDrawColor(DrugCombine[6], -1);
- TextDrawUseBox(DrugCombine[6], 1);
- TextDrawBoxColor(DrugCombine[6], -256);
- TextDrawSetShadow(DrugCombine[6], 0);
- TextDrawSetOutline(DrugCombine[6], 1);
- TextDrawBackgroundColor(DrugCombine[6], -2139062017);
- TextDrawFont(DrugCombine[6], 1);
- TextDrawSetProportional(DrugCombine[6], 1);
- TextDrawSetShadow(DrugCombine[6], 0);
- TextDrawSetSelectable(DrugCombine[6], true);
- DrugCombine[7] = TextDrawCreate(240.667160, 367.955596, "remove");
- TextDrawLetterSize(DrugCombine[7], 0.171998, 0.865781);
- TextDrawTextSize(DrugCombine[7], 263.999694, 10.000000);
- TextDrawAlignment(DrugCombine[7], 1);
- TextDrawColor(DrugCombine[7], -16776961);
- TextDrawUseBox(DrugCombine[7], 1);
- TextDrawBoxColor(DrugCombine[7], -256);
- TextDrawSetShadow(DrugCombine[7], 0);
- TextDrawSetOutline(DrugCombine[7], 0);
- TextDrawBackgroundColor(DrugCombine[7], -2139062017);
- TextDrawFont(DrugCombine[7], 1);
- TextDrawSetProportional(DrugCombine[7], 1);
- TextDrawSetShadow(DrugCombine[7], 0);
- TextDrawSetSelectable(DrugCombine[7], true);
- NewDrugTD[0] = TextDrawCreate(261.333435, 130.525848, "");
- TextDrawLetterSize(NewDrugTD[0], 0.000000, 0.000000);
- TextDrawTextSize(NewDrugTD[0], 125.000007, 123.185241);
- TextDrawAlignment(NewDrugTD[0], 1);
- TextDrawColor(NewDrugTD[0], -1);
- TextDrawSetShadow(NewDrugTD[0], 0);
- TextDrawSetOutline(NewDrugTD[0], 0);
- TextDrawBackgroundColor(NewDrugTD[0], -256);
- TextDrawFont(NewDrugTD[0], 5);
- TextDrawSetProportional(NewDrugTD[0], 0);
- TextDrawSetShadow(NewDrugTD[0], 0);
- TextDrawSetPreviewModel(NewDrugTD[0], 1279);
- TextDrawSetPreviewRot(NewDrugTD[0], 90.000000, 30.000000, 80.000000, 1.000000);
- NewDrugTD[1] = TextDrawCreate(251.000076, 250.562957, "New_Drug_Created!");
- TextDrawLetterSize(NewDrugTD[1], 0.431333, 2.155851);
- TextDrawAlignment(NewDrugTD[1], 1);
- TextDrawColor(NewDrugTD[1], -16776961);
- TextDrawSetShadow(NewDrugTD[1], 0);
- TextDrawSetOutline(NewDrugTD[1], 1);
- TextDrawBackgroundColor(NewDrugTD[1], -65281);
- TextDrawFont(NewDrugTD[1], 1);
- TextDrawSetProportional(NewDrugTD[1], 1);
- TextDrawSetShadow(NewDrugTD[1], 0);
- NewDrugTD[2] = TextDrawCreate(323.666900, 303.659362, "NAME DRUG");
- TextDrawLetterSize(NewDrugTD[2], 0.317666, 1.396741);
- TextDrawTextSize(NewDrugTD[2], 10.000000, 66.333496);
- TextDrawAlignment(NewDrugTD[2], 2);
- TextDrawColor(NewDrugTD[2], -1);
- TextDrawUseBox(NewDrugTD[2], 1);
- TextDrawBoxColor(NewDrugTD[2], -2139094785);
- TextDrawSetShadow(NewDrugTD[2], 0);
- TextDrawSetOutline(NewDrugTD[2], 0);
- TextDrawBackgroundColor(NewDrugTD[2], 8388863);
- TextDrawFont(NewDrugTD[2], 1);
- TextDrawSetProportional(NewDrugTD[2], 1);
- TextDrawSetShadow(NewDrugTD[2], 0);
- TextDrawSetSelectable(NewDrugTD[2], true);
- FadeInit();
- //-- vehicles ------------------------------------------------------------------
- for(new veh = 0; veh < MAX_VEHICLES; veh++)
- {
- CarColor[veh][0] = -1;
- CarColor[veh][1] = -1;
- MechanicSpray[veh][0] = -1;
- MechanicSpray[veh][1] = -1;
- MechanicSpray[veh][2] = -1;
- MechanicSpray[veh][3] = -1;
- MechanicSpray[veh][4] = -1;
- MechanicSpray[veh][5] = -1;
- DMVCarForPlayer[veh] = -1;
- VehicleCanBurn[veh] = 1;
- VehicleOnFire[veh] = 0;
- VehicleBurning[veh] = 0;
- }
- // Special Vehicles (Not Hotwirable)
- PizzaCar1 = CreateVehicleEx(496, 1390.6216, 262.6668, 19.2834, 336.9905, 3, 3, -1, "{FF0000}PIZZA1"); //PizzaCar1
- PizzaCar2 = CreateVehicleEx(496, 1385.1868, 265.2423, 19.2832, 335.8766, 3, 3, -1, "{FF0000}PIZZA2"); //PizzaCar2
- CreateVehicleEx(574, 2252.518554, 27.114748, 26.159330, 270.0, 102, 102, 20, "{996E00}SW33PER1"); //varrerer1
- CreateVehicleEx(574, 2252.512451, 30.788240, 26.136905, 270.0, 102, 102, 20, "{996E00}SW33PER2"); //varrerer2
- CreateVehicleEx(574, 2258.506835, 20.961145, 26.196886, 0.0, 102, 102, 20, "{996E00}SW33PER3"); //varrerer3
- CreateVehicleEx(515, 45.322292, -242.536926, 2.680404, 266.291168, 4, 1, 20); //Roadtrain
- CreateVehicleEx(515, 65.586135, -287.186706, 2.605035, 358.458251, 3, 1, 20); //Roadtrain
- CreateVehicleEx(515, 51.289276, -287.533233, 2.737875, 359.720245, 2, 1, 20); //Roadtrain
- CreateVehicleEx(403, 41.940898, -232.038772, 2.351497, 265.266510, 23, 23, 20); //Linerunner
- CreateVehicleEx(403, 42.384799, -225.604553, 2.341624, 266.042144, 23, 23, 20); //Linerunner
- CreateVehicleEx(514, 38.054271, -266.387237, 2.609447, 267.130615, 3, 3, 20); //Tanker
- CreateVehicleEx(514, 39.510311, -286.409637, 2.594405, 357.244964, 3, 3, 20); //Tanker
- CreateVehicleEx(408, 571.680358, 1216.474975, 12.391812, 209.0, 1, 1, 100, "{008394}LIXO 01"); //Trashmaster1
- CreateVehicleEx(408, 578.395263, 1220.235229, 12.253982, 209.0, 1, 1, 100, "{008394}LIXO 02"); //Trashmaster2
- CreateVehicleEx(408, 634.976623, 1252.676513, 12.199042, 300.0, 1, 1, 100, "{008394}LIXO 03"); //Trashmaster3
- CreateVehicleEx(408, 643.058532, 1239.184570, 12.216603, 300.0, 1, 1, 100, "{008394}LIXO 04"); //Trashmaster4
- CreateVehicleEx(453, 2103.8679, -96.9994, -0.4970, 118.2197, 1, 44, 600); //fishing reefer
- CreateVehicleEx(431, -23.441627, -275.447998, 5.529605, 180.164245, 3, 3, 600, "{FF4753}RCTD 001"); //BUS
- CreateVehicleEx(431, -14.637551, -275.127471, 5.563007, 180.496047, 3, 3, 600, "{FF4753}RCTD 002"); //BUS
- CreateVehicleEx(431, -1.539054, -308.217285, 5.539243, 89.906303, 3, 3, 600, "{FF4753}RCTD 003"); //BUS
- CreateVehicleEx(431, -1.587603, -315.311004, 5.561745, 89.752250, 3, 3, 600, "{FF4753}RCTD 004"); //BUS
- CreateVehicleEx(431, -1.800466, -301.156616, 5.543132, 89.405654, 3, 3, 600, "{FF4753}RCTD 005"); //BUS
- CreateVehicleEx(431, -40.566806, -324.072509, 5.563117, 351.046508, 3, 3, 600, "{FF4753}RCTD 006"); //BUS
- CreateVehicleEx(431, -45.693813, -329.358642, 5.563011, 349.831909, 3, 3, 600, "{FF4753}RCTD 007"); //BUS
- CreateVehicleEx(431, -51.079605, -334.719543, 5.562957, 350.442687, 3, 3, 600, "{FF4753}RCTD 008"); //BUS
- Dumper1 = CreateVehicleEx(406, 835.160766, 871.876892, 14.709035, 200.0, 1, 1, 15); //Dumper - CoalMining
- Dumper2 = CreateVehicleEx(406, 845.427246, 877.530944, 14.877398, 200.0, 1, 1, 15); //Dumper - CoalMining
- MaintTruck1 = CreateVehicleEx(552, 2263.511962, 22.578454, 26.153631, 0.0, 89, 79, 300); //LitterVeh1
- MaintTruck2 = CreateVehicleEx(552, 2231.674316, 29.528244, 26.155784, 0.0, 89, 79, 300); //LitterVeh2
- for(new v = GetVehiclePoolSize(); v != 0; v--)
- {
- Fuel[v] = random(50) + 50;
- EngineStatus[v] = 0;
- VehicleLights[v] = 0;
- VehicleBoots[v][0] = 0;
- VehicleBoots[v][1] = 0;
- VehicleBroke[v] = 0;
- FuelTypeAfterRefuel[v] = 0;
- if(!VehicleHasWindows(v)) WindowState{v} = WINDOWS_OPEN;
- else WindowState{v} = WINDOWS_CLOSED;
- if(!VehicleHasEngine(v))
- {
- EngineStatus[v] = 1;
- Fuel[v] = 100;
- ToggleVehicleEngine(v, 1);
- }
- }
- new cellinfo[20];
- for(new x = 0; x < MAX_TEMPOBJECTS; x++)
- {
- TempObjects[x][ObjectID] = INVALID_OBJECT_ID;
- if(x < 16)
- {
- PrisonCellsLock[x] = 0;
- format(cellinfo, sizeof(cellinfo), "Cell %i\nUnlocked", x+1);
- PrisonCellsText[x] = CreateDynamic3DTextLabel(cellinfo, COLOR_WHITE, PrisonCellsOut[x][0], PrisonCellsOut[x][1], PrisonCellsOut[x][2], 5.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 6164, 6, -1, 5);
- }
- if(x < 13)
- {
- PrisonDoorsLock[x] = 1;
- }
- }
- reefer[ReeferID()] = CreateDynamic3DTextLabel("Fishing Reefer", COLOR_YELLOW, 0.0, 0.0, 0.0, 20.0, INVALID_PLAYER_ID, ReeferID(), 1, -1, -1, -1, 20);
- SetTimerEx("ConnectTrainBot", 3000, 0, "");
- print("\n");
- printf("Hora: %s", GetServerTimeString());
- printf("Data: %s", GetDateString());
- printf("Veiculos Fac: %i/%i", GetVehiclePoolSize() - MAX_SERVER_CARS, MAX_VEHICLES);
- printf("Textdraw Count: %i", TextdrawCount);
- printf("Veiculos: %i/%i", GetVehiclePoolSize(), MAX_VEHICLES);
- printf("Veiculos de Player: %i/%i", TotalOwnedVehicles, MAX_BUYVEHS);
- printf("Objetos normais: %i/%i", GetObjectCount(), MAX_OBJECTS);
- printf("Streamed Objects: %i", CountDynamicObjects());
- printf("Streamed Map Icons: %i", CountDynamicMapIcons());
- printf("Streamed 3D Labels: %i", CountDynamic3DTextLabels());
- #if MYSQL_DEBUG_MODE == true
- mysql_log(LOG_ERROR | LOG_WARNING);
- print(" MySQL debugging is enabled.");
- #else
- mysql_log(LOG_NONE);
- print(" MySQL debugging is disabled.");
- #endif
- printf("\n serve carregado em %i milliseconds.", GetTickCount() - InitialTicks);
- print("----------------------------------------------------------------------------");
- return true;
- }
- public OnGameModeExit()
- {
- printf("\n\n > Game Mode Exit Has Been Called [%s]", GetTimeStringAndSec());
- new i;
- FadeExit();
- foreach(new k: Player)
- {
- if(Logged{k} && MasterAccountLogged{k})
- {
- SetPlayerName(k, MasterAccountName[k]);
- }
- KillTimer(FuelFillingTimer[k]);
- }
- for(i = 0; i < MAX_FIRES; i++)
- {
- RemoveFire(i);
- }
- for(i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- TextDrawDestroy(DigiHP[i]);
- TextDrawDestroy(DigiAP[i]);
- }
- }
- mysql_pquery(conn, "UPDATE players SET `Online` = 0");
- TextDrawDestroy(txtAnimHelper);
- TextDrawDestroy(WeedEffect);
- TextDrawDestroy(Website);
- TextDrawDestroy(CCTV);
- TextDrawDestroy(VehicleEngineText);
- KillTimer(OneSecondTimer);
- KillTimer(QuickCountTimer);
- mysql_close();
- print("Mysql desconectado, o servidor caiu.");
- return true;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- return true;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- if(!IsPlayerNPC(playerid) && SQLID[playerid] != 0 && !Logged{playerid})
- {
- SysMsg(playerid, "Please login and then spawn (/login).");
- KickPlayer(playerid, 0);
- return false;
- }
- return true;
- }
- public OnPlayerConnect(playerid)
- {
- //SA Trading REMOVE
- if(playerid > MAX_PLAYERS)
- {
- SysMsg(playerid, "Oops! A System Error has occurred, please report to an Admin. (ERROR: playerid exceeds MAX_PLAYERS)");
- KickPlayer(playerid, 1);
- return true;
- }
- CreatePTextdraws(playerid);
- NameTag[playerid] = CreateDynamic3DTextLabel("Loading", 0xFFFFFFFF, 0.0, 0.0, 0.10, NAMETAG_DISTANCE, .attachedplayer = playerid, .testlos = 1);
- ResetPlayerVariables(playerid);
- MasterAccount[playerid] = 0;
- MasterAccountLogged{playerid} = false;
- MasterAccountName[playerid][0] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,Password,State FROM masters WHERE Username = '%e'", GetName(playerid));
- mysql_pquery(conn, mquery, "CheckMAState", "d", playerid);
- return true;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(Logged{playerid})
- {
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO connections (MasterAccount, IP, Timestamp, Type, Serial) VALUES (%i, '%e', %i, 1, '%e')", MasterAccount[playerid], PlayerIP[playerid], gettime(), PlayerSerial[playerid]);
- mysql_pquery(conn, mquery);
- }
- PlayerIP[playerid][0] = 0;
- PlayerSerial[playerid][0] = 0;
- MasterAccount[playerid] = 0;
- TimerDisconnect[playerid] = gettime();
- for(new x = 0; x < 50; x++)
- {
- strdel(ActionLog[playerid][x], 0, 200);
- }
- TextDrawDestroy(DigiHP[playerid]);
- TextDrawDestroy(DigiAP[playerid]);
- FadePlayerDisconnect(playerid);
- ClearPlayerData(playerid, reason);
- ResetPlayerVariables(playerid);
- if(IsValidDynamic3DTextLabel(NameTag[playerid])) { DestroyDynamic3DTextLabel(NameTag[playerid]); }
- return true;
- }
- public OnPlayerUpdate(playerid)
- {
- AFKSeconds[playerid] = 0;
- new Float:Health;
- new HealthNum[15];
- GetPlayerHealth(playerid, Health);
- format(HealthNum, sizeof(HealthNum), "%.0f", Health);
- TextDrawSetString(DigiHP[playerid], HealthNum);
- TextDrawShowForPlayer(playerid, DigiHP[playerid]);
- new Float:Armour;
- GetPlayerArmour(playerid, Armour);
- if(Armour >= 1)
- {
- new ArmourNum[15];
- format(ArmourNum, 15, "%.0f", Armour);
- TextDrawSetString(DigiAP[playerid], ArmourNum);
- TextDrawShowForPlayer(playerid, DigiAP[playerid]);
- }
- else
- {
- TextDrawHideForPlayer(playerid, DigiAP[playerid]);
- }
- // handle fps counters.
- new drunknew;
- drunknew = GetPlayerDrunkLevel(playerid);
- if(drunknew < 100)
- {
- SetPlayerDrunkLevel(playerid, 2000); // go back up, keep cycling.
- }
- else
- {
- if (pDrunkLevelLast[playerid] != drunknew)
- {
- new wfps = pDrunkLevelLast[playerid] - drunknew;
- if((wfps > 0) && (wfps < 200)) pFPS[playerid] = wfps;
- pDrunkLevelLast[playerid] = drunknew;
- }
- }
- PauseTick[playerid] = gettime();
- // Get the player's currently held keys
- new keys, updown, leftright;
- GetPlayerKeys(playerid, keys, updown, leftright);
- PlayerPaused[playerid] = GetTickCount();
- if(OverdoseWaitEffect[playerid][1] == 8 && GetPlayerAnimationIndex(playerid) != 1209) //drug comment
- {
- ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0,1);
- }
- if(MovementSpeed[playerid][0] != 0.0)
- {
- new ai = GetPlayerAnimationIndex(playerid);
- if(ai == 1224 || ai == 1226 || ai == 1276 || ai == 1278 || ai == 1228 || ai == 1230 || ai == 1196)
- {
- if(keys == KEY_WALK) {}
- else if(keys == KEY_SPRINT) SetPlayerForwardVelocity(playerid, MovementSpeed[playerid][1], 0.3);
- else SetPlayerForwardVelocity(playerid, MovementSpeed[playerid][0], 0.3);
- }
- }
- if(!PlayerStopEditingObject(playerid)) CancelEdit(playerid);
- if(IsSpectating[playerid] != -1)
- {
- if(leftright != 0)
- {
- if(GetTickCount()-pSpecLimit[playerid] > 666 || GetTickCount()-pSpecLimit[playerid] < 0)
- {
- pSpecLimit[playerid] = GetTickCount();
- new i = IsSpectating[playerid];
- if(leftright == KEY_RIGHT) // Next
- {
- i++;
- if(i == MAX_PLAYERS) i = 0;
- while(!IsPlayerConnected(i) || IsSpectating[i] != -1)
- {
- i++;
- if(i == MAX_PLAYERS) i = 0;
- }
- }
- else if(leftright == KEY_LEFT) // Prev
- {
- i--;
- if(i == -1) i = MAX_PLAYERS-1;
- while(!IsPlayerConnected(i) || IsSpectating[i] != -1)
- {
- i--;
- if(i == -1) i = MAX_PLAYERS-1;
- }
- }
- new val[12];
- format(val, 12, "%i", i);
- cmd_spectate(playerid, val);
- }
- }
- else pSpecLimit[playerid] = 0; // If not holding, reset limit to allow tapping
- }
- if(PfSpec[playerid][FlySpec] == 1)
- {
- if(PfSpec[playerid][mdir] && (GetTickCount() - PfSpec[playerid][lastmove] > 100))
- {
- MoveCamera(playerid);
- }
- if(PfSpec[playerid][updownold] != updown || PfSpec[playerid][leftrightold] != leftright)
- {
- if((PfSpec[playerid][updownold] != 0 || PfSpec[playerid][leftrightold] != 0) && updown == 0 && leftright == 0)
- {
- StopPlayerObject(playerid, PfSpec[playerid][fsobj]);
- PfSpec[playerid][mdir] = 0;
- }
- else
- {
- PfSpec[playerid][mdir] = GetMoveDirectionFromKeys(updown, leftright);
- MoveCamera(playerid);
- }
- }
- PfSpec[playerid][updownold] = updown;
- PfSpec[playerid][leftrightold] = leftright;
- return false;
- }
- if(StretcherHolding[playerid] == 2)
- {
- new Float:X, Float:Y, Float:Z, Float:Ang;
- GetPlayerPos(playerid, X, Y, Z);
- GetXYInFrontOfPlayer(playerid, X, Y, 1.6);
- GetPlayerFacingAngle(playerid, Ang);
- SetDynamicObjectPos(StretcherEquipped[playerid], X, Y, Z - 1.0);
- SetDynamicObjectRot(StretcherEquipped[playerid], 0.0, 0.0, Ang-180.0);
- }
- // Invincible Tank
- if(IsPlayerInAnyVehicle(playerid))
- {
- new vid = GetVehicleModel(GetPlayerVehicleID(playerid)), Float:VHP; GetVehicleHealth(vid, VHP);
- if(vid == 432)
- {
- if(VHP < 10000.0)
- {
- SetVehicleHealthEx(GetPlayerVehicleID(playerid),10000.0); //Rhino
- }
- }
- if(vid == 601)
- {
- if(VHP < 10000.0)
- {
- SetVehicleHealthEx(GetPlayerVehicleID(playerid),10000.0); //SWAT Tank
- }
- }
- if(vid == 528)
- {
- if(VHP < 10000.0)
- {
- SetVehicleHealthEx(GetPlayerVehicleID(playerid),10000.0); //FBI Truck
- }
- }
- if(vid == 427)
- {
- if(VHP < 10000.0)
- {
- SetVehicleHealthEx(GetPlayerVehicleID(playerid),10000.0); //FBI Truck
- }
- }
- if(vid == 428)
- {
- if(VHP < 10000.0)
- {
- SetVehicleHealthEx(GetPlayerVehicleID(playerid),10000.0); //Securicar
- }
- }
- }
- if(!IsPlayerInAnyVehicle(playerid) && !IsPlayerInWater(playerid))
- {
- if(GetPlayerWeapon(playerid) == 31 && HasLaser{playerid}) //Assault Rifle
- {
- if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
- {
- if(AttachedObjects[playerid][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 6);
- }
- AttachedObjects[playerid][6][aoModelID] = 18643;
- AttachedObjects[playerid][6][aoBone] = 6;
- SetPlayerAttachedObject(playerid, 6, 18643, 6,0.528249, -0.020266, 0.068052, -6.671746, 352.20000, 354.70000);
- }
- else
- {
- if(AttachedObjects[playerid][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 6);
- }
- AttachedObjects[playerid][6][aoModelID] = 18643;
- AttachedObjects[playerid][6][aoBone] = 6;
- SetPlayerAttachedObject(playerid, 6, 18643, 6,0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289);
- }
- }
- if(GetPlayerWeapon(playerid)==23 && HasLaser{playerid}) //Taser
- {
- if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
- {
- if(AttachedObjects[playerid][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 6);
- }
- AttachedObjects[playerid][6][aoModelID] = 18643;
- AttachedObjects[playerid][6][aoBone] = 6;
- SetPlayerAttachedObject(playerid,6,18643,6,0.098000,0.031999,0.082999,-0.500000,-9.600000,3.8000);
- }
- else
- {
- if(AttachedObjects[playerid][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 6);
- }
- AttachedObjects[playerid][6][aoModelID] = 18643;
- AttachedObjects[playerid][6][aoBone] = 6;
- SetPlayerAttachedObject(playerid,6,18643,6,0.098000,0.031999,0.082999,10,-10,6);
- }
- }
- if(GetPlayerWeapon(playerid) != 23 && GetPlayerWeapon(playerid) != 31 && HasLaser{playerid})
- {
- if(AttachedObjects[playerid][6][aoModelID] == 18643)
- {
- RemovePlayerAttachedObject(playerid, 6);
- AttachedObjects[playerid][6][aoModelID] = 0;
- AttachedObjects[playerid][6][aoBone] = 0;
- }
- HasLaser{playerid} = false;
- }
- }
- if(IsDead[playerid] == 1)
- {
- new animlib[32], animname[32];
- GetAnimationName(GetPlayerAnimationIndex(playerid), animlib, 32, animname, 32);
- if(!strmatch(animname, "KILL_Knife_ped_die"))
- {
- OnePlayAnim(playerid, "KNIFE", "KILL_Knife_ped_die", 4.1, 0, 1, 1, 1, 0);
- }
- }
- if(GetPlayerWeapon(playerid) != CurrentWeapon[playerid])
- {
- /*for(new il = 0; il < sizeof(unholsterWeap); il++)
- {
- if(CurrentWeapon[playerid] == unholsterWeap[il])
- {
- SetPlayerArmedWeapon(playerid, CurrentWeapon[playerid]);
- CurrentWeapon[playerid] = GetPlayerWeapon(playerid);
- return true;
- }
- }*/
- CurrentWeapon[playerid] = GetPlayerWeapon(playerid);
- for(new z = 1; z < MAX_TOTAL_WEAPONS; z++)
- {
- new w, a;
- w = WeaponData[playerid][z][Weapon];
- a = WeaponData[playerid][z][WeaponAmmo];
- //GetPlayerWeaponData(playerid, z, w, a);
- if(GetPlayerWeapon(playerid) != w)
- {
- for(new jk = 0; jk < MAX_TOYS; jk++)
- {
- if(ToyInfo[playerid][jk][tModelID] == dropObjectID[w])
- {
- if(ToyInfo[playerid][jk][tOptional] == 0)
- {
- new index = GetFreeWeaponObjectIndex(playerid);
- if(index != -1)
- {
- if(IsHolstered[playerid][z] == 1)
- {
- if(!IsEditingHolster[playerid])
- {
- if(a != 0)
- {
- SetPlayerAttachedObject(playerid, index, ToyInfo[playerid][jk][tModelID], ToyInfo[playerid][jk][tBone], ToyInfo[playerid][jk][tOffset][0], ToyInfo[playerid][jk][tOffset][1], ToyInfo[playerid][jk][tOffset][2], ToyInfo[playerid][jk][tRot][0], ToyInfo[playerid][jk][tRot][1], ToyInfo[playerid][jk][tRot][2],
- ToyInfo[playerid][jk][tScale][0], ToyInfo[playerid][jk][tScale][1], ToyInfo[playerid][jk][tScale][2]);
- AttachedObjects[playerid][index][aoToyID] = jk;
- AttachedObjects[playerid][index][aoModelID] = ToyInfo[playerid][jk][tModelID];
- AttachedObjects[playerid][index][aoOffset][0] = ToyInfo[playerid][jk][tOffset][0];
- AttachedObjects[playerid][index][aoOffset][1] = ToyInfo[playerid][jk][tOffset][1];
- AttachedObjects[playerid][index][aoOffset][2] = ToyInfo[playerid][jk][tOffset][2];
- AttachedObjects[playerid][index][aoRot][0] = ToyInfo[playerid][jk][tRot][0];
- AttachedObjects[playerid][index][aoRot][1] = ToyInfo[playerid][jk][tRot][1];
- AttachedObjects[playerid][index][aoRot][2] = ToyInfo[playerid][jk][tRot][2];
- AttachedObjects[playerid][index][aoScale][0] = ToyInfo[playerid][jk][tScale][0];
- AttachedObjects[playerid][index][aoScale][1] = ToyInfo[playerid][jk][tScale][1];
- AttachedObjects[playerid][index][aoScale][2] = ToyInfo[playerid][jk][tScale][2];
- AttachedObjects[playerid][index][aoBone] = ToyInfo[playerid][jk][tBone];
- IsHolstered[playerid][z] = 0;
- break;
- }
- }
- else
- {
- RemovePlayerAttachedObject(playerid, index);
- AttachedObjects[playerid][index][aoBone] = 0;
- IsHolstered[playerid][z] = 1;
- break;
- }
- }
- }
- else
- {
- new HolsterWeapons[13], forceCount = 0;
- for(new we = 1; we < MAX_TOTAL_WEAPONS; we++)
- {
- new aml;
- GetPlayerWeaponData(playerid, we, HolsterWeapons[we], aml);
- }
- if(forceCount >= 4)
- {
- if(z >= 3 && z <= 6)
- {
- for(new hw = 1; hw < MAX_TOTAL_WEAPONS; hw++)
- {
- if(hw <= 2 || hw >= 7)
- {
- for(new ao = 7; ao < 10; ao++)
- {
- if(AttachedObjects[playerid][ao][aoModelID] == dropObjectID[HolsterWeapons[hw]])
- {
- RemovePlayerAttachedObject(playerid, ao);
- AttachedObjects[playerid][ao][aoBone] = 0;
- IsHolsterTogged[playerid][hw] = 1;
- IsHolstered[playerid][hw] = 1;
- break;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return true;
- }
- public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
- {
- //
- return true;
- }
- public OnPlayerSpawn(playerid)
- {
- TogglePlayerSpectating(playerid, false);
- if(JustSpawned{playerid})
- {
- TogglePlayerControllable(playerid, 0);
- SetPlayerSkinEx(playerid, cPlayersSkin[playerid]);
- TeleportTimer[playerid] = 4;
- BeingTeleported{playerid} = true;
- SetPlayerHealthEx(playerid, HealthVar[playerid]);
- JustSpawned{playerid} = false;
- }
- phonebateria(playerid);
- newhudVxC(playerid); //hud vida e colete
- SetPlayerArmourEx(playerid, ArmourVar[playerid], 1);
- SyncPlayerWeapons(playerid);
- SetPlayerTeam(playerid, 5);
- SetTimerEx("CheckDeath", 500, false, "i", playerid);
- Streamer_SetVisibleItems(STREAMER_TYPE_OBJECT, VisibleObjects[playerid], playerid);
- //PlayerTextDrawShow(playerid, DigiHP[playerid]);
- TextDrawShowForPlayer(playerid, DigiHP[playerid]);
-
- new Float:Armour;
- GetPlayerArmour(playerid, Armour);
- if(Armour >= 1) TextDrawShowForPlayer(playerid, DigiAP[playerid]);
- else TextDrawHideForPlayer(playerid, DigiAP[playerid]);
- new playername[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid,playername, MAX_PLAYER_NAME);
- if(!strcmp(playername,"Train_Bot",true))
- {
- SetPlayerColor(playerid, 0x22313F33);
- PutPlayerInVehicle(playerid, BotVehicle, 0);
- Logged{playerid} = true;
- SetPlayerSkinEx(playerid, 7);
- }
- CanPlayerChoke{playerid} = true;
- if(Inventory[playerid][Watch] == 1)
- {
- TextDrawShowForPlayer(playerid, TimeText);
- TimeIsDisplayed{playerid} = true;
- }
- if(!gPlayerAnimLibsPreloaded[playerid])
- {
- PreloadAnimLib(playerid, "AIRPORT");
- PreloadAnimLib(playerid, "Attractors");
- PreloadAnimLib(playerid, "BAR");
- PreloadAnimLib(playerid, "BASEBALL");
- PreloadAnimLib(playerid, "BD_FIRE");
- PreloadAnimLib(playerid, "BEACH");
- PreloadAnimLib(playerid, "BF_injection");
- PreloadAnimLib(playerid, "BIKED");
- PreloadAnimLib(playerid, "BIKEH");
- PreloadAnimLib(playerid, "BIKELEAP");
- PreloadAnimLib(playerid, "BIKES");
- PreloadAnimLib(playerid, "BIKEV");
- PreloadAnimLib(playerid, "BIKE_DBZ");
- PreloadAnimLib(playerid, "BLOWJOBZ");
- PreloadAnimLib(playerid, "BMX");
- PreloadAnimLib(playerid, "BOMBER");
- PreloadAnimLib(playerid, "BOX");
- PreloadAnimLib(playerid, "BSKTBALL");
- PreloadAnimLib(playerid, "BUDDY");
- PreloadAnimLib(playerid, "BUS");
- PreloadAnimLib(playerid, "CAMERA");
- PreloadAnimLib(playerid, "CAR");
- PreloadAnimLib(playerid, "CARRY");
- PreloadAnimLib(playerid, "CAR_CHAT");
- PreloadAnimLib(playerid, "CASINO");
- PreloadAnimLib(playerid, "CHAINSAW");
- PreloadAnimLib(playerid, "CHOPPA");
- PreloadAnimLib(playerid, "CLOTHES");
- PreloadAnimLib(playerid, "COACH");
- PreloadAnimLib(playerid, "COLT45");
- PreloadAnimLib(playerid, "COP_AMBIENT");
- PreloadAnimLib(playerid, "COP_DVBYZ");
- PreloadAnimLib(playerid, "CRACK");
- PreloadAnimLib(playerid, "CRIB");
- PreloadAnimLib(playerid, "DAM_JUMP");
- PreloadAnimLib(playerid, "DANCING");
- PreloadAnimLib(playerid, "DEALER");
- PreloadAnimLib(playerid, "DILDO");
- PreloadAnimLib(playerid, "DODGE");
- PreloadAnimLib(playerid, "DOZER");
- PreloadAnimLib(playerid, "DRIVEBYS");
- PreloadAnimLib(playerid, "FAT");
- PreloadAnimLib(playerid, "FIGHT_B");
- PreloadAnimLib(playerid, "FIGHT_C");
- PreloadAnimLib(playerid, "FIGHT_D");
- PreloadAnimLib(playerid, "FIGHT_E");
- PreloadAnimLib(playerid, "FINALE");
- PreloadAnimLib(playerid, "FINALE2");
- PreloadAnimLib(playerid, "FLAME");
- PreloadAnimLib(playerid, "FOOD");
- PreloadAnimLib(playerid, "Flowers");
- PreloadAnimLib(playerid, "Freeweights");
- PreloadAnimLib(playerid, "GANGS");
- PreloadAnimLib(playerid, "GHANDS");
- PreloadAnimLib(playerid, "GHETTO_DB");
- PreloadAnimLib(playerid, "GRAFFITI");
- PreloadAnimLib(playerid, "GRAVEYARD");
- PreloadAnimLib(playerid, "GRENADE");
- PreloadAnimLib(playerid, "GYMNASIUM");
- PreloadAnimLib(playerid, "HAIRCUTS");
- PreloadAnimLib(playerid, "HEIST9");
- PreloadAnimLib(playerid, "INT_HOUSE");
- PreloadAnimLib(playerid, "INT_OFFICE");
- PreloadAnimLib(playerid, "INT_SHOP");
- PreloadAnimLib(playerid, "JST_BUISNESS");
- PreloadAnimLib(playerid, "KART");
- PreloadAnimLib(playerid, "KISSING");
- PreloadAnimLib(playerid, "KNIFE");
- PreloadAnimLib(playerid, "LAPDAN1");
- PreloadAnimLib(playerid, "LAPDAN2");
- PreloadAnimLib(playerid, "LAPDAN3");
- PreloadAnimLib(playerid, "LOWRIDER");
- PreloadAnimLib(playerid, "MD_CHASE");
- PreloadAnimLib(playerid, "MD_END");
- PreloadAnimLib(playerid, "MEDIC");
- PreloadAnimLib(playerid, "MISC");
- PreloadAnimLib(playerid, "MTB");
- PreloadAnimLib(playerid, "MUSCULAR");
- PreloadAnimLib(playerid, "NEVADA");
- PreloadAnimLib(playerid, "ON_LOOKERS");
- PreloadAnimLib(playerid, "OTB");
- PreloadAnimLib(playerid, "PARACHUTE");
- PreloadAnimLib(playerid, "PARK");
- PreloadAnimLib(playerid, "PAULNMAC");
- PreloadAnimLib(playerid, "PLAYER_DVBYS");
- PreloadAnimLib(playerid, "PLAYIDLES");
- PreloadAnimLib(playerid, "POLICE");
- PreloadAnimLib(playerid, "POOL");
- PreloadAnimLib(playerid, "POOR");
- PreloadAnimLib(playerid, "PYTHON");
- PreloadAnimLib(playerid, "QUAD");
- PreloadAnimLib(playerid, "QUAD_DBZ");
- PreloadAnimLib(playerid, "RAPPING");
- PreloadAnimLib(playerid, "RIFLE");
- PreloadAnimLib(playerid, "RIOT");
- PreloadAnimLib(playerid, "ROB_BANK");
- PreloadAnimLib(playerid, "ROCKET");
- PreloadAnimLib(playerid, "RUSTLER");
- PreloadAnimLib(playerid, "RYDER");
- PreloadAnimLib(playerid, "SAMP");
- PreloadAnimLib(playerid, "SCRATCHING");
- PreloadAnimLib(playerid, "SHAMAL");
- PreloadAnimLib(playerid, "SHOP");
- PreloadAnimLib(playerid, "SHOTGUN");
- PreloadAnimLib(playerid, "SILENCED");
- PreloadAnimLib(playerid, "SKATE");
- PreloadAnimLib(playerid, "SMOKING");
- PreloadAnimLib(playerid, "SNIPER");
- PreloadAnimLib(playerid, "SPRAYCAN");
- PreloadAnimLib(playerid, "STRIP");
- PreloadAnimLib(playerid, "SUNBATHE");
- PreloadAnimLib(playerid, "SWAT");
- PreloadAnimLib(playerid, "SWEET");
- PreloadAnimLib(playerid, "SWIM");
- PreloadAnimLib(playerid, "SWORD");
- PreloadAnimLib(playerid, "TANK");
- PreloadAnimLib(playerid, "TATTOOS");
- PreloadAnimLib(playerid, "TEC");
- PreloadAnimLib(playerid, "TRAIN");
- PreloadAnimLib(playerid, "TRUCK");
- PreloadAnimLib(playerid, "UZI");
- PreloadAnimLib(playerid, "VAN");
- PreloadAnimLib(playerid, "VENDING");
- PreloadAnimLib(playerid, "VORTEX");
- PreloadAnimLib(playerid, "WAYFARER");
- PreloadAnimLib(playerid, "WEAPONS");
- PreloadAnimLib(playerid, "WUZI");
- PreloadAnimLib(playerid, "benchpress");
- PreloadAnimLib(playerid, "goggles");
- PreloadAnimLib(playerid, "ped");
- gPlayerAnimLibsPreloaded[playerid] = true;
- }
- for(new ao = 0; ao < 10; ao++)
- {
- if(AttachedObjects[playerid][ao][aoModelID] > 0)
- {
- SetPlayerAttachedObject(playerid, ao, AttachedObjects[playerid][ao][aoModelID], AttachedObjects[playerid][ao][aoBone], AttachedObjects[playerid][ao][aoOffset][0], AttachedObjects[playerid][ao][aoOffset][1],
- AttachedObjects[playerid][ao][aoOffset][2], AttachedObjects[playerid][ao][aoRot][0], AttachedObjects[playerid][ao][aoRot][1], AttachedObjects[playerid][ao][aoRot][2], AttachedObjects[playerid][ao][aoScale][0],
- AttachedObjects[playerid][ao][aoScale][1], AttachedObjects[playerid][ao][aoScale][2], AttachedObjects[playerid][ao][aoColor], AttachedObjects[playerid][ao][aoColor]);
- }
- }
- foreach(new i: Player)
- {
- if(UsingPaint{i})
- {
- if(PaintLabels[i][playerid] != Text3D:INVALID_3DTEXT_ID)
- {
- DestroyDynamic3DTextLabel(PaintLabels[i][playerid]);
- }
- format(tgstr, sizeof(tgstr), "%s (%i)", NameEx(playerid), playerid);
- PaintLabels[i][playerid] = CreateDynamic3DTextLabel(tgstr, COLOR_ORANGE, PlayerPosX(playerid), PlayerPosY(playerid), PlayerPosZ(playerid), 300, playerid, INVALID_VEHICLE_ID, 0, -1, -1, i, 300.0);
- }
- Streamer_Update(i);
- }
- if(IsSpectating[playerid] == -2) {
- IsSpectating[playerid] = -1;
- SetPlayerSkin(playerid, cPlayersSkin[playerid]);
- }
- return true;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- CancelEdit(playerid);
- foreach(new i: Player)
- {
- if(IsSpectating[i] == playerid)
- {
- SetPlayerInterior(i, GetPlayerInterior(playerid));
- SetPlayerVirtualWorldEx(i, GetPlayerVirtualWorld(playerid));
- //PlayerSpectatePlayer(i, playerid, SPECTATE_MODE_NORMAL);
- }
- }
- if(IsPlayerMasked{playerid}) FormatHealthLabelText(playerid, HealthVar[playerid], ArmourVar[playerid], 2);
- if(newinteriorid != 0 && GetPlayerVirtualWorld(playerid) != 0) SetPlayerWeather(playerid, 1);
- else SetPlayerWeather(playerid, gServerWeather);
- if(IsInHouseID[playerid] != -1)
- {
- if(HouseData[IsInHouseID[playerid]][HouseLights]) SetPlayerTime(playerid, 12, 0);
- }
- if(IsInBizzID[playerid] != -1)
- {
- if(BizzData[IsInBizzID[playerid]][BizzLights]) SetPlayerTime(playerid, 12, 0);
- }
- if(newinteriorid == 0) SetPlayerTime(playerid, gServerHour, gServerMinute);
- return true;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SetPlayerArmourEx(playerid, 0.0, 0);
- if(playerid != -1 && playerid != INVALID_PLAYER_ID)
- {
- CancelEdit(playerid);
- if(!IsAFK{playerid}) DeleteAFKLabel(playerid);
- if(!IsDead[playerid])
- {
- new Msg[128];
- if(reason == 51 || 53 || 54)
- {
- if(HitCount[playerid] == 0)
- {
- HitCount[playerid] ++;
- Injuries[playerid][HitCount[playerid]][pWeaponID] = reason;
- Injuries[playerid][HitCount[playerid]][pBodypart] = 3;
- }
- }
- MyDeaths[playerid] ++;
- MySQLUpdateInt(SQLID[playerid], "Deaths", MyDeaths[playerid], "players");
- if(killerid != INVALID_PLAYER_ID && Logged{killerid})
- {
- MyKills[killerid] ++;
- MySQLUpdateInt(SQLID[killerid], "Kills", MyKills[killerid], "players");
- }
- if(killerid != INVALID_PLAYER_ID)
- {
- new ply_killername[MAX_PLAYER_NAME];
- format(ply_killername, sizeof(ply_killername), "%s", NameEx(killerid));
- if(!IsPlayerConnected(killerid)) format(ply_killername, sizeof(ply_killername), "KILLER_LEAVE");
- format(Msg,sizeof(Msg),"%s has been killed by %s. (%s)", NameEx(playerid), ply_killername, GetDeathReasonName(killerid, reason));
- AdminBroadcast(Msg, 0);
- }
- else
- {
- format(Msg,sizeof(Msg),"%s has died. (%s)",NameEx(playerid),GetDeathReasonName(killerid, reason));
- AdminBroadcast(Msg, 0);
- }
- TriggerPlayerDeath(playerid);
- MakePlayerDead(playerid);
- } else {
- new Float:pPos[4];
- GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
- GetPlayerFacingAngle(playerid, pPos[3]);
- if(!IsPlayerInAnyVehicle(playerid)) SetSpawnInfo(playerid, 4, cPlayersSkin[playerid], pPos[0], pPos[1], pPos[2], pPos[3], 0, 0, 0, 0, 0, 0);
- else SetSpawnInfo(playerid, 4, cPlayersSkin[playerid], pPos[0] + 0.5, pPos[1] + 1, pPos[2], pPos[3], 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- SetPlayerHealthEx(playerid, 12.0);
- SetPlayerArmourEx(playerid, 0.0, 0);
- foreach(new p: Player) if(IsSpectating[p] == playerid) PlayerSpectatePlayer(p, playerid);
- SetTimerEx("DeathLog", 850, 0, "i", playerid);
- }
- }
- return true;
- }
- public OnVehicleSpawn(vehicleid)
- {
- Fuel[vehicleid] = random(50) + 50;
- FuelTypeAfterRefuel[vehicleid] = 0;
- VehicleBroke[vehicleid] = 0;
- EngineStatus[vehicleid] = 0;
- VehicleLights[vehicleid] = 0;
- VehicleBoots[vehicleid][0] = 0;
- VehicleBoots[vehicleid][1] = 0;
- if(!VehicleHasWindows(vehicleid)) WindowState{vehicleid} = WINDOWS_OPEN;
- else WindowState{vehicleid} = WINDOWS_CLOSED;
- if(!VehicleHasEngine(vehicleid))
- {
- EngineStatus[vehicleid] = 1;
- Fuel[vehicleid] = 100;
- ToggleVehicleEngine(vehicleid, 1);
- }
- return true;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- strdel(vMusicLink[vehicleid], 0, 256);
- vMusicPlaying[vehicleid] = false;
- if(vehicleid == VehicleData[vehicleid][IdVehicle])
- {
- VehicleData[vehicleid][NeedsRecovery] = true;
- VehicleData[vehicleid][FuelRemaining] = Fuel[VehicleData[vehicleid][IdVehicle]];
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET NeedsRecovery = %i, Fuel = %f WHERE id = %i", VehicleData[vehicleid][NeedsRecovery], VehicleData[vehicleid][FuelRemaining], VehicleData[vehicleid][VehSQLID]);
- mysql_pquery(conn, mquery);
- if(VehicleData[vehicleid][ForSaleLabel] != Text3D:INVALID_3DTEXT_ID) DestroyDynamic3DTextLabel(VehicleData[vehicleid][ForSaleLabel]);
- VehicleData[vehicleid][ForSaleLabel] = Text3D:INVALID_3DTEXT_ID;
- foreach(new i: Player)
- {
- if(MyTaxiCar[i] == vehicleid)
- {
- MyTaxiCar[i] = 0;
- break;
- }
- }
- if(vTaxiSign[vehicleid] != INVALID_OBJECT_ID) DestroyDynamicObjectEx(vTaxiSign[vehicleid], "vTaxiSign[vehicleid]");
- vTaxiSign[vehicleid] = INVALID_OBJECT_ID;
- }
- if(vehicleid == RentalData[vehicleid][CarID])
- {
- foreach(new i: Player)
- {
- if(RentalCar[i] == vehicleid)
- {
- new cost = 1000*GetVehicleRepairMultiplier(GetVehicleModel(vehicleid));
- GivePlayerCash(i, -cost);
- SendClientMessageF(i, COLOR_RED, "You have been charged $%s for destroying your rental vehicle.", format_cash(cost));
- ToggleVehicleLock(vehicleid, false);
- Locked{vehicleid} = false;
- SetVehicleToRespawnEx(vehicleid);
- RepairVehicleEx(vehicleid);
- RentalCar[i] = 0;
- break;
- }
- }
- }
- if(vehicleid == PizzaCar1 || vehicleid == PizzaCar2)
- {
- SetVehicleToRespawn(vehicleid);
- }
- if(ELMs{vehicleid})
- {
- EmergencyLights[vehicleid] = 0;
- ToggleVehicleLights(vehicleid, 0);
- VehicleLights[vehicleid] = 0;
- }
- if(VehObject[vehicleid] != INVALID_OBJECT_ID)
- {
- DestroyDynamicObjectEx(VehObject[vehicleid], "VehObject[vehicleid] 0");
- VehObject[vehicleid] = INVALID_OBJECT_ID;
- }
- if(Siren{vehicleid}) Siren{vehicleid} = false;
- if(SnowPlow{vehicleid}) SnowPlow{vehicleid} = false;
- if(VehicleData[vehicleid][VehicleOwnerSQLID] > 0)
- {
- MySQLUpdateInt(VehicleData[vehicleid][VehSQLID], "NeedsRecovery", 1, "vehicles");
- ClearVehicleData(vehicleid);
- SetTimerEx("DelayedVehicleDeath", 3500, 0, "d", vehicleid);
- }
- else if(FVehicleData[vehicleid][FVFaction] > 0)
- {
- SetVehicleToRespawnEx(vehicleid);
- DestroyDynamic3DTextLabel(FVehicleData[vehicleid][FVGovUnit3DText]);
- FVehicleData[vehicleid][FVGovUnit3DText] = Text3D:INVALID_3DTEXT_ID;
- FVehicleData[vehicleid][FVGovUnit][0] = 0;
- }
- else
- {
- SetVehicleToRespawnEx(vehicleid);
- RepairVehicleEx(vehicleid);
- }
- VehicleCanBurn[vehicleid] = 1;
- VehicleOnFire[vehicleid] = 0;
- VehicleBurning[vehicleid] = 0;
- return true;
- }
- public OnPlayerText(playerid, text[])
- {
- if(!Logged{playerid}) return false;
- LastPlayerPos[playerid][0] += 1;
- if(IsPlayerAdminLevelOK(playerid, 1))
- {
- format(gstr, sizeof(gstr), "[%s] %s : %s", GetServerTimeString(), NameEx(playerid), text);
- }
- if(Muted[playerid] > 0)
- {
- SysMsgF(playerid,"You are muted. (%i minutes left)", Muted[playerid]);
- return false;
- }
- if(AdminJailData[playerid][0] == 1)
- {
- SysMsg(playerid,"Wait until you are out of the Admin Jail."); //Aguarde até que você esteja fora da Admin Jail
- return false;
- }
- if(UsingCCTV{playerid})
- {
- SysMsg(playerid,"You cannot do this while using the CCTV.");
- return false;
- }
- if(strfind(text, "rcon", true) != -1)
- {
- SysMsg(playerid,"System has prevented this message from being sent.");
- return false;
- }
- if(IsSpectating[playerid] != -1) return false;
- UnlockAchievement(playerid, 3);
- new vid = GetPlayerVehicleID(playerid);
- if(CallerID[playerid] != -1 || CallerService[playerid] != -1) return ProcessPhoneChat(playerid, vid, text, 20.0);
- if(UsingAccent[playerid] == 1) format(sgstr, sizeof(sgstr),"%s says: [%s accent] %s", NameRP(playerid), Accent[playerid], text);
- else format(sgstr, sizeof(sgstr),"%s says: %s", NameRP(playerid), text);
- if(vid > 0 && VehicleHasWindows(vid) && WindowState{vid} == WINDOWS_CLOSED)
- {
- foreach(new i: Player)
- {
- new VehId = GetPlayerVehicleID(i);
- if(VehId == vid) SendSplitMessage(i,COLOR_FADE3,sgstr);
- }
- }
- else
- {
- SetPlayerChatBubble(playerid, text, COLOR_WHITE, 15.0, 5000);
- if(gPlayerUsingLoopingAnim[playerid] != 1 && (!Dead{playerid}) && TalkAnimToggle{playerid})
- {
- OnePlayAnim(playerid,"PED","IDLE_CHAT",4.0,0,0,0,1,1);
- SetTimerEx("StopLoopingAnim", strlen(text)*80, false, "i", playerid);
- }
- new Float:radius = 20.0, occupants;
- if(IsInHouseID[playerid] != -1) occupants = HouseData[IsInHouseID[playerid]][HouseOccupants];
- else if(IsInBizzID[playerid] != -1) occupants = BizzData[IsInBizzID[playerid]][BizzOccupants];
- if(occupants < 10) radius = 20.0;
- else if(occupants < 20) radius = 10.0;
- else radius = 5.0;
- ProxDetector(radius, playerid, sgstr, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- }
- format(gstr, sizeof(gstr), "[%s] %s", GetServerTimeString(), sgstr);
- FormatActionLog(playerid, sgstr);
- totalchat ++;
- return false;
- }
- public OnPlayerCommandReceived(playerid, cmdtext[])
- {
- if(!IsPlayerAdmin(playerid))
- {
- if(IsInHospital{playerid} && AdminLevel[playerid] == 0 && strfind(cmdtext, "/assistance") != 0 && strfind(cmdtext, "/reportar") != 0 && strfind(cmdtext, "/ac") != 0)
- {
- SysMsg(playerid, "Please wait until you are out of hospital.");//Saia do hospital para usar este comando
- return false;
- }
- if(IsChangingSkin{playerid})
- {
- SysMsg(playerid, "Please wait until you choose a skin.");//Você precisa escolher uma skin primeiro
- return false;
- }
- if(AdminJailData[playerid][0] == 1 && strfind(cmdtext, "/pm") != 0 && strfind(cmdtext, "/report") != 0 && strfind(cmdtext, "/admins") != 0 && strfind(cmdtext, "/assistencia") != 0 && strfind(cmdtext, "/ac") != 0 && AdminLevel[playerid] == 0)
- {
- SysMsg(playerid, "Wait until you are out of the Admin Jail.");//Você precisa sair da Ajail primeiro
- return false;
- }
- }
- return true;
- }
- public OnPlayerCommandPerformed(playerid, cmdtext[], success)
- {
- LastPlayerPos[playerid][0] += 1;
- gstr[0] = EOS;
- if(IsPlayerAdminLevelOK(playerid, 1))
- {
- format(gstr, sizeof(gstr), "[%s] %s : %s", GetServerTimeString(), NameEx(playerid), cmdtext);
- }
- if(!success) return SysMsg(playerid, CMDFMSG);
- else
- {
- totalcmds ++;
- format(gstr, sizeof(gstr), "[%s] %s(ID %i): %s", GetServerTimeString(), GetName(playerid), playerid, cmdtext);
- format(gstr, sizeof(gstr), "%s: %s", NameEx(playerid), cmdtext);
- FormatActionLog(playerid, gstr);
- return true;
- }
- }
- public OnPlayerLeaveDynamicArea(playerid, areaid)
- {
- if(areaid == APArea)
- {
- if(ApertureBA == 1)
- {
- StopAudioStreamForPlayer(playerid);
- return true;
- }
- }
- if(ListeningBoom[playerid] >= 0)
- {
- if(areaid == Boomboxes[ListeningBoom[playerid]][BoomArea])
- {
- ListeningBoom[playerid] = -1;
- StopAudioStreamForPlayer(playerid);
- }
- }
- if(areaid == GarageAreas[0] || areaid == GarageAreas[1] || areaid == GarageAreas[2] || areaid == GarageAreas[3])
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new modcount = 0;
- for(new x = 0; x < 14; x++) if(ModQueue[playerid][x] >= 1) modcount ++;
- if(PendingPaintjob[playerid] != -1) modcount ++;
- if(modcount != 0 && IsPlayerInAnyVehicle(playerid))
- {
- if(VehicleData[GetPlayerVehicleID(playerid)][VehicleOwnerSQLID] == SQLID[playerid])
- {
- new component, v = GetPlayerVehicleID(playerid);
- for(new x = 0; x < 14; x++) //removes pending components from the vehicle and then readds saved mods
- {
- component = GetVehicleComponentInSlot(v, x);
- if(component != 0) RemoveVehicleComponent(v, component);
- if(VehicleData[v][VehicleMod][x] && IsVehicleUpgradeCompatible(VehicleData[v][VehicleModel], VehicleData[v][VehicleMod][x]))
- {
- AddVehicleComponent(VehicleData[v][IdVehicle], VehicleData[v][VehicleMod][x]);
- }
- ModQueue[playerid][x] = 0;
- }
- if(PendingPaintjob[playerid] != -1) ChangeVehiclePaintjob(v, 3);
- PendingPaintjob[playerid] = -1;
- if(VehicleData[v][VehiclePaintjob] < 3) ChangeVehiclePaintjob(v, VehicleData[v][VehiclePaintjob]);
- SendClientMessage(playerid, COLOR_WHITE, "Your pending mods have been {FF0000}removed{FFFFFF} as you did not purchase them.");
- }
- }
- }
- }
- return true;
- }
- public OnPlayerEnterDynamicArea(playerid, areaid)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && IsStingerVehicle(GetPlayerVehicleID(playerid)))
- {
- foreach(new p: Player)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(StingerObjectID[p] != INVALID_OBJECT_ID)
- {
- if(IsValidDynamicArea(StingerAreaID[p]) && StingerAreaID[p] == areaid)
- {
- new panels, doors, lights, tires;
- GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
- if((!IsBike(vehicleid) && tires != 15) || (IsBike(vehicleid) && tires != 3))
- {
- if(IsBike(vehicleid)) tires = encode_tires_bike(1, 1);
- else tires = encode_tires(1, 1, 1, 1);
- UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
- format(gstr, sizeof(gstr),"*POP* A loud popping sound is heard as the %s drives over the Spike Strip.",GetVehicleName(vehicleid));
- ProxDetector(30.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- }
- }
- }
- }
- }
- if(areaid == SilverRectangle)
- {
- foreach(new i: Player)
- {
- if(Logged{i} && RadioFrequency[i] == 8767 && RadioPoweredOn[i] == 1 && !CoolPersonList(playerid))
- {
- SendClientMessage(i, 0x967100FF, "[Radio - 8767 MHz] Movement has been detected at The Silver Manor.");
- return true;
- }
- }
- }
- if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0)
- {
- for(new x = 0; x < 6; x++)
- {
- if(areaid == SpeedCameraAreas[x])
- {
- new Speed = GetVehicleSpeed(GetPlayerVehicleID(playerid), 0);
- CheckSpeedCameras(playerid, Speed, GetPlayerVehicleID(playerid));
- return true;
- }
- }
- }
- if(areaid == APArea)
- {
- if(ApertureSAMS == 1 && Faction[playerid] != FACTION_RESEARCH)
- {
- if((IsHelicopter(GetPlayerVehicleID(playerid)) || IsPlane(GetPlayerVehicleID(playerid))) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- ShowInfoText(playerid, "~r~WARNING:~n~~w~ENTERED RESTRICTED AIRSPACE~n~~n~S.A.M. SITES ACTIVATED", 5000);
- SetTimerEx("LaunchMissile", 3000, 0, "i", playerid);
- return true;
- }
- }
- if(ApertureBA == 1)
- {
- PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/alarm.wav");
- }
- foreach(new i: Player)
- {
- if(Faction[playerid] != FACTION_RESEARCH && IsSpectating[playerid] == -1 && IsPlayerSpawned(playerid) && Faction[i] == FACTION_RESEARCH)
- {
- new Float:x, Float:y, Float:z, loc[16];
- GetPlayerPos(i, x, y, z);
- loc = GetNSEWBetweenPoints(213.9910, 1872.1245, 13.1406, x, y);
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessageF(i, 0x967100FF, "[Radio - 4205 MHz] A %s %s has been spotted entering the base perimeter from the %s.", VehicleColors[CarColor[GetPlayerVehicleID(playerid)][0]], GetVehicleName(GetPlayerVehicleID(playerid)), loc);
- }
- else
- {
- SendClientMessageF(i, 0x967100FF, "[Radio - 4205 MHz] An unknown person has been spotted entering the base perimeter from the %s.", loc);
- }
- }
- }
- }
- return true;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- if(StretcherHolding[playerid] == 1)
- {
- new Float:position[3];
- GetPlayerPos(playerid, position[0], position[1], position[2]);
- SetPlayerPos(playerid, position[0], position[1], position[2]);
- SysMsg(playerid, "You may not enter a vehicle with a stretcher equipped.");
- return true;
- }
- if(IsBike(vehicleid) && ispassenger == 0)
- {
- if(IsPushBike(vehicleid)) return true;
- if(LicenseSuspendTime[playerid][LICENSE_BIKE] > 0)
- {
- SysMsg(playerid, "Your motorbike license has been suspended. If caught, you may face serious charges.");
- }
- else if(Licenses[playerid][LICENSE_BIKE] == 0 && DMV_Testing[playerid] == 0)
- {
- SysMsgF(playerid,"You need an MB license to legally operate this %s.", GetVehicleName(vehicleid));
- SysMsg(playerid, "You may get in trouble with the police if you drive it without the appropriate license.");
- return 1;
- }
- }
- if(IsBoat(vehicleid) && ispassenger == 0)
- {
- if(LicenseSuspendTime[playerid][LICENSE_BOAT] > 0)
- {
- SysMsg(playerid, "Your boat license has been suspended. If caught, you may face serious charges");
- }
- else
- {
- if(Licenses[playerid][LICENSE_BOAT] == 0 && DMV_Testing[playerid] == 0)
- {
- TogglePlayerControllable(playerid, 0);
- SysMsgF(playerid, "You need a boat license to operate this %s.", GetVehicleName(vehicleid));
- RemovePlayerFromVehicle(playerid);
- TogglePlayerControllable(playerid,1);
- return true;
- }
- }
- }
- if(IsHelicopter(vehicleid) && ispassenger == 0)
- {
- if(LicenseSuspendTime[playerid][LICENSE_HELI] > 0)
- {
- SysMsg(playerid, "Keep in mind that your A1 license is suspended. If you're caught you'll be in trouble...");
- }
- else
- {
- if(Licenses[playerid][LICENSE_HELI] == 0 && DMV_Testing[playerid] == 0)
- {
- TogglePlayerControllable(playerid, 0);
- SysMsgF(playerid, "You need a helicopter license to operate this %s.", GetVehicleName(vehicleid));
- RemovePlayerFromVehicle(playerid);
- TogglePlayerControllable(playerid,1);
- return true;
- }
- }
- }
- if(IsPlane(vehicleid) && ispassenger == 0)
- {
- if(LicenseSuspendTime[playerid][LICENSE_PLANE] > 0)
- {
- SysMsg(playerid, "Your plane license has been suspended. If caught, you may face serious charges.");
- }
- else
- {
- if(Licenses[playerid][LICENSE_PLANE] == 0 && DMV_Testing[playerid] == 0)
- {
- TogglePlayerControllable(playerid, 0);
- SysMsgF(playerid, "You need a plane license to operate this %s.", GetVehicleName(vehicleid));
- RemovePlayerFromVehicle(playerid);
- TogglePlayerControllable(playerid,1);
- return true;
- }
- }
- }
- if(IsLargeVeh(vehicleid) && ispassenger == 0)
- {
- if(LicenseSuspendTime[playerid][LICENSE_LGV] > 0)
- {
- SysMsg(playerid, "Your Large Vehicle license has been suspended. If caught, you may face serious charges.");
- }
- else
- {
- if(Licenses[playerid][LICENSE_LGV] == 0 && DMV_Testing[playerid] == 0)
- {
- SysMsgF(playerid,"You need a Large Vehicle license to legally operate this %s.", GetVehicleName(vehicleid));
- SysMsg(playerid, "You may get in trouble with the police if you drive it without the appropriate license.");
- return true;
- }
- }
- }
- if(!IsLargeVeh(vehicleid) && !IsPlane(vehicleid) && !IsHelicopter(vehicleid) && !IsBike(vehicleid) && !IsBoat(vehicleid) && ispassenger == 0)
- {
- if(LicenseSuspendTime[playerid][LICENSE_CAR] > 0)
- {
- SysMsg(playerid, "Your Car license has been suspended. If caught, you may face serious charges.");
- }
- else
- {
- if(Licenses[playerid][LICENSE_CAR] == 0 && DMV_Testing[playerid] == 0)
- {
- SysMsgF(playerid, "You need a Car license to legally operate this %s.", GetVehicleName(vehicleid));
- SysMsg(playerid, "You may get in trouble with the police if you drive it without the appropriate license.");
- return true;
- }
- }
- }
- return true;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- if(GetPVarInt(playerid, "DriveBy") == 1)
- {
- RemovePlayerDriveby(playerid);
- }
- if((IsTruck(vehicleid) || GetVehicleModel(vehicleid) == 498) && IsTrucking[playerid] == 1)
- {
- if(Faction[playerid] == FACTION_TRUCKING)
- {
- ET_GetOutTime[playerid] = 15;
- SendClientMessage(playerid, COLOR_WHITE, "You must return to the truck within {FF0000}15{FFFFFF} minutes in order to continue the job.");
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "Your Trucking job has been cancelled as you have exited the vehicle.");
- DisablePlayerCheckpoint(playerid);
- TruckIndex[playerid] = 0;
- IsTrucking[playerid] = 0;
- SidejobDamage[playerid] = 0;
- EmptyTruckingTrailer(TruckingTrailer[playerid]);
- DestroyVehicleEx(TruckingTrailer[playerid], "TruckingTrailer[playerid] 0");
- TruckingTrailer[playerid] = 0;
- if(DeliveringFuel[playerid] > 0)
- {
- if(ET_GetOutTime[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "You have got out the Truck so the job has been cancelled.");
- DisablePlayerCheckpoint(playerid);
- DeiveringFuelAmount[playerid] = 0;
- DeiveringFuelType[playerid] = 0;
- if(DeliveringFuel[playerid] >= 2) DestroyVehicleEx(DeliveringFuelVeh[playerid][1], "DeliveringFuelVeh[playerid][1] 0");
- if(DeliveringFuelLabel[playerid] != Text3D:INVALID_3DTEXT_ID)
- {
- DestroyDynamic3DTextLabel(DeliveringFuelLabel[playerid]);
- DeliveringFuelLabel[playerid] = Text3D:INVALID_3DTEXT_ID;
- }
- DeliveringFuel[playerid] = 0;
- }
- }
- }
- }
- if(IsBus(vehicleid) && IsDrivingBus{playerid})
- {
- SendClientMessage(playerid, COLOR_WHITE, "Your Bus job has been cancelled as you have exited the vehicle.");
- DisablePlayerRaceCheckpoint(playerid);
- BusRouteIndex[playerid] = -1;
- IsDrivingBus{playerid} = false;
- WaitingAtStop{playerid} = false;
- SidejobDamage[playerid] = 0;
- }
- if(IsDumper(vehicleid) && IsCoalmining[playerid] > 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Your Dumper job has been cancelled as you have exited the vehicle.");
- DisablePlayerCheckpoint(playerid);
- CoalmineIndex[playerid] = 0;
- IsCoalmining[playerid] = 0;
- SidejobDamage[playerid] = 0;
- }
- if(IsTrashMan[playerid] == 1)
- {
- TrashMissionData[playerid][1] = 60;
- ShowInfoText(playerid, "~r~60~w~ seconds to get back inside the Trashmaster", 1100);
- }
- TextDrawHideForPlayer(playerid, VehicleEngineText);
- if(InCarCharging[playerid] == 1)
- {
- InCarCharging[playerid] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET Battery = %i WHERE id = %i", floatround(PhoneData[playerid][pBattery]), PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, COLOR_YELLOW, "Your phone is no longer charging in the vehicle.");
- }
- if(InOwnedVehicle[playerid] > 0) InOwnedVehicle[playerid] = 0;
- if(TaxiFare[playerid] > 0)
- {
- foreach(new i: Player)
- {
- if(GetPlayerVehicleID(i) == vehicleid && TaxiFareID[i] == playerid)
- {
- if(Job[i] == JOB_TAXI && GetPlayerState(i) == PLAYER_STATE_DRIVER)
- {
- SendClientMessageF(playerid, COLOR_YELLOW, "You have got out of the Taxi. The fare was $%i.", TaxiFare[playerid]);
- SendClientMessageF(i, COLOR_YELLOW, "%s has got out of the Taxi. They have paid the fare of $%i.", NameEx(playerid), TaxiFare[playerid]);
- if(TaxiFare[playerid] > (Cash[playerid]))
- {
- new owes = TaxiFare[playerid] - Cash[playerid];
- TaxiFare[playerid] = Cash[playerid];
- SendClientMessageF(playerid, COLOR_YELLOW, "(( You have only paid $%i of the fare with $%i left to pay. ))", TaxiFare[playerid], owes);
- SendClientMessageF(i, COLOR_YELLOW, "(( %s has not got enough money to pay fully. Paid $%i with $%i left to pay. ))", NameEx(playerid), TaxiFare[playerid], owes);
- }
- GivePlayerCash(playerid, -TaxiFare[playerid]);
- GivePlayerCash(i, TaxiFare[playerid]);
- TaxiFare[playerid] = 0;
- TaxiFareID[i] = -1;
- TaxiMeter[i] = 0;
- }
- }
- }
- }
- if(AwaitingSpray[playerid] == 1)
- {
- AwaitingSpray[playerid] = 0;
- SendClientMessageF(playerid, COLOR_WHITE, "You have got out of the vehicle that Mechanic %s was going to spray. The spray was cancelled.", NameEx(MechanicSpray[vehicleid][0]));
- SendClientMessageF(MechanicSpray[vehicleid][0], COLOR_WHITE, "The customer (%s) has got out the vehicle you were going to spray. The spray was cancelled.", NameEx(playerid));
- MechanicSpray[vehicleid][0] = -1;
- MechanicSpray[vehicleid][1] = -1;
- MechanicSpray[vehicleid][2] = -1;
- MechanicSpray[vehicleid][3] = -1;
- MechanicSpray[vehicleid][4] = -1;
- MechanicSpray[vehicleid][5] = -1;
- }
- if(playerid == MechanicSpray[vehicleid][0] && vehicleid == MechanicSpray[vehicleid][5])
- {
- AwaitingSpray[MechanicSpray[vehicleid][1]] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "You have got out of the vehicle you were going to spray. The spray was cancelled.");
- SendClientMessageF(MechanicSpray[vehicleid][1], COLOR_WHITE, "The Mechanic (%s) has got out the vehicle they were going to spray for you. The spray was cancelled.", NameEx(playerid));
- MechanicSpray[vehicleid][0] = -1;
- MechanicSpray[vehicleid][1] = -1;
- MechanicSpray[vehicleid][2] = -1;
- MechanicSpray[vehicleid][3] = -1;
- MechanicSpray[vehicleid][4] = -1;
- MechanicSpray[vehicleid][5] = -1;
- }
- if(Hotwiring[playerid][0] > 0)
- {
- Hotwiring[playerid][0] = 0;
- Hotwiring[playerid][1] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "Hotwiring has been cancelled as you have exited the vehicle.");
- }
- if(EngineStartDelay[playerid] > 0) EngineStartDelay[playerid] = 0;
- //PlayerTextDrawHide(playerid, FuelText[playerid]);
- HideFuelTDForPlayer(playerid);
- PlayerTextDrawHide(playerid, SpeedText[playerid]);
- PlayerTextDrawHide(playerid, SpeedTextM[playerid]);
- PlayerTextDrawHide(playerid, Speedo3dl[playerid]);
-
- OcultarVeh03DL(playerid);
- TextDrawHideForPlayer(playerid, texmilhas3dl); //
- TextDrawHideForPlayer(playerid, luzesTxD3dl); //
- TextDrawHideForPlayer(playerid, texmilhas3dl1); //
- TextDrawHideForPlayer(playerid, lockedTxD3dl);
- TextDrawHideForPlayer(playerid, unlockedTxD3dl);
- foreach(new p: Player)
- {
- if(IsSpectating[p] == playerid)
- {
- PlayerTextDrawHide(p, SpeedText[playerid]);
- PlayerTextDrawHide(p, SpeedTextM[playerid]);
- PlayerTextDrawHide(p, Speedo3dl[playerid]);
- TextDrawHideForPlayer(p, texmilhas3dl); //
- }
- }
- return true;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- if(Job[forplayerid] == JOB_TAXI && JobDuty[forplayerid] == 1 && PlayerCalledTaxi[playerid] == 1)
- {
- SetPlayerMarkerForPlayer(forplayerid, playerid, COLOR_YELLOW);
- }
- return true;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- if(IsPlayerMasked{playerid})
- {
- if(ADuty[forplayerid] == 1)
- {
- ShowPlayerNameTagForPlayer(forplayerid, playerid, 1);
- }
- else
- {
- ShowPlayerNameTagForPlayer(forplayerid, playerid, 0);
- }
- FormatHealthLabelText(playerid, HealthVar[playerid], ArmourVar[playerid], 2);
- }
- if(Job[forplayerid] == JOB_TAXI && JobDuty[forplayerid] == 1 && PlayerCalledTaxi[playerid] == 1)
- {
- SetPlayerMarkerForPlayer(forplayerid, playerid, COLOR_YELLOW);
- }
- return true;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return true;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- if(CarColor[vehicleid][0] != -1 && CarColor[vehicleid][1] != -1)
- {
- ChangeVehicleColorEx(vehicleid, CarColor[vehicleid][0], CarColor[vehicleid][1]);
- }
- if(Locked{vehicleid}) return ToggleVehicleLock(vehicleid, 1);
- else ToggleVehicleLock(vehicleid, 0);
- return true;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- if(!IsPlayerAdmin(playerid) && GetPlayerInterior(playerid) == 0)
- {
- //
- }
- return true;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return true;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return true;
- }
- public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
- {
- /*if(Faction[playerid] == FACTION_RESEARCH && IsFactionVehicle(vehicleid) == FACTION_RESEARCH || IsCop(playerid) && IsFactionVehicle(vehicleid) == FACTION_COP)
- {
- if(newstate == 1)
- {
- if(!Siren{vehicleid}) cmd_siren(playerid, "");
- if(!ELMs{vehicleid}) cmd_elm(playerid, "");
- }
- return true;
- }*/
- return true;
- }
- public OnEnterExitModShop(playerid, enterexit, interiorid)
- {
- new vid = GetPlayerVehicleID(playerid);
- if(enterexit == 1) //entering
- {
- EngineStatus[vid] = 0;
- ToggleVehicleEngine(vid, 0);
- HideFuelTDForPlayer(playerid);
- //PlayerTextDrawHide(playerid, FuelText[playerid]);
- PlayerTextDrawHide(playerid, SpeedText[playerid]);
- PlayerTextDrawHide(playerid, SpeedTextM[playerid]);
- PlayerTextDrawHide(playerid, Speedo3dl[playerid]);
- OcultarVeh03DL(playerid);
- TextDrawHideForPlayer(playerid, texmilhas3dl); //
- TextDrawHideForPlayer(playerid, luzesTxD3dl); //
- TextDrawHideForPlayer(playerid, texmilhas3dl1); //
- TextDrawHideForPlayer(playerid, lockedTxD3dl);
- TextDrawHideForPlayer(playerid, unlockedTxD3dl); // //
- foreach(new p: Player) if(IsSpectating[p] == playerid) PlayerTextDrawHide(p, SpeedText[playerid]);
- foreach(new p: Player) if(IsSpectating[p] == playerid) PlayerTextDrawHide(p, SpeedTextM[playerid]);
- foreach(new p: Player) if(IsSpectating[p] == playerid) PlayerTextDrawHide(p, Speedo3dl[playerid]);
- foreach(new p: Player) if(IsSpectating[p] == playerid) TextDrawHideForPlayer(playerid, texmilhas3dl); //
- foreach(new p: Player) if(IsSpectating[p] == playerid) TextDrawHideForPlayer(playerid, luzesTxD3dl); //
- foreach(new p: Player) if(IsSpectating[p] == playerid) TextDrawHideForPlayer(playerid, texmilhas3dl1); //
- foreach(new p: Player) if(IsSpectating[p] == playerid) TextDrawHideForPlayer(playerid, lockedTxD3dl); //
- foreach(new p: Player) if(IsSpectating[p] == playerid) TextDrawHideForPlayer(playerid, unlockedTxD3dl); //
- }
- else if(enterexit == 0) //exit
- {
- for(new mod = 0; mod < 14; mod++)
- {
- if(GetVehicleComponentInSlot(vid, mod) > 0) RemoveVehicleComponent(vid, GetVehicleComponentInSlot(vid, mod));
- }
- }
- return true;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- new VehID = GetPlayerVehicleID(playerid);
- if(KeyPressed(KEY_HANDBRAKE))
- {
- if(VehID > MAX_SERVER_CARS && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && IsPlayerRefilling[playerid] == 0 && EngineStartDelay[playerid] == 0 && EngineStatus[VehID] == 0)
- {
- return cmd_eon(playerid);
- }
- }
- else if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER && newkeys & KEY_CROUCH && GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
- {
- if(22 <= GetPlayerWeapon(playerid) <= 38 && GetPlayerWeapon(playerid) != 24)
- {
- SetPVarInt(playerid, "DriveBy", 1);
- }
- return true;
- }
- else if((newkeys & KEY_SECONDARY_ATTACK || newkeys & KEY_CROUCH) && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER && GetPVarInt(playerid, "DriveBy") == 1)
- {
- RemovePlayerDriveby(playerid);
- return true;
- }
- else if(KeyPressed(KEY_YES)) return cmd_enter(playerid, "");
- else if(KeyPressed(KEY_CTRL_BACK)) return cmd_exit(playerid);
- else if(KeyPressed(KEY_NO)) return cmd_lock(playerid, "");
- else if(KeyPressed(KEY_WALK) && BeingTeleported{playerid})
- {
- TeleportTimer[playerid] = 0;
- TeleportPlayer(playerid);
- return true;
- }
- else if(KeyPressed(KEY_SUBMISSION))
- {
- if(IsBoat(VehID) || IsPlane(VehID) || IsHelicopter(VehID)) return true;
- if(VehID > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && !ELMs{VehID})
- {
- // If lights on, turn off
- if(VehicleLights[VehID] == 1)
- {
- ToggleVehicleLights(VehID, 0);
- VehicleLights[VehID] = 0;
- TextDrawHideForPlayer(playerid, luzesTxD3dl);
- }
- else // If lights off, turn on
- {
- ToggleVehicleLights(VehID, 1);
- VehicleLights[VehID] = 1;
- TextDrawShowForPlayer(playerid, luzesTxD3dl);
- PlayerLightToggleTick[playerid] = GetTickCount();
- }
- }
- }
- else if(KeyRelease(KEY_SUBMISSION) && !ELMs{VehID})
- {
- // If not held for long (tapped), turn lights off
- new halfping = GetPlayerPing(playerid) / 2; // Lag comp
- if(GetTickCount()-PlayerLightToggleTick[playerid] < LIGHT_TOGGLE_DELAY+halfping)
- {
- ToggleVehicleLights(VehID, 0);
- VehicleLights[VehID] = 0;
- TextDrawHideForPlayer(playerid, luzesTxD3dl);
- }
- }
- if(PfSpec[playerid][FlySpec] == 1)
- {
- if((newkeys & KEY_JUMP) && !(oldkeys & KEY_JUMP))
- {
- PfSpec[playerid][fspeed] = 150;
- }
- if((newkeys & KEY_SPRINT) && !(oldkeys & KEY_SPRINT))
- {
- PfSpec[playerid][fspeed] = 10;
- }
- if(!(newkeys & KEY_JUMP) && (oldkeys & KEY_JUMP))
- {
- PfSpec[playerid][fspeed] = 50;
- }
- if(!(newkeys & KEY_SPRINT) && (oldkeys & KEY_SPRINT))
- {
- PfSpec[playerid][fspeed] = 50;
- }
- }
- if(gPlayerUsingLoopingAnim[playerid] == 1 && newkeys & KEY_HANDBRAKE && !(oldkeys & KEY_HANDBRAKE))
- {
- StopLoopingAnim(playerid);
- TextDrawHideForPlayer(playerid,txtAnimHelper);
- }
- if(newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP) && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED)
- {
- OnePlayAnim(playerid, "GYMNASIUM", "gym_jog_falloff", 4.1, 0, 1, 1, 0, 0);
- }
- if(KeyPressed(KEY_SECONDARY_ATTACK) && pRefilling[playerid] == 4)
- {
- pRefilling[playerid] = 0;
- TogglePlayerControllable(playerid, 1);
- }
- if((newkeys & KEY_AIM) == KEY_AIM)
- {
- if(GetPlayerWeapon(playerid) == 43 || GetPlayerWeapon(playerid) == 34)
- {
- for(new ao = 0; ao < 6; ao++)
- {
- if(AttachedObjects[playerid][ao][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, ao);
- AttachedObjects[playerid][ao][aoRemoved] = true;
- }
- }
- }
- }
- if(((newkeys & KEY_AIM) != KEY_AIM) && ((oldkeys & KEY_AIM) == KEY_AIM))
- {
- if(GetPlayerWeapon(playerid) == 43 || GetPlayerWeapon(playerid) == 34)
- {
- for(new ao = 0; ao < 6; ao++)
- {
- if(AttachedObjects[playerid][ao][aoRemoved])
- {
- SetPlayerAttachedObject(playerid, ao, AttachedObjects[playerid][ao][aoModelID], AttachedObjects[playerid][ao][aoBone], AttachedObjects[playerid][ao][aoOffset][0], AttachedObjects[playerid][ao][aoOffset][1],
- AttachedObjects[playerid][ao][aoOffset][2], AttachedObjects[playerid][ao][aoRot][0], AttachedObjects[playerid][ao][aoRot][1], AttachedObjects[playerid][ao][aoRot][2], AttachedObjects[playerid][ao][aoScale][0],
- AttachedObjects[playerid][ao][aoScale][1], AttachedObjects[playerid][ao][aoScale][2], AttachedObjects[playerid][ao][aoColor], AttachedObjects[playerid][ao][aoColor]);
- AttachedObjects[playerid][ao][aoRemoved] = false;
- }
- }
- }
- }
- return true;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- // Spawn stretchers
- if(oldstate == PLAYER_STATE_PASSENGER && newstate == PLAYER_STATE_ONFOOT && StretcherHolding[playerid]) SpawnStretcher(playerid);
- new Car;
- Car = GetPlayerVehicleID(playerid);
- if(newstate == PLAYER_STATE_ONFOOT)
- {
- CurrentWeapon[playerid] = -1;
- if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
- {
- if(ViewingBuyableCar[playerid] == 1)
- {
- ViewingBuyableCar[playerid] = 0;
- }
- if(DMV_Testing[playerid] > 0 && DMV_Testing[playerid] < 10)
- {
- FailDMVTest(playerid, "Exited test vehicle");
- }
- TextDrawHideForPlayer(playerid, LowFuelText);
- if(StretcherHolding[playerid] == 1)
- {
- AttachDynamicObjectToPlayer(StretcherEquipped[playerid], playerid, 0.0, 1.5, -1.0, 0.0, 0.0, 180.0);
- StretcherHolding[playerid] = 2;
- }
- if(InOwnedVehicle[playerid] > 0) InOwnedVehicle[playerid] = 0;
- EngineStartDelay[playerid] = 0;
- }
- if(oldstate == PLAYER_STATE_DRIVER)
- {
- if(pRefilling[playerid] == 1)
- {
- StartRefueling(playerid);
- }
- }
- foreach(new i: Player)
- {
- if(IsSpectating[i] == playerid)
- {
- PlayerSpectatePlayer(i, playerid, SPECTATE_MODE_NORMAL);
- }
- }
- if(IsInFactionCar[playerid] > 0)
- {
- FVehicleData[IsInFactionCar[playerid]][LastDriver] = SQLID[playerid];
- FVehicleData[IsInFactionCar[playerid]][LastDriverTime] = gettime();
- IsInFactionCar[playerid] = 0;
- }
- StopAudioStreamForPlayer(playerid);
- foreach(new p: Player)
- {
- if(IsPlayerInRangeOfPoint(playerid, Boomboxes[p][BoomRange], Boomboxes[p][BoomPos][0], Boomboxes[p][BoomPos][1], Boomboxes[p][BoomPos][2]) && GetPlayerVirtualWorld(playerid) == 0)
- {
- if(Boomboxes[p][BoomOID] >= 1)
- {
- if(!IsPlayerInAnyVehicle(playerid))
- {
- if(strlen(Boomboxes[p][BoomStation]) >= 6)
- {
- if(Boomboxes[p][BoomIsPlaying])
- {
- ListeningBoom[playerid] = p;
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayerEx(playerid, Boomboxes[p][BoomStation], Boomboxes[p][BoomPos][0], Boomboxes[p][BoomPos][1], Boomboxes[p][BoomPos][2], Boomboxes[p][BoomRange], 1);
- }
- }
- }
- }
- }
- }
- return true;
- }
- if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
- {
- if(!IsBoat(GetPlayerVehicleID(playerid))) JustEnteredVehicle[playerid]++;
- format(tgstr, sizeof(tgstr),"~w~%s",GetVehicleName(Car));
- GameTextForPlayer(playerid, tgstr, 2000, 1);
- foreach(new i: Player)
- {
- if(IsSpectating[i] == playerid)
- {
- PlayerSpectateVehicle(i, Car, SPECTATE_MODE_NORMAL);
- }
- }
- if(ChangeOilVehID[playerid] > 0)
- {
- RemovePlayerAttachedObject(playerid, HOLD_OBJECT_MISC);
- DisablePlayerCheckpoint(playerid);
- ChangeOilPos[playerid][0] = 0.0;
- ChangeOilPos[playerid][1] = 0.0;
- ChangeOilPos[playerid][2] = 0.0;
- ChangeOilVehID[playerid] = 0;
- }
- if(vMusicPlaying{Car})
- {
- sgstr[0] = EOS;
- strunpack(sgstr, vMusicLink[Car]);
- PlayAudioStreamForPlayerEx(playerid, sgstr);
- }
- if(!IsPlayerAdmin(playerid))
- {
- new holdingWeapon = GetPlayerWeapon(playerid);
- if(holdingWeapon == 27 || holdingWeapon == 24 || holdingWeapon == 34 || holdingWeapon == 23) SetPlayerArmedWeapon(playerid, 0);
- }
- }
- if(IsPlayerNPC(playerid)) return true;
- if(newstate == PLAYER_STATE_DRIVER)
- {
- if(IsOwnedCar(Car))
- {
- new count;
- for(new x = 0; x < 14; x++)
- {
- if(ModQueue[playerid][x] != 0)
- {
- count = 1;
- break;
- }
- }
- if(count == 1 && !IsPlayerInDynamicArea(playerid, GarageAreas[0]) && !IsPlayerInDynamicArea(playerid, GarageAreas[1]) && !IsPlayerInDynamicArea(playerid, GarageAreas[2]) && !IsPlayerInDynamicArea(playerid, GarageAreas[4]))
- {
- if(VehicleData[GetPlayerVehicleID(playerid)][VehicleOwnerSQLID] == SQLID[playerid])
- {
- new component;
- for(new x = 0; x < 14; x++) //removes pending components from the vehicle and then readds saved mods
- {
- component = GetVehicleComponentInSlot(Car, x);
- if(component != 0) RemoveVehicleComponent(Car, component);
- if(VehicleData[Car][VehicleMod][x] && IsVehicleUpgradeCompatible(VehicleData[Car][VehicleModel], VehicleData[Car][VehicleMod][x]))
- {
- AddVehicleComponent(VehicleData[Car][IdVehicle], VehicleData[Car][VehicleMod][x]);
- }
- ModQueue[playerid][x] = 0;
- }
- if(PendingPaintjob[playerid] != -1) ChangeVehiclePaintjob(Car, 3);
- PendingPaintjob[playerid] = -1;
- if(VehicleData[Car][VehiclePaintjob] < 3) ChangeVehiclePaintjob(Car, VehicleData[Car][VehiclePaintjob]);
- }
- }
- }
- if(BMXBanned[playerid] == 1 && IsPushBike(Car))
- {
- SysMsg(playerid, "You don't have permission to use this bike.");
- SetTimerEx("UnFreezePlayer", 1000, 0, "i", playerid);
- RemovePlayerFromVehicle(playerid);
- TogglePlayerControllable(playerid, 0);
- }
- if(DMV_TestVehicle[playerid] == Car && DMVCarForPlayer[Car] == playerid && DMV_Testing[playerid] == 10)
- {
- EngineStatus[Car] = 1;
- ToggleVehicleEngine(Car, 1);
- Fuel[Car] = 100;
- AdminLocked{Car} = true;
- VehicleBroke[Car] = 0;
- SetCameraBehindPlayer(playerid);
- SetPlayerWorldBounds(playerid, 20000.0000, -20000.0000, 20000.0000, -20000.0000);
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(Car, engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(Car, engine, lights, alarm, 1, bonnet, boot, objective);
- SetVehicleParamsForPlayer(Car, playerid, Objective[Car][playerid], 1);
- DMV_Index[playerid] = 0;
- DMV_TimeTaken[playerid] = 0;
- DMV_Testing[playerid] = DMV_ChosenTest[playerid];
- DMV_ChosenTest[playerid] = 0;
- DMV_SpeedLimit[playerid] = TestData_Speeds[DMV_Testing[playerid]-1][DMV_Index[playerid]];
- new cp_type;
- switch(DMV_Testing[playerid])
- {
- case 1,2,3,4: cp_type = 0;
- case 5,6: cp_type = 3;
- }
- SetPlayerRaceCheckpointEx(playerid, cp_type, TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]][0], TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]][1], TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]][2], TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]+1][0], TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]+1][1], TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]+1][2], 5.0);
- SysMsg(playerid,"Your test has begun. Follow the marked route and ensure you follow all the rules displayed on the right hand side.");
- }
- if(PlayerToBeDetained[playerid] != -1)
- {
- if(IsPlayerConnected(PlayerToBeDetained[playerid]))
- {
- PutPlayerInVehicle(PlayerToBeDetained[playerid], Car, PlayerToBeDetainedSeat[playerid]);
- TogglePlayerControllable(PlayerToBeDetained[playerid], 0);
- PlayerToBeDetained[playerid] = -1;
- PlayerToBeDetainedSeat[playerid] = -1;
- }
- }
- new mycar = 0;
- if(VehicleData[Car][VehicleOwnerSQLID] > 0)
- {
- if(VehicleBorrowKey[playerid] != 0 && VehicleBorrowKey[playerid] == VehicleData[Car][VehSQLID] && VehicleData[Car][VehicleOwnerSQLID] != SQLID[playerid])
- {
- SendClientMessageF(playerid, COLOR_YELLOW, "You are currently sharing this %s with %s. You have %i minutes left to use it.", GetVehicleNameEx(VehicleData[Car][VehicleModel]), GetSQLName(VehicleData[Car][VehicleOwnerSQLID]), VehicleBorrowKeyTime[playerid]);
- TogglePlayerControllable(playerid,1);
- mycar = 1;
- InOwnedVehicle[playerid] = Car;
- }
- else
- {
- if(VehicleData[Car][VehicleOwnerSQLID] == SQLID[playerid])
- {
- SendClientMessageF(playerid, COLOR_YELLOW, "Welcome back to your %s %s.", GetVehicleNameEx(VehicleData[Car][VehicleModel]), GetPlayersFirstName(playerid));
- TogglePlayerControllable(playerid,1);
- if(VehicleHasEngine(Car) == 0)
- {
- EngineStatus[Car] = 1;
- Fuel[Car] = 100;
- ToggleVehicleEngine(Car, 1);
- }
- if(VehicleData[Car][TicketAmount] > 0)
- {
- SendClientMessageF(playerid, COLOR_YELLOW, "This vehicle has a parking fine of $%i. By order of Law, please pay it now using /PayParkingTicket.", VehicleData[Car][TicketAmount]);
- }
- mycar = 1;
- InOwnedVehicle[playerid] = Car;
- }
- }
- if(mycar == 0)
- {
- if(!IsPlayerAdmin(playerid))
- {
- if(EngineStatus[Car] == 0 && VehicleHasEngine(Car))
- {
- if(IsPlayerAdminLevelOK(playerid, 1)) SendClientMessageF(playerid,COLOR_YELLOW, "This %s is owned by %s, you must hotwire it if you wish to use it.", GetSQLName(VehicleData[Car][VehicleOwnerSQLID]));
- else SendClientMessageF(playerid,COLOR_YELLOW, "This %s is owned by someone, you must hotwire it if you wish to use it.");
- }
- ViewingBuyableCar[playerid] = 1;
- //PlayerTextDrawHide(playerid,FuelText[playerid]);
- HideFuelTDForPlayer(playerid);
- PlayerTextDrawHide(playerid,SpeedText[playerid]);
- PlayerTextDrawHide(playerid,SpeedTextM[playerid]);
- PlayerTextDrawHide(playerid,Speedo3dl[playerid]);
- TextDrawHideForPlayer(playerid, texmilhas3dl); //
- TextDrawHideForPlayer(playerid, luzesTxD3dl); //
- TextDrawHideForPlayer(playerid, texmilhas3dl1); //
- TextDrawHideForPlayer(playerid, lockedTxD3dl);
- TextDrawHideForPlayer(playerid, unlockedTxD3dl); //
- foreach(new p: Player)
- {
- if(IsSpectating[p] == playerid)
- {
- PlayerTextDrawHide(p, SpeedText[playerid]);
- PlayerTextDrawHide(p, SpeedTextM[playerid]);
- PlayerTextDrawHide(p, Speedo3dl[playerid]);
- TextDrawHideForPlayer(p, texmilhas3dl); //
- }
- }
- }
- else SendClientMessageF(playerid,COLOR_YELLOW,"This %s is owned by %s, you are allowed to drive it due to having Server Admin.", GetSQLName(VehicleData[Car][VehicleOwnerSQLID]));
- }
- }
- if(VehicleHasEngine(Car))
- {
- if(Fuel[Car] <= 0)
- {
- EngineStatus[Car] = 0;
- ToggleVehicleEngine(Car, 0);
- SendClientMessage(playerid,COLOR_YELLOW,"This vehicle has no fuel and the engine is off.");
- if(VehicleData[Car][Hotwired] == 1) VehicleData[Car][Hotwired] = 0;
- if(SpeedoActive[playerid] == 1)
- {
- if(SpeedFormat[playerid] == 0)
- {
- PlayerTextDrawSetString(playerid, SpeedText[playerid],"~g~VEL ~w~0 MPH");
- PlayerTextDrawHide(playerid,SpeedText[playerid]);
- PlayerTextDrawHide(playerid,Speedo3dl[playerid]);
- TextDrawHideForPlayer(playerid, texmilhas3dl); //
- TextDrawHideForPlayer(playerid, luzesTxD3dl); //
- TextDrawHideForPlayer(playerid, texmilhas3dl1); //
- TextDrawHideForPlayer(playerid, lockedTxD3dl);
- TextDrawHideForPlayer(playerid, unlockedTxD3dl); //
- foreach(new p: Player)
- {
- if(IsSpectating[p] == playerid)
- {
- PlayerTextDrawHide(p, SpeedText[playerid]);
- }
- }
- }
- else if(SpeedFormat[playerid] == 1)
- {
- PlayerTextDrawSetString(playerid, SpeedText[playerid],"~g~VEL ~w~0 KM/H");
- PlayerTextDrawHide(playerid,SpeedText[playerid]);
- foreach(new p: Player)
- {
- if(IsSpectating[p] == playerid)
- {
- PlayerTextDrawHide(p, SpeedText[playerid]);
- }
- }
- }
- }
- }
- else
- {
- if(EngineStatus[Car] == 0 && ViewingBuyableCar[playerid] == 0)
- {
- TextDrawShowForPlayer(playerid, VehicleEngineText);
- }
- else
- {
- if(SpeedoActive[playerid] == 1)
- {
- if(SpeedFormat[playerid] == 0)
- {
- PlayerTextDrawSetString(playerid, SpeedText[playerid],"~g~VEL ~w~0 MPH");
- PlayerTextDrawShow(playerid,SpeedText[playerid]);
- foreach(new p: Player)
- {
- if(IsSpectating[p] == playerid)
- {
- PlayerTextDrawShow(p, SpeedText[playerid]);
- }
- }
- }
- else if(SpeedFormat[playerid] == 1)
- {
- PlayerTextDrawSetString(playerid, SpeedText[playerid],"~g~VEL ~w~0 KM/H");
- PlayerTextDrawShow(playerid,SpeedText[playerid]);
- foreach(new p: Player)
- {
- if(IsSpectating[p] == playerid)
- {
- PlayerTextDrawShow(p, SpeedText[playerid]);
- }
- }
- }
- }
- }
- }
- }
- if(FVehicleData[Car][FactionVehID] == Car)
- {
- if(FVehicleData[Car][FVFaction] > 0)
- {
- if((Faction[playerid] != FVehicleData[Car][FVFaction] || (Faction[playerid] == FVehicleData[Car][FVFaction] && FactionRank[playerid] < FVehicleData[Car][FVMinRank])) && !IsPlayerAdmin(playerid))
- {
- if(Faction[playerid] == FVehicleData[Car][FVFaction] || IsPlayerAdminLevelOK(playerid, 1)) SysMsgF(playerid, "[veículo Facção] Facção: %s, Rank: %i+", GetFactionNameFromId(FVehicleData[Car][FVFaction]), FVehicleData[Car][FVMinRank]);
- else SysMsg(playerid, "You cannot use this faction vehicle.");
- RemovePlayerFromVehicle(playerid);
- TogglePlayerControllable(playerid,false);
- SetTimerEx("UnFreezePlayer", 1000, 0, "d", playerid);
- }
- else
- {
- if(IsPlayerAdmin(playerid)) SysMsgF(playerid, "[Faction Vehicle] Faction: %s, Rank: %i+", GetFactionNameFromId(FVehicleData[Car][FVFaction]), FVehicleData[Car][FVMinRank]);
- IsInFactionCar[playerid] = Car;
- }
- }
- }
- if(VehicleBroke[Car] == 1 || VehicleBroke[Car] == 2)
- {
- if(IsOwnedCar(Car)) VehicleData[Car][Hotwired] = 0;
- EngineStatus[Car] = 0;
- ToggleVehicleEngine(Car, 0);
- SendClientMessage(playerid, COLOR_RED, "This vehicle is broken and needs to be fixed.");
- }
- if(IsTrucking[playerid] == 0 && IsTruck(Car) && IsPlayerInRangeOfPoint(playerid,50.0,66.75766,-128.393,1.57867) || (IsPlayerInRangeOfPoint(playerid,50.0,585.711547, 1664.336669, 6.992187) && Faction[playerid] == FACTION_TRUCKING))
- {
- SendClientMessage(playerid, COLOR_WHITE, "To begin the trucking sidejob use /truck. (Rule: You may not use this vehicle for personal use)");
- }
- if(IsPizzaCar(Car) && IsDelivering[playerid] != 1)
- {
- SendClientMessage(playerid, COLOR_WHITE, "To start the pizza delivery sidejob use /deliver. (Rule: You may not use this vehicle for personal use)");
- }
- if(IsBus(Car) && IsPlayerInRangeOfPoint(playerid,50.0,-29.788593,-306.246978,5.422851))
- {
- SendClientMessage(playerid, COLOR_WHITE, "To start the bus driver sidejob use /drivebus. (Rule: You may not use this vehicle for personal use)");
- }
- if(IsDumper(Car) && IsPlayerInRangeOfPoint(playerid,50.0,841.066101, 861.726196, 13.106781))
- {
- SendClientMessage(playerid, COLOR_WHITE, "To start the coalmine sidejob use /coalmine. (Rule: You may not use this vehicle for personal use)");
- }
- if(GetVehicleModel(Car) == 408 && IsPlayerInRangeOfPoint(playerid,75.0,601.516845, 1224.664794, 11.718750) && IsTrashMan[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "To start the trash collector sidejob use /collecttrash. (Rule: You may not use this vehicle for personal use)");
- }
- if(ET_GetOutTime[playerid] > 0)
- {
- ET_GetOutTime[playerid] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "You are now continuing the trucking job.");
- }
- if(DeliveringStock[playerid] == 1)
- {
- new modelid = GetVehicleModel(GetPlayerVehicleID(playerid));
- if(modelid == 456 || modelid == 498 || modelid == 499)
- {
- DeliveringStock[playerid] = 2;
- SendClientMessageF(playerid, COLOR_LIGHTGREEN, "[Business Stock Delivery 1] Delivering %s to %s", GetBizzDeliveryItem(DeliverStockList[playerid][0]), BizzData[DeliverStockList[playerid][0]][BizzDescription]);
- if(IsMallBizz(DeliverStockList[playerid][0])) SetPlayerRaceCheckpoint(playerid, 2, 123.621, 1057.21, 13.6159, 0.0, 0.0, 0.0, 20.0);
- else SetPlayerRaceCheckpoint(playerid, 2, BizzData[DeliverStockList[playerid][0]][oPosX], BizzData[DeliverStockList[playerid][0]][oPosY], BizzData[DeliverStockList[playerid][0]][oPosZ], 0.0, 0.0, 0.0, 20.0);
- }
- else SysMsg(playerid,"You must be in a Yankee, Boxville or Benson to deliver stock.");
- }
- if(Car == RentalData[Car][CarID] && RentalCar[playerid] != RentalData[Car][CarID])
- {
- SendClientMessageF(playerid, COLOR_WHITE, "You must rent this "COL_FURNGREEN"%s"COL_WHITE" if you wish to use it. Rental cost: "COL_MONEYGREEN"$%i"COL_WHITE" an hour.", GetVehicleName(Car), RentalData[Car][RentalPrice]);
- SendClientMessage(playerid, COLOR_WHITE, "Use "COL_FURNGREEN"/rentvehicle"COL_WHITE" to rent it.");
- }
- if(IsTrashMan[playerid] == 1 && TrashMissionData[playerid][1] > 0)
- {
- TrashMissionData[playerid][1] = 0;
- if(TrashMissionData[playerid][2] == 1)
- {
- SendClientMessage(playerid, COLOR_RED, "You still have to collect the trash from the bins.");
- }
- else if(TrashMissionData[playerid][2] == 2)
- {
- SendClientMessage(playerid, COLOR_RED, "You still have to empty the trash into the truck.");
- }
- else if(TrashMissionData[playerid][2] == 3)
- {
- TrashMissionData[playerid][2] = 0;
- TrashIndex[playerid] ++;
- if(TrashIndex[playerid] == 2)
- {
- SetPlayerCheckpointEx(playerid, -31.229806, 1181.527709, 19.352029, 5.0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Trash Location 2: Clothes store");
- }
- else if(TrashIndex[playerid] == 3)
- {
- SetPlayerCheckpointEx(playerid, -41.943851, 1170.851318, 19.501213, 5.0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Trash Location 3: Diner");
- }
- else if(TrashIndex[playerid] == 4)
- {
- SetPlayerCheckpointEx(playerid, -79.092018, 1160.491210, 19.742187, 5.0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Trash Location 4: Bowling club");
- }
- else if(TrashIndex[playerid] == 5)
- {
- SetPlayerCheckpointEx(playerid, -85.919143, 1358.617431, 10.331272, 5.0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Trash Location 5: Lil Probe Inn");
- }
- else if(TrashIndex[playerid] == 6)
- {
- SetPlayerCheckpointEx(playerid, -162.366821, 1218.922607, 19.742187, 5.0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Trash Location 6: King Ring Donuts");
- }
- else if(TrashIndex[playerid] == 7)
- {
- SetPlayerCheckpointEx(playerid, -191.992294, 1229.681640, 19.742187, 5.0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Trash Location 7: Cafe");
- }
- else if(TrashIndex[playerid] == 8)
- {
- SetPlayerCheckpointEx(playerid, -212.162811, 1225.386352, 19.735198, 5.0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Trash Location 8: Laundry shop");
- }
- else if(TrashIndex[playerid] == 9)
- {
- SetPlayerCheckpointEx(playerid, -259.445312, 1202.692382, 19.593750, 5.0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Trash Location 9: Recycle point");
- }
- else if(TrashIndex[playerid] == 10)
- {
- SetPlayerCheckpointEx(playerid, -284.545593261, 1038.09069824, 18.74218, 5.0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Trash Location 10: Hospital");
- }
- else if(TrashIndex[playerid] == 11)
- {
- SetPlayerCheckpointEx(playerid, -168.789703, 1017.749145, 19.742187, 5.0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Trash Location 11: General store");
- }
- else if(TrashIndex[playerid] == 12)
- {
- SetPlayerCheckpointEx(playerid, -164.707199, 1094.002563, 19.593750, 5.0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Trash Location 12: Bar");
- }
- else if(TrashIndex[playerid] == 13)
- {
- SetPlayerCheckpointEx(playerid, -83.070510, 1120.826049, 19.742187, 5.0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Trash Location 13: Pay N Spray");
- }
- else if(TrashIndex[playerid] == 14)
- {
- SetPlayerCheckpointEx(playerid, 596.030517, 1219.313964, 11.718750, 5.0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Collection finished, go back to the Trash warehouse to finish.");
- }
- }
- }
- if(VehicleHasEngine(Car) == 0)
- {
- EngineStatus[Car] = 1;
- Fuel[Car] = 100;
- ToggleVehicleEngine(Car, 1);
- }
- if(IsTowingVehicle(Car))
- {
- SysMsg(playerid, "To tow other cars with this vehicle use /Tow. To detach anything that is hooked up use /Detach.");
- }
- }
- if(newstate == PLAYER_STATE_PASSENGER)
- {
- foreach(new i: Player)
- {
- if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid) && IsSuitableTaxiCar(GetPlayerVehicleID(i)))
- {
- new taxi_duty = 0;
- if(PlayerCalledTaxi[playerid] == 1 && Job[i] == JOB_TAXI && JobDuty[i] == 1 && GetPlayerState(i) == PLAYER_STATE_DRIVER)
- {
- taxi_duty = 1;
- }
- if(taxi_duty == 1)
- {
- foreach(new Taxi: Player)
- {
- if(Job[Taxi] == JOB_TAXI && JobDuty[Taxi] == 1) SetPlayerMarkerForPlayer(Taxi, playerid, 0xFFFFFF00);
- }
- PlayerCalledTaxi[playerid] = 0;
- TaxiFareID[i] = playerid;
- TaxiFare[playerid] = 0;
- TaxiMeter[i] = 0;
- UnlockAchievement(playerid, 37);
- SendClientMessageF(playerid, COLOR_YELLOW, "Hello, Where would you like to go? The fare rate is $%i.",MyFareCharge[i]);
- SendClientMessageF(i, COLOR_YELLOW, "%s has entered your Taxi. Use /meteron to start the fare.",NameRP(playerid));
- }
- }
- }
- }
- return true;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- PlayerPlaySound(playerid, SOUND_CHECKPOINT, 0.0, 0.0, 0.0);
- new vehicleid = GetPlayerVehicleID(playerid);
- if(PlayerCheckpointID[playerid] == CHECKPOINT_VEH) {
- SysMsg(playerid, "You have arrived at your vehicle.");
- DisablePlayerCheckpoint(playerid);
- return 1;
- }
- if(IsTrucking[playerid] == 1 && (IsTruck(vehicleid) || GetVehicleModel(vehicleid) == 498) && DeliveringFuel[playerid] == 0)
- {
- new Trailer, Truck;
- Truck = GetPlayerVehicleID(playerid);
- if(TruckIndex[playerid] == 0)
- {
- new Float:px, Float:py, Float:pz, ridx = TruckRouteId[playerid];
- GetPlayerPos(playerid, px, py, pz);
- TruckIndex[playerid]++;
- DisablePlayerCheckpoint(playerid);
- if(TruckRoutes[ridx][TruckRouteTrailerID] > 0)
- {
- TruckingTrailer[playerid] = CreateVehicleEx(TruckRoutes[ridx][TruckRouteTrailerID], px, py, pz + 50.0, 0.0, -1, -1, -1);
- SetVehiclePos(Trailer, px, py, pz + 30.0);
- WaitingForTruckTrailer[playerid] = 1;
- SetTimerEx("AttachTrailerToVehicleEx", 1500, 0, "ddd", TruckingTrailer[playerid], Truck, playerid);
- }
- SetPlayerCheckpointEx(playerid, TruckRoutes[ridx][TruckRoutePoints][3], TruckRoutes[ridx][TruckRoutePoints][4], TruckRoutes[ridx][TruckRoutePoints][5], 7.0);
- format(gstr, sizeof(gstr), "Now deliver this load of %s to %s", TruckRoutes[ridx][TruckRouteLoad], TruckRoutes[ridx][TruckRouteEnd]);
- SendClientMessage(playerid, COLOR_ORANGE, gstr);
- return true;
- }
- if(TruckIndex[playerid] == 1 && GetVehicleModel(Truck) == 498)
- {
- DisablePlayerCheckpoint(playerid);
- TruckIndex[playerid]++;
- if(Faction[playerid] == FACTION_TRUCKING) SetPlayerCheckpointEx(playerid, 585.711547, 1664.336669, 6.992187, 10.0);
- else SetPlayerCheckpointEx(playerid, 66.135452, -248.711822, 1.578125, 10.0);
- SendClientMessage(playerid,COLOR_ORANGE,"You have successfully delivered this load. Drive back to the HQ to collect your pay.");
- return true;
- }
- if(TruckIndex[playerid] == 1 && IsTrailerAttachedToVehicle(Truck))
- {
- DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
- EmptyTruckingTrailer(TruckingTrailer[playerid]);
- DestroyVehicleEx(TruckingTrailer[playerid], "TruckingTrailer[playerid] 1");
- DisablePlayerCheckpoint(playerid);
- TruckIndex[playerid]++;
- if(Faction[playerid] == FACTION_TRUCKING) SetPlayerCheckpointEx(playerid, 585.711547, 1664.336669, 6.992187, 10.0);
- else SetPlayerCheckpointEx(playerid, 66.135452, -248.711822, 1.578125, 10.0);
- SendClientMessage(playerid,COLOR_ORANGE,"You have successfully delivered this load. Drive back to the HQ to collect your pay.");
- return true;
- }
- if(TruckIndex[playerid] == 2) //Finished
- {
- new Float:vhealth, damageFee;
- GetVehicleHealth(Truck, vhealth);
- damageFee = SidejobDamage[playerid] - floatround(vhealth);
- if(damageFee < 0) damageFee = 0;
- new CashCut = (1000 + random(1000)) - damageFee;
- if(IsTrailerAttachedToVehicle(Truck))
- {
- Trailer = GetVehicleTrailer(Truck);
- DetachTrailerFromVehicle(Trailer);
- DestroyVehicleEx(Trailer, "Trailer");
- }
- TruckStat[playerid]++;
- TruckIndex[playerid] = 0;
- IsTrucking[playerid] = 0;
- TruckRouteId[playerid] = 0;
- TruckingTrailer[playerid] = 0;
- if(TruckStat[playerid] == 5)
- {
- TruckLevel[playerid] = 2;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now trucking level 2.");
- }
- else if(TruckStat[playerid] == 25)
- {
- TruckLevel[playerid] = 3;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now trucking level 3.");
- }
- else if(TruckStat[playerid] == 75)
- {
- TruckLevel[playerid] = 4;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now trucking level 4.");
- }
- else if(TruckStat[playerid] == 150)
- {
- TruckLevel[playerid] = 5;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now trucking level 5. (You can now choose your job with /truck)");
- }
- CashCut += TruckLevel[playerid] * 75;
- if(Faction[playerid] == FACTION_TRUCKING) TruckSpamTime[playerid] = 0;
- else
- {
- if(TruckLevel[playerid] == 1)
- {
- if(IsDonator[playerid] >= 2) TruckSpamTime[playerid] = 30;
- else TruckSpamTime[playerid] = 60;
- }
- else if(TruckLevel[playerid] == 2)
- {
- if(IsDonator[playerid] >= 2) TruckSpamTime[playerid] = 27;
- else TruckSpamTime[playerid] = 55;
- }
- else if(TruckLevel[playerid] == 3)
- {
- if(IsDonator[playerid] >= 2) TruckSpamTime[playerid] = 25;
- else TruckSpamTime[playerid] = 50;
- }
- else if(TruckLevel[playerid] == 4)
- {
- if(IsDonator[playerid] >= 2) TruckSpamTime[playerid] = 22;
- else TruckSpamTime[playerid] = 45;
- }
- else if(TruckLevel[playerid] == 5)
- {
- if(IsDonator[playerid] >= 2) TruckSpamTime[playerid] = 20;
- else TruckSpamTime[playerid] = 40;
- }
- }
- if(CashCut <= 0)
- {
- SendClientMessage(playerid, COLOR_RED, "You have caused excessive damage to the vehicle therefore you will not receive a pay.");
- format(gstr, sizeof(gstr),"~w~you can haul again in ~b~%i ~w~minutes",TruckSpamTime[playerid]);
- ShowInfoText(playerid,gstr,5000);
- }
- else
- {
- format(gstr, sizeof(gstr),"You have successfully delivered this load. You have earned $%i (check your bank).",CashCut);
- SendClientMessage(playerid,COLOR_ORANGE,gstr);
- if(damageFee > 0)
- {
- format(gstr, sizeof(gstr),"{FF0000}$%i{FFFFFF} was taken out of your original pay of $%i due to damage on the vehicle.", damageFee, CashCut + damageFee);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- format(gstr, sizeof(gstr),"~g~trucker side-job~n~~w~you have earned ~y~$%i~n~~w~you can haul again in ~b~%i ~w~minutes",CashCut,TruckSpamTime[playerid]);
- ShowInfoText(playerid,gstr,10000);
-
- BankBalance[playerid] += CashCut;
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- FACTIONS[FACTION_TRUCKING][FactionBankBalance] += floatround(0.06 * CashCut);
- MySQLUpdateInt(FACTION_TRUCKING, "BankBalance", FACTIONS[FACTION_TRUCKING][FactionBankBalance], "factions");
- }
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET TruckingStat = %i, TruckingLevel = %i, TruckingSpamTime = %i WHERE id = %i", TruckStat[playerid], TruckLevel[playerid], TruckSpamTime[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- DisablePlayerCheckpoint(playerid);
- new truckBizzID = GetBizzID("Red County Trucking LTD");
- if(truckBizzID != -1)
- {
- BizzData[truckBizzID][BizzEarnings] += 100;
- MySQLUpdateInt(BizzData[truckBizzID][BizzSQLID], "BizzEarnings", BizzData[truckBizzID][BizzEarnings], "bizz");
- }
- return true;
- }
- }
- if(IsDelivering[playerid] == 1 && IsPizzaCar(vehicleid))
- {
- if(DeliverIndex[playerid] == 1)
- {
- DisablePlayerCheckpoint(playerid);
- DeliverStat[playerid]++;
- DeliverIndex[playerid] = 0;
- IsDelivering[playerid] = 0;
- if(DeliverStat[playerid] == 5)
- {
- DeliverLevel[playerid] = 2;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Pizza Delivery Level 2.");
- }
- else if(DeliverStat[playerid] == 25)
- {
- DeliverLevel[playerid] = 3;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Pizza Delivery Level 3.");
- }
- else if(DeliverStat[playerid] == 75)
- {
- DeliverLevel[playerid] = 4;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Pizza Delivery Level 4.");
- }
- else if(DeliverStat[playerid] == 150)
- {
- DeliverLevel[playerid] = 5;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Pizza Delivery Level 5.");
- }
- new sprukBizzID = GetBizzID("Montgomery Pizza Stack");
- if(sprukBizzID != -1)
- {
- BizzData[sprukBizzID][BizzEarnings] += 200;
- MySQLUpdateInt(BizzData[sprukBizzID][BizzSQLID], "BizzEarnings", BizzData[sprukBizzID][BizzEarnings], "bizz");
- }
- new Float:vhealth, damageFee;
- GetVehicleHealth(vehicleid, vhealth);
- damageFee = SidejobDamage[playerid] - floatround(vhealth);
- if(damageFee < 0) damageFee = 0;
- new Prize = (DeliverLevel[playerid] * 250 + random(250)) - damageFee;
- if(Prize <= 0)
- {
- SendClientMessage(playerid, COLOR_RED, "You have caused excessive damage to the vehicle therefore you will not receive a pay.");
- format(sgstr, sizeof(sgstr),"~w~You can deliver again in ~b~%i ~w~minutes",DeliverSpamTime[playerid]);
- ShowInfoText(playerid,sgstr,5000);
- }
- else
- {
- SendClientMessageF(playerid,COLOR_ORANGE,"Well done! You have received $%i (check your bank) for your work. You can deliver again in %i minutes.",Prize,DeliverSpamTime[playerid]);
- if(damageFee > 0) SendClientMessageF(playerid, COLOR_WHITE, "{FF0000}$%i{FFFFFF} was taken out of your original pay of $%i due to damage on the vehicle.", damageFee, Prize + damageFee);
- format(sgstr, sizeof(sgstr),"~g~Pizza Delivery sidejob~n~~w~You have earned ~y~$%i~n~~w~You can deliver again in ~b~%i ~w~minutes",Prize,DeliverSpamTime[playerid]);
- ShowInfoText(playerid,sgstr,5000);
- BankBalance[playerid] += Prize;
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- }
- TogglePlayerControllable(playerid, false);
- RemovePlayerFromVehicle(playerid);
- SetTimerEx("UnFreezePlayer", 200, 0, "d", playerid);
- RepairVehicleEx(GetPlayerVehicleID(playerid));
- SetVehicleToRespawnEx(GetPlayerVehicleID(playerid));
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET DeliverStat = %i, DeliverLevel = %i, DeliverSpamTime = %i WHERE id = %i", DeliverStat[playerid], DeliverLevel[playerid], DeliverSpamTime[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- }
- }
- if(IsCoalmining[playerid] > 0 && IsDumper(vehicleid))
- {
- if(IsCoalmining[playerid] == 1)
- {
- CoalmineIndex[playerid] ++;
- DisablePlayerCheckpoint(playerid);
- format(gstr, sizeof(gstr),"~r~%i~w~/~g~25",CoalmineIndex[playerid]);
- ShowInfoText(playerid,gstr,3000);
- if(CoalmineIndex[playerid] == 2) SetPlayerCheckpointEx(playerid, 783.051940, 844.844970, 5.840225, 6.0); //COALMINE_2
- else if(CoalmineIndex[playerid] == 3) SetPlayerCheckpointEx(playerid, 756.447753, 894.720947, -1.230156, 6.0); //COALMINE_3
- else if(CoalmineIndex[playerid] == 4) SetPlayerCheckpointEx(playerid, 723.277709, 955.171081, -7.409820, 6.0); //COALMINE_4
- else if(CoalmineIndex[playerid] == 5) SetPlayerCheckpointEx(playerid, 682.960510, 972.688842, -12.710937, 6.0); //COALMINE_5
- else if(CoalmineIndex[playerid] == 6) SetPlayerCheckpointEx(playerid, 717.765197, 925.282470, -18.697675, 6.0); //COALMINE_6
- else if(CoalmineIndex[playerid] == 7) SetPlayerCheckpointEx(playerid, 726.742919, 885.759643, -26.466794, 6.0); //COALMINE_7
- else if(CoalmineIndex[playerid] == 8) SetPlayerCheckpointEx(playerid, 687.952270, 935.555725, -30.210672, 6.0); //COALMINE_8
- else if(CoalmineIndex[playerid] == 9) SetPlayerCheckpointEx(playerid, 638.532714, 945.180114, -35.323219, 6.0); //COALMINE_9
- else if(CoalmineIndex[playerid] == 10) SetPlayerCheckpointEx(playerid, 626.653747, 908.502075, -43.979866, 6.0); //COALMINE_10
- else if(CoalmineIndex[playerid] == 11) SetPlayerCheckpointEx(playerid, 653.480163, 883.485046, -41.512496, 6.0); //COALMINE_11
- else if(CoalmineIndex[playerid] == 12) SetPlayerCheckpointEx(playerid, 554.376892, 860.763916, -43.073459, 6.0); //COALMINE_12
- else if(CoalmineIndex[playerid] == 13) SetPlayerCheckpointEx(playerid, 496.832946, 880.016357, -32.151275, 6.0); //COALMINE_13
- else if(CoalmineIndex[playerid] == 14) SetPlayerCheckpointEx(playerid, 551.651489, 899.116943, -43.038303, 6.0); //COALMINE_14
- else if(CoalmineIndex[playerid] == 15) SetPlayerCheckpointEx(playerid, 623.719360, 923.080932, -40.971817, 6.0); //COALMINE_15
- else if(CoalmineIndex[playerid] == 16) SetPlayerCheckpointEx(playerid, 683.864929, 937.770568, -30.208955, 6.0); //COALMINE_16
- else if(CoalmineIndex[playerid] == 17) SetPlayerCheckpointEx(playerid, 716.516296, 852.666076, -30.229145, 6.0); //COALMINE_17
- else if(CoalmineIndex[playerid] == 18) SetPlayerCheckpointEx(playerid, 659.518859, 784.881591, -30.212789, 6.0); //COALMINE_18
- else if(CoalmineIndex[playerid] == 19) SetPlayerCheckpointEx(playerid, 562.098815, 804.124938, -28.674205, 6.0); //COALMINE_19
- else if(CoalmineIndex[playerid] == 20) SetPlayerCheckpointEx(playerid, 548.026184, 779.955627, -18.681949, 6.0); //COALMINE_20
- else if(CoalmineIndex[playerid] == 21) SetPlayerCheckpointEx(playerid, 697.304565, 748.885437, -5.290267, 6.0); //COALMINE_21
- else if(CoalmineIndex[playerid] == 22) SetPlayerCheckpointEx(playerid, 757.724060, 828.291259, -7.412478, 6.0); //COALMINE_22
- else if(CoalmineIndex[playerid] == 23) SetPlayerCheckpointEx(playerid, 772.193176, 882.411804, -1.271106, 6.0); //COALMINE_23
- else if(CoalmineIndex[playerid] == 24) SetPlayerCheckpointEx(playerid, 795.062866, 838.577819, 7.316993, 6.0); //COALMINE_24
- else if(CoalmineIndex[playerid] == 25) SetPlayerCheckpointEx(playerid, 839.414367, 856.573364, 12.871128, 6.0); //COALMINE_25
- if(CoalmineIndex[playerid] == 26)
- {
- DisablePlayerCheckpoint(playerid);
- CoalmineStat[playerid]++;
- CoalmineIndex[playerid] = 0;
- IsCoalmining[playerid] = 0;
- if(CoalmineStat[playerid] == 5)
- {
- CoalmineLevel[playerid] = 2;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Coalminer Level 2.");
- }
- else if(CoalmineStat[playerid] == 25)
- {
- CoalmineLevel[playerid] = 3;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Coalminer Level 3.");
- }
- else if(CoalmineStat[playerid] == 75)
- {
- CoalmineLevel[playerid] = 4;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Coalminer Level 4.");
- }
- else if(CoalmineStat[playerid] == 150)
- {
- CoalmineLevel[playerid] = 5;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Coalminer Level 5.");
- }
- if(CoalmineLevel[playerid] == 1)
- {
- if(IsDonator[playerid] >= 2) CoalmineSpamTime[playerid] = 30;
- else CoalmineSpamTime[playerid] = 60;
- }
- else if(CoalmineLevel[playerid] == 2)
- {
- if(IsDonator[playerid] >= 2) CoalmineSpamTime[playerid] = 30;
- else CoalmineSpamTime[playerid] = 55;
- }
- else if(CoalmineLevel[playerid] == 3)
- {
- if(IsDonator[playerid] >= 2) CoalmineSpamTime[playerid] = 30;
- else CoalmineSpamTime[playerid] = 50;
- }
- else if(CoalmineLevel[playerid] == 4)
- {
- if(IsDonator[playerid] >= 2) CoalmineSpamTime[playerid] = 30;
- else CoalmineSpamTime[playerid] = 45;
- }
- else if(CoalmineLevel[playerid] == 5)
- {
- if(IsDonator[playerid] >= 2) CoalmineSpamTime[playerid] = 30;
- else CoalmineSpamTime[playerid] = 40;
- }
- new mineBizzID = GetBizzID("Bone County Coal Mine");
- if(mineBizzID != -1)
- {
- BizzData[mineBizzID][BizzEarnings] += 200;
- MySQLUpdateInt(BizzData[mineBizzID][BizzSQLID], "BizzEarnings", BizzData[mineBizzID][BizzEarnings], "bizz");
- }
- new Float:vhealth, damageFee;
- GetVehicleHealth(vehicleid, vhealth);
- damageFee = SidejobDamage[playerid] - floatround(vhealth);
- if(damageFee < 0) damageFee = 0;
- new Prize = (CoalmineLevel[playerid] * 350 + random(200)) - damageFee;
- if(Prize <= 0)
- {
- SendClientMessage(playerid, COLOR_RED, "You have caused excessive damage to the vehicle therefore you will not receive a pay.");
- format(gstr, sizeof(gstr),"~w~you can mine again in ~b~%i ~w~minutes",CoalmineSpamTime[playerid]);
- ShowInfoText(playerid,gstr,5000);
- }
- else
- {
- format(gstr, sizeof(gstr),"Well Done! You have received $%i (check your bank) for your work. You can mine again in %i minutes.",Prize,CoalmineSpamTime[playerid]);
- SendClientMessage(playerid,COLOR_ORANGE,gstr);
- if(damageFee > 0)
- {
- format(gstr, sizeof(gstr),"{FF0000}$%i{FFFFFF} was taken out of your original pay of $%i due to damage on the vehicle.", damageFee, Prize + damageFee);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- format(gstr, sizeof(gstr),"~g~coalminer side-job route 1~n~~w~you have earned ~y~$%i~n~~w~you can mine again in ~b~%i ~w~minutes",Prize,CoalmineSpamTime[playerid]);
- ShowInfoText(playerid,gstr,5000);
- BankBalance[playerid] += Prize;
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- }
- MySQLUpdateInt(SQLID[playerid], "CoalmineStat", CoalmineStat[playerid], "players");
- MySQLUpdateInt(SQLID[playerid], "CoalmineLevel", CoalmineLevel[playerid], "players");
- MySQLUpdateInt(SQLID[playerid], "CoalmineSpamTime", CoalmineSpamTime[playerid], "players");
- }
- }
- else if(IsCoalmining[playerid] == 2)
- {
- CoalmineIndex[playerid] ++;
- DisablePlayerCheckpoint(playerid);
- format(gstr, sizeof(gstr),"~r~%i~w~/~g~20",CoalmineIndex[playerid]);
- ShowInfoText(playerid,gstr,3000);
- if(CoalmineIndex[playerid] == 2) SetPlayerCheckpointEx(playerid, 780.789916, 823.563354, 5.842009, 6.0); //COALMINE2_2
- else if(CoalmineIndex[playerid] == 3) SetPlayerCheckpointEx(playerid, 734.831848, 754.501098, -5.570585, 6.0); //COALMINE2_3
- else if(CoalmineIndex[playerid] == 4) SetPlayerCheckpointEx(playerid, 643.143981, 746.695495, -11.656181, 6.0); //COALMINE2_4
- else if(CoalmineIndex[playerid] == 5) SetPlayerCheckpointEx(playerid, 540.451660, 781.743835, -19.441673, 6.0); //COALMINE2_5
- else if(CoalmineIndex[playerid] == 6) SetPlayerCheckpointEx(playerid, 569.672363, 801.387634, -28.472608, 6.0); //COALMINE2_6
- else if(CoalmineIndex[playerid] == 7) SetPlayerCheckpointEx(playerid, 707.346252, 816.939147, -30.225858, 6.0); //COALMINE2_7
- else if(CoalmineIndex[playerid] == 8) SetPlayerCheckpointEx(playerid, 698.983825, 914.307800, -30.514612, 6.0); //COALMINE2_8
- else if(CoalmineIndex[playerid] == 9) SetPlayerCheckpointEx(playerid, 635.966552, 955.272033, -34.539966, 6.0); //COALMINE2_9
- else if(CoalmineIndex[playerid] == 10) SetPlayerCheckpointEx(playerid, 531.077575, 935.671569, -24.326200, 6.0); //COALMINE2_10
- else if(CoalmineIndex[playerid] == 11) SetPlayerCheckpointEx(playerid, 551.567504, 959.989196, -19.440387, 6.0); //COALMINE2_11
- else if(CoalmineIndex[playerid] == 12) SetPlayerCheckpointEx(playerid, 628.431762, 965.697326, -18.693401, 6.0); //COALMINE2_12
- else if(CoalmineIndex[playerid] == 13) SetPlayerCheckpointEx(playerid, 679.244934, 974.608215, -12.710937, 6.0); //COALMINE2_13
- else if(CoalmineIndex[playerid] == 14) SetPlayerCheckpointEx(playerid, 625.071777, 980.322265, -7.422729, 6.0); //COALMINE2_14
- else if(CoalmineIndex[playerid] == 15) SetPlayerCheckpointEx(playerid, 544.312011, 994.075500, -6.461905, 6.0); //COALMINE2_15
- else if(CoalmineIndex[playerid] == 16) SetPlayerCheckpointEx(playerid, 646.701416, 1002.316650, 5.850579, 6.0); //COALMINE2_16
- else if(CoalmineIndex[playerid] == 17) SetPlayerCheckpointEx(playerid, 728.749023, 977.734497, 5.857511, 6.0); //COALMINE2_17
- else if(CoalmineIndex[playerid] == 18) SetPlayerCheckpointEx(playerid, 774.907714, 885.302978, -1.297460, 6.0); //COALMINE2_18
- else if(CoalmineIndex[playerid] == 19) SetPlayerCheckpointEx(playerid, 797.311584, 840.728027, 7.792995, 6.0); //COALMINE2_19
- else if(CoalmineIndex[playerid] == 20) SetPlayerCheckpointEx(playerid, 835.888122, 854.415588, 12.585916, 6.0); //COALMINE2_20
- if(CoalmineIndex[playerid] == 21)
- {
- DisablePlayerCheckpoint(playerid);
- CoalmineStat[playerid]++;
- CoalmineIndex[playerid] = 0;
- IsCoalmining[playerid] = 0;
- if(CoalmineStat[playerid] == 5)
- {
- CoalmineLevel[playerid] = 2;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Coalminer Level 2.");
- }
- else if(CoalmineStat[playerid] == 25)
- {
- CoalmineLevel[playerid] = 3;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Coalminer Level 3.");
- }
- else if(CoalmineStat[playerid] == 75)
- {
- CoalmineLevel[playerid] = 4;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Coalminer Level 4.");
- }
- else if(CoalmineStat[playerid] == 150)
- {
- CoalmineLevel[playerid] = 5;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Coalminer Level 5.");
- }
- if(CoalmineLevel[playerid] == 1)
- {
- if(IsDonator[playerid] >= 2) CoalmineSpamTime[playerid] = 30;
- else CoalmineSpamTime[playerid] = 60;
- }
- else if(CoalmineLevel[playerid] == 2)
- {
- if(IsDonator[playerid] >= 2) CoalmineSpamTime[playerid] = 30;
- else CoalmineSpamTime[playerid] = 55;
- }
- else if(CoalmineLevel[playerid] == 3)
- {
- if(IsDonator[playerid] >= 2) CoalmineSpamTime[playerid] = 30;
- else CoalmineSpamTime[playerid] = 50;
- }
- else if(CoalmineLevel[playerid] == 4)
- {
- if(IsDonator[playerid] >= 2) CoalmineSpamTime[playerid] = 30;
- else CoalmineSpamTime[playerid] = 45;
- }
- else if(CoalmineLevel[playerid] == 5)
- {
- if(IsDonator[playerid] >= 2) CoalmineSpamTime[playerid] = 30;
- else CoalmineSpamTime[playerid] = 40;
- }
- new mineBizzID = GetBizzID("Bone County Coal Mine");
- if(mineBizzID != -1)
- {
- BizzData[mineBizzID][BizzEarnings] += 200;
- MySQLUpdateInt(BizzData[mineBizzID][BizzSQLID], "BizzEarnings", BizzData[mineBizzID][BizzEarnings], "bizz");
- }
- new Float:vhealth, damageFee;
- GetVehicleHealth(vehicleid, vhealth);
- damageFee = SidejobDamage[playerid] - floatround(vhealth);
- if(damageFee < 0) damageFee = 0;
- new Prize = (CoalmineLevel[playerid] * 350 + random(200)) - damageFee;
- if(Prize <= 0)
- {
- SendClientMessage(playerid, COLOR_RED, "You have caused excessive damage to the vehicle therefore you will not receive a pay.");
- format(gstr, sizeof(gstr),"~w~you can mine again in ~b~%i ~w~minutes",CoalmineSpamTime[playerid]);
- ShowInfoText(playerid,gstr,5000);
- }
- else
- {
- format(gstr, sizeof(gstr),"Well Done! You have received $%i (check your bank) for your work. You can mine again in %i minutes.",Prize,CoalmineSpamTime[playerid]);
- SendClientMessage(playerid,COLOR_ORANGE,gstr);
- if(damageFee > 0)
- {
- format(gstr, sizeof(gstr),"{FF0000}$%i{FFFFFF} was taken out of your original pay of $%i due to damage on the vehicle.", damageFee, Prize + damageFee);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- format(gstr, sizeof(gstr),"~g~coalminer side-job route 1~n~~w~you have earned ~y~$%i~n~~w~you can mine again in ~b~%i ~w~minutes",Prize,CoalmineSpamTime[playerid]);
- ShowInfoText(playerid,gstr,5000);
- BankBalance[playerid] += Prize;
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- }
- MySQLUpdateInt(SQLID[playerid], "CoalmineStat", CoalmineStat[playerid], "players");
- MySQLUpdateInt(SQLID[playerid], "CoalmineLevel", CoalmineLevel[playerid], "players");
- MySQLUpdateInt(SQLID[playerid], "CoalmineSpamTime", CoalmineSpamTime[playerid], "players");
- }
- }
- }
- if(IsTrashMan[playerid] == 1)
- {
- if(vehicleid == 0 && TrashMissionData[playerid][2] > 0)
- {
- if(TrashMissionData[playerid][2] == 1)
- {
- DisablePlayerCheckpoint(playerid);
- TrashMissionData[playerid][2] = 2;
- format(gstr, sizeof(gstr),"* %s pega um saco de lixo da lixeira. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(TrashIndex[playerid] == 1) SendClientMessage(playerid,COLOR_YELLOW,"> Agora coloque o lixo na parte de trás do caminhão.");
- SetPlayerAttachedObject(playerid, HOLD_OBJECT_MISC, 1265, 6, 0.01, -0.4, 0.0);
- new Float:Pos[4];
- GetVehiclePos(TrashMissionData[playerid][0], Pos[0], Pos[1], Pos[2]);
- GetVehicleZAngle(TrashMissionData[playerid][0], Pos[3]);
- GetXYBehindPoint(Pos[0], Pos[1], Pos[3], 5.5);
- SetPlayerCheckpointEx(playerid, Pos[0], Pos[1], Pos[2], 2.0);
- }
- else if(TrashMissionData[playerid][2] == 2)
- {
- DisablePlayerCheckpoint(playerid);
- RemovePlayerAttachedObject(playerid, HOLD_OBJECT_MISC);
- format(gstr, sizeof(gstr),"* %s joga um saco de lixo na parte taseira do caminhão. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(TrashIndex[playerid] == 1) SendClientMessage(playerid,COLOR_YELLOW,"> Volte para o caminhão de lixo e continue a rota.");
- TrashMissionData[playerid][2] = 3;
- }
- }
- if(vehicleid > 0 && GetVehicleModel(vehicleid) == 408)
- {
- if(TrashIndex[playerid] == 1)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Arrived at Cluckin' Bell. Get out and collect the trash from the bins.");
- DisablePlayerCheckpoint(playerid);
- TrashMissionData[playerid][2] = 1;
- SetPlayerCheckpointEx(playerid, 177.552749, 1192.143554, 14.757812, 2.0);
- }
- else if(TrashIndex[playerid] == 2)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Arrived at the Clothes store. Get out and collect the trash from the bins.");
- DisablePlayerCheckpoint(playerid);
- TrashMissionData[playerid][2] = 1;
- SetPlayerCheckpointEx(playerid, -26.279758, 1165.433105, 19.364347, 2.0);
- }
- else if(TrashIndex[playerid] == 3)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Arrived at the Diner. Get out and collect the trash from the bins.");
- DisablePlayerCheckpoint(playerid);
- TrashMissionData[playerid][2] = 1;
- SetPlayerCheckpointEx(playerid, -44.297412, 1177.808471, 19.434133, 2.0);
- }
- else if(TrashIndex[playerid] == 4)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Arrived at the Bowling club. Get out and collect the trash from the bins.");
- DisablePlayerCheckpoint(playerid);
- TrashMissionData[playerid][2] = 1;
- SetPlayerCheckpointEx(playerid, -88.855072, 1164.065429, 19.742187, 2.0);
- }
- else if(TrashIndex[playerid] == 5)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Arrived at the Lil Probe Inn. Get out and collect the trash from the bins.");
- DisablePlayerCheckpoint(playerid);
- TrashMissionData[playerid][2] = 1;
- SetPlayerCheckpointEx(playerid, -97.222076, 1360.318481, 10.273437, 2.0);
- }
- else if(TrashIndex[playerid] == 6)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Arrived at the King Ring. Get out and collect the trash from the bins.");
- DisablePlayerCheckpoint(playerid);
- TrashMissionData[playerid][2] = 1;
- SetPlayerCheckpointEx(playerid, -157.101928, 1234.478271, 19.742187, 2.0);
- }
- else if(TrashIndex[playerid] == 7)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Arrived at the Cafe. Get out and collect the trash from the bins.");
- DisablePlayerCheckpoint(playerid);
- TrashMissionData[playerid][2] = 1;
- SetPlayerCheckpointEx(playerid, -191.284851, 1220.994018, 19.742187, 2.0);
- }
- else if(TrashIndex[playerid] == 8)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Arrived at the Laundrette. Get out and collect the trash from the bins.");
- DisablePlayerCheckpoint(playerid);
- TrashMissionData[playerid][2] = 1;
- SetPlayerCheckpointEx(playerid, -214.094512, 1218.637573, 19.742187, 2.0);
- }
- else if(TrashIndex[playerid] == 9)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Arrived at the Recycling point. Get out and collect the trash from the bins.");
- DisablePlayerCheckpoint(playerid);
- TrashMissionData[playerid][2] = 1;
- SetPlayerCheckpointEx(playerid, -264.481658, 1211.475097, 19.742187, 2.0);
- }
- else if(TrashIndex[playerid] == 10)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Arrived at the Hospital. Get out and collect the trash from the bins.");
- DisablePlayerCheckpoint(playerid);
- TrashMissionData[playerid][2] = 1;
- SetPlayerCheckpointEx(playerid, -317.762969, 1024.186035, 19.734537, 2.0);
- }
- else if(TrashIndex[playerid] == 11)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Arrived at the General store. Get out and collect the trash from the bins.");
- DisablePlayerCheckpoint(playerid);
- TrashMissionData[playerid][2] = 1;
- SetPlayerCheckpointEx(playerid, -168.490386, 1027.120117, 19.734413, 2.0);
- }
- else if(TrashIndex[playerid] == 12)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Arrived at the Bar. Get out and collect the trash from the bins.");
- DisablePlayerCheckpoint(playerid);
- TrashMissionData[playerid][2] = 1;
- SetPlayerCheckpointEx(playerid, -167.414947, 1084.677001, 19.742187, 2.0);
- }
- else if(TrashIndex[playerid] == 13)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Arrived at the Pay n Spray. Get out and collect the trash from the bins.");
- DisablePlayerCheckpoint(playerid);
- TrashMissionData[playerid][2] = 1;
- SetPlayerCheckpointEx(playerid, -88.998481, 1128.205566, 19.742187, 2.0);
- }
- else if(TrashIndex[playerid] == 14)
- {
- DisablePlayerCheckpoint(playerid);
- TrashStat[playerid]++;
- TrashIndex[playerid] = 0;
- IsTrashMan[playerid] = 0;
- if(TrashStat[playerid] == 5)
- {
- TrashLevel[playerid] = 2;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Trash Collector Level 2.");
- }
- else if(TrashStat[playerid] == 25)
- {
- TrashLevel[playerid] = 3;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Trash Collector Level 3.");
- }
- else if(TrashStat[playerid] == 75)
- {
- TrashLevel[playerid] = 4;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Trash Collector Level 4.");
- }
- else if(TrashStat[playerid] == 150)
- {
- TrashLevel[playerid] = 5;
- SendClientMessage(playerid,COLOR_ORANGE,"You are now Trash Collector Level 5.");
- }
- if(TrashLevel[playerid] == 1)
- {
- if(IsDonator[playerid] >= 2) TrashSpamTime[playerid] = 30;
- else TrashSpamTime[playerid] = 60;
- }
- else if(TrashLevel[playerid] == 2)
- {
- if(IsDonator[playerid] >= 2) TrashSpamTime[playerid] = 27;
- else TrashSpamTime[playerid] = 55;
- }
- else if(TrashLevel[playerid] == 3)
- {
- if(IsDonator[playerid] >= 2) TrashSpamTime[playerid] = 25;
- else TrashSpamTime[playerid] = 50;
- }
- else if(TrashLevel[playerid] == 4)
- {
- if(IsDonator[playerid] >= 2) TrashSpamTime[playerid] = 23;
- else TrashSpamTime[playerid] = 45;
- }
- else if(TrashLevel[playerid] == 5)
- {
- if(IsDonator[playerid] >= 2) TrashSpamTime[playerid] = 20;
- else TrashSpamTime[playerid] = 40;
- }
- new trashbizz = GetBizzID("Bone County Waste Management");
- if(trashbizz != -1)
- {
- BizzData[trashbizz][BizzEarnings] += 200;
- MySQLUpdateInt(BizzData[trashbizz][BizzSQLID], "BizzEarnings", BizzData[trashbizz][BizzEarnings], "bizz");
- }
- new Float:vhealth, damageFee;
- GetVehicleHealth(vehicleid, vhealth);
- damageFee = SidejobDamage[playerid] - floatround(vhealth);
- if(damageFee < 0) damageFee = 0;
- new Prize = (TrashLevel[playerid] * 800 + random(300)) - damageFee;
- if(Prize <= 0)
- {
- SendClientMessage(playerid, COLOR_RED, "You have caused excessive damage to the vehicle therefore you will not receive a pay.");
- format(gstr, sizeof(gstr),"~w~you can collect again in ~b~%i ~w~minutes",TrashSpamTime[playerid]);
- ShowInfoText(playerid,gstr,5000);
- }
- else
- {
- format(gstr, sizeof(gstr),"Well Done! You have received $%i (check your bank) for your work. You can collect trash again in %i minutes.",Prize,TrashSpamTime[playerid]);
- SendClientMessage(playerid,COLOR_ORANGE,gstr);
- if(damageFee > 0)
- {
- format(gstr, sizeof(gstr),"{FF0000}$%i{FFFFFF} was taken out of your original pay of $%i due to damage on the vehicle.", damageFee, Prize + damageFee);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- format(gstr, sizeof(gstr),"~g~Trash Collector side-job~n~~w~you have earned ~y~$%i~n~~w~you can collect again in ~b~%i ~w~minutes",Prize,TrashSpamTime[playerid]);
- ShowInfoText(playerid,gstr,5000);
- BankBalance[playerid] += Prize;
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- }
- MySQLUpdateInt(SQLID[playerid], "TrashStat", TrashStat[playerid], "players");
- MySQLUpdateInt(SQLID[playerid], "TrashLevel", TrashLevel[playerid], "players");
- MySQLUpdateInt(SQLID[playerid], "TrashSpamTime", TrashSpamTime[playerid], "players");
- }
- }
- }
- if(DeliveringFuel[playerid] > 0)
- {
- if(DeliveringFuel[playerid] == 1)
- {
- new Float:px, Float:py, Float:pz;
- GetPlayerPos(playerid, px, py, pz);
- DisablePlayerCheckpoint(playerid);
- DeliveringFuelVeh[playerid][1] = CreateVehicleEx(584, px, py, pz + 50.0, 0.0, -1, -1, -1);
- SetTimerEx("AttachTrailerToVehicleEx", 500, 0, "ddd", DeliveringFuelVeh[playerid][1], DeliveringFuelVeh[playerid][0], playerid);
- WaitingForTruckTrailer[playerid] = 1;
- switch(DeiveringFuelType[playerid])
- {
- case FUEL_GASOLINA:
- {
- DeiveringFuelAmount[playerid] = 10000;
- format(gstr, sizeof(gstr), "[PETROL DELIVERY]\n%i / %i Gallons", DeiveringFuelAmount[playerid], DeiveringFuelAmount[playerid]);
- }
- case FUEL_DIESEL:
- {
- DeiveringFuelAmount[playerid] = 8000;
- format(gstr, sizeof(gstr), "[DIESEL DELIVERY]\n%i / %i Gallons", DeiveringFuelAmount[playerid], DeiveringFuelAmount[playerid]);
- }
- }
- DeliveringFuelLabel[playerid] = CreateDynamic3DTextLabel(gstr, COLOR_WHITE, 0.0, 0.0, 0.0, 25.0,INVALID_PLAYER_ID, DeliveringFuelVeh[playerid][1], 1, -1, -1, -1, 25);
- SendClientMessage(playerid,COLOR_ORANGE,"[FUEL DELIVERY] Visit the gas stations you would like to deliver to then use /supplyfuel.");
- SendClientMessage(playerid,COLOR_ORANGE,"[FUEL DELIVERY] You can stop the route at anytime by using /endfueldelivery. Getting out the truck will end the job.");
- new subinfo[150];
- gstr[0] = EOS;
- strcat(gstr, "The following gas stations can have fuel delivered:\n\n");
- for(new v = 0; v < MAX_FUEL_STATIONS; v++)
- {
- switch(DeiveringFuelType[playerid])
- {
- case FUEL_GASOLINA: format(subinfo, sizeof(subinfo), "%s Gas Station (Petrol: %i / %i Gal)\n", FuelStations[v][StationDescription], FuelStations[v][PetrolAmount], FuelStations[v][PetrolAmountMax]);
- case FUEL_DIESEL: format(subinfo, sizeof(subinfo), "%s Gas Station (Diesel: %i / %i Gal)\n", FuelStations[v][StationDescription], FuelStations[v][DieselAmount], FuelStations[v][DieselAmountMax]);
- }
- strcat(gstr, subinfo);
- }
- Dialog_Show(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Before you set off, check the fuel levels", gstr, "Continue", "");
- DeliveringFuel[playerid] = 2;
- }
- else if(DeliveringFuel[playerid] == 3)
- {
- DisablePlayerCheckpoint(playerid);
- new pay;
- switch(DeiveringFuelType[playerid])
- {
- case FUEL_GASOLINA:
- {
- pay = 10000 - DeiveringFuelAmount[playerid];
- format(gstr, sizeof(gstr), "[FUEL DELIVERY COMPLETE] You delivered %i gallons of petrol and your pay is a dollar per gallon = $%i", pay, pay);
- }
- case FUEL_DIESEL:
- {
- pay = 8000 - DeiveringFuelAmount[playerid];
- format(gstr, sizeof(gstr), "[FUEL DELIVERY COMPLETE] You delivered %i gallons of diesel and your pay is a dollar per gallon = $%i", pay, pay);
- }
- }
- GivePlayerCash(playerid, pay);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- DeiveringFuelAmount[playerid] = 0;
- DeiveringFuelType[playerid] = 0;
- DestroyVehicleEx(DeliveringFuelVeh[playerid][1], "DeliveringFuelVeh[playerid][1] 1");
- DestroyDynamic3DTextLabel(DeliveringFuelLabel[playerid]);
- DeliveringFuelLabel[playerid] = Text3D:INVALID_3DTEXT_ID;
- DeliveringFuel[playerid] = 0;
- DeliveringFuelVeh[playerid][0] = 0;
- DeliveringFuelVeh[playerid][1] = 0;
- }
- return true;
- }
- if(MotelWaypoint[playerid] == 1)
- {
- DisablePlayerCheckpoint(playerid);
- SendClientMessage(playerid,COLOR_ORANGE,"Welcome to your room! To check-out, use /unrentroom at our main office.");
- SendClientMessage(playerid,COLOR_ORANGE,"Motel Commands: /lock /extendrent");
- MotelWaypoint[playerid] = 0;
- }
- if(UsingFuelCan[playerid][1] > 0)
- {
- DisablePlayerCheckpoint(playerid);
- SetPlayerToFacePoint(playerid, RefuelStandPos[playerid][0], RefuelStandPos[playerid][1]);
- SetTimerEx("FinishFuelCanRefilling", 5000, 0, "d", playerid);
- Inventory[playerid][FuelCan][0] = Inventory[playerid][FuelCan][0] - UsingFuelCan[playerid][0];
- MySQLUpdateInt(SQLID[playerid], "HasFuelCan", Inventory[playerid][FuelCan][0], "players");
- Fuel[UsingFuelCan[playerid][1]] = Fuel[UsingFuelCan[playerid][1]] + UsingFuelCan[playerid][0];
- if(Fuel[UsingFuelCan[playerid][1]] >= 100) Fuel[UsingFuelCan[playerid][1]] = 100;
- FuelTypeAfterRefuel[UsingFuelCan[playerid][0]] = Inventory[playerid][FuelCan][1];
- if(Inventory[playerid][FuelCan][0] == 0) SendClientMessage(playerid, COLOR_RED, "Your Fuel Can is now empty, take it to a fuel station and use /refillfc.");
- format(gstr, sizeof(gstr),"* %s uses a Fuel Can to refill the %s. *",NameRP(playerid),GetVehicleName(UsingFuelCan[playerid][1]));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_RED, "This vehicle has been refilled using fuel from your Fuel Can.");
- UsingFuelCan[playerid][0] = 0;
- UsingFuelCan[playerid][1] = 0;
- RefuelStandPos[playerid][0] = 0;
- RefuelStandPos[playerid][1] = 0;
- RefuelStandPos[playerid][2] = 0;
- }
- if(pRefilling[playerid] == 2)
- {
- DisablePlayerCheckpoint(playerid);
- pRefilling[playerid] = 3;
- Dialog_Show(playerid, FuelType, DIALOG_STYLE_MSGBOX, "Vehicle Refuelling", "What type of fuel does your vehicle require?", "Petrol", "Diesel");
- TogglePlayerControllable(playerid, 0);
- }
- return true;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return true;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- PlayerPlaySound(playerid, SOUND_CHECKPOINT, 0.0, 0.0, 0.0);
- if(IsDrivingBus{playerid} && IsBus(GetPlayerVehicleID(playerid)))
- {
- if(BusRouteIndex[playerid] == -1) return true; // error
- if(BusRouteIndex[playerid] != 53)
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Wait at this stop for a few seconds, The marker will disappear when ready.");
- format(gstr, sizeof(gstr),"Current Bus Stop: %s - Next Stop: %s", BusStopDescription[BusRouteIndex[playerid]], BusStopDescription[BusRouteIndex[playerid]+1]);
- ProxDetector(15.0,playerid,gstr,COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE);
- BusStopTimer[playerid] = SetTimerEx("BusRouteContinue",4000,0,"d",playerid);
- WaitingAtStop{playerid} = true;
- }
- else
- {
- BusRouteIndex[playerid] = -1;
- IsDrivingBus{playerid} = false;
- WaitingAtStop{playerid} = false;
- GivePlayerCash(playerid, 1000);
- DisablePlayerRaceCheckpoint(playerid);
- SendClientMessage(playerid,COLOR_YELLOW,"> Bus Route Complete, You Got A $1000 Bonus For Completing The Route.");
- }
- return true;
- }
- if(DMV_Testing[playerid] > 0 && DMV_Testing[playerid] < 10)
- {
- DMV_Index[playerid] ++;
- DMV_SpeedLimit[playerid] = TestData_Speeds[DMV_Testing[playerid]-1][DMV_Index[playerid]];
- if(DMV_Index[playerid] == DMV_TEST_LAST_CP)
- {
- PassDMVTest(playerid);
- return true;
- }
- new cp_type;
- if(DMV_Index[playerid] < DMV_TEST_LAST_CP - 1)
- {
- switch(DMV_Testing[playerid])
- {
- case 1,2,3,4: cp_type = 0;
- case 5,6: cp_type = 3;
- }
- SetPlayerRaceCheckpointEx(playerid, cp_type, TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]][0], TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]][1], TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]][2], TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]+1][0], TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]+1][1], TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]+1][2], 5.0);
- }
- if(DMV_Index[playerid] == DMV_TEST_LAST_CP - 1)
- {
- switch(DMV_Testing[playerid])
- {
- case 1,2,3,4: cp_type = 1;
- case 5,6: cp_type = 4;
- }
- SetPlayerRaceCheckpointEx(playerid, cp_type, TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]][0], TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]][1], TestData_Points[DMV_Testing[playerid]-1][DMV_Index[playerid]][2], 0.0, 0.0, 0.0, 5.0);
- }
- return true;
- }
- if(DeliveringStock[playerid] > 1)
- {
- new modelid = GetVehicleModel(GetPlayerVehicleID(playerid));
- if(modelid == 456 || modelid == 498 || modelid == 499)
- {
- new bizzid = DeliverStockList[playerid][DeliveringStock[playerid] - 2];
- if(IsVehicleInRangeOfPoint(GetPlayerVehicleID(playerid), 25.0, BizzData[bizzid][oPosX], BizzData[bizzid][oPosY], BizzData[bizzid][oPosZ]))
- {
- SendClientMessage(playerid,COLOR_ORANGE,"Wait here for the truck to be unloaded, the marker will disappear when ready.");
- DeliveryTimer[playerid] = SetTimerEx("DeliveryContinue",10000,0,"d",playerid);
- DeliveringAtStop[playerid] = 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ORANGE, "You have arrived at the wrong location, route is being recalculated.");
- DisablePlayerRaceCheckpoint(playerid);
- SetPlayerRaceCheckpoint(playerid, 2, BizzData[bizzid][oPosX], BizzData[bizzid][oPosY], BizzData[bizzid][oPosZ], 0.0, 0.0, 0.0, 20.0);
- return true;
- }
- }
- }
- if(HasGPSWaypoint[playerid] == 1)
- {
- HasGPSWaypoint[playerid] = 0;
- DisablePlayerRaceCheckpoint(playerid);//observar
- SendSatNavText(playerid, "GPS voice says: You have reached your destination.");
- return true;
- }
- return true;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- if(IsDrivingBus{playerid})
- {
- if(WaitingAtStop{playerid})
- {
- WaitingAtStop{playerid} = false;
- KillTimer(BusStopTimer[playerid]);
- SendClientMessage(playerid, COLOR_RED, "You left the bus stop too early; go back.");
- }
- }
- if(DeliveringStock[playerid] > 1)
- {
- if(DeliveringAtStop[playerid] == 1)
- {
- DeliveringAtStop[playerid] = 0;
- KillTimer(DeliveryTimer[playerid]);
- SendClientMessage(playerid, COLOR_RED, "You left the area too early, go back to finish the delivery.");
- }
- }
- return true;
- }
- public OnRconCommand(cmd[])
- {
- return true;
- }
- public OnObjectMoved(objectid)
- {
- return true;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return true;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- if(source == 0)
- {
- if(IsPlayerAdminLevelOK(playerid, 1))
- {
- new str[12];
- format(str, 12, "%i", clickedplayerid);
- cmd_stats(playerid, str);
- return true;
- }
- }
- return true;
- }
- public OnModelSelectionResponse(playerid, extraid, index, modelid, response)
- {
- if((response) && (extraid == MODEL_SACSO_SKINS)) {
- SetPlayerSkinEx(playerid, modelid);
- Clothes[playerid][4] = modelid;
- cPlayersSkin[playerid] = modelid;
- MySQLUpdateInt(SQLID[playerid], "SkinSet5", Clothes[playerid][4], "players");
- MySQLUpdateInt(SQLID[playerid], "Skin", cPlayersSkin[playerid], "players");
- return 1;
- }
- if((response) && (extraid == MODEL_SACFD_SKINS)) {
- SetPlayerSkinEx(playerid, modelid);
- Clothes[playerid][4] = modelid;
- cPlayersSkin[playerid] = modelid;
- MySQLUpdateInt(SQLID[playerid], "SkinSet5", Clothes[playerid][4], "players");
- MySQLUpdateInt(SQLID[playerid], "Skin", cPlayersSkin[playerid], "players");
- return 1;
- }
- if((response) && (extraid == MODEL_SELECTION_PFURNITURE)) {
- new x;
- for(; x != MAX_FURNITURE; x++)
- if(FurniData[x][fModel] == modelid) break;
- new Float:pX,Float:pY,Float:pZ,Float:pA;
- GetPlayerPos(playerid,pX,pY,pZ);
- SetPlayerPos(playerid,pX-0.05,pY-0.05,pZ);
- GetXYInFrontOfPlayer(playerid,pX,pY,3.0);
- GetPlayerFacingAngle(playerid,pA);
- PlayerBuyFurniture[playerid][0] = CreateDynamicObject(modelid, pX, pY, pZ-0.5, 0.0, 0.0, pA, HouseData[IsInHouseID[playerid]][HouseVW]);
- Streamer_Update(playerid);
- EditDynamicObject(playerid, PlayerBuyFurniture[playerid][0]);
- PlayerBuyFurniture[playerid][1] = x;
- return true;
- }
- if((response) && (extraid == MODEL_SELECTION_MODS))
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- AddVehicleComponent(vehicleid, modelid);
- ModQueue[playerid][GetVehicleComponentType(modelid)] = modelid;
- SendSplitMessageF(playerid, COLOR_WHITE, "You have added a(n) "COL_NICEGREEN"%s{FFFFFF} to your modding queue. When you wish to finalize your purchase, use /buymods. If you wish to clear your pending mods, use /clearmods", GetVehicleModName(modelid));
- new mods[50], count = 0, desc[50][32];
- for(new m = 1000; m < 1193; m++)
- {
- if(IsVehicleUpgradeCompatible(VehicleData[vehicleid][VehicleModel], m) && IsActualVehicleMod(m))
- {
- format(desc[count], 32, "%s", GetVehicleModName(m));
- mods[count] = m;
- count ++;
- }
- }
- ShowModelSelectionMenu(playerid, mods[count], count, "Add Modifcations", MODEL_SELECTION_MODS, 0.0, 0.0, 0.0);
- return true;
- }
- if((response) && (extraid == MODEL_SELECTION_WHEELS))
- {
- new v = GetPlayerVehicleID(playerid);
- AddVehicleComponent(v, modelid);
- ModQueue[playerid][GetVehicleComponentType(modelid)] = modelid;
- SendSplitMessageF(playerid, COLOR_WHITE, "You have added "COL_NICEGREEN"%s{FFFFFF} to your modding queue. When you wish to finalize your purchase, use /buymods. If you wish to clear your pending mods, use /clearmods.", GetVehicleModName(modelid));
- ShowModelSelectionMenu(playerid, "Add Wheels", MODEL_SELECTION_WHEELS, {1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1096, 1097, 1098}, 17, 0.0, 0.0, 90.0);
- return true;
- }
- if((response) && (extraid == MODEL_SELECTION_FURNITURE))
- {
- new hid = IsInHouseID[playerid];
- for(new slot = 0; slot < MAX_HFURNITURE; slot++)
- {
- if(HouseData[hid][FurnModel][slot] == modelid && HouseData[hid][FurnPlaced][slot] == 0)
- {
- new fname[50];
- format(fname, sizeof(fname), "%s", GetHouseFurnitureName(HouseData[hid][FurnModel][slot]));
- new Float:pX,Float:pY,Float:pZ,Float:pA;
- GetPlayerPos(playerid,pX,pY,pZ);
- SetPlayerPos(playerid,pX-0.05,pY-0.05,pZ);
- GetXYInFrontOfPlayer(playerid,pX,pY,1.0);
- GetPlayerFacingAngle(playerid,pA);
- if(strfind(fname, "Wall", true) != -1 || strfind(fname, "Doorway", true) != -1 || strfind(fname, "Floor", true) != -1 || strfind(fname, "Carpet", true) != -1 || strfind(fname, "Divider", true) != -1) pA = pA + 90.0;
- PlayerPlaceFurniture[playerid] = CreateDynamicObject(HouseData[hid][FurnModel][slot], pX, pY, pZ-0.5, 0.0, 0.0, pA, HouseData[hid][HouseVW]);
- Streamer_Update(playerid);
- EditDynamicObject(playerid, PlayerPlaceFurniture[playerid]);
- HouseData[hid][FurnObject][slot] = PlayerPlaceFurniture[playerid];
- MySQLUpdateInt(HouseData[hid][FurnSQLID][slot], "Placed", 1, "hfurniture");
- HouseData[hid][FurnPlaced][slot] = 1;
- SetPVarInt(playerid, "HFArrayIndex", slot);
- break;
- }
- }
- return true;
- }
- if((response) && (extraid == MODEL_SELECTION_SFURNITURE))
- {
- new h = IsInHouseID[playerid];
- for(new f = 0; f < MAX_HFURNITURE; f++)
- {
- if(HouseData[h][FurnModel][f] == modelid && HouseData[h][FurnPlaced][f] == 1)
- {
- GetDynamicObjectPos(HouseData[h][FurnObject][f], FurnPosX[playerid], FurnPosY[playerid], FurnPosZ[playerid]);
- if(IsPlayerInRangeOfPoint(playerid, SFRadius[playerid], FurnPosX[playerid], FurnPosY[playerid], FurnPosZ[playerid]))
- {
- GetDynamicObjectRot(HouseData[h][FurnObject][f], FurnRotX[playerid], FurnRotY[playerid], FurnRotZ[playerid]);
- SendClientMessageF(playerid, COLOR_WHITE, "{FFFFFF}You have selected the following item: {BCDCBC}%s", GetHouseFurnitureName(HouseData[h][FurnModel][f]));
- SetPVarInt(playerid, "HFArrayIndex", f);
- PlayerEditFurniture[playerid] = HouseData[h][FurnObject][f];
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "Item da casa", (IsWeedPlantObject(HouseData[h][FurnModel][f])) ? (WEEDEDITSTR) : (FURNEDITSTR), "Select", "Close");
- break;
- }
- }
- }
- SFRadius[playerid] = 0.0;
- return true;
- }
- if((response) && (extraid == MODEL_REMOVE_FURNITURE))
- {
- new hid = IsInHouseID[playerid];
- for(new slot = 0; slot < MAX_HFURNITURE; slot++)
- {
- if(HouseData[hid][FurnModel][slot] == modelid && HouseData[hid][FurnPlaced][slot] == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM hfurniture WHERE HouseSQLID=%i AND Model=%i AND Placed=0 LIMIT 1", HouseData[hid][HouseSQLID], modelid);
- mysql_pquery(conn, mquery);
- HouseData[hid][FurnSQLID][slot] = 0;
- HouseData[hid][FurnModel][slot] = 0;
- HouseData[hid][FurnPlaced][slot] = 0;
- HouseData[hid][FurnObject][slot] = 0;
- SendClientMessageF(playerid, COLOR_WHITE, "You have removed the {BCDCBC}%s{FFFFFF} from your unplaced furniture inventory.", GetHouseFurnitureName(modelid));
- break;
- }
- }
- return true;
- }
- if(response && extraid == MODEL_REMOVE_EFURNITURE)
- {
- new h = GetHouseForExteriorEdit(playerid);
- if(h == -1) return true;
- for(new f = 0; f < MAX_EHFURNITURE; f++)
- {
- if(EFurnData[h][EFurnModel] == modelid && !EFurnData[h][EFurnPlaced])
- {
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM efurniture WHERE id = %i LIMIT 1", EFurnData[h][EFurnSQLID][f]);
- mysql_pquery(conn, mquery);
- EFurnData[h][EFurnSQLID][f] = 0;
- EFurnData[h][EFurnModel][f] = 0;
- EFurnData[h][EFurnPlaced][f] = false;
- EFurnData[h][EFurnObject][f] = 0;
- SendClientMessageF(playerid, COLOR_WHITE, "You have removed the {BCDCBC}%s{FFFFFF} from your unplaced furniture inventory.", GetHouseFurnitureName(modelid));
- break;
- }
- }
- return true;
- }
- if((response) && (extraid == MODEL_SELECTION_EFURNITURE))
- {
- new h = GetHouseForExteriorEdit(playerid);
- if(h == -1) return true;
- for(new f = 0; f < MAX_EHFURNITURE; f++)
- {
- if(!EFurnData[h][EFurnPlaced][f] && EFurnData[h][EFurnModel][f] == modelid)
- {
- new Float:pX, Float:pY ,Float:pZ, Float:pA;
- GetPlayerPos(playerid, pX, pY, pZ);
- SetPlayerPos(playerid, pX-0.05, pY-0.05, pZ);
- GetXYInFrontOfPlayer(playerid, pX, pY, 1.0);
- GetPlayerFacingAngle(playerid, pA);
- PlayerPlaceOutdoorFurniture[playerid] = CreateDynamicObject(EFurnData[h][EFurnModel][f], pX, pY, pZ-0.5, 0.0, 0.0, pA, -1, -1, -1, HouseData[h][ExtStreamDist]);
- Streamer_Update(playerid);
- EditDynamicObject(playerid, PlayerPlaceOutdoorFurniture[playerid]);
- EFurnData[h][EFurnObject][f] = PlayerPlaceOutdoorFurniture[playerid];
- EFurnData[h][EFurnPlaced][f] = true;
- MySQLUpdateInt(EFurnData[h][EFurnSQLID][f], "Placed", 1, "efurniture");
- SetPVarInt(playerid, "HFArrayIndex", f);
- break;
- }
- }
- return true;
- }
- if(response && extraid == MODEL_SELECTION_SEFURNITURE)
- {
- new h = GetHouseForExteriorEdit(playerid);
- for(new f = 0; f < MAX_EHFURNITURE; f++)
- {
- if(EFurnData[h][EFurnModel][f] == modelid && EFurnData[h][EFurnPlaced][f])
- {
- GetDynamicObjectPos(EFurnData[h][EFurnObject][f], FurnPosX[playerid], FurnPosY[playerid], FurnPosZ[playerid]);
- if(IsPlayerInRangeOfPoint(playerid, SFRadius[playerid], FurnPosX[playerid], FurnPosY[playerid], FurnPosZ[playerid]))
- {
- GetDynamicObjectRot(EFurnData[h][EFurnObject][f], FurnRotX[playerid], FurnRotY[playerid], FurnRotZ[playerid]);
- SendClientMessageF(playerid, COLOR_WHITE, "{FFFFFF}You have selected the following item: {BCDCBC}%s", GetHouseFurnitureName(EFurnData[h][EFurnModel][f]));
- SetPVarInt(playerid, "HFArrayIndex", f);
- PlayerEditOutdoorFurniture[playerid] = EFurnData[h][EFurnObject][f];
- Dialog_Show(playerid, ExteriorFurnitureEdit, DIALOG_STYLE_LIST, "Furniture Item", OFURNEDITSTR, "Select", "Close");
- break;
- }
- }
- }
- SFRadius[playerid] = 0.0;
- return true;
- }
- if(response && extraid == MODEL_EFURNITURE_SNAP)
- {
- if(!response) return Dialog_Show(playerid, ExteriorFurnitureEdit, DIALOG_STYLE_LIST, "Edit Furniture", OFURNEDITSTR, "Select", "Cancel");
- new h = GetHouseForExteriorEdit(playerid), x = GetPVarInt(playerid, "HFArrayIndex");
- DeleteFurnEditPVars(playerid);
- if(h == -1) return true;
- for(new slot = 0; slot < MAX_HFURNITURE; slot++)
- {
- if(EFurnData[h][EFurnModel][slot] == modelid && !EFurnData[h][EFurnPlaced][slot])
- {
- new Float:FurnPos[6];
- GetDynamicObjectPos(EFurnData[h][EFurnObject][x], FurnPos[0], FurnPos[1], FurnPos[2]);
- GetDynamicObjectRot(EFurnData[h][EFurnObject][x], FurnPos[3], FurnPos[4], FurnPos[5]);
- PlayerPlaceFurniture[playerid] = CreateDynamicObject(EFurnData[h][EFurnModel][slot], FurnPos[0], FurnPos[1], FurnPos[2], FurnPos[3], FurnPos[4], FurnPos[5], -1, -1, -1, HouseData[h][ExtStreamDist]);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE efurniture SET Placed = 1, Xpos = %f, Ypos = %f, Zpos = %f, Xrot = %f, Yrot = %f, Zrot = %f WHERE id = %i", FurnPos[0], FurnPos[1], FurnPos[2], FurnPos[3], FurnPos[4], FurnPos[5], EFurnData[h][EFurnSQLID][slot]);
- mysql_pquery(conn, mquery);
- Streamer_AppendArrayData(STREAMER_TYPE_OBJECT, PlayerPlaceFurniture[playerid], E_STREAMER_WORLD_ID, GetPlayerVirtualWorld(playerid));
- Streamer_Update(playerid);
- SendSplitMessageF(playerid, COLOR_WHITE, "You have successfully placed the {BCDCBC}%s{FFFFFF}. You can edit it again at any time using /selectfurniture or /selectflist.", GetHouseFurnitureName(EFurnData[h][EFurnModel][slot]));
- Streamer_Update(playerid);
- EditDynamicObject(playerid, PlayerPlaceFurniture[playerid]);
- EFurnData[h][EFurnObject][slot] = PlayerPlaceFurniture[playerid];
- EFurnData[h][EFurnPlaced][slot] = true;
- SetPVarInt(playerid, "HFArrayIndex", slot);
- break;
- }
- }
- return true;
- }
- if((response) && (extraid == MODEL_SELECTION_ACESSORY)) {
- new precos[11] = {25, 20, 25, 300, 25, 75, 50, 50, 50, 100, 100}, jbstring[144];
- if(Cash[playerid] < precos[BrowseMaskType[playerid]-1]) {
- format(jbstring, 144, "Você não possui $%i.", precos[BrowseMaskType[playerid]-1]);
- SendClientMessage(playerid, -1, jbstring);
- return 1;
- }
- GivePlayerCash(playerid, -precos[BrowseMaskType[playerid]-1]);
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO toys (`tPlayer`, `tModelID`, `tOffsetX`, `tOffsetY`, `tOffsetZ`, tRotX, tRotY, tRotZ, tScaleX, tScaleY, tScaleZ, tMask, tBone) VALUES (%i, %i, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, 1, 1, 1, 2)", SQLID[playerid], modelid);
- mysql_pquery(conn, mquery, "SaveNewMask", "ii", playerid, modelid);
- format(jbstring, 144, "You purchased a new accessory per {07940a}$%i{FFFFFF}", precos[BrowseMaskType[playerid]-1]);
- SendClientMessage(playerid, -1, jbstring);
- // --
- BrowseMaskType[playerid] = 0;
- //IsBrowsingMasks[playerid] = 0;
- //PlayerTextDrawHide(playerid, MaskHelpText[playerid]);
- TogglePlayerControllable(playerid, 1);
- return 1;
- }
- if((response) && (extraid == MODEL_SELECTION_CLOTHES))
- {
- GivePlayerCash(playerid,-50);
- for(new x = 0; x < 4; x++)
- {
- if(Clothes[playerid][x] == 0)
- {
- Clothes[playerid][x] = modelid;
- cPlayersSkin[playerid] = modelid;
- SetPlayerSkin(playerid, cPlayersSkin[playerid]);
- new str[10]; //removido1
- format(str,sizeof(str),"SkinSet%i",x+1);
- MySQLUpdateInt(SQLID[playerid], str, Clothes[playerid][x], "players");
- MySQLUpdateInt(SQLID[playerid], "Skin", cPlayersSkin[playerid], "players");
- SendClientMessageF(playerid,COLOR_PINK, "Hope you like your new look! (-$50) - These clothes have been put into clothes slot %i.", x+1);
- break;
- }
- }
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 25;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- return true;
- }
- if(extraid == MODEL_FURNITURE_SNAP)
- {
- new hid = IsInHouseID[playerid], x = GetPVarInt(playerid, "HFArrayIndex");
- if(!response) return Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", (IsWeedPlantObject(HouseData[hid][FurnModel][x])) ? (WEEDEDITSTR) : (FURNEDITSTR), "Select", "Close");
- for(new slot = 0; slot < MAX_HFURNITURE; slot++)
- {
- if(HouseData[hid][FurnModel][slot] == modelid && HouseData[hid][FurnPlaced][slot] == 0)
- {
- new Float:FurnPos[6];
- GetDynamicObjectPos(HouseData[hid][FurnObject][x], FurnPos[0], FurnPos[1], FurnPos[2]);
- GetDynamicObjectRot(HouseData[hid][FurnObject][x], FurnPos[3], FurnPos[4], FurnPos[5]);
- PlayerPlaceFurniture[playerid] = CreateDynamicObject(HouseData[hid][FurnModel][slot], FurnPos[0], FurnPos[1], FurnPos[2], FurnPos[3], FurnPos[4], FurnPos[5], HouseData[hid][HouseVW]);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET Placed = 1, Xpos = %f, Ypos = %f, Zpos = %f, Xrot = %f, Yrot = %f, Zrot = %f WHERE id = %i", FurnPos[0], FurnPos[1], FurnPos[2], FurnPos[3], FurnPos[4], FurnPos[5], HouseData[hid][FurnSQLID][slot]);
- mysql_pquery(conn, mquery);
- Streamer_AppendArrayData(STREAMER_TYPE_OBJECT, PlayerPlaceFurniture[playerid], E_STREAMER_WORLD_ID, GetPlayerVirtualWorld(playerid));
- Streamer_Update(playerid);
- SendSplitMessageF(playerid, COLOR_WHITE, "You have successfully placed the {BCDCBC}%s{FFFFFF}. You can edit it again at any time using /selectfurniture or /selectflist.", GetHouseFurnitureName(HouseData[hid][FurnModel][slot]));
- Streamer_Update(playerid);
- EditDynamicObject(playerid, PlayerPlaceFurniture[playerid]);
- HouseData[hid][FurnObject][slot] = PlayerPlaceFurniture[playerid];
- HouseData[hid][FurnPlaced][slot] = 1;
- SetPVarInt(playerid, "HFArrayIndex", slot);
- break;
- }
- }
- return true;
- }
- if(extraid == MODEL_SELECTION_ROADBLOCK && response)
- {
- new rb;
- for(new x = 0; x < sizeof(RBData); x++)
- {
- if(modelid == RBData[x][RBModel])
- {
- rb = x;
- break;
- }
- }
- new Float:X, Float:Y, Float:Z, Float:Ang;
- GetPlayerPos(playerid, X, Y, Z);
- Ang = GetXYInFrontOfPlayer(playerid, X, Y, RBData[rb][RBDist]);
- for(new rbo = 0; rbo < MAX_PLAYERROADBLOCKS; rbo++)
- {
- if(RoadBlockObjects[playerid][rbo] == INVALID_OBJECT_ID)
- {
- RoadBlockObjects[playerid][rbo] = CreateDynamicObject(RBData[rb][RBModel], X, Y, Z-RBData[rb][RBZDiff], 0.0, 0.0, Ang, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 300.0);
- RoadBlockTimer[playerid][rbo] = 1200;
- EditDynamicObject(playerid, RoadBlockObjects[playerid][rbo]);
- EditingRoadblock[playerid] = RoadBlockObjects[playerid][rbo];
- SelectingRoadblock{playerid} = true;
- break;
- }
- }
- RoadBlockCount[playerid]++;
- SendClientMessage(playerid, COLOR_BLUE, "You have placed a roadblock. It will be automatically removed in 20 minutes.");
- }
- return true;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return true;
- }
- public OnPlayerExitedMenu(playerid)
- {
- TogglePlayerControllable(playerid, 1);
- return true;
- }
- /*public OnRconLoginAttempt(ip[], password[], success) //observar
- {
- new name[MAX_PLAYER_NAME];
- new pid = GetPlayerNameFromIP(ip, name);
- if(!Logged{pid}) Kick(pid);
- if(!success)
- {
- format(gstr, sizeof(gstr),"[Admin] Bad RCon password from ID %i (%s, %s)",pid,name,ip);
- AdminBroadcast(gstr, 1);
- printf("[BAD RCon] IP: %s Password: %s (%s)",ip, password, name);
- format(gstr, sizeof(gstr), "Bad RCON password from %s/%s", name, ip);
- AdminLog(pid, 0, "", gstr);
- }
- else
- {
- printf("[RCon Login] %s (%s)", ip, name);
- new allowrcon = 0;
- MySQLFetchInt(MasterAccount[pid], "HasRCON", allowrcon, "masters");
- format(gstr, sizeof(gstr), "RCON login from %s/%s", name, ip);
- AdminLog(pid, 0, "", gstr);
- if(allowrcon == 0) Kick(pid);
- }
- return true;
- }*/
- public OnQueryError(errorid, error[], callback[], query[], connectionHandle)
- {
- new File:logFile;
- foreach(new p: Player)
- {
- if(IsPlayerAdminLevelOK(p, 1))
- {
- SysMsg(p, "There was a MySQL Error, please contact Revolts with the information below:");
- SysMsgF(p, "Query: %s", query);
- SysMsgF(p, "Error: %s", error);
- }
- }
- print("OnQueryError chamado.");
- format(gstr, sizeof(gstr), "[%s] [MySQL ERROR %i] %s, connection %i, callback '%s', query: '%s'", GetTimeStringAndSec(), errorid, error, connectionHandle, callback, query);
- print(gstr);
- strins(gstr, "\r\n", 0);
- logFile = fopen("/RCRP/SQLError.txt", io_append);
- fwrite(logFile, gstr);
- fclose(logFile);
- return true;
- }
- public OnDynamicObjectMoved(objectid)
- {
- return true;
- }
- stock IsShotgun(weaponid)
- {
- switch(weaponid)
- {
- case 25..27: return true;
- default: return false;
- }
- return false;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
- {
- if(issuerid > MAX_PLAYERS || weaponid == WEAPON_SNIPER || IsWMD(weaponid)) return false;
- if(IsDead[playerid] >= 1 || ADuty[playerid] == 1 || IsFrozen[playerid] == 1 || IsAFK{playerid} || TeleportTimer[playerid] != 0 || Dead{playerid} || Dead{issuerid}) return false;
- new Float:Damage, Float:tdHealth, Float:armour, Float:dist, Float:poz[3], dam, num;
- GetPlayerHealth(playerid,tdHealth);
- GetPlayerArmour(playerid,armour);
- GetPlayerPos(playerid, poz[0], poz[1], poz[2]);
- dist = GetPlayerDistanceFromPoint(issuerid, poz[0], poz[1], poz[2]);
- dam = floatround(dist);
- if(weaponid == 23 && HasTaser{issuerid}) return true;
- if(weaponid == 25 && HasRubberBullets{issuerid}) return true;
- if(IsShotgun(weaponid)) Damage = WeaponDamage[weaponid][WepDamage] - (dam * 2);
- else Damage = WeaponDamage[weaponid][WepDamage];
- switch(bodypart)
- {
- case 3: Damage -= (Damage / 3.8); //Peito
- case 4: Damage -= (Damage / 4.0); //virilha
- case 5, 6: Damage -= (Damage / 2.4); //braço esquerdo, braço direito
- case 7, 8: Damage -= (Damage / 3.0); //perna esquerda, perna direita
- }
- if(dist < 0.9) return true; //evitar danos completos quando um jogador atinge outro com a coronha de sua arma.
- if(armour == 0)
- {
- tdHealth -= Damage;
- }
- else
- {
- armour -= Damage;
- if(armour < 0)
- {
- tdHealth += armour;
- armour = 0;
- RestrictedVest{playerid} = false;
- }
- }
- if(tdHealth <= 0)
- {
- Dead{playerid} = true;
- MakePlayerDead2(playerid);
- MyKills[issuerid] ++;
- MyDeaths[playerid] ++;
- MySQLUpdateInt(SQLID[playerid], "Deaths", MyDeaths[playerid], "players");
- MySQLUpdateInt(SQLID[issuerid], "Kills", MyKills[issuerid], "players");
- format(gstr,sizeof(gstr),"%s has been killed by %s. (%s)", NameEx(playerid), NameEx(issuerid), GetDeathReasonName(issuerid, weaponid));
- AdminBroadcast(gstr, 0);
- printf("[Death] %s(%i) killed by ID %i(%s), reason %s(%i)", NameEx(playerid), playerid, issuerid, NameEx(issuerid), GetDeathReasonName(issuerid, weaponid), weaponid);
- format(sgstr,sizeof(sgstr),"[%s] %s(%i) killed by ID %i(%s), reason %s(%i)",GetServerTimeString(), NameEx(playerid), playerid, issuerid, NameEx(issuerid), GetDeathReasonName(issuerid, weaponid), weaponid);
- TriggerPlayerDeath(playerid);
- }
- else
- {
- SetPlayerArmourEx(playerid, armour, 0);
- SetPlayerHealthEx(playerid, tdHealth);
- }
- if(IsPlayerMasked{playerid}) FormatHealthLabelText(playerid, tdHealth, armour, 2);
- ShotsHit[issuerid] ++;
- if(bodypart == 9) HeadshotsHit[issuerid] ++;
- // Weapon Injury System
- if(Damage != 0)
- {
- if(armour == 0.0)
- {
- if(HitCount[playerid] >= 50) HitCount[playerid] = 49;
- num = HitCount[playerid];
- Injuries[playerid][num][pWeaponID] = weaponid;
- Injuries[playerid][num][pBodypart] = bodypart;
- HitCount[playerid] += 1;
- }
- }
- if(weaponid == 50 || weaponid == 49)
- {
- SetPlayerChatBubble(playerid, "* Falls onto the ground, placing their hands flat on the ground for support. *", COLOR_EMOTE, 15.0, 6000);
- cmd_rollfall(playerid);
- }
- return true;
- }
- public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
- {
- if(IsDead[damagedid] >= 1 || ADuty[damagedid] == 1 || IsFrozen[damagedid] == 1 || IsAFK{damagedid} || Dead{playerid} || TeleportTimer[damagedid] != 0) return false;
- if(IsCop(playerid) || Faction[playerid] == FACTION_RESEARCH || IsPlayerAdmin(playerid))
- {
- if(HasTaser{playerid} && weaponid == WEAPON_SILENCED && IsPlayerInAnyVehicle(playerid) == 0)
- {
- if(Dead{damagedid}) return true;
- if(IsPlayerInAnyVehicle(damagedid) && !IsBike(GetPlayerVehicleID(damagedid))) return true;
- new Float:pos[3];
- GetPlayerPos(damagedid, pos[0], pos[1], pos[2]);
- if(PlayerTased[damagedid] == 0 && GetPlayerDistanceFromPoint(playerid, pos[0], pos[1], pos[2]) < 25)
- {
- if(IsPlayerInAnyVehicle(damagedid)) RemovePlayerFromVehicle(damagedid);
- OnePlayAnim(damagedid, "CRACK", "crckdeth2", 4.0, 1, 1, 1, -1, 0);
- SetTimerEx("UnfreezeTased", 10000, false, "i", damagedid);
- ShowInfoText(damagedid, "~r~You are Tased", 11000);
- PlayerTased[damagedid] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "You have tased the suspect.");
- format(sgstr, sizeof(sgstr),"* %s has been tased by %s. *", NameRP(damagedid), NameRP(playerid));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- PlayerPlaySound(playerid, 4400, 0, 0, 0);
- PlayerPlaySound(damagedid, 4400, 0, 0, 0);
- return true;
- }
- }
- if(HasRubberBullets{playerid} && weaponid == 25 && IsPlayerInAnyVehicle(damagedid) == 0 && IsPlayerInAnyVehicle(playerid) == 0)
- {
- if(Dead{damagedid}) return true;
- if(IsPlayerInAnyVehicle(damagedid) && !IsBike(GetPlayerVehicleID(damagedid))) return true;
- new Float:pos[3];
- GetPlayerPos(damagedid, pos[0], pos[1], pos[2]);
- if(PlayerRubber[damagedid] == 0 && GetPlayerDistanceFromPoint(playerid, pos[0], pos[1], pos[2]) < 25)
- {
- if(IsPlayerInAnyVehicle(damagedid)) RemovePlayerFromVehicle(damagedid);
- OnePlayAnim(damagedid, "CRACK", "crckdeth2", 4.0, 1, 1, 1, -1, 0);
- SetTimerEx("UnfreezeRubber", 10000, false, "i", damagedid);
- PlayerRubber[damagedid] = 1;
- format(sgstr, sizeof(sgstr),"* %s has been hit with a rubber bullet by %s and has been forced to the ground. *", NameRP(damagedid), NameRP(playerid));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- }
- }
- if(Dead{damagedid})
- {
- if(bodypart == 9 && DeathTimer[damagedid] != 0)
- {
- if(!IsPlayerInAnyVehicle(damagedid)) OnePlayAnim(damagedid, "PARACHUTE", "FALL_skyDive_DIE", 3.5, 0, 0, 0, 1, 0);
- DeathTimer[damagedid] = 0;
- PlayerTextDrawSetString(damagedid, DeathText[damagedid], " ");
- PlayerTextDrawHide(damagedid, DeathText[damagedid]);
- SendClientMessage(damagedid, COLOR_WHITE, "You have been executed. You are now free to {FFFF82}/accept death{FFFFFF} if you wish.");
- DestroyDynamic3DTextLabel(LabelFerido[playerid]);
- }
- return true;
- }
- if(!InvalidPlayer(playerid) && (weaponid == WEAPON_SNIPER || IsWMD(weaponid)))
- {
- new Float:Damage, Float:tdHealth, Float:armour, Float:poz[3], num;
- GetPlayerHealth(damagedid,tdHealth);
- GetPlayerArmour(damagedid,armour);
- GetPlayerPos(damagedid, poz[0], poz[1], poz[2]);
- Damage = WeaponDamage[weaponid][WepDamage];
- switch(bodypart)
- {
- case 3: Damage = Damage - (Damage / 3.8);
- case 4: Damage = Damage - (Damage / 4.0);
- case 5: Damage = Damage - (Damage / 2.4);
- case 6: Damage = Damage - (Damage / 2.5);
- case 7: Damage = Damage - (Damage / 3.0);
- case 8: Damage = Damage - (Damage / 2.9);
- }
- if(armour == 0)
- {
- tdHealth = tdHealth - Damage;
- }
- else
- {
- armour = armour - Damage;
- if(armour < 0)
- {
- tdHealth = tdHealth + armour;
- armour = 0;
- RestrictedVest{damagedid} = false;
- }
- }
- if(tdHealth <= 0)
- {
- Dead{damagedid} = true;
- MakePlayerDead2(damagedid);
- format(gstr,sizeof(gstr),"%s has been killed by %s. (%s)", NameEx(damagedid), NameEx(playerid), GetDeathReasonName(playerid, weaponid));
- AdminBroadcast(gstr, 0);
- MyKills[playerid] ++;
- MyDeaths[damagedid] ++;
- MySQLUpdateInt(SQLID[damagedid], "Deaths", MyDeaths[damagedid], "players");
- MySQLUpdateInt(SQLID[playerid], "Kills", MyKills[playerid], "players");
- printf("[Death] %s(%i) killed by ID %i(%s), reason %s(%i)", NameEx(damagedid), damagedid, playerid, NameEx(playerid), GetDeathReasonName(playerid, weaponid), weaponid);
- format(sgstr,sizeof(sgstr),"[%s] %s(%i) killed by ID %i(%s), reason %s(%i)",GetServerTimeString(), NameEx(damagedid), damagedid, playerid, NameEx(playerid), GetDeathReasonName(playerid, weaponid), weaponid);
- TriggerPlayerDeath(damagedid);
- }
- else
- {
- SetPlayerArmourEx(damagedid, armour, 0);
- SetPlayerHealthEx(damagedid, tdHealth);
- }
- if(IsPlayerMasked{damagedid}) FormatHealthLabelText(damagedid, tdHealth, armour, 2);
- ShotsHit[playerid] ++;
- if(bodypart == 9) HeadshotsHit[playerid] ++;
- // Weapon Injury System
- if(Damage != 0)
- {
- if(armour == 0.0)
- {
- if(HitCount[damagedid] >= 50) HitCount[damagedid] = 49;
- num = HitCount[damagedid];
- Injuries[damagedid][num][pWeaponID] = weaponid;
- Injuries[damagedid][num][pBodypart] = bodypart;
- HitCount[damagedid] += 1;
- }
- }
- }
- return true;
- }
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
- {
- ShotsFired[playerid] ++;
- new we, am, slot = GetWeaponSlot(weaponid);
- GetPlayerWeaponData(playerid, slot, we, am);
- if(WeaponData[playerid][slot][Weapon] > 0)
- {
- WeaponData[playerid][slot][Weapon] = weaponid;
- if(am > 0)
- {
- if(HasTaser{playerid} && weaponid == WEAPON_SILENCED) return true;
- else WeaponData[playerid][slot][WeaponAmmo] = am - 1;
- }
- else
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET WeaponPossession = 0, Deleted = 1 WHERE id = %i AND TrunkID = -1 AND FCarID = -1 AND Gunrack = -1 AND Dropped = 0 AND HouseID = -1", WeaponData[playerid][slot][WeaponID]);
- mysql_pquery(conn, mquery);
- ResetWeaponVariables(playerid, 0, slot);
- }
- }
- return true;
- }
- public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
- {
- //Verifique se o jogador clicou na "select" textdraw
- if(playertextid == CharSelInfoTD[playerid][0][0] || playertextid == CharSelInfoTD[playerid][1][0] || playertextid == CharSelInfoTD[playerid][2][0] || playertextid == CharSelInfoTD[playerid][3][0])
- {
- if(!PlayerSelectedCharacter{playerid})
- {
- PlayerSelectedCharacter{playerid} = true;
- new sql;
- if(playertextid == CharSelInfoTD[playerid][0][0]) sql = CharSelectSQL[playerid][0];
- if(playertextid == CharSelInfoTD[playerid][1][0]) sql = CharSelectSQL[playerid][1];
- if(playertextid == CharSelInfoTD[playerid][2][0]) sql = CharSelectSQL[playerid][2];
- if(playertextid == CharSelInfoTD[playerid][3][0]) sql = CharSelectSQL[playerid][3];
- TextDrawHideForPlayer(playerid, CharSelBackground);
- TextDrawHideForPlayer(playerid, CharSelHeader);
- TextDrawHideForPlayer(playerid, CharSelX);
- PlayerTextDrawHide(playerid, CharSelWelcome[playerid]);
- for(new x = 0; x < 4; x++)
- {
- PlayerTextDrawHide(playerid, CharSelInfoTD[playerid][x][0]);
- PlayerTextDrawHide(playerid, CharSelInfoTD[playerid][x][1]);
- PlayerTextDrawHide(playerid, CharSelInfoTD[playerid][x][2]);
- PlayerTextDrawHide(playerid, CharSelInfoTD[playerid][x][3]);
- CharSelectSQL[playerid][x] = 0;
- CharSelectSkin[playerid][x] = 0;
- CharSelectFaction[playerid][x] = 0;
- CharSelectLevel[playerid][x] = 0;
- }
- CancelSelectTextDraw(playerid);
- OnPlayerSelectCharacter(playerid, sql, GetSQLName(sql));
- return true;
- }
- }
- if(playertextid == VSelectOptions[playerid][0] || playertextid == VSelectOptions[playerid][1] || playertextid == VSelectOptions[playerid][2] || playertextid == VSelectOptions[playerid][3] || playertextid == VSelectOptions[playerid][4])
- {
- new id = -1;
- if(playertextid == VSelectOptions[playerid][0]) id = 0;
- if(playertextid == VSelectOptions[playerid][1]) id = 1;
- if(playertextid == VSelectOptions[playerid][2]) id = 2;
- if(playertextid == VSelectOptions[playerid][3]) id = 3;
- if(playertextid == VSelectOptions[playerid][4]) id = 4;
- if(id == -1) return SysMsg(playerid, "An error has occurred.");
- new v = VSelectID[playerid][id];
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET Spawned = 1 WHERE id = %i", PlayerCars[playerid][v][CarSQLID]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM vehicles WHERE id = %i", PlayerCars[playerid][v][CarSQLID]);
- mysql_pquery(conn, mquery, "LoadPlayerCar", "i", playerid);
- PlayerCars[playerid][v][CarSpawned] = true;
- HideVMenuTextdraws(playerid);
- CancelSelectTextDraw(playerid);
- VSelectID[playerid][0] = -1;
- VSelectID[playerid][1] = -1;
- VSelectID[playerid][2] = -1;
- VSelectID[playerid][3] = -1;
- VSelectID[playerid][4] = -1;
- VSelectOffset[playerid] = -1;
- return true;
- }
- return true;
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- //cancel a seleção de caracteres TextDraw e chutar o jogador do servidor
- if(clickedid == Text:INVALID_TEXT_DRAW && CharSelectSQL[playerid][0] >= 1)
- {
- return OnPlayerClickTextDraw(playerid, CharSelX);
- }
- //check if the player clicked the "x" textdraw in the top corner of the character select menu
- if(clickedid == CharSelX)
- {
- TextDrawHideForPlayer(playerid, CharSelBackground);
- TextDrawHideForPlayer(playerid, CharSelHeader);
- TextDrawHideForPlayer(playerid, CharSelX);
- PlayerTextDrawHide(playerid, CharSelWelcome[playerid]);
- for(new x = 0; x < 4; x++)
- {
- PlayerTextDrawHide(playerid, CharSelInfoTD[playerid][x][0]);
- PlayerTextDrawHide(playerid, CharSelInfoTD[playerid][x][1]);
- PlayerTextDrawHide(playerid, CharSelInfoTD[playerid][x][2]);
- PlayerTextDrawHide(playerid, CharSelInfoTD[playerid][x][3]);
- }
- CancelSelectTextDraw(playerid);
- KickPlayer(playerid, 6);
- return true;
- }
- if(clickedid == Text:INVALID_TEXT_DRAW && VSelectOptions[playerid][0] != PlayerText:INVALID_TEXT_DRAW)//parei aqui -car
- {
- VSelectOffset[playerid] = -1;
- VSelectID[playerid][0] = -1;
- VSelectID[playerid][1] = -1;
- VSelectID[playerid][2] = -1;
- VSelectID[playerid][3] = -1;
- VSelectID[playerid][4] = -1;
- HideVMenuTextdraws(playerid);
- CancelSelectTextDraw(playerid);
- return true;
- }
- if(clickedid == Text:INVALID_TEXT_DRAW && CreatingDrugs[playerid][1] > 0) //drug comment
- {
- if(CreatingDrugs[playerid][1] > 0)
- {
- for(new i=0; i < 4; i++) //drug comment
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE ingredients SET ingAmount = ingAmount + %d WHERE id = %d", DrugCombineData[playerid][i + 12],
- DrugCombineData[playerid][i + 16]);
- mysql_pquery(conn, mquery);
- PlayerTextDrawSetPreviewModel(playerid, DrugCombineP[playerid][i], 18631);
- DrugCombineData[playerid][i] = 18631;
- DrugCombineData[playerid][i+4] =-1;
- DrugCombineData[playerid][i+8] =-1;
- DrugCombineData[playerid][i+12] = 0;
- DrugCombineData[playerid][i+16] =-1;
- }
- CancelIngMenu(playerid);
- DrunkLevel[playerid] = 0;
- //PlayerTextDrawDestroy(playerid, BlindfoldEffect[playerid]);
- MovementSpeed[playerid][0] = 0.0;
- MovementSpeed[playerid][1] = 0.0;
- for(new ov = 0; ov < sizeof(OverdoseWaitEffect[]); ov++)
- OverdoseWaitEffect[playerid][ov] = -1;
- for(new bd = 0; bd < sizeof(BaseEffects); bd++)
- BloodDrugLevels[playerid][bd] = 0;
- for(new d = 0; d < 10; d++)
- DrugsTaken[playerid][d] = -1;
- CreatingDrugs[playerid][1] = -1;
- CreatingDrugs[playerid][2] = -1;
- }
- }
- if(clickedid == DrugCombine[6])
- {
- for(new i=0; i < 4; i++) //drug comment
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE ingredients SET ingAmount = ingAmount + %d WHERE id = %d", DrugCombineData[playerid][i + 12],
- DrugCombineData[playerid][i + 16]);
- mysql_pquery(conn, mquery);
- PlayerTextDrawSetPreviewModel(playerid, DrugCombineP[playerid][i], 18631);
- DrugCombineData[playerid][i] = 18631;
- DrugCombineData[playerid][i+4] =-1;
- DrugCombineData[playerid][i+8] =-1;
- DrugCombineData[playerid][i+12] = 0;
- DrugCombineData[playerid][i+16] =-1;
- }
- CancelIngMenu(playerid);
- DrunkLevel[playerid] = 0;
- //PlayerTextDrawDestroy(playerid, BlindfoldEffect[playerid]);
- MovementSpeed[playerid][0] = 0.0;
- MovementSpeed[playerid][1] = 0.0;
- for(new ov = 0; ov < sizeof(OverdoseWaitEffect[]); ov++)
- OverdoseWaitEffect[playerid][ov] = -1;
- for(new bd = 0; bd < sizeof(BaseEffects); bd++)
- BloodDrugLevels[playerid][bd] = 0;
- for(new d = 0; d < 10; d++)
- DrugsTaken[playerid][d] = -1;
- CreatingDrugs[playerid][1] = -1;
- CreatingDrugs[playerid][2] = -1;
- return true;
- }
- if(clickedid == DrugCombine[7])
- {
- if(CreatingDrugs[playerid][1] < 4)
- {
- PlayerTextDrawSetPreviewModel(playerid, DrugCombineP[playerid][CreatingDrugs[playerid][1]], 18631);
- DrugCombineData[playerid][CreatingDrugs[playerid][1]] = 18631;
- PlayerTextDrawShow(playerid, DrugCombineP[playerid][CreatingDrugs[playerid][1]]);
- PlayerTextDrawHide(playerid, DrugCombineP[playerid][4]);
- TextDrawHideForPlayer(playerid, DrugCombine[7]);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE ingredients SET ingAmount = ingAmount + %d WHERE id = %d", DrugCombineData[playerid][CreatingDrugs[playerid][1] + 12],
- DrugCombineData[playerid][CreatingDrugs[playerid][1] + 16]);
- mysql_pquery(conn, mquery);
- DrugCombineData[playerid][CreatingDrugs[playerid][1] + 4] = -1;
- DrugCombineData[playerid][CreatingDrugs[playerid][1] + 12] = -1;
- DrugCombineData[playerid][CreatingDrugs[playerid][1] + 16] = -1;
- CreatingDrugs[playerid][1] = -1;
- }
- }
- if(clickedid == DrugCombine[5])
- {
- CancelSelectTextDraw(playerid);
- CombineDrug(playerid);
- }
- if(clickedid == NewDrugTD[2])
- {
- TextDrawHideForPlayer(playerid, NewDrugTD[0]);
- TextDrawHideForPlayer(playerid, NewDrugTD[1]);
- TextDrawHideForPlayer(playerid, NewDrugTD[2]);
- CancelSelectTextDraw(playerid);
- Dialog_Show(playerid, SetDrugName, DIALOG_STYLE_INPUT,
- "{FFFFFF}Name your new drug!", "{FFFFFF}Please enter a name below to identify your new chemical.\n\nRules:\n- You cannot rename your drug.\n- If you use a name that is offensive or is idiotic, you will be locked out from the drugs system.", "Submit", "Cancel");
- }
- return true;
- }
- public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
- {
- if(IsPlayerAdmin(playerid))
- {
- SetPlayerPos(playerid, fX, fY, fZ);
- SysMsgF(playerid, "TP Administrativo: %f, %f, %f", fX, fY, fZ);
- }
- }
- public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
- {
- CancelEdit(playerid);
- if(SelectingRoadblock{playerid})
- {
- foreach(new p: Player)
- {
- if(IsCop(p) || Faction[p] == FACTION_SACFD || Faction[p] == FACTION_RESEARCH || Faction[p] == FACTION_TRUCKING || IsPlayerAdminLevelOK(p, 1))
- {
- for(new i = 0; i < MAX_PLAYERROADBLOCKS; i++)
- {
- if(RoadBlockObjects[p][i] == objectid)
- {
- EditDynamicObject(playerid, RoadBlockObjects[p][i]);
- EditingRoadblock[playerid] = objectid;
- return true;
- }
- }
- }
- }
- }
- if(RemovingRoadblock{playerid})
- {
- foreach(new p: Player)
- {
- if(IsCop(p) || Faction[p] == FACTION_SACFD || Faction[p] == FACTION_RESEARCH || Faction[p] == FACTION_TRUCKING || IsPlayerAdminLevelOK(p, 1))
- {
- for(new i = 0; i < MAX_PLAYERROADBLOCKS; i++)
- {
- if(RoadBlockObjects[p][i] == objectid)
- {
- new Float:oX, Float:oY, Float:oZ;
- GetDynamicObjectPos(RoadBlockObjects[p][i],oX,oY,oZ);
- if(IsPlayerInRangeOfPoint(playerid,5.0,oX,oY,oZ))
- {
- foreach(new q: Player)
- {
- if(EditingRoadblock[q] == RoadBlockObjects[p][i])
- {
- CancelEdit(q);
- EditingRoadblock[q] = -1;
- SelectingRoadblock{q} = false;
- SendClientMessage(playerid, COLOR_BLUE, "The roadblock you were editing has been removed by another player.");
- }
- }
- DestroyRoadblock(p, i);
- RemovingRoadblock{playerid} = false;
- SendClientMessage(playerid, COLOR_BLUE, "You have removed a roadblock.");
- return true;
- }
- }
- }
- }
- }
- }
- if(GetPVarInt(playerid, "SelectingAnnoyingObject") == 1)
- {
- new Float:oPos[6];
- GetDynamicObjectPos(objectid, oPos[0], oPos[1], oPos[2]);
- GetDynamicObjectRot(objectid, oPos[3], oPos[4], oPos[5]);
- SendClientMessageF(playerid, COLOR_WHITE, "Object ID: %i. Model: %i. Pos: %f %f %f %f %f %f", objectid, modelid, oPos[0], oPos[1], oPos[2], oPos[3], oPos[4], oPos[5]);
- DeletePVar(playerid, "SelectingAnnoyingObject");
- return true;
- }
- if(GetPVarInt(playerid, "SelectingOurdoorFurn") == 1)
- {
- DeletePVar(playerid, "SelectingOurdoorFurn");
- new h = GetHouseForExteriorEdit(playerid);
- if(h == -1) return true;
- for(new f = 0; f < MAX_EHFURNITURE; f++)
- {
- if(objectid == EFurnData[h][EFurnObject][f])
- {
- if(!IsPlayerInRangeOfPoint(playerid, 25.0, x, y, z)) return SysMsg(playerid, "You are not close enough to the object to edit it.");
- SetPVarInt(playerid, "HFArrayIndex", f);
- PlayerEditOutdoorFurniture[playerid] = EFurnData[h][EFurnObject][f];
- SendClientMessageF(playerid, COLOR_WHITE, "{FFFFFF}You have selected the following item: {BCDCBC}%s", GetHouseFurnitureName(EFurnData[h][EFurnModel][f]));
- Dialog_Show(playerid, ExteriorFurnitureEdit, DIALOG_STYLE_LIST, "House Item", OFURNEDITSTR, "Select", "Cancel");
- return true;
- }
- }
- return true;
- }
- if(IsInHouseID[playerid] != -1)
- {
- new h = IsInHouseID[playerid];
- if(CreatingDrugs[playerid][0] == 1) {
- for(new f = 0; f < GetMaxFurnitureForPlayer(playerid); f++)
- {
- if(objectid == HouseData[IsInHouseID[playerid]][FurnObject][f])
- {
- if(CreatingDrugs[playerid][0] == 1) //drug comment
- {
- if(HouseData[IsInHouseID[playerid]][DrugTimer][f] <= 0)
- {
- for(new i = 0; i < 4; i++)
- {
- PlayerTextDrawSetPreviewModel(playerid, DrugCombineP[playerid][i], 18631);
- DrugCombineData[playerid][i] = 18631;
- DrugCombineData[playerid][i+4] =-1;
- DrugCombineData[playerid][i+8] =-1;
- DrugCombineData[playerid][i+12] = 0;
- DrugCombineData[playerid][i+16] =-1;
- }
- CancelIngMenu(playerid);
- for(new i = 0; i < sizeof(DrugCombine) - 1; i++)
- TextDrawShowForPlayer(playerid, DrugCombine[i]);
- for(new i = 0; i < sizeof(DrugCombineP[]) - 1; i++)
- PlayerTextDrawShow(playerid, DrugCombineP[playerid][i]);
- CreatingDrugs[playerid][2] = f;
- SelectTextDraw(playerid, COLOR_ORANGE);
- return 1;
- }
- else
- {
- CreatingDrugs[playerid][2] = f;
- return Dialog_Show(playerid, CreateDrugsEndProcess, DIALOG_STYLE_MSGBOX, "{FFFFFF}Drug Creation - End Process", "{FFFFFF}Are you sure you want to cancel the drug creation process now?", "Confirm", "Cancel");
- }
- }
- else if(HouseData[IsInHouseID[playerid]][DrugTimer][f] == 1)
- {
- CreatingDrugs[playerid][2] = f;
- return Dialog_Show(playerid, CreateDrugsConfirm, DIALOG_STYLE_LIST, "Drug Creation - Confirm creation", "Create new drug\nDestroy drug", "Select", "Cancel");
- }
- else if(HouseData[IsInHouseID[playerid]][DrugTimer][f] > 1)
- {
- CreatingDrugs[playerid][2] = f;
- return Dialog_Show(playerid, CreateDrugsEndProcess, DIALOG_STYLE_MSGBOX, "{FFFFFF}Drug Creation - End Process", "{FFFFFF}Are you sure you want to cancel the drug creation process now?", "Confirm", "Cancel");
- }
- }
- }
- }
- if(CanFurnishHouse(playerid, h))
- {
- for(new f = 0; f < MAX_HFURNITURE; f++)
- {
- if(objectid == HouseData[h][FurnObject][f])
- {
- SetPVarInt(playerid, "HFArrayIndex", f);
- PlayerEditFurniture[playerid] = HouseData[h][FurnObject][f];
- SendClientMessageF(playerid, COLOR_WHITE, "{FFFFFF}Você selecionou o seguinte item: {BCDCBC}%s", GetHouseFurnitureName(HouseData[h][FurnModel][f]));
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "Item da casa", (IsWeedPlantObject(HouseData[h][FurnModel][f])) ? (WEEDEDITSTR) : (FURNEDITSTR), "Select", "Close");
- return true;
- }
- }
- }
- }
- return false;
- }
- public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
- {
- if(GetPVarInt(playerid, "SelectingAnnoyingObject") == 1)
- {
- new Float:oPos[6];
- GetObjectPos(objectid, oPos[0], oPos[1], oPos[2]);
- GetObjectRot(objectid, oPos[3], oPos[4], oPos[5]);
- SendClientMessageF(playerid, COLOR_WHITE, "Object ID: %i. Model: %i. Pos: %f %f %f %f %f %f", objectid, modelid, oPos[0], oPos[1], oPos[2], oPos[3], oPos[4], oPos[5]);
- DeletePVar(playerid, "SelectingAnnoyingObject");
- return true;
- }
- return true;
- }
- public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
- {
- new id = -1;
- EditingAttachedObject[playerid] = 0;
- if(response == EDIT_RESPONSE_FINAL)
- {
- for(new t = 0; t < MAX_TOYS; t++)
- {
- if(ToyBeingEdited[playerid] == t)
- {
- if(Faction[playerid] != FACTION_RESEARCH && (modelid == 19515 || modelid == -3000))
- {
- //make sure the scale of the vest isn't too small to avoid people hiding them in their bodies.
- if(fScaleX < 1.0) fScaleX = 1.0;
- if(fScaleY < 1.0) fScaleY = 1.0;
- if(fScaleZ < 1.0) fScaleZ = 1.0;
- //make sure the offset of the vest isn't too large to avoid people moving them too far from their bodies to hide them.
- if(fOffsetX > 1.0 || fOffsetX < -1.0) fOffsetX = 0.0;
- if(fOffsetY > 1.0 || fOffsetY < -1.0) fOffsetY = 0.0;
- if(fOffsetZ > 1.0 || fOffsetZ < -1.0) fOffsetZ = 0.0;
- }
- id = t;
- ToyInfo[playerid][id][tModelID] = modelid;
- ToyInfo[playerid][id][tOffset][0] = fOffsetX;
- ToyInfo[playerid][id][tOffset][1] = fOffsetY;
- ToyInfo[playerid][id][tOffset][2] = fOffsetZ;
- ToyInfo[playerid][id][tRot][0] = fRotX;
- ToyInfo[playerid][id][tRot][1] = fRotY;
- ToyInfo[playerid][id][tRot][2] = fRotZ;
- ToyInfo[playerid][id][tScale][0] = fScaleX;
- ToyInfo[playerid][id][tScale][1] = fScaleY;
- ToyInfo[playerid][id][tScale][2] = fScaleZ;
- ToyInfo[playerid][id][tBone] = boneid;
- ToyInfo[playerid][id][tOptional] = 0;
- for(new p; p < 45; p++)
- {
- if(dropObjectID[p] == modelid)
- {
- SetPlayerArmedWeapon(playerid, p);
- IsEditingHolster[playerid] = 0;
- AttachedObjects[playerid][index][aoBone] = 0;
- IsHolstered[playerid][GetWeaponSlot(p)] = 1;
- ToyInfo[playerid][id][tScale][0] = 1.0;
- ToyInfo[playerid][id][tScale][1] = 1.0;
- ToyInfo[playerid][id][tScale][2] = 1.0;
- }
- }
- RemovePlayerAttachedObject(playerid, index);
- if(modelid == 19515 && Faction[playerid] == FACTION_RESEARCH) SetPlayerAttachedObject(playerid, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ, 0xFF1B1C1B);
- else SetPlayerAttachedObject(playerid, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ, ToyInfo[playerid][id][tColor], ToyInfo[playerid][id][tColor]);
- SavePlayerToy(playerid, id);
- break;
- }
- }
- if(id == -1)
- {
- id = GetFreeToyInfoSlot(playerid);
- ToyInfo[playerid][id][tModelID] = modelid;
- ToyInfo[playerid][id][tOffset][0] = fOffsetX;
- ToyInfo[playerid][id][tOffset][1] = fOffsetY;
- ToyInfo[playerid][id][tOffset][2] = fOffsetZ;
- ToyInfo[playerid][id][tRot][0] = fRotX;
- ToyInfo[playerid][id][tRot][1] = fRotY;
- ToyInfo[playerid][id][tRot][2] = fRotZ;
- ToyInfo[playerid][id][tScale][0] = fScaleX;
- ToyInfo[playerid][id][tScale][1] = fScaleY;
- ToyInfo[playerid][id][tScale][2] = fScaleZ;
- ToyInfo[playerid][id][tBone] = boneid;
- ToyInfo[playerid][id][tOptional] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO toys (`tPlayer`, `tModelID`, `tOffsetX`, `tOffsetY`, `tOffsetZ`, tRotX, tRotY, tRotZ, tScaleX, tScaleY, tScaleZ, tBone) VALUES (%i, %i, %f, %f, %f, %f, %f, %f, %f, %f, %f, %i)", SQLID[playerid],
- modelid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ, boneid);
- mysql_pquery(conn, mquery);
- }
- AttachedObjects[playerid][index][aoBone] = boneid;
- AttachedObjects[playerid][index][aoModelID] = modelid;
- AttachedObjects[playerid][index][aoOffset][0] = fOffsetX;
- AttachedObjects[playerid][index][aoOffset][1] = fOffsetY;
- AttachedObjects[playerid][index][aoOffset][2] = fOffsetZ;
- AttachedObjects[playerid][index][aoRot][0] = fRotX;
- AttachedObjects[playerid][index][aoRot][1] = fRotY;
- AttachedObjects[playerid][index][aoRot][2] = fRotZ;
- AttachedObjects[playerid][index][aoScale][0] = ToyInfo[playerid][id][tScale][0];
- AttachedObjects[playerid][index][aoScale][1] = ToyInfo[playerid][id][tScale][1];
- AttachedObjects[playerid][index][aoScale][2] = ToyInfo[playerid][id][tScale][2];
- for(new p; p < 45; p++)
- {
- if(dropObjectID[p] == modelid)
- {
- SetPlayerArmedWeapon(playerid, p);
- RemovePlayerAttachedObject(playerid, index);
- IsEditingHolster[playerid] = 0;
- AttachedObjects[playerid][index][aoBone] = 0;
- IsHolstered[playerid][GetWeaponSlot(p)] = 1;
- ToyInfo[playerid][id][tScale][0] = 1.0;
- ToyInfo[playerid][id][tScale][1] = 1.0;
- ToyInfo[playerid][id][tScale][2] = 1.0;
- break;
- }
- }
- ToyBeingEdited[playerid] = -1;
- return true;
- }
- else if(response == EDIT_RESPONSE_CANCEL)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Edit Cancelled.");
- SetPlayerAttachedObject(playerid, index, modelid, boneid, AttachedObjects[playerid][index][aoOffset][0], AttachedObjects[playerid][index][aoOffset][1], AttachedObjects[playerid][index][aoOffset][2], AttachedObjects[playerid][index][aoRot][0], AttachedObjects[playerid][index][aoRot][1], AttachedObjects[playerid][index][aoRot][2],
- AttachedObjects[playerid][index][aoScale][0], AttachedObjects[playerid][index][aoScale][1], AttachedObjects[playerid][index][aoScale][2], AttachedObjects[playerid][index][aoColor], AttachedObjects[playerid][index][aoColor]);
- for(new p; p < 45; p++)
- {
- if(dropObjectID[p] == modelid)
- {
- IsEditingHolster[playerid] = 0;
- IsHolstered[playerid][GetWeaponSlot(p)] = 0;
- break;
- }
- }
- ToyBeingEdited[playerid] = -1;
- }
- return true;
- }
- public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
- {
- if(response == EDIT_RESPONSE_CANCEL)
- {
- for(new i; i != MAX_FACTIONS*MAX_FACTION_DOORS; i++) {
- if(objectid == FacDoor[i][fdID]) {
- FacDoor[i][fdID] = 0;
- FacDoor[i][fdStatus] = 0;
- FacDoor[i][fdModel] = 0;
- for(new j; j != 4; j++) {
- FacDoor[i][fdPosA][j] = 0.0;
- FacDoor[i][fdPosF][j] = 0.0;
- }
- DestroyDynamicObject(objectid);
- SendClientMessage(playerid, -1, "Edit Cancelled.");
- for(new j; j != MAX_FACTIONS; j++) {
- for(new k; k != MAX_FACTION_DOORS; k++) {
- if(FACTIONS[j][FactionDoors][k] == i) {
- FACTIONS[j][FactionDoors][k] = -1;
- }
- }
- }
- return 1;
- }
- }
- if(objectid == EditingRoadblock[playerid])
- {
- SetDynamicObjectPos(objectid, x, y, z);
- SetDynamicObjectRot(objectid, rx, ry, rz);
- EditingRoadblock[playerid] = -1;
- SelectingRoadblock{playerid} = false;
- return true;
- }
- if(EditingTempObject[playerid] != -1)
- {
- if(objectid == TempObjects[EditingTempObject[playerid]][ObjectID])
- {
- new slot = EditingTempObject[playerid];
- SetDynamicObjectPos(objectid, TempObjects[slot][ObjectPosX], TempObjects[slot][ObjectPosY], TempObjects[slot][ObjectPosZ]);
- SetDynamicObjectRot(objectid, TempObjects[slot][ObjectPosRX], TempObjects[slot][ObjectPosRY], TempObjects[slot][ObjectPosRZ]);
- SendClientMessage(playerid, COLOR_RED, "You have reverted the object back to its previous position.");
- return true;
- }
- }
- if(objectid == PlayerBuyFurniture[playerid][0])
- {
- SendClientMessageF(playerid, COLOR_WHITE, "You have cancelled your purchase of {BCDCBC}%s{FFFFFF}.", FurniData[PlayerBuyFurniture[playerid][1]][fuName]);
- DestroyDynamicObjectEx(PlayerBuyFurniture[playerid][0], "PlayerBuyFurniture[playerid][0] 3");
- PlayerBuyFurniture[playerid][0] = INVALID_OBJECT_ID;
- PlayerBuyFurniture[playerid][1] = -1;
- DeleteFurnEditPVars(playerid);
- return true;
- }
- if(objectid == PlayerBuyOutdoorFurniture[playerid][0])
- {
- SendClientMessageF(playerid, COLOR_WHITE, "You have cancelled your purchase of {BCDCBC}%s{FFFFFF}.", FurniData[PlayerBuyOutdoorFurniture[playerid][1]][fuName]);
- DestroyDynamicObjectEx(PlayerBuyOutdoorFurniture[playerid][0], "PlayerBuyOutdoorFurniture[playerid][0] 3");
- PlayerBuyOutdoorFurniture[playerid][0] = INVALID_OBJECT_ID;
- PlayerBuyOutdoorFurniture[playerid][1] = -1;
- DeleteFurnEditPVars(playerid);
- return true;
- }
- if((objectid == PlayerPlaceOutdoorFurniture[playerid] || objectid == PlayerEditOutdoorFurniture[playerid]) && GetHouseForExteriorEdit(playerid) != -1)
- {
- new h = GetHouseForExteriorEdit(playerid), slot = GetPVarInt(playerid, "HFArrayIndex");
- DeleteFurnEditPVars(playerid);
- if(EFurnData[h][EFurnObject][slot] == objectid)
- {
- SetDynamicObjectPos(EFurnData[h][EFurnObject][slot], FurnPosX[playerid], FurnPosY[playerid], FurnPosZ[playerid]);
- SetDynamicObjectRot(EFurnData[h][EFurnObject][slot], FurnRotX[playerid], FurnRotY[playerid], FurnRotZ[playerid]);
- SendSplitMessageF(playerid, COLOR_WHITE, "You have cancelled the editing of {BCDCBC}%s{FFFFFF}. You can edit it again at any time using /eselectfurniture or /eselectflist.", GetHouseFurnitureName(EFurnData[h][EFurnModel][slot]));
- new pos[3];
- pos[0] = floatround(FurnPosX[playerid]);
- pos[1] = floatround(FurnPosY[playerid]);
- pos[2] = floatround(FurnPosZ[playerid]);
- if(pos[0] == 0 && pos[1] == 0 && pos[2] == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE efurniture SET Placed = 0 WHERE id = %i", EFurnData[h][EFurnSQLID][slot]);
- mysql_pquery(conn, mquery);
- EFurnData[h][EFurnPlaced][slot] = false;
- DestroyDynamicObjectEx(EFurnData[h][EFurnObject][slot], "EFurnData[h][EFurnObject][slot]");
- }
- PlayerEditOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- PlayerPlaceOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- FurnPosX[playerid] = 0.0;
- FurnPosY[playerid] = 0.0;
- FurnPosZ[playerid] = 0.0;
- FurnRotX[playerid] = 0.0;
- FurnRotY[playerid] = 0.0;
- FurnRotZ[playerid] = 0.0;
- return true;
- }
- return true;
- }
- if((objectid == PlayerEditFurniture[playerid] || objectid == PlayerPlaceFurniture[playerid]) && IsInHouseID[playerid] != -1)
- {
- new hid = IsInHouseID[playerid], slot = GetPVarInt(playerid, "HFArrayIndex");
- DeleteFurnEditPVars(playerid);
- if(HouseData[hid][FurnObject][slot] == objectid)
- {
- SetDynamicObjectPos(HouseData[hid][FurnObject][slot], FurnPosX[playerid], FurnPosY[playerid], FurnPosZ[playerid]);
- SetDynamicObjectRot(HouseData[hid][FurnObject][slot], FurnRotX[playerid], FurnRotY[playerid], FurnRotZ[playerid]);
- SendSplitMessageF(playerid, COLOR_WHITE, "You have cancelled the editing of {BCDCBC}%s{FFFFFF}. You can edit it again at any time using /selectfurniture or /selectflist.", GetHouseFurnitureName(HouseData[hid][FurnModel][slot]));
- new pos[3];
- pos[0] = floatround(FurnPosX[playerid]);
- pos[1] = floatround(FurnPosY[playerid]);
- pos[2] = floatround(FurnPosZ[playerid]);
- if(pos[0] == 0 && pos[1] == 0 && pos[2] == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET Placed = 0 WHERE id = %i", HouseData[hid][FurnSQLID][slot]);
- mysql_pquery(conn, mquery);
- HouseData[hid][FurnPlaced][slot] = 0;
- DestroyDynamicObjectEx(HouseData[hid][FurnObject][slot], "HouseData[hid][FurnObject][slot]");
- }
- PlayerEditFurniture[playerid] = INVALID_OBJECT_ID;
- PlayerPlaceFurniture[playerid] = INVALID_OBJECT_ID;
- FurnPosX[playerid] = 0.0;
- FurnPosY[playerid] = 0.0;
- FurnPosZ[playerid] = 0.0;
- FurnRotX[playerid] = 0.0;
- FurnRotY[playerid] = 0.0;
- FurnRotZ[playerid] = 0.0;
- return true;
- }
- }
- }
- if(response == EDIT_RESPONSE_FINAL)
- {
- for(new i; i != MAX_FACTIONS*MAX_FACTION_DOORS; i++) {
- if(objectid == FacDoor[i][fdID]) {
- if(FacDoor[i][fdPosA][0] == 0.0) {
- FacDoor[i][fdPosA][0] = x;
- FacDoor[i][fdPosA][1] = y;
- FacDoor[i][fdPosA][2] = z;
- FacDoor[i][fdPosA][3] = rz;
- SendClientMessage(playerid, -1, "Now place the door in the position where it would be CLOSED.");
- EditDynamicObject(playerid, objectid);
- } else {
- FacDoor[i][fdPosF][0] = x;
- FacDoor[i][fdPosF][1] = y;
- FacDoor[i][fdPosF][2] = z;
- FacDoor[i][fdPosF][3] = rz;
- FacDoor[i][fdStatus] = 0;
- SendClientMessage(playerid, -1, "Port created successfully.");
- SetDynamicObjectPos(objectid, x, y, z);
- SetDynamicObjectRot(objectid, 0.0, 0.0, rz);
- new Query[500];
- mysql_format(conn, Query, 500, "INSERT INTO factiondoors (id, Ax, Ay, Az, Ar, Fx, Fy, Fz, Fr, Status, Model) VALUES (%i, %f, %f, %f, %f, %f, %f, %f, %f, 0, %i)",
- (i + 1),
- FacDoor[i][fdPosA][0],
- FacDoor[i][fdPosA][1],
- FacDoor[i][fdPosA][2],
- FacDoor[i][fdPosA][3],
- FacDoor[i][fdPosF][0],
- FacDoor[i][fdPosF][1],
- FacDoor[i][fdPosF][2],
- FacDoor[i][fdPosF][3],
- FacDoor[i][fdModel]);
- mysql_query(conn, Query, false);
- for(new j; j != MAX_FACTIONS; j++) {
- for(new k; k != MAX_FACTION_DOORS; k++) {
- if(FACTIONS[j][FactionDoors][k] == i) {
- mysql_format(conn, Query, 500, "UPDATE factions SET door%i = %i WHERE id = %i", k, i+1, j);
- mysql_query(conn, Query, false);
- return 1;
- }
- }
- }
- }
- return 1;
- }
- }
- if(EditingTempObject[playerid] != -1)
- {
- if(objectid == TempObjects[EditingTempObject[playerid]][ObjectID])
- {
- new slot = EditingTempObject[playerid];
- TempObjects[slot][ObjectPosX] = x;
- TempObjects[slot][ObjectPosY] = y;
- TempObjects[slot][ObjectPosZ] = z;
- TempObjects[slot][ObjectPosRX] = rx;
- TempObjects[slot][ObjectPosRY] = ry;
- TempObjects[slot][ObjectPosRZ] = rz;
- SetDynamicObjectPos(objectid, TempObjects[slot][ObjectPosX], TempObjects[slot][ObjectPosY], TempObjects[slot][ObjectPosZ]);
- SetDynamicObjectRot(objectid, TempObjects[slot][ObjectPosRX], TempObjects[slot][ObjectPosRY], TempObjects[slot][ObjectPosRZ]);
- SendClientMessageF(playerid, COLOR_RED, "You have edited the position of the object in slot %i.", slot);
- return true;
- }
- }
- if(objectid == EditingRoadblock[playerid])
- {
- SetDynamicObjectPos(objectid, x, y, z);
- SetDynamicObjectRot(objectid, rx, ry, rz);
- EditingRoadblock[playerid] = -1;
- SelectingRoadblock{playerid} = false;
- return true;
- }
- else if((objectid == PlayerPlaceOutdoorFurniture[playerid] || objectid == PlayerEditOutdoorFurniture[playerid]) && GetHouseForExteriorEdit(playerid) != -1)
- {
- new h = GetHouseForExteriorEdit(playerid), slot = GetPVarInt(playerid, "HFArrayIndex");
- DeleteFurnEditPVars(playerid);
- if(!IsPointInRangeOfPoint(x, y, z, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ], HouseData[h][ExtStreamDist]))
- {
- SetDynamicObjectPos(objectid, FurnPosX[playerid], FurnPosY[playerid], FurnPosZ[playerid]);
- SysMsg(playerid, "You have placed your object too far from your home.");
- return true;
- }
- if(GetPlayerVirtualWorld(playerid) == 0)
- {
- if(EFurnData[h][EFurnObject][slot] == objectid)
- {
- EFurnData[h][EFurnPlaced][slot] = true;
- PlayerPlaceOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- PlayerEditOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE efurniture SET Placed = 1, Xpos = %f, Ypos = %f, Zpos = %f, Xrot = %f, Yrot = %f, Zrot = %f WHERE id = %i", x, y, z, rx, ry, rz, EFurnData[h][EFurnSQLID][slot]);
- mysql_pquery(conn, mquery);
- SetDynamicObjectPos(objectid, x, y, z);
- SetDynamicObjectRot(objectid, rx, ry, rz);
- Streamer_AppendArrayData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_WORLD_ID, GetPlayerVirtualWorld(playerid));
- Streamer_Update(playerid);
- SendSplitMessageF(playerid, COLOR_WHITE, "You have successfully placed the {BCDCBC}%s{FFFFFF}. You can edit it again at any time using /eselectfurniture or /eselectflist.", GetHouseFurnitureName(EFurnData[h][EFurnModel][slot]));
- return true;
- }
- }
- }
- else if((objectid == PlayerPlaceFurniture[playerid] || objectid == PlayerEditFurniture[playerid]) && IsInHouseID[playerid] != -1)
- {
- new hid = IsInHouseID[playerid], slot = GetPVarInt(playerid, "HFArrayIndex");
- DeleteFurnEditPVars(playerid);
- if(HouseData[hid][HouseVW] == GetPlayerVirtualWorld(playerid))
- {
- if(HouseData[hid][FurnObject][slot] == objectid)
- {
- HouseData[hid][FurnPlaced][slot] = 1;
- PlayerPlaceFurniture[playerid] = INVALID_OBJECT_ID;
- PlayerEditFurniture[playerid] = INVALID_OBJECT_ID;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET Placed = 1, Xpos = %f, Ypos = %f, Zpos = %f, Xrot = %f, Yrot = %f, Zrot = %f WHERE id = %i", x, y, z, rx, ry, rz, HouseData[hid][FurnSQLID][slot]);
- mysql_pquery(conn, mquery);
- SetDynamicObjectPos(objectid, x, y, z);
- SetDynamicObjectRot(objectid, rx, ry, rz);
- Streamer_AppendArrayData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_WORLD_ID, GetPlayerVirtualWorld(playerid));
- Streamer_Update(playerid);
- SendSplitMessageF(playerid, COLOR_WHITE, "You have successfully placed the {BCDCBC}%s{FFFFFF}. You can edit it again at any time using /selectfurniture or /selectflist.", GetHouseFurnitureName(HouseData[hid][FurnModel][slot]));
- return true;
- }
- }
- }
- else if(objectid == PlayerBuyFurniture[playerid][0])
- {
- BuyFurnPos[playerid][0] = x;
- BuyFurnPos[playerid][1] = y;
- BuyFurnPos[playerid][2] = z;
- BuyFurnPos[playerid][3] = rx;
- BuyFurnPos[playerid][4] = ry;
- BuyFurnPos[playerid][5] = rz;
- format(gstr, sizeof(gstr), "{FFFFFF}Would you like to purchase this {BCDCBC}%s{FFFFFF} for {44C300}$%s{FFFFFF}?", FurniData[PlayerBuyFurniture[playerid][1]][fuName], format_cash(FurniData[PlayerBuyFurniture[playerid][1]][fPrice]));
- Dialog_Show(playerid, FurniturePurchase4, DIALOG_STYLE_MSGBOX, "Are you sure you want to buy this?", gstr, "Purchase", "Cancel");
- return true;
- }
- else if(objectid == PlayerBuyOutdoorFurniture[playerid][0])
- {
- new h = GetHouseForExteriorEdit(playerid);
- if(!IsPointInRangeOfPoint(x, y, z, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ], HouseData[h][ExtStreamDist]))
- {
- DestroyDynamicObject(PlayerBuyOutdoorFurniture[playerid][0]);
- PlayerBuyOutdoorFurniture[playerid][0] = INVALID_OBJECT_ID;
- PlayerBuyOutdoorFurniture[playerid][1] = -1;
- SysMsg(playerid, "You have placed your object too far from your home.");
- return true;
- }
- BuyFurnPos[playerid][0] = x;
- BuyFurnPos[playerid][1] = y;
- BuyFurnPos[playerid][2] = z;
- BuyFurnPos[playerid][3] = rx;
- BuyFurnPos[playerid][4] = ry;
- BuyFurnPos[playerid][5] = rz;
- format(gstr, sizeof(gstr), "{FFFFFF}Would you like to purchase this {BCDCBC}%s{FFFFFF} for {44C300}$%s{FFFFFF}?", FurniData[PlayerBuyOutdoorFurniture[playerid][1]][fuName], format_cash(FurniData[PlayerBuyOutdoorFurniture[playerid][1]][fPrice]));
- Dialog_Show(playerid, ExteriorFurnitureBuy4, DIALOG_STYLE_MSGBOX, "Are you sure you want to buy this?", gstr, "Purchase", "Cancel");
- return true;
- }
- }
- return true;
- }
- public OnPlayerShootDynamicObject(playerid, weaponid, STREAMER_TAG_OBJECT objectid, Float:x, Float:y, Float:z)
- {
- if(IsInHouseID[playerid] != -1 && weaponid == WEAPON_SHOTGUN)
- {
- if(!IsValidDoorObject(Streamer_GetIntData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_MODEL_ID))) return true;
- new h = IsInHouseID[playerid];
- for(new f = 0; f < MAX_HFURNITURE; f++)
- {
- if(objectid == HouseData[h][FurnObject][f])
- {
- if(HouseData[h][DoorOpen][f]) return true;
- new Float:rx, Float:ry, Float:rz, Float:pX, Float:pY, Float:pZ, Float:oX, Float:oY, Float:oZ;
- GetDynamicObjectRot(HouseData[h][FurnObject][f], rx, ry, rz);
- GetPlayerPos(playerid, pX, pY, pZ);
- GetOffsetFromDynamicObject(pX, pY, pZ, HouseData[h][FurnObject][f], oX, oY, oZ);
- if(oY > 0.0) SetDynamicObjectRot(HouseData[h][FurnObject][f], rx, ry, rz - 90);
- else SetDynamicObjectRot(HouseData[h][FurnObject][f], rx, ry, rz + 90);
- HouseData[h][DoorOpen][f] = true;
- HouseData[h][DoorLocked][f] = false;
- HouseData[h][ZAdjust][f] = rz;
- return true;
- }
- }
- }
- return true;
- }
- CMD:localizarveiculo(playerid, params[]) {
- if(Inventory[playerid][GPS] == 0) return SysMsg(playerid,"You need a GPS to locate the vehicle.");
- if(isnull(params)) return SysMsg(playerid, "Use /LocalizarVeiculo [id]");
- new vid = strval(params);
- for(new v, k = GetVehiclePoolSize()+1; v != k; v++) {
- if(VehicleData[v][VehicleOwnerSQLID] == SQLID[playerid]) {
- if(VehicleData[v][IdVehicle] == vid) {
- if(GetVehicleDriver(v) != -1) return SysMsg(playerid, "There is a person driving your vehicle, we can not find it!");
- new Float:P[3];
- GetVehiclePos(v, P[0], P[1], P[2]);
- SetPlayerCheckpoint(playerid, P[0], P[1], P[2], 2.0);
- PlayerCheckpointID[playerid] = CHECKPOINT_VEH;
- break;
- }
- }
- }
- SysMsg(playerid, "This vehicle does not belong to you or is not spawned.");
- return 1;
- }
- CMD:portoes(playerid)
- {
- if(Faction[playerid] == FACTION_SACFD)
- if(IsPlayerInRangeOfPoint(playerid, 2.5, 2362.0142,232.4117,26.4830)) //
- Dialog_Show(playerid, fdportoes, DIALOG_STYLE_LIST, "Select the gate you want to open / close", "Gate 1\nGate 2\nGate 3\nGate 4\nGate 5\nGate 6", "Select", "Cancel");
- return 1;
- }
- //COMANDOS
- CMD:descer(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.5, -801.2491,-389.6520,1402.1588))
- SetPlayerPos(playerid,2268.0032,2448.8892,3.5313);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorldEx(playerid, 911);
- return 1;
- }
- CMD:subir(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.5, 2268.0032,2448.8892,3.5313))
- SetPlayerPos(playerid,-801.2173,-389.4684,1402.1588);
- SetPlayerInterior(playerid, 5);
- SetPlayerVirtualWorldEx(playerid, 2);
- return 1;
- }
- //comandos de teste a cima 911
- CMD:reconnectmysql(playerid)
- {
- if(IsPlayerAdminLevelOK(playerid, 1))
- {
- mysql_reconnect(conn);
- if(mysql_errno() == 0)
- {
- SysMsg(playerid, "MySQL re-connected.");
- }
- }
- else return SysMsg(playerid, CMDFMSG);
- return true;
- }
- CMD:register(playerid)
- {
- if(Logged{playerid}) return SysMsg(playerid,"You are already logged in; you don't need to register.");
- SysMsg(playerid, "Registration is only available online at redcountyrp.com/register.");
- return true;
- }
- CMD:version(playerid)
- {
- SysMsgF(playerid, "[Game Mode] %s - %s (/credits)", GAMEMODE, VERSION);
- new hours, minutes, days, uptime;
- uptime = gServerUptime;
- if(uptime > 1440)
- {
- do
- {
- uptime -= 1440;
- days += 1;
- }
- while(uptime > 1440);
- }
- if(uptime > 60)
- {
- do
- {
- uptime -= 60;
- hours += 1;
- }
- while(uptime > 60);
- }
- minutes = uptime;
- SysMsgF(playerid, "Server Uptime: %i days %i hours and %i minutes", days, hours, minutes);
- SysMsg(playerid, "View /statistics for some interesting server related stats!");
- return true;
- }
- CMD:statistics(playerid)
- {
- if(!Logged{playerid}) return true;
- #define query1 "SELECT COUNT(id) FROM masters"
- #define query2 "SELECT COUNT(id) FROM players"
- #define query3 "SELECT players FROM ucpplayerscron ORDER BY players DESC LIMIT 1"
- #define query4 "SELECT COUNT(id) FROM houses"
- #define query5 "SELECT COUNT(id) FROM bizz"
- #define query6 "SELECT COUNT(id) FROM hfurniture"
- mysql_format(conn, mquery, sizeof(mquery), "SELECT (%s) AS macount, (%s) AS charcount, (%s) AS highestplayercount, (%s) AS housecount, (%s) AS bizzcount, (%s) AS furncount", query1, query2, query3, query4, query5, query6);
- mysql_pquery(conn, mquery, "LoadStatisticsNumbers", "i", playerid);
- return true;
- }
- GREENSIDE::LoadStatisticsNumbers(playerid)
- {
- if(!cache_num_rows()) return SysMsg(playerid, "Error.");
- gstr[0] = EOS;
- #define MSG1 "Highest Player Count: {FFFFFF}%i{A9C4E4}\nTotal Master Accounts: {FFFFFF}%s{A9C4E4}\nTotal Character Accounts: {FFFFFF}%s{A9C4E4}\nTotal Houses: {FFFFFF}%s{A9C4E4}\nTotal Businesses: {FFFFFF}%i{A9C4E4}\n"
- #define MSG2 "Total Chat Messages Sent: {FFFFFF}%s{A9C4E4}\nTotal Commands Sent: {FFFFFF}%s{A9C4E4}\nTotal /me's Performed: {FFFFFF}%s{A9C4E4}\n\n"
- #define MSG3 "Streamer Plugin Statistics:\nTotal Objects: {FFFFFF}%s{A9C4E4}\nTotal Map Icons: {FFFFFF}%i{A9C4E4}\nTotal Pickups: {FFFFFF}%s{A9C4E4}\nTotal 3D Text labels: {FFFFFF}%s{A9C4E4}\n\nObjects visible to you: {FFFFFF}%i{A9C4E4}"
- new pcount, macount, charcount, housecount, bizzcount, furncount;
- pcount = cache_get_field_content_int(0, "highestplayercount");
- macount = cache_get_field_content_int(0, "macount");
- charcount = cache_get_field_content_int(0, "charcount");
- housecount = cache_get_field_content_int(0, "housecount");
- bizzcount = cache_get_field_content_int(0, "bizzcount");
- furncount = cache_get_field_content_int(0, "furncount");
- format(sgstr, sizeof(sgstr), MSG1, pcount, format_cash(macount), format_cash(charcount), format_cash(housecount), bizzcount);
- strcat(gstr, sgstr);
- format(tgstr, sizeof(tgstr), "Total Furniture: {FFFFFF}%s{A9C4E4}\n\n", format_cash(furncount));
- strcat(gstr, tgstr);
- format(sgstr, sizeof(sgstr), MSG2, format_cash(totalchat), format_cash(totalcmds), format_cash(totalmes));
- strcat(gstr, sgstr);
- format(sgstr, sizeof(sgstr), MSG3, format_cash(CountDynamicObjects()), CountDynamicMapIcons(), format_cash(CountDynamicPickups()), format_cash(CountDynamic3DTextLabels()), Streamer_CountVisibleItems(playerid, STREAMER_TYPE_OBJECT));
- strcat(gstr, sgstr);
- Dialog_Show(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Statistics", gstr, "Neat!", "");
- return true;
- }
- CMD:uptime(playerid) return cmd_version(playerid);
- CMD:clearchat(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- for(new i = 0; i < 20; i++) SendClientMessage(playerid, COLOR_WHITE, " ");
- return true;
- }
- CMD:characters(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!MasterAccountLogged{playerid}) return SysMsg(playerid, "You must be logged into a Master Account first.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Name FROM players WHERE MasterAccount = %i ORDER BY id ASC LIMIT 4", MasterAccount[playerid]);
- mysql_pquery(conn, mquery, "ShowCharacters", "d", playerid);
- return true;
- }
- CMD:masteraccount(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!MasterAccountLogged{playerid}) return SysMsg(playerid, "You must be logged into a Master Account first. (/malogin)");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT EMail, RecentIP, LastLog, State FROM masters WHERE id = %i", MasterAccount[playerid]);
- mysql_pquery(conn, mquery, "MAInfo", "d", playerid);
- return true;
- }
- CMD:ma(playerid, params[]) return cmd_masteraccount(playerid, params);
- CMD:donation(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT DonationCash, DonationWLevel, DonationPLevel, DonationDLevel, DonationCarModel, RefundXP FROM players WHERE id = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery, "ProcessDonation", "d", playerid);
- return true;
- }
- CMD:transferdonatorlevel(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsDonator[playerid]) return SysMsg(playerid, "You are not a donator.");
- new accountname[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]", accountname)) return SysMsg(playerid, "Usage: /transferdonatorlevel [to Firstname_Lastname]");
- new sqlid = MySQLCheckAccount(accountname, playerid);
- if(sqlid == 0) return SysMsg(playerid, "Name was not found. Please include first name, last name and an underscore (Firstname_Lastname).");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT IsDonator FROM players WHERE id = %i", sqlid);
- mysql_pquery(conn, mquery, "CheckDonationTransfer", "iis", playerid, sqlid, accountname);
- return true;
- }
- GREENSIDE::CheckDonationTransfer(playerid, sqlid, accountname[])
- {
- new donatorlevel = cache_get_field_content_int(0, "IsDonator");
- if(donatorlevel > 0) return SysMsg(playerid, "That account is already a donator.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT AmountDonated FROM players WHERE id = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery, "ProcessDonationTransfer", "iisi", playerid, sqlid, accountname);
- return true;
- }
- GREENSIDE::ProcessDonationTransfer(playerid, sqlid, accountname[])
- {
- new donatorlevel = IsDonator[playerid];
- new amountdonated = cache_get_field_content_int(0, "AmountDonated");
- IsDonator[playerid] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET IsDonator = %i, AmountDonated = %i WHERE id = %i", donatorlevel, amountdonated, sqlid);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET IsDonator = 0, AmountDonated = 0 WHERE id = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM `ignore` WHERE PlayerSQLID=%i", SQLID[playerid]);
- mysql_pquery(conn, mquery);
- foreach(new i: Player)
- {
- if(SQLID[i] == sqlid)
- {
- IsDonator[i] = donatorlevel;
- SendClientMessageF(i, COLOR_WHITE, "%s has given their donator level to you.", NameEx(playerid), donatorlevel);
- }
- }
- SendClientMessageF(playerid, COLOR_WHITE, "You have transferred your level %i donator over to %s. You are no longer a donator on this account.", donatorlevel, accountname);
- return true;
- }
- CMD:changespawn(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new spawnid, bizzid = -1;
- if(sscanf(params, "iI(-1)", spawnid, bizzid)) return SysMsg(playerid,"Usage: /changespawn [spawn id] - 1:Noob, 2:Faction HQ, 3:House, 4:Motel, 5:Guest House, 6:Motorhome 7:Business");
- if(spawnid < 1 || spawnid > 7) return SysMsg(playerid,"Usage: /changespawn [spawn id] - 1:Noob, 2:Faction HQ, 3:House, 4:Motel, 5:Guest House, 6:Motorhome, 7:Business");
- if(spawnid == 1)
- {
- ShowMessage(playerid, "Spawn Point", "You will now spawn at your noob spawn.", "Ok");
- MySpawnID[playerid] = 1;
- BizzSpawn[playerid] = 0;
- HasInjured[playerid] = 1;
-
- mysql_pqueryf(conn, "UPDATE players SET MySpawnID = %i, BizzSpawn = %i WHERE id = %i", MySpawnID[playerid], BizzSpawn[playerid], SQLID[playerid]);
- return true;
- }
- else if(spawnid == 2)
- {
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a faction.");
- new locations[256], title[100];
- if(strlen(FACTIONS[Faction[playerid]][FactionSpawn1Name]) > 1)
- {
- strcat(locations, "1 - ");
- strcat(locations, FACTIONS[Faction[playerid]][FactionSpawn1Name]);
- strcat(locations, "\n");
- }
- if(strlen(FACTIONS[Faction[playerid]][FactionSpawn2Name]) > 1)
- {
- strcat(locations, "2 - ");
- strcat(locations, FACTIONS[Faction[playerid]][FactionSpawn2Name]);
- strcat(locations, "\n");
- }
- if(strlen(FACTIONS[Faction[playerid]][FactionSpawn3Name]) > 1)
- {
- strcat(locations, "3 - ");
- strcat(locations, FACTIONS[Faction[playerid]][FactionSpawn3Name]);
- strcat(locations, "\n");
- }
- if(strlen(FACTIONS[Faction[playerid]][FactionSpawn4Name]) > 1)
- {
- strcat(locations, "4 - ");
- strcat(locations, FACTIONS[Faction[playerid]][FactionSpawn4Name]);
- strcat(locations, "\n");
- }
- if(strlen(FACTIONS[Faction[playerid]][FactionSpawn5Name]) > 1)
- {
- strcat(locations, "5 - ");
- strcat(locations, FACTIONS[Faction[playerid]][FactionSpawn5Name]);
- strcat(locations, "\n");
- }
- format(title, 100, "Select %s Spawn", GetFactionNameFromId(Faction[playerid]));
- Dialog_Show(playerid, FactionSubSpawn, DIALOG_STYLE_LIST, title, locations, "Select", "Cancel");
- return true;
- }
- else if(spawnid == 3)
- {
- if(HasHouseKey[playerid][0] != -1 || HasHouseKey[playerid][1] != -1)
- {
- new hid = bizzid;
- if(hid != 0 && hid != 1 && hid != -1) return SysMsg(playerid, "Invalid house number. Valid house numbers are 0 or 1.");
- if(hid == -1)
- {
- for(new v = 0; v < MAX_HOUSE_PER_PLAYER; v++)
- {
- if(HasHouseKey[playerid][v] != -1)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "House ID: %i - %s", v, HouseData[HasHouseKey[playerid][v]][HouseDescription]);
- }
- }
- SysMsg(playerid, "Usage: /changespawn 3 [House number from above]");
- return true;
- }
- if(HasHouseKey[playerid][hid] == -1) return SysMsg(playerid, "You do not have a house in this slot.");
- if(MySpawnID[playerid] == 3 && SpawnAtHouse[playerid] == hid) return SysMsg(playerid,"You already spawn this house.");
- SpawnAtHouse[playerid] = hid;
- format(gstr, sizeof(gstr),"You will now spawn at your house. [%s]",HouseData[HasHouseKey[playerid][SpawnAtHouse[playerid]]][HouseDescription]);
- ShowMessage(playerid, "Spawn Point", gstr, "Ok");
- MySpawnID[playerid] = 3;
- mysql_pqueryf(conn, "UPDATE players SET MySpawnID = %i, SpawnAtHouse = %i WHERE id = %i", MySpawnID[playerid], hid, SQLID[playerid]);
- return true;
- }
- SysMsg(playerid,"You don't have a house.");
- }
- else if(spawnid == 4)
- {
- if(RentRoom[playerid] > 0)
- {
- if(MySpawnID[playerid] == 4) return SysMsg(playerid,"You already spawn at your Motel Room.");
- ShowMessage(playerid, "Spawn Point", "You will now spawn at your Motel Room.", "Ok");
- MySpawnID[playerid] = 4;
- BizzSpawn[playerid] = 0;
- mysql_pqueryf(conn, "UPDATE players SET MySpawnID = %i, BizzSpawn = %i WHERE id = %i", MySpawnID[playerid], BizzSpawn[playerid], SQLID[playerid]);
- return true;
- }
- SysMsg(playerid,"You don't have a Motel Room.");
- }
- else if(spawnid == 5)
- {
- new ghouse = IsHouseGuest(playerid);
- if(ghouse == 0) return SysMsg(playerid,"You are not living in someone else's house.");
- MySpawnID[playerid] = 5;
- BizzSpawn[playerid] = 0;
- mysql_pqueryf(conn, "UPDATE players SET MySpawnID = %i, BizzSpawn = %i WHERE id = %i", MySpawnID[playerid], BizzSpawn[playerid], SQLID[playerid]);
- format(gstr, sizeof(gstr),"You will now spawn at %s.",HouseData[ghouse][HouseDescription]);
- ShowMessage(playerid, "Spawn Point", gstr, "Ok");
- return true;
- }
- else if(spawnid == 6)
- {
- for(new x = 1, v = GetVehiclePoolSize(); x <= v; x++)
- {
- if(VehicleData[x][VehicleOwnerSQLID] == SQLID[playerid] && SQLID[playerid] > 0)
- {
- if(VehicleData[x][VehicleModel] == 508)
- {
- MySpawnID[playerid] = 6;
- BizzSpawn[playerid] = 0;
- mysql_pqueryf(conn, "UPDATE players SET MySpawnID = %i, BizzSpawn = %i WHERE id = %i", MySpawnID[playerid], BizzSpawn[playerid], SQLID[playerid]);
- ShowMessage(playerid, "Spawn Point", "You will now spawn in your Journey.", "Ok");
- return true;
- }
- }
- }
- SysMsg(playerid,"You do not own a Journey.");
- return true;
- }
- else if(spawnid == 7)
- {
- if(PlayerBizzID[playerid][0] == -1 && PlayerBizzID[playerid][1] == -1) return SysMsg(playerid, "You do not have any businesses to spawn at.");
- if(bizzid != 0 && bizzid != 1 && bizzid != -1) return SysMsg(playerid, "Invalid business number. Valid business numbers are 1 or 2.");
- if(bizzid == -1)
- {
- for(new v = 0; v < MAX_BIZZ_PER_PLAYER; v++)
- {
- if(PlayerBizzID[playerid][v] != -1)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "Business ID: %i - %s", v, BizzData[PlayerBizzID[playerid][v]][BizzDescription]);
- }
- }
- SysMsg(playerid, "Usage: /changespawn 7 [Business ID from above]");
- return true;
- }
- new b = PlayerBizzID[playerid][bizzid];
- MySpawnID[playerid] = 7;
- BizzSpawn[playerid] = BizzData[b][BizzSQLID];
- mysql_pqueryf(conn, "UPDATE players SET MySpawnID = %i, BizzSpawn = %i WHERE id = %i", MySpawnID[playerid], BizzSpawn[playerid], SQLID[playerid]);
- SendClientMessageF(playerid, COLOR_BLUE, "You will now spawn at %s!", BizzData[b][BizzDescription]);
- }
- return true;
- }
- CMD:changenoobspawn(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return SysMsg(playerid,"Usage: /changenoobspawn [spawn id] - 1:Blueberry Caravans, 2:North Caravan Park, 3:Montgomery Caravans, 4:Fort Carson, 5:Angel Pine");
- new spawnid = strval(params);
- if(spawnid < 1 || spawnid > 5) return SysMsg(playerid,"Invalid noob spawn ID, 1 - 5 only.");
- if(spawnid == NoobSpawnID[playerid]) return SysMsg(playerid,"Your noob spawn is already set to this location.");
- NoobSpawnID[playerid] = spawnid;
- MySQLUpdateInt(SQLID[playerid], "NoobSpawnID", NoobSpawnID[playerid], "players");
- ShowMessage(playerid, "Noob Spawn Point", "Your noob spawn location has been changed.", "Ok");
- return true;
- }
- CMD:login(playerid, params[])
- {
- if(MasterAccount[playerid] == 0) return SysMsg(playerid, "You must register before logging in.");
- if(Logged{playerid}) return SysMsg(playerid, "You are already logged in.");
- ShowLoginBox(playerid);
- return true;
- }
- CMD:logout(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(HasJustDied[playerid] == 1) return SysMsg(playerid,"You can't logout when you are in hospital.");
- if(IsAFK{playerid}) return SysMsg(playerid,"You can't logout when you are AFK.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid,"You can't logout when you are cuffed.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't logout when you are tied.");
- if(AdminJailData[playerid][0] == 1) return SysMsg(playerid,"You can't use this if you have been bad!");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SysMsg(playerid,"You may only logout if on-foot.");
- if(HasInjured[playerid] == 1) return Loggout(playerid);
-
- new Float:Health;
- GetPlayerHealth(playerid, Health);
- if(Health < 30) return SysMsg(playerid, "You can't use this command when you are seriously injured.");
- if(SpawnCheckTimer[playerid] != 0) KillTimer(SpawnCheckTimer[playerid]);
- ClearPlayerData(playerid, 3);
- TogglePlayerSpectating(playerid, 1);
- TogglePlayerControllable(playerid, false);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerScore(playerid, 0);
- SetPlayerName(playerid, MasterAccountName[playerid]);
- SetPlayerColor(playerid, 0xBFFFBC00);
- LoginScreenID[playerid][0] = random(sizeof(ClassSelectionData));
- LoginScreenID[playerid][1] = 120;
- InterpolateCameraPos(playerid, ClassSelectionData[LoginScreenID[playerid][0]][0], ClassSelectionData[LoginScreenID[playerid][0]][1], ClassSelectionData[LoginScreenID[playerid][0]][2], ClassSelectionData[LoginScreenID[playerid][0]][6], ClassSelectionData[LoginScreenID[playerid][0]][7], ClassSelectionData[LoginScreenID[playerid][0]][8], 120000, CAMERA_MOVE);
- InterpolateCameraLookAt(playerid, ClassSelectionData[LoginScreenID[playerid][0]][3], ClassSelectionData[LoginScreenID[playerid][0]][4], ClassSelectionData[LoginScreenID[playerid][0]][5], ClassSelectionData[LoginScreenID[playerid][0]][9], ClassSelectionData[LoginScreenID[playerid][0]][10], ClassSelectionData[LoginScreenID[playerid][0]][11], 120000, CAMERA_MOVE);
- // Play login screen music
- switch(random(8))
- {
- case 0: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_gt7afvhjasdftu.mp3");
- case 1: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_5tf76yhasf6tds.mp3");
- case 2: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_gr5dqty6h3qxw6.mp3");
- case 3: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_oikicjwya8cq78.mp3");
- case 4: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_sed65tcs57gpjn.mp3");
- case 5: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_qd3w6758hjxcsa.mp3");
- case 6: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_5r4atgsdh7a56r.mp3");
- case 7: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_mnb12580gdcbtu.mp3");
- }
-
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM masters WHERE id = %i LIMIT 1", MasterAccount[playerid]);
- mysql_pquery(conn, mquery, "LoginMasterAccount", "d", playerid);
- return true;
- }
- //Organizar ordem de comandos
- //==================== 1 Comandos de facções gerais ==========//
- //Comandos de facções gerais
- CMD:showbadge(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /showbadge [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to do that.");
- new hasbadge = 0;
- if(Faction[playerid] == FACTION_COP)
- {
- format(gstr, sizeof(gstr),"[SASP Badge] %s - %s, %s(Rank %i", NameEx(playerid), GetFactionName(playerid), GetFactionRankName(Faction[playerid], FactionRank[playerid]), FactionRank[playerid]);
- if(strlen(FactionCustomRank[playerid]) > 1)
- {
- strcat(gstr, ", Sub Rank: ");
- strcat(gstr, FactionCustomRank[playerid]);
- }
- strcat(gstr, ")");
- SendClientMessage(playa,COLOR_YELLOW,gstr);
- hasbadge = 1;
- }
- else if(Faction[playerid] == FACTION_SACFD)
- {
- format(gstr, sizeof(gstr),"[SACFD Badge] %s - %s, %s(Rank %i)", NameEx(playerid), GetFactionName(playerid), GetFactionRankName(Faction[playerid], FactionRank[playerid]), FactionRank[playerid]);
- if(strlen(FactionCustomRank[playerid]) > 1)
- {
- strcat(gstr, ", Sub Rank: ");
- strcat(gstr, FactionCustomRank[playerid]);
- }
- strcat(gstr, ")");
- SendClientMessage(playa,COLOR_YELLOW,gstr);
- hasbadge = 1;
- }
- else if(Faction[playerid] == FACTION_NEWS)
- {
- format(gstr, sizeof(gstr),"[News Corp. Badge] %s - %s, %s(Rank %i)", NameEx(playerid), GetFactionName(playerid), GetFactionRankName(Faction[playerid], FactionRank[playerid]), FactionRank[playerid]);
- if(strlen(FactionCustomRank[playerid]) > 1)
- {
- strcat(gstr, ", Sub Rank: ");
- strcat(gstr, FactionCustomRank[playerid]);
- }
- strcat(gstr, ")");
- SendClientMessage(playa,COLOR_YELLOW,gstr);
- hasbadge = 1;
- }
- else if(Faction[playerid] == FACTION_TRUCKING)
- {
- format(gstr, sizeof(gstr),"[Licensed Trucker] %s - %s, %s (Rank %i)", NameEx(playerid), GetFactionName(playerid), GetFactionRankName(Faction[playerid], FactionRank[playerid]), FactionRank[playerid]);
- if(strlen(FactionCustomRank[playerid]) > 1)
- {
- strcat(gstr, ", Sub Rank: ");
- strcat(gstr, FactionCustomRank[playerid]);
- }
- strcat(gstr, ")");
- SendClientMessage(playa,COLOR_YELLOW,gstr);
- hasbadge = 1;
- }
- else if(Faction[playerid] == FACTION_PROP)
- {
- format(gstr, sizeof(gstr),"[Silver Trading Employee ID] %s - %s, %s (Rank %i)", NameEx(playerid), GetFactionName(playerid), GetFactionRankName(Faction[playerid], FactionRank[playerid]), FactionRank[playerid]);
- if(strlen(FactionCustomRank[playerid]) > 1)
- {
- strcat(gstr, ", Sub Rank: ");
- strcat(gstr, FactionCustomRank[playerid]);
- }
- strcat(gstr, ")");
- SendClientMessage(playa,COLOR_YELLOW,gstr);
- hasbadge = 1;
- }
- else if(Faction[playerid] == FACTION_RESEARCH)
- {
- if(IsPlayerMasked{playerid}) SendClientMessageF(playa,COLOR_YELLOW, "[Federal Agent Badge] %s - %s, %s (Rank %i)", FactionCustomRank[playerid], GetFactionName(playerid), GetFactionRankName(Faction[playerid], FactionRank[playerid]), FactionRank[playerid]);
- else SendClientMessageF(playa,COLOR_YELLOW, "[Federal Agent Badge] %s - %s, %s (Rank %i)", NameEx(playerid), GetFactionName(playerid), GetFactionRankName(Faction[playerid], FactionRank[playerid]), FactionRank[playerid]);
- hasbadge = 1;
- }
- if(hasbadge == 0) return SysMsg(playerid,"Your faction does not have badges.");
- if(playa == playerid) format(gstr, sizeof(gstr),"* %s looks at their badge. *", NameRP(playerid));
- else format(gstr, sizeof(gstr),"* %s shows their badge to %s. *", NameRP(playerid), NameRP(playa));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:duty(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(ADuty[playerid] == 1) return SysMsg(playerid, "You cannot go on duty while you're on admin duty.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /duty ['on' or 'off']");
- if(strcmp("on",params,true) == 0)
- {
- if(Duty[playerid] == 1) return SysMsg(playerid,"You are already on duty.");
- if(Faction[playerid] == FACTION_COP)
- {
- if(IsPlayerInRangeOfPoint(playerid,2.5,647.0042, -561.5902, 1001.0859) || IsPlayerInRangeOfPoint(playerid,1.75,324.928,305.504,999.148) || IsFactionVehicle(GetPlayerVehicleID(playerid)) == FACTION_COP)
- {
- Duty[playerid] = 1;
- format(gstr, sizeof(gstr),"[Radio - 9112 MHz] Central Dispatcher: %s %s is in the Police Station and is now on duty.", GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameEx(playerid));
- ReportCrime(gstr);
- }
- else return SysMsg(playerid,"You can only switch duty at a Police Station.");
- }
- else if(Faction[playerid] == FACTION_SACFD)
- {
- foreach(new i: Player) if(Faction[i] == FACTION_SACFD) SendClientMessageF(i, COLOR_BLUE, "SACFD Message: %s is now ON duty.",NameEx(playerid));
- Duty[playerid] = 1;
- }
- else if(Faction[playerid] == FACTION_NEWS)
- {
- foreach(new i: Player) if(Faction[i] == FACTION_NEWS) SendClientMessageF(i,COLOR_PINK,"SANews Message: %s is now ON duty.",NameEx(playerid));
- Duty[playerid] = 1;
- }
- return true;
- }
- if(strcmp("off",params,true) == 0)
- {
- if(Duty[playerid] == 0) return SysMsg(playerid, "You are already off duty.");
- if(Faction[playerid] == FACTION_COP)
- {
- if(IsPlayerInRangeOfPoint(playerid,2.5,647.0042, -561.5902, 1001.0859) || IsPlayerInRangeOfPoint(playerid,1.75,324.928,305.504,999.148) || IsFactionVehicle(GetPlayerVehicleID(playerid)) == FACTION_COP)
- {
- format(gstr, sizeof(gstr),"[Radio - 9112 MHz] Central Dispatcher: %s %s is leaving the Police Station and is now off duty.", GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameEx(playerid));
- ReportCrime(gstr);
- Duty[playerid] = 0;
- }
- else return SysMsg(playerid,"You can only switch duty at a Police Station.");
- }
- else if(Faction[playerid] == FACTION_SACFD)
- {
- foreach(new i: Player) if(Faction[i] == FACTION_SACFD) SendClientMessageF(i, COLOR_BLUE, "SACFD Message: %s is now OFF duty.",NameEx(playerid));
- Duty[playerid] = 0;
- }
- else if(Faction[playerid] == FACTION_NEWS)
- {
- foreach(new i: Player) if(Faction[i] == FACTION_NEWS) SendClientMessageF(i,COLOR_PINK,"SANews Message: %s is now OFF duty.",NameEx(playerid));
- Duty[playerid] = 0;
- }
- else if(Duty[playerid] == 0) return SysMsg(playerid,"You are already off duty.");
- return true;
- }
- SysMsg(playerid,"Usage: /duty ['on' or 'off']");
- return true;
- }
- CMD:setunit(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return SysMsg(playerid, "Usage: /setunit [Unit Label]");
- if(!IsCop(playerid) && Faction[playerid] != FACTION_SACFD) return SysMsg(playerid, "You need to be a member of the SASP or SACFD to use this command.");
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You need to be inside a vehicle to use this command.");
- if(IsFactionVehicle(GetPlayerVehicleID(playerid)) != Faction[playerid]) return SysMsg(playerid, "You need to be in a faction vehicle to set the unit label.");
- if(strlen(params) >= 10 && strlen(params) < 1) return SysMsg(playerid, "Unit labels must be between 1 and 8 characters.");
- for(new fiv = 0, x = GetVehiclePoolSize(); fiv <= x; fiv++)
- {
- if(strmatch(FVehicleData[fiv][FVGovUnit], params)) return SendClientMessage(playerid, COLOR_GREY, "This unit label is already in use, please use another.");
- }
- new vehid = GetPlayerVehicleID(playerid);
- format(FVehicleData[vehid][FVGovUnit], 12, params);
- for(new l = 0; l < 10; l++) FVehicleData[vehid][FVGovUnit][l] = toupper(FVehicleData[vehid][FVGovUnit][l]);
- if(FVehicleData[vehid][FVGovUnitTog])
- {
- UpdateDynamic3DTextLabelText(FVehicleData[vehid][FVGovUnit3DText], COLOR_SIGN, FVehicleData[vehid][FVGovUnit]);
- }
- else
- {
- new Float:sX, Float:sY, Float:sZ;
- GetVehicleModelInfo(GetVehicleModel(FVehicleData[vehid][FactionVehID]), VEHICLE_MODEL_INFO_SIZE, sX, sY, sZ);
- FVehicleData[vehid][FVGovUnit3DText] = CreateDynamic3DTextLabel(FVehicleData[vehid][FVGovUnit], COLOR_SIGN, 0.0, (-sY + 1.6) / 2.0, -0.2, 25.0, INVALID_PLAYER_ID, vehid, 1, -1, -1, -1, 25);
- FVehicleData[vehid][FVGovUnitTog] = 1;
- }
- Streamer_Update(playerid);
- SendClientMessageF(playerid, COLOR_BLUE, "You have successfully edited the unit label for this %s, use /togunit to set it active.", GetVehicleNameEx(GetVehicleModel(vehid)));
- return true;
- }
- CMD:togunit(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsCop(playerid) && Faction[playerid] != FACTION_SACFD) return SysMsg(playerid, "You need to be a member of the SASP or SACFD to use this command.");
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You need to be inside a vehicle to use this command.");
- if(IsFactionVehicle(GetPlayerVehicleID(playerid)) != Faction[playerid]) return SysMsg(playerid, "You need to be in a faction vehicle to set the unit label.");
- new vehid = GetPlayerVehicleID(playerid);
- if(FVehicleData[vehid][FVGovUnitTog] == 1)
- {
- DestroyDynamic3DTextLabel(FVehicleData[vehid][FVGovUnit3DText]);
- FVehicleData[vehid][FVGovUnit3DText] = Text3D:INVALID_3DTEXT_ID;
- SendClientMessage(playerid, COLOR_BLUE, "You have successfully removed your vehicles unit label.");
- FVehicleData[vehid][FVGovUnitTog] = 0;
- }
- else
- {
- new Float:sX, Float:sY, Float:sZ;
- GetVehicleModelInfo(GetVehicleModel(FVehicleData[vehid][FactionVehID]), VEHICLE_MODEL_INFO_SIZE, sX, sY, sZ);
- FVehicleData[vehid][FVGovUnit3DText] = CreateDynamic3DTextLabel(FVehicleData[vehid][FVGovUnit], COLOR_SIGN, 0.0, (-sY + 1.6) / 2.0, -0.2, 25.0, INVALID_PLAYER_ID, vehid, 1, -1, -1, -1, 25);
- SendClientMessageF(playerid, COLOR_BLUE, "You have successfully added a unit label to this %s", GetVehicleNameEx(GetVehicleModel(vehid)));
- Streamer_Update(playerid);
- FVehicleData[vehid][FVGovUnitTog] = 1;
- }
- return true;
- }
- CMD:fanuncios(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == 0) return SysMsg(playerid,"Você não está em uma facção.");
- if(FactionRank[playerid] < 3) return SysMsg(playerid,"Você não tem o Rank suficiente.");
- if(FadvertSpamTime > 0) return SysMsg(playerid, "Outro fanuncio não pode ser feito no momento.");
- if(!AdvertsToggle{playerid}) return SysMsg(playerid, "Seus anúncios estão desativados, você não pode fazer anúncio.");
- if(isnull(params))
- {
- SysMsg(playerid,"Use: /fanuncios [mensagem]");
- SysMsg(playerid,"Exemplo: '/fanuncios Isto é um teste' irá mostrar como: [Anúncio da Facção] Isto é um teste [Seu Nome_Sobrenome]");
- return true;
- }
- new AdCost = strlen(params) * 8;
- if(IsDonator[playerid] < 3)
- {
- GivePlayerCash(playerid, -AdCost);
- format(gstr, sizeof(gstr),"Você fez uma anúncio na facção com %i characters, isso irá custa $%i. ($8/Letras)",strlen(params),AdCost);
- }
- else if(IsDonator[playerid] == 3)
- {
- AdCost = AdCost / 2;
- GivePlayerCash(playerid, -AdCost);
- format(gstr, sizeof(gstr),"Você fez uma anúncio na facção com %i characters, isso irá custa $%i. ($8/Letras)",strlen(params),AdCost);
- }
- else if(IsDonator[playerid] >= 4)
- {
- format(gstr, sizeof(gstr),"Você fez um anúncio de facção %i characters, não custando nada.",strlen(params),AdCost);
- }
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- FadvertSpamTime = 60;
- foreach(new i: Player) if(Logged{i} && AdvertsToggle{i}) SendSplitMessageF(i, COLOR_GREEN, "[%s]: {ffffff}%s{ffffff}", GetFactionName(playerid), params);
- format(gstr, sizeof(gstr), "[Admin] ^^ Anúncio de facção por %s (ID %i)", NameEx(playerid), playerid);
- AdminBroadcast(gstr, 0);
- return true;
- }
- CMD:members(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid, "Please login first.");
- new faction;
- if(sscanf(params, "i", faction))
- {
- if(Faction[playerid] == 0) return SysMsg(playerid, "You are not in a faction.");
- MemberBrowsing[playerid] = Faction[playerid];
- MemberListIndex[playerid] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Online,Name,FactionRank,FactionCustomRank FROM players WHERE Faction = %i ORDER BY FactionRank DESC LIMIT 20 OFFSET %i", Faction[playerid], MemberListIndex[playerid] * 20);
- mysql_pquery(conn, mquery, "DisplayFactionMemberList", "dd", playerid, MemberListIndex[playerid]);
- return true;
- }
- if(!IsPlayerAdminLevelOK(playerid, 2)) return SysMsg(playerid, AUTHMSG);
- if(faction == 0) return SysMsg(playerid, "Faction cannot be 0. Please see /fids for a valid faction.");
- MemberBrowsing[playerid] = faction;
- MemberListIndex[playerid] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Online,Name,FactionRank,FactionCustomRank FROM players WHERE Faction = %i ORDER BY FactionRank DESC LIMIT 20 OFFSET %i", faction, MemberListIndex[playerid] * 20);
- mysql_pquery(conn, mquery, "DisplayFactionMemberList", "dd", playerid, MemberListIndex[playerid]);
- return true;
- }
- CMD:factiononline(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- mysql_pquery(conn, "SELECT COUNT(id) AS members, Faction FROM players WHERE Faction != 0 GROUP BY Faction", "LoadFactionOnline", "i", playerid);
- return true;
- }
- GREENSIDE::LoadFactionOnline(playerid)
- {
- new members[MAX_FACTIONS];
- for(new i = 0, r = cache_num_rows(); i < r; i++)
- {
- members[cache_get_field_content_int(i, "Faction")] = cache_get_field_content_int(i, "members");
- }
- gstr[0] = EOS;
- new membercount = 0;
- for(new i = 1; i < MAX_FACTIONS; i++)
- {
- if(IsFactionActive(i) == 1)
- {
- foreach(new p: Player)
- {
- if(Logged{p} && Faction[p] == i)
- {
- membercount ++;
- }
- }
- format(sgstr, sizeof(sgstr), "[{00B837}%i{FFFFFF}/{00B837}%i{FFFFFF}] %s\n", membercount, members[i], FACTIONS[i][FactionName]);
- strcat(gstr, sgstr);
- membercount = 0;
- }
- }
- Dialog_Show(playerid, DIALOG_NONE, DIALOG_STYLE_LIST, "Faction List", gstr, "Neat!", "");
- return true;
- }
- CMD:quitfaction(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Faction[playerid] == 0) return SysMsg(playerid,"You have no Faction to quit from.");
- if(QuitFromFaction[playerid] != 0) return SysMsg(playerid,"You are already quiting, use '/accept quitfaction'.");
- if(IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"Get out of this vehicle first.");
- QuitFromFaction[playerid] = Faction[playerid];
- if(strlen(FactionCustomRank[playerid]) >= 1) FactionCustomRank[playerid][0] = 0;
- SendClientMessageF(playerid,COLOR_WHITE, "Are you sure you want to leave: %s. Type '/accept quitfaction' to confirm.", GetFactionName(playerid));
- return true;
- }
- CMD:ranks(playerid)
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == 0) return SysMsg(playerid, "You must be in a faction to use this command.");
- new f = Faction[playerid], col[12];
- SendClientMessageF(playerid, COLOR_WHITE, "Faction Ranks of {096483}%s", FACTIONS[f][FactionName]);
- for(new x = FACTIONS[f][FactionUberLeaderRank] - 1; x != -1; x--)
- {
- if(strlen(FactionRanks[f][x]))
- {
- if(x + 1 == FACTIONS[f][FactionUberLeaderRank]) col = "328332";
- else if(x + 1 == FACTIONS[f][FactionLeaderRank]) col = "4C924C";
- else col = "FFFFFF";
- SendClientMessageF(playerid, COLOR_WHITE, "{%s} Rank %i: %s", col, x + 1, FactionRanks[f][x]);
- }
- }
- return true;
- }
- CMD:removesubrank(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Faça o login primeiro.");
- if(Faction[playerid] == 0) return SysMsg(playerid,"Você não está em uma facção.");
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"Você não tem um rank alto suficiente para fazer isso.");
- new pname[32], playa;
- if(sscanf(params, "s[32]", pname)) return SysMsg(playerid,"Use: /removesubrank [ID / Nome_Sobrenome]");
- playa = GetPlayerIDs(pname);
- if(!InvalidPlayer(playa))
- {
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"Esse jogador é um NPC.");
- if(Faction[playerid] != Faction[playa]) return SysMsg(playerid,"Esta pessoa não está na mesma facção que você.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET FactionCustomRank = '' WHERE id = %i", SQLID[playa]);
- mysql_pquery(conn, mquery);
- FactionCustomRank[playa][0] = EOS;
- SendClientMessageF(playerid,COLOR_ORANGE, "Você removeu o sub-rank de %s.", NameEx(playa));
- SendClientMessageF(playa,COLOR_ORANGE, "%s removeu seu sub-rank.", NameEx(playerid));
- IsESU{playa} = false;
- return true;
- }
- else if(strfind(pname, "_", true) != -1)
- {
- new sqlid = MySQLCheckAccount(pname, playerid);
- if(sqlid == 0) return SysMsg(playerid, "Nome não encontrado na base de dados, por favor, tente novamente");
- if(sqlid == SQLID[playerid]) return SysMsg(playerid, "O nome não pode ser sua conta.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET FactionCustomRank = '' WHERE id = %i", sqlid);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid,COLOR_ORANGE, "Você removeu o sub-rank de %s.", RPName(pname));
- return true;
- }
- return true;
- }
- CMD:uniforme(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Log in first.");
- if(Faction[playerid] == FACTION_COP)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5, -787.1996,-401.8074,1802.0253))
- {
- if(Duty[playerid] == 1)
- {
- ShowModelSelectionMenu(playerid, "Uniforms", MODEL_SACSO_SKINS, FACTIONS[Faction[playerid]][FactionSkins], GetFactionMaxSkins(Faction[playerid]) - 1, -16.0, 0.0, -55.0);
- }
- else return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: You are not in service.");
- }
- else return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: You are not in the presidio locker room..");
- }
- if(Faction[playerid] == FACTION_SACFD)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5, 2385.8391, 224.1135, 2004.1659))
- {
- if(Duty[playerid] == 1)
- {
- ShowModelSelectionMenu(playerid, "Uniforms", MODEL_SACFD_SKINS, FACTIONS[Faction[playerid]][FactionSkins], GetFactionMaxSkins(Faction[playerid]) - 1, -16.0, 0.0, -55.0);
- }
- else return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: You are not in service.");
- }
- else return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: You are not in the presidio locker room..");
- }
- return 1;
- }
- CMD:gunrack(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You need to be in a vehicle to use this command.");
- new faction = IsFactionVehicle(GetPlayerVehicleID(playerid)), veh = GetPlayerVehicleID(playerid), option[8], weap[24];
- if((Faction[playerid] == FACTION_COP || Faction[playerid] == FACTION_RESEARCH || Faction[playerid] == FACTION_PROP) && faction == Faction[playerid])
- {
- if(FVehicleData[veh][FactionVehID] != GetPlayerVehicleID(playerid)) return true;
- if(sscanf(params, "s[8]S()[24]", option, weap)) return SysMsg(playerid, "Usage: /gunrack [take/store/show] [Gunrack Slot] [Weapon Name]");
- if(strcmp(option, "take", true) == 0 || strcmp(option, "get", true) == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM weapons WHERE Gunrack != -1 AND FCarID = %i AND WeaponID = %i AND Deleted = 0 AND WeaponPossession = 0 AND TrunkID = -1 AND HouseID = -1 AND Dropped = 0", FVehicleData[veh][FVSQLID], GetWeaponIdFromName(weap));
- mysql_pquery(conn, mquery, "ProcessGunrackTake", "ii", playerid, veh);
- return true;
- }
- else if(strcmp(option, "store", true) == 0 || strcmp(option, "place", true) == 0)
- {
- if(!strlen(weap)) return SysMsg(playerid, "Usage: /gunrack store [Gunrack Slot] [Weapon Name]");
- new wep = GetWeaponIdFromName(weap);
- if(wep == -1) return SysMsg(playerid,"Invalid Weapon Name.");
- if(wep < 1 || wep > 47) return SysMsg(playerid,"Invalid Weapon.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM weapons WHERE FCarID = %i AND Gunrack = 1 AND Deleted = 0 AND Dropped = 0", FVehicleData[veh][FVSQLID]);
- mysql_pquery(conn, mquery, "ProcessGunrackStore", "iii", playerid, veh, wep);
- return true;
- }
- else if(strcmp(option, "show", true) == 0 || strcmp(option, "view", true) == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT WeaponID, WeaponAmmo FROM weapons WHERE FCarID = %i AND Gunrack != -1 AND Deleted = 0 AND Dropped = 0", FVehicleData[veh][FVSQLID]);
- mysql_pquery(conn, mquery, "ProcessGunrackView", "i", playerid);
- return true;
- }
- else cmd_gunrack(playerid, "");
- }
- else SysMsg(playerid, "You need to be a member of the SASP to use this command.");
- return true;
- }
- GREENSIDE::ProcessGunrackTake(playerid, veh)
- {
- if(!cache_num_rows()) return SysMsg(playerid, "You don't have a weapon stored in the gun rack.");
- new wep = cache_get_field_content_int(0, "WeaponID");
- new slot = GetWeaponSlot(wep);
- if(WeaponData[playerid][slot][Weapon] != 0) return SysMsg(playerid, "You are already holding a weapon in that slot.");
- if(GetFreeWeaponObjectIndex(playerid) == -1) return SysMsg(playerid, "You can't carry anymore weapons at the moment.");
- WeaponData[playerid][slot][WeaponID] = cache_get_field_content_int(0, "id");
- WeaponData[playerid][slot][WeaponTimestamp] = cache_get_field_content_int(0, "Timestamp");
- WeaponData[playerid][slot][wCreatorSQLID] = cache_get_field_content_int(0, "CreatorSQLID");
- WeaponData[playerid][slot][Weapon] = wep;
- WeaponData[playerid][slot][wOwnerSQLID] = cache_get_field_content_int(0, "OwnerSQLID");
- WeaponData[playerid][slot][WeaponAmmo] = cache_get_field_content_int(0, "WeaponAmmo");
- WeaponData[playerid][slot][WeaponType] = GetWeaponType(WeaponData[playerid][slot][Weapon]);
- WeaponData[playerid][slot][WeaponOrigin] = cache_get_field_content_int(0, "WeaponOrigin");
- WeaponData[playerid][slot][WeaponPossession] = cache_get_field_content_int(0, "WeaponPossession");
- SyncPlayerWeapons(playerid);
- SetPlayerArmedWeapon(playerid, WeaponData[playerid][slot][Weapon]);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET FCarID = -1, Gunrack = -1, WeaponPossession = 1, OwnerSQLID = %i WHERE id = %i", SQLID[playerid], WeaponData[playerid][slot][WeaponID]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_DARKBLUE, "You have taken one %s from the gun rack of this %s.",GetWeaponNameFromID(WeaponData[playerid][slot][Weapon]), GetVehicleNameEx(FVehicleData[veh][FVModel]));
- format(sgstr, sizeof(sgstr),"* %s takes something from the %s's gun rack. *",NameRP(playerid), GetVehicleNameEx(FVehicleData[veh][FVModel]));
- SetPlayerChatBubble(playerid, sgstr, COLOR_EMOTE, 15.0, 5000);
- return true;
- }
- GREENSIDE::ProcessGunrackStore(playerid, veh, weapid)
- {
- if(cache_num_rows() == 2) return SysMsg(playerid, "This gunrack is full.");
- new slot = GetWeaponSlot(weapid);
- if(WeaponData[playerid][slot][Weapon] != weapid) return SysMsg(playerid, "You don't have this weapon to store it.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET FCarID = %i, Gunrack = 1, WeaponPossession = 0, WeaponAmmo = %i WHERE id = %i", FVehicleData[veh][FVSQLID], WeaponData[playerid][slot][WeaponAmmo], WeaponData[playerid][slot][WeaponID]);
- mysql_pquery(conn, mquery);
- ResetWeaponVariables(playerid, 0, slot);
- SyncPlayerWeapons(playerid);
- SendClientMessageF(playerid, COLOR_DARKBLUE, "You have placed a %s into the gun rack of this %s.",GetWeaponNameFromID(weapid), GetVehicleNameEx(FVehicleData[veh][FVModel]));
- format(gstr, sizeof(gstr), "* %s places something into the %s's gun rack. *", NameRP(playerid), GetVehicleNameEx(FVehicleData[veh][FVModel]));
- SetPlayerChatBubble(playerid, gstr, COLOR_EMOTE, 15.0, 5000);
- return true;
- }
- GREENSIDE::ProcessGunrackView(playerid)
- {
- if(!cache_num_rows()) return SysMsg(playerid, "This gunrack is empty.");
- new wep, ammo;
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- wep = cache_get_field_content_int(i, "WeaponID");
- ammo = cache_get_field_content_int(i, "WeaponAmmo");
- SendClientMessageF(playerid, COLOR_DARKBLUE, "[Gun Rack Slot %i] Weapon: %s [Ammo: %i]", i + 1, GetWeaponNameFromID(wep), ammo);
- }
- return true;
- }
- CMD:m(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Muted[playerid] > 0) return SysMsgF(playerid,"You are muted. (%i minutes left)", Muted[playerid]);
- new CarId = GetNearestVehicle(playerid), faction = IsFactionVehicle(CarId);
- if(IsCop(playerid) || Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_RESEARCH)
- {
- if(isnull(params)) return SysMsg(playerid,"Usage: MEGAPHONE: /m [message]");
- if(CarId == 0 || faction == 0 || Faction[playerid] != faction) return SysMsg(playerid,"You must be in or near a suitable faction vehicle.");
- new Float:vpos[3];
- GetVehiclePos(CarId, vpos[0], vpos[1], vpos[2]);
- if(!IsPlayerInVehicle(playerid, CarId) && !IsPlayerInRangeOfPoint(playerid, 4.0, vpos[0], vpos[1], vpos[2])) return SysMsg(playerid, "You must be in or near a suitable faction vehicle.");
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 510) return SysMsg(playerid,"You must be in or near a suitable faction vehicle.");
- format(gstr, sizeof(gstr),"[%s] o< %s",NameRP(playerid),params);
- ProxDetector(100.0,playerid,gstr,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 60, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ]) && GetPlayerVirtualWorld(playerid) == HouseData[h][HouseExtVW])
- {
- foreach(new i: Player)
- {
- if(IsInHouseID[i] == h)
- {
- SendClientMessageF(i,COLOR_YELLOW,"[%s, outside] o< %s",NameRP(playerid),params);
- }
- }
- }
- }
- for(new h = 0; h < MAX_BIZZ; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 60, BizzData[h][oPosX], BizzData[h][oPosY], BizzData[h][oPosZ]) && GetPlayerVirtualWorld(playerid) == 0)
- {
- foreach(new i: Player)
- {
- if(IsInBizzID[i] == h)
- {
- SendClientMessageF(i,COLOR_YELLOW,"[%s, outside] o< %s",NameRP(playerid),params);
- }
- }
- }
- }
- for(new h = 0; h < MAX_GARAGES; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 60, GarageData[h][oPosX], GarageData[h][oPosY], GarageData[h][oPosZ]))
- {
- foreach(new i: Player)
- {
- if(IsInGarageID[i] == h)
- {
- SendClientMessageF(i,COLOR_YELLOW,"[%s, outside] o< %s",NameRP(playerid),params);
- }
- }
- }
- }
- }
- else return SysMsg(playerid,"You can't use this.");
- return true;
- }
- CMD:f(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Muted[playerid] > 0) return SysMsgF(playerid,"You are muted. (%i minutes left)", Muted[playerid]);
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a faction.");
- if(FACTIONS[Faction[playerid]][FactionChatToggleOff] == 1) return SysMsg(playerid,"Faction chat is disabled for your faction.");
- if(ptogf{playerid}) return SysMsg(playerid,"You have faction chat disabled.");
- if(isnull(params)) return SysMsg(playerid,"Usage: Faction Chat: /f [message]");
- if(strlen(FactionCustomRank[playerid]) != 0) format(gstr, sizeof(gstr),"[%s(%s) %s] %s", GetFactionRankName(Faction[playerid], FactionRank[playerid]), FactionCustomRank[playerid], NameEx(playerid), params);
- else format(gstr, sizeof(gstr),"[%s %s] %s", GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameEx(playerid), params);
- foreach(new i: Player) if(Logged{i} && Faction[i] == Faction[playerid] && !ptogf{i}) SendSplitMessage(i, 0x80BCFFFF, gstr);
- return true;
- }
- CMD:togf(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a faction.");
- if(!ptogf{playerid})
- {
- ptogf{playerid} = true;
- SysMsg(playerid,"You have disabled faction chat.");
- }
- else
- {
- ptogf{playerid} = false;
- SysMsg(playerid,"You have enabled faction chat.");
- }
- return true;
- }
- CMD:fo(playerid, params[]) return cmd_fhc(playerid, params);
- CMD:fhc(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Muted[playerid] > 0) return SysMsgF(playerid,"You are muted. (%i minutes left)", Muted[playerid]);
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a faction.");
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"You are not a high enough rank to use this.");
- if(isnull(params)) return SysMsg(playerid,"Usage: Faction Chat: /fhc [message]");
- foreach(new i: Player) if(Logged{i} && Faction[i] == Faction[playerid] && IsValidLeaderRank(Faction[i], FactionRank[i])) SendSplitMessageF(i, 0x459CFFFF, "[Faction HC(%s) %s] %s", GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameEx(playerid), params);
- return true;
- }
- CMD:fan(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Muted[playerid] > 0) return SysMsgF(playerid,"You are muted. (%i minutes left)", Muted[playerid]);
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a faction.");
- if(ptogf{playerid}) return SysMsg(playerid,"You have faction chat disabled.");
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"You are not a high enough rank to use this.");
- if(isnull(params)) return SysMsg(playerid,"Usage: Faction Chat: /fan [message]");
- foreach(new i: Player) if(Logged{i} && Faction[i] == Faction[playerid]) SendSplitMessageF(i, 0x459CFFFF, "[Faction announcement(%s) %s] %s", GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameEx(playerid), params);
- return true;
- }
- CMD:d(playerid) return SysMsg(playerid, "/d has been renamed to /dr. Please use that from now on.");
- CMD:dr(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Muted[playerid] > 0) return SysMsgF(playerid,"You are muted. (%i minutes left)", Muted[playerid]);
- if(IsCop(playerid) || Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_RESEARCH)
- {
- if(Duty[playerid] == 0 && Faction[playerid] != FACTION_RESEARCH) return SysMsg(playerid,"You must be on duty to use this.");
- if(isnull(params)) return SysMsg(playerid,"Usage: Department Chat: /dr [message]");
- new DeptName[10];
- if(Faction[playerid] == FACTION_COP) DeptName = "SASP";
- else if(Faction[playerid] == FACTION_SACFD) DeptName = "SACFD";
- else if(Faction[playerid] == FACTION_RESEARCH) DeptName = "Agency";
- foreach(new i: Player)
- {
- if(!Logged{i} || playerid == i)
- {
- continue;
- }
- if(Faction[i] == FACTION_RESEARCH)
- {
- SendSplitMessageF(i, COLOR_ORANGE, "[%s] %s %s says: %s", DeptName, GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameRP(playerid), params);
- continue;
- }
- if(Duty[i] == 1 && (IsCop(i) || Faction[i] == FACTION_SACFD))
- {
- SendSplitMessageF(i, COLOR_ORANGE, "[%s] %s %s says: %s", DeptName, GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameRP(playerid), params);
- continue;
- }
- }
- format(gstr, sizeof(gstr), "%s says (dept. radio): %s", NameRP(playerid), params);
- ProxDetector(15.0, playerid, gstr, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- }
- else SysMsg(playerid, "You are not in the correct Faction to use this.");
- return true;
- }
- CMD:fcars(playerid)
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == 0) return SysMsg(playerid, "You must be in a Faction.");
- new textBody[3500];
- new Vcount = 0;
- strcat(textBody, "Vehicle Name\tVehicle ID\tRank Required\n");
- for(new v = 0, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(IsVehicleSpawned(FVehicleData[v][FactionVehID]) && Faction[playerid] == FVehicleData[v][FVFaction])
- {
- Vcount ++;
- format(sgstr, sizeof(sgstr), "%s\t%i\t%i\n", GetVehicleNameEx(FVehicleData[v][FVModel]), FVehicleData[v][FactionVehID], FVehicleData[v][FVMinRank]);
- strcat(textBody, sgstr);
- }
- }
- if(Vcount > 0)
- {
- format(tgstr, sizeof(tgstr), "%s - %i Vehicles", FACTIONS[Faction[playerid]][FactionName], Vcount);
- Dialog_Show(playerid, DIALOG_NONE, DIALOG_STYLE_TABLIST_HEADERS, tgstr, textBody, "Done", "");
- }
- else SysMsg(playerid, "No Faction vehicles found for your Faction.");
- return true;
- }
- CMD:lastdriver(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to use this feature.");
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a Faction.");
- new Car = GetPlayerVehicleID(playerid);
- if(Car == 0 || IsInFactionCar[playerid] == 0) return SysMsg(playerid,"You are not in a Faction Vehicle.");
- new h, m, temp, fv = IsInFactionCar[playerid];
- if(FVehicleData[fv][FactionVehID] == Car)
- {
- if(FVehicleData[fv][LastDriver] == 0) return SysMsg(playerid,"This vehicle has not been driven yet.");
- temp = gettime() - FVehicleData[fv][LastDriverTime];
- while(temp > 3600)
- {
- temp -= 3600;
- h++;
- }
- while(temp > 60)
- {
- temp -= 60;
- m++;
- }
- SendClientMessageF(playerid, COLOR_WHITE, "This %s was last driven by %s %i hours %i minutes and %i seconds ago.", GetVehicleName(Car), GetSQLName(FVehicleData[fv][LastDriver]), h, m, temp);
- }
- return true;
- }
- CMD:addsiren(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid) || Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_RESEARCH)
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a vehicle to use this command.");
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid, "You are not the appropriate rank.");
- new vehicleid = GetPlayerVehicleID(playerid);
- if(IsFactionVehicle(vehicleid) != Faction[playerid]) return SysMsg(playerid, "You must be in a faction vehicle.");
- if(IsPushBike(vehicleid)) return SysMsg(playerid, "You cannot add a siren to this vehicle.");
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, FVehicleData[vehicleid][LocationX], FVehicleData[vehicleid][LocationY], FVehicleData[vehicleid][LocationZ])) return SysMsg(playerid, "You must be near the vehicle's spawnpoint.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT HasSiren FROM fveh WHERE id = %i", FVehicleData[vehicleid][FVSQLID]);
- mysql_pquery(conn, mquery, "AssignFVehSiren", "dd", playerid, vehicleid);
- return true;
- }
- else SysMsg(playerid, "You must be in a government faction to use this command.");
- return true;
- }
- CMD:find(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid) || IsPlayerAdmin(playerid) || Faction[playerid] == FACTION_RESEARCH)
- {
- new pnumber, zone[MAX_ZONE_NAME];
- if(sscanf(params, "i", pnumber)) return SysMsg(playerid,"Usage: /find [phone number] *Will give an area name based on their phone number*");
- if(pnumber < 100000 || pnumber > 9999999) return SysMsg(playerid,"Invalid phone number.");
- if(!HasPhoneSignal(playerid)) return SysMsg(playerid, "No satellite signal found. [E001]");
- foreach(new i: Player)
- {
- if(Logged{i} && PhoneData[i][pNumber] == pnumber)
- {
- if(PhoneData[i][pPower] == 0) return SysMsg(playerid,"No satellite signal found. [E002]");
- if(!HasPhoneSignal(i)) return SysMsg(playerid, "No satellite signal found. [E003]");
- if(IsInHouseID[i] != -1) Get2DZone(HouseData[IsInHouseID[i]][oPosX], HouseData[IsInHouseID[i]][oPosY], zone, MAX_ZONE_NAME);
- else if(IsInBizzID[i] != -1) Get2DZone(BizzData[IsInBizzID[i]][oPosX], BizzData[IsInBizzID[i]][oPosY], zone, MAX_ZONE_NAME);
- else if(IsInGarageID[i] != -1) Get2DZone(GarageData[IsInGarageID[i]][oPosX], GarageData[IsInGarageID[i]][oPosY], zone, MAX_ZONE_NAME);
- else GetPlayer2DZone(i, zone, MAX_ZONE_NAME);
- if(Faction[playerid] == FACTION_RESEARCH) SendClientMessageF(playerid, COLOR_WHITE, "The phone number %i has been located within %s. (%s of you)", pnumber, zone, GetNSEWBetweenPlayers(playerid, i));
- else SendClientMessageF(playerid, COLOR_WHITE, "The phone number %i has been located within %s.", pnumber, zone);
- return true;
- }
- }
- for(new i = 0; i < MAX_GUNS; i++)
- {
- if(WeaponDrop[i][Type] == 6)
- {
- if(WeaponDrop[i][DropPhonePower] == 1)
- {
- if(WeaponDrop[i][DropPhoneNumber] == pnumber)
- {
- Get2DZone(WeaponDrop[i][wX], WeaponDrop[i][wY], zone, MAX_ZONE_NAME);
- SendClientMessageF(playerid, COLOR_WHITE, "The phone number %i has been located within %s.", pnumber, zone);
- return true;
- }
- }
- }
- }
- SysMsg(playerid,"No satellite signal found. [E004]");
- }
- else SysMsg(playerid,"You need to be a member of the SASP or Aperture.");
- return true;
- }
- CMD:equipar(playerid)//equipar
- {
- if(!Logged{playerid}) return true;
- gstr[0] = EOS;
- if(IsCop(playerid) && (IsPlayerInRangeOfPoint(playerid,3.5,-750.8323,-420.3136,1440.1000) || IsPlayerInRangeOfPoint(playerid,3.5,327.232574, 307.493316, 999.148437) || IsPlayerInRangeOfPoint(playerid,2.0,1234.5601,767.7869,1010.8853) || IsPlayerInRangeOfPoint(playerid, 2.0, -330.4111,1793.7444,999.3145)))
- {
- if(HasTaser{playerid}) return SysMsg(playerid, "You cannot use this while you have a taser equipped.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid, "You need to be rank 2 for this.");
- gstr[0] = EOS;
- strcat(gstr, "Patrol Officer\nDetective");
- if(FactionRank[playerid] > 3) strcat(gstr, "\nShotgun\nMP5");
- if(FactionRank[playerid] > 6) strcat(gstr, "\nM4\nSPAS-12\nSniper");
- if(strfind(FactionCustomRank[playerid], "SID") != -1 || IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) strcat(gstr, "\nMountable GPS");
- strcat(gstr, "\nDisarm");
- Dialog_Show(playerid, PoliceEquip, DIALOG_STYLE_LIST, "Police Weapon Cache", gstr, "Select", "Exit");
- return true;
- }
- else if(Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_COP)
- {
- new vid = GetPlayerVehicleID(playerid), closest;
- if(vid == 0) closest = GetClosestVehicle(playerid);
- new Float:vpos[3];
- GetVehiclePos(closest, vpos[0], vpos[1], vpos[2]);
- new isESUVeh = 0;
- switch(GetVehicleModel(closest))
- {
- case 427, 528, 433, 544, 407: isESUVeh = 1;
- }
- if(IsFactionVehicle(closest) == FACTION_SACFD || (IsFactionVehicle(vid) == FACTION_COP && IsESU{playerid} && isESUVeh) || (IsFactionVehicle(closest) == FACTION_COP && IsESU{playerid} && IsPlayerInRangeOfPoint(playerid, 7.0, vpos[0], vpos[1], vpos[2]) && isESUVeh))
- {
- format(gstr, sizeof(gstr), "Fire Extinguisher\nPole\nFire Axe\nShovel\nCamera\n");
- if(FactionRank[playerid] > 4) strcat(gstr, "\nChainsaw");
- strcat(gstr, "\nDisarm");
- Dialog_Show(playerid, FireEquip, DIALOG_STYLE_LIST, "Equipment Cache", gstr, "Select", "Exit");
- return true;
- }
- }
- else if(Faction[playerid] == FACTION_NEWS)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 1221.7062, 229.4432, 1019.5291) || IsFactionVehicle(GetNearestVehicle(playerid)) == Faction[playerid])
- {
- new wep, ammo;
- GetPlayerWeaponData(playerid, GetWeaponSlot(43), wep, ammo);
- if(wep != 0) return SysMsg(playerid, "You already have a camera.");
- GivePlayerWeaponEx(playerid,43,1000, 3); //Camera
- SendClientMessage(playerid, COLOR_BLUE, "Received a Camera");
- return true;
- }
- }
- else SysMsg(playerid, "I don't think so BUDDY.");
- return true;
- }
- CMD:ammobox(playerid)
- {
- if(Faction[playerid] != FACTION_RESEARCH) return true;
- if(!IsPlayerInRangeOfPoint(playerid, 2.5, 248.341934, 1859.595825, 14.084012)) return true;
- Inventory[playerid][AmmoBox][AMMOBOX_PISTOL] = 10;
- Inventory[playerid][AmmoBox][AMMOBOX_SMG] = 10;
- Inventory[playerid][AmmoBox][AMMOBOX_SHOTGUN] = 10;
- Inventory[playerid][AmmoBox][AMMOBOX_RIFLE] = 10;
- Inventory[playerid][AmmoBox][AMMOBOX_ASSAULT] = 10;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET AmmoBoxPistol = 10, AmmoBoxSMG = 10, AmmoBoxShotgun = 10, AmmoBoxRifle = 10, AmmoBoxAssaultR = 10 WHERE id = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery);
- return true;
- }
- CMD:weapons(playerid)//armas
- {
- if(!Logged{playerid}) return true;
- gstr[0] = EOS;
- if(Faction[playerid] == FACTION_RESEARCH)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.5, 248.341934, 1859.595825, 14.084012) || IsPlayerInRangeOfPoint(playerid, 2.5, 250.1942,1898.0831,1100.2180))
- {
- format(sgstr, sizeof(sgstr), "Mountable GPS\nCamera\nSpray Can\nNightstick\nKnife\nKatana\n9mm\nSilenced Pistol\nDesert Eagle\nShotgun\nSPAS-12\nUzi\nTec9\nMP5\nAK-47\nM4\nCountry Rifle\nSniper Rifle\nParachute\nTeargas\nDisarm");
- Dialog_Show(playerid, APWeapons, DIALOG_STYLE_LIST, "Aperture Weapons Cache", sgstr, "Select", "Exit");
- return true;
- }
- }
- else SysMsg(playerid, "I don't think so BUDDY.");
- return true;
- }
- CMD:health(playerid)
- {
- if(!Logged{playerid}) return true;
- if(Cash[playerid] < 100) return SysMsg(playerid, "You need $100 for this.");
- if(IsCop(playerid))
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, 653.7676, -570.6655, 1004.7658) || IsPlayerInRangeOfPoint(playerid, 2.0, 320.981262, 308.219970, 999.148437) || IsPlayerInRangeOfPoint(playerid,2.0, 1234.5601, 767.7869, 1010.8853) || IsPlayerInRangeOfPoint(playerid, 2.0, -330.4867, 1792.1184, 999.3145) || IsPlayerInRangeOfPoint(playerid, 2.0, -797.3782,-410.7368,1601.9929))
- {
- Dialog_Show(playerid, HealthDialog, DIALOG_STYLE_MSGBOX, "Select Armor Type", "Select Armor Type", "Light Armor", "Heavy Armor");
- return true;
- }
- }
- else if(Faction[playerid] == FACTION_SACFD)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, 2374.1396, 235.2579, 2004.1659) || IsPlayerInRangeOfPoint(playerid, 2.0, -754.2998,-423.5245,1440.0979))
- {
- RestrictedVest{playerid} = true;
- SetPlayerHealthEx(playerid, 100.0);
- SetPlayerArmourEx(playerid, 50.0, 1);
- GivePlayerCash(playerid, -100);
- SendClientMessage(playerid, COLOR_BLUE, "> Restored Health And Armour. (-$100)");
- return true;
- }
- }
- else if(Faction[playerid] == FACTION_RESEARCH)
- {
- if(IsPlayerInRangeOfPoint(playerid,2.0,243.29104,1858.558349,14.084012) || IsPlayerInRangeOfPoint(playerid, 2.0, 247.9519,1894.1075,1100.2180) || IsPlayerInRangeOfPoint(playerid, 2.0, 1010.9411, -1138.9850, 2025.2595))
- {
- Dialog_Show(playerid, HealthDialog, DIALOG_STYLE_MSGBOX, "Select Armor Type", "Select Armor Type", "Light Armor", "Heavy Armor");
- return true;
- }
- }
- return true;
- }
- CMD:alias(playerid, params[])
- {
- if(Faction[playerid] == FACTION_RESEARCH || Faction[playerid] == FACTION_COP || IsPlayerAdmin(playerid))
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, -219.4361,-316.4091,2030.7196) || IsPlayerInRangeOfPoint(playerid, 3.0, 248.341934, 1859.595825, 14.084012) || IsPlayerInRangeOfPoint(playerid, 3.0, 656.1666, -568.3339, 1001.1180) && Faction[playerid] == FACTION_COP || IsPlayerAdmin(playerid))
- {
- if(Faction[playerid] == FACTION_COP && strfind(FactionCustomRank[playerid], "SID") == -1) return SysMsg(playerid, "You must be an SID member to use this.");
- if(sscanf(params, "s[24]", hmData[playerid][hmNewName])) return SysMsg(playerid,"Usage: /alias [Firstname_Lastname]");
- if(strcmp(GetName(playerid),hmData[playerid][hmNewName],false) == 0) return SysMsg(playerid,"You are already using that name.");
- if(!IsValidRoleplayName(hmData[playerid][hmNewName])) return SysMsg(playerid,"That name is not RP.");
- if(strcmp(hmData[playerid][hmNewName], hmData[playerid][hmOldName], true)) // IF NEW NAME IS NOT THEIR REAL NAME
- {
- if(MySQLCheckAccount(hmData[playerid][hmNewName], playerid) != 0) return SysMsg(playerid,"You cannot use a name that already exists"); // CHECK IF EXISTS, IF NEW NAME IS REAL NAME, WORK.
- }
- if(strlen(hmData[playerid][hmNewName]) > 24) return SysMsg(playerid,"Error: Maximum name length is 24 characters.");
- if(hmData[playerid][hmActive] == 1) return SysMsg(playerid, "You cannot use this when you're already aliased. Please revert back to your original name and then alias again.");
- format(hmData[playerid][hmOldName], MAX_PLAYER_NAME, GetName(playerid));
- if(hmData[playerid][hmActive] == 0)
- {
- format(hmData[playerid][hmOldName], MAX_PLAYER_NAME, GetName(playerid));
- }
- if(SetPlayerName(playerid, hmData[playerid][hmNewName]) != 1) return SysMsg(playerid, "That name is too short, too long, in use, the same or contains invalid characters.");
- SendClientMessageF(playerid,COLOR_DARKBLUE,"You have changed your alias to: %s. Use /removealias to revert back to your original name.", hmData[playerid][hmNewName]);
- if(Faction[playerid] == FACTION_RESEARCH)
- {
- foreach(new i: Player)
- {
- if(Faction[i] == FACTION_RESEARCH && i != playerid)
- {
- SendClientMessageF(i,COLOR_DARKBLUE,"%s has changed their alias to %s.", hmData[playerid][hmOldName], hmData[playerid][hmNewName]);
- }
- }
- }
- if(!strcmp(hmData[playerid][hmNewName], hmData[playerid][hmOldName], true))
- {
- hmData[playerid][hmActive] = 0;
- return true;
- }
- hmData[playerid][hmActive] = 1;
- }
- else return SysMsg(playerid, "You need to be at the workbench to be able to use this command.");
- }
- else return SysMsg(playerid, CMDFMSG);
- return true;
- }
- CMD:removealias(playerid)
- {
- if(Faction[playerid] == FACTION_RESEARCH || Faction[playerid] == FACTION_COP || IsPlayerAdmin(playerid))
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, -219.4361,-316.4091,2030.7196) || IsPlayerInRangeOfPoint(playerid, 3.0, 248.341934, 1859.595825, 14.084012) || IsPlayerInRangeOfPoint(playerid, 3.0, 656.1666, -568.3339, 1001.1180) && Faction[playerid] == FACTION_COP || IsPlayerAdmin(playerid))
- {
- if(Faction[playerid] == FACTION_COP && strfind(FactionCustomRank[playerid], "SID") == -1) return SysMsg(playerid, "You must be an SID member to use this.");
- if(strlen(hmData[playerid][hmOldName]) < 4) return SysMsg(playerid, "You are not aliased.");
- SetPlayerName(playerid, hmData[playerid][hmOldName]);
- hmData[playerid][hmActive] = 0;
- hmData[playerid][hmOldName][0] = 0;
- hmData[playerid][hmNewName][0] = 0;
- SendClientMessage(playerid, COLOR_BLUE, "You have reverted back to your character's name.");
- }
- else return SysMsg(playerid, "You need to be at the workbench to be able to use this command.");
- }
- else return SysMsg(playerid, CMDFMSG);
- return true;
- }
- CMD:attachgps(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(HasGPSMount[playerid] != -1) return SysMsg(playerid, "You do not have a Mountable GPS on you.");
- if(Faction[playerid] == FACTION_COP || Faction[playerid] == FACTION_RESEARCH)
- {
- new vid = GetPlayerVehicleID(playerid), closest;
- if(vid == 0)
- {
- closest = GetClosestVehicle(playerid);
- new Float:vpos[3];
- GetVehiclePos(closest, vpos[0], vpos[1], vpos[2]);
- if(closest == VehicleData[closest][IdVehicle] && IsPlayerInRangeOfPoint(playerid, 3.0, vpos[0], vpos[1], vpos[2]))
- {
- HasGPSMount[playerid] = VehicleData[closest][VehSQLID];
- MySQLUpdateInt(SQLID[playerid], "GPSMount", VehicleData[closest][VehSQLID], "players");
- SendClientMessage(playerid, COLOR_WHITE, "You have mounted the GPS device to the vehicle, You can track it using /ping");
- format(gstr, sizeof(gstr),"* %s takes a small device and plants it under the vehicle *",NameRP(playerid));
- SetPlayerChatBubble(playerid, gstr, COLOR_EMOTE, 15.0, 6000);
- OnePlayAnim(playerid, "BOMBER","BOM_Plant_Loop",4.0, 0, 0, 0, 0, 0); // Place Bomb
- return true;
- }
- }
- }
- return true;
- }
- CMD:ping(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(HasGPSMount[playerid] < 1) return SysMsg(playerid, "You have not mounted a GPS to a vehicle");
- if(Faction[playerid] == FACTION_COP || Faction[playerid] == FACTION_RESEARCH)
- {
- for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(VehicleData[v][VehSQLID] == HasGPSMount[playerid])
- {
- new zone[MAX_ZONE_NAME];
- if(!IsVehicleSpawned(VehicleData[v][IdVehicle]))
- {
- format(sgstr,sizeof(sgstr),"* %s takes out a device and pushes a few buttons *", NameRP(playerid));
- ProxDetector(20.0,playerid,sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- PlayerPlaySound(playerid, SOUND_CHECKPOINT, 0.0, 0.0, 0.0);
- SysMsg(playerid,"{FFFFFF}*** The device recieved no response ***");
- return true;
- }
- GetVehicle2DZone(VehicleData[v][IdVehicle], zone, MAX_ZONE_NAME);
- format(sgstr,sizeof(sgstr),"* %s takes out a device and pushes a few buttons *", NameRP(playerid));
- ProxDetector(20.0,playerid,sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(sgstr,sizeof(sgstr),"{FFFFFF}*** The vehicle has been located in {FF0000}%s {FFFFFF}***",zone);
- SendClientMessage(playerid,COLOR_WHITE,sgstr);
- PlayerPlaySound(playerid, SOUND_CHECKPOINT, 0.0, 0.0, 0.0);
- return true;
- }
- }
- }
- return true;
- }
- //==================== Fim ==================================//
- //2 Elite Trucking
- //Elite Trucking
- CMD:snowplow(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new year, month, day;
- getdate(year, month, day);
- if(month != 12 && !IsPlayerAdmin(playerid)) return SysMsg(playerid, "This command can only be used in December.");
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a vehicle to use this command.");
- if(Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_TRUCKING || IsPlayerAdmin(playerid))
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(IsFactionVehicle(vehicleid) != Faction[playerid] && !IsPlayerAdmin(playerid)) return SysMsg(playerid,"You must be in a faction vehicle.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER && (GetPlayerVehicleSeat(playerid) != 1 && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)) return SysMsg(playerid,"You are not the driver or front passenger.");
- new modelid = GetVehicleModel(vehicleid);
- if(!SnowPlow{vehicleid})
- {
- if(VehObject[vehicleid] != INVALID_OBJECT_ID) return SysMsg(playerid, "This vehicle already has an object attached to it.");
- if(modelid == 554) //yosemite
- {
- VehObject[vehicleid] = CreateVehicleObject(19601, vehicleid, 0.0, 2.7, -0.6, 0.0, 0.0, 180.0);
- SnowPlow{vehicleid} = true;
- }
- else if(modelid == 524) //cement truck
- {
- VehObject[vehicleid] = CreateVehicleObject(19601, vehicleid, 0.0, 4.15, -1.45, 0.0, 0.0, 180);
- SnowPlow{vehicleid} = true;
- }
- else SysMsg(playerid, "You are not in a suitable vehicle to use this.");
- }
- else
- {
- DestroyDynamicObjectEx(VehObject[vehicleid], "VehObject[vehicleid] 3");
- VehObject[vehicleid] = INVALID_OBJECT_ID;
- SnowPlow{vehicleid} = false;
- }
- }
- else SysMsg(playerid, "You cannot use this command.");
- return true;
- }
- CMD:trailers(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_TRUCKING) return SysMsg(playerid,"Only truckers may use this command.");
- if(FactionRank[playerid] < 3) return SysMsg(playerid,"You must be at least rank 3 to use this.");
- if(!IsPlayerInRangeOfPoint(playerid, 1.5, 611.9290, 1653.3989, 6.9922)) return SysMsg(playerid,"You are not at the garage.");
- format(gstr, sizeof(gstr), "Article Trailer 1");
- strcat(gstr, "\nArticle Trailer 2");
- strcat(gstr, "\nArticle Trailer 3");
- strcat(gstr, "\nPetrol Trailer");
- strcat(gstr, "\nUtility Trailer");
- Dialog_Show(playerid, TruckingTrailers, DIALOG_STYLE_LIST, "Trailers", gstr, "Select", "Cancel");
- return true;
- }
- CMD:checkfuel(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == FACTION_TRUCKING || IsPlayerAdmin(playerid))
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.5, 673.5842,1833.3052,5.1829) || IsFactionVehicle(GetPlayerVehicleID(playerid)) == FACTION_TRUCKING)
- {
- new subinfo[150];
- gstr[0] = EOS;
- for(new v = 0; v < MAX_FUEL_STATIONS; v++)
- {
- format(subinfo, sizeof(subinfo), "%s Gas Station (Petrol: %i / %i Gal. - Diesel: %i / %i Gal.)\n\n", FuelStations[v][StationDescription], FuelStations[v][PetrolAmount], FuelStations[v][PetrolAmountMax], FuelStations[v][DieselAmount], FuelStations[v][DieselAmountMax]);
- strcat(gstr, subinfo);
- }
- Dialog_Show(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Fuel Supply", gstr, "Done", "");
- }
- else return SysMsg(playerid,"You are not at the Elite Trucking Gas Management office or a faction truck.");
- }
- else SysMsg(playerid,"Only truckers may use this command.");
- return true;
- }
- CMD:deliverfuel(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_TRUCKING) return SysMsg(playerid,"Only truckers may use this command.");
- if(FactionRank[playerid] < 3) return SysMsg(playerid,"You must be at least rank 3.");
- if(!IsPlayerInRangeOfPoint(playerid, 30.0, 673.5842,1833.3052,5.1829)) return SysMsg(playerid,"You are not at the Elite Trucking Gas Management office.");
- new vehicleid = GetPlayerVehicleID(playerid);
- if(!IsTruck(vehicleid)) return SysMsg(playerid,"You must be in a Truck.");
- if(DeliveringFuel[playerid] > 0) return SysMsg(playerid,"You are already delivering fuel.");
- if(GetVehicleTrailer(vehicleid) > 0) return SysMsg(playerid,"Please detach all trailers before starting.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /deliverfuel [petrol/diesel]");
- if(strcmp("petrol", params, true) == 0)
- {
- DeliveringFuel[playerid] = 1;
- DeliveringFuelVeh[playerid][0] = vehicleid;
- DeiveringFuelAmount[playerid] = 0;
- IsTrucking[playerid] = 1;
- DeiveringFuelType[playerid] = FUEL_GASOLINA;
- SetPlayerCheckpointEx(playerid, -1021.005554, -661.875671, 32.007812, 7.0);
- SendClientMessage(playerid, COLOR_WHITE, "[PETROL DELIVERY] Drive to the chemical plant and collect your tanker.");
- return true;
- }
- else if(strcmp("diesel", params, true) == 0)
- {
- DeliveringFuel[playerid] = 1;
- DeliveringFuelVeh[playerid][0] = vehicleid;
- DeiveringFuelAmount[playerid] = 0;
- IsTrucking[playerid] = 1;
- DeiveringFuelType[playerid] = FUEL_DIESEL;
- SetPlayerCheckpointEx(playerid, -1021.005554, -661.875671, 32.007812, 7.0);
- SendClientMessage(playerid, COLOR_WHITE, "[DIESEL DELIVERY] Drive to the chemical plant and collect your tanker.");
- return true;
- }
- SysMsg(playerid,"Usage: /deliverfuel [petrol/diesel]");
- return true;
- }
- CMD:endfueldelivery(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_TRUCKING) return SysMsg(playerid,"Only truckers may use this command.");
- if(DeliveringFuel[playerid] == 0) return SysMsg(playerid,"You are not delivering fuel.");
- if(DeliveringFuel[playerid] == 1)
- {
- DisablePlayerCheckpoint(playerid);
- DeiveringFuelAmount[playerid] = 0;
- DeiveringFuelType[playerid] = 0;
- DeliveringFuel[playerid] = 0;
- DeliveringFuelVeh[playerid][0] = 0;
- DeliveringFuelVeh[playerid][1] = 0;
- IsTrucking[playerid] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "[FUEL DELIVERY] Job cancelled.");
- return true;
- }
- SetPlayerCheckpointEx(playerid, 585.711547, 1664.336669, 6.992187, 10.0);
- DeliveringFuel[playerid] = 3;
- SendClientMessage(playerid, COLOR_WHITE, "[FUEL DELIVERY] Drive to the Trucking HQ to finish and get paid.");
- return true;
- }
- CMD:supplyfuel(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_TRUCKING) return SysMsg(playerid,"Only truckers may use this command.");
- if(DeliveringFuel[playerid] != 2) return SysMsg(playerid,"You are not delivering fuel.");
- if(EngineStatus[GetPlayerVehicleID(playerid)] == 1) return SysMsg(playerid,"Please turn off the engine before unloading fuel.");
- new fuelstation = -1;
- for(new i = 0; i < MAX_FUEL_STATIONS; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 40.0, FuelStations[i][SignX], FuelStations[i][SignY], FuelStations[i][SignZ]))
- {
- fuelstation = i;
- break;
- }
- }
- if(fuelstation == -1) return SysMsg(playerid,"You are not near a gas station. (Red County, Bone County and Angel Pine Only)");
- new fuelamount;
- if(sscanf(params, "i", fuelamount)) return SysMsg(playerid,"Usage: /supplyfuel [amount]");
- if(fuelamount < 1) return SysMsg(playerid,"Amount must be a number and greater than 0.");
- if(fuelamount > DeiveringFuelAmount[playerid]) return SysMsg(playerid,"You do not have enough fuel in your tanker trailer.");
- switch(DeiveringFuelType[playerid])
- {
- case FUEL_GASOLINA:
- {
- if(fuelamount + FuelStations[fuelstation][PetrolAmount] > FuelStations[fuelstation][PetrolAmountMax]) return SysMsg(playerid,"This gas station is unable to hold that much petrol.");
- FuelStations[fuelstation][PetrolAmount] += fuelamount;
- DeiveringFuelAmount[playerid] -= fuelamount;
- UpdateFuelStationSign(fuelstation);
- format(gstr, sizeof(gstr), "You have added %i gallons of petrol to the %s gas station. You can finish with /endfueldelivery any time.", fuelamount, FuelStations[fuelstation][StationDescription]);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "[PETROL DELIVERY]\n%i / 10000 Gallons", DeiveringFuelAmount[playerid]);
- UpdateDynamic3DTextLabelText(DeliveringFuelLabel[playerid], COLOR_WHITE, gstr);
- }
- case FUEL_DIESEL:
- {
- if(fuelamount + FuelStations[fuelstation][DieselAmount] > FuelStations[fuelstation][DieselAmountMax]) return SysMsg(playerid,"This gas station is unable to hold that much diesel.");
- FuelStations[fuelstation][DieselAmount] += fuelamount;
- DeiveringFuelAmount[playerid] -= fuelamount;
- UpdateFuelStationSign(fuelstation);
- format(gstr, sizeof(gstr), "You have added %i gallons of diesel to the %s gas station. You can finish with /endfueldelivery any time.", fuelamount, FuelStations[fuelstation][StationDescription]);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "[DIESEL DELIVERY]\n%i / 8000 Gallons", DeiveringFuelAmount[playerid]);
- UpdateDynamic3DTextLabelText(DeliveringFuelLabel[playerid], COLOR_WHITE, gstr);
- }
- }
- return true;
- }
- CMD:deliverstock(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_TRUCKING) return SysMsg(playerid,"Only truckers may use this command.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You must be at least rank 2.");
- if(!IsPlayerInRangeOfPoint(playerid, 3.0, 2361.8120, -1413.2019, 999.2947)) return SysMsg(playerid,"You are not in the the Elite Trucking office.");
- if(DeliveringStock[playerid] > 0) return SysMsg(playerid,"You are already delivering stock.");
- new bcount;
- gstr[0] = EOS;
- for(new b = 0; b < MAX_BIZZ; b++)
- {
- if(BizzData[b][BizzRequestStock] == 1 && BizzData[b][BizzETDelivering] == 0)
- {
- strcat(gstr, BizzData[b][BizzDescription]);
- strcat(gstr, "\n");
- bcount ++;
- if(bcount == 40) break;
- }
- }
- if(bcount > 0)
- {
- SendClientMessage(playerid,COLOR_GOLD,"Select up to 3 businesses to restock at once...");
- Dialog_Show(playerid, StockDelivery, DIALOG_STYLE_LIST, "List of businesses requesting a delivery", gstr, "Add to Job", "Cancel");
- }
- else SysMsg(playerid,"There are no businesses requesting a restock.");
- return true;
- }
- CMD:viewcalls(playerid, params[])
- {
- if(Faction[playerid] != FACTION_TRUCKING && !IsPlayerAdmin(playerid)) return SysMsg(playerid, "You must be in Elite Trucking to use this command.");
- new calls = 0;
- foreach(new i: Player)
- {
- if(HasActiveTruckingCall{i})
- {
- sgstr[0] = EOS;
- strunpack(sgstr, TruckingCallMsg[i]);
- SendClientMessageF(playerid, COLOR_WHITE, "[Elite Trucking Hotline]: [PN: %i] [Name: %s] %s", PhoneData[i][pNumber], NameRP(i), sgstr);
- calls++;
- }
- }
- if(calls == 0) return SysMsg(playerid, "No active calls.");
- return true;
- }
- CMD:clearcall(playerid, params[])
- {
- new playa = -1;
- if(Faction[playerid] != FACTION_TRUCKING && !IsPlayerAdmin(playerid)) return SysMsg(playerid, "You must be in Elite Trucking to use this command.");
- if(sscanf(params, "u", playa)) return SysMsg(playerid, "Usage: /clearcall [playerid or name]");
- if(!HasActiveTruckingCall{playa}) return SysMsg(playerid, "That person doesn't even have a call to clear.");
- HasActiveTruckingCall{playa} = false;
- strdel(TruckingCallMsg[playa], 0, 128);
- format(gstr, sizeof(gstr), "You have cleared %s's call.", NameRP(playa));
- return true;
- }
- CMD:propriedades(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInRangeOfPoint(playerid,7.5,1341.4280,213.4901,1378.1924) && Faction[playerid] != FACTION_PROP) return SysMsg(playerid,"Você deve estar nos escritórios SA Trading para usar esse comando.");
- Dialog_Show(playerid, STPropertiesMenu, DIALOG_STYLE_LIST, "Select List Type", "View Silver Trading Properties\nView Unowned Homes", "Select", "Cancel");
- return true;
- }
- CMD:addp(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_PROP) return SysMsg(playerid, AUTHMSG);
- new idx = 0, forsale, price;
- if(sscanf(params, "ii", forsale, price)) return SysMsg(playerid,"Use: /addp [à venda 0/1/2] [$preço]");
- if(forsale < 0 || forsale > 2) return SysMsg(playerid,"O parâmetro de venda deve ser 1(não), 2(sim), ou 0(escondido de /properties).");
- if(price < 1 || price > 100000000) return SysMsg(playerid,"parâmetro de preço deve estar entre 1 e 100,000,000.");
- for(idx = 0; idx < MAX_HOUSES; idx++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 0.75, HouseData[idx][oPosX], HouseData[idx][oPosY], HouseData[idx][oPosZ]) && GetPlayerVirtualWorld(playerid) == HouseData[idx][HouseExtVW])
- {
- HouseData[idx][HouseOwnerSQLID] = -5;
- MySQLUpdateInt(HouseData[idx][HouseSQLID], "OwnerSQLID", -5, "houses");
- if(forsale != 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "REPLACE INTO traders (Type, ForSale, Price, SQLID, Description) VALUES (1, %i, %i, %i, '%e')", forsale - 1, price, HouseData[idx][HouseSQLID], HouseData[idx][HouseDescription]);
- mysql_pquery(conn, mquery);
- }
- SendClientMessageF(playerid, COLOR_WHITE, "A casa '%s' agora está em SA Trading por $%i", HouseData[idx][HouseDescription], price);
- return true;
- }
- }
- for(idx = 0; idx < MAX_BIZZ; idx++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 0.75, BizzData[idx][oPosX], BizzData[idx][oPosY], BizzData[idx][oPosZ]))
- {
- BizzData[idx][BizzOwnerSQLID] = -5;
- MySQLUpdateInt(BizzData[idx][BizzSQLID], "OwnerSQLID", -5, "bizz");
- if(forsale != 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "REPLACE INTO traders (Type, ForSale, Price, SQLID, Description) VALUES (2, %i, %i, %i, '%e')", forsale - 1, price, BizzData[idx][BizzSQLID], BizzData[idx][BizzDescription]);
- mysql_pquery(conn, mquery);
- }
- SendClientMessageF(playerid, COLOR_WHITE, "A empresa '%s' agora está em SA Trading por $%i", BizzData[idx][BizzDescription], price);
- return true;
- }
- }
- return true;
- }
- CMD:getprop(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_PROP) return SysMsg(playerid, AUTHMSG);
- new idx;
- for(idx = 0; idx < MAX_HOUSES; idx++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 0.75, HouseData[idx][oPosX], HouseData[idx][oPosY], HouseData[idx][oPosZ]) && GetPlayerVirtualWorld(playerid) == HouseData[idx][HouseExtVW] && HouseData[idx][HouseOwnerSQLID] == -5)
- {
- HouseData[idx][HouseOwnerSQLID] = SQLID[playerid];
- MySQLUpdateInt(HouseData[idx][HouseSQLID], "OwnerSQLID", SQLID[playerid], "houses");
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM traders WHERE SQLID=%i AND Type=1", HouseData[idx][HouseSQLID]);
- mysql_pquery(conn, mquery);
- format(gstr, sizeof(gstr), "The house '%s' is now yours.", HouseData[idx][HouseDescription]);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- return true;
- }
- }
- for(idx = 0; idx < MAX_BIZZ; idx++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 0.75, BizzData[idx][oPosX], BizzData[idx][oPosY], BizzData[idx][oPosZ]) && BizzData[idx][BizzOwnerSQLID] == -5)
- {
- BizzData[idx][BizzOwnerSQLID] = SQLID[playerid];
- MySQLUpdateInt(BizzData[idx][BizzSQLID], "OwnerSQLID", SQLID[playerid], "bizz");
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM traders WHERE SQLID=%i AND Type=2", BizzData[idx][BizzSQLID]);
- mysql_pquery(conn, mquery);
- format(gstr, sizeof(gstr), "The business '%s' is now yours.", BizzData[idx][BizzDescription]);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- return true;
- }
- }
- return true;
- }
- CMD:lockbizzes(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_PROP) return SysMsg(playerid, AUTHMSG);
- new toggle = 0;
- if(sscanf(params, "i", toggle)) return SysMsg(playerid, "Usage: /lockbizzes [0 for unlock, 1 for lock]");
- if(toggle != 0 && toggle != 1) return cmd_lockbizzes(playerid, "");
- for(new b = MAX_BIZZ; b != 0; b--)
- {
- if(BizzData[b][BizzOwnerSQLID] == -5)
- {
- if(toggle == 0)
- {
- if(BizzData[b][BizzLocked])
- {
- BizzData[b][BizzLocked] = false;
- }
- }
- else
- {
- if(!BizzData[b][BizzLocked])
- {
- BizzData[b][BizzLocked] = true;
- }
- }
- }
- }
- if(toggle == 1) SysMsg(playerid, "All Silver Trading businesses locked.");
- else SysMsg(playerid, "All Silver Trading businesses unlocked.");
- return true;
- }
- CMD:lockhouses(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_PROP) return SysMsg(playerid, AUTHMSG);
- new toggle = 0, idx;
- if(sscanf(params, "i", toggle)) return SysMsg(playerid, "Usage: /lockhouses [0 for unlock, 1 for lock]");
- if(toggle == 0)
- {
- for(idx = 0; idx < MAX_HOUSES; idx++)
- {
- if(HouseData[idx][HouseOwnerSQLID] == -5)
- {
- HouseData[idx][HouseLocked] = 0;
- MySQLUpdateInt(HouseData[idx][HouseSQLID], "HouseLocked", HouseData[idx][HouseLocked], "houses");
- }
- }
- SysMsg(playerid, "All Silver Trading houses unlocked.");
- toggle = 1;
- }
- else
- {
- for(idx = 0; idx < MAX_HOUSES; idx++)
- {
- if(HouseData[idx][HouseOwnerSQLID] == -5)
- {
- HouseData[idx][HouseLocked] = 1;
- MySQLUpdateInt(HouseData[idx][HouseSQLID], "HouseLocked", HouseData[idx][HouseLocked], "houses");
- }
- }
- SysMsg(playerid, "All Silver Trading houses locked.");
- toggle = 0;
- }
- return true;
- }
- //==================== Fim ==================================//
- //3 SACFD
- //SACFD
- CMD:heal(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_COP || Faction[playerid] == FACTION_RESEARCH)
- {
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /heal [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid,"That player is not connected.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You may not heal yourself.");
- if(!Dead{playa}) return SysMsg(playerid, "This player is not downed.");
- if(DeathTimer[playa] == 0) return SysMsg(playerid, "This player's death timer has expired. They cannot be healed.");
- new injuriescount = 0, injuries[100], namestring[64];
- gstr[0] = EOS;
- strcat(gstr, "Injury Type\tLocation\tWeapon\n");
- for(new hit = 0; hit < HitCount[playa]; hit++)
- {
- if(Injuries[playa][hit][pBodypart] > 0)
- {
- switch(Injuries[playa][hit][pWeaponID])
- {
- // Blunt Weapons
- case 0,1,2,3,5,6,7,10,11,12,13,14,15,41,42,43,44,45,46:
- {
- format(injuries, sizeof(injuries), "Blunt Trauma\t%s\t%s\n", ReturnBodyPartName(Injuries[playa][hit][pBodypart]), GetWeaponNameFromID(Injuries[playa][hit][pWeaponID]));
- }
- // Stab Weapons
- case 4, 8, 9:
- {
- format(injuries, sizeof(injuries), "Stab Wound\t%s\t%s\n", ReturnBodyPartName(Injuries[playa][hit][pBodypart]), GetWeaponNameFromID(Injuries[playa][hit][pWeaponID]));
- }
- // Gunshot Wounds
- case 22..34,38:
- {
- format(injuries, sizeof(injuries), "Gunshot Wound\t%s\t%s\n", ReturnBodyPartName(Injuries[playa][hit][pBodypart]), GetWeaponNameFromID(Injuries[playa][hit][pWeaponID]));
- }
- // Explosion/Burn
- case 16,17,18,35,36,37,39,40,51:
- {
- format(injuries, sizeof(injuries), "Explosion/Burn\t%s\t%s\n", ReturnBodyPartName(Injuries[playa][hit][pBodypart]), GetWeaponNameFromID(Injuries[playa][hit][pWeaponID]));
- }
- default:
- {
- format(injuries, sizeof(injuries), "Unknown\t%s\t%s\n", ReturnBodyPartName(Injuries[playa][hit][pBodypart]), GetWeaponNameFromID(Injuries[playa][hit][pWeaponID]));
- // Unknown wound
- }
- }
- injuriescount ++;
- strcat(gstr, injuries);
- }
- }
- format(namestring, sizeof(namestring), "Injuries of %s", NameRP(playa));
- if(injuriescount > 0)
- {
- Healing[playerid] = playa;
- Dialog_Show(playerid, HealDialog, DIALOG_STYLE_TABLIST_HEADERS, namestring, gstr, "Close", "");
- }
- else if(injuriescount == 0 && Dead{playa}) RevivePlayer(playa);
- else SysMsgF(playerid, "%s does not have any injuries.", NameRP(playa));
- }
- else SysMsg(playerid,"You need to be a member of the SACFD.");
- return true;
- }
- CMD:stretcher(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new action[9], playa = -1;
- if(sscanf(params, "s[9]U(-1)", action, playa)) return SysMsg(playerid,"Usage: /stretcher [equip/drop/pickup/putaway/load/unload/getoff/intoambu]");
- new Float:pX,Float:pY,Float:pZ, Float:oX,Float:oY,Float:oZ;
- GetPlayerPos(playerid, pX, pY, pZ);
- if(strcmp("equip", action, true) == 0)
- {
- if(Faction[playerid] != FACTION_SACFD && !IsESU{playerid}) return SysMsg(playerid,"You need to be a member of the SACFD.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You need to be rank 2 to use this.");
- if(StretcherEquipped[playerid] > 0) return SysMsg(playerid,"You already have a stretcher.");
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 416) return SysMsg(playerid,"You must be in the back of an Ambulance to get a stretcher.");
- if(GetPlayerVehicleSeat(playerid) != 2 && GetPlayerVehicleSeat(playerid) != 3) return SysMsg(playerid,"You must be in the back of an Ambulance to get a stretcher.");
- StretcherEquipped[playerid] = CreateDynamicObject(1997, pX, pY + 1.5, pZ - 1.0, 0.0, 0.0, 100.0);//2146
- StretcherHolding[playerid] = 1;
- RemovePlayerFromVehicle(playerid);
- format(gstr, sizeof(gstr),"* Paramedic %s pulls a stretcher out of the Ambulance. *",NameEx(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- if(strcmp("drop", action, true) == 0)
- {
- new Float:pXb, Float:pYb;
- new Float:Ang = GetXYInFrontOfPlayer(playerid, pXb, pYb, 1.7);
- if(Faction[playerid] != FACTION_SACFD && !IsESU{playerid}) return SysMsg(playerid,"You need to be a member of the SACFD.");
- if(StretcherHolding[playerid] == 0) return SysMsg(playerid,"You need to have a stretcher.");
- if(StretcherPlayerID[playerid] != -1) return SysMsg(playerid,"You can not drop the stretcher with someone on it");
- DestroyDynamicObjectEx(StretcherEquipped[playerid], "StretcherEquipped[playerid] 0");
- StretcherEquipped[playerid] = CreateDynamicObject(1997, pXb, pYb, pZ-1.0, 0.0, 0.0, Ang+180);
- StretcherHolding[playerid] = 0;
- StretcherTimer[playerid] = SetTimerEx("DestroyStretcher", 600000, 0, "ii", playerid, StretcherEquipped[playerid]);
- foreach(new p: Player) Streamer_Update(p);
- format(gstr, sizeof(gstr),"* Paramedic %s locks the wheels of the stretcher in place. *",NameEx(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- if(strcmp("pickup", action, true) == 0)
- {
- GetDynamicObjectPos(StretcherEquipped[playerid],oX,oY,oZ);
- new Float:distance = DistanceBetweenPoints(pX,pY,pZ,oX,oY,oZ);
- if(Faction[playerid] != FACTION_SACFD && !IsESU{playerid}) return SysMsg(playerid,"You need to be a member of the SACFD.");
- if(StretcherEquipped[playerid] == 0) return SysMsg(playerid,"You need to have a stretcher.");
- if(StretcherPlayerID[playerid] != -1) return SysMsg(playerid,"You can not drop the stretcher with someone on it");
- if(StretcherHolding[playerid] == 2) return SysMsg(playerid,"You already have a stretcher");
- if(distance > 5) return SysMsg(playerid,"You aren't close enough");
- KillTimer(StretcherTimer[playerid]);
- StretcherTimer[playerid] = -1;
- StretcherHolding[playerid] = 2;
- format(gstr, sizeof(gstr),"* Paramedic %s unlocks the wheels of the stretcher *",NameEx(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- if(strcmp("putaway", action, true) == 0)
- {
- if(Faction[playerid] != FACTION_SACFD && !IsESU{playerid}) return SysMsg(playerid,"You need to be a member of the SACFD.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You need to be rank 2 to use this.");
- if(StretcherEquipped[playerid] == 0) return SysMsg(playerid,"You do not have a stretcher to put away.");
- if(StretcherPlayerID[playerid] >= 0) return SysMsg(playerid,"Please unload the stretcher before putting it away.");
- new Float:vX, Float:vY, Float:vZ;
- for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(GetVehicleModel(v) == 416)
- {
- GetVehiclePos(v, vX, vY, vZ);
- if(IsPlayerInRangeOfPoint(playerid, 10.0, vX, vY, vZ))
- {
- DestroyDynamicObjectEx(StretcherEquipped[playerid], "StretcherEquipped[playerid] 1");
- StretcherEquipped[playerid] = 0;
- StretcherHolding[playerid] = 0;
- format(gstr, sizeof(gstr),"* Paramedic %s puts their stretcher into the back of the Ambulance. *",NameEx(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- }
- }
- SysMsg(playerid,"You must be near an Ambulance in order to put a stretcher away.");
- return true;
- }
- if(strcmp("load", action, true) == 0)
- {
- if(Faction[playerid] != FACTION_SACFD && !IsESU{playerid}) return SysMsg(playerid,"You need to be a member of the SACFD.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You need to be rank 2 to use this.");
- if(StretcherEquipped[playerid] == 0) return SysMsg(playerid,"You must have a stretcher to load someone on it.");
- if(StretcherPlayerID[playerid] >= 0) return SysMsg(playerid,"You already have someone loaded on the stretcher.");
- if(sscanf(params, "s[8]u", action, playa)) return SysMsg(playerid,"Usage: /stretcher Load [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid,"That player is not connected.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You may not do this to yourself.");
- if(StretcherEquipped[playa] > 0) return SysMsg(playerid,"You may not put someone with a stretcher on a stretcher.");
- if(StretcherHolding[playerid] == 0) return SysMsg(playerid, "You need to be holding the stretcher");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,3.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to put them on a stretcher.");
- StretcherPlayerID[playerid] = playa;
- OnePlayAnim(playa,"BEACH", "bather", 4.0, 1, 0, 0, 1, -1);
- format(gstr, sizeof(gstr),"* Paramedic %s is now pulling the stretcher with %s on it. *",NameEx(playerid),NameRP(StretcherPlayerID[playerid]));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"%s in now on your stretcher. You can get them off using '/stretcher unload'",NameEx(StretcherPlayerID[playerid]));
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"%s has put you onto their stretcher. Use '/stretcher getoff' if you don't want to be on it.",NameEx(playerid));
- SendClientMessage(StretcherPlayerID[playerid],COLOR_WHITE,gstr);
- return true;
- }
- if(strcmp("unload", action, true) == 0)
- {
- if(Faction[playerid] != FACTION_SACFD && !IsESU{playerid}) return SysMsg(playerid,"You need to be a member of the SACFD.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You need to be rank 2 to use this.");
- if(StretcherEquipped[playerid] == 0) return SysMsg(playerid,"You must have a stretcher to load someone on it.");
- if(StretcherPlayerID[playerid] == -1) return SysMsg(playerid,"You don't even have someone loaded on the stretcher.");
- if(StretcherHolding[playerid] == 0) return SysMsg(playerid, "You need to be holding the stretcher");
- new Float:playerpos[4];
- TogglePlayerControllable(StretcherPlayerID[playerid], 1);
- GetPlayerPos(playerid, playerpos[0], playerpos[1], playerpos[2]);
- GetXYInFrontOfPlayer(playerid, playerpos[0], playerpos[1], -2);
- SetPlayerPos(StretcherPlayerID[playerid], playerpos[0], playerpos[1], playerpos[2]);
- ClearAnimations(StretcherPlayerID[playerid]);
- format(gstr, sizeof(gstr),"%s has been removed from the stretcher.",NameEx(StretcherPlayerID[playerid]));
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"%s has removed you from their stretcher.",NameEx(playerid));
- SendClientMessage(StretcherPlayerID[playerid],COLOR_WHITE,gstr);
- StretcherPlayerID[playerid] = -1;
- return true;
- }
- if(strcmp("getoff", action, true) == 0)
- {
- foreach(new i: Player)
- {
- if(StretcherPlayerID[i] == playerid)
- {
- new Float:playerpos[4];
- TogglePlayerControllable(playerid, 1);
- GetPlayerPos(i, playerpos[0], playerpos[1], playerpos[2]);
- GetXYInFrontOfPlayer(i, playerpos[0], playerpos[1], 6.0);
- SetPlayerPos(playerid, playerpos[0], playerpos[1], playerpos[2]);
- ClearAnimations(playerid);
- format(gstr, sizeof(gstr),"%s has got off the stretcher.",NameEx(playerid));
- SendClientMessage(i,COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"You have got off %s's stretcher.",NameEx(i));
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- StretcherPlayerID[i] = -1;
- return true;
- }
- }
- SysMsg(playerid,"You are not on a stretcher so clearly cannot get off one.");
- return true;
- }
- if(strcmp("intoambu", action, true) == 0)
- {
- if(Faction[playerid] != FACTION_SACFD && !IsESU{playerid}) return SysMsg(playerid,"You need to be a member of the SACFD.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You need to be rank 2 to use this.");
- if(StretcherEquipped[playerid] == 0) return SysMsg(playerid,"You must have a stretcher.");
- if(StretcherPlayerID[playerid] == -1) return SysMsg(playerid,"You don't even have someone loaded on the stretcher.");
- new Float:vX, Float:vY, Float:vZ;
- for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(GetVehicleModel(v) == 416)
- {
- GetVehiclePos(v, vX, vY, vZ);
- if(IsPlayerInRangeOfPoint(playerid, 10.0, vX, vY, vZ))
- {
- new seatid = 2;
- foreach(new i: Player)
- {
- if(GetPlayerVehicleID(i) == v)
- {
- if(GetPlayerVehicleSeat(i) == 2) seatid = 3;
- if(GetPlayerVehicleSeat(i) == 3 && seatid == 3) seatid = -1;
- }
- }
- if(seatid == -1) return SysMsg(playerid,"There are no seats free in the back of this Ambulance.");
- PutPlayerInVehicle(StretcherPlayerID[playerid], v, seatid);
- TogglePlayerControllable(StretcherPlayerID[playerid], 1);
- format(gstr, sizeof(gstr),"* Paramedic %s pushes the stretcher with %s on it into the back of the Ambulance. *",NameEx(playerid),NameRP(StretcherPlayerID[playerid]));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- DestroyDynamicObjectEx(StretcherEquipped[playerid], "StretcherEquipped[playerid] 2");
- StretcherEquipped[playerid] = 0;
- StretcherPlayerID[playerid] = -1;
- StretcherHolding[playerid] = 0;
- return true;
- }
- }
- }
- SysMsg(playerid,"You must be near an Ambulance in order to put a stretcher inside.");
- return true;
- }
- return true;
- }
- CMD:str(playerid, params[]) return cmd_stretcher(playerid, params);
- CMD:createfire(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if((Faction[playerid] == FACTION_SACFD && FactionRank[playerid] > 8) || IsPlayerAdminLevelOK(playerid, 3))
- {
- //if(GetPlayerInterior(playerid) > 0) return SysMsg(playerid, "You cannot create a fire here.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /createfire [small/med/big]");
- if(strcmp("small", params, true) == 0)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- GetXYInFrontOfPlayer(playerid, x, y, 2.5);
- PlaceFire(x, y, z, 1, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), true);
- return true;
- }
- if(strcmp("med", params, true) == 0)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- GetXYInFrontOfPlayer(playerid, x, y, 2.5);
- PlaceFire(x, y, z, 2, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), true);
- return true;
- }
- if(strcmp("big", params, true) == 0)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- GetXYInFrontOfPlayer(playerid, x, y, 2.5);
- PlaceFire(x, y, z, 3, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), true);
- return true;
- }
- }
- return true;
- }
- CMD:createstillfire(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if((Faction[playerid] == FACTION_SACFD && FactionRank[playerid] > 8) || IsPlayerAdminLevelOK(playerid, 2))
- {
- //if(GetPlayerInterior(playerid) > 0) return SysMsg(playerid, "You cannot create a fire here.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /createfire [small/med/big]");
- if(strcmp("small", params, true) == 0)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- GetXYInFrontOfPlayer(playerid, x, y, 2.5);
- PlaceFire(x, y, z, 1, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), false);
- return true;
- }
- if(strcmp("med", params, true) == 0)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- GetXYInFrontOfPlayer(playerid, x, y, 2.5);
- PlaceFire(x, y, z, 2, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), false);
- return true;
- }
- if(strcmp("big", params, true) == 0)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- GetXYInFrontOfPlayer(playerid, x, y, 2.5);
- PlaceFire(x, y, z, 3, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), false);
- return true;
- }
- }
- return true;
- }
- CMD:scba(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == FACTION_SACFD || (Faction[playerid] == FACTION_COP && IsESU{playerid}))
- {
- new playerskin = GetPlayerSkin(playerid);
- if(Faction[playerid] == FACTION_SACFD && (playerskin != 277 && playerskin != 278 && playerskin != 279)) return SendClientMessage(playerid, COLOR_WHITE, "You need your bunker gear on first!");
- if(Faction[playerid] == FACTION_COP && IsESU{playerid} && (playerskin != 277 && playerskin != 278 && playerskin != 279)) SetPlayerSkinEx(playerid, 279);
- if(scba[playerid] == 0)
- {
- new index = GetFreePlayerObjectIndex(playerid);
- if(index != -1)
- {
- AttachedObjects[playerid][index][aoModelID] = 1008;
- AttachedObjects[playerid][index][aoBone] = 1;
- SetPlayerAttachedObject(playerid, index, 19816, 1, -0.012000, -0.187999, 0.000000, -0.499998, -91.499885, 8.499999, 1.162999, 1.238000, 1.291000);
- SendClientMessage(playerid, COLOR_WHITE, "Your SCBA is now on");
- OnePlayAnim(playerid,"PARACHUTE","PARA_Land",4,0,0,0,0,0);
- scba[playerid] = 1;
- }
- else return SysMsg(playerid, "You have too many objects on your character. Remove one to use this command.");
- }
- else if(scba[playerid] == 1)
- {
- if(smask[playerid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "You need take you mask off first.");
- for(new index = 0; index < 6; index++)
- {
- if(AttachedObjects[playerid][index][aoModelID] == 1008)
- {
- AttachedObjects[playerid][index][aoModelID] = 0;
- AttachedObjects[playerid][index][aoBone] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "Your SCBA is now off.");
- RemovePlayerAttachedObject(playerid, index);
- OnePlayAnim(playerid,"PARACHUTE","PARA_Land",4,0,0,0,0,0);
- scba[playerid] = 0;
- SetPlayerSkinEx(playerid, Clothes[playerid][4]);
- return true;
- }
- }
- SendClientMessage(playerid, COLOR_GREY, "You don't currently have SCBA gear equipped.");
- scba[playerid] = 0;
- }
- }
- else return SysMsg(playerid, "You need to be a member of SACFD or ESU to use this command.");
- return true;
- }
- CMD:smask(playerid, params[])
- {
- if(smask[playerid] == 0)
- {
- if(scba[playerid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "You need your SCBA on first!");
- new index = GetFreePlayerObjectIndex(playerid);
- if(index != -1)
- {
- OnePlayAnim(playerid,"goggles","goggles_put_on",4,0,0,0,0,0);
- AttachedObjects[playerid][index][aoModelID] = 19472;
- AttachedObjects[playerid][index][aoBone] = 2;
- SetPlayerAttachedObject(playerid,index,19472,2,-0.033000,0.124999,0.002999,-84.900085,-171.599990,2.100000,1.255001,1.124000,1.293001);
- SendClientMessage(playerid, COLOR_WHITE, "Your SCBA Mask is now on");
- smask[playerid] = 1;
- CanPlayerChoke{playerid} = false;
- }
- else return SendClientMessage(playerid, COLOR_GREY, "You have too many objects on your character. Remove one to use this command.");
- }
- else if(smask[playerid] == 1)
- {
- for(new index = 0; index < 6; index++)
- {
- if(AttachedObjects[playerid][index][aoModelID] == 19472)
- {
- AttachedObjects[playerid][index][aoModelID] = 0;
- AttachedObjects[playerid][index][aoBone] = 0;
- RemovePlayerAttachedObject(playerid, index);
- SendClientMessage(playerid, COLOR_WHITE, "Your SCBA Mask is now off.");
- smask[playerid] = 0;
- OnePlayAnim(playerid,"goggles","goggles_put_on",4,0,0,0,0,0);
- CanPlayerChoke{playerid} = true;
- PlayerChoking{playerid} = false;
- return true;
- }
- }
- SendClientMessage(playerid, COLOR_GREY, "You don't have a mask on.");
- smask[playerid] = 0;
- }
- return true;
- }
- CMD:detox(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_SACFD) return SysMsg(playerid,"You need to be a member of the SACFD.");
- new playa = -1, method[8];
- if(sscanf(params, "s[8]u", method, playa)) return SysMsg(playerid,"Usage: /detox [alcohol/drugs] [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid,"That player is not connected.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You may not detox yourself.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,3.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to detox them.");
- if(strcmp(method, "drugs", true) == 0)
- {
- if(DrugSpamTimer[playa] == 0) return SysMsg(playerid,"This person does not seem to have any side-effects of drugs.");
- DrugSpamTimer[playa] = 0;
- SetPlayerWeather(playa, gServerWeather);
- DrunkLevel[playerid] = 0;
- SetPlayerDrunkLevel(playa, 0);
- TextDrawHideForPlayer(playa, WeedEffect);
- format(gstr, sizeof(gstr),"* Paramedic %s detoxifies %s using an injection of Narcan. *", NameEx(playerid), NameEx(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"Paramedic %s has detoxified you to remove the effects of drugs.",NameEx(playerid));
- SendClientMessage(playa,COLOR_RED,gstr);
- format(gstr, sizeof(gstr),"You have detoxified %s to remove the effects of drugs.",NameEx(playa));
- SendClientMessage(playerid,COLOR_LIGHTBLUE,gstr);
- }
- else if(strcmp(method, "alcohol", true) == 0)
- {
- new drunkLevel = GetPlayerDrunkLevel(playa);
- if(drunkLevel < 100) return SysMsg(playerid,"This person does not seem to be under the influence of alcohol.");
- if(drunkLevel > 10000) SetPlayerDrunkLevel(playa, 2500);
- else SetPlayerDrunkLevel(playa, 0);
- format(gstr, sizeof(gstr),"* Paramedic %s detoxifies %s to reduce their alcohol levels. *", NameEx(playerid), NameEx(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"Paramedic %s has detoxified you.",NameEx(playerid));
- SendClientMessage(playa,COLOR_RED,gstr);
- format(gstr, sizeof(gstr),"You have detoxified %s.",NameEx(playa));
- SendClientMessage(playerid,COLOR_LIGHTBLUE,gstr);
- }
- return true;
- }
- CMD:pagermsg(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_SACFD) return SysMsg(playerid,"You need to be a member of the SACFD.");
- if(FactionRank[playerid] < 5) return SysMsg(playerid,"You need to be at least rank 5.");
- if(!PagerStatus{playerid}) return SysMsg(playerid, "Your pager is not on.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /pagermsg [message]");
- foreach(new t: Player)
- {
- if(Logged{t} && Faction[t] == FACTION_SACFD && PagerStatus{t} && Faction[t] == Faction[playerid])
- {
- if(t != playerid && ADuty[playerid] == 0)
- {
- format(gstr, sizeof(gstr), "A pager is heard. * BEEP BEEP * ((%s))", NameRP(t));
- ProxDetector(20.0,t,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- SendClientMessageF(t, COLOR_ORANGE, "[Pager Msg] %s: %s", GetPlayersFirstName(playerid), params);
- }
- }
- return true;
- }
- CMD:pager(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == FACTION_SACFD)
- {
- if(PagerStatus{playerid})
- {
- PagerStatus{playerid} = false;
- SendClientMessage(playerid,COLOR_GOLD,"Your pager is now off.");
- }
- else
- {
- PagerStatus{playerid} = true;
- SendClientMessage(playerid,COLOR_GOLD,"Your pager is now on.");
- }
- }
- else return SysMsg(playerid,"You need to be a member of the SACFD.");
- return true;
- }
- CMD:rescue(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_SACFD) return SysMsg(playerid,"You need to be a member of the SACFD.");
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /rescue [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid,"That player is not connected.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You may not rescue yourself.");
- if(WantsRescue[playa] == 1) return SysMsg(playerid,"That player already wants assistance.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,3.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to do this.");
- WantsRescue[playa] = playerid+500;
- format(gstr, sizeof(gstr),"Firefighter %s wants to help you. Type '/accept rescue' if you accept.",NameEx(playerid));
- SendClientMessage(playa,COLOR_RED,gstr);
- format(gstr, sizeof(gstr),"You have sent a rescue request to %s.",NameEx(playa));
- SendClientMessage(playerid,COLOR_LIGHTBLUE,gstr);
- return true;
- }
- CMD:cut(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_SACFD) return SysMsg(playerid,"You need to be a member of the SACFD.");
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /cut [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid,"That player is not connected.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You may not cut yourself out.");
- if(WantsRescue[playa] != 1) return SysMsg(playerid,"That player doesn't want assistance.");
- new vehid = GetPlayerVehicleID(playa);
- if(vehid == 0) return SysMsg(playerid,"That player is not in a vehicle.");
- if(!VehicleHasWindows(vehid)) return SysMsg(playerid,"That player can't be cut from that vehicle.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to heal them.");
- RemovePlayerFromVehicle(playa);
- format(gstr, sizeof(gstr),"* Firefighter %s cuts %s out of the %s using a large hydraulic tool. *",NameEx(playerid), NameEx(playa), GetVehicleName(vehid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- //==================== Fim ==================================//
- //4 SAN
- //SAN
- CMD:news(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_NEWS) return SysMsg(playerid,"You must be a member of the News Corp.");
- if(Duty[playerid] == 0) return SysMsg(playerid,"You must be on duty to use this.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You must be at least rank 2 to use this.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /news [message]");
- NewsToggle{playerid} = true;
- foreach(new i: Player)
- {
- if(Logged{i} && NewsToggle{i})
- {
- SendSplitMessageF(i, COLOR_PINK, "[NEWS] %s %s: %s", GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameEx(playerid), params);
- }
- }
- return true;
- }
- CMD:checkweather(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_NEWS) return SysMsg(playerid,"You must be a member of the News Corp.");
- if(Duty[playerid] == 0) return SysMsg(playerid,"You must be on duty to use this.");
- SendClientMessageF(playerid, COLOR_WHITE, "[Weather Data] Current: %s, Expected: %s", GetWeatherName(gServerWeather), GetWeatherName(gServerUpcomingWeather));
- return true;
- }
- CMD:interview(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_NEWS) return SysMsg(playerid,"You must be a member of the News Corp.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You must be at least rank 2 to use this.");
- if(Duty[playerid] == 0) return SysMsg(playerid,"You must be on duty to use this.");
- if(Interviewer != -1) return SysMsg(playerid,"There is already an interview.");
- new playa = -1, showname[20];
- if(sscanf(params, "us[20]", playa, showname)) return SysMsg(playerid,"Usage: /interview [playerid id or name] [show name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't interview yourself.");
- InterviewPlayer = playa;
- Interviewer = playerid;
- format(InterviewName, 20, showname);
- SendClientMessageF(InterviewPlayer, COLOR_WHITE, "%s has started an interview with you. Use '/ichat' to get on-air!", NameEx(Interviewer));
- SendClientMessageF(Interviewer, COLOR_WHITE, "You have started an interview with %s. Use '/ichat' to chat during an interview!", NameEx(InterviewPlayer));
- return true;
- }
- CMD:ichat(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(InterviewPlayer != playerid && Interviewer != playerid) return SysMsg(playerid,"You are not in an interview.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /ichat [message]");
- NewsToggle{playerid} = true;
- if(InterviewPlayer == playerid)
- {
- foreach(new i: Player)
- {
- if(Logged{i} && NewsToggle{i})
- {
- SendSplitMessageF(i, COLOR_PINK, "[NEWS INTERVIEW] %s %s: %s", InterviewName, NameEx(playerid), params);
- }
- }
- }
- else if(Interviewer == playerid)
- {
- foreach(new i: Player)
- {
- if(Logged{i} && NewsToggle{i})
- {
- SendSplitMessageF(i, COLOR_PINK, "[NEWS INTERVIEW] Host %s: %s", NameEx(playerid), params);
- }
- }
- }
- return true;
- }
- CMD:endinterview(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_NEWS) return SysMsg(playerid,"You must be a member of the News Corp.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You must be at least rank 2 to use this.");
- if(Duty[playerid] == 0) return SysMsg(playerid,"You must be on duty to use this.");
- if(Interviewer == -1) return SysMsg(playerid,"There is no interview.");
- if(Interviewer != playerid) return SysMsg(playerid,"You are not the host of the interview.");
- format(gstr, sizeof(gstr),"The interview has been ended by %s.", NameEx(Interviewer));
- SendClientMessage(InterviewPlayer,COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"You have ended the interview with %s.", NameEx(InterviewPlayer));
- SendClientMessage(Interviewer,COLOR_WHITE,gstr);
- InterviewPlayer = -1;
- Interviewer = -1;
- InterviewName[0] = 0;
- return true;
- }
- CMD:starttalkshow(playerid)
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_NEWS) return SysMsg(playerid,"You must be a member of the News Corp.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You must be at least rank 2 to use this.");
- if(Duty[playerid] == 0) return SysMsg(playerid,"You must be on duty to use this.");
- if(TalkshowHost != -1) return SysMsg(playerid,"There is already an talk show live.");
- TalkshowHost = playerid;
- SendClientMessage(TalkshowHost, COLOR_WHITE, "You have started a talk show. Use /tchat to talk on air!");
- foreach(new i: Player) if(Logged{i} && Faction[i] == FACTION_NEWS && i != playerid) SendClientMessageF(i, COLOR_PINK, "[TALKSHOW ALERT] %s has started a talkshow.", NameEx(playerid));
- return true;
- }
- CMD:endtalkshow(playerid)
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_NEWS) return SysMsg(playerid,"You must be a member of the News Corp.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You must be at least rank 2 to use this.");
- if(Duty[playerid] == 0) return SysMsg(playerid,"You must be on duty to use this.");
- if(TalkshowHost == -1) return SysMsg(playerid, "There are no talk shows live at the moment.");
- TalkshowHost = -1;
- TalkshowPlayer = -1;
- for(new x = 0; x < sizeof(TalkshowCallers); x++) TalkshowCallers[x] = -1;
- SendClientMessage(playerid, COLOR_PINK, "You have ended the talk show.");
- foreach(new i: Player) if(Logged{i} && Faction[i] == FACTION_NEWS && i != playerid) SendClientMessageF(i, COLOR_PINK, "[TALKSHOW ALERT] %s has ended their talkshow.", NameEx(playerid));
- return true;
- }
- CMD:callers(playerid)
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_NEWS) return SysMsg(playerid,"You must be a member of the News Corp.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You must be at least rank 2 to use this.");
- if(Duty[playerid] == 0) return SysMsg(playerid,"You must be on duty to use this.");
- if(TalkshowHost == -1) return SysMsg(playerid, "There are no talk shows live at the moment.");
- new playa, callers = 0;
- for(new x = 0; x < sizeof(TalkshowCallers); x++)
- {
- if(TalkshowCallers[x] != -1)
- {
- playa = TalkshowCallers[x];
- callers ++;
- SendClientMessageF(playerid, COLOR_PINK, "Caller %i: %s [PN: %i]", callers, PhoneData[playa][pOwnerName], PhoneData[playa][pNumber]);
- }
- }
- return true;
- }
- CMD:acceptcaller(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_NEWS) return SysMsg(playerid,"You must be a member of the News Corp.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You must be at least rank 2 to use this.");
- if(Duty[playerid] == 0) return SysMsg(playerid,"You must be on duty to use this.");
- if(TalkshowHost == -1) return SysMsg(playerid, "There are no talk shows live at the moment.");
- new callernumber;
- if(sscanf(params, "i", callernumber)) return SysMsg(playerid, "Usage: /acceptcaller [Caller ID from /callers]");
- if(callernumber < 0 && callernumber > sizeof(TalkshowCallers)) return SysMsgF(playerid, "Caller ID must be greater than 0 and less than %i", sizeof(TalkshowCallers));
- if(TalkshowCallers[callernumber - 1] == -1) return SendClientMessageF(playerid, COLOR_PINK, "There is nobody on line %i", callernumber + 1);
- TalkshowPlayer = TalkshowCallers[callernumber - 1];
- SendClientMessageF(TalkshowPlayer, COLOR_PINK, "You are now live on a talk show with %s. Use /tchat to talk.", NameEx(playerid));
- SendClientMessageF(playerid, COLOR_PINK, "%s is now live on your talk show.", NameEx(TalkshowPlayer));
- return true;
- }
- CMD:endcall(playerid)
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_NEWS) return SysMsg(playerid,"You must be a member of the News Corp.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You must be at least rank 2 to use this.");
- if(Duty[playerid] == 0) return SysMsg(playerid,"You must be on duty to use this.");
- if(TalkshowHost == -1) return SysMsg(playerid, "There are no talk shows live at the moment.");
- if(TalkshowPlayer == -1) return SysMsg(playerid, "You are current not in a call with someone.");
- SendClientMessage(TalkshowPlayer, COLOR_PINK, "Your connection with SAN has been closed.");
- SendClientMessageF(TalkshowHost, COLOR_PINK, "You have ended the call with %s", NameEx(TalkshowPlayer));
- TalkshowPlayer = -1;
- return true;
- }
- CMD:denycaller(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_NEWS) return SysMsg(playerid,"You must be a member of the News Corp.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You must be at least rank 2 to use this.");
- if(Duty[playerid] == 0) return SysMsg(playerid,"You must be on duty to use this.");
- if(TalkshowHost == -1) return SysMsg(playerid, "There are no talk shows live at the moment.");
- new callernumber;
- if(sscanf(params, "i", callernumber)) return SysMsg(playerid, "Usage: /acceptcaller [Caller ID from /callers]");
- if(callernumber < 0 && callernumber > sizeof(TalkshowCallers)) return SysMsgF(playerid, "Caller ID must be greater than 0 and less than %i", sizeof(TalkshowCallers));
- if(TalkshowCallers[callernumber - 1] == -1) return SendClientMessageF(playerid, COLOR_PINK, "There is nobody on line %i", callernumber + 1);
- SendClientMessageF(playerid, COLOR_PINK, "You have denied the call from %s.", NameEx(TalkshowCallers[callernumber - 1]));
- TalkshowCallers[callernumber - 1] = -1;
- return true;
- }
- CMD:toglines(playerid)
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_NEWS) return SysMsg(playerid,"You must be a member of the News Corp.");
- if(FactionRank[playerid] < 2) return SysMsg(playerid,"You must be at least rank 2 to use this.");
- if(Duty[playerid] == 0) return SysMsg(playerid,"You must be on duty to use this.");
- if(TalkshowHost == -1) return SysMsg(playerid, "There are no talk shows live at the moment.");
- SANCallers = !SANCallers;
- if(SANCallers) SendClientMessage(playerid, COLOR_PINK, "You have opened the SAN caller lines.");
- else SendClientMessage(playerid, COLOR_PINK, "You have closed the SAN caller lines.");
- return true;
- }
- CMD:tchat(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(TalkshowPlayer != playerid && TalkshowHost != playerid) return SysMsg(playerid, "You are not in an talk show.");
- if(isnull(params)) return SysMsg(playerid, "Usage: /tchat [message]");
- NewsToggle{playerid} = true;
- foreach(new i: Player)
- {
- if(Logged{i} && NewsToggle{i})
- {
- if(TalkshowHost == playerid) SendSplitMessageF(i, COLOR_PINK, "[TALK SHOW] Host %s: %s", NameEx(playerid), params);
- else if(TalkshowPlayer == playerid) SendSplitMessageF(i, COLOR_PINK, "[TALK SHOW] Caller %s: %s", NameEx(playerid), params);
- }
- }
- return true;
- }
- //==================== Fim ==================================// = antigo interior do SA Trading RCRP 1325.923950,183.807281,1858.25976
- //5 SA Trading
- //SATraing
- //==================== Fim ==================================//
- //6 General government faction commands (sasp, ap, fd, etc)
- //General government faction commands (sasp, ap, fd, etc)
- CMD:beanbag(playerid, params[])
- {
- if(IsPlayerAdmin(playerid) || IsCop(playerid) || Faction[playerid] == FACTION_RESEARCH)
- {
- if(GetPlayerWeapon(playerid) != 25) return SysMsg(playerid, "You must be holding a shotgun to use this.");
- HasRubberBullets{playerid} = !HasRubberBullets{playerid};
- if(HasRubberBullets{playerid}) SendClientMessage(playerid, COLOR_YELLOW, "Beanbag shells activated.");
- else SendClientMessage(playerid, COLOR_YELLOW, "Beanbag shells disabled.");
- }
- else return SysMsg(playerid,"You need to be a member of the State Police.");
- return true;
- }
- CMD:cuff(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid) || Faction[playerid] == FACTION_RESEARCH)
- {
- new playa = -1, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]", name)) return SysMsg(playerid,"Usage: /cuff [ID or Part of Name or Stranger ID]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(IsCuffed[playa] == 1) return SysMsg(playerid,"That player is already cuffed.");
- if(playa == playerid) return SysMsg(playerid,"You cannot cuff yourself.");
- if(ADuty[playa] == 1) return SysMsg(playerid, "You cannot cuff on duty admins.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to cuff them.");
- IsCuffed[playa] = 1;
- SetPlayerToFacePlayer(playerid, playa);
- OnePlayAnim(playerid, "BD_FIRE", "wash_up", 4.0, 0, 0, 0, 0, 0);
- SetPlayerSpecialAction(playa, SPECIAL_ACTION_CUFFED);
- if(AttachedObjects[playa][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playa, 6);
- }
- AttachedObjects[playa][6][aoModelID] = 19415;
- AttachedObjects[playa][6][aoBone] = 6;
- SetPlayerAttachedObject(playa, 6, 19418, 6, -0.011, 0.028, -0.022, -15.600012, -33.699977, -81.700035, 1.0, 1.0, 1.0);
- SendClientMessageF(playa, COLOR_RED, "%s has handcuffed you.",NameRP(playerid));
- SendClientMessageF(playerid, COLOR_LIGHTBLUE, "You have handcuffed %s.",NameEx(playa));
- format(gstr, sizeof(gstr),"* %s has put hand cuffs on %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else return SysMsg(playerid,"You need to be a member of the State Police.");
- return true;
- }
- CMD:uncuff(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid) || Faction[playerid] == FACTION_RESEARCH || IsPlayerAdminLevelOK(playerid, 1))
- {
- new playa = -1, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]", name)) return SysMsg(playerid,"Usage: /uncuff [ID or Part of Name or Stranger ID]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(playa == playerid && !IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid,"You can't uncuff yourself.");
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsCuffed[playa] == 0) return SysMsg(playerid,"That player isn't cuffed.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to uncuff them.");
- IsCuffed[playa] = 0;
- SetPlayerSpecialAction(playa, SPECIAL_ACTION_NONE);
- RemovePlayerAttachedObject(playa, 6);
- if(PlayerToBeDetained[playerid] == playa)
- {
- PlayerToBeDetained[playerid] = -1;
- PlayerToBeDetainedSeat[playerid] = -1;
- }
- SendClientMessageF(playa,COLOR_RED, "%s has removed your handcuffs.",NameRP(playerid));
- SendClientMessageF(playerid,COLOR_LIGHTBLUE, "You have removed the handcuffs from %s.",NameEx(playa));
- format(gstr, sizeof(gstr),"* %s removes the hand cuffs from %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else return SysMsg(playerid,"You need to be a member of the State Police.");
- return true;
- }
- CMD:taser(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid) || Faction[playerid] == FACTION_RESEARCH || IsPlayerAdmin(playerid))
- {
- if(IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You cannot use the taser while in a vehicle.");
- HasTaser{playerid} = !HasTaser{playerid};
- new slot = GetWeaponSlot(24), weps, ammo;
- GetPlayerWeaponData(playerid, slot, weps, ammo);
- if(HasTaser{playerid})
- {
- format(gstr, sizeof(gstr),"* %s grabs their belt and unclips a taser from it. *", NameRP(playerid));
- if(weps != WEAPON_SILENCED) GivePlayerWeapon(playerid, WEAPON_SILENCED, 5);
- if(weps != 0)
- {
- PreTaserWeapon[playerid] = weps;
- PreTaserAmmo[playerid] = ammo;
- WeaponData[playerid][slot][Weapon] = WEAPON_SILENCED;
- }
- }
- else
- {
- format(gstr, sizeof(gstr)," *%s slides their taser back into its holster. *", NameRP(playerid));
- if(PreTaserWeapon[playerid] != 0)
- {
- if(PreTaserWeapon[playerid] != WEAPON_SILENCED) GivePlayerWeapon(playerid, PreTaserWeapon[playerid], PreTaserAmmo[playerid]);
- WeaponData[playerid][slot][Weapon] = PreTaserWeapon[playerid];
- WeaponData[playerid][slot][WeaponAmmo] = PreTaserAmmo[playerid];
- PreTaserWeapon[playerid] = 0;
- PreTaserAmmo[playerid] = 0;
- }
- else
- {
- ResetWeaponVariables(playerid, 0, slot);
- SyncPlayerWeapons(playerid);
- PreTaserWeapon[playerid] = 0;
- PreTaserAmmo[playerid] = 0;
- }
- }
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else return SysMsg(playerid,"You need to be a member of the State Police.");
- return true;
- }
- CMD:laser(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsCop(playerid) && Faction[playerid] != FACTION_RESEARCH) return SysMsg(playerid,"You are not able to use the laser");
- if(GetPlayerWeapon(playerid) != 23 && GetPlayerWeapon(playerid) != 31) return SysMsg(playerid,"You do not have the correct weapon to use the laser");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid, "You can't use this command whilst cuffed.");
- if(CallerID[playerid] >= 1) return SysMsg(playerid, "You can't attach a laser whilst you are on the phone.");
- if(!HasLaser{playerid})
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Your laser is now attached to your weapon.");
- OnePlayAnim(playerid,"RIFLE","RIFLE_load",4,0,0,0,0,0);
- HasLaser{playerid} = true;
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Your laser is now removed from your weapon.");
- OnePlayAnim(playerid,"RIFLE","RIFLE_load",4,0,0,0,0,0);
- HasLaser{playerid} = false;
- RemovePlayerAttachedObject(playerid,6);
- }
- return true;
- }
- CMD:removemask(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid) || IsPlayerAdminLevelOK(playerid, 1))
- {
- new Float:ClosestDistance = 99999.99, Float:tmpDistance, ClosestPlayer = -1;
- new Float:x1, Float:y1, Float:z1;
- GetPlayerPos(playerid, x1, y1, z1);
- foreach(new x: Player)
- {
- if(x != playerid && IsSpectating[x] == -1 && IsPlayerMasked{x} && MaskHideName{x})
- {
- new Float:x3, Float:y3, Float:z3;
- GetPlayerPos(x, x3, y3, z3);
- tmpDistance = floatsqroot(floatpower(floatabs(floatsub(x3, x1)), 2) + floatpower(floatabs(floatsub(y3, y1)), 2) + floatpower(floatabs(floatsub(z3, z1)) ,2));
- if(tmpDistance < ClosestDistance)
- {
- ClosestDistance = tmpDistance;
- ClosestPlayer = x;
- }
- }
- }
- if(ClosestDistance > 10.0) return SysMsg(playerid,"You are not close to anyone masked.");
- new RandomHit = random(4);
- if(RandomHit == 0)
- {
- format(gstr, sizeof(gstr),"* %s tries to remove a near by players mask but fails. *",NameEx(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- format(gstr, sizeof(gstr),"* %s removes the mask from a near by person. *",NameEx(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- foreach(new i: Player)
- {
- if(ClosestPlayer != i) ShowPlayerNameTagForPlayer(i, ClosestPlayer, 1);
- }
- IsPlayerMasked{ClosestPlayer} = false;
- MaskHideName{ClosestPlayer} = false;
- DeleteMaskLabel(ClosestPlayer);
- MaskLabelNumber[ClosestPlayer] = 0;
- SendClientMessage(ClosestPlayer, COLOR_LIGHTRED, "Your mask has been removed.");
- return true;
- }
- else SysMsg(playerid,"You need to be a member of the State Police.");
- return true;
- }
- CMD:detain(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid))
- {
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SysMsg(playerid,"You must be on foot to detain.");
- if(PlayerToBeDetained[playerid] != -1) return SysMsg(playerid,"You may only have one person detained at one time. Please enter your car and re-detain.");
- new playa = -1, seatid, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]i", name, seatid)) return SysMsg(playerid,"Usage: /detain [ID or Part of Name or Stranger ID] [seat id] *Hint: 1, 2 & 3 Are Passenger Seats*");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(playa == playerid) return SysMsg(playerid,"You can't use detain yourself.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(IsCuffed[playa] == 0) return SysMsg(playerid,"That player is not cuffed. Please use /cuff first.");
- if(seatid < 1 || seatid > 4) return SysMsg(playerid,"The seat ID was invalid.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,6.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to detain them.");
- format(gstr, sizeof(gstr),"* Officer %s detains %s. *",NameEx(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"You have detained %s. They will be put in seat id %i of your next car.",NameEx(playa),seatid);
- SendClientMessage(playerid,COLOR_BLUE,gstr);
- PlayerToBeDetained[playerid] = playa;
- PlayerToBeDetainedSeat[playerid] = seatid;
- TogglePlayerControllable(playa,0);
- LoopingAnim(playa,"WUZI","CS_Dead_Guy", 3.0,0,0,0,0,0);
- }
- else SysMsg(playerid,"You need to be a member of the State Police.");
- return true;
- }
- CMD:mdc(playerid)
- {
- if((IsPlayerAdmin(playerid)) || Faction[playerid] == FACTION_COP || Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_RESEARCH)
- {
- if(CanUseMDC(playerid))
- {
- PlayerPlayNearbySound(playerid, MDC_OPEN);
- if(Faction[playerid] == FACTION_COP || (IsPlayerAdmin(playerid)) || Faction[playerid] == FACTION_RESEARCH) Dialog_Show(playerid, MDC_Home, DIALOG_STYLE_LIST, "MDC - Dashboard", "Name Search\nPlate Search\nAll Points Bulletin\nRecent 911 calls", "Select", "Logout");
- else Dialog_Show(playerid, MDC_Home, DIALOG_STYLE_LIST, "MDC - Dashboard", "Recent 911 calls\nRequest Backup", "Select", "Logout");
- SetPlayerChatBubble(playerid, "* Logs into the Mobile Data Computer *", COLOR_EMOTE, 15, 10000);
- }
- else return SysMsg(playerid,"You can only use this system in a MDC equipped faction vehicle or at a faction computer.");
- }
- else return SysMsg(playerid, "You need to be a member of a government faction to use this command.");
- return true;
- }
- CMD:forcein(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsCop(playerid)) return SysMsg(playerid,"You need to be a Law Enforcement Officer.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You must be a driver to force a player inside.");
- new playa = -1, seatid, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]i", name, seatid)) return SysMsg(playerid,"Usage: /forcein [ID or Part of Name or Stranger ID] [seat id] *Hint: 1, 2 & 3 Are Passenger Seats*");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(playa == playerid) return SysMsg(playerid,"You can't force in yourself.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(IsCuffed[playa] == 0) return SysMsg(playerid,"That player is not cuffed. Please use /cuff first.");
- if(seatid < 1 || seatid > 4) return SysMsg(playerid,"The seat ID was invalid.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,6.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to force them in.");
- format(gstr, sizeof(gstr),"* Officer %s pulls %s inside the vehicle. *",NameEx(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- PutPlayerInVehicle(playa, GetPlayerVehicleID(playerid), seatid);
- return true;
- }
- CMD:take(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid) || Faction[playerid] == FACTION_RESEARCH || IsPlayerAdminLevelOK(playerid, 1))
- {
- new playa = -1, object[10], itemAmount = -1, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]s[10]I(-1)", name, object, itemAmount)) return SysMsg(playerid,"Usage: /take [ID or Part of Name or Stranger ID] [weapon/weed/cocaine/moonshine] [amount (if required)]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- new Float:tX, Float:tY, Float:tZ;
- GetPlayerPos(playa, tX, tY, tZ);
- if(!IsPlayerInRangeOfPoint(playerid, 5.5, tX, tY, tZ)) return SysMsg(playerid,"You must be close to the player.");
- if(strcmp("weapon", object, true) == 0)
- {
- new wCount = 0;
- for(new i = 0; i < MAX_TOTAL_WEAPONS; i++)
- {
- if(WeaponData[playa][i][Weapon] > 0)
- {
- new substr[50];
- if(wCount == 0) format(gstr, sizeof(gstr), GetWeaponNameFromID(WeaponData[playa][i][Weapon]));
- else
- {
- format(substr, 50, "\n%s", GetWeaponNameFromID(WeaponData[playa][i][Weapon]));
- strcat(gstr, substr);
- }
- wCount ++;
- }
- }
- if(wCount == 0)
- {
- SysMsg(playerid,"That player has no weapons.");
- return true;
- }
- else
- {
- if(wCount > 1) strcat(gstr, "\nTake All Weapons");
- TakeGunPlayer[playerid] = playa;
- new caption[128];
- format(caption, 128, "Take a weapon from %s:", NameRP(playa)),
- Dialog_Show(playerid, WeaponTake, DIALOG_STYLE_LIST, caption, gstr, "Take", "Cancel");
- }
- return true;
- }
- if(strcmp("weed", object, true) == 0)
- {
- if(itemAmount == -1) return SysMsg(playerid,"Usage: /take [player id or name] Weed [amount]");
- if(itemAmount < 1 || itemAmount > Inventory[playa][Weed]) return SysMsg(playerid,"Invalid amount, must be 1 to amount of weed the player has (/frisk).");
- Inventory[playa][Weed] -= itemAmount;
- MySQLUpdateInt(SQLID[playa], "Weed", Inventory[playa][Weed], "players");
- format(gstr, sizeof(gstr),"* %s takes some drugs from %s. *", NameRP(playerid), NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"%s has taken %i gram(s) of weed from you.", NameRP(playerid), itemAmount);
- SendClientMessage(playa, COLOR_ORANGE, gstr);
- format(gstr, sizeof(gstr),"You took %i gram(s) of weed from %s.", itemAmount, NameRP(playa));
- SendClientMessage(playerid, COLOR_ORANGE, gstr);
- return true;
- }
- if(strcmp("Cocaine", object, true) == 0)
- {
- if(itemAmount == -1) return SysMsg(playerid,"Usage: /take [player id or name] Cocaine [amount]");
- if(itemAmount < 1 || itemAmount > Inventory[playa][Cocaine]) return SysMsg(playerid,"Invalid amount, must be 1 to amount of cocaine the player has (/frisk).");
- Inventory[playa][Cocaine] -= itemAmount;
- MySQLUpdateInt(SQLID[playa], "Cocaine", Inventory[playa][Cocaine], "players");
- format(gstr, sizeof(gstr),"* %s takes some drugs from %s. *", NameRP(playerid), NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"%s has taken %i gram(s) of cocaine from you.", NameRP(playerid), itemAmount);
- SendClientMessage(playa, COLOR_ORANGE, gstr);
- format(gstr, sizeof(gstr),"You took %i gram(s) of cocaine from %s.", itemAmount, NameRP(playa));
- SendClientMessage(playerid, COLOR_ORANGE, gstr);
- return true;
- }
- if(strcmp("MoonShine", object, true) == 0)
- {
- if(itemAmount == -1) return SysMsg(playerid,"Usage: /take [player id or name] MoonShine [amount]");
- if(itemAmount < 1 || itemAmount > Inventory[playa][MoonShine]) return SysMsg(playerid,"Invalid amount, must be 1 to amount of MoonShine the player has (/frisk).");
- Inventory[playa][MoonShine] -= itemAmount;
- MySQLUpdateInt(SQLID[playa], "MoonShine", Inventory[playa][MoonShine], "players");
- format(gstr, sizeof(gstr),"* %s takes some drugs from %s. *", NameRP(playerid), NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"%s has taken %i litre(s) of Moon Shine from you.", NameRP(playerid), itemAmount);
- SendClientMessage(playa, COLOR_ORANGE, gstr);
- format(gstr, sizeof(gstr),"You took %i litre(s) of Moon Shine from %s.", itemAmount, NameRP(playa));
- SendClientMessage(playerid, COLOR_ORANGE, gstr);
- return true;
- }
- }
- else SysMsg(playerid,"You need to be a member of the State Police.");
- return true;
- }
- CMD:siren(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new vehicleid = GetPlayerVehicleID(playerid);
- if(vehicleid == 0) return SysMsg(playerid,"You must be in a faction vehicle.");
- if(IsFactionVehicle(vehicleid) != Faction[playerid]) return SysMsg(playerid,"You must be in a faction vehicle.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER && (GetPlayerVehicleSeat(playerid) != 1 && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)) return SysMsg(playerid,"You are not the driver or front passenger.");
- new modelid = GetVehicleModel(vehicleid);
- if(!Siren{vehicleid})
- {
- if(VehObject[vehicleid] != INVALID_OBJECT_ID) return SysMsg(playerid, "This vehicle already has an object attached to it.");
- if(IsCop(playerid))
- {
- switch(modelid)
- {
- case 596: //LSPD
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, -1.75, 0.35, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 598: //LVPD
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, -1.5, 0.35, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 490: //FBI RANCH
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.5, 0.5, 1.15, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 560: //SULTAN
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.45, 0.25, 0.85, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 426: //PREMIER
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.45, 0.0, 0.875, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 541: //Bullet
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.6, 0.35, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 411: //Infernus
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.98, 0.24, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 402: //buffalo
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.55, 0.3, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 579: //buffalo
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.6, 0.6, -10.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 413: //PONY
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.65, 1.2, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 597: //SFPD
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, -1.75, 0.35, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 415: //CHEETAH
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.65, 0.2, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 445: //admiral
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.004999, 0.739999, 0.309999, 0.000000, 0.000000, 0.000000);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 421: //Washington
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.000000, 0.799999, 0.239999, 0.000000, 0.000000, 0.000000);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 599: //Police Ranger
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.65, 0.5, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 427: //Enforcer
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 1.655, 0.7, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 405: //Sentinel
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.7, 0.25, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 482: //Burrito
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.5, 0.6, 0.95, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 457: //Caddy
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.3, 0.3, 1.35, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 470: //Patriot
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.75, 0.2, 1.13, 0, 0, 0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 525: //Towtruck
- {
- VehObject[vehicleid] = CreateVehicleObject(19803, vehicleid, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- default: SysMsg(playerid,"This vehicle cannot have a siren.");
- }
- }
- else if(Faction[playerid] == FACTION_SACFD)
- {
- switch(modelid)
- {
- case 407: //FireTruck
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.0,-3.01,1.350000,0.0,0.0,0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 544: //FireTruck LA (Ladder)
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0,2.850001,1.500000,0.0,0.0,0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 416: // Ambulance
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0,-3.525001,1.350000,0.0,0.0,0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 525: // Towtruck
- {
- VehObject[vehicleid] = CreateVehicleObject(19803, vehicleid, 0.0,-0.449999,1.425000,0.0,0.0,0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 433: // Barracks
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0,1.275000,1.725000,0.0,0.0,0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 552: //Utility
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.65, 1.375, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 554: //Yosemite
- {
- VehObject[vehicleid] = CreateVehicleObject(19419, vehicleid, 0.0, 0.0, 1.049999, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 427: //Enforcer
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 1.655, 0.7, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 490: //FBI RANCH
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.5, 0.5, 1.15, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 597: //SFPD
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, -1.75, 0.35, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- default: SysMsg(playerid,"This vehicle cannot have a siren.");
- }
- }
- else if(Faction[playerid] == FACTION_RESEARCH)
- {
- switch(modelid)
- {
- case 596: //LSPD
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, -1.75, 0.35, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 598: //LVPD
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, -1.5, 0.35, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 560: //SULTAN
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.45, 0.25, 0.85, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 426: //PREMIER
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.45, 0.0, 0.875, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 541: //Bullet
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.6, 0.35, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 411: //Infernus
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.98, 0.24, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 482: //burrito
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.0, 0.995, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 402: //buffalo
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.55, 0.3, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 579: //buffalo
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.6, 0.6, -10.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 413: //PONY
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.65, 1.2, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 597: //SFPD
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, -1.75, 0.35, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 415: //CHEETAH
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.65, 0.2, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 428: //securi
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.65, 1.35, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 405: //SENTINEL
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.75, 0.25, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 421: //WASHINTON
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0.0, 0.9, 0.225, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 490: //FBI RANCH
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.5, 0.5, 1.15, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 470: //Patriot
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.75, 0.2, 1.13, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 433: //Barracks
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.65, 015, 1.74, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 429: //Banshee
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.5, -1.27, 0.6, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 424: //BF Injection
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.64, 0.16, 0.92, -10.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 582: //Newsvan
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, -0.7, 1.05, 1.18, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 503: //hotrin
- {
- VehObject[vehicleid] = CreateVehicleObject(18646, vehicleid, 0, 0.75, 0.45, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- case 525: //Towtruck
- {
- VehObject[vehicleid] = CreateVehicleObject(19803, vehicleid, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {4BB74C}Attached{FFFFFF}. Warning: This may not display correctly if you have a vehicle mod installed.");
- }
- default: SysMsg(playerid,"This vehicle cannot have a siren.");
- }
- }
- else return SysMsg(playerid, "This faction doesn't have this feature.");
- Siren{vehicleid} = true;
- }
- else
- {
- if(IsCop(playerid) || Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_RESEARCH)
- {
- if(VehObject[vehicleid] != INVALID_OBJECT_ID && Siren{vehicleid})
- {
- if(Faction[playerid] == FACTION_SACFD && GetVehicleModel(vehicleid) == 554)
- {
- DestroyDynamicObjectEx(VehObject[vehicleid], "VehObject[vehicleid] 4");
- VehObject[vehicleid] = CreateVehicleObject(19420, vehicleid, 0.0, 0.0, 1.049999, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Siren Turned {8B0000}Off");
- }
- else
- {
- DestroyDynamicObjectEx(VehObject[vehicleid], "VehObject[vehicleid] 5");
- VehObject[vehicleid] = INVALID_OBJECT_ID;
- SendClientMessage(playerid, COLOR_WHITE, "> Siren {8B0000}Detached");
- }
- Siren{vehicleid} = false;
- }
- }
- }
- return true;
- }
- CMD:viewmyimpounds(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You cannot collect an impounded vehicle while inside of one.");
- if(!IsPlayerInRangeOfPoint(playerid, 3.0, 619.476257, -592.645996, 17.233013)) return SysMsg(playerid,"You need to be at the Impound Garage (Dillimore).");
- new sub[300], count;
- gstr[0] = EOS;
- for(new v = 0, x = MAX_VEHICLES; v < x; v++)
- {
- if(ImpoundData[v][iModel] > 399)
- {
- if(ImpoundData[v][iOwnerSQLID] == SQLID[playerid] || ImpoundData[v][iFaction] == Faction[playerid] && Faction[playerid] != 0)
- {
- if(ImpoundData[v][iImpoundTime] > 0) format(sub, 100, "%s - %i minutes left - $%i release fee - Reason: '%s'\n", GetVehicleNameEx(ImpoundData[v][iModel]), ImpoundData[v][iImpoundTime], ImpoundData[v][iImpoundFee], ImpoundData[v][iImpoundReason]);
- else format(sub, 100, "%s - $%i release fee - Reason: '%s'\n", GetVehicleNameEx(ImpoundData[v][iModel]), ImpoundData[v][iImpoundFee], ImpoundData[v][iImpoundReason]);
- strcat(gstr, sub);
- ClothingSelected[playerid][count] = v;
- count ++;
- }
- }
- }
- if(count == 0) return SysMsg(playerid,"You have no impounded vehicles.");
- Dialog_Show(playerid, MyImpounds, DIALOG_STYLE_LIST, "My Impounded Vehicles", gstr, "Release", "Exit");
- return true;
- }
- CMD:payparkingticket(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new vehicleid = GetPlayerVehicleID(playerid);
- if(vehicleid == 0) return SysMsg(playerid, "You must be in your vehicle.");
- if(VehicleData[vehicleid][VehicleOwnerSQLID] != SQLID[playerid]) return SysMsg(playerid, "You must be in your vehicle.");
- if(VehicleData[vehicleid][TicketAmount] == 0) return SysMsg(playerid, "This vehicle has no parking ticket to pay.");
- if(Cash[playerid] < VehicleData[vehicleid][TicketAmount]) return SysMsg(playerid, "You don't have enough money to pay this ticket.");
- GivePlayerCash(playerid, -VehicleData[vehicleid][TicketAmount]);
- format(gstr, sizeof(gstr),"You have paid the parking ticket of $%i for your %s.", VehicleData[vehicleid][TicketAmount], GetVehicleName(vehicleid));
- SendClientMessage(playerid,COLOR_LIGHTBLUE,gstr);
- FACTIONS[FACTION_COP][FactionBankBalance] += floatround(0.4 * VehicleData[vehicleid][TicketAmount]);
- MySQLUpdateInt(FACTION_COP, "BankBalance", FACTIONS[FACTION_COP][FactionBankBalance], "factions");
- format(gstr, sizeof(gstr),"%s has paid their parking ticket of $%i. A percentage of the money has been added to the Faction Bank.", NameEx(playerid), VehicleData[vehicleid][TicketAmount]);
- PoliceMessage(gstr);
- VehicleData[vehicleid][TicketAmount] = 0;
- MySQLUpdateInt(VehicleData[vehicleid][VehSQLID], "TicketAmount", 0, "vehicles");
- return true;
- }
- CMD:psa(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid) || Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_RESEARCH)
- {
- if(Faction[playerid] == FACTION_RESEARCH && FactionRank[playerid] < 8) return SysMsg(playerid,"You need to be rank 8+ to send an Aperture PSA.");
- if(Faction[playerid] == FACTION_SACFD && !IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"You are not the appropriate rank to send an SACFD PSA.");
- if(IsCop(playerid) && !IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"You are not the appropriate rank to send an SASP PSA.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /psa [message]");
- new psa[196];
- format(psa, sizeof(psa), "PSA from %s %s: %s", GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameEx(playerid), params);
- SendClientMessageToAllLogged(COLOR_BLUE, psa);
- }
- return true;
- }
- CMD:pan(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == FACTION_COP)
- {
- new tannoy2[196], loc[12];
- if(!IsPlayerInRangeOfPoint(playerid, 2.0, -1337.6696, -48.7392, 17.7579)) return SysMsg(playerid,"You must be in the control room to use the tannoy.");
- if(sscanf(params, "s[12]s[196]", loc, tannoy2)) return SysMsg(playerid,"Usage: /pan [inside/outside/both] [message]");
- if(strcmp("inside", loc, true) == 0)
- {
- foreach(new i: Player)
- {
- if(Logged{i} && GetPlayerInterior(i) == 6 && GetPlayerVirtualWorld(i) == 6164)
- {
- SendClientMessageF(i, 0x3DAD2FFF, "Prison Tannoy o< %s", tannoy2);
- }
- }
- }
- if(strcmp("outside", loc, true) == 0)
- {
- foreach(new i: Player)
- {
- if(Logged{i} && IsPlayerInRangeOfPoint(i, 75.0, 173.2664, 1412.5975, 31.3242))
- {
- SendClientMessageF(i, 0x3DAD2FFF, "Prison Tannoy o< %s", tannoy2);
- }
- }
- }
- if(strcmp("both", loc, true) == 0)
- {
- foreach(new i: Player)
- {
- if(Logged{i} && ((GetPlayerInterior(i) == 6 && GetPlayerVirtualWorld(i) == 6164) || IsPlayerInRangeOfPoint(i, 75.0, 173.2664,1412.5975,31.3242)))
- {
- SendClientMessageF(i, 0x3DAD2FFF, "Prison Tannoy o< %s", tannoy2);
- }
- }
- }
- }
- else return SysMsg(playerid,"You need to be a member of the SASP to use this command.");
- return true;
- }
- CMD:lockdown(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_COP) return SysMsg(playerid, "You must be a member of the SASP.");
- new cellstr[64];
- if(!IsPlayerInRangeOfPoint(playerid, 2.0, -1337.6696, -48.7392, 17.7579)) return SysMsg(playerid, "You must be at the prison tannoy to start a lockdown");
- {
- if(PrisonLockdown == 0)
- {
- PrisonLockdown = 1;
- foreach(new i: Player) if(Logged{i} && IsInPrison(i) || IsPlayerInRangeOfPoint(i, 75.0, -694.249816, 456.985992, 5.0055)) SendClientMessage(i, 0x3DAD2FFF, "Prison Tannoy o< The prison is now under lockdown!");
- for(new w = 0; w < sizeof(PrisonDoorsLock); w++) PrisonDoorsLock[w] = 1;
- for(new p = 0; p < 16; p++)
- {
- PrisonCellsLock[p] = 1;
- format(cellstr, sizeof(cellstr), "Cell %i\nLocked", p+1);
- DestroyDynamic3DTextLabel(PrisonCellsText[p]);
- PrisonCellsText[p] = Text3D:INVALID_3DTEXT_ID;
- PrisonCellsText[p] = CreateDynamic3DTextLabel(cellstr, COLOR_WHITE, PrisonCellsOut[p][0], PrisonCellsOut[p][1], PrisonCellsOut[p][2], 5.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 6164, -1, -1, 5);
- }
- }
- else if(PrisonLockdown == 1)
- {
- PrisonLockdown = 0;
- foreach(new i: Player) if(Logged{i} && IsInPrison(i) || IsPlayerInRangeOfPoint(i, 75.0, -694.249816, 456.985992, 5.0055)) SendClientMessage(i, 0x3DAD2FFF, "Prison Tannoy o< The prison is no longer under lockdown. Please return to your regular activities.");
- for(new w = 0; w < sizeof(PrisonDoorsLock); w++) PrisonDoorsLock[w] = 0;
- for(new p = 0; p < 16; p++)
- {
- PrisonCellsLock[p] = 0;
- format(cellstr, sizeof(cellstr), "Cell %i\nUnlocked", p+1);
- DestroyDynamic3DTextLabel(PrisonCellsText[p]);
- PrisonCellsText[p] = Text3D:INVALID_3DTEXT_ID;
- PrisonCellsText[p] = CreateDynamic3DTextLabel(cellstr, COLOR_WHITE, PrisonCellsOut[p][0], PrisonCellsOut[p][1], PrisonCellsOut[p][2], 5.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 6164, -1, -1, 55);
- }
- }
- }
- return true;
- }
- CMD:wanted(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == FACTION_COP || Faction[playerid] == FACTION_RESEARCH)
- {
- if(!CanUseMDC(playerid)) return SysMsg(playerid,"You must be at a computer.");
- new count = 0;
- SendClientMessage(playerid, COLOR_WHITE, "Current Wanted People:");
- foreach(new i: Player)
- {
- if(Logged{i})
- {
- if(PoliceFineAmount[i] > 0)
- {
- SendClientMessageF(playerid, COLOR_LIGHTBLUE, " %s(%i) - Fine to pay: $%i.",NameEx(i), i, PoliceFineAmount[i]);
- count++;
- }
- }
- }
- if(!count) SendClientMessage(playerid, COLOR_LIGHTBLUE, "None");
- }
- else SysMsg(playerid, "You must be in a government faction to use this.");
- return true;
- }
- CMD:cases(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsCop(playerid)) return SysMsg(playerid,"You need to be a Law Enforcement Officer");
- new count = 0;
- SendClientMessage(playerid, COLOR_WHITE, "People in jail:");
- foreach(new i: Player)
- {
- if(Logged{i})
- {
- if(IsJailed[i] > 0)
- {
- SendClientMessageF(playerid, COLOR_LIGHTBLUE, "%s (%i) - %i minutes remaining in cell %i.", NameEx(i), i, JailTime[i], JailCell[i]);
- count++;
- }
- }
- }
- if(count == 0) SendClientMessage(playerid, COLOR_LIGHTBLUE, "None");
- return true;
- }
- CMD:swat(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_COP) return SysMsg(playerid,"You need to be a member of the SASP.");
- if(FactionRank[playerid] < 3) return SysMsg(playerid,"You are not a high enough rank.");
- if(!IsPlayerInRangeOfPoint(playerid,1.75, -779.4825,-394.8364,1805.5311) && GetVehicleModel(GetPlayerVehicleID(playerid)) != 427) return SysMsg(playerid,"You are not in the armoury/enforcer.");
- if(SwatMode[playerid] == 0)
- {
- if(!WeaponCheck(playerid, 31)) return SysMsg(playerid, "You cannot get this weapon. You either have two sidearms or one primary weapon plus a sidearm on your person.");
- SwatMode[playerid] = 1;
- SkinBeforeSwat[playerid] = cPlayersSkin[playerid];
- GivePlayerWeaponEx(playerid, 17, 10, 3); //Tear Gas
- GivePlayerWeaponEx(playerid, 31, GetDefaultWeaponAmmo(31), 3);
- SetPlayerArmourEx(playerid, 125, 1);
- SetPlayerSkinEx(playerid, 285);
- TogglePlayerControllable(playerid, 0);
- SetTimerEx("UnFreezePlayer", 1000, 0, "d", playerid);
- SendClientMessage(playerid, COLOR_WHITE, "You are now on S.W.A.T duty. Use /swat to turn it off.");
- foreach(new i: Player) if(Faction[i] == FACTION_COP && RadioPoweredOn[playerid]) SendClientMessageF(i, 0x967100FF, "[Radio - 9112 MHz] Central Dispatcher: S.W.A.T Operative %s is now available!", NameEx(playerid));
- }
- else
- {
- SetPlayerSkinEx(playerid, SkinBeforeSwat[playerid]);
- cPlayersSkin[playerid] = SkinBeforeSwat[playerid];
- MySQLUpdateInt(SQLID[playerid], "Skin", cPlayersSkin[playerid], "players");
- SendClientMessage(playerid, COLOR_WHITE, "You are no longer on S.W.A.T duty.");
- ResetPlayerWeaponsEx(playerid);
- SyncPlayerWeapons(playerid);
- SetPlayerArmourEx(playerid, 100, 1);
- SetPlayerArmedWeapon(playerid, 0);
- SwatMode[playerid] = 0;
- }
- return true;
- }
- CMD:revokelicense(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsCop(playerid)) return SysMsg(playerid,"You need to be a Law Enforcement Officer");
- //if(FactionRank[playerid] < 2) return SysMsg(playerid, "You are not a high enough rank to revoke licenses.");
- new playa = -1, type[24], hours;
- if(sscanf(params, "us[24]i", playa, type, hours)) return SysMsg(playerid,"Usage: /revokelicense [player id or name] [car/bike/boat/plane/heli/largeveh] [hours to suspend (up to 12, use 0 for revoke)]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- new Float:Pos[3];
- GetPlayerPos(playa, Pos[0], Pos[1], Pos[2]);
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, Pos[0], Pos[1], Pos[2])) return SysMsg(playerid,"You must be close to the player.");
- if(hours < 0 || hours > 12) return SysMsg(playerid,"Hours must be from 0 to 12.");
- new lic = -1, sqlname[24], vehname[24], susname[32];
- if(strcmp("car", type, true) == 0) { lic = 0; sqlname = "LicenseCar"; susname = "LicenseSuspendTime_Car"; vehname = "CAR"; }
- else if(strcmp("large", type, true) == 0) { lic = 1; sqlname = "LicenseLargeVehicle"; susname = "LicenseSuspendTime_LargeVehicle"; vehname = "LARGE VEHICLE"; }
- else if(strcmp("bike", type, true) == 0) { lic = 2; sqlname = "LicenseBike"; susname = "LicenseSuspendTime_Bike"; vehname = "BIKE"; }
- else if(strcmp("boat", type, true) == 0) { lic = 3; sqlname = "LicenseBoat"; susname = "LicenseSuspendTime_Boat"; vehname = "BOAT"; }
- else if(strcmp("heli", type, true) == 0) { lic = 4; sqlname = "LicenseHelicopter"; susname = "LicenseSuspendTime_Helicopter"; vehname = "HELI"; }
- else if(strcmp("plane", type, true) == 0) { lic = 5; sqlname = "LicensePlane"; susname = "LicenseSuspendTime_Plane"; vehname = "PLANE"; }
- else return SysMsg(playerid,"No such license name.");
- if(Licenses[playa][lic] == 0) return SysMsg(playerid,"They don't have this license.");
- if(LicenseSuspendTime[playa][lic] > 0 && hours > 0) return SysMsg(playerid,"They already have this license suspended.");
- if(hours == 0)
- {
- Licenses[playa][lic] = 0;
- LicenseSuspendTime[playa][lic] = 0;
- MySQLUpdateInt(SQLID[playa], susname, LicenseSuspendTime[playa][lic], "players");
- MySQLUpdateInt(SQLID[playa], sqlname, Licenses[playa][lic], "players");
- format(gstr, sizeof(gstr),"Officer %s has revoked your %s license. (You must resit the test)", NameEx(playerid), vehname);
- SendClientMessage(playa,COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr),"You have revoked %s's %s license.", NameEx(playa), vehname);
- SendClientMessage(playerid,COLOR_WHITE, gstr);
- }
- else
- {
- LicenseSuspendTime[playa][lic] = hours * 60;
- MySQLUpdateInt(SQLID[playa], susname, LicenseSuspendTime[playa][lic], "players");
- format(gstr, sizeof(gstr),"Officer %s has suspended your %s license for %i hours.", NameEx(playerid), vehname, hours);
- SendClientMessage(playa,COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr),"You have suspended %s's %s license for %i hours.", NameEx(playa), vehname, hours);
- SendClientMessage(playerid,COLOR_WHITE, gstr);
- }
- return true;
- }
- CMD:drag(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsDragging[playerid] != -1) return SysMsg(playerid,"You are already dragging someone.");
- if(IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You can't drag from inside a vehicle.");
- if(IsCop(playerid) || Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_RESEARCH)
- {
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /drag [player id or name]");
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(playa == playerid) return SysMsg(playerid, "You can't drag yourself.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(IsCop(playerid) && IsCuffed[playa] == 0) return SysMsg(playerid,"The player must be in cuffs to drag them.");
- if(IsJailed[playa] == 1) return SysMsg(playerid,"You may not drag someone who is in Jail.");
- if(IsPlayerInAnyVehicle(playa)) return SysMsg(playerid,"You can't drag them if they are inside a vehicle.");
- if(IsSpectating[playa] >= 0) return SysMsg(playerid,"You must be close to the player to drag them.");
- if(ADuty[playa] == 1) return SysMsg(playerid, "You cannot drag on duty admins.");
- foreach(new i: Player)
- {
- if(IsDragging[i] == playerid) return SysMsg(playerid, "You cannot drag someone who is already dragging someone.");
- }
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,4.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to drag them.");
- IsDragging[playerid] = playa;
- TogglePlayerControllable(playa, 0);
- format(gstr, sizeof(gstr),"* %s grabs hold of %s and starts to drag them. *", NameRP(playerid), NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"%s is dragging you.", NameRP(playerid));
- SendClientMessage(playa,COLOR_BLUE,gstr);
- }
- return true;
- }
- CMD:stopdrag(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsDragging[playerid] == -1) return SysMsg(playerid,"You are not dragging anyone.");
- new playa = IsDragging[playerid];
- TogglePlayerControllable(playa, 1);
- IsDragging[playerid] = -1;
- if(IsCop(playerid) || Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_RESEARCH)
- {
- format(gstr, sizeof(gstr),"* %s releases their grip on %s and lets them go. *", NameRP(playerid), NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"%s is no longer dragging you.", NameRP(playerid));
- SendClientMessage(playa,COLOR_BLUE,gstr);
- }
- return true;
- }
- CMD:stinger(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid) || Faction[playerid] == FACTION_RESEARCH)
- {
- //if(FactionRank[playerid] < 2) return SysMsg(playerid, "You are not a high enough rank to place a Stinger.");
- if(StingerObjectID[playerid] != INVALID_OBJECT_ID) return SysMsg(playerid, "You have already placed a Stinger.");
- if(GetPlayerVehicleID(playerid) > 0) return SysMsg(playerid, "You cannot deploy a stinger from within a vehicle.");
- new Float:X, Float:Y, Float:Z, Float:Ang;
- GetPlayerPos(playerid, X, Y, Z);
- Ang = GetXYInFrontOfPlayer(playerid, X, Y, 5.0);
- StingerObjectID[playerid] = CreateDynamicObject(2892, X, Y, Z-1, 0.0, 0.0, Ang, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 300.0);
- StingerAreaID[playerid] = CreateDynamicRectangle(X-2, Y-6, X+2, Y+6);
- format(gstr, sizeof(gstr),"* Officer %s deploys a spike strip. *", NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_BLUE, "Stinger Deployed! Use /rstinger to remove it.");
- }
- return true;
- }
- CMD:rstinger(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid) || Faction[playerid] == FACTION_RESEARCH || IsPlayerAdminLevelOK(playerid, 1))
- {
- if(GetPlayerVehicleID(playerid) > 0) return SysMsg(playerid, "You cannot clear a stinger from within a vehicle.");
- foreach(new i: Player)
- {
- new Float:X, Float:Y, Float:Z;
- GetDynamicObjectPos(StingerObjectID[i], X, Y, Z);
- if(IsPlayerInRangeOfPoint(i, 10.0, X, Y, Z))
- {
- DestroyDynamicObjectEx(StingerObjectID[i], "StingerObjectID[i] 1");
- StingerObjectID[i] = INVALID_OBJECT_ID;
- DestroyDynamicArea(StingerAreaID[i]);
- StingerAreaID[i] = -1;
- SendClientMessage(playerid, COLOR_BLUE, "Stinger Removed.");
- return true;
- }
- }
- SysMsg(playerid, "You are not near a stinger.");
- }
- else SysMsg(playerid, "You must be in the SASP or Aperture to use this command.");
- return true;
- }
- CMD:rb(playerid)
- {
- if(!Logged{playerid}) return true;
- if((IsPlayerAdmin(playerid)) || IsCop(playerid) || Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_RESEARCH || Faction[playerid] == FACTION_TRUCKING)
- {
- //if(FactionRank[playerid] < 3) return SysMsg(playerid, "You are not a high enough rank to place a Roadblock.");
- if(RoadBlockCount[playerid] >= MAX_PLAYERROADBLOCKS) return SysMsg(playerid, "You have already placed the maximum numberof roadblocks. Use /removerb.");
- new blocks[9], count; //increase this number whenever adding a roadblock to RBData otherwise it will not show up here and probably return an array index error.
- for(new x = 0; x < sizeof(RBData); x++)
- {
- blocks[x] = RBData[x][RBModel];
- count ++;
- }
- //ShowModelSelectionMenu(playerid, "Place Roadblock", MODEL_SELECTION_ROADBLOCK, blocks, count, 0.0, 0.0, 0.0);
- }
- else SysMsg(playerid, "You must be in the SASP/Aperture/SACFD to use this command.");
- return true;
- }
- CMD:moverb(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid) || Faction[playerid] == FACTION_RESEARCH || Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_RESEARCH || Faction[playerid] == FACTION_TRUCKING || IsPlayerAdminLevelOK(playerid, 1))
- {
- SelectingRoadblock{playerid} = true;
- SelectObject(playerid);
- return true;
- }
- else SysMsg(playerid, "You must be in the SASP/Aperture/SACFD to use this command.");
- return true;
- }
- CMD:roadblock(playerid) return cmd_rb(playerid);
- CMD:removerb(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid) || Faction[playerid] == FACTION_RESEARCH || Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_RESEARCH || Faction[playerid] == FACTION_TRUCKING || IsPlayerAdminLevelOK(playerid, 1))
- {
- RemovingRoadblock{playerid} = true;
- SelectObject(playerid);
- }
- else SysMsg(playerid, "You must be in the SASP/Aperture/SACFD to use this command.");
- return true;
- }
- CMD:ram(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == FACTION_SACFD || IsCop(playerid) || Faction[playerid] == FACTION_RESEARCH)
- {
- // HOUSES
- new Float:percChance[2], Float:randChos = random(100), ef = 0;
- percChance[0] = 0.4;
- percChance[1] = 0.6;
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid,DOOR_PROXIMITY,HouseData[h][oPosX],HouseData[h][oPosY],HouseData[h][oPosZ]) && GetPlayerVirtualWorld(playerid) == HouseData[h][HouseExtVW])
- {
- if(HouseData[h][HouseOwnerSQLID] == -5) return SysMsg(playerid,"You can't ram this door down.");
- if(HouseData[h][HouseLocked] == 0) return SysMsg(playerid, "House door is not locked.");
- foreach(new i: Player)
- {
- if(Logged{i})
- {
- if(IsInHouseID[i] == h)
- {
- SendClientMessage(i, COLOR_EMOTE, "**A loud pound is heard at the door.**");
- PlayerPlaySound(i, 6603, HouseData[h][intPosX], HouseData[h][intPosY], HouseData[h][intPosZ]);
- }
- if(IsPlayerInRangeOfPoint(i, 20.0, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ]))
- {
- PlayerPlaySound(i, 6603, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ]);
- }
- }
- }
- while(randChos > 0)
- {
- ef = random(2);
- randChos = floatsub(randChos, percChance[ef]);
- }
- if(ef == 1)
- {
- format(gstr, sizeof(gstr),"* %s tries to ram the door open but fails. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else
- {
- HouseData[h][HouseLocked] = 0;
- MySQLUpdateInt(HouseData[h][HouseSQLID], "HouseLocked", HouseData[h][HouseLocked], "houses");
- format(gstr, sizeof(gstr),"* %s tries to ram the door open and succeeds. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"The door of %s is now open.",HouseData[h][HouseDescription]);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- return true;
- }
- }
- // BIZZes
- for(new b = 0; b < MAX_BIZZ; b++)
- {
- if(IsPlayerInRangeOfPoint(playerid,DOOR_PROXIMITY,BizzData[b][oPosX],BizzData[b][oPosY],BizzData[b][oPosZ]))
- {
- if(BizzData[b][BizzOwnerSQLID] == -5) return SysMsg(playerid,"You can't ram this door down.");
- if(!BizzData[b][BizzLocked]) return SysMsg(playerid, "The business is not locked.");
- foreach(new i: Player)
- {
- if(Logged{i})
- {
- if(IsInBizzID[i] == b)
- {
- SendClientMessage(i, COLOR_EMOTE, "**A loud pound is heard at the door.**");
- PlayerPlaySound(i, 6603, BizzData[b][iPosX], BizzData[b][iPosY], BizzData[b][iPosZ]);
- }
- if(IsPlayerInRangeOfPoint(i, 20.0, BizzData[b][oPosX], BizzData[b][oPosY], BizzData[b][oPosZ]))
- {
- PlayerPlaySound(i, 6603, BizzData[b][oPosX], BizzData[b][oPosY], BizzData[b][oPosZ]);
- }
- }
- }
- while(randChos > 0)
- {
- ef = random(2);
- randChos = floatsub(randChos, percChance[ef]);
- }
- if(ef == 1)
- {
- format(gstr, sizeof(gstr),"* %s tries to ram the door open but fails. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else
- {
- BizzData[b][BizzLocked] = false;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Locked", BizzData[b][BizzLocked], "bizz");
- format(gstr, sizeof(gstr),"* %s tries to ram the door open and succeeds. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"The door of %s is now open.",BizzData[b][BizzDescription]);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- return true;
- }
- }
- //garages
- for(new g = 0; g < MAX_GARAGES; g++)
- {
- if(IsPlayerInRangeOfPoint(playerid,DOOR_PROXIMITY,GarageData[g][oPosX],GarageData[g][oPosY],GarageData[g][oPosZ]))
- {
- if(!GarageData[g][GarageLocked]) return SysMsg(playerid, "The garage is not locked.");
- foreach(new i: Player)
- {
- if(Logged{i})
- {
- if(IsInGarageID[i] == g)
- {
- SendClientMessage(i, COLOR_EMOTE, "**A loud pound is heard at the door.**");
- PlayerPlaySound(i, 6603, GarageData[g][iPosX], GarageData[g][iPosY], GarageData[g][iPosZ]);
- }
- if(IsPlayerInRangeOfPoint(i, 20.0, GarageData[g][oPosX], GarageData[g][oPosY], GarageData[g][oPosZ]))
- {
- PlayerPlaySound(i, 6603, GarageData[g][oPosX], GarageData[g][oPosY], GarageData[g][oPosZ]);
- }
- }
- }
- while(randChos > 0)
- {
- ef = random(2);
- randChos = floatsub(randChos, percChance[ef]);
- }
- if(ef == 1)
- {
- format(gstr, sizeof(gstr),"* %s tries to ram the door open but fails. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else
- {
- GarageData[g][GarageLocked] = false;
- MySQLUpdateInt(GarageData[g][gID], "Locked", GarageData[g][GarageLocked], "bizz");
- format(gstr, sizeof(gstr),"* %s tries to ram the door open and succeeds. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"The garage of %s is now open.",HouseData[GarageData[g][gHouseID]][HouseDescription]);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- return true;
- }
- }
- //house furniture doors
- if(IsInHouseID[playerid] != -1)
- {
- new h = IsInHouseID[playerid], Float:x, Float:y, Float:z;
- for(new f = 0; f < MAX_HFURNITURE; f++)
- {
- if(IsValidDoorObject(HouseData[h][FurnModel][f]))
- {
- GetDynamicObjectPos(HouseData[h][FurnObject][f], x, y, z);
- if(IsPlayerInRangeOfPoint(playerid, 2.0, x, y, z))
- {
- if(!HouseData[h][DoorOpen][f] && HouseData[h][DoorLocked][f])
- {
- while(randChos > 0)
- {
- ef = random(2);
- randChos = floatsub(randChos, percChance[ef]);
- }
- if(ef == 1)
- {
- format(gstr, sizeof(gstr),"* %s tries to ram the door open but fails. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else
- {
- ProcessHouseDoorRam(playerid, h, f);
- format(gstr, sizeof(gstr),"* %s tries to ram the door open and succeeds. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- break;
- }
- }
- }
- }
- }
- }
- }
- else SysMsg(playerid, "You must be in the SASP, SACFD or Aperture to use this.");
- return true;
- }
- CMD:backup(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Radio] == 0) return SysMsg(playerid,"You don't have a Radio.");
- if(RadioPoweredOn[playerid] == 0) return SysMsg(playerid,"Your Radio is not powered on. (/ron)");
- if(Faction[playerid] == 0) return SysMsg(playerid,"You must be in a Faction.");
- if(Duty[playerid] != 1) return SysMsg(playerid, "You must be on duty.");
- if(Dead{playerid} && IsHeadshotted(playerid)) return SysMsg(playerid,"You can't do this after being wounded by a headshot.");
- if(Faction[playerid] == FACTION_SACFD || IsCop(playerid))
- {
- if(isnull(params)) return SysMsg(playerid, "Usage: /backup [SASP/fd]");
- new freq, faction = -1, zone[MAX_ZONE_NAME];
- GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
- format(BackupLocation[playerid], MAX_ZONE_NAME, zone);
- if(strcmp(params, "SASP", true) == 0)
- {
- freq = FACTIONS[FACTION_COP][FactionRadioChannel];
- faction = FACTION_COP;
- BackupType[playerid] = 2;
- }
- else if(strcmp(params, "fd", true) == 0)
- {
- freq = FACTIONS[FACTION_SACFD][FactionRadioChannel];
- faction = FACTION_SACFD;
- BackupType[playerid] = 1;
- }
- if(faction == -1) return SysMsg(playerid, "Usage: /backup [SASP/fd]");
- format(sgstr, sizeof(sgstr), "[Radio - %i MHz] Departmental Dispatcher: %s %s from %s is requesting backup at %s.", freq, GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameEx(playerid), FACTIONS[Faction[playerid]][FNameShort], zone);
- foreach(new i: Player)
- {
- if(IsPlayerNPC(i) || !Logged{i}) continue;
- if(RadioPoweredOn[i] == 1 && RadioFrequency[i] == freq && Faction[i] == faction)
- {
- SendClientMessage(i, 0x967100FF, sgstr);
- }
- }
- if(!IsPlayerInAnyVehicle(playerid)) format(sgstr, sizeof(sgstr),"* %s presses a button on their radio. *", NameRP(playerid));
- else format(sgstr, sizeof(sgstr),"* %s presses a button on the mobile data computer. *", NameRP(playerid));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- return true;
- }
- stock IsHeadshotted(playerid)
- {
- for(new hit = 0; hit < HitCount[playerid]; hit++)
- {
- if(Injuries[playerid][hit][pBodypart] == 9)
- {
- return true;
- }
- }
- return false;
- }
- CMD:backupcancel(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == 0) return SysMsg(playerid,"You must be in a Faction.");
- if(Faction[playerid] == FACTION_SACFD || IsCop(playerid))
- {
- new freq;
- switch(BackupType[playerid])
- {
- case 1: freq = FACTIONS[FACTION_SACFD][FactionRadioChannel];
- case 2: freq = FACTIONS[FACTION_COP][FactionRadioChannel];
- }
- format(gstr, sizeof(gstr), "[Radio - %i MHz] Departmental Dispatcher: %s %s from %s no longer needs backup.", freq, GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameEx(playerid), FACTIONS[Faction[playerid]][FNameShort]);
- foreach(new i: Player)
- {
- if(IsPlayerNPC(i) || !Logged{i}) continue;
- if(RadioPoweredOn[i] == 1 && RadioFrequency[i] == freq)
- {
- SendClientMessage(i, 0x967100FF, gstr);
- }
- }
- BackupType[playerid] = 0;
- }
- return true;
- }
- CMD:bkcancel(playerid, params[]) return cmd_bkcancel(playerid, params);
- CMD:cctv(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(UsingCCTV{playerid} || (Faction[playerid] == FACTION_COP && IsPlayerInRangeOfPoint(playerid, 2.5, -789.2054,-418.9164,1601.9958)) || Faction[playerid] == FACTION_RESEARCH && IsPlayerInRangeOfPoint(playerid, 2.5, 1034.3674,-1115.4692,2025.2595))
- {
- gstr[0] = EOS;
- strcat(gstr, "Blueberry North\n");
- strcat(gstr, "Blueberry South\n");
- strcat(gstr, "Blueberry Truck Terminal\n");
- strcat(gstr, "Bone County East Gas Station\n");
- strcat(gstr, "Dillimore North\n");
- strcat(gstr, "Dillimore West\n");
- strcat(gstr, "El Quebrados Central\n");
- strcat(gstr, "El Quebrados East\n");
- strcat(gstr, "Fort Carson Central\n");
- strcat(gstr, "Fort Carson East\n");
- strcat(gstr, "Fort Carson Gas Station\n");
- strcat(gstr, "Fort Carson Medical Center\n");
- strcat(gstr, "Fort Carson North Entrance\n");
- strcat(gstr, "Hunter Quarry Intersection\n");
- strcat(gstr, "Las Barrancas South\n");
- strcat(gstr, "Las Barrancas\n");
- strcat(gstr, "Las Payasadas\n");
- strcat(gstr, "Montgomery East\n");
- strcat(gstr, "Montgomery Hospital\n");
- strcat(gstr, "Montgomery South\n");
- strcat(gstr, "Palomino Creek East\n");
- strcat(gstr, "Palomino Creek Main St\n");
- strcat(gstr, "Palomino Creek South\n");
- strcat(gstr, "Pay Toll East\n");
- strcat(gstr, "Pay Toll West\n");
- strcat(gstr, "Tiera Robada Junction\n");
- strcat(gstr, "Tiera Robada South\n");
- if(!UsingCCTV{playerid})
- {
- if(Faction[playerid] == FACTION_COP)
- {
- SetPlayerCameraPos(playerid, 263.7805, 109.5896, 1005.817);
- SetPlayerCameraLookAt(playerid, 253.7805, 109.5896, 1005.817);
- }
- else if(Faction[playerid] == FACTION_PROP)
- {
- SetPlayerCameraPos(playerid, 263.7805, 109.5896, 1005.817);
- SetPlayerCameraLookAt(playerid, 253.7805, 109.5896, 1005.817);
- }
- }
- Dialog_Show(playerid, CCTVMenu, DIALOG_STYLE_LIST, "CCTV - Camera List", gstr, "View", "Exit");
- UsingCCTV{playerid} = true;
- FadeColorForPlayer(playerid, 63, 71, 76, 100, 63, 71, 76, 100, 1, 10);
- }
- else SysMsg(playerid, "SASP only. You must be in a CCTV room.");
- return true;
- }
- CMD:elm(playerid)
- {
- if(!Logged{playerid}) return true;
- new VehID = GetPlayerVehicleID(playerid);
- if(IsCop(playerid) || Faction[playerid] == FACTION_SACFD || Faction[playerid] == FACTION_RESEARCH)
- {
- if(VehID == 0) return SysMsg(playerid,"You must be in a faction vehicle.");
- if(IsFactionVehicle(VehID) != Faction[playerid]) return SysMsg(playerid,"You must be in a faction vehicle.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER && (GetPlayerVehicleSeat(playerid) != 1 && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)) return SysMsg(playerid,"You are not the driver or front passenger.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- if(!ELMs{VehID})
- {
- ToggleVehicleLights(VehID, 1);
- EmergencyLights[VehID] = 0;
- ELMs{VehID} = true;
- SendClientMessage(playerid, COLOR_WHITE, "> Emergency Lights Turned {4BB74C}On");
- ShowInfoText(playerid,"~g~Emergency Lights ON",1000);
- }
- else if(ELMs{VehID})
- {
- EmergencyLights[VehID] = 0;
- ToggleVehicleLights(VehID, VehicleLights[VehID]);
- new panels, doors, lights, tires;
- GetVehicleDamageStatus(VehID, panels, doors, lights, tires);
- UpdateVehicleDamageStatus(VehID, panels, doors, 0, tires);
- SendClientMessage(playerid, COLOR_WHITE, "> Emergency Lights Turned {8B0000}Off");
- ShowInfoText(playerid,"~r~Emergency Lights Off",1000);
- ELMs{VehID} = false;
- }
- }
- else SysMsg(playerid,"Only certain factions can use this feature.");
- return true;
- }
- CMD:jail(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid))
- {
- new playa = -1, time, cellid, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]ii", name, time, cellid)) return SysMsg(playerid,"Usage: /jail [player id or name] [time] [cell number, 1-4]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(IsDragging[playerid] == playa) return SysMsg(playerid,"You can't jail the person you are dragging.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to jail them.");
- if(time < 1) return SysMsg(playerid,"The time must be greater than 0 minutes");
- if(time > 60) return SysMsg(playerid,"The time must be less than 60 minutes");
- if(cellid < 1) return SysMsg(playerid,"Cell number must be 1, 2, 3 or 4");
- if(cellid > 4) return SysMsg(playerid,"Cell number must be 1, 2, 3 or 4");
- JailTime[playa] = time;
- MySQLUpdateInt(SQLID[playa], "JailTime", JailTime[playa], "players");
- JailPlayer(playa, cellid);
- IsJailed[playa] = 1;
- JailCell[playa] = cellid;
- SendClientMessageF(playa,COLOR_DARKBLUE,"Officer %s Has Jailed You For %i Minute(s)",NameEx(playerid),time);
- foreach(new i: Player)
- {
- if(Logged{i} && (IsCop(i))) SendClientMessageF(i,COLOR_DARKBLUE,"Officer %s has Jailed %s",NameEx(playerid),NameEx(playa));
- }
- SendClientMessageF(playerid, COLOR_LIGHTBLUE, "You Have Jailed %s For %i Minute(s)",NameEx(playa),time);
- AddToMDC(SQLID[playa], playerid, MDC_TYPE_JAIL, time, "");
- foreach(new i: Player)
- {
- if(PlayerToBeDetained[i] == playa)
- {
- PlayerToBeDetained[i] = -1;
- PlayerToBeDetainedSeat[i] = -1;
- break;
- }
- }
- }
- else return SysMsg(playerid,"You need to be a member of the State Police.");
- return true;
- }
- CMD:unjail(playerid, params[])
- {
- new playa = -1;
- if(!Logged{playerid}) return true;
- if(!IsCop(playerid)) return true;
- {
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /unjail [player id or name]");
- if(IsJailed[playa] == 0) return SysMsg(playerid,"This player is not in jail.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,4.5,tX,tY,tZ)) return SysMsg(playerid,"You must be near the player in order to release them.");
- UnJailPlayer(playa);
- MySQLUpdateInt(SQLID[playa], "JailTime", 0, "players");
- SendClientMessageF(playa, COLOR_RED, "Officer %s has released you from jail.",NameRP(playerid));
- foreach(new i: Player)
- {
- if(Logged{i} && (IsCop(i))) SendClientMessageF(i,COLOR_DARKBLUE,"Officer %s has released %s from jail.",NameEx(playerid),NameRP(playa));
- }
- SendClientMessageF(playerid, COLOR_LIGHTBLUE, "You have released %s from jail.",NameEx(playa));
- }
- return true;
- }
- CMD:timeleft(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(PlayerImprisoned{playerid}) return SendClientMessageF(playerid, COLOR_WHITE, "You have {FFA900}%i{FFFFFF} minutes remaining in prison.", PrisonTime[playerid]);
- if(IsJailed[playerid] == 1) return SendClientMessageF(playerid, COLOR_WHITE, "You have {FFA900}%i{FFFFFF} minutes remaining in jail.", JailTime[playerid]);
- else return SysMsg(playerid, "You are not in jail or prison.");
- }
- CMD:prison(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsCop(playerid))
- {
- new playa = -1, time, cellid, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]ii", name, time, cellid)) return SysMsg(playerid,"Usage: /prison [player id or name] [hours] [cell number]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(IsDragging[playerid] == playa) return SysMsg(playerid,"You can't imprison the person you are dragging.");
- if(playerid == playa) return SysMsg(playerid,"You can't imprison yourself.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to imprison them.");
- if(time < 1) return SysMsg(playerid,"The time must be greater than 1 hour.");
- if(time > 2) return SysMsg(playerid,"The time must be no more than 2 hours.");
- if(cellid < 1 || cellid > 16) return SysMsg(playerid,"Cell numbers range from 1 to 16 only.");
- cellid --;
- PrisonTime[playa] = time*60;
- ImprisonPlayer(playa, cellid);
- PlayerImprisoned{playa} = true;
- if(Cash[playa] > 0)
- {
- BankBalance[playa] += Cash[playa];
- SetPlayerCash(playa, 0);
- }
- SetPlayerArmourEx(playa, 0.0, 1);
- Inventory[playa][Fags] = 0;
- Inventory[playa][Lighter] = 0;
- Inventory[playa][Weed] = 0;
- Inventory[playa][MoonShine] = 0;
- Inventory[playa][Cocaine] = 0;
- Inventory[playa][AmmoBox][0] = 0;
- Inventory[playa][AmmoBox][1] = 0;
- Inventory[playa][AmmoBox][2] = 0;
- Inventory[playa][AmmoBox][3] = 0;
- Inventory[playa][AmmoBox][4] = 0;
- Inventory[playa][AmmoBox][5] = 0;
- Inventory[playa][Rope] = 0;
- Inventory[playa][RollingPaper] = 0;
- Inventory[playa][Bong] = 0;
- Inventory[playa][MedKit] = 0;
- Inventory[playa][Toolbox] = 0;
- Inventory[playa][WeedSeed] = 0;
- Inventory[playa][Water] = 0;
- mysql_pqueryf(conn, "UPDATE players SET HasFags = 0, HasLighter = 0, Weed = 0, Cocaine = 0, Moonshine = 0, AmmoBoxPistol = 0, AmmoBoxShotgun = 0, AmmoBoxSMG = 0, AmmoBoxRifle = 0, AmmoBoxAssaultR = 0,\
- HasRope = 0, RollingPaper = 0, Bong = 0, HasMedKit = 0, HasToolbox = 0, HasWater = 0, HasWeedSeed = 0, PrisonTime = %i, Bank = %i WHERE id = %i", PrisonTime[playa], BankBalance[playa], SQLID[playa]);
- if(IsPlayerMasked{playa}) cmd_unmask(playa, "");
- AddToMDC(SQLID[playa], playerid, MDC_TYPE_JAIL, (time * 60), "");
- SendClientMessageF(playa,COLOR_RED, "%s has imprisoned you for %i hours.",NameEx(playerid),time);
- SendClientMessage(playa, COLOR_WHITE, "Note: Certain items are unauthorized in the prison, they have been taken from you. Any cash you had will now be in your bank.");
- SendClientMessage(playa, COLOR_WHITE, "Confiscated Items: cigarettes, lighters, drugs/drug items, ammo, weapons, rope, liquids, tools, phone, radio");
- foreach(new i: Player) if(Logged{i} && IsCop(i)) SendClientMessageF(i,COLOR_DARKBLUE, "Officer %s has imprisoned %s.",NameEx(playerid),NameEx(playa));
- SendClientMessageF(playerid,COLOR_LIGHTBLUE, "You have imprisoned %s for %i hours.",NameEx(playa),time);
- foreach(new i: Player)
- {
- if(PlayerToBeDetained[i] == playa)
- {
- PlayerToBeDetained[i] = -1;
- PlayerToBeDetainedSeat[i] = -1;
- break;
- }
- }
- }
- else return SysMsg(playerid,"You need to be a member of the State Police.");
- return true;
- }
- CMD:isolate(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] != FACTION_COP) return SysMsg(playerid, "You must be in the SASP to isolate players.");
- new playa = -1, time, isoid;
- if(sscanf(params, "iii", playa, time, isoid)) return SysMsg(playerid,"Usage: /isolate [player id] [time in minutes] [room number]");
- if(Isolated[playa] == 1) return SysMsg(playerid, "That player is already in isolation.");
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(IsDragging[playerid] == playa) return SysMsg(playerid,"You can't isolate the person you are dragging.");
- if(playerid == playa) return SysMsg(playerid,"You can't isolate yourself.");
- if(time > PrisonTime[playa]) return SysMsg(playerid, "You cannot isolate somebody for longer than their prison sentence.");
- if(isoid > 3) return SysMsg(playerid, "You must select room 0 to 3.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to isolate them.");
- SendClientMessageF(playa,COLOR_RED, "Correctional Officer %s has put you into isolation for %i minutes.",NameEx(playerid),time);
- foreach(new i: Player) if(Logged{i} && Faction[i] == FACTION_COP) SendClientMessageF(i,COLOR_DARKBLUE, "Correctional Officer %s has put %s into isolation.",NameEx(playerid),NameEx(playa));
- IsolationTime[playa] = time;
- MySQLUpdateInt(SQLID[playa], "IsolationTime", IsolationTime[playa], "players");
- IsolatePlayer(playa, isoid);
- Isolated[playa] = 1;
- return true;
- }
- CMD:editprison(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == FACTION_COP)
- {
- new playa = -1, etime;
- if(sscanf(params, "ui", playa, etime)) return SysMsg(playerid,"Usage: /editprison [player id or name] [minutes]");
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(!PlayerImprisoned{playa}) return SysMsg(playerid,"That player is not in prison.");
- if(etime < 1) return SysMsg(playerid,"The time must be greater than 1 hour.");
- if(etime > 120) return SysMsg(playerid,"The time must be no more than 2 hours.");
- PrisonTime[playa] = etime;
- MySQLUpdateInt(SQLID[playa], "PrisonTime", PrisonTime[playa], "players");
- SendClientMessageF(playa,COLOR_RED, "Your prison time has been changed to %i minutes by %s.",etime,NameEx(playerid));
- SendClientMessageF(playerid,COLOR_LIGHTBLUE, "You have changed %s's prison time to %i minutes.",NameEx(playa),etime);
- }
- else return SysMsg(playerid,"You must be in the SASP to use this command.");
- return true;
- }
- CMD:releaseprisoner(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == FACTION_COP || IsPlayerAdminLevelOK(playerid, 4))
- {
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /releaseprisoner [player id or name]");
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(!PlayerImprisoned{playa}) return SysMsg(playerid,"That player is not in prison.");
- ReleaseFromPrison(playa);
- SendClientMessageF(playa, COLOR_RED, "You have been released from prison by %s.",NameEx(playerid));
- SendClientMessageF(playerid, COLOR_LIGHTBLUE, "You have released %s from prison.",NameEx(playa));
- if(IsPlayerAdminLevelOK(playerid, 0)) foreach(new p: Player) if(Faction[p] == FACTION_COP) SendClientMessageF(p, COLOR_LIGHTBLUE, "[Police Message] %s has been released from prison by %s %s.", NameEx(playa), GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameEx(playerid));
- }
- else return SysMsg(playerid,"You must be a member of the SASP to use this command.");
- return true;
- }
- CMD:prisoners(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == FACTION_COP || IsPlayerAdminLevelOK(playerid, 1))
- {
- new prisoner[48], count = 0;
- gstr[0] = EOS;
- strcat(gstr, "{A58977}Green Palms Correctional Facility Prisoners {B0B9CE}(( Online Players ))\n\n{FFFFFF}");
- foreach(new i: Player)
- {
- if(Logged{i} && PlayerImprisoned{i})
- {
- format(prisoner, sizeof(prisoner), "%s - %i minutes left\n", NameEx(i), PrisonTime[i]);
- strcat(gstr, prisoner);
- count ++;
- }
- }
- if(count == 0) SysMsg(playerid, "No one is in prison right now.");
- else ShowMessage(playerid, "Prisoners:", gstr, "Done");
- }
- else return SysMsg(playerid,"You must be a member of the SASP to use this command.");
- return true;
- }
- CMD:celldoor(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == FACTION_COP)
- {
- if(GetPlayerInterior(playerid) != 6 && GetPlayerVirtualWorld(playerid) != 6164) return SysMsg(playerid, "You may only interact with cell doors if you are in the main room of the prison.");
- new number[4], action[7], cellid = -1;
- if(sscanf(params, "s[4]s[7]", number, action)) return SysMsg(playerid,"Usage: /celldoor [cell number or 'all'] [(l)ock/(u)nlock]");
- if(IsNumeric(number))
- {
- cellid = strval(number);
- if(cellid < 1 || cellid > 16) return SysMsg(playerid, "The cell number must be between 1 and 20, or use 'all' to lock/unlock them all at once.");
- cellid --;
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, PrisonCellsOut[cellid][0], PrisonCellsOut[cellid][1], PrisonCellsOut[cellid][2])) return SysMsg(playerid, "You must be closer to the cell door first.");
- new cellstr[50];
- if(strcmp("lock", action, true) == 0 || strcmp("L", action, true) == 0)
- {
- if(PrisonCellsLock[cellid] == 1) return SysMsg(playerid, "That cell door is already locked.");
- PrisonCellsLock[cellid] = 1;
- format(cellstr, sizeof(cellstr), "Cell %i\nLocked", cellid+1);
- DestroyDynamic3DTextLabel(PrisonCellsText[cellid]);
- PrisonCellsText[cellid] = Text3D:INVALID_3DTEXT_ID;
- PrisonCellsText[cellid] = CreateDynamic3DTextLabel(cellstr, COLOR_WHITE, PrisonCellsOut[cellid][0], PrisonCellsOut[cellid][1], PrisonCellsOut[cellid][2], 5.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 6164, -1, -1, 5);
- format(cellstr, sizeof(cellstr), "Cell %i {8B0000}Locked", cellid+1);
- SendClientMessage(playerid, COLOR_WHITE, cellstr);
- return true;
- }
- else if(strcmp("unlock", action, true) == 0 || strcmp("U", action, true) == 0)
- {
- if(PrisonCellsLock[cellid] == 0) return SysMsg(playerid, "That cell door is already unlocked.");
- PrisonCellsLock[cellid] = 0;
- DestroyDynamic3DTextLabel(PrisonCellsText[cellid]);
- PrisonCellsText[cellid] = Text3D:INVALID_3DTEXT_ID;
- PrisonCellsText[cellid] = CreateDynamic3DTextLabel(cellstr, COLOR_WHITE, PrisonCellsOut[cellid][0], PrisonCellsOut[cellid][1], PrisonCellsOut[cellid][2], 5.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 6164, -1, -1, 5);
- format(cellstr, sizeof(cellstr), "Cell %i {4BB74C}Unlocked", cellid+1);
- SendClientMessage(playerid, COLOR_WHITE, cellstr);
- return true;
- }
- else return SysMsg(playerid, "Please use either 'lock' or 'unlock'. You can also use L and U for short.");
- }
- else
- {
- if(strcmp("all", number, true) == 0 || strcmp("A", number, true) == 0)
- {
- new changed = 0, p, cellstr[22];
- if(strcmp("lock", action, true) == 0 || strcmp("L", action, true) == 0)
- {
- for(p = 0; p < 16; p++)
- {
- if(PrisonCellsLock[p] == 0)
- {
- changed ++;
- PrisonCellsLock[p] = 1;
- format(cellstr, sizeof(cellstr), "Cell %i\nLocked", p+1);
- DestroyDynamic3DTextLabel(PrisonCellsText[p]);
- PrisonCellsText[p] = Text3D:INVALID_3DTEXT_ID;
- PrisonCellsText[p] = CreateDynamic3DTextLabel(cellstr, COLOR_WHITE, PrisonCellsOut[p][0], PrisonCellsOut[p][1], PrisonCellsOut[p][2], 5.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 6164, -1, -1, 5);
- }
- }
- if(changed == 0) return SysMsg(playerid, "All cells are already locked.");
- SendClientMessage(playerid, COLOR_WHITE, "All Cells {8B0000}Locked");
- return true;
- }
- else if(strcmp("unlock", action, true) == 0 || strcmp("U", action, true) == 0)
- {
- for(p = 0; p < 16; p++)
- {
- if(PrisonCellsLock[p] == 1)
- {
- changed ++;
- PrisonCellsLock[p] = 0;
- format(cellstr, sizeof(cellstr), "Cell %i\nUnlocked", p+1);
- DestroyDynamic3DTextLabel(PrisonCellsText[p]);
- PrisonCellsText[p] = Text3D:INVALID_3DTEXT_ID;
- PrisonCellsText[p] = CreateDynamic3DTextLabel(cellstr, COLOR_WHITE, PrisonCellsOut[p][0], PrisonCellsOut[p][1], PrisonCellsOut[p][2], 5.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 6164, -1, -1, 5);
- }
- }
- if(changed == 0) return SysMsg(playerid, "All cells are already unlocked.");
- SendClientMessage(playerid, COLOR_WHITE, "All Cells {4BB74C}Unlocked");
- return true;
- }
- else return SysMsg(playerid, "Please use either 'lock' or 'unlock'. You can also use L and U for short.");
- }
- }
- }
- else return SysMsg(playerid,"You need to be a member of the SASP to use this command.");
- return true;
- }
- CMD:fine(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsCop(playerid)) return SysMsg(playerid,"You need to be a Law Enforcement Officer.");
- new playa = -1, cash, reason[64];
- if(sscanf(params, "uiS()[64]", playa, cash, reason)) return SysMsg(playerid,"Usage: /fine [player id or name] [cash] [Optional: reason]");
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to fine them.");
- if(cash < 1) return SysMsg(playerid,"The fine must be greater than $0");
- switch(PlayerLevel[playa])
- {
- case 0,1: if(cash > 10000) return SysMsg(playerid,"The maximum fine amount for level 1 players is $10,000.");
- case 2,3: if(cash > 20000) return SysMsg(playerid,"The maximum fine amount for level 2 and 3 players is $20,000.");
- case 4,5: if(cash > 30000) return SysMsg(playerid,"The maximum fine amount for level 4 and 5 players is $30,000.");
- default: if(cash > 60000) return SysMsg(playerid,"The maximum fine amount is $60,000.");
- }
- if(strlen(reason) > 63) return SysMsg(playerid,"Reason was too long.");
- if(isnull(reason)) format(reason, sizeof(reason), "Not Specified");
- if(PoliceFineAmount[playa] < 0)
- {
- PoliceFineAmount[playa] = 0;
- }
- PoliceFineAmount[playa] += cash;
- MySQLUpdateInt(SQLID[playa], "PoliceFine", PoliceFineAmount[playa], "players");
- AddToMDC(SQLID[playa], playerid, MDC_TYPE_FINE, cash, reason);
- if(PlayerToBeDetained[playerid] == playa)
- {
- PlayerToBeDetained[playerid] = -1;
- PlayerToBeDetainedSeat[playerid] = -1;
- }
- if(IsCop(playerid)) format(gstr, sizeof(gstr),"Officer %s has fined you $%s, use '/accept fine' to pay it. [Reason: %s]",NameEx(playerid),format_cash(cash),reason);
- SendClientMessage(playa,COLOR_RED,gstr);
- format(gstr, sizeof(gstr),"You have fined %s $%s [Reason: %s]",NameEx(playa),format_cash(cash),reason);
- SendClientMessage(playerid,COLOR_LIGHTBLUE,gstr);
- return true;
- }
- CMD:warning(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsCop(playerid)) return SysMsg(playerid,"You need to be a Law Enforcement Officer");
- new playa = -1, reason[50];
- if(sscanf(params, "us[50]", playa, reason)) return SysMsg(playerid,"Usage: /warning [player id or name] [reason]");
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to warn them.");
- if(strlen(reason) < 2 || strlen(reason) > 50) return SysMsg(playerid,"Reason was too long/short.");
- SendClientMessageF(playa, COLOR_RED, "Official warning from Officer %s: %s",NameEx(playerid),reason);
- SendClientMessageF(playa, COLOR_RED, "This will be on your Criminal Record.");
- SendClientMessageF(playerid, COLOR_LIGHTBLUE, "You have warned %s: %s",NameEx(playa),reason);
- return true;
- }
- CMD:pticket(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsCop(playerid)) return SysMsg(playerid,"You need to be a Law Enforcement Officer");
- new vehicleid = GetNearestVehicle(playerid);
- new regplate[MAX_REG_PLATE], ticketAmount;
- if(sscanf(params, "s[8]i", regplate, ticketAmount)) return SysMsg(playerid,"Usage: Parking Ticket: /pticket [registration plate] [amount]");
- if(!strmatch(VehicleData[vehicleid][RegPlate], regplate) || strlen(VehicleData[vehicleid][RegPlate]) <= 0) return SysMsg(playerid, "You are not in range of that vehicle or the plate doesn't exist.");
- if(ticketAmount < 1 || ticketAmount > 1000) return SysMsg(playerid,"Amount must be between $1 and $1000.");
- VehicleData[vehicleid][TicketAmount] += ticketAmount;
- MySQLUpdateInt(VehicleData[vehicleid][VehSQLID], "TicketAmount", ticketAmount, "vehicles");
- format(gstr, sizeof(gstr),"You have set a $%i ticket to %s [%s, Owner: %s]", ticketAmount, VehicleData[vehicleid][RegPlate], GetVehicleNameEx(VehicleData[vehicleid][VehicleModel]), GetSQLName(VehicleData[vehicleid][VehicleOwnerSQLID]));
- SendClientMessage(playerid,COLOR_LIGHTBLUE,gstr);
- return true;
- }
- CMD:impound(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInRangeOfPoint(playerid, 50.0, 619.4, -592.6, 17.2)) return SysMsg(playerid,"You need to be near the Impound Garage (Dillimore).");
- if(!IsCop(playerid)) return SysMsg(playerid,"You need to be a Law Enforcement Officer");
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a vehicle.");
- new vehicleid = GetPlayerVehicleID(playerid);
- new impoundid = GetVehicleTrailer(vehicleid);
- if(GetVehicleModel(vehicleid) != 525 || impoundid == 0) return SysMsg(playerid, "You must have the vehicle attached to a Tow Truck in order to impound it.");
- if(IsRentalCar(impoundid) || IsServerCar(impoundid)) return SysMsg(playerid, "You cannot impound server vehicles.");
- new cashAmount, impoundHours, reason[64];
- if(sscanf(params, "iis[64]", cashAmount, impoundHours, reason)) return SysMsg(playerid,"Usage: /impound [cash fine] [hours] [reason]");
- if(cashAmount < 0 || cashAmount > 1000) return SysMsg(playerid,"Amount must be between $1 and $1000.");
- if(impoundHours < 1 || impoundHours > 24) return SysMsg(playerid,"Impound time must be between 1 and 24 hours.");
- if(strlen(reason) > 19) return SysMsg(playerid,"Reason was too long.");
- new impound_minutes = impoundHours * 60;
- if(VehicleData[impoundid][IdVehicle] > 0)
- {
- if(VehicleData[impoundid][Impounded]) return SysMsg(playerid, "Oops! A System Error has occurred, please report to an Admin. (ERROR: VIMP-1)");
- VehicleData[impoundid][Impounded] = true;
- for(new im = 0, x = GetVehiclePoolSize(); im <= x; im++)
- {
- if(ImpoundData[im][iSQLID] < 1)
- {
- ImpoundData[im][iModel] = VehicleData[impoundid][VehicleModel];
- ImpoundData[im][iSQLID] = VehicleData[impoundid][VehSQLID];
- ImpoundData[im][iOwnerSQLID] = VehicleData[impoundid][VehicleOwnerSQLID];
- ImpoundData[im][iImpoundedBy] = SQLID[playerid];
- ImpoundData[im][iImpoundFee] = cashAmount;
- ImpoundData[im][iImpoundTime] = impound_minutes;
- ImpoundData[im][iColor1] = VehicleData[impoundid][vColor1];
- ImpoundData[im][iColor2] = VehicleData[impoundid][vColor2];
- format(ImpoundData[im][iImpoundReason], 64, reason);
- format(ImpoundData[im][iRegPlate], MAX_REG_PLATE, VehicleData[impoundid][RegPlate]);
- ImpoundData[im][iVehType] = 1;
- ImpoundData[im][iFaction] = 0;
- break;
- }
- }
- new Float:health, panels, doors, lights, tires;
- GetVehicleHealth(impoundid, health);
- GetVehicleDamageStatus(impoundid, panels, doors, lights, tires);
- if(health < 250) health = 250;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET Impounded = 1, ImpoundedBy = %i, ImpoundTime = %i, ImpoundFee = %i, ImpoundReason = '%e', DamageHealth = %.2f, DamagePanels = %i, DamageDoors = %i, DamageLights = %i, DamageTires = %i WHERE id = %i",
- SQLID[playerid], impound_minutes, cashAmount, reason, health, panels, doors, lights, tires, VehicleData[impoundid][VehSQLID]);
- mysql_pquery(conn, mquery);
- if(VehicleData[impoundid][ForSale])
- {
- VehicleData[impoundid][ForSale] = false;
- VehicleData[impoundid][ForSalePrice] = 0;
- }
- if(VehicleData[impoundid][ForSaleLabel] != Text3D:INVALID_3DTEXT_ID) DestroyDynamic3DTextLabel(VehicleData[impoundid][ForSaleLabel]);
- VehicleData[impoundid][ForSaleLabel] = Text3D:INVALID_3DTEXT_ID;
- VehicleData[impoundid][IdVehicle] = 0;
- }
- else if(FVehicleData[vehicleid][FactionVehID] > 0)
- {
- FVehicleData[impoundid][FImpounded] = true;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE fveh SET Impounded = 1, ImpoundedBy = %i, ImpoundTime = %i, ImpoundFee = %i, ImpoundReason = '%e' WHERE id = %i",
- SQLID[playerid], impound_minutes, cashAmount, reason, FVehicleData[impoundid][FVSQLID]);
- mysql_pquery(conn, mquery);
- for(new im = 0, x = GetVehiclePoolSize(); im <= x; im++)
- {
- if(ImpoundData[im][iSQLID] < 1)
- {
- ImpoundData[im][iModel] = FVehicleData[impoundid][FVModel];
- ImpoundData[im][iSQLID] = FVehicleData[impoundid][FVSQLID];
- ImpoundData[im][iOwnerSQLID] = 0;
- ImpoundData[im][iImpoundedBy] = SQLID[playerid];
- ImpoundData[im][iImpoundFee] = cashAmount;
- ImpoundData[im][iImpoundTime] = impound_minutes;
- ImpoundData[im][iColor1] = FVehicleData[impoundid][FVCol1];
- ImpoundData[im][iColor2] = FVehicleData[impoundid][FVCol2];
- format(ImpoundData[im][iImpoundReason], 64, reason);
- format(ImpoundData[im][iRegPlate], MAX_REG_PLATE, FVehicleData[impoundid][FVRegPlate]);
- ImpoundData[im][iVehType] = 2;
- ImpoundData[im][iFaction] = FVehicleData[impoundid][FVFaction];
- break;
- }
- }
- }
- else return SysMsg(playerid, "You can't impound this vehicle.");
- SendClientMessageF(playerid, COLOR_LIGHTBLUE, "You have impounded the %s for %i hours (%i minutes) and attached a $%i fine to it.", GetVehicleName(impoundid), impoundHours, impound_minutes, cashAmount);
- SendClientMessageF(playerid, COLOR_LIGHTBLUE, "Reason for impound: %s", reason);
- DetachTrailerFromVehicle(vehicleid);
- DestroyVehicleEx(impoundid, "impoundid");
- ClearVehicleData(impoundid);
- return true;
- }
- CMD:viewimpounds(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInRangeOfPoint(playerid, 3.0, 619.476257, -592.645996, 17.233013)) return SysMsg(playerid,"You need to be at the Impound Garage (Dillimore).");
- if(!IsCop(playerid)) return SysMsg(playerid,"You need to be a Law Enforcement Officer");
- ShowImpoundList(playerid, 0);
- return true;
- }
- //==================== Fim ==================================//
- //7 House commands e furniture
- //House commands
- CMD:light(playerid)
- {
- if(!Logged{playerid}) return true;
- if(IsInHouseID[playerid] == -1 && IsInBizzID[playerid] == -1) return SysMsg(playerid, "You must be in a house or business to use this command.");
- new lighttype;
- if(IsInHouseID[playerid] != -1) lighttype = 1;
- else if(IsInBizzID[playerid] != -1) lighttype = 2;
- if(lighttype == 1)
- {
- new h = IsInHouseID[playerid];
- HouseData[h][HouseLights] = !HouseData[h][HouseLights];
- if(HouseData[h][HouseLights])
- {
- format(tgstr, sizeof(tgstr), "* %s flips a lightswitch on. *", NameRP(playerid));
- ProxDetector(20.0, playerid, tgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- foreach(new i: Player)
- {
- if(IsInHouseID[i] == h)
- {
- SetPlayerTime(i, 12, 0);
- }
- }
- }
- else
- {
- format(tgstr, sizeof(tgstr), "* %s flips a lightswitch off. *", NameRP(playerid));
- ProxDetector(20.0, playerid, tgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- foreach(new i: Player)
- {
- if(IsInHouseID[i] == h)
- {
- SetPlayerTime(i, gServerHour, gServerMinute);
- }
- }
- }
- }
- else if(lighttype == 2)
- {
- new b = IsInBizzID[playerid];
- if(BizzData[b][BizzOwnerSQLID] != SQLID[playerid] && !IsBizzMod(playerid, b) && !IsPlayerAdmin(playerid)) return SysMsg(playerid, "Only bizz owners/managers can use this command.");
- BizzData[b][BizzLights] = !BizzData[b][BizzLights];
- if(BizzData[b][BizzLights])
- {
- format(tgstr, sizeof(tgstr), "* %s flips a lightswitch on. *", NameRP(playerid));
- ProxDetector(20.0, playerid, tgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- foreach(new i: Player)
- {
- if(IsInBizzID[i] == b)
- {
- SetPlayerTime(i, 12, 0);
- }
- }
- }
- else
- {
- format(tgstr, sizeof(tgstr), "* %s flips a lightswitch off. *", NameRP(playerid));
- ProxDetector(20.0, playerid, tgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- foreach(new i: Player)
- {
- if(IsInBizzID[i] == b)
- {
- SetPlayerTime(i, gServerHour, gServerMinute);
- }
- }
- }
- }
- return true;
- }
- CMD:buyhouse(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(GetPlayerHouseCount(playerid) >= MAX_HOUSE_PER_PLAYER) return SysMsg(playerid,"You can't own anymore homes.");
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid,1.0,HouseData[h][oPosX],HouseData[h][oPosY],HouseData[h][oPosZ]) && GetPlayerVirtualWorld(playerid) == HouseData[h][HouseExtVW])
- {
- if(HouseData[h][HouseOwnerSQLID] == 0)
- {
- if(Cash[playerid] < HouseData[h][HousePrice]) return SysMsg(playerid,"You don't have enough money to buy this house.");
- HouseData[h][HouseOwnerSQLID] = SQLID[playerid];
- HasHouseKey[playerid][0] = -1;
- HasHouseKey[playerid][1] = -1;
- ProcessHouseKey(playerid);
- if(HasHouseKey[playerid][0] == h) SpawnAtHouse[playerid] = 0;
- else if(HasHouseKey[playerid][1] == h) SpawnAtHouse[playerid] = 1;
- MySpawnID[playerid] = 3;
- GivePlayerCash(playerid, -HouseData[h][HousePrice]);
- mysql_pqueryf(conn, "UPDATE players SET GuestHouseID = 0 WHERE GuestHouseID = %i", HouseData[h][HouseSQLID]);
- mysql_pqueryf(conn, "UPDATE houses SET OwnerSQLID = %i WHERE id = %i", SQLID[playerid], HouseData[h][HouseSQLID]);
- mysql_pqueryf(conn, "UPDATE players SET MySpawnID = %i, SpawnAtHouse = %i WHERE id = %i", MySpawnID[playerid], SpawnAtHouse[playerid], SQLID[playerid]);
- foreach(new i: Player) if(HouseData[h][HouseSQLID] == GuestHouseID[i]) GuestHouseID[i] = 0;
- SendClientMessageF(playerid,COLOR_GOLD, "You have purchased %s for $%s.",HouseData[h][HouseDescription],format_cash(HouseData[h][HousePrice]));
- ShowInfoText(playerid,"~w~PROPERTY ACQUIRED",5000);
- UpdateHousePickup(h);
- UnlockAchievement(playerid, 9);
- break;
- }
- else if(HouseData[h][HouseOwnerSQLID] == -5) return SysMsg(playerid,"This property is currently in the hands of Silver Trading, check there to see if it's for sale.");
- else return SysMsg(playerid,"This property is already purchased.");
- }
- }
- return true;
- }
- CMD:sellmyhouse(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(GetPlayerHouseCount(playerid) == 0) return SysMsg(playerid,"You have no house to sell.");
- new id, conf[8];
- if(sscanf(params, "is[8]", id, conf))
- {
- for(new x = 0; x < MAX_HOUSE_PER_PLAYER; x++)
- {
- if(HasHouseKey[playerid][x] != -1)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "House ID: %i - %s ($%s)", x, HouseData[HasHouseKey[playerid][x]][HouseDescription], format_cash(HouseData[HasHouseKey[playerid][x]][HousePrice] / 2));
- }
- }
- return SendClientMessage(playerid, COLOR_WHITE, "Use '/sellmyhouse [ID from above] confirm' if you wish to sell your house.");
- }
- if(HasHouseKey[playerid][id] == -1) return SysMsg(playerid, "You do not have a house in this slot.");
- if(id != 0 && id != 1) return SysMsg(playerid, "Invalid house ID.");
- if(strmatch(conf, "confirm"))
- {
- new h = HasHouseKey[playerid][id];
- if(!IsPlayerInRangeOfPoint(playerid, 4.5, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ])) return SysMsg(playerid, "You are not at your house.");
- new houseValue = HouseData[h][HousePrice] / 2;
- HouseData[h][HouseOwnerSQLID] = 0;
- HouseData[h][HouseLocked] = 0;
- HasHouseKey[playerid][0] = -1;
- HasHouseKey[playerid][1] = -1;
- ProcessHouseKey(playerid);
- SpawnAtHouse[playerid] = 0;
- if(MySpawnID[playerid] == 3)
- {
- MySpawnID[playerid] = 1;
- MySQLUpdateInt(SQLID[playerid], "MySpawnID", MySpawnID[playerid], "players");
- }
- GivePlayerCash(playerid, houseValue);
- MySQLUpdateInt(HouseData[h][HouseSQLID], "OwnerSQLID", HouseData[h][HouseOwnerSQLID], "houses");
- format(gstr, sizeof(gstr),"You have sold your house (%s) for $%s.",HouseData[h][HouseDescription],format_cash(houseValue));
- SendClientMessage(playerid,COLOR_GOLD,gstr);
- ShowInfoText(playerid,"~w~PROPERTY SOLD",5000);
- SendClientMessage(playerid,COLOR_GOLD,"All of your house guests (if any) have been evicted.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET GuestHouseID = 0 WHERE GuestHouseID = %i", HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET SpawnAtHouse = 0 WHERE id = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery);
- foreach(new i: Player) if(HouseData[h][HouseSQLID] == GuestHouseID[i]) GuestHouseID[i] = 0;
- UpdateHousePickup(h);
- }
- return true;
- }
- CMD:movein(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(GetPlayerHouseCount(playerid) == 0) return SysMsg(playerid,"You don't have a house.");
- new playa = -1, id;
- if(sscanf(params, "iu", id, playa))
- {
- for(new x = 0; x < MAX_HOUSE_PER_PLAYER; x++)
- {
- if(HasHouseKey[playerid][x] != -1)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "House ID: %i - %s", x, HouseData[HasHouseKey[playerid][x]][HouseDescription]);
- }
- }
- return SysMsg(playerid,"Usage: /movein [House ID from above] [player id or name]");
- }
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(playa == playerid) return SysMsg(playerid,"You can't do this to yourself.");
- if(id != 0 && id != 1) return SysMsg(playerid, "Invalid house ID.");
- if(HasHouseKey[playerid][id] == -1) return SysMsg(playerid, "You do not have a house in this slot.");
- if(!IsPlayerInRangeOfPoint(playerid,5.0, PlayerPosX(playa), PlayerPosY(playa), PlayerPosZ(playa))) return SysMsg(playerid,"You must be close to the player to invite them to move in.");
- OfferedMoveinFrom[playa][0] = playerid;
- OfferedMoveinFrom[playa][1] = id;
- SendClientMessageF(playa, COLOR_WHITE, "%s is offering you to move into their house (%s). Use '/accept movein' to confirm.", NameEx(playerid), HouseData[HasHouseKey[playerid][id]][HouseDescription]);
- if(GuestHouseID[playa] >= 1) SendClientMessage(playa, COLOR_WHITE, "Note: As a guest you may only stay in one house at a time, so moving into this house will evict you from your other house.");
- SendClientMessageF(playerid, COLOR_WHITE, "You have offered %s to move into your house (%s). They must accept first.", NameEx(playa), HouseData[HasHouseKey[playerid][id]][HouseDescription]);
- return true;
- }
- CMD:moveout(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new ghouse = IsHouseGuest(playerid);
- if(ghouse == 0) return SysMsg(playerid,"You are not living in someone elses house.");
- if(HouseData[ghouse][HouseSQLID] == GuestHouseID[playerid])
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET GuestHouseID = 0 WHERE id = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery);
- GuestHouseID[playerid] = 0;
- }
- if(MySpawnID[playerid] == 5)
- {
- MySpawnID[playerid] = 1;
- MySQLUpdateInt(SQLID[playerid], "MySpawnID", MySpawnID[playerid], "players");
- }
- SendClientMessageF(playerid,COLOR_GOLD,"You have moved out of %s.", HouseData[ghouse][HouseDescription]);
- foreach(new i: Player)
- {
- for(new x = 0; x < MAX_HOUSE_PER_PLAYER; x++)
- {
- if(HasHouseKey[i][x] == ghouse && Logged{i})
- {
- SendClientMessageF(i, COLOR_WHITE, "%s has just moved out of your house. (%s)", NameEx(playerid), HouseData[ghouse][HouseDescription]);
- return true;
- }
- }
- }
- return true;
- }
- CMD:evictguest(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(GetPlayerHouseCount(playerid) == 0) return SysMsg(playerid, "You don't have a house.");
- new id, guest[MAX_PLAYER_NAME + 1];
- if(sscanf(params, "is[25]", id, guest))
- {
- for(new x = 0; x < MAX_HOUSE_PER_PLAYER; x++)
- {
- if(HasHouseKey[playerid][x] != -1)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "House ID: %i - %s", x, HouseData[HasHouseKey[playerid][x]][HouseDescription]);
- }
- }
- return SysMsg(playerid, "Usage: /evictguest [House ID from above] [Full_Name] (use /viewhouseguests to find out who is staying in your house)");
- }
- if(id != 0 && id != 1) return SysMsg(playerid, "Invalid house.");
- if(HasHouseKey[playerid][id] == -1) return SysMsg(playerid, "You do not have a house in that slot.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,GuestHouseID FROM players WHERE Name = '%e'", guest);
- mysql_pquery(conn, mquery, "ProcessGuestEviction", "ii", playerid, HasHouseKey[playerid][id]);
- return true;
- }
- CMD:housemusic(playerid, params[])
- {
- if(IsInHouseID[playerid] == -1) return SysMsg(playerid, "You must be in a house.");
- if(IsHouseOwner(playerid, IsInHouseID[playerid]) || IsInHouseID[playerid] == IsHouseGuest(playerid))
- {
- new musicLink[200];
- if(sscanf(params, "s[200]", musicLink)) return SysMsg(playerid, "Usage: /housemusic [link/stop]");
- new h = IsInHouseID[playerid];
- if(strcmp(musicLink, "stop") == 0)
- {
- foreach(new i: Player)
- {
- if(Logged{i} && IsInHouseID[i] == h)
- {
- StopAudioStreamForPlayer(i);
- }
- }
- HouseData[h][HMusicPlaying] = 0;
- HouseData[h][HMusic][0] = EOS;
- }
- else
- {
- foreach(new i: Player)
- {
- if(Logged{i} && IsInHouseID[i] == h)
- {
- PlayAudioStreamForPlayerEx(i, musicLink);
- ListeningBoom[i] = -1;
- }
- }
- format(HouseData[h][HMusic], 200, musicLink);
- HouseData[h][HMusicPlaying] = 1;
- }
- return true;
- }
- else SysMsg(playerid,"You must be in your own house.");
- return true;
- }
- CMD:housestore(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsInHouseID[playerid] == -1) return SysMsg(playerid, "You must be in a house.");
- new item[10], itemname[20], amount, h = IsInHouseID[playerid];
- if(HouseData[h][HouseOwnerSQLID] == SQLID[playerid])
- {
- if(sscanf(params, "s[10]S()[20]", item)) return SysMsg(playerid,"Usage: /housestore [item] [amount/name] - Items: Cash, Weapon, Weed, Cocaine, MoonShine, Armour, Phone");
- if(strcmp("Cash", item, true) == 0 || strcmp("Money", item, true) == 0)
- {
- if(sscanf(params, "s[10]s[20]", item, itemname)) return SysMsg(playerid,"Usage: /housestore Cash [amount $]");
- if(!IsNumeric(itemname)) return SysMsg(playerid,"Amount must be a number.");
- amount = strval(itemname);
- if(amount < 1) return SysMsg(playerid,"Amount of Cash must be greater than zero.");
- if(amount > Cash[playerid]) return SysMsg(playerid,"You don't have that much Cash to store.");
- HouseData[h][StoredCash] += amount;
- GivePlayerCash(playerid, -amount);
- MySQLUpdateInt(HouseData[h][HouseSQLID], "StoredCash", HouseData[h][StoredCash], "houses");
- format(gstr, sizeof(gstr),"* %s stores some money in their house.",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"You stored $%s in your house.", format_cash(amount));
- SendClientMessage(playerid,COLOR_LIGHTRED,gstr);
- format(gstr, sizeof(gstr),"[%s] %s(%i) puts $%i in their house ID %i. (Total: $%i)", GetServerTimeString(), NameEx(playerid), playerid, amount, h, Cash[playerid]);
- return true;
- }
- if(strcmp("Weapon", item, true) == 0 || strcmp("Gun", item, true) == 0)
- {
- if(sscanf(params, "s[10]s[20]", item, itemname)) return SysMsg(playerid,"Usage: /housestore Weapon [name of weapon]");
- new wid = GetWeaponIdFromName(itemname);
- if(wid == -1) return SysMsg(playerid,"Invalid Weapon Name.");
- if(wid < 1 || wid > 47) return SysMsg(playerid,"Invalid Weapon.");
- if(wid == 19 || wid == 20 || wid == 21) return SysMsg(playerid,"Invalid Weapon.");
- new Slot = GetWeaponSlot(wid);
- if(WeaponData[playerid][Slot][Weapon] != wid) return SysMsg(playerid,"You don't have that weapon.");
- if(WeaponData[playerid][Slot][WeaponOrigin] == 3) return SysMsg(playerid, "You cannot store faction weapons in your home.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM weapons WHERE HouseID = %i AND Deleted = 0 AND Dropped = 0", HouseData[h][HouseSQLID]);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() >= 10) return SysMsg(playerid, "There is no more space left in your house for weapons.");
- cache_delete(result);
- new ammo = WeaponData[playerid][Slot][WeaponAmmo];
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET WeaponPossession = 0, HouseID = %i, WeaponAmmo = %i WHERE id = %i", HouseData[h][HouseSQLID], WeaponData[playerid][Slot][WeaponAmmo], WeaponData[playerid][Slot][WeaponID]);
- mysql_pquery(conn, mquery);
- ResetWeaponVariables(playerid, 0, Slot);
- SetPlayerArmedWeapon(playerid, 0);
- SyncPlayerWeapons(playerid);
- format(gstr, sizeof(gstr),"* %s stores a %s in their house. *",NameRP(playerid),GetWeaponNameFromID(wid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"You stored a %s and %i ammo in your house.",GetWeaponNameFromID(wid), ammo);
- SendClientMessage(playerid,COLOR_LIGHTRED,gstr);
- return true;
- }
- if(strcmp("Weed", item, true) == 0)
- {
- if(sscanf(params, "s[10]s[20]", item, itemname)) return SysMsg(playerid,"Usage: /housestore Weed [amount]");
- if(!IsNumeric(itemname)) return SysMsg(playerid,"Amount must be a number.");
- amount = strval(itemname);
- if(amount < 1) return SysMsg(playerid,"Amount of Weed must be greater than zero.");
- if(amount > Inventory[playerid][Weed]) return SysMsg(playerid,"You don't have that much Weed to store.");
- HouseData[h][StoredWeed] += amount;
- Inventory[playerid][Weed] -= amount;
- MySQLUpdateInt(HouseData[h][HouseSQLID], "StoredWeed", HouseData[h][StoredWeed], "houses");
- MySQLUpdateInt(SQLID[playerid], "Weed", Inventory[playerid][Weed], "players");
- format(gstr, sizeof(gstr),"* %s stores some Weed in their house.",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"You stored %ig of Weed in your house. You now have %ig in your inventory.", amount, Inventory[playerid][Weed]);
- SendClientMessage(playerid,COLOR_LIGHTRED,gstr);
- return true;
- }
- if(strcmp("Cocaine", item, true) == 0)
- {
- if(sscanf(params, "s[10]s[20]", item, itemname)) return SysMsg(playerid,"Usage: /housestore Cocaine [amount]");
- if(!IsNumeric(itemname)) return SysMsg(playerid,"Amount must be a number.");
- amount = strval(itemname);
- if(amount < 1) return SysMsg(playerid,"Amount of Cocaine must be greater than zero.");
- if(amount > Inventory[playerid][Cocaine]) return SysMsg(playerid,"You don't have that much Cocaine to store.");
- HouseData[h][StoredCocaine] += amount;
- Inventory[playerid][Cocaine] -= amount;
- MySQLUpdateInt(HouseData[h][HouseSQLID], "StoredCocaine", HouseData[h][StoredCocaine], "houses");
- MySQLUpdateInt(SQLID[playerid], "Cocaine", Inventory[playerid][Cocaine], "players");
- format(gstr, sizeof(gstr),"* %s stores some Cocaine in their house.",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"You stored %ig of Cocaine in your house. You now have %ig in your inventory.", amount, Inventory[playerid][Cocaine]);
- SendClientMessage(playerid,COLOR_LIGHTRED,gstr);
- return true;
- }
- if(strcmp("MoonShine", item, true) == 0)
- {
- if(sscanf(params, "s[10]s[20]", item, itemname)) return SysMsg(playerid,"Usage: /housestore MoonShine [amount]");
- if(!IsNumeric(itemname)) return SysMsg(playerid,"Amount must be a number.");
- amount = strval(itemname);
- if(amount < 1) return SysMsg(playerid,"Amount of MoonShine must be greater than zero.");
- if(amount > Inventory[playerid][MoonShine]) return SysMsg(playerid,"You don't have that much MoonShine to store.");
- HouseData[h][StoredMoonShine] += amount;
- Inventory[playerid][MoonShine] -= amount;
- MySQLUpdateInt(HouseData[h][HouseSQLID], "StoredMoonShine", HouseData[h][StoredMoonShine], "houses");
- MySQLUpdateInt(SQLID[playerid], "MoonShine", Inventory[playerid][MoonShine], "players");
- format(gstr, sizeof(gstr),"* %s stores some MoonShine in their house.",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"You stored %i L of MoonShine in your house. You now have %i L in your inventory.", amount, Inventory[playerid][MoonShine]);
- SendClientMessage(playerid,COLOR_LIGHTRED,gstr);
- return true;
- }
- if(strcmp("armour", item, true) == 0 || strcmp("armor", item, true) == 0)
- {
- new Float:carmour;
- GetPlayerArmour(playerid, carmour);
- if(VestType[playerid] == 0 || carmour == 0) return SysMsg(playerid, "You do not have any armor.");
- if(RestrictedVest{playerid}) return SysMsg(playerid, "You cannot store this vest in your house.");
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO storedarmor (ArmorType, ArmorAmount, HouseID) VALUES (%i, %f, %i)", VestType[playerid], carmour, HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery);
- format(gstr, sizeof(gstr),"* %s stores some Armour in their house.",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(VestType[playerid] == 1) SendClientMessageF(playerid, COLOR_LIGHTRED, "You stored a light kevlar vest in your house.");
- else SendClientMessage(playerid, COLOR_LIGHTRED, "You stored a heavy kevlar vest in your house.");
- SetPlayerArmourEx(playerid, 0.0, 1);
- VestType[playerid] = 0;
- return true;
- }
- if(strcmp("phone", item, true) == 0)
- {
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid, "You do not have a phone.");
- if(IsPhoneRinging[playerid] == 1) return SysMsg(playerid,"You cannot store your phone while it is ringing.");
- if(CallerID[playerid] != -1 || CallerService[playerid] != -1) return SysMsg(playerid,"You cannot store your phone while you are using it.");
- new phone = PhoneData[playerid][pID];
- HouseData[h][StoredPhone] = phone;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE houses SET StoredPhone = %i WHERE id = %i", phone, HouseData[h][HouseSQLID]);
- mysql_tquery(conn, mquery);
- ClearPhoneData(playerid);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhonePossession = 0 WHERE id = %i", phone);
- mysql_tquery(conn, mquery);
- format(gstr, sizeof(gstr),"* %s stores a phone in their house. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid,COLOR_LIGHTRED, "You have stored your phone in your house.");
- return true;
- }
- }
- else return SysMsg(playerid, "You are not in your own house.");
- return true;
- }
- CMD:houseget(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsInHouseID[playerid] == -1) return SysMsg(playerid,"You must be in your own house.");
- new item[10], itemname[20], amount, h = IsInHouseID[playerid];
- if(HouseData[h][HouseOwnerSQLID] == SQLID[playerid])
- {
- if(sscanf(params, "s[10]S()[20]", item, itemname)) return SysMsg(playerid,"Usage: /houseget [item] [amount/name] - Items: Cash, Weapon, Weed, Cocaine, Moonshine, Armour, Phone");
- if(strcmp("Cash", item, true) == 0 || strcmp("Money", item, true) == 0)
- {
- if(sscanf(params, "s[10]s[20]", item, itemname)) return SysMsg(playerid,"Usage: /houseget Cash [amount $]");
- if(!IsNumeric(itemname)) return SysMsg(playerid,"Amount must be a number.");
- amount = strval(itemname);
- if(amount < 1) return SysMsg(playerid,"Amount of Cash must be greater than zero.");
- if(amount > HouseData[h][StoredCash]) return SysMsg(playerid,"You don't have that much Cash stored in the house.");
- HouseData[h][StoredCash] -= amount;
- GivePlayerCash(playerid, amount);
- MySQLUpdateInt(HouseData[h][HouseSQLID], "StoredCash", HouseData[h][StoredCash], "houses");
- format(gstr, sizeof(gstr),"* %s gets some money from their house. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"You got $%s from your house.", format_cash(amount));
- SendClientMessage(playerid,COLOR_LIGHTRED,gstr);
- format(gstr, sizeof(gstr),"[%s] %s(%i) gets $%i from their house ID %i. (Total: $%i)", GetServerTimeString(), NameEx(playerid), playerid, amount, h, Cash[playerid]);
- return true;
- }
- if(strcmp("Weapon", item, true) == 0 || strcmp("Gun", item, true) == 0)
- {
- if(sscanf(params, "s[10]s[20]", item, itemname)) return SysMsg(playerid,"Usage: /houseget Weapon [name of weapon]");
- new wid = GetWeaponIdFromName(itemname);
- if(wid == -1) return SysMsg(playerid,"Invalid Weapon Name.");
- if(wid < 1 || wid > 47) return SysMsg(playerid,"Invalid Weapon.");
- if(wid == 19 || wid == 20 || wid == 21) return SysMsg(playerid,"Invalid Weapon.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM weapons WHERE WeaponID = %i AND HouseID = %i AND Deleted = 0 AND Dropped = 0", wid, HouseData[h][HouseSQLID]);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() == 0)
- {
- SysMsg(playerid, "That weapon is not stored in your house.");
- cache_delete(result);
- return true;
- }
- if(!WeaponCheck(playerid, wid)) return SysMsg(playerid, "You cannot get this weapon. You either have two sidearms or one primary weapon plus a sidearm on your person.");
- new Slot = GetWeaponSlot(wid);
- if(WeaponData[playerid][Slot][Weapon] == wid) return SysMsg(playerid,"You already have that weapon.");
- if(cache_num_rows())
- {
- WeaponData[playerid][Slot][WeaponID] = cache_get_field_content_int(0, "id");
- WeaponData[playerid][Slot][WeaponTimestamp] = cache_get_field_content_int(0, "Timestamp");
- WeaponData[playerid][Slot][wCreatorSQLID] = cache_get_field_content_int(0, "CreatorSQLID");
- WeaponData[playerid][Slot][Weapon] = cache_get_field_content_int(0, "WeaponID");
- WeaponData[playerid][Slot][wOwnerSQLID] = cache_get_field_content_int(0, "OwnerSQLID");
- WeaponData[playerid][Slot][WeaponAmmo] = cache_get_field_content_int(0, "WeaponAmmo");
- WeaponData[playerid][Slot][WeaponType] = GetWeaponType(WeaponData[playerid][Slot][Weapon]);
- WeaponData[playerid][Slot][WeaponOrigin] = cache_get_field_content_int(0, "WeaponOrigin");
- WeaponData[playerid][Slot][WeaponPossession] = cache_get_field_content_int(0, "WeaponPossession");
- }
- cache_delete(result);
- SyncPlayerWeapons(playerid);
- SetPlayerArmedWeapon(playerid, wid);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET WeaponPossession = 1, HouseID = -1, OwnerSQLID = %i WHERE id = %i", SQLID[playerid], WeaponData[playerid][Slot][WeaponID]);
- mysql_pquery(conn, mquery);
- format(gstr, sizeof(gstr),"* %s gets a %s from their house. *",NameRP(playerid),GetWeaponNameFromID(wid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"You got a %s and %i ammo from your house.",GetWeaponNameFromID(wid), WeaponData[playerid][Slot][WeaponAmmo]);
- SendClientMessage(playerid,COLOR_LIGHTRED,gstr);
- return true;
- }
- if(strcmp("Weed", item, true) == 0)
- {
- if(sscanf(params, "s[10]s[20]", item, itemname)) return SysMsg(playerid,"Usage: /houseget Weed [amount]");
- if(!IsNumeric(itemname)) return SysMsg(playerid,"Amount must be a number.");
- amount = strval(itemname);
- if(amount < 1) return SysMsg(playerid,"Amount of Weed must be greater than zero.");
- if(amount > HouseData[h][StoredWeed]) return SysMsg(playerid,"You don't have that much Weed stored in the house.");
- if(Inventory[playerid][Weed] + amount > DRUG_MAX_WEED) return SysMsg(playerid,"You can't carry that much Weed.");
- HouseData[h][StoredWeed] -= amount;
- Inventory[playerid][Weed] += amount;
- MySQLUpdateInt(HouseData[h][HouseSQLID], "StoredWeed", HouseData[h][StoredWeed], "houses");
- MySQLUpdateInt(SQLID[playerid], "Weed", Inventory[playerid][Weed], "players");
- format(gstr, sizeof(gstr),"* %s gets some Weed from their house. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"You got %ig of Weed from your house. You now have %ig in your inventory.", amount, Inventory[playerid][Weed]);
- SendClientMessage(playerid,COLOR_LIGHTRED,gstr);
- return true;
- }
- if(strcmp("Cocaine", item, true) == 0)
- {
- if(sscanf(params, "s[10]s[20]", item, itemname)) return SysMsg(playerid,"Usage: /houseget Cocaine [amount]");
- if(!IsNumeric(itemname)) return SysMsg(playerid,"Amount must be a number.");
- amount = strval(itemname);
- if(amount < 1) return SysMsg(playerid,"Amount of Cocaine must be greater than zero.");
- if(amount > HouseData[h][StoredCocaine]) return SysMsg(playerid,"You don't have that much Cocaine stored in the house.");
- if(Inventory[playerid][Cocaine] + amount > DRUG_MAX_COCAINE) return SysMsg(playerid,"You can't carry that much Cocaine.");
- HouseData[h][StoredCocaine] -= amount;
- Inventory[playerid][Cocaine] += amount;
- MySQLUpdateInt(HouseData[h][HouseSQLID], "StoredCocaine", HouseData[h][StoredCocaine], "houses");
- MySQLUpdateInt(SQLID[playerid], "Cocaine", Inventory[playerid][Cocaine], "players");
- format(gstr, sizeof(gstr),"* %s gets some Cocaine from their house. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"You got %ig of Cocaine from your house. You now have %ig in your inventory.", amount, Inventory[playerid][Cocaine]);
- SendClientMessage(playerid,COLOR_LIGHTRED,gstr);
- return true;
- }
- if(strcmp("MoonShine", item, true) == 0)
- {
- if(sscanf(params, "s[10]s[20]", item, itemname)) return SysMsg(playerid,"Usage: /houseget MoonShine [amount]");
- if(!IsNumeric(itemname)) return SysMsg(playerid,"Amount must be a number.");
- amount = strval(itemname);
- if(amount < 1) return SysMsg(playerid,"Amount of MoonShine must be greater than zero.");
- if(amount > HouseData[h][StoredMoonShine]) return SysMsg(playerid,"You don't have that much MoonShine stored in the house.");
- if(Inventory[playerid][MoonShine] + amount > DRUG_MAX_MOONSHINE) return SysMsg(playerid,"You can't carry that much MoonShine.");
- HouseData[h][StoredMoonShine] -= amount;
- Inventory[playerid][MoonShine] += amount;
- MySQLUpdateInt(HouseData[h][HouseSQLID], "StoredMoonShine", HouseData[h][StoredMoonShine], "houses");
- MySQLUpdateInt(SQLID[playerid], "MoonShine", Inventory[playerid][MoonShine], "players");
- format(gstr, sizeof(gstr),"* %s gets some MoonShine from their house. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"You got %i L of MoonShine from your house. You now have %i L in your inventory.", amount, Inventory[playerid][MoonShine]);
- SendClientMessage(playerid,COLOR_LIGHTRED,gstr);
- return true;
- }
- if(strcmp("armour", item, true) == 0 || strcmp("armor", item, true) == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id, ArmorType, ArmorAmount FROM storedarmor WHERE HouseID = %i", HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery, "ShowStoredArmor", "dd", playerid, 1);
- return true;
- }
- if(strcmp("phone", item, true) == 0)
- {
- if(Inventory[playerid][MobilePhone] == 1) return SysMsg(playerid, "You already have a phone in your inventory.");
- if(HouseData[h][StoredPhone] == 0) return SysMsg(playerid, "This house does not have a phone stored in it");
- format(gstr, sizeof(gstr),"* %s gets a phone from their house. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid,COLOR_LIGHTRED, "You have taken a phone out from your house.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhonePossession = 1, PhonePossessor = %i WHERE id = %i", SQLID[playerid], HouseData[h][StoredPhone]);
- mysql_tquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE houses SET StoredPhone = 0 WHERE id = %i", HouseData[h][HouseSQLID]);
- mysql_tquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM phones WHERE id = %i AND PhonePossession = 1", HouseData[h][StoredPhone]);
- mysql_tquery(conn, mquery, "LoadPlayerPhone", "d", playerid);
- HouseData[h][StoredPhone] = 0;
- return true;
- }
- }
- else return SysMsg(playerid, "You are not in your house.");
- return true;
- }
- CMD:houseview(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsInHouseID[playerid] == -1) return SysMsg(playerid,"You must be in your own house.");
- new h = IsInHouseID[playerid];
- if(HouseData[h][HouseOwnerSQLID] == SQLID[playerid])
- {
- SendClientMessageF(playerid, COLOR_LIGHTGREEN, "House Inventory: $%s, %ig weed, %ig cocaine, %iL moonshine", format_cash(HouseData[h][StoredCash]), HouseData[h][StoredWeed], HouseData[h][StoredCocaine], HouseData[h][StoredMoonShine]);
- if(HouseData[h][StoredPhone] >= 1) SendClientMessage(playerid, COLOR_LIGHTGREEN, "There is a mobile phone stored in this house.");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Use /houseviewguns to view the weapons inside your house. Use /houseget armor to see the armor in your house.");
- return true;
- }
- SysMsg(playerid, "You are not in your house.");
- return true;
- }
- CMD:houseviewguns(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsInHouseID[playerid] == -1) return SysMsg(playerid,"You must be in your own house.");
- new h = IsInHouseID[playerid];
- if(HouseData[h][HouseOwnerSQLID] == SQLID[playerid])
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,WeaponID,WeaponAmmo FROM weapons WHERE WeaponPossession = 0 AND HouseID = %i AND Deleted = 0 AND TrunkID = -1 AND FCarID = -1 AND Dropped = 0", HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery, "ShowHouseGuns", "d", playerid);
- return true;
- }
- else SysMsg(playerid, "You are not in your house.");
- return true;
- }
- //House furniture commands
- CMD:guestfurnish(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(GetPlayerHouseCount(playerid) == 0) return SysMsg(playerid, "You do not own a house.");
- new id, playa = -1;
- if(sscanf(params, "iu", id, playa))
- {
- for(new x = 0; x < MAX_HOUSE_PER_PLAYER; x++)
- {
- if(HasHouseKey[playerid][x] != -1)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "House ID: %i - %s", x, HouseData[HasHouseKey[playerid][x]][HouseDescription]);
- }
- }
- return SysMsg(playerid, "Usage: /guestfurnish [House ID] [player id or name]");
- }
- if(playa == playerid) return SysMsg(playerid, "Cannot be yourself.");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(id != 0 && id != 1) return SysMsg(playerid, "Invalid house.");
- if(HasHouseKey[playerid][id] == -1) return SysMsg(playerid, "You do not have a house in this slot.");
- if(EditingHouseFurn[playa] != -1) return SysMsg(playerid, "This player is already furnishing a house.");
- new h = HasHouseKey[playerid][id];
- EditingHouseFurn[playa] = HouseData[h][HouseSQLID];
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET GuestFurnish = %i WHERE id = %i", HouseData[h][HouseSQLID], SQLID[playa]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_WHITE, "You have given %s access to furnish your house. (%s)", NameEx(playa), HouseData[h][HouseDescription]);
- SendClientMessageF(playa, COLOR_WHITE, "%s has given you access to furnish their house. (%s)", NameEx(playerid), HouseData[h][HouseDescription]);
- SendClientMessage(playa, COLOR_WHITE, "You can remove your access at any time by using /stopguestfurnish.");
- return true;
- }
- CMD:stopguestfurnish(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(EditingHouseFurn[playerid] == -1) return SysMsg(playerid, "You are not editing the house furniture of another house.");
- SendClientMessageF(playerid, COLOR_WHITE, "You no longer have access to furnish %s.", HouseData[GetHouseArrayFromID(EditingHouseFurn[playerid])][HouseDescription]);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET GuestFurnish = -1 WHERE id = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery);
- EditingHouseFurn[playerid] = -1;
- return true;
- }
- CMD:revokefurnish(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(GetPlayerHouseCount(playerid) == 0) return SysMsg(playerid,"You don't have a house.");
- new id, name[MAX_PLAYER_NAME+1];
- if(sscanf(params, "is[25]", id, name))
- {
- for(new x = 0; x < MAX_HOUSE_PER_PLAYER; x++)
- {
- if(HasHouseKey[playerid][x] != -1)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "House ID: %i - %s", x, HouseData[HasHouseKey[playerid][x]][HouseDescription]);
- }
- }
- return SysMsg(playerid, "Usage: /revokefurnish [House ID from above] [Full_Name] *use /viewguestfurnishers to view current guests.*");
- }
- if(id != 0 && id != 1) return SysMsg(playerid, "Invalid house.");
- if(HasHouseKey[playerid][id] == -1) return SysMsg(playerid, "You do not have a house in this slot.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,Online FROM players WHERE Name = '%e' AND GuestFurnish = %i", name, HouseData[HasHouseKey[playerid][id]][HouseSQLID]);
- mysql_pquery(conn, mquery, "ProcessFurnishRevoke", "iis", playerid, id, name);
- return true;
- }
- GREENSIDE::ProcessFurnishRevoke(playerid, houseid, name[])
- {
- if(!cache_num_rows()) return SysMsg(playerid, "This user does not have furniture access in your home.");
- new id, online;
- id = cache_get_field_content_int(0, "id");
- online = cache_get_field_content_int(0, "Online");
- if(online == 1)
- {
- foreach(new i: Player)
- {
- if(SQLID[i] == id)
- {
- EditingHouseFurn[i] = -1;
- SendClientMessageF(i, COLOR_WHITE, "%s has revoked your permission to edit their house furniture. (%s)", NameEx(playerid), HouseData[houseid][HouseDescription]);
- }
- }
- }
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET GuestFurnish = -1 WHERE id = %i", id);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_WHITE, "You have revoked %s's permission to edit your house furniture.", name);
- return true;
- }
- CMD:viewguestfurnishers(playerid, params[])
- {
- if(isnull(params) || !IsNumeric(params))
- {
- for(new x = 0; x < MAX_HOUSE_PER_PLAYER; x++)
- {
- if(HasHouseKey[playerid][x] != -1)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "House ID: %i - %s", x, HouseData[HasHouseKey[playerid][x]][HouseDescription]);
- }
- }
- return SysMsg(playerid, "Usage: /viewguestfurnishers [House ID from above]");
- }
- if(strval(params) != 0 && strval(params) != 1) return SysMsg(playerid, "Invalid house.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Name FROM players WHERE GuestFurnish = %i", HouseData[HasHouseKey[playerid][strval(params)]][HouseSQLID]);
- mysql_pquery(conn, mquery, "ViewHouseFurnishers", "i", playerid);
- return true;
- }
- GREENSIDE::ViewHouseFurnishers(playerid)
- {
- if(!cache_num_rows()) return SysMsg(playerid, "You do not have any guests furnishing this house.");
- gstr[0] = EOS;
- new name[MAX_PLAYER_NAME+1];
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "Name", name);
- format(tgstr, sizeof(tgstr), "%s\n", name);
- strcat(gstr, tgstr);
- }
- Dialog_Show(playerid, DIALOG_NONE, DIALOG_STYLE_LIST, "Guest House Furnishers", gstr, "Neat!", "");
- return true;
- }
- CMD:payfurn(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params) || IsNumeric(params)) return SysMsg(playerid, "Usage: /payfurn ['Cash' or 'Bank'] *This will change where you're charged from when buying new furniture.*");
- if(strcmp("bank", params, true) == 0)
- {
- BuyFurnFrom[playerid] = 0;
- SysMsg(playerid, "Money will now be taken from your bank account when you purchase furniture.");
- }
- else if(strcmp("cash", params, true) == 0)
- {
- BuyFurnFrom[playerid] = 1;
- SysMsg(playerid, "Money will now be taken from your in-hand cash when you purchase furniture.");
- }
- else cmd_payfurn(playerid, "");
- return true;
- }
- CMD:addobj(playerid, params[])
- {
- if(!IsPlayerAdminLevelOK(playerid, 5)) return SysMsg(playerid, AUTHMSG);
- new modelid, objname[51], price, category, subcategory;
- if(sscanf(params, "is[51]iii", modelid, objname, price, category, subcategory)) return SendClientMessage(playerid, -1, "Use /AddObj [Modelo] [Nome_do_objeto] [Preço] [Categoria] [Subcategoria].");
- new Query[300];
- for(new i; i != 51; i++) { if(objname[i] == '_') { objname[i] = ' '; } }
- mysql_format(conn, Query, 300, "INSERT INTO furniture (Model, Name, Price, Category, SubCategory) VALUES (%i, '%s', %i, %i, %i)", modelid, objname, price, category, subcategory);
- mysql_query(conn, Query, false);
- new jbstring[144];
- format(jbstring, 144, "Objeto '%s' adicionado:", objname);
- SendClientMessage(playerid, -1, jbstring);
- format(jbstring, 144, "Modelo: %i | Preço: %i | Categoria: %i | Subcategoria: %i", modelid, price, category, subcategory);
- SendClientMessage(playerid, -1, jbstring);
- return 1;
- }
- CMD:buyf(playerid, params[])
- {
- if(!CanFurnishHouse(playerid, IsInHouseID[playerid])) return SysMsg(playerid, "You must be inside your own home to use this command.");
- if(BuyFurnFrom[playerid] == -1) return SysMsg(playerid, "Use /pagarfurniture to determine where the purchased furniture will be charged.");
- if(GetFreeHouseFurnitureForHouse(playerid) >= GetMaxFurnitureForPlayer(playerid)) return SysMsgF(playerid, "You have reached the %i furniture and can not buy more.",GetMaxFurnitureForPlayer(playerid));
- if(PlayerBuyFurniture[playerid][0] != INVALID_OBJECT_ID || PlayerPlaceFurniture[playerid] != INVALID_OBJECT_ID) return SysMsg(playerid, "You are already editing an object.");
- if(isnull(params)) return Dialog_Show(playerid, FurniturePurchase, DIALOG_STYLE_LIST, "Select a category of furniture", GetHouseCategoryList(), "Select", "Cancel");
- for(new x = 0; x < MAX_FURNITURE; x++)
- {
- if(strmatch(FurniData[x][fuName], params))
- {
- if(BuyFurnFrom[playerid] == 1)
- {
- if(Cash[playerid] < FurniData[x][fPrice]) return SysMsg(playerid, "You do not have the money needed for this item.");
- }
- else
- {
- if(BankBalance[playerid] < FurniData[x][fPrice]) return SysMsg(playerid, "You do not have the money needed for this item.");
- }
- for(new slot = 0; slot < GetMaxFurnitureForPlayer(playerid); slot++)
- {
- if(HouseData[IsInHouseID[playerid]][FurnModel][slot] == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO hfurniture (Model,Placed,Xpos,Ypos,Zpos,Xrot,Yrot,Zrot,HouseSQLID) VALUES (%i,0,0.0,0.0,0.0,0.0,0.0,0.0,%i)",
- FurniData[x][fModel], HouseData[IsInHouseID[playerid]][HouseSQLID]);
- mysql_pquery(conn, mquery, "InsertHouseFurni", "dd", playerid, slot);
- new h = IsInHouseID[playerid];
- HouseData[h][FurnObject][slot] = 0;
- HouseData[h][FurnModel][slot] = FurniData[x][fModel];
- HouseData[h][FurnPlaced][slot] = 0;
- if(BuyFurnFrom[playerid] == 0) //take money from the player's bank
- {
- BankBalance[playerid] -= FurniData[x][fPrice];
- mysql_pqueryf(conn, "UPDATE players SET Bank = %i WHERE id = %i", BankBalance[playerid], SQLID[playerid]);
- }
- else GivePlayerCash(playerid, -FurniData[x][fPrice]); //take money from their wallet.
- break;
- }
- }
- SendClientMessageF(playerid, COLOR_WHITE, "You bought {BCDCBC}%s{FFFFFF} per {BCDCBC}$%i{FFFFFF}.", params, FurniData[x][fPrice]);
- return true;
- }
- }
- SysMsg(playerid, "Could not find a furniture object with that name.");
- return true;
- }
- CMD:selecionarf(playerid, params[]) return cmd_selectfurniture(playerid, params);
- CMD:selectfurniture(playerid, params[])
- {
- if(!Logged{playerid} || PlayerBuyFurniture[playerid][0] != INVALID_OBJECT_ID) return true;
- if(!CanFurnishHouse(playerid, IsInHouseID[playerid])) return SysMsg(playerid,"Você deve estar em sua própria casa para usar esse recurso.");
- SelectObject(playerid);
- return true;
- }
- CMD:selecionarlista(playerid, params[]) return cmd_selectflist(playerid, params);
- CMD:selectflist(playerid, params[])
- {
- if(!Logged{playerid} || PlayerBuyFurniture[playerid][0] != INVALID_OBJECT_ID) return true;
- if(!CanFurnishHouse(playerid, IsInHouseID[playerid])) return SysMsg(playerid,"You must be in your own house to use this feature.");
- new Float:dist;
- if(sscanf(params, "f", dist)) return SysMsg(playerid, "Usgae: /selectflist [radius]");
- if(dist <= 0.0) return SysMsg(playerid, "Distance must be greater than 0.");
- new count = 0, mfurniture[MAX_HFURNITURE], desc[MAX_HFURNITURE][32], h = IsInHouseID[playerid], Float:x, Float:y, Float:z;
- for(new f = 0; f < MAX_HFURNITURE; f++)
- {
- if(HouseData[h][FurnModel][f] > 0 && HouseData[h][FurnPlaced][f] == 1)
- {
- GetDynamicObjectPos(HouseData[h][FurnObject][f], x, y, z);
- if(IsPlayerInRangeOfPoint(playerid, dist, x, y, z))
- {
- mfurniture[count] = HouseData[h][FurnModel][f];
- format(desc[count], 32, "%s", GetHouseFurnitureName(HouseData[h][FurnModel][f]));
- count++;
- }
- }
- }
- if(count > 0)
- {
- ShowModelSelectionMenu(playerid, "Select Furniture", MODEL_SELECTION_SFURNITURE, mfurniture, count, 0.0, 0.0, 90.0);
- SFRadius[playerid] = dist;
- }
- else SysMsg(playerid, "You are not close enough to any item.");
- return true;
- }
- CMD:colocarf(playerid, params[]) return cmd_placefurniture(playerid, params);
- CMD:placefurniture(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!CanFurnishHouse(playerid, IsInHouseID[playerid])) return SysMsg(playerid,"You should be in your own home to put furniture.");
- new count = 0, mfurniture[MAX_HFURNITURE], desc[MAX_HFURNITURE][64];
- for(new i = 0; i < MAX_HFURNITURE; i++)
- {
- if(HouseData[IsInHouseID[playerid]][FurnModel][i] > 0 && HouseData[IsInHouseID[playerid]][FurnPlaced][i] == 0)
- {
- mfurniture[count] = HouseData[IsInHouseID[playerid]][FurnModel][i];
- format(desc[count], 64, "%s", GetHouseFurnitureName(HouseData[IsInHouseID[playerid]][FurnModel][i]));
- count++;
- }
- }
- if(count > 0) ShowModelSelectionMenu(playerid, "To put furniture", MODEL_SELECTION_FURNITURE, mfurniture, count, 0.0, 0.0, 50.0);
- //ShowMessage(playerid,"inventário da casa","Você Não tem nenhum item no invenrário da casa.", "OK");
- return true;
- }
- CMD:removef(playerid, params[]) return cmd_removefurniture(playerid, params);
- CMD:removefurniture(playerid, params[])//apagar do inventário
- {
- if(!Logged{playerid}) return true;
- if(!CanFurnishHouse(playerid, IsInHouseID[playerid])) return SysMsg(playerid,"You should be in your own home for remote furniture.");
- new count = 0, mfurniture[MAX_HFURNITURE], desc[MAX_HFURNITURE][64];
- for(new i = 0; i < MAX_HFURNITURE; i++)
- {
- if(HouseData[IsInHouseID[playerid]][FurnModel][i] > 0 && HouseData[IsInHouseID[playerid]][FurnPlaced][i] == 0)
- {
- mfurniture[count] = HouseData[IsInHouseID[playerid]][FurnModel][i];
- format(desc[count], 64, "%s", GetHouseFurnitureName(HouseData[IsInHouseID[playerid]][FurnModel][i]));
- count++;
- }
- }
- if(count > 0) ShowModelSelectionMenu(playerid, "Remove Furniture", MODEL_REMOVE_FURNITURE, mfurniture, count, 0.0, 0.0, 90.0);
- //ShowMessage(playerid,"House Item Inventory","You do not have any unplaced items to throw out.", "OK");
- return true;
- }
- CMD:removeallf(playerid, params[]) return cmd_removeallfurniture(playerid, params);
- CMD:removeallfurniture(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!CanFurnishHouse(playerid, IsInHouseID[playerid])) return SysMsg(playerid,"You should be in your own home to remove furniture.");
- new count = 0;
- for(new i = 0; i < MAX_HFURNITURE; i++)
- {
- if(HouseData[IsInHouseID[playerid]][FurnModel][i] > 0 && HouseData[IsInHouseID[playerid]][FurnPlaced][i] == 0)
- {
- count = 1;
- break;
- }
- }
- if(count == 1) Dialog_Show(playerid, FurnitureRemoveAll, DIALOG_STYLE_MSGBOX, "Furniture", "Are you sure you want to discard all your unplaced furniture?\nThe furniture that is already placed inside your home is not affected.", "Yes", "Nevermind");
- else ShowMessage(playerid,"House item inventory", "You do not have unposted items to throw away.", "OK");
- return true;
- }
- CMD:pickupallf(playerid, params[]) return cmd_pickupallfurniture(playerid, params);
- CMD:pickupallfurniture(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!CanFurnishHouse(playerid, IsInHouseID[playerid])) return SysMsg(playerid,"You should be in your own home to pick up furniture.");
- new count = 0;
- for(new i = 0; i < MAX_HFURNITURE; i++)
- {
- if(HouseData[IsInHouseID[playerid]][FurnModel][i] > 0 && HouseData[IsInHouseID[playerid]][FurnPlaced][i] == 1)
- {
- count = 1;
- break;
- }
- }
- if(count == 1) Dialog_Show(playerid, FurniturePickupAll, DIALOG_STYLE_MSGBOX, "Furniture", "Are you sure you want to store all furniture in your place?\nYou can then put them back using /placefurniture.", "Yes", "Nevermind");
- else ShowMessage(playerid,"House item inventory", "You have no items placed to save.", "OK");
- return true;
- }
- CMD:frickedf(playerid)
- {
- if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
- new Float:x, Float:y, Float:z, count = 0;
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- for(new f = 0; f < MAX_HFURNITURE; f++)
- {
- if(HouseData[h][FurnPlaced][f] == 1)
- {
- GetDynamicObjectPos(HouseData[h][FurnObject][f], x, y, z);
- if(IsPointInRangeOfPoint(x, y, z, 0.0, 0.0, 0.0, 10.0))
- {
- count ++;
- }
- }
- }
- }
- printf("%i", count);
- return true;
- }
- CMD:reloadoutdoorfurniture(playerid)
- {
- if(!Logged{playerid}) return true;
- new h = GetHouseForExteriorEdit(playerid);
- if(h == -1) return SysMsg(playerid, "We could not find a house exterior for you to edit.");
- for(new f = 0; f < MAX_EHFURNITURE; f++)
- {
- if(EFurnData[h][EFurnPlaced][f])
- {
- if(EFurnData[h][EFurnObject][f] != INVALID_OBJECT_ID) DestroyDynamicObjectEx(EFurnData[h][EFurnObject][f], "EFurnData[h][EFurnObject][f]");
- EFurnData[h][EFurnObject][f] = INVALID_OBJECT_ID;
- EFurnData[h][EFurnPlaced][f] = false;
- EFurnData[h][EFurnSQLID][f] = 0;
- EFurnData[h][EFurnModel][f] = 0;
- }
- }
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM efurniture WHERE HouseSQLID = %i", HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery, "LoadExteriorHouseFurniture");
- return true;
- }
- CMD:reloadmyfurniture(playerid, params[])
- {
- if(!CanFurnishHouse(playerid, IsInHouseID[playerid])) return SysMsg(playerid,"You must be in your own house.");
- new b = IsInHouseID[playerid];
- foreach(new i: Player)
- {
- if(PlayerPlaceFurniture[i] != INVALID_OBJECT_ID || PlayerEditFurniture[i] != INVALID_OBJECT_ID || PlayerBuyFurniture[i][0] != INVALID_OBJECT_ID)
- {
- if(IsInHouseID[i] == IsInHouseID[playerid] && i != playerid)
- {
- return SysMsg(playerid, "Somebody in your house is editing or buying house furniture, as such you may not reload furniture until they're done.");
- }
- }
- }
- if(HouseData[b][InsideID] == 31) //warehouse int
- {
- //freeze the player for 3 seconds
- TogglePlayerControllable(playerid, false);
- TeleportTimer[playerid] = 3;
- BeingTeleported{playerid} = true;
- }
- for(new f = 0; f < MAX_HFURNITURE; f++)
- {
- if(HouseData[b][FurnObject][f] != INVALID_OBJECT_ID)
- {
- DestroyDynamicObjectEx(HouseData[b][FurnObject][f], "HouseData[b][FurnObject][f] 1");
- }
- HouseData[b][FurnSQLID][f] = 0;
- HouseData[b][FurnModel][f] = 0;
- HouseData[b][FurnPlaced][f] = 0;
- HouseData[b][FurnObject][f] = INVALID_OBJECT_ID;
- HouseData[b][DoorOpen][f] = false;
- HouseData[b][DoorLocked][f] = false;
- for(new i = 0; i < MAX_TEXTURESLOTS; i++)
- {
- FurnitureIndex[b][f][i] = -1;
- }
- }
- for(new w = 0; w < MAX_WEED_PLANTS; w++)
- {
- WeedData[b][PlantGrowth][w] = 0;
- WeedData[b][PlantWater][w] = 0;
- WeedData[b][PlantPotObj][w] = INVALID_OBJECT_ID;
- WeedData[b][PlantSQLID][w] = 0;
- WeedData[b][PlantFurnIndex][w] = 0;
- }
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM hfurniture WHERE HouseSQLID = %i LIMIT %i", HouseData[b][HouseSQLID], MAX_HFURNITURE);
- mysql_tquery(conn, mquery, "LoadHouseFurniture");
- SendClientMessage(playerid, COLOR_WHITE, "You have {44C300}reloaded{FFFFFF} your house furniture.");
- Streamer_Update(playerid);
- return true;
- }
- CMD:reloadfurniture(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
- for(new x = 0; x < MAX_FURNITURE; x++)
- {
- FurniData[x][fuName][0] = 0;
- FurniData[x][fModel] = 0;
- FurniData[x][fPrice] = 0;
- FurniData[x][fSubCategory] = 0;
- }
- mysql_pquery(conn, "SELECT * FROM furniture ORDER BY Name ASC", "LoadFurniture", "");
- SendClientMessage(playerid, COLOR_WHITE, "Você {44C300}recarregou{FFFFFF} todos os objetos.");
- return true;
- }
- CMD:updatef(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET insideid = %i WHERE HouseSQLID = %i", HouseData[h][InsideID], HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery);
- }
- SendClientMessage(playerid, COLOR_RED, "Inside ID's updated.");
- return true;
- }
- CMD:emptyfurniture(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return true;
- mysql_pquery(conn, "SELECT HouseSQLID FROM hfurniture GROUP BY HouseSQLID", "ProcessFurnitureEmpty");
- return true;
- }
- CMD:furniturelimite(playerid, params[])
- {
- SendClientMessageF(playerid, COLOR_GREY, "Your furniture limit is %i. You can find out more about the limits of furniture by viewing the donation page on the website.", GetMaxFurnitureForPlayer(playerid));
- return true;
- }
- CMD:furnitureconta(playerid, params[])
- {
- if(IsInHouseID[playerid] == -1) return SysMsg(playerid,"You must be in a house to use this feature.");
- new h = IsInHouseID[playerid];
- if(!CanFurnishHouse(playerid, h)) return SysMsg(playerid, "You must be in a house that you can provide to use this command.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM hfurniture WHERE HouseSQLID = %i", HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery, "ShowFurnitureCount", "d", playerid);
- return true;
- }
- //end of house and furniture cmds
- //==================== Fim ==================================//
- //8 business commands
- //business commands
- CMD:makebizz(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
- new Float:X,Float:Y,Float:Z, NewBizzCost, NewPayout, Description[50], bType;
- if(sscanf(params, "iiis[50]", NewBizzCost, bType, NewPayout, Description)) return SysMsg(playerid,"Usage: /makebizz [cost] [type] [payout] [desc]");
- if(NewBizzCost < 1) return SysMsg(playerid,"Cost must be > 0");
- if(NewPayout < 1) return SysMsg(playerid,"Invalid Payout.");
- if(bType < 0 || bType > 22) return SysMsg(playerid, "Invalid Type");
- GetPlayerPos(playerid,X,Y,Z);
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO bizz (Description,oPosX,oPosY,oPosZ) VALUES ('%e',%f,%f,%f)", Description,X,Y,Z);
- mysql_pquery(conn, mquery, "InsertNewBusiness", "iiii", playerid, NewBizzCost, NewPayout, bType);
- return true;
- }
- CMD:editbizz(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
- new bizzid = -1;
- for(new b = 0; b < MAX_BIZZ; b++)
- {
- if(IsPlayerInRangeOfPoint(playerid,4.5,BizzData[b][oPosX],BizzData[b][oPosY],BizzData[b][oPosZ]))
- {
- bizzid = b;
- break;
- }
- }
- if(bizzid == -1) return SysMsg(playerid,"You are not near any bizz.");
- new element[10], value;
- if(sscanf(params, "s[10]IS", element)) return SysMsg(playerid,"Usage: /editbizz [element] [value] Elements: Cost, Owner, Payout, Redo, Name");
- if(strcmp("cost", element, true) == 0)
- {
- if(sscanf(params, "s[10]i", element, value)) return SysMsg(playerid,"Usage: /editbizz Cost [value]");
- if(value < 1) return SysMsg(playerid,"Cost must be > 0");
- MySQLUpdateInt(BizzData[bizzid][BizzSQLID], "Price", value, "bizz");
- BizzData[bizzid][BizzPrice] = value;
- SysMsgF(playerid, "Bizz Price Is Now $%i.", BizzData[bizzid][BizzPrice]);
- format(gstr, sizeof(gstr), "Edited bizz #%i price to $%i", BizzData[bizzid][BizzSQLID], value);
- AdminLog(playerid, 0, "", gstr);
- return true;
- }
- else if(strcmp("payout", element, true) == 0)
- {
- if(sscanf(params, "s[10]i", element, value)) return SysMsg(playerid,"Usage: /editbizz Payout [value]");
- if(value < 1) return SysMsg(playerid,"New Payout must be greater than 0.");
- MySQLUpdateInt(BizzData[bizzid][BizzSQLID], "Payout", value, "bizz");
- BizzData[bizzid][Payout] = value;
- SysMsgF(playerid, "Bizz Payout Is Now $%i.", BizzData[bizzid][Payout]);
- format(gstr, sizeof(gstr), "Edited bizz #%i payout to $%i", BizzData[bizzid][BizzSQLID], value);
- AdminLog(playerid, 0, "", gstr);
- return true;
- }
- else if(strcmp("redo", element, true) == 0)
- {
- if(sscanf(params, "s[10]i", element, value)) return SysMsg(playerid,"Usage: /editbizz Redo [bizz type]");
- if(value < 0) return SysMsg(playerid,"New Bizz Type must >= 0.");
- new Float:pPos[3];
- GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
- BizzData[bizzid][oPosX] = pPos[0];
- BizzData[bizzid][oPosY] = pPos[1];
- BizzData[bizzid][oPosZ] = pPos[2];
- BizzData[bizzid][BizzType] = value;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE bizz SET oPosX=%f, oPosY=%f, oPosZ=%f, BizzType = %i WHERE id=%i", pPos[0], pPos[1], pPos[2], BizzData[bizzid][BizzType], BizzData[bizzid][BizzSQLID]);
- mysql_pquery(conn, mquery);
- DestroyDynamicPickup(BizzData[bizzid][BizzPickup]);
- BizzData[bizzid][BizzPickup] = CreateDynamicPickup(1272,23,BizzData[bizzid][oPosX],BizzData[bizzid][oPosY],BizzData[bizzid][oPosZ], -1, -1, -1, 10);
- UpdateBizzLabel(bizzid);
- SysMsgF(playerid, "Bizz Type Is Now %i And XYZ Updated.", BizzData[bizzid][BizzType]);
- return true;
- }
- else if(strcmp("owner", element, true) == 0)
- {
- new newowner[20];
- if(sscanf(params, "s[10]s[20]", element, newowner)) return SysMsg(playerid,"Usage: /editbizz Owner [value]");
- if(strcmp("None", newowner, true) == 0)
- {
- new i = 0;
- foreach(new p: Player)
- {
- for(i = 0; i < MAX_BIZZ_PER_PLAYER; i++)
- {
- if(PlayerBizzID[p][i] == bizzid)
- {
- PlayerBizzID[p][i] = -1;
- break;
- }
- }
- }
- MySQLUpdateInt(BizzData[bizzid][BizzSQLID], "OwnerSQLID", 0, "bizz");
- BizzData[bizzid][BizzOwnerSQLID] = 0;
- format(gstr, sizeof(gstr), "Edited bizz #%i owner to NONE", bizzid);
- AdminLog(playerid, 0, "", gstr);
- return true;
- }
- new accid = MySQLCheckAccount(newowner, playerid);
- if(accid == 0) return SysMsg(playerid, "No account name found.");
- new posID = GetPlayerID(playerid, newowner);
- new bizzCount = 0;
- if(posID >= 0)
- {
- foreach(new i: Player)
- {
- for(new b = 0; b < MAX_BIZZ_PER_PLAYER; b++)
- {
- if(PlayerBizzID[i][b] == bizzid)
- {
- PlayerBizzID[i][b] = -1;
- }
- }
- }
- for(new i = 0; i < MAX_BIZZ_PER_PLAYER; i++)
- {
- if(PlayerBizzID[posID][i] != -1)
- {
- bizzCount ++;
- }
- }
- if(bizzCount +1 > MAX_BIZZ_PER_PLAYER) return SysMsg(playerid,"That new owner can't have any more businesses.");
- for(new i = 0; i < MAX_BIZZ_PER_PLAYER; i++)
- {
- if(PlayerBizzID[posID][i] == -1)
- {
- PlayerBizzID[posID][i] = bizzid;
- break;
- }
- }
- }
- MySQLUpdateInt(BizzData[bizzid][BizzSQLID], "OwnerSQLID", accid, "bizz");
- BizzData[bizzid][BizzOwnerSQLID] = accid;
- UpdateBizzLabel(bizzid);
- SysMsgF(playerid, "Bizz Owner Is Now %s.", GetSQLName(BizzData[bizzid][BizzOwnerSQLID]));
- format(gstr, sizeof(gstr), "Edited bizz #%i owner to %s", BizzData[bizzid][BizzSQLID], GetSQLName(BizzData[bizzid][BizzOwnerSQLID]));
- AdminLog(playerid, 0, "", gstr);
- return true;
- }
- else if(strcmp("name", element, true) == 0)
- {
- new newname[60];
- if(sscanf(params, "s[10]s[60]", element, newname)) return SysMsg(playerid,"Usage: /editbizz name [value]");
- MySQLUpdateString(BizzData[bizzid][BizzSQLID], "Description", newname, "bizz");
- format(BizzData[bizzid][BizzDescription], 60, newname);
- UpdateBizzLabel(bizzid);
- SysMsgF(playerid, "Bizz Name Is Now %s.", BizzData[bizzid][BizzDescription]);
- format(gstr, sizeof(gstr), "Edited bizz #%i name to %s",BizzData[bizzid][BizzSQLID], BizzData[bizzid][BizzDescription]);
- AdminLog(playerid, 0, "", gstr);
- return true;
- }
- else SysMsg(playerid,"*Usage: /editbizz [element] [value] Elements: Cost, Owner, Payout, Redo, Name");
- return true;
- }
- CMD:badvert(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(AdvertSpamTime[playerid] > 0) return SysMsg(playerid, "Please wait between posting advertisements.");
- if(!AdvertsToggle{playerid}) return SysMsg(playerid, "You can't make an advert as you have adverts disabled.");
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid,"You need a Mobile Phone to send an advert.");
- new b = IsInBizzID[playerid];
- if(b <= 0)
- {
- for(new x = 0; x < MAX_BIZZ; x++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, BizzData[x][oPosX], BizzData[x][oPosY], BizzData[x][oPosZ]))
- {
- b = x;
- break;
- }
- }
- }
- if(b <= 0) return SysMsg(playerid, "You must be standing at a business to use this command.");
- if(BizzData[b][BizzOwnerSQLID] == SQLID[playerid] || IsBizzMod(playerid, b))
- {
- if(isnull(params))
- {
- SysMsg(playerid,"Usage: /badvert [message]");
- SysMsg(playerid,"Example: '/badvert This is a test' will show as: [Business Advert] This is a test [Business Name]");
- return true;
- }
- if(strlen(params) < 30) return SysMsg(playerid, "Your advert is too short. Please be creative and be IC only.");
- new AdCost = strlen(params) * 8;
- if(IsDonator[playerid] < 3)
- {
- GivePlayerCash(playerid, -AdCost);
- AdvertSpamTime[playerid] = 60;
- format(gstr, sizeof(gstr),"You made a business advert %i characters long, costing you $%i ($8/letter).",strlen(params),AdCost);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- else if(IsDonator[playerid] == 3)
- {
- AdCost = AdCost / 2;
- GivePlayerCash(playerid, -AdCost);
- AdvertSpamTime[playerid] = 60;
- format(gstr, sizeof(gstr),"You made a business advert %i characters long, costing you $%i. ($8/letter)",strlen(params),AdCost);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- else if(IsDonator[playerid] == 4)
- {
- AdvertSpamTime[playerid] = 60;
- format(gstr, sizeof(gstr),"You made a business advert %i characters long, costing you $%i. ($8/letter)",strlen(params),AdCost);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- FACTIONS[FACTION_NEWS][FactionBankBalance] += floatround(1 * AdCost);
- MySQLUpdateInt(FACTION_NEWS, "BankBalance", FACTIONS[FACTION_NEWS][FactionBankBalance], "factions");
- format(gstr, sizeof(gstr),"[Business Advert] %s [%s]", params, BizzData[b][BizzDescription]);
- foreach(new i: Player) if(Logged{i} && AdvertsToggle{i}) SendSplitMessage(i, COLOR_GREEN, gstr);
- format(gstr, sizeof(gstr), "[Admin] ^^ Bizz Advert by %s (ID %i)", NameEx(playerid), playerid);
- AdminBroadcast(gstr, 0);
- return true;
- }
- else SysMsg(playerid, "You must own or be a manager of this business to use this command.");
- return true;
- }
- CMD:enterfee(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- for(new h = 0; h < MAX_BIZZ; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.5, BizzData[h][oPosX], BizzData[h][oPosY], BizzData[h][oPosZ]))
- {
- if(BizzData[h][BizzOwnerSQLID] == SQLID[playerid])
- {
- if(BizzData[h][BizzType] == BIZZ_TYPE_STATIC && BizzData[h][IsSpecial] == 0) return SysMsg(playerid,"You can't have an enter fee for this bizz.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /enterfee [amount]");
- if(!IsNumeric(params)) return SysMsg(playerid,"Invalid Amount.");
- if(strval(params) < 0) return SysMsg(playerid,"Invalid Amount, Must be a minimum of $0.");
- if(strval(params) > 25) return SysMsg(playerid,"Invalid Amount, Can only be a maximum of $25.");
- BizzData[h][EnterFee] = strval(params);
- MySQLUpdateInt(BizzData[h][BizzSQLID], "EnterFee", BizzData[h][EnterFee], "bizz");
- SendClientMessageF(playerid, COLOR_LIGHTRED, "The new entrance fee for %s is now $%i.",BizzData[h][BizzDescription], BizzData[h][EnterFee]);
- UpdateBizzLabel(h);
- break;
- }
- }
- }
- return true;
- }
- CMD:bizzmusic(playerid, params[])
- {
- if(IsInBizzID[playerid] == -1) return SysMsg(playerid, "You must be in a business.");
- if(BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] != SQLID[playerid] && !IsBizzMod(playerid, IsInBizzID[playerid])) return SysMsg(playerid,"You must own the business.");
- new musicLink[200], bizz = IsInBizzID[playerid];
- if(sscanf(params, "s[200]", musicLink)) return SysMsg(playerid, "Usage: /bizzmusic [link/stop]");
- if(strcmp(musicLink, "stop") == 0)
- {
- foreach(new i: Player)
- {
- if(Logged{i} && IsInBizzID[i] == IsInBizzID[playerid])
- {
- StopAudioStreamForPlayer(i);
- }
- }
- BizzData[bizz][BMusicPlaying] = 0;
- }
- else
- {
- foreach(new i: Player)
- {
- if(Logged{i} && IsInBizzID[i] == IsInBizzID[playerid])
- {
- StopAudioStreamForPlayer(i);
- PlayAudioStreamForPlayerEx(i, musicLink);
- }
- format(BizzData[bizz][BMusic], 200, musicLink);
- BizzData[bizz][BMusicPlaying] = 1;
- }
- }
- return true;
- }
- CMD:mybizz(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new Bcount = 0, substr[128], bid;
- gstr[0] = EOS;
- for(new v = 0; v < MAX_BIZZ_PER_PLAYER; v++)
- {
- if(PlayerBizzID[playerid][v] != -1)
- {
- if(Bcount != 0) strcat(gstr, "\n");
- bid = PlayerBizzID[playerid][v];
- if(BizzData[bid][BizzType] > 0 || BizzData[bid][IsSpecial] == 1)
- {
- new locked[9];
- if(BizzData[bid][BizzLocked]) format(locked, sizeof(locked), "Locked");
- else format(locked, sizeof(locked), "Unlocked");
- if(IsBizzStockable(bid) > 0) format(substr, sizeof(substr), "%s - $%s Payout - Door %s - $%s Earnings To Collect - %i%% Stock", BizzData[bid][BizzDescription], format_cash(BizzData[bid][Payout]), locked, format_cash(BizzData[bid][BizzEarnings]), BizzData[bid][BizzStock]);
- else format(substr, sizeof(substr), "%s - $%s Payout - Door %s - $%s Earnings To Collect", BizzData[bid][BizzDescription], format_cash(BizzData[bid][Payout]), locked, format_cash(BizzData[bid][BizzEarnings]));
- strcat(gstr, substr);
- }
- else
- {
- format(substr, sizeof(substr), "%s - $%s Payout (Standard Business)", BizzData[bid][BizzDescription], format_cash(BizzData[bid][Payout]));
- strcat(gstr, substr);
- }
- Bcount ++;
- }
- }
- if(Bcount > 0)
- {
- strcat(gstr, "\n");
- new Sbizzid = -1;
- if(Sbizzid != -1 && BizzData[Sbizzid][BizzOwnerSQLID] == SQLID[playerid])
- {
- format(substr, sizeof(substr), "Red County Trucking LTD - $200 per job - $%s.", format_cash(BizzData[Sbizzid][BizzEarnings]));
- strcat(gstr, substr);
- }
- Sbizzid = GetBizzID("Montgomery Pizza Stack");
- if(Sbizzid != -1 && BizzData[Sbizzid][BizzOwnerSQLID] == SQLID[playerid])
- {
- format(substr, sizeof(substr), "Montgomery Pizza Stack - $200 per job - $%s.", format_cash(BizzData[Sbizzid][BizzEarnings]));
- strcat(gstr, substr);
- }
- Sbizzid = GetBizzID("Red County Transport LTD");
- if(Sbizzid != -1 && BizzData[Sbizzid][BizzOwnerSQLID] == SQLID[playerid])
- {
- format(substr, sizeof(substr), "Red County Transport LTD - $10 per bus stop - $%s.", format_cash(BizzData[Sbizzid][BizzEarnings]));
- strcat(gstr, substr);
- }
- Sbizzid = GetBizzID("Bone County Waste Management");
- if(Sbizzid != -1 && BizzData[Sbizzid][BizzOwnerSQLID] == SQLID[playerid])
- {
- format(substr, sizeof(substr), "Bone County Waste Management - $%s.", format_cash(BizzData[Sbizzid][BizzEarnings]));
- strcat(gstr, substr);
- }
- Sbizzid = GetBizzID("Bone County Coal Mine");
- if(Sbizzid != -1 && BizzData[Sbizzid][BizzOwnerSQLID] == SQLID[playerid])
- {
- format(substr, sizeof(substr), "Bone County Coal Mine - $%s.", format_cash(BizzData[Sbizzid][BizzEarnings]));
- strcat(gstr, substr);
- }
- ShowMessage(playerid, "My Businesses", gstr, "OK");
- }
- else SysMsg(playerid,"You Have No Businesses.");
- return true;
- }
- CMD:collectearning(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new text[128], Bcount = 0, bizz, TotalEarn = 0, becount = 0;
- for(new b = 0; b < MAX_BIZZ_PER_PLAYER; b++)
- {
- if(PlayerBizzID[playerid][b] != -1)
- {
- bizz = PlayerBizzID[playerid][b];
- if(GetPlayerVirtualWorld(playerid) == BizzData[bizz][BizzVW] || IsPlayerInRangeOfPoint(playerid, 3.0, BizzData[bizz][oPosX], BizzData[bizz][oPosY], BizzData[bizz][oPosZ]))
- {
- becount++;
- if(BizzData[bizz][BizzEarnings] > 0)
- {
- Bcount ++;
- TotalEarn += BizzData[bizz][BizzEarnings];
- format(text, 128, "%s - You have received $%s from this business.", BizzData[bizz][BizzDescription], format_cash(BizzData[bizz][BizzEarnings]));
- SendClientMessage(playerid, COLOR_ORANGE, text);
- GivePlayerCash(playerid, BizzData[bizz][BizzEarnings]);
- BizzData[bizz][BizzEarnings] = 0;
- MySQLUpdateInt(BizzData[bizz][BizzSQLID], "BizzEarnings", 0, "bizz");
- }
- }
- }
- }
- if(TotalEarn >= 5000) UnlockAchievement(playerid,24);
- if(becount == 0) return SysMsg(playerid,"You need to be inside or at the exterior of a business to use this command.");
- else if(Bcount == 0) return SysMsg(playerid,"None of your bizzes have any earnings to collect.");
- return true;
- }
- CMD:collectearnings(playerid, params[]) return cmd_collectearning(playerid, params);
- CMD:requeststock(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsInBizzID[playerid] == -1) return SysMsg(playerid,"You must be inside your business to request more stock.");
- new bizz = IsInBizzID[playerid];
- if(IsBizzMod(playerid, bizz) || BizzData[bizz][BizzOwnerSQLID] == SQLID[playerid])
- {
- if(BizzData[bizz][BizzLocked]) return SysMsg(playerid,"This business is already locked.");
- if(IsBizzStockable(bizz) == 0) return SysMsg(playerid,"This business does not require stock to run.");
- if(BizzData[bizz][BizzStock] > 50) return SysMsg(playerid,"You can only request more stock if the stock level is below fifty percent.");
- if(BizzData[bizz][BizzETDelivering] == 1) return SysMsg(playerid,"A delivery is already underway.");
- new fee = IsBizzStockable(bizz);
- if(fee > BankBalance[playerid]) return SysMsgF(playerid, "Your bank account needs at least $%s in it to request a restock.", format_cash(fee));
- BankBalance[playerid] -= fee;
- BizzData[bizz][BizzRequestStock] = 1;
- BizzData[bizz][BizzETDelivering] = 0;
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- MySQLUpdateInt(BizzData[bizz][BizzSQLID], "RequestStock", BizzData[bizz][BizzRequestStock], "bizz");
- SendClientMessageF(playerid, COLOR_WHITE, "You have successfully requested a restock for %s at a cost of $%s from your bank.", BizzData[bizz][BizzDescription], format_cash(fee));
- return true;
- }
- return true;
- }
- CMD:manageactors(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsInBizzID[playerid] == -1) return SysMsg(playerid, "You must be in a business to use this command.");
- new b = IsInBizzID[playerid];
- if(BizzData[b][BizzOwnerSQLID] != SQLID[playerid] && !IsBizzMod(playerid, b)) return SysMsg(playerid, "You do not own this business.");
- if(IsDonator[playerid] == 0 || IsDonator[playerid] == 1) format(tgstr, sizeof(tgstr), "Actor 1");
- if(IsDonator[playerid] == 2) format(tgstr, sizeof(tgstr), "Actor 1\nActor 2");
- if(IsDonator[playerid] == 3) format(tgstr, sizeof(tgstr), "Actor 1\nActor 2\nActor 3");
- if(IsDonator[playerid] == 4) format(tgstr, sizeof(tgstr), "Actor 1\nActor 2\nActor 3\nActor 4");
- Dialog_Show(playerid, ActorMenu, DIALOG_STYLE_LIST, "Actor Management", tgstr, "Okay", "Cancel");
- return true;
- }
- CMD:addmanager(playerid, params[])
- {
- new bcount = 0, bizzid, playa = -1;
- for(new v = 0; v < MAX_BIZZ_PER_PLAYER; v++)
- {
- if(PlayerBizzID[playerid][v] != -1)
- {
- if(sscanf(params, "iu", bizzid, playa)) SendClientMessageF(playerid, COLOR_WHITE, "ID %i - %s", v, BizzData[PlayerBizzID[playerid][v]][BizzDescription]);
- bcount ++;
- }
- }
- if(bcount == 0) return SysMsg(playerid, "You do not own a business.");
- if(sscanf(params, "iu", bizzid, playa)) return SysMsg(playerid, "Usage: /addmanager [business ID (see above)] [player id or name]");
- if(bizzid > 1) return SysMsg(playerid, "Business ID cannot be higher than 1.");
- if(bizzid < 0) return SysMsg(playerid, "Business ID cannot be less than 0.");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't make yourself a business moderator.");
- if(!Logged{playa}) return SysMsg(playerid,"That player hasn't logged/registered.");
- if(IsBizzMod(playa, PlayerBizzID[playerid][bizzid])) return SysMsg(playerid, "This player is already a manager for your business. If you'd like to remove them then use /removemanager.");
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO bizzmods (BizzID, ModSQLID) VALUES (%i, %i)", BizzData[PlayerBizzID[playerid][bizzid]][BizzSQLID], SQLID[playa]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_BLUE, "%s has been added as a manager for your business: %s", NameEx(playa), BizzData[PlayerBizzID[playerid][bizzid]][BizzDescription]);
- SendClientMessageF(playa, COLOR_BLUE, "%s has made you a manager of their business: %s", NameEx(playerid), BizzData[PlayerBizzID[playerid][bizzid]][BizzDescription]);
- return true;
- }
- CMD:removemanager(playerid, params[])
- {
- new bcount = 0, bizzid, fullname[MAX_PLAYER_NAME];
- for(new v = 0; v < MAX_BIZZ_PER_PLAYER; v++)
- {
- if(PlayerBizzID[playerid][v] != -1)
- {
- if(sscanf(params, "is[24]", bizzid, fullname)) SendClientMessageF(playerid, COLOR_WHITE, "ID %i - %s", v, BizzData[PlayerBizzID[playerid][v]][BizzDescription]);
- bcount ++;
- }
- }
- if(bcount == 0) return SysMsg(playerid, "You do not own a business.");
- if(sscanf(params, "is[24]", bizzid, fullname)) return SysMsg(playerid,"Usage: /removemanager [business ID (see above)] [Full_Name] *Please note that this scans the database, not in-game players*");
- if(bizzid > 1) return SysMsg(playerid, "Business ID cannot be higher than 1.");
- new sqlid = MySQLCheckAccount(fullname, playerid);
- if(sqlid == 0) return SysMsg(playerid, "Name was not found. Please include first name, last name and an underscore.");
- new b = PlayerBizzID[playerid][bizzid];
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM bizzmods WHERE BizzID = %i AND ModSQLID = %i", BizzData[b][BizzSQLID], sqlid);
- mysql_pquery(conn, mquery, "ProcessManagerRemoval", "ddds", playerid, sqlid, b, fullname);
- return true;
- }
- CMD:viewmanagers(playerid, params[])
- {
- new bcount = 0, bizzid;
- for(new v = 0; v < MAX_BIZZ_PER_PLAYER; v++)
- {
- if(PlayerBizzID[playerid][v] != -1)
- {
- if(sscanf(params, "i", bizzid)) SendClientMessageF(playerid, COLOR_WHITE, "ID %i - %s", v, BizzData[PlayerBizzID[playerid][v]][BizzDescription]);
- bcount ++;
- }
- }
- if(bcount == 0) return SysMsg(playerid, "You do not own a business.");
- if(sscanf(params, "i", bizzid)) return SysMsg(playerid,"Usage: /viewmanagers [business ID (see above)]");
- if(bizzid > 1) return SysMsg(playerid, "Business ID cannot be higher than 1.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM bizzmods WHERE BizzID = %i", BizzData[PlayerBizzID[playerid][bizzid]][BizzSQLID]);
- mysql_pquery(conn, mquery, "ShowManagerList", "d", playerid);
- return true;
- }
- CMD:reloadbizz(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SysMsg(playerid, AUTHMSG);
- for(new b = 0; b < MAX_BIZZ; b++)
- {
- DestroyDynamicPickup(BizzData[b][BizzPickup]);
- DeleteBizzLabel(b);
- BizzData[b][BizzDescription][0] = 0;
- BizzData[b][BizzSQLID] = 0;
- BizzData[b][oPosX] = 0;
- BizzData[b][oPosY] = 0;
- BizzData[b][oPosZ] = 0;
- BizzData[b][iPosX] = 0;
- BizzData[b][iPosY] = 0;
- BizzData[b][iPosZ] = 0;
- BizzData[b][Payout] = 0;
- BizzData[b][BizzPrice] = 0;
- BizzData[b][BizzType] = 0;
- BizzData[b][EnterFee] = 0;
- BizzData[b][BizzEarnings] = 0;
- BizzData[b][BizzLocked] = false;
- BizzData[b][BizzStock] = 0;
- BizzData[b][BizzRequestStock] = 0;
- BizzData[b][IsSpecial] = 0;
- BizzData[b][BizzOwnerSQLID] = 0;
- BizzData[b][InteriorID] = 0;
- BizzData[b][BizzVW] = 0;
- BizzData[b][ExitVW] = 0;
- BizzData[b][BizzPickup] = 0;
- BizzData[b][BizzLabel] = Text3D:INVALID_3DTEXT_ID;
- BizzData[b][BizzLights] = false;
- for(new x = 0; x < 4; x++)
- {
- if(BizzData[b][BizzActorSpawned][x] == 1) DestroyActor(BizzData[b][BizzActor][x]);
- BizzData[b][BizzActor][x] = -1;
- BizzData[b][BizzActorSpawned][x] = 0;
- BizzData[b][BizzActorSkin][x] = 0;
- BizzData[b][BizzActorX][x] = 0;
- BizzData[b][BizzActorY][x] = 0;
- BizzData[b][BizzActorZ][x] = 0;
- BizzData[b][BizzActorAngle][x] = 0;
- BizzData[b][BizzActorAnim][x] = -1;
- }
- }
- mysql_tquery(conn, "SELECT * FROM bizz", "LoadBizzes");
- SetTimer("ProcessBKeys", 1000, 0);
- SendClientMessage(playerid, COLOR_WHITE, "All businesses {44C300}reloaded.");
- AdminLog(playerid, 0, "", "Reloaded all businesses from database");
- return true;
- }
- CMD:buybizz(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new bizzCount = 0;
- for(new biz = 0; biz < MAX_BIZZ_PER_PLAYER; biz++)
- {
- if(PlayerBizzID[playerid][biz] != -1)
- {
- bizzCount ++;
- }
- }
- if(bizzCount +1 > MAX_BIZZ_PER_PLAYER) return SysMsg(playerid,"You can't have any more businesses.");
- for(new h = 0; h < MAX_BIZZ; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid,2.5,BizzData[h][oPosX],BizzData[h][oPosY],BizzData[h][oPosZ]))
- {
- if(BizzData[h][BizzOwnerSQLID] == 0)
- {
- if(Cash[playerid] < BizzData[h][BizzPrice]) return SysMsg(playerid,"You don't have enough money to buy this business.");
- BizzData[h][BizzOwnerSQLID] = SQLID[playerid];
- MySQLUpdateInt(BizzData[h][BizzSQLID], "OwnerSQLID", SQLID[playerid], "bizz");
- GivePlayerCash(playerid, -BizzData[h][BizzPrice]);
- for(new i = 0; i < MAX_BIZZ_PER_PLAYER; i++)
- {
- if(PlayerBizzID[playerid][i] == -1)
- {
- PlayerBizzID[playerid][i] = h;
- break;
- }
- }
- UpdateBizzLabel(h);
- SendClientMessageF(playerid,COLOR_GOLD,"You Have Purchased %s For $%s.",BizzData[h][BizzDescription],format_cash(BizzData[h][BizzPrice]));
- SendClientMessageF(playerid,COLOR_GOLD,"You Will Now Receive An Extra $%s Every PayDay.",format_cash(BizzData[h][Payout]));
- ShowInfoText(playerid,"~g~business ACQUIRED",5000);
- UnlockAchievement(playerid, 59);
- break;
- }
- else if(BizzData[h][BizzOwnerSQLID] == -5) return SysMsg(playerid,"This business is currently in the hands of Silver Trading, check there to see if it's for sale.");
- else return SysMsg(playerid,"This business is not for sale.");
- }
- }
- return true;
- }
- CMD:sellbizz(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new bizzCount = 0;
- for(new biz = 0; biz < MAX_BIZZ_PER_PLAYER; biz++)
- {
- if(PlayerBizzID[playerid][biz] != -1)
- {
- bizzCount ++;
- }
- }
- if(bizzCount == 0) return SysMsg(playerid,"You don't have a businesses to sell.");
- new bool:soldBizz = false;
- for(new h = 0; h < MAX_BIZZ; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.5, BizzData[h][oPosX], BizzData[h][oPosY], BizzData[h][oPosZ]))
- {
- for(new b = 0; b < MAX_BIZZ_PER_PLAYER; b++)
- {
- if(PlayerBizzID[playerid][b] == h)
- {
- new bizzValue = BizzData[h][BizzPrice] / 2;
- if(sscanf(params, "s[8]", params)) return SendClientMessageF(playerid, COLOR_WHITE, "Use [/sellbizz confirm] to confirm that you wish to sell %s for $%s.", BizzData[h][BizzDescription], format_cash(bizzValue));
- if(strmatch(params, "confirm"))
- {
- GivePlayerCash(playerid, bizzValue);
- for(new id = 0; id < MAX_BIZZ_PER_PLAYER; id++)
- {
- if(PlayerBizzID[playerid][id] == h)
- {
- PlayerBizzID[playerid][id] = -1;
- break;
- }
- }
- BizzData[h][BizzOwnerSQLID] = 0;
- MySQLUpdateInt(BizzData[h][BizzSQLID], "OwnerSQLID", 0, "bizz");
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM bizzmods WHERE BizzID = %i", BizzData[h][BizzSQLID]);
- mysql_pquery(conn, mquery);
- if(MySpawnID[playerid] == 7 && BizzData[h][BizzSQLID] == BizzSpawn[playerid])
- {
- MySpawnID[playerid] = 1;
- BizzSpawn[playerid] = 0;
- mysql_pqueryf(conn, mquery, "UPDATE players SET MySpawnID = %i, BizzSpawn = %i WHERE id = %i", MySpawnID[playerid], BizzSpawn[playerid], SQLID[playerid]);
- }
- UpdateBizzLabel(h);
- SendClientMessageF(playerid, COLOR_GOLD, "You Have Sold Your Business (%s) For $%s.",BizzData[h][BizzDescription],format_cash(bizzValue));
- ShowInfoText(playerid,"~g~business sold",5000);
- soldBizz = true;
- break;
- }
- }
- }
- }
- }
- if(soldBizz == false) SysMsg(playerid, "You are not at your business.");
- return true;
- }
- //end of business commands
- //==================== Fim ==================================//
- //9 Clothing/holster commands
- //Clothing/holster commands
- CMD:clothing(playerid)
- {
- gstr[0] = EOS;
- new count = 0;
- for(new t; t < MAX_TOYS; t++)
- {
- if(ToyInfo[playerid][t][tMask] == 1)
- {
- if(!ToyInfo[playerid][t][MaskWorn]) format(sgstr, sizeof(sgstr), "%s\n", GetMaskDescription(ToyInfo[playerid][t][tModelID]));
- else format(sgstr, sizeof(sgstr), "{2735FF}%s{FFFFFF}\n", GetMaskDescription(ToyInfo[playerid][t][tModelID]));
- strcat(gstr, sgstr);
- ClothingSelected[playerid][count] = ToyInfo[playerid][t][tID];
- count ++;
- }
- }
- if(count == 0) Dialog_Show(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Clothing - Error", "You currently do not have any clothing objects to wear.", "Close", "");
- else Dialog_Show(playerid, ClothingMenu, DIALOG_STYLE_LIST, "Clothing Menu", gstr, "Select", "Cancel");
- return true;
- }
- CMD:holster(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(GetFreeWeaponObjectIndex(playerid) == -1) return SysMsg(playerid, "You currently have too many weapons holstered to holster another.");
- if(GetPlayerWeapon(playerid) == 0) return SysMsg(playerid, "You need to be holding a weapon to holster it.");
- new test = 0;
- new wep = GetPlayerWeapon(playerid);
- for(new p; p < sizeof(unholsterWeap); p++)
- {
- if(wep == unholsterWeap[p])
- {
- return SysMsg(playerid, "You can't holster this weapon.");
- }
- }
- if(WeaponData[playerid][GetWeaponSlot(wep)][Weapon] != wep) return SysMsg(playerid, "This weapon is not able to be holstered due to it being a non-permanent weapon.");
- new t = -1;
- for(t = 0; t < MAX_TOYS; t++)
- {
- if(ToyInfo[playerid][t][tModelID] == dropObjectID[wep])
- {
- SetPVarInt(playerid, "isHolster", t);
- for(new l; l < sizeof(HolsterTog); l++)
- {
- if(wep == HolsterTog[l])
- {
- if(IsHolsterTogged[playerid][GetWeaponSlot(wep)] == 1) format(gstr, sizeof(gstr), "{00FF00}Show Holstered %s{FFFFFF}\nSpine\nHead\nLeft upper arm\nRight upper arm\nLeft hand\nRight hand\nLeft thigh\nRight Thigh\nLeft foot\nRight foot\nRight calf\nLeft calf\nLeft forearm\nRight forearm\nLeft shoulder\nRight shoulder", WeaponNames[wep]);
- else format(gstr, sizeof(gstr), "{FF0000}Hide Holstered %s{FFFFFF}\nSpine\nHead\nLeft upper arm\nRight upper arm\nLeft hand\nRight hand\nLeft thigh\nRight Thigh\nLeft foot\nRight foot\nRight calf\nLeft calf\nLeft forearm\nRight forearm\nLeft shoulder\nRight shoulder", WeaponNames[wep]);
- test = 1;
- SetPVarInt(playerid, "isHolstered", 1);
- }
- }
- break;
- }
- }
- if(GetPVarType(playerid, "isHolster") == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM toys WHERE tPlayer = %i AND tModelID = %i", SQLID[playerid], dropObjectID[wep]);
- mysql_pquery(conn, mquery, "NewHolsterCheck", "dd", playerid, wep);
- }
- if(test == 0) format(gstr, sizeof(gstr), "{FFFFFF}Spine\nHead\nLeft upper arm\nRight upper arm\nLeft hand\nRight hand\nLeft thigh\nRight Thigh\nLeft foot\nRight foot\nRight calf\nLeft calf\nLeft forearm\nRight forearm\nLeft shoulder\nRight shoulder");
- Dialog_Show(playerid, HolsterBone, DIALOG_STYLE_LIST, "{FFFFFF}Holster | Select Bone.", gstr, "Select", "");
- format(gstr, sizeof(gstr), "You have chose to holster your %s, please select the bone you wish to attach it to.", WeaponNames[wep]);
- SendClientMessage(playerid, COLOR_YELLOW, gstr);
- return true;
- }
- CMD:resetmask(playerid, params[])
- {
- if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid, "Usage: /resetmask [playerid or part of name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- gstr[0] = EOS;
- new count = 0;
- for(new t = 0; t < MAX_TOYS; t++)
- {
- if(ToyInfo[playa][t][tMask] == 1)
- {
- if(!ToyInfo[playa][t][MaskWorn]) format(gstr, sizeof(gstr), "%s%s (ID %i)\n", gstr, GetMaskDescription(ToyInfo[playa][t][tModelID]), ToyInfo[playa][t][tID]);
- else format(gstr, sizeof(gstr), "%s{2735FF}%s{FFFFFF} (ID %i)\n", gstr, GetMaskDescription(ToyInfo[playa][t][tModelID]), ToyInfo[playa][t][tID]);
- ClothingSelected[playerid][count] = ToyInfo[playa][t][tID];
- count ++;
- }
- }
- if(count == 0) return SendClientMessage(playerid, COLOR_WHITE, "Error: That player has no clothing objects.");
- Dialog_Show(playerid, ClothingAdminReset, DIALOG_STYLE_LIST, "Reset Mask Scale", gstr, "Select", "Cancel");
- ResettingMask[playerid] = playa;
- return true;
- }
- CMD:resetallholsters(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new conf[12];
- if(sscanf(params, "s[12]", conf)) return SendSplitMessage(playerid, COLOR_WHITE, "To reset all of your holster data, type '/resetallholsters confirm'. This will clear the positions for every attached weapon you have and you will need to relog after it is done.");
- if(strmatch(conf, "confirm"))
- {
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM toys WHERE tPlayer = %i AND tMask = 0", SQLID[playerid]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, COLOR_WHITE, "You have "COL_NICEGREEN"reset{FFFFFF} all of your holster data. Please use /logout and re-select your character.");
- return true;
- }
- return true;
- }
- CMD:editvest(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(AttachedObjects[playerid][7][aoModelID] == 19142 || AttachedObjects[playerid][7][aoModelID] == 19515)
- {
- for(new t = 0; t < MAX_TOYS; t++)
- {
- if(ToyInfo[playerid][t][tModelID] == AttachedObjects[playerid][7][aoModelID])
- {
- ToyBeingEdited[playerid] = t;
- }
- }
- if(ToyBeingEdited[playerid] == -1) return SysMsg(playerid, "An error has occurred and you cannot edit your vest.");
- EditingAttachedObject[playerid] = 1;
- EditAttachedObject(playerid, 7);
- SendClientMessage(playerid, COLOR_WHITE, " ");
- SendClientMessage(playerid, COLOR_WHITE, "Select an option from [Move] [Rotate] or [Scale] then drag the [X] [Y] and [Z] buttons to edit.");
- SendClientMessage(playerid, COLOR_WHITE, "Press the save button to finish or press the escape key to cancel.");
- return true;
- }
- SysMsg(playerid, "You don't have a vest on.");
- return true;
- }
- CMD:resetvest(playerid)
- {
- if(!Logged{playerid}) return true;
- if(VestType[playerid] == 0) return SysMsg(playerid, "You must be wearing a vest to use this command.");
- new Float:armor;
- GetPlayerArmour(playerid, armor);
- if(floatround(armor) == 0) return SysMsg(playerid, "You must be wearing a vest to use this command.");
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM toys WHERE tPlayer = %i AND tModelID = 19142 OR tPlayer = %i AND tModelID = 19515", SQLID[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- for(new id = 0; id < MAX_TOYS; id++)
- {
- if(ToyInfo[playerid][id][tModelID] == 19142 || ToyInfo[playerid][id][tModelID] == 19515)
- {
- ClearToyData(playerid, id);
- }
- }
- if(AttachedObjects[playerid][7][aoToyID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 7);
- AttachedObjects[playerid][7][aoScale][0] = 1.0;
- AttachedObjects[playerid][7][aoScale][1] = 1.0;
- AttachedObjects[playerid][7][aoScale][2] = 1.0;
- AttachedObjects[playerid][7][aoOffset][0] = 0.0;
- AttachedObjects[playerid][7][aoOffset][1] = 0.0;
- AttachedObjects[playerid][7][aoOffset][2] = 0.0;
- AttachedObjects[playerid][7][aoRot][0] = 0.0;
- AttachedObjects[playerid][7][aoRot][1] = 0.0;
- AttachedObjects[playerid][7][aoRot][2] = 0.0;
- }
- GivePlayerVest(playerid);
- return true;
- }
- CMD:vestoff(playerid, params[])
- {
- new Float:armor;
- GetPlayerArmour(playerid, armor);
- if(armor == 0 && (AttachedObjects[playerid][7][aoModelID] == 19142 || AttachedObjects[playerid][7][aoModelID] == 19515))
- {
- RemovePlayerAttachedObject(playerid, 7);
- AttachedObjects[playerid][7][aoModelID] = 0;
- AttachedObjects[playerid][7][aoBone] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "> Vest Removed");
- }
- else return SysMsg(playerid, "You cannot remove the vest object if you have any amount of armor. If you wish to take off the vest, store it in a house or vehicle trunk.");
- return true;
- }
- CMD:removevest(playerid, params[]) return cmd_vestoff(playerid, params);
- CMD:mask(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Mask] == 0) return SysMsg(playerid,"You don't have a Mask.");
- if(PlayerImprisoned{playerid}) return SysMsg(playerid,"You cannot mask in prison.");
- if(IsPlayerMasked{playerid}) return SysMsg(playerid,"You are already Masked. (/unmask)");
- if((Faction[playerid] != FACTION_COP && Faction[playerid] != FACTION_RESEARCH) && PlayerLevel[playerid] < 8) return SysMsg(playerid, "You need to be at least level 8 to use this command.");
- foreach(new i: Player) if(i != playerid) if(ADuty[i] == 0) ShowPlayerNameTagForPlayer(i, playerid, 0);
- MaskLabelNumber[playerid] = MaskStrangerNumber;
- MaskStrangerNumber ++;
- IsPlayerMasked{playerid} = true;
- MaskHideName{playerid} = true;
- FormatHealthLabelText(playerid, HealthVar[playerid], ArmourVar[playerid], 1);
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO strangers (StrangerID, PlayerName, Timestamp, SQLID, IP) VALUES (%i, '%e', %i, %i, '%e')", MaskLabelNumber[playerid], GetName(playerid), gettime(), SQLID[playerid], PlayerIP[playerid]);
- mysql_pquery(conn, mquery);
- UnlockAchievement(playerid, 46);
- format(gstr, sizeof(gstr), "* %s puts on a mask. *", NameRP(playerid));
- ProxDetector(15.0, playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_LIGHTRED, "You are now Masked, use /unmask to remove it.");
- return true;
- }
- CMD:unmask(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Mask] == 0) return SysMsg(playerid,"You don't have a Mask.");
- if(!IsPlayerMasked{playerid}) return SysMsg(playerid,"You are not wearing a Mask. (/mask)");
- if(MaskHideName{playerid})
- {
- MaskHideName{playerid} = false;
- MaskLabelNumber[playerid] = 0;
- foreach(new i: Player)
- {
- if(i != playerid)
- {
- ShowPlayerNameTagForPlayer(i, playerid, 1);
- }
- }
- }
- DeleteMaskLabel(playerid);
- format(gstr, sizeof(gstr),"* %s takes off their mask. *", NameRP(playerid));
- ProxDetector(5.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have removed your mask.");
- IsPlayerMasked{playerid} = false;
- return true;
- }
- //end of clothing/holster commands
- //==================== Fim ==================================//
- //10 Animation Commands
- //Animation Commands
- CMD:animlist(playerid, params[])
- {
- SendClientMessage(playerid,COLOR_YELLOW,"___________________________________________________________________________________________________________________");
- SendClientMessage(playerid, COLOR_RED, "Available Animation Commands:");
- SendClientMessage(playerid, COLOR_WHITE, "/fall /fallback /fall2 /injured /akick /push /lowbodypush /handsup /bomb /drunk /laugh /sup /crossarms /lay(2) /sleep /fstance");
- SendClientMessage(playerid, COLOR_WHITE, "/basket /headbutt /medic /spraycan /robman /kungfu /box /lookout /cellaway /cellout /bat /lightcig /tapcig");
- SendClientMessage(playerid, COLOR_WHITE, "/deal /crack /smoke /(gro)undsit /chat /dance /fucku /strip /hide /vomit /eat /sit(2) /reload /lowthrow /highthrow");
- SendClientMessage(playerid, COLOR_WHITE, "/koface /kostomach /rollfall /carjacked /carjack /exhaust /leftslap /lifejump /carlock /hoodfrisked");
- SendClientMessage(playerid, COLOR_WHITE, "/chant /finger /shouting /knife /cop /elbow /kneekick /airkick /gkick /pickupanim /putdownitem /direct /chairsit");
- SendClientMessage(playerid, COLOR_WHITE, "/gpunch /aim /pee /lean /car /gsign /relax /givedrink /washhands /goggles /inbedleft");
- SendClientMessage(playerid, COLOR_WHITE, "/swipecard /liftcase /hitchhikeR /hitchhikeL /scratchcrotch /copmove /angry /cheer /loot /wounded");
- SendClientMessage(playerid, COLOR_WHITE, "/fdrink /wavebye /flex /awwyeah /drugged /cashier /spotter /shout /lookaround /woah /holdrifle");
- SendClientMessage(playerid, COLOR_WHITE, "/hailtaxi /jog /sneak /dj /halt /taphand");
- SendClientMessage(playerid,COLOR_YELLOW,"\n");
- return true;
- }
- CMD:inbedleft(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "INT_HOUSE","BED_In_R",4.0,0,0,0,1,1); //CMD: /inbedleft
- return true;
- }
- CMD:inbedright(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "INT_HOUSE","BED_In_L",4.0,0,0,0,1,1); //CMD: /inbedright
- return true;
- }
- CMD:carjacked(playerid, params[])
- {
- if(isnull(params)) return SysMsg(playerid,"Usage: /carjacked [1-2]");
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid,"PED","CAR_jackedLHS",4.0,0,1,1,1,0);
- case 2: LoopingAnim(playerid,"PED","CAR_jackedRHS",4.0,0,1,1,1,0);
- default: SysMsg(playerid,"Usage: /carjacked [1-2 only]");
- }
- return true;
- }
- CMD:handsup(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "ROB_BANK","SHP_HandsUp_Scr", 4.0, 0, 1, 1, 1, 0);
- return true;
- }
- CMD:cellout(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
- if(AttachedObjects[playerid][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 6);
- }
- AttachedObjects[playerid][6][aoModelID] = 330;
- AttachedObjects[playerid][6][aoBone] = 6;
- SetPlayerAttachedObject(playerid, 6, 330, 6);
- return true;
- }
- CMD:cellaway(playerid, params[])
- {
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
- RemovePlayerAttachedObject(playerid, 6);
- AttachedObjects[playerid][6][aoModelID] = 0;
- AttachedObjects[playerid][6][aoBone] = 0;
- return true;
- }
- CMD:drunk(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
- return true;
- }
- CMD:bomb(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- ClearAnimations(playerid);
- LoopingAnim(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0); // Place Bomb
- return true;
- }
- CMD:laugh(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0); // Laugh
- return true;
- }
- CMD:cry(playerid)
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"GRAVEYARD","mrnM_loop", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:lookout(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0); // Rob Lookout
- return true;
- }
- CMD:robman(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0); // Rob
- return true;
- }
- CMD:crossarms(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1); // Arms crossed
- return true;
- }
- CMD:lay(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0); // Lay down
- return true;
- }
- CMD:hide(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "ped", "cower", 3.0, 1, 0, 0, 0, 0); // Taking Cover
- return true;
- }
- CMD:vomit(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0); // Vomit
- return true;
- }
- CMD:eat(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0); // Eat Burger
- return true;
- }
- CMD:wave(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0); // Wave
- return true;
- }
- CMD:wave2(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "KISSING", "gfwave2", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:slapass(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:deal(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:crack(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:wounded(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "CRACK", "crckidle1", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:sleep(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "CRACK", "crckidle2", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:smoke(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /smoke [1-4]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid,"SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0);
- case 2: LoopingAnim(playerid,"SMOKING", "F_smklean_loop", 4.0, 1, 0, 0, 0, 0);
- case 3: LoopingAnim(playerid,"SMOKING","M_smkstnd_loop", 4.0, 1, 0, 0, 0, 0);
- case 4: LoopingAnim(playerid,"SMOKING","M_smk_out", 4.0, 1, 0, 0, 0, 0);
- default: SysMsg(playerid,"Usage: /smoke [1-4]");
- }
- return true;
- }
- CMD:groundsit(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:gro(playerid, params[]) return cmd_groundsit(playerid, params);
- CMD:chat(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"PED","IDLE_CHAT",4.0,1,0,0,1,1);
- return true;
- }
- CMD:fucku(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"PED","fucku",4.0,0,0,0,0,0);
- return true;
- }
- CMD:fucku2(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "RIOT", "riot_fuku", 4.0, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:kungfu(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(!FightStyleLearned[playerid]{FS_KUNGFU}) return SysMsg(playerid,"You must learn Kung Fu first.");
- LoopingAnim(playerid,"PARK","Tai_Chi_Loop",4.0,1,0,0,0,0);
- return true;
- }
- CMD:sit(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"PED","SEAT_down",4.1,0,0,0,1,0);
- return true;
- }
- CMD:fsit(playerid)
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"SUNBATHE","SBATHE_F_LieB2Sit",4.1,0,0,0,1,0);
- return true;
- }
- CMD:eatsit(playerid)
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "FOOD", "FF_Sit_Loop", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:bbat(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /bbat [1-2]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid, "CRACK", "Bbalbat_Idle_01",4.0,1,0,0,0,0);
- case 2: LoopingAnim(playerid, "CRACK", "Bbalbat_Idle_02",4.0,1,0,0,0,0);
- }
- return true;
- }
- CMD:seat(playerid, params[]) return cmd_sit(playerid, params);
- CMD:fseat(playerid) return cmd_fsit(playerid);
- CMD:direct(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /direct [1-4]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid, "POLICE","CopTraf_Come",4.0,1,0,0,0,0);
- case 2: LoopingAnim(playerid, "POLICE","CopTraf_Away",4.0,1,0,0,0,0);
- case 3: LoopingAnim(playerid, "POLICE","CopTraf_Stop",4.0,1,0,0,0,0);
- case 4: LoopingAnim(playerid, "POLICE","CopTraf_Left",4.0,1,0,0,0,0);
- default: SysMsg(playerid,"Usage: /direct [1-4]");
- }
- return true;
- }
- CMD:goggles(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "goggles","goggles_put_on",4.0,0,0,0,0,0);
- return true;
- }
- CMD:sit2(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "INT_HOUSE","LOU_In",4.0,0,0,0,1,0);
- return true;
- }
- CMD:chairsit(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /chairsit [1-6]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid, "INT_OFFICE", "OFF_Sit_Type_Loop", 4.0, 1, 0, 0, 1, 0);
- case 2: LoopingAnim(playerid, "INT_OFFICE", "OFF_Sit_Bored_Loop", 4.0, 1, 0, 0, 1, 0);
- case 3: LoopingAnim(playerid, "INT_OFFICE", "OFF_Sit_In", 4.0, 0, 0, 0, 1, 1);
- case 4: LoopingAnim(playerid, "JST_BUISNESS", "girl_02", 4.0, 0, 0, 0, 1, 1);
- case 5: LoopingAnim(playerid, "MISC", "seat_talk_01", 4.0, 0, 0, 0, 1, 1);
- case 6: LoopingAnim(playerid, "MISC", "seat_talk_02", 4.0, 0, 0, 0, 1, 1);
- default: SysMsg(playerid,"Usage: /chairsit [1-6]");
- }
- return true;
- }
- CMD:fall(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(GetPlayerVehicleID(playerid) > 0) return SysMsg(playerid, "You may not perform this action in a vehicle.");
- LoopingAnim(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0);
- return true;
- }
- CMD:fall2(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(GetPlayerVehicleID(playerid) > 0) return SysMsg(playerid, "You may not perform this action in a vehicle.");
- LoopingAnim(playerid,"PED", "BIKE_fall_off",4.1,0,1,1,1,0);
- return true;
- }
- CMD:fallback(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "PED","FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:injured(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "SWEET", "Sweet_injuredloop", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:sup(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /sup [1-3]");
- switch(strval(params))
- {
- case 1: OnePlayAnim(playerid,"GANGS","hndshkba",4.0,0,0,0,0,0);
- case 2: OnePlayAnim(playerid,"GANGS","hndshkda",4.0,0,0,0,0,0);
- case 3: OnePlayAnim(playerid,"GANGS","hndshkfa_swt",4.0,0,0,0,0,0);
- default: SysMsg(playerid,"Usage: /sup [1-3]");
- }
- return true;
- }
- CMD:gsign(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid, "Usage: /gsign [1-10]");
- switch(strval(params))
- {
- case 1: OnePlayAnim(playerid, "GHANDS", "gsign1", 3.5, 0, 1, 1, 1, 1);
- case 2: OnePlayAnim(playerid, "GHANDS", "gsign1LH", 3.5, 0, 1, 1, 1, 1);
- case 3: OnePlayAnim(playerid, "GHANDS", "gsign2", 3.5, 0, 1, 1, 1, 1);
- case 4: OnePlayAnim(playerid, "GHANDS", "gsign2LH", 3.5, 0, 1, 1, 1, 1);
- case 5: OnePlayAnim(playerid, "GHANDS", "gsign3", 3.5, 0, 1, 1, 1, 1);
- case 6: OnePlayAnim(playerid, "GHANDS", "gsign3LH", 3.5, 0, 1, 1, 1, 1);
- case 7: OnePlayAnim(playerid, "GHANDS", "gsign4", 3.5, 0, 1, 1, 1, 1);
- case 8: OnePlayAnim(playerid, "GHANDS", "gsign4LH", 3.5, 0, 1, 1, 1, 1);
- case 9: OnePlayAnim(playerid, "GHANDS", "gsign5", 3.5, 0, 1, 1, 1, 1);
- case 10: OnePlayAnim(playerid, "GHANDS", "gsign5LH", 3.5, 0, 1, 1, 1, 1);
- default: cmd_gsign(playerid, "");
- }
- return true;
- }
- CMD:salute(playerid)
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "GHANDS", "gsign5LH", 3.5, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:rap(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /rap [1-4]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid,"RAPPING","RAP_A_Loop",4.0,1,0,0,0,0);
- case 2: LoopingAnim(playerid,"RAPPING","RAP_C_Loop",4.0,1,0,0,0,0);
- case 3: LoopingAnim(playerid,"GANGS","prtial_gngtlkD",4.0,1,0,0,0,0);
- case 4: LoopingAnim(playerid,"GANGS","prtial_gngtlkH",4.0,1,0,0,1,1);
- default: SysMsg(playerid,"Usage: /rap [1-4]");
- }
- return true;
- }
- CMD:push(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"GANGS","shake_cara",4.0,0,0,0,0,0);
- return true;
- }
- CMD:akick(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"POLICE","Door_Kick",4.0,0,0,0,0,0);
- return true;
- }
- CMD:lowbodypush(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"GANGS","shake_carSH",4.0,0,0,0,0,0);
- return true;
- }
- CMD:spraycan(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"SPRAYCAN","spraycan_full",4.0,0,0,0,0,0);
- return true;
- }
- CMD:headbutt(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"WAYFARER","WF_Fwd",4.0,0,0,0,0,0);
- return true;
- }
- CMD:medic(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"MEDIC","CPR",4.0,0,0,0,0,0);
- return true;
- }
- CMD:koface(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"PED","KO_shot_face",4.0,0,1,1,1,0);
- return true;
- }
- CMD:kostomach(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"PED","KO_shot_stom",4.0,0,1,1,1,0);
- return true;
- }
- CMD:lifejump(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"PED","EV_dive",4.0,0,1,1,1,0);
- return true;
- }
- CMD:exhaust(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"FAT","IDLE_tired",3.0,1,0,0,0,0);
- return true;
- }
- CMD:leftslap(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"PED","BIKE_elbowL",4.0,0,0,0,0,0);
- return true;
- }
- CMD:rollfall(playerid)
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"PED","BIKE_fallR",4.0,0,1,1,1,0);
- return true;
- }
- CMD:carlock(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"PED","CAR_doorlocked_LHS",4.0,0,0,0,0,0);
- return true;
- }
- CMD:carjack(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /carjack [1-4]");
- switch(strval(params))
- {
- case 1: OnePlayAnim(playerid,"PED","CAR_pulloutL_LHS",4.0,0,0,0,0,0);
- case 2: OnePlayAnim(playerid,"PED","CAR_pulloutL_RHS",4.0,0,0,0,0,0);
- case 3: OnePlayAnim(playerid,"PED","CAR_pullout_LHS",4.0,0,0,0,0,0);
- case 4: OnePlayAnim(playerid,"PED","CAR_pullout_RHS",4.0,0,0,0,0,0);
- default: SysMsg(playerid,"Usage: /carjack [1-4 only]");
- }
- return true;
- }
- CMD:hoodfrisked(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"POLICE","crm_drgbst_01",4.0,0,1,1,1,0);
- return true;
- }
- CMD:lightcig(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"SMOKING","M_smk_in",3.0,0,0,0,0,0);
- return true;
- }
- CMD:tapcig(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"SMOKING","M_smk_tap",3.0,0,0,0,0,0);
- return true;
- }
- CMD:taphand(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(IsBus(GetPlayerVehicleID(playerid))) return SysMsg(playerid, "You cannot use this animation in a bus.");
- if(GetPlayerVehicleSeat(playerid) == 0 || GetPlayerVehicleSeat(playerid) == 2) OnePlayAnim(playerid, "CAR", "Tap_hand", 4.0,0,1,1,1,0);
- else return SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle and in the correct seat to use this animation.");
- return true;
- }
- CMD:bat(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"BASEBALL","Bat_IDLE",4.0,1,1,1,1,0);
- return true;
- }
- CMD:box(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(!FightStyleLearned[playerid]{FS_BOXING}) return SysMsg(playerid,"You have not learned Boxing.");
- LoopingAnim(playerid,"GYMNASIUM","GYMshadowbox",4.0,1,1,1,1,0);
- return true;
- }
- CMD:lay2(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"SUNBATHE","Lay_Bac_in",3.0,0,1,1,1,0);
- return true;
- }
- CMD:chant(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"RIOT","RIOT_CHANT",4.0,1,1,1,1,0);
- return true;
- }
- CMD:finger(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"RIOT","RIOT_FUKU",2.0,0,0,0,0,0);
- return true;
- }
- CMD:fuckyou(playerid, params[]) return cmd_finger(playerid, params);
- CMD:shouting(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"RIOT","RIOT_shout",4.0,1,0,0,0,0);
- return true;
- }
- CMD:cop(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"SWORD","sword_block",50.0,0,1,1,1,1);
- return true;
- }
- CMD:elbow(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"FIGHT_D","FightD_3",4.0,0,1,1,0,0);
- return true;
- }
- CMD:kneekick(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"FIGHT_D","FightD_2",4.0,0,1,1,0,0);
- return true;
- }
- CMD:fstance(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"FIGHT_D","FightD_IDLE",4.0,1,1,1,1,0);
- return true;
- }
- CMD:gpunch(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"FIGHT_B","FightB_G",4.0,0,0,0,0,0);
- return true;
- }
- CMD:airkick(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"FIGHT_C","FightC_M",4.0,0,1,1,0,0);
- return true;
- }
- CMD:gkick(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"FIGHT_D","FightD_G",4.0,0,0,0,0,0);
- return true;
- }
- CMD:lowthrow(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"GRENADE","WEAPON_throwu",4.0,0,0,0,0,0);
- return true;
- }
- CMD:highthrow(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid,"GRENADE","WEAPON_throw",4.0,0,0,0,0,0);
- return true;
- }
- CMD:dealstance(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"DEALER","DEALER_IDLE",4.0,1,0,0,0,0);
- return true;
- }
- CMD:pee(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_PISSING);
- return true;
- }
- CMD:piss(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_PISSING);
- return true;
- }
- CMD:wank(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid,"PAULNMAC","wank_loop",4.0,1,0,0,0,0);
- if(IsInHouseID[playerid] != -1 && HouseData[IsInHouseID[playerid]][HouseOwnerSQLID] == SQLID[playerid]) UnlockAchievement(playerid, 33);
- return true;
- }
- CMD:knife(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /knife [1-4]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid,"KNIFE","KILL_Knife_Ped_Damage",4.0,0,1,1,1,0);
- case 2: LoopingAnim(playerid,"KNIFE","KILL_Knife_Ped_Die",4.0,0,1,1,1,0);
- case 3: OnePlayAnim(playerid,"KNIFE","KILL_Knife_Player",4.0,0,0,0,0,0);
- case 4: LoopingAnim(playerid,"KNIFE","KILL_Partial",4.0,0,1,1,1,1);
- default: SysMsg(playerid,"Usage: /knife [1-4]");
- }
- return true;
- }
- CMD:basket(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /basket [1-6]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid,"BSKTBALL","BBALL_idleloop",4.0,1,0,0,0,0);
- case 2: OnePlayAnim(playerid,"BSKTBALL","BBALL_Jump_Shot",4.0,0,0,0,0,0);
- case 3: OnePlayAnim(playerid,"BSKTBALL","BBALL_pickup",4.0,0,0,0,0,0);
- case 4: LoopingAnim(playerid,"BSKTBALL","BBALL_run",4.1,1,1,1,1,1);
- case 5: LoopingAnim(playerid,"BSKTBALL","BBALL_def_loop",4.0,1,0,0,0,0);
- case 6: LoopingAnim(playerid,"BSKTBALL","BBALL_Dnk",4.0,1,0,0,0,0);
- default: SysMsg(playerid,"Usage: /basket [1-6]");
- }
- return true;
- }
- CMD:reload(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /reload [pistol/rifle]");
- if(strcmp("pistol", params, true) == 0) OnePlayAnim(playerid,"COLT45","colt45_reload",4.0,0,0,0,0,0);
- else if(strcmp("rifle", params, true) == 0) OnePlayAnim(playerid,"UZI","UZI_reload",4.0,0,0,0,0,0);
- else SysMsg(playerid,"Usage: /reload [pistol/rifle]");
- return true;
- }
- CMD:gwalk(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /gwalk [1/2]");
- if(strval(params)) LoopingAnim(playerid,"PED","WALK_gang1",4.1,1,1,1,1,1);
- else if(strval(params)) LoopingAnim(playerid,"PED","WALK_gang2",4.1,1,1,1,1,1);
- else SysMsg(playerid,"Usage: /gwalk [1/2]");
- return true;
- }
- CMD:aim(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /aim [1-3]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid,"PED","gang_gunstand",4.0,1,1,1,1,1);
- case 2: LoopingAnim(playerid,"PED","Driveby_L",4.0,0,1,1,1,1);
- case 3: LoopingAnim(playerid,"PED","Driveby_R",4.0,0,1,1,1,1);
- default: SysMsg(playerid,"Usage: /aim [1-3]");
- }
- return true;
- }
- CMD:lean(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /lean [1-4]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid,"GANGS","leanIDLE",4.0,0,1,1,1,0);
- case 2: LoopingAnim(playerid,"MISC","Plyrlean_loop",4.0,0,1,1,1,0);
- case 3: LoopingAnim(playerid,"RYDER","Van_Lean_R",4.0,0,1,1,1,0);
- case 4: LoopingAnim(playerid,"GANGS","leanIDLE",4.0,0,0,1,1,1);
- default: SysMsg(playerid,"Usage: /lean [1-4]");
- }
- return true;
- }
- CMD:car(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /car [1-3]");
- switch(strval(params))
- {
- case 1:
- {
- ClearAnimations(playerid);
- LoopingAnim(playerid, "CAR", "Fixn_Car_Out", 4.1, 0, 1, 1, 1, 1); // Twice so that it applies.
- SetTimerEx("CarAnim1", 125, false, "i", playerid);
- SetTimerEx("CarAnim2", 1500, false, "i", playerid);
- }
- case 2: LoopingAnim(playerid, "CAR", "Fixn_Car_Out", 4.1, 0, 1, 1, 1, 1);
- case 3: LoopingAnim(playerid, "CAR", "flag_drop", 4.1, 0, 1, 1, 1, 1);
- default: SysMsg(playerid,"Usage: /car [1-3 only]");
- }
- return true;
- }
- GREENSIDE::CarAnim1(playerid)
- {
- LoopingAnim(playerid, "CAR", "Fixn_Car_Out", 4.1, 0, 1, 1, 1, 1);
- return true;
- }
- GREENSIDE::CarAnim2(playerid)
- {
- LoopingAnim(playerid,"CAR", "Fixn_Car_Loop", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:clear(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(IsPlayerInAnyVehicle(playerid)) return true;
- ClearAnimations(playerid);
- OnePlayAnim(playerid, "CARRY", "crry_prtial", 1.0, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:strip(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /strip [1-7]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid,"STRIP", "strip_A", 4.1, 1, 1, 1, 1, 1);
- case 2: LoopingAnim(playerid,"STRIP", "strip_B", 4.1, 1, 1, 1, 1, 1);
- case 3: LoopingAnim(playerid,"STRIP", "strip_C", 4.1, 1, 1, 1, 1, 1);
- case 4: LoopingAnim(playerid,"STRIP", "strip_D", 4.1, 1, 1, 1, 1, 1);
- case 5: LoopingAnim(playerid,"STRIP", "strip_E", 4.1, 1, 1, 1, 1, 1);
- case 6: LoopingAnim(playerid,"STRIP", "strip_F", 4.1, 1, 1, 1, 1, 1);
- case 7: LoopingAnim(playerid,"STRIP", "strip_G", 4.1, 1, 1, 1, 1, 1);
- default: SysMsg(playerid,"Usage: /strip [1-7 only]");
- }
- return true;
- }
- CMD:dance(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /dance [1-11]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid,"DANCING", "DAN_Loop_A", 4.1, 1, 1, 1, 1, 1);
- case 2: LoopingAnim(playerid,"DANCING", "dnce_M_a", 4.1, 1, 0, 0, 1, 1);
- case 3: LoopingAnim(playerid,"DANCING", "dnce_M_b", 4.1, 1, 1, 1, 1, 1);
- case 4: LoopingAnim(playerid,"DANCING", "dnce_M_c", 4.1, 1, 1, 1, 1, 1);
- case 5: LoopingAnim(playerid,"DANCING", "dnce_M_d", 4.1, 1, 0, 0, 1, 1);
- case 6: LoopingAnim(playerid,"DANCING", "dnce_M_e", 4.1, 1, 0, 0, 1, 1);
- case 7: LoopingAnim(playerid,"DANCING", "bd_clap1", 4.1, 1, 1, 1, 1, 1);
- case 8: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE1);
- case 9: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE2);
- case 10: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE3);
- case 11: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE4);
- default: SysMsg(playerid,"Usage: /dance [1-11 only]");
- }
- return true;
- }
- CMD:walk(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid, "Usage: /walk [1 - 10]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid,"PED","WALK_GANG1", 4.1, 1, 1, 1, 1, 1);
- case 2: LoopingAnim(playerid,"PED","WALK_GANG2", 4.1, 1, 1, 1, 1, 1);
- case 3: LoopingAnim(playerid,"PED","WALK_FAT", 4.1, 1, 1, 1, 1, 1);
- case 4: LoopingAnim(playerid,"PED","WALK_FATOLD", 4.1, 1, 1, 1, 1, 1);
- case 5: LoopingAnim(playerid,"PED","WALK_OLD", 4.1, 1, 1, 1, 1, 1);
- case 6: LoopingAnim(playerid,"PED","WOMAN_WALKNORM", 4.1, 1, 1, 1, 1, 1);
- case 7: LoopingAnim(playerid,"PED","WOMAN_WALKSEXY", 4.1, 1, 1, 1, 1, 1);
- case 8: LoopingAnim(playerid,"MUSCULAR","MUSCLEWALK", 4.1, 1, 1, 1, 1, 1);
- case 9: LoopingAnim(playerid,"PED","WALK_WUZI", 4.1, 1, 1, 1, 1, 1);
- case 10: LoopingAnim(playerid, "PED", "WALK_civi", 4.1, 1, 1, 1, 1, 1);
- default: SysMsg(playerid, "Usage: /walk [1 - 10]");
- }
- return true;
- }
- CMD:relax(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "BAR", "BARman_idle", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:givedrink(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "BAR", "Barserve_give", 4.0, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:washhands(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "BD_FIRE", "wash_up", 4.0, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:pickupanim(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "Freeweights", "gym_free_pickup", 4.0, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:putdownitem(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "Freeweights", "gym_free_putdown", 4.0, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:swipecard(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "HEIST9", "Use_SwipeCard", 4.0, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:liftcase(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "MISC", "Case_pickup", 4.0, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:hitchhiker(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "MISC", "Hiker_Pose", 3.5, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:hitchhikel(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "MISC", "Hiker_Pose_L", 3.5, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:scratchcrotch(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "MISC", "Scratchballs_01", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:copmove(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "POLICE", "Cop_move_FWD", 4.0, 1, 1, 1, 1, 1);
- return true;
- }
- CMD:angry(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "RIOT", "RIOT_ANGRY", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:cheer(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "RIOT", "RIOT_ANGRY_B", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:loot(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "ROB_BANK", "CAT_Safe_Rob", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:fdrink(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "BAR", "dnk_stndF_loop", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:wavebye(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "BD_FIRE", "bd_gf_wave", 4.0, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:flex(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid, "Usage: /flex [1-2]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid, "benchpress", "gym_bp_celebrate", 4.1, 1, 0, 0, 0, 0);
- case 2: OnePlayAnim(playerid, "Freeweights", "gym_free_celebrate", 4.1, 0, 0, 0, 0, 0);
- default: SysMsg(playerid, "Usage: /flex [1-2]");
- }
- return true;
- }
- CMD:awwyeah(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "CASINO", "manwinB", 4.1, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:drugged(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid, "Usage: /drugged [1-4]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid, "CRACK", "crckidle3", 4.1, 1, 0, 0, 0, 0);
- case 2: LoopingAnim(playerid, "CRACK", "crckidle4", 4.1, 1, 0, 0, 0, 0);
- case 3: LoopingAnim(playerid, "PAULNMAC", "pnm_loop_A", 4.1, 1, 0, 0, 0, 0);
- case 4: LoopingAnim(playerid, "PAULNMAC", "pnm_loop_B", 4.1, 1, 0, 0, 0, 0);
- default: SysMsg(playerid, "Usage: /drugged [1-4]");
- }
- return true;
- }
- CMD:cashier(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid, "Usage: /cashier [1-2]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid, "INT_SHOP", "shop_cashier", 4.1, 1, 0, 0, 0, 0);
- case 2: LoopingAnim(playerid, "SHOP", "shp_serve_loop", 4.1, 1, 0, 0, 0, 0);
- default: SysMsg(playerid, "Usage: /cashier [1-2]");
- }
- return true;
- }
- CMD:hegebeface(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "PED", "facanger", 4.1, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:spotter(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "ON_LOOKERS", "panic_point", 4.1, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:shout(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid, "Usage: /shout [1-2]");
- switch(strval(params))
- {
- case 1: OnePlayAnim(playerid, "ON_LOOKERS", "shout_01", 4.1, 0, 0, 0, 0, 0);
- case 2: OnePlayAnim(playerid, "ON_LOOKERS", "shout_02", 4.1, 0, 0, 0, 0, 0);
- default: SysMsg(playerid, "Usage: /shout [1-2]");
- }
- return true;
- }
- CMD:lookaround(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "ON_LOOKERS", "lkaround_loop", 4.1, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:woah(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "PED", "handscower", 4.1, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:holdrifle(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "PED", "idle_armed", 4.1, 1, 0, 0, 0, 0);
- return true;
- }
- CMD:hailtaxi(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "PED", "idle_taxi", 4.0, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:jog(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid, "Usage: /jog [1-2]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid, "PED", "jog_maleA", 4.1, 1, 1, 1, 1, 1);
- case 2: LoopingAnim(playerid, "PED", "jog_femaleA", 4.1, 1, 1, 1, 1, 1);
- default: SysMsg(playerid, "Usage: /jog [1-2]");
- }
- return true;
- }
- CMD:sneak(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- LoopingAnim(playerid, "PED", "player_sneak", 4.1, 1, 1, 1, 0, 0);
- return true;
- }
- CMD:dj(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid, "Usage: /dj [1-4]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid, "SCRATCHING", "scdlulp", 4.1, 1, 0, 0, 0, 0);
- case 2: LoopingAnim(playerid, "SCRATCHING", "scdrdlp", 4.1, 1, 0, 0, 0, 0);
- case 3: LoopingAnim(playerid, "SCRATCHING", "scdrulp", 4.1, 1, 0, 0, 0, 0);
- case 4: LoopingAnim(playerid, "SCRATCHING", "scshrtl", 4.1, 1, 0, 0, 0, 0);
- default: SysMsg(playerid, "Usage: /dj [1-4]");
- }
- return true;
- }
- CMD:halt(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- OnePlayAnim(playerid, "SWAT", "swt_lkt", 4.1, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:blowjob(playerid, params[])
- {
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are unable to perform this command as you are downed.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_RED, "You must be on-foot to perform this animation.");
- if(isnull(params)) return SysMsg(playerid, "Usage: /blowjob [1-4]");
- switch(strval(params))
- {
- case 1: LoopingAnim(playerid, "BLOWJOBZ", "BJ_COUCH_LOOP_W", 4.1, 1, 0, 0, 1, 1);
- case 2: LoopingAnim(playerid, "BLOWJOBZ", "BJ_COUCH_LOOP_P", 4.1, 1, 0, 0, 1, 1);
- case 3: LoopingAnim(playerid, "BLOWJOBZ", "BJ_STAND_LOOP_W", 4.1, 1, 0, 0, 1, 1);
- case 4: LoopingAnim(playerid, "BLOWJOBZ", "BJ_STAND_LOOP_P", 4.1, 1, 0, 0, 1, 1);
- default: SysMsg(playerid, "Usage: /blowjob [1-4]");
- }
- return true;
- }
- CMD:facepalm(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- format(gstr, sizeof(gstr),"* %s sighs and then facepalms. *", NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- UnlockAchievement(playerid, 32);
- if(!IsPlayerInAnyVehicle(playerid)) OnePlayAnim(playerid, "MISC", "plyr_shkhead", 1.25, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:breathe(playerid, params[])
- {
- new index = GetFreePlayerObjectIndex(playerid);
- if(index == -1) return SysMsg(playerid, "You cannot use this feature as you have too many attached objects.");
- SetPlayerAttachedObject(playerid, index, 18677, 2, 0, 0.17, -1.6, 0, 0, 0, 1, 1, 1);
- SetTimerEx("remove_ostick", 3333, 0, "ii", playerid, index);
- return true;
- }
- CMD:vape(playerid) return SysMsg(playerid, "Frick off, hecker.");
- GREENSIDE::remove_ostick(playerid, index)
- {
- RemovePlayerAttachedObject(playerid, index);
- return true;
- }
- //End of animations
- //==================== Fim ==================================//
- //11 Fishing
- //Fishing
- //Fishing
- CMD:fish(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- new fishingType = -1, v, Float:vPos[3], Float:ReeferPos[3];
- GetVehiclePos(ReeferID(), ReeferPos[0], ReeferPos[1], ReeferPos[2]);
- if(GetPlayerState(playerid) == 1 && (IsPlayerInRangeOfPoint(playerid,6.0,2111.0522,-98.3380,2.1039) || IsPlayerInRangeOfPoint(playerid, 6.0, -793.7495,-1947.7505,6.7726))) fishingType = 1;
- if(fishingType == -1)
- {
- if(IsPlayerInAnyVehicle(playerid)) v = GetPlayerVehicleID(playerid);
- else v = GetClosestVehicle(playerid);
- if(v == INVALID_VEHICLE_ID || !IsBoat(v)) return SysMsg(playerid,"You must be at the fishing spot or on a Reefer.");
- GetVehiclePos(v, vPos[0], vPos[1], vPos[2]);
- }
- if(v == ReeferID()) fishingType = 2;
- else if(IsOwnedCar(v) && IsBoat(v) && v != ReeferID()) fishingType = 3;
- else if(IsPlayerInRangeOfPoint(playerid,5.0,ReeferPos[0], ReeferPos[1], ReeferPos[2]) && !IsPlayerInRangeOfPoint(playerid,6.0,2111.0522,-98.3380,2.1039)) fishingType = 2;
- else if(IsPlayerInRangeOfPoint(playerid,5.0, vPos[0], vPos[1], vPos[2])) fishingType = 3;
- if(fishingType == -1) return SysMsg(playerid,"You must be at the fishing spot or on a Reefer.");
- if(fishingType == 2 && IsPlayerInRangeOfPoint(playerid, 100.0, 2105.352050, -96.437431, 0.725863)) return SysMsg(playerid,"Please take the Reefer away from the dock before fishing.");
- if(fishingType == 3 && IsPlayerInRangeOfPoint(playerid, 300.0, 2105.352050, -96.437431, 0.725863)) return SysMsg(playerid, "Please take the boat far away from the Palomino Creek Bay before fishing.");
- if(Inventory[playerid][FishingPermit] == 0) return SysMsg(playerid,"You don't have a fishing permit.");
- if(Inventory[playerid][FishingRod] == 0) return SysMsg(playerid,"You don't have a fishing rod.");
- if(FishSpamTime[playerid] != 0) return SysMsg(playerid,"Please wait before fishing again.");
- if(Inventory[playerid][FishingBait] <= 0) return SysMsg(playerid,"You have no bait left, go to the fishing shop to buy some.");
- if(FishWeight[playerid][0] != -1 && FishWeight[playerid][1] != -1 && FishWeight[playerid][2] != -1 && FishWeight[playerid][3] != -1 && FishWeight[playerid][4] != -1) return SysMsg(playerid,"You can't hold anymore fish.");
- FishingRodHealth[playerid] --;
- MySQLUpdateInt(SQLID[playerid], "FishingRodHealth", FishingRodHealth[playerid], "players");
- if(FishingRodHealth[playerid] <= 0 && Inventory[playerid][FishingRod] == 1)
- {
- Inventory[playerid][FishingRod] = 0;
- FishingRodHealth[playerid] = 0;
- MySQLUpdateInt(SQLID[playerid], "FishingRod", Inventory[playerid][FishingRod], "players");
- format(gstr, sizeof(gstr),"* %s's rod snaps into two pieces. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid,COLOR_DARKBLUE,"Your fishing rod has snapped in half due to its condition.");
- return true;
- }
- TogglePlayerControllable(playerid, 0);
- if(AttachedObjects[playerid][7][aoModelID] == 0)
- {
- AttachedObjects[playerid][7][aoModelID] = 18632;
- AttachedObjects[playerid][7][aoBone] = 6;
- SetPlayerAttachedObject(playerid, 7, 18632, 6, 0.1, 0.05, 0, 0, 180, 180, 0);
- }
- Inventory[playerid][FishingBait] --;
- MySQLUpdateInt(SQLID[playerid], "FishingBait", Inventory[playerid][FishingBait], "players");
- new rand;
- if(fishingType == 1)
- {
- rand = random(5) + 5;
- format(sgstr, sizeof(sgstr),"* %s starts to fish off the jetty... *",NameRP(playerid));
- }
- else if(fishingType == 2)
- {
- rand = random(10) + 10;
- format(sgstr, sizeof(sgstr),"* %s starts to fish off the Reefer... *",NameRP(playerid));
- }
- else if(fishingType == 3)
- {
- fishingType = 2; //set type back to 2 to trigger boat fishing
- rand = random(10) + 10;
- format(sgstr, sizeof(sgstr),"* %s starts to fish off the %s... *",NameRP(playerid), GetVehicleName(v));
- }
- FishSpamTime[playerid] = 1;
- OnePlayAnim(playerid, "SAMP", "FishingIdle", 10.0, 0, 0, 0, 1, rand*1000);
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SetTimerEx("OnPlayerFish",(rand*1000),0,"ii",playerid, fishingType);
- return true;
- }
- CMD:fishes(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- for(new f = 0; f < 5; f++)
- {
- if(FishWeight[playerid][f] == -1) SendClientMessageF(playerid,COLOR_DARKBLUE, "Fish Slot %i: Name: n/a Weight: n/a",f+1);
- else SendClientMessageF(playerid,COLOR_DARKBLUE, "Fish Slot %i: Name: %s Weight: %i Lbs",f+1,FishName[playerid][f],FishWeight[playerid][f]);
- }
- SendClientMessageF(playerid,COLOR_DARKBLUE, "Fishing Bait: %i, My Biggest Fish Record: %i Lbs, Rod Durability: %i %%",Inventory[playerid][FishingBait],BiggestFish[playerid],FishingRodHealth[playerid]);
- return true;
- }
- CMD:showfish(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid, "Usage: /showfish [playerid or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playa, x, y, z);
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z)) return SysMsg(playerid, "You must be closer to the player.");
- SendClientMessageF(playa, COLOR_DARKBLUE, "%s's fish.", NameRP(playerid));
- for(new f = 0; f < 5; f++)
- {
- if(FishWeight[playerid][f] == -1) SendClientMessageF(playa, COLOR_DARKBLUE, "Fish Slot %i: Name: n/a Weight: n/a", f + 1);
- else SendClientMessageF(playa, COLOR_DARKBLUE, "Fish Slot %i: Name: %s Weight: %i Lbs", f + 1, FishName[playerid][f], FishWeight[playerid][f]);
- }
- return true;
- }
- CMD:sellfish(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(!IsPlayerInRangeOfPoint(playerid,5.0,2150.601318,-100.634284,2.755812) && !IsPlayerInRangeOfPoint(playerid, 4.5, -800.5269,-1922.8231,9.1117)) return SysMsg(playerid,"You are not at the fishing shop.");
- if(FishWeight[playerid][0] == -1 && FishWeight[playerid][1] == -1 && FishWeight[playerid][2] == -1 && FishWeight[playerid][3] == -1 && FishWeight[playerid][4] == -1) return SysMsg(playerid,"You have no fish.");
- gstr[0] = EOS;
- for(new f = 0; f < 5; f++)
- {
- if(FishWeight[playerid][f] != -1)
- {
- new fishValue = 3 * FishWeight[playerid][f];
- format(sgstr, sizeof(sgstr), "%s - %iLbs - Worth $%i\n", FishName[playerid][f], FishWeight[playerid][f], fishValue);
- strcat(gstr, sgstr);
- }
- }
- strcat(gstr, "\nSell All");
- Dialog_Show(playerid, FishSell, DIALOG_STYLE_LIST, "Sell Fish", gstr, "Sell", "Cancel");
- return true;
- }
- CMD:putback(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- new atFishSpot = 0;
- if(GetPlayerSurfingVehicleID(playerid) == ReeferID()) atFishSpot = 1;
- if(GetPlayerVehicleID(playerid) == ReeferID()) atFishSpot = 1;
- if(GetPlayerState(playerid) == 1 && IsPlayerInRangeOfPoint(playerid,6.0,2111.0522,-98.3380,2.1039) || IsPlayerInRangeOfPoint(playerid, 6.0, -793.7495,-1947.7505,6.7726)) atFishSpot = 1;
- new Float:ReeferPos[3]; GetVehiclePos(ReeferID(), ReeferPos[0], ReeferPos[1], ReeferPos[2]);
- if(IsPlayerInRangeOfPoint(playerid,5.0,ReeferPos[0], ReeferPos[1], ReeferPos[2]) && !IsPlayerInRangeOfPoint(playerid,6.0,2111.0522,-98.3380,2.1039)) atFishSpot = 1;
- if(atFishSpot == 0) return SysMsg(playerid,"You must be at the fishing spot or on a Reefer to put fish back.");
- if(FishWeight[playerid][0] == -1 && FishWeight[playerid][1] == -1 && FishWeight[playerid][2] == -1 && FishWeight[playerid][3] == -1 && FishWeight[playerid][4] == -1) return SysMsg(playerid,"You have no fish.");
- new SlotToUse;
- if(sscanf(params, "i", SlotToUse)) return SysMsg(playerid,"Usage: /putback [fish number] *Hint: Uses /fishes for fish numbers*");
- if(SlotToUse > 5 || SlotToUse < 1) return SysMsg(playerid,"Invalid Fish Id! (1 to 5 only)");
- SlotToUse --;
- if(FishWeight[playerid][SlotToUse] == -1) return SysMsg(playerid,"No fish in that slot.");
- format(gstr, sizeof(gstr),"* %s throws a %s back in the water. *",NameRP(playerid),FishName[playerid][SlotToUse]);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"You put the %i Lb %s back into the water.",FishWeight[playerid][SlotToUse],FishName[playerid][SlotToUse]);
- SendClientMessage(playerid,COLOR_SKYBLUE,gstr);
- FishWeight[playerid][SlotToUse] = -1;
- FishName[playerid][SlotToUse][0] = EOS;
- for(new x = 0; x < 5; x++)
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Fish%iName = %i, Fish%iWeight = %i WHERE id = %i", x + 1, FishName[playerid][x], x+ 1, FishWeight[playerid][x], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- }
- return true;
- }
- CMD:putallback(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- new atFishSpot = 0;
- if(GetPlayerSurfingVehicleID(playerid) == ReeferID()) atFishSpot = 1;
- if(GetPlayerVehicleID(playerid) == ReeferID()) atFishSpot = 1;
- if(GetPlayerState(playerid) == 1 && IsPlayerInRangeOfPoint(playerid,6.0,2111.0522,-98.3380,2.1039) || IsPlayerInRangeOfPoint(playerid, 6.0, -793.7495,-1947.7505,6.7726)) atFishSpot = 1;
- new Float:ReeferPos[3]; GetVehiclePos(ReeferID(), ReeferPos[0], ReeferPos[1], ReeferPos[2]);
- if(IsPlayerInRangeOfPoint(playerid,5.0,ReeferPos[0], ReeferPos[1], ReeferPos[2]) && !IsPlayerInRangeOfPoint(playerid,6.0,2111.0522,-98.3380,2.1039)) atFishSpot = 1;
- if(atFishSpot == 0) return SysMsg(playerid,"You must be at the fishing spot or on a Reefer to put fish back.");
- if(FishWeight[playerid][0] == -1 && FishWeight[playerid][1] == -1 && FishWeight[playerid][2] == -1 && FishWeight[playerid][3] == -1 && FishWeight[playerid][4] == -1) return SysMsg(playerid,"You have no fish.");
- new FishCount = 0;
- for(new F = 0; F < 5; F++)
- {
- if(FishWeight[playerid][F] != -1)
- {
- FishWeight[playerid][F] = -1;
- FishName[playerid][F][0] = EOS;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Fish%iName = %i, Fish%iWeight = %i WHERE id = %i", F + 1, FishName[playerid][F], F+ 1, FishWeight[playerid][F], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- FishCount++;
- }
- }
- format(gstr, sizeof(gstr),"* %s throws %i fish back in the water. *",NameRP(playerid),FishCount);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"You put %i fish back into the water.",FishCount);
- SendClientMessage(playerid,COLOR_SKYBLUE,gstr);
- return true;
- }
- stock GetCurrentCrateSlots(sqlid)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT NULL FROM fishcrates WHERE CrateOwner = %i", sqlid);
- new Cache:result = mysql_query(conn, mquery);
- new num = cache_num_rows();
- cache_delete(result);
- return num;
- }
- stock GetMaxCrateSlots(type)
- {
- switch(type)
- {
- case 1: return 100;
- case 2: return 250;
- case 3: return 500;
- }
- return 100;
- }
- GREENSIDE::ShowCrateInfo(playerid)
- {
- new weight = cache_get_field_content_int(0, "weight"), count = cache_get_field_content_int(0, "rows");
- SendClientMessageF(playerid, COLOR_WHITE, "Total Weight: %i (Worth $%s)", weight, format_cash(weight * 3));
- SendClientMessageF(playerid, COLOR_WHITE, "Total Fish: %i", count);
- }
- CMD:sellcrate(playerid)
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInRangeOfPoint(playerid,5.0,2150.601318,-100.634284,2.755812) && !IsPlayerInRangeOfPoint(playerid, 4.5, -800.5269,-1922.8231,9.1117)) return SysMsg(playerid,"You are not at the fishing shop.");
- return true;
- }
- GREENSIDE::ProcessCrateSale(playerid)
- {
- new weight = cache_get_field_content_int(0, "weight"), value = (weight * 3), count = cache_get_field_content_int(0, "rows");
- SetPVarInt(playerid, "SellingFishWeight", weight);
- SetPVarInt(playerid, "SellingFishCount", count);
- format(sgstr, sizeof(sgstr), "Are you sure you'd like to sell this fishing crate?\nThere are currently %i fish in the crate totaling %i pounds, valued at $%s.", count, weight, format_cash(value));
- Dialog_Show(playerid, FishCrateSell, DIALOG_STYLE_MSGBOX, "Are You Sure?", sgstr, "Yes", "No");
- return true;
- }
- CMD:givemeafish(playerid)
- {
- if(!IsPlayerAdmin(playerid)) return true;
- if(FishWeight[playerid][0] != -1 && FishWeight[playerid][1] != -1 && FishWeight[playerid][2] != -1 && FishWeight[playerid][3] != -1 && FishWeight[playerid][4] != -1) return SysMsg(playerid,"You can't hold anymore fish.");
- OnPlayerFish(playerid, 2);
- return true;
- }
- stock GetFishingCrateModelID(crateid)
- {
- switch(crateid)
- {
- case 1: return 1271; //small
- case 2: return 3800; //medium
- case 3: return 3798; //large
- }
- return true;
- }
- stock GetFreeFishCrateSlot()
- {
- for(new c = 0; c < MAX_FISHCRATES; c++)
- {
- if(FishingCrates[c][CrateID] == -1)
- {
- return c;
- }
- }
- return true;
- }
- stock ClearFishingCrateData(crateid)
- {
- FishingCrates[crateid][CrateID] = 0;
- FishingCrates[crateid][FishingCrateObject] = INVALID_OBJECT_ID;
- FishingCrates[crateid][CrateOwner] = 0;
- FishingCrates[crateid][CrateType] = 0;
- FishingCrates[crateid][CrateVehicle] = 0;
- FishingCrates[crateid][CrateLocX] = 0.0;
- FishingCrates[crateid][CrateLocY] = 0.0;
- FishingCrates[crateid][CrateLocZ] = 0.0;
- return true;
- }
- //end of fishing
- //FINAL SISTEMA DE PESCA
- //==================== Fim ==================================//
- //Death system commands
- CMD:injuries(playerid, params[])
- {
- new playa = -1, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]", name)) return SysMsg(playerid,"Use: /injuries [player id ou MaskID]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(IsSpectating[playa] >= 0) return SysMsg(playerid,"You must be close to the player to view injuries.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,2.5,tX,tY,tZ) && !IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid,"You must be close to the player view injuries.");
- ShowInjuriesForPlayer(playerid, playa);
- return true;
- }
- CMD:helpup(playerid, params[])//ajudar levantar
- {
- if(!Logged{playerid}) return true;
- new playa = -1, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]", name)) return SysMsg(playerid,"Usage: /helpup [player id or MaskID]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(!Dead{playa}) return SysMsg(playerid, "This player is not injured.");
- if(playa == playerid) return SysMsg(playerid, "You may not help yourself up.");
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, PlayerPosX(playa), PlayerPosY(playa), PlayerPosZ(playa))) return SysMsg(playerid, "You must be near this player to help them up.");
- new nlwcount = 0, lwcount = 0;
- for(new x = 0; x < HitCount[playa]; x++)
- {
- switch(Injuries[playa][x][pWeaponID])
- {
- case 22..34,38: lwcount ++;
- default: nlwcount ++;
- }
- }
- if(lwcount >= 1) return SysMsg(playerid, "This player has a lethal wound. They need proper medical treatment.");
- else
- {
- RevivePlayer(playa);
- SetPlayerHealthEx(playa, 50.0);
- SendClientMessageF(playa, COLOR_WHITE, "%s has helped you onto your feet.", NameRP(playerid));
- format(gstr, sizeof(gstr),"* %s helps %s onto their feet. *", NameRP(playerid), NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- return true;
- }
- //Job commands
- CMD:jobs(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- SendClientMessage(playerid,COLOR_ORANGE,"Job Statistics:");
- if(Job[playerid] > 0)
- {
- new JobName[50];
- switch(Job[playerid])
- {
- case JOB_MECHANIC: JobName = "Mechanic";
- case JOB_DRUGDEALER: JobName = "Drug Dealer";
- case JOB_TAXI: JobName = "Taxi Driver";
- }
- SendClientMessageF(playerid,COLOR_YELLOW,"You Are Currently Working As: %s (Job Spam Timer: %i Minutes)", JobName, JobSpamTime[playerid]);
- }
- SendClientMessageF(playerid,COLOR_YELLOW,"TRUCKER: Times Completed: %i, Level: %i (%i jobs until levelup), Spam Timer: %i minutes", TruckStat[playerid], TruckLevel[playerid], GetAmountTillJobLevelup(1, TruckLevel[playerid], TruckStat[playerid]), TruckSpamTime[playerid]);
- SendClientMessageF(playerid,COLOR_YELLOW,"PIZZA DELIVERY: Times Completed: %i, Level: %i (%i jobs until levelup), Spam Timer: %i minutes", DeliverStat[playerid], DeliverLevel[playerid], GetAmountTillJobLevelup(3, DeliverLevel[playerid], DeliverStat[playerid]), DeliverSpamTime[playerid]);
- SendClientMessageF(playerid,COLOR_YELLOW,"COALMINER: Times Completed: %i, Level: %i (%i jobs until levelup), Spam Timer: %i minutes", CoalmineStat[playerid], CoalmineLevel[playerid], GetAmountTillJobLevelup(4, CoalmineLevel[playerid], CoalmineStat[playerid]), CoalmineSpamTime[playerid]);
- SendClientMessageF(playerid,COLOR_YELLOW,"TRASH COLLECTOR: Times Completed: %i, Level: %i (%i jobs until levelup), Spam Timer: %i minutes", TrashStat[playerid], TrashLevel[playerid], GetAmountTillJobLevelup(5, TrashLevel[playerid], TrashStat[playerid]), TrashSpamTime[playerid]);
- return true;
- }
- CMD:jobinfo(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsPlayerInRangeOfPoint(playerid, 2.5, 883.109497, 2261.683105, 238.237808) || IsPlayerInRangeOfPoint(playerid, 2.5, 2260.0586,-66.4948,1004.6469) || IsPlayerInRangeOfPoint(playerid, 2.5, 922.06030, 2380.831787, 246.462112) || IsPlayerInRangeOfPoint(playerid, 2.5, 758.2207,-29.9649,1008.6959) || IsPlayerInRangeOfPoint(playerid, 2.5, 1184.8542,1349.2084,999.1968) || IsPlayerInRangeOfPoint(playerid, 2.5, 1229.5603,186.1047,2091.3569))
- {
- gstr[0] = EOS;
- strcat(gstr, "JOBS\n");
- strcat(gstr, "Mechanic\n");
- strcat(gstr, "Working as a Mechanic means you can repair, mod and spray vehicles.\n");
- strcat(gstr, "Location: Dillimore Pay N Spray\n");
- strcat(gstr, "Pay: $300 BASE per Payday\n\n");
- strcat(gstr, "SIDE JOBS\n");
- strcat(gstr, "This type of work is a one-off job, although can be repeated, to earn some quick cash.\n");
- strcat(gstr, "Bus Driver - Blueberry\n");
- strcat(gstr, "Coal Miner - Hunter Quarry\n");
- strcat(gstr, "Pizza Delivery - Montgomery\n");
- strcat(gstr, "Trash Collector - Bone County\n");
- strcat(gstr, "Trucking - Blueberry\n");
- ShowMessage(playerid, "Employment Information", gstr, "Done");
- }
- return true;
- }
- CMD:getjob(playerid, params[])//pegartrabalho//
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(PlayerLevel[playerid] < 2) return SysMsg(playerid,"You must be at least level 2 for a job.");
- if(Job[playerid] > 0) return SysMsg(playerid,"You already have a job, use /quitjob first.");
- if(JobSpamTime[playerid] > 0) return SysMsgF(playerid, "You must wait %i minutes to apply for a new job.", JobSpamTime[playerid]);
- if(IsPlayerInRangeOfPoint(playerid, 3.5, 723.706787, -464.991302, 16.335937)) //Mechanic Job
- {
- Job[playerid] = JOB_MECHANIC;
- MySQLUpdateInt(SQLID[playerid], "Job", Job[playerid], "players");
- if(IsDonator[playerid] >= 2) JobSpamTime[playerid] = 0;
- else JobSpamTime[playerid] = 30;
- SendClientMessage(playerid, COLOR_WHITE, "Your new job is a Mechanic. To see what you can do, look at '/Help Job'.");
- MySQLUpdateInt(SQLID[playerid], "JobSpamTime", JobSpamTime[playerid], "players");
- }
- if(IsPlayerInRangeOfPoint(playerid, 3.5, 196.133499, -232.079284, 1.778618)) //Drug Dealer Job
- {
- Job[playerid] = JOB_DRUGDEALER;
- MySQLUpdateInt(SQLID[playerid], "Job", Job[playerid], "players");
- if(IsDonator[playerid] >= 2) JobSpamTime[playerid] = 0;
- else JobSpamTime[playerid] = 30;
- SendClientMessage(playerid, COLOR_WHITE, "Your new job is a Drug Dealer. To see what you can do, look at '/Help Job'.");
- MySQLUpdateInt(SQLID[playerid], "JobSpamTime", JobSpamTime[playerid], "players");
- }
- if(IsPlayerInRangeOfPoint(playerid, 3.5, 1235.2996, 173.2005, 2091.3513) && GetPlayerVirtualWorld(playerid) == 1) //Taxi Job // 40073 old
- {
- new count = 0;
- for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(VehicleData[v][VehicleOwnerSQLID] == SQLID[playerid] && IsSuitableTaxiCar(v))
- {
- count++;
- break;
- }
- }
- if(count != 0)
- {
- Job[playerid] = JOB_TAXI;
- MySQLUpdateInt(SQLID[playerid], "Job", Job[playerid], "players");
- if(IsDonator[playerid] >= 2) JobSpamTime[playerid] = 0;
- else JobSpamTime[playerid] = 30;
- SendClientMessage(playerid, COLOR_WHITE, "Your new job is a Taxi Driver. To see what you can do, look at '/Help Job'.");
- MySQLUpdateInt(SQLID[playerid], "JobSpamTime", JobSpamTime[playerid], "players");
- }
- else return SysMsg(playerid, "You must have one of the following vehicles to obtain this job: Taxi, Cabbie, Moonbeam, Admiral or Premier.");
- }
- return true;
- }
- CMD:quitjob(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Job[playerid] == 0) return SysMsg(playerid,"You have no Job to quit from.");
- if(JobSpamTime[playerid] > 0) return SysMsgF(playerid, "Job Spam: You still have %i minutes left before you can quit.", JobSpamTime[playerid]);
- new oldJobName[25];
- switch(Job[playerid])
- {
- case JOB_MECHANIC: oldJobName = "a Mechanic";
- case JOB_DRUGDEALER: oldJobName = "a Drug Dealer";
- case JOB_TAXI: oldJobName = "a Taxi Driver";
- }
- Job[playerid] = 0;
- if(IsDonator[playerid] >= 2) JobSpamTime[playerid] = 0;
- else JobSpamTime[playerid] = 30;
- JobDuty[playerid] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Job = 0, JobSpamTime = %i WHERE id = %i", JobSpamTime[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_WHITE, "You have quit your job. You are no longer %s.", oldJobName);
- return true;
- }
- CMD:jobduty(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- new status[10], skin;
- if(sscanf(params, "s[4]i", status, skin)) return SysMsg(playerid,"Usage: /jobduty ['on' or 'off'] [work clothes 1/2/3/4]");
- if(Job[playerid] == JOB_TAXI)
- {
- if(strcmp("on",status,true) == 0)
- {
- if(JobDuty[playerid] == 1) return SysMsg(playerid, "You are already on duty.");
- new vehicleid = GetPlayerVehicleID(playerid);
- if(!IsSuitableTaxiCar(vehicleid)) return SysMsg(playerid, "You must be a in a suitable taxi vehicle to go on duty. (Taxi, Cabbie, Owned Premier, Moonbeam or Admiral)");
- switch(GetVehicleModel(vehicleid))
- {
- case 445: vTaxiSign[vehicleid] = CreateVehicleObject(19308, vehicleid, 0.0, 0.0, 0.915, 0.0, 0.0, 90.0);
- case 426: vTaxiSign[vehicleid] = CreateVehicleObject(19308, vehicleid, 0.0, 0.0, 0.9325, 0.0, 0.0, 90.0);
- case 418: vTaxiSign[vehicleid] = CreateVehicleObject(19308, vehicleid, 0.0, 0.0, 1.12, 0.0, 0.0, 90.0);
- }
- MyTaxiCar[playerid] = vehicleid;
- JobDuty[playerid] = 1;
- format(gstr, sizeof(gstr),"[Cabbie Co] %s is now ON duty, call 444 if you need a taxi.", NameEx(playerid));
- SendClientMessageToAllLogged(COLOR_YELLOW,gstr);
- SendClientMessage(playerid, COLOR_WHITE, "You are now an on duty {FBFF00}Taxi Driver.");
- return true;
- }
- else if(strcmp("off",status,true) == 0)
- {
- if(JobDuty[playerid] == 0) return SysMsg(playerid, "You are already off duty.");
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a vehicle to use this.");
- if(!IsSuitableTaxiCar(GetPlayerVehicleID(playerid))) return SysMsg(playerid, "You must be in a suitable taxi vehicle.");
- new v = GetPlayerVehicleID(playerid);
- if(vTaxiSign[v] != INVALID_OBJECT_ID) DestroyDynamicObjectEx(vTaxiSign[v], "vTaxiSign[v]");
- vTaxiSign[v] = INVALID_OBJECT_ID;
- MyTaxiCar[playerid] = 0;
- JobDuty[playerid] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "You are now an off duty {FBFF00}Taxi Driver.");
- return true;
- }
- }
- return true;
- }
- //taxi commands
- CMD:forcefare(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Job[playerid] == JOB_TAXI)
- {
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /forcefare [playerid id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- new vehicleid = GetPlayerVehicleID(playerid);
- if(!IsSuitableTaxiCar(vehicleid)) return SysMsg(playerid,"You must be in a suitable vehicle to use this.");
- if(TaxiFareID[playerid] > -1) return SysMsg(playerid,"You already have a fare.");
- if(GetPlayerVehicleID(playa) != vehicleid) return SysMsg(playerid,"They must be in the Taxi with you.");
- if(TaxiMeter[playerid] == 1) return SysMsg(playerid,"The meter must be off.");
- TaxiForceFare[playerid] = playa;
- format(gstr, sizeof(gstr),"Taxi Driver %s would like to confirm you need a ride. Use '/accept taxi' to continue or get out. (Fare rate will be $%i)", NameEx(playerid), MyFareCharge[playerid]);
- SendClientMessage(playa,COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"Now offering %s a ride, they must first accept.", NameEx(playa));
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- else return SysMsg(playerid,"You must be a Taxi driver to use this.");
- return true;
- }
- CMD:setfare(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(TaxiForceFare[playerid] > -1) return SysMsg(playerid,"You cant change the fare while you have a pending customer.");
- if(Job[playerid] == JOB_TAXI)
- {
- new newfare = -1;
- if(sscanf(params, "i", newfare)) return SysMsg(playerid,"Usage: /setfare [amount 0-25]");
- if(newfare < 0 || newfare > 25) return SysMsg(playerid,"The fare must be between 0 and 25.");
- if(newfare > MyFareCharge[playerid] && TaxiFareID[playerid] > -1) return SysMsg(playerid,"You cannot increase the fare when you have a passenger, feel free to decrease it though.");
- if(MyFareCharge[playerid] == newfare) return SysMsg(playerid,"Your fare is already set to that.");
- new oldfare = MyFareCharge[playerid];
- MyFareCharge[playerid] = newfare;
- MySQLUpdateInt(SQLID[playerid], "FareRate", MyFareCharge[playerid], "players");
- if(TaxiFareID[playerid] > -1)
- {
- format(gstr, sizeof(gstr),"Your taxi driver has changed the fare rate to {4BB74C}$%i{FFFFFF}. (It was previously $%i)", MyFareCharge[playerid], oldfare);
- SendClientMessage(TaxiFareID[playerid],COLOR_WHITE,gstr);
- }
- format(gstr, sizeof(gstr),"Your new fare will increment by {4BB74C}$%i{FFFFFF} from now on. (It was $%i)", MyFareCharge[playerid], oldfare);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- else return SysMsg(playerid,"You must be a Taxi driver to use this.");
- return true;
- }
- CMD:myfare(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Job[playerid] == JOB_TAXI)
- {
- format(gstr, sizeof(gstr),"Your fare rate is {4BB74C}$%i", MyFareCharge[playerid]);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- else return SysMsg(playerid,"You must be a Taxi driver to use this.");
- return true;
- }
- CMD:cancelfare(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Job[playerid] == JOB_TAXI)
- {
- if(TaxiFareID[playerid] == -1) return SysMsg(playerid,"You do not have a fare to cancel.");
- new playa = TaxiFareID[playerid];
- TaxiFare[playa] = 0;
- TaxiFareID[playerid] = -1;
- TaxiMeter[playerid] = 0;
- SendClientMessage(playa, COLOR_WHITE, "The driver has cancelled your fare.");
- }
- else return SysMsg(playerid,"You must be a Taxi driver to use this.");
- return true;
- }
- CMD:canceltaxi(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(PlayerCalledTaxi[playerid] == 0) return SysMsg(playerid,"You have not called a Taxi.");
- new rnd = random(5);
- foreach(new Taxi: Player)
- {
- if(Job[Taxi] == JOB_TAXI && JobDuty[Taxi] == 1)
- {
- SetPlayerMarkerForPlayer(Taxi, playerid, 0xFFFFFF00);
- switch(rnd)
- {
- case 0: SendClientMessage(Taxi, COLOR_YELLOW, "Central Dispatcher: {FFFFFF}\"Forget 'bout that call, they don't want a taxi anymore.\" ((a call was cancelled, marker removed))");
- case 1: SendClientMessage(Taxi, COLOR_YELLOW, "Central Dispatcher: {FFFFFF}\"You guys are losing my customers! Stop reading newspapers and actually collect them!\" ((a call was cancelled, marker removed))");
- case 2: SendClientMessage(Taxi, COLOR_YELLOW, "Central Dispatcher: {FFFFFF}\"My god do you even listen to me! When a call comes in your supposed to pick them up not ignore them!\" ((a call was cancelled, marker removed))");
- case 3: SendClientMessage(Taxi, COLOR_YELLOW, "Central Dispatcher: {FFFFFF}\"There goes another paying customer! I would be better doing this myself.\" ((a call was cancelled, marker removed))");
- case 4: SendClientMessage(Taxi, COLOR_YELLOW, "Central Dispatcher: {FFFFFF}\"Ignore that job, they called up and cancelled.\" ((a call was cancelled, marker removed))");
- }
- }
- }
- PlayerCalledTaxi[playerid] = 0;
- TaxiFare[playerid] = 0;
- SendClientMessage(playerid,COLOR_YELLOW,"[Taxi Cancelled] Don't forget our number is 444 if you need us again!");
- return true;
- }
- CMD:meteron(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Job[playerid] == JOB_TAXI)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(!IsSuitableTaxiCar(vehicleid)) return SysMsg(playerid,"You must be in a suitable vehicle to use this.");
- if(TaxiFareID[playerid] == -1) return SysMsg(playerid,"You have no fare in your vehicle.");
- if(GetPlayerVehicleID(TaxiFareID[playerid]) != vehicleid) return SysMsg(playerid,"Your fare is not in your vehicle.");
- if(TaxiMeter[playerid] == 1) return SysMsg(playerid,"The meter is already on.");
- TaxiMeter[playerid] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "Meter is now on.");
- format(gstr, sizeof(gstr),"* %s switches on the fare meter in the %s. *", NameEx(playerid), GetVehicleName(vehicleid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else return SysMsg(playerid,"You must be a Taxi driver to use this.");
- return true;
- }
- CMD:meteroff(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Job[playerid] == JOB_TAXI)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(!IsSuitableTaxiCar(vehicleid)) return SysMsg(playerid,"You must be in a suitable vehicle to use this.");
- if(TaxiMeter[playerid] == 0) return SysMsg(playerid,"The meter is already off.");
- TaxiMeter[playerid] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "Meter is now off.");
- format(gstr, sizeof(gstr),"* %s switches off the fare meter in the %s. *", NameEx(playerid), GetVehicleName(vehicleid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else return SysMsg(playerid, "You must be a Taxi Driver to use this.");
- return true;
- }
- CMD:refreshmap(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Job[playerid] == JOB_TAXI)
- {
- new count = 0;
- foreach(new i: Player)
- {
- if(PlayerCalledTaxi[i] == 1 && Logged{i})
- {
- count ++;
- SetPlayerMarkerForPlayer(i, playerid, COLOR_YELLOW);
- }
- }
- if(count == 0) return SendClientMessage(playerid, COLOR_WHITE, "No new customers were added to your mini-map.");
- SendClientMessage(playerid, COLOR_WHITE, "Your mini-map has been refreshed with all new customers waiting for a taxi.");
- }
- else return SysMsg(playerid,"You must be a Taxi driver to use this.");
- return true;
- }
- CMD:clearcaller(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Job[playerid] != JOB_TAXI) return SysMsg(playerid,"You must be in RTCR to use this feature.");
- new playa;
- if(sscanf(params, "u", playa)) return SysMsg(playerid, "Usage: /clearcaller [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(PlayerCalledTaxi[playa] == 0) return SysMsg(playerid,"No marker to remove.");
- foreach(new i: Player)
- {
- if(Logged{i} && Job[i] == JOB_TAXI)
- {
- SendClientMessageF(i, COLOR_YELLOW, "(( [TAXI]: %s has cancelled %s's request (( Marker has been removed ))", NameEx(playerid), NameEx(playa));
- SetPlayerMarkerForPlayer(i, playa, 0xFFFFFF00);
- }
- }
- return true;
- }
- //mechanic commands
- CMD:viewmechaniccalls(playerid, params[])
- {
- if(Job[playerid] != JOB_MECHANIC) return SysMsg(playerid, "You must be a mechanic to use this command.");
- new calls = 0;
- foreach(new i: Player)
- {
- if(HasActiveMechanicCall{i} && i != playerid)
- {
- sgstr[0] = EOS;
- strunpack(sgstr, MechanicCall[i]);
- SendSplitMessageF(playerid, COLOR_WHITE, "[Mechanic Request]: Phone Number: %i | Details: %s", PhoneData[i][pNumber], sgstr);
- calls ++;
- }
- }
- if(calls == 0) return SysMsg(playerid, "There are currently no active mechanic calls.");
- return true;
- }
- CMD:clearmechaniccall(playerid, params[])
- {
- if(Job[playerid] != JOB_MECHANIC) return SysMsg(playerid, "You must be a mechanic to use this command.");
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid, "Usage: /clearmechaniccall [playerid or name]");
- if(!HasActiveMechanicCall{playa}) return SysMsg(playerid, "That person doesn't have a call to clear.");
- HasActiveMechanicCall{playa} = false;
- strdel(MechanicCall[playa], 0, 128);
- SendClientMessage(playerid, COLOR_WHITE, "You have cleared the call.");
- return true;
- }
- CMD:offerspray(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to use this feature.");
- if(Job[playerid] == JOB_MECHANIC)
- {
- new myVehicle = GetPlayerVehicleID(playerid);
- if(myVehicle == 0) return SysMsg(playerid,"You must be in a vehicle to offer a re-spray.");
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SysMsg(playerid,"You must not be the driver to offer a re-spray.");
- new playa = -1, color1, color2, Price;
- if(sscanf(params, "uiii", playa, Price, color1, color2)) return SysMsg(playerid,"Usage: /offerspray [player id or name] [price] [Primary color] [Secondary Color]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't do this to yourself.");
- new theirVehicle = GetPlayerVehicleID(playa);
- if(myVehicle != theirVehicle) return SysMsg(playerid,"You must be in the same vehicle as the customer to offer a re-spray.");
- if(GetPlayerState(playa) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"The customer must be the driver to offer a re-spray.");
- if(AwaitingSpray[playa] == 1) return SysMsg(playerid,"They already have another Mechanic offering a spray.");
- if(Price < 0 || Price > 10000) return SysMsg(playerid,"Invalid price. [$0 - $10,000 only]");
- if(color1 < 0 || color1 > 255) return SysMsg(playerid,"Invalid color 1. [0 - 255 only]");
- if(color2 < 0 || color2 > 255) return SysMsg(playerid,"Invalid color 2. [0 - 255 only]");
- AwaitingSpray[playa] = 1;
- GoingToSprayVehicleID[playerid] = myVehicle;
- MechanicSpray[myVehicle][0] = playerid;
- MechanicSpray[myVehicle][1] = playa;
- MechanicSpray[myVehicle][2] = color1;
- MechanicSpray[myVehicle][3] = color2;
- MechanicSpray[myVehicle][4] = Price;
- MechanicSpray[myVehicle][5] = myVehicle;
- SendClientMessageF(playa, COLOR_WHITE, "Mechanic %s is offering you a spray for this %s. They will spray it %s(%i) and %s(%i) for $%i.", NameEx(playerid), GetVehicleName(myVehicle), VehicleColors[color1], color1, VehicleColors[color2], color2, Price);
- SendClientMessage(playa, COLOR_WHITE, "Use '/accept spray' to confirm this.");
- SendClientMessageF(playerid, COLOR_WHITE, "You are offering %s a spray for this %s. You will spray it %s(%i) and %s(%i) for $%i. They must accept first...", NameEx(playa), GetVehicleName(myVehicle), VehicleColors[color1], color1, VehicleColors[color2], color2, Price);
- }
- return true;
- }
- CMD:respray(playerid, params[]) return cmd_spray(playerid, params);
- CMD:colourcar(playerid, params[]) return cmd_spray(playerid, params);
- CMD:colorcar(playerid, params[]) return cmd_spray(playerid, params);
- CMD:spray(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to use this feature.");
- new v = GetPlayerVehicleID(playerid);
- if(Job[playerid] == JOB_MECHANIC || IsPlayerAdmin(playerid))
- {
- new bodyshop = -1;
- if(IsPlayerInDynamicArea(playerid, GarageAreas[0])) bodyshop = 1; //palomino creek
- if(IsPlayerInDynamicArea(playerid, GarageAreas[1])) bodyshop = 2; //dillimore
- if(IsPlayerInDynamicArea(playerid, GarageAreas[2])) bodyshop = 3; //fort carson
- if(IsPlayerInDynamicArea(playerid, GarageAreas[3])) bodyshop = 4; //el q
- if(IsPlayerInDynamicArea(playerid, GarageAreas[4])) bodyshop = 5; //airstrip
- if(IsPlayerInDynamicArea(playerid, GarageAreas[5])) bodyshop = 6; //bayside
- if(IsPlayerInDynamicArea(playerid, GarageAreas[6])) bodyshop = 7; //angel pine
- if(bodyshop == -1) return SysMsg(playerid,"You must be at a vehicle garage in order to spray it.");
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You must be in a vehicle to re-spray.");
- new color1, color2;
- if(sscanf(params, "iI(-1)", color1, color2)) return SysMsg(playerid,"Usage: /spray [Primary color] [Optional: Secondary color]");
- if(color1 < 0 || color1 > 255) return SysMsg(playerid,"Primary color must be between 0 and 255.");
- if(color2 == -1) color2 = color1;
- else if(color2 < 0 || color2 > 255) return SysMsg(playerid,"Secondary color 2 must be between 0 and 255.");
- if(FVehicleData[v][FVFaction] > 0)
- {
- if(FVehicleData[v][FVFaction] != Faction[playerid]) return SysMsg(playerid, "You can't spray a vehicle that isn't in your faction.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE fveh SET Col1 = %i, Col2 = %i WHERE id = %i", color1, color2, FVehicleData[v][FVSQLID]);
- mysql_pquery(conn, mquery);
- FVehicleData[v][FVCol1] = color1;
- FVehicleData[v][FVCol2] = color2;
- ChangeVehicleColorEx(v, color1, color2);
- ShowInfoText(playerid,"~G~R~R~E~B~S~Y~P~P~R~W~A~G~Y",3000);
- SendClientMessageF(playerid, COLOR_WHITE, "Faction vehicle color changed to: %s(%i) & %s(%i)", VehicleColors[color1], color1, VehicleColors[color2], color2);
- format(gstr, sizeof(gstr),"* %s resprays their %s %s and %s. *", NameRP(playerid), GetVehicleName(v), VehicleColors[color1], VehicleColors[color2]);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else if(VehicleData[v][VehicleOwnerSQLID] > 0)
- {
- if(VehicleData[v][VehicleOwnerSQLID] != SQLID[playerid]) return SysMsg(playerid, "You don't own this vehicle, please use /offerspray to spray the vehicle for the owner.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET Color1 = %i, Color2 = %i WHERE id = %i", color1, color2, VehicleData[v][VehSQLID]);
- mysql_pquery(conn, mquery);
- VehicleData[v][vColor1] = color1;
- VehicleData[v][vColor2] = color2;
- ChangeVehicleColorEx(v, color1, color2);
- ShowInfoText(playerid,"~G~R~R~E~B~S~Y~P~P~R~W~A~G~Y",3000);
- SendClientMessageF(playerid, COLOR_WHITE, "Owned vehicle color changed to: %s(%i) & %s(%i)", VehicleColors[color1], color1, VehicleColors[color2], color2);
- format(gstr, sizeof(gstr),"* %s resprays their %s %s and %s. *", NameRP(playerid), GetVehicleName(v), VehicleColors[color1], VehicleColors[color2]);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- SysMsg(playerid, "You may only spray your own vehicles with /spray.");
- }
- else return SysMsg(playerid, "You must be a Mechanic to respray vehicles.");
- return true;
- }
- CMD:nos(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to use this feature.");
- if(Job[playerid] != JOB_MECHANIC) return SysMsg(playerid, "You must be a Mechanic to add NOS to vehicles.");
- new VehicleId = GetPlayerVehicleID(playerid);
- if(VehicleId == 0) return SysMsg(playerid,"You must be in a vehicle to add NOS.");
- if(Cash[playerid] < 50) return SysMsg(playerid,"You need $50 to add NOS.");
- if(Cash[playerid] - 50 <= 0) return SysMsg(playerid, "You need $50 to add NOS.");
- if(IsPlayerInInvalidNosVehicle(VehicleId) != 0) return SysMsg(playerid,"You can't add nos to this vehicle.");
- if(GetVehicleComponentInSlot(VehicleId, CARMODTYPE_NITRO) != 0) return SysMsg(playerid, "This vehicle already has NOS. Use /removemods at a repair garage to get rid of it.");
- AddVehicleComponent(VehicleId, 1010);
- PlayerPlaySound(playerid,SOUND_CAR_MOD,0,0,0);
- ShowInfoText(playerid,"~G~NOS ~W~Added~n~~r~-$50",3000);
- GivePlayerCash(playerid, -50);
- format(gstr, sizeof(gstr),"* %s adds a NOS bottle to the %s. *", NameRP(playerid), GetVehicleName(VehicleId));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(!aspawned{VehicleId})
- {
- if(VehicleData[VehicleId][IdVehicle] == VehicleId && VehicleData[VehicleId][VehicleOwnerSQLID] > 0)
- {
- VehicleData[VehicleId][VehicleMod][CARMODTYPE_NITRO] = 1010;
- MySQLUpdateInt(VehicleData[VehicleId][VehSQLID], "VehicleModNos", 1010, "vehicles");
- return true;
- }
- if(FVehicleData[VehicleId][FVFaction] > 0 && FVehicleData[VehicleId][FactionVehID] == VehicleId)
- {
- FVehicleData[VehicleId][FVMod][CARMODTYPE_NITRO] = 1010;
- MySQLUpdateInt(FVehicleData[VehicleId][FVSQLID], "FVModNos", 1010, "fveh");
- return true;
- }
- }
- return true;
- }
- CMD:hyd(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to use this feature.");
- if(Job[playerid] != JOB_MECHANIC) return SysMsg(playerid, "You must be a Mechanic to add Hydraulics to vehicles.");
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You must be in a vehicle to add Hydraulics.");
- new VehicleId = GetPlayerVehicleID(playerid);
- if(CanVehicleHaveHydraulics(VehicleId) == 0) return SysMsg(playerid,"This vehicle can't have Hydraulics.");
- if(Cash[playerid] < 500) return SysMsg(playerid,"You need $500 to add Hydraulics.");
- if(GetVehicleComponentInSlot(VehicleId, CARMODTYPE_HYDRAULICS) != 0) return SysMsg(playerid, "This vehicle already has Hydraulics. Use /removemods at a repair garage to get rid of it.");
- AddVehicleComponent(VehicleId, 1087);
- PlayerPlaySound(playerid,SOUND_CAR_MOD,0,0,0);
- ShowInfoText(playerid,"~R~Hydraulics~W~ Added~n~~r~-$500",3000);
- GivePlayerCash(playerid, -500);
- format(gstr, sizeof(gstr),"* %s adds Hydraulics to the %s. *", NameRP(playerid), GetVehicleName(VehicleId));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(!aspawned{VehicleId})
- {
- new slot = GetVehicleComponentType(1087);
- if(VehicleData[VehicleId][IdVehicle] == VehicleId && VehicleData[VehicleId][VehicleOwnerSQLID] > 0)
- {
- VehicleData[VehicleId][VehicleMod][slot] = 1087;
- MySQLUpdateInt(VehicleData[VehicleId][VehSQLID], "Mod10", VehicleData[VehicleId][VehicleMod][slot], "vehicles");
- return true;
- }
- if(FVehicleData[VehicleId][FVFaction] > 0 && FVehicleData[VehicleId][FactionVehID] == VehicleId)
- {
- FVehicleData[VehicleId][FVMod][slot] = 1087;
- MySQLUpdateInt(FVehicleData[VehicleId][FVSQLID], "FVModHyd", FVehicleData[VehicleId][FVMod][slot], "fveh");
- return true;
- }
- }
- return true;
- }
- CMD:changeoil(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new VehID = GetPlayerVehicleID(playerid);
- if(Inventory[playerid][EngineOil] == 0) return SysMsg(playerid,"You do not have any oil.");
- if(Job[playerid] != JOB_MECHANIC) return SysMsg(playerid,"Only mechanics may change engine oil.");
- if(VehID > 0)
- {
- if(!VehicleHasEngine(VehID)) return SysMsg(playerid,"This vehicle doesn't have an engine therefore doesn't need an oil change.");
- if(GetVehicleSpeed(VehID, 0) > 0) return SysMsg(playerid,"Please reduce your speed to 0.");
- if(VehicleBoots[VehID][0] == 0) return SysMsg(playerid,"The hood/bonnet must be open.");
- if(EngineStatus[VehID] == 1) return SysMsg(playerid,"The engine must be off to change the oil.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- if(InCarCharging[playerid] > 0) return SysMsg(playerid,"Please wait until your phone is finished charging.");
- new Float:bonnety, Float:vx, Float:vy, Float:vz, Float:va;
- GetVehicleEnginePos(GetVehicleModel(VehID), bonnety);
- if(bonnety == 0 || IsBike(VehID) || IsHelicopter(VehID) || IsPlane(VehID) || IsBoat(VehID))
- {
- Inventory[playerid][EngineOil] = 0;
- MySQLUpdateInt(SQLID[playerid], "HasEngineOil", Inventory[playerid][EngineOil], "players");
- VehicleData[VehID][LastOilMileage] = VehicleData[VehID][Mileage];
- MySQLUpdateFloat(VehicleData[VehID][VehSQLID], "LastOilMileage", VehicleData[VehID][LastOilMileage], "vehicles");
- ToggleVehicleBonnet(VehID, 0);
- VehicleBoots[VehID][0] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "(( OOC Oil Change. This vehicle does not support interactive oil changes. The oil has been replaced. ))");
- }
- else
- {
- RemovePlayerFromVehicle(playerid);
- SetPlayerAttachedObject(playerid, HOLD_OBJECT_MISC, 2062, 6, 0.05, 0.05, 0.0, 0.0, 0.0, 0.0, 0.15, 0.15, 0.15);
- GetVehiclePos(VehID, vx, vy, vz);
- GetVehicleZAngle(VehID, va);
- new Float:dist = DistanceBetweenPoints(vx, vy, vz, vx, bonnety+vy, vz);
- vx += (dist * floatsin(-va, degrees));
- vy += (dist * floatcos(-va, degrees));
- ChangeOilPos[playerid][0] = vx;
- ChangeOilPos[playerid][1] = vy;
- ChangeOilPos[playerid][2] = vz;
- ChangeOilVehID[playerid] = VehID;
- SetPlayerCheckpointEx(playerid, vx, vy, vz, 1.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Proceed close to the {FF0000}engine{FFFFFF} and use /changeoil again to change the oil.");
- }
- }
- else
- {
- if(ChangeOilPos[playerid][0] == 0) return SysMsg(playerid,"You are not changing any oil.");
- if(ChangeOilVehID[playerid] == 0) return SysMsg(playerid,"You are not changing oil.");
- if(!IsPlayerInRangeOfPoint(playerid, 1.5, ChangeOilPos[playerid][0], ChangeOilPos[playerid][1], ChangeOilPos[playerid][2])) return SysMsg(playerid,"You must be near the engine to change the oil.");
- TogglePlayerControllable(playerid, 0);
- SetPlayerToFacePoint(playerid, ChangeOilPos[playerid][0], ChangeOilPos[playerid][1]);
- OnePlayAnim(playerid, "BD_FIRE", "wash_up", 4.0, 1, 0, 0, 0, 0);
- SetTimerEx("FinishOilChange", 10000, 0, "dd", playerid, ChangeOilVehID[playerid]);
- format(gstr, sizeof(gstr),"* %s begins to change the %s's engine oil. *",NameRP(playerid),GetVehicleName(ChangeOilVehID[playerid]));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- Inventory[playerid][EngineOil] = 0;
- MySQLUpdateInt(SQLID[playerid], "HasEngineOil", Inventory[playerid][EngineOil], "players");
- }
- return true;
- }
- //end of job commands
- //Phone commands
- CMD:p(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid,"You don't have a Mobile Phone.");
- if(IsPhoneRinging[playerid] == -1) return SysMsg(playerid,"There is nobody on the line.");
- if(PhoneData[playerid][pPower] == 0) return SysMsg(playerid, "Your phone is off so you cannot pick up the call.");
- if(CallerID[playerid] != -1 || CallerService[playerid] != -1) return SysMsg(playerid,"You are already on the phone.");
- if(IsPlayerInWater(playerid)) return SysMsg(playerid,"You may not use your mobile phone while in water.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid, "You may not use your phone whilst cuffed.");
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- if(AttachedObjects[playerid][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 6);
- }
- AttachedObjects[playerid][6][aoModelID] = 330;
- AttachedObjects[playerid][6][aoBone] = 6;
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
- SetPlayerAttachedObject(playerid, 6, 330, 6);
- }
- CallerID[playerid] = IsPhoneRinging[playerid];
- IsPhoneRinging[playerid] = -1;
- if(UsingPayPhone[CallerID[playerid]] == 0) LastNumber[playerid] = PhoneData[CallerID[playerid]][pNumber];
- SendClientMessage(playerid, COLOR_GREY, "You pickup the phone.");
- SendClientMessage(CallerID[playerid], COLOR_GREY, "They answer the phone call...");
- format(gstr, sizeof(gstr),"* %s takes out their phone and answers it... *",NameRP(playerid));
- SetPlayerChatBubble(playerid, gstr, COLOR_EMOTE, 15.0, 6000);
- return true;
- }
- CMD:pickup(playerid, params[]) return cmd_p(playerid, params);
- CMD:hangup(playerid)
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(!UsingPayPhone[playerid] && PhoneData[playerid][pPower] == 0) return SysMsg(playerid, "Your phone is off.");
- if(Inventory[playerid][MobilePhone] == 0 && UsingPayPhone[playerid] == 0) return SysMsg(playerid,"You are not using a phone.");
- if(CallerID[playerid] != -1 || IsPhoneRinging[playerid] != -1)
- {
- new playa = CallerID[playerid];
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USECELLPHONE)
- {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
- AttachedObjects[playerid][6][aoModelID] = 0;
- AttachedObjects[playerid][6][aoBone] = 0;
- RemovePlayerAttachedObject(playerid, 6);
- }
- if(GetPlayerSpecialAction(playa) == SPECIAL_ACTION_USECELLPHONE)
- {
- SetPlayerSpecialAction(playa, SPECIAL_ACTION_STOPUSECELLPHONE);
- AttachedObjects[playa][6][aoModelID] = 0;
- AttachedObjects[playa][6][aoBone] = 0;
- RemovePlayerAttachedObject(playa, 6);
- }
- if(UsingPayPhone[playerid] > 0)
- {
- PayPhoneInUse[UsingPayPhone[playerid]-1] = 0;
- UsingPayPhone[playerid] = 0;
- TogglePlayerControllable(playerid, 1);
- SetCameraBehindPlayer(playerid);
- SendClientMessage(playerid,COLOR_GREY,"[Pay phone] {87CEFF}You hung up.");
- format(sgstr, sizeof(sgstr),"* %s puts the phone handset back. *",NameRP(playerid));
- ProxDetector(15.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else
- {
- SendClientMessage(playa, COLOR_GREY, "[Cellphone] {87CEFF}They hung up and the line went dead.");
- SendClientMessage(playerid, COLOR_GREY, "[Cellphone] {87CEFF}You hung up.");
- format(sgstr, sizeof(sgstr),"* %s puts their phone away. *",NameRP(playerid));
- SetPlayerChatBubble(playerid, sgstr, COLOR_EMOTE, 15.0, 6000);
- }
- if(UsingPayPhone[playa] > 0)
- {
- PayPhoneInUse[UsingPayPhone[playa]-1] = 0;
- UsingPayPhone[playa] = 0;
- TogglePlayerControllable(playa, 1);
- SetCameraBehindPlayer(playa);
- SendClientMessage(playa,COLOR_GREY,"[Pay phone] {87CEFF}You hung up.");
- format(sgstr, sizeof(sgstr),"* %s puts the phone handset back. *",NameRP(playa));
- ProxDetector(15.0,playa,sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else
- {
- format(sgstr, sizeof(sgstr),"* %s puts their phone away. *",NameRP(playa));
- SetPlayerChatBubble(playa, sgstr, COLOR_EMOTE, 15.0, 6000);
- }
- MobileSpeaker[playerid] = 0;
- CallerID[playerid] = -1;
- CallerID[playa] = -1;
- IsPhoneRinging[playerid] = -1;
- IsPhoneRinging[playa] = -1;
- return true;
- }
- if(CallerService[playerid] != -1)
- {
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USECELLPHONE)
- {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
- AttachedObjects[playerid][6][aoModelID] = 0;
- AttachedObjects[playerid][6][aoBone] = 0;
- RemovePlayerAttachedObject(playerid, 6);
- }
- SendClientMessage(playerid,COLOR_GREY,"[Cellphone] {87CEFF}You hung up.");
- format(sgstr, sizeof(sgstr),"* %s puts their phone away. *",NameRP(playerid));
- SetPlayerChatBubble(playerid, sgstr, COLOR_EMOTE, 15.0, 6000);
- CallerService[playerid] = -1;
- return true;
- }
- SysMsg(playerid, "Your phone is not in use and can't be hungup.");
- return true;
- }
- CMD:h(playerid) return cmd_hangup(playerid);
- CMD:callback(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid,"You don't have a Mobile Phone.");
- if(IsPhoneRinging[playerid] >= 0) return SysMsg(playerid,"Your phone is ringing. Answer it first.");
- if(CallerID[playerid] != -1 || CallerService[playerid] != -1) return SysMsg(playerid,"You are already using your phone. /hangup first.");
- if(PhoneData[playerid][pPower] == 0) return SysMsg(playerid,"Your phone is off. Turn it on to call numbers.");
- if(LastNumber[playerid] == -1) return SysMsg(playerid,"You don't have a number to call back.");
- if(IsPlayerInWater(playerid)) return SysMsg(playerid,"You may not use your mobile phone while in water.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid, "You may not use your phone whilst cuffed.");
- new numberstr[12];
- format(numberstr, 12, "%i", LastNumber[playerid]);
- cmd_call(playerid, numberstr);
- return true;
- }
- CMD:call(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid,"You don't have a Mobile Phone.");
- if(IsPhoneRinging[playerid] >= 0) return SysMsg(playerid,"Your phone is ringing. Answer it first.");
- if(CallerID[playerid] != -1 || CallerService[playerid] != -1) return SysMsg(playerid,"You are already using your phone. /hangup first.");
- if(PhoneData[playerid][pPower] == 0) return SysMsg(playerid,"Your phone is off. Turn it on to call numbers.");
- if(!HasPhoneSignal(playerid)) return SysMsg(playerid,"No Service.");
- if(UsingPayPhone[playerid] > 0) return SysMsg(playerid,"You are already on the phone.");
- if(IsJailed[playerid] == 1 || PlayerImprisoned{playerid}) return SysMsg(playerid,"Your Phone was confiscated and it will be returned upon your release.");
- if(IsPlayerInWater(playerid)) return SysMsg(playerid,"You may not use your mobile phone while in water.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid, "You may not use your phone whilst cuffed.");
- new callnumber = -1;
- if(isnull(params)) return SysMsg(playerid,"Usage: /call [number OR contact name] (alias /dial)") && SysMsg(playerid,"Useful Numbers") && SysMsg(playerid,"Emergency Line - 911") && SysMsg(playerid,"SANews - 726") && SysMsg(playerid,"Taxi Co. - 444") && SysMsg(playerid,"Elite Trucking - 927") && SysMsg(playerid, "Mechanic Hotline - 118");
- if(IsNumeric(params)) callnumber = strval(params);
- else
- {
- for(new i = 0; i < MAX_PHONECONTACTS; i++)
- {
- if(PhoneContacts[playerid][i][cID] != 0 && !isnull(PhoneContacts[playerid][i][ContactName]))
- {
- if(strcmp(params, PhoneContacts[playerid][i][ContactName], true) == 0)
- {
- callnumber = PhoneContacts[playerid][i][ContactNumber];
- break;
- }
- }
- }
- if(callnumber == -1) return SysMsg(playerid, "That name was not found in your contact list.");
- }
- ProcessPhoneCall(playerid, callnumber);
- return true;
- }
- CMD:dial(playerid, params[]) return cmd_call(playerid, params);
- CMD:contacts(playerid)
- {
- if(PhoneData[playerid][pPower] == 0) return SysMsg(playerid, "Your phone is off.");
- gstr[0] = EOS;
- new ccount = GetContactsCount(playerid);
- if(ccount > 0) strcat(gstr, "View All Contacts\n");
- if(ccount < GetMaxContactLimitForPlayer(playerid)) strcat(gstr, "Create New Contact\n");
- if(ccount > 0) strcat(gstr, "Delete A Contact\nEdit A Contact\n");
- Dialog_Show(playerid, ContactsMenu, DIALOG_STYLE_LIST, "Contacts Menu", gstr, "Select", "Cancel");
- return true;
- }
- CMD:phone(playerid)
- {
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid,"You don't have a Mobile Phone.");
- if(IsPhoneRinging[playerid] >= 0) return SysMsg(playerid,"Your phone is ringing. Answer it first.");
- if(CallerID[playerid] != -1 || CallerService[playerid] != -1) return SysMsg(playerid,"You are already using your phone. /hangup first.");
- if(UsingPayPhone[playerid] > 0) return SysMsg(playerid,"Please finish using the pay phone before using your mobile.");
- if(IsPlayerInWater(playerid)) return SysMsg(playerid,"You may not use your mobile phone while in water.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid, "You may not use your phone whilst cuffed.");
- DisplayPhoneMenu(playerid);
- format(gstr, sizeof(gstr),"* %s gets their phone out and presses a few buttons.. *", NameRP(playerid));
- SetPlayerChatBubble(playerid, gstr, COLOR_EMOTE, 15.0, 6000);
- return true;
- }
- CMD:payphone(playerid, params[])//telefonepublico
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(IsPhoneRinging[playerid] >= 0) return SysMsg(playerid,"Your phone is ringing. Answer it first.");
- if(CallerID[playerid] != -1 || CallerService[playerid] != -1) return SysMsg(playerid,"You are already using your phone. /hangup first.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SysMsg(playerid,"On your feet!");
- if(UsingPayPhone[playerid] == 1) return SysMsg(playerid, "You are using a Pay Phone.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid, "You may not use your phone whilst cuffed.");
- new NumberCalled;
- if(sscanf(params, "i", NumberCalled)) return SysMsg(playerid,"Usage: /payphone [number]");
- if(NumberCalled < 1 || NumberCalled > 9999999) return SysMsg(playerid,"Invalid network number.");
- if(NumberCalled == PhoneData[playerid][pNumber]) return SysMsg(playerid,"You may not call your own phone.");
- if(!PlayerImprisoned{playerid})
- {
- if(Cash[playerid] < 5 && NumberCalled != 911) return SysMsg(playerid,"You need $5 to make a call.");
- }
- if(IsPlayerInRangeOfPoint(playerid, 2.0, 256.7420349121, -81.5554428101, 1.2701275349)) // bb liquor
- {
- if(PayPhoneInUse[0] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, 251.1188, -77.4623, 2.7296);
- SetPlayerCameraLookAt(playerid, 260.9838, -78.8487, 1.8581);
- PayPhoneInUse[0] = 1;
- UsingPayPhone[playerid] = 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, 273.56250, -171.4013671875, 1.9214571714)) // bb gym
- {
- if(PayPhoneInUse[1] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, 291.4234, -175.0688, 4.9296);
- SetPlayerCameraLookAt(playerid, 281.4782, -174.0235, 3.7109);
- PayPhoneInUse[1] = 1;
- UsingPayPhone[playerid] = 2;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1279.6098632813, 263.5825500488, 19.9056930542)) // mont central
- {
- if(PayPhoneInUse[2] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, 1268.5700, 259.6120, 26.0062);
- SetPlayerCameraLookAt(playerid, 1277.8419, 259.6120, 22.2601);
- PayPhoneInUse[2] = 1;
- UsingPayPhone[playerid] = 3;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1226.0195312500, 330.1572265625, 19.9056930542)) // mont hospital
- {
- if(PayPhoneInUse[3] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, 1223.7540, 344.2998, 25.0116);
- SetPlayerCameraLookAt(playerid, 1228.1376, 335.3118, 21.7559);
- PayPhoneInUse[3] = 1;
- UsingPayPhone[playerid] = 4;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2270.9658203125, 50.8583984375, 26.1763782501)) // palomino general store
- {
- if(PayPhoneInUse[4] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, 2262.6542, 46.6263, 32.2843);
- SetPlayerCameraLookAt(playerid, 2271.7558, 48.3955, 28.5383);
- PayPhoneInUse[4] = 1;
- UsingPayPhone[playerid] = 5;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2275.0713, -76.8855, 26.5763)) // palomino library
- {
- if(PayPhoneInUse[5] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, 2259.4619, -88.2675, 28.9991);
- SetPlayerCameraLookAt(playerid, 2265.8898, -80.6071, 28.9991);
- PayPhoneInUse[5] = 1;
- UsingPayPhone[playerid] = 6;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2334.2177734375, -5.5068359375, 26.1764545441)) // palomino cafe
- {
- if(PayPhoneInUse[6] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, 2346.5444, 1.2500, 34.0843);
- SetPlayerCameraLookAt(playerid, 2337.9726, 1.2500, 28.9339);
- PayPhoneInUse[6] = 1;
- UsingPayPhone[playerid] = 7;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -155.2096405029, 1208.0728759766, 19.4341907501)) // fort c. king ring
- {
- if(PayPhoneInUse[7] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, -135.0444, 1232.8094, 34.4937);
- SetPlayerCameraLookAt(playerid, -141.9910, 1225.6160, 29.1945);
- PayPhoneInUse[7] = 1;
- UsingPayPhone[playerid] = 8;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -205.1318359375, 1128.0488281250, 19.4341907501)) // FC mayor house
- {
- if(PayPhoneInUse[8] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, -184.6137, 1126.4040, 24.6929);
- SetPlayerCameraLookAt(playerid, -194.4891, 1126.2316, 23.1285);
- PayPhoneInUse[8] = 1;
- UsingPayPhone[playerid] = 9;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -13.1679687500, 1183.0556640625, 19.7134227753)) // FC beef grill
- {
- if(PayPhoneInUse[9] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, -38.0793, 1187.0872, 21.5520);
- SetPlayerCameraLookAt(playerid, -28.0930, 1186.5639, 22.2496);
- PayPhoneInUse[9] = 1;
- UsingPayPhone[playerid] = 10;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1349.6008,232.3512,19.5547)) // mont pizza
- {
- if(PayPhoneInUse[10] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, 1344.4250,233.1461,21.5547);
- SetPlayerCameraLookAt(playerid, 1349.6008,232.3512,19.5547);
- PayPhoneInUse[10] = 1;
- UsingPayPhone[playerid] = 11;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, 711.5770263672, -475.6603393555, 16.0279407501)) // dill paynspray
- {
- if(PayPhoneInUse[11] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, 705.6245, -482.0432, 21.1359);
- SetPlayerCameraLookAt(playerid, 712.8022, -475.8037, 18.0457);
- PayPhoneInUse[11] = 1;
- UsingPayPhone[playerid] = 12;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2154.1416, 66.5370, 26.9873)) // palomino bridge
- {
- if(PayPhoneInUse[12] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, 2151.7534, 64.0967, 28.8964);
- SetPlayerCameraLookAt(playerid, 2154.1416, 66.5370, 26.9873);
- PayPhoneInUse[12] = 1;
- UsingPayPhone[playerid] = 13;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1256.3623046875, 147.20568847656, 20.088111877441)) // mont driving school
- {
- if(PayPhoneInUse[13] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, 1248.2823, 152.7991, 24.2069);
- SetPlayerCameraLookAt(playerid, 1254.1035, 145.3483, 20.9513);
- PayPhoneInUse[13] = 1;
- UsingPayPhone[playerid] = 14;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, 673.415954, -589.050598, 16.335937)) // dill south
- {
- if(PayPhoneInUse[14] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- SetPlayerCameraPos(playerid, 676.0861, -580.8543, 18.0359);
- SetPlayerCameraLookAt(playerid, 676.0861, -590.8543, 18.0359);
- PayPhoneInUse[14] = 1;
- UsingPayPhone[playerid] = 15;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -2097.108642, -2331.721191, 30.625)) // angel pine
- {
- if(PayPhoneInUse[15] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- PayPhoneInUse[15] = 1;
- UsingPayPhone[playerid] = 16;
- SetCameraBehindPlayer(playerid);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -2171.307861, -2353.388427, 30.625)) // angel pine
- {
- if(PayPhoneInUse[16] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- PayPhoneInUse[16] = 1;
- UsingPayPhone[playerid] = 17;
- SetCameraBehindPlayer(playerid);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -2197.533203, -2418.167968, 30.625)) // angel pine
- {
- if(PayPhoneInUse[17] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- PayPhoneInUse[17] = 1;
- UsingPayPhone[playerid] = 18;
- SetCameraBehindPlayer(playerid);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -2177.902099, -2436.297363, 30.625)) // angel pine
- {
- if(PayPhoneInUse[18] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- PayPhoneInUse[18] = 1;
- UsingPayPhone[playerid] = 19;
- SetCameraBehindPlayer(playerid);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -2128.440673, -2446.063720, 30.174999)) // angel pine
- {
- if(PayPhoneInUse[20] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- PayPhoneInUse[20] = 1;
- UsingPayPhone[playerid] = 21;
- SetCameraBehindPlayer(playerid);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -2093.919189, -2477.046875, 30.174999)) // angel pine
- {
- if(PayPhoneInUse[21] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- PayPhoneInUse[21] = 1;
- UsingPayPhone[playerid] = 22;
- SetCameraBehindPlayer(playerid);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -1572.513427, -2725.353515, 48.293457)) // angel pine
- {
- if(PayPhoneInUse[22] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- PayPhoneInUse[22] = 1;
- UsingPayPhone[playerid] = 23;
- SetCameraBehindPlayer(playerid);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -2451.410156, 2321.001464, 4.073258)) // bayside
- {
- if(PayPhoneInUse[23] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- PayPhoneInUse[23] = 1;
- UsingPayPhone[playerid] = 24;
- SetCameraBehindPlayer(playerid);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -2553.039062, 2320.415527, 5.056630)) // bayside
- {
- if(PayPhoneInUse[24] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- PayPhoneInUse[24] = 1;
- UsingPayPhone[playerid] = 25;
- SetCameraBehindPlayer(playerid);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -2550.275390, 2320.460449, 5.060738)) // bayside
- {
- if(PayPhoneInUse[25] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- PayPhoneInUse[25] = 1;
- UsingPayPhone[playerid] = 26;
- SetCameraBehindPlayer(playerid);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 4.0, -673.593444, 2179.334960, 3836.8)) // prison
- {
- if(PayPhoneInUse[26] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- PayPhoneInUse[26] = 1;
- UsingPayPhone[playerid] = 27;
- SetCameraBehindPlayer(playerid);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1034.3674, -1115.4692, 2025.2595)) // st hideout
- {
- if(PayPhoneInUse[27] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- PayPhoneInUse[27] = 1;
- UsingPayPhone[playerid] = 28;
- SetCameraBehindPlayer(playerid);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1236.6080, 184.4952, 2091.3687)) // info center
- {
- if(PayPhoneInUse[28] == 1) return SysMsg(playerid, "Pay phone is already being used.");
- PayPhoneInUse[28] = 1;
- UsingPayPhone[playerid] = 29;
- SetCameraBehindPlayer(playerid);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 4.0, -801.9138, -1912.3365, 7.0407)) //camp bob payphone
- {
- if(PayPhoneInUse[29] == 1) return SysMsg(playerid, "O telefone público já está em uso.");
- PayPhoneInUse[29] = 1;
- UsingPayPhone[playerid] = 30;
- SetCameraBehindPlayer(playerid);
- }
- if(UsingPayPhone[playerid] == 0) return SysMsg(playerid, "You are not near any Pay Phone.");
- format(gstr, sizeof(gstr),"* %s picks up the public pay phone handset and dials some numbers... *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- TogglePlayerControllable(playerid, 0);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
- if(AttachedObjects[playerid][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 6);
- }
- AttachedObjects[playerid][6][aoModelID] = 330;
- AttachedObjects[playerid][6][aoBone] = 6;
- SetPlayerAttachedObject(playerid, 6, 330, 6);
- if(NumberCalled == 444) //Cabbie Company
- {
- Dialog_Show(playerid, TaxiMenu, DIALOG_STYLE_LIST, "Cabbie Co - Select the service you require", "Taxi", "Select", "Hangup");
- CallerService[playerid] = 444;
- return true;
- }
- if(NumberCalled == 911) //Police & EMS
- {
- SendClientMessage(playerid, COLOR_WHITE, "You have reached the San Andreas emergency switchboard. Do you require Police, Fire or EMS?");
- CallerService[playerid] = 911;
- return true;
- }
- if(NumberCalled == 927) //Elite Trucking
- {
- new truckers = 0;
- foreach(new i: Player)
- {
- if(Logged{i} && Faction[i] == FACTION_TRUCKING)
- {
- truckers++;
- }
- }
- if(truckers == 0)
- {
- SysMsg(playerid, "'You're through to Elite Trucking, our help desk is currently unavailable. Please call back later.'");
- TogglePlayerControllable(playerid, 1);
- PayPhoneInUse[UsingPayPhone[playerid]-1] = 0;
- UsingPayPhone[playerid] = 0;
- SetCameraBehindPlayer(playerid);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
- AttachedObjects[playerid][6][aoModelID] = 0;
- AttachedObjects[playerid][6][aoBone] = 0;
- RemovePlayerAttachedObject(playerid, 6);
- return true;
- }
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- if(AttachedObjects[playerid][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 6);
- }
- AttachedObjects[playerid][6][aoModelID] = 330;
- AttachedObjects[playerid][6][aoBone] = 6;
- SetPlayerAttachedObject(playerid, 6, 330, 6);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
- }
- SendClientMessage(playerid, COLOR_WHITE, "You're through to the Elite Trucking Hotline, how can we help you today?");
- CallerService[playerid] = 927;
- return true;
- }
- if(NumberCalled == 118) //Mechanic
- {
- new mechanics = 0;
- foreach(new i: Player)
- {
- if(Logged{i} && Job[i] == JOB_MECHANIC)
- {
- mechanics++;
- }
- }
- if(mechanics == 0) return SysMsg(playerid, "Hi there, we regret to inform you that there are currently no mechanics on duty. Please try again later.'");
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- if(AttachedObjects[playerid][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 6);
- }
- AttachedObjects[playerid][6][aoModelID] = 330;
- AttachedObjects[playerid][6][aoBone] = 6;
- SetPlayerAttachedObject(playerid, 6, 330, 6);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
- }
- SendClientMessage(playerid, COLOR_WHITE, "'You've reached the San Andreas Mechanic Service, how may we assist you today?");
- CallerService[playerid] = 118;
- return true;
- }
- foreach(new i: Player)
- {
- if(Logged{i})
- {
- if(PhoneData[i][pNumber] == NumberCalled && CallerID[i] == -1 && IsPhoneRinging[i] == -1 && PhoneData[i][pPower] == 1 && Inventory[i][MobilePhone] == 1)
- {
- SetPlayerChatBubble(i, " Phone rings *", COLOR_EMOTE, 15.0, 6000);
- SendClientMessageF(i, COLOR_GREY, "Your phone is ringing (caller = %i)... Use '/pickup' or '/p' to answer it.", 1000 + UsingPayPhone[playerid]);
- SendClientMessageF(playerid, COLOR_GREY, "You are calling number %i... Use '/hangup' or '/h' to cancel.", NumberCalled);
- if(!PlayerImprisoned{playerid}) GivePlayerCash(playerid, -5);
- CallerID[playerid] = i;
- IsPhoneRinging[i] = playerid;
- MobileSpeaker[playerid] = 0;
- return true;
- }
- }
- }
- SysMsg(playerid,"Operator: \"That number is either invalid or busy.\"");
- TogglePlayerControllable(playerid, 1);
- PayPhoneInUse[UsingPayPhone[playerid]-1] = 0;
- UsingPayPhone[playerid] = 0;
- SetCameraBehindPlayer(playerid);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
- AttachedObjects[playerid][6][aoModelID] = 0;
- AttachedObjects[playerid][6][aoBone] = 0;
- RemovePlayerAttachedObject(playerid, 6);
- return true;
- }
- CMD:phoneon(playerid)
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid,"You don't have a Mobile Phone.");
- if(PhoneData[playerid][pPower] == 1) return SysMsg(playerid,"Your phone is already on.");
- if(PhoneData[playerid][pBattery] == 0) return SysMsg(playerid,"Your phone has no battery.");
- if(IsJailed[playerid] == 1 || PlayerImprisoned{playerid}) return SysMsg(playerid,"Your Phone was confiscated and it will be returned upon your release.");
- if(IsPlayerInWater(playerid)) return SysMsg(playerid,"You may not use your mobile phone while in water.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid, "You may not use your phone whilst cuffed.");
- PhoneData[playerid][pPower] = 1;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhonePower = 1 WHERE id = %i", PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- format(gstr, sizeof(gstr),"* %s presses a button to turn their phone on. *", NameRP(playerid));
- SetPlayerChatBubble(playerid, gstr, COLOR_EMOTE, 15.0, 6000);
- SendClientMessage(playerid, COLOR_WHITE, "Your phone is now on.");
- return true;
- }
- CMD:phoneoff(playerid)
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid,"You don't have a Mobile Phone.");
- if(PhoneData[playerid][pPower] == 0) return SysMsg(playerid,"Your phone is already off.");
- if(IsJailed[playerid] == 1 || PlayerImprisoned{playerid}) return SysMsg(playerid,"Your Phone was confiscated and it will be returned upon your release.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid, "You may not use your phone whilst cuffed.");
- if(IsPhoneRinging[playerid] >= 0) return SysMsg(playerid,"Your phone is ringing. Answer it first.");
- if(CallerID[playerid] != -1 || CallerService[playerid] != -1) return SysMsg(playerid,"You are already using your phone. /hangup first.");
- PhoneData[playerid][pPower] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhonePower = 0 WHERE id = %i", PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- format(gstr, sizeof(gstr),"* %s holds a button to turn their phone off. *", NameRP(playerid));
- SetPlayerChatBubble(playerid, gstr, COLOR_EMOTE, 15.0, 6000);
- SendClientMessage(playerid, COLOR_WHITE, "Your phone is now off.");
- return true;
- }
- CMD:poff(playerid) return cmd_phoneoff(playerid);
- CMD:pon(playerid) return cmd_phoneon(playerid);
- CMD:recharge(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid,"You don't have a Mobile Phone.");
- if(PhoneData[playerid][pBattery] >= 99) return SysMsg(playerid,"Your phone is already full battery.");
- new vid = GetPlayerVehicleID(playerid);
- if(vid > 0 && Inventory[playerid][CarAdapter] == 1)
- {
- if(InCarCharging[playerid] == 1) return SysMsg(playerid, "You cannot recharge your phone if it's already being recharged.");
- if(VehicleData[vid][VehicleOwnerSQLID] == SQLID[playerid])
- {
- if(IsPlane(vid) || IsBoat(vid) || IsBike(vid) || IsPushBike(vid)) return SysMsg(playerid,"You cannot re-charge a phone in this vehicle.");
- if(PhoneData[playerid][pBattery] <= 98)
- {
- InCarCharging[playerid] = 1;
- PhoneData[playerid][pBattery] = floatadd(PhoneData[playerid][pBattery], 1);
- format(gstr, sizeof(gstr),"* %s starts to re-charge their phone inside their car. *", NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "Your phone is now charging, please wait. Get out the vehicle to stop charging.");
- }
- else
- {
- PhoneData[playerid][pBattery] = 100;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET Battery = %i WHERE id = %i", floatround(PhoneData[playerid][pBattery]), PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- format(gstr, sizeof(gstr),"* %s re-charges their phone inside their car. *", NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "Your phone is now fully recharged.");
- }
- return true;
- }
- new faction = IsFactionVehicle(vid);
- if(faction > 0 && Faction[playerid] == faction)
- {
- if(PhoneData[playerid][pBattery] <= 98)
- {
- InCarCharging[playerid] = 1;
- PhoneData[playerid][pBattery] = floatadd(PhoneData[playerid][pBattery], 1);
- format(gstr, sizeof(gstr),"* %s starts to re-charge their phone inside the %s. *", NameRP(playerid),GetVehicleName(vid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "Your phone is now charging, please wait. Get out the vehicle to stop charging.");
- }
- else
- {
- PhoneData[playerid][pBattery] = 100;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET Battery = %i WHERE id = %i", floatround(PhoneData[playerid][pBattery]), PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- format(gstr, sizeof(gstr),"* %s re-charges their phone inside the %s. *", NameRP(playerid),GetVehicleName(vid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "Your phone is now fully recharged.");
- }
- return true;
- }
- }
- if(IsInHouseID[playerid] != -1)
- {
- if(HouseData[IsInHouseID[playerid]][HouseOwnerSQLID] == SQLID[playerid] || IsHouseGuestSQL(playerid) == HouseData[IsInHouseID[playerid]][HouseSQLID])
- {
- PhoneData[playerid][pBattery] = 100;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET Battery = %i WHERE id = %i", floatround(PhoneData[playerid][pBattery]), PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- format(gstr, sizeof(gstr),"* %s re-charges their phone inside their house. *", NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "Your phone is now fully recharged.");
- return true;
- }
- }
- if(IsPlayerInRangeOfPoint(playerid, 5.0, -2236.320312, 130.603515, 1035.41406))
- {
- PhoneData[playerid][pBattery] = 100;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET Battery = %i WHERE id = %i", floatround(PhoneData[playerid][pBattery]), PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- format(gstr, sizeof(gstr),"* %s re-charges their phone using the public re-charge point in the shop. *", NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "Your phone is now fully recharged.");
- return true;
- }
- SysMsg(playerid,"You must be in an Electronic shop, your house or an owned vehicle to recharge a phone.");
- return true;
- }
- CMD:txt(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid,"You don't have a Mobile Phone.");
- if(PhoneData[playerid][pPower] == 0) return SysMsg(playerid,"Your phone is off. Turn it on to send text messages.");
- if(!HasPhoneSignal(playerid)) return SysMsg(playerid,"No Service.");
- if(IsPlayerInWater(playerid)) return SysMsg(playerid,"You may not use your mobile phone while in water.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid, "You may not use your phone whilst cuffed.");
- new numberOrName[24], TextMsg[170], actualNumber;
- if(sscanf(params, "s[24]s[170]", numberOrName, TextMsg)) return SysMsg(playerid,"Usage: /sms [phone number OR contact name] [message]");
- if(IsNumeric(numberOrName)) actualNumber = strval(numberOrName);
- else
- {
- for(new i = 0; i < MAX_PHONECONTACTS; i++)
- {
- if(PhoneContacts[playerid][i][cID] > 0 && !isnull(PhoneContacts[playerid][i][ContactName]))
- {
- if(strcmp(numberOrName, PhoneContacts[playerid][i][ContactName], true) == 0)
- {
- actualNumber = PhoneContacts[playerid][i][ContactNumber];
- break;
- }
- }
- }
- if(actualNumber <= 0) return SysMsg(playerid, "That name was not found in your contact list.");
- }
- ProcessTextMessage(playerid, actualNumber, TextMsg);
- return true;
- }
- CMD:sms(playerid, params[]) return cmd_txt(playerid, params);
- CMD:txtback(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid,"You don't have a Mobile Phone.");
- if(PhoneData[playerid][pPower] == 0) return SysMsg(playerid,"Your phone is off. Turn it on to send text messages.");
- if(!HasPhoneSignal(playerid)) return SysMsg(playerid,"No Service.");
- if(LastSMSNumber[playerid] == 0) return SysMsg(playerid,"Nobody has sent you a message that you can quick-reply to.");
- if(IsPlayerInWater(playerid)) return SysMsg(playerid,"You may not use your mobile phone while in water.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /smsback [message] *Will send to the last person that sent you a message*");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid, "You may not use your phone whilst cuffed.");
- ProcessTextMessage(playerid, LastSMSNumber[playerid], params);
- return true;
- }
- CMD:smsback(playerid, params[]) return cmd_txtback(playerid, params);
- CMD:phoneshow(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid, "Please login first.");
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid, "You do not have a mobile phone.");
- PhoneData[playerid][ShowPhonebook] = !PhoneData[playerid][ShowPhonebook];
- if(PhoneData[playerid][ShowPhonebook])
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET ShowPhonebook = 1 WHERE OwnerSQLID = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, COLOR_WHITE, "Your information now be shown in the phonebook.");
- }
- else
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET ShowPhonebook = 0 WHERE OwnerSQLID = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, COLOR_WHITE, "Your information will no longer be shown in the phonebook.");
- }
- return true;
- }
- CMD:getnum(playerid, params[]) return cmd_getnumber(playerid, params);
- CMD:number(playerid, params[]) return cmd_getnumber(playerid, params);
- CMD:phonebook(playerid, params[]) return cmd_getnumber(playerid, params);
- CMD:getnumber(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][Phonebook] == 0) return SysMsg(playerid,"You must first buy a phonebook from an Electrical Store.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /getnumber [part of OR full name]");
- if(strlen(params) < 5) return SysMsg(playerid,"Please be more specific with the name.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT OwnerName,PhoneNumber FROM phones WHERE OwnerName LIKE '%%%e%%' AND ShowPhonebook = 1 LIMIT 25", params);
- mysql_pquery(conn, mquery, "ProcessPhonebookRequest", "ds", playerid, params);
- return true;
- }
- CMD:pinfo(playerid)//celularinfo
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Log in first.");
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid,"You do not have a mobile phone.");
- SendClientMessageF(playerid, COLOR_WHITE, "[{0098F2}%s's{FFFFFF} Cell Phone Information]", RPName(PhoneData[playerid][pOwnerName]));
- SendClientMessageF(playerid,COLOR_WHITE, "Phone number: %i", PhoneData[playerid][pNumber]);
- SendClientMessageF(playerid,COLOR_WHITE, "Phone credit: {4BB74C}$%i", PhoneData[playerid][pCredit]);
- SendClientMessage(playerid,COLOR_WHITE, "Phone network: S.A. Mobile");
- switch(floatround(PhoneData[playerid][pBattery]))
- {
- case 90..100: PlayerTextDrawShow(playerid, textdrawBateria0[playerid]);
- case 80..89: PlayerTextDrawShow(playerid, textdrawBateria0[playerid]);
- case 70..79: PlayerTextDrawShow(playerid, textdrawBateria0[playerid]);
- case 60..69: PlayerTextDrawShow(playerid, textdrawBateria0[playerid]);
- case 50..59: PlayerTextDrawShow(playerid, textdrawBateria0[playerid]);
- case 40..49: PlayerTextDrawShow(playerid, textdrawBateria0[playerid]);
- case 30..39: PlayerTextDrawShow(playerid, textdrawBateria0[playerid]);
- case 20..29: PlayerTextDrawShow(playerid, textdrawBateria0[playerid]);
- case 10..19: PlayerTextDrawShow(playerid, textdrawBateria0[playerid]);
- case 1..9: PlayerTextDrawShow(playerid, textdrawBateria0[playerid]);
- case 0: PlayerTextDrawShow(playerid, textdrawBateria0[playerid]);
- }
- if(PhoneData[playerid][pPower] == 1) SendClientMessage(playerid, COLOR_WHITE, "Cell Phone Status: {16BD00}On");
- else SendClientMessage(playerid, COLOR_WHITE, "Mobile status: {F01000}Off");
- if(HasPhoneSignal(playerid)) SendClientMessage(playerid, COLOR_WHITE, "Cell Phone Signal: {16BD00}Full service");
- else SendClientMessage(playerid, COLOR_WHITE, "Cell Phone Signal: {F01000}No service");
- return true;
- }
- CMD:lp(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Muted[playerid] > 0) return SysMsgF(playerid, "You are muted. (%i minutes left)", Muted[playerid]);
- if(isnull(params)) return SysMsg(playerid,"Usage: Phone Quiet Talk: /lp [chat]");
- if(CallerID[playerid] != -1 || CallerService[playerid] != -1) ProcessPhoneChat(playerid, GetPlayerVehicleID(playerid), params, 4.0);
- else SysMsg(playerid,"You are not talking on a phone.");
- return true;
- }
- CMD:loudspeaker(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid,"You don't have a Mobile Phone.");
- if(PhoneData[playerid][pPower] == 0) return SysMsg(playerid,"Your phone is off. Turn it on to change settings.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /loudspeaker [on/off]");
- if(strcmp("on", params, false) == 0)
- {
- if(MobileSpeaker[playerid] == 1) return SysMsg(playerid, "Your Mobile loudspeaker is already on.");
- MobileSpeaker[playerid] = 1;
- SendClientMessage(playerid,COLOR_GOLD,"Your Mobile loudspeaker is now on.");
- SetPlayerChatBubble(playerid, "* Switches on their phone's loudspeaker. *", COLOR_EMOTE, 15.0, 6000);
- return true;
- }
- else if(strcmp("off", params, false) == 0)
- {
- if(MobileSpeaker[playerid] == 0) return SysMsg(playerid, "Your Mobile loudspeaker is already off.");
- MobileSpeaker[playerid] = 0;
- SendClientMessage(playerid,COLOR_GOLD,"Your Mobile loudspeaker is now off.");
- SetPlayerChatBubble(playerid, "* Switches off their phone's loudspeaker. *", COLOR_EMOTE, 15.0, 6000);
- return true;
- }
- else SysMsg(playerid,"Usage: /loudspeaker [on/off]");
- return true;
- }
- //end of phone commands
- //Vehicle rental commands
- CMD:rentvehicle(playerid)
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a rentable vehicle to use this command.");
- if(Licenses[playerid][LICENSE_CAR] != 1) return SysMsg(playerid, "You must have a valid driver's license to rent vehicles.");
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid, "You must have a mobile phone to rent vehicles.");
- new v = GetPlayerVehicleID(playerid);
- if(!IsRentalCar(v)) return SysMsg(playerid, "You must be in a rentable vehicle to use this command.");
- if(RentalCar[playerid] == v) return SysMsg(playerid, "You are already renting this vehicle.");
- if(RentalCar[playerid] != 0) return SysMsg(playerid, "You are already renting a vehicle.");
- foreach(new i: Player) if(RentalCar[i] == v) return SysMsg(playerid, "This vehicle is already being rented by somebody.");
- if(RentalData[v][RentalPrice] > Cash[playerid]) return SysMsgF(playerid, "You need $%i to rent this vehicle.", RentalData[v][RentalPrice]);
- RentalCar[playerid] = RentalData[v][CarID];
- GivePlayerCash(playerid, -RentalData[v][RentalPrice]);
- SendSplitMessageF(playerid, COLOR_WHITE, "You are now renting this {BCDCBC}%s{FFFFFF}. You will be charged {4BB74C}$%i{FFFFFF} every hour until you return it. You can return the vehicle by using {BCDCBC}/returnvehicle{FFFFFF} at the rental car lot.", GetVehicleName(v), RentalData[v][RentalPrice]);
- return true;
- }
- CMD:returnvehicle(playerid)
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a rentable vehicle to use this command.");
- new v = GetPlayerVehicleID(playerid);
- if(IsOwnedCar(v)) return SysMsg(playerid, "You must be in a rentable vehicle to use this command.");
- if(IsFactionVehicle(v)) return SysMsg(playerid, "You must be in a rentable vehicle to use this command.");
- if(RentalCar[playerid] == 0) return SysMsg(playerid, "You are not renting this vehicle.");
- foreach(new i: Player) if(RentalCar[i] == v && i != playerid) return SysMsg(playerid, "This vehicle is being rented by someone else.");
- if(RentalCar[playerid] != v) return SysMsg(playerid, "You are not renting this vehicle.");
- if(!IsPlayerInRangeOfPoint(playerid, 10.0, RentalData[v][rPosX], RentalData[v][rPosY], RentalData[v][rPosZ])) return SysMsg(playerid, "You are not near the rental car lot.");
- ToggleVehicleLock(v, false);
- TogglePlayerControllable(playerid, false);
- RemovePlayerFromVehicle(playerid);
- SetTimerEx("UnFreezePlayer", 200, 0, "d", playerid);
- RepairVehicleEx(v);
- SetVehicleToRespawnEx(v);
- RentalCar[playerid] = 0;
- RentalTime[playerid] = 0;
- RentalRevoked{playerid} = false;
- new Float:vh, price;
- GetVehicleHealth(v, vh);
- price = ((1000 - floatround(vh)) * 3);
- if(vh < 1000)
- {
- SendClientMessageF(playerid, COLOR_RED, "You have been charged an additional $%s for damaging the vehicle.", format_cash(price));
- GivePlayerCash(playerid, -price);
- }
- SendClientMessageF(playerid, COLOR_WHITE, "You have returned the {BCDCBC}%s{FFFFFF} to the rental company.", GetVehicleName(v));
- return true;
- }
- //end of vehicle rental commands
- //end of vehicle rental commands
- //Sidejob commands
- CMD:deliver(playerid)
- {
- if(IsCuffed[playerid] == 1) return SysMsg(playerid,"This action cannot be performed while you are in handcuffs.");
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to use this feature.");
- if(IsDelivering[playerid] == 1) return SysMsg(playerid,"You are already doing a delivery.");
- if(!IsPlayerInRangeOfPoint(playerid, 30.0, 1387.9158, 264.1994, 19.5669)) return SysMsg(playerid,"You must be at the Pizza Stack to start.");
- if(IsPizzaCar(GetPlayerVehicleID(playerid)) == 0 || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You are not in a delivery vehicle.");
- if(DeliverSpamTime[playerid] > 0) return SysMsgF(playerid, "You must wait %i minutes to deliver again.", DeliverSpamTime[playerid]);
- new homecount = 0, zone[MAX_ZONE_NAME + 1], homesfound[100], town = random(4), townname[50], pizzacount = 0;
- if(town == 0) townname = "Montgomery";
- if(town == 1) townname = "Palomino Creek";
- if(town == 2) townname = "Blueberry";
- if(town == 3) townname = "Fort Carson";
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(homecount == 99) break; //end the loop if the homecount somehow gets this high to prevent crashing.
- Get2DZone(HouseData[h][oPosX], HouseData[h][oPosY], zone, MAX_ZONE_NAME);
- if(strcmp(townname, zone, true) == 0)
- {
- //original peach block homes, remove this code when/if the mapping is removed.
- if(HouseData[h][HouseSQLID] == 74 || HouseData[h][HouseSQLID] == 75 || HouseData[h][HouseSQLID] == 8 || HouseData[h][HouseSQLID] == 70) continue;
- homesfound[homecount] = h;
- homecount ++;
- }
- }
- //should never happen but it's just a failsafe.
- if(homecount == 0) return SysMsg(playerid, "An error has occurred while trying to find homes for you to deliver to.");
- for(new p = 0; p < homecount; p++)
- {
- if(pizzacount == 10) break;
- new randy = random(12);
- if(randy == 2)
- {
- PizzaHomes[playerid][pizzacount] = homesfound[p];
- PizzaMarkers[playerid][pizzacount] = CreateDynamicMapIcon(HouseData[homesfound[p]][oPosX], HouseData[homesfound[p]][oPosY], HouseData[homesfound[p]][oPosZ], 29, -1, -1, -1, playerid);
- pizzacount ++;
- }
- }
- //should never happen but it's just a failsafe.
- if(pizzacount == 0) return SysMsg(playerid, "An error has occurred while trying to find homes for you to deliver to.");
- new Float:vhealth;
- GetVehicleHealth(GetPlayerVehicleID(playerid), vhealth);
- IsDelivering[playerid] = 1;
- SidejobDamage[playerid] = floatround(vhealth);
- if(SidejobDamage[playerid] > 1000)
- {
- SidejobDamage[playerid] = 1000;
- SetVehicleHealthEx(GetPlayerVehicleID(playerid), 1000);
- }
- //apply spam timer
- if(DeliverLevel[playerid] == 1)
- {
- if(IsDonator[playerid] >= 2) DeliverSpamTime[playerid] = 30;
- else DeliverSpamTime[playerid] = 60;
- }
- else if(DeliverLevel[playerid] == 2)
- {
- if(IsDonator[playerid] >= 2) DeliverSpamTime[playerid] = 30;
- else DeliverSpamTime[playerid] = 55;
- }
- else if(DeliverLevel[playerid] == 3)
- {
- if(IsDonator[playerid] >= 2) DeliverSpamTime[playerid] = 30;
- else DeliverSpamTime[playerid] = 50;
- }
- else if(DeliverLevel[playerid] == 4)
- {
- if(IsDonator[playerid] >= 2) DeliverSpamTime[playerid] = 30;
- else DeliverSpamTime[playerid] = 45;
- }
- else if(DeliverLevel[playerid] == 5)
- {
- if(IsDonator[playerid] >= 2) DeliverSpamTime[playerid] = 30;
- else DeliverSpamTime[playerid] = 40;
- }
- SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You have been assigned to deliver pizza to %i homes in {FFFFFF}%s{00FF00}. Use /deliveryhomes to view said homes.", pizzacount, townname);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Alternatively, look for pizza icons on your minimap to get a general idea of where you must deliver pizzas to.");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Use /getpizza to get a pizza from your vehicle. To deliver the pizza, walk into the house icon.");
- return true;
- }
- CMD:getpizza(playerid)
- {
- if(IsDelivering[playerid] != 1) return SysMsg(playerid, "You are not delivering pizza.");
- if(IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must not be in a vehicle.");
- if(DeliverIndex[playerid] == 1) return SysMsg(playerid, "You do not have any more pizzas to deliver.");
- new v = GetNearestVehicle(playerid);
- if(!IsPizzaCar(v)) return SysMsg(playerid, "Vehicle must be a Pizzaboy.");
- if(HasPizza{playerid})
- {
- RemovePlayerAttachedObject(playerid, PizzaIndex[playerid]);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- HasPizza{playerid} = false;
- PizzaIndex[playerid] = -1;
- }
- else
- {
- new index = GetFreePlayerObjectIndex(playerid);
- if(index == -1) return SysMsg(playerid, "Could not find a clothing slot to attach a pizza box. Please take off an item.");
- SetPlayerAttachedObject(playerid, index, 19571, 1, -0.035999, 0.354000, -0.040999, -90.000000, -0.000000, -90.000000, 1.000000, 1.000000, 1.000000);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
- HasPizza{playerid} = true;
- PizzaIndex[playerid] = index;
- format(sgstr, sizeof(sgstr),"* %s gets a hot, fresh pizza from their Blista Compact. *",NameRP(playerid));
- ProxDetector(20.0,playerid,sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- return true;
- }
- CMD:deliveryhomes(playerid)
- {
- if(!Logged{playerid}) return true;
- if(IsDelivering[playerid] != 1) return SysMsg(playerid, "You are not delivering pizza.");
- gstr[0] = EOS;
- new homecount = 0;
- for(new x = 0; x < 10; x++)
- {
- if(PizzaHomes[playerid][x] != -1)
- {
- format(tgstr, sizeof(tgstr), "%i: %s\n", x + 1, HouseData[PizzaHomes[playerid][x]][HouseDescription]);
- strcat(gstr, tgstr);
- homecount ++;
- }
- }
- if(homecount == 0) return SysMsg(playerid, "Could not find any homes to deliver to.");
- else ShowMessage(playerid, "Homes Awaiting Delivery", gstr, "Thanks!");
- return true;
- }
- CMD:truck(playerid, params[])
- {
- if(IsCuffed[playerid] == 1) return SysMsg(playerid,"This action cannot be performed while you are in handcuffs.");
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to use this feature.");
- if(IsTrucking[playerid] == 1) return SysMsg(playerid,"You are already trucking.");
- if(TruckSpamTime[playerid] > 0) return SysMsgF(playerid, "You must wait %i minutes to truck again.",TruckSpamTime[playerid]);
- if(IsPlayerInRangeOfPoint(playerid,50.0,66.75766,-256.393,1.57867) || (IsPlayerInRangeOfPoint(playerid,50.0,585.711547, 1664.336669, 6.992187) && Faction[playerid] == FACTION_TRUCKING))
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(vehicleid == 0) return SysMsg(playerid, "You must be in a truck.");
- if(IsTruck(vehicleid) || GetVehicleModel(vehicleid) == 498)
- {
- if(Faction[playerid] == FACTION_TRUCKING || IsPlayerAdmin(playerid) || TruckLevel[playerid] == 5)
- {
- gstr[0] = EOS;
- strcat(gstr, "Select Random\n");
- for(new i = 0; i < sizeof(TruckRoutes); i++)
- {
- //vehicle is boxville
- if(GetVehicleModel(vehicleid) != 498 && TruckRoutes[i][TruckRouteTrailerID] == 0) continue;
- if(GetVehicleModel(vehicleid) == 498 && TruckRoutes[i][TruckRouteTrailerID] > 0) continue;
- format(sgstr, sizeof(sgstr), "FROM %s TO %s\n", TruckRoutes[i][TruckRouteStart], TruckRoutes[i][TruckRouteEnd]);
- strcat(gstr, sgstr);
- }
- Dialog_Show(playerid, TruckingRoutes, DIALOG_STYLE_LIST, "Select Job", gstr, "Select", "Cancel");
- return true;
- }
- if(GetVehicleModel(vehicleid) == 498 && Faction[playerid] != FACTION_TRUCKING) return SysMsg(playerid, "Only Elite Trucking can use a Boxville for this job.");
- new Float:vhealth;
- GetVehicleHealth(GetPlayerVehicleID(playerid), vhealth);
- IsTrucking[playerid] = 1;
- TruckIndex[playerid] = 0;
- SidejobDamage[playerid] = floatround(vhealth);
- if(SidejobDamage[playerid] > 1000)
- {
- SidejobDamage[playerid] = 1000;
- SetVehicleHealthEx(GetPlayerVehicleID(playerid), 1000);
- }
- new randLoad = random(sizeof(TruckRoutes));
- TruckRouteId[playerid] = randLoad;
- SetPlayerCheckpointEx(playerid, TruckRoutes[randLoad][TruckRoutePoints][0], TruckRoutes[randLoad][TruckRoutePoints][1], TruckRoutes[randLoad][TruckRoutePoints][2], 7.0);
- SendClientMessage(playerid, COLOR_ORANGE, "[TRUCKING JOB]");
- SendClientMessageF(playerid, COLOR_ORANGE, "Collect load from: %s", TruckRoutes[randLoad][TruckRouteStart]);
- SendClientMessageF(playerid, COLOR_ORANGE, "Deliver to: %s", TruckRoutes[randLoad][TruckRouteEnd]);
- SendClientMessageF(playerid, COLOR_ORANGE, "Hauling: %s", TruckRoutes[randLoad][TruckRouteLoad]);
- SendClientMessage(playerid, COLOR_WHITE, "Go to the marker now and collect the load.");
- }
- else return SysMsg(playerid,"You must be in a truck.");
- return true;
- }
- SysMsg(playerid,"You must be at the truck HQ to start.");
- return true;
- }
- CMD:drivebus(playerid, params[])
- {
- if(IsCuffed[playerid] == 1) return SysMsg(playerid,"This action cannot be performed while you are in handcuffs.");
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to use this feature.");
- if(IsDrivingBus{playerid}) return SysMsg(playerid,"You are already driving a bus route.");
- if(!IsPlayerInRangeOfPoint(playerid,50.0,-29.788593,-306.246978,5.422851)) return SysMsg(playerid,"You must be at the Bus Station to start.");
- if(!IsBus(GetPlayerVehicleID(playerid)) || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You must be in a Bus. (as Driver)");
- if(HasGPSWaypoint[playerid] == 1) return SysMsg(playerid,"You may not do a Bus job when the GPS is active.");
- IsDrivingBus{playerid} = true;
- BusRouteIndex[playerid] = 0;
- SidejobDamage[playerid] = 500;
- SetPlayerRaceCheckpointEx(playerid,2, -228.403884,-285.622985,1.078125 ,0.0, 0.0, 0.0, 5.0); //BUS_0_PanapticanCutoff
- SendClientMessage(playerid, COLOR_WHITE, "Bus Driver: Drive Around Red County Stopping At Marked Bus Stops. Each Bus Stop Gets You $10.");
- SendClientMessage(playerid, COLOR_WHITE, "You are driving ROUTE 101: Red County > Bone County > Red County.");
- SendClientMessage(playerid, COLOR_WHITE, "Current Bus Stop: n/a - Next Stop: The Panopticon Cutoff (START OF SERVICE)");
- return true;
- }
- CMD:coalmine(playerid, params[])
- {
- if(IsCuffed[playerid] == 1) return SysMsg(playerid,"This action cannot be performed while you are in handcuffs.");
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to use this feature.");
- if(IsCoalmining[playerid] > 0) return SysMsg(playerid,"You are already coalmining.");
- if(!IsPlayerInRangeOfPoint(playerid,30.0,841.066101, 861.726196, 13.106781)) return SysMsg(playerid,"You must be at the quarry to start.");
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You must be in a coalmine Dumper.");
- if(!IsDumper(GetPlayerVehicleID(playerid))) return SysMsg(playerid,"You must be in a coalmine Dumper.");
- if(CoalmineSpamTime[playerid] > 0) return SysMsgF(playerid, "You Must Wait %i Minutes Before You Can Coalmine Again.",CoalmineSpamTime[playerid]);
- new Float:vhealth;
- GetVehicleHealth(GetPlayerVehicleID(playerid), vhealth);
- IsCoalmining[playerid] = random(2)+1;
- CoalmineIndex[playerid] = 1;
- SidejobDamage[playerid] = floatround(vhealth);
- if(SidejobDamage[playerid] > 1000)
- {
- SidejobDamage[playerid] = 1000;
- SetVehicleHealthEx(GetPlayerVehicleID(playerid), 1000);
- }
- if(IsCoalmining[playerid] == 1)
- {
- SetPlayerCheckpointEx(playerid,815.422424, 847.468750, 10.534412,6.0); //COALMINE_1
- SendClientMessage(playerid,COLOR_ORANGE,"Deliver the coal throughout the quarry. You are driving route number 1.");
- }
- else if(IsCoalmining[playerid] == 2)
- {
- SetPlayerCheckpointEx(playerid,817.027343, 846.395263, 10.584503,6.0); //COALMINE_1
- SendClientMessage(playerid,COLOR_ORANGE,"Deliver the coal throughout the quarry. You are driving route number 2.");
- }
- return true;
- }
- CMD:collecttrash(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to use this feature.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid,"This action cannot be performed while you are in handcuffs.");
- if(IsTrashMan[playerid] > 0) return SysMsg(playerid,"You are already collecting trash.");
- if(!IsPlayerInRangeOfPoint(playerid,75.0,601.516845, 1224.664794, 11.718750)) return SysMsg(playerid,"You must be at the factory to start.");
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You must be in a Trashmaster.");
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 408) return SysMsg(playerid, "You must be in a Trashmaster.");
- if(GetPlayerVehicleSeat(playerid) != 0) return SysMsg(playerid, "You must be the driver of the Trashmaster to start the sidejob.");
- if(TrashSpamTime[playerid] > 0) return SysMsgF(playerid, "You must wait %i minutes before you can collect trash again.", TrashSpamTime[playerid]);
- new Float:vhealth;
- GetVehicleHealth(GetPlayerVehicleID(playerid), vhealth);
- IsTrashMan[playerid] = 1;
- TrashIndex[playerid] = 1;
- SidejobDamage[playerid] = floatround(vhealth);
- if(SidejobDamage[playerid] > 1000)
- {
- SidejobDamage[playerid] = 1000;
- SetVehicleHealthEx(GetPlayerVehicleID(playerid), 1000);
- }
- TrashMissionData[playerid][0] = GetPlayerVehicleID(playerid);
- SetPlayerCheckpointEx(playerid,167.428207, 1183.789550, 14.757812,6.0); //COALMINE_1
- SendClientMessage(playerid,COLOR_ORANGE,"Collect trash throughout Fort Carson. Go to the first pick up location.");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Trash Location 1: Cluckin' Bell");
- return true;
- }
- //End of sidejob commands
- CMD:addinterior(playerid, params[]) {
- if(!IsPlayerAdminLevelOK(playerid, 5)) return SysMsg(playerid, AUTHMSG);
- new intid;
- if(sscanf(params, "i", intid)) return SendClientMessage(playerid, -1, "Use /AddInterior [ID do Interior]");
- new Query[300], Float:P[3];
- GetPlayerPos(playerid, P[0], P[1], P[2]);
- mysql_format(conn, Query, 300, "UPDATE bizz SET IsSpecial = 1, iPosX = %f, iPosY = %f, iPosZ = %f WHERE id = %i", P[0], P[1], P[2], intid);
- mysql_query(conn, Query, false);
- format(Query, 144, "Interior adicionado ao \"Interior ID %i\"", intid);
- SendClientMessage(playerid, -1, Query);
- return 1;
- }
- //Vehicle commands
- CMD:savecar(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You are not in a car to save.");
- new v = GetPlayerVehicleID(playerid);
- if(IsPlayerInDynamicArea(playerid, PCArea)) return SysMsg(playerid, "You can't save your car here.");
- if(IsOwnedCar(VehicleData[v][IdVehicle]))
- {
- if(VehicleData[v][VehicleOwnerSQLID] != SQLID[playerid]) return SysMsg(playerid, "This car is not owned by you.");
- new Float:vPos[4], vworld = GetVehicleVirtualWorld(v), interior = GetPlayerInterior(playerid);
- GetVehiclePos(v, vPos[0], vPos[1], vPos[2]);
- GetVehicleZAngle(v, vPos[3]);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET LastX = %f, LastY = %f, LastZ = %f, LastRot = %f, VWorld = %i, Interior = %i WHERE id = %i", vPos[0], vPos[1], vPos[2], vPos[3], vworld, interior, VehicleData[v][VehSQLID]);
- mysql_pquery(conn, mquery);
- VehicleData[v][LastX] = vPos[0];
- VehicleData[v][LastY] = vPos[1];
- VehicleData[v][LastZ] = vPos[2];
- VehicleData[v][LastRot] = vPos[3];
- VehicleData[v][VirtualWorld] = vworld;
- VehicleData[v][FuelRemaining] = Fuel[v];
- VehicleData[v][VehicleInterior] = interior;
- SendClientMessage(playerid,COLOR_GOLD,"Vehicle position saved; it will now spawn here in the future.");
- return true;
- }
- return true;
- }
- CMD:removesharedkey(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(VehicleBorrowKey[playerid] == 0) return SysMsg(playerid,"You don't have a shared vehicle key to remove.");
- VehicleBorrowKey[playerid] = 0;
- VehicleBorrowKeyTime[playerid] = 0;
- MySQLUpdateInt(SQLID[playerid], "BorrowKey", VehicleBorrowKey[playerid], "players");
- MySQLUpdateInt(SQLID[playerid], "BorrowKeyTime", VehicleBorrowKeyTime[playerid], "players");
- SendClientMessage(playerid, COLOR_GOLD, "Your shared vehicle key has been removed. You can no longer use the vehicle that you were sharing.");
- return true;
- }
- CMD:givesharedkey(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(GetPlayerOwnedVehicleCount(playerid) == 0) return SysMsg(playerid,"You have no purchased cars to share.");
- new playa = -1, vid, minutes, slot = 1, ctr;
- if(sscanf(params, "uii", playa, vid, minutes))
- {
- for(ctr = 0; ctr < MAX_VEH_PER_PLAYER; ctr++)
- {
- if(VehicleData[ctr][VehicleOwnerSQLID] == SQLID[playerid])
- {
- if(!VehicleData[ctr][Impounded])
- {
- SendClientMessageF(playerid, COLOR_WHITE, "ID %i - %s", slot, GetVehicleName(ctr));
- slot ++;
- }
- }
- }
- SysMsg(playerid,"Usage: /givesharedkey [player id or name] [vehicle id from /mycars] [time in minutes]");
- return true;
- }
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't share keys with yourself.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to give them keys.");
- if(VehicleBorrowKey[playa] > 0) return SysMsg(playerid,"That player already has a shared key.");
- if(VehicleData[vid][VehicleOwnerSQLID] != SQLID[playerid]) return SysMsg(playerid,"This vehicle does not belong to you. As such you cannot give somebody a key for it.");
- if(minutes < 5 || minutes > 20160) return SysMsg(playerid,"Time must be between 5 and 20160 minutes (14 days).");
- VehicleShareOffer[playa][0] = playerid;
- VehicleShareOffer[playa][1] = vid;
- VehicleShareOffer[playa][2] = minutes;
- SendClientMessageF(playa, COLOR_WHITE, "%s has offered you a shared key to their %s. Use '/accept sharedkey' to confirm.", NameEx(playerid), GetVehicleName(vid));
- SendClientMessageF(playerid, COLOR_WHITE, "You have offered %s a shared key to your %s. They must first accept.", NameEx(playa), GetVehicleName(vid));
- return true;
- }
- CMD:speedo(playerid, params[])//velocimetro //V
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return SysMsg(playerid,"Usage: /speedo [on/off/type]");
- if(strcmp("on", params, false) == 0)
- {
- if(SpeedoActive[playerid] == 1) return SysMsg(playerid, "Your speedometer is already on.");
- SpeedoActive[playerid] = 1;
- if(GetPlayerVehicleID(playerid) > 0) PlayerTextDrawShow(playerid,SpeedText[playerid]);
- SendClientMessage(playerid,COLOR_GOLD,"Your speedometer is now turned on.");
- return true;
- }
- else if(strcmp("off", params, false) == 0)
- {
- if(SpeedoActive[playerid] == 0) return SysMsg(playerid, "Your speedometer is already off.");
- SpeedoActive[playerid] = 0;
- if(GetPlayerVehicleID(playerid) > 0) PlayerTextDrawHide(playerid,SpeedText[playerid]);
- if(GetPlayerVehicleID(playerid) > 0) PlayerTextDrawHide(playerid,Speedo3dl[playerid]);
- SendClientMessage(playerid,COLOR_GOLD,"Your speedometer is now turned off.");
- UnlockAchievement(playerid,27);
- return true;
- }
- else if(strcmp("type", params, false) == 0)
- {
- if(SpeedFormat[playerid] == 0)
- {
- SpeedFormat[playerid] = 1;
- MySQLUpdateInt(SQLID[playerid], "SpeedoFormat", SpeedFormat[playerid], "players");
- SendClientMessage(playerid,COLOR_GOLD,"Your speedometer is now set to show Kilometers Per Hour (KM/H).");
- UnlockAchievement(playerid,28);
- }
- else if(SpeedFormat[playerid] == 1)
- {
- SpeedFormat[playerid] = 0;
- MySQLUpdateInt(SQLID[playerid], "SpeedoFormat", SpeedFormat[playerid], "players");
- SendClientMessage(playerid,COLOR_GOLD,"Your speedometer is now set to show Miles Per Hour (MPH).");
- }
- return true;
- }
- SysMsg(playerid,"Usage: /speedo [on/off/type]");
- return true;
- }
- CMD:viewcars(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM vehicles WHERE OwnerSQLID = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery, "BuyVehicleFromShop", "i", playerid);
- return true;
- }
- CMD:viewbikes(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, 707.712890,-522.316284,16.335937)) return SysMsg(playerid,"You must be at the Motorbike shop in Dillimore.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM vehicles WHERE OwnerSQLID = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery, "BuyBikeFromShop", "i", playerid);
- return true;
- }
- CMD:viewboats(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, -2186.7673, 2413.8621, 5.1563)) return SysMsg(playerid, "You must be at the boat shop at the Bayside Docks.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM vehicles WHERE OwnerSQLID = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery, "BuyBoatFromShop", "i", playerid);
- return true;
- }
- CMD:viewstock(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- gstr[0] = EOS;
- new v = 0;
- strcat(gstr, "Vehicle\tPrice");
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 643.642395, -492.949493, 16.335937)) //mm
- {
- for(v = 0; v < sizeof(MicksVehicleData); v++)
- {
- format(gstr, sizeof(gstr), "%s\n%s\t$%s", gstr, GetVehicleNameEx(MicksVehicleData[v][0]), format_cash(MicksVehicleData[v][1]));
- }
- SetPVarInt(playerid, "ViewingStock", 1);
- Dialog_Show(playerid, StockView, DIALOG_STYLE_TABLIST_HEADERS, "Mick's Motors Stock List", gstr, "Select", "Close");
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, 707.712890,-522.316284,16.335937)) //bike
- {
- for(v = 0; v < sizeof(BuyMotorbikeData); v++)
- {
- format(gstr, sizeof(gstr), "%s\n%s\t$%s", gstr, GetVehicleNameEx(BuyMotorbikeData[v][0]), format_cash(BuyMotorbikeData[v][1]));
- }
- SetPVarInt(playerid, "ViewingStock", 2);
- Dialog_Show(playerid, StockView, DIALOG_STYLE_TABLIST_HEADERS, "Dealership Stock List", gstr, "Select", "Close");
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, -2186.7673, 2413.8621, 5.1563)) //boat
- {
- for(v = 0; v < sizeof(BuyBoatData); v++)
- {
- format(gstr, sizeof(gstr), "%s\n%s\t$%s", gstr, GetVehicleNameEx(BuyBoatData[v][0]), format_cash(BuyBoatData[v][1]));
- }
- SetPVarInt(playerid, "ViewingStock", 3);
- Dialog_Show(playerid, StockView, DIALOG_STYLE_TABLIST_HEADERS, "Dealership Stock List", gstr, "Select", "Close");
- }
- else return SysMsg(playerid, "You are not near any vehicle dealership.");
- return true;
- }
- CMD:setforsale(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(GetPlayerOwnedVehicleCount(playerid) == 0) return SysMsg(playerid,"You don't have any cars to sell.");
- new v = GetPlayerVehicleID(playerid);
- if(v == 0) return SysMsg(playerid,"You must be in a vehicle.");
- if(v == VehicleData[v][IdVehicle])
- {
- if(VehicleData[v][VehicleOwnerSQLID] != SQLID[playerid]) return SysMsg(playerid,"You don't own this vehicle.");
- if(VehicleData[v][ForSale]) return SysMsg(playerid,"This vehicle is already for sale.");
- if(VehicleData[v][DonatorCar]) return SysMsg(playerid,"You may not sell Donator vehicles.");
- new askingprice;
- if(sscanf(params, "i", askingprice)) return SysMsg(playerid,"Usage: /(set)forsale [asking price]");
- if(askingprice < 1 || askingprice > 10000000) return SysMsg(playerid,"Price must be between $1 and $10,000,000.");
- if(Inventory[playerid][Pen] == 0 || Inventory[playerid][Paper] == 0) return SysMsg(playerid,"You need a pen and paper to create a for sale sign.");
- Inventory[playerid][Pen] --;
- Inventory[playerid][Paper] --;
- VehicleData[v][ForSale] = true;
- VehicleData[v][ForSalePrice] = askingprice;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET ForSale = 1, ForSalePrice = %i WHERE id = %i", askingprice, VehicleData[v][VehSQLID]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET HasPaper = %i, HasPen = %i WHERE id = %i", Inventory[playerid][Paper], Inventory[playerid][Pen], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- new forsale[128];
- format(forsale, sizeof(forsale), "FOR SALE\n%s\n$%s\nPlease Call %i for more info.", GetVehicleName(v), format_cash(VehicleData[v][ForSalePrice]), PhoneData[playerid][pNumber]);
- VehicleData[v][ForSaleLabel] = CreateDynamic3DTextLabel(forsale, COLOR_SIGN, 0.0, 0.0, 0.0, 10.0, INVALID_PLAYER_ID, VehicleData[v][IdVehicle], 1, -1, 0, -1, 30.0);
- SendClientMessageF(playerid, COLOR_WHITE, "You have set your %s for sale with an asking price of $%s. Be sure to keep your phone on in case of callers!", GetVehicleName(v), format_cash(VehicleData[v][ForSalePrice]));
- format(gstr, sizeof(gstr),"* %s writes on a piece of paper then displays it inside their %s. *",NameRP(playerid),GetVehicleName(v));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- SysMsg(playerid,"You can't sell this vehicle.");
- return true;
- }
- CMD:forsale(playerid, params[]) return cmd_setforsale(playerid, params);
- CMD:cancelforsale(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(GetPlayerOwnedVehicleCount(playerid) == 0) return SysMsg(playerid,"You don't have any vehicles.");
- new v = GetPlayerVehicleID(playerid);
- if(v == 0) return SysMsg(playerid,"You must be in a vehicle.");
- if(v == VehicleData[v][IdVehicle])
- {
- if(VehicleData[v][VehicleOwnerSQLID] != SQLID[playerid]) return SysMsg(playerid,"You don't own this vehicle.");
- if(!VehicleData[v][ForSale]) return SysMsg(playerid,"This vehicle is not for sale.");
- VehicleData[v][ForSale] = false;
- VehicleData[v][ForSalePrice] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET ForSale = 0, ForSalePrice = 0 WHERE id = %i", VehicleData[v][VehSQLID]);
- mysql_pquery(conn, mquery);
- DestroyDynamic3DTextLabel(VehicleData[v][ForSaleLabel]);
- SendClientMessageF(playerid, COLOR_WHITE, "You have cancelled the sale of your %s.", GetVehicleName(v));
- format(gstr, sizeof(gstr),"* %s removes a piece of paper from view inside their %s. *",NameRP(playerid),GetVehicleName(v));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- return true;
- }
- CMD:refill(playerid, params[]) return cmd_refuel(playerid, params);
- CMD:fill(playerid, params[]) return cmd_refuel(playerid, params);
- CMD:fuel(playerid, params[]) return cmd_refuel(playerid, params);
- CMD:refuel(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new VehID;
- if(IsPlayerInAnyVehicle(playerid)) VehID = GetPlayerVehicleID(playerid);
- else VehID = GetClosestVehicle(playerid);
- if(VehID == 0) return SysMsg(playerid,"You must be in a vehicle with an engine.");
- if(!VehicleHasEngine(VehID)) return SysMsg(playerid,"This vehicle doesn't need fuel.");
- if(!IsPlayerNearGasStation(playerid)) return SysMsg(playerid,"You are not near a gas station. (Red County, Bone County and Angel Pine for cars/bikes, BC Airstrip for aircraft, Bayside Marina for boats.)");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- if(Fuel[VehID] >= 100) return SysMsg(playerid,"You already have a full gas tank.");
- if(EngineStatus[VehID] == 1) return SysMsg(playerid,"Please turn off the engine before refuelling.");
- if(IsPlayerRefilling[playerid] == 1) return SysMsg(playerid,"You are already filling this vehicle.");
- if(DeliveringFuel[playerid] > 0) return SysMsg(playerid, "You cannot refuel your vehicle while delivering fuel.");
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- new Float:x, Float:y, Float:z;
- GetVehiclePos(VehID, x, y, z);
- if(!IsPlayerInRangeOfPoint(playerid, 15.0, x, y, z)) return SysMsg(playerid, "You must be near the vehicle to refuel it.");
- }
- pRefilling[playerid] = 1;
- SetPVarInt(playerid, "fillType", 1);
- if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, COLOR_WHITE, "Exit the vehicle and proceed to the vehicle's gas cap.");
- else
- {
- StartRefueling(playerid);
- SendClientMessage(playerid, COLOR_WHITE, "Proceed to your vehicle's fuel cap to start refueling.");
- }
- return true;
- }
- CMD:fuelcan(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new VehID = GetPlayerVehicleID(playerid);
- if(VehID == 0) return SysMsg(playerid,"You must be in a vehicle with an engine.");
- if(!VehicleHasEngine(VehID)) return SysMsg(playerid,"This vehicle doesn't need fuel.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You are not the driver.");
- if(EngineStatus[VehID] == 1) return SysMsg(playerid,"Please turn off the engine to refuel using this method.");
- if(Fuel[VehID] == 100) return SysMsg(playerid,"Vehicle already has maximum fuel.");
- if(Inventory[playerid][FuelCan][0] == -1) return SysMsg(playerid,"You don't have a Fuel Can to use.");
- if(Inventory[playerid][FuelCan][0] == 0) return SysMsg(playerid,"Your Fuel Can is empty.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- if(IsPlayerRefilling[playerid] == 1) return SysMsg(playerid,"You are already filling this vehicle.");
- new fuelAmount = -1;
- if(sscanf(params, "i", fuelAmount))
- {
- SysMsg(playerid,"Usage: /fuelcan [amount of gas (as percentage)]");
- SysMsgF(playerid, "Current Fuel: %.0f percent. Use %.0f to fill the tank.", Fuel[VehID], floatsub(100.0, Fuel[VehID]));
- return true;
- }
- if(fuelAmount < 1 || fuelAmount > 100) return SysMsg(playerid,"Amount must be between 1 and 100.");
- if(fuelAmount > Inventory[playerid][FuelCan][0]) return SysMsg(playerid,"You do not have that much fuel in your can.");
- if(Fuel[VehID] + fuelAmount > 100) return SysMsg(playerid,"You cannot add that much fuel to this vehicle.");
- if(VehID == VehicleData[VehID][IdVehicle])
- {
- if(VehicleData[VehID][VehicleOwnerSQLID] != SQLID[playerid])
- {
- if(GetVehicleFuelType(VehID) != Inventory[playerid][FuelCan][1]) return SysMsg(playerid,"You may not add this fuel to this vehicle since you do not own it.");
- }
- }
- new Float:CapPos[3];
- GetVehiclePetrolCapPos(GetVehicleModel(VehID), CapPos[0], CapPos[1]);
- if(CapPos[0] == 0 && CapPos[1] == 0)
- {
- Inventory[playerid][FuelCan][0] = Inventory[playerid][FuelCan][0] - fuelAmount;
- Fuel[VehID] = Fuel[VehID] + fuelAmount;
- if(Fuel[VehID] < 10) TextDrawShowForPlayer(playerid, LowFuelText);
- else TextDrawHideForPlayer(playerid, LowFuelText);
- MySQLUpdateInt(SQLID[playerid], "HasFuelCan", Inventory[playerid][FuelCan][0], "players");
- if(Inventory[playerid][FuelCan][0] == 0) return SendClientMessage(playerid, COLOR_RED, "Seu galão de combustível agora está vazio, use /enchergalao para encher.");
- //UpdateFuelText(VehID, gstr);
- //PlayerTextDrawSetString(playerid, FuelText[playerid],gstr);
- format(gstr, sizeof(gstr),"* %s usa um galão de combustível para abastecer o veículo %s. *",NameRP(playerid),GetVehicleNameEx(GetVehicleModel(VehID)));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_RED, "Este veículo foi reabastecido usando um galão. ((Não foi encontrada a tampa do tanque do veículo))");
- }
- else
- {
- RemovePlayerFromVehicle(playerid);
- UsingFuelCan[playerid][1] = VehID;
- UsingFuelCan[playerid][0] = fuelAmount;
- CapPos[1] = -CapPos[1];
- RotatePointVehicleRotation(VehID, CapPos, RefuelStandPos[playerid][0], RefuelStandPos[playerid][1], RefuelStandPos[playerid][2], 1);
- SetPlayerCheckpointEx(playerid, RefuelStandPos[playerid][0], RefuelStandPos[playerid][1], RefuelStandPos[playerid][2], 0.5);
- SetPlayerAttachedObject(playerid, HOLD_OBJECT_MISC, 1650, 6, 0.15, 0.015, 0.05, 0.0, 270.0, 0.0);
- SendClientMessage(playerid, COLOR_WHITE, "> Tampa do tanque {4BB74C}aberta{FFFFFF}, vá no ponto {FF0000}marcado{FFFFFF} para abastecer o veículo.");
- format(gstr, sizeof(gstr),"* %s pressiona um botão no painel do veículo %s e abre a tampa do tanque de combustível. *",NameRP(playerid),GetVehicleName(VehID));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- return true;
- }
- CMD:refillfc(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerNearGasStation(playerid)) return SysMsg(playerid,"You are not near a gas station. (Red County, Bone County and Angel Pine Only)");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SysMsg(playerid,"You must be on foot to refill your fuel container.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- if(IsPlayerRefilling[playerid] == 1) return SysMsg(playerid,"You are already re-filling.");
- if(Inventory[playerid][FuelCan][0] == -1) return SysMsg(playerid,"You don't have a Fuel Can to fill.");
- if(Inventory[playerid][FuelCan][0] == 100) return SysMsg(playerid,"Your Fuel Can is already full.");
- new amount, fueltype[8];
- if(sscanf(params, "s[8]i", fueltype, amount))
- {
- SysMsg(playerid,"Usage: /refillfc [petrol/diesel] [amount of gas (as percentage)]");
- SysMsgF(playerid, "Current Fuel: %i percent. Use %i to fill your container.", Inventory[playerid][FuelCan][0], 100-Inventory[playerid][FuelCan][0]);
- return true;
- }
- new fuelstation = -1;
- for(new i = 0; i < MAX_FUEL_STATIONS; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 50.0, FuelStations[i][SignX], FuelStations[i][SignY], FuelStations[i][SignZ]))
- {
- fuelstation = i;
- break;
- }
- }
- if(amount < 5 || amount > 100) return SysMsg(playerid,"Amount must be between 5 and 100.");
- if(fuelstation > 0 && FuelStations[fuelstation][PetrolAmount] <= 0) return SysMsg(playerid,"This gas station does not have any fuel left.");
- if(Inventory[playerid][FuelCan][0] + amount > 100) return SysMsg(playerid,"This container can't hold that much fuel.");
- new gasprice;
- if(strcmp("petrol", fueltype, true) == 0)
- {
- if(FuelStations[fuelstation][PetrolAmount] < amount) return SysMsg(playerid,"This gas station doesn't have that much fuel.");
- if(Inventory[playerid][FuelCan][0] > 0 && Inventory[playerid][FuelCan][1] != FUEL_GASOLINA) return SysMsg(playerid,"You cannot mix both petrol and diesel in the same fuel container.");
- gasprice = amount;
- if(IsDonator[playerid] < 4 && Cash[playerid] < gasprice) return SysMsg(playerid,"You don't have enough money for this amount of much petrol.");
- Inventory[playerid][FuelCan][1] = FUEL_GASOLINA;
- MySQLUpdateInt(SQLID[playerid], "HasFuelCanType", Inventory[playerid][FuelCan][1], "players");
- SendClientMessageF(playerid, COLOR_WHITE, "You have added {FFAB1A}%i{FFFFFF} percent of petrol to your container for {339900}$%i{FFFFFF}.", amount, gasprice);
- FuelStations[fuelstation][PetrolAmount] -= amount;
- UpdateFuelStationSign(fuelstation);
- }
- else if(strcmp("diesel", fueltype, true) == 0)
- {
- if(FuelStations[fuelstation][DieselAmount] < amount) return SysMsg(playerid,"This gas station doesn't have that much fuel.");
- if(Inventory[playerid][FuelCan][0] > 0 && Inventory[playerid][FuelCan][1] != FUEL_DIESEL) return SysMsg(playerid,"You cannot mix both petrol and diesel in the same fuel container.");
- gasprice = amount * 2;
- if(IsDonator[playerid] < 4 && Cash[playerid] < gasprice) return SysMsg(playerid,"You don't have enough money for this amount of much diesel.");
- Inventory[playerid][FuelCan][1] = FUEL_DIESEL;
- MySQLUpdateInt(SQLID[playerid], "HasFuelCanType", Inventory[playerid][FuelCan][1], "players");
- SendClientMessageF(playerid, COLOR_WHITE, "You have added {FFAB1A}%i{FFFFFF} percent of diesel to your container for {339900}$%i{FFFFFF}.", amount, gasprice);
- FuelStations[fuelstation][DieselAmount] -= amount;
- UpdateFuelStationSign(fuelstation);
- }
- else return SysMsg(playerid,"You must specify petrol or diesel only.");
- Inventory[playerid][FuelCan][0] += amount;
- MySQLUpdateInt(SQLID[playerid], "HasFuelCan", Inventory[playerid][FuelCan][0], "players");
- if(IsDonator[playerid] < 4) GivePlayerCash(playerid, -gasprice);
- format(gstr, sizeof(gstr),"* %s fills their fuel container. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:emptyfc(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SysMsg(playerid,"You must be on foot to empty your fuel container.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- if(IsPlayerRefilling[playerid] == 1) return SysMsg(playerid,"You are currently re-filling.");
- if(Inventory[playerid][FuelCan][0] == -1) return SysMsg(playerid,"You don't have a Fuel Can to fill.");
- if(Inventory[playerid][FuelCan][0] == 0) return SysMsg(playerid,"Your Fuel Can is already empty.");
- Inventory[playerid][FuelCan][0] = 0;
- MySQLUpdateInt(SQLID[playerid], "HasFuelCan", Inventory[playerid][FuelCan][0], "players");
- format(gstr, sizeof(gstr),"* %s empties their fuel container on the ground *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:einfo(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new VehID = GetPlayerVehicleID(playerid);
- if(VehID == 0 || !VehicleHasEngine(VehID)) return SysMsg(playerid,"You must be in a vehicle with an engine.");
- new fueltype[20];
- switch(GetVehicleFuelType(VehID))
- {
- case FUEL_NONE: fueltype = "None";
- case FUEL_GASOLINA: fueltype = "Petrol";
- case FUEL_DIESEL: fueltype = "Diesel";
- }
- SendClientMessageF(playerid,COLOR_WHITE, "[%s] Fuel Type: {38B0DE}%s", GetVehicleName(VehID), fueltype);
- return true;
- }
- CMD:engineinfo(playerid, params[]) return cmd_einfo(playerid, params);
- CMD:engineon(playerid)
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You must be in a vehicle with an engine.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You are not the driver.");
- new VehID = GetPlayerVehicleID(playerid);
- if(!VehicleHasEngine(VehID))
- {
- EngineStatus[VehID] = 1;
- ToggleVehicleEngine(VehID, 1);
- return SysMsg(playerid,"This vehicle has no engine.");
- }
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- if(EngineStatus[VehID] == 1) return SysMsg(playerid,"This vehicle is already turned on.");
- if(ViewingBuyableCar[playerid] == 1 || EngineStartDelay[playerid] > 0) return true;
- if(VehicleBroke[VehID] > 0) return SysMsg(playerid,"The engine is broken.");
- if(Fuel[VehID] <= 0) return SysMsg(playerid,"You cannot start a car with no fuel.");
- if(IsPlayerRefilling[playerid] == 1) return SysMsg(playerid,"Please wait until you finish refuelling the vehicle.");
- if(RentalData[VehID][CarID] >= 1 && RentalCar[playerid] != RentalData[VehID][CarID]) return SysMsg(playerid, "You do not have the keys to this rental car.");
- if(VehicleData[VehID][VehicleOwnerSQLID] == SQLID[playerid])
- {
- if(VehicleData[VehID][Mileage] - VehicleData[VehID][LastOilMileage] >= 500)
- {
- OilTextToggle[playerid] = 1;
- if(VehicleData[VehID][Mileage] - VehicleData[VehID][LastOilMileage] >= 520)
- {
- OilTextToggle[playerid] = 3;
- SendClientMessage(playerid, COLOR_RED, "> There is a problem with this vehicles engine and it cannot start. (Engine Oil)");
- format(sgstr, sizeof(sgstr),"* %s tries to start the %s's engine but the engine immediately cuts out. *", NameRP(playerid), GetVehicleNameEx(GetVehicleModel(VehID)));
- ProxDetector(20.0,playerid,sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- }
- }
- if(FuelTypeAfterRefuel[VehID] != GetVehicleFuelType(VehID) && FuelTypeAfterRefuel[VehID] > 0)
- {
- SetVehicleHealthEx(VehID, 275.0);
- ToggleVehicleEngine(VehID, 0);
- VehicleBroke[VehID] = 2;
- if(IsOwnedCar(VehID)) VehicleData[VehID][Hotwired] = 0;
- SendClientMessage(playerid, COLOR_RED, "> Wrong fuel type in vehicle!");
- format(sgstr, sizeof(sgstr),"* A loud crank is heard when %s turns on the %s's engine *", NameRP(playerid), GetVehicleNameEx(GetVehicleModel(VehID)));
- ProxDetector(20.0,playerid,sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(sgstr, sizeof(sgstr),"* A loud bang is heard as the %s comes to a dead stop. *",GetVehicleNameEx(GetVehicleModel(VehID)));
- ProxDetector(20.0,playerid,sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_RED, "This vehicle is broken and needs to be repaired.");
- return true;
- }
- format(sgstr, sizeof(sgstr),"* Twists the key in the %s's ignition. *",GetVehicleNameEx(GetVehicleModel(VehID)));
- SetPlayerChatBubble(playerid, sgstr, COLOR_EMOTE, 15.0, 2000);
- TextDrawHideForPlayer(playerid, VehicleEngineText);
- ShowInfoText(playerid, "~g~Engine Starting.", 1200);
- if(Fuel[VehID] < 10) TextDrawShowForPlayer(playerid, LowFuelText);
- else TextDrawHideForPlayer(playerid, LowFuelText);
- new SlowStart[21] =
- {
- 417, 425, 447, 460, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520, 548, 553, 563, 577, 592, 593
- };
- new found = 0;
- for(new dv = 0; dv < sizeof(SlowStart); dv++)
- {
- if(SlowStart[dv] == GetVehicleModel(VehID))
- {
- found = 1;
- break;
- }
- }
- if(found == 1) EngineStartDelay[playerid] = 4;
- else EngineStartDelay[playerid] = 2;
- return true;
- }
- CMD:eon(playerid) return cmd_engineon(playerid);
- CMD:hotwire(playerid)
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a vehicle.");
- if(Inventory[playerid][Toolbox] == 0) return SysMsg(playerid,"You will need tools to hotwire this vehicle.");
- new VehID = GetPlayerVehicleID(playerid);
- if(!IsOwnedCar(VehID)) return SysMsg(playerid, "You can only hotwire owned vehicles.");
- if(EngineStatus[VehID] == 1) return SysMsg(playerid,"This vehicle's engine is already running.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You are not the driver of a vehicle.");
- if(IsPushBike(VehID)) return SysMsg(playerid, "You may not hotwire a bike.");
- if(VehicleBroke[VehID] == 1 || VehicleBroke[VehID] == 2) return SysMsg(playerid, "This vehicle is broken and cannot be hotwired.");
- if(VehicleData[VehID][Hotwired] == 1) return SysMsg(playerid, "This vehicle has already been hotwired.");
- if(!VehicleHasEngine(VehID)) return SysMsg(playerid,"This vehicle has no engine.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- if(VehicleBroke[VehID] > 0) return SysMsg(playerid,"The engine is broken.");
- if(Fuel[VehID] <= 0) return SysMsg(playerid,"You cannot start a car with no fuel.");
- if(VehicleData[VehID][Mileage] - VehicleData[VehID][LastOilMileage] >= 520) return SysMsg(playerid, "This vehicle needs its oil changed and cannot be hotwired.");
- if(IsPlayerRefilling[playerid] == 1) return SysMsg(playerid,"Please wait until you finish refuelling the vehicle.");
- if(Hotwiring[playerid][0] > 0) return SysMsg(playerid,"You are already hotwiring this vehicle.");
- new engine, lights, alarm, doors, bonnet, boot, objective, Float:vhp;
- GetVehicleParamsEx(VehID, engine, lights, alarm, doors, bonnet, boot, objective);
- GetVehicleHealth(VehID, vhp);
- if(engine == 1) return SysMsg(playerid,"This vehicle's engine is already running.");
- if(vhp <= 400) return SysMsg(playerid, "This vehicle is broken and cannot be hotwired.");
- HotwireCar(playerid, VehID);
- return true;
- }
- CMD:eoff(playerid)
- {
- if(!Logged{playerid}) return true;
- new VehID = GetPlayerVehicleID(playerid);
- if(VehID == 0) return SysMsg(playerid,"You must be in a vehicle with an engine.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You are not the driver.");
- if(!VehicleHasEngine(VehID)) return SysMsg(playerid,"This vehicle has no engine.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- if(EngineStatus[VehID] == 0) return SysMsg(playerid,"This vehicle is already turned off.");
- if(VehicleData[VehID][VehicleOwnerSQLID] != SQLID[playerid] && VehicleData[VehID][Hotwired] == 1 && VehicleBorrowKey[playerid] != VehicleData[VehID][VehSQLID]) return SysMsg(playerid, "Você não pode desligar o motor do veículo depois de ter feiro ligação direta.");
- EngineStatus[VehID] = 0;
- ToggleVehicleEngine(VehID, 0);
- if(VehicleData[VehID][Hotwired] == 1)
- {
- VehicleData[VehID][Hotwired] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET HotwireExpiration = 0 WHERE id = %i", VehicleData[VehID][VehSQLID]);
- mysql_pquery(conn, mquery);
- }
- SendClientMessage(playerid, COLOR_WHITE, "> Engine Turned {8B0000}Off");
- format(gstr, sizeof(gstr),"* %s turns off the vehicles engine. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- ShowInfoText(playerid,"~r~Engine Off",2000);
- //PlayerTextDrawHide(playerid, FuelText[playerid]);
- HideFuelTDForPlayer(playerid);
- PlayerTextDrawHide(playerid, SpeedText[playerid]);
- PlayerTextDrawHide(playerid, SpeedTextM[playerid]);
- PlayerTextDrawHide(playerid, Speedo3dl[playerid]);
- OcultarVeh03DL(playerid);
- TextDrawHideForPlayer(playerid, texmilhas3dl); //
- TextDrawHideForPlayer(playerid, luzesTxD3dl); //
- TextDrawHideForPlayer(playerid, texmilhas3dl1); //
- TextDrawHideForPlayer(playerid, lockedTxD3dl);
- TextDrawHideForPlayer(playerid, unlockedTxD3dl); //
- TextDrawHideForPlayer(playerid, LowFuelText); //
- foreach(new p: Player)
- {
- if(IsSpectating[p] == playerid)
- {
- PlayerTextDrawHide(p, SpeedText[playerid]);
- PlayerTextDrawHide(p, SpeedTextM[playerid]);
- }
- }
- return true;
- }
- CMD:engineoff(playerid) return cmd_eoff(playerid);
- CMD:engine(playerid)
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You must be in a vehicle with an engine.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You are not the driver.");
- new VehID = GetPlayerVehicleID(playerid);
- if(!VehicleHasEngine(VehID)) return SysMsg(playerid,"This vehicle has no engine.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- if(EngineStatus[VehID] == 0) cmd_engineon(playerid);
- else cmd_engineoff(playerid);
- return true;
- }
- CMD:luzes(playerid, params[])//luzes
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You must be in a vehicle.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You are not the driver.");
- new VehID = GetPlayerVehicleID(playerid);
- if(IsBoat(VehID) || IsPlane(VehID) || IsHelicopter(VehID)) return SysMsg(playerid,"This vehicle does not have any usable lights.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- if(ELMs{VehID}) return SysMsg(playerid,"This cannot be used when the Emergency Lights are on.");
- if(VehicleLights[VehID] == 0)
- {
- ToggleVehicleLights(VehID, 1);
- VehicleLights[VehID] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "> Lights Turned {4BB74C}On");
- TextDrawShowForPlayer(playerid, luzesTxD3dl);
- format(gstr, sizeof(gstr),"* %s turns on the vehicles lights. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- ShowInfoText(playerid,"~g~Lights On",1000);
- VehicleLights[VehID] = 1;
- }
- else if(VehicleLights[VehID] == 1)
- {
- ToggleVehicleLights(VehID, 0);
- VehicleLights[VehID] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "> Lights Turned {8B0000}Off");
- TextDrawHideForPlayer(playerid, luzesTxD3dl);
- format(gstr, sizeof(gstr),"* %s turns off the vehicles lights. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- ShowInfoText(playerid,"~r~Lights Off",1000);
- VehicleLights[VehID] = 0;
- }
- return true;
- }
- CMD:vlights(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- SendClientMessage(playerid, COLOR_WHITE, "Tap '~k~~TOGGLE_SUBMISSIONS~' to flash headlights. Hold for 1 second to toggle lights on/off.");
- return true;
- }
- CMD:tlon(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new VehID = GetPlayerVehicleID(playerid);
- if(VehID == 0) return SysMsg(playerid,"You must be in a vehicle.");
- new VehTrailerID = GetVehicleTrailer(VehID);
- if(VehTrailerID == 0) return SysMsg(playerid,"You must have a trailer.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You are not the driver.");
- if(VehicleLights[VehTrailerID] == 1) return SysMsg(playerid,"Lights are already on.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- ToggleVehicleLights(VehTrailerID, 1);
- VehicleLights[VehTrailerID] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "> Trailer Lights Turned {4BB74C}On");
- ShowInfoText(playerid,"~g~trailer Lights On",1000);
- return true;
- }
- CMD:tloff(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new VehID = GetPlayerVehicleID(playerid);
- if(VehID == 0) return SysMsg(playerid,"You must be in a vehicle.");
- new VehTrailerID = GetVehicleTrailer(VehID);
- if(VehTrailerID == 0) return SysMsg(playerid,"You must have a trailer.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You are not the driver.");
- if(VehicleLights[VehTrailerID] == 0) return SysMsg(playerid,"Lights are already off.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- ToggleVehicleLights(VehTrailerID, 0);
- VehicleLights[VehTrailerID] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "> Trailer Lights Turned {8B0000}Off");
- ShowInfoText(playerid,"~r~trailer Lights Off",1000);
- return true;
- }
- CMD:bonnet(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new VehID = GetPlayerVehicleID(playerid);
- if(VehID == 0) return SysMsg(playerid,"You must be in a vehicle.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You must be in the driver seat.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- if(VehicleBoots[VehID][0] == 1)
- {
- ToggleVehicleBonnet(VehID, 0);
- VehicleBoots[VehID][0] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "> Bonnet {8B0000}Closed");
- }
- else
- {
- ToggleVehicleBonnet(VehID, 1);
- VehicleBoots[VehID][0] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "> Bonnet {4BB74C}Opened");
- format(gstr, sizeof(gstr),"* %s pulls a lever to pop open the bonnet. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- return true;
- }
- CMD:hood(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new VehID = GetPlayerVehicleID(playerid);
- if(VehID == 0) return SysMsg(playerid,"You must be in a vehicle.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You must be in the driver seat.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't do that when you are tied.");
- if(VehicleBoots[VehID][0] == 1)
- {
- ToggleVehicleBonnet(VehID, 0);
- VehicleBoots[VehID][0] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "> Hood {8B0000}Closed");
- }
- else
- {
- ToggleVehicleBonnet(VehID, 1);
- VehicleBoots[VehID][0] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "> Hood {4BB74C}Opened");
- format(gstr, sizeof(gstr),"* %s pulls a lever to pop open the hood. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- return true;
- }
- CMD:testalarm(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new VehID = GetPlayerVehicleID(playerid);
- if(VehID == 0) return SysMsg(playerid,"You must be in a vehicle.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You are not the driver.");
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(VehID, engine, lights, alarm, doors, bonnet, boot, objective);
- if(alarm == 1) return SysMsg(playerid,"Alarm is already activated.");
- SetVehicleParamsEx(VehID, engine, 1, 1, doors, bonnet, boot, objective);
- SetTimerEx("ToggleVehicleAlarm", 10000, 0, "dd", VehID, 0);
- SendClientMessage(playerid, COLOR_WHITE, "> Alarm Turned {4BB74C}On");
- return true;
- }
- CMD:viewhouseguests(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(GetPlayerHouseCount(playerid) == 0) return SysMsg(playerid, "You must own a house to view guests.");
- if(isnull(params) || !IsNumeric(params))
- {
- for(new x = 0; x < MAX_HOUSE_PER_PLAYER; x++)
- {
- if(HasHouseKey[playerid][x] != -1)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "House ID: %i - %s", x, HouseData[HasHouseKey[playerid][x]][HouseDescription]);
- }
- }
- return SysMsg(playerid, "Usage: /viewhouseguests [House ID from above]");
- }
- new id = strval(params);
- if(id != 0 && id != 1) return SysMsg(playerid, "Invalid house ID.");
- if(HasHouseKey[playerid][id] == -1) return SysMsg(playerid, "You do not have a house in this slot.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Name,LastLogin FROM players WHERE GuestHouseID = %i", HouseData[HasHouseKey[playerid][id]][HouseSQLID]);
- mysql_pquery(conn, mquery, "ShowHouseGuests", "d", playerid);
- return true;
- }
- CMD:myhouse(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- gstr[0] = EOS;
- if(HasHouseKey[playerid][0] == -1 && HasHouseKey[playerid][1] == -1 && IsHouseGuest(playerid) == 0 && RentRoom[playerid] == 0) return SysMsg(playerid, "You are currently not staying anywhere.");
- if(HasHouseKey[playerid][0] != -1)
- {
- new h = HasHouseKey[playerid][0];
- strcat(gstr, "OWNED HOUSE\nAddress: ");
- strcat(gstr, HouseData[h][HouseDescription]);
- strcat(gstr, "\nHouse Guest: Use /viewhouseguests 0.");
- strcat(gstr, "\n\n");
- }
- if(HasHouseKey[playerid][1] != -1)
- {
- new h = HasHouseKey[playerid][1];
- strcat(gstr, "OWNED HOUSE 2\nAddress: ");
- strcat(gstr, HouseData[h][HouseDescription]);
- strcat(gstr, "\nHouse Guest: Use /viewhouseguests 1.");
- strcat(gstr, "\n\n");
- }
- new ghouse = IsHouseGuest(playerid);
- if(ghouse > 0)
- {
- strcat(gstr, "GUEST IN HOUSE\nAddress: ");
- strcat(gstr, HouseData[ghouse][HouseDescription]);
- strcat(gstr, "\nOwner: ");
- strcat(gstr, GetSQLName(HouseData[ghouse][HouseOwnerSQLID]));
- strcat(gstr, "\n\n");
- }
- if(RentRoom[playerid] > 0)
- {
- new place[50], m = RentRoom[playerid], value[5];
- switch(MotelData[m][MotelID])
- {
- case 1,2,3,4: format(place, 50, "Fort Carson");
- case 5: format(place, 50, "Valle Ocultado");
- case 6: format(place, 50, "Angel Pine");
- case 7: format(place, 50, "Xoomer Service Station");
- }
- strcat(gstr, "RENTED MOTEL ROOM\nMotel: ");
- strcat(gstr, place);
- strcat(gstr, "\nDays remaining: ");
- valstr(value, MotelData[RentRoom[playerid]][RoomDaysLeft]);
- strcat(gstr, value);
- strcat(gstr, "\n\n");
- }
- Dialog_Show(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "My House Information", gstr, "Done", "");
- return true;
- }
- CMD:scrapvehicle(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to use this feature.");
- if(GetPlayerVehicleID(playerid) == 0) return SysMsg(playerid,"You must be in a car to scrap it.");
- if(IsRentalCar(GetPlayerVehicleID(playerid))) return SysMsg(playerid, "You cannot scrap rental cars.");
- if(IsPlane(GetPlayerVehicleID(playerid))) return SysMsg(playerid,"You cannot scrap Planess here.");
- if(IsHelicopter(GetPlayerVehicleID(playerid))) return SysMsg(playerid,"You cannot scrap Helicopters here.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You must be the driver.");
- if(IsFactionVehicle(GetPlayerVehicleID(playerid)) > 0) return SysMsg(playerid,"You cannot scrap faction vehicles.");
- if(BeingScrapped{GetPlayerVehicleID(playerid)}) return SysMsg(playerid, "This vehicle is already being scrapped.");
- if(VehicleData[GetPlayerVehicleID(playerid)][DonatorCar]) return SysMsg(playerid,"You may not scrap Donator vehicles.");
- if(SQLID[playerid] != VehicleData[GetPlayerVehicleID(playerid)][VehicleOwnerSQLID]) return SysMsg(playerid, "You must own this vehicle if you wish to scrap it.");
- if(IsSuitableTaxiCar(GetPlayerVehicleID(playerid)) && JobDuty[playerid] == 1) return SysMsg(playerid, "You cannot scrap your taxi vehicle if you are on duty.");
- if(IsPlayerInRangeOfPoint(playerid, 7.0, 224.557, 98.4865, 3.8906) && !IsBoat(GetPlayerVehicleID(playerid)) || IsPlayerInDynamicArea(playerid, GarageAreas[5]) && IsBoat(GetPlayerVehicleID(playerid)))
- {
- BeingScrapped{GetPlayerVehicleID(playerid)} = true;
- SetPVarInt(playerid, "ScrapCar", GetPlayerVehicleID(playerid));
- RemovePlayerFromVehicle(playerid);
- if(!IsPlayerInDynamicArea(playerid, GarageAreas[5]))
- {
- SetPlayerCameraPos(playerid, 217.2184, 89.5583, 16.9906);
- SetPlayerCameraLookAt(playerid, 224.0594, 96.6424, 15.2541);
- SetPlayerPos(playerid, 218.149, 93.0901, 3.89062);
- }
- else
- {
- SetPlayerCameraPos(playerid, -2184.2893,2434.2036,13.8967);
- SetPlayerCameraLookAt(playerid, -2207.0972, 2424.8665, 0.1369);
- SetPlayerPos(playerid, -2192.6199, 2409.2146, 4.9583);
- }
- TogglePlayerControllable(playerid, 0);
- new Float:cost = (0.25 * VehicleData[GetPlayerVehicleID(playerid)][VehiclePrice]), price = floatround(cost);
- format(gstr, sizeof(gstr), "{FFFFFF}Are you sure you want to scrap your %s? You will get 25 percent of the vehicle's cost ($%s) and you will {E20000}NEVER{FFFFFF} be able to use this vehicle again as it will be deleted.", GetVehicleName(GetPlayerVehicleID(playerid)), format_cash(price));
- Dialog_Show(playerid, VehicleScrap, DIALOG_STYLE_MSGBOX, "Scrap Car?", gstr, "Yes", "No");
- }
- else SysMsg(playerid, "You are not near the scrapyard or the Bayside Docks.");
- return true;
- }
- CMD:collectvehicle(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new bodyshop = -1;
- if(IsPlayerInDynamicArea(playerid, GarageAreas[0])) bodyshop = 1; //palomino creek
- if(IsPlayerInDynamicArea(playerid, GarageAreas[1])) bodyshop = 2; //dillimore
- if(IsPlayerInDynamicArea(playerid, GarageAreas[2])) bodyshop = 3; //fort carson
- if(IsPlayerInDynamicArea(playerid, GarageAreas[3])) bodyshop = 4; //el q
- if(IsPlayerInDynamicArea(playerid, GarageAreas[4])) bodyshop = 5; //airstrip
- if(IsPlayerInDynamicArea(playerid, GarageAreas[5])) bodyshop = 6; //bayside
- if(IsPlayerInDynamicArea(playerid, GarageAreas[6])) bodyshop = 7; //angel pine
- if(bodyshop == -1) return SysMsg(playerid,"You are not near any body repair center.");
- if(IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"Please get out of this vehicle first.");
- gstr[0] = EOS;
- for(new v = 0, x = MAX_VEHICLES; v <= x; v++)
- {
- if((RepairData[v][rOwnerSQLID] == SQLID[playerid] && SQLID[playerid] != 0) || (RepairData[v][rFaction] == Faction[playerid] && Faction[playerid] != 0))
- {
- if(RepairData[v][rGarage] == bodyshop && RepairData[v][rTime] < gettime())
- {
- if(RepairData[v][rModel] > 399)
- {
- strcat(gstr, "{FFFFFF}");
- strcat(gstr, GetVehicleNameEx(RepairData[v][rModel]));
- strcat(gstr, " (Reg: {FFFFC0}");
- strcat(gstr, RepairData[v][rRegPlate]);
- strcat(gstr, "{FFFFFF})\n");
- }
- }
- }
- }
- if(strlen(gstr) > 10) Dialog_Show(playerid, VehicleCollection, DIALOG_STYLE_LIST, "Vehicles awaiting collection:", gstr, "Collect", "Cancel");
- else SysMsg(playerid, "You do not have any vehicles awaiting collection from this repair garage.");
- return true;
- }
- CMD:repair(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new bodyshop = -1;
- if(IsPlayerInDynamicArea(playerid, GarageAreas[0])) bodyshop = 1; //palomino creek
- if(IsPlayerInDynamicArea(playerid, GarageAreas[1])) bodyshop = 2; //dillimore
- if(IsPlayerInDynamicArea(playerid, GarageAreas[2])) bodyshop = 3; //fort carson
- if(IsPlayerInDynamicArea(playerid, GarageAreas[3])) bodyshop = 4; //el q
- if(IsPlayerInDynamicArea(playerid, GarageAreas[4])) bodyshop = 5; //airstrip
- if(IsPlayerInDynamicArea(playerid, GarageAreas[5])) bodyshop = 6; //bayside
- if(IsPlayerInDynamicArea(playerid, GarageAreas[6])) bodyshop = 7; //angel pine
- if(bodyshop == -1) return SysMsg(playerid,"You are not near any vehicle garage.");
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a vehicle first.");
- new VehicleId = GetPlayerVehicleID(playerid);
- if(VehicleData[VehicleId][Hotwired] == 1) return SysMsg(playerid, "You cannot repair a hotwired vehicle.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You must be the vehicle driver.");
- if(bodyshop == 5 && (!IsHelicopter(VehicleId) && !IsPlane(VehicleId))) return SysMsg(playerid,"You can only repair helicopters and planes here.");
- if(bodyshop == 6 && !IsBoat(VehicleId)) return SysMsg(playerid, "You can only repair boats here.");
- if(IsRentalCar(VehicleId)) return SysMsg(playerid, "Rental vehicles cannot be repaired.");
- if(IsServerCar(VehicleId)) return SysMsg(playerid, "Server vehicles cannot be repaired.");
- if(aspawned{VehicleId}) return SysMsg(playerid, "Admin spawned vehicles cannot be repaired.");
- if(IsOwnedCar(VehicleId)) if(VehicleData[VehicleId][VehicleOwnerSQLID] != SQLID[playerid]) return SysMsg(playerid, "You cannot repair this vehicle.");
- new payment[10], option, confirm[10];
- if(sscanf(params, "is[10]S()[10]", option, payment, confirm)) return SysMsg(playerid,"Usage: /repair [Option: 1-Engine 2-Bodywork(Incl. Tires) 3-Tires Only 4-All 5-Headlights] [Payment Method: bank or cash]");
- if(!strmatch(payment, "bank") && !strmatch(payment, "cash")) return SysMsg(playerid, "Payment method must be bank or cash.");
- if(option < 1 || option > 5) return cmd_repair(playerid, "");
- new Float:health;
- GetVehicleHealth(VehicleId, health);
- if(health < 250) return SysMsg(playerid,"Your vehicle's engine is on fire! We can't touch that!");
- if((option == 1 || option == 4) && health >= 950) return SysMsg(playerid,"Your vehicle's engine seems to be in good working order.");
- new panels, doors, lights, tires, temp = 3, th = gServerHour, tm = gServerMinute;
- new price = CalculateRepairPrice(VehicleId, option);
- if(price == 0)
- {
- if(option == 1) return SysMsg(playerid, "Your vehicles engine seems to be in working order!");
- if(option == 2 || option == 4) return SysMsg(playerid, "Your vehicles bodywork seems to have no problems!");
- if(option == 3) return SysMsg(playerid,"Your vehicles tires seems to have no problems!");
- }
- price = price * GetVehicleRepairMultiplier(GetVehicleModel(VehicleId));
- if(IsFactionVehicle(VehicleId) == FACTION_COP || IsFactionVehicle(VehicleId) == FACTION_SACFD || IsFactionVehicle(VehicleId) == FACTION_RESEARCH) price = 0;
- if(strcmp("confirm", confirm, true) == 0 && strlen(confirm) > 1)
- {
- if(strmatch(payment, "bank"))
- {
- if(BankBalance[playerid] < price) return SysMsg(playerid, "You do not have enough money in your bank account for this repair.");
- BankBalance[playerid] -= price;
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- }
- else
- {
- if(Cash[playerid] < price) return SysMsg(playerid,"You do not have enough cash for this repair.");
- GivePlayerCash(playerid, -price);
- }
- if(option == 5)
- {
- GetVehicleDamageStatus(VehicleId, panels, doors, lights, tires);
- lights = encode_lights(0, 0, 0, 0);
- UpdateVehicleDamageStatus(VehicleId, panels, doors, lights, tires);
- SendClientMessageF(playerid,COLOR_LIGHTBLUE, "The headlights of your %s have been repaired, costing you $%i.", GetVehicleNameEx(GetVehicleModel(VehicleId)), price);
- }
- else
- {
- for(new vl = 1, x = GetVehiclePoolSize(); vl <= x; vl++)
- {
- if(RepairData[vl][rModel] < 400)
- {
- new reptime = gettime() + 60;
- RepairData[vl][rModel] = GetVehicleModel(VehicleId);
- RepairData[vl][rGarage] = bodyshop;
- RepairData[vl][rTime] = reptime;
- if(VehicleData[VehicleId][VehicleOwnerSQLID] > 0) //Checks if the vehicle is a player vehicle.
- {
- RepairData[vl][rSQLID] = VehicleData[VehicleId][VehSQLID];
- RepairData[vl][rOwnerSQLID] = VehicleData[VehicleId][VehicleOwnerSQLID];
- RepairData[vl][rFaction] = 0;
- GetVehicleDamageStatus(VehicleId, panels, doors, lights, tires);
- switch(option)
- {
- case 1: mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET GarageRepairID = %i, GarageCollectTime = %i, DamageHealth = 1000, DamagePanels = %i, DamageDoors = %i, DamageLights = %i, DamageTires = %i, Fuel = %f, Mileage = %f WHERE id = %i", bodyshop, gettime() + 60, panels, doors, lights, tires, Fuel[VehicleId], VehicleData[VehicleId][Mileage], VehicleData[VehicleId][VehSQLID]);
- case 2: mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET GarageRepairID = %i, GarageCollectTime = %i, DamageHealth = %f, DamagePanels = 0, DamageDoors = 0, DamageLights = 0, DamageTires = 0, Fuel = %f, Mileage = %f WHERE id = %i", bodyshop, gettime() + 60, health, Fuel[VehicleId], VehicleData[VehicleId][Mileage], VehicleData[VehicleId][VehSQLID]);
- case 3: mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET GarageRepairID = %i, GarageCollectTime = %i, DamageHealth = %f, DamagePanels = %i, DamageDoors = %i, DamageLights = %i, DamageTires = 0, Fuel = %f, Mileage = %f WHERE id = %i", bodyshop, gettime() + 60, health, panels, doors, lights, Fuel[VehicleId], VehicleData[VehicleId][Mileage], VehicleData[VehicleId][VehSQLID]);
- case 4: mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET GarageRepairID = %i, GarageCollectTime = %i, DamageHealth = 1000.0, DamagePanels = 0, DamageDoors = 0, DamageLights = 0, DamageTires = 0, Fuel = %f, Mileage = %f WHERE id = %i", bodyshop, gettime() + 60, Fuel[VehicleId], VehicleData[VehicleId][Mileage], VehicleData[VehicleId][VehSQLID]);
- }
- mysql_pquery(conn, mquery);
- format(RepairData[vl][rRegPlate], MAX_REG_PLATE, VehicleData[VehicleId][RegPlate]);
- if(VehicleData[VehicleId][ForSale])
- {
- VehicleData[VehicleId][ForSale] = false;
- VehicleData[VehicleId][ForSalePrice] = 0;
- DestroyDynamic3DTextLabel(VehicleData[VehicleId][ForSaleLabel]);
- }
- VehicleBroke[VehicleId] = 0;
- FuelTypeAfterRefuel[VehicleId] = 0;
- if(vTaxiSign[VehicleId] != INVALID_OBJECT_ID) DestroyDynamicObjectEx(vTaxiSign[VehicleId], "vTaxiSign[VehicleId] 1");
- vTaxiSign[VehicleId] = INVALID_OBJECT_ID;
- }
- else if(FVehicleData[VehicleId][FVFaction] > 0) //Checks if the vehicle is a faction vehicle.
- {
- RepairData[vl][rSQLID] = FVehicleData[VehicleId][FVSQLID];
- RepairData[vl][rFaction] = FVehicleData[VehicleId][FVFaction];
- RepairData[vl][rOwnerSQLID] = 0;
- mysql_pqueryf(conn, "UPDATE fveh SET GarageRepairID = %i, GarageCollectTime = %i WHERE id = %i", bodyshop, reptime, FVehicleData[VehicleId][FVSQLID]);
- format(RepairData[vl][rRegPlate], MAX_REG_PLATE, FVehicleData[VehicleId][FVRegPlate]);
- }
- temp = 1;
- while(temp > 0)
- {
- temp --;
- tm ++;
- if(tm == 60)
- {
- tm = 0;
- th ++;
- if(th > 23)
- {
- th = 0;
- }
- }
- }
- DestroyVehicleEx(VehicleId, "vehicleid 0");
- ClearVehicleData(VehicleId);
- switch(option)
- {
- case 1: SendClientMessageF(playerid,COLOR_LIGHTBLUE, "Your %s has been booked for a new engine costing $%i, come back in around 1 hour ((1 minute, %02d:%02d)) to collect it.", GetVehicleNameEx(RepairData[vl][rModel]), price, th, tm);
- case 2: SendClientMessageF(playerid,COLOR_LIGHTBLUE, "Your %s has been booked for bodywork repairs costing $%i, come back in around 1 hour ((1 minute, %02d:%02d)) to collect it.", GetVehicleNameEx(RepairData[vl][rModel]), price, th, tm);
- case 3: SendClientMessageF(playerid,COLOR_LIGHTBLUE, "Your %s has been booked for new tires costing $%i, come back in around 1 hour ((1 minutes, %02d:%02d)) to collect it.", GetVehicleNameEx(RepairData[vl][rModel]), price, th, tm);
- case 4: SendClientMessageF(playerid,COLOR_LIGHTBLUE, "Your %s has been booked for a full repair costing $%i, come back in around 1 hour ((1 minute, %02d:%02d)) to collect it.", GetVehicleNameEx(RepairData[vl][rModel]), price, th, tm);
- }
- break;
- }
- }
- }
- }
- else
- {
- switch(option)
- {
- case 1: SendClientMessageF(playerid, COLOR_WHITE, "It will cost {4BB74C}$%i{FFFFFF} for your engine to be repaired, use '/repair 1 %s confirm' to accept.", price, payment);
- case 2: SendClientMessageF(playerid, COLOR_WHITE, "It will cost {4BB74C}$%i{FFFFFF} for your bodywork to be repaired, use '/repair 2 %s confirm' to accept.", price, payment);
- case 3: SendClientMessageF(playerid, COLOR_WHITE, "It will cost {4BB74C}$%i{FFFFFF} for your tires to be replaced, use '/repair 3 %s confirm' to accept.", price, payment);
- case 4: SendClientMessageF(playerid, COLOR_WHITE, "It will cost {4BB74C}$%i{FFFFFF} for your bodywork and engine to be repaired, use '/repair 4 %s confirm' to accept.", price, payment);
- case 5:
- {
- SendClientMessage(playerid, COLOR_RED, "NOTE: Even if your vehicle's headlights are not damaged, you will still be charged for the repairs if you confirm.");
- SendClientMessageF(playerid, COLOR_WHITE, "It will cost {4BB74C}$%i{FFFFFF} for your lights to be repaired, use '/repair 5 %s confirm' to accept.", price, payment);
- }
- }
- }
- return true;
- }
- CMD:vmenu(playerid)
- {
- if(!Logged{playerid}) return true;
- for(new i; i != MAX_VEH_PER_PLAYER; i++) {
- if(!PlayerCars[playerid][i][CarModel]) {
- if(i == MAX_VEH_PER_PLAYER - 1) return SendClientMessage(playerid, -1, "You already have a vehicle spawned.");
- continue;
- }
- break;
- }
- if(HasVehicleSpawned(playerid)) return SysMsg(playerid, "You already have a vehicle spawned.");
- CreateVMenuTextdraws(playerid);
- for(new v = 0; v < 5; v++)
- {
- if(PlayerCars[playerid][v][CarModel] != 0)
- {
- PlayerTextDrawSetPreviewModel(playerid, VSelectOptions[playerid][v], PlayerCars[playerid][v][CarModel]);
- PlayerTextDrawSetPreviewVehCol(playerid, VSelectOptions[playerid][v], PlayerCars[playerid][v][CarCol1], PlayerCars[playerid][v][CarCol2]);
- }
- PlayerTextDrawShow(playerid, VSelectOptions[playerid][v]);
- VSelectID[playerid][v] = v;
- }
- VSelectOffset[playerid] = 3;
- TextDrawShowForPlayer(playerid, backgoundvcar12);
- SelectTextDraw(playerid, COLOR_GREY);
- return true;
- }
- CMD:vdespawn(playerid)
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You need to be in a vehicle to use this command.");
- new bool:candespawn = false, vid = -1, v = GetPlayerVehicleID(playerid);
- for(new x = 0; x < MAX_VEH_PER_PLAYER; x++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 10.0, PlayerCars[playerid][x][CarPosX], PlayerCars[playerid][x][CarPosY], PlayerCars[playerid][x][CarPosZ])
- || IsPlayerInRangeOfPoint(playerid, 10.0, VehicleData[v][LastX], VehicleData[v][LastY], VehicleData[v][LastZ]))
- {
- candespawn = true;
- }
- if(PlayerCars[playerid][x][CarSQLID] == VehicleData[v][VehSQLID])
- {
- vid = x;
- }
- }
- if(!candespawn) return SysMsg(playerid, "You need to be in the parking lot of this vehicle.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET Spawned = 0 WHERE id = %i", VehicleData[v][VehSQLID]);
- mysql_pquery(conn, mquery);
- ClearVehicleData(v);
- DestroyVehicle(v);
- PlayerCars[playerid][vid][CarSpawned] = false;
- return true;
- }
- stock HasVehicleSpawned(playerid)
- {
- for(new v = 0; v < MAX_VEH_PER_PLAYER; v++)
- {
- if(PlayerCars[playerid][v][CarSpawned]) return true;
- }
- return false;
- }
- stock CreateVMenuTextdraws(playerid)
- {
- VSelectOptions[playerid][0] = CreatePlayerTextDraw(playerid, 157.000000, 175.875000, "");
- PlayerTextDrawLetterSize(playerid, VSelectOptions[playerid][0], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, VSelectOptions[playerid][0], 67.000000, 67.812500);
- PlayerTextDrawAlignment(playerid, VSelectOptions[playerid][0], 2);
- PlayerTextDrawColor(playerid, VSelectOptions[playerid][0], -1);
- PlayerTextDrawSetShadow(playerid, VSelectOptions[playerid][0], 0);
- PlayerTextDrawSetOutline(playerid, VSelectOptions[playerid][0], 0);
- PlayerTextDrawBackgroundColor(playerid, VSelectOptions[playerid][0], 0x00000000);
- PlayerTextDrawFont(playerid, VSelectOptions[playerid][0], 5);
- PlayerTextDrawSetProportional(playerid, VSelectOptions[playerid][0], 1);
- PlayerTextDrawSetShadow(playerid, VSelectOptions[playerid][0], 0);
- PlayerTextDrawSetSelectable(playerid, VSelectOptions[playerid][0], true);
- PlayerTextDrawSetPreviewModel(playerid, VSelectOptions[playerid][0], 18631);
- PlayerTextDrawSetPreviewRot(playerid, VSelectOptions[playerid][0], 0.000000, 0.000000, -25.000000, 1.000000);
- PlayerTextDrawSetPreviewVehCol(playerid, VSelectOptions[playerid][0], 1, 1);
- VSelectOptions[playerid][1] = CreatePlayerTextDraw(playerid, 244.500000, 176.875000, "");
- PlayerTextDrawLetterSize(playerid, VSelectOptions[playerid][1], 0.000000, -0.550000);
- PlayerTextDrawTextSize(playerid, VSelectOptions[playerid][1], 67.000000, 67.812500);
- PlayerTextDrawAlignment(playerid, VSelectOptions[playerid][1], 1);
- PlayerTextDrawColor(playerid, VSelectOptions[playerid][1], -1);
- PlayerTextDrawSetShadow(playerid, VSelectOptions[playerid][1], 0);
- PlayerTextDrawSetOutline(playerid, VSelectOptions[playerid][1], 0);
- PlayerTextDrawBackgroundColor(playerid, VSelectOptions[playerid][1], 0x00000000);
- PlayerTextDrawFont(playerid, VSelectOptions[playerid][1], 5);
- PlayerTextDrawSetProportional(playerid, VSelectOptions[playerid][1], 0);
- PlayerTextDrawSetShadow(playerid, VSelectOptions[playerid][1], 0);
- PlayerTextDrawSetSelectable(playerid, VSelectOptions[playerid][1], true);
- PlayerTextDrawSetPreviewModel(playerid, VSelectOptions[playerid][1], 18631);
- PlayerTextDrawSetPreviewRot(playerid, VSelectOptions[playerid][1], 0.000000, 0.000000, -25.000000, 1.000000);
- PlayerTextDrawSetPreviewVehCol(playerid, VSelectOptions[playerid][1], 1, 1);
- VSelectOptions[playerid][2] = CreatePlayerTextDraw(playerid, 329.000000, 177.875000, "");
- PlayerTextDrawLetterSize(playerid, VSelectOptions[playerid][2], 0.000000, -0.750000);
- PlayerTextDrawTextSize(playerid, VSelectOptions[playerid][2], 67.000000, 67.812500);
- PlayerTextDrawAlignment(playerid, VSelectOptions[playerid][2], 1);
- PlayerTextDrawColor(playerid, VSelectOptions[playerid][2], -1);
- PlayerTextDrawSetShadow(playerid, VSelectOptions[playerid][2], 0);
- PlayerTextDrawSetOutline(playerid, VSelectOptions[playerid][2], 0);
- PlayerTextDrawBackgroundColor(playerid, VSelectOptions[playerid][2], 0x00000000);
- PlayerTextDrawFont(playerid, VSelectOptions[playerid][2], 5);
- PlayerTextDrawSetProportional(playerid, VSelectOptions[playerid][2], 0);
- PlayerTextDrawSetShadow(playerid, VSelectOptions[playerid][2], 0);
- PlayerTextDrawSetSelectable(playerid, VSelectOptions[playerid][2], true);
- PlayerTextDrawSetPreviewModel(playerid, VSelectOptions[playerid][2], 18631);
- PlayerTextDrawSetPreviewRot(playerid, VSelectOptions[playerid][2], 0.000000, 0.000000, -25.000000, 1.000000);
- PlayerTextDrawSetPreviewVehCol(playerid, VSelectOptions[playerid][2], 1, 1);
-
- VSelectOptions[playerid][3] = CreatePlayerTextDraw(playerid, 417.000000, 178.875000, "");
- PlayerTextDrawLetterSize(playerid, VSelectOptions[playerid][3], 0.000000, -2.049999);
- PlayerTextDrawTextSize(playerid, VSelectOptions[playerid][3], 67.000000, 67.812500);
- PlayerTextDrawAlignment(playerid, VSelectOptions[playerid][3], 1);
- PlayerTextDrawColor(playerid, VSelectOptions[playerid][3], -1);
- PlayerTextDrawSetShadow(playerid, VSelectOptions[playerid][3], 0);
- PlayerTextDrawSetOutline(playerid, VSelectOptions[playerid][3], 0);
- PlayerTextDrawBackgroundColor(playerid, VSelectOptions[playerid][3], 0x00000000);
- PlayerTextDrawFont(playerid, VSelectOptions[playerid][3], 5);
- PlayerTextDrawSetProportional(playerid, VSelectOptions[playerid][3], 0);
- PlayerTextDrawSetShadow(playerid, VSelectOptions[playerid][3], 0);
- PlayerTextDrawSetSelectable(playerid, VSelectOptions[playerid][3], true);
- PlayerTextDrawSetPreviewModel(playerid, VSelectOptions[playerid][3], 18631);
- PlayerTextDrawSetPreviewRot(playerid, VSelectOptions[playerid][3], 0.000000, 0.000000, -25.000000, 1.000000);
- PlayerTextDrawSetPreviewVehCol(playerid, VSelectOptions[playerid][3], 1, 1);
-
- /*VSelectOptions[playerid][4] = CreatePlayerTextDraw(playerid, 322.000000, 195.000000, "");
- PlayerTextDrawLetterSize(playerid, VSelectOptions[playerid][4], 1.220000, 2.599999);
- PlayerTextDrawTextSize(playerid, VSelectOptions[playerid][4], 89.000000, 87.000000);
- PlayerTextDrawAlignment(playerid, VSelectOptions[playerid][4], 1);
- PlayerTextDrawColor(playerid, VSelectOptions[playerid][4], -1);
- PlayerTextDrawSetShadow(playerid, VSelectOptions[playerid][4], 0);
- PlayerTextDrawSetOutline(playerid, VSelectOptions[playerid][4], 0);
- PlayerTextDrawBackgroundColor(playerid, VSelectOptions[playerid][4], 255);
- PlayerTextDrawFont(playerid, VSelectOptions[playerid][4], 5);
- PlayerTextDrawSetProportional(playerid, VSelectOptions[playerid][4], 0);
- PlayerTextDrawSetShadow(playerid, VSelectOptions[playerid][4], 0);
- PlayerTextDrawSetSelectable(playerid, VSelectOptions[playerid][4], true);
- PlayerTextDrawSetPreviewModel(playerid, VSelectOptions[playerid][4], 18631);
- PlayerTextDrawSetPreviewRot(playerid, VSelectOptions[playerid][4], -16.000000, 0.000000, -55.000000, 1.000000);
- PlayerTextDrawSetPreviewVehCol(playerid, VSelectOptions[playerid][4], 1, 1);*/
- return true;
- }
- stock HideVMenuTextdraws(playerid)
- {
- TextDrawHideForPlayer(playerid, backgoundvcar12);
- PlayerTextDrawDestroy(playerid, VSelectOptions[playerid][0]);
- PlayerTextDrawDestroy(playerid, VSelectOptions[playerid][1]);
- PlayerTextDrawDestroy(playerid, VSelectOptions[playerid][2]);
- PlayerTextDrawDestroy(playerid, VSelectOptions[playerid][3]);
- PlayerTextDrawDestroy(playerid, VSelectOptions[playerid][4]);
- VSelectOptions[playerid][0] = PlayerText:INVALID_TEXT_DRAW;
- VSelectOptions[playerid][1] = PlayerText:INVALID_TEXT_DRAW;
- VSelectOptions[playerid][2] = PlayerText:INVALID_TEXT_DRAW;
- VSelectOptions[playerid][3] = PlayerText:INVALID_TEXT_DRAW;
- VSelectOptions[playerid][4] = PlayerText:INVALID_TEXT_DRAW;
- return true;
- }
- CMD:mycars(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new lockedTxt[9], Vcount = 0, sub[100];
- gstr[0] = EOS;
- for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(Vcount < MAX_VEH_PER_PLAYER)
- {
- if(VehicleData[v][VehicleOwnerSQLID] == SQLID[playerid])
- {
- if(VehicleData[v][IdVehicle] > 0)
- {
- if(Locked{v}) lockedTxt = "Locked";
- else lockedTxt = "Unlocked";
- if(VehicleData[v][Hotwired] == 1) lockedTxt = "Stolen";
- Vcount ++;
- format(sub, sizeof(sub), "%s - %s (ID: %i Slot: %i Reg: %s)\n", GetVehicleNameEx(VehicleData[v][VehicleModel]), lockedTxt, VehicleData[v][IdVehicle], v, VehicleData[v][RegPlate]);
- strcat(gstr, sub);
- }
- }
- else if(ImpoundData[v][iOwnerSQLID] == SQLID[playerid])
- {
- if(ImpoundData[v][iImpoundTime] < 1) ImpoundData[v][iImpoundTime] = 0;
- if(ImpoundData[v][iImpoundTime] == 0) format(sub, sizeof(sub), "%s - Currently Impounded (Awaiting Collection)\n", GetVehicleNameEx(ImpoundData[v][iModel]));
- else format(sub, sizeof(sub), "%s - Currently Impounded (%i minutes left)\n", GetVehicleNameEx(ImpoundData[v][iModel]), ImpoundData[v][iImpoundTime]);
- Vcount++;
- strcat(gstr, sub);
- }
- if(RepairData[v][rOwnerSQLID] == SQLID[playerid])
- {
- if(RepairData[v][rTime] < gettime()) format(sub, sizeof(sub), "%s - Being worked on at the %s (Awaiting Collection)\n", GetVehicleNameEx(RepairData[v][rModel]), GetRepairGarageName(RepairData[v][rGarage]));
- else format(sub, sizeof(sub), "%s - Being worked on at the %s\n", GetVehicleNameEx(RepairData[v][rModel]), GetRepairGarageName(RepairData[v][rGarage]));
- Vcount++;
- strcat(gstr, sub);
- }
- }
- }
- mysql_format(conn, mquery, sizeof(mquery), "SELECT VehicleModel FROM vehicles WHERE NeedsRecovery = 1 AND OwnerSQLID = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery, "MyCarsRecovery", "isi", playerid, gstr, Vcount);
- return true;
- }
- CMD:customreg(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInRangeOfPoint(playerid, 3.5, -2032.927978, -117.508804, 1035.171875)) return SysMsg(playerid, "You must be at the DMV in order to buy a custom registration.");
- new vslot = 1, regplate[MAX_REG_PLATE], confirmation[8];
- if(sscanf(params, "is[8]S()[8]", vslot, regplate, confirmation)) return SysMsg(playerid, "Usage: /customreg [Vehicle ID from /mycars] [new registration]");
- if(vslot < 0 || vslot > MAX_VEHICLES) return SysMsg(playerid, "Invalid vehicle ID.");
- if(VehicleData[vslot][VehicleOwnerSQLID] != SQLID[playerid]) return SysMsg(playerid, "You must own the vehicle.");
- new reglen = strlen(regplate);
- if(reglen > MAX_REG_PLATE-1) return SysMsg(playerid,"New registration was too long. (7 max)");
- if(reglen < 4) return SysMsg(playerid,"New registration was too short. (4 min)");
- for(new letter = 0; letter < reglen; letter++)
- {
- regplate[letter] = toupper(regplate[letter]);
- if(!IsValidRegChar(regplate[letter])) return SysMsg(playerid, "Invalid character found.");
- }
- if(IsRegPlateUsed(regplate)) return SysMsg(playerid,"Registration is already taken by someone.");
- new ve = vslot, regcost = -1;
- switch(reglen)
- {
- case 4: regcost = 2500000;
- case 5: regcost = 1250000;
- case 6: regcost = 300000;
- case 7: regcost = 40000;
- }
- if(regcost == -1) return SysMsg(playerid,"Oops! A System Error has occurred, please report to an Admin. (ERROR: 2-001)");
- if(isnull(confirmation)) return SendClientMessageF(playerid, COLOR_WHITE, "Changing the plate from '%s' to '%s' on your %s will cost $%s. Use '/customreg %i %s confirm' to buy now.", VehicleData[ve][RegPlate], regplate, GetVehicleNameEx(VehicleData[ve][VehicleModel]), format_cash(regcost), vslot, regplate);
- else
- {
- if(strcmp(confirmation, "confirm", true) == 0)
- {
- if(Cash[playerid] < regcost) return SysMsg(playerid,"You don't have enough money to buy this plate.");
- GivePlayerCash(playerid, -regcost);
- MySQLUpdateString(VehicleData[ve][VehSQLID], "RegPlate", regplate, "vehicles");
- format(VehicleData[ve][RegPlate], MAX_REG_PLATE, regplate);
- SetVehicleNumberPlate(VehicleData[ve][IdVehicle], regplate);
- SendClientMessageF(playerid, COLOR_GOLD, "Your %s's registration plate is now: '%s'. This cost $%s.", GetVehicleNameEx(VehicleData[ve][VehicleModel]), VehicleData[ve][RegPlate], format_cash(regcost));
- format(gstr, sizeof(gstr),"[%s] %s(%i) spends $%i on a custom plate. (Total: $%i)", GetTimeStringAndSec(), NameEx(playerid), playerid, regcost, Cash[playerid]);
- }
- }
- return true;
- }
- CMD:recovervehicle(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM vehicles WHERE OwnerSQLID = %i AND NeedsRecovery = 1 LIMIT %i", SQLID[playerid], MAX_VEH_PER_PLAYER);
- mysql_pquery(conn, mquery, "DisplayRecoverVehicle", "i", playerid);
- return true;
- }
- CMD:carmusic(playerid, params[])
- {
- new v = GetPlayerVehicleID(playerid);
- new VehicleMusic[200];
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid,"You must be in a vehicle to use this command.");
- if(GetPlayerVehicleSeat(playerid) >= 2) return SysMsg(playerid, "Only the driver/passenger can use this command.");
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 408) return SysMsg(playerid,"You may not use this command in sidejob vehicles.");
- if(IsPushBike(v)) return SysMsg(playerid,"You may not use this command on pushbikes.");
- if(sscanf(params, "s[200]", VehicleMusic)) return SysMsg(playerid, "Usage: /carmusic [link/stop]");
- if(strcmp(VehicleMusic, "stop", true) == 0 || strcmp(VehicleMusic, "no", true) == 0 || strcmp(VehicleMusic, "off", true) == 0)
- {
- if(GetPlayerVehicleSeat(playerid) == 0 || GetPlayerVehicleSeat(playerid) == 1)
- {
- foreach(new i: Player)
- {
- if(Logged{i} && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
- {
- StopAudioStreamForPlayer(i);
- }
- }
- vMusicPlaying{v} = false;
- strdel(vMusicLink[v], 0, 256);
- SetPlayerChatBubble(playerid, "* Reaches down to the radio and turns it off. *", COLOR_EMOTE, 15.0, 6000);
- }
- }
- else if(GetPlayerVehicleSeat(playerid) == 0 || GetPlayerVehicleSeat(playerid) == 1)
- {
- foreach(new i: Player)
- {
- if(Logged{i} && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
- {
- StopAudioStreamForPlayer(i);
- PlayAudioStreamForPlayerEx(i, VehicleMusic);
- ListeningBoom[i] = -1;
- }
- }
- vMusicPlaying{v} = true;
- strpack(vMusicLink[v], VehicleMusic);
- SetPlayerChatBubble(playerid,"* Reaches down to the radio and turns it on, tuning it to a station. *", COLOR_EMOTE, 15.0, 6000);
- }
- return true;
- }
- CMD:togplate(playerid)
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Toolbox] == 0) return SysMsg(playerid,"You need a toolbox in order to replace your license plate.");
- if(IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You need to be outside of a vehicle to use this feature.");
- new v = GetNearestVehicle(playerid);
- if(IsPushBike(v) || IsHelicopter(v) || IsPlane(v)) return SysMsgF(playerid, "This %s does not have a license plate.", GetVehicleName(v));
- if(!TrunkXY(playerid, v)) return SysMsg(playerid, "You are not near the back of a vehicle.");
- if(VehicleData[v][VehicleOwnerSQLID] != SQLID[playerid]) return SysMsgF(playerid, "You do not own this %s.", GetVehicleName(v));
- new world = GetVehicleVirtualWorld(v);
- SetVehicleVirtualWorld(v, v);
- if(VehicleData[v][PlateToggle])
- {
- VehicleData[v][PlateToggle] = false;
- SetVehicleNumberPlate(v, VehicleData[v][RegPlate]);
- cmd_me(playerid, "takes a license plate from their vehicle and kneels down, screwing it back into place.");
- OnePlayAnim(playerid, "BOMBER", "BOM_Plant_Loop", 3.0, 0, 0, 0, 0, 0);
- SetTimerEx("PutVehicleBack", 500, 0, "ii", v, world);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET PlateToggle = 0 WHERE id = %i", VehicleData[v][VehSQLID]);
- mysql_pquery(conn, mquery);
- return true;
- }
- else
- {
- VehicleData[v][PlateToggle] = true;
- SetVehicleNumberPlate(v, " ");
- cmd_me(playerid, "kneels down and unscrews their license plate from their vehicle, stowing it in the trunk.");
- OnePlayAnim(playerid, "BOMBER", "BOM_Plant_Loop", 3.0, 0, 0, 0, 0, 0);
- SetTimerEx("PutVehicleBack", 500, 0, "ii", v, world);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET PlateToggle = 1 WHERE id = %i", VehicleData[v][VehSQLID]);
- mysql_pquery(conn, mquery);
- return true;
- }
- }
- GREENSIDE::PutVehicleBack(vehicleid, world)
- {
- SetVehicleVirtualWorld(vehicleid, world);
- return true;
- }
- CMD:checkplate(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new v = GetClosestVehicle(playerid);
- if(VehicleData[v][PlateToggle]) SysMsgF(playerid, "This %s does not have a plate showing.", GetVehicleName(v));
- else if(!VehicleData[v][PlateToggle]) SysMsgF(playerid, "This %s has a plate showing.", GetVehicleName(v));
- else SysMsg(playerid, "This is not a personal vehicle.");
- return true;
- }
- CMD:trunk(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new tempv = GetClosestVehicle(playerid);
- if(!VehicleHasTrunk(tempv)) return SysMsg(playerid,"This vehicle doesn't have a trunk to use.");
- if(tempv == INVALID_VEHICLE_ID) return SysMsg(playerid, "You need to be near a vehicle to use this command.");
- if(aspawned{tempv}) return SysMsg(playerid, "This vehicle is an admin spawned vehicle.");
- if(IsRentalCar(tempv)) return SysMsg(playerid, "You cannot open rental car trunks.");
- if(IsServerCar(tempv)) return SysMsg(playerid, "You cannot open this vehicle's trunk. (Server Vehicle)");
- new Item[15], Amount[40], Method[15], trunkstring[128];
- if(sscanf(params, "s[15]S(None)[15]S(None)[40]", Method, Item, Amount)) return SysMsg(playerid,"Usage: /trunk [open/close/get/store/show] [item] [amount], Items: cash, armour, weed, cocaine, moonshine, weapon");
- if(TrunkXY(playerid, tempv) || GetPlayerVehicleID(playerid) == tempv)
- {
- if(strmatch("open", Method))
- {
- if(VehicleBoots[tempv][1] == 1) return SysMsg(playerid,"Trunk is already open.");
- if(IsOwnedCar(tempv))
- {
- if(Locked{tempv})
- {
- format(trunkstring, sizeof(trunkstring), "* %s attempts to open the %s's trunk. *", NameRP(playerid), GetVehicleNameEx(VehicleData[tempv][VehicleModel]));
- ProxDetector(20.0,playerid,trunkstring, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SysMsg(playerid,"This vehicle is currently locked, if you want to use its trunk you must unlock it.");
- return true;
- }
- }
- else if(IsFactionVehicle(tempv))
- {
- if(Locked{tempv})
- {
- format(trunkstring, sizeof(trunkstring), "* %s attempts to open the %s's trunk. *", NameRP(playerid), GetVehicleNameEx(FVehicleData[tempv][FVModel]));
- ProxDetector(20.0,playerid,trunkstring, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SysMsg(playerid, "This vehicle is currently locked, if you want to use its trunk you must unlock it.");
- return true;
- }
- }
- if(!IsPlayerInAnyVehicle(playerid)) ToggleVehicleTrunk(tempv, 1);
- VehicleBoots[tempv][1] = 1;
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- format(trunkstring, sizeof(trunkstring),"* %s pushes a button in, popping open the trunk. *", NameRP(playerid));
- ProxDetector(20.0,playerid,trunkstring, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(VehicleBoots[tempv][1] == 1)
- {
- if(strmatch("close", Method))
- {
- if(VehicleBoots[tempv][1] == 0) return SysMsg(playerid,"Trunk is already closed.");
- ToggleVehicleTrunk(tempv, 0);
- VehicleBoots[tempv][1] = 0;
- format(trunkstring, sizeof(trunkstring),"* %s grips the trunk, closing it. *",NameRP(playerid));
- ProxDetector(20.0,playerid,trunkstring, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- if(strcmp("store",Method) == 0)
- {
- if(strmatch(Item, "None")) return SysMsg(playerid,"Usage: /trunk store [item] [amount(name for weapon)], Items: cash, armour, weed, cocaine, moonshine, weapon");
- if(strcmp("cash",Item) == 0)
- {
- if(strmatch(Amount, "None")) return SysMsg(playerid,"Usage: /trunk Store Cash [amount $]");
- if(!IsNumeric(Amount)) return SysMsg(playerid,"Amount must be a valid number.");
- if(strval(Amount) < 1 || strval(Amount) > 100000) return SysMsg(playerid,"You may only store a maximum of $100,000.");
- if(strval(Amount) > Cash[playerid]) return SysMsg(playerid,"You don't have that amount to store.");
- GivePlayerCash(playerid, -strval(Amount));
- if(IsOwnedCar(tempv))
- {
- VehicleData[tempv][TrunkCash] += strval(Amount);
- MySQLUpdateInt(VehicleData[tempv][VehSQLID], "TrunkCash", VehicleData[tempv][TrunkCash], "vehicles");
- format(trunkstring, sizeof(trunkstring),"* %s stores something in the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- }
- else if(IsFactionVehicle(tempv))
- {
- FVehicleData[tempv][FTrunkCash] += strval(Amount);
- MySQLUpdateInt(FVehicleData[tempv][FVSQLID], "TrunkCash", FVehicleData[tempv][FTrunkCash], "fveh");
- format(trunkstring, sizeof(trunkstring),"* %s stores something in the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- }
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- format(trunkstring, sizeof(trunkstring),"You have stored $%s in the trunk of this car.",format_cash(strval(Amount)));
- SendClientMessage(playerid,COLOR_DARKBLUE,trunkstring);
- ApplyTrunkAnimation(playerid);
- format(trunkstring, sizeof(trunkstring),"[%s] %s(%i) stores $%i in a vehicles trunk.", GetServerTimeString(), NameEx(playerid), playerid, strval(Amount));
- return true;
- }
- else if(strcmp("armor",Item,true) == 0 || strcmp("armour",Item,true) == 0)
- {
- new Float:Armour;
- GetPlayerArmour(playerid,Armour);
- if(Armour == 0) return SysMsg(playerid, "You do not have an armor vest on.");
- //if(VestType[playerid] == 0) return SysMsg(playerid, "You do not have an armor vest on.");
- if(IsOwnedCar(tempv))
- {
- if(RestrictedVest{playerid}) return SysMsg(playerid, "You cannot store this vest in this vehicle.");
- if(!MySQLCheckVehicleArmor(VehicleData[tempv][VehSQLID])) return SysMsg(playerid, "You cannot store any more vests in this vehicle as it already has 5 vests.");
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO storedarmor (ArmorType, ArmorAmount, TrunkID) VALUES (%i, %f, %i)", VestType[playerid], Armour, VehicleData[tempv][VehSQLID]);
- mysql_pquery(conn, mquery);
- format(trunkstring, sizeof(trunkstring),"* %s stores something in the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- }
- else if(IsFactionVehicle(tempv))
- {
- if(RestrictedVest{playerid} && IsFactionVehicle(FVehicleData[tempv][FactionVehID]) != Faction[playerid]) return SysMsg(playerid, "You cannot store this vest in this vehicle.");
- if(!MySQLCheckFVehArmor(FVehicleData[tempv][FVSQLID])) return SysMsg(playerid, "You cannot store any more vests in this vehicle as it already has 5 vests.");
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO storedarmor (ArmorType, ArmorAmount, FCarID) VALUES (%i, %f, %i)", VestType[playerid], Armour, FVehicleData[tempv][FVSQLID]);
- mysql_pquery(conn, mquery);
- format(trunkstring, sizeof(trunkstring),"* %s stores something in the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- }
- ApplyTrunkAnimation(playerid);
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- if(VestType[playerid] == 1) SendClientMessage(playerid,COLOR_DARKBLUE,"You have stored a light vest in the trunk of this car.");
- else SendClientMessage(playerid, COLOR_DARKBLUE, "You have stored a heavy vest in the trunk of this car.");
- SetPlayerArmourEx(playerid, 0.0, 1);
- VestType[playerid] = 0;
- return true;
- }
- else if(strcmp("weed",Item,true) == 0)
- {
- if(strmatch(Amount, "None")) return SysMsg(playerid,"Usage: /trunk Store Weed [amount]");
- if(!IsNumeric(Amount)) return SysMsg(playerid,"Amount must be a valid number.");
- if(strval(Amount) < 1) return SysMsg(playerid,"You must store at least 1.");
- if(strval(Amount) > Inventory[playerid][Weed]) return SysMsg(playerid,"You don't have that amount to store.");
- Inventory[playerid][Weed] -= strval(Amount);
- MySQLUpdateInt(SQLID[playerid], "Weed", Inventory[playerid][Weed], "players");
- if(IsOwnedCar(tempv))
- {
- VehicleData[tempv][TrunkWeed] += strval(Amount);
- MySQLUpdateInt(VehicleData[tempv][VehSQLID], "TrunkWeed", VehicleData[tempv][TrunkWeed], "vehicles");
- format(trunkstring, sizeof(trunkstring),"* %s stores something in the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- }
- else if(IsFactionVehicle(tempv))
- {
- FVehicleData[tempv][FTrunkWeed] += strval(Amount);
- MySQLUpdateInt(FVehicleData[tempv][FVSQLID], "TrunkWeed", FVehicleData[tempv][FTrunkWeed], "fveh");
- format(trunkstring, sizeof(trunkstring),"* %s stores something in the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- }
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- ApplyTrunkAnimation(playerid);
- format(trunkstring, sizeof(trunkstring),"You have stored %i grams of Weed in the trunk of this car.",strval(Amount));
- SendClientMessage(playerid,COLOR_DARKBLUE,trunkstring);
- return true;
- }
- else if(strcmp("Cocaine",Item,true) == 0)
- {
- if(strmatch(Amount, "None")) return SysMsg(playerid,"Usage: /trunk Store Cocaine [amount]");
- if(!IsNumeric(Amount)) return SysMsg(playerid,"Amount must be a valid number.");
- if(strval(Amount) < 1) return SysMsg(playerid,"You must store at least 1.");
- if(strval(Amount) > Inventory[playerid][Cocaine]) return SysMsg(playerid,"You don't have that amount to store.");
- Inventory[playerid][Cocaine] -= strval(Amount);
- MySQLUpdateInt(SQLID[playerid], "Cocaine", Inventory[playerid][Cocaine], "players");
- if(IsOwnedCar(tempv))
- {
- VehicleData[tempv][TrunkCocaine] += strval(Amount);
- MySQLUpdateInt(VehicleData[tempv][VehSQLID], "TrunkCocaine", VehicleData[tempv][TrunkCocaine], "vehicles");
- format(trunkstring, sizeof(trunkstring),"* %s stores something in the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- }
- else if(IsFactionVehicle(tempv))
- {
- FVehicleData[tempv][FTrunkCocaine] += strval(Amount);
- MySQLUpdateInt(FVehicleData[tempv][FVSQLID], "TrunkCocaine", FVehicleData[tempv][FTrunkCocaine], "fveh");
- format(trunkstring, sizeof(trunkstring),"* %s stores something in the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- }
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- ApplyTrunkAnimation(playerid);
- format(trunkstring, sizeof(trunkstring),"You have stored %i grams of Cocaine in the trunk of this car.",strval(Amount));
- SendClientMessage(playerid,COLOR_DARKBLUE,trunkstring);
- return true;
- }
- else if(strcmp("MoonShine",Item,true) == 0)
- {
- if(strmatch(Amount, "None")) return SysMsg(playerid,"Usage: /trunk Store MoonShine [amount]");
- if(!IsNumeric(Amount)) return SysMsg(playerid,"Amount must be a valid number.");
- if(strval(Amount) < 1) return SysMsg(playerid,"You must store at least 1.");
- if(strval(Amount) > Inventory[playerid][MoonShine]) return SysMsg(playerid,"You don't have that amount to store.");
- Inventory[playerid][MoonShine] -= strval(Amount);
- MySQLUpdateInt(SQLID[playerid], "MoonShine", Inventory[playerid][MoonShine], "players");
- if(IsOwnedCar(tempv))
- {
- VehicleData[tempv][TrunkMoonShine] += strval(Amount);
- MySQLUpdateInt(VehicleData[tempv][VehSQLID], "TrunkMoonShine", VehicleData[tempv][TrunkMoonShine], "vehicles");
- format(trunkstring, sizeof(trunkstring),"* %s stores something in the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- }
- else if(IsFactionVehicle(tempv))
- {
- FVehicleData[tempv][FTrunkMoonShine] += strval(Amount);
- MySQLUpdateInt(FVehicleData[tempv][FVSQLID], "TrunkMoonShine", FVehicleData[tempv][FTrunkMoonShine], "fveh");
- format(trunkstring, sizeof(trunkstring),"* %s stores something in the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- }
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- ApplyTrunkAnimation(playerid);
- format(trunkstring, sizeof(trunkstring),"You have stored %i litres of Moon Shine in the trunk of this car.",strval(Amount));
- SendClientMessage(playerid,COLOR_DARKBLUE,trunkstring);
- return true;
- }
- else if(strcmp("gun",Item,true) == 0 || strcmp("weapon",Item,true) == 0)
- {
- if(strmatch(Amount, "None")) return SysMsg(playerid,"Usage: /trunk Store Weapon [name of weapon]");
- new wid = GetWeaponIdFromName(Amount);
- if(wid == -1) return SysMsg(playerid,"Invalid Weapon Name.");
- if(wid < 1 || wid > 47) return SysMsg(playerid,"Invalid Weapon.");
- if(wid == 19 || wid == 20 || wid == 21) return SysMsg(playerid,"Invalid Weapon.");
- new Slot = GetWeaponSlot(wid);
- if(HasTaser{playerid} && Slot == 2) return SysMsg(playerid, "You cannot store tasers.");
- if(WeaponData[playerid][Slot][Weapon] != wid) return SysMsg(playerid,"You don't have that weapon.");
- if(WeaponData[playerid][Slot][WeaponOrigin] == 3 && FVehicleData[tempv][FVFaction] != Faction[playerid]) return SysMsg(playerid, "You cannot store faction weapons in vehicles that don't belong to your faction.");
- if(IsOwnedCar(tempv))
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM weapons WHERE TrunkID = %i AND Deleted = 0 AND Dropped = 0", VehicleData[tempv][VehSQLID]);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() >= GetVehicleTrunkLimit(VehicleData[tempv][IdVehicle])) return SysMsg(playerid, "There is no more space left in this trunk.") && cache_delete(result);
- cache_delete(result);
- format(trunkstring, sizeof(trunkstring),"* %s stores something in the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET TrunkID = %i, WeaponPossession = 0, WeaponAmmo = %i WHERE id = %i", VehicleData[tempv][VehSQLID], WeaponData[playerid][Slot][WeaponAmmo], WeaponData[playerid][Slot][WeaponID]);
- mysql_pquery(conn, mquery);
- ResetWeaponVariables(playerid, 0, Slot);
- }
- else if(IsFactionVehicle(tempv))
- {
- if(WeaponData[playerid][Slot][WeaponOrigin] == 3 && IsFactionVehicle(FVehicleData[tempv][FactionVehID]) != Faction[playerid]) return SysMsg(playerid, "You cannot store faction weapons in vehicles that don't belong to your faction.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM weapons WHERE FCarID = %i AND Gunrack = -1 AND Deleted = 0 AND Dropped = 0", FVehicleData[tempv][FVSQLID]);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() >= GetVehicleTrunkLimit(FVehicleData[tempv][FactionVehID])) return SysMsg(playerid, "There is no more space left in this trunk.") && cache_delete(result);
- cache_delete(result);
- format(trunkstring, sizeof(trunkstring),"* %s stores something in the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET FCarID = %i, WeaponPossession = 0, WeaponAmmo = %i WHERE id = %i", FVehicleData[tempv][FVSQLID], WeaponData[playerid][Slot][WeaponAmmo], WeaponData[playerid][Slot][WeaponID]);
- mysql_pquery(conn, mquery);
- ResetWeaponVariables(playerid, 0, Slot);
- }
- ResetWeaponVariables(playerid, 0, Slot);
- SyncPlayerWeapons(playerid);
- if(wid == 2) UnlockAchievement(playerid, 35);
- ApplyTrunkAnimation(playerid);
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- format(trunkstring, sizeof(trunkstring),"You have stored one %s in the trunk of this car.",GetWeaponNameFromID(wid));
- SendClientMessage(playerid,COLOR_DARKBLUE,trunkstring);
- return true;
- }
- else if(strcmp("phone", Item, true) == 0)
- {
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid, "You need to have a phone if you wish to store one");
- if(IsPhoneRinging[playerid] == 1) return SysMsg(playerid,"You cannot store your phone while it is ringing.");
- if(CallerID[playerid] != -1 || CallerService[playerid] != -1) return SysMsg(playerid,"You cannot store your phone while you are using it.");
- new phoneid = PhoneData[playerid][pID];
- if(IsFactionVehicle(tempv))
- {
- FVehicleData[tempv][FTrunkPhone] = phoneid;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE fveh SET TrunkPhone = %i WHERE id = %i", phoneid, FVehicleData[tempv][FVSQLID]);
- mysql_tquery(conn, mquery);
- }
- else
- {
- VehicleData[tempv][TrunkPhone] = phoneid;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET TrunkPhone = %i WHERE id = %i", phoneid, VehicleData[tempv][VehSQLID]);
- mysql_tquery(conn, mquery);
- }
- ClearPhoneData(playerid);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhonePossession = 0 WHERE id = %i", phoneid);
- mysql_tquery(conn, mquery);
- format(trunkstring, sizeof(trunkstring),"* %s stores a phone in the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- ApplyTrunkAnimation(playerid);
- SendClientMessage(playerid,COLOR_DARKBLUE,"You have stored a phone in the trunk.");
- return true;
- }
- }
- else if(strcmp("get",Method,true) == 0)
- {
- if(strmatch(Item, "None")) return SysMsg(playerid,"Usage: /trunk Get [item] [amount(name for weapon)], Items: cash, armour, weed, cocaine, moonshine, weapon");
- if(strcmp("cash",Item,true) == 0)
- {
- if(strmatch(Amount, "None")) return SysMsg(playerid,"Usage: /trunk Get Cash [amount $]");
- if(!IsNumeric(Amount)) return SysMsg(playerid,"Amount must be a valid number.");
- if(strval(Amount) < 1 || strval(Amount) > 100000) return SysMsg(playerid,"You may only get a maximum of $100,000.");
- if(IsOwnedCar(tempv))
- {
- if(strval(Amount) > VehicleData[tempv][TrunkCash]) return SysMsg(playerid,"This car doesn't have that much cash in the trunk.");
- VehicleData[tempv][TrunkCash] -= strval(Amount);
- MySQLUpdateInt(VehicleData[tempv][VehSQLID], "TrunkCash", VehicleData[tempv][TrunkCash], "vehicles");
- }
- else if(IsFactionVehicle(tempv))
- {
- if(strval(Amount) > FVehicleData[tempv][FTrunkCash]) return SysMsg(playerid,"This car doesn't have that much cash in the trunk.");
- FVehicleData[tempv][FTrunkCash] -= strval(Amount);
- MySQLUpdateInt(FVehicleData[tempv][FVSQLID], "TrunkCash", FVehicleData[tempv][FTrunkCash], "fveh");
- }
- GivePlayerCash(playerid, strval(Amount));
- ApplyTrunkAnimation(playerid);
- format(trunkstring, sizeof(trunkstring),"You have got $%s out of the trunk.",format_cash(strval(Amount)));
- SendClientMessage(playerid,COLOR_DARKBLUE,trunkstring);
- format(trunkstring, sizeof(trunkstring),"* %s takes something from the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- format(trunkstring, sizeof(trunkstring),"[%s] %s(%i) gets $%i from a vehicles trunk.", GetServerTimeString(), NameEx(playerid), playerid, strval(Amount));
- }
- else if(strcmp("armor",Item,true) == 0 || strcmp("armour",Item,true) == 0)
- {
- if(IsOwnedCar(tempv))
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id, ArmorType, ArmorAmount FROM storedarmor WHERE TrunkID = %i", VehicleData[tempv][VehSQLID]);
- mysql_pquery(conn, mquery, "ShowStoredArmor", "dd", playerid, 2);
- }
- else if(IsFactionVehicle(tempv) && IsGovTrunk(tempv))
- {
- if(HasGovTrunkAccess(playerid, tempv))
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id, ArmorType, ArmorAmount FROM storedarmor WHERE FCarID = %i", FVehicleData[tempv][FVSQLID]);
- mysql_pquery(conn, mquery, "ShowStoredArmor", "dd", playerid, 2);
- }
- else return SysMsg(playerid, "You can't take armor from a government vehicle.");
- }
- else if(IsFactionVehicle(tempv) && !IsGovTrunk(tempv))
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id, ArmorType, ArmorAmount FROM storedarmor WHERE FCarID = %i", FVehicleData[tempv][FVSQLID]);
- mysql_pquery(conn, mquery, "ShowStoredArmor", "dd", playerid, 2);
- }
- }
- else if(strcmp("gun",Item,true) == 0 || strcmp("weapon",Item,true) == 0)
- {
- if(strmatch(Amount, "None")) return SysMsg(playerid,"Usage: /trunk Get Weapon [name of weapon]");
- new wid = GetWeaponIdFromName(Amount);
- if(wid == -1) return SysMsg(playerid,"Invalid Weapon Name.");
- if(wid < 1 || wid > 47) return SysMsg(playerid,"Invalid Weapon.");
- if(wid == 19 || wid == 20 || wid == 21) return SysMsg(playerid,"Invalid Weapon.");
- new Slot = GetWeaponSlot(wid);
- if(WeaponData[playerid][Slot][Weapon] != 0) return SysMsg(playerid,"You already have a weapon of this type.");
- if(IsOwnedCar(tempv))
- {
- if(VehicleData[tempv][VehSQLID] >= 1)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM weapons WHERE TrunkID = %i AND WeaponID = %i AND Deleted = 0 AND FCarID = -1 AND Gunrack = -1 AND WeaponPossession = 0 AND HouseID = -1 AND Dropped = 0", VehicleData[tempv][VehSQLID], wid);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() == 0)
- {
- SysMsg(playerid, "This weapon is not in your trunk.");
- cache_delete(result);
- return true;
- }
- else
- {
- WeaponData[playerid][Slot][WeaponID] = cache_get_field_content_int(0, "id");
- WeaponData[playerid][Slot][WeaponTimestamp] = cache_get_field_content_int(0, "Timestamp");
- WeaponData[playerid][Slot][wCreatorSQLID] = cache_get_field_content_int(0, "CreatorSQLID");
- WeaponData[playerid][Slot][Weapon] = cache_get_field_content_int(0, "WeaponID");
- WeaponData[playerid][Slot][wOwnerSQLID] = cache_get_field_content_int(0, "OwnerSQLID");
- WeaponData[playerid][Slot][WeaponAmmo] = cache_get_field_content_int(0, "WeaponAmmo");
- WeaponData[playerid][Slot][WeaponType] = GetWeaponType(WeaponData[playerid][Slot][Weapon]);
- WeaponData[playerid][Slot][WeaponOrigin] = cache_get_field_content_int(0, "WeaponOrigin");
- WeaponData[playerid][Slot][WeaponPossession] = cache_get_field_content_int(0, "WeaponPossession");
- }
- cache_delete(result);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET TrunkID = -1, WeaponPossession = 1, OwnerSQLID = %i WHERE id = %i", SQLID[playerid], WeaponData[playerid][Slot][WeaponID]);
- mysql_pquery(conn, mquery);
- }
- else return SysMsg(playerid, "An error has occurred. Please contact an admin.");
- }
- else if(IsFactionVehicle(tempv) && IsGovTrunk(tempv))
- {
- if(HasGovTrunkAccess(playerid, tempv))
- {
- if(FVehicleData[tempv][FVSQLID] >= 1)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM weapons WHERE FCarID = %i AND Gunrack = -1 AND WeaponID = %i AND Deleted = 0 AND TrunkID = -1 AND WeaponPossession = 0 AND HouseID = -1 AND Dropped = 0", FVehicleData[tempv][FVSQLID], wid);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() == 0)
- {
- SysMsg(playerid, "This weapon is not in your trunk.");
- cache_delete(result);
- return true;
- }
- else
- {
- WeaponData[playerid][Slot][WeaponID] = cache_get_field_content_int(0, "id");
- WeaponData[playerid][Slot][WeaponTimestamp] = cache_get_field_content_int(0, "Timestamp");
- WeaponData[playerid][Slot][wCreatorSQLID] = cache_get_field_content_int(0, "CreatorSQLID");
- WeaponData[playerid][Slot][Weapon] = cache_get_field_content_int(0, "WeaponID");
- WeaponData[playerid][Slot][wOwnerSQLID] = cache_get_field_content_int(0, "OwnerSQLID");
- WeaponData[playerid][Slot][WeaponAmmo] = cache_get_field_content_int(0, "WeaponAmmo");
- WeaponData[playerid][Slot][WeaponType] = GetWeaponType(WeaponData[playerid][Slot][Weapon]);
- WeaponData[playerid][Slot][WeaponOrigin] = cache_get_field_content_int(0, "WeaponOrigin");
- WeaponData[playerid][Slot][WeaponPossession] = cache_get_field_content_int(0, "WeaponPossession");
- }
- cache_delete(result);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET FCarID = -1, WeaponPossession = 1, OwnerSQLID = %i WHERE id = %i", SQLID[playerid], WeaponData[playerid][Slot][WeaponID]);
- mysql_pquery(conn, mquery);
- }
- else return SysMsg(playerid, "An error has occurred. Please contact an admin.");
- }
- else return SysMsg(playerid, "You can't take weapons from government vehicles.");
- }
- else if(IsFactionVehicle(tempv) && !IsGovTrunk(tempv))
- {
- if(FVehicleData[tempv][FVSQLID] >= 1)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM weapons WHERE FCarID = %i AND Gunrack = -1 AND WeaponID = %i AND Deleted = 0 AND TrunkID = -1 AND WeaponPossession = 0 AND HouseID = -1 AND Dropped = 0", FVehicleData[tempv][FVSQLID], wid);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() == 0)
- {
- SysMsg(playerid, "This weapon is not in your trunk.");
- cache_delete(result);
- return true;
- }
- else
- {
- WeaponData[playerid][Slot][WeaponID] = cache_get_field_content_int(0, "id");
- WeaponData[playerid][Slot][WeaponTimestamp] = cache_get_field_content_int(0, "Timestamp");
- WeaponData[playerid][Slot][wCreatorSQLID] = cache_get_field_content_int(0, "CreatorSQLID");
- WeaponData[playerid][Slot][Weapon] = cache_get_field_content_int(0, "WeaponID");
- WeaponData[playerid][Slot][wOwnerSQLID] = cache_get_field_content_int(0, "OwnerSQLID");
- WeaponData[playerid][Slot][WeaponAmmo] = cache_get_field_content_int(0, "WeaponAmmo");
- WeaponData[playerid][Slot][WeaponType] = GetWeaponType(WeaponData[playerid][Slot][Weapon]);
- WeaponData[playerid][Slot][WeaponOrigin] = cache_get_field_content_int(0, "WeaponOrigin");
- WeaponData[playerid][Slot][WeaponPossession] = cache_get_field_content_int(0, "WeaponPossession");
- }
- cache_delete(result);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET FCarID = -1, WeaponPossession = 1, OwnerSQLID = %i WHERE id = %i", SQLID[playerid], WeaponData[playerid][Slot][WeaponID]);
- mysql_pquery(conn, mquery);
- }
- else return SysMsg(playerid, "An error has occurred. Please contact an admin.");
- }
- ApplyTrunkAnimation(playerid);
- format(trunkstring, sizeof(trunkstring),"You have taken one %s from the trunk of this %s.",GetWeaponNameFromID(wid),GetVehicleName(tempv));
- SendClientMessage(playerid,COLOR_DARKBLUE,trunkstring);
- format(trunkstring, sizeof(trunkstring),"* %s takes something from the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- SyncPlayerWeapons(playerid);
- return true;
- }
- else if(strcmp("Weed",Item,true) == 0)
- {
- if(strmatch(Amount, "None")) return SysMsg(playerid,"Usage: /trunk Get Weed [amount]");
- if(!IsNumeric(Amount)) return SysMsg(playerid,"Amount must be a valid number.");
- if(IsOwnedCar(tempv))
- {
- if(strval(Amount) < 1 || strval(Amount) > VehicleData[tempv][TrunkWeed]) return SysMsg(playerid,"You must take at least 1 and no more than whats in the trunk.");
- if(Inventory[playerid][Weed] + strval(Amount) > DRUG_MAX_WEED) return SysMsg(playerid,"You cannot carry that much Weed.");
- VehicleData[tempv][TrunkWeed] -= strval(Amount);
- MySQLUpdateInt(VehicleData[tempv][VehSQLID], "TrunkWeed", VehicleData[tempv][TrunkWeed], "vehicles");
- }
- else if(IsFactionVehicle(tempv))
- {
- if(strval(Amount) < 1 || strval(Amount) > FVehicleData[tempv][FTrunkWeed]) return SysMsg(playerid,"You must take at least 1 and no more than whats in the trunk.");
- if(Inventory[playerid][Weed] + strval(Amount) > DRUG_MAX_WEED) return SysMsg(playerid,"You cannot carry that much Weed.");
- FVehicleData[tempv][FTrunkWeed] -= strval(Amount);
- MySQLUpdateInt(FVehicleData[tempv][FVSQLID], "TrunkWeed", FVehicleData[tempv][FTrunkWeed], "fveh");
- }
- Inventory[playerid][Weed] += strval(Amount);
- MySQLUpdateInt(SQLID[playerid], "Weed", Inventory[playerid][Weed], "players");
- ApplyTrunkAnimation(playerid);
- format(trunkstring, sizeof(trunkstring),"You have got %i grams of Weed from the trunk.",strval(Amount));
- SendClientMessage(playerid,COLOR_DARKBLUE,trunkstring);
- format(trunkstring, sizeof(trunkstring),"* %s takes something from the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- return true;
- }
- else if(strcmp("Cocaine",Item,true) == 0)
- {
- if(strmatch(Amount, "None")) return SysMsg(playerid,"Usage: /trunk Get Cocaine [amount]");
- if(!IsNumeric(Amount)) return SysMsg(playerid,"Amount must be a valid number.");
- if(IsOwnedCar(tempv))
- {
- if(strval(Amount) < 1 || strval(Amount) > VehicleData[tempv][TrunkCocaine]) return SysMsg(playerid,"You must take at least 1 and no more than whats in the trunk.");
- if(Inventory[playerid][Cocaine] + strval(Amount) > DRUG_MAX_COCAINE) return SysMsg(playerid,"You cannot carry that much cocaine.");
- VehicleData[tempv][TrunkCocaine] -= strval(Amount);
- MySQLUpdateInt(VehicleData[tempv][VehSQLID], "TrunkCocaine", VehicleData[tempv][TrunkCocaine], "vehicles");
- }
- else if(IsFactionVehicle(tempv))
- {
- if(strval(Amount) < 1 || strval(Amount) > FVehicleData[tempv][FTrunkCocaine]) return SysMsg(playerid,"You must take at least 1 and no more than whats in the trunk.");
- if(Inventory[playerid][Cocaine] + strval(Amount) > DRUG_MAX_COCAINE) return SysMsg(playerid,"You cannot carry that much cocaine.");
- FVehicleData[tempv][FTrunkCocaine] -= strval(Amount);
- MySQLUpdateInt(FVehicleData[tempv][FVSQLID], "TrunkCocaine", FVehicleData[tempv][FTrunkCocaine], "fveh");
- }
- Inventory[playerid][Cocaine] += strval(Amount);
- MySQLUpdateInt(SQLID[playerid], "Cocaine", Inventory[playerid][Cocaine], "players");
- ApplyTrunkAnimation(playerid);
- format(trunkstring, sizeof(trunkstring),"You have got %i grams of Cocaine from the trunk.",strval(Amount));
- SendClientMessage(playerid,COLOR_DARKBLUE,trunkstring);
- format(trunkstring, sizeof(trunkstring),"* %s takes something from the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- return true;
- }
- else if(strcmp("MoonShine",Item,true) == 0)
- {
- if(strmatch(Amount, "None")) return SysMsg(playerid,"Usage: /trunk Get MoonShine [amount]");
- if(!IsNumeric(Amount)) return SysMsg(playerid,"Amount must be a valid number.");
- if(IsOwnedCar(tempv))
- {
- if(strval(Amount) < 1 || strval(Amount) > VehicleData[tempv][TrunkMoonShine]) return SysMsg(playerid,"You must take at least 1 and no more than whats in the trunk.");
- if(Inventory[playerid][MoonShine] + strval(Amount) > DRUG_MAX_MOONSHINE) return SysMsg(playerid,"You cannot carry that much moonshine.");
- VehicleData[tempv][TrunkMoonShine] -= strval(Amount);
- MySQLUpdateInt(VehicleData[tempv][VehSQLID], "TrunkMoonShine", VehicleData[tempv][TrunkMoonShine], "vehicles");
- }
- else if(IsFactionVehicle(tempv))
- {
- if(strval(Amount) < 1 || strval(Amount) > FVehicleData[tempv][FTrunkMoonShine]) return SysMsg(playerid,"You must take at least 1 and no more than whats in the trunk.");
- if(Inventory[playerid][MoonShine] + strval(Amount) > DRUG_MAX_MOONSHINE) return SysMsg(playerid,"You cannot carry mooonshine.");
- FVehicleData[tempv][FTrunkMoonShine] -= strval(Amount);
- MySQLUpdateInt(FVehicleData[tempv][FVSQLID], "TrunkMoonShine", FVehicleData[tempv][FTrunkMoonShine], "fveh");
- }
- Inventory[playerid][MoonShine] += strval(Amount);
- MySQLUpdateInt(SQLID[playerid], "MoonShine", Inventory[playerid][MoonShine], "players");
- ApplyTrunkAnimation(playerid);
- format(trunkstring, sizeof(trunkstring),"You have got %i litre(s) of MoonShine from the trunk.",strval(Amount));
- SendClientMessage(playerid,COLOR_DARKBLUE,trunkstring);
- format(trunkstring, sizeof(trunkstring),"* %s takes something from the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- return true;
- }
- else if(strcmp("Phone", Item, true) == 0)
- {
- if(Inventory[playerid][MobilePhone] == 1) return SysMsg(playerid, "You already have a phone in your inventory.");
- new phoneid;
- if(IsFactionVehicle(tempv))
- {
- if(FVehicleData[tempv][FTrunkPhone] == 0) return SysMsg(playerid, "This vehicle does not have a phone in its trunk.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhonePossession = 1, PhonePossessor = %i WHERE id = %i", SQLID[playerid], FVehicleData[tempv][FTrunkPhone]);
- mysql_tquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE fveh SET TrunkPhone = 0 WHERE id = %i", FVehicleData[tempv][FVSQLID]);
- mysql_tquery(conn, mquery);
- FVehicleData[tempv][FTrunkPhone] = 0;
- }
- if(IsOwnedCar(tempv))
- {
- if(VehicleData[tempv][TrunkPhone] == 0) return SysMsg(playerid, "This vehicle does not have a phone in its trunk.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhonePossession = 1, PhonePossessor = %i WHERE id = %i", SQLID[playerid], VehicleData[tempv][TrunkPhone]);
- mysql_tquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET TrunkPhone = 0 WHERE id = %i", VehicleData[tempv][VehSQLID]);
- mysql_tquery(conn, mquery);
- VehicleData[tempv][TrunkPhone] = 0;
- }
- ApplyTrunkAnimation(playerid);
- SendClientMessage(playerid,COLOR_DARKBLUE,"You have taken a phone from the vehicle's trunk");
- format(trunkstring, sizeof(trunkstring),"* %s takes a phone from the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM phones WHERE id = %i AND PhonePossession = 1", phoneid);
- mysql_tquery(conn, mquery, "LoadPlayerPhone", "d", playerid);
- return true;
- }
- }
- else if(strcmp("show",Method,true) == 0)
- {
- if(IsOwnedCar(tempv))
- {
- SendClientMessageF(playerid,COLOR_DARKBLUE, "[Trunk] Cash: $%s | Weed: %ig | Cocaine: %ig | MoonShine: %i L.", format_cash(VehicleData[tempv][TrunkCash]), VehicleData[tempv][TrunkWeed], VehicleData[tempv][TrunkCocaine], VehicleData[tempv][TrunkMoonShine]);
- SendClientMessage(playerid,COLOR_DARKBLUE, "[Trunk] Weapons: Use /trunk viewguns | Armor: use /trunk get armor.");
- if(VehicleData[tempv][TrunkPhone] >= 1) SendClientMessageF(playerid, COLOR_DARKBLUE, "This vehicle has a phone stored in it.");
- }
- else if(IsFactionVehicle(tempv))
- {
- SendClientMessageF(playerid,COLOR_DARKBLUE, "[Trunk] Cash: $%s | Weed: %ig | Cocaine: %ig | MoonShine: %i L.", format_cash(FVehicleData[tempv][FTrunkCash]), FVehicleData[tempv][FTrunkWeed], FVehicleData[tempv][FTrunkCocaine], FVehicleData[tempv][FTrunkMoonShine]);
- SendClientMessage(playerid,COLOR_DARKBLUE, "[Trunk] Weapons: Use /trunk viewguns | Armor: use /trunk get armor.");
- if(FVehicleData[tempv][FTrunkPhone] >= 1) SendClientMessageF(playerid, COLOR_DARKBLUE, "This vehicle has a phone stored in it.");
- }
- format(trunkstring, sizeof(trunkstring),"* %s looks in the %s's trunk. *",NameRP(playerid),GetVehicleName(tempv));
- ProxDetector(15.0,playerid,trunkstring, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else if(strcmp("viewguns",Method,true) == 0)
- {
- if(IsOwnedCar(tempv)) mysql_format(conn, mquery, sizeof(mquery), "SELECT id,WeaponID,WeaponAmmo FROM weapons WHERE TrunkID = %i AND Deleted = 0 AND WeaponPossession = 0 AND HouseID = -1 AND Gunrack = -1 AND FCarID = -1 AND Dropped = 0", VehicleData[tempv][VehSQLID]);
- else mysql_format(conn, mquery, sizeof(mquery), "SELECT id,WeaponID,WeaponAmmo FROM weapons WHERE FCarID = %i AND Gunrack = -1 AND Deleted = 0 AND WeaponPossession = 0 AND TrunkID = -1 AND HouseID = -1 AND Dropped = 0", FVehicleData[tempv][FVSQLID]);
- mysql_pquery(conn, mquery, "ShowTrunkGuns", "d", playerid);
- return true;
- }
- }
- else SysMsg(playerid, "Usage: /trunk [open/close/get/store/show] [item] [amount], Items: cash, armour, weed, cocaine, moonshine, weapon");
- }
- return true;
- }
- CMD:donationvehicle(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new rewardCarModel;
- MySQLFetchInt(SQLID[playerid], "DonationCarModel", rewardCarModel, "players");
- if(rewardCarModel == 0) return SysMsg(playerid, "You do not have a donation vehicle to get at this time.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM vehicles WHERE OwnerSQLID = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery, "ProcessDonationVehicle", "dd", playerid, rewardCarModel);
- return true;
- }
- CMD:changedonatorveh(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return SysMsg(playerid, "Usage: /changedonatorveh [vehicle model or name]");
- if(IsDonator[playerid] < 3) return SysMsg(playerid, "You must be either a level 3 or 4 donator.");
- new vehicleid = GetPlayerVehicleID(playerid);
- if(vehicleid == 0) return SysMsg(playerid,"You are not in any vehicle.");
- if(vehicleid == VehicleData[vehicleid][IdVehicle] && VehicleData[vehicleid][DonatorCar] && VehicleData[vehicleid][VehicleOwnerSQLID] == SQLID[playerid])
- {
- new Car = GetVehicleModelIdFromName(params);
- if(Car == -1)
- {
- Car = strval(params);
- if(Car < 400 || Car > 611) return SysMsg(playerid, "Invalid Vehicle ID.");
- }
- mysql_format(conn, mquery, sizeof(mquery), "SELECT NextChangable FROM vehicles WHERE id = %i LIMIT 1", VehicleData[vehicleid][VehSQLID]);
- mysql_pquery(conn, mquery, "SetCDV", "ddd", playerid, Car, vehicleid);
- return true;
- }
- else SysMsg(playerid,"You are not in your owned donator vehicle.");
- return true;
- }
- CMD:mod(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a vehicle first.");
- new bodyshop = -1, v = GetPlayerVehicleID(playerid);
- if(IsPlayerInDynamicArea(playerid, GarageAreas[0])) bodyshop = 1; //palomino creek
- if(IsPlayerInDynamicArea(playerid, GarageAreas[2])) bodyshop = 3; //fort carson
- if(bodyshop == -1) return SysMsg(playerid, "You must be at the Fort Carson or Palomino Creek vehicle garages to mod your vehicle.");
- if(VehicleData[v][Hotwired] == 1) return SysMsg(playerid, "You cannot mod a hotwired vehicle.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You must be the vehicle driver.");
- if(IsHelicopter(v) || IsPlane(v) || IsBoat(v) || IsBike(v)) return SysMsg(playerid,"You cannot modify helicopters, boats, bikes or planes.");
- if(VehicleData[v][VehicleOwnerSQLID] != SQLID[playerid]) return SysMsg(playerid, "You must own this vehicle to modify it.");
- if(aspawned{v}) return SysMsg(playerid, "You cannot modify admin spawned vehicles. If you are using this vehicle without authorization, please get an admin or helper to remove it.");
- new Float:health;
- GetVehicleHealth(v, health);
- if(health <= 950) return SysMsg(playerid, "Your vehicle must be in good condition to be modified.");
- Dialog_Show(playerid, vModSelect, DIALOG_STYLE_MSGBOX, "Mod Vehicle", "Select the type of mod you'd like to add to your vehicle", "Bodywork", "Rims");
- return true;
- }
- CMD:paintjob(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a vehicle first.");
- new bodyshop = -1, v = GetPlayerVehicleID(playerid);
- if(IsPlayerInDynamicArea(playerid, GarageAreas[0])) bodyshop = 1; //palomino creek
- if(IsPlayerInDynamicArea(playerid, GarageAreas[1])) bodyshop = 2; //dillimore
- if(IsPlayerInDynamicArea(playerid, GarageAreas[2])) bodyshop = 3; //fort carson
- if(IsPlayerInDynamicArea(playerid, GarageAreas[3])) bodyshop = 4; //el q
- if(IsPlayerInDynamicArea(playerid, GarageAreas[6])) bodyshop = 5; //angel pine
- if(bodyshop == -1) return SysMsg(playerid,"You are not near any vehicle garage.");
- if(VehicleData[v][Hotwired] == 1) return SysMsg(playerid, "You cannot mod a hotwired vehicle.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You must be the vehicle driver.");
- if(IsHelicopter(v) || IsPlane(v) || IsBoat(v) || IsBike(v)) return SysMsg(playerid,"You cannot modify helicopters, boats, bikes or planes.");
- if(bodyshop == 5 && (!IsHelicopter(v) && !IsPlane(v))) return SysMsg(playerid,"You cannot modify vehicles at this garage.");
- if(VehicleData[v][VehicleOwnerSQLID] != SQLID[playerid]) return SysMsg(playerid, "You must own this vehicle to modify it.");
- if(aspawned{v}) return SysMsg(playerid, "You cannot modify admin spawned vehicles. If you are using this vehicle without authorization, please get an admin or helper to remove it.");
- new Float:health;
- GetVehicleHealth(v, health);
- if(health <= 950) return SysMsg(playerid, "Your vehicle must be in good condition to be modified.");
- if(!IsNumeric(params)) return SysMsg(playerid, "Usage: /paintjob [0-3] *0 will remove any paintjob your vehicle has.*");
- new paintjob = strval(params);
- if(paintjob < 0 || paintjob > 3) return SysMsg(playerid, "Paintjob must be 0-3.");
- if(!IsSuitablePaintjobCar(v)) SendSplitMessage(playerid, COLOR_RED, "Note: Your current vehicle does not natively support paintjobs. If you have a vehicle mod that supports paintjobs, it will show up. Otherwise applying a paintjob will not do anything.");
- if(paintjob != 0)
- {
- PendingPaintjob[playerid] = paintjob - 1;
- ChangeVehiclePaintjob(v, paintjob - 1);
- SendClientMessage(playerid, COLOR_WHITE, "You have added a new "COL_NICEGREEN"paintjob{FFFFFF} to your modding queue.");
- }
- else
- {
- ChangeVehiclePaintjob(v, 3);
- VehicleData[v][VehiclePaintjob] = 3;
- SavePlayerVehicles(playerid, 0);
- PendingPaintjob[playerid] = -1;
- SendClientMessage(playerid, COLOR_WHITE, "You have removed the "COL_NICERED"paintjob{FFFFFF} from your vehicle.");
- }
- return true;
- }
- CMD:clearmods(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a vehicle first.");
- new bodyshop = -1, v = GetPlayerVehicleID(playerid);
- if(IsPlayerInDynamicArea(playerid, GarageAreas[0])) bodyshop = 1; //palomino creek
- if(IsPlayerInDynamicArea(playerid, GarageAreas[1])) bodyshop = 2; //dillimore
- if(IsPlayerInDynamicArea(playerid, GarageAreas[2])) bodyshop = 3; //fort carson
- if(IsPlayerInDynamicArea(playerid, GarageAreas[3])) bodyshop = 4; //el q
- if(bodyshop == -1) return SysMsg(playerid, "You must be near a garage.");
- new modcount = 0;
- for(new x = 0; x < 14; x++) if(ModQueue[playerid][x] >= 1) modcount ++;
- if(PendingPaintjob[playerid] != -1) modcount ++;
- if(modcount == 0) return SysMsg(playerid, "You do not have any mods pending installation.");
- new component;
- for(new x = 0; x < 14; x++) //removes pending components from the vehicle and then re-adds saved mods
- {
- component = GetVehicleComponentInSlot(v, x);
- if(component != 0) RemoveVehicleComponent(v, component);
- if(VehicleData[v][VehicleMod][x] && IsVehicleUpgradeCompatible(VehicleData[v][VehicleModel], VehicleData[v][VehicleMod][x]))
- {
- AddVehicleComponent(VehicleData[v][IdVehicle], VehicleData[v][VehicleMod][x]);
- }
- ModQueue[playerid][x] = 0;
- }
- if(PendingPaintjob[playerid] != -1) ChangeVehiclePaintjob(v, 3);
- PendingPaintjob[playerid] = -1;
- return true;
- }
- CMD:buymods(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a vehicle first.");
- new bodyshop = -1, v = GetPlayerVehicleID(playerid);
- if(IsPlayerInDynamicArea(playerid, GarageAreas[0])) bodyshop = 1; //palomino creek
- if(IsPlayerInDynamicArea(playerid, GarageAreas[1])) bodyshop = 2; //dillimore
- if(IsPlayerInDynamicArea(playerid, GarageAreas[2])) bodyshop = 3; //fort carson
- if(IsPlayerInDynamicArea(playerid, GarageAreas[3])) bodyshop = 4; //el q
- if(bodyshop == -1) return SysMsg(playerid, "You must be near a garage.");
- new modcount = 0;
- for(new x = 0; x < 14; x++) if(ModQueue[playerid][x] >= 1) modcount ++;
- if(PendingPaintjob[playerid] != -1) modcount ++;
- if(modcount == 0) return SysMsg(playerid, "You do not have any mods pending installation.");
- new
- price,
- spoiler = ModQueue[playerid][CARMODTYPE_SPOILER],
- hood = ModQueue[playerid][CARMODTYPE_HOOD],
- roof = ModQueue[playerid][CARMODTYPE_ROOF],
- lamps = ModQueue[playerid][CARMODTYPE_LAMPS],
- exhaust = ModQueue[playerid][CARMODTYPE_EXHAUST],
- wheels = ModQueue[playerid][CARMODTYPE_WHEELS],
- fbumper = ModQueue[playerid][CARMODTYPE_FRONT_BUMPER],
- rbumper = ModQueue[playerid][CARMODTYPE_REAR_BUMPER],
- rvent = ModQueue[playerid][CARMODTYPE_VENT_RIGHT],
- lvent = ModQueue[playerid][CARMODTYPE_VENT_LEFT];
- if(spoiler >= 1000) price += 750;
- if(hood >= 1000) price += 500;
- if(roof >= 1000) price += 500;
- if(lamps>= 1000) price += 200;
- if(exhaust>= 1000) price += 500;
- if(wheels >= 1000) price += 500;
- if(fbumper >= 1000) price += 1000;
- if(rbumper >= 1000) price += 1000;
- if(rvent >= 1000) price += 1000;
- if(lvent >= 1000) price += 1000;
- if(PendingPaintjob[playerid] != -1) price += 1000;
- price *= GetVehicleRepairMultiplier(GetVehicleModel(v));
- new conf[12];
- if(sscanf(params, "s[12]", conf)) return SendClientMessageF(playerid, COLOR_WHITE, "Usage: /buymods confirm. This will cost you $%s.", format_cash(price));
- if(strmatch(conf, "confirm"))
- {
- if(Cash[playerid] - price < 0) return SysMsg(playerid, "You do not have enough money to afford this.");
- for(new x = 0; x < 14; x++)
- {
- if(ModQueue[playerid][x] != 0)
- {
- VehicleData[v][VehicleMod][x] = ModQueue[playerid][x];
- ModQueue[playerid][x] = 0;
- }
- }
- if(PendingPaintjob[playerid] != -1) VehicleData[v][VehiclePaintjob] = PendingPaintjob[playerid];
- PendingPaintjob[playerid] = -1;
- GivePlayerCash(playerid, -price);
- SendClientMessageF(playerid, COLOR_WHITE, "You have added new mods to your vehicle for $%s!", format_cash(price));
- SavePlayerVehicles(playerid, 0);
- }
- return true;
- }
- CMD:removemods(playerid)
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You must be in a vehicle first.");
- new bodyshop = -1, v = GetPlayerVehicleID(playerid);
- if(IsPlayerInDynamicArea(playerid, GarageAreas[0])) bodyshop = 1; //palomino creek
- if(IsPlayerInDynamicArea(playerid, GarageAreas[1])) bodyshop = 2; //dillimore
- if(IsPlayerInDynamicArea(playerid, GarageAreas[2])) bodyshop = 3; //fort carson
- if(IsPlayerInDynamicArea(playerid, GarageAreas[3])) bodyshop = 4; //el q
- if(bodyshop == -1) return SysMsg(playerid, "You must be near a garage.");
- if(VehicleData[v][Hotwired] == 1) return SysMsg(playerid, "You cannot mod a hotwired vehicle.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You must be the vehicle driver.");
- if(IsHelicopter(v) && IsPlane(v) && IsBoat(v) && IsBike(v)) return SysMsg(playerid,"You cannot modify helicopters, boats, bikes or planes.");
- if(bodyshop == 5) return SysMsg(playerid,"You cannot modify vehicles at this garage.");
- if(VehicleData[v][VehicleOwnerSQLID] != SQLID[playerid]) return SysMsg(playerid, "You must own this vehicle.");
- if(aspawned{v}) return SysMsg(playerid, "You cannot modify admin spawned vehicles. If you are using this vehicle without authorization, please get an admin or helper to remove it.");
- gstr[0] = EOS;
- new count = 0;
- for(new x = 0; x < 14; x++)
- {
- if(ModQueue[playerid][x] != 0)
- {
- format(sgstr, sizeof(sgstr), "{FF0000}%s: %s\n", ComponentTypes[x], GetVehicleModName(GetVehicleComponentInSlot(v, x)));
- strcat(gstr, sgstr);
- count ++;
- }
- else if(VehicleData[v][VehicleMod][x] != 0)
- {
- format(sgstr, sizeof(sgstr), "%s: %s\n", ComponentTypes[x], GetVehicleModName(GetVehicleComponentInSlot(v, x)));
- strcat(gstr, sgstr);
- count ++;
- }
- }
- if(count == 0) return SysMsg(playerid, "No mods to remove.");
- else Dialog_Show(playerid, vModRemove, DIALOG_STYLE_LIST, "Mod Removal: Red = Pending | White = Installed", gstr, "Remove", "Cancel");
- return true;
- }
- //End of vehicle commands
- CMD:stats(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) ShowPlayerStats(playerid, playerid);
- else
- {
- if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /stats [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- ShowPlayerStats(playa, playerid);
- }
- return true;
- }
- CMD:ttp(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new d = 0, h = 0, temp = TotalTimePlayed[playerid];
- while(temp > 1440)
- {
- temp -= 1440;
- d++;
- }
- while(temp > 60)
- {
- temp -= 60;
- h++;
- }
- SendClientMessageF(playerid, COLOR_WHITE, "Total Time Played: {00FF00}%i{FFFFFF} days {00FF00}%i{FFFFFF} hours and {00FF00}%i{FFFFFF} minutes.", d, h, temp);
- return true;
- }
- CMD:age(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT BirthYear, BirthMonth, BirthDate FROM players WHERE id = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery, "AgeCheck", "d", playerid);
- return true;
- }
- CMD:changedob(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new age, birthyear, birthmonth, birthday, thstndrd[3];
- if(sscanf(params, "iii", birthday, birthmonth, birthyear)) return SysMsg(playerid,"Usage: /changedob [day 1-31] [month 1-12] [year] *This is free*");
- if(birthday < 1 || birthday > 31) return SysMsg(playerid, "Invalid day. [1 to 31 only]");
- if(birthmonth < 1 || birthmonth > 12) return SysMsg(playerid, "Invalid month. [1 to 12 only]");
- if(birthday > LastDayInMonth(birthmonth)) return SysMsg(playerid, "Invalid day for the chosen month.");
- if(birthyear > gServerYear - 16 || birthyear < 1900) return SysMsg(playerid, "Invalid year. You must be at least 16 years old and the year cannot be less than 1900.");
- if(birthday > LastDayInMonth(birthmonth)) return SysMsg(playerid, "Invalid day for the chosen month.");
- if(birthyear > gServerYear - 16 || birthyear < 1900) return SysMsg(playerid, "Invalid year. You must be at least 16 years old and the year cannot be less than 1900.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET BirthYear = %i, BirthMonth = %i, BirthDate = %i WHERE id = %i", birthyear, birthmonth, birthday, SQLID[playerid]);
- mysql_pquery(conn, mquery);
- age = gServerYear - birthyear;
- switch(birthday)
- {
- case 1,21,31: format(thstndrd, sizeof(thstndrd), "st");
- case 2,22: format(thstndrd, sizeof(thstndrd), "nd");
- case 3,23: format(thstndrd, sizeof(thstndrd), "rd");
- default: format(thstndrd, sizeof(thstndrd), "th");
- }
- SendClientMessageF(playerid, COLOR_WHITE, "Your birthday is now set to: %i%s of %s %i.", birthday, thstndrd, GetMonthName(birthmonth), birthyear);
- SendClientMessageF(playerid, COLOR_WHITE, "This means you are now %i years old.", age);
- return true;
- }
- CMD:findyear(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return SysMsg(playerid, "Usage: /findyear [desired age]");
- new age = strval(params);
- if(age < 16 || age > 100) return SysMsg(playerid, "Invalid age. [16 to 100 only]");
- new chosenyear = gServerYear - age;
- SendClientMessageF(playerid, COLOR_WHITE, "In order to be %i years old, you would have to set your birth year to %i.", age, chosenyear);
- return true;
- }
- CMD:licenses(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return ShowPlayerLicenses(playerid, playerid);
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /showlicenses [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to do that.");
- if(playa != playerid)
- {
- format(gstr, sizeof(gstr),"* %s shows their licenses to %s. *", NameRP(playerid), NameRP(playa));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- for(new lic = 0; lic < sizeof(Licenses[]); lic++) if(Licenses[playerid][lic] == 1) UnlockAchievement(playerid, 43);
- }
- ShowPlayerLicenses(playerid, playa);
- return true;
- }
- CMD:showlicenses(playerid, params[]) return cmd_licenses(playerid, params);
- CMD:showkeys(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /showkeys [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(playa == playerid) return SysMsg(playerid,"You cannot show keys to yourself.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to do that.");
- new count = 0;
- format(gstr, sizeof(gstr), "%s's Vehicle Keys: ", NameEx(playerid));
- for(new i = 1, x = GetVehiclePoolSize(); i <= x; i++)
- {
- if(VehicleData[i][VehicleOwnerSQLID] == SQLID[playerid])
- {
- if(!VehicleData[i][Impounded])
- {
- if(count == 0)
- {
- strcat(gstr, GetVehicleNameEx(VehicleData[i][VehicleModel]));
- }
- else
- {
- strcat(gstr, ", ");
- strcat(gstr, GetVehicleNameEx(VehicleData[i][VehicleModel]));
- }
- count ++;
- }
- }
- }
- SendClientMessage(playa, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr),"* %s shows %s a set of keys. *", NameRP(playerid), NameRP(playa));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:dmv(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInRangeOfPoint(playerid, 2.0, 722.0221,3107.5122,2084.6230)) return SysMsg(playerid, "You are not at the DMV.");
- Dialog_Show(playerid, DMVMain, DIALOG_STYLE_LIST, "Welcome to the DMV! Please select an option:", "General Car License [GVL-1]\nLarge Vehicle License [GVL-2]\nMotorbike License [MB]\nBoat License [B]\nHelicopter License [A1]\nPlane License [A2]", "Select", "Exit");
- return true;
- }
- CMD:endtest(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(DMV_CanEndTest[playerid] == 0) return true;
- DMV_CanEndTest[playerid] = 0;
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorldEx(playerid, 0);
- SetPlayerPos(playerid, 1251.018798, 134.651306, 19.948959);
- SetPlayerFacingAngle(playerid, 68.0);
- TogglePlayerControllable(playerid, 1);
- SetCameraBehindPlayer(playerid);
- PlayerPlaySound(playerid, SOUND_DMV_PASS_END, 0, 0, 0);
- GameTextForPlayer(playerid, " ", 100, 3);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "[DMV] Thank you for using the San Andreas DMV. Enjoy your new license and drive safely.");
- return true;
- }
- CMD:buylevel(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new ReqXP = PlayerLevel[playerid] * 10;
- if(isnull(params))
- {
- SendClientMessageF(playerid,COLOR_ORANGE,"A Level-Up will require %i Experience Points. You currently have %i.",ReqXP,PlayerXP[playerid]);
- SendClientMessage(playerid,COLOR_ORANGE,"To Level-Up now, type '/buylevel confirm'");
- return true;
- }
- if(strcmp("confirm",params) == 0)
- {
- if(PlayerXP[playerid] < ReqXP) return SysMsg(playerid,"You don't have enough XP to level up.");
- PlayerXP[playerid] -= ReqXP;
- PlayerLevel[playerid]++;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET PlayerXP = %i, PlayerLevel = %i WHERE id = %i", PlayerXP[playerid], PlayerLevel[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- if(PlayerLevel[playerid] >= 2) UnlockAchievement(playerid,20);
- if(PlayerLevel[playerid] >= 5) UnlockAchievement(playerid,21);
- if(PlayerLevel[playerid] >= 10) UnlockAchievement(playerid,22);
- if(PlayerLevel[playerid] >= 20) UnlockAchievement(playerid,23);
- if(PlayerLevel[playerid] >= 30) UnlockAchievement(playerid,52);
- if(PlayerLevel[playerid] >= 40) UnlockAchievement(playerid,53);
- if(PlayerLevel[playerid] >= 50) UnlockAchievement(playerid,54);
- if(PlayerLevel[playerid] >= 75) UnlockAchievement(playerid,55);
- if(PlayerLevel[playerid] >= 100) UnlockAchievement(playerid,56);
- if(PlayerLevel[playerid] >= 101) UnlockAchievement(playerid,57);
- SendClientMessageF(playerid,COLOR_ORANGE,"Congratulations! You are now level %i. %i Experience Points were required.",PlayerLevel[playerid],ReqXP);
- if(PlayerLevel[playerid] == 2)
- {
- GivePlayerCash(playerid, 2500);
- SendClientMessage(playerid, COLOR_GREEN, "Level up bonus! You have received $2,500 for reaching level two.");
- }
- if(PlayerLevel[playerid] == 3)
- {
- GivePlayerCash(playerid, 5000);
- SendClientMessage(playerid, COLOR_GREEN, "Level up bonus! You have received $5,000 for reaching level three.");
- }
- return true;
- }
- return true;
- }
- CMD:buyweaponskill(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInRangeOfPoint(playerid,5.5,312.582183, -165.342315, 999.601013)) return SysMsg(playerid,"You are not in Ammunation.");
- if(WeaponSkillLevel[playerid] == 10) return SysMsg(playerid,"Your skill is maxed out.");
- new ReqXP;
- if(WeaponSkillLevel[playerid] <= 1) ReqXP = 5;
- if(WeaponSkillLevel[playerid] == 2) ReqXP = 5;
- if(WeaponSkillLevel[playerid] == 3) ReqXP = 5;
- if(WeaponSkillLevel[playerid] == 4) ReqXP = 10;
- if(WeaponSkillLevel[playerid] == 5) ReqXP = 10;
- if(WeaponSkillLevel[playerid] == 6) ReqXP = 10;
- if(WeaponSkillLevel[playerid] == 7) ReqXP = 20;
- if(WeaponSkillLevel[playerid] == 8) ReqXP = 20;
- if(WeaponSkillLevel[playerid] == 9) ReqXP = 20;
- if(isnull(params))
- {
- format(gstr, sizeof(gstr),"You current weapon skill level is %i.",WeaponSkillLevel[playerid]);
- SendClientMessage(playerid,COLOR_ORANGE,gstr);
- format(gstr, sizeof(gstr),"A weapon skill level-up will cost you %i Experience Points. You currently have %i.",ReqXP,PlayerXP[playerid]);
- SendClientMessage(playerid,COLOR_ORANGE,gstr);
- SendClientMessage(playerid,COLOR_ORANGE,"To level-up now, type '/buyweaponskill confirm'");
- return true;
- }
- if(strcmp("confirm",params) == 0)
- {
- if(PlayerXP[playerid] < ReqXP) return SysMsg(playerid,"You don't have enough Experience Points to level up.");
- PlayerXP[playerid] -= ReqXP;
- if(WeaponSkillLevel[playerid] == 0)
- {
- WeaponSkillLevel[playerid] = 2;
- }
- else
- {
- WeaponSkillLevel[playerid]++;
- }
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET PlayerXP = %i, WeaponSkill = %i WHERE id = %i", PlayerXP[playerid], WeaponSkillLevel[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- new newSkill = WeaponSkillLevel[playerid] * 100;
- new SkillOneHand;
- if(newSkill > 999)
- {
- newSkill = 999;
- SkillOneHand = 900;
- }
- SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, newSkill-10);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, SkillOneHand);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, SkillOneHand);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, newSkill);
- format(gstr, sizeof(gstr),"Congratulations! Your weapon skill is now level %i! Requiring %i Experience Points.",WeaponSkillLevel[playerid],ReqXP);
- SendClientMessage(playerid,COLOR_ORANGE,gstr);
- if(WeaponSkillLevel[playerid] == 10)
- {
- PlayerXP[playerid] += 50;
- MySQLUpdateInt(SQLID[playerid], "PlayerXP", PlayerXP[playerid], "players");
- SendClientMessage(playerid,COLOR_PINK," >> Weapon Skill Maxed Out! (+50 Experience Points)");
- UnlockAchievement(playerid,14);
- }
- return true;
- }
- return true;
- }
- CMD:inventory(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in.");
- if(isnull(params)) ShowPlayerInventory(playerid, playerid);
- else
- {
- if(!IsPlayerAdminLevelOK(playerid, 1)) return ShowPlayerInventory(playerid, playerid);
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /inventory [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- ShowPlayerInventory(playa, playerid);
- }
- return true;
- }
- CMD:give(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in.");
- new playa = -1, itemname[25], itemamount[45], amount, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]s[25]S()[45]", name, itemname, itemamount))
- {
- SysMsg(playerid,"Usage: /give [player id or name] [item] [Optional: quantity/name]");
- SysMsg(playerid,"Items: Rod, Bait, Dice, Weapon, Radio, FuelCan, Watch, Lighter, Cigarette, GPS");
- SysMsg(playerid,"Weed, Cocaine, Moonshine, Bong, RollingPaper, Medkit, WeedSeed, Water, Oil");
- return true;
- }
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(!Logged{playa}) return SysMsg(playerid,"They must be logged in.");
- if(playa == playerid) return SysMsg(playerid,"You can't give this to yourself.");
- new Float:Pos[3];
- GetPlayerPos(playa, Pos[0], Pos[1], Pos[2]);
- if(!IsPlayerInRangeOfPoint(playerid, 3.5, Pos[0], Pos[1], Pos[2])) return SysMsg(playerid,"You must be close to the player to give them something.");
- if(strcmp("Rod",itemname,true) == 0)
- {
- if(Inventory[playerid][FishingRod] == 0) return SysMsg(playerid,"You don't have a Fishing Rod to give away.");
- if(Inventory[playa][FishingRod] == 1 && FishingRodHealth[playa] != 0) return SysMsg(playerid,"That player already has a Fishing Rod.");
- Inventory[playerid][FishingRod] = 0;
- Inventory[playa][FishingRod] = 1;
- MySQLUpdateInt(SQLID[playerid], "FishingRod", Inventory[playerid][FishingRod], "players");
- MySQLUpdateInt(SQLID[playa], "FishingRod", Inventory[playa][FishingRod], "players");
- format(gstr, sizeof(gstr), "You gave %s your Rod.", NameRP(playa));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "%s gave you their Rod.", NameRP(playerid));
- SendClientMessage(playa, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "* %s hands a Fishing Rod over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("Bait",itemname,true) == 0)
- {
- if(Inventory[playerid][FishingBait] == 0) return SysMsg(playerid,"You don't have a Fishing Bait to give away.");
- if(sscanf(params, "us[25]s[45]", playa, itemname, itemamount)) return SysMsg(playerid,"Usage: /give [player id or name] Bait [amount of Bait]");
- amount = strval(itemamount);
- if(amount < 1 || amount > Inventory[playerid][FishingBait]) return SysMsg(playerid,"That amount was invalid. (1 to your amount only)");
- Inventory[playerid][FishingBait] -= amount;
- Inventory[playa][FishingBait] += amount;
- MySQLUpdateInt(SQLID[playerid], "FishingBait", Inventory[playerid][FishingBait], "players");
- MySQLUpdateInt(SQLID[playa], "FishingBait", Inventory[playa][FishingBait], "players");
- format(gstr, sizeof(gstr), "You gave %s %i fishing bait. You now have %i left.", NameRP(playa), amount, Inventory[playerid][FishingBait]);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "%s gave you %i fishing bait. You now have %i left.", NameRP(playerid), amount, Inventory[playa][FishingBait]);
- SendClientMessage(playa, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "* %s hands some Fishing Bait over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("Dice",itemname,true) == 0)
- {
- if(Inventory[playerid][Dice] == 0) return SysMsg(playerid,"You don't have any dice to give away.");
- if(Inventory[playa][Dice] == 1) return SysMsg(playerid,"That player already has dice.");
- Inventory[playerid][Dice] = 0;
- Inventory[playa][Dice] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasDice", Inventory[playerid][Dice], "players");
- MySQLUpdateInt(SQLID[playa], "HasDice", Inventory[playa][Dice], "players");
- format(gstr, sizeof(gstr), "You gave %s your dice.", NameRP(playa));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "%s gave you their dice.", NameRP(playerid));
- SendClientMessage(playa, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "* %s hands dice over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("Radio",itemname,true) == 0)
- {
- if(Inventory[playerid][Radio] == 0) return SysMsg(playerid,"You don't have a Radio to give away.");
- if(Inventory[playa][Radio] == 1) return SysMsg(playerid,"That player already has a Radio.");
- Inventory[playerid][Radio] = 0;
- Inventory[playa][Radio] = 1;
- RadioPoweredOn[playa] = 0;
- RadioFrequency[playa] = 1000;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET HasRadio = %i, RadioFrequency = %i, RadioPower = %i WHERE id = %i", Inventory[playa][Radio], RadioFrequency[playa], RadioPoweredOn[playa], SQLID[playa]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_WHITE, "You gave %s your Radio.", NameRP(playa));
- SendClientMessageF(playa, COLOR_WHITE, "%s gave you their Radio.", NameRP(playerid));
- format(gstr, sizeof(gstr), "* %s hands a Radio over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("Watch",itemname,true) == 0)
- {
- if(Inventory[playerid][Watch] == 0) return SysMsg(playerid,"You don't have a Watch to give away.");
- if(Inventory[playa][Watch] == 1) return SysMsg(playerid,"That player already has a Watch.");
- Inventory[playerid][Watch] = 0;
- Inventory[playa][Watch] = 1;
- TextDrawHideForPlayer(playerid, TimeText);
- TextDrawHideForPlayer(playerid, TimeText24);
- TimeIsDisplayed{playerid} = false;
- MySQLUpdateInt(SQLID[playerid], "HasWatch", Inventory[playerid][Watch], "players");
- MySQLUpdateInt(SQLID[playa], "HasWatch", Inventory[playa][Watch], "players");
- format(gstr, sizeof(gstr), "You gave %s your Watch.", NameRP(playa));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "%s gave you their Watch.", NameRP(playerid));
- SendClientMessage(playa, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "* %s hands a Watch over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("FuelCan",itemname,true) == 0)
- {
- if(Inventory[playerid][FuelCan][0] == -1) return SysMsg(playerid,"You don't have a Fuel Can to give away.");
- if(Inventory[playa][FuelCan][0] >= 0) return SysMsg(playerid,"That player already has a Fuel Can.");
- Inventory[playa][FuelCan][0] = Inventory[playerid][FuelCan][0];
- Inventory[playa][FuelCan][1] = Inventory[playerid][FuelCan][1];
- Inventory[playerid][FuelCan][0] = 0;
- Inventory[playerid][FuelCan][1] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET HasFuelCan = %i, HasFuelCanType = %i WHERE id = %i", Inventory[playerid][FuelCan][0], Inventory[playerid][FuelCan][1], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET HasFuelCan = %i, HasFuelCanType = %i WHERE id = %i", Inventory[playa][FuelCan][0], Inventory[playa][FuelCan][1], SQLID[playa]);
- mysql_pquery(conn, mquery);
- format(gstr, sizeof(gstr), "You gave %s your fuel can.", NameRP(playa));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "%s gave you their fuel can.", NameRP(playerid));
- SendClientMessage(playa, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "* %s hands a Fuel Can over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("Phone",itemname, true) == 0)
- {
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid, "You do not have a phone to give to anybody.");
- if(IsPhoneRinging[playerid] == 1) return SysMsg(playerid,"You cannot store your phone while it is ringing.");
- if(CallerID[playerid] != -1 || CallerService[playerid] != -1) return SysMsg(playerid,"You cannot store your phone while you are using it.");
- if(Inventory[playa][MobilePhone] == 1) return SysMsg(playerid, "This player already has a phone.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhonePossessor = %i WHERE id = %i", SQLID[playa], PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_WHITE, "You gave %s your phone.", NameRP(playa));
- SendClientMessageF(playa, COLOR_WHITE, "%s gave you their phone.", NameRP(playerid));
- format(gstr, sizeof(gstr), "* %s hands a phone over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM phones WHERE id = %i AND PhonePossession = 1", PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery, "LoadPlayerPhone", "d", playa);
- ClearPhoneData(playerid);
- }
- if(strcmp("weapon",itemname,true) == 0 || strcmp("gun",itemname,true) == 0)
- {
- if(GetPlayerVehicleID(playerid) > 0) return SysMsg(playerid,"(( Please don't give weapons inside vehicles. ))");
- if(GetPlayerVehicleID(playa) > 0) return SysMsg(playerid,"(( Please don't give weapons to people inside vehicles. ))");
- if(sscanf(params, "us[25]s[30]", playa, itemname, itemamount)) return SysMsg(playerid,"Usage: /give [player id or name] Gun [name of gun]");
- new wid = GetWeaponIdFromName(itemamount);
- if(wid == -1) return SysMsg(playerid,"Invalid Weapon Name.");
- if(wid < 1 || wid > 47) return SysMsg(playerid,"Invalid Weapon.");
- if(wid == 19 || wid == 20 || wid == 21) return SysMsg(playerid,"Invalid Weapon.");
- new Slot = GetWeaponSlot(wid);
- if(!WeaponCheck(playa, wid)) return SysMsg(playerid, "They can't hold that weapon.");
- if(WeaponData[playerid][Slot][Weapon] != wid) return SysMsg(playerid,"You don't have that weapon.");
- if(WeaponData[playa][Slot][Weapon] >= 1) return SysMsg(playerid,"The Receiver already has a weapon in that slot.");
- if(WeaponData[playerid][Slot][WeaponOrigin] == 3 && Faction[playerid] != Faction[playa]) return SysMsg(playerid, "You cannot give faction weapons to people outside of your faction.");
- TransferWeaponData(playerid, playa, Slot);
- SetPlayerArmedWeapon(playerid, 0);
- SyncPlayerWeapons(playerid);
- SyncPlayerWeapons(playa);
- SetPlayerArmedWeapon(playa, wid);
- SendClientMessageF(playerid, COLOR_WHITE, "You gave %s a %s.", NameRP(playa), GetWeaponNameFromID(wid));
- SendClientMessageF(playa, COLOR_WHITE, "%s gave you a %s.", NameRP(playerid), GetWeaponNameFromID(wid));
- format(gstr, sizeof(gstr), "* %s hands a weapon over to %s. *", NameRP(playerid), NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("drugs",itemname,true)==0) //drug comment
- {
- SetPVarInt(playerid, "giveDrugs", playa);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM drugs WHERE drugOwner = %d AND drugAmount > 0 AND drugOwnerType = 'P' LIMIT 20", SQLID[playerid]);
- mysql_pquery(conn, mquery, "GivePlayerDrugs", "ii", playerid, 0);
- }
- if(strcmp("ingredients",itemname,true) == 0)
- {
- SetPVarInt(playerid, "giveIngred", playa);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM ingredients WHERE ingOwner = %d AND ingAmount > 0 AND ingOwnerType = 'P' LIMIT 20", SQLID[playerid]);
- mysql_pquery(conn, mquery, "GivePlayerIngreds", "ii", playerid, 0);
- }
- if(strcmp("Lighter",itemname,true) == 0)
- {
- if(Inventory[playerid][Lighter] == 0) return SysMsg(playerid,"You don't have a Lighter to give away.");
- if(Inventory[playa][Lighter] >= 1) return SysMsg(playerid,"That player already has a Lighter.");
- Inventory[playa][Lighter] = Inventory[playerid][Lighter];
- Inventory[playerid][Lighter] = 0;
- MySQLUpdateInt(SQLID[playerid], "HasLighter", Inventory[playerid][Lighter], "players");
- MySQLUpdateInt(SQLID[playa], "HasLighter", Inventory[playa][Lighter], "players");
- format(gstr, sizeof(gstr), "You gave %s your Lighter.", NameRP(playa));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "%s gave you their Lighter.", NameRP(playerid));
- SendClientMessage(playa, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "* %s hands a Lighter over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("Cigarette",itemname,true) == 0)
- {
- if(Inventory[playerid][Fags] == 0) return SysMsg(playerid,"You don't have any Fags to give away.");
- if(sscanf(params, "us[25]s[45]", playa, itemname, itemamount)) return SysMsg(playerid,"Usage: /give [player id or name] Cigarette [amount of Cigarettes]");
- amount = strval(itemamount);
- if(amount < 1 || amount > Inventory[playerid][Fags]) return SysMsg(playerid,"That amount was invalid. (1 to your amount only)");
- Inventory[playerid][Fags] -= amount;
- Inventory[playa][Fags] += amount;
- MySQLUpdateInt(SQLID[playerid], "HasFags", Inventory[playerid][Fags], "players");
- MySQLUpdateInt(SQLID[playa], "HasFags", Inventory[playa][Fags], "players");
- SendClientMessageF(playerid, COLOR_WHITE, "You gave %s %i Cigarette(s). You now have %i.", NameRP(playa), amount, Inventory[playerid][Fags]);
- SendClientMessageF(playa, COLOR_WHITE, "%s gave you %i Cigarette(s). You now have %i.", NameRP(playerid), amount, Inventory[playa][Fags]);
- if(amount == 1)
- {
- format(gstr, sizeof(gstr), "* %s hands one Cigarette over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else
- {
- format(gstr, sizeof(gstr), "* %s hands a few Cigarettes over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- }
- if(strcmp("GPS",itemname,true) == 0)
- {
- if(Inventory[playerid][GPS] == 0) return SysMsg(playerid,"You don't have a GPS to give away.");
- if(Inventory[playa][GPS] == 1) return SysMsg(playerid,"That player already has a GPS.");
- Inventory[playerid][GPS] = 0;
- Inventory[playa][GPS] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasGPS", Inventory[playerid][GPS], "players");
- MySQLUpdateInt(SQLID[playa], "HasGPS", Inventory[playa][GPS], "players");
- format(gstr, sizeof(gstr), "You gave %s your GPS.", NameRP(playa));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "%s gave you their GPS.", NameRP(playerid));
- SendClientMessage(playa, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "* %s hands a GPS over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("Weed",itemname,true) == 0)
- {
- if(Inventory[playerid][Weed] == 0) return SysMsg(playerid,"You don't have any Weed to give away.");
- if(sscanf(params, "us[25]s[45]", playa, itemname, itemamount)) return SysMsg(playerid,"Usage: /give [player id or name] Weed [grams]");
- amount = strval(itemamount);
- if(amount < 1 || amount > Inventory[playerid][Weed]) return SysMsg(playerid,"That amount was invalid. (1 to your amount only)");
- if(amount + Inventory[playa][Weed] > DRUG_MAX_WEED) return SysMsgF(playerid, "Invalid amount, %s wouldnt be able to carry that much Weed. You can give a maximum of %i grams.", NameEx(playa), DRUG_MAX_WEED - Inventory[playa][Weed]);
- Inventory[playerid][Weed] -= amount;
- Inventory[playa][Weed] += amount;
- MySQLUpdateInt(SQLID[playerid], "Weed", Inventory[playerid][Weed], "players");
- MySQLUpdateInt(SQLID[playa], "Weed", Inventory[playa][Weed], "players");
- SendClientMessageF(playerid, COLOR_WHITE, "You gave %s %i grams of Weed. You have %i grams left.", NameRP(playa), amount, Inventory[playerid][Weed]);
- SendClientMessageF(playa, COLOR_WHITE, "%s gave you %i grams of Weed. You have %i grams left.", NameRP(playerid), amount, Inventory[playa][Weed]);
- format(gstr, sizeof(gstr), "* %s hands some Weed over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("Cocaine",itemname,true) == 0)
- {
- if(Inventory[playerid][Cocaine] == 0) return SysMsg(playerid,"You don't have any Cocaine to give away.");
- if(sscanf(params, "us[25]s[45]", playa, itemname, itemamount)) return SysMsg(playerid,"Usage: /give [player id or name] Cocaine [grams]");
- amount = strval(itemamount);
- if(amount < 1 || amount > Inventory[playerid][Cocaine]) return SysMsg(playerid,"That amount was invalid. (1 to your amount only)");
- if(amount + Inventory[playa][Cocaine] > DRUG_MAX_COCAINE) return SysMsgF(playerid, "Invalid amount, %s wouldnt be able to carry that much Cocaine. You can give a maximum of %i grams.", NameEx(playa), DRUG_MAX_COCAINE - Inventory[playa][Cocaine]);
- Inventory[playerid][Cocaine] -= amount;
- Inventory[playa][Cocaine] += amount;
- MySQLUpdateInt(SQLID[playerid], "Cocaine", Inventory[playerid][Cocaine], "players");
- MySQLUpdateInt(SQLID[playa], "Cocaine", Inventory[playa][Cocaine], "players");
- SendClientMessageF(playerid, COLOR_WHITE, "You gave %s %i grams of Cocaine. You have %i grams left.", NameRP(playa), amount, Inventory[playerid][Cocaine]);
- SendClientMessageF(playa, COLOR_WHITE, "%s gave you %i grams of Cocaine. You have %i grams left.", NameRP(playerid), amount, Inventory[playa][Cocaine]);
- format(gstr, sizeof(gstr), "* %s hands some Cocaine over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("MoonShine",itemname,true) == 0)
- {
- if(Inventory[playerid][MoonShine] == 0) return SysMsg(playerid,"You don't have any MoonShine to give away.");
- if(sscanf(params, "us[25]s[45]", playa, itemname, itemamount)) return SysMsg(playerid,"Usage: /give [player id or name] MoonShine [litres]");
- amount = strval(itemamount);
- if(amount < 1 || amount > Inventory[playerid][MoonShine]) return SysMsg(playerid,"That amount was invalid. (1 to your amount only)");
- if(amount + Inventory[playa][MoonShine] > DRUG_MAX_MOONSHINE) return SysMsgF(playerid, "Invalid amount, %s wouldnt be able to carry that much MoonShine. You can give a maximum of %i litres.", NameEx(playa), DRUG_MAX_MOONSHINE - Inventory[playa][MoonShine]);
- Inventory[playerid][MoonShine] -= amount;
- Inventory[playa][MoonShine] += amount;
- MySQLUpdateInt(SQLID[playerid], "MoonShine", Inventory[playerid][MoonShine], "players");
- MySQLUpdateInt(SQLID[playa], "MoonShine", Inventory[playa][MoonShine], "players");
- SendClientMessageF(playerid, COLOR_WHITE, "You gave %s %i grams of MoonShine. You have %i grams left.", NameRP(playa), amount, Inventory[playerid][MoonShine]);
- SendClientMessageF(playa, COLOR_WHITE, "%s gave you %i grams of MoonShine. You have %i grams left.", NameRP(playerid), amount, Inventory[playa][MoonShine]);
- format(gstr, sizeof(gstr), "* %s hands some MoonShine over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("Bong",itemname,true) == 0)
- {
- if(Inventory[playerid][Bong] == 0) return SysMsg(playerid,"You don't have a Bong to give away.");
- if(Inventory[playa][Bong] == 1) return SysMsg(playerid,"That player already has a bong.");
- Inventory[playerid][Bong] = 0;
- Inventory[playa][Bong] = 1;
- MySQLUpdateInt(SQLID[playerid], "Bong", Inventory[playerid][Bong], "players");
- MySQLUpdateInt(SQLID[playa], "Bong", Inventory[playa][Bong], "players");
- SendClientMessageF(playerid, COLOR_WHITE, "You gave %s your bong.", NameRP(playa));
- SendClientMessageF(playa, COLOR_WHITE, "%s gave you a bong.", NameRP(playerid));
- format(gstr, sizeof(gstr), "* %s hands a bong over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("RollingPaper",itemname,true) == 0)
- {
- if(Inventory[playerid][RollingPaper] == 0) return SysMsg(playerid,"You don't have any Rolling Papers to give away.");
- if(sscanf(params, "us[25]s[45]", playa, itemname, itemamount)) return SysMsg(playerid,"Usage: /give [player id or name] RollingPaper [amount]");
- amount = strval(itemamount);
- if(amount < 1 || amount > Inventory[playerid][RollingPaper]) return SysMsg(playerid,"That amount was invalid. (1 to your amount only)");
- if(Inventory[playa][RollingPaper] + amount > MAX_ROLLINGPAPER) return SysMsg(playerid, "That player can't have that many Rolling Papers.");
- Inventory[playerid][RollingPaper] -= amount;
- Inventory[playa][RollingPaper] += amount;
- MySQLUpdateInt(SQLID[playerid], "RollingPaper", Inventory[playerid][RollingPaper], "players");
- MySQLUpdateInt(SQLID[playa], "RollingPaper", Inventory[playa][RollingPaper], "players");
- format(gstr, sizeof(gstr), "You gave %s %i Rolling Papers. You now have %i.", NameRP(playa), amount, Inventory[playerid][RollingPaper]);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "%s gave you %i Rolling Papers. You now have %i.", NameRP(playerid), amount, Inventory[playa][RollingPaper]);
- SendClientMessage(playa, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "* %s hands some Rolling Papers over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("MedKit",itemname,true) == 0)
- {
- if(Inventory[playerid][MedKit] == 0) return SysMsg(playerid,"You don't have a Med Kit to give away.");
- if(Inventory[playa][MedKit] == 1) return SysMsg(playerid,"That player already has a Med Kit.");
- Inventory[playa][MedKit] = 1;
- Inventory[playerid][MedKit] = 0;
- MySQLUpdateInt(SQLID[playerid], "HasMedKit", Inventory[playerid][MedKit], "players");
- MySQLUpdateInt(SQLID[playa], "HasMedKit", Inventory[playa][MedKit], "players");
- format(gstr, sizeof(gstr), "You gave %s your Med Kit.", NameRP(playa));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "%s gave you their Med Kit.", NameRP(playerid));
- SendClientMessage(playa, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "* %s hands a First Aid Kit over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("WeedSeed",itemname,true) == 0)
- {
- if(Inventory[playerid][WeedSeed] == 0) return SysMsg(playerid,"You don't have any Weed Seeds to give away.");
- if(sscanf(params, "us[25]s[45]", playa, itemname, itemamount)) return SysMsg(playerid,"Usage: /give [player id or name] WeedSeed [amount]");
- amount = strval(itemamount);
- if(amount < 1 || amount > Inventory[playerid][WeedSeed]) return SysMsg(playerid,"That amount was invalid. (1 to your amount only)");
- if(Inventory[playa][WeedSeed] + amount > MAX_WEEDSEED) return SysMsg(playerid, "That player can't have that many Weed SeedS.");
- if(PlayerLevel[playa] < 5) return SysMsg(playerid, "Players need to be at least level 5 in order to have this item.");
- Inventory[playerid][WeedSeed] -= amount;
- Inventory[playa][WeedSeed] += amount;
- MySQLUpdateInt(SQLID[playerid], "HasWeedSeed", Inventory[playerid][WeedSeed], "players");
- MySQLUpdateInt(SQLID[playa], "HasWeedSeed", Inventory[playa][WeedSeed], "players");
- SendClientMessageF(playerid, COLOR_WHITE, "You gave %s %i Weed Seed(s). You now have %i.", NameRP(playa), amount, Inventory[playerid][WeedSeed]);
- SendClientMessageF(playa, COLOR_WHITE, "%s gave you %i Weed Seed(s). You now have %i.", NameRP(playerid), amount, Inventory[playa][WeedSeed]);
- format(sgstr, sizeof(sgstr), "* %s hands a small packet over to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(strcmp("Oil", itemname, true) == 0)
- {
- if(Inventory[playerid][EngineOil] == 0) return SysMsg(playerid, "You do not have any engine oil.");
- if(Inventory[playa][EngineOil] == 1) return SysMsg(playerid, "They already have engine oil.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET HasEngineOil = 0 WHERE id = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET HasEngineOil = 1 WHERE id = %i", SQLID[playa]);
- mysql_pquery(conn, mquery);
- Inventory[playerid][EngineOil] = 0;
- Inventory[playa][EngineOil] = 1;
- SendClientMessageF(playerid, COLOR_WHITE, "You have given %s your engine oil.", NameRP(playa));
- SendClientMessageF(playa, COLOR_WHITE, "%s has given you some engine oil.", NameRP(playerid));
- format(sgstr, sizeof(sgstr), "* %s gives %s some engine oil. *", NameRP(playerid), NameRP(playa));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- return true;
- }
- CMD:drop(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in.");
- if(GetPlayerVehicleID(playerid) > 0) return SysMsg(playerid,"You may not use this in a vehicle.");
- new itemname[30], amount[50];
- if(sscanf(params, "s[20]S()[50]", itemname, amount))
- {
- SysMsg(playerid,"Usage: /drop [item]");
- SysMsg(playerid,"Items: Weapon, Weed, Cocaine, Moonshine, Clothes, Phone");
- return true;
- }
- if(strcmp("Weapon",itemname,true) == 0)
- {
- if(DeathTimer[playerid] == 0 && Dead{playerid}) return SysMsg(playerid, "You cannot drop weapons when you are dead.");
- new wCount = 0;
- for(new w = 0; w < MAX_TOTAL_WEAPONS; w++)
- {
- if(WeaponData[playerid][w][Weapon] > 0)
- {
- wCount ++;
- }
- }
- if(!wCount) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have no weapons to drop.");
- new wid = GetPlayerWeapon(playerid);
- if(wid == 0) return SysMsg(playerid,"You need to be holding the weapon to drop it.");
- if(wid < 1 || wid > 47) return SysMsg(playerid,"You can't drop this weapon.");
- if(wid == 19 || wid == 20 || wid == 21) return SysMsg(playerid,"You can't drop this weapon.");
- new Slot = GetWeaponSlot(wid);
- if(WeaponData[playerid][Slot][Weapon] != wid) return SysMsg(playerid,"You don't have that weapon.");
- if(WeaponData[playerid][Slot][WeaponOrigin] == 3) return SysMsg(playerid, "You cannot drop faction weapons.");
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- DropGun(playerid, 1, WeaponData[playerid][Slot][Weapon], WeaponData[playerid][Slot][WeaponAmmo], X, Y, Z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
- SendClientMessage(playerid, COLOR_WHITE, "You dropped your weapon on the ground. It can be picked up with /pickupitem.");
- format(sgstr, sizeof(sgstr), "* %s places a weapon on the ground. *", NameRP(playerid));
- SetPlayerChatBubble(playerid, sgstr, COLOR_EMOTE, 20, 7000);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET WeaponPossession = 0, OwnerSQLID = 0, WeaponAmmo = %i, Dropped = 1 WHERE id = %i", WeaponData[playerid][Slot][WeaponAmmo], WeaponData[playerid][Slot][WeaponID]);
- mysql_pquery(conn, mquery);
- ResetWeaponVariables(playerid, 0, Slot);
- SetPlayerArmedWeapon(playerid, 0);
- SyncPlayerWeapons(playerid);
- OnePlayAnim(playerid,"CARRY","putdwn",4,0,0,0,0,0);
- return true;
- }
- else if(strcmp("Weed",itemname,true) == 0)
- {
- if(Inventory[playerid][Weed] == 0) return SysMsg(playerid, "You don't have any weed to drop.");
- new Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- new virtw = GetPlayerVirtualWorld(playerid);
- DropGun(playerid, 2, 1575, Inventory[playerid][Weed], Pos[0], Pos[1], Pos[2], virtw, GetPlayerInterior(playerid));
- Inventory[playerid][Weed] = 0;
- MySQLUpdateInt(SQLID[playerid], "Weed", 0, "players");
- format(gstr, sizeof(gstr), "* %s drops some Weed. *", NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else if(strcmp("MoonShine",itemname,true) == 0)
- {
- if(Inventory[playerid][MoonShine] == 0) return SysMsg(playerid, "You don't have any Moonshine to drop.");
- new Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- DropGun(playerid, 3, 1950, Inventory[playerid][MoonShine], Pos[0], Pos[1], Pos[2]+0.4, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
- Inventory[playerid][MoonShine] = 0;
- MySQLUpdateInt(SQLID[playerid], "MoonShine", 0, "players");
- format(gstr, sizeof(gstr), "* %s drops some MoonShine. *", NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- OnePlayAnim(playerid,"CARRY","putdwn",4,0,0,0,0,0);
- return true;
- }
- else if(strcmp("Cocaine",itemname,true) == 0)
- {
- if(Inventory[playerid][Cocaine] == 0) return SysMsg(playerid, "You don't have any Cocaine to drop.");
- new Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- new virtw = GetPlayerVirtualWorld(playerid);
- DropGun(playerid, 4, 1577, Inventory[playerid][Cocaine], Pos[0], Pos[1], Pos[2], virtw, GetPlayerInterior(playerid));
- Inventory[playerid][Cocaine] = 0;
- MySQLUpdateInt(SQLID[playerid], "Cocaine", 0, "players");
- format(gstr, sizeof(gstr), "* %s drops some Cocaine. *", NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- OnePlayAnim(playerid,"CARRY","putdwn",4,0,0,0,0,0);
- return true;
- }
- else if(strcmp("Clothes",itemname,true) == 0)
- {
- if(sscanf(params, "s[20]s[50]", itemname, amount)) return SysMsg(playerid, "Usage: /drop [Clothes] [Slot]");
- new slot = strval(amount);
- if(slot < 1 || slot > 5) return SysMsg(playerid, "Slot must be from 1 to 5.");
- slot --;
- if(Clothes[playerid][slot] == 0) return SysMsg(playerid, "You have no clothes in that slot.");
- if(Clothes[playerid][slot] == cPlayersSkin[playerid]) return SysMsg(playerid, "You can't drop the clothes you are wearing.");
- Clothes[playerid][slot] = 0;
- slot ++;
- new str[10];
- format(str,sizeof(str),"SkinSet%i",slot);
- MySQLUpdateInt(SQLID[playerid], str, Clothes[playerid][slot-1], "players");
- format(gstr, sizeof(gstr), "You dropped the clothes in slot %i.", slot);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "* %s drops some clothes. *", NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- OnePlayAnim(playerid,"CARRY","putdwn",4,0,0,0,0,0);
- return true;
- }
- else if(strcmp("phone", itemname, true) == 0)
- {
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid, "You have no phone to drop.");
- if(IsPhoneRinging[playerid] == 1) return SysMsg(playerid,"You cannot drop your phone while it is ringing.");
- if(CallerID[playerid] != -1 || CallerService[playerid] != -1) return SysMsg(playerid,"You cannot drop your phone while you are using it.");
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- Inventory[playerid][MobilePhone] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhonePossessor = 0, PhonePossession = 0 WHERE id = %i", PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, COLOR_WHITE, "You have dropped your phone. Anybody can now pick it up.");
- format(gstr, sizeof(gstr), "* %s drops a phone. *", NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- DropGun(playerid, 6, 330, 1, X, Y, Z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
- OnePlayAnim(playerid,"CARRY","putdwn",4,0,0,0,0,0);
- return true;
- }
- return true;
- }
- CMD:pickupitem(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in.");
- for(new i = 0; i < MAX_GUNS; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, WeaponDrop[i][wX], WeaponDrop[i][wY], WeaponDrop[i][wZ]))
- {
- if(GetPlayerVirtualWorld(playerid) == WeaponDrop[i][DropvWorld] && GetPlayerInterior(playerid) == WeaponDrop[i][DropInt])
- {
- if(WeaponDrop[i][Type] == 2)
- {
- Inventory[playerid][Weed] += WeaponDrop[i][DropAmmo];
- WeaponDrop[i][wX] = 0.0;
- WeaponDrop[i][wY] = 0.0;
- WeaponDrop[i][wZ] = 0.0;
- WeaponDrop[i][DropModel] = 0;
- WeaponDrop[i][DropAmmo] = 0;
- WeaponDrop[i][DropvWorld] = 0;
- WeaponDrop[i][DropInt] = 0;
- WeaponDrop[i][gSpawned] = 0;
- OnePlayAnim(playerid, "CARRY", "liftup", 4,0,0,0,0,0);
- DestroyDynamicObjectEx(DropObject[i], "DropObject[i]");
- DropObject[i] = INVALID_OBJECT_ID;
- SendClientMessage(playerid, COLOR_WHITE, "You picked up a pack of weed from the ground.");
- break;
- }
- else if(WeaponDrop[i][Type] == 3)
- {
- Inventory[playerid][MoonShine] += WeaponDrop[i][DropAmmo];
- WeaponDrop[i][wX] = 0.0;
- WeaponDrop[i][wY] = 0.0;
- WeaponDrop[i][wZ] = 0.0;
- WeaponDrop[i][DropModel] = 0;
- WeaponDrop[i][DropAmmo] = 0;
- WeaponDrop[i][DropvWorld] = 0;
- WeaponDrop[i][DropInt] = 0;
- WeaponDrop[i][gSpawned] = 0;
- OnePlayAnim(playerid, "CARRY", "liftup", 4,0,0,0,0,0);
- DestroyDynamicObjectEx(DropObject[i], "DropObject[i]");
- SendClientMessage(playerid, COLOR_WHITE, "You picked up a bottle of moonshine from the ground.");
- break;
- }
- else if(WeaponDrop[i][Type] == 4)
- {
- Inventory[playerid][Cocaine] += WeaponDrop[i][DropAmmo];
- WeaponDrop[i][wX] = 0.0;
- WeaponDrop[i][wY] = 0.0;
- WeaponDrop[i][wZ] = 0.0;
- WeaponDrop[i][DropModel] = 0;
- WeaponDrop[i][DropAmmo] = 0;
- WeaponDrop[i][DropvWorld] = 0;
- WeaponDrop[i][DropInt] = 0;
- WeaponDrop[i][gSpawned] = 0;
- OnePlayAnim(playerid, "CARRY", "liftup", 4,0,0,0,0,0);
- DestroyDynamicObjectEx(DropObject[i], "DropObject[i]");
- DropObject[i] = INVALID_OBJECT_ID;
- SendClientMessage(playerid, COLOR_WHITE, "You picked up a pack of cocaine from the ground.");
- break;
- }
- else if(WeaponDrop[i][Type] == 6)
- {
- if(Inventory[playerid][MobilePhone] == 1) return SysMsg(playerid, "You already have a mobile phone.");
- WeaponDrop[i][wX] = 0.0;
- WeaponDrop[i][wY] = 0.0;
- WeaponDrop[i][wZ] = 0.0;
- WeaponDrop[i][DropModel] = 0;
- WeaponDrop[i][DropAmmo] = 0;
- WeaponDrop[i][DropvWorld] = 0;
- WeaponDrop[i][DropInt] = 0;
- WeaponDrop[i][gSpawned] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhonePossessor = %i, PhonePossession = 1 WHERE id = %i", SQLID[playerid], WeaponDrop[i][PhoneID]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM phones WHERE id = %i", WeaponDrop[i][PhoneID]);
- mysql_pquery(conn, mquery, "LoadPlayerPhone", "d", playerid);
- WeaponDrop[i][PhoneID] = 0;
- WeaponDrop[i][DropPhoneNumber] = 0;
- WeaponDrop[i][DropPhonePower] = 0;
- OnePlayAnim(playerid, "CARRY", "liftup", 4,0,0,0,0,0);
- DestroyDynamicObjectEx(DropObject[i], "DropObject[i]");
- DropObject[i] = INVALID_OBJECT_ID;
- SendClientMessage(playerid, COLOR_WHITE, "You have picked up a phone from the ground. Use /pinfo to see the phone's information");
- }
- else if(WeaponDrop[i][Type] == 1)
- {
- if(!IsPlayerAdmin(playerid) && IsBanWeapon(WeaponDrop[i][DropModel])) return SysMsg(playerid, "You may not pick up this weapon.");
- if(GetFreeWeaponObjectIndex(playerid) == -1) return SysMsg(playerid, "You can't carry another weapon right now.");
- if(WeaponDrop[i][DropModel] == 14) UnlockAchievement(playerid, 48);
- if(!WeaponCheck(playerid, WeaponDrop[i][DropModel])) return SysMsg(playerid, "You cannot get this weapon. You either have two sidearms or one primary weapon plus a sidearm on your person.");
- if(WeaponData[playerid][GetWeaponSlot(WeaponDrop[i][DropModel])][Weapon] != 0) return SysMsg(playerid, "You are already carrying a weapon of this type.");
- new slot = GetWeaponSlot(WeaponDrop[i][DropModel]);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM weapons WHERE id = %i", WeaponDrop[i][DropWeaponID]);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows())
- {
- WeaponData[playerid][slot][WeaponID] = cache_get_field_content_int(0, "id");
- WeaponData[playerid][slot][WeaponTimestamp] = cache_get_field_content_int(0, "Timestamp");
- WeaponData[playerid][slot][wCreatorSQLID] = cache_get_field_content_int(0, "CreatorSQLID");
- WeaponData[playerid][slot][Weapon] = cache_get_field_content_int(0, "WeaponID");
- WeaponData[playerid][slot][wOwnerSQLID] = cache_get_field_content_int(0, "OwnerSQLID");
- WeaponData[playerid][slot][WeaponAmmo] = cache_get_field_content_int(0, "WeaponAmmo");
- WeaponData[playerid][slot][WeaponType] = GetWeaponType(WeaponData[playerid][slot][Weapon]);
- WeaponData[playerid][slot][WeaponOrigin] = cache_get_field_content_int(0, "WeaponOrigin");
- WeaponData[playerid][slot][WeaponPossession] = cache_get_field_content_int(0, "WeaponPossession");
- }
- cache_delete(result);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET OwnerSQLID = %i, WeaponPossession = 1, Dropped = 0 WHERE id = %i", SQLID[playerid], WeaponData[playerid][slot][WeaponID]);
- mysql_pquery(conn, mquery);
- WeaponDrop[i][wX] = 0.0;
- WeaponDrop[i][wY] = 0.0;
- WeaponDrop[i][wZ] = 0.0;
- WeaponDrop[i][DropModel] = 0;
- WeaponDrop[i][DropWeaponID] = 0;
- WeaponDrop[i][DropAmmo] = 0;
- WeaponDrop[i][DropvWorld] = 0;
- WeaponDrop[i][DropInt] = 0;
- WeaponDrop[i][gSpawned] = 0;
- SyncPlayerWeapons(playerid);
- OnePlayAnim(playerid, "CARRY", "liftup", 4,0,0,0,0,0);
- DestroyDynamicObjectEx(DropObject[i], "DropObject[i]");
- DropObject[i] = INVALID_OBJECT_ID;
- SendClientMessageF(playerid, COLOR_WHITE, "You picked up %s from the ground.", weaponstring[WeaponData[playerid][slot][Weapon]]);
- break;
- }
- }
- }
- }
- for(new d = 1; d < MAX_DRUGS; d++) //drug comment
- {
- if(DrugTakenData[d][effActive] == 2)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, DrugTakenData[d][drugPos][0], DrugTakenData[d][drugPos][1], DrugTakenData[d][drugPos][2] + 1.0))
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM drugs WHERE drugOwner = %d AND drugEffects = '%s' AND drugComedown = '%s' AND drugQuality = %d", SQLID[playerid], DrugTakenData[d][drugEffects], DrugTakenData[d][drugComedown], DrugTakenData[d][drugsQuality]);
- mysql_pquery(conn, mquery, "PickupDrug", "ii", playerid, d);
- break;
- }
- }
- }
- for(new d = 1; d < MAX_INGREDIENTS; d++)
- {
- if(IngredientsData[d][ingredPos][0] != 0.0 && IngredientsData[d][ingredPos][1] != 0.0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, IngredientsData[d][ingredPos][0], IngredientsData[d][ingredPos][1], IngredientsData[d][ingredPos][2] + 1.0))
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM ingredients WHERE ingOwner = %d AND ingType = %d", SQLID[playerid], IngredientsData[d][ingredType]);
- mysql_pquery(conn, mquery, "PickupIngredient", "ii", playerid, d);
- break;
- }
- }
- }
- for(new tein = 0; tein < sizeof(TestIngred); tein++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.5, TestIngred[tein][tePos][0], TestIngred[tein][tePos][1], TestIngred[tein][tePos][2]))
- {
- SendClientMessageF(playerid, COLOR_YELLOW, "You have picked up 20 %s's up off the floor for testing purposes.", IngredName[TestIngred[tein][teDrugType]]);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM ingredients WHERE ingOwner = %d AND ingType = %d", SQLID[playerid], TestIngred[tein][teDrugType]);
- mysql_pquery(conn, mquery, "PickupTestIngredient", "dd", playerid, TestIngred[tein][teDrugType]);
- break;
- }
- }
- return true;
- }
- CMD:charity(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return SysMsg(playerid,"/charity [amount]");
- new amount = strval(params);
- if(amount < 1 || amount > Cash[playerid]) return SysMsg(playerid,"Amount must be between 1 and your cash in hand.");
- GivePlayerCash(playerid, -amount);
- MySQLUpdateInt(SQLID[playerid], "Cash", amount, "players");
- LotteryJackpot += amount;
- if(amount > 999) UnlockAchievement(playerid, 40);
- SendClientMessageF(playerid, COLOR_PINK, "You gave away $%s of your money. The money has been put into the next Lottery /Jackpot.", format_cash(amount));
- format(gstr, sizeof(gstr),"[%s] %s(%i) puts $%i to charity. (Total: $%i)", GetServerTimeString(), NameEx(playerid), playerid, amount, Cash[playerid]);
- return true;
- }
- CMD:jackpot(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- SendClientMessageF(playerid, COLOR_PINK, "Lottery Jackpot: {FFFFFF}$%s", format_cash(LotteryJackpot));
- if(LotteryNumber[playerid] != -1) SendClientMessageF(playerid, COLOR_PINK, "Your ticket number for the next draw is {FFFFFF}%i.", LotteryNumber[playerid]);
- else SendClientMessage(playerid, COLOR_PINK, "You have not been entered for the next draw.");
- return true;
- }
- CMD:destroycash(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid, "You must be logged in.");
- if(Cash[playerid] < 0) return SysMsg(playerid, "You must have money in hand to use this command.");
- new monies, conf[12];
- if(sscanf(params, "iS()[12]", monies, conf)) return SysMsg(playerid, "Usage: /destroycash [amount] *THIS WILL DELETE ANY SPECIFIED AMOUNT OF MONEY ON HAND FROM THE SERVER PERMANENTLY AND CANNOT BE UNDONE.*");
- if(isnull(conf)) return SendClientMessageF(playerid, COLOR_WHITE, "Using this command will delete $%s from your on hand cash. Type /destroycash %i confirm to continue.", format_cash(monies), monies);
- if(strmatch(conf, "confirm") && monies >= 1)
- {
- if(Cash[playerid] - monies < 0) return SysMsg(playerid, "Subtracting this much money from your in hand cash would put you into a negative balance.");
- GivePlayerCash(playerid, -monies);
- SendClientMessageF(playerid, COLOR_WHITE, "You have sent $%s into the void.", format_cash(monies));
- return true;
- }
- return true;
- }
- CMD:hesoyam(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- UnlockAchievement(playerid, 26);
- return true;
- }
- CMD:hegebe(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- UnlockAchievement(playerid, 60);
- return true;
- }
- CMD:nametags(playerid, params[])
- {
- if(nameshidden[playerid] == 0)
- {
- foreach(new i: Player) ShowPlayerNameTagForPlayer(playerid, i, false);
- nameshidden[playerid] = 1;
- SysMsg(playerid,"You have now disabled player name tags; please use /nametags to re-enable them.");
- }
- else
- {
- foreach(new i: Player) if(!MaskHideName{i}) ShowPlayerNameTagForPlayer(playerid, i, true);
- nameshidden[playerid] = 0;
- SysMsg(playerid,"You have now enabled player name tags; please use /nametags to disable them.");
- }
- return true;
- }
- CMD:me(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return SysMsg(playerid,"Usage: /me [action]");
- new Float:radius = 20.0, occupants;
- if(IsInHouseID[playerid] != -1) occupants = HouseData[IsInHouseID[playerid]][HouseOccupants];
- else if(IsInBizzID[playerid] != -1) occupants = BizzData[IsInBizzID[playerid]][BizzOccupants];
- if(occupants < 10) radius = 20.0;
- else if(occupants < 20) radius = 10.0;
- else radius = 5.0;
- format(gstr, sizeof(gstr),"%s %s", NameRP(playerid), params);
- ProxDetector(radius, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- totalmes ++;
- return true;
- }
- CMD:ame(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return SysMsg(playerid,"Usage: /ame [action]");
- SetPlayerChatBubble(playerid, params, COLOR_EMOTE, 15.0, 6000);
- SendClientMessageF(playerid, COLOR_EMOTE, "Annotated Message: %s", params);
- return true;
- }
- CMD:ame2(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return SysMsg(playerid,"Usage: /ame [action]");
- SetPlayerChatBubble(playerid, params, COLOR_EMOTE, 15.0, 6000);
- return true;
- }
- CMD:do(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return SysMsg(playerid,"Usage: /do [action]");
- new Float:radius = 20.0, occupants;
- if(IsInHouseID[playerid] != -1) occupants = HouseData[IsInHouseID[playerid]][HouseOccupants];
- else if(IsInBizzID[playerid] != -1) occupants = BizzData[IsInBizzID[playerid]][BizzOccupants];
- if(occupants < 10) radius = 20.0;
- else if(occupants < 20) radius = 10.0;
- else radius = 5.0;
- format(sgstr, sizeof(sgstr), "%s ((%s))", params, NameRP(playerid));
- ProxDetector(radius, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:attempt(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return SysMsg(playerid,"Usage: /attempt [action]");
- new success = random(50);
- if(success < 25) format(sgstr, sizeof(sgstr), "* %s has attempted to %s and succeeded. *", NameRP(playerid), params);
- else format(sgstr, sizeof(sgstr), "* %s has attempted to %s but failed. *", NameRP(playerid), params);
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:sdo(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerAdmin(playerid)) return false;
- if(isnull(params)) return SysMsg(playerid,"Usage: /sdo [action]");
- ProxDetector(20.0, playerid, params, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:accent(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return SysMsg(playerid,"Usage: /accent [Accent] - Example: 'Italian'. Use 'none' to remove accents.");
- if(strlen(params) > 11) return SysMsg(playerid,"Accent was too long (max 11 characters).");
- if(strlen(params) < 3) return SysMsg(playerid,"Accent was too short (min 3 characters).");
- if(strcmp("none", params, true) == 0)
- {
- if(UsingAccent[playerid] == 0) return SysMsg(playerid,"You do not have an accent.");
- Accent[playerid][0] = EOS;
- UsingAccent[playerid] = 0;
- MySQLUpdateString(SQLID[playerid], "Accent", Accent[playerid], "players");
- SendClientMessage(playerid, COLOR_WHITE, "You have removed your accent.");
- return true;
- }
- new acc[10]; format(acc, sizeof(acc), params);
- UsingAccent[playerid] = 1;
- format(Accent[playerid], 12, params);
- MySQLUpdateString(SQLID[playerid], "Accent", Accent[playerid], "players");
- SendClientMessageF(playerid, COLOR_WHITE, "Your accent is now: %s. Use '/accent none' to remove it.", Accent[playerid]);
- UnlockAchievement(playerid,25);
- return true;
- }
- CMD:appearance(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return SysMsg(playerid,"Usage: /appearance [description]");
- if(strlen(params) - 12 > 128) return SysMsg(playerid,"Please use a shorter appearance description.");
- if(strcmp(params, "none", true) == 0)
- {
- Appearance[playerid][0] = EOS;
- MySQLUpdateString(SQLID[playerid], "LooksLike", Appearance[playerid], "players");
- SendClientMessage(playerid, COLOR_WHITE, "Appearance description has been removed.");
- return true;
- }
- format(Appearance[playerid], 128, params);
- MySQLUpdateString(SQLID[playerid], "LooksLike", Appearance[playerid], "players");
- SendClientMessageF(playerid, COLOR_WHITE, "Your appearance is now: '%s'. Use '/appearance none' to remove it.", Appearance[playerid]);
- return true;
- }
- CMD:describe(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /describe [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(strlen(Appearance[playa]) == 0) return SysMsg(playerid,"Player has no description to see.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.0,tX,tY,tZ) && IsSpectating[playa] != -1) return SysMsg(playerid,"You must be close to the player.");
- format(gstr, sizeof(gstr), "* %s * (%s)", Appearance[playa], NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:checkid(playerid, params[])
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new v = GetPlayerVehicleID(playerid);
- if(VehicleData[v][VehicleOwnerSQLID] != 0)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "[Vehicle ID] %s - ID %i", GetVehicleName(v), VehicleData[v][VehSQLID]);
- return true;
- }
- if(FVehicleData[v][FactionVehID] == v)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "[Faction Vehicle ID] %s - ID %i, Creator: %s", GetVehicleName(v), FVehicleData[v][FVSQLID], GetSQLName(GetFactionVehicleCreator(FVehicleData[v][FVSQLID])));
- return true;
- }
- }
- for(new p = 0; p < MAX_SQLPICKUPS; p++)
- {
- if(IsPlayerInRangeOfPoint(playerid, DOOR_PROXIMITY, PickupData[p][Xpos], PickupData[p][Ypos], PickupData[p][Zpos]))
- {
- SendClientMessageF(playerid, COLOR_WHITE, "[Pickup ID] - ID %i", PickupData[p][PickupSQLID]);
- return true;
- }
- }
- for(new int = 0; int < MAX_INTERIORS; int++)
- {
- if(IsPlayerInRangeOfPoint(playerid, DOOR_PROXIMITY, Interiors[int][oPosX], Interiors[int][oPosY], Interiors[int][oPosZ]))
- {
- SendClientMessageF(playerid, COLOR_WHITE, "[Interior ID] ID %i", Interiors[int][interiorID]);
- return true;
- }
- }
- for(new b = 0; b < MAX_BIZZ; b++)
- {
- if(IsPlayerInRangeOfPoint(playerid, DOOR_PROXIMITY, BizzData[b][oPosX], BizzData[b][oPosY], BizzData[b][oPosZ]))
- {
- SendClientMessageF(playerid, COLOR_WHITE, "[Bizz ID] %s - ID %i", BizzData[b][BizzDescription], BizzData[b][BizzSQLID]);
- return true;
- }
- }
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, DOOR_PROXIMITY, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ]) && GetPlayerVirtualWorld(playerid) == HouseData[h][HouseExtVW])
- {
- SendClientMessageF(playerid, COLOR_WHITE, "[House ID] %s - ID %i", HouseData[h][HouseDescription], HouseData[h][HouseSQLID]);
- return true;
- }
- }
- for(new g = 0; g < MAX_GARAGES; g++)
- {
- if(IsPlayerInRangeOfPoint(playerid, DOOR_PROXIMITY, GarageData[g][oPosX], GarageData[g][oPosY], GarageData[g][oPosZ]) && GetPlayerVirtualWorld(playerid) == GarageData[g][oVirtualWorld])
- {
- SendClientMessageF(playerid, COLOR_WHITE, "[Garage ID] ID %i", GarageData[g][gID]);
- return true;
- }
- }
- SysMsg(playerid, "Couldn't find jack shit, yo.");
- return true;
- }
- CMD:getid(playerid, params[])
- {
- if(isnull(params)) return SysMsg(playerid,"Usage: /getid [part/full name of player]");
- if(strlen(params) < 3) return SysMsg(playerid,"Usage: /getid [part/full name of player]");
- new count = 0;
- foreach(new i: Player)
- {
- if(strfind(GetName(i), params, true) != -1)
- {
- count ++;
- SendClientMessageF(playerid, COLOR_WHITE, "%s - ID %i", NameEx(i), i);
- }
- }
- if(count == 0) SysMsg(playerid, "No players found with that name.");
- return true;
- }
- CMD:id(playerid, params[]) return cmd_getid(playerid, params);
- CMD:kill(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in.");
- if(Dead{playerid}) return SendClientMessage(playerid, COLOR_RED, "You are already dead.");
- if(IsJailed[playerid] == 1 || AdminJailData[playerid][0] == 1) return true;
- if(IsCuffed[playerid] == 1) return true;
- if(isnull(params))
- {
- SetPlayerHealthEx(playerid, 0.0);
- SetPlayerArmourEx(playerid, 0.0, 0);
- SetPlayerChatBubble(playerid, "(( Player used /kill ))", COLOR_ORANGE, 15.0, 5000);
- format(gstr, sizeof(gstr),"[Death] %s has used /kill", NameEx(playerid));
- AdminBroadcast(gstr, 1);
- }
- else
- {
- if(!IsPlayerAdminLevelOK(playerid, 3)) return SysMsg(playerid, AUTHMSG);
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /kill [playerid id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- SetPlayerHealthEx(playa,0.0);
- SetPlayerArmourEx(playa,0.0, 0);
- format(gstr, sizeof(gstr),"Admin %s has killed you.",NameEx(playerid));
- SendClientMessage(playa,COLOR_RED,gstr);
- format(gstr, sizeof(gstr),"You killed %s.",NameEx(playa));
- SendClientMessage(playerid,COLOR_LIGHTRED,gstr);
- format(gstr, sizeof(gstr),"[Death] Admin %s has killed %s ", NameEx(playerid), NameEx(playa));
- AdminBroadcast(gstr, 1);
- SetPlayerChatBubble(playa, "(( Admin /kill'ed this player ))", COLOR_ORANGE, 15.0, 5000);
- }
- return true;
- }
- CMD:time(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Watch] == 0) return SysMsg(playerid,"You don't have a watch.");
- new StNdRdTh[4], Year, Month, Day;
- getdate(Year, Month, Day);
- StNdRdTh = "th";
- if(Day == 1||Day == 21||Day == 31) StNdRdTh = "st";
- else if(Day == 2||Day == 22) StNdRdTh = "nd";
- else if(Day == 3||Day == 23) StNdRdTh = "rd";
- SysMsgF(playerid, "Current Time: %s, Todays Date: %i%s of %s %i", GetTimeString(), Day, StNdRdTh, GetMonthName(Month), gServerYear);
- format(gstr, sizeof(gstr),"* %s looks at their watch. *", NameRP(playerid));
- ProxDetector(10.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(!IsPlayerInAnyVehicle(playerid)) OnePlayAnim(playerid, "PLAYIDLES", "time", 3.0, 0, 0, 0, 0, 0);
- return true;
- }
- CMD:date(playerid, params[]) return cmd_time(playerid, params);
- CMD:showtime(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Watch] == 0) return SysMsg(playerid,"You don't have a watch.");
- if(TimeIsDisplayed{playerid} != 0)
- {
- TextDrawHideForPlayer(playerid, TimeText);
- TextDrawHideForPlayer(playerid, TimeText24);
- TimeIsDisplayed{playerid} = 0;
- SysMsg(playerid,"Time Display Hidden.");
- }
- else
- {
- if(isnull(params) || !IsNumeric(params)) return SysMsg(playerid, "Usage: /showtime [24/12]");
- if(strval(params) == 12) TextDrawShowForPlayer(playerid, TimeText);
- else if(strval(params) == 24) TextDrawShowForPlayer(playerid, TimeText24);
- TimeIsDisplayed{playerid} = true;
- SysMsg(playerid,"Time Display On.");
- }
- return true;
- }
- CMD:togpay(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!CheckReady{playerid}) return SysMsg(playerid,"You do not have a pending paycheck.");
- if(PaycheckDisplayed{playerid})
- {
- PlayerTextDrawHide(playerid, Signcheck[playerid]);
- PaycheckDisplayed{playerid} = false;
- SysMsg(playerid,"You have hidden your paycheck number. Use this command again to redisplay it.");
- }
- else
- {
- format(gstr, sizeof(gstr), "~g~~h~~h~Payday: ~w~%i", CheckNumber[playerid]);
- PlayerTextDrawSetString(playerid, Signcheck[playerid], gstr);
- PlayerTextDrawShow(playerid, Signcheck[playerid]);
- PaycheckDisplayed{playerid} = true;
- SysMsg(playerid,"You have redisplayed your paycheck number. Use this command again to hide it.");
- }
- return true;
- }
- CMD:paytoll(playerid, params[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- new trailer = GetVehicleTrailer(vehicleid);
- new Float:rot[3];
- for(new pt = 0; pt < sizeof(PaytollPos); pt++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, PaytollPos[pt][0], PaytollPos[pt][1], PaytollPos[pt][2])) // RC-BC 1
- {
- new Float:pos[3];
- GetDynamicObjectPos(PayTolls[pt][0], pos[0], pos[1], pos[2]);
- GetDynamicObjectRot(PayTolls[pt][0], rot[0], rot[1], rot[2]);
- if(vehicleid == 0) return SysMsg(playerid, "Only vehicles have to pay a toll and you are not in one.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid, "Only the driver can pay the toll.");
- if(PayTolls[pt][1] == 1) return SysMsg(playerid, "The toll gate is already open.");
- if(trailer > 0)
- {
- if(Cash[playerid] < 10) return SysMsg(playerid, "You don't have enough money to pay the toll. ($10 needed)");
- GivePlayerCash(playerid, -10);
- format(gstr, sizeof(gstr), "[Toll - "COL_MONEYGREEN"$10{FFFFFF}] Welcome to %s. Please Drive Safely. [Trailer/towing fee was $5]", PaytollNames[pt]);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- }
- else
- {
- if(!QualifiesForFreeToll(playerid))
- {
- if(Cash[playerid] < 5) return SysMsg(playerid, "You don't have enough money to pay the toll. ($5 needed)");
- GivePlayerCash(playerid, -5);
- format(gstr, sizeof(gstr), "[Toll - "COL_MONEYGREEN"$5{FFFFFF}] Welcome to %s. Please Drive Safely.", PaytollNames[pt]);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- }
- else
- {
- format(gstr, sizeof(gstr), "[Toll - "COL_MONEYGREEN"$0{FFFFFF}] Welcome to %s. You qualify for free tolls. Please drive safely.", PaytollNames[pt]);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- }
- }
- MoveDynamicObject(PayTolls[pt][0], pos[0], pos[1], pos[2]+0.001, 0.0005, rot[0], 0.0, rot[2]);
- PayTolls[pt][1] = 1;
- PaytollCloseTimer[pt] = SetTimerEx("CloseTollGate", 7000, 0, "df", pt, 90.0);
- }
- }
- return true;
- }
- CMD:bank(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in.");
- if(!IsInBank(playerid)) return SysMsg(playerid, "You are not in a bank.");
- UsingATM{playerid} = false;
- Dialog_Show(playerid,BankMenu,DIALOG_STYLE_LIST,"{3D9140}Red County Banking","Balance\nDeposit\nWithdraw\nTransfer","Enter","Cancel");
- return true;
- }
- CMD:fbalance(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in.");
- if(!IsInBank(playerid)) return SysMsg(playerid, "You are not in a bank");
- if(Faction[playerid] < 1) return SysMsg(playerid,"You are not in a faction.");
- SendClientMessageF(playerid, COLOR_WHITE, "Faction Bank Balance For {0098F2}%s{FFFFFF} - {4BB74C}$%s.", GetFactionName(playerid), format_cash(FACTIONS[Faction[playerid]][FactionBankBalance]));
- return true;
- }
- CMD:fdeposit(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in.");
- if(!IsInBank(playerid)) return SysMsg(playerid, "You are not in a bank");
- if(Faction[playerid] < 1) return SysMsg(playerid,"You are not in a Faction.");
- new amount;
- if(sscanf(params, "i", amount)) return SysMsg(playerid,"Usage: /fdeposit [amount]");
- if(amount < 1) return SysMsg(playerid,"Invalid Amount, Must be greater that 0.");
- if(amount > Cash[playerid]) return SysMsg(playerid,"Invalid Amount, You don't have that much.");
- GivePlayerCash(playerid, -amount);
- SendClientMessageF(playerid, COLOR_WHITE, "[Deposit] Faction Bank Balance For {0098F2}%s{FFFFFF}:", GetFactionName(playerid));
- SendClientMessageF(playerid, COLOR_WHITE, "[Deposit] Old Balance: {4BB74C}$%s{FFFFFF}, New Balance: {4BB74C}$%s{FFFFFF}.", format_cash(FACTIONS[Faction[playerid]][FactionBankBalance]), format_cash(FACTIONS[Faction[playerid]][FactionBankBalance]+amount));
- FACTIONS[Faction[playerid]][FactionBankBalance] += amount;
- MySQLUpdateInt(FACTIONS[Faction[playerid]][FactionId], "BankBalance", FACTIONS[Faction[playerid]][FactionBankBalance], "factions");
- format(gstr, sizeof(gstr),"[%s] %s(%i) puts $%i into %s fbank. (Total: $%i)", GetServerTimeString(), NameEx(playerid), playerid, amount, GetFactionName(playerid), Cash[playerid]);
- return true;
- }
- //Comandos Leader Facção
- CMD:fpay(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"You are not a high enough rank.");
- new playa = -1,PayCash;
- if(sscanf(params, "ui", playa, PayCash)) return SysMsg(playerid,"Usage: /fpay [player id or name] [amount to pay]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(Faction[playerid] != Faction[playa]) return SysMsg(playerid,"They are not in the same faction as you.");
- if(PayCash < 100 || PayCash > 100000) return SysMsg(playerid,"Cash must be between $100 and $100,000");
- if(FACTIONS[Faction[playerid]][FactionBankBalance] < PayCash) return SysMsg(playerid,"You don't have that much money in the faction bank.");
- FACTIONS[Faction[playerid]][FactionBankBalance] -= PayCash;
- BankBalance[playa] += PayCash;
- MySQLUpdateInt(FACTIONS[Faction[playerid]][FactionId], "BankBalance", FACTIONS[Faction[playerid]][FactionBankBalance], "factions");
- MySQLUpdateInt(SQLID[playa], "Bank", BankBalance[playa], "players");
- SendClientMessageF(playerid, COLOR_LIGHTGREEN, "[FACTION BANK STATEMENT] %s - %s(Rank: %s)",GetFactionName(playerid),NameEx(playerid),GetFactionRankName(Faction[playerid], FactionRank[playerid]));
- SendClientMessageF(playerid, COLOR_LIGHTGREEN, " 1. Transfer: TO %s FROM %s - $%i.",NameEx(playa),GetFactionName(playerid),PayCash);
- SendClientMessageF(playerid, COLOR_LIGHTGREEN, " 2. New Faction Balance: $%i.",FACTIONS[Faction[playerid]][FactionBankBalance]);
- SendClientMessageF(playa, COLOR_LIGHTGREEN, "[FACTION PAYDAY] %s - %s(Rank: %s)",GetFactionName(playa),NameEx(playa),GetFactionRankName(Faction[playa], FactionRank[playa]));
- SendClientMessageF(playa, COLOR_LIGHTGREEN, " 1. Deposit: %s %s - $%i.",GetFactionRankName(Faction[playerid], FactionRank[playerid]),NameEx(playerid),PayCash);
- SendClientMessageF(playa, COLOR_LIGHTGREEN, " 2. Balance: $%i.",BankBalance[playa]);
- printf("[Cmd] %s %s Pays %s $%i (FactionPay)",GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameEx(playerid), NameEx(playa), PayCash);
- return true;
- }
- CMD:fsave(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to use this feature.");
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a Faction.");
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"You are not a high enough rank.");
- if(GetPlayerVehicleID(playerid) == 0) return SysMsg(playerid, "You are not even in a vehicle.");
- if(IsFactionVehicle(GetPlayerVehicleID(playerid)) == 0) return SysMsg(playerid, "This is not a faction vehicle.");
- new vehicle = GetPlayerVehicleID(playerid), faction = IsFactionVehicle(vehicle);
- if((faction > 0 && Faction[playerid] != faction) && !IsPlayerAdmin(playerid)) return SysMsg(playerid,"You cannot edit this faction vehicle.");
- if(faction > 0)
- {
- new factionSQLID = vehicle;
- if(factionSQLID == -1) return SysMsg(playerid, "Oops! A System Error has occurred, please report to an Admin. (ERROR: 4-001)");
- new Float:X, Float:Y, Float:Z, Float:R, inter, vw;
- GetVehiclePos(vehicle, X, Y, Z);
- GetVehicleZAngle(vehicle, R);
- inter = GetPlayerInterior(playerid);
- vw = GetPlayerVirtualWorld(playerid);
- new sqlid = FVehicleData[vehicle][FVSQLID];
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE fveh SET LocationX = %f, LocationY = %f, LocationZ = %f, LocationR = %f, VWorld = %i, Interior = %i WHERE id = %i", X, Y, Z, R, vw, inter, FVehicleData[vehicle][FVSQLID]);
- mysql_tquery(conn, mquery);
- DestroyVehicleEx(vehicle, "vehicle");
- ClearVehicleData(vehicle);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM fveh WHERE id = %i", sqlid);
- mysql_tquery(conn, mquery, "LoadFactionVehicles");
- new Float:pX,Float:pY,Float:pZ;
- GetPlayerPos(playerid,pX,pY,pZ);
- SetPlayerPos(playerid,pX,pY,(pZ+5.0));
- SendClientMessage(playerid, COLOR_WHITE, "Faction vehicle has been saved here.");
- }
- return true;
- }
- CMD:hire(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a Faction.");
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"You are not a high enough rank.");
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /hire [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't hire yourself.");
- if(!Logged{playa}) return SysMsg(playerid,"That player hasn't logged/registered.");
- if(Faction[playa] != 0) return SysMsg(playerid,"That player is already in a Faction.");
- InvitedToJoinFaction[playa] = Faction[playerid];
- InvitedToJoinFactionBy[playa] = SQLID[playerid];
- format(gstr, sizeof(gstr),"You have been invited by %s to join their Faction: %s. Use '/accept faction' to join.",NameEx(playerid),GetFactionName(playerid));
- SendClientMessage(playa,COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"You have invited %s to join your Faction.",NameEx(playa));
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- return true;
- }
- CMD:demote(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a Faction.");
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"You are not a high enough rank.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /demote [Full_Name]");
- if(strmatch(params, GetName(playerid))) return SysMsg(playerid, "You can't demote yourself.");
- foreach(new p: Player)
- {
- if(strmatch(params, GetName(p)))
- {
- if(IsPlayerConnected(p) && Logged{p})
- {
- if(Faction[p] != Faction[playerid]) return SysMsg(playerid, "You can't demote somebody who isn't in your faction.");
- if(FactionRank[p] >= FactionRank[playerid]) return SysMsg(playerid, "You can't demote somebody who is a higher or equal rank to you.");
- if(FactionRank[p] == 1) return SysMsg(playerid, "They are already the lowest possible rank.");
- FactionRank[p] --;
- MySQLUpdateInt(SQLID[p], "FactionRank", FactionRank[p], "players");
- format(gstr, sizeof(gstr),"%s %s has demoted you! You are now rank %i(%s).", GetFactionRankName(Faction[playerid], FactionRank[playerid]),NameEx(playerid),FactionRank[p],GetFactionRankName(Faction[p], FactionRank[p]));
- SendClientMessage(p,COLOR_ORANGE,gstr);
- format(gstr, sizeof(gstr),"You have demoted %s! They are now rank %i(%s)", NameEx(p), FactionRank[p] ,GetFactionRankName(Faction[playerid], FactionRank[p]));
- SendClientMessage(playerid,COLOR_ORANGE,gstr);
- return true;
- }
- else return SysMsg(playerid, "That player is either not connected or hasn't logged in yet, please try again.");
- }
- }
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id, Faction, FactionRank, Name FROM players WHERE Name = '%e' LIMIT 1", params);
- mysql_pquery(conn, mquery, "DemoteF", "d", playerid);
- return true;
- }
- GREENSIDE::DemoteF(playerid)
- {
- if(cache_num_rows())
- {
- new currentFaction, currentRank, actualName[50], sqlid;
- sqlid = cache_get_field_content_int(0, "id");
- currentFaction = cache_get_field_content_int(0, "Faction");
- currentRank = cache_get_field_content_int(0, "FactionRank");
- cache_get_field_content(0, "Name", actualName);
- if(Faction[playerid] != currentFaction) return SysMsg(playerid,"They are not in the same Faction as you.");
- if(currentRank == 1) return SysMsg(playerid,"They are already the lowest rank.");
- if(currentRank >= FactionRank[playerid]) return SysMsg(playerid,"You cannot demote higher ranking members.");
- currentRank --;
- MySQLUpdateInt(sqlid, "FactionRank", currentRank, "players");
- /*new oldSub[2], newSub[2], oldRank;
- oldRank = currentRank + 1;*/
- //FactionLog(SQLID[playerid], sqlid, 2, oldSub, newSub, oldRank, currentRank, Faction[playerid]);
- SendClientMessageF(playerid,COLOR_ORANGE,"You have demoted %s! They are now rank %i (%s)",actualName,currentRank,GetFactionRankName(Faction[playerid], currentRank));
- }
- else return SysMsg(playerid, "Name not found in the database, please use Firstname_Lastname when searching.");
- return true;
- }
- CMD:promote(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a Faction.");
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"You are not a high enough rank.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /promote [Full_Name]");
- if(strmatch(params, GetName(playerid))) return SysMsg(playerid, "You can't promote yourself.");
- foreach(new p: Player)
- {
- if(strmatch(params, GetName(p)))
- {
- if(IsPlayerConnected(p) && Logged{p} && SQLID[p] != SQLID[playerid])
- {
- if(Faction[p] != Faction[playerid]) return SysMsg(playerid, "You can't promote somebody who isn't in your faction.");
- if(FactionRank[p] >= FactionRank[playerid]) return SysMsg(playerid, "You can't promote somebody who is a higher or equal rank to you.");
- if(FactionRank[p] >= FACTIONS[Faction[p]][FactionUberLeaderRank]) return SysMsg(playerid, "They are already the highest possible rank.");
- FactionRank[p] ++;
- MySQLUpdateInt(SQLID[p], "FactionRank", FactionRank[p], "players");
- format(gstr, sizeof(gstr),"%s %s has promoted you! You are now rank %i(%s).", GetFactionRankName(Faction[playerid], FactionRank[playerid]),NameEx(playerid),FactionRank[p],GetFactionRankName(Faction[p], FactionRank[p]));
- SendClientMessage(p,COLOR_ORANGE,gstr);
- UnlockAchievement(p, 63);
- format(gstr, sizeof(gstr),"You have promoted %s! They are now rank %i(%s)", NameEx(p), FactionRank[p] ,GetFactionRankName(Faction[playerid], FactionRank[p]));
- SendClientMessage(playerid,COLOR_ORANGE,gstr);
- return true;
- }
- else return SysMsg(playerid, "That player is either not connected or hasn't logged in yet, please try again.");
- }
- }
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id, Faction, FactionRank, Name FROM players WHERE Name = '%e' LIMIT 1", params);
- mysql_pquery(conn, mquery, "PromoteF", "d", playerid);
- return true;
- }
- CMD:fire(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a Faction.");
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"You are not a high enough rank.");
- new fullname[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]", fullname)) return SysMsg(playerid,"Usage: /fire [Full_Name] *Please note that this scans the database, not in-game*");
- new sqlid = MySQLCheckAccount(fullname, playerid);
- if(sqlid == 0) return SysMsg(playerid, "Name was not found. Please include first name, last name and an underscore.");
- if(sqlid == SQLID[playerid]) return SysMsg(playerid, "Name cannot be your account.");
- new playa = -1;
- foreach(new i: Player) if(strcmp(GetName(i), fullname, true) == 0) playa = i;
- if(playa != -1 && IsPlayerConnected(playa))
- {
- if(Faction[playerid] != Faction[playa]) return SysMsg(playerid,"They are not in the same Faction as you.");
- if(FactionRank[playerid] < FactionRank[playa]) return SysMsg(playerid,"You can't fire someone with a higher rank than you.");
- if(RadioFrequency[playa] == FACTIONS[Faction[playa]][FactionRadioChannel]) RadioFrequency[playa] = 1000;
- for(new r = 0; r < 3; r++)
- {
- if(RadioSlot[playa][r] == FACTIONS[Faction[playa]][FactionRadioChannel])
- {
- RadioSlot[playa][r] = 1000;
- }
- }
- Faction[playa] = 0;
- FactionRank[playa] = 0;
- if(MySpawnID[playa] == 2)
- {
- MySpawnID[playa] = 1;
- SubFactionSpawn[playa] = 0;
- }
- if(RestrictedVest{playa}) SetPlayerArmourEx(playa, 0.0, 1);
- ResetPlayerWeapons(playa);
- for(new slot = MAX_TOTAL_WEAPONS - 1; slot != -1; slot--)
- {
- if(WeaponData[playa][slot][WeaponOrigin] == 3)
- {
- ResetWeaponVariables(playa, 0, slot);
- }
- }
- for(new slot = MAX_TOTAL_WEAPONS - 1; slot != -1; slot--)
- {
- GivePlayerWeapon(playa, WeaponData[playa][slot][Weapon], WeaponData[playa][slot][WeaponAmmo]);
- }
- IsESU{playa} = false;
- if(Clothes[playa][0] == 0)
- {
- cPlayersSkin[playa] = 1;
- SetPlayerSkinEx(playa, 1);
- }
- if(Clothes[playa][0] != 0)
- {
- cPlayersSkin[playa] = Clothes[playa][0];
- SetPlayerSkinEx(playa, Clothes[playa][0]);
- }
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Skin = %i WHERE id = %i", cPlayersSkin[playa], SQLID[playa]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid,COLOR_ORANGE,"You have fired %s!", NameEx(playa));
- FactionCustomRank[playa][0] = 0;
- IsESU{playerid} = false;
- SendClientMessageF(playa, COLOR_ORANGE,"%s %s has fired you! You are now a civilian.", GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameEx(playerid));
- //new oldSub[2], newSub[2], oldRank, newRank;
- for(new p; p < MAX_TOYS; p++)
- {
- if(ToyInfo[playa][p][FactionMask] == 1)
- {
- ClearToyData(playa, p);
- }
- }
- FirePlayer(sqlid, 1);
- //FactionLog(SQLID[playerid], SQLID[playa], 1, oldSub, newSub, oldRank, newRank, Faction[playerid]);
- }
- else
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Faction,FactionRank,Name FROM `players` WHERE id = %i", sqlid);
- mysql_pquery(conn, mquery, "Fire", "dd", playerid, sqlid);
- }
- return true;
- }
- CMD:togglef(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a Faction.");
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"You are not a high enough rank.");
- if(FACTIONS[Faction[playerid]][FactionChatToggleOff] == 0)
- {
- FACTIONS[Faction[playerid]][FactionChatToggleOff] = 1;
- foreach(new i: Player) if(Logged{i} && Faction[i] == Faction[playerid]) SendClientMessageF(i, COLOR_ORANGE,"Faction chat has been disabled by %s.", NameEx(playerid));
- }
- else
- {
- FACTIONS[Faction[playerid]][FactionChatToggleOff] = 0;
- foreach(new i: Player) if(Logged{i} && Faction[i] == Faction[playerid]) SendClientMessageF(i, COLOR_ORANGE, "Faction chat has been enabled by %s.", NameEx(playerid));
- }
- return true;
- }
- CMD:setsubrank(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a Faction.");
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"You are not a high enough rank.");
- new pname[32], newrank[20], playa;
- if(sscanf(params, "s[32]s[20]", pname, newrank)) return SysMsg(playerid,"Usage: /setsubrank [ID / Full_Name] [New Sub Rank]");
- playa = GetPlayerIDs(pname);
- if(!InvalidPlayer(playa))
- {
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(Faction[playerid] != Faction[playa]) return SysMsg(playerid,"They are not in the same faction as you.");
- if((strlen(newrank) < 2 || strlen(newrank) > 15)) return SysMsg(playerid,"Ensure the rank length is between 2 and 15 letters.");
- format(FactionCustomRank[playa], 16, newrank);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET FactionCustomRank = '%e' WHERE id = %i", FactionCustomRank[playa], SQLID[playa]);
- mysql_pquery(conn, mquery);
- if(strfind(FactionCustomRank[playa], "ESU") != -1) IsESU{playa} = true;
- else IsESU{playa} = false;
- SendClientMessageF(playerid,COLOR_ORANGE, "You have set %s's sub-rank to '%s'", NameEx(playa), newrank);
- SendClientMessageF(playa,COLOR_ORANGE, "%s has set your sub-rank to '%s'", NameEx(playerid), newrank);
- }
- else if(strfind(pname, "_", true) != -1)
- {
- new sqlid = MySQLCheckAccount(pname, playerid);
- if(sqlid == 0) return SysMsg(playerid, "Name was not found in the database, please try again.");
- if(sqlid == SQLID[playerid]) return SysMsg(playerid, "Name cannot be your account.");
- if(strlen(newrank) < 2 || strlen(newrank) > 15) return SysMsg(playerid,"Ensure the rank length is between 2 and 15 letters.");
- MySQLUpdateString(sqlid, "FactionCustomRank", newrank, "players");
- SendClientMessageF(playerid,COLOR_ORANGE,"You have set %s's sub-rank to '%s'", RPName(pname), newrank);
- }
- return true;
- }
- CMD:frespawn(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == 0) return SysMsg(playerid, "You must be in a Faction.");
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"You are not a high enough rank.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /frespawn [vehicle id OR all] *Use /fcars for ID or SAMP command /dl*");
- if(strcmp("all", params, true) == 0)
- {
- new vcount = 0, tcount = 0;
- for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(IsVehicleSpawned(v) && FVehicleData[v][FVFaction] == Faction[playerid] && !FVehicleData[v][FImpounded])
- {
- tcount ++;
- if(VehicleBeingTowed(v)) continue;
- if(VehicleIsOccupied(v)) continue;
- vcount ++;
- RespawnFactionCar(v);
- }
- }
- foreach(new i: Player) if(Logged{i} && Faction[i] == Faction[playerid]) SendClientMessageF(i, COLOR_ORANGE, "[Faction Message] %s has respawned %i out of %i faction vehicles.", NameEx(playerid), vcount, tcount);
- }
- else
- {
- new v = strval(params);
- if(IsVehicleSpawned(FVehicleData[v][FactionVehID]) && FVehicleData[v][FVFaction] == Faction[playerid])
- {
- if(VehicleBeingTowed(v)) return SysMsg(playerid, "You can't respawn a vehicle that is being towed.");
- if(VehicleIsOccupied(v)) return SysMsg(playerid, "You can't respawn a vehicle that is occupied.");
- if(FVehicleData[v][FImpounded]) return SysMsg(playerid, "You can't frespawn a vehicle that is impounded.");
- SendClientMessage(playerid, COLOR_ORANGE, "Vehicle has been respawned.");
- RespawnFactionCar(v);
- }
- }
- return true;
- }
- CMD:setfmotd(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == 0) return SysMsg(playerid, "You must be in a faction to use this.");
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid, "You are not the appropriate faction rank to change the faction MOTD.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /setfmotd [new faction motd]");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE fmotd SET fmotd = '%e' WHERE fid = %i", params, Faction[playerid]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_WHITE, "You have set the faction MOTD to %s", params);
- format(sgstr, sizeof(sgstr), "Changed faction %i's MOTD", Faction[playerid]);
- AdminLog(playerid, 0, params, sgstr);
- return true;
- }
- CMD:setrank(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to use this feature.");
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a Faction.");
- if(!IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) return SysMsg(playerid,"You are not a high enough rank.");
- new vehicle = GetPlayerVehicleID(playerid);
- if(vehicle == 0) return SysMsg(playerid, "You are not even in a vehicle.");
- new faction = IsFactionVehicle(vehicle);
- if(faction == 0) return SysMsg(playerid, "This is not a faction vehicle.");
- if((faction > 0 && Faction[playerid] != faction) && !IsPlayerAdmin(playerid)) return SysMsg(playerid,"You cannot edit this faction vehicle.");
- if(faction > 0)
- {
- new newRank;
- if(isnull(params)) return SysMsg(playerid,"Usage: /setrank [Required Rank To Drive Vehicle]");
- if(!IsNumeric(params)) return SysMsg(playerid,"Rank must be a number.");
- newRank = strval(params);
- if(newRank < 1 || newRank > FACTIONS[Faction[playerid]][FactionUberLeaderRank]) return SysMsgF(playerid, "Rank can only be from 1 to %i.", FACTIONS[Faction[playerid]][FactionUberLeaderRank]);
- if(FVehicleData[vehicle][FVMinRank] == newRank) return SysMsg(playerid,"Rank is already this value.");
- if(FVehicleData[vehicle][FVMinRank] > FactionRank[playerid]) return SysMsg(playerid,"You may not edit a vehicles rank if it is higher than your own rank.");
- FVehicleData[vehicle][FVMinRank] = newRank;
- MySQLUpdateInt(FVehicleData[vehicle][FVSQLID], "MinRank", newRank, "fveh");
- SendClientMessageF(playerid, COLOR_WHITE, "Faction vehicle rank restriction is now %s(%i) and higher.", GetFactionRankName(Faction[playerid], newRank), newRank);
- }
- return true;
- }
- CMD:setrankname(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a Faction.");
- if(FactionRank[playerid] < FACTIONS[Faction[playerid]][FactionUberLeaderRank]) return SysMsg(playerid,"You are not a high enough rank.");
- new rank, desc[32];
- if(sscanf(params, "is[32]", rank, desc)) return SysMsg(playerid,"Usage: /setrankname [rank number] [name] *Example: /setrankname 1 Trainee*");
- if(strlen(desc) > 19) return SysMsg(playerid,"Length of rank name is too long (max 19 characters).");
- if(rank > FACTIONS[Faction[playerid]][FactionUberLeaderRank]) return SysMsgF(playerid, "Rank can only be from 1 to %i.", FACTIONS[Faction[playerid]][FactionUberLeaderRank]);
- new x = rank - 1, f = Faction[playerid];
- if(strcmp(FactionRanks[f][x], desc, true) == 0) return SysMsgF(playerid, "Rank name is already %s", desc);
- new mysqlfield[12];
- format(mysqlfield, 12, "RankName%i", rank);
- format(FactionRanks[f][x], 32, desc);
- MySQLUpdateString(FACTIONS[f][FactionId], mysqlfield, desc, "factions");
- SendClientMessageF(playerid, COLOR_ORANGE,"Rank %i is now named %s.", rank, desc);
- return true;
- }
- CMD:setspawnpoint(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a Faction.");
- if(FactionRank[playerid] < FACTIONS[Faction[playerid]][FactionUberLeaderRank]) return SysMsg(playerid,"You are not a high enough rank.");
- if(GetPlayerVehicleID(playerid) > 0) return SysMsg(playerid,"You cannot create a spawn inside a vehicle.");
- if(IsInHouseID[playerid] != -1) return SysMsg(playerid,"You cannot create a spawn inside a house.");
- if(IsInBizzID[playerid] != -1) return SysMsg(playerid,"You cannot create a spawn inside a business.");
- new spawnpoint, desc[40];
- if(sscanf(params, "is[40]", spawnpoint, desc)) return SysMsg(playerid,"Usage: /setspawnpoint [point 1-5] [description] *Example: /setspawnpoint 1 Fort Carson Office*");
- if(strlen(desc) > 39) return SysMsg(playerid,"Length of description is too long (max 39 characters).");
- switch(spawnpoint)
- {
- case 1:
- {
- GetPlayerPos(playerid, FACTIONS[Faction[playerid]][FactionSpawn1][0], FACTIONS[Faction[playerid]][FactionSpawn1][1], FACTIONS[Faction[playerid]][FactionSpawn1][2]);
- GetPlayerFacingAngle(playerid, FACTIONS[Faction[playerid]][FactionSpawn1][3]);
- FACTIONS[Faction[playerid]][FactionSpawnVW][0] = GetPlayerVirtualWorld(playerid);
- FACTIONS[Faction[playerid]][FactionSpawnInt][0] = GetPlayerInterior(playerid);
- format(FACTIONS[Faction[playerid]][FactionSpawn1Name], 40, desc);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE factions SET Spawn1Name = '%e', Spawn1X = %f, Spawn1Y = %f, Spawn1Z = %f, Spawn1A = %f, Spawn1VW = %i, Spawn1Int = %i WHERE id = %i",
- desc, FACTIONS[Faction[playerid]][FactionSpawn1][0], FACTIONS[Faction[playerid]][FactionSpawn1][1], FACTIONS[Faction[playerid]][FactionSpawn1][2], FACTIONS[Faction[playerid]][FactionSpawn1][3],
- FACTIONS[Faction[playerid]][FactionSpawnVW][0], FACTIONS[Faction[playerid]][FactionSpawnInt][0], FACTIONS[Faction[playerid]][FactionId]);
- mysql_pquery(conn, mquery);
- }
- case 2:
- {
- GetPlayerPos(playerid, FACTIONS[Faction[playerid]][FactionSpawn2][0], FACTIONS[Faction[playerid]][FactionSpawn2][1], FACTIONS[Faction[playerid]][FactionSpawn2][2]);
- GetPlayerFacingAngle(playerid, FACTIONS[Faction[playerid]][FactionSpawn2][3]);
- FACTIONS[Faction[playerid]][FactionSpawnVW][1] = GetPlayerVirtualWorld(playerid);
- FACTIONS[Faction[playerid]][FactionSpawnInt][1] = GetPlayerInterior(playerid);
- format(FACTIONS[Faction[playerid]][FactionSpawn2Name], 40, desc);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE factions SET Spawn2Name = '%e', Spawn2X = %f, Spawn2Y = %f, Spawn2Z = %f, Spawn2A = %f, Spawn2VW = %i, Spawn2Int = %i WHERE id = %i",
- desc, FACTIONS[Faction[playerid]][FactionSpawn2][0], FACTIONS[Faction[playerid]][FactionSpawn2][1], FACTIONS[Faction[playerid]][FactionSpawn2][2], FACTIONS[Faction[playerid]][FactionSpawn2][3],
- FACTIONS[Faction[playerid]][FactionSpawnVW][1], FACTIONS[Faction[playerid]][FactionSpawnInt][1], FACTIONS[Faction[playerid]][FactionId]);
- mysql_pquery(conn, mquery);
- }
- case 3:
- {
- if(FACTIONS[Faction[playerid]][FactionSpawn2][0] == 0) return SysMsg(playerid, "Please use spawn point 2 first.");
- GetPlayerPos(playerid, FACTIONS[Faction[playerid]][FactionSpawn3][0], FACTIONS[Faction[playerid]][FactionSpawn3][1], FACTIONS[Faction[playerid]][FactionSpawn3][2]);
- GetPlayerFacingAngle(playerid, FACTIONS[Faction[playerid]][FactionSpawn3][3]);
- FACTIONS[Faction[playerid]][FactionSpawnVW][2] = GetPlayerVirtualWorld(playerid);
- FACTIONS[Faction[playerid]][FactionSpawnInt][2] = GetPlayerInterior(playerid);
- format(FACTIONS[Faction[playerid]][FactionSpawn3Name], 40, desc);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE factions SET Spawn3Name = '%e', Spawn3X = %f, Spawn3Y = %f, Spawn3Z = %f, Spawn3A = %f, Spawn3VW = %i, Spawn3Int = %i WHERE id = %i",
- desc, FACTIONS[Faction[playerid]][FactionSpawn3][0], FACTIONS[Faction[playerid]][FactionSpawn3][1], FACTIONS[Faction[playerid]][FactionSpawn3][2], FACTIONS[Faction[playerid]][FactionSpawn3][3],
- FACTIONS[Faction[playerid]][FactionSpawnVW][2], FACTIONS[Faction[playerid]][FactionSpawnInt][2], FACTIONS[Faction[playerid]][FactionId]);
- mysql_pquery(conn, mquery);
- }
- case 4:
- {
- if(FACTIONS[Faction[playerid]][FactionSpawn3][0] == 0) return SysMsg(playerid, "Please use spawn point 2 first.");
- GetPlayerPos(playerid, FACTIONS[Faction[playerid]][FactionSpawn4][0], FACTIONS[Faction[playerid]][FactionSpawn4][1], FACTIONS[Faction[playerid]][FactionSpawn4][2]);
- GetPlayerFacingAngle(playerid, FACTIONS[Faction[playerid]][FactionSpawn4][3]);
- FACTIONS[Faction[playerid]][FactionSpawnVW][3] = GetPlayerVirtualWorld(playerid);
- FACTIONS[Faction[playerid]][FactionSpawnInt][3] = GetPlayerInterior(playerid);
- format(FACTIONS[Faction[playerid]][FactionSpawn4Name], 40, desc);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE factions SET Spawn4Name = '%e', Spawn4X = %f, Spawn4Y = %f, Spawn4Z = %f, Spawn4A = %f, Spawn4VW = %i, Spawn4Int = %i WHERE id = %i",
- desc, FACTIONS[Faction[playerid]][FactionSpawn4][0], FACTIONS[Faction[playerid]][FactionSpawn4][1], FACTIONS[Faction[playerid]][FactionSpawn4][2], FACTIONS[Faction[playerid]][FactionSpawn4][3],
- FACTIONS[Faction[playerid]][FactionSpawnVW][3], FACTIONS[Faction[playerid]][FactionSpawnInt][3], FACTIONS[Faction[playerid]][FactionId]);
- mysql_pquery(conn, mquery);
- }
- case 5:
- {
- if(FACTIONS[Faction[playerid]][FactionSpawn4][0] == 0) return SysMsg(playerid, "Please use spawn point 2 first.");
- GetPlayerPos(playerid, FACTIONS[Faction[playerid]][FactionSpawn5][0], FACTIONS[Faction[playerid]][FactionSpawn5][1], FACTIONS[Faction[playerid]][FactionSpawn5][2]);
- GetPlayerFacingAngle(playerid, FACTIONS[Faction[playerid]][FactionSpawn5][3]);
- FACTIONS[Faction[playerid]][FactionSpawnVW][4] = GetPlayerVirtualWorld(playerid);
- FACTIONS[Faction[playerid]][FactionSpawnInt][4] = GetPlayerInterior(playerid);
- format(FACTIONS[Faction[playerid]][FactionSpawn5Name], 40, desc);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE factions SET Spawn5Name = '%e', Spawn5X = %f, Spawn5Y = %f, Spawn5Z = %f, Spawn5A = %f, Spawn5VW = %i, Spawn5Int = %i WHERE id = %i",
- desc, FACTIONS[Faction[playerid]][FactionSpawn5][0], FACTIONS[Faction[playerid]][FactionSpawn5][1], FACTIONS[Faction[playerid]][FactionSpawn5][2], FACTIONS[Faction[playerid]][FactionSpawn5][3],
- FACTIONS[Faction[playerid]][FactionSpawnVW][4], FACTIONS[Faction[playerid]][FactionSpawnInt][4], FACTIONS[Faction[playerid]][FactionId]);
- mysql_pquery(conn, mquery);
- }
- default: return SysMsg(playerid,"Spawn point can only be from 1 to 5.");
- }
- SendClientMessageF(playerid, COLOR_ORANGE, "Spawn point %i has been saved. [%s]", spawnpoint, desc);
- return true;
- }
- CMD:removespawnpoint(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Faction[playerid] == 0) return SysMsg(playerid,"You are not in a Faction.");
- if(FactionRank[playerid] < FACTIONS[Faction[playerid]][FactionUberLeaderRank]) return SysMsg(playerid,"You are not a high enough rank.");
- new spawnpoint;
- if(sscanf(params, "i", spawnpoint)) return SysMsg(playerid,"Usage: /removespawnpoint [point 2-5]");
- new desc[40];
- switch(spawnpoint)
- {
- case 1: return SysMsg(playerid,"You may not delete the first spawn point.");
- case 2:
- {
- if(FACTIONS[Faction[playerid]][FactionSpawn2][0] == 0) return SysMsg(playerid,"This spawn point has not been set.");
- format(desc, 40, FACTIONS[Faction[playerid]][FactionSpawn2Name]);
- FACTIONS[Faction[playerid]][FactionSpawn2][0] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawn2][1] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawn2][2] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawn2][3] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawnVW][1] = 0;
- FACTIONS[Faction[playerid]][FactionSpawnInt][1] = 0;
- FACTIONS[Faction[playerid]][FactionSpawn2Name][0] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE factions SET Spawn2Name = '', Spawn2X = 0.0, Spawn2Y = 0.0, Spawn2Z = 0.0, Spawn2A = 0.0, Spawn2VW = 0, Spawn2Int = 0 WHERE id = %i", FACTIONS[Faction[playerid]][FactionId]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET SubFactionSpawn=1 WHERE SubFactionSpawn=3 AND Faction=%i", Faction[playerid]);
- mysql_pquery(conn, mquery);
- }
- case 3:
- {
- if(FACTIONS[Faction[playerid]][FactionSpawn3][0] == 0) return SysMsg(playerid,"This spawn point has not been set.");
- format(desc, 40, FACTIONS[Faction[playerid]][FactionSpawn3Name]);
- FACTIONS[Faction[playerid]][FactionSpawn3][0] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawn3][1] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawn3][2] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawn3][3] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawnVW][2] = 0;
- FACTIONS[Faction[playerid]][FactionSpawnInt][2] = 0;
- FACTIONS[Faction[playerid]][FactionSpawn3Name][0] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE factions SET Spawn3Name = '', Spawn3X = 0.0, Spawn3Y = 0.0, Spawn3Z = 0.0, Spawn3A = 0.0, Spawn3VW = 0, Spawn3Int = 0 WHERE id = %i", FACTIONS[Faction[playerid]][FactionId]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET SubFactionSpawn=1 WHERE SubFactionSpawn=3 AND Faction=%i", Faction[playerid]);
- mysql_pquery(conn, mquery);
- }
- case 4:
- {
- if(FACTIONS[Faction[playerid]][FactionSpawn4][0] == 0) return SysMsg(playerid,"This spawn point has not been set.");
- format(desc, 40, FACTIONS[Faction[playerid]][FactionSpawn4Name]);
- FACTIONS[Faction[playerid]][FactionSpawn4][0] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawn4][1] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawn4][2] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawn4][3] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawnVW][3] = 0;
- FACTIONS[Faction[playerid]][FactionSpawnInt][3] = 0;
- FACTIONS[Faction[playerid]][FactionSpawn4Name][0] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE factions SET Spawn4Name = '', Spawn4X = 0.0, Spawn4Y = 0.0, Spawn4Z = 0.0, Spawn4A = 0.0, Spawn4VW = 0, Spawn4Int = 0 WHERE id = %i", FACTIONS[Faction[playerid]][FactionId]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET SubFactionSpawn=1 WHERE SubFactionSpawn=4 AND Faction=%i", Faction[playerid]);
- mysql_pquery(conn, mquery);
- }
- case 5:
- {
- if(FACTIONS[Faction[playerid]][FactionSpawn5][0] == 0) return SysMsg(playerid,"This spawn point has not been set.");
- format(desc, 40, FACTIONS[Faction[playerid]][FactionSpawn5Name]);
- FACTIONS[Faction[playerid]][FactionSpawn5][0] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawn5][1] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawn5][2] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawn5][3] = 0.0;
- FACTIONS[Faction[playerid]][FactionSpawnVW][4] = 0;
- FACTIONS[Faction[playerid]][FactionSpawnInt][4] = 0;
- FACTIONS[Faction[playerid]][FactionSpawn5Name][0] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE factions SET Spawn5Name = '', Spawn5X = 0.0, Spawn5Y = 0.0, Spawn5Z = 0.0, Spawn5A = 0.0, Spawn5VW = 0, Spawn5Int = 0 WHERE id = %i", FACTIONS[Faction[playerid]][FactionId]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET SubFactionSpawn=1 WHERE SubFactionSpawn=5 AND Faction=%i", Faction[playerid]);
- mysql_pquery(conn, mquery);
- }
- default: return SysMsg(playerid,"Spawn point can only be from 1 to 5.");
- }
- foreach(new i: Player)
- {
- if(Logged{i} && Faction[i] == Faction[playerid] && SubFactionSpawn[i] == spawnpoint)
- {
- SubFactionSpawn[i] = 1;
- MySQLUpdateInt(SQLID[i], "SubFactionSpawn", SubFactionSpawn[i], "players");
- }
- }
- format(gstr, sizeof(gstr), "Spawn point %i (%s) has been removed.", spawnpoint, desc);
- SendClientMessage(playerid, COLOR_ORANGE, gstr);
- return true;
- }
- CMD:fwithdraw(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in.");
- if(!IsInBank(playerid)) return SysMsg(playerid, "You are not in a bank");
- if(Faction[playerid] < 1) return SysMsg(playerid,"You are not in a Faction.");
- if(FactionRank[playerid] < FACTIONS[Faction[playerid]][FactionUberLeaderRank]) return SysMsg(playerid,"You are not a high enough Rank.");
- new amount;
- if(sscanf(params, "i", amount)) return SysMsg(playerid,"Usage: /fwithdraw [amount]");
- if(amount < 1) return SysMsg(playerid,"Invalid Amount, Must be greater that 0.");
- if(amount > FACTIONS[Faction[playerid]][FactionBankBalance]) return SysMsg(playerid,"Invalid Amount, There is not even that much in the account.");
- new oldBal = FACTIONS[Faction[playerid]][FactionBankBalance];
- FACTIONS[Faction[playerid]][FactionBankBalance] -= amount;
- GivePlayerCash(playerid, amount);
- SendClientMessageF(playerid, COLOR_WHITE, "[Withdraw] Faction Bank Balance For {0098F2}%s:", GetFactionName(playerid));
- SendClientMessageF(playerid, COLOR_WHITE, "[Withdraw] Old Balance: {4BB74C}$%s{FFFFFF}, New Balance: {4BB74C}$%s{FFFFFF}.", format_cash(oldBal), format_cash(FACTIONS[Faction[playerid]][FactionBankBalance]));
- MySQLUpdateInt(FACTIONS[Faction[playerid]][FactionId], "BankBalance", FACTIONS[Faction[playerid]][FactionBankBalance], "factions");
- format(gstr, sizeof(gstr),"[%s] %s(%i) gets $%i from %s fbank. (Total: $%i)", GetServerTimeString(), NameEx(playerid), playerid, amount, GetFactionName(playerid), Cash[playerid]);
- return true;
- }
- CMD:atm(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in.");
- new atm = IsPlayerNearATM(playerid);
- if(atm == 0) return SysMsg(playerid,"You are not near an ATM.");
- new Float:atmPos[3];
- GetDynamicObjectPos(atm, atmPos[0], atmPos[1], atmPos[2]);
- SetPlayerToFacePoint(playerid, atmPos[0], atmPos[1]);
- OnePlayAnim(playerid, "ped", "ATM", 3.5, 0, 0, 0, 0, 0);
- UsingATM{playerid} = true;
- Dialog_Show(playerid,BankMenu,DIALOG_STYLE_LIST,"{3D9140}Red County Banking {FFFFFF}(ATM)","Balance\nWithdraw\nWithdraw ALL\nWithdraw HALF","Select","Cancel");
- return true;
- }
- CMD:payday(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!CheckReady{playerid}) return SysMsg(playerid,"You have no outstanding payday.");
- if(IsPlayerInRangeOfPoint(playerid, 2.5, 756.6013,-31.4750,1008.6959) || IsPlayerInRangeOfPoint(playerid, 2.5, 915.378479, 2370.55102, 246.462112) || IsPlayerInRangeOfPoint(playerid, 2.5, 2257.6848,-62.0732,1004.6469) || IsPlayerInRangeOfPoint(playerid, 2.5, 889.941467, 2261.735351, 238.230422) || IsPlayerInRangeOfPoint(playerid, 2.5, 1174.3242,1354.0504,1002.8235) || ADuty[playerid] == 1)
- {
- new paydaynumber;
- if(sscanf(params, "i", paydaynumber)) return SysMsg(playerid,"Use: /payday [number]");
- if(paydaynumber < 1111 || paydaynumber > 9111) return SysMsg(playerid,"Invalid verification number.");
- if(paydaynumber != CheckNumber[playerid]) return SysMsg(playerid,"Wrong verification number.");
- PayDay(playerid);
- CheckReady{playerid} = false;
- UnlockAchievement(playerid, 11);
- PlayerTextDrawSetString(playerid, Signcheck[playerid], "~g~~h~~h~Payday: ~w~0000");
- PlayerTextDrawHide(playerid, Signcheck[playerid]);
- printf("[PayDay] %s (%i)",NameEx(playerid),CheckReady{playerid});
- return true;
- }
- SysMsg(playerid,"You should be in a city hall to get your payday. (Palomino Creek, Fort Carson or Angel Pine).");
- return true;
- }
- CMD:water(playerid)
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Water] <= 0) return SysMsg(playerid,"You do not have any water.");
- Inventory[playerid][Water] --;
- MySQLUpdateFloat(SQLID[playerid], "HasWater", Inventory[playerid][Water], "players");
- OnePlayAnim(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
- SendClientMessage(playerid, COLOR_WHITE, "After drinking some {00B9F9}water{FFFFFF}, you feel somewhat {00B9F9}refreshed{FFFFFF} and {00B9F9}hydrated{FFFFFF}.");
- return true;
- }
- CMD:drink(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerAtBar(playerid)) return SysMsg(playerid,"You are not at a bar.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /drink [name of drink] (Drinks: wine, beer, sprunk, vodka, cola)");
- if(strcmp("beer",params,true) == 0)
- {
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_BEER) return SysMsg(playerid,"Please wait until you have finished drinking.");
- GivePlayerCash(playerid, -5);
- DrunkLevel[playerid] = GetPlayerDrunkLevel(playerid);
- if(DrunkLevel[playerid] < 47500)
- {
- DrunkLevel[playerid] += 2500;
- SetPlayerDrunkLevel(playerid, DrunkLevel[playerid]);
- }
- else
- {
- DrunkLevel[playerid] = 50000;
- SetPlayerDrunkLevel(playerid, 50000);
- }
- LoopingAnim(playerid, "BAR", "Barcustom_get", 3.0, 0, 1, 1, 1, 0);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
- SendClientMessage(playerid,COLOR_SKYBLUE,"You have just bought a beer costing $5.");
- format(gstr, sizeof(gstr),"* %s buys a bottle of beer from the bar. *",NameRP(playerid));
- ProxDetector(10.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- UnlockAchievement(playerid, 64);
- return true;
- }
- else if(strcmp("wine",params,true) == 0)
- {
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_WINE) return SysMsg(playerid,"Please wait until you have finished drinking.");
- GivePlayerCash(playerid, -7);
- DrunkLevel[playerid] = GetPlayerDrunkLevel(playerid);
- if(DrunkLevel[playerid] < 47000)
- {
- DrunkLevel[playerid] += 3000;
- SetPlayerDrunkLevel(playerid, DrunkLevel[playerid]);
- }
- else
- {
- DrunkLevel[playerid] = 50000;
- SetPlayerDrunkLevel(playerid, 50000);
- }
- LoopingAnim(playerid, "BAR", "Barcustom_get", 3.0, 0, 1, 1, 1, 0);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
- SendClientMessage(playerid,COLOR_SKYBLUE,"You have just bought wine costing $7.");
- format(gstr, sizeof(gstr),"* %s buys a bottle of wine from the bar. *",NameRP(playerid));
- ProxDetector(10.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- UnlockAchievement(playerid, 64);
- return true;
- }
- else if(strcmp("sprunk",params,true) == 0)
- {
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_SPRUNK) return SysMsg(playerid,"Please wait until you have finished drinking.");
- GivePlayerCash(playerid, -3);
- LoopingAnim(playerid, "BAR", "Barcustom_get", 3.0, 0, 1, 1, 1, 0);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
- SendClientMessage(playerid,COLOR_SKYBLUE,"You have just bought sprunk costing $3.");
- format(gstr, sizeof(gstr),"* %s buys a can of Sprunk from the bar. *",NameRP(playerid));
- ProxDetector(10.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- UnlockAchievement(playerid, 64);
- return true;
- }
- else if(strcmp("cola",params,true) == 0)
- {
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_SPRUNK) return SysMsg(playerid,"Please wait until you have finished drinking.");
- GivePlayerCash(playerid, -3);
- LoopingAnim(playerid, "BAR", "Barcustom_get", 3.0, 0, 1, 1, 1, 0);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
- SendClientMessage(playerid,COLOR_SKYBLUE,"You have just bought Cola costing $3.");
- format(gstr, sizeof(gstr),"* %s buys a can of Cola from the bar. *",NameRP(playerid));
- ProxDetector(10.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- UnlockAchievement(playerid, 64);
- return true;
- }
- else if(strcmp("vodka",params,true) == 0)
- {
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_WINE) return SysMsg(playerid,"Please wait until you have finished drinking.");
- GivePlayerCash(playerid, -6);
- DrunkLevel[playerid] = GetPlayerDrunkLevel(playerid);
- if(DrunkLevel[playerid] < 47000)
- {
- DrunkLevel[playerid] += 5000;
- SetPlayerDrunkLevel(playerid, DrunkLevel[playerid]);
- }
- else
- {
- DrunkLevel[playerid] = 50000;
- SetPlayerDrunkLevel(playerid, 50000);
- }
- LoopingAnim(playerid, "BAR", "Barcustom_get", 3.0, 0, 1, 1, 1, 0);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
- SendClientMessage(playerid,COLOR_SKYBLUE,"You have just bought vodka costing $6.");
- format(gstr, sizeof(gstr),"* %s buys a bottle of Vodka from the bar. *",NameRP(playerid));
- ProxDetector(10.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- UnlockAchievement(playerid, 64);
- return true;
- }
- return true;
- }
- CMD:buyfood(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- gstr[0] = EOS;
- if(IsPlayerInRangeOfPoint(playerid,2.5,375.593475,-119.421913,1001.499511) || IsPlayerInRangeOfPoint(playerid, 2.5, 1377.5850,230.8785,859.7217))
- {
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 && BizzData[IsInBizzID[playerid]][BizzStock] <= 0) return SysMsg(playerid,"This business has no stock left.");
- strcat(gstr, "{FFFFFF}Buster - {3D9140}$2\n");
- strcat(gstr, "{FFFFFF}Double D-Luxe - {3D9140}$5\n");
- strcat(gstr, "{FFFFFF}Full Rack - {3D9140}$10\n");
- strcat(gstr, "{FFFFFF}Salad Meal - {3D9140}$10");
- Dialog_Show(playerid, FoodMenu, DIALOG_STYLE_LIST, "Food Menu", gstr, "Buy", "Exit");
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid,3.5,449.311401,-84.340423,999.554687) || IsPlayerInRangeOfPoint(playerid, 5.5, -1337.6069, -41.5284, 17.7579) ||
- IsPlayerInRangeOfPoint(playerid,3.5,378.4463,-187.9347,1000.6328) || IsPlayerInRangeOfPoint(playerid,3.5,1981.5765,2358.3240,1023.9039))
- {
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 && BizzData[IsInBizzID[playerid]][BizzStock] <= 0) return SysMsg(playerid,"This business has no stock left.");
- strcat(gstr, "{FFFFFF}Burger - {3D9140}$4\n");
- strcat(gstr, "{FFFFFF}Coffee - {3D9140}$1\n");
- strcat(gstr, "{FFFFFF}Cola - {3D9140}$2\n");
- strcat(gstr, "{FFFFFF}Double Whopper Cheeseburger - {3D9140}$20\n");
- strcat(gstr, "{FFFFFF}Fries - {3D9140}$4\n");
- strcat(gstr, "{FFFFFF}Soup - {3D9140}$3\n");
- strcat(gstr, "{FFFFFF}Tea - {3D9140}$1\n");
- strcat(gstr, "{FFFFFF}Toast - {3D9140}$2");
- Dialog_Show(playerid, CafeMenu, DIALOG_STYLE_LIST, "Cafe Menu", gstr, "Buy", "Exit");
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.5,-2680.204833, 632.025817, 13700.49804) || IsPlayerInRangeOfPoint(playerid, 5.5, -1340.6831, -31.1640, 14.2559)) //mont hospital, prison cafes
- {
- strcat(gstr, "{FFFFFF}Coffee - {3D9140}$1\n");
- strcat(gstr, "{FFFFFF}Cola - {3D9140}$2\n");
- strcat(gstr, "{FFFFFF}Soup - {3D9140}$3\n");
- strcat(gstr, "{FFFFFF}Tea - {3D9140}$1\n");
- strcat(gstr, "{FFFFFF}Toast - {3D9140}$2\n");
- Dialog_Show(playerid, CafeMenu, DIALOG_STYLE_LIST, "Cafe Menu", gstr, "Buy", "Exit");
- return true;
- }
- return true;
- }
- /*CMD:cancelarcompra(playerid, params[])//cancelarcompra
- {
- if(!Logged{playerid}) return true;
- if(IsBrowsingMasks[playerid] > 0)
- {
- if(ClothesShop[playerid] == 1) // Binco
- {
- SetPlayerInterior(playerid, 15);
- SetPlayerPos(playerid, 217.741760, -98.467315, 1005.257812);
- SetPlayerFacingAngle(playerid, 85.428855);
- }
- else if(ClothesShop[playerid] == 2) // Pro Laps
- {
- SetPlayerInterior(playerid, 3);
- SetPlayerPos(playerid, 199.539031, -128.424484, 1003.515197);
- SetPlayerFacingAngle(playerid, 180.0);
- ClothesShop[playerid] = 0;
- }
- else if(ClothesShop[playerid] == 3) // D Sachs
- {
- SetPlayerInterior(playerid, 14);
- SetPlayerPos(playerid, 215.935409, -155.250579, 1000.523437);
- SetPlayerFacingAngle(playerid, 90.0);
- ClothesShop[playerid] = 0;
- }
- else if(ClothesShop[playerid] == 4) // Sub urban
- {
- SetPlayerInterior(playerid, 1);
- SetPlayerPos(playerid, 214.644851, -40.850963, 1002.023437);
- SetPlayerFacingAngle(playerid, 90.0);
- ClothesShop[playerid] = 0;
- }
- else if(ClothesShop[playerid] == 5) // ZIP
- {
- SetPlayerInterior(playerid, 18);
- SetPlayerPos(playerid, 180.1575, -88.2124, 1002.0234);
- SetPlayerFacingAngle(playerid, 90.0);
- ClothesShop[playerid] = 0;
- }
- SetPlayerVirtualWorldEx(playerid, BizzData[IsInBizzID[playerid]][BizzVW]);
- BrowseMaskType[playerid] = 0;
- IsBrowsingMasks[playerid] = 0;
- ClothesShop[playerid] = 0;
- SetCameraBehindPlayer(playerid);
- //PlayerTextDrawHide(playerid, MaskHelpText[playerid]);
- TogglePlayerControllable(playerid, 1);
- for(new i = 0; i < MAX_TEMPCLOTHES; i++)
- {
- if(Clothing_Objects[playerid][i] != INVALID_OBJECT_ID)
- {
- DestroyDynamicObjectEx(Clothing_Objects[playerid][i], "Clothing_Objects[playerid][i]");
- Clothing_Objects[playerid][i] = INVALID_OBJECT_ID;
- }
- }
- }
- return true;
- }*/
- CMD:comprar(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsPlayerInRangeOfPoint(playerid,5.5,-27.167560,-89.524269,1003.546875) || IsPlayerInRangeOfPoint(playerid,5.5,-23.428977, -55.200191, 1003.546875) || IsPlayerInRangeOfPoint(playerid,5.5,2.20236, -28.508106, 1003.549438) || IsPlayerInRangeOfPoint(playerid, 5.5, 1248.3158,204.4189,2020.6406) || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- if(b <= 0) return SysMsg(playerid,"You are not in a shop..");
- if(BizzData[b][BizzOwnerSQLID] > 0 && BizzData[b][BizzStock] <= 0) return SysMsg(playerid,"Não há nada no estoque.");
- gstr[0] = EOS;
- strcat(gstr, "{FFFFFF}Item\t{FFFFFF}Cost\n");
- strcat(gstr, "{FFFFFF}Backpack/Parachute\t{3D9140}$135\n");
- strcat(gstr, "{FFFFFF}Basic Calculator\t{3D9140}$45\n");
- strcat(gstr, "{FFFFFF}Bat\t{3D9140}$45\n");
- strcat(gstr, "{FFFFFF}Blindfold\t{3D9140}$25\n");
- strcat(gstr, "{FFFFFF}Bottle of Water\t{3D9140}$2\n");
- strcat(gstr, "{FFFFFF}Bottles of Water (x6)\t{3D9140}$10\n");
- strcat(gstr, "{FFFFFF}Cane\t{3D9140}$50\n");
- strcat(gstr, "{FFFFFF}Dice\t{3D9140}$5\n");
- strcat(gstr, "{FFFFFF}First Aid Kit\t{3D9140}$65\n");
- strcat(gstr, "{FFFFFF}Flowers\t{3D9140}$15\n");
- strcat(gstr, "{FFFFFF}Fuel Container\t{3D9140}$125\n");
- strcat(gstr, "{FFFFFF}Golf Club\t{3D9140}$155\n");
- strcat(gstr, "{FFFFFF}Lighter\t{3D9140}$5\n");
- strcat(gstr, "{FFFFFF}Notepad\t{3D9140}$6\n");
- strcat(gstr, "{FFFFFF}Pack of Cigarettes (x10)\t{3D9140}$3\n");
- strcat(gstr, "{FFFFFF}Pack of Cigarettes (x20)\t{3D9140}$5\n");
- strcat(gstr, "{FFFFFF}Pool Cue\t{3D9140}$80\n");
- strcat(gstr, "{FFFFFF}Rope\t{3D9140}$12\n");
- strcat(gstr, "{FFFFFF}Shovel\t{3D9140}$35\n");
- strcat(gstr, "{FFFFFF}Small Logs\t{3D9140}$100\n");
- strcat(gstr, "{FFFFFF}SPECIAL: Santa Hat\t{3D9140}$50\n");
- strcat(gstr, "{FFFFFF}Spraycan\t{3D9140}$50\n");
- strcat(gstr, "{FFFFFF}Watch\t{3D9140}$250\n");
- strcat(gstr, "{FFFFFF}Writing Paper (x5)\t{3D9140}$5\n");
- strcat(gstr, "{FFFFFF}Writing Pen\t{3D9140}$3\n");
- Dialog_Show(playerid, ShopDialog, DIALOG_STYLE_TABLIST_HEADERS, "General Store", gstr, "Buy", "Cancel");
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid,5.5, 1643.2906,326.9814,1085.8859))
- {
- if(IsInBizzID[playerid] <= 0) return SysMsg(playerid,"You are not in a shop.");
- if(BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 && BizzData[IsInBizzID[playerid]][BizzStock] <= 0) return SysMsg(playerid,"This business has no stock left.");
- gstr[0] = EOS;
- strcat(gstr, "{FFFFFF}Item\t{FFFFFF}Cost\n");
- strcat(gstr, "{3D9140}$100{FFFFFF} Phone Credit\t{3D9140}$100\n");
- strcat(gstr, "{3D9140}$10{FFFFFF} Phone Credit\t{3D9140}$10\n");
- strcat(gstr, "{3D9140}$20{FFFFFF} Phone Credit\t{3D9140}$20\n");
- strcat(gstr, "{3D9140}$50{FFFFFF} Phone Credit\t{3D9140}$50\n");
- strcat(gstr, "{FFFFFF}Basic Calculator\t{3D9140}$45\n");
- strcat(gstr, "{FFFFFF}Boombox (Large)\t{3D9140}$15000\n");
- strcat(gstr, "{FFFFFF}Boombox (Small)\t{3D9140}$7500\n");
- strcat(gstr, "{FFFFFF}Camera\t{3D9140}$125\n");
- strcat(gstr, "{FFFFFF}Mobile Phone\t{3D9140}$300\n");
- strcat(gstr, "{FFFFFF}Phone Car Charger Adapter\t{3D9140}$395\n");
- strcat(gstr, "{FFFFFF}Phonebook\t{3D9140}$5\n");
- strcat(gstr, "{FFFFFF}Pocket GPS\t{3D9140}$400\n");
- strcat(gstr, "{FFFFFF}Radio\t{3D9140}$225\n");
- strcat(gstr, "{FFFFFF}Watch\t{3D9140}$250\n");
- Dialog_Show(playerid, ShopDialog, DIALOG_STYLE_TABLIST_HEADERS, "Electronic Store", gstr, "Buy", "Cancel");
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid,4.5,2150.958251,-100.995117,2.755812) || IsPlayerInRangeOfPoint(playerid, 4.5, -800.5269,-1922.8231,9.1117)) //fishing shop
- {
- gstr[0] = EOS;
- strcat(gstr, "Fishing Permit - {3D9140}$500\n");
- strcat(gstr, "Fishing Rod - {3D9140}$150\n");
- strcat(gstr, "Bait (X25) - {3D9140}$10\n");
- strcat(gstr, "Small Fish Crate (100 slots) - {3D9140}$1,000\n");
- strcat(gstr, "Medium Fish Crate (250 slots) - {3D9140}$2,500\n");
- strcat(gstr, "Large Fish Crate (500 slots) - {3D9140}$5,000\n");
- Dialog_Show(playerid, FishingBuy, DIALOG_STYLE_LIST, "Fishing Store", gstr, "Buy", "Cancel");
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid,7.5,312.582183, -165.342315, 999.601013)) //ammunation
- {
- if(IsInBizzID[playerid] <= 0) return SysMsg(playerid,"You are not in a shop.");
- if(BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 && BizzData[IsInBizzID[playerid]][BizzStock] <= 0) return SysMsg(playerid,"This business has no stock left.");
- gstr[0] = EOS;
- if(WeaponLicense[playerid] > 0)
- {
- strcat(gstr, "{FFFFFF}9mm Pistol with 85 ammo - {3D9140}$7500\n");
- strcat(gstr, "{FFFFFF}Desert Eagle with 70 ammo - {3D9140}$10000\n");
- }
- if(WeaponLicense[playerid] > 1)
- {
- strcat(gstr, "{FFFFFF}Country Rifle with 50 ammo - {3D9140}$29500\n");
- strcat(gstr, "{FFFFFF}Shotgun with 50 ammo - {3D9140}$18500\n");
- }
- if(WeaponLicense[playerid] == 3)
- {
- strcat(gstr, "{FFFFFF}MP5 with 120 ammo - {3D9140}$15000\n");
- }
- strcat(gstr, "{FFFFFF}Light Armor - {3D9140}$2500\n");
- strcat(gstr, "{FFFFFF}Pistol Ammo - {3D9140}$3000\n");
- strcat(gstr, "{FFFFFF}Shotgun Ammo - {3D9140}$4000\n");
- strcat(gstr, "{FFFFFF}SMG/UZI Ammo - {3D9140}$5000\n");
- strcat(gstr, "{FFFFFF}Assault Rifle Ammo - {3D9140}$6000\n");
- strcat(gstr, "{FFFFFF}Rifle/Sniper Ammo - {3D9140}$6000\n");
- strcat(gstr, "{FFFFFF}Store Help");
- Dialog_Show(playerid, AmmunationDialog, DIALOG_STYLE_LIST, "Ammunation Store", gstr, "Buy", "Cancel");
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 4.0, -104.774566, -11.245146, 1000.71875)) //sex shop
- {
- if(IsInBizzID[playerid] <= 0) return SysMsg(playerid,"You are not in a shop.");
- if(BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 && BizzData[IsInBizzID[playerid]][BizzStock] <= 0) return SysMsg(playerid,"This business has no stock left.");
- Dialog_Show(playerid, SexShopMenu, DIALOG_STYLE_LIST, "Sex Shop Items", "{FFFFFF}Long Purple Dildo - {3D9140}$3500\n{FFFFFF}Small White Vibrator - {3D9140}$2995\n{FFFFFF}Large White Vibrator - {3D9140}$6250\n{FFFFFF}Silver Vibrator - {3D9140}$5000\n{FFFFFF}Nite Stick - {3D9140}$1200", "Buy", "Cancel");
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1465.098754, -1080.154663, 213.447738) && IsPlayerAdminLevelOK(playerid, 1)) //admin ex shop
- {
- Dialog_Show(playerid, SexShopMenu, DIALOG_STYLE_LIST, "Sex Shop Itens", "{FFFFFF}Dildo roxo longo - {3D9140}$3500\n{FFFFFF}Vibrador branco pequeno - {3D9140}$2995\n{FFFFFF}Vibrato branco grander - {3D9140}$6250\n{FFFFFF}Vibrador de prata - {3D9140}$5000\n{FFFFFF}Nite Stick - {3D9140}$1200", "Comprar", "Cancelar");
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 4.0, 745.4332, 1439.9840, 1102.7031)) //drug shop
- {
- if(IsInBizzID[playerid] <= 0) return SysMsg(playerid,"You are not in a shop.");
- if(BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 && BizzData[IsInBizzID[playerid]][BizzStock] <= 0) return SysMsg(playerid,"This business has no stock left.");
- Dialog_Show(playerid, DrugShopDialog, DIALOG_STYLE_LIST, "Drug Shop Items",
- "{FFFFFF}Rolling Paper (x10) - {3D9140}$40\n\
- {FFFFFF}Bong - {3D9140}$1350\n\
- {FFFFFF}Bottle of Distilled Water - {3D9140}$6\n\
- {FFFFFF}Weed Seed (x10) - {3D9140}$750",
- "Buy", "Cancel");
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 4.0, 2435.888916, 111.16863, 1001.593872)) //pc garage
- {
- if(IsInBizzID[playerid] <= 0) return SysMsg(playerid,"You are not in a shop..");
- if(BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 && BizzData[IsInBizzID[playerid]][BizzStock] <= 0) return SysMsg(playerid,"We are currently out of stock, please come back at another time.");
- gstr[0] = EOS;
- strcat(gstr, "{FFFFFF}Item\t{FFFFFF}Cost\n");
- strcat(gstr, "{FFFFFF}Fuel Container\t{3D9140}$125\n");
- strcat(gstr, "{FFFFFF}Phone Car Charger Adapter\t{3D9140}$395\n");
- strcat(gstr, "{FFFFFF}Supreme Engine Oil\t{3D9140}$115\n");
- strcat(gstr, "{FFFFFF}Toolbox\t{3D9140}$350\n");
- Dialog_Show(playerid, ShopDialog, DIALOG_STYLE_TABLIST_HEADERS, "Palomino Creek Garage", gstr, "Buy", "Cancel");
- return true;
- }
- return true;
- }
- CMD:medkit(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][MedKit] == 0) return SysMsg(playerid, "You don't have a First Aid Kit to use.");
- if(MedKitAction[playerid] != 0 || MedKitActionPlayer[playerid] != -1) return SysMsg(playerid, "You are already using a medkit.");
- new Float:Health;
- if(strcmp("me", params, true) == 0)
- {
- foreach(new i: Player)
- {
- if(MedKitActionPlayer[i] == playerid)
- {
- return SysMsg(playerid, "You are already being healed.");
- }
- }
- new nlwcount = 0, lwcount = 0;
- for(new x = 0; x < HitCount[playerid]; x++)
- {
- switch(Injuries[playerid][x][pWeaponID])
- {
- case 22..34,38: lwcount ++;
- default: nlwcount ++;
- }
- }
- if(lwcount >= 1) return SysMsg(playerid, "You have a lethal wound. You need proper medical treatment.");
- GetPlayerHealth(playerid, Health);
- if(Health == 100.0) return SysMsg(playerid, "You are feeling perfectly fine so do not require this.");
- MedKitAction[playerid] = 20;
- OnePlayAnim(playerid, "CASINO", "dealone", 1.0, 1, 0, 0, 0, 20000);
- format(gstr, sizeof(gstr),"* %s opens a small first aid kit... *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else
- {
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /medkit [player id or name OR 'me' to use on yourself]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return cmd_medkit(playerid, "me");
- foreach(new i: Player)
- {
- if(MedKitActionPlayer[i] == playa)
- {
- return SysMsg(playerid, "This player is already being healed.");
- }
- }
- new nlwcount = 0, lwcount = 0;
- for(new x = 0; x < HitCount[playa]; x++)
- {
- switch(Injuries[playa][x][pWeaponID])
- {
- case 22..34,38: lwcount ++;
- default: nlwcount ++;
- }
- }
- if(lwcount >= 1) return SysMsg(playerid, "This player has a lethal wound. They need proper medical treatment.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,4.0,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to heal them.");
- GetPlayerHealth(playa, Health);
- if(Health == 100.0) return SysMsg(playerid, "That player does not require this.");
- MedKitAction[playerid] = 20;
- MedKitActionPlayer[playerid] = playa;
- SetPlayerToFacePlayer(playerid, playa);
- OnePlayAnim(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 1, 0);
- OnePlayAnim(playa, "SWEET", "Sweet_injuredloop", 4.0, 1, 0, 0, 0, 0);
- SetTimerEx("UnTazePlayer", 20000, 0, "d", playerid);
- SetTimerEx("UnTazePlayer", 20000, 0, "d", playa);
- format(gstr, sizeof(gstr),"* %s opens a small first aid kit... *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- return true;
- }
- CMD:train(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, 768.177551, -42.182048, 1000.686462)) return SysMsg(playerid, "You need to be in a Gym to do this.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /train [boxing/kungfu]");
- PreloadAnimLib(playerid, "GYMNASIUM");
- PreloadAnimLib(playerid, "PARK");
- if(!strcmp("boxing", params, true) || !strcmp("boxer", params, true))
- {
- if(UsingFightStyle{playerid} == FIGHT_STYLE_BOXING) return SysMsg(playerid,"You are already using your Boxing fighting style.");
- if(FightStyleLearned[playerid]{FS_BOXING})
- {
- SysMsg(playerid,"You have already learned Boxing.");
- if(UsingFightStyle{playerid} != FIGHT_STYLE_BOXING) SysMsg(playerid,"To use your boxing fighting style, use /fightstyle (/fs).");
- return 1;
- }
- SetPlayerVirtualWorldEx(playerid, playerid+10000);
- //SetPlayerSkinEx(playerid, 81);
- SetPlayerPos(playerid, 768.280273, -36.697841, 1000.686462);
- SetPlayerFacingAngle(playerid, 220.9);
- TogglePlayerControllable(playerid, 0);
- SetPlayerCameraPos(playerid, 768.3822, -41.8251, 1000.1867);
- SetPlayerCameraLookAt(playerid, 764.3148, -32.6897, 1001.923);
- OnePlayAnim(playerid,"GYMNASIUM","GYMshadowbox",4.0,1,1,1,1,0);
- Dialog_Show(playerid, FightDialog, DIALOG_STYLE_MSGBOX, "Gym", "{FFFFFF}Do you want to learn to fight in the style of {4897FF}Boxing{FFFFFF}?\nThis will cost {4897FF}$50,000", "Yes", "No");
- SetPVarInt(playerid, "FStyleBuy", 1);
- }
- else if(!strcmp("kungfu", params, true) || !strcmp("kung fu", params, true))
- {
- if(UsingFightStyle{playerid} == FIGHT_STYLE_KUNGFU) return SysMsg(playerid,"You are already using your Kung Fu fighting style.");
- if(FightStyleLearned[playerid]{FS_KUNGFU})
- {
- SysMsg(playerid,"You have already learned Kung Fu.");
- if(UsingFightStyle{playerid} != FIGHT_STYLE_KUNGFU) SysMsg(playerid,"To use your kung fu fighting style, use /fightstyle (/fs).");
- return 1;
- }
- SetPlayerVirtualWorldEx(playerid, playerid+10000);
- //SetPlayerSkinEx(playerid, 49);
- SetPlayerPos(playerid, 768.280273, -36.697841, 1000.686462);
- SetPlayerFacingAngle(playerid, 220.9);
- TogglePlayerControllable(playerid, 0);
- SetPlayerCameraPos(playerid, 768.3822, -41.8251, 1000.1867);
- SetPlayerCameraLookAt(playerid, 764.3148, -32.6897, 1001.923);
- OnePlayAnim(playerid,"PARK","Tai_Chi_Loop",4.0,1,0,0,0,0);
- Dialog_Show(playerid, FightDialog, DIALOG_STYLE_MSGBOX, "Gym", "{FFFFFF}Do you want to learn {4897FF}Kung Fu{FFFFFF}?\nThis will cost {4897FF}$50,000", "Yes", "No");
- SetPVarInt(playerid, "FStyleBuy", 2);
- }
- return true;
- }
- CMD:fs(playerid, params[]) return cmd_fightstyle(playerid, params);
- CMD:fightstyle(playerid, params[])
- {
- if(isnull(params)) return SysMsg(playerid,"Usage: /fightstyle [normal/boxing/kungfu]");
- if(!strcmp(params, "normal", true) || !strcmp(params, "none", true) || !strcmp(params, "default", true))
- {
- if(UsingFightStyle{playerid} == FIGHT_STYLE_NORMAL) return SysMsg(playerid, "You are already using this fighting style.");
- SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL);
- UsingFightStyle{playerid} = FIGHT_STYLE_NORMAL;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET FightStyle = %i WHERE id = %i", UsingFightStyle{playerid}, SQLID[playerid]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, -1, "Fighting style set to 'normal'.");
- }
- else if(!strcmp(params, "boxing", true) || !strcmp(params, "boxer", true))
- {
- if(!FightStyleLearned[playerid]{FS_BOXING}) return SysMsg(playerid, "You do not know this fightstyle.");
- if(UsingFightStyle{playerid} == FIGHT_STYLE_BOXING) return SysMsg(playerid, "You are already using this fighting style.");
- SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
- UsingFightStyle{playerid} = FIGHT_STYLE_BOXING;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET FightStyle = %i WHERE id = %i", UsingFightStyle{playerid}, SQLID[playerid]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, -1, "Fighting style set to 'Boxing'.");
- }
- else if(!strcmp(params, "kungfu", true) || !strcmp(params, "kung fu", true))
- {
- if(!FightStyleLearned[playerid]{FS_KUNGFU}) return SysMsg(playerid, "You do not know this fightstyle.");
- if(UsingFightStyle{playerid} == FIGHT_STYLE_KUNGFU) return SysMsg(playerid, "You are already using this fighting style.");
- SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
- UsingFightStyle{playerid} = FIGHT_STYLE_KUNGFU;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET FightStyle = %i WHERE id = %i", UsingFightStyle{playerid}, SQLID[playerid]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, -1, "Fighting style set to 'Kung Fu'.");
- }
- return true;
- }
- CMD:pay(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new playa = -1, PayCash, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]i", name, PayCash)) return SysMsg(playerid,"Usage: /pay [player id or name] [amount to pay]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't pay yourself.");
- if(PayCash < 1 || PayCash > 1000000) return SysMsg(playerid,"Cash must be between $1 and $1,000,000.");
- if(PayCash > Cash[playerid]) return SysMsg(playerid,"You don't have that amount of money.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.5,tX,tY,tZ) || IsSpectating[playa] > -1) return SysMsg(playerid,"You must be close to the player to pay them.");
- GivePlayerCash(playerid, -PayCash);
- GivePlayerCash(playa, PayCash);
- SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You gave %s $%s",NameRP(playa),format_cash(PayCash));
- SendClientMessageF(playa, COLOR_LIGHTGREEN, "%s gave you $%s",NameRP(playerid),format_cash(PayCash));
- format(gstr, sizeof(gstr),"* %s takes out some cash and gives it to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(10.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(!IsPlayerInAnyVehicle(playerid) && !IsPlayerInAnyVehicle(playa))
- {
- SetPlayerToFacePlayer(playerid, playa);
- OnePlayAnim(playerid, "DEALER", "shop_pay", 3.5, 0, 0, 0, 0, 0);
- }
- format(gstr, sizeof(gstr),"[%s] %s(%i) pays %s(%i) $%i. (Total: $%i)", GetServerTimeString(), NameEx(playerid), playerid, NameEx(playa), playa, PayCash, Cash[playerid]);
- if(PayCash >= 1000000)
- {
- format(gstr, sizeof(gstr), "[Admin] %s has given %s $%i.", NameEx(playerid), NameEx(playa), PayCash);
- AdminBroadcast(gstr, 0);
- }
- return true;
- }
- CMD:writecheck(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Checks] == 0) return SysMsg(playerid, "You do not have any checks to write.");
- new playa = -1, PayCash, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]i", name, PayCash)) return SysMsg(playerid,"Usage: /writecheck [player id or name] [amount]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't give a check to yourself.");
- if(PayCash < 10 || PayCash > 50000000) return SysMsg(playerid,"Amount must be between $10 and $50,000,000.");
- if(PayCash > BankBalance[playerid]) return SysMsg(playerid,"You don't have that amount of money in your bank.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.0,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to do this.");
- new checkslot = -1;
- for(new i = 0; i < 3; i++)
- {
- if(PlayerChecks[playa][i] == 0) checkslot = i;
- }
- if(checkslot == -1) return SysMsg(playerid, "That player can't have any more checks.");
- BankBalance[playerid] -= PayCash;
- Inventory[playerid][Checks] --;
- PlayerChecks[playa][checkslot] = PayCash;
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- MySQLUpdateInt(SQLID[playerid], "Checks", Inventory[playerid][Checks], "players");
- new str[8];
- for(new x = 0; x < 3; x++)
- {
- format(str, sizeof(str), "Check%i", x + 1);
- MySQLUpdateInt(SQLID[playa], str, PlayerChecks[playa][x], "players");
- }
- SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You wrote a check of $%s and gave it to %s", format_cash(PayCash), NameRP(playa));
- SendClientMessageF(playa, COLOR_LIGHTGREEN, "%s gave you a check of $%s. Goto the bank to deposit it. (Check Slot %i)", NameRP(playerid), format_cash(PayCash), checkslot + 1);
- format(gstr, sizeof(gstr),"* %s takes out a blank check, writes on it then hands it over to %s. *", NameRP(playerid), NameRP(playa));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(!IsPlayerInAnyVehicle(playerid) && !IsPlayerInAnyVehicle(playa))
- {
- SetPlayerToFacePlayer(playerid, playa);
- OnePlayAnim(playerid, "DEALER", "shop_pay", 3.5, 0, 0, 0, 0, 0);
- }
- format(gstr, sizeof(gstr),"[%s] %s(%i) writes a check for $%i to %s(%i).", GetServerTimeString(), NameEx(playerid), playerid, PayCash, NameEx(playa), playa);
- return true;
- }
- CMD:getchecks(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Checks] > 0) return SysMsg(playerid, "You already have a check book.");
- if(!IsInBank(playerid)) return SysMsg(playerid,"You must be in a bank.");
- if(Cash[playerid] < 25) return SysMsg(playerid, "You need at least $25 for a new check book.");
- Inventory[playerid][Checks] = 50;
- GivePlayerCash(playerid, -25);
- MySQLUpdateInt(SQLID[playerid], "Checks", Inventory[playerid][Checks], "players");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "You now have a new check book (50 blank checks). It cost $25.");
- return true;
- }
- CMD:depositcheck(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsInBank(playerid)) return SysMsg(playerid, "You are not in a bank.");
- new checkslot;
- if(sscanf(params, "i", checkslot)) return SysMsg(playerid,"Usage: /depositcheck [check slot] *Look in /checks for the slot number*");
- if(checkslot < 1 || checkslot > 3) return SysMsg(playerid,"Check slot must be 1, 2 or 3.");
- checkslot --;
- if(PlayerChecks[playerid][checkslot] == 0) return SysMsg(playerid,"No check in that slot to deposit.");
- BankBalance[playerid] += PlayerChecks[playerid][checkslot];
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- new str[8];
- for(new x = 0; x < 3; x++)
- {
- format(str, sizeof(str), "Check%i", x + 1);
- if(checkslot != x) MySQLUpdateInt(SQLID[playerid], str, PlayerChecks[playerid][x], "players");
- else MySQLUpdateInt(SQLID[playerid], str, 0, "players");
- }
- format(gstr, sizeof(gstr), "BANK STATEMENT - %s @ %s\nOld Balance: $%s\nCheck Deposit: $%s\n\nNew Balance: $%s", NameEx(playerid), GetTimeString(), format_cash(BankBalance[playerid]-PlayerChecks[playerid][checkslot]), format_cash(PlayerChecks[playerid][checkslot]), format_cash(BankBalance[playerid]));
- ShowMessage(playerid, "Red County Banking - Check Statement", gstr, "Ok");
- format(gstr, sizeof(gstr), "[%s] %s(%i) deposits a check for $%i.", GetServerTimeString(), NameEx(playerid), playerid, PlayerChecks[playerid][checkslot]);
- PlayerChecks[playerid][checkslot] = 0;
- format(gstr,sizeof(gstr),"* %s deposits a check. *", NameRP(playerid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:checks(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- SendClientMessageF(playerid, COLOR_WHITE, "[Inventory] You currently have %i blank checks.", Inventory[playerid][Checks]);
- new count, value;
- for(new i = 0; i < 3; i++)
- {
- if(PlayerChecks[playerid][i] > 0)
- {
- count ++;
- value += PlayerChecks[playerid][i];
- format(gstr, sizeof(gstr), "Check Slot %i: $%s to be deposited", i + 1, format_cash(PlayerChecks[playerid][i]));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- }
- else
- {
- format(gstr, sizeof(gstr), "Check Slot %i: None", i + 1);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- }
- }
- SendClientMessageF(playerid, COLOR_WHITE, "You have %i checks ready to be deposited at the bank for a total value of $%s.", count, format_cash(value));
- return true;
- }
- CMD:shake(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new playa = -1, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]", name)) return SysMsg(playerid,"Usage: /fshake [player id or name]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't do this to yourself.");
- if(GetPlayerVehicleID(playerid) > 0) return SysMsg(playerid,"You can't do this in a vehicle.");
- if(GetPlayerVehicleID(playa) > 0) return SysMsg(playerid,"You can't do this to someone in a vehicle.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,2.5,tX,tY,tZ) || IsSpectating[playa] != -1) return SysMsg(playerid,"You must be close to the player to shake hands.");
- RequestedToShake[playa] = playerid;
- SetTimerEx("CancelPlayerHandShake", 15000, 0, "ii", playerid, playa);
- format(gstr, sizeof(gstr),"%s wants to shake your hand, use '/accept shake' to continue. (This will time-out in 15 seconds)", NameRP(playerid));
- SendClientMessage(playa,COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"You have requested for %s to shake your hand. They must accept first. (This will time-out in 15 seconds)", NameRP(playa));
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- return true;
- }
- CMD:fshake(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new playa = -1, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]", name)) return SysMsg(playerid,"Usage: /fshake [player id or name]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't do this to yourself.");
- if(GetPlayerVehicleID(playerid) > 0) return SysMsg(playerid,"You can't do this in a vehicle.");
- if(GetPlayerVehicleID(playa) > 0) return SysMsg(playerid,"You can't do this to someone in a vehicle.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,2.5,tX,tY,tZ) || IsSpectating[playa] != -1) return SysMsg(playerid,"You must be close to the player to shake hands.");
- RequestedToFShake[playa] = playerid;
- SetTimerEx("CancelPlayerFHandShake", 15000, 0, "ii", playerid, playa);
- format(gstr, sizeof(gstr),"%s wants to shake your hand (formal), use '/accept fshake' to continue. (This will time-out in 15 seconds)", NameRP(playerid));
- SendClientMessage(playa,COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"You have requested for %s to shake your hand (formal). They must accept first. (This will time-out in 15 seconds)", NameRP(playa));
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- return true;
- }
- CMD:kiss(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new playa = -1, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]", name)) return SysMsg(playerid,"Usage: /kiss [player id or name]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't do this to yourself.");
- if(GetPlayerVehicleID(playerid) > 0) return SysMsg(playerid,"You can't do this in a vehicle.");
- if(GetPlayerVehicleID(playa) > 0) return SysMsg(playerid,"You can't do this to someone in a vehicle.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,2.5,tX,tY,tZ) || IsSpectating[playa] != -1) return SysMsg(playerid,"You must be close to the player to kiss them.");
- RequestedToKiss[playa] = playerid;
- SetTimerEx("CancelPlayerKiss", 15000, 0, "ii", playerid, playa);
- SendClientMessageF(playa, COLOR_WHITE, "%s wants to kiss you, use '/accept kiss' to continue. (This will time-out in 15 seconds)", NameRP(playerid));
- SendClientMessageF(playerid, COLOR_WHITE, "You have requested to kiss %s. They must accept first. (This will time-out in 15 seconds)", NameRP(playa));
- return true;
- }
- CMD:buyticket(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsPlayerInRangeOfPoint(playerid,5.5,-27.167560,-89.524269,1003.546875) || IsPlayerInRangeOfPoint(playerid,5.5,-23.428977, -55.200191, 1003.546875) || IsPlayerInRangeOfPoint(playerid,5.5,2.20236, -28.508106, 1003.549438) || IsPlayerInRangeOfPoint(playerid, 5.5, 1248.3158,204.4189,2020.6406) || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- if(IsPlayingLottery{playerid}) return SysMsg(playerid,"You have already bought a ticket. Please wait until the draw.");
- if(Cash[playerid] < 5) return SysMsg(playerid,"You don't have $5 for a ticket.");
- new ticketnumber;
- if(sscanf(params, "i", ticketnumber)) return SysMsg(playerid,"Usage: /buyticket [number]");
- if(ticketnumber < 1 || ticketnumber > 99) return SysMsg(playerid,"Number Is Invalid! (Must be 1 to 99)");
- LotteryNumber[playerid] = ticketnumber;
- IsPlayingLottery{playerid} = true;
- GivePlayerCash(playerid,-5);
- LotteryJackpot += 5;
- new DrawHour;
- DrawHour = gServerHour + 1;
- if(gServerHour == 23)
- {
- DrawHour = 0;
- }
- format(gstr, sizeof(gstr),"Thanks for buying a lottery ticket for $5. Your number is %i. Good luck!", ticketnumber);
- SendClientMessage(playerid,COLOR_MAGENTA,gstr);
- format(gstr, sizeof(gstr),"A draw is held hourly. The next draw will be at %i:00 ((game time)) with current jackpot $%s.", DrawHour, format_cash(LotteryJackpot));
- SendClientMessage(playerid,COLOR_MAGENTA,gstr);
- printf("[Lottery] %s Buys A Lottery Ticket: %i", NameEx(playerid), ticketnumber);
- }
- else SysMsg(playerid, "You must be in a general store to buy a lottery ticket.");
- return true;
- }
- CMD:bet(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerInRangeOfPoint(playerid,5.0,-2167.633544,643.458557,1052.375000)) return SysMsg(playerid,"You are not in the bet shop.");
- new HorseID, CashBet;
- if(sscanf(params, "ii", HorseID, CashBet)) return SysMsg(playerid,"Usage: /bet [horse id] [bet amount]");
- if(HorseID < 1 || HorseID > 5) return SysMsg(playerid,"Invalid horse ID. Must be between 1 and 5.");
- if(CashBet < 50 || CashBet > 5000) return SysMsg(playerid,"Please place a bet of at least $50 and no more than $5000.");
- if(Cash[playerid] < CashBet) return SysMsg(playerid,"You don't have enough money.");
- if(HasBet[playerid] == 1) return SysMsg(playerid, "You have already placed a bet.");
- SetPlayerCameraPos(playerid, -2162.9819, 640.2431, 1056.1741);
- SetPlayerCameraLookAt(playerid, -2172.0449, 644.4693, 1052.9184);
- SetPlayerPos(playerid, -2168.866699,644.429626,1052.375000);
- SetPlayerFacingAngle(playerid, 47.650478);
- TogglePlayerControllable(playerid,false);
- GivePlayerCash(playerid,-CashBet);
- HasBet[playerid] = 1;
- SetTimerEx("OnPlayerBetFinished",10000,0,"ddd",playerid,CashBet,HorseID);
- SendClientMessage(playerid,COLOR_PINK,"Please Wait Until The Race Is Finished...");
- ShowInfoText(playerid, "~w~Race in progress~n~~b~please wait", 9500);
- return true;
- }
- CMD:buyclothes(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsChangingSkin{playerid}) return SysMsg(playerid,"You are already changing your skin.");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 && BizzData[IsInBizzID[playerid]][BizzStock] <= 0) return SysMsg(playerid,"This business has no stock left.");
- new shop_id = -1;
- if(IsPlayerInRangeOfPoint(playerid, 4.5, 207.674606, -103.337852, 1005.257812)) shop_id = 1; // BINCO
- if(IsPlayerInRangeOfPoint(playerid, 4.5, 207.036727, -129.569824, 1003.507812)) shop_id = 2; // PROLAPS
- if(IsPlayerInRangeOfPoint(playerid, 4.5, 204.281341, -159.792633, 1000.523437)) shop_id = 3; // DEIDER SACHS
- if(IsPlayerInRangeOfPoint(playerid, 4.5, 203.805587, -44.099208, 1001.804687)) shop_id = 4; // SUB URB
- if(IsPlayerInRangeOfPoint(playerid, 4.5, 161.584900, -85.259500, 1001.804700)) shop_id = 5;
- if(shop_id == -1) return SysMsg(playerid,"You must be in a Clothes Shop to change your skin.");
- ClothesShop[playerid] = shop_id;
- Dialog_Show(playerid, ClothingBuy, DIALOG_STYLE_LIST, "Select what you want to buy", "Men's clothes\nFeminine clothes\nNew Men's Clothing\nNew Women's Clothing\nAccessories", "Select", "Cancel");
- return true;
- }
- CMD:changeclothes(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to change your skin.");
- if(IsJailed[playerid] == 1) return SysMsg(playerid,"Please wait until you are out of jail.");
- if(PlayerImprisoned{playerid}) return SysMsg(playerid,"You cannot do this in prison.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid,"This action cannot be performed while you are in handcuffs.");
- if(JobDuty[playerid] == 1) return SysMsg(playerid, "You cannot change clothes on job duty.");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SysMsg(playerid, "You must be on-foot to change clothes.");
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_ENTER_VEHICLE || GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_EXIT_VEHICLE) return SysMsg(playerid, "You cannot do this while entering/exiting a vehicle.");
- if(SwatMode[playerid] == 1) return SysMsg(playerid, "You cannot use this while on S.W.A.T duty.");
- if((Duty[playerid] == 1 && IsCop(playerid)) || Duty[playerid] == 0)
- {
- new Slot;
- if(sscanf(params, "i", Slot)) return SysMsg(playerid,"Usage: /changeclothes [slot] - Look at /Clothes for slots.");
- if(Slot < 1 || Slot > 5) return SysMsg(playerid,"Slot number must be 1 to 5.");
- Slot --;
- if(Clothes[playerid][Slot] == 0) return SysMsg(playerid,"You have no clothes in that slot.");
- if(Clothes[playerid][Slot] == cPlayersSkin[playerid]) return SysMsg(playerid,"You are already using the clothes in that slot.");
- SetPlayerSkinEx(playerid, Clothes[playerid][Slot]);
- cPlayersSkin[playerid] = Clothes[playerid][Slot];
- MySQLUpdateInt(SQLID[playerid], "Skin", cPlayersSkin[playerid], "players");
- Slot ++;
- format(gstr, sizeof(gstr),"* %s changes their clothes. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr), "You have changed into your slot %i clothes.", Slot);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- else return SysMsg(playerid,"You can't change clothes when on duty.");
- return true;
- }
- CMD:clothes(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to change your skin.");
- new tempstr[50];
- format(gstr, sizeof(gstr), "Inventory Clothes: ");
- for(new i = 0; i < 4; i++)
- {
- if(Clothes[playerid][i] > 0)
- {
- format(tempstr, 50, "[Slot %i: %i] ", i+1, Clothes[playerid][i]);
- strcat(gstr, tempstr);
- }
- else
- {
- format(tempstr, 50, "[Slot %i: Empty] ", i+1);
- strcat(gstr, tempstr);
- }
- }
- if(Clothes[playerid][4] > 0)
- {
- format(tempstr, 50, "[Faction: %i] ", Clothes[playerid][4]);
- strcat(gstr, tempstr);
- }
- else strcat(gstr, "[Faction: Empty] ");
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- return true;
- }
- CMD:accept(playerid, params[]) // comando de aceitar
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- new option[32], value[32];
- if(sscanf(params, "s[32]S()[32]", option, value)) return true;
- if(strmatch(option, "faction"))
- {
- if(InvitedToJoinFaction[playerid] == 0) return SysMsg(playerid,"You haven't been invited to a faction.");
- if(InvitedToJoinFaction[playerid] > 0)
- {
- Faction[playerid] = InvitedToJoinFaction[playerid];
- FactionRank[playerid] = 1;
- MySpawnID[playerid] = 2;
- SubFactionSpawn[playerid] = 1;
- SendClientMessageF(playerid,COLOR_ORANGE,"You have joined %i (%s) as rank %i (%s)",Faction[playerid],GetFactionName(playerid),FactionRank[playerid],GetFactionRankName(Faction[playerid], FactionRank[playerid]));
- if(InvitedToJoinFaction[playerid] == 7) UnlockAchievement(playerid, 66);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Faction = %i, FactionRank = 1, MySpawnID = 2, SubFactionSpawn = 1 WHERE id = %i", InvitedToJoinFaction[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- foreach(new players: Player)
- {
- if(players == playerid) continue;
- if(Faction[players] == Faction[playerid] && FactionRank[players] >= 4) SendClientMessageF(players,COLOR_ORANGE,"%s is now in your faction (%s) as rank %s.",NameEx(playerid),GetFactionName(playerid),GetFactionRankName(Faction[playerid], FactionRank[playerid]));
- }
- //GivePlayerWeapons(playerid);
- InvitedToJoinFaction[playerid] = 0;
- //new oldSub[2], newSub[2], oldRank, newRank;
- //FactionLog(InvitedToJoinFactionBy[playerid], SQLID[playerid], 4, oldSub, newSub, oldRank, newRank, InvitedToJoinFaction[playerid]);
- InvitedToJoinFaction[playerid] = 0;
- InvitedToJoinFactionBy[playerid] = 0;
- UnlockAchievement(playerid, 5);
- return true;
- }
- }
- else if(strmatch(option, "quitfaction"))
- {
- if(QuitFromFaction[playerid] == 0) return SysMsg(playerid, "You are not quiting from any faction.");
- SendClientMessageF(playerid, COLOR_WHITE, "You have quit from %s. You are no longer in this faction.", GetFactionName(playerid));
- if(MySpawnID[playerid] == 2)
- {
- MySpawnID[playerid] = 1;
- SubFactionSpawn[playerid] = 0;
- }
- if(Clothes[playerid][0] == 0)
- {
- cPlayersSkin[playerid] = 1;
- SetPlayerSkinEx(playerid, 1);
- }
- if(Clothes[playerid][0] != 0)
- {
- cPlayersSkin[playerid] = Clothes[playerid][0];
- SetPlayerSkinEx(playerid, Clothes[playerid][0]);
- }
- MySQLUpdateInt(SQLID[playerid], "Skin", cPlayersSkin[playerid], "players");
- if(RadioFrequency[playerid] == FACTIONS[Faction[playerid]][FactionRadioChannel]) RadioFrequency[playerid] = 1000;
- for(new r = 0; r < 3; r++)
- {
- if(RadioSlot[playerid][r] == FACTIONS[Faction[playerid]][FactionRadioChannel])
- {
- RadioSlot[playerid][r] = 1000;
- }
- }
- Faction[playerid] = 0;
- FactionRank[playerid] = 0;
- QuitFromFaction[playerid] = 0;
- FactionCustomRank[playerid][0] = EOS;
- IsESU{playerid} = false;
- if(RestrictedVest{playerid}) SetPlayerArmourEx(playerid, 0.0, 1);
- ResetPlayerWeapons(playerid);
- for(new slot = MAX_TOTAL_WEAPONS - 1; slot != -1; slot--)
- {
- if(WeaponData[playerid][slot][WeaponOrigin] == 3)
- {
- ResetWeaponVariables(playerid, 0, slot);
- }
- }
- for(new slot = MAX_TOTAL_WEAPONS - 1; slot != -1; slot--)
- {
- GivePlayerWeapon(playerid, WeaponData[playerid][slot][Weapon], WeaponData[playerid][slot][WeaponAmmo]);
- }
- for(new p; p < MAX_TOYS; p++)
- {
- if(ToyInfo[playerid][p][FactionMask] == 1)
- {
- ClearToyData(playerid, p);
- }
- }
- FirePlayer(SQLID[playerid], 1); //FirePlayer is used here because the queries with /despedir and /accept quitfaction are basically the same.
- return true;
- }
- else if(strmatch(option, "rescue"))
- {
- if(WantsRescue[playerid] == 0 || WantsRescue[playerid] == 1) return true;
- new playa = WantsRescue[playerid] - 500;
- if(IsPlayerConnected(playa))
- {
- SendClientMessageF(playa, COLOR_WHITE, "%s has accepted your help.", NameEx(playerid));
- SendClientMessageF(playerid, COLOR_WHITE, "You have accepted the help from Firefighter %s.", NameEx(playa));
- }
- WantsRescue[playerid] = 1;
- }
- else if(strmatch(option, "house"))
- {
- foreach(new i: Player)
- {
- if(IsPlayerNPC(i)) continue;
- if(SellingAsset[i][1] == playerid)
- {
- if(SellingAsset[i][2] != 1) return SysMsg(playerid,"You have no house to accept.");
- if(HasHouseKey[i][0] != SellingAsset[i][3] && HasHouseKey[i][1] != SellingAsset[i][3])
- {
- SellingAsset[i][0] = 0; //yes/no
- SellingAsset[i][1] = -1; //playerid
- SellingAsset[i][2] = 0; //type
- SellingAsset[i][3] = -1; //id
- SellingAsset[i][4] = 0; //price
- SellingAsset[i][5] = -1; //house slot
- SysMsg(playerid,"The house is no longer available.");
- return true;
- }
- if(Cash[playerid] < SellingAsset[i][4])
- {
- SellingAsset[i][0] = 0; //yes/no
- SellingAsset[i][1] = -1; //playerid
- SellingAsset[i][2] = 0; //type
- SellingAsset[i][3] = -1; //id
- SellingAsset[i][4] = 0; //price
- SellingAsset[i][5] = -1; //house slot
- SysMsg(playerid,"You don't have enough money to buy the house.");
- return true;
- }
- HasHouseKey[i][SellingAsset[i][5]] = -1;
- HouseData[SellingAsset[i][3]][HouseOwnerSQLID] = SQLID[playerid];
- MySpawnID[playerid] = 3;
- ProcessHouseKey(playerid);
- ProcessHouseKey(SellingAsset[i][5]);
- if(HasHouseKey[playerid][0] == SellingAsset[i][3]) SpawnAtHouse[playerid] = 0;
- else if(HasHouseKey[playerid][1] == SellingAsset[i][3]) SpawnAtHouse[playerid] = 1;
- MySQLUpdateInt(HouseData[SellingAsset[i][3]][HouseSQLID], "OwnerSQLID", SQLID[playerid], "houses");
- MySQLUpdateInt(SQLID[playerid], "MySpawnID", MySpawnID[playerid], "players");
- MySQLUpdateInt(SQLID[playerid], "SpawnAtHouse", SpawnAtHouse[playerid], "players");
- GivePlayerCash(playerid, -SellingAsset[i][4]);
- GivePlayerCash(i, SellingAsset[i][4]);
- UnlockAchievement(playerid, 9);
- ShowInfoText(playerid, "~w~PROPERTY ACQUIRED", 5000);
- SendClientMessageF(i, COLOR_WHITE, "%s has bought your house(%s) for $%s. You are no longer the owner.", NameEx(playerid), HouseData[SellingAsset[i][3]][HouseDescription], format_cash(SellingAsset[i][4]));
- SendClientMessageF(playerid, COLOR_WHITE, "You have bought %s's house(%s) for $%s. You are now the new owner.", NameEx(i), HouseData[SellingAsset[i][3]][HouseDescription], format_cash(SellingAsset[i][4]));
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET GuestHouseID = 0 WHERE GuestHouseID = %i", HouseData[SellingAsset[i][3]][HouseSQLID]);
- mysql_pquery(conn, mquery);
- foreach(new x: Player) if(HouseData[SellingAsset[i][3]][HouseSQLID] == GuestHouseID[x]) GuestHouseID[x] = 0;
- SendClientMessage(i, COLOR_WHITE, "Your house guests (if any) have been automatically evicted after selling the house.");
- if(MySpawnID[i] == 3)
- {
- MySpawnID[i] = 1;
- MySQLUpdateInt(SQLID[i], "MySpawnID", MySpawnID[i], "players");
- }
- SellingAsset[i][0] = 0; //yes/no
- SellingAsset[i][1] = -1; //playerid
- SellingAsset[i][2] = 0; //type
- SellingAsset[i][3] = -1; //id
- SellingAsset[i][4] = 0; //price
- SellingAsset[i][5] = -1; //house slot
- break;
- }
- }
- }
- else if(strmatch(option, "bizz"))
- {
- foreach(new i: Player)
- {
- if(IsPlayerNPC(i)) continue;
- if(SellingAsset[i][1] == playerid)
- {
- if(SellingAsset[i][2] != 2) return SysMsg(playerid,"You have no bizz to accept.");
- new hasBizz = 0;
- for(new bz = 0; bz < MAX_BIZZ_PER_PLAYER; bz++)
- {
- if(PlayerBizzID[i][bz] == SellingAsset[i][3]) hasBizz = 1;
- }
- if(hasBizz == 0)
- {
- SellingAsset[i][0] = 0; //yes/no
- SellingAsset[i][1] = -1; //playerid
- SellingAsset[i][2] = 0; //type
- SellingAsset[i][3] = -1; //id
- SellingAsset[i][4] = 0; //price
- SysMsg(playerid,"The bizz is no longer available.");
- return true;
- }
- if(Cash[playerid] < SellingAsset[i][4])
- {
- SellingAsset[i][0] = 0; //yes/no
- SellingAsset[i][1] = -1; //playerid
- SellingAsset[i][2] = 0; //type
- SellingAsset[i][3] = -1; //id
- SellingAsset[i][4] = 0; //price
- SysMsg(playerid,"You don't have enough money to buy the bizz.");
- return true;
- }
- BizzData[SellingAsset[i][3]][BizzOwnerSQLID] = SQLID[playerid];
- MySQLUpdateInt(BizzData[SellingAsset[i][3]][BizzSQLID], "OwnerSQLID", SQLID[playerid], "bizz");
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM bizzmods WHERE BizzID = %i", BizzData[SellingAsset[i][3]][BizzSQLID]);
- mysql_pquery(conn, mquery);
- GivePlayerCash(playerid, -SellingAsset[i][4]);
- GivePlayerCash(i, SellingAsset[i][4]);
- new done[2] = {0};
- for(new id = 0; id < MAX_BIZZ_PER_PLAYER; id++)
- {
- if(done[0] == 0 && PlayerBizzID[i][id] == SellingAsset[i][3])
- {
- PlayerBizzID[i][id] = -1;
- done[0] = 1;
- }
- if(done[1] == 0 && PlayerBizzID[playerid][id] <= 0)
- {
- PlayerBizzID[playerid][id] = SellingAsset[i][3];
- done[1] = 1;
- }
- }
- new h = SellingAsset[i][3];
- UpdateBizzLabel(h);
- ShowInfoText(playerid, "~w~BUSINESS ACQUIRED", 5000);
- SendClientMessageF(i, COLOR_WHITE, "%s has bought your bizz(%s) for $%s. You are no longer the owner.", NameEx(playerid), BizzData[SellingAsset[i][3]][BizzDescription], format_cash(SellingAsset[i][4]));
- SendClientMessageF(playerid, COLOR_WHITE, "You have bought %s's bizz(%s) for $%s. You are now the new owner.", NameEx(i), BizzData[SellingAsset[i][3]][BizzDescription], format_cash(SellingAsset[i][4]));
- SellingAsset[i][0] = 0; //yes/no
- SellingAsset[i][1] = -1; //playerid
- SellingAsset[i][2] = 0; //type
- SellingAsset[i][3] = -1; //id
- SellingAsset[i][4] = 0; //price
- break;
- }
- }
- }
- else if(strmatch(option, "vehicle"))
- {
- foreach(new i: Player)
- {
- if(IsPlayerNPC(i)) continue;
- if(SellingAsset[i][1] == playerid)
- {
- if(SellingAsset[i][2] != 3) return SysMsg(playerid,"You have no vehicle to accept.");
- new hasBizz = 0;
- for(new bz = 1, x = GetVehiclePoolSize(); bz <= x; bz++)
- {
- if(VehicleData[bz][VehicleOwnerSQLID] == SQLID[i])
- if(bz == SellingAsset[i][3]) hasBizz = 1;
- }
- if(hasBizz == 0)
- {
- SellingAsset[i][0] = 0; //yes/no
- SellingAsset[i][1] = -1; //playerid
- SellingAsset[i][2] = 0; //type
- SellingAsset[i][3] = -1; //id
- SellingAsset[i][4] = 0; //price
- SysMsg(playerid,"The vehicle is no longer available.");
- return true;
- }
- if(Cash[playerid] < SellingAsset[i][4])
- {
- SellingAsset[i][0] = 0; //yes/no
- SellingAsset[i][1] = -1; //playerid
- SellingAsset[i][2] = 0; //type
- SellingAsset[i][3] = -1; //id
- SellingAsset[i][4] = 0; //price
- SysMsg(playerid,"You don't have enough money to buy the vehicle.");
- return true;
- }
- new v = SellingAsset[i][3];
- VehicleData[v][VehicleOwnerSQLID] = SQLID[playerid];
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET OwnerSQLID = %i, HotwireExpiration = 0 WHERE id = %i", SQLID[playerid], VehicleData[v][VehSQLID]);
- mysql_pquery(conn, mquery);
- GivePlayerCash(playerid, -SellingAsset[i][4]);
- GivePlayerCash(i, SellingAsset[i][4]);
- if(VehicleData[v][VehicleModel] == 508 && MySpawnID[i] == 6)
- {
- MySpawnID[i] = 1;
- MySQLUpdateInt(SQLID[i], "MySpawnID", MySpawnID[i], "players");
- }
- ShowInfoText(playerid, "~w~VEHICLE ACQUIRED", 5000);
- SendClientMessageF(i, COLOR_WHITE, "%s has bought your vehicle(%s) for $%s. You are no longer the owner.", NameEx(playerid), GetVehicleNameEx(VehicleData[v][VehicleModel]), format_cash(SellingAsset[i][4]));
- SendClientMessageF(playerid, COLOR_WHITE, "You have bought %s's vehicle(%s) for $%s. You are now the new owner.", NameEx(i), GetVehicleNameEx(VehicleData[v][VehicleModel]), format_cash(SellingAsset[i][4]));
- if(VehicleData[v][ForSale])
- {
- VehicleData[v][ForSale] = false;
- VehicleData[v][ForSalePrice] = 0;
- DestroyDynamic3DTextLabel(VehicleData[v][ForSaleLabel]);
- VehicleData[v][ForSaleLabel] = Text3D:INVALID_3DTEXT_ID;
- MySQLUpdateInt(VehicleData[v][VehSQLID], "ForSale", 0, "vehicles");
- MySQLUpdateInt(VehicleData[v][VehSQLID], "ForSalePrice", 0, "vehicles");
- }
- SellingAsset[i][0] = 0; //yes/no
- SellingAsset[i][1] = -1; //playerid
- SellingAsset[i][2] = 0; //type
- SellingAsset[i][3] = -1; //id
- SellingAsset[i][4] = 0; //price
- break;
- }
- }
- }
- else if(strmatch(option, "spray"))
- {
- if(AwaitingSpray[playerid] == 0) return SysMsg(playerid, "No spray offers to accept right now.");
- for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(MechanicSpray[v][1] == playerid)
- {
- if(Cash[playerid] < MechanicSpray[v][4])
- {
- SysMsg(playerid, "You don't have enough money for this spray. The spray was cancelled.");
- GoingToSprayVehicleID[MechanicSpray[v][0]] = 0;
- AwaitingSpray[playerid] = 0;
- MechanicSpray[v][0] = -1;
- MechanicSpray[v][1] = -1;
- MechanicSpray[v][2] = -1;
- MechanicSpray[v][3] = -1;
- MechanicSpray[v][4] = -1;
- MechanicSpray[v][5] = -1;
- break;
- }
- GivePlayerCash(playerid, -MechanicSpray[v][4]);
- GivePlayerCash(MechanicSpray[v][0], MechanicSpray[v][4]);
- ChangeVehicleColorEx(v, MechanicSpray[v][2], MechanicSpray[v][3]);
- UnlockAchievement(MechanicSpray[v][0], 47);
- for(new vi = 1, h = GetVehiclePoolSize(); vi <= h; vi++)
- {
- if(vi == v)
- {
- MySQLUpdateInt(VehicleData[vi][VehSQLID], "Color2", MechanicSpray[v][3], "vehicles");
- MySQLUpdateInt(VehicleData[vi][VehSQLID], "Color1", MechanicSpray[v][2], "vehicles");
- VehicleData[vi][vColor1] = MechanicSpray[v][2];
- VehicleData[vi][vColor2] = MechanicSpray[v][3];
- }
- }
- SendClientMessageF(playerid, COLOR_WHITE, "Spray Accepted - The vehicle was resprayed by Mechanic %s for $%i.", NameEx(MechanicSpray[v][0]), MechanicSpray[v][4]);
- SendClientMessageF(MechanicSpray[v][0], COLOR_WHITE, "Spray Was Accepted - You have resprayed the vehicle for $%i.", MechanicSpray[v][4]);
- format(gstr, sizeof(gstr),"* Mechanic %s resprays the %s %s and %s. *", NameEx(MechanicSpray[v][0]), GetVehicleName(v), VehicleColors[MechanicSpray[v][2]], VehicleColors[MechanicSpray[v][3]]);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- GoingToSprayVehicleID[MechanicSpray[v][0]] = 0;
- AwaitingSpray[playerid] = 0;
- MechanicSpray[v][0] = -1;
- MechanicSpray[v][1] = -1;
- MechanicSpray[v][2] = -1;
- MechanicSpray[v][3] = -1;
- MechanicSpray[v][4] = -1;
- MechanicSpray[v][5] = -1;
- break;
- }
- }
- }
- else if(strmatch(option, "shake"))
- {
- if(RequestedToShake[playerid] == -1) return SysMsg(playerid, "No hand shakes to accept right now.");
- if(!IsPlayerConnected(RequestedToShake[playerid]))
- {
- SysMsg(playerid, "Oops! A System Error has occurred, please report to an Admin. (ERROR: 1-001)");
- RequestedToShake[playerid] = -1;
- return true;
- }
- if(GetPlayerVehicleID(playerid) > 0) return SysMsg(playerid,"You can't do this in a vehicle.");
- if(GetPlayerVehicleID(RequestedToShake[playerid]) > 0) return SysMsg(playerid,"You can't do this to someone in a vehicle.");
- new Float:tX, Float:tY, Float:tZ;
- GetPlayerPos(RequestedToShake[playerid], tX, tY, tZ);
- if(!IsPlayerInRangeOfPoint(playerid, 2.0, tX, tY, tZ)) return SysMsg(playerid,"You must be close to the player to shake hands.");
- SetPlayerToFacePlayer(playerid, RequestedToShake[playerid]);
- SetPlayerToFacePlayer(RequestedToShake[playerid], playerid);
- OnePlayAnim(playerid, "GANGS", "hndshkfa_swt", 3.5, 0, 0, 0, 0, 0);
- OnePlayAnim(RequestedToShake[playerid], "GANGS", "hndshkfa_swt", 3.5, 0, 0, 0, 0, 0);
- format(gstr, sizeof(gstr),"Hand shake with %s was accepted.", NameRP(playerid));
- SendClientMessage(RequestedToShake[playerid],COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"Hand shake with %s was accepted.", NameRP(RequestedToShake[playerid]));
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"* %s shakes hands with %s. *",NameRP(playerid),NameRP(RequestedToShake[playerid]));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(Faction[playerid] == Faction[RequestedToShake[playerid]]) UnlockAchievement(RequestedToShake[playerid], 36);
- if(SQLID[RequestedToShake[playerid]] == 1) UnlockAchievement(playerid, 44);
- if(SQLID[playerid] == 1) UnlockAchievement(RequestedToShake[playerid], 44);
- RequestedToShake[playerid] = -1;
- }
- else if(strmatch(option, "fshake"))
- {
- if(RequestedToFShake[playerid] == -1) return SysMsg(playerid, "No hand shakes to accept right now.");
- if(!IsPlayerConnected(RequestedToFShake[playerid]))
- {
- SysMsg(playerid, "Oops! A System Error has occurred, please report to an Admin. (ERROR: 1-002)");
- RequestedToShake[playerid] = -1;
- return true;
- }
- if(GetPlayerVehicleID(playerid) > 0) return SysMsg(playerid,"You can't do this in a vehicle.");
- if(GetPlayerVehicleID(RequestedToFShake[playerid]) > 0) return SysMsg(playerid,"You can't do this to someone in a vehicle.");
- new Float:tX, Float:tY, Float:tZ;
- GetPlayerPos(RequestedToFShake[playerid], tX, tY, tZ);
- if(!IsPlayerInRangeOfPoint(playerid, 2.0, tX, tY, tZ)) return SysMsg(playerid,"You must be close to the player to shake hands.");
- SetPlayerToFacePlayer(playerid, RequestedToFShake[playerid]);
- SetPlayerToFacePlayer(RequestedToFShake[playerid], playerid);
- OnePlayAnim(playerid, "GANGS", "prtial_hndshk_biz_01", 3.5, 0, 0, 0, 0, 0);
- OnePlayAnim(RequestedToFShake[playerid], "GANGS", "prtial_hndshk_biz_01", 3.5, 0, 0, 0, 0, 0);
- format(gstr, sizeof(gstr),"Formal hand shake with %s was accepted.", NameRP(playerid));
- SendClientMessage(RequestedToFShake[playerid],COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"Formal hand shake with %s was accepted.", NameRP(RequestedToFShake[playerid]));
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"* %s shakes hands with %s. *",NameRP(playerid),NameRP(RequestedToFShake[playerid]));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(Faction[playerid] == Faction[RequestedToFShake[playerid]]) UnlockAchievement(RequestedToFShake[playerid], 36);
- if(strcmp("Alec_Rae", GetName(RequestedToFShake[playerid]), false) == 0) UnlockAchievement(playerid, 44);
- if(strcmp("Alec_Rae", GetName(playerid), false) == 0) UnlockAchievement(RequestedToFShake[playerid], 44);
- RequestedToFShake[playerid] = -1;
- }
- else if(strmatch(option, "kiss"))
- {
- if(RequestedToKiss[playerid] == -1) return SysMsg(playerid, "No kisses to accept right now.");
- if(!IsPlayerConnected(RequestedToKiss[playerid]))
- {
- SysMsg(playerid, "Oops! A System Error has occurred, please report to an Admin. (ERROR: 1-003)");
- RequestedToFrisk[playerid] = -1;
- return true;
- }
- if(GetPlayerVehicleID(playerid) > 0) return SysMsg(playerid,"You can't do this in a vehicle.");
- if(GetPlayerVehicleID(RequestedToKiss[playerid]) > 0) return SysMsg(playerid,"You can't do this to someone in a vehicle.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(RequestedToKiss[playerid],tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,2.0,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to kiss them.");
- SetPlayerToFacePlayer(playerid, RequestedToKiss[playerid]);
- SetPlayerToFacePlayer(RequestedToKiss[playerid], playerid);
- OnePlayAnim(playerid, "KISSING", "Playa_Kiss_02", 3.5, 0, 0, 0, 0, 0);
- OnePlayAnim(RequestedToKiss[playerid], "KISSING", "Grlfrd_Kiss_02", 3.5, 0, 0, 0, 0, 0);
- format(gstr, sizeof(gstr),"Kiss with %s was accepted.", NameRP(playerid));
- SendClientMessage(RequestedToKiss[playerid],COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"Kiss with %s was accepted.", NameRP(RequestedToKiss[playerid]));
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"* %s kisses %s. *",NameRP(playerid),NameRP(RequestedToKiss[playerid]));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- RequestedToKiss[playerid] = -1;
- }
- else if(strmatch(option, "sharedkey"))
- {
- if(VehicleShareOffer[playerid][0] == -1) return SysMsg(playerid, "No shared key to accept.");
- format(gstr, sizeof(gstr),"Vehicle share with %s was accepted.", NameRP(playerid));
- SendClientMessage(VehicleShareOffer[playerid][0],COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"Vehicle share with %s was accepted. You can now use their vehicle for up to %i minutes.", NameRP(VehicleShareOffer[playerid][0]), VehicleShareOffer[playerid][2]);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- SendClientMessage(playerid, COLOR_WHITE, "You can remove this shared key at any time using /removesharedkey.");
- VehicleBorrowKey[playerid] = VehicleData[VehicleShareOffer[playerid][1]][VehSQLID];
- VehicleBorrowKeyTime[playerid] = VehicleShareOffer[playerid][2];
- MySQLUpdateInt(SQLID[playerid], "BorrowKey", VehicleBorrowKey[playerid], "players");
- MySQLUpdateInt(SQLID[playerid], "BorrowKeyTime", VehicleBorrowKeyTime[playerid], "players");
- VehicleShareOffer[playerid][0] = -1;
- VehicleShareOffer[playerid][1] = 0;
- VehicleShareOffer[playerid][2] = 0;
- }
- else if(strmatch(option, "frisk"))
- {
- if(RequestedToFrisk[playerid] == -1) return SysMsg(playerid, "No frisks to accept right now.");
- if(!IsPlayerConnected(RequestedToFrisk[playerid]))
- {
- SysMsg(playerid, "Oops! A System Error has occurred, please report to an Admin. (ERROR: 1-004)");
- RequestedToFrisk[playerid] = -1;
- return true;
- }
- new playa = -1;
- foreach(new i: Player)
- {
- if(RequestedToFrisk[playerid] == i)
- {
- playa = i;
- break;
- }
- }
- if(GetPlayerVehicleID(playerid) > 0) return SysMsg(playerid,"You can't do this in a vehicle.");
- if(GetPlayerVehicleID(playa) > 0) return SysMsg(playerid,"You can't do this to someone in a vehicle.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playerid,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,2.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to frisk them.");
- format(gstr, sizeof(gstr),"* %s frisks %s. *", NameRP(playa), NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"%s has frisked you.", NameRP(playa));
- SendClientMessage(playerid, COLOR_ORANGE, gstr);
- new wCount = 0;
- format(gstr, sizeof(gstr), "[Weapons] ");
- for(new i = 0; i < MAX_TOTAL_WEAPONS; i++)
- {
- if(WeaponData[playerid][i][Weapon] > 0)
- {
- if(wCount != 0) strcat(gstr, ", ");
- strcat(gstr, GetWeaponNameFromID(WeaponData[playerid][i][Weapon]));
- wCount ++;
- }
- }
- if(wCount == 0) strcat(gstr, "None.");
- SendClientMessage(playa, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "[Misc] Cash: $%s", format_cash(Cash[playerid]));
- SendClientMessage(playa, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr), "[Drugs] Weed: %ig, Cocaine: %ig, Moonshine: %iL", Inventory[playerid][Weed], Inventory[playerid][Cocaine], Inventory[playerid][MoonShine]);
- SendClientMessage(playa, COLOR_WHITE, gstr);
- RequestedToFrisk[playerid] = -1;
- }
- else if(strmatch(option, "movein"))
- {
- if(OfferedMoveinFrom[playerid][0] == -1) return SysMsg(playerid, "No 'move ins' to accept right now.");
- new playa = OfferedMoveinFrom[playerid][0], hid = OfferedMoveinFrom[playerid][1];
- OfferedMoveinFrom[playerid][0] = -1;
- OfferedMoveinFrom[playerid][1] = -1;
- if(!IsPlayerConnected(playa)) return SysMsg(playerid, "Oops! A System Error has occurred, please report to an Admin. (ERROR: 1-005)");
- new ghouse = HasHouseKey[playa][hid];
- if(ghouse <= 0) return SysMsg(playerid, "Oops! A System Error has occurred, please report to an Admin. (ERROR: 1-005-1)");
- MySpawnID[playerid] = 5;
- GuestHouseID[playerid] = HouseData[ghouse][HouseSQLID];
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET GuestHouseID = %i, MySpawnID = %i WHERE id = %i", HouseData[ghouse][HouseSQLID], MySpawnID[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playa, COLOR_WHITE, "%s has just moved into your house.", NameEx(playerid));
- SendClientMessageF(playerid,COLOR_GOLD, "You have moved into '%s' with %s. Your spawn point has automatically been set to this house.", HouseData[ghouse][HouseDescription], NameEx(playa));
- }
- else if(strmatch(option, "taxi"))
- {
- new vehid = GetPlayerVehicleID(playerid);
- foreach(new i: Player)
- {
- if(vehid == GetPlayerVehicleID(i) && TaxiForceFare[i] == playerid)
- {
- TaxiForceFare[i] = -1;
- TaxiFareID[i] = playerid;
- TaxiMeter[i] = 0;
- TaxiFare[playerid] = 1;
- format(gstr, sizeof(gstr),"You have accepted the ride from %s. Where would you like to go?", NameEx(i));
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- format(gstr, sizeof(gstr),"%s has confirmed the Taxi fare. They are now your customer and you can start the meter if needed.", NameEx(playerid));
- SendClientMessage(i,COLOR_WHITE,gstr);
- return true;
- }
- }
- SysMsg(playerid, "No taxis to accept right now.");
- }
- else if(strmatch(option, "blindfold"))
- {
- if(RequestedToBlindfold[playerid] == -1) return SysMsg(playerid, "You do not have any pending blindfold requests.");
- if(!IsPlayerConnected(RequestedToBlindfold[playerid]))
- {
- SysMsg(playerid, "Oops! A System Error has occurred, please report to an Admin. (ERROR: 1-004)");
- RequestedToBlindfold[playerid] = -1;
- return true;
- }
- new playa = -1;
- foreach(new i: Player)
- {
- if(RequestedToBlindfold[playerid] == i)
- {
- playa = i;
- break;
- }
- }
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playerid,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playa,2.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to accept a blindfold from them.");
- PlayerTextDrawShow(playerid, BlindfoldEffect[playerid]);
- GangZoneShowForPlayer(playerid, BlindZone, COLOR_BLACK);
- format(gstr, sizeof(gstr),"* %s takes out a blindfold and ties it around the head of %s. *", NameRP(playa), NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"%s has blindfolded you.", NameRP(playa));
- SendClientMessage(playerid, COLOR_ORANGE, gstr);
- RequestedToBlindfold[playerid] = -1;
- Blindfolded[playerid] = 1;
- Inventory[playa][Blindfold] = 0;
- MySQLUpdateInt(SQLID[playerid], "HasBlindfold", Inventory[playa][Blindfold], "players");
- }
- else if(strmatch(option, "heal"))
- {
- if(BeingHealed[playerid] == 0) return SysMsg(playerid, "You do not have any healing requests.");
- new playa = HealedBy[playerid];
- Injuries[playerid][HealID[playerid]][pWeaponID] = 0;
- Injuries[playerid][HealID[playerid]][pBodypart] = 0;
- DeathTimer[playerid] += 30;
- format(gstr, sizeof(gstr),"* %s heals a wound on %s. *", NameRP(playa), NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"%s has healed one of your wounds.", NameRP(playa));
- SendClientMessage(playerid, COLOR_ORANGE, gstr);
- Healing[playa] = -1;
- BeingHealed[playerid] = 0;
- HealID[playerid] = -1;
- HealedBy[playerid] = -1;
- HitCount[playerid] --;
- return true;
- }
- else if(strmatch(option, "death"))
- {
- if(!Dead{playerid}) return SysMsg(playerid, "You are not in a critical condition.");
- if(DeathTimer[playerid] != 0) return SysMsg(playerid, "You cannot accept death yet.");
- if(IsPlayerInAnyVehicle(playerid))
- {
- RemovePlayerFromVehicle(playerid);
- SetPlayerPos(playerid, PlayerPosX(playerid), PlayerPosY(playerid), PlayerPosZ(playerid) + 2);
- }
- HasJustDied[playerid] = 2;
- Dead{playerid} = false;
- DeathTimer[playerid] = 0;
- SendPlayerToHospital(playerid);
- ClearInjuriesForPlayer(playerid);
- format(sgstr, sizeof(sgstr), "[Admin] %s has accepted their death. ((/accept death))", NameEx(playerid));
- AdminBroadcast(sgstr, 1);
- format(sgstr, sizeof(sgstr), "[Death] %s has accepted their death. ((/accept death))", NameRP(playerid));
- ProxDetector(20.0, playerid, sgstr, COLOR_FADE3, COLOR_FADE3, COLOR_FADE3, COLOR_FADE3, COLOR_FADE3);
- DestroyDynamic3DTextLabel(LabelFerido[playerid]);
- return true;
- }
- return true;
- }
- CMD:rw(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new vehicleid = GetPlayerVehicleID(playerid);
- if(vehicleid == 0) return SysMsg(playerid, "You must be in a vehicle to control the windows.");
- if(!VehicleHasWindows(vehicleid)) return SysMsg(playerid,"This vehicle has no windows to control.");
- if(Locked{vehicleid} && IsOwnedCar(vehicleid) && SQLID[playerid] != VehicleData[vehicleid][VehicleOwnerSQLID]) return SysMsg(playerid, "You must unlock the vehicle.");
- new status[12];
- if(sscanf(params, "s[12]", status)) return SysMsg(playerid, "Usage: /rw (/rollwindows) [down/open OR up/close]");
- if(strcmp("down", status, true) == 0 || strcmp("open", status, true) == 0)
- {
- if(WindowState{vehicleid} == WINDOWS_OPEN) return SysMsg(playerid, "The windows are already open.");
- WindowState{vehicleid} = WINDOWS_OPEN;
- SetVehicleParamsCarWindows(vehicleid, 0, 0, 0, 0);
- format(gstr, sizeof(gstr),"* %s rolls down all the windows on their %s. *",NameRP(playerid),GetVehicleName(vehicleid));
- ProxDetector(20.0, playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- if(strcmp("up", status, true) == 0 || strcmp("close", status, true) == 0)
- {
- if(WindowState{vehicleid} == WINDOWS_CLOSED) return SysMsg(playerid, "The windows are already closed.");
- WindowState{vehicleid} = WINDOWS_CLOSED;
- SetVehicleParamsCarWindows(vehicleid, 1, 1, 1, 1);
- format(gstr, sizeof(gstr),"* %s closes all the windows on their %s. *",NameRP(playerid),GetVehicleName(vehicleid));
- ProxDetector(20.0, playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else SysMsg(playerid, "Usage: /rw (/rollwindows) [down/open OR up/close]");
- return true;
- }
- CMD:rollwindows(playerid, params[]) return cmd_rw(playerid, params);
- CMD:tow(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new vehicleid = GetPlayerVehicleID(playerid);
- if(!IsTowingVehicle(vehicleid)) return SysMsg(playerid,"You must be in a vehicle that can tow.");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You must be the driver.");
- if(IsTrailerAttachedToVehicle(vehicleid)) return SysMsg(playerid,"You are already towing a vehicle use /detach first.");
- new Float:pX,Float:pY,Float:pZ;
- new Float:vX,Float:vY,Float:vZ;
- GetPlayerPos(playerid,pX,pY,pZ);
- new Found = 0;
- new vid = 1;
- new x = GetVehiclePoolSize();
- while(vid <= x && Found == 0)
- {
- vid++;
- GetVehiclePos(vid,vX,vY,vZ);
- if(floatabs(pX-vX) < 7.0 && floatabs(pY-vY) < 7.0 && floatabs(pZ-vZ) < 7.0 && vid != vehicleid)
- {
- Found = 1;
- AttachTrailerToVehicle(vid, vehicleid);
- }
- }
- if(!Found) SendClientMessage(playerid,COLOR_SKYBLUE,"You are not near any vehicles. Please ensure you are close to the back of a vehicle if you wish to tow it.");
- return true;
- }
- CMD:detach(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SysMsg(playerid,"You must be the driver.");
- new vehicleid = GetPlayerVehicleID(playerid);
- if(vehicleid == 0) return SysMsg(playerid, "You are not in a vehicle.");
- new trailerid = GetVehicleTrailer(vehicleid);
- if(trailerid == 0) return SysMsg(playerid, "You do not have a trailer attached.");
- DetachTrailerFromVehicle(vehicleid);
- SendClientMessage(playerid,COLOR_SKYBLUE,"Trailer Detached");
- return true;
- }
- CMD:pm(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(PMSpamTime[playerid] > 0) return SysMsg(playerid,"Please wait before sending another message.");
- new playa = -1, msg[152];
- if(sscanf(params, "us[152]", playa, msg)) return SysMsg(playerid,"Usage: /pm [player id or name] [message] *Personal Messages are fully OOC*");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You may not PM yourself.");
- if(!AcceptPM{playa} && !IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid,"That player has private messages turned off.");
- if(IsPlayerIgnoringPlayer(playerid, playa)) return SysMsg(playerid,"You may not send a message to someone you are ignoring.");
- if(IsPlayerIgnoringPlayer(playa, playerid)) return SysMsg(playerid,"That player has private messages turned off.");
- if(!Logged{playa}) return SysMsg(playerid,"You may only send messages to logged-in players.");
- if(!IsPlayerIgnoringPlayer(playa, playerid) || IsPlayerAdminLevelOK(playa, 1)) SendSplitMessageF(playa,COLOR_PM,"[PM from %s, ID %i] %s", NameEx(playerid), playerid, msg);
- SendSplitMessageF(playerid,COLOR_PM, "[PM to %s, ID %i] %s", NameEx(playa), playa, msg);
- if(!IsPlayerAdminLevelOK(playerid, 1)) PMSpamTime[playerid] = 3;
- PMReplyID[playa] = playerid;
- if(!AcceptPM{playerid}) SysMsg(playerid,"Note: You currently have private messages turned off and therefore won't receive any replies.");
- if(IsAFK{playa}) SysMsg(playerid,"Note: The player you are messaging is AFK. You may not receive a reply (straight away).");
- return true;
- }
- CMD:rpm(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(PMReplyID[playerid] == -1) return SysMsg(playerid, "You do not have any PMs to reply to.");
- if(isnull(params)) return SysMsg(playerid, "Usage: /rpm [message] *Sends a quick PM to the last player to PM you.*");
- new playa = PMReplyID[playerid];
- format(sgstr, sizeof(sgstr), "%i %s", playa, params);
- cmd_pm(playerid, sgstr);
- return true;
- }
- CMD:isignored(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(IsDonator[playerid] < 3) return SysMsg(playerid,"Only Donator level 3 and above can use this feature.");
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /isignored [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You may not do this to yourself!");
- if(IsPlayerAdminLevelOK(playa, 1)) return SysMsg(playerid,"You will recieve PM's from Administrators even if you are ignoring them.");
- if(IsPlayerIgnoringPlayer(playerid, playa)) SendClientMessageF(playerid,COLOR_WHITE, "You are indeed ignoring PM's from %s.", NameEx(playa));
- else SendClientMessageF(playerid,COLOR_WHITE, "You are not ignoring PM's from %s.", NameEx(playa));
- return true;
- }
- CMD:togglepm(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /togglepm ['on' or 'off' or ID]");
- if(strcmp("off", params, true) == 0)
- {
- if(!AcceptPM{playerid}) return SysMsg(playerid,"You already have PM replies turned off.");
- AcceptPM{playerid} = false;
- SendClientMessage(playerid, COLOR_WHITE, "Personal Messages turned off, other players can't PM you.");
- return true;
- }
- else if(strcmp("on", params, true) == 0)
- {
- if(AcceptPM{playerid}) return SysMsg(playerid,"You already have PM replies turned on.");
- AcceptPM{playerid} = true;
- SendClientMessage(playerid, COLOR_WHITE, "Personal Messages turned on, other players may PM you.");
- return true;
- }
- else if(IsNumeric(params) || IsPlayerConnected(GetPlayerIDs(params)))
- {
- new playa = GetPlayerIDs(params);
- if(playa == playerid) return SysMsg(playerid,"You may not ignore yourself!");
- if(IsPlayerAdminLevelOK(playa, 1)) return SysMsg(playerid,"You may not ignore Admins.");
- if(!IsPlayerIgnoringPlayer(playerid, playa))
- {
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO `ignore` (PlayerSQLID,IgnoringSQLID) VALUES (%i,%i)", SQLID[playerid], SQLID[playa]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_DONATE, "You are now ignoring PM's from %s.", NameEx(playa));
- return true;
- }
- else if(IsPlayerIgnoringPlayer(playerid, playa))
- {
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM `ignore` WHERE PlayerSQLID=%i AND IgnoringSQLID=%i", SQLID[playerid], SQLID[playa]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_DONATE, "You are no longer ignoring PM's from %s.", NameEx(playa));
- return true;
- }
- }
- SysMsg(playerid,"Usage: /togglepm ['on' or 'off' or ID]");
- return true;
- }
- CMD:toggold(playerid)
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(IsDonator[playerid] < 2) return SysMsg(playerid,"Only level 2+ Donators can use this feature.");
- if(GoldToggle[playerid] == 0)
- {
- if(ADuty[playerid] == 1) return SysMsg(playerid, "You are on admin duty.");
- GoldToggle[playerid] = 1;
- SetPlayerColor(playerid, COLOR_DONATE);
- SendClientMessage(playerid, COLOR_WHITE, "Donator Message: Your golden OOC and name are now turned on.");
- }
- else
- {
- GoldToggle[playerid] = 0;
- SetPlayerColor(playerid, 0xFFFFFF00);
- SendClientMessage(playerid, COLOR_WHITE, "Donator Message: Your golden OOC and name are now turned off.");
- }
- return true;
- }
- CMD:togooc(playerid)
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(IsDonator[playerid] < 2) return SysMsg(playerid,"Only level 2+ Donators can use this feature.");
- if(OOCToggle[playerid] == 0)
- {
- OOCToggle[playerid] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "Donator Message: The OOC chat channel is now disabled for you.");
- }
- else
- {
- OOCToggle[playerid] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "Donator Message: The OOC chat channel is now enabled for you.");
- }
- return true;
- }
- CMD:togdooc(playerid)
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(IsDonator[playerid] < 1) return SysMsg(playerid,"Only Donators can use this feature.");
- ToggleDOOC{playerid} = !ToggleDOOC{playerid};
- SendClientMessage(playerid, COLOR_WHITE, (ToggleDOOC{playerid}) ? ("Donator Message: The Donator OOC chat channel is now disabled for you.") : ("Donator Message: The Donator OOC chat channel is now enabled for you."));
- return true;
- }
- CMD:gtoghc(playerid)
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerAdminLevelOK(playerid, 4)) return SysMsg(playerid, AUTHMSG);
- GlobalHelperChatTog = !GlobalHelperChatTog;
- foreach(new i: Player)
- {
- if(IsHelper{i} || AdminLevel[i] != 0)
- {
- if(GlobalHelperChatTog) SendClientMessage(i, COLOR_LIGHTGREEN, "The Helper Chat has been disabled.");
- else SendClientMessage(i, COLOR_LIGHTGREEN, "The Helper Chat has been enabled.");
- }
- }
- return true;
- }
- CMD:togshoutanim(playerid)
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- ShoutAnimToggle{playerid} = !ShoutAnimToggle{playerid};
- if(ShoutAnimToggle{playerid}) SendClientMessage(playerid, COLOR_WHITE, "The shout (/s) animation is now enabled for you.");
- else SendClientMessage(playerid, COLOR_WHITE, "The shout (/s) animation is now disabled for you.");
- MySQLUpdateInt(SQLID[playerid], "ShoutAnimToggle", ShoutAnimToggle{playerid}, "players");
- return true;
- }
- CMD:togtalkanim(playerid)
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- TalkAnimToggle{playerid} = !TalkAnimToggle{playerid};
- if(TalkAnimToggle{playerid}) SendClientMessage(playerid, COLOR_WHITE, "The talk animation is now enabled for you.");
- else SendClientMessage(playerid, COLOR_WHITE, "The talk animation is now disabled for you.");
- MySQLUpdateInt(SQLID[playerid], "TalkAnimToggle", TalkAnimToggle{playerid}, "players");
- return true;
- }
- CMD:tognews(playerid)
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- NewsToggle{playerid} = !NewsToggle{playerid};
- if(NewsToggle{playerid}) SendClientMessage(playerid, COLOR_WHITE, "News Broadcasts are now enabled for you.");
- else SendClientMessage(playerid, COLOR_WHITE, "News Broadcasts are now disabled for you.");
- return true;
- }
- CMD:togadverts(playerid)
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- AdvertsToggle{playerid} = !AdvertsToggle{playerid};
- if(AdvertsToggle{playerid}) SendClientMessage(playerid, COLOR_WHITE, "Adverts are now disabled for you.");
- else SendClientMessage(playerid, COLOR_WHITE, "Adverts are now enabled for you.");
- return true;
- }
- CMD:togaudiostreams(playerid)
- {
- if(!Logged{playerid}) return true;
- AudioToggle{playerid} = !AudioToggle{playerid};
- if(AudioToggle{playerid})
- {
- StopAudioStreamForPlayer(playerid);
- SendClientMessage(playerid, COLOR_WHITE, "Certain audio streams now disabled for you.");
- }
- else SendClientMessage(playerid, COLOR_WHITE, "Certain audio streams are now enabled for you.");
- return true;
- }
- CMD:toghints(playerid)
- {
- if(!Logged{playerid}) return true;
- HintToggle{playerid} = !HintToggle{playerid};
- if(HintToggle{playerid}) SendClientMessage(playerid, COLOR_WHITE, "Hint messages are now disabled for you.");
- else SendClientMessage(playerid, COLOR_WHITE, "Hint messages are now enabled for you.");
- return true;
- }
- CMD:notepad(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][Notepad] == 0) return SysMsg(playerid,"You don't have a Notepad to use.");
- new action[10], page, text[75];
- if(sscanf(params, "s[10]I(0)S()[75]", action, page, text)) return SysMsg(playerid,"Usage: /notepad [write / read / clear / edit / show] [page number] [text (if writing)]");
- if(strcmp("clear", action, false) == 0)
- {
- if(page == 0) return SysMsg(playerid,"Usage: /notepad Clear [page number]");
- if(page < 1 || page > 5) return SysMsg(playerid,"Invalid page number. Use 1 to 5 only.");
- if(strcmp("blank", NotepadText[playerid][page-1], true) == 0) return SysMsg(playerid,"That page is already blank.");
- NotepadText[playerid][page-1] = "blank";
- new str[10];
- for(new x = 0; x < 5; x++)
- {
- format(str, sizeof(str), "Notepad%i", x + 1);
- MySQLUpdateString(SQLID[playerid], str, NotepadText[playerid][x], "players");
- }
- SendClientMessageF(playerid, COLOR_WHITE, "You have cleared page %i of your notepad.", page);
- return true;
- }
- else if(strcmp("read", action, false) == 0)
- {
- if(page == 0) return SysMsg(playerid,"Usage: /notepad Read [page number]");
- if(page < 1 || page > 5) return SysMsg(playerid,"Invalid page number. Use 1 to 5 only.");
- if(strcmp("blank", NotepadText[playerid][page-1], true) == 0) return SysMsg(playerid,"That page is blank.");
- format(sgstr,sizeof(sgstr),"* %s gets a notepad out and reads one of the pages. *",NameRP(playerid));
- ProxDetector(15.0,playerid,sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessageF(playerid, COLOR_WHITE, "[Notepad: Page %i] %s", page, NotepadText[playerid][page-1]);
- return true;
- }
- else if(strcmp("write", action, false) == 0)
- {
- if(Inventory[playerid][Pen] == 0) return SysMsg(playerid,"You don't have a pen to write with.");
- if(page == 0) return SysMsg(playerid,"Usage: /notepad Write [page number] [text]");
- if(page < 1 || page > 5) return SysMsg(playerid,"Invalid page number. Use 1 to 5 only.");
- if(strcmp("blank", NotepadText[playerid][page-1], true) != 0) return SysMsg(playerid,"This page has already got text on it. Please clear this page to use it.");
- if(isnull(text)) return SysMsg(playerid,"Usage: /notepad Write [page number] [text]");
- if(strlen(text) > 73) return SysMsg(playerid,"The message was too long to fit on the page.");
- format(NotepadText[playerid][page-1], 75, text);
- new str[10];
- for(new x = 0; x < 5; x++)
- {
- format(str, sizeof(str), "Notepad%i", x + 1);
- MySQLUpdateString(SQLID[playerid], str, NotepadText[playerid][x], "players");
- }
- format(sgstr,sizeof(sgstr),"* %s gets a notepad out and writes on one of the pages. *",NameRP(playerid));
- ProxDetector(15.0,playerid,sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessageF(playerid, COLOR_WHITE, "[Notepad: Page %i: Write] %s", page, NotepadText[playerid][page-1]);
- Inventory[playerid][Pen] --;
- MySQLUpdateInt(SQLID[playerid], "HasPen", Inventory[playerid][Pen], "players");
- if(Inventory[playerid][Pen] <= 0)
- {
- Inventory[playerid][Pen] = 0;
- format(sgstr,sizeof(sgstr),"* %s's pen has ran out of ink, it is now useless. *",NameRP(playerid));
- ProxDetector(15.0,playerid,sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "> Your Pen has no ink left, you throw it away.");
- }
- return true;
- }
- else if(strcmp("edit", action, false) == 0)
- {
- if(page == 0) return SysMsg(playerid,"Usage: /notepad Edit [page number] [text] - adds text to the end of the current message");
- if(page < 1 || page > 5) return SysMsg(playerid,"Invalid page number. Use 1 to 5 only.");
- if(strcmp("blank", NotepadText[playerid][page-1], true) == 0) return SysMsg(playerid,"That page is blank. You must 'write' a blank page before editing.");
- if(isnull(text)) return SysMsg(playerid,"Usage: /notepad Edit [page number] [text] - adds text to the end of the current message");
- if(strlen(text) + strlen(NotepadText[playerid][page-1]) > 73) return SysMsg(playerid,"The message and the edit were too long to fit on the page.");
- format(NotepadText[playerid][page-1], 75, "%s %s", NotepadText[playerid][page-1], text);
- new str[10];
- for(new x = 0; x < 5; x++)
- {
- format(str, sizeof(str), "Notepad%i", x + 1);
- MySQLUpdateString(SQLID[playerid], str, NotepadText[playerid][x], "players");
- }
- format(sgstr,sizeof(sgstr),"*%s gets a notepad out and writes on one of the pages. *",NameRP(playerid));
- ProxDetector(15.0,playerid,sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessageF(playerid, COLOR_WHITE, "[Notepad: Page %i: Edit] %s", page, NotepadText[playerid][page-1]);
- return true;
- }
- else if(strcmp("show", action, false) == 0)
- {
- new Float:tX, Float:tY, Float:tZ;
- if(page == 0 || isnull(text)) return SysMsg(playerid,"Usage: /notepad Show [page number] [player id/name]");
- if(page < 1 || page > 5) return SysMsg(playerid,"Invalid page number. Use 1 to 5 only.");
- if(strcmp("blank", NotepadText[playerid][page-1], true) == 0) return SysMsg(playerid,"That page is blank. You must 'write' a blank page before showing it.");
- new playa;
- if(!IsNumeric(text)) playa = GetPlayerID(playerid, text); else playa = strval(text);
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- GetPlayerPos(playa, tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,2.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to show the note.");
- format(sgstr,sizeof(sgstr),"*%s gets a notepad out and shows one of the pages to %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(15.0,playerid,sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessageF(playa, COLOR_WHITE, "[Page] %s", NotepadText[playerid][page-1]);
- return true;
- }
- return true;
- }
- CMD:calc(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][Calculator] == 0) return SysMsg(playerid,"You don't have a Calculator to use.");
- new Float:n1, Float:n2, oper, Float:answer;
- if(sscanf(params, "fcf", n1, oper, n2)) return SysMsg(playerid,"Usage: /calc [first number] [+(add) OR -(subtract) OR *(multiply) OR /(divide)] [second number]");
- format(gstr, sizeof(gstr), "*%s gets a calculator out and presses some buttons. *", NameRP(playerid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- switch(oper)
- {
- case '+': answer = n1 + n2;
- case '-': answer = n1 - n2;
- case '/':
- {
- if(n2 == 0) return SysMsg(playerid, "[CALCULATOR] ERROR: Can't divide by zero");
- answer = n1 / n2;
- }
- case '*': answer = n1 * n2;
- default: return SysMsg(playerid, "[CALCULATOR] ERROR: Invalid Operator");
- }
- SendClientMessageF(playerid, COLOR_WHITE, "[CALCULATOR] %.2f %c %.2f = %.2f", n1, oper, n2, answer);
- return true;
- }
- CMD:rolldice(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][Dice] == 0) return SysMsg(playerid,"You don't have dice. Buy them from a General Store.");
- format(gstr, sizeof(gstr),"* %s throws a dice and it lands on %i. *", NameRP(playerid), random(6)+1);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:flipcoin(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Cash[playerid] <= 0) return SysMsg(playerid,"You don't even have any coins on you.");
- new Side[7], Rand = random(2);
- if(Rand == 0) Side = "Tails";
- if(Rand == 1) Side = "Heads";
- format(gstr, sizeof(gstr),"* %s flips a coin and it lands on %s. *",NameRP(playerid),Side);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:smokecig(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][Lighter] <= 0) return SysMsg(playerid,"You need a lighter to smoke a ciggy.");
- if(Inventory[playerid][Fags] <= 0) return SysMsg(playerid,"You have no more Cigarettes left.");
- Inventory[playerid][Fags] -= 1;
- Inventory[playerid][Lighter] -= 1;
- MySQLUpdateInt(SQLID[playerid], "HasFags", Inventory[playerid][Fags], "players");
- MySQLUpdateInt(SQLID[playerid], "HasLighter", Inventory[playerid][Lighter], "players");
- if(Inventory[playerid][Lighter] <= 0)
- {
- SysMsg(playerid,"Your lighter has just ran out of fluid, You throw it away.");
- Inventory[playerid][Lighter] = 0;
- }
- if(Inventory[playerid][Fags] <= 0)
- {
- SysMsg(playerid,"The pack of Cigarettes has none left, You throw the empty packet away.");
- Inventory[playerid][Fags] = 0;
- }
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
- format(gstr, sizeof(gstr),"* %s takes out a Cigarette and lights it... *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:useammo(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /useammo [ammo type] - Types: 'Pistol', 'Shotgun', 'Rifle', 'Assault', 'SMG' *You must be holding the weapon you wish to add ammo to*");
- new weapid = GetPlayerWeapon(playerid), weapslot = -1;
- if(strcmp("pistol", params, true) == 0)
- {
- if(Inventory[playerid][AmmoBox][AMMOBOX_PISTOL] > 0)
- {
- if(weapid == -1) return SysMsg(playerid,"Invalid Weapon Name.");
- if(weapid < 1 || weapid > 47) return SysMsg(playerid,"Invalid Weapon.");
- if(weapid == 19 || weapid == 20 || weapid == 21) return SysMsg(playerid,"Invalid Weapon.");
- weapslot = GetWeaponSlot(weapid);
- if(weapslot != 2) return SysMsg(playerid,"That weapon can't take pistol ammo.");
- if(WeaponData[playerid][weapslot][Weapon] != weapid) return SysMsg(playerid,"You don't have this weapon.");
- if(WeaponData[playerid][weapslot][WeaponAmmo] == GetDefaultWeaponAmmo(weapid)) return SysMsg(playerid, "You already have max ammo on this weapon.");
- Inventory[playerid][AmmoBox][AMMOBOX_PISTOL] --;
- MySQLUpdateInt(SQLID[playerid], "AmmoBoxPistol", Inventory[playerid][AmmoBox][AMMOBOX_PISTOL], "players");
- WeaponData[playerid][weapslot][WeaponAmmo] = GetDefaultWeaponAmmo(weapid);
- SyncPlayerWeapons(playerid);
- format(gstr, sizeof(gstr), "* %s takes their %s and adds some ammo from a small box to it. *", NameRP(playerid), GetWeaponNameFromID(weapid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr), "You have refilled the ammunition on your %s.", GetWeaponNameFromID(weapid));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- SetPlayerArmedWeapon(playerid, weapid);
- return true;
- }
- else return SysMsg(playerid, "You don't have any pistol ammo boxes.");
- }
- else if(strcmp("shotgun", params, true) == 0)
- {
- if(Inventory[playerid][AmmoBox][AMMOBOX_SHOTGUN] > 0)
- {
- if(weapid == -1) return SysMsg(playerid,"Invalid Weapon Name.");
- if(weapid < 1 || weapid > 47) return SysMsg(playerid,"Invalid Weapon.");
- if(weapid == 19 || weapid == 20 || weapid == 21) return SysMsg(playerid,"Invalid Weapon.");
- weapslot = GetWeaponSlot(weapid);
- if(weapslot != 3) return SysMsg(playerid,"That weapon can't take Shotgun ammo.");
- if(WeaponData[playerid][weapslot][Weapon] != weapid) return SysMsg(playerid,"You don't have this weapon.");
- if(WeaponData[playerid][weapslot][WeaponAmmo] == GetDefaultWeaponAmmo(weapid)) return SysMsg(playerid, "You already have max ammo on this weapon.");
- Inventory[playerid][AmmoBox][AMMOBOX_SHOTGUN] --;
- MySQLUpdateInt(SQLID[playerid], "AmmoBoxShotgun", Inventory[playerid][AmmoBox][AMMOBOX_SHOTGUN], "players");
- WeaponData[playerid][weapslot][WeaponAmmo] = GetDefaultWeaponAmmo(weapid);
- SyncPlayerWeapons(playerid);
- format(gstr, sizeof(gstr), "* %s takes their %s and adds some ammo from a small box to it. *", NameRP(playerid), GetWeaponNameFromID(weapid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr), "You have refilled the ammunition of your %s.", GetWeaponNameFromID(weapid));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- SetPlayerArmedWeapon(playerid, weapid);
- return true;
- }
- else return SysMsg(playerid, "You don't have any shotgun ammo boxes.");
- }
- else if(strcmp("SMG", params, true) == 0)
- {
- if(Inventory[playerid][AmmoBox][AMMOBOX_SMG] > 0)
- {
- if(weapid == -1) return SysMsg(playerid,"Invalid Weapon Name.");
- if(weapid < 1 || weapid > 47) return SysMsg(playerid,"Invalid Weapon.");
- if(weapid == 19 || weapid == 20 || weapid == 21) return SysMsg(playerid,"Invalid Weapon.");
- weapslot = GetWeaponSlot(weapid);
- if(weapslot != 4) return SysMsg(playerid,"That weapon can't take SMG ammo.");
- if(WeaponData[playerid][weapslot][Weapon] != weapid) return SysMsg(playerid,"You don't have this weapon.");
- if(WeaponData[playerid][weapslot][WeaponAmmo] == GetDefaultWeaponAmmo(weapid)) return SysMsg(playerid, "You already have max ammo on this weapon.");
- Inventory[playerid][AmmoBox][AMMOBOX_SMG] --;
- MySQLUpdateInt(SQLID[playerid], "AmmoBoxSMG", Inventory[playerid][AmmoBox][AMMOBOX_SMG], "players");
- WeaponData[playerid][weapslot][WeaponAmmo] = GetDefaultWeaponAmmo(weapid);
- SyncPlayerWeapons(playerid);
- format(gstr, sizeof(gstr), "* %s takes their %s and adds some ammo from a small box to it. *", NameRP(playerid), GetWeaponNameFromID(weapid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr), "You have refilled the ammunition of your %s.", GetWeaponNameFromID(weapid));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- SetPlayerArmedWeapon(playerid, weapid);
- return true;
- }
- else return SysMsg(playerid, "You don't have any SMG ammo boxes.");
- }
- else if(strcmp("Rifle", params, true) == 0)
- {
- if(Inventory[playerid][AmmoBox][AMMOBOX_RIFLE] > 0)
- {
- if(weapid == -1) return SysMsg(playerid,"Invalid Weapon Name.");
- if(weapid < 1 || weapid > 47) return SysMsg(playerid,"Invalid Weapon.");
- if(weapid == 19 || weapid == 20 || weapid == 21) return SysMsg(playerid,"Invalid Weapon.");
- weapslot = GetWeaponSlot(weapid);
- if(weapslot != 6) return SysMsg(playerid,"That weapon can't take Rifle ammo.");
- if(WeaponData[playerid][weapslot][Weapon] != weapid) return SysMsg(playerid,"You don't have this weapon.");
- if(WeaponData[playerid][weapslot][WeaponAmmo] == GetDefaultWeaponAmmo(weapid)) return SysMsg(playerid, "You already have max ammo on this weapon.");
- Inventory[playerid][AmmoBox][AMMOBOX_RIFLE] --;
- MySQLUpdateInt(SQLID[playerid], "AmmoBoxRifle", Inventory[playerid][AmmoBox][AMMOBOX_RIFLE], "players");
- WeaponData[playerid][weapslot][WeaponAmmo] = GetDefaultWeaponAmmo(weapid);
- SyncPlayerWeapons(playerid);
- format(gstr, sizeof(gstr), "* %s takes their %s and adds some ammo from a small box to it. *", NameRP(playerid), GetWeaponNameFromID(weapid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr), "You have refilled the ammunition of your %s.", GetWeaponNameFromID(weapid));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- SetPlayerArmedWeapon(playerid, weapid);
- return true;
- }
- else return SysMsg(playerid, "You don't have any rifle ammo boxes.");
- }
- else if(strcmp("Assault", params, true) == 0)
- {
- if(Inventory[playerid][AmmoBox][AMMOBOX_ASSAULT] > 0)
- {
- if(weapid == -1) return SysMsg(playerid,"Invalid Weapon Name.");
- if(weapid < 1 || weapid > 47) return SysMsg(playerid,"Invalid Weapon.");
- if(weapid == 19 || weapid == 20 || weapid == 21) return SysMsg(playerid,"Invalid Weapon.");
- weapslot = GetWeaponSlot(weapid);
- if(weapslot != 5) return SysMsg(playerid,"That weapon can't take Assault Rifle ammo.");
- if(WeaponData[playerid][weapslot][Weapon] != weapid) return SysMsg(playerid,"You don't have this weapon.");
- if(WeaponData[playerid][weapslot][WeaponAmmo] == GetDefaultWeaponAmmo(weapid)) return SysMsg(playerid, "You already have max ammo on this weapon.");
- Inventory[playerid][AmmoBox][AMMOBOX_ASSAULT] --;
- MySQLUpdateInt(SQLID[playerid], "AmmoBoxAssaultR", Inventory[playerid][AmmoBox][AMMOBOX_ASSAULT], "players");
- WeaponData[playerid][weapslot][WeaponAmmo] = GetDefaultWeaponAmmo(weapid);
- SyncPlayerWeapons(playerid);
- format(gstr, sizeof(gstr), "* %s takes their %s and adds some ammo from a small box to it. *", NameRP(playerid), GetWeaponNameFromID(weapid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr), "You have refilled the ammunition on your %s.", GetWeaponNameFromID(weapid));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- SetPlayerArmedWeapon(playerid, weapid);
- return true;
- }
- else return SysMsg(playerid, "You don't have any assault rifle ammo boxes.");
- }
- SysMsg(playerid,"Usage: /useammo [AMMO TYPE] - Types: 'Pistol', 'Shotgun', 'Rifle', 'Assault', 'SMG'");
- return true;
- }
- CMD:gps(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][GPS] == 0 && !IsPlayerInRangeOfPoint(playerid, 2.5, 1244.2136, 165.6529, 2091.3589)) return SysMsg(playerid,"You don't have a GPS.");
- if(IsInHospital{playerid}) return SysMsg(playerid,"Pocket GPS has no signal. (error 01)");
- if(IsDrivingBus{playerid}) return SysMsg(playerid,"Pocket GPS has no signal. (error 02)");
- if(IsInHouseID[playerid] != -1) return SysMsg(playerid,"Pocket GPS has no signal. (error 03)");
- if(IsInBizzID[playerid] != -1) return SysMsg(playerid,"Pocket GPS has no signal. (error 04)");
- new MenuText[64];
- format(MenuText, sizeof(MenuText), "Set Destination\nSaved Place");
- if(HasGPSWaypoint[playerid] == 1) strcat(MenuText, "\nRemove Waypoint");
- strcat(MenuText, "\nExit");
- Dialog_Show(playerid, GPSMenu, DIALOG_STYLE_LIST, "Global Positioning System Menu", MenuText, "Select", "Cancel");
- format(gstr, sizeof(gstr),"* %s takes out a Pocket GPS... *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:navigateto(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(Inventory[playerid][GPS] == 0) return SysMsg(playerid,"You don't have a GPS.");
- if(IsInHospital{playerid}) return SysMsg(playerid,"Pocket GPS has no signal. (error 01)");
- if(IsDrivingBus{playerid}) return SysMsg(playerid,"Pocket GPS has no signal. (error 02)");
- if(IsInHouseID[playerid] != -1) return SysMsg(playerid,"Pocket GPS has no signal. (error 03)");
- if(IsInBizzID[playerid] != -1) return SysMsg(playerid,"Pocket GPS has no signal. (error 04)");
- if(isnull(params)) return SysMsg(playerid,"Usage: /navigateto(/navto) [full or partial name of: house/business]");
- if(strlen(params) < 3) return SysMsg(playerid,"Please use a longer search term.");
- gstr[0] = EOS;
- new matchescount, a = 0, caption[50];
- for(a = 0; a < MAX_HOUSES; a++)
- {
- if(strlen(HouseData[a][HouseDescription]) > 1 && strfind(HouseData[a][HouseDescription], params, true) != -1)
- {
- if(strfind(HouseData[a][HouseDescription], "Montgomery Block", true) != -1) continue;
- if(strfind(HouseData[a][HouseDescription], "Dillimore Block", true) != -1) continue;
- if(strfind(HouseData[a][HouseDescription], "Palomino Block", true) != -1) continue;
- matchescount ++;
- strcat(gstr, "{FF4753}House: {FFFFFF}");
- strcat(gstr, HouseData[a][HouseDescription]);
- strcat(gstr, "\n");
- if(strlen(gstr) > 1950) break;
- }
- }
- for(a = 0; a < MAX_BIZZ; a++)
- {
- if(strlen(gstr) > 1950) break;
- if(strlen(BizzData[a][BizzDescription]) > 1 && strfind(BizzData[a][BizzDescription], params, true) != -1)
- {
- matchescount ++;
- strcat(gstr, "{6896F1}Bizz: {FFFFFF}");
- strcat(gstr, BizzData[a][BizzDescription]);
- strcat(gstr, "\n");
- }
- }
- for(a = 0; a < MAX_INTERIORS; a++)
- {
- if(strlen(gstr) > 1950) break;
- if(strlen(Interiors[a][InteriorName]) > 1 && strfind(Interiors[a][InteriorName], params, true) != -1 && Interiors[a][InteriorNavTo] == 1)
- {
- matchescount++;
- strcat(gstr, "{FFCC11}POI: {FFFFFF}");
- strcat(gstr, Interiors[a][InteriorName]);
- strcat(gstr, "\n");
- }
- }
- if(matchescount == 0) return SysMsg(playerid,"No locations could be found for that search term.");
- if(strlen(gstr) > 1950) SysMsg(playerid,"Maximum amount of locations now being shown, for the rest please use a more specific term.");
- format(caption, sizeof(caption), "{FBFF00}%i {FFFFFF}possible locations found:", matchescount);
- Dialog_Show(playerid, NavigationDialog, DIALOG_STYLE_LIST, caption, gstr, "Goto", "Cancel");
- return true;
- }
- CMD:navto(playerid, params[]) return cmd_navigateto(playerid, params);
- CMD:tie(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(PlayerLevel[playerid] < 4) return SysMsg(playerid,"You must be level 4 to use this.");
- if(Inventory[playerid][Rope] == 0) return SysMsg(playerid,"You don't have rope. Either buy some or untie the person your rope is on.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't tie someone when you are tied!");
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /tie [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't tie yourself.");
- new vehicleid = GetPlayerVehicleID(playerid);
- new tvehicleid = GetPlayerVehicleID(playa);
- if(vehicleid == 0) return SysMsg(playerid, "You must be in a car to tie someone.");
- if(vehicleid != tvehicleid) return SysMsg(playerid, "You must be in the same car to tie the person.");
- if(IsTied[playa] > 0) return SysMsg(playerid,"They are already tied.");
- new success = random(50);
- if(success < 25)
- {
- format(gstr, sizeof(gstr), "* %s has attempted to tie %s but failed. *", NameRP(playerid), NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- Inventory[playerid][Rope] = 0;
- MySQLUpdateInt(SQLID[playerid], "HasRope", Inventory[playerid][Rope], "players");
- IsTied[playa] = 1200;
- TogglePlayerControllable(playa, 0);
- format(gstr, sizeof(gstr),"You tie %s with your rope.", NameRP(playa));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr),"* %s takes out some rope and ties up %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:untie(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- if(IsTied[playerid] > 0) return SysMsg(playerid,"You can't untie someone when you are tied!");
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid,"Usage: /untie [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't untie yourself.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,3.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to do that.");
- if(IsTied[playa] == 0) return SysMsg(playerid,"They are not even tied.");
- Inventory[playerid][Rope] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasRope", Inventory[playerid][Rope], "players");
- IsTied[playa] = 0;
- TogglePlayerControllable(playa, 1);
- format(gstr, sizeof(gstr),"You untie %s and get your rope back.", NameRP(playa));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr),"* %s takes the rope off %s. *",NameRP(playerid),NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:advert(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(AdvertSpamTime[playerid] > 0) return SysMsg(playerid, "Please wait between posting advertisements.");
- if(!AdvertsToggle{playerid}) return SysMsg(playerid, "You can't make an advert as you have adverts disabled.");
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid,"You need a Mobile Phone to post an advert.");
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 2263.7627,-60.7692,1000.0648) || IsPlayerInRangeOfPoint(playerid, 5.0, 2571.6018,1250.0525,2944.2271) || IsPlayerInRangeOfPoint(playerid, 5.0, 754.812927, 102.666061, 70.551887) || IsPlayerInRangeOfPoint(playerid, 5.0, 885.252014, 2262.758544, 238.230422) || IsPlayerInRangeOfPoint(playerid, 2.5, 1182.8987,1360.4265,1002.8235))
- {
- if(isnull(params))
- {
- SysMsg(playerid,"Usage: /advert [message]");
- SysMsg(playerid,"Example: '/advert This is a test' will show as: [Advert] This is a test [Your_Name, Phone: ###]");
- return true;
- }
- if(strlen(params) < 30) return SysMsg(playerid, "Your advert is too short. Please be creative and be IC only.");
- new AdCost = strlen(params) * 5;
- if(IsDonator[playerid] < 3)
- {
- GivePlayerCash(playerid, -AdCost);
- AdvertSpamTime[playerid] = 60;
- format(gstr, sizeof(gstr),"You made an advert %i characters long, costing you $%i ($5/letter).",strlen(params),AdCost);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- else if(IsDonator[playerid] == 3)
- {
- AdCost = AdCost / 2;
- GivePlayerCash(playerid, -AdCost);
- AdvertSpamTime[playerid] = 60;
- format(gstr, sizeof(gstr),"You made an advert %i characters long, costing you $%i. (Donator Bonus)",strlen(params),AdCost);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- else if(IsDonator[playerid] == 4)
- {
- AdvertSpamTime[playerid] = 60;
- format(gstr, sizeof(gstr),"You made an advert %i characters long, costing you $0. (Donator Bonus)",strlen(params),AdCost);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- FACTIONS[FACTION_NEWS][FactionBankBalance] += floatround(1 * AdCost);
- MySQLUpdateInt(FACTION_NEWS, "BankBalance", FACTIONS[FACTION_NEWS][FactionBankBalance], "factions");
- foreach(new i: Player) if(Logged{i} && AdvertsToggle{i}) SendSplitMessageF(i, COLOR_GREEN, "[Advert] %s [%s, Phone: %i]", params, NameEx(playerid), PhoneData[playerid][pNumber]);
- new jbstring[250];
- format(jbstring, 250, "[Advert] %s [%s, Phone: %i]", params, NameEx(playerid), PhoneData[playerid][pNumber]);
- for(new i, k = strlen(jbstring); i != k; i++) {
- if(jbstring[i] > 227) {
- if(jbstring[i] == 'Ç') { jbstring[i] = 'C'; }
- else if(jbstring[i] == 'ç') { jbstring[i] = 'c'; }
- else if(jbstring[i] == 'á') { jbstring[i] = 'a'; }
- else if(jbstring[i] == 'ã') { jbstring[i] = 'a'; }
- else if(jbstring[i] == 'â') { jbstring[i] = 'a'; }
- else if(jbstring[i] == 'à') { jbstring[i] = 'a'; }
- else if(jbstring[i] == 'ä') { jbstring[i] = 'a'; }
- else if(jbstring[i] == 'é') { jbstring[i] = 'e'; }
- else if(jbstring[i] == 'è') { jbstring[i] = 'e'; }
- else if(jbstring[i] == 'ê') { jbstring[i] = 'e'; }
- else if(jbstring[i] == 'ë') { jbstring[i] = 'e'; }
- else if(jbstring[i] == 'í') { jbstring[i] = 'i'; }
- else if(jbstring[i] == 'ì') { jbstring[i] = 'i'; }
- else if(jbstring[i] == 'î') { jbstring[i] = 'i'; }
- else if(jbstring[i] == 'ï') { jbstring[i] = 'i'; }
- else if(jbstring[i] == 'ó') { jbstring[i] = 'o'; }
- else if(jbstring[i] == 'ò') { jbstring[i] = 'o'; }
- else if(jbstring[i] == 'õ') { jbstring[i] = 'o'; }
- else if(jbstring[i] == 'ô') { jbstring[i] = 'o'; }
- else if(jbstring[i] == 'ö') { jbstring[i] = 'o'; }
- else if(jbstring[i] == 'ú') { jbstring[i] = 'u'; }
- else if(jbstring[i] == 'ù') { jbstring[i] = 'u'; }
- else if(jbstring[i] == 'û') { jbstring[i] = 'u'; }
- else if(jbstring[i] == 'ü') { jbstring[i] = 'u'; }
- else if(jbstring[i] == 'ñ') { jbstring[i] = 'n'; }
- else if(jbstring[i] == 'Á') { jbstring[i] = 'A'; }
- else if(jbstring[i] == 'Ã') { jbstring[i] = 'A'; }
- else if(jbstring[i] == 'Â') { jbstring[i] = 'A'; }
- else if(jbstring[i] == 'À') { jbstring[i] = 'A'; }
- else if(jbstring[i] == 'Ä') { jbstring[i] = 'A'; }
- else if(jbstring[i] == 'É') { jbstring[i] = 'E'; }
- else if(jbstring[i] == 'È') { jbstring[i] = 'E'; }
- else if(jbstring[i] == 'Ê') { jbstring[i] = 'E'; }
- else if(jbstring[i] == 'Ë') { jbstring[i] = 'E'; }
- else if(jbstring[i] == 'Í') { jbstring[i] = 'I'; }
- else if(jbstring[i] == 'Ì') { jbstring[i] = 'I'; }
- else if(jbstring[i] == 'Î') { jbstring[i] = 'I'; }
- else if(jbstring[i] == 'Ï') { jbstring[i] = 'I'; }
- else if(jbstring[i] == 'Ó') { jbstring[i] = 'O'; }
- else if(jbstring[i] == 'Ò') { jbstring[i] = 'O'; }
- else if(jbstring[i] == 'Õ') { jbstring[i] = 'O'; }
- else if(jbstring[i] == 'Ô') { jbstring[i] = 'O'; }
- else if(jbstring[i] == 'Ö') { jbstring[i] = 'O'; }
- else if(jbstring[i] == 'Ú') { jbstring[i] = 'U'; }
- else if(jbstring[i] == 'Ù') { jbstring[i] = 'U'; }
- else if(jbstring[i] == 'Û') { jbstring[i] = 'U'; }
- else if(jbstring[i] == 'Ü') { jbstring[i] = 'U'; }
- else if(jbstring[i] == 'Ñ') { jbstring[i] = 'N'; }
- else SysMsg(playerid, "Your ad has very special characters and could not be released on the Official Discord.");
- }
- }
- DCC_SendChannelMessage(D_ChatID, jbstring);
- return true;
- }
- SysMsg(playerid, "You can only create one ad within an Office of News Corporation");
- return true;
- }
- CMD:padvert(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(AdvertSpamTime[playerid] > 0) return SysMsg(playerid, "Please wait between posting advertisements.");
- if(!AdvertsToggle{playerid}) return SysMsg(playerid, "You can't make an advert as you have adverts disabled.");
- if(Inventory[playerid][MobilePhone] == 0) return SysMsg(playerid,"You need a Mobile Phone to send an advert.");
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 2263.7627,-60.7692,1000.0648) || IsPlayerInRangeOfPoint(playerid, 5.0, 754.812927, 102.666061, 70.551887) || IsPlayerInRangeOfPoint(playerid, 5.0, 885.252014, 2262.758544, 238.230422) || IsPlayerInRangeOfPoint(playerid, 2.5, 1182.8987,1360.4265,1002.8235))
- {
- if(isnull(params))
- {
- SysMsg(playerid,"Usage: /padvert [message]");
- SysMsg(playerid,"Example: '/padvert This is a test' will show as: [Private Advert] This is a test [Phone: #]");
- return true;
- }
- if(strlen(params) < 30) return SysMsg(playerid, "Your advert is too short. Please be creative and be IC only.");
- new AdCost = strlen(params) * 8;
- if(IsDonator[playerid] < 3)
- {
- GivePlayerCash(playerid, -AdCost);
- AdvertSpamTime[playerid] = 60;
- format(gstr, sizeof(gstr),"You made a private advert %i characters long, costing you $%i ($8/letter).",strlen(params),AdCost);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- else if(IsDonator[playerid] == 3)
- {
- AdCost = AdCost / 2;
- GivePlayerCash(playerid, -AdCost);
- AdvertSpamTime[playerid] = 60;
- format(gstr, sizeof(gstr),"You made a private advert %i characters long, costing you $%i. ($8/letter)",strlen(params),AdCost);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- else if(IsDonator[playerid] == 4)
- {
- AdvertSpamTime[playerid] = 60;
- format(gstr, sizeof(gstr),"You made a private advert %i characters long, costing you $%i. ($8/letter)",strlen(params),AdCost);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- FACTIONS[FACTION_NEWS][FactionBankBalance] += floatround(1 * AdCost);
- MySQLUpdateInt(FACTION_NEWS, "BankBalance", FACTIONS[FACTION_NEWS][FactionBankBalance], "factions");
- format(gstr, sizeof(gstr),"[Private Advert, Phone %i] %s", PhoneData[playerid][pNumber], params);
- foreach(new i: Player) if(Logged{i} && AdvertsToggle{i}) SendSplitMessage(i, COLOR_GREEN, gstr);
- format(gstr, sizeof(gstr), "[Admin] ^^ Private Advert by %s (ID %i)", NameEx(playerid), playerid);
- AdminBroadcast(gstr, 0);
- return true;
- }
- SysMsg(playerid, "You can only create an advert inside a News Corporation Office");
- return true;
- }
- //== chats =====================================================================
- CMD:o(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Muted[playerid] > 0) return SysMsgF(playerid,"You are muted. (%i minutes left)", Muted[playerid]);
- if(ToggleOOC == 0) return SysMsg(playerid,"Out Of Character chat is disabled.");
- if(IsDonator[playerid] >= 2 && OOCToggle[playerid] == 1) return SysMsg(playerid,"Donator Message: Your OOC chat is disabled.");
- if(gOOCDelay > 0) return SysMsg(playerid,"The Global OOC chat is limited to 1 message every 3 seconds. Please wait.");
- if(isnull(params)) return SysMsg(playerid,"Usage: Global OOC Chat: /o [message]");
- new color = COLOR_OOC;
- if(IsDonator[playerid] >= 2 && GoldToggle[playerid] == 1) color = COLOR_DONATE;
- foreach(new i: Player) if(Logged{i}) if(OOCToggle[i] == 0) SendClientMessageF(i, color, "(( [OOC] %s says: %s ))",NameEx(playerid),params);
- gOOCDelay = 3;
- return true;
- }
- CMD:b(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Muted[playerid] > 0) return SysMsgF(playerid, "You are muted. (%i minutes left)", Muted[playerid]);
- if(UsingCCTV{playerid}) return SysMsg(playerid, "You may not use /b while viewing CCTV cameras.");
- if(!LocalOOCEnabled{playerid}) return SysMsg(playerid, "You currently have local OOC chat disabled (/togb).");
- if(isnull(params)) return SysMsg(playerid,"Usage: Local OOC Chat: /b [message]");
- new oocPlayersInArea = 0;
- new Float:myPos[3], vWorld = GetPlayerVirtualWorld(playerid);
- GetPlayerPos(playerid, myPos[0], myPos[1], myPos[2]);
- foreach(new i: Player)
- {
- if(GetPlayerVirtualWorld(i) == vWorld && IsPlayerInRangeOfPoint(i, 25.0, myPos[0], myPos[1], myPos[2]) && LocalOOCEnabled{i})
- {
- SendSplitMessageF(i, COLOR_LIGHTBLUE, "(( [OOC] %s: %s ))",NameEx(playerid),params);
- if(i != playerid && GetPlayerState(i) != 9) oocPlayersInArea++;
- }
- }
- if(oocPlayersInArea == 0) SysMsg(playerid, "No one in the area has local OOC chat enabled.");
- return true;
- }
- CMD:togb(playerid)
- {
- if(!Logged{playerid}) return SysMsg(playerid,"Please login first.");
- LocalOOCEnabled{playerid} = !LocalOOCEnabled{playerid};
- if(!LocalOOCEnabled{playerid})
- {
- SendClientMessage(playerid, COLOR_WHITE, "The {009FFB}Local OOC {FFFFFF}chat channel is now disabled for you.");
- SetPlayerChatBubble(playerid, "(( Disabled /b ))", COLOR_LIGHTBLUE, 15.0, 1000);
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "The {009FFB}Local OOC {FFFFFF}chat channel is now enabled for you.");
- SetPlayerChatBubble(playerid, "(( Enabled /b ))", COLOR_LIGHTBLUE, 15.0, 1000);
- }
- return true;
- }
- CMD:dooc(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsDonator[playerid] == 0) return SysMsg(playerid,"This feature is only for Donators.");
- if(GlobalDOOCMute) return SysMsg(playerid,"This chat has been disabled globally, oh well.");
- if(ToggleDOOC{playerid}) return SysMsg(playerid,"You have this chat disabled. Use /TogDooc");
- if(DOOCMuted[playerid] > 1) return SysMsg(playerid, "You're muted from Donator OOC.");
- if(isnull(params)) return SysMsg(playerid,"Usage: Donator OOC Chat: /dooc [message]");
- foreach(new i: Player)
- {
- if(Logged{i})
- {
- if(IsDonator[i] > 0 && !ToggleDOOC{i})
- {
- SendSplitMessageF(i, COLOR_DONATE, "[Donator OOC] %s (Level %i) says: %s",NameEx(playerid), IsDonator[playerid], params);
- }
- }
- }
- //IRC_SayF(IRCBot, IRC_DOOC_CHANNEL, "7[Donator OOC] %s (Level %i) says: %s",NameEx(playerid), IsDonator[playerid], params);
- return true;
- }
- CMD:s(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Muted[playerid] > 0) return SysMsgF(playerid,"You are muted. (%i minutes left)", Muted[playerid]);
- if(UsingCCTV{playerid}) return SysMsg(playerid,"You cannot do this while using the CCTV.");
- if(IsSpectating[playerid] != -1) return SysMsg(playerid, "You cannot do this while spectating.");
- if(isnull(params)) return SysMsg(playerid,"Usage: Shout!: /s [message]");
- if(GetPlayerVehicleID(playerid) == 0 && ShoutAnimToggle{playerid})
- {
- StopLoopingAnim(playerid);
- OnePlayAnim(playerid, "RIOT", "RIOT_shout", 3.0, 0, 0, 0, 0, 0);
- }
- if(UsingAccent[playerid] == 1) format(gstr, sizeof(gstr),"%s shouts: [%s accent] %s", NameRP(playerid), Accent[playerid], params);
- else format(gstr, sizeof(gstr),"%s shouts: %s", NameRP(playerid), params);
- ProxDetector(42.0,playerid, gstr,COLOR_ORANGE,COLOR_ORANGE,COLOR_ORANGE,COLOR_ORANGE,COLOR_ORANGE);
- if(UsingAccent[playerid] == 1) format(gstr, sizeof(gstr),"[%s accent] %s", Accent[playerid], params);
- else format(gstr, sizeof(gstr),"%s", params);
- if(UsingAccent[playerid] == 1) SendToInRangeBuilding(playerid, 15, COLOR_ORANGE, Accent[playerid], params);
- else SendToInRangeBuilding(playerid, 15, COLOR_ORANGE, "", params);
- SetPlayerChatBubble(playerid, params, COLOR_ORANGE, 15.0, 6000);
- return true;
- }
- CMD:w(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Muted[playerid] > 0) return SysMsgF(playerid,"You are muted. (%i minutes left)", Muted[playerid]);
- new playa = -1, msg[150], name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]s[150]", name, msg)) return SysMsg(playerid,"Usage: Whisper: /w [player id or name you're whispering to] [message]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"Invalid Player. Can't be yourself.");
- if(IsSpectating[playa] >= 0) return SysMsg(playerid,"You must be close to the player to whisper.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,2.5,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to whisper.");
- if(UsingAccent[playerid] == 1) format(gstr, sizeof(gstr),"%s whispers to you: [%s accent] %s", NameRP(playerid), Accent[playerid], msg);
- else format(gstr, sizeof(gstr),"%s whispers to you: %s", NameRP(playerid), msg);
- SendSplitMessage(playa,0x565F91FF,gstr);
- format(gstr, sizeof(gstr),"You whisper to %s: %s", NameRP(playa), msg);
- SendSplitMessage(playerid,0x565F91FF,gstr);
- format(gstr, sizeof(gstr),"* %s whispers something to %s... *", NameRP(playerid), NameRP(playa));
- SetPlayerChatBubble(playerid, gstr, COLOR_EMOTE, 15.0, 6000);
- //ProxDetector(10.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:low(playerid, params[]) return cmd_l(playerid, params);
- CMD:l(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Muted[playerid] > 0) return SysMsgF(playerid, "You are muted. (%i minutes left)", Muted[playerid]);
- if(UsingCCTV{playerid}) return SysMsg(playerid,"You cannot do this while using the CCTV.");
- if(isnull(params)) return SysMsg(playerid,"Usage: Quiet Talk: /l [message]");
- new vid = GetPlayerVehicleID(playerid);
- if(vid > 0 && VehicleHasWindows(vid))
- {
- if(WindowState{vid} == WINDOWS_CLOSED)
- {
- if(UsingAccent[playerid] == 1) format(gstr, sizeof(gstr),"[Quiet] %s says: [%s accent] %s", NameRP(playerid), Accent[playerid], params);
- else format(gstr, sizeof(gstr),"[Quiet] %s says: %s", NameRP(playerid), params);
- foreach(new i: Player)
- {
- new VehId = GetPlayerVehicleID(i);
- if(VehId == vid) SendSplitMessage(i,COLOR_FADE3,gstr);
- }
- }
- else
- {
- if(UsingAccent[playerid] == 1) format(gstr, sizeof(gstr),"[Quiet] %s says: [%s accent] %s", NameRP(playerid), Accent[playerid], params);
- else format(gstr, sizeof(gstr),"[Quiet] %s says: %s", NameRP(playerid), params);
- ProxDetector(4.0, playerid, gstr, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- }
- }
- else
- {
- if(UsingAccent[playerid] == 1) format(gstr, sizeof(gstr),"[Quiet] %s says: [%s accent] %s", NameRP(playerid), Accent[playerid], params);
- else format(gstr, sizeof(gstr),"[Quiet] %s says: %s", NameRP(playerid), params);
- ProxDetector(4.0, playerid, gstr, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- }
- return true;
- }
- CMD:a(playerid, params[])
- {
- if(!IsPlayerAdminLevelOK(playerid, 1)) return false;
- if(isnull(params)) return SysMsg(playerid,"Usage: Admin Chat: /a [message]");
- foreach(new i: Player)
- {
- if(IsPlayerAdminLevelOK(i,1))
- {
- SendSplitMessageF(i, COLOR_RED, "[Admin] %s: %s",NameEx(playerid),params);
- }
- }
- //IRC_SayF(IRCBot, IRC_ADMIN_CHANNEL, "4[Admin] %s: %s", NameEx(playerid), params);
- return true;
- }
- CMD:r(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Muted[playerid] > 0) return SysMsgF(playerid,"You are muted. (%i minutes left)", Muted[playerid]);
- if(Inventory[playerid][Radio] == 0) return SysMsg(playerid,"You don't have a Radio.");
- if(RadioPoweredOn[playerid] == 0) return SysMsg(playerid,"Your Radio is not powered on. (/ron /roff)");
- if(IsJailed[playerid] == 1 || PlayerImprisoned{playerid}) return SysMsg(playerid,"Your Radio was confiscated and it will be returned upon your release.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid, "You may not use your radio whilst cuffed.");
- if(isnull(params)) return SysMsg(playerid,"Usage: Radio Chat: /r [message]");
- foreach(new i: Player)
- {
- if(Logged{i} && RadioFrequency[playerid] == RadioFrequency[i] && RadioPoweredOn[i] == 1)
- {
- if(i != playerid) SendSplitMessageF(i, 0x967100FF, "[Radio - %i MHz] %s: %s", RadioFrequency[playerid], NameRP(playerid), params);
- }
- }
- format(gstr, sizeof(gstr), "%s says (radio): %s", NameRP(playerid), params);
- ProxDetector(15.0, playerid, gstr, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- return true;
- }
- CMD:lr(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Muted[playerid] > 0) return SysMsgF(playerid, "You are muted. (%i minutes left)", Muted[playerid]);
- if(Inventory[playerid][Radio] == 0) return SysMsg(playerid,"You don't have a Radio.");
- if(RadioPoweredOn[playerid] == 0) return SysMsg(playerid,"Your Radio is not powered on. (/ron /roff)");
- if(IsJailed[playerid] == 1 || PlayerImprisoned{playerid}) return SysMsg(playerid,"Your Radio was confiscated and it will be returned upon your release.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid, "You may not use your radio whilst cuffed.");
- if(isnull(params)) return SysMsg(playerid,"Usage: Low Radio Chat: /lr [message] *Whisper into radio*");
- foreach(new i: Player)
- {
- if(Logged{i} && RadioFrequency[playerid] == RadioFrequency[i] && RadioPoweredOn[i] == 1)
- {
- if(i != playerid) SendSplitMessageF(i, 0x967100FF, "[Radio - %i MHz] [Quiet] %s: %s", RadioFrequency[playerid], NameRP(playerid), params);
- }
- }
- format(gstr, sizeof(gstr), "[Quiet] %s says (radio): %s", NameRP(playerid), params);
- ProxDetector(4.0, playerid, gstr, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- return true;
- }
- //end of chats rtune
- CMD:rtune(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Radio] == 0) return SysMsg(playerid,"You don't have a Radio.");
- if(RadioPoweredOn[playerid] == 0) return SysMsg(playerid,"Your Radio is not powered on. (/ron /roff)");
- new Frequency;
- if(sscanf(params, "i", Frequency)) return SysMsg(playerid,"Usage: /rtune [channel frequency]");
- if(Frequency < 1000 || Frequency > 9999) return SysMsg(playerid,"Channel Frequency Must Be Between 1000 MHz and 9999 MHz.");
- if(Frequency == RadioFrequency[playerid]) return SysMsg(playerid,"Channel Frequency is already set to that.");
- new i, allow = 1;
- for(i = 0; i < MAX_FACTIONS; i++)
- {
- if(FACTIONS[i][FactionRadioChannel] == Frequency && Faction[playerid] != i)
- {
- allow = 0;
- break;
- }
- }
- if(allow == 0) return SysMsg(playerid, "Channel frequency is reserved.");
- RadioFrequency[playerid] = Frequency;
- RadioSlot[playerid][RadioSlotUsed[playerid] - 1] = Frequency;
- new sub[32];
- format(sub, sizeof(sub), "RadioSlot%i", RadioSlotUsed[playerid]);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET RadioFrequency = %i, %s = %i WHERE id = %i", RadioFrequency[playerid], sub, RadioFrequency[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- SysMsgF(playerid, "Radio Re-Tuned To %i MHz.", RadioFrequency[playerid]);
- format(gstr, sizeof(gstr), "* %s turns a dial on their Radio and re-tunes it. *", NameRP(playerid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:rslot(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Radio] == 0) return SysMsg(playerid, "You do not have a radio.");
- if(RadioPoweredOn[playerid] == 0) return SysMsg(playerid, "Your radio is not powered on. (/ron)");
- new slot;
- if(sscanf(params, "i", slot)) return SysMsg(playerid, "Usage: /rslot [Radio slot 1-3]");
- if(slot <= 0) return SysMsg(playerid, "Radio slot cannot be less than 1.");
- if(slot >= 4) return SysMsg(playerid, "Radio slot cannot be greater than 3.");
- if(RadioSlotUsed[playerid] == slot) return SysMsg(playerid, "You are already using this slot.");
- RadioSlotUsed[playerid] = slot;
- RadioFrequency[playerid] = RadioSlot[playerid][slot - 1];
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET RadioFrequency = %i, RadioSlotInUse = %i WHERE id = %i", RadioFrequency[playerid], RadioSlotUsed[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- SysMsgF(playerid, "Radio slot changed to %i, which is tuned to %i", slot, RadioFrequency[playerid]);
- format(gstr, sizeof(gstr), "* %s turns a smaller dial on their radio, switching their radio slot. *", NameRP(playerid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- CMD:rinfo(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Radio] == 0) return SysMsg(playerid,"You don't have a Radio.");
- if(IsJailed[playerid] == 1 || PlayerImprisoned{playerid}) return SysMsg(playerid,"Your Radio was confiscated and it will be returned upon your release.");
- new onoff[4], color[7];
- switch(RadioPoweredOn[playerid])
- {
- case 0:
- {
- format(onoff, sizeof(onoff), "off");
- format(color, sizeof(color), "FF3414");
- }
- case 1:
- {
- format(onoff, sizeof(onoff), "on");
- format(color, sizeof(color), "18A300");
- }
- }
- SendClientMessageF(playerid, COLOR_WHITE, "Your radio is currently {%s}%s{FFFFFF} and is tuned to {38C0FF}%i{FFFFFF} MHz on slot %i.", color, onoff, RadioFrequency[playerid], RadioSlotUsed[playerid]);
- SendClientMessageF(playerid, COLOR_WHITE, "Your radio slots are currently set to the following frequencies: Slot 1: %i, Slot 2: %i and Slot 3: %i.", RadioSlot[playerid][0], RadioSlot[playerid][1], RadioSlot[playerid][2]);
- return true;
- }
- CMD:ron(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Radio] == 0) return SysMsg(playerid,"You don't have a Radio.");
- if(RadioPoweredOn[playerid] == 1) return SysMsg(playerid,"Your Radio is already powered on. (/roff)");
- if(IsJailed[playerid] == 1 || PlayerImprisoned{playerid}) return SysMsg(playerid,"Your Radio was confiscated and it will be returned upon your release.");
- RadioPoweredOn[playerid] = 1;
- MySQLUpdateInt(SQLID[playerid], "RadioPower", RadioPoweredOn[playerid], "players");
- SysMsgF(playerid, "Radio Turned On, You Are On %i MHz.", RadioFrequency[playerid]);
- return true;
- }
- CMD:roff(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Radio] == 0) return SysMsg(playerid,"You don't have a Radio.");
- if(RadioPoweredOn[playerid] == 0) return SysMsg(playerid,"Your Radio is already powered off. (/ron)");
- if(IsJailed[playerid] == 1 || PlayerImprisoned{playerid}) return SysMsg(playerid,"Your Radio was confiscated and it will be returned upon your release.");
- RadioPoweredOn[playerid] = 0;
- MySQLUpdateInt(SQLID[playerid], "RadioPower", RadioPoweredOn[playerid], "players");
- SysMsg(playerid, "Radio Turned Off.");
- return true;
- }
- CMD:isafk(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid, "Usage: /isafk [player id or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(IsAFK{playa}) SendClientMessageF(playerid, COLOR_GREEN, "[AFK] %s has been AFK for %i minutes. Reason: %s",NameEx(playa),AwayMinutes[playa],AFKReason[playa]);
- else SendClientMessageF(playerid, COLOR_GREEN, "[AFK] %s is not marked as AFK.",NameEx(playa));
- return true;
- }
- CMD:afk(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == 5 || ViewingBuyableCar[playerid] == 1) return SysMsg(playerid, "You can't go AFK when driving.");
- if(IsTied[playerid] > 0) return SysMsg(playerid, "You can't go AFK when tied.");
- if(IsAFK{playerid}) return SysMsg(playerid, "You are already AFK.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid, "You can't go AFK when cuffed.");
- if(IsFrozen[playerid] == 1) return SysMsg(playerid, "You can't go AFK when frozen.");
- if(Dead{playerid}) return SysMsg(playerid, "You cannot go AFK while downed.");
- new ReasonString[64], Reason[64];
- IsAFK{playerid} = true;
- AwayMinutes[playerid] = 0;
- if(isnull(params))
- {
- Reason = "None";
- format(ReasonString,sizeof(ReasonString),"[Away From Keyboard]\nAway for 0 minutes");
- }
- else
- {
- format(Reason,sizeof(Reason),params);
- format(ReasonString,sizeof(ReasonString),"[Away From Keyboard]\nAway for 0 minutes\nReason: %s", Reason);
- }
- FreezePlayer(playerid);
- TextDrawShowForPlayer(playerid, URAFK2);
- TextDrawShowForPlayer(playerid, URAFK3);
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- if(!IsPlayerMasked{playerid}) format(sgstr, sizeof(sgstr), "[AFK] A near by player is now AFK: %s(%i) [Reason: %s]", NameEx(playerid), playerid, Reason);
- else format(sgstr, sizeof(sgstr), "[AFK] A near by player is now AFK: %s [Reason: %s]", NameRP(playerid), Reason);
- ProxDetector(20.0, playerid, sgstr, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN);
- AFKReason[playerid] = Reason;
- if(IsPlayerMasked{playerid}) AFK_Label[playerid] = CreateDynamic3DTextLabel(ReasonString, COLOR_GREEN, x, y, z+0.5, 20.0, playerid, INVALID_VEHICLE_ID, 1, GetPlayerVirtualWorld(playerid), -1, -1, 20.0);
- else AFK_Label[playerid] = CreateDynamic3DTextLabel(ReasonString, COLOR_GREEN, x, y, z, 20.0, playerid, INVALID_VEHICLE_ID, 1, GetPlayerVirtualWorld(playerid), -1, -1, 20.0);
- if(ADuty[playerid] == 1)
- {
- ADuty[playerid] = 0;
- SetPlayerColor(playerid, 0xFFFFFF00);
- if(UsingPaint{playerid}) cmd_paint(playerid);
- SysMsg(playerid,"Admin Duty has been turned off automatically since you are AFK.");
- }
- return true;
- }
- CMD:back(playerid)
- {
- if(!Logged{playerid}) return true;
- if(!IsAFK{playerid}) return SysMsg(playerid, "You are not AFK.") && DeleteAFKLabel(playerid);
- printf("[Cmd] %s Is No Longer AFK. (%i:%s)",NameEx(playerid), AwayMinutes[playerid], AFKReason[playerid]);
- if(!IsPlayerMasked{playerid}) format(gstr, sizeof(gstr), "[AFK] A near by player is no longer AFK: %s(%i). They were away for %i minutes. [Reason: %s]", NameEx(playerid), playerid, AwayMinutes[playerid], AFKReason[playerid]);
- else format(gstr, sizeof(gstr), "[AFK] A near by player is no longer AFK: %s. They were away for %i minutes. [Reason: %s]", NameRP(playerid), AwayMinutes[playerid], AFKReason[playerid]);
- ProxDetector(20.0, playerid, gstr, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN);
- DeleteAFKLabel(playerid);
- UnFreezePlayer(playerid);
- ShowInfoText(playerid, " ", 100);
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) RemovePlayerFromVehicle(playerid);
- TextDrawHideForPlayer(playerid, URAFK2);
- TextDrawHideForPlayer(playerid, URAFK3);
- return true;
- }
- CMD:viewdonators(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new count = 0;
- gstr[0] = EOS;
- foreach(new i: Player)
- {
- if(Logged{i} && IsDonator[i] > 0)
- {
- count ++;
- format(tgstr, sizeof(tgstr), "%s (ID %i) - Level %i\n", NameEx(i), i, IsDonator[i]);
- strcat(gstr, tgstr);
- }
- }
- format(tgstr, sizeof(tgstr), "Online Donators List (%i Donators)", count);
- ShowMessage(playerid, tgstr, gstr, "Ok");
- return true;
- }
- CMD:help(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- UnlockAchievement(playerid, 10);
- if(isnull(params))
- {
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Red County Roleplay Help - Usage: /Help [Section]");
- SendClientMessage(playerid, COLOR_WHITE, "Sections: General, Chats, Faction, Bizz, House, Motel, Furniture, Vehicle, Job, Fish, Phone, Crate, Donator, Bank, Helper");
- return true;
- }
- if(strcmp("General", params, true) == 0)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"General Commands: /kill /me /do /pay /report /animlist /enter /exit /admins /ip /time (/afk /back /isafk) /advert /buyclothes /stats /give");
- SendClientMessage(playerid,COLOR_YELLOW,"/buylevel /eject /buy /buyfood /bank /writenote /inventory /useammo /drink /buyticket /bet /buyweaponskill /achievements /viewdonators");
- SendClientMessage(playerid,COLOR_YELLOW,"/pm /forum /padvert /sell /cancelsell /phoneinfo /speedo /attempt /showkeys /ame /fshake /appearance /version(/uptime)");
- SendClientMessage(playerid,COLOR_YELLOW,"/describe /togshoutanim /age /shake /kiss /factiononline /changespawn /helpers /myadminrecord /boombox /boomboxid");
- SendClientMessage(playerid,COLOR_YELLOW,"/assistance /cancelassistance /canceltaxi /frisk /lastonline /masteraccount(/ma) /characters");
- }
- else if(strcmp("Chats", params, true) == 0)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"Chat Commands: Global OOC /o, Local OOC /b, Whisper /w, Shout /s, Faction /f, Quiet /l [RADIO: /r /lr /rtune /ron /roff /rinfo /rslot]");
- SendClientMessage(playerid,COLOR_YELLOW,"Toggle Chats: /togb /togadverts /tognews");
- }
- else if(strcmp("Faction", params, true) == 0)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"Faction Commands: /skin /members /showbadge /fadvert /fcars /lastdriver /togf");
- if(FactionRank[playerid] >= FACTIONS[Faction[playerid]][FactionLeaderRank]) SendClientMessage(playerid,COLOR_YELLOW,"Leader Commands: /fpay /fsave /hire /demote /promote /fire /togglef (globally tog fchat) /setsubrank /frespawn /setfmotd /setrank(vehicle ranks)");
- if(FactionRank[playerid] >= FACTIONS[Faction[playerid]][FactionUberLeaderRank]) SendClientMessage(playerid,COLOR_YELLOW,"Leader Only: /setrankname /setspawnpoint /removespawnpoint /fwithdraw");
- if(Faction[playerid] == FACTION_COP)
- {
- SendClientMessage(playerid, COLOR_WHITE, "PD Commands: /duty /(un)cuff /jail /detain /taser /fine /psa /rb(/roadblock) /removeRB /wanted /swat /stinger");
- SendClientMessage(playerid, COLOR_WHITE, "/find /drag /forcein /cases /ram /backup /bkcancel /removemask /speed /pticket /impound /laser /setunit /togunit");
- SendClientMessage(playerid, COLOR_WHITE, "/mdc /grantweaponlicense /revokeweaponlicense /revokelicense /viewimpounds /siren /gunrack /addsiren");
- SendClientMessage(playerid, COLOR_WHITE, "/prison /editprison /releaseprisoner /celldoor /prisoners /pan /lockpdoor");
- }
- else if(Faction[playerid] == FACTION_SACFD)
- {
- SendClientMessage(playerid, COLOR_WHITE, "SACFD Commands: /duty /siren /fheal /rb /pager /pagermsg /heal /detox");
- SendClientMessage(playerid, COLOR_WHITE, "SACFD Commands: /rescue /drag /cut /ram /backup /bkcancel");
- SendClientMessage(playerid, COLOR_WHITE, "SACFD Commands: /equip /ladder /scba /smask /firehat /stretcher");
- }
- else if(Faction[playerid] == FACTION_NEWS)
- {
- SendClientMessage(playerid, COLOR_WHITE, "San Andreas News Commands: /duty /news /interview /endinterview /ichat /checkweather /starttalkshow /endtalkshow /toglines");
- SendClientMessage(playerid, COLOR_WHITE, "/acceptcaller /endcall /denycaller /callers /tchat");
- }
- else if(Faction[playerid] == FACTION_TRUCKING) SendClientMessage(playerid, COLOR_WHITE, "Elite Trucking Commands: /checkfuel /deliverfuel /supplyfuel /endfueldelivery /truck /tlon /tloff /detach /tow /deliverstock");
- else if(Faction[playerid] == FACTION_PROP) SendClientMessage(playerid, COLOR_WHITE, "Property Commands: /reloadhouses /reloadbizz /addp");
- }
- else if(strcmp("Bizz", params, true) == 0)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"Bizz Commands: /buybizz /sellbizz /mybizz /lock /enterfee /collectearnings /requeststock /bizzmusic");
- SendClientMessage(playerid, COLOR_YELLOW, "Bizz Manager Commands: /addmanager /removemanager /viewmanagers /manageactors /badvert");
- }
- else if(strcmp("House", params, true) == 0)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"House Commands: /buyhouse /sellmyhouse /myhouse /lock /writenote /knock /housestore /houseget /houseview /housemusic");
- SendClientMessage(playerid,COLOR_YELLOW,"House Guests: /movein /moveout /evictguest /light");
- }
- else if(strcmp("Motel", params, true) == 0) SendClientMessage(playerid,COLOR_YELLOW,"Motel Commands: /rentroom /unrentroom /extendrent");
- else if(strcmp("Furniture", params, true) == 0)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"Furniture Commands: /placef /selectf /selectflist /removef /removeallf /pickupallf /furniturecount /furniturelimit");
- SendClientMessage(playerid,COLOR_YELLOW,"Furniture Commands: /reloadmyfurniture /payfurn /guestfurnish /buyf /searchf");
- }
- else if(strcmp("Vehicle", params, true) == 0)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"Vehicle Commands: /eon(/engineon) /eoff(/engineoff) /refuel /fuelcan /refillfc /emptyfc /rw /trunk /eject /engineinfo");
- SendClientMessage(playerid,COLOR_YELLOW,"Vehicle Commands: /lights /vlights /hood /changeoil /repair /mod /recovervehicle /removeplate");
- SendClientMessage(playerid,COLOR_YELLOW,"Vehicle Ownership: /lock /savecar /mycars /(set)forsale /cancelforsale");
- SendClientMessage(playerid,COLOR_YELLOW,"Shared Vehicle: /removesharedkey /givesharedkey");
- }
- else if(strcmp("Job", params, true) == 0)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"Job Commands: /getjob /quitjob, Side Jobs: /jobs");
- if(Job[playerid] == JOB_MECHANIC) SendClientMessage(playerid, COLOR_WHITE, "Mechanic: /spray /repair /nos /hyd /viewmechaniccalls /clearmechaniccall");
- else if(Job[playerid] == JOB_TAXI) SendClientMessage(playerid, COLOR_WHITE, "Taxi Driver: /jobduty /meteron /meteroff /forcefare /cancelfare /refreshmap /setfare /myfare");
- else if(Job[playerid] == JOB_DRUGDEALER) SendClientMessage(playerid, COLOR_WHITE, "Drug Dealer: /buydrug");
- }
- else if(strcmp("Fish", params, true) == 0) SendClientMessage(playerid,COLOR_YELLOW,"Fishing Commands: /fish /sellfish /fishes /putback /putallback");
- else if(strcmp("Phone", params, true) == 0)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"Phone Commands: /call(/dial) /sms(/txt) /pickup(/p) /hangup(/h) /phoneoff(/poff) /phoneon(/pon) /phoneinfo(/pinfo)");
- SendClientMessage(playerid,COLOR_YELLOW,"Phone Commands: /recharge /callback /smsback(/txtback) /loudspeaker /phone /lp /phoneshow");
- }
- else if(strcmp("Donator", params, true) == 0)
- {
- if(IsDonator[playerid] == 0) return SysMsg(playerid,"You are not a Donator.");
- SendClientMessage(playerid,COLOR_YELLOW,"Donator Commands: /TogOOC /TogGold /ChangeDonatorVeh");
- SendClientMessage(playerid,COLOR_YELLOW,"Ignore Commands: /togglepm /isignored");
- }
- else if(strcmp("Bank", params, true) == 0) SendClientMessage(playerid,COLOR_YELLOW,"Banking & Money Commands: /bank /atm /writecheck /checks /depositcheck");
- else if(strmatch("Helper", params))
- {
- if(IsHelper{playerid})
- {
- SendClientMessage(playerid, COLOR_YELLOW,"Helper Commands: /assist /assists /endassist /requestadmin /freeze /unfreeze /delv /vspec ");
- SendClientMessage(playerid, COLOR_YELLOW,"Helper Commands: /namechanges /confirmname /reefer /toghmsg /hc /toghchat");
- }
- else return SysMsg(playerid, "You need to be a helper to view this section.");
- }
- return true;
- }
- CMD:forum(playerid)
- {
- if(!Logged{playerid}) return true;
- SendClientMessage(playerid, COLOR_WHITE, "Greenside Roleplay - Forum: http://forum.greensiderp.com.br/");
- return true;
- }
- CMD:players(playerid)
- {
- if(!Logged{playerid}) return true;
- SendClientMessageF(playerid, COLOR_WHITE, "Players Online: %i (Max %i) | NPC's Online: 1 | Vehicles: %i (Max %i) | Owned Vehicles: %i (Max %i)", GetOnlinePlayerCount(), MAX_PLAYERS - 1, GetVehiclePoolSize(), MAX_VEHICLES, GetOwnedVehicleCount(), MAX_BUYVEHS);
- return true;
- }
- CMD:actors(playerid)
- {
- if(!IsPlayerAdminLevelOK(playerid, 1)) return true;
- SendClientMessageF(playerid, COLOR_WHITE, "%i actors are currently on the server.", GetActorPoolSize());
- return true;
- }
- CMD:changemyname(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- gstr[0] = EOS;
- new count = 0;
- foreach(new i: Player) if(IsPlayerAdminLevelOK(i,1) || IsHelper{i}) count ++;
- if(count == 0) return SysMsg(playerid, "There are no suitable Admins online to confirm your new name, please try again later.");
- if(Cash[playerid] < 25000) return SysMsg(playerid,"You need at least $25,000 to change your name.");
- strcat(gstr, "{FFFFFF}To change your name, you must have the required cash available and a valid reason.");
- strcat(gstr, "\nIt is also possible to clear your criminal record along with a name change for CK purposes.");
- strcat(gstr, "\n\nChange Your Name\t{9BE27F}$25,000\n{FFFFFF}Clear Criminal Record\t{9BE27F}Extra $25,000{FFFFFF}");
- strcat(gstr, "\n\nAll changes are confirmed by an Admin and may be declined if any Admins deems the change unsuitable.");
- Dialog_Show(playerid, NamechangeRequest1, DIALOG_STYLE_MSGBOX, "{FFEEA7}Change Name", gstr, "Next", "Cancel");
- return true;
- }
- CMD:cancelnamechange(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(WantsNameChange[playerid][0] == 0) return SysMsg(playerid,"You have no request to cancel");
- SendClientMessage(playerid, COLOR_DARKBLUE, "You have cancelled your name change request.");
- format(gstr, sizeof(gstr),"* %s has cancelled their name change to %s.", NameEx(playerid), NameChange[playerid]);
- AdminBroadcast(gstr, 1);
- format(gstr, sizeof(gstr), "Cancelled name change to %s", NameChange[playerid]);
- AdminLog(playerid, SQLID[playerid], GetName(playerid), gstr);
- WantsNameChange[playerid][1] = 0;
- WantsNameChange[playerid][0] = 0;
- NameChange[playerid][0] = EOS;
- return true;
- }
- CMD:lastonline(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(isnull(params)) return SysMsg(playerid,"Usage: /lastonline [Firstname_Lastname]");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT LastLogin, LastLogout, Name FROM players WHERE Name = '%e'", params);
- mysql_pquery(conn, mquery, "LastOnlineCheck", "d", playerid);
- return true;
- }
- CMD:billcosby(playerid)
- {
- if(!Logged{playerid}) return true;
- GameTextForPlayer(playerid, "~w~zip ~r~zop ~b~zoopity ~y~bop!", 5000, 11);
- return true;
- }
- CMD:bazinga(playerid)
- {
- if(!Logged{playerid}) return true;
- PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/bazinga.mp3");
- return true;
- }
- CMD:valero(playerid)
- {
- if(!Logged{playerid}) return true;
- PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/valero.mp3");
- return true;
- }
- CMD:boombox(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsBoomBanned[playerid] == 1) return SysMsg(playerid, "You are banned from using boomboxes.");
- if(GetPlayerVirtualWorld(playerid) != 0 || GetPlayerInterior(playerid) != 0) return SysMsg(playerid, "You can only place a boombox outside.");
- if(Inventory[playerid][Boombox] >= 1)
- {
- if(IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You need to be on foot to perform this command.");
- new Float:pPos[4];
- GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
- pPos[3] = GetXYInFrontOfPlayer(playerid, pPos[0], pPos[1], 1.0);
- foreach(new bm: Player)
- {
- if(Boomboxes[bm][BoomOID] >= 1)
- {
- if(IsPlayerInRangeOfPoint(playerid, 80, Boomboxes[bm][BoomPos][0], Boomboxes[bm][BoomPos][1], Boomboxes[bm][BoomPos][2])) return SysMsg(playerid, "You are too close to another boombox, try somewhere else.");
- else if(Boomboxes[bm][BoomOID] == SQLID[playerid]) return SysMsg(playerid, "You already have a boombox placed down, go pick it up.");
- }
- }
- if(Inventory[playerid][Boombox] == 1)
- {
- Boomboxes[playerid][BoomObj] = CreateDynamicObject(2102, pPos[0], pPos[1], pPos[2] - 1.0, 0, 0, pPos[3]);
- Boomboxes[playerid][BoomRange] = 15;
- }
- else if(Inventory[playerid][Boombox] == 2)
- {
- Boomboxes[playerid][BoomObj] = CreateDynamicObject(2226, pPos[0], pPos[1], pPos[2] - 1.0, 0, 0, pPos[3]);
- Boomboxes[playerid][BoomRange] = 38;
- }
- Boomboxes[playerid][BoomOID] = SQLID[playerid];
- Boomboxes[playerid][BoomPos][0] = pPos[0];
- Boomboxes[playerid][BoomPos][1] = pPos[1];
- Boomboxes[playerid][BoomPos][2] = pPos[2];
- Boomboxes[playerid][BoomPos][3] = pPos[3];
- Boomboxes[playerid][BoomStation][0] = 0;
- Boomboxes[playerid][BoomIsPlaying] = false;
- Boomboxes[playerid][BoomType] = Inventory[playerid][Boombox];
- Inventory[playerid][Boombox] = 0;
- OnePlayAnim(playerid,"BOMBER","BOM_Plant_Crouch_In", 4.0, 0, 0, 0, 0, 0);
- Boomboxes[playerid][BoomArea] = CreateDynamicSphere(Boomboxes[playerid][BoomPos][0], Boomboxes[playerid][BoomPos][1], Boomboxes[playerid][BoomPos][2], Boomboxes[playerid][BoomRange], 0);
- format(gstr, sizeof(gstr), "* %s places a boombox on the ground. *", NameRP(playerid));
- SetPlayerChatBubble(playerid, gstr, COLOR_EMOTE, 20, 7000);
- SendClientMessage(playerid, COLOR_YELLOW, "You have placed a boombox on the ground, use /boombox to use the boombox.");
- Dialog_Show(playerid, BoomboxMenu, DIALOG_STYLE_LIST, "Boombox Menu", "Play New\n \nStop\nPickup", "Select", "Close");
- }
- else if(IsPlayerInRangeOfPoint(playerid, 3.0, Boomboxes[playerid][BoomPos][0], Boomboxes[playerid][BoomPos][1], Boomboxes[playerid][BoomPos][2]))
- {
- if(strlen(Boomboxes[playerid][BoomStation]) >= 6) Dialog_Show(playerid, BoomboxMenu, DIALOG_STYLE_LIST, "Boombox Menu", "Play New Station\nPlay Last Station\nStop\nPickup", "Select", "Close");
- else Dialog_Show(playerid, BoomboxMenu, DIALOG_STYLE_LIST, "Boombox Menu", "Play New Station\n \nStop\nPickup", "Select", "Close");
- }
- else return SysMsg(playerid, "You don't have a boombox.");
- return true;
- }
- CMD:campfireid(playerid)
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
- new Float:x, Float:y, Float:z;
- foreach(new i: Player)
- {
- if(CampfirePlaced[i] != INVALID_OBJECT_ID)
- {
- GetDynamicObjectPos(CampfirePlaced[i], x, y, z);
- if(IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z))
- {
- SendClientMessageF(playerid, COLOR_WHITE, "Campfire owner: %s (ID %i)", NameEx(i), i);
- return true;
- }
- }
- }
- SysMsg(playerid, "Could not find any campfires near you.");
- return true;
- }
- CMD:removecampfire(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(!IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(playerid, AUTHMSG);
- new playa = -1;
- if(sscanf(params, "u", playa)) return SysMsg(playerid, "Usage: /removecampfire [playerid or name]");
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(CampfirePlaced[playa] == INVALID_OBJECT_ID) return SysMsg(playerid, "This player has not placed a campfire.");
- DestroyDynamicObjectEx(CampfirePlaced[playa], "CampfirePlaced[playa]");
- CampfirePlaced[playa] = INVALID_OBJECT_ID;
- SendClientMessageF(playerid, COLOR_RED, "You have removed %s's campfire.", NameEx(playa));
- SendClientMessageF(playa, COLOR_RED, "Admin %s has removed your campfire.", NameEx(playerid));
- return true;
- }
- CMD:campfire(playerid)
- {
- if(!Logged{playerid}) return true;
- if(Inventory[playerid][Logs] == 0) return SysMsg(playerid, "You do not have any logs.");
- if(IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "You cannot use this command in a vehicle.");
- if(CampfirePlaced[playerid] == INVALID_OBJECT_ID)
- {
- if(GetPlayerInterior(playerid) != 0 && GetPlayerVirtualWorld(playerid) != 0) return SysMsg(playerid, "You can only create campfires outdoors.");
- new Float:x, Float:y, Float:z;
- foreach(new i: Player)
- {
- if(CampfirePlaced[i] != INVALID_OBJECT_ID)
- {
- GetDynamicObjectPos(CampfirePlaced[i], x, y, z);
- if(IsPlayerInRangeOfPoint(playerid, 20.0, x, y, z)) return SysMsg(playerid, "You are too close to a separate campfire.");
- }
- }
- new Float:a;
- GetPlayerPos(playerid, x, y, z);
- a = GetXYInFrontOfPlayer(playerid, x, y, 1.0);
- CampfirePlaced[playerid] = CreateDynamicObject(19632, x, y, z - 1.0, 0, 0, a);
- OnePlayAnim(playerid, "CARRY", "putdwn", 4,0,0,0,0,0);
- SetPlayerChatBubble(playerid, "* Places some small logs on the ground, sorting them into a neat pile before lighting them on fire. *", COLOR_EMOTE, 15.0, 6000);
- return true;
- }
- else
- {
- new Float:x, Float:y, Float:z;
- GetDynamicObjectPos(CampfirePlaced[playerid], x, y, z);
- if(!IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z)) return SysMsg(playerid, "You are not near your campfire.");
- DestroyDynamicObjectEx(CampfirePlaced[playerid], "CampfirePlaced[playerid] 0");
- CampfirePlaced[playerid] = INVALID_OBJECT_ID;
- OnePlayAnim(playerid, "CARRY", "liftup", 4,0,0,0,0,0);
- SetPlayerChatBubble(playerid, "* Reaches down to the ground and extinguishes their campfire before picking it up. *", COLOR_EMOTE, 15.0, 6000);
- return true;
- }
- }
- CMD:answer(playerid, params[])
- {
- if(!Logged{playerid}) return SysMsg(playerid,"You must be logged in to answer.");
- if(MathsStarted == 0) return SysMsg(playerid,"There is no question to answer.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /answer [my answer]");
- if(!IsNumeric(params)) return SysMsg(playerid,"Your answer must be a number.");
- new MyAnswer = strval(params);
- if(MyAnswer == MathsAnswer)
- {
- GivePlayerCash(playerid, 1000);
- format(gstr, sizeof(gstr), "%s was first to answer correctly and won $1000. The answer was %i.", NameEx(playerid), MathsAnswer);
- SendClientMessageToAllLogged(COLOR_LIGHTRED, gstr);
- MathsStarted = 0;
- MathsAnswer = 0;
- }
- else return SysMsg(playerid,"That was the wrong answer.");
- return true;
- }
- CMD:cpfaccao(playerid, params[]) {
- if(!IsPlayerAdminLevelOK(playerid, 5)) return SysMsg(playerid, AUTHMSG);
- static portasvalidas[] = { 1493, 1495, 1496, 1497, 1498, 1500, 1501, 1502, 1504, 1505, 1506, 1507, 1536, 1557, 1567, 1569 };
- new portaid, facid;
- if(sscanf(params, "ii", facid, portaid)) {
- SendClientMessage(playerid, -1, "Use /PortaFaccao [Facção ID] [Modelo da Porta]");
- SendClientMessage(playerid, -1, "Portas válidas: 1493, 1495, 1496, 1497, 1498, 1500, 1501, 1502, 1504, 1505, 1506, 1507, 1536, 1557, 1567, 1569.");
- return 1;
- }
- if(!FACTIONS[facid][FactionName][0]) return SendClientMessage(playerid, -1, "Facção inválida.");
- for(new i; i != sizeof portasvalidas; i++) {
- if(portaid != portasvalidas[i]) {
- if(i == ((sizeof portasvalidas) - 1)) {
- SendClientMessage(playerid, -1, "Use /PortaFaccao [Facção ID] [Modelo da Porta]");
- SendClientMessage(playerid, -1, "Portas válidas: 1493, 1495, 1496, 1497, 1498, 1500, 1501, 1502, 1504, 1505, 1506, 1507, 1536, 1557, 1567, 1569.");
- return 1;
- }
- continue;
- }
- break;
- }
- new Float:P[3];
- GetPlayerPos(playerid, P[0], P[1], P[2]);
- GetXYInFrontOfPlayer(playerid, P[0], P[1], 1.0);
- for(new i; i != MAX_FACTIONS*MAX_FACTION_DOORS; i++) {
- new k;
- for(; k != MAX_FACTION_DOORS; k++) {
- if(FACTIONS[facid][FactionDoors][k] != -1) {
- if(k == MAX_FACTION_DOORS-1) return SendClientMessage(playerid, -1, "Esta facção já excedeu o limite de portas (25).");
- continue;
- }
- break;
- }
- if(!FacDoor[i][fdPosA][0]) {
- SendClientMessage(playerid, -1, "Coloque a porta na posição em que ela ficaria ABERTA.");
- FacDoor[i][fdID] = CreateDynamicObject(portaid, P[0], P[1], P[2], 0.0, 0.0, 0.0);
- FacDoor[i][fdModel] = portaid;
- EditDynamicObject(playerid, FacDoor[i][fdID]);
- FACTIONS[facid][FactionDoors][k] = i;
- return 1;
- }
- }
- SendClientMessage(playerid, -1, "O máximo de portas de facção foi alcançado.");
- return 1;
- }
- CMD:door(playerid, params[])// abrir/trancar objetos portas
- {
- if(IsInHouseID[playerid] == -1) {
- for(new i; i != MAX_FACTION_DOORS*MAX_FACTIONS; i++) {
- if(FacDoor[i][fdStatus]) {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, FacDoor[i][fdPosA][0], FacDoor[i][fdPosA][1], FacDoor[i][fdPosA][2])) {
- for(new j; j != MAX_FACTIONS; j++) {
- for(new k; k != MAX_FACTION_DOORS; k++) {
- if(FACTIONS[j][FactionDoors][k] == i) {
- if(Faction[playerid] != j) return SendClientMessage(playerid, -1, "You can not open this door.");
- MoveDynamicObject(FacDoor[i][fdID], FacDoor[i][fdPosF][0], FacDoor[i][fdPosF][1], FacDoor[i][fdPosF][2], 1.0, 0.0, 0.0, FacDoor[i][fdPosF][3]);
- FacDoor[i][fdStatus] = 0;
- return 1;
- }
- }
- }
- return 1;
- }
- } else {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, FacDoor[i][fdPosF][0], FacDoor[i][fdPosF][1], FacDoor[i][fdPosF][2])) {
- for(new j; j != MAX_FACTIONS; j++) {
- for(new k; k != MAX_FACTION_DOORS; k++) {
- if(FACTIONS[j][FactionDoors][k] == i) {
- if(Faction[playerid] != j) return SendClientMessage(playerid, -1, "You can not open this door.");
- MoveDynamicObject(FacDoor[i][fdID], FacDoor[i][fdPosA][0], FacDoor[i][fdPosA][1], FacDoor[i][fdPosA][2], 1.0, 0.0, 0.0, FacDoor[i][fdPosA][3]);
- FacDoor[i][fdStatus] = 1;
- return 1;
- }
- }
- }
- return 1;
- }
- }
- }
- }
- if(IsHouseOwner(playerid, IsInHouseID[playerid]) || IsHouseGuestSQL(playerid) == HouseData[IsInHouseID[playerid]][HouseSQLID])
- {
- new Float:FurnPos[6], h = IsInHouseID[playerid];
- for(new x = 0; x < MAX_HFURNITURE; x++)
- {
- if(IsValidDoorObject(HouseData[h][FurnModel][x]))
- {
- GetDynamicObjectPos(HouseData[h][FurnObject][x], FurnPos[0], FurnPos[1], FurnPos[2]);
- if(IsPlayerInRangeOfPoint(playerid, 2.0, FurnPos[0], FurnPos[1], FurnPos[2]))
- {
- HouseData[h][DoorLocked][x] = !HouseData[h][DoorLocked][x];
- if(HouseData[h][DoorLocked][x])
- {
- MoveDynamicObject(HouseData[h][FurnObject][x], FurnPos[0], FurnPos[1], FurnPos[2]/*+0.01*/, /*0.01*/1, FurnPos[3], FurnPos[4], FurnPos[5]-90.0);
- SysMsg(playerid, "You close the door.");
- }
- else {
- MoveDynamicObject(HouseData[h][FurnObject][x], FurnPos[0], FurnPos[1], FurnPos[2]/*+0.01*/, /*0.01*/1, FurnPos[3], FurnPos[4], FurnPos[5]);
- SysMsg(playerid, "You opened the door.");
- }
- mysql_pqueryf(conn, "UPDATE hfurniture SET Locked = %i WHERE id = %i", HouseData[h][DoorLocked][x], HouseData[h][FurnSQLID][x]);
- return true;
- }
- }
- }
- }
- else SysMsg(playerid, "You do not have the key to this door.");
- return true;
- }
- CMD:lock(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsInHouseID[playerid] != -1)
- {
- new h = IsInHouseID[playerid];
- if(HouseData[h][HouseOwnerSQLID] == SQLID[playerid] || IsHouseGuestSQL(playerid) == HouseData[h][HouseSQLID])
- {
- if(HouseData[h][HouseLocked] == 1)
- {
- HouseData[h][HouseLocked] = 0;
- MySQLUpdateInt(HouseData[h][HouseSQLID], "HouseLocked", HouseData[h][HouseLocked], "houses");
- format(sgstr, sizeof(sgstr),"* %s unlocks the door of %s. *",NameRP(playerid),HouseData[h][HouseDescription]);
- ProxDetector(15.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessageF(playerid,COLOR_WHITE, "You have {4BB74C}unlocked{FFFFFF} {BCDCBC}%s{FFFFFF}, anybody may enter this residence until it is locked again.",HouseData[h][HouseDescription]);
- ShowInfoText(playerid, "~Y~House Unlocked!", 3000);
- return true;
- }
- else
- {
- HouseData[h][HouseLocked] = 1;
- MySQLUpdateInt(HouseData[h][HouseSQLID], "HouseLocked", HouseData[h][HouseLocked], "houses");
- format(sgstr, sizeof(sgstr),"* %s locks the door of %s. *",NameRP(playerid),HouseData[h][HouseDescription]);
- ProxDetector(15.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessageF(playerid,COLOR_WHITE, "You have {8B0000}locked{FFFFFF} the doors of {BCDCBC}%s.",HouseData[h][HouseDescription]);
- ShowInfoText(playerid, "~Y~House Locked!", 3000);
- return true;
- }
- }
- }
- else
- {
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ]) && GetPlayerVirtualWorld(playerid) == HouseData[h][HouseExtVW])
- {
- if(HouseData[h][HouseOwnerSQLID] == SQLID[playerid] || IsHouseGuestSQL(playerid) == HouseData[h][HouseSQLID])
- {
- if(HouseData[h][HouseLocked] == 1)
- {
- HouseData[h][HouseLocked] = 0;
- MySQLUpdateInt(HouseData[h][HouseSQLID], "HouseLocked", HouseData[h][HouseLocked], "houses");
- format(sgstr, sizeof(sgstr),"* %s unlocks the door of %s. *",NameRP(playerid),HouseData[h][HouseDescription]);
- ProxDetector(15.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessageF(playerid,COLOR_WHITE, "You have {4BB74C}unlocked{FFFFFF} {BCDCBC}%s{FFFFFF}, anybody may enter this residence until it is locked again.",HouseData[h][HouseDescription]);
- ShowInfoText(playerid, "~Y~House Unlocked!", 3000);
- return true;
- }
- else
- {
- HouseData[h][HouseLocked] = 1;
- MySQLUpdateInt(HouseData[h][HouseSQLID], "HouseLocked", HouseData[h][HouseLocked], "houses");
- format(sgstr, sizeof(sgstr),"* %s locks the door of %s. *",NameRP(playerid),HouseData[h][HouseDescription]);
- ProxDetector(15.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessageF(playerid,COLOR_WHITE, "You have {8B0000}locked{FFFFFF} the doors of {BCDCBC}%s.",HouseData[h][HouseDescription]);
- ShowInfoText(playerid, "~Y~House Locked!", 3000);
- return true;
- }
- }
- else return SysMsg(playerid, "You don't own or live in this house.");
- }
- }
- }
- if(IsInBizzID[playerid] >= 1)
- {
- new bizz = IsInBizzID[playerid];
- if(BizzData[bizz][BizzOwnerSQLID] == SQLID[playerid] || IsBizzMod(playerid, bizz))
- {
- if(BizzData[bizz][BizzType] == BIZZ_TYPE_STATIC && BizzData[bizz][IsSpecial] == 0) return SysMsg(playerid,"This business cannot be entered.");
- if(BizzData[bizz][BizzLocked])
- {
- BizzData[bizz][BizzLocked] = false;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Locked", BizzData[bizz][BizzLocked], "bizz");
- SendClientMessageF(playerid,COLOR_WHITE, "You have {4BB74C}unlocked{FFFFFF} {BCDCBC}%s.",BizzData[bizz][BizzDescription]);
- format(sgstr, sizeof(sgstr),"* %s unlocks the door of %s. *",NameRP(playerid),BizzData[bizz][BizzDescription]);
- ProxDetector(15.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else
- {
- BizzData[bizz][BizzLocked] = true;
- MySQLUpdateInt(BizzData[bizz][BizzSQLID], "Locked", BizzData[bizz][BizzLocked], "bizz");
- SendClientMessageF(playerid,COLOR_WHITE, "You have {8B0000}locked{FFFFFF} {BCDCBC}%s.",BizzData[bizz][BizzDescription]);
- format(sgstr, sizeof(sgstr),"* %s locks the door of %s. *",NameRP(playerid),BizzData[bizz][BizzDescription]);
- ProxDetector(15.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- }
- }
- else
- {
- for(new bz = 0; bz < MAX_BIZZ; bz++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.5, BizzData[bz][oPosX], BizzData[bz][oPosY], BizzData[bz][oPosZ]))
- {
- for(new b = 0; b < MAX_BIZZ_PER_PLAYER; b++)
- {
- if(PlayerBizzID[playerid][b] == bz || IsBizzMod(playerid, bz))
- {
- if(BizzData[bz][BizzType] == BIZZ_TYPE_STATIC && BizzData[bz][IsSpecial] == 0) return SysMsg(playerid,"This business cannot be entered.");
- if(BizzData[bz][BizzLocked])
- {
- BizzData[bz][BizzLocked] = false;
- MySQLUpdateInt(BizzData[bz][BizzSQLID], "Locked", BizzData[bz][BizzLocked], "bizz");
- SendClientMessageF(playerid,COLOR_WHITE, "You have {4BB74C}unlocked{FFFFFF} {BCDCBC}%s.",BizzData[bz][BizzDescription]);
- format(sgstr, sizeof(sgstr),"* %s unlocks the door of %s. *",NameRP(playerid),BizzData[bz][BizzDescription]);
- ProxDetector(15.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else
- {
- BizzData[bz][BizzLocked] = true;
- MySQLUpdateInt(BizzData[bz][BizzSQLID], "Locked", BizzData[bz][BizzLocked], "bizz");
- SendClientMessageF(playerid,COLOR_WHITE, "You have {8B0000}locked{FFFFFF} {BCDCBC}%s.",BizzData[bz][BizzDescription]);
- format(sgstr, sizeof(sgstr),"* %s locks the door of %s. *",NameRP(playerid),BizzData[bz][BizzDescription]);
- ProxDetector(15.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- }
- }
- }
- }
- }
- if(IsPlayerInAnyVehicle(playerid))
- {
- new veh = GetPlayerVehicleID(playerid);
- if(Locked{veh})
- {
- if(IsOwnedCar(veh))
- {
- if(VehicleData[veh][VehicleOwnerSQLID] == SQLID[playerid] || VehicleBorrowKey[playerid] != 0 && VehicleBorrowKey[playerid] == VehicleData[veh][VehSQLID])
- {
- Locked{veh} = false;
- ToggleVehicleLock(VehicleData[veh][IdVehicle], false);
- PlayerPlayNearbySound(playerid, SOUND_LOCK_CAR_DOOR);
- MySQLUpdateInt(VehicleData[veh][VehSQLID], "IsLocked", 0, "vehicles");
- ShowInfoText(playerid, "~B~Doors Unlocked!", 3000);
- TextDrawHideForPlayer(playerid, lockedTxD3dl);
- TextDrawShowForPlayer(playerid, unlockedTxD3dl);
- SendClientMessage(playerid, COLOR_GREEN, "> Vehicle {009000}Unlocked.");
- format(sgstr, sizeof(sgstr),"* %s pushes a button to unlock their %s. *",NameRP(playerid),GetVehicleName(veh));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else return SysMsg(playerid, "You do not have keys for this vehicle.");
- }
- else if(IsRentalCar(veh))
- {
- if(RentalCar[playerid] != veh) return SysMsg(playerid, "You do not have the keys to this rental vehicle.");
- Locked{veh} = false;
- ToggleVehicleLock(RentalData[veh][CarID], false);
- PlayerPlayNearbySound(playerid, SOUND_LOCK_CAR_DOOR);
- ShowInfoText(playerid, "~B~Doors Unlocked!", 3000);
- TextDrawHideForPlayer(playerid, lockedTxD3dl);
- TextDrawShowForPlayer(playerid, unlockedTxD3dl);
- SendClientMessage(playerid, COLOR_WHITE, "> Vehicle {009000}Unlocked.");
- format(sgstr, sizeof(sgstr),"* %s pushes a button to unlock their %s. *",NameRP(playerid),GetVehicleName(veh));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else if(IsFactionVehicle(veh))
- {
- new faction = IsFactionVehicle(veh);
- if(Faction[playerid] != faction && !IsPlayerAdmin(playerid)) return SysMsg(playerid,"You cannot edit this faction vehicle.");
- if(FactionRank[playerid] < FVehicleData[veh][FVMinRank]) return SysMsg(playerid, "You are not the correct rank to edit this faction vehicle.");
- ToggleVehicleLock(FVehicleData[veh][FactionVehID], false);
- Locked{veh} = false;
- SendClientMessage(playerid, COLOR_WHITE, "Faction vehicle has been unlocked.");
- ShowInfoText(playerid,"~B~Doors Unlocked!!",3000);
- TextDrawHideForPlayer(playerid, lockedTxD3dl);
- TextDrawShowForPlayer(playerid, unlockedTxD3dl);
- MySQLUpdateInt(FVehicleData[veh][FVSQLID], "Locked", 0, "fveh");
- format(sgstr, sizeof(sgstr),"* %s pushes a button to unlock their %s. *",NameRP(playerid),GetVehicleName(FVehicleData[veh][FactionVehID]));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- }
- else
- {
- if(IsOwnedCar(veh))
- {
- if(VehicleData[veh][VehicleOwnerSQLID] == SQLID[playerid] || VehicleBorrowKey[playerid] != 0 && VehicleBorrowKey[playerid] == VehicleData[veh][VehSQLID])
- {
- Locked{veh} = true;
- ToggleVehicleLock(veh, true);
- PlayerPlayNearbySound(playerid, SOUND_LOCK_CAR_DOOR);
- MySQLUpdateInt(VehicleData[veh][VehSQLID], "IsLocked", 1, "vehicles");
- ShowInfoText(playerid, "~B~Doors Locked!", 3000);
- TextDrawHideForPlayer(playerid, unlockedTxD3dl);
- TextDrawShowForPlayer(playerid, lockedTxD3dl);
- SendClientMessage(playerid, COLOR_GREEN, "> Vehicle Locked.");
- format(sgstr, sizeof(sgstr),"* %s pushes a button to lock their %s. *",NameRP(playerid),GetVehicleName(veh));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else return SysMsg(playerid, "You do not have the keys to this vehicle.");
- }
- else if(IsRentalCar(veh))
- {
- if(RentalCar[playerid] != veh) return SysMsg(playerid, "You do not have the keys to this rental vehicle.");
- Locked{veh} = true;
- ToggleVehicleLock(RentalData[veh][CarID], true);
- PlayerPlayNearbySound(playerid, SOUND_LOCK_CAR_DOOR);
- ShowInfoText(playerid, "~B~Doors Locked!", 3000);
- TextDrawHideForPlayer(playerid, unlockedTxD3dl);
- TextDrawShowForPlayer(playerid, lockedTxD3dl);
- SendClientMessage(playerid, COLOR_GREEN, "> Vehicle Locked.");
- format(sgstr, sizeof(sgstr),"* %s pushes a button to lock their %s. *",NameRP(playerid),GetVehicleName(veh));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else if(IsFactionVehicle(veh))
- {
- new faction = IsFactionVehicle(veh);
- if(Faction[playerid] != faction && !IsPlayerAdmin(playerid)) return SysMsg(playerid, "You do not have the keys to this vehicle.");
- if(FactionRank[playerid] < FVehicleData[veh][FVMinRank]) return SysMsg(playerid, "You are not the correct rank to edit this faction vehicle.");
- ToggleVehicleLock(FVehicleData[veh][FactionVehID], true);
- Locked{veh} = true;
- MySQLUpdateInt(FVehicleData[veh][FVSQLID], "Locked", 1, "fveh");
- SendClientMessage(playerid, COLOR_WHITE, "Faction vehicle has been locked.");
- ShowInfoText(playerid, "~B~Doors Locked!", 3000);
- TextDrawHideForPlayer(playerid, unlockedTxD3dl);
- TextDrawShowForPlayer(playerid, lockedTxD3dl);
- format(sgstr, sizeof(sgstr),"* %s pushes a button to lock their %s. *",NameRP(playerid),GetVehicleName(veh));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- }
- }
- else
- {
- new v = GetClosestVehicle(playerid);
- new Float:vPos[3];
- GetVehiclePos(v, vPos[0], vPos[1], vPos[2]);
- if(IsPlayerInRangeOfPoint(playerid, 10.0, vPos[0], vPos[1], vPos[2]))
- {
- if(IsOwnedCar(v))
- {
- if(VehicleData[v][VehicleOwnerSQLID] == SQLID[playerid] || VehicleBorrowKey[playerid] != 0 && VehicleBorrowKey[playerid] == VehicleData[v][VehSQLID] || WindowState{v} == WINDOWS_OPEN && VehicleHasWindows(v))
- {
- if(Locked{v})
- {
- Locked{v} = false;
- ToggleVehicleLock(v, 0);
- FlashVehicleLights(v);
- PlayerPlayNearbySound(playerid, SOUND_LOCK_CAR_DOOR);
- MySQLUpdateInt(VehicleData[v][VehSQLID], "IsLocked", 0, "vehicles");
- ShowInfoText(playerid,"~B~Doors Unlocked!",3000);
-
- for(new i, k = GetPlayerPoolSize()+1; i != k; i++) {
- if(IsPlayerInVehicle(i, v) && GetPlayerState(i) == PLAYER_STATE_DRIVER) {
- TextDrawHideForPlayer(i, lockedTxD3dl);
- TextDrawShowForPlayer(i, unlockedTxD3dl);
- }
- }
- if(WindowState{v} == WINDOWS_OPEN && VehicleHasWindows(v)) format(sgstr, sizeof(sgstr),"* %s reaches inside of the %s and unlocks it. *",NameRP(playerid),GetVehicleName(v));
- else format(sgstr, sizeof(sgstr),"* %s pushes a button to unlock their %s. *",NameRP(playerid),GetVehicleName(v));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else
- {
- Locked{v} = true;
- ToggleVehicleLock(v, 1);
- FlashVehicleLights(v);
- PlayerPlayNearbySound(playerid, SOUND_LOCK_CAR_DOOR);
- MySQLUpdateInt(VehicleData[v][VehSQLID], "IsLocked", 1, "vehicles");
- ShowInfoText(playerid,"~B~Doors Locked!",3000);
- for(new i, k = GetPlayerPoolSize()+1; i != k; i++) {
- if(IsPlayerInVehicle(i, v) && GetPlayerState(i) == PLAYER_STATE_DRIVER) {
- TextDrawHideForPlayer(i, unlockedTxD3dl);
- TextDrawShowForPlayer(i, lockedTxD3dl);
- }
- }
- if(WindowState{v} == WINDOWS_OPEN && VehicleHasWindows(v)) format(sgstr, sizeof(sgstr),"* %s reaches inside of the %s and locks it. *",NameRP(playerid),GetVehicleName(v));
- else format(sgstr, sizeof(sgstr),"* %s pushes a button to lock their %s. *",NameRP(playerid),GetVehicleName(v));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- }
- else return SysMsg(playerid, "You do not have keys for this vehicle.");
- }
- else if(IsRentalCar(v))
- {
- if(RentalCar[playerid] != v) return SysMsg(playerid, "You do not have the keys to this rental vehicle.");
- if(Locked{v})
- {
- Locked{v} = false;
- ToggleVehicleLock(RentalData[v][CarID], false);
- PlayerPlayNearbySound(playerid, SOUND_LOCK_CAR_DOOR);
- FlashVehicleLights(v);
- ShowInfoText(playerid,"~B~Doors Unlocked!",3000);
- for(new i, k = GetPlayerPoolSize()+1; i != k; i++) {
- if(IsPlayerInVehicle(i, v) && GetPlayerState(i) == PLAYER_STATE_DRIVER) {
- TextDrawHideForPlayer(i, lockedTxD3dl);
- TextDrawShowForPlayer(i, unlockedTxD3dl);
- }
- }
- SendClientMessage(playerid, COLOR_WHITE, "> Vehicle {009000}Unlocked.");
- format(sgstr, sizeof(sgstr),"* %s pushes a button to unlock their %s. *",NameRP(playerid),GetVehicleName(v));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else
- {
- Locked{v} = true;
- ToggleVehicleLock(RentalData[v][CarID], true);
- PlayerPlayNearbySound(playerid, SOUND_LOCK_CAR_DOOR);
- FlashVehicleLights(v);
- ShowInfoText(playerid,"~B~Doors Locked!",3000);
- for(new i, k = GetPlayerPoolSize()+1; i != k; i++) {
- if(IsPlayerInVehicle(i, v) && GetPlayerState(i) == PLAYER_STATE_DRIVER) {
- TextDrawHideForPlayer(i, unlockedTxD3dl);
- TextDrawShowForPlayer(i, lockedTxD3dl);
- }
- }
- SendClientMessage(playerid, COLOR_WHITE, "> Vehicle {8B0000}locked.");
- format(sgstr, sizeof(sgstr),"* %s aperta um botão na chaves e fecha o veículo. *",NameRP(playerid),GetVehicleName(v));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- }
- else if(IsFactionCar(v))
- {
- new fveh = IsFactionVehicle(v);
- if(Faction[playerid] != fveh && !IsPlayerAdmin(playerid)) return SysMsg(playerid, "You do not have the keys to this vehicle.");
- if(FactionRank[playerid] < FVehicleData[v][FVMinRank]) return SysMsg(playerid, "You can not edit this faction vehicle.");
- if(Locked{v})
- {
- ToggleVehicleLock(FVehicleData[v][FactionVehID], false);
- Locked{FVehicleData[v][FactionVehID]} = false;
- PlayerPlayNearbySound(playerid, SOUND_LOCK_CAR_DOOR);
- FlashVehicleLights(v);
- SendClientMessage(playerid, COLOR_WHITE, "Vehicle faction has been opened.");
- ShowInfoText(playerid,"~B~Portas Abertas!",3000);
- for(new i, k = GetPlayerPoolSize()+1; i != k; i++) {
- if(IsPlayerInVehicle(i, v) && GetPlayerState(i) == PLAYER_STATE_DRIVER) {
- TextDrawHideForPlayer(i, lockedTxD3dl);
- TextDrawShowForPlayer(i, unlockedTxD3dl);
- }
- }
- MySQLUpdateInt(FVehicleData[v][FVSQLID], "Locked", 0, "fveh");
- format(sgstr, sizeof(sgstr),"* %s pushes a button to unlock their %s. *",NameRP(playerid),GetVehicleName(FVehicleData[v][FactionVehID]));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else
- {
- ToggleVehicleLock(FVehicleData[v][FactionVehID], true);
- Locked{FVehicleData[v][FactionVehID]} = true;
- PlayerPlayNearbySound(playerid, SOUND_LOCK_CAR_DOOR);
- FlashVehicleLights(v);
- SendClientMessage(playerid, COLOR_WHITE, "Vehicle faction was locked.");
- ShowInfoText(playerid,"~B~Doors Unlocked!",3000);
- for(new i, k = GetPlayerPoolSize()+1; i != k; i++) {
- if(IsPlayerInVehicle(i, v) && GetPlayerState(i) == PLAYER_STATE_DRIVER) {
- TextDrawHideForPlayer(i, unlockedTxD3dl);
- TextDrawShowForPlayer(i, lockedTxD3dl);
- }
- }
- MySQLUpdateInt(FVehicleData[v][FVSQLID], "Locked", 1, "fveh");
- format(sgstr, sizeof(sgstr),"* %s presses a button on the keys and closes the vehicle. *",NameRP(playerid),GetVehicleName(FVehicleData[v][FactionVehID]));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- }
- }
- }
- if(GetPlayerInterior(playerid) == 0)
- {
- new m = RentRoom[playerid];
- if(IsPlayerInRangeOfPoint(playerid, 3.0, MotelData[m][RoomX], MotelData[m][RoomY], MotelData[m][RoomZ]))
- {
- if(MotelData[m][RoomLocked] == 1)
- {
- MotelData[m][RoomLocked] = 0;
- MySQLUpdateInt(m, "RoomLocked", MotelData[m][RoomLocked], "motel");
- format(sgstr, sizeof(sgstr),"* %s unlocks the door of their Motel Room. *",NameRP(playerid));
- ProxDetector(15.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "You have {4BB74C}unlocked{FFFFFF} your Motel Room.");
- ShowInfoText(playerid,"~Y~Room Unlocked!",3000);
- return true;
- }
- else
- {
- MotelData[m][RoomLocked] = 1;
- MySQLUpdateInt(m, "RoomLocked", MotelData[m][RoomLocked], "motel");
- format(sgstr, sizeof(sgstr),"* %s locks the door of their Motel Room. *",NameRP(playerid));
- ProxDetector(15.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "You have {8B0000}locked{FFFFFF} your Motel Room.");
- ShowInfoText(playerid,"~Y~Room Locked!",3000);
- return true;
- }
- }
- }
- else
- {
- if(IsInMotel[playerid] >= 1)
- {
- new m = IsInMotel[playerid];
- if(MotelData[m][RoomOwner] == SQLID[playerid])
- {
- if(MotelData[m][RoomLocked] == 1)
- {
- MotelData[m][RoomLocked] = 0;
- MySQLUpdateInt(m, "RoomLocked", MotelData[m][RoomLocked], "motel");
- format(sgstr, sizeof(sgstr),"* %s unlocks the door of their Motel Room. *",NameRP(playerid));
- ProxDetector(15.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "You have {4BB74C}unlocked{FFFFFF} your Motel Room.");
- ShowInfoText(playerid,"~Y~Room Unlocked!",3000);
- return true;
- }
- else
- {
- MotelData[m][RoomLocked] = 1;
- MySQLUpdateInt(m, "RoomLocked", MotelData[m][RoomLocked], "motel");
- format(sgstr, sizeof(sgstr),"* %s locks the door of their Motel Room. *",NameRP(playerid));
- ProxDetector(15.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "You have {8B0000}locked{FFFFFF} your Motel Room.");
- ShowInfoText(playerid,"~Y~Room Locked!",3000);
- return true;
- }
- }
- return SysMsg(playerid, "You are not renting this room.");
- }
- }
- if(IsInPrison(playerid))
- {
- if(Faction[playerid] == FACTION_COP || IsPlayerAdmin(playerid))
- {
- for(new w = 0; w < sizeof(PrisonDoors); w++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.5, PrisonDoors[w][0], PrisonDoors[w][1], PrisonDoors[w][2]))
- {
- if(PrisonDoorsLock[w] == 1)
- {
- format(sgstr, sizeof(sgstr),"* %s takes a set of keys and uses one to unlock the door. *", NameRP(playerid));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "This door has now been {4BB74C}unlocked{FFFFFF}.");
- PrisonDoorsLock[w] = 0;
- }
- else
- {
- format(sgstr, sizeof(sgstr),"* %s takes a set of keys and uses one to lock the door. *", NameRP(playerid));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "This door has now been {8B0000}locked{FFFFFF}.");
- PrisonDoorsLock[w] = 1;
- }
- return true;
- }
- if(IsPlayerInRangeOfPoint(playerid, 1.5, PrisonDoors[w][4], PrisonDoors[w][5], PrisonDoors[w][6]))
- {
- if(PrisonDoorsLock[w] == 1)
- {
- format(sgstr, sizeof(sgstr),"* %s takes a set of keys and uses one to unlock the door. *", NameRP(playerid));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "This door has now been {4BB74C}unlocked{FFFFFF}.");
- PrisonDoorsLock[w] = 0;
- }
- else
- {
- format(sgstr, sizeof(sgstr),"* %s takes a set of keys and uses one to lock the door. *", NameRP(playerid));
- ProxDetector(20.0, playerid, sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_WHITE, "This door has now been {8B0000}locked{FFFFFF}.");
- PrisonDoorsLock[w] = 1;
- }
- return true;
- }
- }
- }
- }
- SysMsg(playerid, "You are not near anything that you can lock.");
- return true;
- }
- CMD:lockgarage(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsInGarageID[playerid] != -1)
- {
- new g = IsInGarageID[playerid], h = GarageData[g][gHouseID];
- if(HouseData[h][HouseOwnerSQLID] == SQLID[playerid] || IsHouseGuest(playerid) == h)
- {
- if(GarageData[g][GarageLocked] == 1)
- {
- GarageData[g][GarageLocked] = 0;
- MySQLUpdateInt(GarageData[g][gID], "Locked", GarageData[g][GarageLocked], "garages");
- SendClientMessageF(playerid,COLOR_WHITE, "You have {4BB74C}unlocked{FFFFFF} the garage of %s.", HouseData[h][HouseDescription]);
- format(gstr, sizeof(gstr),"* %s unlocks their garage. *",NameRP(playerid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else
- {
- GarageData[g][GarageLocked] = 1;
- MySQLUpdateInt(GarageData[g][gID], "Locked", GarageData[g][GarageLocked], "garages");
- SendClientMessageF(playerid,COLOR_WHITE, "You have {8B0000}locked{FFFFFF} the garage of %s.", HouseData[h][HouseDescription]);
- format(gstr, sizeof(gstr),"* %s locks their garage. *",NameRP(playerid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- }
- else SysMsg(playerid, "You cannot access this garage.");
- }
- else
- {
- for(new g = 0; g < MAX_GARAGES; g++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, GarageData[g][oPosX], GarageData[g][oPosY], GarageData[g][oPosZ]))
- {
- new h = GarageData[g][gHouseID];
- if(HouseData[h][HouseOwnerSQLID] == SQLID[playerid] || IsHouseGuest(playerid) == h)
- {
- if(GarageData[g][GarageLocked] == 1)
- {
- GarageData[g][GarageLocked] = 0;
- MySQLUpdateInt(GarageData[g][gID], "Locked", GarageData[g][GarageLocked], "garages");
- SendClientMessageF(playerid,COLOR_WHITE, "You have {4BB74C}unlocked{FFFFFF} the garage of %s.", HouseData[h][HouseDescription]);
- format(gstr, sizeof(gstr),"* %s unlocks their garage. *",NameRP(playerid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else
- {
- GarageData[g][GarageLocked] = 1;
- MySQLUpdateInt(GarageData[g][gID], "Locked", GarageData[g][GarageLocked], "garages");
- SendClientMessageF(playerid,COLOR_WHITE, "You have {8B0000}locked{FFFFFF} the garage of %s.", HouseData[h][HouseDescription]);
- format(gstr, sizeof(gstr),"* %s locks their garage. *",NameRP(playerid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- }
- else SysMsg(playerid, "You cannot access this garage.");
- }
- }
- }
- return true;
- }
- CMD:achievements(playerid, params[])
- {
- Dialog_Show(playerid,AchievementMenu,DIALOG_STYLE_LIST,"Achievements","View My Achievements\nView Others Achievements\nMy Summary","Go","Close");
- return true;
- }
- CMD:svo(playerid, params[]) return cmd_setvisibleobjects(playerid, params);
- CMD:setvisibleobjects(playerid, params[])
- {
- if(isnull(params) || !IsNumeric(params)) return SysMsg(playerid, "Usage: /setvisibleobjects [350-1000] *This command will change the max amount of mapped objects that will be streamed to your client.*");
- new objects = strval(params);
- if(objects > 1000) return SysMsg(playerid, "Object limit cannot be higher than 1,000.");
- if(objects < 350) return SysMsg(playerid, "Object limit cannot be less than 350.");
- if(objects == VisibleObjects[playerid]) return SysMsgF(playerid, "Object limit is already %i.", objects);
- Streamer_SetVisibleItems(STREAMER_TYPE_OBJECT, objects, playerid);
- if(objects < VisibleObjects[playerid] && GetPlayerVirtualWorld(playerid) == 0 && GetPlayerInterior(playerid) == 0) Streamer_DestroyAllVisibleItems(playerid, STREAMER_TYPE_OBJECT);
- Streamer_UpdateEx(playerid, PlayerPosX(playerid), PlayerPosY(playerid), PlayerPosZ(playerid), GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
- VisibleObjects[playerid] = objects;
- mysql_pqueryf(conn, "UPDATE masters SET MaxVisibleObjects = %i WHERE id = %i", VisibleObjects[playerid], MasterAccount[playerid]);
- SysMsgF(playerid, "You have set your max visible object limit to %i. Note: This limit will be ignored in interiors to ensure all details load while indoors.", VisibleObjects[playerid]);
- return true;
- }
- CMD:hotkeys(playerid)
- {
- if(!Logged{playerid}) return true;
- SendClientMessage(playerid, COLOR_WHITE, "{FFFF82}'~k~~CONVERSATION_YES~'{FFFFFF} can be used as an alternative to {44C300}/enter.");
- SendClientMessage(playerid, COLOR_WHITE, "{FFFF82}'~k~~CONVERSATION_NO~'{FFFFFF} can be used as an alternative to {44C300}/lock.");
- SendClientMessage(playerid, COLOR_WHITE, "{FFFF82}'~k~~SNEAK_ABOUT~'{FFFFFF} can be used to unfreeze your player when entering buildings.");
- return true;
- }
- CMD:cage(playerid, params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 249.6434,-169.6998,1017.9922))
- {
- LillyCage{playerid} = !LillyCage{playerid};
- if(LillyCage{playerid}) SetPlayerPos(playerid, 248.8951,-167.8426,1018.3791);//in
- else SetPlayerPos(playerid, 249.6434,-169.6998,1017.9922); //out
- }
- return true;
- }
- CMD:roof(playerid, params[])//observar
- {
- if(!Logged{playerid}) return true;
- if(Faction[playerid] == FACTION_COP)
- {
- if(IsPlayerInRangeOfPoint(playerid,3.0,635.7831,-566.9708,1011.9344))
- {
- SetPlayerPos(playerid,621.417,-570.289,26.1432);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorldEx(playerid,0);
- SetTimerEx("UnFreezePlayer", 1000, 0, "d", playerid);
- TogglePlayerControllable(playerid, 0);
- }
- }
- if(IsPlayerInRangeOfPoint(playerid,3.0,243.210525, 66.328117, 1003.640625))
- {
- SetPlayerPos(playerid,94.300003, 1062.325683, 24.817752);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorldEx(playerid,0);
- SetTimerEx("UnFreezePlayer", 1000, 0, "d", playerid);
- TogglePlayerControllable(playerid, 0);
- }
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 678.033081, 1814.505371, -5.632563))
- {
- TogglePlayerControllable(playerid, 0);
- Streamer_UpdateEx(playerid, 667.4, 1816.2, 10.2, 0, 0);
- SetPlayerPos(playerid,667.43804931641, 1816.2852783203, 10.272919654846);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorldEx(playerid,0);
- SetTimerEx("UnFreezePlayer", 1000, 0, "d", playerid);
- }
- return true;
- }
- CMD:enter(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new vid = GetPlayerVehicleID(playerid);
- if(vid == 0)
- {
- for(new in = 0; in < MAX_INTERIORS; in++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.5, Interiors[in][oPosX], Interiors[in][oPosY], Interiors[in][oPosZ]) && GetPlayerVirtualWorld(playerid) == Interiors[in][oVirtualWorld])
- {
- if(Interiors[in][IntFaction] > 0 && Interiors[in][IntFaction] != Faction[playerid] && !IsPlayerAdmin(playerid)) return SysMsg(playerid,"You may not enter.");
- if(Interiors[in][IntFactionRank] > 0 && Interiors[in][IntFactionRank] > FactionRank[playerid] && !IsPlayerAdmin(playerid)) return SysMsg(playerid,"You are not a high enough rank for this faction interior.");
- Teleport(playerid, Interiors[in][iPosX], Interiors[in][iPosY], Interiors[in][iPosZ], Interiors[in][iAngle], Interiors[in][iInteriorID], Interiors[in][iVirtualWorld]);
- new interiorText[100];
- format(interiorText, 100, "~W~");
- strcat(interiorText, Interiors[in][InteriorName]);
- strcat(interiorText, "~N~~R~Type /exit to go outside");
- ShowInfoText(playerid, interiorText, 5000);
- SetWorldTime(11);
- if(Interiors[in][interiorID] == 7 || Interiors[in][interiorID] == 20 || Interiors[in][interiorID] == 21)
- SendClientMessage(playerid, COLOR_WHITE, "Rule: Do not PR (Payday Rush). Please walk when inside this town hall and also when around the exterior.");
- return true;
- }
- }
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, DOOR_PROXIMITY, HouseData[h][oPosX],HouseData[h][oPosY],HouseData[h][oPosZ]) && GetPlayerVirtualWorld(playerid) == HouseData[h][HouseExtVW])
- {
- if(HouseData[h][HouseLocked] == 1 && ADuty[playerid] != 1) return SysMsgF(playerid, "%s is locked.",HouseData[h][HouseDescription]);
- if(strlen(HouseData[h][DoorNoteMessage]) > 1 && HouseData[h][HouseOwnerSQLID] == SQLID[playerid])
- {
- new noteMsg[200];
- format(noteMsg,200,"Message: '%s'",HouseData[h][DoorNoteMessage]);
- ShowMessage(playerid, "Note On Door", noteMsg, "Done");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE houses SET DoorNote = '' WHERE id = %i", HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery);
- HouseData[h][DoorNoteMessage][0] = 0;
- }
- if(HouseData[h][InsideID] == 11) //custom interiors
- {
- Teleport(playerid, HouseData[h][intPosX], HouseData[h][intPosY], HouseData[h][intPosZ], 0.0, HouseData[h][HouseInterior], HouseData[h][HouseVW]);
- IsInHouseID[playerid] = h;
- GameTextForPlayer(playerid,"~N~~N~~N~~W~Type ~r~/exit ~w~to go outside",5000,3);
- }
- else //default interiors
- {
- new x = HouseData[h][InsideID] - 1;
- Teleport(playerid, InsideIDs[x][InsideX], InsideIDs[x][InsideY], InsideIDs[x][InsideZ], InsideIDs[x][InsideAng], InsideIDs[x][InsideInt], HouseData[h][HouseVW]);
- IsInHouseID[playerid] = h;
- GameTextForPlayer(playerid,"~N~~N~~N~~W~Type ~r~/exit ~w~to go outside",5000,3);
- }
- HouseData[h][HouseOccupants] ++;
- if(HouseData[h][HMusicPlaying] == 1) PlayAudioStreamForPlayerEx(playerid, HouseData[h][HMusic]);
- return true;
- }
- }
- for(new b = 0; b < MAX_BIZZ; b++)
- {
- if(IsPlayerInRangeOfPoint(playerid, DOOR_PROXIMITY, BizzData[b][oPosX],BizzData[b][oPosY],BizzData[b][oPosZ]))
- {
- if(BizzData[b][BizzType] == BIZZ_TYPE_STATIC && BizzData[b][IsSpecial] == 0) return SysMsg(playerid,"This business cannot be entered.");
- if(BizzData[b][BizzLocked] && ADuty[playerid] == 0) return SysMsgF(playerid, "[%s] The Door Is Locked.", BizzData[b][BizzDescription]);
- if(BizzData[b][EnterFee] > 0 && (BizzData[b][BizzOwnerSQLID] > 0 && BizzData[b][BizzOwnerSQLID] != SQLID[playerid]))
- {
- new nopay = 0;
- //no enter fee for SAN employees at SAN building
- if(BizzData[b][BizzSQLID] == 19 && Faction[playerid] == FACTION_NEWS) nopay = 1;
- if(IsBizzMod(playerid, b)) nopay = 1;
- if(nopay == 0)
- {
- if(Cash[playerid] < BizzData[b][EnterFee]) return SysMsg(playerid,"You don't have enough cash for the entrance fee.");
- GivePlayerCash(playerid, -BizzData[b][EnterFee]);
- BizzData[b][BizzEarnings] += BizzData[b][EnterFee];
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- }
- }
- if(BizzData[b][BizzOwnerSQLID] > 0)
- {
- if(BizzData[b][BizzOwnerSQLID] == SQLID[playerid]) SendClientMessageF(playerid, COLOR_WHITE, "[%s] You are the owner of this business. For business related commands use '/help bizz'", BizzData[b][BizzDescription]);
- else if(BizzData[b][BizzOwnerSQLID] == -5) SendClientMessageF(playerid, COLOR_WHITE, "Welcome to %s. Owned by Silver Trading. Entrance fee: $%i", BizzData[b][BizzDescription], BizzData[b][EnterFee]);
- else SendClientMessageF(playerid, COLOR_WHITE, "Welcome to %s. Owned by %s. Entrance fee: $%i", BizzData[b][BizzDescription], GetSQLName(BizzData[b][BizzOwnerSQLID]), BizzData[b][EnterFee]);
- }
- else SendClientMessageF(playerid, COLOR_WHITE, "Welcome to %s. This business has no owner.", BizzData[b][BizzDescription]);
- if(BizzData[b][IsSpecial] == 1)
- {
- Teleport(playerid, BizzData[b][iPosX], BizzData[b][iPosY], BizzData[b][iPosZ], 0.0, BizzData[b][InteriorID], BizzData[b][BizzVW]);
- IsInBizzID[playerid] = b;
- }
- else
- {
- new x = BizzData[b][BizzType];
- Teleport(playerid, BInsideIDs[x][InsideX], BInsideIDs[x][InsideY], BInsideIDs[x][InsideZ], BInsideIDs[x][InsideAng], BInsideIDs[x][InsideInt], BizzData[b][BizzVW]);
- GameTextForPlayer(playerid, "~N~~N~~N~~W~Welcome to the business~N~~R~type /exit to go outside", 5000, 3);
- IsInBizzID[playerid] = b;
- }
- BizzData[b][BizzOccupants] ++;
- if(BizzData[b][BMusicPlaying] == 1) PlayAudioStreamForPlayerEx(playerid, BizzData[b][BMusic]);
- return true;
- }
- }
- for(new i = 1; i < MAX_MOTELROOMS; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 0.75, MotelData[i][RoomX], MotelData[i][RoomY], MotelData[i][RoomZ]) && MotelData[i][RoomOwner] > 0)
- {
- if(MotelData[i][RoomLocked] == 1) return SysMsg(playerid, "This room is locked.");
- Teleport(playerid, -434.7513, -775.4567, 971.0526, 0.0, 11, 50000+i);
- IsInMotel[playerid] = i;
- switch(MotelData[i][MotelID])
- {
- case 1,4,5,6: // $100 rent
- {
- Teleport(playerid, 2282.726806, -1139.603515, 1050.898437, 0.0, 11, 50000+i);
- IsInMotel[playerid] = i;
- return true;
- }
- case 2,7: // $200 rent
- {
- Teleport(playerid, 2217.425781, -1076.156494, 1050.484375, 9.0, 1, 50000+i);
- IsInMotel[playerid] = i;
- return true;
- }
- case 3: // $500 rent
- {
- Teleport(playerid, 2233.775634, -1114.455688, 1050.882812, 0.0, 5, 50000+i);
- IsInMotel[playerid] = i;
- return true;
- }
- }
- }
- }
- }
- for(new g = 0; g < MAX_GARAGES; g++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, GarageData[g][oPosX], GarageData[g][oPosY], GarageData[g][oPosZ]))
- {
- if(GarageData[g][GarageLocked] == 1 && ADuty[playerid] != 1) return SysMsg(playerid, "This garage is locked.");
- if(GarageData[g][gType] == 1) //tiny 1 car garage
- {
- if(GarageCheck(g, 1) && IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "There is currently a vehicle blocking the garage entrance.");
- if(vid >= 1)
- {
- SetVehiclePos(vid, 1449.0339, -2518.7883, 13.7018);
- SetVehicleZAngle(vid, 90.0);
- SetVehicleVirtualWorld(vid, GarageData[g][iVirtualWorld]);
- LinkVehicleToInterior(vid, 1);
- foreach(new p: Player)
- {
- if(GetPlayerVehicleID(p) == vid)
- {
- SetPlayerVirtualWorld(p, GarageData[g][iVirtualWorld]);
- SetPlayerInterior(p, 1);
- IsInGarageID[p] = g;
- }
- }
- return true;
- }
- else
- {
- Teleport(playerid, 1452.6891, -2516.3198, 13.5750, 90.0, 1, GarageData[g][iVirtualWorld]);
- IsInGarageID[playerid] = g;
- return true;
- }
- }
- if(GarageData[g][gType] == 2) //normal single car garage
- {
- if(GarageCheck(g, 1) && IsPlayerInAnyVehicle(playerid)) return SysMsg(playerid, "There is currently a vehicle blocking the garage entrance.");
- if(vid >= 1)
- {
- SetVehiclePos(vid, 1836.6912, -2440.2810, 13.7131);
- SetVehicleZAngle(vid, 90.0);
- SetVehicleVirtualWorld(vid, GarageData[g][iVirtualWorld]);
- LinkVehicleToInterior(vid, 1);
- foreach(new p: Player)
- {
- if(GetPlayerVehicleID(p) == vid)
- {
- SetPlayerVirtualWorld(p, GarageData[g][iVirtualWorld]);
- SetPlayerInterior(p, 1);
- IsInGarageID[p] = g;
- }
- }
- return true;
- }
- else
- {
- Teleport(playerid, 1840.1310, -2436.8567, 13.5859, 90.0, 1, GarageData[g][iVirtualWorld]);
- IsInGarageID[playerid] = g;
- return true;
- }
- }
- else if(GarageData[g][gType] == 3) //standard 2 car garage
- {
- if(vid >= 1)
- {
- new side[6];
- if(sscanf(params, "s[6]", side)) return SysMsg(playerid, "Usage: /enter [left/right]");
- if(strcmp(side, "left", true) == 0)
- {
- if(GarageCheck(g, 1, 0)) return SysMsg(playerid, "There is currently a vehicle blocking the garage entrance.");
- SetVehiclePos(vid, 2081.5933, -2479.1887, 13.7145);
- }
- else if(strcmp(side, "right", true) == 0)
- {
- if(GarageCheck(g, 1, 1)) return SysMsg(playerid, "There is currently a vehicle blocking the garage entrance.");
- SetVehiclePos(vid, 2081.593, -2473.189, 13.92);
- }
- else return SysMsg(playerid, "Usage: /enter [left/right]");
- SetVehicleZAngle(vid, 90.0);
- SetVehicleVirtualWorld(vid, GarageData[g][iVirtualWorld]);
- LinkVehicleToInterior(vid, 1);
- foreach(new p: Player)
- {
- if(GetPlayerVehicleID(p) == vid)
- {
- SetPlayerVirtualWorld(p, GarageData[g][iVirtualWorld]);
- IsInGarageID[p] = g;
- SetPlayerInterior(p, 1);
- }
- }
- return true;
- }
- else
- {
- Teleport(playerid, 2086.1670, -2476.5586, 13.5859, 90.0, 1, GarageData[g][iVirtualWorld]);
- SetPlayerVirtualWorld(playerid, GarageData[g][iVirtualWorld]);
- IsInGarageID[playerid] = g;
- return true;
- }
- }
- else if(GarageData[g][gType] == 4) //fancy 2 car garage
- {
- if(vid >= 1)
- {
- new side[6];
- if(sscanf(params, "s[6]", side)) return SysMsg(playerid, "Usage: /enter [left/right]");
- if(strmatch("left", side))
- {
- if(GarageCheck(g, 1, 0)) return SysMsg(playerid, "There is currently a vehicle blocking the garage entrance.");
- SetVehiclePos(vid, 1566.3131, -2562.6003, 13.7139);
- }
- else if(strmatch("right", side))
- {
- if(GarageCheck(g, 1, 1)) return SysMsg(playerid, "There is currently a vehicle blocking the garage entrance.");
- SetVehiclePos(vid, 1566.283, -2555.600, 13.296);
- }
- else return SysMsg(playerid, "Usage: /enter [left/right]");
- SetVehicleZAngle(vid, 90.0);
- SetVehicleVirtualWorld(vid, GarageData[g][iVirtualWorld]);
- LinkVehicleToInterior(vid, 1);
- foreach(new p: Player)
- {
- if(GetPlayerVehicleID(p) == vid)
- {
- SetPlayerVirtualWorld(p, GarageData[g][iVirtualWorld]);
- IsInGarageID[p] = g;
- SetPlayerInterior(p, 1);
- }
- }
- return true;
- }
- else
- {
- Teleport(playerid, 1571.5144, -2567.9014, 13.5989, 90.0, 1, GarageData[g][iVirtualWorld]);
- SetPlayerVirtualWorld(playerid, GarageData[g][iVirtualWorld]);
- IsInGarageID[playerid] = g;
- return true;
- }
- }
- else if(GarageData[g][gType] == 5) //custom garage
- {
- if(vid >= 1)
- {
- SetVehiclePos(vid, GarageData[g][iPosX], GarageData[g][iPosY], GarageData[g][iPosZ]);
- SetVehicleVirtualWorld(vid, GarageData[g][iVirtualWorld]);
- LinkVehicleToInterior(vid, GarageData[g][InsideInt]);
- foreach(new p: Player)
- {
- if(GetPlayerVehicleID(p) == vid)
- {
- SetPlayerVirtualWorld(p, GarageData[g][iVirtualWorld]);
- if(GarageData[g][UseHouse]) IsInHouseID[p] = GarageData[g][gHouseID];
- else IsInGarageID[p] = g;
- SetPlayerInterior(p, GarageData[g][InsideInt]);
- }
- }
- return true;
- }
- else
- {
- Teleport(playerid, GarageData[g][iPosX], GarageData[g][iPosY], GarageData[g][iPosZ], GarageData[g][iAngle], 1, GarageData[g][iVirtualWorld]);
- if(GarageData[g][UseHouse]) IsInHouseID[playerid] = GarageData[g][gHouseID];
- else IsInGarageID[playerid] = g;
- SetPlayerInterior(playerid, GarageData[g][InsideInt]);
- return true;
- }
- }
- }
- }
- if(IsPlayerInRangeOfPoint(playerid, 5.0, -4118.1626, 1863.7806, -6.0066)) //pirate ship
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- SetPlayerPos(playerid, x, y, z + 20.0);
- TogglePlayerControllable(playerid, false);
- SetTimerEx("PutPlayerInShip", 500, 0, "i", playerid);
- return true;
- }
- new model = GetVehicleModel(vid);
- UnlockAchievement(playerid,12);
- if(model == 592 && vid > 0)
- {
- RemovePlayerFromVehicle(playerid);
- SetPlayerPos(playerid,315.747528,973.342773,1961.580932);
- SetPlayerFacingAngle(playerid,4.525218);
- SetPlayerInterior(playerid,9);
- return true;
- }
- // Aperture
- else if(IsPlayerInRangeOfPoint(playerid,2.5,281.6272,1821.7705,17.6406)) //Area51 Onto Runway
- {
- if(vid > 0)
- {
- SetVehiclePos(vid,291.2745,1821.3871,17.6406);
- SetVehicleZAngle(vid,265.0996);
- }
- else
- {
- SetPlayerPos(playerid,291.2745,1821.3871,17.6406);
- SetPlayerFacingAngle(playerid,265.0996);
- }
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid,2.5,291.2745,1821.3871,17.6406) && Faction[playerid] == FACTION_RESEARCH) //Area51 Off Runway
- {
- if(vid > 0)
- {
- SetVehiclePos(vid,281.6272,1821.7705,17.6406);
- SetVehicleZAngle(vid,265.0996);
- }
- else
- {
- SetPlayerPos(playerid,281.6272,1821.7705,17.6406);
- SetPlayerFacingAngle(playerid,265.0996);
- }
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid,10.0,135.2250,1952.6047,19.4092) && Faction[playerid] == FACTION_RESEARCH) //Area51 In base
- {
- if(vid > 0)
- {
- SetVehiclePos(vid,134.8420,1929.8167,19.2142);
- SetVehicleZAngle(vid,180.0);
- }
- }
- else if(IsPlayerInRangeOfPoint(playerid,10.0,134.8420,1929.8167,19.2142) && Faction[playerid] == FACTION_RESEARCH) //Area51 Out base
- {
- if(vid > 0)
- {
- SetVehiclePos(vid,135.2250,1952.6047,19.4092);
- SetVehicleZAngle(vid,0.0);
- return true;
- }
- }
- //Aperture Post
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -119.2304,1607.1378,18.1936) && Faction[playerid] == FACTION_RESEARCH)
- {
- SetPlayerPos(playerid,-121.0000,1607.1378,18.4500);
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -107.9196,1607.6631,18.1957) && Faction[playerid] == FACTION_RESEARCH)
- {
- SetPlayerPos(playerid,-105.9196,1607.6631,18.4500);
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid,5.0, 974.4432,-1091.5729,24.2055)) //ST garage ENTER
- {
- if(Faction[playerid] != FACTION_PROP) return true;
- if(vid == 0)
- {
- SetPlayerPos(playerid,1484.3281,-2592.6111,13.6177);
- SetPlayerFacingAngle(playerid, 358.4381);
- SetPlayerInterior(playerid,187);
- SetPlayerVirtualWorldEx(playerid, 187);
- }
- else
- {
- SetVehiclePos(vid, 1481.2957,-2589.0603,13.6197);
- SetVehicleZAngle(vid, 360.0);
- LinkVehicleToInteriorEx(vid, 187);
- SetVehicleVirtualWorld(vid, 187);
- foreach(new v: Player)
- {
- if(Logged{v})
- {
- if(GetPlayerVehicleID(v) == vid)
- {
- SetPlayerVirtualWorldEx(v, 187);
- SetPlayerInterior(v, 187);
- }
- }
- }
- }
- ShowInfoText(playerid,"~W~ST garage~N~~R~type /exit to go back",5000);
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 10.0, -63.7647, -1116.42, 1.078)) //rosmc garage enter
- {
- if(vid == 0) Teleport(playerid, -108.818, -1136.22, 1001.34, 90.0, 1, 3);
- else
- {
- SetVehiclePos(vid, -113.4797, -1137.5911, 1001.5186);
- SetVehicleZAngle(vid, 90.0);
- LinkVehicleToInteriorEx(vid, 1);
- SetVehicleVirtualWorld(vid, 3);
- foreach(new v: Player)
- {
- if(Logged{v})
- {
- if(GetPlayerVehicleID(v) == vid)
- {
- SetPlayerVirtualWorldEx(v, 3);
- SetPlayerInterior(v, 1);
- }
- }
- }
- }
- ShowInfoText(playerid,"~W~RosMC garage~N~~R~type /exit to go back",5000);
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid,5.0, 623.303771, -598.885620, 17.077930)) //dpd garage ENTER
- {
- if(!IsCop(playerid)) return SysMsg(playerid, "You must be a police officer if you wish to enter this garage.");
- if(vid == 0)
- {
- SetPlayerPos(playerid,2300.9836,2498.7104,3.2734);
- SetPlayerFacingAngle(playerid, 180.0);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorldEx(playerid, 911);
- }
- else
- {
- SetVehiclePos(vid, 2300.9836,2498.7104,3.2734);
- SetVehicleZAngle(vid, 180.0);
- SetPlayerInterior(playerid, 0);
- SetVehicleVirtualWorld(vid, 911);
- foreach(new v: Player)
- {
- if(Logged{v})
- {
- if(GetPlayerVehicleID(v) == vid)
- {
- SetPlayerVirtualWorldEx(v, 911);
- }
- }
- }
- }
- ShowInfoText(playerid,"~W~DPD garage~N~~R~type /exit to go back",5000);
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid,5.0, 1198.8041,254.2202,19.5547)) //SAN garage ENTER
- {
- if(Faction[playerid] != FACTION_NEWS) return SysMsg(playerid,"You may not enter this garage.");
- if(vid == 0)
- {
- SetPlayerPos(playerid, 1123.5432, 225.0353, 845.3271);
- SetPlayerFacingAngle(playerid, 90.0);
- SetPlayerInterior(playerid,6);
- SetPlayerVirtualWorldEx(playerid, 558822);
- }
- else
- {
- SetVehiclePos(vid, 1123.5432, 225.0353, 845.3271);
- SetVehicleZAngle(vid, 90.0);
- LinkVehicleToInteriorEx(vid, 6);
- SetVehicleVirtualWorld(vid, 558822);
- foreach(new v: Player)
- {
- if(Logged{v})
- {
- if(GetPlayerVehicleID(v) == vid)
- {
- SetPlayerVirtualWorldEx(v, 558822);
- SetPlayerInterior(v, 6);
- }
- }
- }
- }
- ShowInfoText(playerid,"~W~SAN garage~N~~R~type /exit to go back",5000);
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, 844.2215, -598.8593, 18.4219)) //swat garage ENTER
- {
- if(Faction[playerid] != FACTION_COP) return SysMsg(playerid,"You may not enter this garage.");
- if(vid == 0)
- {
- SetPlayerPos(playerid, 2040.6063, -2587.3342, 13.6177);
- SetPlayerFacingAngle(playerid, 90.0);
- SetPlayerInterior(playerid,6);
- SetPlayerVirtualWorldEx(playerid, 558821);
- }
- else
- {
- SetVehiclePos(vid, 2036.1995, -2593.0525, 13.6216);
- SetVehicleZAngle(vid, 90.0);
- LinkVehicleToInteriorEx(vid, 6);
- SetVehicleVirtualWorld(vid, 558821);
- foreach(new v: Player)
- {
- if(Logged{v})
- {
- if(GetPlayerVehicleID(v) == vid)
- {
- SetPlayerVirtualWorldEx(v, 558821);
- SetPlayerInterior(v, 6);
- }
- }
- }
- }
- ShowInfoText(playerid,"~W~swat garage~N~~R~type /exit to go back",5000);
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, 1239.3077, 180.7602, 19.9204)) //info center left entrance
- {
- if(vid == 0) return SysMsg(playerid, "You must be in a vehicle to use this entrance.");
- if(!IsRentalCar(vid)) return SysMsg(playerid, "The vehicle must be a rental car.");
- SetVehiclePos(vid, 1245.4321, 170.6587, 2086.3684);
- SetVehicleZAngle(vid, 180.0);
- LinkVehicleToInteriorEx(vid, 2);
- SetVehicleVirtualWorld(vid, 1);
- new b = GetBizzIDFromSQL(73);
- foreach(new v: Player)
- {
- if(Logged{v} && GetPlayerVehicleID(v) == vid)
- {
- SetPlayerVirtualWorldEx(v, 1);
- SetPlayerInterior(v, 2);
- IsInBizzID[v] = b;
- }
- }
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, 1219.8643, 189.4231, 19.9018)) //info center right entrance
- {
- if(vid == 0) return SysMsg(playerid, "You must be in a vehicle to use this entrance.");
- SetVehiclePos(vid, 1224.1946, 171.3404, 2086.3726);
- SetVehicleZAngle(vid, 180.0);
- LinkVehicleToInteriorEx(vid, 2);
- SetVehicleVirtualWorld(vid, 1);
- new b = GetBizzIDFromSQL(73);
- IsInBizzID[playerid] = b;
- foreach(new v: Player)
- {
- if(Logged{v})
- {
- if(GetPlayerVehicleID(v) == vid)
- {
- SetPlayerVirtualWorldEx(v, 1);
- SetPlayerInterior(v, 2);
- IsInBizzID[v] = b;
- }
- }
- }
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, 617.8813, 1667.3865, 6.9922)) //Trucking Garage 1
- {
- if(Faction[playerid] != FACTION_TRUCKING) return SysMsg(playerid, "Only Truckers can enter the garage.");
- if(vid > 0)
- {
- SetVehiclePos(vid, 1062.526489, 2084.312500, 11.83835);
- SetVehicleZAngle(vid, 270.0);
- ShowInfoText(playerid,"~W~elite trucking garage~N~~R~type /exit to go back",5000);
- }
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, 584.7940, 1644.5438, 6.9922)) //Trucking Garage 2
- {
- if(Faction[playerid] != FACTION_TRUCKING) return SysMsg(playerid, "Only Truckers can enter the garage.");
- if(vid > 0)
- {
- SetVehiclePos(vid, 1062.935791, 2132.715087, 11.839662);
- SetVehicleZAngle(vid, 255.4);
- ShowInfoText(playerid,"~W~elite trucking garage~N~~R~type /exit to go back",5000);
- }
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 7.0, 219.3465,8.0401,2.2700)) // BB Garage
- {
- if(vid > 0)
- {
- SetVehiclePos(vid, 1060.2075,2086.2024,10.5256);
- SetVehicleZAngle(vid, 328.4567);
- SetVehicleVirtualWorld(vid, 187);
- foreach(new p: Player) if(GetPlayerVehicleID(p) == vid) SetPlayerVirtualWorldEx(p, 187);
- return true;
- }
- else
- {
- SetPlayerPos(playerid,1060.2075,2086.2024,10.5256);
- SetPlayerFacingAngle(playerid,328.4567);
- SetPlayerVirtualWorldEx(playerid,187);
- return true;
- }
- }
- if(vid == 0)
- {
- new cVeh = GetClosestVehicle(playerid);
- new Float:Pos[3];
- GetVehiclePos(cVeh, Pos[0], Pos[1], Pos[2]);
- if(GetVehicleModel(cVeh) == 519 && IsPlayerInRangeOfPoint(playerid, 15.0, Pos[0], Pos[1], Pos[2]))
- {
- Teleport(playerid, 1.752286,34.395935,1199.593750, 182.570526, 1, cVeh);
- ShamalInterior[playerid] = cVeh;
- return true;
- }
- if(GetVehicleModel(cVeh) == 508 && IsPlayerInRangeOfPoint(playerid, 10.0, Pos[0], Pos[1], Pos[2]))
- {
- if(Locked{cVeh}) return SysMsg(playerid, "This Journey is locked.");
- Teleport(playerid, 2216.6523, -465.2169, 1023.7059, 0.0, 1, cVeh);
- JourneyInterior[playerid] = cVeh;
- return true;
- }
- if(GetVehicleModel(cVeh) == 454 && IsPlayerInRangeOfPoint(playerid, 15.0, Pos[0], Pos[1], Pos[2]))
- {
- if(Locked{cVeh}) return SysMsg(playerid, "This Tropic is locked.");
- Teleport(playerid, 2120.3872, -94.9943, 950.1429, 0.0, 1, cVeh);
- TropicInterior[playerid] = cVeh;
- return true;
- }
- if(IsTrailer(cVeh) && IsPlayerInRangeOfPoint(playerid, 10.0, Pos[0], Pos[1], Pos[2]))
- {
- foreach(new i: Player)
- {
- if(TruckingTrailer[i] == cVeh)
- {
- if(IsTrucking[i] == 1 || DeliveringStock[i] == 1) Teleport(playerid, 585.0163, 1682.1957, 995.6417, 0.0, 2, cVeh);
- return true;
- }
- }
- Teleport(playerid, 585.0163, 1682.1957, 995.6417, 0.0, 1, cVeh);
- TrailerInterior[playerid] = cVeh;
- }
- }
- else if(vid > 0)
- {
- if(GetVehicleModel(vid) == 508)
- {
- Teleport(playerid, 2216.6523, -465.2169, 1023.7059, 0.0, 1, vid);
- JourneyInterior[playerid] = vid;
- return true;
- }
- if(GetVehicleModel(vid) == 454)
- {
- Teleport(playerid, 2120.3872, -94.9943, 950.1429, 0.0, 1, vid);
- TropicInterior[playerid] = vid;
- return true;
- }
- }
- if(IsInPrison(playerid))
- {
- for(new w = 0; w < 16; w++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, PrisonCellsOut[w][0], PrisonCellsOut[w][1], PrisonCellsOut[w][2]))
- {
- if(PrisonCellsLock[w] == 1) return SysMsg(playerid, "This cell door is locked.");
- else return SetPlayerPos(playerid, PrisonCellsIn[w][0], PrisonCellsIn[w][1], PrisonCellsIn[w][2]);
- }
- }
- for(new w = 0; w < sizeof(PrisonDoors); w++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, PrisonDoors[w][0], PrisonDoors[w][1], PrisonDoors[w][2]) && GetPlayerVirtualWorld(playerid) == PrisonWorldsOut[w])
- {
- if(PrisonDoorsLock[w] == 1) return SysMsg(playerid, "This door is locked.");
- SetPlayerPos(playerid, PrisonDoors[w][4], PrisonDoors[w][5], PrisonDoors[w][6]);
- SetPlayerFacingAngle(playerid, PrisonDoors[w][7]);
- SetPlayerVirtualWorld(playerid, PrisonWorldsIn[w]);
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 1.0, PrisonDoors[w][4], PrisonDoors[w][5], PrisonDoors[w][6]) && GetPlayerVirtualWorld(playerid) == PrisonWorldsIn[w])
- {
- if(PrisonDoorsLock[w] == 1) return SysMsg(playerid, "This door is locked.");
- if(w == 12)
- {
- TogglePlayerControllable(playerid, false);
- SetTimerEx("UnFreezePlayer", 1000, 0, "d", playerid);
- }
- SetPlayerPos(playerid, PrisonDoors[w][0], PrisonDoors[w][1], PrisonDoors[w][2]);
- SetPlayerFacingAngle(playerid, PrisonDoors[w][3]);
- SetPlayerVirtualWorld(playerid, PrisonWorldsOut[w]);
- return true;
- }
- }
- }
- foreach(new p: Player)
- {
- if(IsSpectating[p] == playerid)
- {
- SetPlayerVirtualWorldEx(p, GetPlayerVirtualWorld(playerid));
- SetPlayerInterior(p, GetPlayerInterior(playerid));
- PlayerSpectatePlayer(p, playerid);
- }
- }
- return true;
- }
- CMD:ent(playerid, params[]) return cmd_enter(playerid, params);
- CMD:e(playerid, params[])
- {
- if(GetPlayerState(playerid) == 1) return cmd_enter(playerid, params);
- else return cmd_eon(playerid);
- }
- CMD:exit(playerid)
- {
- if(!Logged{playerid}) return true;
- UnlockAchievement(playerid,13);
- for(new i = 0; i < MAX_INTERIORS; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, Interiors[i][iPosX], Interiors[i][iPosY], Interiors[i][iPosZ]) && GetPlayerVirtualWorld(playerid) == Interiors[i][iVirtualWorld] && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- Teleport(playerid, Interiors[i][oPosX], Interiors[i][oPosY], Interiors[i][oPosZ], Interiors[i][oAngle], Interiors[i][oInteriorID], Interiors[i][oVirtualWorld]);
- if(Interiors[i][interiorID] == 115) IsInBizzID[playerid] = GetBizzID("SANews Corporation HQ.");
- if(Interiors[i][oInteriorID] == 0 && Interiors[i][oVirtualWorld] == 0)
- {
- IsInHouseID[playerid] = -1;
- IsInBizzID[playerid] = -1;
- IsInGarageID[playerid] = -1;
- }
- return true;
- }
- }
- if(IsInGarageID[playerid] != -1 && GetPlayerVirtualWorld(playerid) == GarageData[IsInGarageID[playerid]][iVirtualWorld])
- {
- new g = IsInGarageID[playerid];
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(GarageCheck(g, 0)) return SysMsg(playerid, "There is currently a vehicle blocking your exit.");
- new vid = GetPlayerVehicleID(playerid);
- SetVehiclePos(vid, GarageData[g][oPosX], GarageData[g][oPosY], GarageData[g][oPosZ]);
- SetVehicleVirtualWorld(vid, 0);
- LinkVehicleToInterior(vid, 0);
- SetVehicleZAngle(vid, GarageData[g][oVehicleAngle]);
- foreach(new i: Player)
- {
- if(GetPlayerVehicleID(i) == vid)
- {
- SetPlayerVirtualWorld(i, 0);
- SetPlayerInterior(i, 0);
- IsInGarageID[i] = -1;
- }
- }
- return true;
- }
- else
- {
- SetPlayerPos(playerid, GarageData[g][oPosX], GarageData[g][oPosY], GarageData[g][oPosZ]);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 0);
- IsInGarageID[playerid] = -1;
- }
- return true;
- }
- new VehId = GetPlayerVehicleID(playerid);
- if(IsPlayerInRangeOfPoint(playerid,7.5,315.747528,973.342773,1961.580932)) //Adromada
- {
- for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
- {
- new model = GetVehicleModel(v);
- if(model == 592)
- {
- new Float:ox,Float:oy,Float:oz,Float:ang;
- GetVehiclePos(v,ox,oy,oz);
- GetVehicleZAngle(v,ang);
- if(ang < 90 && ang > 0)
- {
- SetPlayerPos(playerid,ox-5,oy-5,oz);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorldEx(playerid,0);
- return true;
- }
- else if(ang > 89 && ang < 181)
- {
- SetPlayerPos(playerid,ox-5,oy+5,oz);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorldEx(playerid,0);
- return true;
- }
- else if(ang < 271 && ang > 180)
- {
- SetPlayerPos(playerid,ox+5,oy+5,oz);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorldEx(playerid,0);
- return true;
- }
- else if(ang > 270 && ang < 0)
- {
- SetPlayerPos(playerid,ox+5,oy-5,oz);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorldEx(playerid,0);
- return true;
- }
- }
- }
- }
- else if(ShamalInterior[playerid] > 0)
- {
- new Float:sPos[3];
- GetVehiclePos(ShamalInterior[playerid], sPos[0], sPos[1], sPos[2]);
- SetPlayerPos(playerid, sPos[0]+2.0, sPos[1]+2.0, sPos[2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorldEx(playerid, 0);
- ShamalInterior[playerid] = 0;
- return true;
- }
- else if(JourneyInterior[playerid] > 0)
- {
- new seatavailable = 1;
- foreach(new pl: Player)
- {
- if(GetPlayerVehicleID(pl) == JourneyInterior[playerid] && GetPlayerState(pl) == PLAYER_STATE_PASSENGER)
- {
- seatavailable = 0;
- }
- }
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorldEx(playerid, GetVehicleVirtualWorld(JourneyInterior[playerid]));
- if(seatavailable == 0)
- {
- new Float:sPos[3];
- GetVehiclePos(JourneyInterior[playerid], sPos[0], sPos[1], sPos[2]);
- SetPlayerPos(playerid, sPos[0]+2.0, sPos[1]+2.0, sPos[2]);
- }
- else PutPlayerInVehicle(playerid, JourneyInterior[playerid], 1);
- JourneyInterior[playerid] = 0;
- return true;
- }
- else if(TropicInterior[playerid] > 0)
- {
- new Float:x, Float:y, Float:z, Float:a;
- GetVehiclePos(TropicInterior[playerid], x, y, z);
- GetVehicleZAngle(TropicInterior[playerid], a);
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, x, y, z + 5);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- TropicInterior[playerid] = 0;
- TeleportTimer[playerid] = 4;
- BeingTeleported{playerid} = true;
- return true;
- }
- else if(TrailerInterior[playerid] > 0)
- {
- new Float:x, Float:y, Float:z, Float:a;
- GetVehiclePos(TrailerInterior[playerid], x, y, z);
- GetVehicleZAngle(TrailerInterior[playerid], a);
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, x, y, z + 3);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, GetVehicleVirtualWorld(TrailerInterior[playerid]));
- TrailerInterior[playerid] = 0;
- TeleportTimer[playerid] = 4;
- BeingTeleported{playerid} = true;
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 7.0, 1123.5432,225.0353,845.3271) && GetPlayerVirtualWorld(playerid) == 187) //BB Garage
- {
- if(VehId > 0)
- {
- SetVehiclePos(VehId, 219.3465,8.0401,2.2797);
- SetVehicleZAngle(VehId, 269.8848);
- SetVehicleVirtualWorld(VehId, 0);
- foreach(new p: Player)
- {
- if(GetPlayerVehicleID(p) == VehId)
- {
- SetPlayerVirtualWorldEx(p, 0);
- }
- }
- }
- else
- {
- SetPlayerPos(playerid,219.3465,8.0401,2.2797);
- SetPlayerFacingAngle(playerid,269.8848);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorldEx(playerid,0);
- }
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, 1481.2957,-2589.0603,13.6197) && GetPlayerVirtualWorld(playerid) == 187) //ST Garage EXIT
- {
- if(VehId == 0)
- {
- SetPlayerPos(playerid, 974.4432,-1091.5729,24.2055);
- SetPlayerFacingAngle(playerid, 269.5953);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorldEx(playerid, 0);
- }
- else
- {
- SetVehiclePos(VehId, 974.4432,-1091.5729,24.2055);
- SetVehicleZAngle(VehId, 269.5953);
- SetVehicleVirtualWorld(VehId, 0);
- LinkVehicleToInteriorEx(VehId, 0);
- foreach(new v: Player)
- {
- if(Logged{v} && GetPlayerVehicleID(v) == VehId)
- {
- SetPlayerVirtualWorldEx(v, 0);
- SetPlayerInterior(v, 0);
- }
- }
- }
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, -113.4797,-1137.5911,1001.5186) && GetPlayerVirtualWorld(playerid) == 3) //RosMC Garage EXIT
- {
- if(VehId == 0)
- {
- SetPlayerPos(playerid, -63.7647, -1116.42, 1.078);
- SetPlayerFacingAngle(playerid, 68.373);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorldEx(playerid, 0);
- }
- else
- {
- SetVehiclePos(VehId, -67.4992, -1119.4043, 0.7837);
- SetVehicleZAngle(VehId, 70.0);
- SetVehicleVirtualWorld(VehId, 0);
- LinkVehicleToInteriorEx(VehId, 0);
- foreach(new v: Player)
- {
- if(Logged{v} && GetPlayerVehicleID(v) == VehId)
- {
- SetPlayerVirtualWorldEx(v, 0);
- SetPlayerInterior(v, 0);
- }
- }
- }
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, 2300.9836,2498.7104,3.2734) && GetPlayerVirtualWorld(playerid) == 911) //DPD Garage EXIT
- {
- if(VehId == 0) return true;
- else
- {
- SetPlayerVirtualWorldEx(playerid, 0);
- SetVehiclePos(VehId, 623.303771, -598.885620, 17.077930);
- SetVehicleZAngle(VehId, 270.0);
- SetVehicleVirtualWorld(VehId, 0);
- foreach(new v: Player)
- {
- if(Logged{v} && GetPlayerVehicleID(v) == VehId)
- {
- SetPlayerVirtualWorldEx(v, 0);
- }
- }
- }
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, 1123.5432,225.0353,845.3271) && GetPlayerVirtualWorld(playerid) == 558822) //SAN Garage EXIT
- {
- if(VehId == 0)
- {
- SetPlayerPos(playerid, 1198.8041,254.2202,19.5547);
- SetPlayerFacingAngle(playerid, 335.8774);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorldEx(playerid, 0);
- }
- else
- {
- SetVehiclePos(VehId, 1200.2883, 257.5103, 19.3547);
- SetVehicleZAngle(VehId, 335.8774);
- SetVehicleVirtualWorld(VehId, 0);
- LinkVehicleToInteriorEx(VehId, 0);
- foreach(new v: Player)
- {
- if(Logged{v} && GetPlayerVehicleID(v) == VehId)
- {
- SetPlayerVirtualWorldEx(v, 0);
- SetPlayerInterior(v, 0);
- }
- }
- }
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, 2036.1995, -2593.0525, 13.6216) && GetPlayerVirtualWorld(playerid) == 558821) //SWAT Garage EXIT
- {
- if(VehId == 0)
- {
- SetPlayerPos(playerid, 844.2215, -598.8593, 18.4219);
- SetPlayerFacingAngle(playerid, 335.8774);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorldEx(playerid, 0);
- }
- else
- {
- SetVehiclePos(VehId, 844.2215, -598.8593, 18.4219);
- SetVehicleZAngle(VehId, 335.8774);
- SetVehicleVirtualWorld(VehId, 0);
- LinkVehicleToInteriorEx(VehId, 0);
- foreach(new v: Player)
- {
- if(Logged{v} && GetPlayerVehicleID(v) == VehId)
- {
- SetPlayerVirtualWorldEx(v, 0);
- SetPlayerInterior(v, 0);
- }
- }
- }
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, 1224.2386, 184.9009, 2090.1450)) //info center garage left exit
- {
- if(VehId == 0) return SysMsg(playerid, "You must be in a vehicle to use this exit.");
- SetVehiclePos(VehId, 1219.8643, 189.4231, 19.9018);
- SetVehicleZAngle(VehId, 335.8774);
- SetVehicleVirtualWorld(VehId, 0);
- LinkVehicleToInteriorEx(VehId, 0);
- IsInBizzID[playerid] = -1;
- foreach(new v: Player)
- {
- if(Logged{v} && GetPlayerVehicleID(v) == VehId)
- {
- SetPlayerVirtualWorldEx(v, 0);
- SetPlayerInterior(v, 0);
- IsInBizzID[v] = -1;
- }
- }
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, 1244.7186, 184.5773 ,2090.0583)) //info center garage right exit
- {
- if(VehId == 0) return SysMsg(playerid, "You must be in a vehicle to use this exit.");
- SetVehiclePos(VehId, 1239.3077, 180.7602, 19.9204);
- SetVehicleZAngle(VehId, 335.8774);
- SetVehicleVirtualWorld(VehId, 0);
- LinkVehicleToInteriorEx(VehId, 0);
- IsInBizzID[playerid] = -1;
- foreach(new v: Player)
- {
- if(Logged{v} && GetPlayerVehicleID(v) == VehId)
- {
- SetPlayerVirtualWorldEx(v, 0);
- SetPlayerInterior(v, 0);
- IsInBizzID[v] = -1;
- }
- }
- }
- if(IsPlayerInRangeOfPoint(playerid, 5.0, -2887.7366, 1914.3883, -18.6266)) //pirate ship
- {
- Teleport(playerid, -4118.1626, 1863.7806, 1.0000, 0.0, 0, 0);
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid,7.5,1064.570678, 2085.178955, 10.820312)) //Trucking Garage 1
- {
- if(VehId > 0)
- {
- SetVehiclePos(VehId, 608.7408, 1661.5490, 6.9922);
- SetVehicleZAngle(VehId, 33.82);
- }
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid,7.5,1065.835571, 2131.229248, 10.820312)) //Trucking Garage 2
- {
- if(VehId > 0)
- {
- SetVehiclePos(VehId, 627.3016, 1673.2096, 6.9922);
- SetVehicleZAngle(VehId, 33.82);
- }
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0, 2807.619873, -1171.899902, 1025.570312) && GetPlayerVirtualWorld(playerid) == 9876543)
- {
- SetPlayerPos(playerid, -691.797058, 939.202087, 13.632812);
- SetPlayerVirtualWorldEx(playerid, 0);
- SetPlayerInterior(playerid, 0);
- return true;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 15.0, 2299.4983, 2498.2363, 3.2734) && VehId > 0 && Faction[playerid] == FACTION_COP && GetPlayerVirtualWorld(playerid) == 911)
- {
- SetVehiclePos(VehId, 623.303771, -598.885620, 17.077930);
- SetVehicleZAngle(VehId, 270.0);
- SetVehicleVirtualWorld(VehId, 0);
- foreach(new p: Player)
- {
- if(GetPlayerVehicleID(p) == VehId)
- {
- SetPlayerVirtualWorldEx(p, 0);
- }
- }
- return true;
- }
- //Aperture Post
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -121.2304,1607.1378,18.1936) && Faction[playerid] == FACTION_RESEARCH) SetPlayerPos(playerid,-119.0000,1607.1378,18.1936);
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, -105.9196,1607.6631,18.1957) && Faction[playerid] == FACTION_RESEARCH) SetPlayerPos(playerid,-107.9196,1607.6631,18.1957);
- else if(IsInHouseID[playerid] != -1)
- {
- new h = IsInHouseID[playerid];
- if(HouseData[h][HouseExtVW] == 0) //This check is for houses that aren't flats.
- {
- if(HouseData[h][InsideID] == 11) //cheques if the interior is a custom interior.
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseData[h][intPosX], HouseData[h][intPosY], HouseData[h][intPosZ]))
- {
- Teleport(playerid, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ], 0.0, 0, 0);
- if(HouseData[h][HouseLocked] == 1) SysMsg(playerid,"You have climbed out the window as the door was locked.");
- if(HouseData[h][HMusicPlaying] == 1) StopAudioStreamForPlayer(playerid);
- HouseData[h][HouseOccupants] --;
- IsInHouseID[playerid] = -1;
- CancelEdit(playerid);
- return true;
- }
- }
- else //The interior is not a custom interior.
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, InsideIDs[HouseData[h][InsideID] - 1][InsideX], InsideIDs[HouseData[h][InsideID] - 1][InsideY], InsideIDs[HouseData[h][InsideID] - 1][InsideZ]))
- {
- Teleport(playerid, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ], 0.0, 0, 0);
- if(HouseData[h][HouseLocked] == 1) SysMsg(playerid,"You have climbed out the window as the door was locked.");
- if(HouseData[h][HMusicPlaying] == 1) StopAudioStreamForPlayer(playerid);
- HouseData[h][HouseOccupants] --;
- IsInHouseID[playerid] = -1;
- CancelEdit(playerid);
- return true;
- }
- }
- }
- else
- {
- if(HouseData[h][InsideID] == 11) //cheques if the interior is a custom interior.
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseData[h][intPosX], HouseData[h][intPosY], HouseData[h][intPosZ]))
- {
- Teleport(playerid, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ], 0.0, 0, 0);
- if(HouseData[h][HouseLocked] == 1) SysMsg(playerid,"You have climbed out the window as the door was locked.");
- if(HouseData[h][HMusicPlaying] == 1) StopAudioStreamForPlayer(playerid);
- HouseData[h][HouseOccupants] --;
- IsInHouseID[playerid] = -1;
- CancelEdit(playerid);
- return true;
- }
- }
- else //The interior is not a custom interior.
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, InsideIDs[HouseData[h][InsideID] - 1][InsideX], InsideIDs[HouseData[h][InsideID] - 1][InsideY], InsideIDs[HouseData[h][InsideID] - 1][InsideZ]))
- {
- Teleport(playerid, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ], 0.0, 2, HouseData[h][HouseExtVW]);
- if(HouseData[h][HouseLocked] == 1) SysMsg(playerid,"You have climbed out the window as the door was locked.");
- if(HouseData[h][HMusicPlaying] == 1) StopAudioStreamForPlayer(playerid);
- HouseData[h][HouseOccupants] --;
- IsInHouseID[playerid] = -1;
- CancelEdit(playerid);
- return true;
- }
- }
- }
- }
- else if(IsInBizzID[playerid] != -1)
- {
- new b = IsInBizzID[playerid];
- if(GetPlayerVirtualWorld(playerid) == BizzData[b][BizzVW])
- {
- if(BizzData[b][IsSpecial] == 1) //cheques if the player is in a special business
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, BizzData[b][iPosX], BizzData[b][iPosY], BizzData[b][iPosZ]))
- {
- Teleport(playerid, BizzData[b][oPosX], BizzData[b][oPosY], BizzData[b][oPosZ], 0.0, 0, BizzData[b][ExitVW]);
- if(BizzData[b][BMusicPlaying] == 1) StopAudioStreamForPlayer(playerid);
- BizzData[b][BizzOccupants] --;
- IsInBizzID[playerid] = -1;
- return true;
- }
- }
- else //cheques if the player is in a standard business
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, BInsideIDs[BizzData[b][BizzType]][InsideX], BInsideIDs[BizzData[b][BizzType]][InsideY], BInsideIDs[BizzData[b][BizzType]][InsideZ]))
- {
- Teleport(playerid, BizzData[b][oPosX], BizzData[b][oPosY], BizzData[b][oPosZ], 0.0, 0, BizzData[b][ExitVW]);
- if(BizzData[b][BMusicPlaying] == 1) StopAudioStreamForPlayer(playerid);
- BizzData[b][BizzOccupants] --;
- IsInBizzID[playerid] = -1;
- return true;
- }
- }
- }
- }
- else if(IsInMotel[playerid] > 0 && GetPlayerVirtualWorld(playerid) == 50000+IsInMotel[playerid])
- {
- Teleport(playerid, MotelData[IsInMotel[playerid]][RoomX], MotelData[IsInMotel[playerid]][RoomY], MotelData[IsInMotel[playerid]][RoomZ], 0.0, 0, 0);
- IsInMotel[playerid] = 0;
- return true;
- }
- else if(ViewingMicksCar[playerid] >= 0)
- {
- DestroyVehicleEx(ViewingMicksCarID[playerid], "ViewingMicksCarID 2");
- ViewingMicksCar[playerid] = -1;
- ViewingMicksCarID[playerid] = -1;
- SetPlayerVirtualWorldEx(playerid, 0);
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllable(playerid, 1);
- ShowMessage(playerid, "Dillimore Automotive Dealership", "You have exited Dillimore Automotive Dealership vehicle catalogue.\n\nThanks for shopping.", "Ok");
- return true;
- }
- else if(ViewingBuyBikes[playerid] >= 0)
- {
- DestroyVehicleEx(ViewingBikeID[playerid], "ViewingBikeID[playerid] 2");
- ViewingBuyBikes[playerid] = -1;
- ViewingBikeID[playerid] = -1;
- SetPlayerVirtualWorldEx(playerid, 0);
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllable(playerid, 1);
- ShowMessage(playerid, "Motorbike Dealership", "You have exited the Dealership catalogue.\n\nThanks for shopping.", "Ok");
- return true;
- }
- else if(ViewingBuyBoats[playerid] >= 0)
- {
- DestroyVehicleEx(ViewingBoatID[playerid], "ViewingboatID[playerid] 2");
- ViewingBuyBoats[playerid] = -1;
- ViewingBoatID[playerid] = -1;
- SetPlayerVirtualWorldEx(playerid, 0);
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllable(playerid, 1);
- ShowMessage(playerid, "Boat Dealership", "You have exited the Dealership catalogue.\n\nThanks for shopping.", "Ok");
- return true;
- }
- if(IsInPrison(playerid))
- {
- for(new w = 0; w < 16; w++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, PrisonCellsIn[w][0], PrisonCellsIn[w][1], PrisonCellsIn[w][2]))
- {
- if(PrisonCellsLock[w] == 1) return SysMsg(playerid, "The cell door is locked.");
- else return SetPlayerPos(playerid, PrisonCellsOut[w][0], PrisonCellsOut[w][1], PrisonCellsOut[w][2]);
- }
- }
- }
- foreach(new p: Player)
- {
- if(IsSpectating[p] == playerid)
- {
- SetPlayerVirtualWorldEx(p, GetPlayerVirtualWorld(playerid));
- SetPlayerInterior(p, GetPlayerInterior(playerid));
- PlayerSpectatePlayer(p, playerid);
- }
- }
- return true;
- }
- CMD:frisk(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(PlayerLevel[playerid] < 3) return SysMsg(playerid,"You need to be at least level 3 to use this.");
- new playa = -1, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]", name)) return SysMsg(playerid,"Usage: /frisk [ID or Part of Name or Stranger ID]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(playa == playerid) return SysMsg(playerid,"You can't frisk yourself.");
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.0,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player to frisk them.");
- RequestedToFrisk[playa] = playerid;
- SetTimerEx("CancelPlayerFrisk", 15000, 0, "ii", playerid, playa);
- SendClientMessageF(playa, COLOR_WHITE, "%s wants to frisk you, use '/accept frisk' to continue. (This will time-out in 15 seconds)", NameRP(playerid));
- SendClientMessageF(playerid, COLOR_WHITE, "You have requested to frisk %s. They must accept first. (This will time-out in 15 seconds)", NameRP(playa));
- return true;
- }
- CMD:blindfold(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(PlayerLevel[playerid] < 3) return SysMsg(playerid, "You need to be at least level 3 to use a blindfold");
- if(Inventory[playerid][Blindfold] == 0) return SysMsg(playerid, "You need a blindfold to blindfold somebody.");
- new playa = -1, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]", name)) return SysMsg(playerid,"Usage: /blindfold [ID or Part of Name or Stranger ID]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(Blindfolded[playa] == 1) return SysMsg(playerid, "This player is already blindfolded.");
- if(playa == playerid) return SysMsg(playerid,"You can't blindfold yourself.");
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,5.0,tX,tY,tZ)) return SysMsg(playerid,"You must be within the player's vicinity to blindfold them.");
- RequestedToBlindfold[playa] = playerid;
- SetTimerEx("CancelPlayerBlindfold", 15000, 0, "ii", playerid, playa);
- SendClientMessageF(playa, COLOR_WHITE, "%s wants to blindfold you, use '/accept blindfold' to continue. (This will time-out in 15 seconds)", NameRP(playerid));
- SendClientMessage(playa, COLOR_WHITE, "Ensure that the player attempting to blindfold you has properly roleplayed it before accepting.");
- SendClientMessageF(playerid, COLOR_WHITE, "You have requested to blindfold %s. They must accept first. (This will time-out in 15 seconds)", NameRP(playa));
- return true;
- }
- CMD:unblind(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new playa = -1, name[MAX_PLAYER_NAME];
- if(sscanf(params, "s[24]", name)) return SysMsg(playerid,"Usage: /unblind [ID or Part of Name or Stranger ID]");
- if(strval(name) >= 500)
- {
- foreach(new p: Player)
- {
- if(MaskLabelNumber[p] == strval(name))
- {
- playa = p;
- }
- }
- }
- else playa = GetPlayerIDs(name);
- if(Blindfolded[playa] == 0) return SysMsg(playerid, "That player is not blindfolded.");
- if(InvalidPlayer(playa) || !Logged{playa}) return SysMsg(playerid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid && IsTied[playa] > 0) return SysMsg(playerid, "You cannot remove a blindfold from yourself if you are tied up.");
- if(playa == playerid)
- {
- format(gstr, sizeof(gstr),"* %s reaches behind their head and unties their blindfold as they pull it off their head. *", NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_ORANGE, "You have removed your blindfold.");
- }
- else
- {
- format(gstr, sizeof(gstr),"* %s unties a blindfold from %s's head and pulls it off. *",NameRP(playerid), NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessageF(playa, COLOR_ORANGE, "%s has removed the blindfold from your head.", NameRP(playerid));
- }
- Inventory[playerid][Blindfold] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasBlindfold", Inventory[playerid][Blindfold], "players");
- PlayerTextDrawHide(playa, BlindfoldEffect[playerid]);
- GangZoneHideForPlayer(playa, BlindZone);
- Blindfolded[playa] = 0;
- return true;
- }
- CMD:sell(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new element[10], playa = -1, price, slotid;
- if(sscanf(params, "s[10]U(-1)", element, playa)) return SysMsg(playerid,"Usage: /sell [house/bizz/vehicle]");
- if(strcmp("house", element, true) == 0)
- {
- if(GetPlayerHouseCount(playerid) == 0) return SysMsg(playerid,"You don't have a house.");
- new id;
- if(sscanf(params, "s[10]uii", element, playa, id, price))
- {
- for(new x = 0; x < MAX_HOUSE_PER_PLAYER; x++)
- {
- if(HasHouseKey[playerid][x] != -1)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "House ID: %i - %s", x, HouseData[HasHouseKey[playerid][x]][HouseDescription]);
- }
- }
- return SysMsg(playerid,"Usage: /sell House [playerid id or name] [House ID from above] [price]");
- }
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't sell this to yourself.");
- if(id != 0 && id != 1) return SysMsg(playerid, "Invalid house.");
- if(HasHouseKey[playerid][id] == -1) return SysMsg(playerid, "You do not have a house in that slot.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,4.0,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player.");
- if(GetPlayerHouseCount(playa) >= MAX_HOUSE_PER_PLAYER) return SysMsg(playerid,"They already have a house key.");
- if(price < 1 || price > 100000000) return SysMsg(playerid,"Price is out-of-bounds: $1 to $100,000,000 only.");
- SellingAsset[playerid][0] = 1; //yes/no
- SellingAsset[playerid][1] = playa; //playerid
- SellingAsset[playerid][2] = 1; //type
- SellingAsset[playerid][3] = HasHouseKey[playerid][id]; //id
- SellingAsset[playerid][4] = price; //price
- SellingAsset[playerid][5] = id;
- SendClientMessageF(playa, COLOR_WHITE, "%s wants to sell you their house(%s) for $%s. Use '/accept house' to confirm it.", NameEx(playerid), HouseData[HasHouseKey[playerid][id]][HouseDescription], format_cash(price));
- SendClientMessageF(playerid, COLOR_WHITE, "You are selling your house(%s) to %s for $%s. They must accept to confirm it.", HouseData[HasHouseKey[playerid][id]][HouseDescription], NameEx(playa), format_cash(price));
- }
- else if(strcmp("bizz", element, true) == 0)
- {
- new bizzCount = 0;
- for(new biz = 0; biz < MAX_BIZZ_PER_PLAYER; biz++)
- {
- if(PlayerBizzID[playerid][biz] != -1) bizzCount ++;
- }
- if(bizzCount == 0) return SysMsg(playerid,"You have no businesses to sell.");
- if(sscanf(params, "s[10]uii", element, playa, slotid, price))
- {
- SysMsg(playerid, "Businesses you can sell:");
- for(new biz = 0; biz < MAX_BIZZ_PER_PLAYER; biz++) if(PlayerBizzID[playerid][biz] != -1) SendClientMessageF(playerid, COLOR_WHITE, "Bizz ID: %i - %s", biz+1, BizzData[PlayerBizzID[playerid][biz]][BizzDescription]);
- SysMsg(playerid,"Usage: /sell Bizz [playerid id or name] [bizz id (from above)] [price]");
- return true;
- }
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't sell this to yourself.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,4.0,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player.");
- bizzCount = 0;
- for(new bz = 0; bz < MAX_BIZZ_PER_PLAYER; bz++)
- {
- if(PlayerBizzID[playa][bz] != -1) bizzCount ++;
- }
- if(bizzCount == MAX_BIZZ_PER_PLAYER) return SysMsg(playerid,"That player can't have any more businesses.");
- if(slotid < 1 || slotid > MAX_BIZZ_PER_PLAYER) return SysMsg(playerid,"Bizz ID was invalid. [Error 1]");
- slotid --;
- if(PlayerBizzID[playerid][slotid] == -1) return SysMsg(playerid,"Bizz ID was invalid. [Error 2]");
- if(price < 1 || price > 100000000) return SysMsg(playerid,"Price is out-of-bounds: $1 to $100,000,000 only.");
- SellingAsset[playerid][0] = 1; //yes/no
- SellingAsset[playerid][1] = playa; //playerid
- SellingAsset[playerid][2] = 2; //type
- SellingAsset[playerid][3] = PlayerBizzID[playerid][slotid]; //id
- SellingAsset[playerid][4] = price; //price
- SendClientMessageF(playa, COLOR_WHITE, "%s wants to sell you their business(%s) for $%s. Use '/accept bizz' to confirm it.", NameEx(playerid), BizzData[PlayerBizzID[playerid][slotid]][BizzDescription], format_cash(price));
- SendClientMessageF(playerid, COLOR_WHITE, "You are selling your business(%s) to %s for $%s. They must accept to confirm it.", BizzData[PlayerBizzID[playerid][slotid]][BizzDescription], NameEx(playa), format_cash(price));
- }
- else if(strcmp("vehicle", element, true) == 0)
- {
- if(GetPlayerOwnedVehicleCount(playerid) == 0) return SysMsg(playerid,"You have no vehicles to sell.");
- if(sscanf(params, "s[10]uii", element, playa, slotid, price))
- {
- new counter = 0;
- SysMsg(playerid, "Vehicles you can sell:");
- for(new vh = 1, x = GetVehiclePoolSize(); vh <= x; vh++)
- {
- if(VehicleData[vh][VehicleOwnerSQLID] == SQLID[playerid])
- {
- if(!VehicleData[vh][Impounded] && !VehicleData[vh][NeedsRecovery])
- {
- counter ++;
- format(gstr, sizeof(gstr), "Vehicle ID: %i - %s", counter, GetVehicleName(vh));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- }
- }
- }
- if(counter == 0) return SysMsg(playerid,"You have no vehicles to sell, you cannot sell impounded vehicles or ones that require recovery.");
- SysMsg(playerid,"Usage: /sell Vehicle [playerid id or name] [vehicle id (from above)] [price]");
- return true;
- }
- if(InvalidPlayer(playa)) return SysMsg(playerid, NOPLAYER);
- if(IsPlayerNPC(playa)) return SysMsg(playerid,"That player is a NPC.");
- if(playa == playerid) return SysMsg(playerid,"You can't sell this to yourself.");
- new Float:tX,Float:tY,Float:tZ;
- GetPlayerPos(playa,tX,tY,tZ);
- if(!IsPlayerInRangeOfPoint(playerid,4.0,tX,tY,tZ)) return SysMsg(playerid,"You must be close to the player.");
- if(GetPlayerOwnedVehicleCount(playa) >= MAX_VEH_PER_PLAYER) return SysMsg(playerid,"That player can't have any more vehicles.");
- if(slotid < 1 || slotid > MAX_VEH_PER_PLAYER) return SysMsg(playerid,"Vehicle ID was invalid. [Error 1]");
- new vehd = 0, vslot = slotid, x;
- for(vehd = 1, x = GetVehiclePoolSize(); vehd <= x; vehd++)
- {
- if(VehicleData[vehd][VehicleOwnerSQLID] == SQLID[playerid])
- {
- vslot --;
- if(vslot != 0) continue;
- else break;
- }
- }
- if(VehicleData[vehd][DonatorCar]) return SysMsg(playerid,"You may not sell Donator vehicles.");
- if(VehicleData[vehd][Impounded]) return SysMsg(playerid,"Vehicle is impounded, you may not sell it.");
- if(price < 1 || price > 10000000) return SysMsg(playerid,"Price is out-of-bounds: $1 to $10,000,000 only.");
- SellingAsset[playerid][0] = 1; //yes/no
- SellingAsset[playerid][1] = playa; //playerid
- SellingAsset[playerid][2] = 3; //type
- SellingAsset[playerid][3] = vehd; //id
- SellingAsset[playerid][4] = price; //price
- format(gstr, sizeof(gstr),"%s wants to sell you their vehicle(%s) for $%s. Use '/accept vehicle' to confirm it.", NameEx(playerid), GetVehicleName(vehd), format_cash(price));
- SendClientMessage(playa, COLOR_WHITE, gstr);
- format(gstr, sizeof(gstr),"You are selling your vehicle(%s) to %s for $%s. They must accept to confirm it.", GetVehicleName(vehd), NameEx(playa), format_cash(price));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- }
- return true;
- }
- CMD:cancelsell(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- foreach(new i: Player)
- {
- if(SellingAsset[playerid][1] == i)
- {
- if(SellingAsset[playerid][2] == 1) SysMsg(i,"The player that you were buying a house from has cancelled the deal.");
- else if(SellingAsset[playerid][2] == 2) SysMsg(i,"The player that you were buying a business from has cancelled the deal.");
- else if(SellingAsset[playerid][2] == 3) SysMsg(i,"The player that you were buying a vehicle from has cancelled the deal.");
- SysMsg(playerid,"You have cancelled the deal.");
- SellingAsset[playerid][0] = 0; //yes/no
- SellingAsset[playerid][1] = -1; //playerid
- SellingAsset[playerid][2] = 0; //type
- SellingAsset[playerid][3] = -1; //id
- SellingAsset[playerid][4] = 0; //price
- SellingAsset[playerid][5] = -1;
- break;
- }
- }
- return true;
- }
- CMD:rentroom(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(RentRoom[playerid] > 0) return SysMsg(playerid,"You already have a Motel room.");
- new motel = GetMotelID(playerid);
- if(motel == 0) return SysMsg(playerid,"You are not near any motel.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM motel WHERE MotelID = %i AND OwnerSQLID = 0 LIMIT 1", motel);
- mysql_pquery(conn, mquery, "ProcessRoomRental", "dds", playerid, motel, params);
- return true;
- }
- CMD:extendrent(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(RentRoom[playerid] == 0) return SysMsg(playerid,"You don't have a Motel room.");
- new motel = GetMotelID(playerid);
- if(motel == 0) return SysMsg(playerid,"You are not near any motel.");
- if(MotelData[RentRoom[playerid]][RoomDaysLeft] > 2) return SysMsg(playerid,"You may only extend your stay here when you have 2 or less days remaining.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /extendrent [amount of days to add]");
- new daystostay = strval(params);
- if(daystostay < 1 || daystostay > 7) return SysMsg(playerid,"You may only extend your stay by a maximum of 7 days and a minimum of 1 day.");
- new fee;
- switch(MotelData[RentRoom[playerid]][MotelID])
- {
- case 1,4,5: fee = 100 * daystostay;
- case 2,7: fee = 200 * daystostay;
- case 3,8,9: fee = 500 * daystostay;
- case 6: fee = 150 * daystostay;
- }
- if(Cash[playerid] < fee) return SysMsg(playerid,"You don't have enough money to extend your stay here.");
- GivePlayerCash(playerid, -fee);
- MotelData[RentRoom[playerid]][RoomDaysLeft] += daystostay;
- MySQLUpdateInt(RentRoom[playerid], "RoomDaysLeft", MotelData[RentRoom[playerid]][RoomDaysLeft], "motel");
- SendClientMessageF(playerid,COLOR_GOLD,"You have extended your stay by %i days meaning you now have %i days remaining. This cost $%i.", daystostay, MotelData[RentRoom[playerid]][RoomDaysLeft], fee);
- return true;
- }
- CMD:unrentroom(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(RentRoom[playerid] == 0) return SysMsg(playerid,"You don't have a Motel room.");
- new motel = GetMotelID(playerid);
- if(motel != MotelData[RentRoom[playerid]][MotelID]) return SysMsg(playerid,"You are not near the motel office for checkout.");
- new ID = RentRoom[playerid];
- MotelData[ID][RoomOwner] = 0;
- RentRoom[playerid] = 0;
- MotelWaypoint[playerid] = 0;
- DestroyDynamicPickup(MotelData[ID][RoomPickupID]);
- if(MySpawnID[playerid] == 4)
- {
- MySpawnID[playerid] = 1;
- MySQLUpdateInt(SQLID[playerid], "MySpawnID", MySpawnID[playerid], "players");
- }
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE motel SET OwnerSQLID=0 AND RoomDaysLeft=0 AND Weapon=0 AND WeaponAmmo=0 WHERE id=%i", ID);
- mysql_pquery(conn, mquery, "UpdateMotelSign", "i", MotelData[ID][MotelID] - 1);
- SendClientMessage(playerid,COLOR_GOLD,"You have checked out from this Motel. Thanks for staying!");
- return true;
- }
- CMD:writenote(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid,3.5,HouseData[h][oPosX],HouseData[h][oPosY],HouseData[h][oPosZ]) && GetPlayerVirtualWorld(playerid) == HouseData[h][HouseExtVW])
- {
- if(HouseData[h][HouseOwnerSQLID] > 0)
- {
- if(strlen(HouseData[h][DoorNoteMessage]) > 1) return SysMsg(playerid,"There is already a note on this door.");
- if(HasHouseKey[playerid][0] == h || HasHouseKey[playerid][1] == h) return SysMsg(playerid,"You can't put a note on your own door.");
- if(isnull(params)) return SysMsg(playerid,"Usage: /writenote [message]");
- format(HouseData[h][DoorNoteMessage], 128, params);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE houses SET DoorNote = '%e' WHERE id = %i", HouseData[h][DoorNoteMessage], HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery);
- format(gstr, sizeof(gstr),"* %s tapes a note to the door of %s. *", NameRP(playerid), HouseData[h][HouseDescription]);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessageF(playerid,COLOR_GOLD,"You have left a note at %s.",HouseData[h][HouseDescription]);
- break;
- }
- else return SysMsg(playerid,"This property is not even purchased.");
- }
- }
- return true;
- }
- CMD:knock(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- if(IsInHouseID[playerid] != -1) return SysMsg(playerid,"You cannot knock on a door from inside a house.");
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, DOOR_PROXIMITY, HouseData[h][oPosX],HouseData[h][oPosY],HouseData[h][oPosZ]) && GetPlayerVirtualWorld(playerid) == HouseData[h][HouseExtVW])
- {
- if(HouseData[h][HouseOwnerSQLID] != 0)
- {
- foreach(new i: Player)
- {
- if(Logged{i})
- {
- if(IsInHouseID[i] == h)
- {
- SendClientMessageF(i, COLOR_EMOTE, "KNOCK KNOCK KNOCK ((%s))", NameRP(playerid), HouseData[h][HouseDescription]);
- }
- }
- }
- format(gstr, sizeof(gstr),"* %s knocks on the door of %s. *", NameRP(playerid), HouseData[h][HouseDescription]);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- else return SysMsg(playerid,"This property is not even purchased.");
- }
- }
- SysMsg(playerid,"You are not at a house front door.");
- return true;
- }
- CMD:croom(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- if(isnull(params)) return SysMsg(playerid,"Usage: /croom [motel id]");
- if(!IsNumeric(params)) return SysMsg(playerid,"Faction must be a number.");
- new motel = strval(params);
- if(motel < 1) return SysMsg(playerid,"Motel ID must be > 0");
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- MotelData[CurrentMotelEnumID][MotelID] = motel;
- MotelData[CurrentMotelEnumID][RoomX] = X;
- MotelData[CurrentMotelEnumID][RoomY] = Y;
- MotelData[CurrentMotelEnumID][RoomZ] = Z;
- MotelData[CurrentMotelEnumID][RoomLocked] = 0;
- MotelData[CurrentMotelEnumID][RoomOwner] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO motel (MotelID) VALUES (%i)", motel);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE motel SET RoomLocked = 0, OwnerSQLID = 0, OutsideX = %f, OutsideY = %f, OutsideZ = %f WHERE id = %i", X, Y, Z, CurrentMotelEnumID);
- mysql_pquery(conn, mquery);
- CurrentMotelEnumID ++;
- SendClientMessageF(playerid,COLOR_GOLD, "Created Room %i.", CurrentMotelEnumID);
- AdminLog(playerid, 0, "", "Created a new motel room");
- }
- else return SysMsg(playerid, AUTHMSG);
- return true;
- }
- CMD:annoyingobject(playerid, params[])
- {
- if(!IsPlayerAdminLevelOK(playerid, 2)) return SysMsg(playerid, CMDFMSG);
- SysMsgF(playerid, "Objetos visíveis: %i. Total de objetos: %i", Streamer_CountVisibleItems(playerid, STREAMER_TYPE_OBJECT), CountDynamicObjects());
- SelectObject(playerid);
- SetPVarInt(playerid, "SelectingAnnoyingObject", 1);
- return true;
- }
- CMD:viewroute(playerid, params[])
- {
- if(!Logged{playerid}) return true;
- new Float:x, Float:y, Float:z;
- gstr[0] = EOS;
- for(new i = 0; i < MAX_BUSSTOPS; i++)
- {
- GetDynamicObjectPos(BusStopObjectIDStart + i, x, y, z);
- if(IsPlayerInRangeOfPoint(playerid, 2.0, x, y, z))
- {
- strcat(gstr, "{4BB74C}Blueberry {FFFFFF}(Panoptican, Farm, BB Acres, Town Center)\n");
- strcat(gstr, "{4BB74C}Fort Carson {FFFFFF}(Trailer Park only)\n");
- strcat(gstr, "{4BB74C}Las Barrancas\n");
- strcat(gstr, "{4BB74C}Tierra Robada\n");
- strcat(gstr, "{4BB74C}El Quebrados\n");
- strcat(gstr, "{4BB74C}Valle Ocultado\n");
- strcat(gstr, "{4BB74C}Las Payasdas\n");
- strcat(gstr, "{4BB74C}Hunter Quarry {FFFFFF}(via West Bone County)\n");
- strcat(gstr, "{4BB74C}Fort Carson {FFFFFF}(Trailer Park, Hospital, Town Center)\n");
- strcat(gstr, "{4BB74C}Hampton Barns\n");
- strcat(gstr, "{4BB74C}Montgomery {FFFFFF}(Hospital, Cabbie Co, Town Center, Casino)\n");
- strcat(gstr, "{4BB74C}Palomino Creek {FFFFFF}(Main Street, Bank)\n");
- strcat(gstr, "{4BB74C}Dillimore {FFFFFF}(via Montgomery Cutoff)\n");
- strcat(gstr, "{4BB74C}Blueberry South {FFFFFF}(Panoptican, Farm, BB Acres)\n");
- strcat(gstr, "{4BB74C}Bus Station");
- Dialog_Show(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Bus Route", gstr, "OK", "");
- break;
- }
- }
- return true;
- }
- CMD:licenseinfo(playerid)
- {
- if(!IsPlayerInRangeOfPoint(playerid, 2.5, 1239.9242, 185.4836, 2091.3547)) return true;
- gstr[0] = EOS;
- strcat(gstr, "During a driving test you will have to follow a certain route from checkpoint to checkpoint while paying attention to the speed limits and keeping your car undamaged.\n");
- strcat(gstr, "The DMV is located in Montgomery, next to the trailer park. (( Use /gps to find its location. )) You can obtain the following licenses there:\n\n");
- strcat(gstr, "- General Vehicle License [GVL-1] The license costs $100. The vehicle you use is an Admiral. Do not pass the speeding limits and do not crash the car. Meet the required time, If you want to pass.\n");
- strcat(gstr, "- Large Vehicle License [GVL-2] The license costs $3,000. The vehicle you use is a Mule. Do not pass the speeding limits and do not crash the truck. Meet the required time, If you want to pass.\n");
- strcat(gstr, "- Motorbike License [MB] The license costs $2,500. The motorbike you use is a Sanchez. Do not pass the speeding limits and do not crash the motorbike. Meet the required time, If you want to pass.\n");
- strcat(gstr, "- Boat License [B ]The license costs $4,000. The boat you use is a Coastguard. Do not pass the speeding limit. Meet the required time, If you want to pass.\n");
- strcat(gstr, "- Helicopter License [A1] The license costs $15,000. The helicopter you use is a Sparrow. Do not pass the speeding limits. Meet the required time, If you want to pass.\n");
- strcat(gstr, "- Plane License [A2] The license costs $25,000. The airplane you use is a Dodo. Do not pass the speeding limits. Meet the required time, If you want to pass.\n");
- ShowMessage(playerid, "License Info", gstr, "Neat!");
- return true;
- }
- CMD:info(playerid)
- {
- if(!IsPlayerInRangeOfPoint(playerid, 2.5, 1234.6780, 180.5994, 2091.3687)) return true;
- gstr[0] = EOS;
- strcat(gstr, "What can you do at the Information Center?\n");
- strcat(gstr, "- Withdraw money from your bank account via an ATM\n");
- strcat(gstr, "- Call a person or a hotline via a public payphone\n");
- strcat(gstr, "- Look up important phone numbers\n");
- strcat(gstr, "- Find out how to get a driver's license\n");
- strcat(gstr, "- Rent a vehicle\n");
- strcat(gstr, "- Post an advertisement in the SAN Network radio\n");
- strcat(gstr, "- Find an address or a Point of Interest located within Red, Bone or Flint County\n");
- strcat(gstr, "- View a list of full-time and part-time jobs available to you\n");
- strcat(gstr, "- Park up your vehicle in the used cars lot and set it for sale\n");
- strcat(gstr, "- Get yourself hired as a taxi driver in the Cabbie Co\n");
- strcat(gstr, "- View a map of all the key locations in San Andreas)\n");
- ShowMessage(playerid, "Info Center", gstr, "Neat!");
- return true;
- }
- CMD:saleinfo(playerid)
- {
- if(!IsPlayerInRangeOfPoint(playerid, 2.5, 1226.7029, 164.5297, 2086.6648)) return true;
- gstr[0] = EOS;
- strcat(gstr, "First of all, you have to visit any general store and purchase a pen and paper. After that, enter your vehicle and use '/setforsale PRICE', for example '/setforsale 5000'.\n");
- strcat(gstr, "Make sure you park your vehicle at any visible place, use /savecar to do so. Keep your phone on, you might get a call regarding your vehicle.\n");
- strcat(gstr, "If you happen to change your mind and wish to cancel the sale, use /cancelforsale.");
- ShowMessage(playerid, "Used Cars Sales Lot", gstr, "Neat!");
- return true;
- }
- CMD:rentinfo(playerid)
- {
- if(!IsPlayerInRangeOfPoint(playerid, 2.5, 1242.5016, 164.4828, 2086.6648)) return true;
- gstr[0] = EOS;
- strcat(gstr, "We have a few vehicles that could be rented. Here's a list of them along with their prices:\n\n");
- strcat(gstr, "- Willard - $650\n");
- strcat(gstr, "- Admiral - $750\n");
- strcat(gstr, "- Manana- $350\n");
- strcat(gstr, "- Cadrona - $350\n");
- strcat(gstr, "- Rancher - $1000\n");
- strcat(gstr, "- Previon - $350\n");
- strcat(gstr, "- Reefer - $1000 (located at the Palomino Creek bay)\n");
- strcat(gstr, "- Tropic - $1500 (located at the Palomino Creek bay)\n\n");
- strcat(gstr, "If you want to rent a vehicle simply choose the one you like the most, then enter it and use /rentvehicle.\n");
- strcat(gstr, "You will be charged a certain price and you will pay it again every hour. When you decide to return the vehicle, drive back to the rental garage and use /returnvehicle.\n");
- strcat(gstr, "If you have damaged the vehicle, you will be charged additionally for the repairs\n");
- ShowMessage(playerid, "Red County Car Rentals", gstr, "Neat!");
- return true;
- }
- Dialog:fdportoes(playerid, response, listitem, inputtext[]) {
- if(!response) return 1;
- new status = MoveFDGate(listitem);
- new jbstring[144];
- format(jbstring, 144, "Portão %i %s.", listitem + 1, ( status ? ("fechando") : ("abrindo") ));
- SendClientMessage(playerid, -1, jbstring);
- return 1;
- }
- Dialog:LabelCreate(playerid, response, listitem, inputtext[])
- {
- if(!response) return DeletePVar(playerid, "PendingLabelText");
- new text[150];
- GetPVarString(playerid, "PendingLabelText", text, 150);
- CreateRPLabel(playerid, text);
- DeletePVar(playerid, "PendingLabelText");
- return true;
- }
- Dialog:ReportsList(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- format(sgstr, sizeof(sgstr), Reports[listitem][ReportReason]);
- if(strlen(sgstr) > 100) strins(sgstr, "\n", 101);
- format(gstr, sizeof(gstr), "Report From %s Against %s\n\n%s", Reports[listitem][ReporterName], Reports[listitem][ReportedName], sgstr);
- Dialog_Show(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Report Details", gstr, "Neat!", "");
- return true;
- }
- Dialog:ObjectTeleport(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- new str[12];
- strdel(inputtext, 3, strlen(inputtext));
- format(str, 12, "goto %i", strval(inputtext));
- return cmd_object(playerid, str);
- }
- Dialog:HealthDialog(playerid, response, listitem, inputtext[])
- {
- new Float:armor;
- GetPlayerArmour(playerid, armor);
- if(!response)
- {
- if(floatround(armor) == 100) return SysMsg(playerid, "You already have a full heavy vest.");
- SetPlayerArmourEx(playerid, 0.0, 1);
- RestrictedVest{playerid} = true;
- SetPlayerHealthEx(playerid, 100.0);
- SetPlayerArmourEx(playerid, 100.0, 1);
- GivePlayerCash(playerid, -100);
- SendClientMessage(playerid, COLOR_BLUE, "> Restored health and received a heavy armor vest. (-$100)");
- }
- else
- {
- if(floatround(armor) == 50) return SysMsg(playerid, "You already have a full light vest.");
- SetPlayerArmourEx(playerid, 0.0, 1);
- RestrictedVest{playerid} = true;
- SetPlayerHealthEx(playerid, 100.0);
- SetPlayerArmourEx(playerid, 50.0, 1);
- GivePlayerCash(playerid, -100);
- SendClientMessage(playerid, COLOR_BLUE, "> Restored health and received a light armor vest. (-$100)");
- }
- return true;
- }
- Dialog:HealDialog(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- else
- {
- new hit = listitem, playa = Healing[playerid];
- if(Injuries[playa][hit][pBodypart] == 9) return SysMsg(playerid, "You cannot heal gunshot wounds to the head.");
- if(BeingHealed[playa] == 1) return SysMsg(playerid, "Someone is already healing a wound of this player.");
- BeingHealed[playa] = 1;
- HealID[playa] = hit;
- HealedBy[playa] = playerid;
- SendClientMessageF(playa, COLOR_WHITE, "%s has healed one of your wounds. Use /accept heal to accept. ((Make sure they have roleplayed it.))", NameRP(playerid));
- SendClientMessageF(playerid, COLOR_WHITE, "You have requested to heal one of %s's wounds. They must accept it.", NameRP(playa));
- return true;
- }
- }
- Dialog:StoreArmorHouse(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- else
- {
- new Float:carmour;
- GetPlayerArmour(playerid, carmour);
- if(carmour >= 1) return SysMsg(playerid, "You are aleady wearing a kevlar vest.");
- new armor[12], armorid[12], ar, id;
- if(strfind(inputtext, "Light Armor Vest", true) != -1)
- {
- strmid(armor, inputtext, strfind(inputtext, "Armor: ") + 7, strfind(inputtext, "Armor: ") + 10);
- strmid(armorid, inputtext, strfind(inputtext, "[ID: ") + 5, strfind(inputtext, "]"));
- ar = strval(armor);
- id = strval(armorid);
- SetPlayerArmourEx(playerid, ar, 1);
- SendClientMessage(playerid, COLOR_RED, "You have taken a light armor vest from your house.");
- format(gstr, sizeof(gstr),"* %s gets some Armour from their house.",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM storedarmor WHERE id = %i", id);
- mysql_pquery(conn, mquery);
- }
- if(strfind(inputtext, "Heavy Armor Vest", true) != -1)
- {
- strmid(armor, inputtext, strfind(inputtext, "Armor: ") + 7, strfind(inputtext, "Armor: ") + 10);
- strmid(armorid, inputtext, strfind(inputtext, "[ID: ") + 5, strfind(inputtext, "]"));
- ar = strval(armor);
- id = strval(armorid);
- SetPlayerArmourEx(playerid, ar, 1);
- SendClientMessage(playerid, COLOR_RED, "You have taken a heavy armor vest from your house.");
- format(gstr, sizeof(gstr),"* %s gets some Armour from their house.",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM storedarmor WHERE id = %i", id);
- mysql_pquery(conn, mquery);
- }
- return true;
- }
- }
- Dialog:StoreArmorTrunk(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- else
- {
- new Float:carmour;
- GetPlayerArmour(playerid, carmour);
- if(carmour >= 1) return SysMsg(playerid, "You are aleady wearing a kevlar vest.");
- new armor[12], armorid[12], ar, id, x = GetNearestVehicle(playerid), trunkstring[128];
- if(strfind(inputtext, "Light Armor Vest", true) != -1)
- {
- strmid(armor, inputtext, strfind(inputtext, "Armor: ") + 7, strfind(inputtext, "Armor: ") + 10);
- strmid(armorid, inputtext, strfind(inputtext, "[ID: ") + 5, strfind(inputtext, "]"));
- ar = strval(armor);
- id = strval(armorid);
- SetPlayerArmourEx(playerid, ar, 1);
- SendClientMessage(playerid,COLOR_DARKBLUE,"You have taken a light armor vest from the vehicle's trunk.");
- format(trunkstring, sizeof(trunkstring), "* %s takes something from the %s's trunk. *", NameRP(playerid), GetVehicleName(x));
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- ApplyTrunkAnimation(playerid);
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM storedarmor WHERE id = %i", id);
- mysql_pquery(conn, mquery);
- }
- if(strfind(inputtext, "Heavy Armor Vest", true) != -1)
- {
- strmid(armor, inputtext, strfind(inputtext, "Armor: ") + 7, strfind(inputtext, "Armor: ") + 10);
- strmid(armorid, inputtext, strfind(inputtext, "[ID: ") + 5, strfind(inputtext, "]"));
- ar = strval(armor);
- id = strval(armorid);
- SetPlayerArmourEx(playerid, ar, 1);
- SendClientMessage(playerid, COLOR_DARKBLUE, "You have taken a heavy armor vest from the vehicle's trunk.");
- format(trunkstring, sizeof(trunkstring), "* %s takes something from the %s's trunk. *", NameRP(playerid), GetVehicleName(x));
- SetPlayerChatBubble(playerid, trunkstring, COLOR_EMOTE, 15.0, 5000);
- ApplyTrunkAnimation(playerid);
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM storedarmor WHERE id = %i", id);
- mysql_pquery(conn, mquery);
- }
- return true;
- }
- }
- Dialog:VehicleScrap(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- ShowInfoText(playerid, "~r~Scrapping Car~n~~w~Please Wait", 10000);
- ScrapTimer[playerid] = SetTimerEx("ScrapCar", 10000, 0, "ii", playerid, GetPVarInt(playerid, "ScrapCar"));
- DeletePVar(playerid, "ScrapCar");
- return true;
- }
- else
- {
- TogglePlayerControllable(playerid, 1);
- SetCameraBehindPlayer(playerid);
- BeingScrapped{GetPVarInt(playerid, "ScrapCar")} = false;
- PutPlayerInVehicle(playerid, GetPVarInt(playerid, "ScrapCar"), 0);
- DeletePVar(playerid, "ScrapCar");
- return true;
- }
- }
- Dialog:LoginDialog(playerid, response, listitem, inputtext[])
- {
- if(response == 0) return KickPlayer(playerid, 3);
- if(isnull(inputtext)) return ShowLoginBox(playerid);
- if(Logged{playerid}) return ShowMessage(playerid, "Error", "You Are Already Logged In!", "Ok");
- new buffer[150];
- WP_Hash(buffer, 150, inputtext);
- if(strcmp(MasterAccountPass[playerid], buffer, true))
- {
- new loginText[128];
- if(PasswordTries[playerid] > 1)
- {
- SysMsg(playerid, "[Auto Kicked] Too many wrong passwords.");
- format(loginText,sizeof(loginText),"[Auto Kick] %s was kicked after 3 wrong passwords were entered.",NameEx(playerid));
- KickPlayer(playerid, 4);
- AdminBroadcast(loginText, 1);
- return true;
- }
- ShowLoginBox(playerid);
- SysMsg(playerid,"Wrong Password.");
- printf("[Failed Login] %s",GetName(playerid));
- PasswordTries[playerid] ++;
- }
- else
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM masters WHERE id = %i LIMIT 1", MasterAccount[playerid]);
- mysql_pquery(conn, mquery, "LoginMasterAccount", "d", playerid);
- printf("[Login] %s",GetName(playerid));
- }
- return true;
- }
- Dialog:ActorMenu(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- else
- {
- strdel(inputtext, 0, 6);
- new a = strval(inputtext) - 1;
- SetPVarInt(playerid, "EditingActor", a);
- gstr[0] = EOS;
- if(BizzData[IsInBizzID[playerid]][BizzActorSpawned][a] == 1) strcat(gstr, "Despawn Actor\n");
- else strcat(gstr, "Spawn Actor\n");
- strcat(gstr, "Set Actor Skin\nSet Actor Position\nSet Actor Facing Angle\nSet Actor Animation");
- Dialog_Show(playerid, ActorEdit, DIALOG_STYLE_LIST, "Edit an Actor", gstr, "Okay", "Cancel");
- return true;
- }
- }
- Dialog:ActorEdit(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- DeletePVar(playerid, "EditingActor");
- return true;
- }
- else
- {
- switch(listitem)
- {
- case 0: //spawn/despawn actor
- {
- new a = GetPVarInt(playerid, "EditingActor"), b = IsInBizzID[playerid];
- if(strmatch(inputtext, "Spawn Actor"))
- {
- if(BizzData[b][BizzActorSpawned][a] == 1) return SysMsg(playerid, "That actor is already spawned.");
- if(BizzData[b][BizzActorSkin][a] == 0) return SysMsg(playerid, "This actor does not have a skin set yet. Please set one by selecting the set skin option.");
- if(BizzData[b][BizzActorX][a] == 0 && BizzData[b][BizzActorY][a] == 0 && BizzData[b][BizzActorZ][a] == 0) return SysMsg(playerid, "This business actor does not have a position set. Please set one using the set position option.");
- BizzData[b][BizzActor][a] = CreateActor(BizzData[b][BizzActorSkin][a], BizzData[b][BizzActorX][a], BizzData[b][BizzActorY][a], BizzData[b][BizzActorZ][a], BizzData[b][BizzActorAngle][a]);
- SetActorInvulnerable(BizzData[b][BizzActor][a], true);
- SetActorVirtualWorld(BizzData[b][BizzActor][a], BizzData[b][BizzVW]);
- BizzData[b][BizzActorSpawned][a] = 1;
- if(BizzData[b][BizzActorAnim] != -1) ApplyBizzActorAnim(BizzData[b][BizzActor][a], BizzData[b][BizzActorAnim][a]);
- SendClientMessageF(playerid, COLOR_WHITE, "You have"COL_NICEGREEN" spawned "COL_WHITE"Business Actor %i.", a + 1);
- SaveBizzActorData(b, a);
- DeletePVar(playerid, "EditingActor");
- return true;
- }
- else
- {
- if(BizzData[b][BizzActorSpawned][a] == 0) return SysMsg(playerid, "That actor is not spawned.");
- DestroyActor(BizzData[b][BizzActor][a]);
- BizzData[b][BizzActorSpawned][a] = 0;
- SendClientMessageF(playerid, COLOR_WHITE, "You have"COL_NICERED" despawned "COL_WHITE"Business Actor %i.", a + 1);
- SaveBizzActorData(b, a);
- DeletePVar(playerid, "EditingActor");
- return true;
- }
- }
- case 1: //set actor skin
- {
- return Dialog_Show(playerid, ActorSkin, DIALOG_STYLE_INPUT, "Set Actor Skin", "Here you may set the skin that your actor is going to use.\nYou may find a list of skin IDs at http://wiki.sa-mp.com/wiki/Skins:All", "Submit", "Cancel");
- }
- case 2: //set actor position
- {
- new a = GetPVarInt(playerid, "EditingActor"), b = IsInBizzID[playerid];
- if(BizzData[b][BizzActorSpawned][a] == 1) return SysMsg(playerid, "You cannot change an actor's position while it's spawned.");
- Dialog_Show(playerid, ActorPosition, DIALOG_STYLE_MSGBOX, "Set Actor Position", "Selecting 'Submit' will set your business actor's position to where you're currently standing.", "Submit", "Cancel");
- return true;
- }
- case 3: //set actor angle
- {
- return Dialog_Show(playerid, ActorAngle, DIALOG_STYLE_INPUT, "Set Actor Angle", "Type in an angle ranging from 0 to 360. This will change the direction your actor is facing.", "Submit", "Cancel");
- }
- case 4: //set actor animation
- {
- new sub[32];
- gstr[0] = EOS;
- strcat(gstr, "Clear Animation\n");
- for(new x = 0; x < MAX_ACTORANIMS; x++)
- {
- format(sub, sizeof(sub), "%s", AnimData[x][AnimName]);
- strcat(gstr, sub);
- strcat(gstr, "\n");
- }
- Dialog_Show(playerid, ActorAnimation, DIALOG_STYLE_LIST, "Set Actor Animation", gstr, "Select", "Cancel");
- return true;
- }
- }
- return true;
- }
- }
- Dialog:ActorSkin(playerid, response, listitem, inputtext[])
- {
- if(!response) return DeletePVar(playerid, "EditingActor");
- else
- {
- if(!IsNumeric(inputtext)) return Dialog_Show(playerid, ActorSkin, DIALOG_STYLE_INPUT, "Set Actor Skin", "ERROR: Skin ID must be numeric.", "Confirm", "Cancel");
- if(strval(inputtext) < 1 || strval(inputtext) > 311 || strval(inputtext) == 74) return Dialog_Show(playerid, ActorSkin, DIALOG_STYLE_INPUT, "Set Actor Skin", "ERROR: Skin ID was invalid.", "Confirm", "Cancel");
- if(!IsSkinAvailable(strval(inputtext))) return Dialog_Show(playerid, ActorSkin, DIALOG_STYLE_INPUT, "Set Actor Skin", "ERROR: Skin ID is not available for use.", "Confirm", "Cancel");
- new a = GetPVarInt(playerid, "EditingActor"), b = IsInBizzID[playerid], s = strval(inputtext);
- BizzData[b][BizzActorSkin][a] = s;
- if(BizzData[b][BizzActorSpawned][a] == 1) SetActorSkin(BizzData[b][BizzActor][a], s);
- SendClientMessageF(playerid, COLOR_WHITE, "You have set your business actor's skin to %i.", s);
- SaveBizzActorData(b, a);
- DeletePVar(playerid, "EditingActor");
- return true;
- }
- }
- Dialog:ActorPosition(playerid, response, listitem, inputtext[])
- {
- if(!response) return DeletePVar(playerid, "EditingActor");
- else
- {
- new a = GetPVarInt(playerid, "EditingActor"), b = IsInBizzID[playerid];
- BizzData[b][BizzActorX][a] = PlayerPosX(playerid);
- BizzData[b][BizzActorY][a] = PlayerPosY(playerid);
- BizzData[b][BizzActorZ][a] = PlayerPosZ(playerid);
- BizzData[b][BizzActorAngle][a] = PlayerPosA(playerid);
- if(BizzData[b][BizzActorSpawned][a] == 1)
- {
- SetActorPos(BizzData[b][BizzActor][a], BizzData[b][BizzActorX][a], BizzData[b][BizzActorY][a], BizzData[b][BizzActorZ][a]);
- SetActorFacingAngle(BizzData[b][BizzActor][a], BizzData[b][BizzActorAngle][a]);
- }
- SendClientMessage(playerid, COLOR_WHITE, "Your business actor's position has been updated.");
- SaveBizzActorData(b, a);
- DeletePVar(playerid, "EditingActor");
- return true;
- }
- }
- Dialog:ActorAngle(playerid, response, listitem, inputtext[])
- {
- if(!response) return DeletePVar(playerid, "EditingActor");
- else
- {
- if(!IsNumeric(inputtext)) return Dialog_Show(playerid, ActorAngle, DIALOG_STYLE_INPUT, "Set Actor Angle", "ERROR: Angle must be numeric.", "Submit", "Cancel");
- new ang = strval(inputtext);
- if(ang < 0) Dialog_Show(playerid, ActorAngle, DIALOG_STYLE_INPUT, "Set Actor Angle", "ERROR: Angle cannot be less than 0.", "Submit", "Cancel");
- if(ang > 360) Dialog_Show(playerid, ActorAngle, DIALOG_STYLE_INPUT, "Set Actor Angle", "ERROR: Angle cannot be greater than 360.", "Submit", "Cancel");
- new a = GetPVarInt(playerid, "EditingActor"), b = IsInBizzID[playerid];
- BizzData[b][BizzActorAngle][a] = strval(inputtext);
- if(BizzData[b][BizzActorSpawned][a] == 1) SetActorFacingAngle(BizzData[b][BizzActor][a], BizzData[b][BizzActorAngle][a]);
- SendClientMessage(playerid, COLOR_WHITE, "Your business actor's facing angle has been updated.");
- SaveBizzActorData(b, a);
- DeletePVar(playerid, "EditingActor");
- return true;
- }
- }
- Dialog:ActorAnimation(playerid, response, listitem, inputtext[])
- {
- if(!response) return DeletePVar(playerid, "EditingActor");
- else
- {
- new a = GetPVarInt(playerid, "EditingActor"), b = IsInBizzID[playerid], x = listitem - 1;
- if(listitem == 0)
- {
- ClearActorAnimations(BizzData[b][BizzActor][a]);
- BizzData[b][BizzActorAnim][a] = -1;
- }
- else
- {
- BizzData[b][BizzActorAnim][a] = x;
- ApplyBizzActorAnim(BizzData[b][BizzActor][a], BizzData[b][BizzActorAnim][a]);
- }
- SaveBizzActorData(b, a);
- DeletePVar(playerid, "EditingActor");
- return true;
- }
- }
- Dialog:ShopDialog(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- if(strcmp("Flowers",inputtext,true) == 0)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(Cash[playerid] < 15)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid,-15);
- GivePlayerWeaponEx(playerid,WEAPON_FLOWER,5, 7);
- ShowMessage(playerid,"Shop Message","You have bought a bouquet of flowers which costs $15", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 15;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else return SysMsg(playerid, "You can't carry these flowers at the moment.");
- }
- else if(strmatch("Boombox (Small)", inputtext))
- {
- if(Cash[playerid] < 7500)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- if(Inventory[playerid][Boombox] >= 1 || Boomboxes[playerid][BoomOID] == SQLID[playerid])
- return ShowMessage(playerid, "Shop Message", "You already own a boombox.", "Ok");
- GivePlayerCash(playerid, -7500);
- ShowMessage(playerid,"Shop Message","You have bought a Small Boombox which costs $7500", "Ok");
- Inventory[playerid][Boombox] = 1;
- MySQLUpdateInt(SQLID[playerid], "Boombox", Inventory[playerid][Boombox], "players");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 500;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strmatch("Boombox (Large)", inputtext))
- {
- if(Cash[playerid] < 15000)
- return ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- if(Inventory[playerid][Boombox] >= 1 || Boomboxes[playerid][BoomOID] == SQLID[playerid])
- return ShowMessage(playerid, "Shop Message", "You already own a boombox.", "OK");
- GivePlayerCash(playerid, -15000);
- ShowMessage(playerid,"Shop Message","You have bought a Large Boombox which costs $15000", "Ok");
- Inventory[playerid][Boombox] = 2;
- MySQLUpdateInt(SQLID[playerid], "Boombox", Inventory[playerid][Boombox], "players");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 1000;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Camera",inputtext,true) == 0)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(Cash[playerid] < 125)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid,-125);
- GivePlayerWeaponEx(playerid,WEAPON_CAMERA,50, 7);
- ShowMessage(playerid,"Shop Message","You have bought a Camera which costs $125", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 125;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else return SysMsg(playerid, "You can't carry a camera right now.");
- }
- else if(strcmp("Small Logs", inputtext, true) == 0)
- {
- if(Inventory[playerid][Logs] == 1) return ShowMessage(playerid,"Shop Message","You already have some small logs. Use /campfire", "Ok");
- if(Cash[playerid] < 5) return ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- GivePlayerCash(playerid, -100);
- Inventory[playerid][Logs] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasLogs", Inventory[playerid][Logs], "players");
- ShowMessage(playerid,"Shop Message","You have bought some small logs which costs $100. Use /campfire.", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 5;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Dice",inputtext,true) == 0)
- {
- if(Inventory[playerid][Dice] == 1)
- {
- ShowMessage(playerid,"Shop Message","You already have Dice. Use /rolldice", "Ok");
- return true;
- }
- if(Cash[playerid] < 5)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid,-5);
- Inventory[playerid][Dice] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasDice", Inventory[playerid][Dice], "players");
- ShowMessage(playerid,"Shop Message","You have bought Dice which costs $5. Use /rolldice.", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 5;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Bat",inputtext,true) == 0)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(Cash[playerid] < 45)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid,-45);
- GivePlayerWeaponEx(playerid,WEAPON_BAT,5, 7);
- ShowMessage(playerid,"Shop Message","You have bought a Bat which costs $45", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 45;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else return SysMsg(playerid, "You can't carry a bat at the moment.");
- }
- else if(strcmp("Shovel",inputtext,true) == 0)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(Cash[playerid] < 35)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid,-35);
- GivePlayerWeaponEx(playerid,WEAPON_SHOVEL,5, 7);
- ShowMessage(playerid,"Shop Message","You have bought a Shovel which costs $35", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 35;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else return SysMsg(playerid, "You can't carry a shovel right now.");
- }
- else if(strcmp("Cane",inputtext,true) == 0)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(Cash[playerid] < 15)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid,-15);
- GivePlayerWeaponEx(playerid,WEAPON_CANE,5, 7);
- ShowMessage(playerid,"Shop Message","You have bought a cane costs $15", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 15;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else return SysMsg(playerid, "You can't carry a cane at the moment.");
- }
- else if(strcmp("Phonebook",inputtext,true) == 0)
- {
- if(Inventory[playerid][Phonebook] == 1)
- {
- ShowMessage(playerid,"Shop Message","You already have a Phonebook. Use /getnumber", "Ok");
- return true;
- }
- if(Cash[playerid] < 5)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid,-5);
- Inventory[playerid][Phonebook] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasPhonebook", Inventory[playerid][Phonebook], "players");
- ShowMessage(playerid,"Shop Message","You have bought a Phonebook which costs $5. Use Command /getnumber", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 5;
- MySQLUpdateInt(IsInBizzID[playerid], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(IsInBizzID[playerid], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Radio",inputtext,true) == 0)
- {
- if(Inventory[playerid][Radio] == 1)
- {
- ShowMessage(playerid,"Shop Message","You already have a Radio. Use: /r /rtune /ron /roff", "Ok");
- return true;
- }
- if(Cash[playerid] < 225)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid,-225);
- Inventory[playerid][Radio] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasRadio", Inventory[playerid][Radio], "players");
- ShowMessage(playerid,"Shop Message","You have bought a Radio which costs $225. Use Commands: /r /rtune /ron /roff", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 225;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Fuel Container",inputtext,true) == 0)
- {
- if(Inventory[playerid][FuelCan][0] > -1)
- {
- ShowMessage(playerid,"Shop Message","You already have a Fuel Can. Refill en empty fuel can at a gas station", "Ok");
- return true;
- }
- if(Cash[playerid] < 125)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid,-125);
- Inventory[playerid][FuelCan][0] = 0;
- Inventory[playerid][FuelCan][1] = 0;
- MySQLUpdateInt(SQLID[playerid], "HasFuelCan", Inventory[playerid][FuelCan][0], "players");
- MySQLUpdateInt(SQLID[playerid], "HasFuelCanType", Inventory[playerid][FuelCan][1], "players");
- ShowMessage(playerid,"Shop Message","You have bought a Fuel Can which costs $125. Use Command: /fuelcan or /emptyfc", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 125;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Watch",inputtext,true) == 0)
- {
- if(Inventory[playerid][Watch] == 1)
- {
- ShowMessage(playerid,"Shop Message","You already have a watch. Use: /time /showtime", "Ok");
- return true;
- }
- if(Cash[playerid] < 250)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid, -250);
- Inventory[playerid][Watch] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasWatch", Inventory[playerid][Watch], "players");
- ShowMessage(playerid,"Shop Message","You have bought a Watch which costs $250. Use Commands: /time /showtime", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 250;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Lighter",inputtext,true) == 0)
- {
- if(Inventory[playerid][Lighter] > 0)
- {
- ShowMessage(playerid,"Shop Message","You already have a Lighter.", "Ok");
- return true;
- }
- if(Cash[playerid] < 5)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid, -5);
- Inventory[playerid][Lighter] = 100;
- MySQLUpdateInt(SQLID[playerid], "HasLighter", Inventory[playerid][Lighter], "players");
- ShowMessage(playerid,"Shop Message","You have bought a Lighter which costs $5.", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 5;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Pack of Cigarettes (x20)",inputtext,true) == 0)
- {
- if(Cash[playerid] < 5)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid, -5);
- Inventory[playerid][Fags] += 20;
- MySQLUpdateInt(SQLID[playerid], "HasFags", Inventory[playerid][Fags], "players");
- ShowMessage(playerid,"Shop Message","You have bought 20 Cigarettes which cost $5. Use Command /smokecig", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 5;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Pack of Cigarettes (x10)",inputtext,true) == 0)
- {
- if(Cash[playerid] < 3)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid, -3);
- Inventory[playerid][Fags] += 10;
- MySQLUpdateInt(SQLID[playerid], "HasFags", Inventory[playerid][Fags], "players");
- ShowMessage(playerid,"Shop Message","You have bought 10 Cigarettes which cost $3. Use Command /smokecig", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 3;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Pocket GPS", inputtext, true) == 0)
- {
- if(Inventory[playerid][GPS] == 1)
- {
- ShowMessage(playerid,"Shop Message","You already have a Pocket GPS.", "Ok");
- return true;
- }
- if(Cash[playerid] < 400)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid, -400);
- Inventory[playerid][GPS] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasGPS", Inventory[playerid][GPS], "players");
- ShowMessage(playerid,"Shop Message","You have bought a Pocket GPS which cost $400. Use Commands /gps /navigateto", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 400;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Rope", inputtext, true) == 0)
- {
- if(Inventory[playerid][Rope] == 1)
- {
- ShowMessage(playerid,"Shop Message","You already have Rope.", "Ok");
- return true;
- }
- if(Cash[playerid] < 12)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid, -12);
- Inventory[playerid][Rope] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasRope", Inventory[playerid][Rope], "players");
- ShowMessage(playerid,"Shop Message","You have bought Rope which cost $12. Use Command /tie /untie", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 12;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Notepad", inputtext, true) == 0)
- {
- if(Inventory[playerid][Notepad] == 1)
- {
- ShowMessage(playerid,"Shop Message","You already have a Notepad.", "Ok");
- return true;
- }
- if(Cash[playerid] < 6)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid, -6);
- Inventory[playerid][Notepad] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasNotepad", Inventory[playerid][Notepad], "players");
- ShowMessage(playerid,"Shop Message","You have bought a paper Notepad which cost $6. Use Command /notepad", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 6;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Writing Pen", inputtext, true) == 0)
- {
- if(Inventory[playerid][Pen] > 0)
- {
- ShowMessage(playerid,"Shop Message","You already have a Pen.", "Ok");
- return true;
- }
- if(Cash[playerid] < 3)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid, -3);
- Inventory[playerid][Pen] = 100;
- MySQLUpdateInt(SQLID[playerid], "HasPen", Inventory[playerid][Pen], "players");
- ShowMessage(playerid,"Shop Message","You have bought a Pen which cost $3.", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 3;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Writing Paper (x5)", inputtext, true) == 0)
- {
- if(Cash[playerid] < 5)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid, -5);
- Inventory[playerid][Paper] += 5;
- MySQLUpdateInt(SQLID[playerid], "HasPaper", Inventory[playerid][Paper], "players");
- ShowMessage(playerid,"Shop Message","You have bought 5 sheets of Paper which cost $5.", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 5;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Phone Car Charger Adapter", inputtext, true) == 0)
- {
- if(Inventory[playerid][CarAdapter] == 1)
- {
- ShowMessage(playerid,"Shop Message","You already have a Car Adapter.", "Ok");
- return true;
- }
- if(Cash[playerid] < 395)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid, -395);
- Inventory[playerid][CarAdapter] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasCarAdapter", Inventory[playerid][CarAdapter], "players");
- ShowMessage(playerid,"Shop Message","You have bought a Car Charger Adapter which cost $395.", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 395;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Golf Club",inputtext,true) == 0)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(Cash[playerid] < 155)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid,-155);
- GivePlayerWeaponEx(playerid,WEAPON_GOLFCLUB,5, 7);
- ShowMessage(playerid,"Shop Message","You have bought a Golf Club which costs $155", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 155;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else return SysMsg(playerid, "You can't carry a golf club right now.");
- }
- else if(strcmp("Backpack/Parachute",inputtext,true) == 0)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(Cash[playerid] < 135)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid,-135);
- GivePlayerWeaponEx(playerid,WEAPON_PARACHUTE,5, 7);
- ShowMessage(playerid,"Shop Message","You have bought a Backpack which costs $135", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 135;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else return SysMsg(playerid, "You can't carry a parachute right now.");
- }
- else if(strcmp("Pool Cue",inputtext,true) == 0)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(Cash[playerid] < 80)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid,-80);
- GivePlayerWeaponEx(playerid,WEAPON_POOLSTICK,5, 7);
- ShowMessage(playerid,"Shop Message","You have bought a Pool Cue which costs $80", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 80;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else return SysMsg(playerid, "You can't carry a pool cue right now.");
- }
- else if(strcmp("Mobile Phone", inputtext, true) == 0)
- {
- if(Inventory[playerid][MobilePhone] == 1)
- {
- ShowMessage(playerid,"Shop Message","You already have a Mobile Phone.", "Ok");
- return true;
- }
- if(Cash[playerid] < 300)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- new newNumber;
- do
- {
- newNumber = random(8999999) + 100000;
- }
- while(IsPhoneNumberUsed(newNumber) > 0);
- PhoneData[playerid][pNumber] = newNumber;
- Inventory[playerid][MobilePhone] = 1;
- PhoneData[playerid][pCredit] = 10;
- PhoneData[playerid][pPower] = 1;
- PhoneData[playerid][pBattery] = 100;
- format(PhoneData[playerid][pOwnerName], 24, "%s", GetName(playerid));
- GivePlayerCash(playerid, -300);
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO phones (PhoneNumber, PhoneCredit, Battery, PhonePower, OwnerSQLID, PhonePossessor, OwnerName, PhonePossession) VALUES (%i, %i, %i, 1, %i, %i, '%e', 1)",
- PhoneData[playerid][pNumber], PhoneData[playerid][pCredit], floatround(PhoneData[playerid][pBattery]), SQLID[playerid], SQLID[playerid], GetName(playerid));
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "[Important Mobile Phone Information: /pinfo]");
- SendClientMessage(playerid, COLOR_WHITE, "You have bought a Mobile Phone for $300.");
- SendClientMessage(playerid, COLOR_WHITE, "This phone has come free with $10 of credit. This credit is used to send texts and receive calls. You can buy more phone credit at any electronic store around the state.");
- SendClientMessage(playerid, COLOR_WHITE, "Your phone has been given to you powered on, use /phoneoff(/poff) to turn it off and /phoneon(/pon) to power it back on.");
- SendClientMessage(playerid, COLOR_WHITE, "You can enter your own contacts into the phone by using /phone.");
- SendClientMessage(playerid, COLOR_WHITE, "Your phone has also been given to you fully charged, you can use /phoneinfo(/pinfo) to check the battery charge among other details.");
- SendClientMessageF(playerid, COLOR_LIGHTGREEN, "Your phone number is: %i.", newNumber);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, " ");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 300;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("$10 Phone Credit", inputtext, true) == 0)
- {
- if(Inventory[playerid][MobilePhone] == 0)
- {
- ShowMessage(playerid,"Shop Message","You need to have a Mobile Phone.", "Ok");
- return true;
- }
- if(Cash[playerid] < 10)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- PhoneData[playerid][pCredit] += 10;
- GivePlayerCash(playerid, -10);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhoneCredit = %i WHERE id = %i", PhoneData[playerid][pCredit], PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, COLOR_WHITE, "You have bought $10 of phone credit.");
- }
- else if(strcmp("$20 Phone Credit", inputtext, true) == 0)
- {
- if(Inventory[playerid][MobilePhone] == 0)
- {
- ShowMessage(playerid,"Shop Message","You need to have a Mobile Phone.", "Ok");
- return true;
- }
- if(Cash[playerid] < 20)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- PhoneData[playerid][pCredit] += 20;
- GivePlayerCash(playerid, -20);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhoneCredit = %i WHERE id = %i", PhoneData[playerid][pCredit], PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, COLOR_WHITE, "You have bought $20 of phone credit.");
- }
- else if(strcmp("$50 Phone Credit", inputtext, true) == 0)
- {
- if(Inventory[playerid][MobilePhone] == 0)
- {
- ShowMessage(playerid,"Shop Message","You need to have a Mobile Phone.", "Ok");
- return true;
- }
- if(Cash[playerid] < 50)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- PhoneData[playerid][pCredit] += 50;
- GivePlayerCash(playerid, -50);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhoneCredit = %i WHERE id = %i", PhoneData[playerid][pCredit], PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, COLOR_WHITE, "You have bought $50 of phone credit.");
- }
- else if(strcmp("$100 Phone Credit", inputtext, true) == 0)
- {
- if(Inventory[playerid][MobilePhone] == 0)
- {
- ShowMessage(playerid,"Shop Message","You need to have a Mobile Phone.", "Ok");
- return true;
- }
- if(Cash[playerid] < 100)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- PhoneData[playerid][pCredit] += 100;
- GivePlayerCash(playerid, -100);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhoneCredit = %i WHERE id = %i", PhoneData[playerid][pCredit], PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, COLOR_WHITE, "You have bought $100 of phone credit.");
- }
- else if(strcmp("Basic Calculator", inputtext, true) == 0)
- {
- if(Inventory[playerid][Calculator] == 1)
- {
- ShowMessage(playerid,"Shop Message","You already have a Calculator.", "Ok");
- return true;
- }
- if(Cash[playerid] < 45)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- Inventory[playerid][Calculator] = 1;
- GivePlayerCash(playerid, -45);
- MySQLUpdateInt(SQLID[playerid], "HasCalculator", Inventory[playerid][Calculator], "players");
- SendClientMessage(playerid, COLOR_WHITE, "You have bought a Calculator for $45. (Use /calc to use it)");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 45;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("First Aid Kit", inputtext, true) == 0)
- {
- if(Inventory[playerid][MedKit] == 1)
- {
- ShowMessage(playerid,"Shop Message","You already have a Med Kit.", "Ok");
- return true;
- }
- if(Cash[playerid] < 65)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- Inventory[playerid][MedKit] = 1;
- GivePlayerCash(playerid, -65);
- MySQLUpdateInt(SQLID[playerid], "HasMedKit", Inventory[playerid][MedKit], "players");
- SendClientMessage(playerid, COLOR_WHITE, "You have bought a First Aid Kit for $65. (Use /medkit to use it)");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 65;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Toolbox", inputtext, true) == 0)
- {
- if(Inventory[playerid][Toolbox] == 1)
- {
- ShowMessage(playerid,"Shop Message","You already have a Toolbox.", "Ok");
- return true;
- }
- if(Cash[playerid] < 350)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- Inventory[playerid][Toolbox] = 1;
- GivePlayerCash(playerid, -350);
- MySQLUpdateInt(SQLID[playerid], "HasToolbox", Inventory[playerid][Toolbox], "players");
- SendClientMessage(playerid, COLOR_WHITE, "You have bought a Toolbox for $350.");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 15;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Supreme Engine Oil", inputtext, true) == 0)
- {
- if(Inventory[playerid][EngineOil] == 1)
- {
- ShowMessage(playerid,"Shop Message","You already have Engine Oil.", "Ok");
- return true;
- }
- if(Cash[playerid] < 115)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- Inventory[playerid][EngineOil] = 1;
- GivePlayerCash(playerid, -115);
- MySQLUpdateInt(SQLID[playerid], "HasEngineOil", Inventory[playerid][EngineOil], "players");
- SendClientMessage(playerid, COLOR_WHITE, "You have bought Supreme Engine Oil for $115.");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 115;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Bottle of water",inputtext,true) == 0)
- {
- if(Cash[playerid] < 2)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- if(Inventory[playerid][Water] + 1 > 24)
- {
- ShowMessage(playerid,"Shop Message","You may only have 24 bottles of water at any one time.", "Ok");
- return true;
- }
- GivePlayerCash(playerid, -2);
- Inventory[playerid][Water] += 1;
- MySQLUpdateFloat(SQLID[playerid], "HasWater", Inventory[playerid][Water], "players");
- ShowMessage(playerid,"Shop Message","You have bought a bottle of water which cost $2.", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 2;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Bottles of water (x6)",inputtext,true) == 0)
- {
- if(Cash[playerid] < 10)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- if(Inventory[playerid][Water] + 6 > 24)
- {
- ShowMessage(playerid,"Shop Message","You may only have 24 bottles of water at any one time.", "Ok");
- return true;
- }
- GivePlayerCash(playerid, -10);
- Inventory[playerid][Water] += 6;
- MySQLUpdateFloat(SQLID[playerid], "HasWater", Inventory[playerid][Water], "players");
- ShowMessage(playerid,"Shop Message","You have bought six bottles of water which cost $10.", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 10;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Blindfold",inputtext,true) == 0)
- {
- if(Cash[playerid] < 25) return ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- if(Inventory[playerid][Blindfold] == 1) return ShowMessage(playerid,"Shop Message","You already have a blindfold!", "Ok");
- GivePlayerCash(playerid, -25);
- Inventory[playerid][Blindfold] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasBlindfold", Inventory[playerid][Blindfold], "players");
- ShowMessage(playerid,"Shop Message","You have purchased a blindfold which cost $25. (Commands: /blindfold, /unblind)", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 25;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Spraycan",inputtext,true) == 0)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(Cash[playerid] < 50) return ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- GivePlayerCash(playerid,-50);
- GivePlayerWeaponEx(playerid,41,1000, 7);
- ShowMessage(playerid,"Shop Message","You have bought a spraycan which costs $50", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 50;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- }
- else return SysMsg(playerid, "You can't carry a spraycan right now.");
- }
- else if(strcmp("SPECIAL: Santa Hat", inputtext, true) == 0)
- {
- new year, month, day;
- getdate(year, month, day);
- if(month != 12) return ShowMessage(playerid,"Shop Message","Santa Hats are only available in December.", "Ok");
- if(Cash[playerid] < 50) return ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- GivePlayerCash(playerid, -50);
- SendClientMessage(playerid, COLOR_WHITE, "You have bought a Santa Hat for $50. (/clothing) You may have to reconnect for the hat to work properly.");
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO toys (`tPlayer`, `tModelID`, `tOffsetX`, `tOffsetY`, `tOffsetZ`, tRotX, tRotY, tRotZ, tScaleX, tScaleY, tScaleZ, tMask, tBone) VALUES (%i, 19064, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2)", SQLID[playerid]);
- mysql_pquery(conn, mquery, "SaveNewMask", "ii", playerid, 19064);
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0 || IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363))
- {
- new b;
- if(IsPlayerInRangeOfPoint(playerid, 5.5, 663.9998,-568.8943,16.3363)) b = 44;
- else b = IsInBizzID[playerid];
- BizzData[b][BizzEarnings] += 20;
- MySQLUpdateInt(IsInBizzID[playerid], "BizzEarnings", BizzData[b][BizzEarnings], "bizz");
- if(BizzData[b][BizzStock] > 0)
- {
- BizzData[b][BizzStock] --;
- MySQLUpdateInt(IsInBizzID[playerid], "Stock", BizzData[b][BizzStock], "bizz");
- }
- }
- return true;
- }
- return true;
- }
- Dialog:AmmunationDialog(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(strcmp("Light Armor - $2500",inputtext,true) == 0)
- {
- new Float:Armor;
- GetPlayerArmour(playerid, Armor);
- if(Armor >= 1) return ShowMessage(playerid, "Shop Message", "You already have an armor vest.", "Ok");
- if(Cash[playerid] < 2500) return ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- GivePlayerCash(playerid,-2500);
- SetPlayerArmourEx(playerid, 50.0, 1);
- ShowMessage(playerid,"Shop Message","You have bought Light Armor which costs $2500.", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 1350;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp(inputtext, "Pistol Ammo - $3000", true) == 0)
- {
- if(Cash[playerid] < 3000)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- if(Inventory[playerid][AmmoBox][AMMOBOX_PISTOL] >= 2) return ShowMessage(playerid,"Shop Message","You can't hold any more ammo boxes of this type.", "Ok");
- GivePlayerCash(playerid,-3000);
- Inventory[playerid][AmmoBox][AMMOBOX_PISTOL] ++;
- MySQLUpdateInt(SQLID[playerid], "AmmoBoxPistol", Inventory[playerid][AmmoBox][AMMOBOX_PISTOL], "players");
- ShowMessage(playerid,"Shop Message","You have bought Pistol Ammo which costs $3000.", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 200;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp(inputtext, "Shotgun Ammo - $4000", true) == 0)
- {
- if(Cash[playerid] < 4000)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- if(Inventory[playerid][AmmoBox][AMMOBOX_SHOTGUN] >= 2) return ShowMessage(playerid,"Shop Message","You can't hold any more ammo boxes of this type.", "Ok");
- GivePlayerCash(playerid,-4000);
- Inventory[playerid][AmmoBox][AMMOBOX_SHOTGUN] ++;
- MySQLUpdateInt(SQLID[playerid], "AmmoBoxShotgun", Inventory[playerid][AmmoBox][AMMOBOX_SHOTGUN], "players");
- ShowMessage(playerid,"Shop Message","You have bought Shotgun Ammo which costs $4000.", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 200;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp(inputtext, "SMG/UZI Ammo - $5000", true) == 0)
- {
- if(Cash[playerid] < 5000) return ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- if(Inventory[playerid][AmmoBox][AMMOBOX_SMG] >= 2) return ShowMessage(playerid,"Shop Message","You can't hold any more ammo boxes of this type.", "Ok");
- GivePlayerCash(playerid,-5000);
- Inventory[playerid][AmmoBox][AMMOBOX_SMG] ++;
- MySQLUpdateInt(SQLID[playerid], "AmmoBoxSMG", Inventory[playerid][AmmoBox][AMMOBOX_SMG], "players");
- ShowMessage(playerid,"Shop Message","You have bought SMG/UZI Ammo which costs $5000.", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 200;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp(inputtext, "Assault Rifle Ammo - $6000", true) == 0)
- {
- if(Cash[playerid] < 6000) return ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- if(Inventory[playerid][AmmoBox][AMMOBOX_ASSAULT] >= 2) return ShowMessage(playerid,"Shop Message","You can't hold any more ammo boxes of this type.", "Ok");
- GivePlayerCash(playerid,-6000);
- Inventory[playerid][AmmoBox][AMMOBOX_ASSAULT] ++;
- MySQLUpdateInt(SQLID[playerid], "AmmoBoxAssaultR", Inventory[playerid][AmmoBox][AMMOBOX_ASSAULT], "players");
- ShowMessage(playerid,"Shop Message","You have bought Assault Rifle Ammo which costs $6000.", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 200;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp(inputtext, "Rifle/Sniper Ammo - $6000", true) == 0)
- {
- if(Cash[playerid] < 6000) return ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- if(Inventory[playerid][AmmoBox][AMMOBOX_RIFLE] >= 2) return ShowMessage(playerid,"Shop Message","You can't hold any more ammo boxes of this type.", "Ok");
- GivePlayerCash(playerid,-6000);
- Inventory[playerid][AmmoBox][AMMOBOX_RIFLE] ++;
- MySQLUpdateInt(SQLID[playerid], "AmmoBoxRifle", Inventory[playerid][AmmoBox][AMMOBOX_RIFLE], "players");
- ShowMessage(playerid,"Shop Message","You have bought Rifle/Sniper Ammo which costs $6000.", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 200;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp(inputtext, "9mm Pistol with 85 ammo - $7500", true) == 0)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(Cash[playerid] < 7500) return ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- if(!WeaponCheck(playerid, WEAPON_COLT45)) return SysMsg(playerid, "You cannot get this weapon. You either have two sidearms or one primary weapon plus a sidearm on your person.");
- if(WeaponData[playerid][2][WeaponID] > 0) return SysMsg(playerid, "You already have a pistol.");
- if(WeaponLicenseCheck(playerid, WEAPON_COLT45)) return SysMsg(playerid, "You have already purchased a weapon of this type.");
- GivePlayerCash(playerid,-7500);
- GivePlayerWeaponEx(playerid, WEAPON_COLT45, GetDefaultWeaponAmmo(WEAPON_COLT45), 4);
- ShowMessage(playerid,"Shop Message","You have bought a 9mm Pistol with 85 ammo which costs $7500.\n ((You may only buy one 9mm at a time, regardless of where its stored or who is currently in possession of it.))", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 200;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- else return SysMsg(playerid, "You can't carry another weapon right now.");
- }
- else if(strcmp(inputtext, "Desert Eagle with 70 ammo - $10000", true) == 0)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(Cash[playerid] < 10000) return ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- if(!WeaponCheck(playerid, WEAPON_DEAGLE)) return SysMsg(playerid, "You cannot get this weapon. You either have two sidearms or one primary weapon plus a sidearm on your person.");
- if(WeaponData[playerid][2][WeaponID] > 0) return SysMsg(playerid, "You already have a pistol.");
- if(WeaponLicenseCheck(playerid, WEAPON_DEAGLE)) return SysMsg(playerid, "You have already purchased a weapon of this type.");
- GivePlayerCash(playerid,-10000);
- GivePlayerWeaponEx(playerid, WEAPON_DEAGLE, GetDefaultWeaponAmmo(WEAPON_DEAGLE), 4);
- ShowMessage(playerid,"Shop Message","You have bought a Desert Eagle with 70 ammo which costs $10000.\n ((You may only buy one desert eagle at a time, regardless of where its stored or who is currently in possession of it.))", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 200;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- else return SysMsg(playerid, "You can't carry another weapon right now.");
- }
- else if(strcmp(inputtext, "Country Rifle with 50 ammo - $29500", true) == 0)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(Cash[playerid] < 17500) return ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- if(!WeaponCheck(playerid, WEAPON_RIFLE)) return SysMsg(playerid, "You cannot get this weapon. You either have two sidearms or one primary weapon plus a sidearm on your person.");
- if(WeaponData[playerid][6][WeaponID] > 0) return SysMsg(playerid, "You already have a rifle.");
- if(WeaponLicenseCheck(playerid, WEAPON_RIFLE)) return SysMsg(playerid, "You have already purchased a weapon of this type.");
- GivePlayerCash(playerid,-17500);
- GivePlayerWeaponEx(playerid, WEAPON_RIFLE, GetDefaultWeaponAmmo(WEAPON_RIFLE), 4);
- ShowMessage(playerid,"Shop Message","You have bought a Country Rifle with 50 ammo which costs $29500.\n ((You may only buy one rifle at a time, regardless of where its stored or who is currently in possession of it.))", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 200;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- else return SysMsg(playerid, "You can't carry another weapon right now.");
- }
- else if(strcmp(inputtext, "MP5 with 120 ammo - $15000", true) == 0)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(Cash[playerid] < 15000) return ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- if(!WeaponCheck(playerid, WEAPON_MP5)) return SysMsg(playerid, "You cannot get this weapon. You either have two sidearms or one primary weapon plus a sidearm on your person.");
- if(WeaponData[playerid][4][WeaponID] > 0) return SysMsg(playerid, "You already have an SMG.");
- if(WeaponLicenseCheck(playerid, WEAPON_MP5)) return SysMsg(playerid, "You have already purchased a weapon of this type.");
- GivePlayerCash(playerid,-15000);
- GivePlayerWeaponEx(playerid, WEAPON_MP5, GetDefaultWeaponAmmo(WEAPON_MP5), 4);
- ShowMessage(playerid,"Shop Message","You have bought a MP5 with 120 ammo which costs $15000.\n ((You may only buy one MP5 at a time, regardless of where its stored or who is currently in possession of it.))", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 200;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- else return SysMsg(playerid, "You can't carry another weapon right now.");
- }
- else if(strcmp(inputtext, "Shotgun with 50 ammo - $18500", true) == 0)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(Cash[playerid] < 18500) return ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- if(!WeaponCheck(playerid, WEAPON_SHOTGUN)) return SysMsg(playerid, "You cannot get this weapon. You either have two sidearms or one primary weapon plus a sidearm on your person.");
- if(WeaponData[playerid][3][WeaponID] > 0) return SysMsg(playerid, "You already have a shotgun.");
- if(WeaponLicenseCheck(playerid, WEAPON_SHOTGUN)) return SysMsg(playerid, "You have already purchased a weapon of this type.");
- GivePlayerCash(playerid,-18500);
- GivePlayerWeaponEx(playerid, WEAPON_SHOTGUN, GetDefaultWeaponAmmo(WEAPON_SHOTGUN), 4);
- ShowMessage(playerid,"Shop Message","You have bought a Shotgun with 50 ammo which costs $18500.\n ((You may only buy one Shotgun at a time, regardless of where its stored or who is currently in possession of it.))", "Ok");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 200;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- else return SysMsg(playerid, "You can't carry another weapon right now.");
- }
- else if(strcmp(inputtext, "Store Help", true) == 0)
- {
- gstr[0] = EOS;
- strcat(gstr, "AMMUNATION STORE INFORMATION\n\n");
- strcat(gstr, "Pistol Ammo Box: Use for: 9mm, Silenced 9mm and Desert Eagle.\n");
- strcat(gstr, "Shotgun Ammo Box: Use for: Shotgun, Sawn-off, SPAS-12.\n");
- strcat(gstr, "Rifle Ammo Box: Use for: Country Rifle, Sniper Rifle.\n");
- strcat(gstr, "SMG Ammo Box: Use for: Micro SMG, SMG, Tec9.\n");
- strcat(gstr, "Assault Rifle Ammo Box: Use for: AK47, M4.\n");
- strcat(gstr, "Use all ammo boxes with command: /UseAmmo.\n\nWeapons can be purchased only if you have a weapon license.");
- ShowMessage(playerid,"Shop Message", gstr, "Ok");
- }
- }
- return true;
- }
- Dialog:ClothingMenu(playerid, response, listitem, inputtext[])
- {
- if(!response) return ClearClothingSelection(playerid);
- else
- {
- for(new x = 0; x < MAX_TOYS; x++)
- {
- if(ToyInfo[playerid][x][tID] == ClothingSelected[playerid][listitem])
- {
- ToyBeingEdited[playerid] = x;
- break;
- }
- }
- new toyspawn[32] = "Spawn With Item", wearingmask[12] = "Wear";
- if(ToyInfo[playerid][ToyBeingEdited[playerid]][tSpawn]) toyspawn = "Don't Spawn With Item";
- if(ToyInfo[playerid][ToyBeingEdited[playerid]][MaskWorn]) wearingmask = "Take Off";
- format(sgstr, sizeof(sgstr), "%s\nEdit Placement\nBone\nAdd Color\nRemove Color\nDelete\nReset Position\n%s", wearingmask, toyspawn);
- Dialog_Show(playerid, ClothingOptions, DIALOG_STYLE_LIST, "Clothing Options", sgstr, "Confirm", "Cancel");
- return true;
- }
- }
- Dialog:ClothingAdminReset(playerid, response, listitem, inputtext[])
- {
- if(!response) return ClearClothingSelection(playerid);
- else
- {
- new playa = ResettingMask[playerid], toyid;
- for(new x = 0; x < MAX_TOYS; x++)
- {
- if(ToyInfo[playa][x][tID] == ClothingSelected[playerid][listitem])
- {
- toyid = x;
- break;
- }
- }
- ResettingMask[playerid] = -1;
- for(new ao = 0; ao < 6; ao++)
- {
- if(AttachedObjects[playa][ao][aoToyID] == ToyInfo[playa][toyid][tID])
- {
- RemovePlayerAttachedObject(playa, ao);
- ToyInfo[playa][toyid][tScale][0] = 1.0;
- ToyInfo[playa][toyid][tScale][1] = 1.0;
- ToyInfo[playa][toyid][tScale][2] = 1.0;
- SetPlayerAttachedObject(playa, ao, ToyInfo[playa][toyid][tModelID], ToyInfo[playa][toyid][tBone], ToyInfo[playa][toyid][tOffset][0], ToyInfo[playa][toyid][tOffset][1], ToyInfo[playa][toyid][tOffset][2], ToyInfo[playa][toyid][tRot][0], ToyInfo[playa][toyid][tRot][1], ToyInfo[playa][toyid][tRot][2], ToyInfo[playa][toyid][tScale][0], ToyInfo[playa][toyid][tScale][1], ToyInfo[playa][toyid][tScale][2]);
- SendClientMessageF(playa, COLOR_RED, "Admin %s has reset the size of your %s.", NameEx(playerid), GetMaskDescription(ToyInfo[playa][toyid][tModelID]));
- SendClientMessageF(playerid, COLOR_WHITE, "You have reset the mask size of %s.", NameEx(playa));
- SavePlayerToy(playa, toyid);
- ClearClothingSelection(playerid);
- return true;
- }
- }
- return true;
- }
- }
- Dialog:ClothingBone(playerid, response, listitem, inputtext[])
- {
- if(!response) return ClearClothingSelection(playerid);
- else
- {
- new b = listitem + 1, id = ToyBeingEdited[playerid];
- for(new ao = 0; ao < 6; ao++)
- {
- if(AttachedObjects[playerid][ao][aoToyID] == ToyInfo[playerid][id][tID])
- {
- RemovePlayerAttachedObject(playerid, ao);
- SetPlayerAttachedObject(playerid, ao, ToyInfo[playerid][id][tModelID], b, ToyInfo[playerid][id][tOffset][0], ToyInfo[playerid][id][tOffset][1], ToyInfo[playerid][id][tOffset][2], ToyInfo[playerid][id][tRot][0], ToyInfo[playerid][id][tRot][1], ToyInfo[playerid][id][tRot][2], ToyInfo[playerid][id][tScale][0], ToyInfo[playerid][id][tScale][1], ToyInfo[playerid][id][tScale][2]);
- break;
- }
- }
- ToyInfo[playerid][id][tBone] = b;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE toys SET tBone = %i WHERE id = %i", ToyInfo[playerid][id][tBone], ToyInfo[playerid][id][tID]);
- mysql_pquery(conn, mquery);
- SysMsg(playerid, "You have successfuly changed the bone your object is attached to.");
- ClearClothingSelection(playerid);
- return true;
- }
- }
- Dialog:ClothingOptions(playerid, response, listitem, inputtext[])
- {
- if(!response) return ClearClothingSelection(playerid);
- switch(listitem)
- {
- case 0: //Wear
- {
- if(strmatch(inputtext, "Wear"))
- {
- if(ToyBeingEdited[playerid] != -1)
- {
- if(ToyInfo[playerid][ToyBeingEdited[playerid]][MaskWorn]) return SysMsg(playerid, "You are already wearing this item.");
- new index = GetFreePlayerObjectIndex(playerid);
- new id = ToyBeingEdited[playerid];
- SetPlayerAttachedObject(playerid, index, ToyInfo[playerid][id][tModelID], ToyInfo[playerid][id][tBone], ToyInfo[playerid][id][tOffset][0], ToyInfo[playerid][id][tOffset][1], ToyInfo[playerid][id][tOffset][2], ToyInfo[playerid][id][tRot][0], ToyInfo[playerid][id][tRot][1], ToyInfo[playerid][id][tRot][2], ToyInfo[playerid][id][tScale][0], ToyInfo[playerid][id][tScale][1], ToyInfo[playerid][id][tScale][2], ToyInfo[playerid][id][tColor], ToyInfo[playerid][id][tColor]);
- AttachedObjects[playerid][index][aoToyID] = ToyInfo[playerid][id][tID];
- AttachedObjects[playerid][index][aoModelID] = ToyInfo[playerid][id][tModelID];
- AttachedObjects[playerid][index][aoOffset][0] = ToyInfo[playerid][id][tOffset][0];
- AttachedObjects[playerid][index][aoOffset][1] = ToyInfo[playerid][id][tOffset][1];
- AttachedObjects[playerid][index][aoOffset][2] = ToyInfo[playerid][id][tOffset][2];
- AttachedObjects[playerid][index][aoRot][0] = ToyInfo[playerid][id][tRot][0];
- AttachedObjects[playerid][index][aoRot][1] = ToyInfo[playerid][id][tRot][1];
- AttachedObjects[playerid][index][aoRot][2] = ToyInfo[playerid][id][tRot][2];
- AttachedObjects[playerid][index][aoScale][0] = ToyInfo[playerid][id][tScale][0];
- AttachedObjects[playerid][index][aoScale][1] = ToyInfo[playerid][id][tScale][1];
- AttachedObjects[playerid][index][aoScale][2] = ToyInfo[playerid][id][tScale][2];
- AttachedObjects[playerid][index][aoBone] = ToyInfo[playerid][id][tBone];
- AttachedObjects[playerid][index][aoColor] = ToyInfo[playerid][id][tColor];
- ToyInfo[playerid][id][MaskWorn] = true;
- ClearClothingSelection(playerid);
- cmd_clothing(playerid);
- return true;
- }
- }
- else if(strmatch(inputtext, "Take Off"))
- {
- new t = ToyBeingEdited[playerid];
- for(new ao = 0; ao < 6; ao++)
- {
- if(AttachedObjects[playerid][ao][aoModelID] == ToyInfo[playerid][t][tModelID])
- {
- RemovePlayerAttachedObject(playerid, ao);
- AttachedObjects[playerid][ao][aoToyID] = 0;
- AttachedObjects[playerid][ao][aoModelID] = 0;
- AttachedObjects[playerid][ao][aoOffset][0] = 0;
- AttachedObjects[playerid][ao][aoOffset][1] = 0;
- AttachedObjects[playerid][ao][aoOffset][2] = 0;
- AttachedObjects[playerid][ao][aoRot][0] = 0;
- AttachedObjects[playerid][ao][aoRot][1] = 0;
- AttachedObjects[playerid][ao][aoRot][2] = 0;
- AttachedObjects[playerid][ao][aoScale][0] = 0;
- AttachedObjects[playerid][ao][aoScale][1] = 0;
- AttachedObjects[playerid][ao][aoScale][2] = 0;
- AttachedObjects[playerid][ao][aoBone] = 0;
- AttachedObjects[playerid][ao][aoColor] = 0;
- ToyInfo[playerid][t][MaskWorn] = false;
- ClearClothingSelection(playerid);
- cmd_clothing(playerid);
- return true;
- }
- }
- SysMsg(playerid, "You are not wearing this clothing object.");
- }
- else SysMsg(playerid, "wtf");
- return true;
- }
- case 1: //Edit Placement
- {
- if(!ToyInfo[playerid][ToyBeingEdited[playerid]][MaskWorn]) return SysMsg(playerid, "You are not wearing this item.");
- for(new ao = 0; ao < 6; ao++)
- {
- if(AttachedObjects[playerid][ao][aoToyID] == ToyInfo[playerid][ToyBeingEdited[playerid]][tID])
- {
- EditingAttachedObject[playerid] = 1;
- EditAttachedObject(playerid, ao);
- SendClientMessage(playerid, COLOR_WHITE, " ");
- SendClientMessage(playerid, COLOR_WHITE, "Select an option from [Move] [Rotate] or [Scale] then drag the [X] [Y] and [Z] buttons to edit.");
- SendClientMessage(playerid, COLOR_WHITE, "Press the save button to finish or press the escape key to cancel.");
- ClearClothingSelection(playerid);
- break;
- }
- }
- return true;
- }
- case 2: //Bone
- {
- Dialog_Show(playerid, ClothingBone, DIALOG_STYLE_LIST, "Clothing - Select a Bone", "Spine\nHead\nLeft upper arm\nRight upper arm\nLeft hand\nRight hand\nLeft thigh\nRight Thigh\nLeft foot\nRight foot\nRight calf\nLeft calf\nLeft forearm\nRight forearm\nLeft shoulder\nRight shoulder", "Select", "Cancel");
- return true;
- }
- case 3: //Add Color
- {
- new sub[12], bigstr[3000];
- for(new x = 0; x < sizeof(MaterialColors); x++)
- {
- format(sub, 12, "%x", MaterialColors[x][ColorHex]);
- strdel(sub, 0, 2);
- format(bigstr, sizeof(bigstr), "%s{%s}%s\n", bigstr, sub, MaterialColors[x][ColorName]);
- }
- Dialog_Show(playerid, ClothingColor, DIALOG_STYLE_LIST, "Clothing - Select a Color", bigstr, "Select", "Cancel");
- return true;
- }
- case 4: //Remove Color
- {
- new id = ToyBeingEdited[playerid];
- if(ToyInfo[playerid][id][tColor] == 0) return SysMsg(playerid, "This item does not have a color on it.");
- ToyInfo[playerid][id][tColor] = 0;
- SavePlayerToy(playerid, id);
- SendClientMessageF(playerid, COLOR_WHITE, "You have "COL_NICERED"removed{FFFFFF} the color from your %s.", GetMaskDescription(ToyInfo[playerid][id][tModelID]));
- for(new ao = 0; ao < 6; ao++)
- {
- if(AttachedObjects[playerid][ao][aoToyID] == ToyInfo[playerid][id][tID])
- {
- AttachedObjects[playerid][ao][aoColor] = 0;
- RemovePlayerAttachedObject(playerid, ao);
- SetPlayerAttachedObject(playerid, ao, AttachedObjects[playerid][ao][aoModelID], AttachedObjects[playerid][ao][aoBone], AttachedObjects[playerid][ao][aoOffset][0], AttachedObjects[playerid][ao][aoOffset][1],
- AttachedObjects[playerid][ao][aoOffset][2], AttachedObjects[playerid][ao][aoRot][0], AttachedObjects[playerid][ao][aoRot][1], AttachedObjects[playerid][ao][aoRot][2], AttachedObjects[playerid][ao][aoScale][0],
- AttachedObjects[playerid][ao][aoScale][1], AttachedObjects[playerid][ao][aoScale][2], AttachedObjects[playerid][ao][aoColor], AttachedObjects[playerid][ao][aoColor]);
- break;
- }
- }
- cmd_clothing(playerid);
- return true;
- }
- case 5: //Delete object
- {
- Dialog_Show(playerid, ClothingDelete, DIALOG_STYLE_MSGBOX, "Are you sure?", "Are you sure you wish to delete this item?", "Yes", "No");
- return true;
- }
- case 6: //Reset object
- {
- Dialog_Show(playerid, ClothingReset, DIALOG_STYLE_MSGBOX, "Are you sure?", "Are you sure you wish to reset this item?", "Yes", "No");
- return true;
- }
- case 7: //spawn/don't spawn with item
- {
- new id = ToyBeingEdited[playerid];
- if(strcmp(inputtext, "Spawn With Item", true) == 0)
- {
- ToyInfo[playerid][id][tSpawn] = true;
- SavePlayerToy(playerid, id);
- SendClientMessage(playerid, COLOR_WHITE, "You will now spawn with this item attached.");
- cmd_clothing(playerid);
- }
- else
- {
- ToyInfo[playerid][id][tSpawn] = false;
- SavePlayerToy(playerid, id);
- SendClientMessage(playerid, COLOR_WHITE, "You will no longer spawn with this item attached.");
- cmd_clothing(playerid);
- }
- return true;
- }
- }
- return true;
- }
- Dialog:ClothingColor(playerid, response, listitem, inputtext[])
- {
- if(!response) return ClearClothingSelection(playerid);
- else
- {
- new id = ToyBeingEdited[playerid], colstring[12];
- format(colstring, 12, "%x", MaterialColors[listitem][ColorHex]);
- ToyInfo[playerid][id][tColor] = MaterialColors[listitem][ColorHex];
- strdel(colstring, 0, 2);
- SendClientMessageF(playerid, COLOR_WHITE, "You have changed the color of your %s to {%s}%s!", GetMaskDescription(ToyInfo[playerid][id][tModelID]), colstring, MaterialColors[listitem][ColorName]);
- SavePlayerToy(playerid, id);
- for(new ao = 0; ao < 6; ao++)
- {
- if(AttachedObjects[playerid][ao][aoToyID] == ToyInfo[playerid][id][tID])
- {
- AttachedObjects[playerid][ao][aoColor] = MaterialColors[listitem][ColorHex];
- RemovePlayerAttachedObject(playerid, ao);
- SetPlayerAttachedObject(playerid, ao, AttachedObjects[playerid][ao][aoModelID], AttachedObjects[playerid][ao][aoBone], AttachedObjects[playerid][ao][aoOffset][0], AttachedObjects[playerid][ao][aoOffset][1],
- AttachedObjects[playerid][ao][aoOffset][2], AttachedObjects[playerid][ao][aoRot][0], AttachedObjects[playerid][ao][aoRot][1], AttachedObjects[playerid][ao][aoRot][2], AttachedObjects[playerid][ao][aoScale][0],
- AttachedObjects[playerid][ao][aoScale][1], AttachedObjects[playerid][ao][aoScale][2], AttachedObjects[playerid][ao][aoColor], AttachedObjects[playerid][ao][aoColor]);
- break;
- }
- }
- ClearClothingSelection(playerid);
- cmd_clothing(playerid);
- return true;
- }
- }
- Dialog:ClothingDelete(playerid, response, listitem, inputtext[])
- {
- if(!response) return cmd_clothing(playerid);
- else
- {
- new id = ToyBeingEdited[playerid];
- for(new ao = 0; ao < 6; ao++)
- {
- if(AttachedObjects[playerid][ao][aoToyID] == ToyInfo[playerid][id][tID]) return SysMsg(playerid, "You cannot delete a clothing object if you are wearing one.");
- break;
- }
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM toys WHERE id = %i", ToyInfo[playerid][id][tID]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_WHITE, "You have removed your %s from your mask inventory", GetMaskDescription(ToyInfo[playerid][id][tModelID]));
- ClearToyData(playerid, id);
- ClearClothingSelection(playerid);
- cmd_clothing(playerid);
- }
- return true;
- }
- Dialog:ClothingReset(playerid, response, listitem, inputtext[])
- {
- if(!response) return cmd_clothing(playerid);
- else
- {
- new id = ToyBeingEdited[playerid];
- ToyInfo[playerid][id][tScale][0] = 1.0;
- ToyInfo[playerid][id][tScale][1] = 1.0;
- ToyInfo[playerid][id][tScale][2] = 1.0;
- ToyInfo[playerid][id][tOffset][0] = 0.0;
- ToyInfo[playerid][id][tOffset][1] = 0.0;
- ToyInfo[playerid][id][tOffset][2] = 0.0;
- ToyInfo[playerid][id][tRot][0] = 0.0;
- ToyInfo[playerid][id][tRot][1] = 0.0;
- ToyInfo[playerid][id][tRot][2] = 0.0;
- for(new ao = 0; ao < 6; ao++)
- {
- if(AttachedObjects[playerid][ao][aoToyID] == ToyInfo[playerid][id][tID])
- {
- RemovePlayerAttachedObject(playerid, ao);
- AttachedObjects[playerid][ao][aoScale][0] = 1.0;
- AttachedObjects[playerid][ao][aoScale][1] = 1.0;
- AttachedObjects[playerid][ao][aoScale][2] = 1.0;
- AttachedObjects[playerid][ao][aoOffset][0] = 0.0;
- AttachedObjects[playerid][ao][aoOffset][1] = 0.0;
- AttachedObjects[playerid][ao][aoOffset][2] = 0.0;
- AttachedObjects[playerid][ao][aoRot][0] = 0.0;
- AttachedObjects[playerid][ao][aoRot][1] = 0.0;
- AttachedObjects[playerid][ao][aoRot][2] = 0.0;
- SetPlayerAttachedObject(playerid, ao, ToyInfo[playerid][id][tModelID], ToyInfo[playerid][id][tBone], ToyInfo[playerid][id][tOffset][0], ToyInfo[playerid][id][tOffset][1], ToyInfo[playerid][id][tOffset][2], ToyInfo[playerid][id][tRot][0], ToyInfo[playerid][id][tRot][1], ToyInfo[playerid][id][tRot][2], ToyInfo[playerid][id][tScale][0], ToyInfo[playerid][id][tScale][1], ToyInfo[playerid][id][tScale][2]);
- ClearClothingSelection(playerid);
- return true;
- }
- }
- SendClientMessage(playerid, COLOR_WHITE, "You have reset the position of your item.");
- SavePlayerToy(playerid, id);
- cmd_clothing(playerid);
- }
- return true;
- }
- Dialog:ClothingBuy(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- switch(listitem)
- {
- case 0:
- {
- if(IsJailed[playerid] == 1) return SysMsg(playerid,"Please wait until you are out of jail.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid,"This action cannot be performed while you are in handcuffs.");
- if(IsChangingSkin{playerid}) return SysMsg(playerid,"You are already changing your skin.");
- if(Duty[playerid] == 1) return SysMsg(playerid,"You can't get new clothes when on duty.");
- if(Cash[playerid] < 50) return SysMsg(playerid, "You must have $50 to buy new clothes.");
- new cSets = 0;
- for(new c = 0; c < 4; c++)
- {
- if(Clothes[playerid][c] != 0)
- {
- cSets ++;
- }
- }
- if(cSets == 4) return SysMsg(playerid,"You can't have any more clothes in your inventory.");
- new skins[] = { // Masculinas (Padrão do jogo)
- 1,2,3,4,5,6,7,8,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,
- 35,36,37,38,42,43,44,45,46,47,48,49,50,51,52,57,58,59,60,61,62,66,67,68,72,73,78,
- 79,80,81,82,83,84,86,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,
- 111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,132,133,134,
- 135,136,137,142,143,144,146,147,149,153,154,155,156,158,159,160,161,162,163,164,165,
- 166,167,168,170,171,173,174,175,176,177,179,180,181,182,183,184,185,186,187,188,189,
- 200,202,203,204,206,209,210,212,213,217,220,221,222,223,227,228,229,230,234,235,236,
- 239,240,241,242,247,248,249,250,252,253,254,255,258,259,260,261,262,264,268,269,270,
- 271,272,273,289,290,291,292,293,294,295,296,297,299
- };
- new count = sizeof(skins);
- ShowModelSelectionMenu(playerid, "Buy Clothing", MODEL_SELECTION_CLOTHES, skins, count, 0.0, 0.0, 0.0);
- printf("[Cmd] %s Enters Skin Change",NameEx(playerid));
- return true;
- }
- case 1:
- {
- if(IsJailed[playerid] == 1) return SysMsg(playerid,"Please wait until you are out of jail.");
- if(IsCuffed[playerid] == 1) return SysMsg(playerid,"This action cannot be performed while you are in handcuffs.");
- if(IsChangingSkin{playerid}) return SysMsg(playerid,"You are already changing your skin.");
- if(Duty[playerid] == 1) return SysMsg(playerid,"You can't get new clothes when on duty.");
- if(Cash[playerid] < 50) return SysMsg(playerid, "You must have $50 to buy new clothes.");
- new cSets = 0;
- for(new c = 0; c < 4; c++)
- {
- if(Clothes[playerid][c] != 0)
- {
- cSets ++;
- }
- }
- if(cSets == 4) return SysMsg(playerid,"You can't have any more clothes in your inventory.");
- new skins[] = { // Femininas (Padrão do jogo)
- 9, 10, 11, 12, 13, 31, 38, 39, 40, 41, 53, 54, 55,
- 56, 63, 64, 69, 75, 76, 77, 85, 87, 88, 89, 90, 91,
- 92, 93, 129, 130, 131, 138, 139, 140, 141, 145, 148,
- 150, 151, 152, 157, 169, 172, 178, 190, 191, 192, 193,
- 194, 195, 196, 197, 198, 199, 201, 205, 207, 211, 214,
- 215, 216, 218, 219, 224, 225, 226, 231, 232, 233, 237,
- 238, 243, 244, 245, 246, 251, 256, 257, 263, 298, 304
- };
- new count = sizeof(skins);
- ShowModelSelectionMenu(playerid, "Buy Clothing", MODEL_SELECTION_CLOTHES, skins, count, 0.0, 0.0, 0.0);
- printf("[Cmd] %s Enters Skin Change",NameEx(playerid));
- return true;
- }
- case 2:
- {
- new skins[] = { // 0.3.DL Masculinas
- 20000,20002,20003,20004,20005,20006,20007,20008,20009,20010,20011,20012,20013,
- 20014,20015,20016,20017,20019,20020,20021,20022,20023,20024,20025,20026,20027,20028,20029,20030,
- 20031,20032,20033,20034,20035,20036,20037,20038,20039,20040,20041,20042,20043,20044,20047,20149,20150,20151,
- 20152,20153
- };
- new count = sizeof(skins);
- ShowModelSelectionMenu(playerid, "Skins custom MALE", MODEL_SELECTION_CLOTHES, skins, count, 0.0, 0.0, 0.0);
- return 1;
- }
- case 3:
- {
- new skins[] = { // 0.3.DL Femininas
- 25000,25001,25002,25003,
- 25004,25005,25006,25007,25008,25009,25010,25011,25012,25013,
- 25014,25015
- };
- new count = sizeof(skins);
- ShowModelSelectionMenu(playerid, "Skins custom FAME", MODEL_SELECTION_CLOTHES, skins, count, 0.0, 0.0, 0.0);
- return 1;
- }
- case 4:
- {
- if(GetToyCount(playerid) >= MAX_TOYS) return SysMsg(playerid, "You can not buy more items.");
- format(gstr, sizeof(gstr), "Masks\nBandanas\nHats\nHelmets\nHair\nSunglasses\nWatches\nMiscellaneous\nTools\n");
- if(IsCop(playerid)) strcat(gstr, "Police Items\n");
- else if(Faction[playerid] == FACTION_SACFD) strcat(gstr, "SACFD Items\n");
- Dialog_Show(playerid, ClothingItemMenu, DIALOG_STYLE_LIST, "Select the type of item you are looking for", gstr, "Select", "Cancel");
- return true;
- }
- default: return SysMsg(playerid, "How did you do this shit? ");
- }
- return true;
- }
- Dialog:FishingBuy(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(isnull(inputtext)) return Dialog_Show(playerid, FishingBuy, DIALOG_STYLE_LIST, "Fishing Store","Fishing Permit - {3D9140}$500\nFishing Rod - {3D9140}$150\nBait (X25) - {3D9140}$10\nFish Crate - {3D9140}$1,000", "Buy", "Cancel");
- if(strcmp("Fishing Permit - $500",inputtext,true) == 0)
- {
- if(Cash[playerid] < 500)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- if(Inventory[playerid][FishingPermit] == 1) return SysMsg(playerid,"You already have that item.");
- GivePlayerCash(playerid,-500);
- Inventory[playerid][FishingPermit] = 1;
- MySQLUpdateInt(SQLID[playerid], "FishingPermit", Inventory[playerid][FishingPermit], "players");
- ShowMessage(playerid,"Shop Message","You have bought a Fishing Permit which costs $500. You may now /fish.", "Ok");
- }
- else if(strcmp("Fishing Rod - $150",inputtext,true) == 0)
- {
- if(Cash[playerid] < 150)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- if(Inventory[playerid][FishingRod] == 1 && FishingRodHealth[playerid] != 0) return SysMsg(playerid,"You already have a fishing rod.");
- GivePlayerCash(playerid, -150);
- Inventory[playerid][FishingRod] = 1;
- FishingRodHealth[playerid] = 100;
- MySQLUpdateInt(SQLID[playerid], "FishingRod", Inventory[playerid][FishingRod], "players");
- MySQLUpdateInt(SQLID[playerid], "FishingRodHealth", FishingRodHealth[playerid], "players");
- ShowMessage(playerid,"Shop Message","You have bought a Fishing Rod which cost $150. You may now /fish.", "Ok");
- }
- else if(strcmp("Bait (X25) - $10",inputtext,true) == 0)
- {
- if(Cash[playerid] < 10)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- GivePlayerCash(playerid,-10);
- Inventory[playerid][FishingBait] += 25;
- MySQLUpdateInt(SQLID[playerid], "FishingBait", Inventory[playerid][FishingBait], "players");
- ShowMessage(playerid,"Shop Message","You have bought a Bait (x25) which costs $10.", "Ok");
- }
- else if(strcmp("Small Fish Crate (100 slots) - $1,000", inputtext, true) == 0)
- {
- if(Cash[playerid] < 1000) return SysMsg(playerid, "You cannot afford this crate.");
- for(new c = 0; c < MAX_FISHCRATES; c++)
- {
- if(FishingCrates[c][CrateOwner] == SQLID[playerid]) return SysMsg(playerid, "You already own a fishing crate.");
- }
- new boatcount = 0;
- for(new v = 0, r = GetVehiclePoolSize(); v <= r; v++)
- {
- if(VehicleData[v][VehicleOwnerSQLID] == SQLID[playerid] && IsBoat(v))
- {
- boatcount ++;
- }
- }
- if(boatcount == 0) return SysMsg(playerid, "You must own a suitable boat to buy this.");
- new index = GetFreePlayerObjectIndex(playerid);
- if(index == -1) return SysMsg(playerid, "You do not have any free attached object slots.");
- SetPlayerAttachedObject(playerid, index, GetFishingCrateModelID(1), 1, -0.057999, 0.659000, 0.000000, 0.000000, 88.099960, -179.699905, 0.499000, 0.559000, 0.414999);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
- new c = GetFreeFishCrateSlot();
- FishingCrates[c][CrateID] = c;
- FishingCrates[c][CrateType] = 1;
- FishingCrates[c][CrateOwner] = SQLID[playerid];
- SendClientMessage(playerid, COLOR_WHITE, "You have purchased a small fish crate. You must put this crate on a boat ASAP otherwise it will be deleted upon relogging.");
- GivePlayerCash(playerid, -1000);
- }
- else if(strcmp("Medium Fish Crate (250 slots) - $2,500", inputtext, true) == 0)
- {
- if(Cash[playerid] < 2500) return SysMsg(playerid, "You cannot afford this crate.");
- for(new c = 0; c < MAX_FISHCRATES; c++)
- {
- if(FishingCrates[c][CrateOwner] == SQLID[playerid]) return SysMsg(playerid, "You already own a fishing crate.");
- }
- new boatcount = 0;
- for(new v = 0, r = GetVehiclePoolSize(); v <= r; v++)
- {
- if(VehicleData[v][VehicleOwnerSQLID] == SQLID[playerid] && IsBoat(v))
- {
- boatcount ++;
- }
- }
- if(boatcount == 0) return SysMsg(playerid, "You must own a suitable boat to buy this.");
- new index = GetFreePlayerObjectIndex(playerid);
- if(index == -1) return SysMsg(playerid, "You do not have any free attached object slots.");
- SetPlayerAttachedObject(playerid, index, GetFishingCrateModelID(2), 1, -0.057999, 0.659000, 0.000000, 0.000000, 88.099960, -179.699905, 0.499000, 0.559000, 0.414999);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
- new c = GetFreeFishCrateSlot();
- FishingCrates[c][CrateID] = c;
- FishingCrates[c][CrateType] = 2;
- FishingCrates[c][CrateOwner] = SQLID[playerid];
- SendClientMessage(playerid, COLOR_WHITE, "You have purchased a medium fish crate. You must put this crate on a boat ASAP otherwise it will be deleted upon relogging.");
- GivePlayerCash(playerid, -2500);
- }
- else if(strcmp("Large Fish Crate (500 slots) - $5,000", inputtext, true) == 0)
- {
- if(Cash[playerid] < 5000) return SysMsg(playerid, "You cannot afford this crate.");
- for(new c = 0; c < MAX_FISHCRATES; c++)
- {
- if(FishingCrates[c][CrateOwner] == SQLID[playerid]) return SysMsg(playerid, "You already own a fishing crate.");
- }
- new boatcount = 0;
- for(new v = 0, r = GetVehiclePoolSize(); v <= r; v++)
- {
- if(VehicleData[v][VehicleOwnerSQLID] == SQLID[playerid] && IsBoat(v))
- {
- boatcount ++;
- }
- }
- if(boatcount == 0) return SysMsg(playerid, "You must own a suitable boat to buy this.");
- new index = GetFreePlayerObjectIndex(playerid);
- if(index == -1) return SysMsg(playerid, "You do not have any free attached object slots.");
- SetPlayerAttachedObject(playerid, index, GetFishingCrateModelID(3), 1, -0.057999, 0.659000, 0.000000, 0.000000, 88.099960, -179.699905, 0.499000, 0.559000, 0.414999);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
- new c = GetFreeFishCrateSlot();
- FishingCrates[c][CrateID] = c;
- FishingCrates[c][CrateType] = 3;
- FishingCrates[c][CrateOwner] = SQLID[playerid];
- SendClientMessage(playerid, COLOR_WHITE, "You have purchased a large fish crate. You must put this crate on a boat ASAP otherwise it will be deleted upon relogging.");
- GivePlayerCash(playerid, -5000);
- }
- }
- return true;
- }
- Dialog:vModSelect(playerid, response, listitem, inputtext[])
- {
- if(!response) //rims
- {
- ShowModelSelectionMenu(playerid, "Add Wheels", MODEL_SELECTION_WHEELS, {1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1096, 1097, 1098}, 17, 0.0, 0.0, 90.0);
- return true;
- }
- new modname[50][32], v = GetPlayerVehicleID(playerid), mods[50], count = 0;
- for(new m = 1000; m < 1193; m++)
- {
- if(IsVehicleUpgradeCompatible(VehicleData[v][VehicleModel], m) && IsActualVehicleMod(m))
- {
- mods[count] = m;
- format(modname[count], 32, "%s", GetVehicleModName(m));
- count ++;
- }
- }
- if(count == 0) return SysMsg(playerid, "This vehicle does not support any bodywork modifications.");
- ShowModelSelectionMenu(playerid, "Add Modifications", MODEL_SELECTION_MODS, mods, count, 0.0, 0.0, 0.0);
- return true;
- }
- Dialog:vModRemove(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- new m = GetVehicleModTypeFromName(inputtext), v = GetPlayerVehicleID(playerid);
- if(ModQueue[playerid][m] != 0)
- {
- SendClientMessageF(playerid, COLOR_LIGHTBLUE, "You have removed the %s modification from your %s.", GetVehicleModName(ModQueue[playerid][m]), GetVehicleName(v));
- RemoveVehicleComponent(v, ModQueue[playerid][m]);
- ModQueue[playerid][m] = 0;
- if(VehicleData[v][VehicleMod][m] != 0) AddVehicleComponent(v, VehicleData[v][VehicleMod][m]);
- }
- else if(VehicleData[v][VehicleMod][m] != 0)
- {
- SendClientMessageF(playerid, COLOR_LIGHTBLUE, "You have removed the %s modification from your %s.", GetVehicleModName(VehicleData[v][VehicleMod][m]), GetVehicleName(v));
- RemoveVehicleComponent(v, VehicleData[v][VehicleMod][m]);
- VehicleData[v][VehicleMod][m] = 0;
- }
- else return SysMsg(playerid, "Error VMR1.");
- SavePlayerVehicles(playerid, 0);
- PlayerPlaySound(playerid,SOUND_CAR_MOD, 0.0, 0.0, 0.0);
- cmd_removemods(playerid);
- return true;
- }
- Dialog:CitizenReg1(playerid, response, listitem, inputtext[])
- {
- if(response == 0 || response == 1)
- {
- Dialog_Show(playerid,CitizenReg2,DIALOG_STYLE_INPUT,"RCRP - Citizen Registration - 1","Question 1: What day of the month were you born on? \n\nExample Answer: 24","Continue","");
- }
- return true;
- }
- Dialog:CitizenReg2(playerid, response, listitem, inputtext[])
- {
- if(response == 0 || response == 1)
- {
- if(!IsNumeric(inputtext))
- {
- Dialog_Show(playerid,CitizenReg2,DIALOG_STYLE_INPUT,"RCRP - Citizen Registration - 1","Question 1: What day of the month were you born on? \n\nExample Answer: 24\n\nINVALID","Continue","");
- return true;
- }
- if(strlen(inputtext) > 2 || strval(inputtext) < 1 || strval(inputtext) > 31)
- {
- Dialog_Show(playerid,CitizenReg2,DIALOG_STYLE_INPUT,"RCRP - Citizen Registration - 1","Question 1: What day of the month were you born on? \n\nExample Answer: 24\n\nINVALID","Continue","");
- return true;
- }
- MySQLUpdateInt(SQLID[playerid], "BirthDate", strval(inputtext), "players");
- Dialog_Show(playerid,CitizenReg3,DIALOG_STYLE_LIST,"RCRP - Citizen Registration - 2(Month)","January\nFebruary\nMarch\nApril\nMay\nJune\nJuly\nAugust\nSeptember\nOctober\nNovember\nDecember","Continue","");
- }
- return true;
- }
- Dialog:CitizenReg3(playerid, response, listitem, inputtext[])
- {
- if(response == 0 || response == 1)
- {
- new monthID = -1;
- monthID = listitem + 1;
- if(monthID == -1)
- {
- Dialog_Show(playerid,CitizenReg3,DIALOG_STYLE_LIST,"RCRP - Citizen Registration - 2(Month)","January\nFebruary\nMarch\nApril\nMay\nJune\nJuly\nAugust\nSeptember\nOctober\nNovember\nDecember","Continue","");
- return true;
- }
- MySQLUpdateInt(SQLID[playerid], "BirthMonth", monthID, "players");
- Dialog_Show(playerid,CitizenReg4,DIALOG_STYLE_INPUT,"RCRP - Citizen Registration - 3","What year were you born in? \n\nExample Answer: 1963","Continue","");
- }
- return true;
- }
- Dialog:CitizenReg4(playerid, response, listitem, inputtext[])
- {
- if(response == 0 || response == 1)
- {
- if(!IsNumeric(inputtext))
- {
- Dialog_Show(playerid,CitizenReg4,DIALOG_STYLE_INPUT,"RCRP - Citizen Registration - 3","What year were you born in? \n\nExample Answer: 1963","Continue","");
- return true;
- }
- if(strlen(inputtext) > 4)
- {
- Dialog_Show(playerid,CitizenReg4,DIALOG_STYLE_INPUT,"RCRP - Citizen Registration - 3","What year were you born in? \n\nExample Answer: 1963","Continue","");
- return true;
- }
- if(strval(inputtext) > gServerYear - 12 || strval(inputtext) < 1900)
- {
- Dialog_Show(playerid,CitizenReg4,DIALOG_STYLE_INPUT,"RCRP - Citizen Registration - 3","What year were you born in? (YOU MUST BE at least 16, YEAR 1900 IS THE MINIMUM) \n\nExample Answer: 1963","Continue","");
- return true;
- }
- MySQLUpdateInt(SQLID[playerid], "BirthYear", strval(inputtext), "players");
- NoobSpawnID[playerid] = 3;
- FilledForm[playerid] = 1;
- MySQLUpdateInt(SQLID[playerid], "FilledForm", FilledForm[playerid], "players");
- MySQLUpdateInt(SQLID[playerid], "NoobSpawnID", NoobSpawnID[playerid], "players");
- SetSpawnInfo(playerid,4,cPlayersSkin[playerid],1282.459960, 170.554199, 20.329582, 338.116455,0,0,0,0,0,0);
- SetPlayerVirtualWorldEx(playerid,0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "RCRP - Citizen Registration - Complete");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Thanks for completing the form.");
- UnlockAchievement(playerid,1);
- if(!CompletedTutorial{playerid})
- {
- SendClientMessage(playerid, COLOR_WHITE, "> You will now proceed to the tutorial.");
- ShowInfoText(playerid, "~w~The ~b~tutorial ~w~is now starting!", 2100);
- SetTimerEx("SetupTutorial", 4000, 0, "d", playerid);
- return true;
- }
- SpawnPlayer(playerid);
- }
- return true;
- }
- Dialog:BankMenu(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(strcmp("Deposit",inputtext,true) == 0)
- {
- if(Cash[playerid] <= 0)
- {
- SysMsg(playerid, "You do not have any money to deposit.");
- }
- else
- {
- new depositBody[128];
- format(depositBody,128,"{FFFFFF}Account: %s\nCurrent Balance: {3D9140}$%s{FFFFFF}\n\nPlease Enter The Amount To Deposit:",NameEx(playerid),format_cash(BankBalance[playerid]));
- Dialog_Show(playerid,BankDeposit,DIALOG_STYLE_INPUT,"Red County Banking - Deposit",depositBody,"OK", "");
- }
- UsingATM{playerid} = false;
- }
- else if(strcmp("Withdraw",inputtext,true) == 0)
- {
- if(!UsingATM{playerid}) format(gstr, sizeof(gstr),"{FFFFFF}Account: %s\nCurrent Balance: {3D9140}$%s{FFFFFF}\nWithdraw Limit: {3D9140}$%s{FFFFFF}\n\nPlease Enter The Amount To Withdraw:",NameEx(playerid),format_cash(BankBalance[playerid]),format_cash(BankBalance[playerid]));
- else format(gstr, sizeof(gstr),"{FFFFFF}Account: %s\nCurrent Balance: {3D9140}$%s{FFFFFF}\nWithdraw Limit: {3D9140}$50,000{FFFFFF}\n\nPlease Enter The Amount To Withdraw:",NameEx(playerid),format_cash(BankBalance[playerid]));
- Dialog_Show(playerid,BankWithdraw,DIALOG_STYLE_INPUT,"Red County Banking - Withdraw",gstr,"Enter","Cancel");
- }
- else if(strcmp("Transfer",inputtext,true) == 0)
- {
- gstr[0] = EOS;
- new count = 0;
- foreach(new i: Player)
- {
- if(Logged{i} && i != playerid)
- {
- strcat(gstr,GetName(i));
- strcat(gstr,"\n");
- count++;
- }
- }
- if(count > 0) Dialog_Show(playerid,BankTransfer1,DIALOG_STYLE_LIST,"Red County Banking - Transfer - (( Select Player To Receive ))",gstr,"Next","Cancel");
- else ShowMessage(playerid,"Red County Banking - Transfer","Sorry, There Is Nobody To Transfer Your Money To.", "OK");
- }
- else if(strcmp("Balance",inputtext,true) == 0)
- {
- format(sgstr, sizeof(sgstr),"{FFFFFF}Account: %s\n\nCurrent Balance: {3D9140}$%s",NameEx(playerid),format_cash(BankBalance[playerid]));
- ShowMessage(playerid,"Red County Banking - Balance",sgstr,"OK");
- UsingATM{playerid} = false;
- }
- else if(strcmp("Deposit ALL",inputtext,true) == 0)
- {
- if(Cash[playerid] < 1) return SysMsg(playerid, "You don't have any cash to deposit.");
- format(gstr, sizeof(gstr), "{FFFFFF}BANK STATEMENT - %s @ %s\nOld Balance: {EAEAAE}$%s{FFFFFF}\nDeposit: {EAEAAE}$%s{FFFFFF}\n\nNew Balance: {3D9140}$%s{FFFFFF}",NameEx(playerid),GetTimeString(),format_cash(BankBalance[playerid]),format_cash(Cash[playerid]),format_cash(BankBalance[playerid]+Cash[playerid]));
- BankBalance[playerid] += Cash[playerid];
- format(gstr, sizeof(gstr), "[%s] %s(%i) deposits all ($%i).", GetServerTimeString(), NameEx(playerid), playerid, Cash[playerid]);
- GivePlayerCash(playerid, -Cash[playerid]);
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- ShowMessage(playerid,"Red County Banking - Deposit Statement", gstr, "Ok");
- }
- else if(strcmp("Deposit HALF",inputtext,true) == 0)
- {
- if(Cash[playerid] < 2) return SysMsg(playerid, "You don't have any cash to deposit.");
- new deposit = Cash[playerid] / 2;
- format(gstr, sizeof(gstr), "{FFFFFF}BANK STATEMENT - %s @ %s\nOld Balance: {EAEAAE}$%s{FFFFFF}\nDeposit: {EAEAAE}$%s{FFFFFF}\n\nNew Balance: {3D9140}$%s{FFFFFF}",NameEx(playerid),GetTimeString(),format_cash(BankBalance[playerid]),format_cash(deposit),format_cash(BankBalance[playerid]+deposit));
- GivePlayerCash(playerid, -deposit);
- BankBalance[playerid] += deposit;
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- ShowMessage(playerid,"Red County Banking - Deposit Statement", gstr, "Ok");
- format(gstr, sizeof(gstr), "[%s] %s(%i) deposits half ($%i) to bank.", GetServerTimeString(), NameEx(playerid), playerid, deposit);
- }
- else if(strcmp("Withdraw ALL",inputtext,true) == 0)
- {
- if(BankBalance[playerid] < 1) return SysMsg(playerid, "You don't have any cash to withdraw.");
- if(UsingATM{playerid} && BankBalance[playerid] > 50000) return SysMsg(playerid, "The maximum you can withdraw from an ATM is $50,000.");
- format(gstr, sizeof(gstr), "{FFFFFF}BANK STATEMENT - %s @ %s\nOld Balance: {EAEAAE}$%s{FFFFFF}\nWithdraw: {EAEAAE}$%s{FFFFFF}\n\nNew Balance: {3D9140}$0{FFFFFF}",NameEx(playerid),GetTimeString(),format_cash(BankBalance[playerid]),format_cash(BankBalance[playerid]));
- GivePlayerCash(playerid, BankBalance[playerid]);
- format(gstr, sizeof(gstr), "[%s] %s(%i) withdraws all ($%i) from bank.", GetServerTimeString(), NameEx(playerid), playerid, BankBalance[playerid]);
- BankBalance[playerid] = 0;
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- ShowMessage(playerid,"Red County Banking - Withdraw Statement", gstr, "Ok");
- }
- else if(strcmp("Withdraw HALF",inputtext,true) == 0)
- {
- if(BankBalance[playerid] < 2) return SysMsg(playerid, "You don't have any cash to withdraw.");
- if(UsingATM{playerid} && BankBalance[playerid] > 50000) return SysMsg(playerid, "The maximum you can withdraw from an ATM is $50,000.");
- new withdraw = BankBalance[playerid] / 2;
- format(gstr, sizeof(gstr), "{FFFFFF}BANK STATEMENT - %s @ %s\nOld Balance: {EAEAAE}$%s{FFFFFF}\nWithdraw: {EAEAAE}$%s{FFFFFF}\n\nNew Balance: {3D9140}$%s{FFFFFF}",NameEx(playerid),GetTimeString(),format_cash(BankBalance[playerid]),format_cash(withdraw),format_cash(BankBalance[playerid]-withdraw));
- GivePlayerCash(playerid, withdraw);
- BankBalance[playerid] -= withdraw;
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- ShowMessage(playerid,"Red County Banking - Withdraw Statement", gstr, "Ok");
- format(gstr, sizeof(gstr), "[%s] %s(%i) withdraws half ($%i) from bank.", GetServerTimeString(), NameEx(playerid), playerid, withdraw);
- }
- }
- return true;
- }
- Dialog:BankWithdraw(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(isnull(inputtext) || strval(inputtext) < 1 || strval(inputtext) > BankBalance[playerid])
- {
- if(!UsingATM{playerid}) format(gstr, sizeof(gstr),"{FFFFFF}Account: %s\nCurrent Balance: {3D9140}$%s{FFFFFF}\nWithdraw Limit: {3D9140}$%s{FFFFFF}\n\nPlease Enter The Amount To Withdraw:",NameEx(playerid),format_cash(BankBalance[playerid]),format_cash(BankBalance[playerid]));
- else format(gstr, sizeof(gstr),"{FFFFFF}Account: %s\nCurrent Balance: {3D9140}$%s{FFFFFF}\nWithdraw Limit: {3D9140}$50,000{FFFFFF}\n\nPlease Enter The Amount To Withdraw:",NameEx(playerid),format_cash(BankBalance[playerid]));
- Dialog_Show(playerid,BankWithdraw,DIALOG_STYLE_INPUT,"Red County Banking - Withdraw",gstr,"Enter","Cancel");
- return true;
- }
- if(UsingATM{playerid} && strval(inputtext) > 50000)
- {
- format(gstr, sizeof(gstr),"{FFFFFF}Account: %s\nCurrent Balance: {3D9140}$%s{FFFFFF}\nWithdraw Limit: {FF4753}$50,000{FFFFFF}\n\nPlease Enter The Amount To Withdraw:",NameEx(playerid),format_cash(BankBalance[playerid]));
- Dialog_Show(playerid,BankWithdraw,DIALOG_STYLE_INPUT,"Red County Banking - Withdraw",gstr,"Enter","Cancel");
- return true;
- }
- if(UsingATM{playerid} && strval(inputtext) % 10 != 0)
- {
- format(gstr, sizeof(gstr),"{FFFFFF}Account: %s\nCurrent Balance: {3D9140}$%s{FFFFFF}\nWithdraw Limit: {3D9140}$50,000\n\n{FF4753}You may only withdraw in portions of $10\n\n{FFFFFF}Please Enter The Amount To Withdraw:",NameEx(playerid),format_cash(BankBalance[playerid]));
- Dialog_Show(playerid,BankWithdraw,DIALOG_STYLE_INPUT,"Red County Banking - Withdraw",gstr,"Enter","Cancel");
- return true;
- }
- format(gstr, sizeof(gstr),"{FFFFFF}BANK STATEMENT - %s @ %s\nOld Balance: {EAEAAE}$%s{FFFFFF}\nWithdraw: {EAEAAE}$%s{FFFFFF}\n\nNew Balance: {3D9140}$%s{FFFFFF}",NameEx(playerid),GetTimeString(),format_cash(BankBalance[playerid]),format_cash(strval(inputtext)),format_cash(BankBalance[playerid]-strval(inputtext)));
- GivePlayerCash(playerid, strval(inputtext));
- BankBalance[playerid] -= strval(inputtext);
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- UsingATM{playerid} = false;
- ShowMessage(playerid,"Red County Banking - Withdraw Statement",gstr, "Ok");
- format(gstr, sizeof(gstr), "[%s] %s(%i) withdraws $%i from bank. Old balance: %i.", GetServerTimeString(), NameEx(playerid), playerid, strval(inputtext), BankBalance[playerid] + strval(inputtext));
- }
- return true;
- }
- Dialog:BankDeposit(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(isnull(inputtext) || strval(inputtext) < 1 || strval(inputtext) > Cash[playerid])
- {
- new depositBody[200];
- format(depositBody,200,"{FFFFFF}Account: %s\nCurrent Balance: {3D9140}$%s{FFFFFF}\n\nPlease Enter The Amount To Deposit:",NameEx(playerid),format_cash(BankBalance[playerid]));
- Dialog_Show(playerid,BankDeposit,DIALOG_STYLE_INPUT,"Red County Banking - Deposit",depositBody,"OK", "");
- return true;
- }
- format(gstr, sizeof(gstr), "{FFFFFF}BANK STATEMENT - %s @ %s\nOld Balance: {EAEAAE}$%s{FFFFFF}\nDeposit: {EAEAAE}$%s{FFFFFF}\n\nNew Balance: {3D9140}$%s{FFFFFF}",NameEx(playerid),GetTimeString(),format_cash(BankBalance[playerid]),format_cash(strval(inputtext)),format_cash(BankBalance[playerid]+strval(inputtext)));
- BankBalance[playerid] += strval(inputtext);
- GivePlayerCash(playerid, -strval(inputtext));
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- ShowMessage(playerid,"Red County Banking - Deposit Statement",gstr, "Ok");
- format(gstr, sizeof(gstr), "[%s] %s(%i) deposits $%i to bank.", GetServerTimeString(), NameEx(playerid), playerid, strval(inputtext));
- }
- return true;
- }
- Dialog:BankTransfer1(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- new posID = GetPlayerID(playerid, inputtext);
- if(IsPlayerConnected(posID) && !IsPlayerNPC(posID) && Logged{posID})
- {
- TransferingMoneyTo[playerid] = posID;
- }
- else
- {
- format(gstr, sizeof(gstr),"Error While Processing Request.\n\nError Code: RC-TRFR(%i)",posID);
- ShowMessage(playerid,"Red County Banking - Error",gstr, "Ok");
- return true;
- }
- format(gstr, sizeof(gstr),"Please Now Enter The Amount You Wish To Transfer To %s(%i).\n\nYour Current Balance: $%i",NameEx(posID),posID,BankBalance[playerid]);
- Dialog_Show(playerid,BankTransfer2,DIALOG_STYLE_INPUT,"Red County Banking - Transfer",gstr,"Transfer","Cancel");
- }
- return true;
- }
- Dialog:BankTransfer2(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- new playa = TransferingMoneyTo[playerid];
- TransferingMoneyTo[playerid] = -1;
- if(!Logged{playa})
- {
- SysMsg(playerid, "That player is not logged in.");
- return true;
- }
- if(isnull(inputtext))
- {
- format(gstr, sizeof(gstr),"{FFFFFF}Please Now Enter The Amount You Wish To Transfer To %s(%i).\n\nYour Current Balance: {EAEAAE}$%i",NameEx(playa),playa,BankBalance[playerid]);
- Dialog_Show(playerid,BankTransfer2,DIALOG_STYLE_INPUT,"Red County Banking - Transfer",gstr,"Transfer","Cancel");
- return true;
- }
- if(strval(inputtext) < 1 || strval(inputtext) > 500000)
- {
- SysMsg(playerid,"Invalid amount of cash! (Must be between $1 and $500,000)");
- format(gstr, sizeof(gstr),"{FFFFFF}Please Now Enter The Amount You Wish To Transfer To %s(%i).\n\nYour Current Balance: {EAEAAE}$%i",NameEx(playa),playa,BankBalance[playerid]);
- Dialog_Show(playerid,BankTransfer2,DIALOG_STYLE_INPUT,"Red County Banking - Transfer",gstr,"Transfer","Cancel");
- return true;
- }
- if(strval(inputtext) > BankBalance[playerid])
- {
- SysMsg(playerid,"You don't have that much cash in the bank to transfer.");
- format(gstr, sizeof(gstr),"{FFFFFF}Please Now Enter The Amount You Wish To Transfer To %s(%i).\n\nYour Current Balance: {EAEAAE}$%i",NameEx(playa),playa,BankBalance[playerid]);
- Dialog_Show(playerid,BankTransfer2,DIALOG_STYLE_INPUT,"Red County Banking - Transfer",gstr,"Transfer","Cancel");
- return true;
- }
- format(gstr, sizeof(gstr),"{FFFFFF}BANK STATEMENT - %s @ %s\n\nOld Balance: {EAEAAE}$%i{FFFFFF}\nTransfered {EAEAAE}$%i{FFFFFF} To {EAEAAE}%s(%i){FFFFFF}\nNew Balance: {3D9140}$%i{FFFFFF}",NameEx(playerid),GetTimeString(),BankBalance[playerid],strval(inputtext),NameEx(playa),playa,BankBalance[playerid]-strval(inputtext));
- ShowMessage(playerid,"Red County Banking - Transfer Complete",gstr, "Ok");
- //--------------- Messages for receiver
- SendClientMessageF(playa, COLOR_GREEN, "[ BANK STATEMENT. %s @ %s ]",NameEx(playa),GetTimeString());
- SendClientMessageF(playa, COLOR_LIGHTGREEN, "{FFFFFF}Old Balance: {EAEAAE}$%i",BankBalance[playa]);
- SendClientMessageF(playa, COLOR_LIGHTGREEN, "{FFFFFF}%s(%i) Sent You {EAEAAE}$%i",NameEx(playerid),playerid,strval(inputtext));
- BankBalance[playa] += strval(inputtext);
- BankBalance[playerid] -= strval(inputtext);
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- MySQLUpdateInt(SQLID[playa], "Bank", BankBalance[playa], "players");
- SendClientMessageF(playa, COLOR_LIGHTGREEN, "{FFFFFF}New Balance: {3D9140}$%i",BankBalance[playa]);
- format(gstr, sizeof(gstr),"[%s] %s(%i) transfers $%i to %s(%i).", GetServerTimeString(), NameEx(playerid), playerid, strval(inputtext), NameEx(playa), playa);
- }
- return true;
- }
- Dialog:AchievementMenu(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- new largestr[3000];
- if(strcmp(inputtext,"View My Achievements",true) == 0)
- {
- new header[128], yn[9];
- for(new a = 1; a < MAX_ACHS; a++)
- {
- if(HasUnlockedAchievement[playerid][a] == 1)
- {
- format(yn,sizeof(yn),"Unlocked");
- format(largestr, sizeof(largestr),"%s\n%s - %s (%i Points)",largestr, yn, AchievementData[a][Name], AchievementData[a][PointValue]);
- }
- }
- format(header,128,"Achievements - %s - %i Points Total",NameEx(playerid),AchievementPoints[playerid]);
- Dialog_Show(playerid,AchievementList,DIALOG_STYLE_LIST,header,largestr,"Info","Back");
- return true;
- }
- if(strcmp(inputtext,"View Others Achievements",true) == 0)
- {
- new count = 0;
- foreach(new i: Player)
- {
- if(Logged{i} && i != playerid)
- {
- format(largestr, sizeof(largestr),"%s\n%s",largestr,GetName(i));
- count++;
- }
- }
- if(count > 0) Dialog_Show(playerid,AchievementSelectOther,DIALOG_STYLE_LIST,"Achievements - Select Player To Check",largestr,"OK", "");
- else ShowMessage(playerid,"Achievements","Sorry, There Is No One Available To Check.", "OK");
- return true;
- }
- if(strcmp(inputtext,"My Summary",true) == 0)
- {
- new count_Locked = 0, count_Unlocked = 0, count_TotalPoints = 0, count_Total = 0;
- for(new a = 1; a < MAX_ACHS; a++)
- {
- if(HasUnlockedAchievement[playerid][a] == 1) count_Unlocked++;
- else count_Locked++;
- count_Total ++;
- count_TotalPoints += AchievementData[a][PointValue];
- }
- format(largestr, sizeof(largestr), "Achievement Summary For %s\n\nTotal Unlocked: %i\nTotal Locked: %i\nTotal: %i / %i\nPoints: %i / %i",NameEx(playerid),count_Unlocked,count_Locked,count_Unlocked,count_Total,AchievementPoints[playerid],count_TotalPoints);
- Dialog_Show(playerid,AchievementSummary,DIALOG_STYLE_MSGBOX,"My Achievement Summary",largestr,"Back","Close");
- }
- }
- return true;
- }
- Dialog:AchievementList(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- new a = listitem + 1, yn[26], largestr[3000];
- if(HasUnlockedAchievement[playerid][a] == 1) format(yn,sizeof(yn),"{00D13B}Unlocked{FFFFFF}");
- else format(yn,sizeof(yn),"{FF3C2E}Locked{FFFFFF}");
- format(largestr, sizeof(largestr),"Name: %s\nInfo: %s\nPoints: %i\n\n%s",AchievementData[a][Name],AchievementData[a][Info],AchievementData[a][PointValue],yn);
- Dialog_Show(playerid,AchievementDetails,DIALOG_STYLE_MSGBOX,"Achievement Details",largestr, "Back", "Close");
- }
- else
- {
- Dialog_Show(playerid,AchievementMenu,DIALOG_STYLE_LIST,"Achievements","View My Achievements\nView Others Achievements\nMy Summary","Go","Close");
- }
- return true;
- }
- Dialog:AchievementDetails(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- new header[128], yn[9], largestr[3000];
- for(new a = 1; a < MAX_ACHS; a++)
- {
- if(HasUnlockedAchievement[playerid][a] == 1) format(yn,sizeof(yn),"Unlocked");
- else format(yn,sizeof(yn),"Locked");
- format(largestr,sizeof(largestr),"%s\n%s - %s (%i Points)",largestr, yn, AchievementData[a][Name], AchievementData[a][PointValue]);
- }
- format(header,128,"Achievements - %s - %i Points Total",NameEx(playerid),AchievementPoints[playerid]);
- Dialog_Show(playerid,AchievementList,DIALOG_STYLE_LIST,header,largestr,"Info","Back");
- }
- return true;
- }
- Dialog:AchievementSelectOther(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- new PID = GetPlayerID(playerid, inputtext), header[128], yn[9], largestr[3000];
- for(new a = 1; a < MAX_ACHS; a++)
- {
- if(HasUnlockedAchievement[PID][a] == 1) format(yn,sizeof(yn),"Unlocked");
- else format(yn,sizeof(yn),"Locked}");
- format(largestr, sizeof(largestr),"%s\n%s - %s (%i Points)",largestr, yn, AchievementData[a][Name], AchievementData[a][PointValue]);
- }
- format(header,128,"Achievements - %s - %i Points Total",NameEx(PID),AchievementPoints[PID]);
- Dialog_Show(playerid,AchievementViewOther,DIALOG_STYLE_LIST,header,largestr,"Back","Close");
- }
- return true;
- }
- Dialog:AchievementViewOther(playerid, response, listitem, inputtext[])
- {
- if(response) Dialog_Show(playerid,AchievementMenu,DIALOG_STYLE_LIST,"Achievements","View My Achievements\nView Others Achievements\nMy Summary","Go","Close");
- return true;
- }
- Dialog:AchievementSummary(playerid, response, listitem, inputtext[])
- {
- if(response) Dialog_Show(playerid,AchievementMenu,DIALOG_STYLE_LIST,"Achievements","View My Achievements\nView Others Achievements\nMy Summary","Go","Close");
- return true;
- }
- Dialog:FishSell(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- new tmpVal;
- if(strcmp("Sell All", inputtext, false) == 0)
- {
- new totalsell = 0;
- for(new f = 0; f < 5; f++)
- {
- if(FishWeight[playerid][f] > 0)
- {
- tmpVal = 3 * FishWeight[playerid][f];
- totalsell += tmpVal;
- format(gstr, sizeof(gstr),"You have received {4BB74C}$%i{FFFFFF} for selling the {4BB74C}%iLb %s{FFFFFF}.", tmpVal, FishWeight[playerid][f], FishName[playerid][f]);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- FishWeight[playerid][f] = -1;
- FishName[playerid][f][0] = EOS;
- GivePlayerCash(playerid, tmpVal);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Fish%iName = '', Fish%iWeight = -1 WHERE id = %i", f + 1, f + 1, SQLID[playerid]);
- mysql_pquery(conn, mquery);
- }
- }
- format(gstr, sizeof(gstr),"Total: {4BB74C}$%i", totalsell);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- }
- else
- {
- new slot = -1;
- new cmpStr[128];
- for(new f = 0; f < 5; f++)
- {
- tmpVal = 3 * FishWeight[playerid][f];
- format(cmpStr,128,"%s - %iLbs - Worth $%i",FishName[playerid][f], FishWeight[playerid][f], tmpVal);
- if(strcmp(cmpStr,inputtext,true) == 0)
- {
- slot = f;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Fish%iName = '', Fish%iWeight = -1 WHERE id = %i", f + 1, f + 1, SQLID[playerid]);
- mysql_pquery(conn, mquery);
- break;
- }
- }
- new fishValue = 3 * FishWeight[playerid][slot];
- format(gstr, sizeof(gstr),"You Have Received $%i For Selling The %iLb %s.",fishValue,FishWeight[playerid][slot],FishName[playerid][slot]);
- ShowMessage(playerid,"Sold Fish",gstr,"OK");
- FishWeight[playerid][slot] = -1;
- FishName[playerid][slot][0] = EOS;
- GivePlayerCash(playerid, fishValue);
- }
- }
- return true;
- }
- Dialog:HolsterBone(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- DeletePVar(playerid, "isHolstered");
- DeletePVar(playerid, "isHolster");
- return true;
- }
- if(response)
- {
- new b = listitem, a = GetFreeWeaponObjectIndex(playerid), id = GetPVarInt(playerid, "isHolster");
- for(new l; l < sizeof(HolsterTog); l++)
- {
- if(GetPlayerWeapon(playerid) == HolsterTog[l])
- {
- if(b == 0)
- {
- if(ToyInfo[playerid][id][tModelID] == dropObjectID[GetPlayerWeapon(playerid)])
- {
- if(IsHolsterTogged[playerid][GetWeaponSlot(GetPlayerWeapon(playerid))] == 1)
- {
- IsHolsterTogged[playerid][GetWeaponSlot(GetPlayerWeapon(playerid))] = 0;
- ToyInfo[playerid][id][tOptional] = 0;
- SendClientMessageF(playerid, COLOR_YELLOW, "This %s will now be visibly holstered.", WeaponNames[GetPlayerWeapon(playerid)]);
- SavePlayerToy(playerid, id);
- DeletePVar(playerid, "isHolstered");
- DeletePVar(playerid, "isHolster");
- return true;
- }
- else if(IsHolsterTogged[playerid][GetWeaponSlot(GetPlayerWeapon(playerid))] == 0)
- {
- IsHolsterTogged[playerid][GetWeaponSlot(GetPlayerWeapon(playerid))] = 1;
- ToyInfo[playerid][id][tOptional] = 1;
- SendClientMessageF(playerid, COLOR_YELLOW, "This %s will now be hidden from holstering.", WeaponNames[GetPlayerWeapon(playerid)]);
- SavePlayerToy(playerid, id);
- DeletePVar(playerid, "isHolstered");
- DeletePVar(playerid, "isHolster");
- return true;
- }
- }
- }
- }
- }
- if(GetPVarType(playerid, "isHolstered") == 0) b = listitem + 1;
- DeletePVar(playerid, "isHolstered");
- DeletePVar(playerid, "isHolster");
- for(new ao; ao < 10; ao++)
- {
- if(AttachedObjects[playerid][ao][aoModelID] == dropObjectID[GetPlayerWeapon(playerid)])
- {
- RemovePlayerAttachedObject(playerid, ao);
- break;
- }
- }
- IsHolstered[playerid][GetWeaponSlot(GetPlayerWeapon(playerid))] = 0;
- IsEditingHolster[playerid] = 1;
- if(ToyInfo[playerid][id][tBone] == b) SetPlayerAttachedObject(playerid, a, dropObjectID[GetPlayerWeapon(playerid)], b, ToyInfo[playerid][id][tOffset][0], ToyInfo[playerid][id][tOffset][1], ToyInfo[playerid][id][tOffset][2], ToyInfo[playerid][id][tRot][0], ToyInfo[playerid][id][tRot][1], ToyInfo[playerid][id][tRot][2],
- ToyInfo[playerid][id][tScale][0], ToyInfo[playerid][id][tScale][1], ToyInfo[playerid][id][tScale][2]);
- else SetPlayerAttachedObject(playerid, a, dropObjectID[GetPlayerWeapon(playerid)], b, 0.0, 0.0, 0.0, ToyInfo[playerid][id][tRot][0], ToyInfo[playerid][id][tRot][1], ToyInfo[playerid][id][tRot][2], ToyInfo[playerid][id][tScale][0], ToyInfo[playerid][id][tScale][1], ToyInfo[playerid][id][tScale][2]);
- SetPlayerArmedWeapon(playerid, 0);
- EditingAttachedObject[playerid] = 1;
- EditAttachedObject(playerid, a);
- ToyBeingEdited[playerid] = id;
- }
- return true;
- }
- Dialog:DMVMain(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- gstr[0] = EOS;
- if(listitem == 0) //"General Car License [GVL-1]"
- {
- strcat(gstr, inputtext);
- strcat(gstr, "\n\n");
- if(Licenses[playerid][LICENSE_CAR] == 1) strcat(gstr, "PASSED - You have this license\n\n");
- else strcat(gstr, "NOT PASSED - You have not obtained this license yet\n\n");
- strcat(gstr, "TEST DETAILS\n");
- strcat(gstr, "Fee: $100\n");
- strcat(gstr, "Type: Evaluation of your driving\n");
- strcat(gstr, "Vehicle: DMV Admiral\n");
- strcat(gstr, "Pass Criteria: No damage, meet required time, match speed limits\n");
- strcat(gstr, "Fail Criteria: Vehicle damage, complete to late/quick, speeding, exit car\n\n");
- strcat(gstr, "This license allows you to drive regular 1/2/4 door vehicles of average size.\n\n");
- strcat(gstr, "To start this test, click 'Take Test' below.\nYou will be charged the test fee.");
- }
- else if(listitem == 1) //"Large Vehicle License [GVL-2]"
- {
- strcat(gstr, inputtext);
- strcat(gstr, "\n\n");
- if(Licenses[playerid][LICENSE_LGV] == 1) strcat(gstr, "PASSED - You have this license\n\n");
- else strcat(gstr, "NOT PASSED - You have not obtained this license yet\n\n");
- strcat(gstr, "TEST DETAILS\n");
- strcat(gstr, "Fee: $3,000\n");
- strcat(gstr, "Type: Evaluation of your driving\n");
- strcat(gstr, "Vehicle: DMV Mule\n");
- strcat(gstr, "Pass Criteria: No damage, meet required time, match speed limits\n");
- strcat(gstr, "Fail Criteria: Vehicle damage, complete to late/quick, speeding, exit vehicle\n\n");
- strcat(gstr, "This license allows you to drive large industrial/commercial vehicles such as trucks and buses.\n\n");
- strcat(gstr, "To start this test, click 'Take Test' below.\nYou will be charged the test fee.");
- }
- else if(listitem == 2) //"Motorbike License [MB]"
- {
- strcat(gstr, inputtext);
- strcat(gstr, "\n\n");
- if(Licenses[playerid][LICENSE_BIKE] == 1) strcat(gstr, "PASSED - You have this license\n\n");
- else strcat(gstr, "NOT PASSED - You have not obtained this license yet\n\n");
- strcat(gstr, "TEST DETAILS\n");
- strcat(gstr, "Fee: $2,500\n");
- strcat(gstr, "Type: Evaluation of your driving\n");
- strcat(gstr, "Vehicle: DMV Sanchez\n");
- strcat(gstr, "Pass Criteria: No damage, meet required time, match speed limits\n");
- strcat(gstr, "Fail Criteria: Fall off bike, vehicle damage, complete to late/quick, speeding\n\n");
- strcat(gstr, "This license allows you to drive all motorbikes.\n\n");
- strcat(gstr, "To start this test, click 'Take Test' below.\nYou will be charged the test fee.");
- }
- else if(listitem == 3) //"Boat License [B]"
- {
- strcat(gstr, inputtext);
- strcat(gstr, "\n\n");
- if(Licenses[playerid][LICENSE_BOAT] == 1) strcat(gstr, "PASSED - You have this license\n\n");
- else strcat(gstr, "NOT PASSED - You have not obtained this license yet\n\n");
- strcat(gstr, "TEST DETAILS\n");
- strcat(gstr, "Fee: $4,000\n");
- strcat(gstr, "Type: Evaluation of your driving\n");
- strcat(gstr, "Vehicle: DMV Coastguard\n");
- strcat(gstr, "Pass Criteria: No damage, meet required time, match speed limits\n");
- strcat(gstr, "Fail Criteria: Vehicle damage, complete to late/quick, speeding, exit vehicle\n\n");
- strcat(gstr, "This license allows you to drive all types of boats on the water.\n\n");
- strcat(gstr, "To start this test, click 'Take Test' below.\nYou will be charged the test fee.");
- }
- else if(listitem == 4) //"Helicopter License [A1]"
- {
- strcat(gstr, inputtext);
- strcat(gstr, "\n\n");
- if(Licenses[playerid][LICENSE_HELI] == 1) strcat(gstr, "PASSED - You have this license\n\n");
- else strcat(gstr, "NOT PASSED - You have not obtained this license yet\n\n");
- strcat(gstr, "TEST DETAILS\n");
- strcat(gstr, "Fee: $15,000\n");
- strcat(gstr, "Type: Evaluation of your driving\n");
- strcat(gstr, "Vehicle: DMV Sparrow\n");
- strcat(gstr, "Pass Criteria: No damage, meet required time\n");
- strcat(gstr, "Fail Criteria: Vehicle damage, complete to late/quick, exit vehicle\n\n");
- strcat(gstr, "This license allows you to fly all types of helicopters.\n\n");
- strcat(gstr, "To start this test, click 'Take Test' below.\nYou will be charged the test fee.");
- }
- else if(listitem == 5) //"Airplane License [A2]"
- {
- strcat(gstr, inputtext);
- strcat(gstr, "\n\n");
- if(Licenses[playerid][LICENSE_PLANE] == 1) strcat(gstr, "PASSED - You have this license\n\n");
- else strcat(gstr, "NOT PASSED - You have not obtained this license yet\n\n");
- strcat(gstr, "TEST DETAILS\n");
- strcat(gstr, "Fee: $25,000\n");
- strcat(gstr, "Type: Evaluation of your driving\n");
- strcat(gstr, "Vehicle: DMV Dodo\n");
- strcat(gstr, "Pass Criteria: No damage, meet required time\n");
- strcat(gstr, "Fail Criteria: Vehicle damage, complete to late/quick, exit vehicle\n\n");
- strcat(gstr, "This license allows you to fly all types of planes.\n\n");
- strcat(gstr, "To start this test, click 'Take Test' below.\nYou will be charged the test fee.");
- }
- DMV_ChosenTest[playerid] = listitem + 1;
- Dialog_Show(playerid, DMVInfo, DIALOG_STYLE_MSGBOX, "DMV - License Informaion", gstr, "Take Test", "Exit");
- return true;
- }
- else SetCameraBehindPlayer(playerid);
- return true;
- }
- Dialog:DMVInfo(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- gstr[0] = EOS;
- new name_o_test[24];
- new fee = 0;
- switch(DMV_ChosenTest[playerid])
- {
- case 1:
- {
- fee = 100;
- format(name_o_test, 24, "CAR");
- }
- case 2:
- {
- fee = 3000;
- format(name_o_test, 24, "LARGE VEHICLE");
- }
- case 3:
- {
- fee = 2500;
- format(name_o_test, 24, "MOTORBIKE");
- }
- case 4:
- {
- fee = 4000;
- format(name_o_test, 24, "BOAT");
- }
- case 5:
- {
- fee = 15000;
- format(name_o_test, 24, "HELICOPTER");
- }
- case 6:
- {
- fee = 25000;
- format(name_o_test, 24, "AIRPLANE");
- }
- }
- if(DMV_ChosenTest[playerid] >= 1 && Licenses[playerid][DMV_ChosenTest[playerid] - 1] == 1)
- {
- SysMsg(playerid, "You already have this license. You may not re-sit the test.");
- return true;
- }
- if(Cash[playerid] < fee)
- {
- SysMsg(playerid, "You don't have enough money to pay for this test.");
- return true;
- }
- format(gstr, sizeof(gstr), "You have chosen to begin the %s driving test.\nThis will cost $%s.\n\nAre you sure you want to pay this amount and start now?", name_o_test, format_cash(fee));
- Dialog_Show(playerid, DMV_TakeTest, DIALOG_STYLE_MSGBOX, "DMV - Confirm Test Start", gstr, "Yes", "No");
- return true;
- }
- else SetCameraBehindPlayer(playerid);
- return true;
- }
- Dialog:DMV_TakeTest(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- new name_o_test[24];
- new fee = 0;
- switch(DMV_ChosenTest[playerid])
- {
- case 1:
- {
- fee = 100;
- format(name_o_test, 24, "CAR");
- DMV_TestVehicle[playerid] = CreateVehicleEx(445, 1252.786376, 120.065780, 20.215339, 66.551605, 1, 1, -1);
- SetPlayerPos(playerid, 1251.018798, 135.651306, 19.948959);
- SetPlayerFacingAngle(playerid, 68.0);
- }
- case 2:
- {
- fee = 3000;
- format(name_o_test, 24, "LARGE VEHICLE");
- DMV_TestVehicle[playerid] = CreateVehicleEx(414, 1254.270996, 118.876358, 20.625650, 70.074890, 1, 1, -1);
- SetPlayerPos(playerid, 1251.018798, 135.651306, 19.948959);
- SetPlayerFacingAngle(playerid, 68.0);
- }
- case 3:
- {
- fee = 2500;
- format(name_o_test, 24, "MOTORBIKE");
- DMV_TestVehicle[playerid] = CreateVehicleEx(468, 1252.069458, 119.183479, 19.945499, 67.341445, 1, 1, -1);
- SetPlayerPos(playerid, 1251.018798, 135.651306, 19.948959);
- SetPlayerFacingAngle(playerid, 68.0);
- }
- case 4:
- {
- fee = 4000;
- format(name_o_test, 24, "BOAT");
- DMV_TestVehicle[playerid] = CreateVehicleEx(472, 2137.921142, -162.836959, -0.502234, 45.924163, 1, 1, -1);
- SetPlayerPos(playerid, 2168.153076, -127.928520, 1.651431);
- SetPlayerFacingAngle(playerid, 131.0);
- BoatTestObjects[playerid][0] = CreateDynamicObject(1243, 1885.80737305, -90.33319855, -2.750, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][1] = CreateDynamicObject(1243, 1890.07128906, -83.70085144, -2.750, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][2] = CreateDynamicObject(1243, 1894.39855957, -77.37152100, -3.0, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][3] = CreateDynamicObject(1243, 1898.79663086, -70.88615417, -3.0, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][4] = CreateDynamicObject(1243, 1903.29833984, -63.97266388, -3.250, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][5] = CreateDynamicObject(1243, 1907.30932617, -57.81337738, -3.250, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][6] = CreateDynamicObject(1243, 1883.31860352, -52.73433304, -2.75000191, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][7] = CreateDynamicObject(1243, 1889.96655273, -42.77386475, -2.250, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][8] = CreateDynamicObject(1243, 1886.47351074, -47.62805176, -2.25000191, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][9] = CreateDynamicObject(1243, 1857.80590820, -48.42462921, -3.0, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][10] = CreateDynamicObject(1243, 1855.48864746, -55.28154755, -2.750, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][11] = CreateDynamicObject(1243, 1854.40539551, -62.36398315, -3.250, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][12] = CreateDynamicObject(1243, 1853.57666016, -69.47421265, -2.500, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][13] = CreateDynamicObject(1243, 1855.50048828, -75.61514282, -2.250, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][14] = CreateDynamicObject(1243, 1856.73803711, -41.61993408, -2.0, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][15] = CreateDynamicObject(1243, 1641.60327148, -20.33261871, -2.500, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][16] = CreateDynamicObject(1243, 1638.70629883, -14.85173893, -2.250, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][17] = CreateDynamicObject(1243, 1636.46606445, -9.12693596, -2.750, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][18] = CreateDynamicObject(1243, 1624.28186035, -2.34179783, -2.500, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][19] = CreateDynamicObject(17068, 1423.66809082, -276.25048828, 0.30000001, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][20] = CreateDynamicObject(16502, 1439.33374023, -236.27458191, 0.0, 0.0, 0.0, 79.76000977, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][21] = CreateDynamicObject(17068, 1405.27600098, -277.40725708, 0.55000001, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][22] = CreateDynamicObject(901, 1439.41101074, -259.09072876, 0.0, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][23] = CreateDynamicObject(901, 1420.46374512, -238.42713928, 0.0, 0.0, 0.0, 99.70001221, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][24] = CreateDynamicObject(898, 1226.29492188, -162.89363098, 2.70765209, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][25] = CreateDynamicObject(898, 1261.53784180, -175.33505249, 2.39763546, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][26] = CreateDynamicObject(898, 1030.62036133, -121.04367065, 0.0, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][27] = CreateDynamicObject(898, 1041.07470703, -109.43426514, 0.0, 0.0, 0.0, 348.09008789, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][28] = CreateDynamicObject(898, 1023.01037598, -94.45648956, 0.0, 0.0, 0.0, 348.07983398, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][29] = CreateDynamicObject(898, 1053.57690430, -101.19123840, 0.0, 0.0, 0.0, 23.95019531, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][30] = CreateDynamicObject(898, 1039.01672363, -133.48587036, 0.0, 0.0, 0.0, 23.95019531, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][31] = CreateDynamicObject(898, 1034.01806641, -82.57163239, 0.0, 0.0, 0.0, 23.95019531, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][32] = CreateDynamicObject(2918, 745.31994629, -196.56101990, 0.47500005, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][33] = CreateDynamicObject(2918, 744.02392578, -204.00813293, 0.0, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][34] = CreateDynamicObject(2918, 707.17620850, -210.45657349, 0.0, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][35] = CreateDynamicObject(2918, 728.50909424, -197.45863342, 0.43500072, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][36] = CreateDynamicObject(2918, 727.64630127, -209.51922607, 0.40000007, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][37] = CreateDynamicObject(2918, 739.05737305, -212.24778748, 0.42500007, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][38] = CreateDynamicObject(2918, 719.82690430, -208.57377625, 0.250, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][39] = CreateDynamicObject(2918, 719.99731445, -198.38546753, 0.17500001, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][40] = CreateDynamicObject(2918, 715.38970947, -227.99397278, 0.02500000, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][41] = CreateDynamicObject(2918, 703.52618408, -218.43243408, 0.27500004, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][42] = CreateDynamicObject(7916, 477.91900635, -244.77207947, 3.62499523, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][43] = CreateDynamicObject(7916, 493.12487793, -258.55093384, 2.750, 0.0, 0.0, 180.58557129, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][44] = CreateDynamicObject(2780, 490.33026123, -251.44458008, -4.500, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][45] = CreateDynamicObject(1349, 287.23202515, -368.15283203, 0.07500000, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][46] = CreateDynamicObject(1349, 286.07791138, -372.26062012, 0.0, 57.56500244, 0.0, 69.78997803, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][47] = CreateDynamicObject(1349, 288.88714600, -372.18966675, 0.0, 57.56286621, 0.0, 300.17529297, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][48] = CreateDynamicObject(1327, 272.77404785, -365.59115601, 0.0, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][49] = CreateDynamicObject(1327, 276.47634888, -376.70654297, 0.25000003, 359.26013184, 268.70660400, 25.79663086, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][50] = CreateDynamicObject(1343, 274.56597900, -372.60769653, 0.0, 65.50500488, 0.0, 3.97000122, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][51] = CreateDynamicObject(1343, 274.36880493, -362.00018311, 0.0, 65.50048828, 0.0, 194.47631836, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][52] = CreateDynamicObject(1357, 273.94894409, -369.39480591, 0.15000001, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][53] = CreateDynamicObject(1369, 286.31759644, -375.93408203, 0.17500001, 20.27813721, 300.90490723, 252.61016846, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][54] = CreateDynamicObject(896, 267.08197021, -371.55551147, -5.46655464, 0.0, 0.0, 330.22521973, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][55] = CreateDynamicObject(901, 300.63421631, -361.25021362, 0.0, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][56] = CreateDynamicObject(1243, 271.72457886, -358.66265869, -3.0, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][57] = CreateDynamicObject(1243, 289.99057007, -355.22717285, -3.0, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][58] = CreateDynamicObject(10230, -70.65627289, -611.28198242, 6.09999418, 359.50012207, 354.80895996, 332.06982422, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][59] = CreateDynamicObject(9958, -147.66494751, -552.17181396, 6.07835340, 0.0, 0.0, 128.58117676, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][60] = CreateDynamicObject(899, -11.33603096, -639.07031250, 0.02725792, 0.0, 0.0, 0.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][61] = CreateDynamicObject(3865, 508.53210449, -263.71215820, 3.47808266, 0.0, 0.0, 182.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][62] = CreateDynamicObject(3865, 464.61035156, -237.51876831, 4.50499678, 0.0, 0.0, 7.99951172, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][63] = CreateDynamicObject(3865, 496.46328735, -265.97329712, 4.39863205, 0.0, 0.0, 169.24804688, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][64] = CreateDynamicObject(7950, 582.96691895, -260.65979004, 0.43186256, 0.0, 0.0, 14.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][65] = CreateDynamicObject(7950, 599.52636719, -200.23245239, 5.80400085, 0.0, 0.0, 183.99658203, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][66] = CreateDynamicObject(16086, 579.10565186, -227.65164185, 2.68785715, 0.0, 0.0, 12.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][67] = CreateDynamicObject(16267, 615.42755127, -168.23411560, -0.35909599, 0.0, 0.0, 274.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][68] = CreateDynamicObject(16087, 620.88848877, -172.03623962, -1.08087158, 0.0, 0.0, 274.0, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][69] = CreateDynamicObject(16087, 633.54608154, -295.24899292, 2.12499905, 0.0, 0.0, 273.99902344, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][70] = CreateDynamicObject(16087, 648.45819092, -303.61547852, -1.500, 0.0, 0.0, 273.99902344, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][71] = CreateDynamicObject(3865, 647.12109375, -237.41853333, 1.05812526, 0.0, 0.0, 183.24438477, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][72] = CreateDynamicObject(3865, 588.13085938, -251.66616821, 2.90702486, 0.0, 0.0, 191.24095154, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][73] = CreateDynamicObject(3865, 625.36895752, -202.14833069, 1.16347742, 0.0, 0.0, 191.23901367, 100 + playerid, 0, playerid, 300.0);
- BoatTestObjects[playerid][74] = CreateDynamicObject(3643, 595.06665039, -213.21408081, 10.79755783, 90.0, 180.0, 184.0, 100 + playerid, 0, playerid, 300.0);
- }
- case 5:
- {
- fee = 15000;
- format(name_o_test, 24, "HELICOPTER");
- DMV_TestVehicle[playerid] = CreateVehicleEx(469, 389.200347, 2535.742919, 16.552303, 180.0, 1, 1, -1);
- SetPlayerPos(playerid, 411.193298, 2533.709228, 19.148437);
- SetPlayerFacingAngle(playerid, 90.0);
- }
- case 6:
- {
- fee = 25000;
- format(name_o_test, 24, "AIRPLANE");
- DMV_TestVehicle[playerid] = CreateVehicleEx(593, 397.805145, 2523.618652, 16.953622, 90.0, 1, 1, -1);
- SetPlayerPos(playerid, 411.193298, 2533.709228, 19.148437);
- SetPlayerFacingAngle(playerid, 90.0);
- }
- }
- SetVehicleParamsForPlayer(DMV_TestVehicle[playerid], playerid, 1, 0);
- SetVehicleVirtualWorld(DMV_TestVehicle[playerid], 100 + playerid);
- Objective[DMV_TestVehicle[playerid]][playerid] = 1;
- AdminLocked{DMV_TestVehicle[playerid]} = false;
- Locked{DMV_TestVehicle[playerid]} = false;
- GivePlayerCash(playerid, -fee);
- DMV_Testing[playerid] = 10;
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorldEx(playerid, 100 + playerid);
- DMVCarForPlayer[DMV_TestVehicle[playerid]] = playerid;
- SetCameraBehindPlayer(playerid);
- format(gstr, sizeof(gstr), "You have started the %s driving test (-$%s). Please get into the vehicle shown.", name_o_test, format_cash(fee));
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- return true;
- }
- else SetCameraBehindPlayer(playerid);
- return true;
- }
- Dialog:ViewCars(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- SetPlayerVirtualWorldEx(playerid, (playerid + 1000));
- SetPlayerCameraPos(playerid, 638.8969, -493.5531, 16.9359);
- SetPlayerCameraLookAt(playerid, 642.8041, -502.7581, 16.0643);
- TogglePlayerControllable(playerid, 0);
- ViewingMicksCar[playerid] ++;
- if(ViewingMicksCar[playerid] >= sizeof(MicksVehicleData))
- {
- ViewingMicksCar[playerid] = 0;
- }
- format(sgstr, sizeof(sgstr), "Vehicle Name: %s\nPrice: $%s\n\nPress F6 And Type /Exit To Quit The Shop", GetVehicleNameEx(MicksVehicleData[ViewingMicksCar[playerid]][0]), format_cash(MicksVehicleData[ViewingMicksCar[playerid]][1]));
- DestroyVehicleEx(ViewingMicksCarID[playerid], "ViewingMicksCarID 0");
- ViewingMicksCarID[playerid] = CreateVehicleEx(MicksVehicleData[ViewingMicksCar[playerid]][0], 643.115173, -501.142303, 16.079319, 0.0, -1, -1, -1); //CarSelection
- SetVehicleVirtualWorld(ViewingMicksCarID[playerid], (playerid + 1000));
- Dialog_Show(playerid, ViewCars, DIALOG_STYLE_MSGBOX, "Dillimore Automotive Dealership", sgstr, "Next", "Buy");
- }
- else if(response == 0)
- {
- if(Cash[playerid] < MicksVehicleData[ViewingMicksCar[playerid]][1]) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money to buy this vehicle. Use /exit to return.");
- format(sgstr, sizeof(sgstr), "You are about to buy this vehicle.\nAre you sure?\n\nTo buy it press 'Yes' or press 'No' to cancel.\n\nVehicle Name: %s\nPrice: $%s", GetVehicleNameEx(MicksVehicleData[ViewingMicksCar[playerid]][0]), format_cash(MicksVehicleData[ViewingMicksCar[playerid]][1]));
- Dialog_Show(playerid, BuyCar, DIALOG_STYLE_MSGBOX, "Buy Vehicle - Are you sure?", sgstr, "Yes", "No");
- }
- return true;
- }
- Dialog:BuyCar(playerid, response, listitem, inputtext[])
- {
- if(response == 1) //Buy
- {
- new arrayPos = ViewingMicksCar[playerid];
- new vid = ViewingMicksCarID[playerid];
- ProcessVehicleShopPurchase(vid, MicksVehicleData[arrayPos][1], MicksVehicleData[arrayPos][0], playerid);
- ViewingMicksCar[playerid] = -1;
- ViewingMicksCarID[playerid] = -1;
- DeletePVar(playerid, "ViewingStock");
- }
- else if(response == 0) //Cancel
- {
- DestroyVehicleEx(ViewingMicksCarID[playerid], "ViewingMicksCarID 1");
- ViewingMicksCar[playerid] = -1;
- ViewingMicksCarID[playerid] = -1;
- SetPlayerVirtualWorldEx(playerid, 0);
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllable(playerid, 1);
- ShowMessage(playerid, "Dillimore Automotive Dealership", "You have exited Dillimore Automotive Dealership vehicle catalogue.\n\nThanks for shopping.", "Ok");
- DeletePVar(playerid, "ViewingStock");
- }
- return true;
- }
- Dialog:ViewBikes(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- SetPlayerVirtualWorldEx(playerid, (playerid + 1000));
- SetPlayerCameraPos(playerid, 704.0340, -529.0277, 16.9359);
- SetPlayerCameraLookAt(playerid, 701.2777, -519.4151, 16.9359);
- TogglePlayerControllable(playerid, 0);
- ViewingBuyBikes[playerid] ++;
- if(ViewingBuyBikes[playerid] >= sizeof(BuyMotorbikeData))
- {
- ViewingBuyBikes[playerid] = 0;
- }
- format(sgstr, sizeof(sgstr), "Vehicle Name: %s\nPrice: $%s\n\nPress F6 And Type /Exit To Quit The Shop", GetVehicleNameEx(BuyMotorbikeData[ViewingBuyBikes[playerid]][0]), format_cash(BuyMotorbikeData[ViewingBuyBikes[playerid]][1]));
- DestroyVehicleEx(ViewingBikeID[playerid], "ViewingBikeID[playerid] 0");
- ViewingBikeID[playerid] = CreateVehicle(BuyMotorbikeData[ViewingBuyBikes[playerid]][0], 701.821472, -522.654357, 15.876281, 117.476898, -1, -1, -1); //CarSelection
- SetVehicleVirtualWorld(ViewingBikeID[playerid], (playerid + 1000));
- Dialog_Show(playerid, ViewBikes, DIALOG_STYLE_MSGBOX, "Motorbike Dealership", sgstr, "Next", "Buy");
- }
- else if(response == 0)
- {
- if(Cash[playerid] < BuyMotorbikeData[ViewingBuyBikes[playerid]][1]) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money to buy this vehicle. Use /exit to return.");
- format(sgstr, sizeof(sgstr), "You are about to buy this vehicle.\nAre you sure?\n\nTo buy it press 'Yes' or press 'No' to cancel.\n\nVehicle Name: %s\nPrice: $%s", GetVehicleNameEx(BuyMotorbikeData[ViewingBuyBikes[playerid]][0]), format_cash(BuyMotorbikeData[ViewingBuyBikes[playerid]][1]));
- Dialog_Show(playerid, BuyBike, DIALOG_STYLE_MSGBOX, "Buy Vehicle - Are you sure?", sgstr, "Yes", "No");
- }
- return true;
- }
- Dialog:ViewBoats(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- SetPlayerVirtualWorldEx(playerid, (playerid + 1000));
- SetPlayerCameraPos(playerid, -2184.2893,2434.2036,13.8967);
- SetPlayerCameraLookAt(playerid, -2207.0972, 2424.8665, 0.1369);
- TogglePlayerControllable(playerid, 0);
- ViewingBuyBoats[playerid] ++;
- if(ViewingBuyBoats[playerid] >= sizeof(BuyBoatData)) ViewingBuyBoats[playerid] = 0;
- format(sgstr, sizeof(sgstr), "Vehicle Name: %s\nPrice: $%s\n\nPress F6 and type /exit to leave the shop", GetVehicleNameEx(BuyBoatData[ViewingBuyBoats[playerid]][0]), format_cash(BuyBoatData[ViewingBuyBoats[playerid]][1]));
- DestroyVehicleEx(ViewingBoatID[playerid], "ViewingboatID[playerid] 0");
- ViewingBoatID[playerid] = CreateVehicle(BuyBoatData[ViewingBuyBoats[playerid]][0], -2207.0972, 2424.8665, 0.1369, 44.3222, -1, -1, -1); //CarSelection
- SetVehicleVirtualWorld(ViewingBoatID[playerid], (playerid + 1000));
- Dialog_Show(playerid, ViewBoats, DIALOG_STYLE_MSGBOX, "Boat Dealership", sgstr, "Next", "Buy");
- }
- else if(response == 0)
- {
- if(Cash[playerid] < BuyBoatData[ViewingBuyBoats[playerid]][1]) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money to buy this vehicle. Use /exit to return.");
- format(sgstr, sizeof(sgstr), "You are about to buy this vehicle.\nAre you sure?\n\nTo buy it press 'Yes' or press 'No' to cancel.\n\nVehicle Name: %s\nPrice: $%s", GetVehicleNameEx(BuyBoatData[ViewingBuyBoats[playerid]][0]), format_cash(BuyBoatData[ViewingBuyBoats[playerid]][1]));
- Dialog_Show(playerid, BuyBoat, DIALOG_STYLE_MSGBOX, "Buy Vehicle - Are you sure?", sgstr, "Yes", "No");
- }
- return true;
- }
- Dialog:BuyBike(playerid, response, listitem, inputtext[])
- {
- if(response == 1) //Buy
- {
- new arrayPos = ViewingBuyBikes[playerid];
- new vid = ViewingBikeID[playerid];
- ProcessVehicleShopPurchase(vid, BuyMotorbikeData[arrayPos][1], BuyMotorbikeData[arrayPos][0], playerid);
- ViewingBuyBikes[playerid] = -1;
- ViewingBikeID[playerid] = -1;
- DeletePVar(playerid, "ViewingStock");
- }
- else if(response == 0) //Cancel
- {
- DestroyVehicleEx(ViewingBikeID[playerid], "ViewingBikeID[playerid] 1");
- ViewingBuyBikes[playerid] = -1;
- ViewingBikeID[playerid] = -1;
- SetPlayerVirtualWorldEx(playerid, 0);
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllable(playerid, 1);
- ShowMessage(playerid, "Motorbike Dealership", "You have exited the Dealership catalogue.\n\nThanks for shopping.", "Ok");
- DeletePVar(playerid, "ViewingStock");
- }
- return true;
- }
- Dialog:BuyBoat(playerid, response, listitem, inputtext[])
- {
- if(response == 1) //Buy
- {
- new arrayPos = ViewingBuyBoats[playerid];
- new vid = ViewingBoatID[playerid];
- ProcessVehicleShopPurchase(vid, BuyBoatData[arrayPos][1], BuyBoatData[arrayPos][0], playerid);
- ViewingBuyBoats[playerid] = -1;
- ViewingBoatID[playerid] = -1;
- DeletePVar(playerid, "ViewingStock");
- }
- else if(response == 0) //Cancel
- {
- DestroyVehicleEx(ViewingBoatID[playerid], "ViewingboatID[playerid] 1");
- ViewingBuyBoats[playerid] = -1;
- ViewingBoatID[playerid] = -1;
- SetPlayerVirtualWorldEx(playerid, 0);
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllable(playerid, 1);
- ShowMessage(playerid, "Boat Dealership", "You have exited the Dealership catalogue.\n\nThanks for shopping.", "Ok");
- DeletePVar(playerid, "ViewingStock");
- }
- return true;
- }
- Dialog:BuyDV3(playerid, response, listitem, inputtext[])
- {
- if(response == 1) //Buy
- {
- new arrayPos = ViewingBuyDV3[playerid];
- new vid = ViewingDV3ID[playerid];
- ProcessVehicleShopPurchase(vid, dvLevel3[arrayPos][1], dvLevel3[arrayPos][0], playerid);
- ViewingBuyDV3[playerid] = -1;
- ViewingDV3ID[playerid] = -1;
- DeletePVar(playerid, "ViewingStock");
- } else if(response == 0) { //Cancel
- DestroyVehicleEx(ViewingDV3ID[playerid], "ViewingDV3ID[playerid] 1");
- ViewingBuyDV3[playerid] = -1;
- ViewingDV3ID[playerid] = -1;
- SetPlayerVirtualWorldEx(playerid, 0);
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllable(playerid, 1);
- ShowMessage(playerid, "Donatio dealershipn", "You left the dealership catalog.\n\nThank you for buying.", "Ok");
- DeletePVar(playerid, "ViewingStock");
- }
- return true;
- }
- Dialog:BuyDV4(playerid, response, listitem, inputtext[])
- {
- if(response == 1) //Buy
- {
- new arrayPos = ViewingBuyDV4[playerid];
- new vid = ViewingDV4ID[playerid];
- ProcessVehicleShopPurchase(vid, dvLevel4[arrayPos][1], dvLevel4[arrayPos][0], playerid);
- ViewingBuyDV4[playerid] = -1;
- ViewingDV4ID[playerid] = -1;
- DeletePVar(playerid, "ViewingStock");
- } else if(response == 0) { //Cancel
- DestroyVehicleEx(ViewingDV4ID[playerid], "ViewingDV4ID[playerid] 1");
- ViewingBuyDV4[playerid] = -1;
- ViewingDV4ID[playerid] = -1;
- SetPlayerVirtualWorldEx(playerid, 0);
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllable(playerid, 1);
- ShowMessage(playerid, "Donatio dealershipn", "You left the dealership catalog.\n\nThank you for buying.", "Ok");
- DeletePVar(playerid, "ViewingStock");
- }
- return true;
- }
- Dialog:StockView(playerid, response, listitem, inputtext[])
- {
- if(!response) return DeletePVar(playerid, "ViewingStock");
- else
- {
- if(GetPlayerOwnedVehicleCount(playerid) >= MAX_VEH_PER_PLAYER)
- {
- DeletePVar(playerid, "ViewingStock");
- return SysMsg(playerid, "You cannot buy any more vehicles.");
- }
- new x = listitem;
- if(GetPVarInt(playerid, "ViewingStock") == 1) //cars
- {
- if(Cash[playerid] < MicksVehicleData[x][1]) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money to buy this vehicle.");
- ViewingMicksCar[playerid] = x;
- ViewingMicksCarID[playerid] = CreateVehicle(MicksVehicleData[x][0], 643.115173, -501.142303, 16.079319, 0.0, -1, -1, -1);
- format(sgstr, sizeof(sgstr), "You are about to buy this vehicle.\nAre you sure?\n\nTo buy it press 'Yes' or press 'No' to cancel.\n\nVehicle Name: %s\nPrice: $%s", GetVehicleNameEx(MicksVehicleData[x][0]), format_cash(MicksVehicleData[x][1]));
- Dialog_Show(playerid, BuyCar, DIALOG_STYLE_MSGBOX, "Buy Vehicle - Are you sure?", sgstr, "Yes", "No");
- }
- else if(GetPVarInt(playerid, "ViewingStock") == 2) //bikes
- {
- if(Cash[playerid] < BuyMotorbikeData[x][1]) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money to buy this vehicle.");
- ViewingBuyBikes[playerid] = x;
- ViewingBikeID[playerid] = CreateVehicle(BuyMotorbikeData[x][0], 701.821472, -522.654357, 15.876281, 117.476898, -1, -1, -1);
- format(sgstr, sizeof(sgstr), "You are about to buy this vehicle.\nAre you sure?\n\nTo buy it press 'Yes' or press 'No' to cancel.\n\nVehicle Name: %s\nPrice: $%s", GetVehicleNameEx(BuyMotorbikeData[x][0]), format_cash(BuyMotorbikeData[x][1]));
- Dialog_Show(playerid, BuyBike, DIALOG_STYLE_MSGBOX, "Buy Vehicle - Are you sure?", sgstr, "Yes", "No");
- }
- else if(GetPVarInt(playerid, "ViewingStock") == 3) //boats
- {
- if(Cash[playerid] < BuyBoatData[x][1]) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money to buy this vehicle.");
- ViewingBuyBoats[playerid] = x;
- ViewingBoatID[playerid] = CreateVehicle(BuyBoatData[x][0], -2207.0972, 2424.8665, 0.1369, 44.3222, -1, -1, -1);
- format(sgstr, sizeof(sgstr), "You are about to buy this vehicle.\nAre you sure?\n\nTo buy it press 'Yes' or press 'No' to cancel.\n\nVehicle Name: %s\nPrice: $%s", GetVehicleNameEx(BuyBoatData[x][0]), format_cash(BuyBoatData[x][1]));
- Dialog_Show(playerid, BuyBoat, DIALOG_STYLE_MSGBOX, "Buy Vehicle - Are you sure?", sgstr, "Yes", "No");
- }
- else if(GetPVarInt(playerid, "ViewingStock") == 4) //donate level 3
- {
- if(Cash[playerid] < dvLevel3[x][1]) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money to buy this vehicle.");
- ViewingBuyDV3[playerid] = x;
- ViewingDV3ID[playerid] = CreateVehicle(dvLevel3[x][0], COORD_CONC_DONATE, 44.3222, -1, -1, -1);
- format(sgstr, sizeof(sgstr), "You are about to buy this vehicle.\nAre you sure?\n\nTo buy it press 'Yes' or press 'No' to cancel.\n\nVehicle Name: %s\nPrice: $%s", GetVehicleNameEx(dvLevel3[x][0]), format_cash(dvLevel3[x][1]));
- Dialog_Show(playerid, BuyDV3, DIALOG_STYLE_MSGBOX, "Buy Vehicle - Are you sure?", sgstr, "Yes", "No");
- }
- else if(GetPVarInt(playerid, "ViewingStock") == 5) //donate level 4
- {
- if(x < sizeof(dvLevel3)) {
- if(Cash[playerid] < dvLevel3[x][1]) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money to buy this vehicle.");
- ViewingBuyDV3[playerid] = x;
- ViewingDV3ID[playerid] = CreateVehicle(dvLevel3[x][0], COORD_CONC_DONATE, 44.3222, -1, -1, -1);
- format(sgstr, sizeof(sgstr), "You are about to buy this vehicle.\nAre you sure?\n\nTo buy it press 'Yes' or press 'No' to cancel.\n\nVehicle Name: %s\nPrice: $%s", GetVehicleNameEx(dvLevel3[x][0]), format_cash(dvLevel3[x][1]));
- Dialog_Show(playerid, BuyDV3, DIALOG_STYLE_MSGBOX, "Buy Vehicle - Are you sure?", sgstr, "Yes", "No");
- } else {
- x -= sizeof(dvLevel3);
- if(Cash[playerid] < dvLevel4[x][1]) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money to buy this vehicle.");
- ViewingBuyDV4[playerid] = x;
- ViewingDV4ID[playerid] = CreateVehicle(dvLevel4[x][0], COORD_CONC_DONATE, 44.3222, -1, -1, -1);
- format(sgstr, sizeof(sgstr), "You are about to buy this vehicle.\nAre you sure?\n\nTo buy it press 'Yes' or press 'No' to cancel.\n\nVehicle Name: %s\nPrice: $%s", GetVehicleNameEx(dvLevel4[x][0]), format_cash(dvLevel3[x][1]));
- Dialog_Show(playerid, BuyDV4, DIALOG_STYLE_MSGBOX, "Buy Vehicle - Are you sure?", sgstr, "Yes", "No");
- }
- }
- }
- return true;
- }
- Dialog:VehicleRecover(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM vehicles WHERE NeedsRecovery = 1 AND OwnerSQLID = %i LIMIT 1 OFFSET %i", SQLID[playerid], listitem);
- mysql_pquery(conn, mquery, "LoadRecoveredVehicle", "i", playerid);
- }
- return true;
- }
- Dialog:GPSMenu(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(strcmp("Set Destination", inputtext, true) == 0)
- {
- new bigstr[3000];
- strcat(bigstr, "Type\tLocation\n");
- for(new x = 0; x < sizeof(GPSLocations); x++)
- {
- format(sgstr, sizeof(sgstr), "%s\t%s\n", GPSLocations[x][LocType], GPSLocations[x][LocName]);
- strcat(bigstr, sgstr);
- }
- Dialog_Show(playerid, GPSDestinations, DIALOG_STYLE_TABLIST_HEADERS, "GPS - Select Destination", bigstr, "Select", "Back");
- }
- if(strcmp("Remove Waypoint", inputtext, true) == 0)
- {
- HasGPSWaypoint[playerid] = 0;
- DisablePlayerRaceCheckpoint(playerid);
- SendSatNavText(playerid, "GPS voice says: Route cancelled.");
- }
- if(strcmp("Saved Place", inputtext, true) == 0)
- {
- Dialog_Show(playerid, GPSSave, DIALOG_STYLE_LIST, "GPS - Saved Destination", "Save Here\nGo to Saved Place", "Select", "Back");
- }
- }
- return true;
- }
- Dialog:GPSSave(playerid, response, listitem, inputtext[])
- {
- if(response == 0)
- {
- new MenuText[256];
- format(MenuText, 256, "Set Destination\nSaved Place");
- if(HasGPSWaypoint[playerid] == 1) strcat(MenuText, "\nRemove Waypoint");
- strcat(MenuText, "\nExit");
- Dialog_Show(playerid, GPSMenu, DIALOG_STYLE_LIST, "Global Positioning System Menu", MenuText, "Select", "Cancel");
- }
- else if(response == 1)
- {
- if(strcmp("Save Here", inputtext, true) == 0)
- {
- if(GetPlayerInterior(playerid) > 0) return SysMsg(playerid, "Can't save a destination here.");
- GetPlayerPos(playerid, SavedWaypoint[playerid][0], SavedWaypoint[playerid][1], SavedWaypoint[playerid][2]);
- mysql_pqueryf(conn, "UPDATE players SET SavedWaypointX=%f WHERE id=%i", SavedWaypoint[playerid][0], SQLID[playerid]);
- mysql_pqueryf(conn, "UPDATE players SET SavedWaypointY=%f WHERE id=%i", SavedWaypoint[playerid][1], SQLID[playerid]);
- mysql_pqueryf(conn, "UPDATE players SET SavedWaypointZ=%f WHERE id=%i", SavedWaypoint[playerid][2], SQLID[playerid]);
- format(gstr, sizeof(gstr), "[GPS] The destination has been saved at: %f, %f, %f", SavedWaypoint[playerid][0], SavedWaypoint[playerid][1], SavedWaypoint[playerid][2]);
- SendClientMessage(playerid, COLOR_ORANGE, gstr);
- SendSatNavText(playerid, "GPS voice says: Waypoint has been saved.");
- }
- if(strcmp("Go to Saved Place", inputtext, true) == 0)
- {
- if(SavedWaypoint[playerid][0] == 0 && SavedWaypoint[playerid][1] == 0 && SavedWaypoint[playerid][2] == 0)
- {
- SysMsg(playerid, "GPS voice says: Error, invalid position file.");
- return true;
- }
- HasGPSWaypoint[playerid] = 1;
- SendClientMessage(playerid, COLOR_ORANGE, "Pocket GPS set to 'Saved Destination'.");
- SendSatNavText(playerid, "GPS voice says: Calculating route, please wait...");
- DisablePlayerRaceCheckpoint(playerid);
- SetPlayerRaceCheckpointEx(playerid, 2, SavedWaypoint[playerid][0], SavedWaypoint[playerid][1], SavedWaypoint[playerid][2], 0.0, 0.0, 0.0, 5.0);
- SendSatNavText(playerid, "GPS voice says: Route to 'Saved Destination' calculated, proceed to waypoint.");
- }
- }
- return true;
- }
- Dialog:GPSDestinations(playerid, response, listitem, inputtext[])
- {
- if(response == 0)
- {
- sgstr[0] = EOS;
- strcat(sgstr, "Set Destination\nSaved Place");
- if(HasGPSWaypoint[playerid] == 1) strcat(sgstr, "\nRemove Waypoint");
- strcat(sgstr, "\nExit");
- Dialog_Show(playerid, GPSMenu, DIALOG_STYLE_LIST, "Global Positioning System Menu", sgstr, "Select", "Cancel");
- }
- else if(response == 1)
- {
- if(HasGPSWaypoint[playerid] == 1) SendSatNavText(playerid, "GPS voice says: Previous route cancelled.");
- HasGPSWaypoint[playerid] = 1;
- DisablePlayerRaceCheckpoint(playerid);
- format(sgstr, sizeof(sgstr), "Pocket GPS set to '%s'.", GPSLocations[listitem][LocName]);
- SendClientMessage(playerid, COLOR_ORANGE, sgstr);
- SendSatNavText(playerid, "GPS voice says: Calculating route, please wait...");
- format(sgstr, sizeof(sgstr), "GPS voice says: Route to '%s' calculated, proceed to waypoint.", GPSLocations[listitem][LocName]);
- SendSatNavText(playerid, sgstr);
- SetPlayerRaceCheckpointEx(playerid, 2, GPSLocations[listitem][LocX], GPSLocations[listitem][LocY], GPSLocations[listitem][LocZ], 0.0, 0.0, 0.0, 5.0);
- }
- return true;
- }
- Dialog:FuelType(playerid, response, listitem, inputtext[])
- {
- if(pRefilling[playerid] == 3)
- {
- new vid = GetNearestVehicle(playerid);
- new fuelstation = -1;
- for(new i = 0; i < MAX_FUEL_STATIONS; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 50.0, FuelStations[i][SignX], FuelStations[i][SignY], FuelStations[i][SignZ]))
- {
- fuelstation = i;
- break;
- }
- }
- if(response)
- {
- if(GetPVarInt(playerid, "fillType") == 1)
- {
- pRefilling[playerid] = 4;
- FuelFillingTimer[playerid] = SetTimerEx("Refilling", 1000, 0, "ddddd", playerid, vid, FUEL_GASOLINA, fuelstation, 0);
- ShowInfoText(playerid, "~g~Refilling~n~ ~w~Please Wait.", 1000);
- DeletePVar(playerid, "fillType");
- return true;
- }
- else if(GetPVarInt(playerid, "fillType") == 3)
- {
- if(Inventory[playerid][FuelCan][1] != FUEL_DIESEL)
- {
- ShowInfoText(playerid, "~g~Refilling~n~ ~w~Please Wait.", 1000);
- Inventory[playerid][FuelCan][1] = FUEL_GASOLINA;
- pRefilling[playerid] = 4;
- DeletePVar(playerid, "fillType");
- return true;
- }
- else return SendClientMessage(playerid, COLOR_GREY, "You can't mix fuel types, use /emptyfc to empty out the current fuel.");
- }
- }
- if(!response)
- {
- if(GetPVarInt(playerid, "fillType") == 1)
- {
- pRefilling[playerid] = 4;
- FuelFillingTimer[playerid] = SetTimerEx("Refilling", 1000, 0, "ddddd", playerid, vid, FUEL_DIESEL, fuelstation, 0);
- ShowInfoText(playerid, "~g~Refilling~n~ ~w~Please Wait.", 1000);
- DeletePVar(playerid, "fillType");
- return true;
- }
- else if(GetPVarInt(playerid, "fillType") == 3)
- {
- if(Inventory[playerid][FuelCan][1] != FUEL_GASOLINA)
- {
- ShowInfoText(playerid, "~g~Refilling~n~ ~w~Please Wait.", 1000);
- Inventory[playerid][FuelCan][1] = FUEL_DIESEL;
- pRefilling[playerid] = 4;
- DeletePVar(playerid, "fillType");
- return true;
- }
- else return SendClientMessage(playerid, COLOR_GREY, "You can't mix fuel types, use /emptyfc to empty out the current fuel.");
- }
- }
- }
- return true;
- }
- Dialog:WeaponTake(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- new Float:tX, Float:tY, Float:tZ;
- GetPlayerPos(TakeGunPlayer[playerid], tX, tY, tZ);
- if(!IsPlayerInRangeOfPoint(playerid, 5.5, tX, tY, tZ)) return SysMsg(playerid,"You must be close to the player.");
- new playa = TakeGunPlayer[playerid];
- new weaponid;
- new slot;
- if(strcmp("Take All Weapons", inputtext, true) == 0)
- {
- ResetPlayerWeaponsEx(playa);
- format(gstr, sizeof(gstr),"* %s takes some weapons from %s. *", NameRP(playerid), NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessageF(playa, COLOR_ORANGE, "%s has taken all of your weapons.", NameRP(playerid));
- SendClientMessageF(playerid, COLOR_ORANGE, "You took all of %s's weapons.", NameRP(playa));
- }
- else
- {
- for(new w = 0; w < sizeof(WeaponNames); w++)
- {
- if(strcmp(WeaponNames[w], inputtext, true) == 0)
- {
- weaponid = w;
- break;
- }
- }
- slot = GetWeaponSlot(weaponid);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET WeaponPossession = 0, Deleted = 1 WHERE id = %i AND TrunkID = -1 AND FCarID = -1 AND Gunrack = -1 AND Dropped = 0 AND HouseID = -1", WeaponData[playa][slot][WeaponID]);
- mysql_pquery(conn, mquery);
- ResetWeaponVariables(playa, 0, slot);
- SyncPlayerWeapons(playa);
- new wName[24];
- format(wName, sizeof(wName), WeaponNames[weaponid]);
- format(gstr, sizeof(gstr),"* %s takes a weapon from %s. *", NameRP(playerid), NameRP(playa));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessageF(playa, COLOR_ORANGE, "%s has taken your %s.", NameRP(playerid), wName);
- SendClientMessageF(playerid, COLOR_ORANGE, "You took %s's %s.", NameRP(playa), wName);
- }
- TakeGunPlayer[playerid] = -1;
- }
- return true;
- }
- Dialog:BoomboxMenu(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- switch(listitem)
- {
- case 0:
- {
- if(Boomboxes[playerid][BoomOID] == SQLID[playerid])
- {
- Dialog_Show(playerid, BoomboxPlay, DIALOG_STYLE_INPUT, "Boombox - Enter Stream Link", "{FFFFFF}Please enter the stream you wish to play:", "Play", "Close");
- }
- }
- case 1:
- {
- if(Boomboxes[playerid][BoomOID] == SQLID[playerid])
- {
- if(strlen(Boomboxes[playerid][BoomStation]) >= 10)
- {
- if(!Boomboxes[playerid][BoomIsPlaying])
- {
- foreach(new p: Player)
- {
- if(IsPlayerInRangeOfPoint(p, Boomboxes[playerid][BoomRange], Boomboxes[playerid][BoomPos][0], Boomboxes[playerid][BoomPos][1], Boomboxes[playerid][BoomPos][2]) && GetPlayerVirtualWorld(playerid) == 0)
- {
- if(!IsPlayerInAnyVehicle(p))
- {
- StopAudioStreamForPlayer(p);
- PlayAudioStreamForPlayerEx(p, Boomboxes[playerid][BoomStation], Boomboxes[playerid][BoomPos][0], Boomboxes[playerid][BoomPos][1], Boomboxes[playerid][BoomPos][2], Boomboxes[playerid][BoomRange], 1);
- Boomboxes[playerid][BoomIsPlaying] = true;
- ListeningBoom[p] = playerid;
- }
- }
- }
- }
- else SysMsg(playerid, "Boombox is already playing a stream.");
- }
- }
- }
- case 2:
- {
- if(Boomboxes[playerid][BoomOID] == SQLID[playerid])
- {
- foreach(new c: Player)
- {
- if(IsPlayerInRangeOfPoint(c, Boomboxes[playerid][BoomRange], Boomboxes[playerid][BoomPos][0], Boomboxes[playerid][BoomPos][1], Boomboxes[playerid][BoomPos][2]))
- {
- if(!IsPlayerInAnyVehicle(c))
- {
- StopAudioStreamForPlayer(c);
- ListeningBoom[c] = -1;
- }
- }
- }
- Boomboxes[playerid][BoomIsPlaying] = false;
- }
- else if(IsPlayerAdminLevelOK(playerid, 1))
- {
- foreach(new p: Player)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, Boomboxes[p][BoomPos][0], Boomboxes[p][BoomPos][1], Boomboxes[p][BoomPos][2]))
- {
- foreach(new c: Player)
- {
- if(IsPlayerInRangeOfPoint(c, Boomboxes[p][BoomRange], Boomboxes[p][BoomPos][0], Boomboxes[p][BoomPos][1], Boomboxes[p][BoomPos][2]))
- {
- if(!IsPlayerInAnyVehicle(p))
- {
- StopAudioStreamForPlayer(c);
- ListeningBoom[c] = -1;
- }
- }
- }
- Boomboxes[p][BoomIsPlaying] = false;
- }
- }
- SysMsg(playerid, "You have successfully stopped the boombox from playing.");
- }
- }
- case 3:
- {
- if(Boomboxes[playerid][BoomOID] == SQLID[playerid])
- {
- Inventory[playerid][Boombox] = Boomboxes[playerid][BoomType];
- if(Boomboxes[playerid][BoomIsPlaying])
- {
- foreach(new p: Player)
- {
- if(IsPlayerInRangeOfPoint(p, Boomboxes[playerid][BoomRange], Boomboxes[playerid][BoomPos][0], Boomboxes[playerid][BoomPos][1], Boomboxes[playerid][BoomPos][2]))
- {
- if(!IsPlayerInAnyVehicle(p))
- {
- StopAudioStreamForPlayer(p);
- ListeningBoom[p] = -1;
- }
- }
- }
- }
- Boomboxes[playerid][BoomPos][0] = 0.0;
- Boomboxes[playerid][BoomPos][1] = 0.0;
- Boomboxes[playerid][BoomPos][2] = 0.0;
- Boomboxes[playerid][BoomPos][3] = 0.0;
- DestroyDynamicObjectEx(Boomboxes[playerid][BoomObj], "Boomboxes[playerid][BoomObj]");
- Boomboxes[playerid][BoomObj] = INVALID_OBJECT_ID;
- Boomboxes[playerid][BoomRange] = 0;
- Boomboxes[playerid][BoomStation][0] = 0;
- Boomboxes[playerid][BoomOID] = -1;
- Boomboxes[playerid][BoomType] = -1;
- Boomboxes[playerid][BoomIsPlaying] = false;
- DestroyDynamicArea(Boomboxes[playerid][BoomArea]);
- OnePlayAnim(playerid,"BOMBER","BOM_Plant_Crouch_In", 4.0, 0, 0, 0, 0, 0);
- }
- }
- }
- return true;
- }
- Dialog:BoomboxPlay(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- foreach(new p: Player)
- {
- if(IsPlayerInRangeOfPoint(p, Boomboxes[playerid][BoomRange], Boomboxes[playerid][BoomPos][0], Boomboxes[playerid][BoomPos][1], Boomboxes[playerid][BoomPos][2]) && GetPlayerVirtualWorld(playerid) == 0)
- {
- if(!IsPlayerInAnyVehicle(p))
- {
- StopAudioStreamForPlayer(p);
- PlayAudioStreamForPlayerEx(p, inputtext, Boomboxes[playerid][BoomPos][0], Boomboxes[playerid][BoomPos][1], Boomboxes[playerid][BoomPos][2], Boomboxes[playerid][BoomRange], 1);
- ListeningBoom[p] = playerid;
- }
- }
- }
- format(Boomboxes[playerid][BoomStation], 256, inputtext);
- Boomboxes[playerid][BoomIsPlaying] = true;
- return true;
- }
- Dialog:BoomboxDelete(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- if(IsPlayerAdminLevelOK(playerid, 1))
- {
- if(GetPVarType(playerid, "bbID") == 1)
- {
- new tid = GetPVarInt(playerid, "bbID");
- if(Boomboxes[tid][BoomIsPlaying])
- {
- foreach(new p: Player)
- {
- if(!IsPlayerInAnyVehicle(p))
- {
- if(IsPlayerInRangeOfPoint(p, Boomboxes[tid][BoomRange], Boomboxes[tid][BoomPos][0], Boomboxes[tid][BoomPos][1], Boomboxes[tid][BoomPos][2]))
- {
- StopAudioStreamForPlayer(p);
- ListeningBoom[p] = -1;
- }
- }
- }
- }
- Inventory[tid][Boombox] = 0;
- MySQLUpdateInt(SQLID[tid], "Boombox", 0, "players");
- Boomboxes[tid][BoomPos][0] = 0.0;
- Boomboxes[tid][BoomPos][1] = 0.0;
- Boomboxes[tid][BoomPos][2] = 0.0;
- Boomboxes[tid][BoomPos][3] = 0.0;
- DestroyDynamicObjectEx(Boomboxes[tid][BoomObj], "Boomboxes[tid][BoomObj]");
- Boomboxes[tid][BoomObj] = INVALID_OBJECT_ID;
- Boomboxes[tid][BoomRange] = 0;
- Boomboxes[tid][BoomStation][0] = 0;
- Boomboxes[tid][BoomOID] = -1;
- Boomboxes[tid][BoomType] = -1;
- Boomboxes[tid][BoomIsPlaying] = false;
- DestroyDynamicArea(Boomboxes[tid][BoomArea]);
- DeletePVar(playerid, "bbID");
- DeletePVar(playerid, "bbBanC");
- }
- }
- return true;
- }
- Dialog:BoomboxBan(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- DeletePVar(playerid, "bbID");
- DeletePVar(playerid, "bbBanC");
- return true;
- }
- if(IsPlayerAdminLevelOK(playerid, 1))
- {
- if(GetPVarInt(playerid, "bbBanC") == 1)
- {
- new tid = GetPVarInt(playerid, "bbID");
- MySQLUpdateInt(SQLID[GetPVarInt(playerid, "bbID")], "BoomBanned", 1, "players");
- IsBoomBanned[tid] = 1;
- format(gstr, sizeof(gstr), "You have been permanently banned from using boomboxes by Admin %s [Reason: %s]", NameRP(playerid), inputtext);
- SendClientMessage(tid, COLOR_LIGHTRED, gstr);
- format(gstr, sizeof(gstr), "You have successfully banned %s from using boomboxes.", NameRP(tid));
- SendClientMessage(playerid, COLOR_YELLOW, gstr);
- format(gstr, sizeof(gstr), "Admin %s has banned %s from using boomboxes [Reason: %s]", NameRP(playerid), NameRP(tid), inputtext);
- AdminLog(playerid, SQLID[tid], GetName(tid), gstr);
- DeletePVar(playerid, "bbID");
- DeletePVar(playerid, "bbBanC");
- if(Boomboxes[tid][BoomOID] == SQLID[tid])
- {
- if(Boomboxes[tid][BoomIsPlaying])
- {
- foreach(new p: Player)
- {
- if(IsPlayerInRangeOfPoint(p, Boomboxes[tid][BoomRange], Boomboxes[tid][BoomPos][0], Boomboxes[tid][BoomPos][1], Boomboxes[tid][BoomPos][2]))
- {
- if(!IsPlayerInAnyVehicle(p))
- {
- StopAudioStreamForPlayer(p);
- ListeningBoom[p] = -1;
- }
- }
- }
- }
- Inventory[tid][Boombox] = 0;
- MySQLUpdateInt(SQLID[tid], "Boombox", 0, "players");
- Boomboxes[tid][BoomPos][0] = 0.0;
- Boomboxes[tid][BoomPos][1] = 0.0;
- Boomboxes[tid][BoomPos][2] = 0.0;
- Boomboxes[tid][BoomPos][3] = 0.0;
- DestroyDynamicObjectEx(Boomboxes[tid][BoomObj], "Boomboxes[tid][BoomObj]");
- Boomboxes[tid][BoomObj] = INVALID_OBJECT_ID;
- Boomboxes[tid][BoomRange] = 0;
- Boomboxes[tid][BoomStation][0] = 0;
- Boomboxes[tid][BoomOID] = -1;
- Boomboxes[tid][BoomType] = -1;
- Boomboxes[tid][BoomIsPlaying] = false;
- DestroyDynamicArea(Boomboxes[tid][BoomArea]);
- }
- }
- else if(GetPVarType(playerid, "bbBanC") == 0)
- {
- SetPVarInt(playerid, "bbBanC", 1);
- Dialog_Show(playerid, BoomboxBan, DIALOG_STYLE_INPUT, "Boombox Ban", "{FF0000}THIS BAN IS PERMANENT\n\t{FFFFFF}Please enter reason:", "Ban", "Cancel");
- }
- }
- return true;
- }
- Dialog:NameChange1(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- new playa = -1;
- foreach(new p: Player)
- {
- if(strfind(inputtext, NameEx(p), true) != -1)
- {
- SetPVarInt(playerid, "cnID", p);
- playa = p;
- }
- }
- if(playa != -1)
- {
- if(WantsNameChange[playa][0] == 1)
- {
- new lastReasonUsed[64],reason[128];
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Reason FROM namechanges WHERE SQLID=%i ORDER BY ChangeTime DESC LIMIT 1", SQLID[playa]);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() > 0) cache_get_field_content(0, "Reason", lastReasonUsed);
- cache_delete(result);
- if(strlen(lastReasonUsed) < 2) format(lastReasonUsed, sizeof(lastReasonUsed), "No Record");
- format(reason, 128, "Last Reason Used: {FF0000}%s", lastReasonUsed);
- format(gstr, sizeof(gstr), "\n{FFFFFF}Current Name: {00FF00}%s{FFFFFF}\nRequested Name: {FF0000}%s{FFFFFF}\nReason: {ff0000}%s\n\n{FFFFFF}Clear Criminal Record ", NameEx(playa), RPName(NameChange[playa]), NameChangeReason[playa]);
- switch(WantsNameChange[playa][1])
- {
- case 0: format(gstr, sizeof(gstr), "%s [{FF0000}X{FFFFFF}]", gstr);
- case 1: format(gstr, sizeof(gstr), "%s [{00FF00}X{FFFFFF}]", gstr);
- }
- format(gstr, sizeof(gstr), "%s\n\n%s", gstr, reason);
- Dialog_Show(playerid, NameChange2, DIALOG_STYLE_MSGBOX, "Confirm Name Change", gstr, "Confirm", "Deny");
- }
- else return SysMsg(playerid, "Name Change being dealt with.");
- }
- return true;
- }
- Dialog:NameChange2(playerid, response, listitem, inputtext[])
- {
- new playa = GetPVarInt(playerid, "cnID");
- if(WantsNameChange[playa][0] == 1)
- {
- if(response)
- {
- new cashNeeded;
- switch(WantsNameChange[playa][1])
- {
- case 0: cashNeeded = 25000;
- case 1: cashNeeded = 50000;
- }
- if(Cash[playa] < cashNeeded)
- {
- SysMsg(playerid,"That player no longer has enough money for a name change.");
- SysMsg(playa,"You no longer have enough money for the name change.");
- WantsNameChange[playa][0] = 0;
- WantsNameChange[playa][1] = 0;
- NameChange[playa][0] = EOS;
- return true;
- }
- SendClientMessageF(playa, COLOR_DARKBLUE, "Your name change request has been accepted by %s, you are now %s. (-$%s)", NameEx(playerid), RPName(NameChange[playa]), format_cash(cashNeeded));
- if(IsPlayerAdminLevelOK(playerid, 1)) format(gstr, sizeof(gstr),"* Admin %s has confirmed %s's name change to %s.", NameEx(playerid), NameEx(playa), RPName(NameChange[playa]));
- else if(IsHelper{playerid}) format(gstr, sizeof(gstr),"* Helper %s has confirmed %s's name change to %s.", NameEx(playerid), NameEx(playa), RPName(NameChange[playa]));
- AdminBroadcast(gstr, 1);
- HelperBroadcast(gstr);
- format(gstr, sizeof(gstr),"(( [OOC] Name Change: %s is now known as %s. ))", NameEx(playa), RPName(NameChange[playa]));
- SendClientMessageToAllLogged(COLOR_OOC, gstr);
- format(gstr, sizeof(gstr), "Confirmed name change to %s", NameChange[playa]);
- AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Name='%e' WHERE id=%i LIMIT 1", NameChange[playa], SQLID[playa]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET OwnerName = '%e' WHERE OwnerSQLID = %i", NameChange[playa], SQLID[playa]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO namechanges (SQLID,OldName,NewName,ChangeTime,Type,Reason) VALUES (%i,'%e','%e',%i,%i,'%e')", SQLID[playa], GetName(playa), NameChange[playa], gettime(), WantsNameChange[playa][1], NameChangeReason[playa]);
- mysql_pquery(conn, mquery);
- format(PhoneData[playa][pOwnerName], 25, "%s", NameChange[playa]);
- if(WantsNameChange[playa][1] == 1)
- {
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM mdc WHERE SuspectSQLID=%i", SQLID[playa]);
- mysql_pquery(conn, mquery, "");
- }
- SetPlayerName(playa, NameChange[playa]);
- GivePlayerCash(playa, -cashNeeded);
- WantsNameChange[playa][0] = 0;
- WantsNameChange[playa][1] = 0;
- NameChange[playa][0] = EOS;
- NameChangeReason[playa][0] = EOS;
- for(new b = 0; b < MAX_BIZZ_PER_PLAYER; b++)
- {
- if(PlayerBizzID[playa][b] != -1)
- {
- UpdateBizzLabel(b);
- }
- }
- foreach(new i: Player)
- {
- if(UsingPaint{i})
- {
- format(tgstr, sizeof(tgstr), "%s (%i)", NameEx(playa), playa);
- UpdateDynamic3DTextLabelText(PaintLabels[i][playa], COLOR_ORANGE, tgstr);
- }
- }
- DeletePVar(playerid, "cnID");
- }
- else if(!response)
- {
- return Dialog_Show(playerid, NameChange3, DIALOG_STYLE_INPUT, "Deny name change.", "Please enter the reason for denying the name change:", "Confirm", "Cancel");
- }
- }
- else return SysMsg(playerid, "This name change request has already been dealt with by another Helper/Admin.");
- return true;
- }
- Dialog:NameChange3(playerid, response, listitem, inputtext[])
- {
- new playa = GetPVarInt(playerid, "cnID");
- if(!response) return true;
- SendClientMessageF(playa, COLOR_DARKBLUE, "Your name change request has been denied by Admin %s [Reason: %s]", NameEx(playerid), inputtext);
- format(gstr, sizeof(gstr),"* Admin %s has denied %s's name change to %s [Reason: %s].", NameEx(playerid), NameEx(playa), NameChange[playa], inputtext);
- AdminBroadcast(gstr, 1);
- format(gstr, sizeof(gstr), "Rejected name change to %s", NameChange[playa]);
- AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
- WantsNameChange[playa][0] = 0;
- WantsNameChange[playa][1] = 0;
- NameChange[playa][0] = EOS;
- NameChangeReason[playa][0] = EOS;
- DeletePVar(playerid, "cnID");
- return true;
- }
- Dialog:TPList(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- DeletePVar(playerid, "tpID");
- DeletePVar(playerid, "tpVID");
- return true;
- }
- new playa = GetPVarInt(playerid, "tpID");
- if(GetPVarInt(playerid, "tpVID") >= 1)
- {
- new vid = GetPVarInt(playerid, "tpVID");
- SetVehiclePos(vid, Teleports[listitem][TPx],Teleports[listitem][TPy],Teleports[listitem][TPz]);
- foreach(new p: Player)
- {
- if(IsPlayerInVehicle(p, vid) )
- {
- SetPlayerVirtualWorldEx(p ,Teleports[listitem][TPVw]);
- SetPlayerInterior(p, Teleports[listitem][TPInt]);
- }
- }
- LinkVehicleToInteriorEx(vid, Teleports[listitem][TPVw]);
- SetVehicleVirtualWorld(vid, Teleports[listitem][TPInt]);
- if(IsInHouseID[playa] != -1) IsInHouseID[playa] = -1;
- if(IsInBizzID[playa] != -1) IsInBizzID[playa] = -1;
- if(IsInGarageID[playa] != -1) IsInGarageID[playa] = -1;
- SendClientMessageF(playa, COLOR_LIGHTBLUE, "Admin %s has teleported you to %s.",NameEx(playerid),Teleports[listitem][TPName]);
- format(gstr, sizeof(gstr),"[Admin] %s has teleported %s to %s", NameEx(playerid),NameEx(playa),Teleports[listitem][TPName]);
- AdminBroadcast(gstr, 1);
- format(gstr, sizeof(gstr), "Teleported to %s", Teleports[listitem][TPName]);
- AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
- DeletePVar(playerid, "tpID");
- DeletePVar(playerid, "tpVID");
- return true;
- }
- else if(GetPVarType(playerid, "tpID") == 1)
- {
- SetPlayerPos(playa,Teleports[listitem][TPx],Teleports[listitem][TPy],Teleports[listitem][TPz]);
- SetPlayerFacingAngle(playa,Teleports[listitem][TPa]);
- SetPlayerInterior(playa,Teleports[listitem][TPInt]);
- SetPlayerVirtualWorldEx(playa,Teleports[listitem][TPVw]);
- if(IsInHouseID[playa] != -1) IsInHouseID[playa] = -1;
- if(IsInBizzID[playa] != -1) IsInBizzID[playa] = -1;
- if(IsInGarageID[playa] != -1) IsInGarageID[playa] = -1;
- format(gstr, sizeof(gstr),"Admin %s has teleported you to %s.",NameEx(playerid), Teleports[listitem][TPName]);
- SendClientMessage(playa,COLOR_LIGHTBLUE,gstr);
- format(gstr, sizeof(gstr),"[Admin] %s has teleported %s to %s.",NameEx(playerid),NameEx(playa), Teleports[listitem][TPName]);
- AdminBroadcast(gstr, 1);
- format(gstr, sizeof(gstr), "Teleported to %s", Teleports[listitem][TPName]);
- AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
- DeletePVar(playerid, "tpID");
- DeletePVar(playerid, "tpVID");
- return true;
- }
- return true;
- }
- Dialog:MDC_Home(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- DeleteMDCPVars(playerid);
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- SetPlayerChatBubble(playerid, "* logs off of the Mobile Data Computer *", COLOR_EMOTE, 15, 10000);
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- switch(listitem)
- {
- case 0:
- {
- if(Faction[playerid] == FACTION_SACFD) mysql_pquery(conn, "SELECT emergencyInfo,location,emerReason,serviceType,unitsRes,callCleared FROM `911calls` WHERE serviceType = 1 ORDER BY timestamp DESC LIMIT 20", "mdc911", "i", playerid);
- else Dialog_Show(playerid, MDC_Name, DIALOG_STYLE_INPUT, "{ffffff}MDC - Name Search", "{ffffff}Enter full name to be searched below:", "Search", "Return");
- }
- case 1:
- {
- if(Faction[playerid] == FACTION_SACFD) return cmd_backup(playerid, "sasp");
- else Dialog_Show(playerid, MDC_PlateSearch, DIALOG_STYLE_INPUT, "{ffffff}MDC - Plate Search", "{ffffff}Enter the full vehicle plate (inc. spaces) that you wish to search below:", "Search", "Return");
- }
- case 2:
- {
- if(IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) Dialog_Show(playerid, MDC_APBHome, DIALOG_STYLE_LIST, "{FFFFFF}MDC - APB Dashboard", "All Active APBs\nCreate New APB\nRemoved APBs", "Select", "Return");
- else Dialog_Show(playerid, MDC_APBHome, DIALOG_STYLE_LIST, "{FFFFFF}MDC - APB Dashboard", "All Active APBs\nCreate New APB", "Select", "Return");
- }
- case 3: mysql_pquery(conn, "SELECT emergencyInfo,location,emerReason,serviceType,unitsRes,callCleared FROM `911calls` WHERE serviceType = 0 ORDER BY timestamp DESC LIMIT 20", "mdc911", "i", playerid);
- /*case 4:
- {
- if(FactionRank[playerid] >= FACTIONS[Faction[playerid]][FactionUberLeaderRank] - 1)
- {
- mysql_pquery(conn, "SELECT * FROM `mdc` WHERE removed = 1 AND RecordType = 5 ORDER BY id DESC LIMIT 20", "mdcRemovedCharges", "i", playerid);
- }
- }*/
- }
- }
- return true;
- }
- Dialog:MDC_NameHome(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- if(Faction[playerid] == FACTION_COP || Faction[playerid] == FACTION_RESEARCH) Dialog_Show(playerid, MDC_Home, DIALOG_STYLE_LIST, "MDC - Dashboard", "Name Search\nPlate Search\nAll Points Bulletin\nRecent 911 calls", "Select", "Logout");
- else Dialog_Show(playerid, MDC_Home, DIALOG_STYLE_LIST, "MDC - Dashboard", "Recent 911 calls\nRequest Backup", "Select", "Logout");
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- switch(listitem)
- {
- case 0:
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,Name,id,WeaponLicense,Faction,BirthDate,BirthMonth,BirthYear FROM `players` WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameSearch", "ii", playerid, 2);
- }
- case 1:
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,Name,id,WeaponLicense,Faction,BirthDate,BirthMonth,BirthYear FROM `players` WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameSearch", "ii", playerid, 3);
- }
- case 2, 6:
- {
- format(gstr, sizeof(gstr), "{ffffff}%s - Dashboard", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameHome, DIALOG_STYLE_LIST, gstr, "{ffffff}Personal Information\nVehicular Information\n \nAdd New Charge\nOutstanding Charges\nPrevious Charges\n \nMost Recent Fines\nMost Recent Jails", "Select", "Return");
- }
- case 3:
- {
- format(gstr, sizeof(gstr), "%s - Add New Charge", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_AddCharge, DIALOG_STYLE_INPUT, gstr, "{ffffff}Enter the full description of the charge below: [Max Chars: 32]", "Submit", "Return");
- }
- case 4:
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT timestamp,Reason FROM `mdc` WHERE SuspectSQLID = %i AND cleared = 0 AND removed = 0 AND RecordType = 5 ORDER BY id DESC", GetPVarInt(playerid, "mdcAcc"));
- mysql_pquery(conn, mquery, "mdcNameOutstanding", "i", playerid);
- }
- case 5:
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Reason,timestamp FROM `mdc` WHERE SuspectSQLID = %i AND cleared = 1 AND removed = 0 AND RecordType = 5 ORDER BY id DESC LIMIT 35", GetPVarInt(playerid, "mdcAcc"));
- mysql_pquery(conn, mquery, "mdcNamePrevious", "ii", playerid, 0);
- }
- case 7:
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Reason,OfficerRank,OfficerName,Amount,timestamp FROM mdc WHERE SuspectSQLID = %i AND RecordType = 2 ORDER BY id DESC LIMIT 30", GetPVarInt(playerid, "mdcAcc"));
- mysql_pquery(conn, mquery, "mdcRecentCharge", "ii", playerid, 2);
- }
- case 8:
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Reason,OfficerRank,OfficerName,Amount,timestamp FROM mdc WHERE SuspectSQLID = %i AND RecordType = 1 ORDER BY id DESC LIMIT 30", GetPVarInt(playerid, "mdcAcc"));
- mysql_pquery(conn, mquery, "mdcRecentCharge", "ii", playerid, 1);
- }
- }
- }
- return true;
- }
- Dialog:MDC_Name(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- cmd_mdc(playerid);
- return true;
- }
- if(response)
- {
- for(new sN; sN < strlen(inputtext); sN++)
- {
- if(inputtext[sN] == ' ')
- {
- inputtext[sN] = '_';
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,Name,id,WeaponLicense,Faction,BirthDate,BirthMonth,BirthYear FROM `players` WHERE Name = '%e'", inputtext);
- mysql_pquery(conn, mquery, "mdcNameSearch", "ii", playerid, 1);
- return true;
- }
- }
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- Dialog_Show(playerid, MDC_NameError, DIALOG_STYLE_MSGBOX, "{ffffff}MDC - {ff0000}Name Search", "{ffffff}The name you specified doesn't exist in the database.", "Close", "");
- return true;
- }
- return true;
- }
- Dialog:MDC_PlateSearch(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- if(Faction[playerid] == FACTION_COP || Faction[playerid] == FACTION_RESEARCH) Dialog_Show(playerid, MDC_Home, DIALOG_STYLE_LIST, "MDC - Dashboard", "Name Search\nPlate Search\nAll Points Bulletin\nRecent 911 calls", "Select", "Logout");
- else Dialog_Show(playerid, MDC_Home, DIALOG_STYLE_LIST, "MDC - Dashboard", "Recent 911 calls\nRequest Backup", "Select", "Logout");
- return true;
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT OwnerSQLID,VehicleModel,RegPlate FROM `vehicles` WHERE RegPlate = '%e'", inputtext);
- mysql_pquery(conn, mquery, "mdcPlateSearch", "iisi", playerid, 1, inputtext, 0);
- format(mdcPlate[playerid], 12, inputtext);
- }
- return true;
- }
- Dialog:MDC_PlateError(playerid, response, listitem, inputtext[])
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- if(Faction[playerid] == FACTION_COP || Faction[playerid] == FACTION_RESEARCH) Dialog_Show(playerid, MDC_Home, DIALOG_STYLE_LIST, "MDC - Dashboard", "Name Search\nPlate Search\nAll Points Bulletin\nRecent 911 calls", "Select", "Logout");
- else Dialog_Show(playerid, MDC_Home, DIALOG_STYLE_LIST, "MDC - Dashboard", "Recent 911 calls\nRequest Backup", "Select", "Logout");
- return true;
- }
- Dialog:MDC_NameError(playerid, response, listitem, inputtext[]) return cmd_mdc(playerid);
- Dialog:MDC_NameDetails(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- if(strlen(mdcName[playerid]))
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,Name,id,WeaponLicense,Faction,BirthDate,BirthMonth,BirthYear FROM `players` WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameSearch", "ii", playerid, 1);
- return true;
- }
- else
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- return Dialog_Show(playerid, MDC_Name, DIALOG_STYLE_INPUT, "{ffffff}MDC - Name Search", "{ffffff}Enter full name to be searched below:", "Search", "Return");
- }
- }
- else
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- format(gstr, sizeof(gstr), "{FFFFFF}%s - Name Search Menu", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameMenu, DIALOG_STYLE_LIST, gstr, "Vehicle Licenses\nWeapon Licenses", "Select", "Return");
- }
- return true;
- }
- Dialog:MDC_NameMenu(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,Name,id,WeaponLicense,Faction,BirthDate,BirthMonth,BirthYear FROM `players` WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameSearch", "ii", playerid, 1);
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- switch(listitem)
- {
- case 0:
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,WeaponLicense FROM `players` WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameMenu", "ii", playerid, 1);
- }
- case 1:
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,WeaponLicense FROM `players` WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameMenu", "ii", playerid, 2);
- }
- }
- }
- return true;
- }
- Dialog:MDC_NameLicenses(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,Name,id,WeaponLicense,Faction,BirthDate,BirthMonth,BirthYear FROM players WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameSearch", "ii", playerid, 2);
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane FROM players WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcVehLicense", "ii", playerid, listitem);
- }
- return true;
- }
- Dialog:MDC_NameLicensesEdit(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,WeaponLicense FROM `players` WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameMenu", "ii", playerid, 1);
- }
- if(response)
- {
- new li = -1;
- switch(listitem)
- {
- case 0:
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,WeaponLicense FROM `players` WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameMenu", "ii", playerid, 1);
- }
- case 1:
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- if(strmatch("Revoke Car License", inputtext)) { mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseCar = 0, LicenseSuspendTime_Car = 0 WHERE Name = '%e'", mdcName[playerid]); li = 0; }
- else if(strmatch("Revoke Large Vehicle License", inputtext)) { mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseLargeVehicle = 0, LicenseSuspendTime_LargeVehicle = 0 WHERE Name = '%e'", mdcName[playerid]); li = 1; }
- else if(strmatch("Revoke Bike License", inputtext)) { mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseBike = 0, LicenseSuspendTime_Bike = 0 WHERE Name = '%e'", mdcName[playerid]); li = 2; }
- else if(strmatch("Revoke Boat License", inputtext)) { mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseBoat = 0, LicenseSuspendTime_Boat = 0 WHERE Name = '%e'", mdcName[playerid]); li = 3; }
- else if(strmatch("Revoke Heli License", inputtext)) { mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseHelicopter = 0, LicenseSuspendTime_Helicopter = 0 WHERE Name = '%e'", mdcName[playerid]); li = 4; }
- else if(strmatch("Revoke Plane License", inputtext)) { mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicensePlane = 0, LicenseSuspendTime_Plane = 0 WHERE Name = '%e'", mdcName[playerid]); li = 5; }
- foreach(new p: Player)
- if(strmatch(GetName(playerid), mdcName[playerid]))
- Licenses[playerid][li] = 0;
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane FROM players WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcVehLicense", "ii", playerid, li);
- }
- case 2:
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- if(strmatch("Suspend Car License", inputtext)) li = 0;
- else if(strmatch("Suspend Large Vehicle License", inputtext)) li = 1;
- else if(strmatch("Suspend Bike License", inputtext)) li = 2;
- else if(strmatch("Suspend Boat License", inputtext)) li = 3;
- else if(strmatch("Suspend Heli License", inputtext)) li = 4;
- else if(strmatch("Suspend Plane License", inputtext)) li = 5;
- SetPVarInt(playerid, "mdcLicense", li);
- format(gstr, sizeof(gstr), "{FFFFFF}%s - Suspend License", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameLicenseSuspend, DIALOG_STYLE_INPUT, gstr, "{FFFFFF}How many hours would you like to suspend the license for:\n\t\t\t[Max Hours: 12]", "Submit", "Return");
- }
- }
- }
- return true;
- }
- Dialog:MDC_NameLicenseSuspend(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane FROM players WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcVehLicense", "ii", playerid, GetPVarInt(playerid, "mdcLicense"));
- }
- if(response)
- {
- if(IsNumeric(inputtext))
- {
- if(strval(inputtext) >= 1 && strval(inputtext) <= 12)
- {
- new li = GetPVarInt(playerid, "mdcLicense"), playa = -1;
- foreach(new p: Player)
- if(strmatch(GetName(p), mdcName[playerid]))
- playa = p;
- if(!InvalidPlayer(playa))
- {
- if(li == 0) {mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseSuspendTime_Car = %i WHERE Name = '%e'", strval(inputtext)*60*60, mdcName[playerid]); LicenseSuspendTime[playa][LICENSE_CAR] = strval(inputtext)*60; }
- else if(li == 1) {mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseSuspendTime_LargeVehicle = %i WHERE Name = '%e'", strval(inputtext)*60, mdcName[playerid]); LicenseSuspendTime[playa][LICENSE_LGV] = strval(inputtext)*60; }
- else if(li == 2) {mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseSuspendTime_Bike = %i WHERE Name = '%e'", strval(inputtext)*60, mdcName[playerid]); LicenseSuspendTime[playa][LICENSE_BIKE] = strval(inputtext)*60; }
- else if(li == 3) {mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseSuspendTime_Boat = %i WHERE Name = '%e'", strval(inputtext)*60, mdcName[playerid]); LicenseSuspendTime[playa][LICENSE_BOAT] = strval(inputtext)*60; }
- else if(li == 4) {mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseSuspendTime_Helicopter = %i WHERE Name = '%e'", strval(inputtext)*60, mdcName[playerid]); LicenseSuspendTime[playa][LICENSE_HELI] = strval(inputtext)*60; }
- else if(li == 5) {mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseSuspendTime_Plane = %i WHERE Name = '%e'", strval(inputtext)*60, mdcName[playerid]); LicenseSuspendTime[playa][LICENSE_PLANE] = strval(inputtext)*60; }
- }
- else
- {
- if(li == 0) mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseSuspendTime_Car = %i WHERE Name = '%e'", strval(inputtext)*60, mdcName[playerid]);
- else if(li == 1) mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseSuspendTime_LargeVehicle = %i WHERE Name = '%e'", strval(inputtext)*60, mdcName[playerid]);
- else if(li == 2) mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseSuspendTime_Bike = %i WHERE Name = '%e'", strval(inputtext)*60, mdcName[playerid]);
- else if(li == 3) mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseSuspendTime_Boat = %i WHERE Name = '%e'", strval(inputtext)*60, mdcName[playerid]);
- else if(li == 4) mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseSuspendTime_Helicopter = %i WHERE Name = '%e'", strval(inputtext)*60, mdcName[playerid]);
- else if(li == 5) mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LicenseSuspendTime_Plane = %i WHERE Name = '%e'", strval(inputtext)*60, mdcName[playerid]);
- }
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane FROM players WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcVehLicense", "ii", playerid, GetPVarInt(playerid, "mdcLicense"));
- DeletePVar(playerid, "mdcLicense");
- }
- else
- {
- format(gstr, sizeof(gstr), "{FFFFFF}%s - {FF0000}ERROR", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameLicenseSuspend, DIALOG_STYLE_INPUT, gstr, "{FFFFFF}How many hours would you like to suspend the license for:\n\t\t\t[Max Hours: 12]", "Submit", "Return");
- }
- }
- else
- {
- format(gstr, sizeof(gstr), "{FFFFFF}%s - {FF0000}ERROR", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameLicenseSuspend, DIALOG_STYLE_INPUT, gstr, "{FFFFFF}How many hours would you like to suspend the license for:\n\t\t\t[Max Hours: 12]", "Submit", "Return");
- }
- }
- return true;
- }
- Dialog:MDC_NameWeaponLicense(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,Name,id,WeaponLicense,Faction,BirthDate,BirthMonth,BirthYear FROM players WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameSearch", "ii", playerid, 2);
- }
- if(response)
- {
- if(Faction[playerid] == 1)
- {
- if(strmatch("Revoke Weapon License", inputtext))
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- new sqlid = MySQLCheckAccount(mdcName[playerid], playerid);
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM weaponlicenses WHERE OwnerSQLID = %i", sqlid);
- mysql_pquery(conn, mquery);
- foreach(new p: Player)
- {
- if(strmatch(GetName(p), mdcName[playerid]))
- {
- WeaponLicense[p] = 0;
- }
- }
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,WeaponLicense FROM players WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameMenu", "ii", playerid, 2);
- format(gstr, sizeof(gstr), "[%s] %s has removed %s's weapon license.", GetServerTimeString(), NameEx(playerid), RPName(mdcName[playerid]));
- }
- else if(strmatch("Grant Weapon License", inputtext) || strmatch("Change Weapon License", inputtext))
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- format(gstr, sizeof(gstr), "{FFFFFF}%s - Weapon License", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameWeaponGrant, DIALOG_STYLE_INPUT, gstr, "{ffffff}Please input the license type below:", "Select", "Close");
- }
- else
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,WeaponLicense FROM players WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameMenu", "ii", playerid, 2);
- }
- }
- else
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,Name,id,WeaponLicense,Faction,BirthDate,BirthMonth,BirthYear FROM players WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameSearch", "ii", playerid, 2);
- }
- }
- return true;
- }
- Dialog:MDC_NameWeaponGrant(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- format(gstr, sizeof(gstr), "{FFFFFF}%s - Name Search Menu", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameMenu, DIALOG_STYLE_LIST, gstr, "Vehicle Licenses\nWeapon Licenses", "Select", "Return");
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- if(strlen(inputtext) == 1)
- {
- new lic, sqlid = MySQLCheckAccount(mdcName[playerid], playerid);
- if(strmatch(inputtext, "A")) lic = 1;
- else if(strmatch(inputtext, "B")) lic = 2;
- else if(strmatch(inputtext, "C")) lic = 3;
- else return Dialog_Show(playerid, MDC_NameWeaponGrant, DIALOG_STYLE_INPUT, gstr, " {ff0000} \t ERROR\nPlease input the license type below:", "Select", "Close");
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO weaponlicenses (LicenseType, OwnerSQLID, GivingOfficer, Timestamp, ExpirationTime) VALUES (%i, %i, %i, %i, %i)", lic, sqlid, SQLID[playerid], gettime(), gettime() + 7776000);
- new Cache:result = mysql_query(conn, mquery);
- new id = cache_insert_id();
- cache_delete(result);
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM weaponlicenses WHERE OwnerSQLID = %i AND id != %i", sqlid, id);
- mysql_tquery(conn, mquery);
- format(gstr, sizeof(gstr), "[%s] %s has granted %s a weapon license %s.", GetServerTimeString(), NameEx(playerid), RPName(mdcName[playerid]), inputtext);
- foreach(new p: Player)
- {
- if(strmatch(GetName(p), mdcName[playerid]))
- {
- WeaponLicense[p] = lic;
- }
- }
- foreach(new p: Player)
- {
- if(Faction[p] == FACTION_COP)
- {
- SendClientMessageF(p, COLOR_BLUE, "%s has granted %s a weapon license %s.", NameEx(playerid), RPName(mdcName[playerid]), inputtext);
- }
- }
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,WeaponLicense FROM players WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameMenu", "ii", playerid, 2);
- }
- else return Dialog_Show(playerid, MDC_NameWeaponGrant, DIALOG_STYLE_INPUT, gstr, " {ff0000} \t ERROR\nPlease input the license type below:", "Select", "Close");
- }
- return true;
- }
- Dialog:MDC_NameInfo(playerid, response, listitem, inputtext[])
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- format(gstr, sizeof(gstr), "{ffffff}%s - Dashboard", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameHome, DIALOG_STYLE_LIST, gstr, "{ffffff}Personal Information\nVehicular Information\n \nAdd New Charge\nOutstanding Charges\nPrevious Charges\n \nMost Recent Fines\nMost Recent Jails", "Select", "Return");
- return true;
- }
- Dialog:MDC_AddCharge(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- format(gstr, sizeof(gstr), "{ffffff}%s - Dashboard", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameHome, DIALOG_STYLE_LIST, gstr, "{ffffff}Personal Information\nVehicular Information\n \nAdd New Charge\nOutstanding Charges\nPrevious Charges\n \nMost Recent Fines\nMost Recent Jails", "Select", "Return");
- return true;
- }
- if(strlen(inputtext) >= 3 && strlen(inputtext) <= 32)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- new sqlid = MySQLCheckAccount(mdcName[playerid], playerid);
- AddToMDC(sqlid, playerid, MDC_TYPE_STAR, 1, inputtext);
- format(gstr, sizeof(gstr), "{FFFFFF}%s - Add Another Charge", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_AddCharge, DIALOG_STYLE_INPUT, gstr, "{FFFFFF}Enter the full description of the charge below: [Max Chars: 32]", "Add More", "Return");
- }
- return true;
- }
- Dialog:MDC_NameOutstanding(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- format(gstr, sizeof(gstr), "{ffffff}%s - Dashboard", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameHome, DIALOG_STYLE_LIST, gstr, "{ffffff}Personal Information\nVehicular Information\n \nAdd New Charge\nOutstanding Charges\nPrevious Charges\n \nMost Recent Fines\nMost Recent Jails", "Select", "Return");
- return true;
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- SetPVarInt(playerid, "mdcOutViewing", listitem);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT timestamp,OfficerName,OfficerRank,Reason FROM `mdc` WHERE SuspectSQLID = %i AND cleared = 0 AND RecordType = 5 ORDER BY id DESC LIMIT 1 OFFSET %i", GetPVarInt(playerid, "mdcAcc"), listitem);
- mysql_pquery(conn, mquery, "mdcOutstandingDetails", "i", playerid);
- }
- return true;
- }
- Dialog:MDC_NamePrevious(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- format(gstr, sizeof(gstr), "{ffffff}%s - Dashboard", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameHome, DIALOG_STYLE_LIST, gstr, "{ffffff}Personal Information\nVehicular Information\n \nAdd New Charge\nOutstanding Charges\nPrevious Charges\n \nMost Recent Fines\nMost Recent Jails", "Select", "Return");
- return true;
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- SetPVarInt(playerid, "mdcOutViewing", listitem);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT timestamp,OfficerName,OfficerRank,Reason FROM `mdc` WHERE SuspectSQLID = %i AND cleared = 1 AND RecordType = 5 ORDER BY id DESC LIMIT 1 OFFSET %i", GetPVarInt(playerid, "mdcAcc"), listitem);
- mysql_pquery(conn, mquery, "mdcPreviousDetails", "i", playerid);
- }
- return true;
- }
- Dialog:MDC_NameoutDetails(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT timestamp,Reason FROM `mdc` WHERE SuspectSQLID = %i AND cleared = 0 AND removed = 0 AND RecordType = 5 ORDER BY id DESC", GetPVarInt(playerid, "mdcAcc"));
- mysql_pquery(conn, mquery, "mdcNameOutstanding", "i", playerid);
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- Dialog_Show(playerid, MDC_NameoutMenu, DIALOG_STYLE_LIST, "MDC - Outstanding Charges Menu", "Clear Charge\nRemove Charge", "Select", "Cancel");
- }
- return true;
- }
- Dialog:MDC_NameoutMenu(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT timestamp,Reason FROM `mdc` WHERE SuspectSQLID = %i AND cleared = 0 AND removed = 0 AND RecordType = 5 ORDER BY id DESC LIMIT 1 OFFSET %i", GetPVarInt(playerid, "mdcAcc"), GetPVarInt(playerid, "mdcOutViewing"));
- mysql_pquery(conn, mquery, "mdcNameOutstanding", "i", playerid);
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- switch(listitem)
- {
- case 0:
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,cleared,removed,timestamp,Reason FROM `mdc` WHERE SuspectSQLID = %i AND cleared = 0 AND removed = 0 AND RecordType = 5 ORDER BY id DESC LIMIT 1 OFFSET %i", GetPVarInt(playerid, "mdcAcc"), GetPVarInt(playerid, "mdcOutViewing"));
- mysql_pquery(conn, mquery, "mdcOutstandingClear", "ii", playerid, 1);
- }
- case 1:
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,cleared,removed,timestamp,Reason FROM `mdc` WHERE SuspectSQLID = %i AND cleared = 0 AND removed = 0 AND RecordType = 5 ORDER BY id DESC LIMIT 1 OFFSET %i", GetPVarInt(playerid, "mdcAcc"), GetPVarInt(playerid, "mdcOutViewing"));
- mysql_pquery(conn, mquery, "mdcOutstandingClear", "ii", playerid, 2);
- }
- }
- }
- return true;
- }
- Dialog:MDC_OutMenuError(playerid, response, listitem, inputtext[])
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT timestamp,Reason FROM `mdc` WHERE SuspectSQLID = %i AND cleared = 0 AND removed = 0 AND RecordType = 5 ORDER BY id DESC", GetPVarInt(playerid, "mdcAcc"));
- mysql_pquery(conn, mquery, "mdcNameOutstanding", "i", playerid);
- return true;
- }
- Dialog:MDC_PrevMenuError(playerid, response, listitem, inputtext[])
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- format(gstr, sizeof(gstr), "{ffffff}%s - Dashboard", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameHome, DIALOG_STYLE_LIST, gstr, "{ffffff}Personal Information\nVehicular Information\n \nAdd New Charge\nOutstanding Charges\nPrevious Charges\n \nMost Recent Fines\nMost Recent Jails", "Select", "Return");
- return true;
- }
- Dialog:MDC_NamePrevDetails(playerid, response, listitem, inputtext[])
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Reason,timestamp FROM `mdc` WHERE SuspectSQLID = %i AND cleared = 1 AND removed = 0 AND RecordType = 5 ORDER BY id DESC LIMIT 35", GetPVarInt(playerid, "mdcAcc"));
- mysql_pquery(conn, mquery, "mdcNamePrevious", "ii", playerid, 0);
- return true;
- }
- Dialog:MDC_APBHome(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- if(Faction[playerid] == FACTION_COP) Dialog_Show(playerid, MDC_Home, DIALOG_STYLE_LIST, "MDC - Dashboard", "Name Search\nPlate Search\nAll Points Bulletin\nRecent 911 calls", "Select", "Logout");
- else Dialog_Show(playerid, MDC_Home, DIALOG_STYLE_LIST, "MDC - Dashboard", "Recent 911 calls\nRequest Backup", "Select", "Logout");
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- switch(listitem)
- {
- case 0:
- {
- new l;
- gstr[0] = EOS;
- for(new i; i < MAX_APB; i++)
- {
- if(strlen(apbData[i][apbString]) >= 1)
- {
- new date[6];
- TimestampToDate(apbData[i][apbTime], date[2], date[1], date[0], date[3], date[4], date[5]);
- new mess[135];
- format(mess, 135, "%s", apbData[i][apbString]);
- if(strlen(mess) >= 59)
- {
- strdel(mess, 59, sizeof(mess));
- strins(mess, "...", 59);
- }
- format(gstr, sizeof(gstr), "%s[ %02d/%02d %02d:%02d ] - %s\n", gstr, date[0], date[1], date[3], date[4], mess);
- apbData[i][apbListItem] = l;
- l += 1;
- }
- }
- if(l == 0) Dialog_Show(playerid, MDC_CreateS, DIALOG_STYLE_MSGBOX, "{FFFFFF}All Active APBs - No APBs", "{FFFFFF}There are currently no active APBs in the database.", "Close", "");
- else Dialog_Show(playerid, MDC_APBList, DIALOG_STYLE_LIST, "{FFFFFF}APB - All Active APBs", gstr, "Select", "Return");
- }
- case 1: Dialog_Show(playerid, MDC_Create, DIALOG_STYLE_INPUT, "{FFFFFF}APB - Create New APB", "{fFFFFF}Please insert the bulletin message you wish to display below:", "Submit", "Cancel");
- case 2:
- {
- if(IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) mysql_pquery(conn, "SELECT apbString,apbRemovedBy,apbRemovedTime FROM apbs WHERE apbDeleted = 1 ORDER BY apbTimestamp DESC LIMIT 20", "LoadRemovedAPBs", "i", playerid);
- }
- }
- }
- return true;
- }
- Dialog:MDC_Create(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- if(IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) Dialog_Show(playerid, MDC_APBHome, DIALOG_STYLE_LIST, "{FFFFFF}MDC - APB Dashboard", "All Active APBs\nCreate New APB\nRemoved APBs", "Select", "Return");
- else Dialog_Show(playerid, MDC_APBHome, DIALOG_STYLE_LIST, "{FFFFFF}MDC - APB Dashboard", "All Active APBs\nCreate New APB", "Select", "Return");
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- new id = -1;
- for(new i; i < MAX_APB; i++)
- {
- if(isnull(apbData[i][apbString]))
- {
- id = i;
- break;
- }
- }
- if(id != -1)
- {
- format(apbData[id][apbString], 128, "%s", inputtext);
- format(apbData[id][apbRank], 32, "%s", GetFactionRankName(Faction[playerid], FactionRank[playerid]));
- GetPlayerName(playerid, apbData[id][apbBy], MAX_PLAYER_NAME);
- apbData[id][apbTime] = gettime();
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO apbs (apbBy, apbString, apbTimestamp) VALUES (%i, '%e', %i)", SQLID[playerid], apbData[id][apbString], gettime());
- mysql_pquery(conn, mquery);
- Dialog_Show(playerid, MDC_CreateS, DIALOG_STYLE_MSGBOX, "{FFFFFF}Create New APB - Success", "{FFFFFF}You have successfully created a new APB.", "Close", "");
- foreach(new x: Player)
- {
- if(Faction[x] == FACTION_COP)
- {
- if(Duty[x] == 1)
- {
- PlayerPlayNearbySound(x, MDC_SELECT);
- format(gstr, sizeof(gstr), "ALERT: New APB has been posted.", inputtext);
- SendClientMessage(x, COLOR_LIGHTRED, gstr);
- }
- }
- }
- }
- }
- return true;
- }
- Dialog:MDC_CreateS(playerid, response, listitem, inputtext[])
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- if(IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) Dialog_Show(playerid, MDC_APBHome, DIALOG_STYLE_LIST, "{FFFFFF}MDC - APB Dashboard", "All Active APBs\nCreate New APB\nRemoved APBs", "Select", "Return");
- else Dialog_Show(playerid, MDC_APBHome, DIALOG_STYLE_LIST, "{FFFFFF}MDC - APB Dashboard", "All Active APBs\nCreate New APB", "Select", "Return");
- return true;
- }
- Dialog:MDC_APBList(playerid, response, listitem, inputtext[])
- {
- gstr[0] = EOS;
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- if(IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) Dialog_Show(playerid, MDC_APBHome, DIALOG_STYLE_LIST, "{FFFFFF}MDC - APB Dashboard", "All Active APBs\nCreate New APB\nRemoved APBs", "Select", "Return");
- else Dialog_Show(playerid, MDC_APBHome, DIALOG_STYLE_LIST, "{FFFFFF}MDC - APB Dashboard", "All Active APBs\nCreate New APB", "Select", "Return");
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- new id = -1;
- for(new i; i < MAX_APB; i++)
- {
- if(apbData[i][apbListItem] == listitem)
- {
- id = i;
- break;
- }
- }
- if(id != -1)
- {
- new mess[135];
- format(mess, 135,"%s", apbData[id][apbString]);
- if(strlen(mess) >= 33)
- {
- for(new l = 33; l < strlen(mess); l++)
- {
- if(mess[l] == ' ')
- {
- strins(mess, "\n", l);
- break;
- }
- }
- if(strlen(mess) >= 70)
- {
- for(new l = 70; l < strlen(mess); l++)
- {
- if(mess[l] == ' ')
- {
- strins(mess, "\n", l);
- break;
- }
- else if(l == 80)
- {
- strins(mess, "\n", 80);
- break;
- }
- }
- }
- }
- new date[6];
- TimestampToDate(apbData[id][apbTime], date[2], date[1], date[0], date[3], date[4], date[5]);
- format(gstr, sizeof(gstr), "{FFFFFF}________________________________________________\nDETAILS OF ALL POINTS BULLETIN:\n\nSubmitted by: %s %s\nSubmitted on: %02d/%02d/%i - %02d:%02d\nBulletin Message: %s\n\n________________________________________________",
- apbData[id][apbRank], RPName(apbData[id][apbBy]), date[0], date[1], date[2], date[3], date[4], mess);
- format(sgstr, sizeof(sgstr), "{FFFFFF}All Active APBs - APB %i Details", id);
- SetPVarInt(playerid, "apbID", id);
- Dialog_Show(playerid, MDC_APBDelete, DIALOG_STYLE_MSGBOX, sgstr, gstr, "Delete", "Return");
- }
- else
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- if(IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) Dialog_Show(playerid, MDC_APBHome, DIALOG_STYLE_LIST, "{FFFFFF}MDC - APB Dashboard", "All Active APBs\nCreate New APB\nRemoved APBs", "Select", "Return");
- else Dialog_Show(playerid, MDC_APBHome, DIALOG_STYLE_LIST, "{FFFFFF}MDC - APB Dashboard", "All Active APBs\nCreate New APB", "Select", "Return");
- }
- }
- return true;
- }
- Dialog:MDC_APBDelete(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- new l;
- gstr[0] = EOS;
- for(new i; i < MAX_APB; i++)
- {
- if(strlen(apbData[i][apbString]) >= 1)
- {
- new date[6];
- TimestampToDate(apbData[i][apbTime], date[2], date[1], date[0], date[3], date[4], date[5]);
- new mess[135];
- format(mess, 135, "%s", apbData[i][apbString]);
- if(strlen(mess) >= 59)
- {
- strdel(mess, 59, sizeof(mess));
- strins(mess, "...", 59);
- }
- format(gstr, sizeof(gstr), "%s[ %02d/%02d %02d:%02d ] - %s\n", gstr, date[0], date[1], date[3], date[4], mess);
- apbData[i][apbListItem] = l;
- l += 1;
- }
- }
- if(l == 0) Dialog_Show(playerid, MDC_CreateS, DIALOG_STYLE_MSGBOX, "{FFFFFF}All Active APBs - No APBs", "{FFFFFF}There are currently no active APBs in the database.", "Close", "");
- else Dialog_Show(playerid, MDC_APBList, DIALOG_STYLE_LIST, "{FFFFFF}APB - All Active APBs", gstr, "Select", "Return");
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- if(GetPVarType(playerid, "apbID") == 1)
- {
- new id = GetPVarInt(playerid, "apbID");
- new date[6];
- TimestampToDate(apbData[id][apbTime], date[2], date[1], date[0], date[3], date[4], date[5]);
- format(gstr, sizeof(gstr), "[%s] %s deleted APB (%s | %s) [%02d/%02d/%02d %02d:%02d:%02d]", GetServerTimeString(), NameEx(playerid), apbData[id][apbBy], apbData[id][apbString], date[0], date[1], date[2], date[3], date[4], date[5]);
- apbData[id][apbString][0] = 0;
- apbData[id][apbRank][0] = 0;
- apbData[id][apbBy][0] = 0;
- apbData[id][apbListItem] = -1;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE apbs SET apbDeleted = 1, apbRemovedBy = '%e', apbRemovedTime = %i WHERE apbTimestamp = %i", NameEx(playerid), gettime(), apbData[id][apbTime]);
- mysql_pquery(conn, mquery);
- DeletePVar(playerid, "apbID");
- format(gstr, sizeof(gstr), "You have successfully deleted APB ID: %i", id);
- Dialog_Show(playerid, MDC_CreateS, DIALOG_STYLE_MSGBOX, "APB Deletion - Success", gstr, "Close", "");
- }
- }
- return true;
- }
- Dialog:MDC_911List(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- if(Faction[playerid] == FACTION_COP) Dialog_Show(playerid, MDC_Home, DIALOG_STYLE_LIST, "MDC - Dashboard", "Name Search\nPlate Search\nAll Points Bulletin\nRecent 911 calls", "Select", "Logout");
- else Dialog_Show(playerid, MDC_Home, DIALOG_STYLE_LIST, "MDC - Dashboard", "Recent 911 calls\nRequest Backup", "Select", "Logout");
- }
- if(response)
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- SetPVarInt(playerid, "mdcViewing", listitem);
- if(Faction[playerid] == FACTION_SACFD) mysql_format(conn, mquery, sizeof(mquery), "SELECT emergencyInfo,location,serviceType,callerNumber,timestamp,emerReason,nameGiven,nameRetrieved,unitsResponding,addInfo,unitsRes,callCleared FROM `911calls` WHERE serviceType = 1 ORDER BY timestamp DESC LIMIT 1 OFFSET %i", listitem);
- else if(IsESU{playerid} && Faction[playerid] == FACTION_COP) mysql_format(conn, mquery, sizeof(mquery), "SELECT emergencyInfo,location,serviceType,callerNumber,timestamp,emerReason,nameGiven,nameRetrieved,unitsResponding,addInfo,unitsRes,callCleared FROM `911calls` ORDER BY timestamp DESC LIMIT 1 OFFSET %i", listitem);
- else mysql_format(conn, mquery, sizeof(mquery), "SELECT emergencyInfo,location,serviceType,callerNumber,timestamp,emerReason,nameGiven,nameRetrieved,unitsResponding,addInfo,unitsRes,callCleared FROM `911calls` WHERE serviceType = 0 ORDER BY timestamp DESC LIMIT 1 OFFSET %i", listitem);
- mysql_pquery(conn, mquery, "mdc911Details", "i", playerid);
- }
- return true;
- }
- Dialog:MDC_911Details(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- if(Faction[playerid] == FACTION_SACFD) mysql_pquery(conn, "SELECT emergencyInfo,location,emerReason,serviceType,unitsRes,callCleared FROM `911calls` WHERE serviceType = 1 ORDER BY timestamp DESC LIMIT 20", "mdc911", "i", playerid);
- else if(IsESU{playerid} && Faction[playerid] == FACTION_COP) mysql_pquery(conn, "SELECT emergencyInfo,location,emerReason,serviceType,unitsRes,callCleared FROM `911calls` ORDER BY timestamp DESC LIMIT 20", "mdc911", "i", playerid);
- else mysql_pquery(conn, "SELECT emergencyInfo,location,emerReason,serviceType,unitsRes,callCleared FROM `911calls` WHERE serviceType = 0 ORDER BY timestamp DESC LIMIT 20", "mdc911", "i", playerid);
- }
- if(response)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- if(GetPVarInt(playerid, "mdcResponding") >= 5) Dialog_Show(playerid, MDC_911Menu, DIALOG_STYLE_LIST, "{FFFFFF}MDC - 911 Call Menu", "{0A0A0A}Set Responding\n{FFFFFF}Add Additional Notes\nContact Caller\nClear Call\n", "Select", "Return");
- else Dialog_Show(playerid, MDC_911Menu, DIALOG_STYLE_LIST, "{FFFFFF}MDC - 911 Call Menu", "{FFFFFF}Set Responding\nAdd Additional Notes\nContact Caller\nClear Call\n", "Select", "Return");
- }
- else
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- Dialog_Show(playerid, MDC_911Error, DIALOG_STYLE_MSGBOX, "{ffffff}MDC - 911 ERROR", "{FFFFFF}You can't access this menu from the station computer.", "Return", "");
- }
- }
- return true;
- }
- Dialog:MDC_911Menu(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- if(Faction[playerid] == FACTION_SACFD) mysql_pquery(conn, "SELECT emergencyInfo,location,emerReason,serviceType,unitsRes,callCleared FROM `911calls` WHERE serviceType = 1 ORDER BY timestamp DESC LIMIT 20", "mdc911", "i", playerid);
- else if(IsESU{playerid} && Faction[playerid] == FACTION_COP) mysql_pquery(conn, "SELECT emergencyInfo,location,emerReason,serviceType,unitsRes,callCleared FROM `911calls` ORDER BY timestamp DESC LIMIT 20", "mdc911", "i", playerid);
- else mysql_pquery(conn, "SELECT emergencyInfo,location,emerReason,serviceType,unitsRes,callCleared FROM `911calls` WHERE serviceType = 0 ORDER BY timestamp DESC LIMIT 20", "mdc911", "i", playerid);
- return true;
- }
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- if(Faction[playerid] == FACTION_SACFD) mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM 911calls WHERE serviceType = 1 ORDER BY timestamp DESC LIMIT 1 OFFSET %i", GetPVarInt(playerid, "mdcViewing"));
- else if(IsESU{playerid} && Faction[playerid] == FACTION_COP) mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM 911calls ORDER BY timestamp DESC LIMIT 1 OFFSET %i", GetPVarInt(playerid, "mdcViewing"));
- else mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM 911calls WHERE serviceType = 0 ORDER BY timestamp DESC LIMIT 1 OFFSET %i", GetPVarInt(playerid, "mdcViewing"));
- switch(listitem)
- {
- case 0:
- {
- mysql_pquery(conn, mquery, "mdcSetResponding", "i", playerid);
- }
- case 1:
- {
- Dialog_Show(playerid, MDC_911AddInfo, DIALOG_STYLE_INPUT, "MDC - Add Additional Info", "{FFFFFF}Input the additional information you wish to display:\n\t(Note: All previous notes will be deleted)", "Submit", "Return");
- }
- case 2:
- {
- mysql_pquery(conn, mquery, "mdcContactCaller", "i", playerid);
- }
- case 3:
- {
- mysql_pquery(conn, mquery, "mdcClearCall", "i", playerid);
- }
- }
- return true;
- }
- Dialog:MDC_911AddInfo(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- if(GetPVarInt(playerid, "mdcResponding") >= 5) Dialog_Show(playerid, MDC_911Menu, DIALOG_STYLE_LIST, "{FFFFFF}MDC - 911 Call Menu", "{0A0A0A}Set Responding\n{FFFFFF}Add Additional Notes\nContact Caller\nClear Call\n", "Select", "Return");
- else Dialog_Show(playerid, MDC_911Menu, DIALOG_STYLE_LIST, "{FFFFFF}MDC - 911 Call Menu", "{FFFFFF}Set Responding\nAdd Additional Notes\nContact Caller\nClear Call\n", "Select", "Return");
- }
- if(response)
- {
- if(strlen(inputtext) >= 3 && strlen(inputtext) <= 124)
- {
- if(Faction[playerid] == FACTION_SACFD) mysql_format(conn, mquery, sizeof(mquery), "SELECT timestamp FROM 911calls WHERE serviceType = 1 ORDER BY timestamp DESC LIMIT 1 OFFSET %i", GetPVarInt(playerid, "mdcViewing"));
- else if(IsESU{playerid} && Faction[playerid] == FACTION_COP) mysql_format(conn, mquery, sizeof(mquery), "SELECT timestamp FROM 911calls ORDER BY timestamp DESC LIMIT 1 OFFSET %i", GetPVarInt(playerid, "mdcViewing"));
- else mysql_format(conn, mquery, sizeof(mquery), "SELECT timestamp FROM 911calls WHERE serviceType = 0 ORDER BY timestamp DESC LIMIT 1 OFFSET %i", GetPVarInt(playerid, "mdcViewing"));
- mysql_pquery(conn, mquery, "mdcAddInfo", "is", playerid, inputtext);
- }
- else
- {
- Dialog_Show(playerid, MDC_911AddInfo, DIALOG_STYLE_INPUT, "MDC - Add Additional Info", "{FFFFFF}Input the additional information you wish to display:\n\t(Note: All previous notes will be deleted)", "Submit", "Return");
- }
- }
- return true;
- }
- Dialog:MDC_911Error(playerid, response, listitem, inputtext[])
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- if(Faction[playerid] == FACTION_COP) Dialog_Show(playerid, MDC_Home, DIALOG_STYLE_LIST, "{FFFFFF}MDC - Dashboard", "Name Search\nPlate Search\nAll Points Bulletin\nRecent 911 calls", "Select", "Logout");
- return true;
- }
- Dialog:MDC_911MenuError(playerid, response, listitem, inputtext[])
- {
- if(GetPVarInt(playerid, "mdcResponding") >= 5) Dialog_Show(playerid, MDC_911Menu, DIALOG_STYLE_LIST, "{FFFFFF}MDC - 911 Call Menu", "{0A0A0A}Set Responding\n{FFFFFF}Add Additional Notes\nContact Caller\nClear Call\n", "Select", "Return");
- else Dialog_Show(playerid, MDC_911Menu, DIALOG_STYLE_LIST, "{FFFFFF}MDC - 911 Call Menu", "{FFFFFF}Set Responding\nAdd Additional Notes\nContact Caller\nClear Call\n", "Select", "Return");
- return true;
- }
- Dialog:PoliceEquip(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(strcmp(inputtext, "Mountable GPS", true) == 0)
- {
- if(HasGPSMount[playerid] != 0)
- {
- HasGPSMount[playerid] = -1;
- MySQLUpdateInt(SQLID[playerid], "GPSMount", -1, "players");
- SendClientMessage(playerid, COLOR_WHITE, "Your previous GPS device has been destroyed.");
- SendClientMessage(playerid, COLOR_WHITE, "You can mount the GPS device to a vehicle using /attachgps. You can not mount the device onto faction or admin vehicles.");
- SendClientMessage(playerid, COLOR_BLUE, "Received: Mountable GPS");
- }
- else
- {
- HasGPSMount[playerid] = -1;
- MySQLUpdateInt(SQLID[playerid], "GPSMount", -1, "players");
- SendClientMessage(playerid, COLOR_BLUE, "Received: Mountable GPS");
- SendClientMessage(playerid, COLOR_WHITE, "You can mount the GPS device to a vehicle using /attachgps. You can not mount the device onto faction or admin vehicles.");
- }
- return true;
- }
- if(strcmp(inputtext, "Patrol Officer", true) == 0)
- {
- ResetPlayerWeaponsEx(playerid);
- SyncPlayerWeapons(playerid);
- if(WeaponData[playerid][GetWeaponSlot(24)][Weapon] == 0) GivePlayerWeaponEx(playerid, 24, GetDefaultWeaponAmmo(24), 3); //Desert Eaglefequip
- if(WeaponData[playerid][GetWeaponSlot(3)][Weapon] == 0) GivePlayerWeaponEx(playerid, 3, GetDefaultWeaponAmmo(3), 3); //Nitestick
- if(WeaponData[playerid][GetWeaponSlot(41)][Weapon] == 0) GivePlayerWeaponEx(playerid, 41, GetDefaultWeaponAmmo(41), 3); //Spray Can
- SetPlayerArmedWeapon(playerid, 0);
- SendClientMessage(playerid, COLOR_BLUE, "Received Patrol Officer Weapons & Equipment.");
- return true;
- }
- else if(strcmp(inputtext, "Detective", true) == 0)
- {
- ResetPlayerWeaponsEx(playerid);
- SyncPlayerWeapons(playerid);
- if(WeaponData[playerid][GetWeaponSlot(24)][Weapon] == 0) GivePlayerWeaponEx(playerid, 24, GetDefaultWeaponAmmo(24), 3); //Desert Eagle
- if(WeaponData[playerid][GetWeaponSlot(3)][Weapon] == 0) GivePlayerWeaponEx(playerid, 3, GetDefaultWeaponAmmo(3), 3); //Nitestick
- if(WeaponData[playerid][GetWeaponSlot(43)][Weapon] == 0) GivePlayerWeaponEx(playerid, 43, GetDefaultWeaponAmmo(43), 3); //Camera
- SetPlayerArmedWeapon(playerid, 0);
- SendClientMessage(playerid, COLOR_BLUE, "Received Detective Weapons & Equipment.");
- return true;
- }
- else if(strcmp(inputtext, "Disarm", true) == 0)
- {
- ResetPlayerWeaponsEx(playerid);
- SyncPlayerWeapons(playerid);
- SetPlayerArmedWeapon(playerid, 0);
- SendClientMessage(playerid, COLOR_BLUE, "You have disarmed yourself.");
- return true;
- }
- else if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- new wid = GetWeaponIdFromName(inputtext);
- if(wid == -1) return SysMsg(playerid, "Error.");
- new slot = GetWeaponSlot(wid);
- if(WeaponData[playerid][slot][Weapon] != 0) return SysMsg(playerid, "You already have a weapon of this type.");
- if(!WeaponCheck(playerid, wid)) return SysMsg(playerid, "You cannot get this weapon. You either have two sidearms or one primary weapon plus a sidearm on your person.");
- SyncPlayerWeapons(playerid);
- GivePlayerWeaponEx(playerid, wid, GetDefaultWeaponAmmo(wid), 3);
- SendClientMessageF(playerid, COLOR_BLUE, "Received %s", weaponstring[wid]);
- return true;
- }
- else return SysMsg(playerid, "You cannot carry any more weapons.");
- }
- return true;
- }
- Dialog:FireEquip(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(strcmp(inputtext, "Fire Extinguisher", true) == 0)
- {
- if(WeaponData[playerid][GetWeaponSlot(42)][Weapon] != 0) return SysMsg(playerid, "You already have a weapon of this type.");
- GivePlayerWeaponEx(playerid, 42, 99999, 3);
- SendClientMessage(playerid, COLOR_RED, "Received a Fire Extinguisher.");
- }
- else if(strcmp(inputtext, "Pole", true) == 0)
- {
- if(WeaponData[playerid][GetWeaponSlot(7)][Weapon] != 0) return SysMsg(playerid, "You already have a weapon of this type.");
- SendClientMessage(playerid, COLOR_RED, "Received a Pike Pole.");
- GivePlayerWeaponEx(playerid, 7, 5, 3);
- }
- else if(strcmp(inputtext, "Fire Axe", true) == 0)
- {
- if(WeaponData[playerid][GetWeaponSlot(15)][Weapon] != 0) return SysMsg(playerid, "You already have a weapon of this type.");
- SendClientMessage(playerid, COLOR_RED, "Received a Fire Axe.");
- GivePlayerWeaponEx(playerid, 15, 5, 3);
- }
- else if(strcmp(inputtext, "Shovel", true) == 0)
- {
- if(WeaponData[playerid][GetWeaponSlot(6)][Weapon] != 0) return SysMsg(playerid, "You already have a weapon of this type.");
- SendClientMessage(playerid, COLOR_RED, "Received a Shovel.");
- GivePlayerWeaponEx(playerid, 6, 5, 3);
- }
- else if(strcmp(inputtext, "Camera", true) == 0)
- {
- if(WeaponData[playerid][GetWeaponSlot(43)][Weapon] != 0) return SysMsg(playerid, "You already have a weapon of this type.");
- SendClientMessage(playerid, COLOR_RED, "Received a Camera.");
- GivePlayerWeaponEx(playerid, 43, 100, 3);
- }
- else if(strcmp(inputtext, "Chainsaw", true) == 0)
- {
- if(WeaponData[playerid][GetWeaponSlot(9)][Weapon] != 0) return SysMsg(playerid, "You already have a weapon of this type.");
- SendClientMessage(playerid, COLOR_RED, "Received a Chainsaw.");
- GivePlayerWeaponEx(playerid, 9, 5, 3);
- }
- else if(strmatch(inputtext, "Disarm"))
- {
- ResetPlayerWeaponsEx(playerid);
- SyncPlayerWeapons(playerid);
- SetPlayerArmedWeapon(playerid, 0);
- SendClientMessage(playerid, COLOR_BLUE, "You have disarmed yourself.");
- }
- }
- else return SysMsg(playerid, "You can't carry another weapon right now.");
- }
- return true;
- }
- Dialog:TutorialDialog(playerid, response, listitem, inputtext[])
- {
- gstr[0] = EOS;
- if(TutorialIndex[playerid] == 2)
- {
- TutorialIndex[playerid] = 3;
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, -156.0747, 1076.0804, 40.8421);
- SetPlayerCameraPos(playerid, -156.0747, 1076.0804, 34.8421);
- SetPlayerCameraLookAt(playerid, -158.6530, 1085.7030, 33.9706);
- strcat(gstr, "Red County Roleplay has a rather unique house system. The server offers over 800 houses which span across Red, Bone and Flint County.\n");
- strcat(gstr, "You may obtain a home of you own through a few simple means and they are the following.\nYou can get a home from a player or create an advertisement at any SAN building/townhall.\n");
- strcat(gstr, "You can also purchase homes by using /buyhouse right at the front door, assuming it isn't owned by anybody.\n");
- strcat(gstr, "Lastly, there is a propery faction on the server by the name of Silver Trading which sells houses and businesses from their office in Montgomery.\n");
- strcat(gstr, "You may purcahse furniture for your home from any furniture store located around the county. \nYou can place said furniture anywhere in your home, and you ");
- strcat(gstr, "can also apply different textures to the furniture you can buy, making every house unique!\n");
- strcat(gstr, "There are many other features that homes on the server offer to their owners, you can use '/help house' for the full list.");
- Dialog_Show(playerid, TutorialDialog, DIALOG_STYLE_MSGBOX, "Houses", gstr, "Continue", "");
- }
- else if(TutorialIndex[playerid] == 3)
- {
- TutorialIndex[playerid] = 4;
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, 1200.2905, 208.7031, 33.8517);
- SetPlayerCameraPos(playerid, 1200.2905, 208.7031, 28.8517);
- SetPlayerCameraLookAt(playerid, 1209.8973, 209.0386, 26.0953);
- strcat(gstr, "Red County Roleplay covers a large portion of the game's map. Since the roleplay area is so large, vehicles are essential for getting around.\n");
- strcat(gstr, "Vehicles can be purchased via dealerships that are currently spread out around Red County.\nBrand new vehicles are often");
- strcat(gstr, "more expensive than used cars which you can barter between players for, or you could try your luck with an auction on the forums.\n");
- strcat(gstr, "Once you obtain a vehicle, it should be worth mentioning that it can be stolen at any time.\nIf you wish to prevent your car being stolen, ");
- strcat(gstr, "you must keep it locked at all times when you're not using it.\nYou also need to keep your trunk locked as well, or else somebody will most likely rob its contents.\n");
- strcat(gstr, "You can set your vehicle to spawn anywhere you please using /savecar, however its parking position must be within the laws of the state, otherwise it will be towed.\n\n");
- strcat(gstr, "More info for vehicles can be found using: '/help vehicle'");
- Dialog_Show(playerid, TutorialDialog, DIALOG_STYLE_MSGBOX, "Vehicles", gstr, "Continue", "");
- }
- else if(TutorialIndex[playerid] == 4)
- {
- TutorialIndex[playerid] = 5;
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, 2183.0119, -114.5582, 31.2289);
- SetPlayerCameraPos(playerid, 2183.0119, -114.5582, 26.2289);
- SetPlayerCameraLookAt(playerid, 2173.2683, -112.3087, 22.0027);
- strcat(gstr, "There are over 300 businesses on the server, and much like houses they span across the entire roleplay area.\n");
- strcat(gstr, "Businesses function to create roleplay environments depending on its type.\nWhether it's a club, a Cafe, or a general store ");
- strcat(gstr, "they're all viable choices if you wish to create some roleplay.\nThey also grant their owners a bonus in their paychecks every payday.\n");
- strcat(gstr, "These business payouts can range from $500 to $5,000. You can also collect earnings from your business through small entrance fees as well as\n");
- strcat(gstr, "people purchasing items from your business, assuming it's a business that people can buy items from.\n\n");
- strcat(gstr, "More info for businesses can be found using: '/help bizz'");
- Dialog_Show(playerid, TutorialDialog, DIALOG_STYLE_MSGBOX, "Businesses", gstr, "Continue", "");
- }
- else if(TutorialIndex[playerid] == 5)
- {
- TutorialIndex[playerid] = 6;
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, 674.0645, -609.2480, 39.2767);
- SetPlayerCameraPos(playerid, 674.0645, -609.2480, 34.2767);
- SetPlayerCameraLookAt(playerid, 670.3184, -599.9761, 31.5203);
- strcat(gstr, "Moving on, there are a number of factions to chose from on Red County Roleplay.\nThere's always a number of factions that come and go, so ");
- strcat(gstr, "we won't get into specific factions.\nAs expected on any roleplay server, there are two essential factions that will always have a permanent spot.\nThe San Andreas State Police ");
- strcat(gstr, "enforce the law on the server, while the San Andreas County Fire Department is there for all medical and fire related problems.\nThere are plenty of illegal ");
- strcat(gstr, "factions, both official and unofficial which are available to provide roleplay for anybody who likes to roleplay a criminal.\n");
- strcat(gstr, "You can find out more information about all of the server's factions on our forums.");
- Dialog_Show(playerid, TutorialDialog, DIALOG_STYLE_MSGBOX, "Factions", gstr, "Continue", "");
- }
- else if(TutorialIndex[playerid] == 6)
- {
- TutorialIndex[playerid] = 7;
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, 113.4003, -272.2333, 25.2733);
- SetPlayerCameraPos(playerid, 113.4003, -272.2333, 20.2733);
- SetPlayerCameraLookAt(playerid, 121.5919, -266.4975, 18.3652);
- strcat(gstr, "We're almost done here! Most of the commands for communicating on this server are the standard commands you'd find on any roleplay server.\n");
- strcat(gstr, "For OOC communications, you may use /pm to send personal messages between yourself and another player. /b is used for the local OOC chat.\nIf you're hired into a faction, you can use /f to communicate with members of the same faction.\n");
- strcat(gstr, "For IC communication, you can use /l to speak quietly, /w to whisper to players, /s to shout at the top of your lungs. To speak normally ICly, all you need to do is type in the chat!");
- Dialog_Show(playerid, TutorialDialog, DIALOG_STYLE_MSGBOX, "Communication", gstr, "Continue", "");
- }
- else if(TutorialIndex[playerid] == 7)
- {
- TutorialIndex[playerid] = 7;
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, 274.1940, 96.9045, 28.7815);
- SetPlayerCameraPos(playerid, 274.1940, 96.9045, 23.7815);
- SetPlayerCameraLookAt(playerid, 264.3290, 97.7675, 22.3898);
- strcat(gstr, "Thank you for sitting through our tutorial. We hope the information provided has answered some of your questions, and if not you are more than welcome to create an assistance asking for help from the server's staff.\n");
- strcat(gstr, "Be sure to check the /help command first! Most of server's commands are listed there.\n");
- strcat(gstr, "If you ever find any players breaking the rules, be sure to /report them so the staff can deal with the player accordingly.\n");
- strcat(gstr, "Welcome to Greenside Roleplay, we hope you enjoy your stay!");
- Dialog_Show(playerid, TutorialDialog, DIALOG_STYLE_MSGBOX, "Conclusion", gstr, "Continue", "");
- }
- else if(TutorialIndex[playerid] == 9)
- {
- TutorialIndex[playerid] = 0;
- CompletedTutorial{playerid} = true;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE masters SET CompletedTutorial = 1 WHERE id = %i", MasterAccount[playerid]);
- mysql_pquery(conn, mquery);
- TogglePlayerControllable(playerid, 1);
- SetCameraBehindPlayer(playerid);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "You have completed the tutorial!");
- Logged{playerid} = true;
- JustSpawned{playerid} = true;
- SpawnPlayer(playerid);
- }
- return true;
- }
- Dialog:MakePDCall(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- CallType[playerid] = listitem;
- if(CallerService[playerid] == 911) CallerService[playerid] = 912; SendClientMessage(playerid, COLOR_WHITE, "911 Dispatch: OK, Tell us more about what's going on.");
- }
- else
- {
- if(CallerService[playerid] == 911)
- {
- SendClientMessage(playerid, COLOR_WHITE, "911 Dispatcher: Alright we will cancel our units. Thank you.");
- CallerService[playerid] = -1;
- HangupPhone(playerid);
- }
- }
- return true;
- }
- Dialog:MakeFDCall(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- CallType[playerid] = listitem;
- if(CallerService[playerid] == 911)
- {
- CallerService[playerid] = 912;
- SendClientMessage(playerid, COLOR_WHITE, "911 Dispatch: OK, Tell us more about what's going on.");
- }
- }
- else
- {
- if(CallerService[playerid] == 911)
- {
- SendClientMessage(playerid, COLOR_WHITE, "911 Dispatcher: Okay, we will cancel our units. Thank you.");
- CallerService[playerid] = -1;
- HangupPhone(playerid);
- }
- }
- return true;
- }
- Dialog:APWeapons(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- new wid = -1;
- if(strcmp(inputtext, "Mountable GPS", true) == 0)
- {
- if(HasGPSMount[playerid] != 0)
- {
- HasGPSMount[playerid] = -1;
- MySQLUpdateInt(SQLID[playerid], "GPSMount", -1, "players");
- SendClientMessage(playerid, COLOR_WHITE, "Your previous GPS device has been destroyed");
- SendClientMessage(playerid, COLOR_WHITE, "You can mount the GPS device to a vehicle using /attachgps. You can not mount the device onto faction or admin vehicles");
- SendClientMessage(playerid, COLOR_BLUE, "Received: Mountable GPS");
- wid = 999;
- }
- else
- {
- HasGPSMount[playerid] = -1;
- MySQLUpdateInt(SQLID[playerid], "GPSMount", -1, "players");
- SendClientMessage(playerid, COLOR_BLUE, "Received: Mountable GPS");
- SendClientMessage(playerid, COLOR_WHITE, "You can mount the GPS device to a vehicle using /attachgps. You can not mount the device onto faction or admin vehicles");
- wid = 999;
- }
- return true;
- }
- else if(strcmp(inputtext, "Disarm", true) == 0)
- {
- ResetPlayerWeaponsEx(playerid);
- SyncPlayerWeapons(playerid);
- SendClientMessage(playerid, COLOR_BLUE, "You have disarmed yourself.");
- return true;
- }
- wid = GetWeaponIdFromName(inputtext);
- if(wid == -1) return SysMsg(playerid, "Error.");
- if(WeaponData[playerid][GetWeaponSlot(wid)][Weapon] != 0) return SysMsg(playerid, "You already have a weapon of this type on you.");
- if(IsActualGun(wid) && !WeaponCheck(playerid, wid)) return SysMsg(playerid, "You cannot get this weapon. You either have two sidearms or one primary weapon plus a sidearm on your person.");
- GivePlayerWeaponEx(playerid, wid, GetDefaultWeaponAmmo(wid), 3);
- SetPlayerArmedWeapon(playerid, 0);
- if(wid != 999) SendClientMessageF(playerid, COLOR_BLUE, "Received Weapon: %s.", GetWeaponNameFromID(wid));
- }
- return true;
- }
- Dialog:FactionSubSpawn(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- new subspawn = strval(inputtext[0]);
- MySpawnID[playerid] = 2;
- BizzSpawn[playerid] = 0;
- SubFactionSpawn[playerid] = subspawn;
- mysql_pqueryf(conn, "UPDATE players SET MySpawnID = %i, BizzSpawn = %i, SubFactionSpawn = %i WHERE id = %i", MySpawnID[playerid], BizzSpawn[playerid], SubFactionSpawn[playerid], SQLID[playerid]);
- switch(subspawn)
- {
- case 1: format(gstr, sizeof(gstr), "You will now spawn at %s. [Faction: %s]", FACTIONS[Faction[playerid]][FactionSpawn1Name], GetFactionName(playerid));
- case 2: format(gstr, sizeof(gstr), "You will now spawn at %s. [Faction: %s]", FACTIONS[Faction[playerid]][FactionSpawn2Name], GetFactionName(playerid));
- case 3: format(gstr, sizeof(gstr), "You will now spawn at %s. [Faction: %s]", FACTIONS[Faction[playerid]][FactionSpawn3Name], GetFactionName(playerid));
- case 4: format(gstr, sizeof(gstr), "You will now spawn at %s. [Faction: %s]", FACTIONS[Faction[playerid]][FactionSpawn4Name], GetFactionName(playerid));
- case 5: format(gstr, sizeof(gstr), "You will now spawn at %s. [Faction: %s]", FACTIONS[Faction[playerid]][FactionSpawn5Name], GetFactionName(playerid));
- }
- ShowMessage(playerid, "Spawn Point", gstr, "OK");
- }
- return true;
- }
- Dialog:TaxiMenu(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- SetCameraBehindPlayer(playerid);
- HangupPhone(playerid);
- TogglePlayerControllable(playerid, 1);
- return true;
- }
- if(response == 1)
- {
- if(TaxiCount() == 0)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"Taxi Operator: 'Thanks for calling, there are currently no employees available, sorry.'");
- HangupPhone(playerid);
- return true;
- }
- new zone[MAX_ZONE_NAME];
- GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
- if(listitem == 0) // "Taxi"
- {
- format(gstr, sizeof(gstr), "Dispatcher: %s would like a taxi at their current location (%s) ((Go to the yellow marker to pick them up))",NameRP(playerid),zone);
- TaxiMessage(gstr);
- TaxiMarker(playerid);
- PlayerCalledTaxi[playerid] = 1;
- SendClientMessage(playerid,COLOR_YELLOW,"Red County Taxi: Thanks for calling, a Taxi should be there soon. You can cancel using /canceltaxi");
- HangupPhone(playerid);
- }
- if(listitem == 1)
- {
- format(gstr, sizeof(gstr), "Dispatcher: %s would like a taxi at their current location (%s) ((Go to the yellow marker to pick them up))",NameRP(playerid),zone);
- TaxiMessage(gstr);
- TaxiMarker(playerid);
- PlayerCalledTaxi[playerid] = 1;
- SendClientMessage(playerid,COLOR_YELLOW,"Red County Taxi: Thanks for calling, a Taxi should be there soon. You can cancel using /canceltaxi");
- HangupPhone(playerid);
- }
- else if(response == 0) HangupPhone(playerid);
- return true;
- }
- return true;
- }
- Dialog:TruckingTrailers(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(strcmp("Article Trailer 1", inputtext, false) == 0)
- {
- CreateVehicleEx(435, 622.3498, 1670.0978, 6.9922, 33.932495, 1, 1, -1);
- SendClientMessage(playerid, COLOR_WHITE, "Trailer Retrieved: Article Trailer 1");
- }
- else if(strcmp("Article Trailer 2", inputtext, false) == 0)
- {
- CreateVehicleEx(450, 622.3498, 1670.0978, 6.9922, 33.932495, 1, 1, -1);
- SendClientMessage(playerid, COLOR_WHITE, "Trailer Retrieved: Article Trailer 2");
- }
- else if(strcmp("Article Trailer 3", inputtext, false) == 0)
- {
- CreateVehicleEx(591, 622.3498, 1670.0978, 6.9922, 33.932495, 1, 1, -1);
- SendClientMessage(playerid, COLOR_WHITE, "Trailer Retrieved: Article Trailer 3");
- }
- else if(strcmp("Petrol Trailer", inputtext, false) == 0)
- {
- CreateVehicleEx(584, 622.3498, 1670.0978, 6.9922, 33.932495, 1, 1, -1);
- SendClientMessage(playerid, COLOR_WHITE, "Trailer Retrieved: Article Trailer 3");
- }
- else if(strcmp("Utility Trailer", inputtext, false) == 0)
- {
- CreateVehicleEx(611, 622.3498, 1670.0978, 6.9922, 33.932495, 1, 1, -1);
- SendClientMessage(playerid, COLOR_WHITE, "Trailer Retrieved: Utility Trailer");
- }
- }
- return true;
- }
- Dialog:ImpoundMenu(playerid, response, listitem, inputtext[])
- {
- if(!response) return ClearClothingSelection(playerid);
- if(strmatch(inputtext, "<< Previous Page"))
- {
- MemberListIndex[playerid]--;
- ShowImpoundList(playerid, MemberListIndex[playerid]);
- return true;
- }
- else if(strmatch(inputtext, "Next Page >>"))
- {
- MemberListIndex[playerid]++;
- ShowImpoundList(playerid, MemberListIndex[playerid]);
- return true;
- }
- gstr[0] = EOS;
- new nam[MAX_PLAYER_NAME], rank, nam2[MAX_PLAYER_NAME];
- for(new v = 0, x = MAX_VEHICLES; v < x; v++)
- {
- if(ImpoundData[v][iModel] > 399)
- {
- new item = listitem * (MemberListIndex[playerid] + 1);
- if(ClothingSelected[playerid][item] == v)
- {
- MySQLFetchInt(ImpoundData[v][iImpoundedBy], "FactionRank", rank, "players");
- nam = GetSQLName(ImpoundData[v][iImpoundedBy]);
- if(ImpoundData[v][iOwnerSQLID] > 0)
- {
- MySQLFetchString(ImpoundData[v][iOwnerSQLID], "Name", nam2, "players");
- format(gstr, sizeof(gstr), "VEHICLE IMPOUND DATABASE\n\n%s\nOwner: %s\nRegistration: %s\nImpounded By: %s %s\nColor: %s/%s\nRelease Fee: $%i\nImpound Reason: %s\nTime Remaining: %i minutes", GetVehicleNameEx(ImpoundData[v][iModel]), nam2,
- ImpoundData[v][iRegPlate], GetFactionRankName(FACTION_COP, rank), nam, VehicleColors[ImpoundData[v][iColor1]], VehicleColors[ImpoundData[v][iColor2]], ImpoundData[v][iImpoundFee], ImpoundData[v][iImpoundReason], ImpoundData[v][iImpoundTime]);
- }
- else if(ImpoundData[v][iFaction] > 0)
- {
- format(gstr, sizeof(gstr), "VEHICLE IMPOUND DATABASE\n\n%s\nOwner: %s\nRegistration: %s\nImpounded By: %s %s\nColor: %s/%s\nRelease Fee: $%i\nImpound Reason: %s\nTime Remaining: %i minutes", GetVehicleNameEx(ImpoundData[v][iModel]), FACTIONS[ImpoundData[v][iFaction]][FactionName],
- ImpoundData[v][iRegPlate], GetFactionRankName(FACTION_COP, rank), nam, VehicleColors[ImpoundData[v][iColor1]], VehicleColors[ImpoundData[v][iColor2]], ImpoundData[v][iImpoundFee], ImpoundData[v][iImpoundReason], ImpoundData[v][iImpoundTime]);
- }
- ReleasingImpoundedVehicle[playerid] = v;
- ClearClothingSelection(playerid);
- Dialog_Show(playerid, ImpoundRelease, DIALOG_STYLE_MSGBOX, "Impound Details", gstr, "Release", "Return");
- return true;
- }
- }
- }
- ClearClothingSelection(playerid); //just in case.
- return true;
- }
- Dialog:ImpoundRelease(playerid, response, listitem, inputtext[])
- {
- if(!response) return ReleasingImpoundedVehicle[playerid] = 0;
- format(sgstr, sizeof(sgstr), "Are you sure you want to release this %s?", GetVehicleNameEx(ImpoundData[ReleasingImpoundedVehicle[playerid]][iModel]));
- Dialog_Show(playerid, ImpoundReleaseConfirm, DIALOG_STYLE_MSGBOX, "Impound Release - Are you sure?", sgstr, "Yes", "Cancel");
- return true;
- }
- Dialog:ImpoundReleaseConfirm(playerid, response, listitem, inputtext[])
- {
- if(!response) return ReleasingImpoundedVehicle[playerid] = 0;
- new v = ReleasingImpoundedVehicle[playerid];
- if(ImpoundData[v][iModel] > 399)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "You have released a vehicle (%s) from the impound. The owner will now have to collect it.", GetVehicleNameEx(ImpoundData[v][iModel]));
- ImpoundData[v][iImpoundTime] = 0;
- ReleasingImpoundedVehicle[playerid] = 0;
- return true;
- }
- ReleasingImpoundedVehicle[playerid] = 0;
- return true;
- }
- Dialog:MyImpounds(playerid, response, listitem, inputtext[])
- {
- if(!response) return ClearClothingSelection(playerid);
- for(new v = 0, x = MAX_VEHICLES; v < x; v++)
- {
- if(ClothingSelected[playerid][listitem] == v)
- {
- ClearClothingSelection(playerid);
- if(ImpoundData[v][iOwnerSQLID] == SQLID[playerid] || ImpoundData[v][iFaction] == Faction[playerid] && Faction[playerid] != 0)
- {
- if(ImpoundData[v][iImpoundTime] > 0) return SysMsg(playerid, "This vehicle is not ready to be released. Please wait to specified time first.");
- if(Cash[playerid] < ImpoundData[v][iImpoundFee]) return SysMsg(playerid, "You do not have enough cash to release this vehicle.");
- ReleasingImpoundedVehicle[playerid] = v;
- gstr[0] = EOS;
- format(gstr, sizeof(gstr), "RELEASE VEHICLE FROM IMPOUND\n\n%s\nRelease Fee: $%i\nImpound Reason: %s\n\nDo you want to release this vehicle from the impound?\nIf yes, you will pay the $%i release fee.", GetVehicleNameEx(ImpoundData[v][iModel]), ImpoundData[v][iImpoundFee], ImpoundData[v][iImpoundReason], ImpoundData[v][iImpoundFee]);
- Dialog_Show(playerid, MyImpoundsConfirm, DIALOG_STYLE_MSGBOX, "Release Impounded Vehicle", gstr, "Yes", "No");
- return true;
- }
- }
- }
- ClearClothingSelection(playerid); //just in case
- return true;
- }
- Dialog:MyImpoundsConfirm(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- new idx = ReleasingImpoundedVehicle[playerid];
- if(ImpoundData[idx][iVehType] == 1)
- {
- if(ImpoundData[idx][iOwnerSQLID] != SQLID[playerid]) return SysMsg(playerid, "You are not the owner of this vehicle.");
- GivePlayerCash(playerid, -ImpoundData[idx][iImpoundFee]);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET Impounded = 0, ImpoundTime = 0, ImpoundedBy = 0, ImpoundFee = 0, ImpoundReason = '' WHERE id = %i", ImpoundData[idx][iSQLID]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM vehicles WHERE id = %i AND RegPlate = '%e'", ImpoundData[idx][iSQLID], ImpoundData[idx][iRegPlate]);
- mysql_pquery(conn, mquery, "LoadImpoundedVehicle", "i", playerid);
- }
- else if(ImpoundData[idx][iVehType] == 2)
- {
- if(ImpoundData[idx][iFaction] != Faction[playerid]) return SysMsg(playerid, "You are not in the faction of this vehicle.");
- GivePlayerCash(playerid, -ImpoundData[idx][iImpoundFee]);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE fveh SET Impounded = 0, ImpoundTime = 0, ImpoundedBy = 0, ImpoundFee = 0, ImpoundReason = '' WHERE id = %i", ImpoundData[idx][iSQLID]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM fveh WHERE id = %i AND RegPlate = '%e'", ImpoundData[idx][iSQLID], ImpoundData[idx][iRegPlate]);
- mysql_pquery(conn, mquery, "LoadImpoundedFVehicle", "i", playerid);
- }
- SendClientMessageF(playerid, COLOR_WHITE, "Your %s has been released from the impound and you have paid the $%i release fee.", GetVehicleNameEx(ImpoundData[idx][iModel]), ImpoundData[idx][iImpoundFee]);
- ImpoundData[idx][iSQLID] = 0;
- ImpoundData[idx][iColor1] = 0;
- ImpoundData[idx][iColor2] = 0;
- ImpoundData[idx][iImpoundTime] = 0;
- ImpoundData[idx][iImpoundFee] = 0;
- ImpoundData[idx][iImpoundedBy] = 0;
- ImpoundData[idx][iModel] = 0;
- ImpoundData[idx][iFaction] = 0;
- ImpoundData[idx][iOwnerSQLID] = 0;
- ReleasingImpoundedVehicle[playerid] = 0;
- }
- return true;
- }
- //Fim da parte 5
- Dialog:CafeMenu(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- switch(listitem)
- {
- case 0://Tea
- {
- new Float:CurHealth;
- GetPlayerHealth(playerid,CurHealth);
- if(!PlayerImprisoned{playerid})
- {
- if(Cash[playerid] < 1)
- {
- SysMsg(playerid,"You don't have enough cash to buy that.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- GivePlayerCash(playerid,-1);
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have bought Tea which costs $1");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "[Prison Cafe] Cup of Tea at no cost.");
- if(CurHealth + 5.0 < 100.0) SetPlayerHealthEx(playerid,CurHealth + 5.0);
- else SetPlayerHealthEx(playerid,100.0);
- format(gstr, sizeof(gstr),"* %s drinks their tea. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- TogglePlayerControllable(playerid,1);
- UnlockAchievement(playerid, 65);
- if(IsInBizzID[playerid] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 1;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- case 1://Coffee
- {
- new Float:CurHealth;
- GetPlayerHealth(playerid,CurHealth);
- if(!PlayerImprisoned{playerid})
- {
- if(Cash[playerid] < 1)
- {
- SysMsg(playerid,"You don't have enough cash to buy that.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- GivePlayerCash(playerid,-1);
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have bought Coffee which costs $1");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "[Prison Cafe] Cup of Coffee at no cost.");
- if(CurHealth + 5.0 < 100.0) SetPlayerHealthEx(playerid,CurHealth + 5.0);
- else SetPlayerHealthEx(playerid,100.0);
- format(gstr, sizeof(gstr),"* %s drinks their coffee. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- TogglePlayerControllable(playerid,1);
- UnlockAchievement(playerid, 65);
- if(IsInBizzID[playerid] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 1;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- case 2://Cola
- {
- new Float:CurHealth;
- GetPlayerHealth(playerid,CurHealth);
- if(!PlayerImprisoned{playerid})
- {
- if(Cash[playerid] < 2)
- {
- SysMsg(playerid,"You don't have enough cash to buy that.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- GivePlayerCash(playerid,-2);
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have bought Cola which costs $2");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "[Prison Cafe] Cola at no cost.");
- if(CurHealth + 8.0 < 100.0) SetPlayerHealthEx(playerid,CurHealth + 8.0);
- else SetPlayerHealthEx(playerid,100.0);
- format(gstr, sizeof(gstr),"* %s drinks their Cola. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- TogglePlayerControllable(playerid,1);
- UnlockAchievement(playerid, 65);
- if(IsInBizzID[playerid] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 2;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- case 3://Toast
- {
- new Float:CurHealth;
- GetPlayerHealth(playerid,CurHealth);
- if(!PlayerImprisoned{playerid})
- {
- if(Cash[playerid] < 2)
- {
- SysMsg(playerid,"You don't have enough cash to buy that.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- GivePlayerCash(playerid,-2);
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have bought Toast which costs $2");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "[Prison Cafe] Couple of slices of toast at no cost.");
- if(CurHealth + 10.0 < 100.0) SetPlayerHealthEx(playerid,CurHealth + 10.0);
- else SetPlayerHealthEx(playerid,100.0);
- format(gstr, sizeof(gstr),"* %s eats their toast. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- TogglePlayerControllable(playerid,1);
- UnlockAchievement(playerid, 65);
- if(IsInBizzID[playerid] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 2;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- case 4://Soup
- {
- new Float:CurHealth;
- GetPlayerHealth(playerid,CurHealth);
- if(!PlayerImprisoned{playerid})
- {
- if(Cash[playerid] < 3)
- {
- SysMsg(playerid,"You don't have enough cash to buy that.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- GivePlayerCash(playerid,-3);
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have bought Soup which costs $3");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "[Prison Cafe] Cup of Soup at no cost.");
- if(CurHealth + 13.0 < 100.0) SetPlayerHealthEx(playerid,CurHealth + 13.0);
- else SetPlayerHealthEx(playerid,100.0);
- format(gstr, sizeof(gstr),"* %s eats their soup. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- TogglePlayerControllable(playerid,1);
- UnlockAchievement(playerid, 65);
- if(IsInBizzID[playerid] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 3;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- case 5://Fries
- {
- new Float:CurHealth;
- GetPlayerHealth(playerid,CurHealth);
- if(!PlayerImprisoned{playerid})
- {
- if(Cash[playerid] < 4)
- {
- SysMsg(playerid,"You don't have enough cash to buy that.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- GivePlayerCash(playerid,-4);
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have bought Fries which costs $4");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "[Prison Cafe] Plate of Fries at no cost.");
- if(CurHealth + 15.0 < 100.0) SetPlayerHealthEx(playerid,CurHealth + 15.0);
- else SetPlayerHealthEx(playerid,100.0);
- format(gstr, sizeof(gstr),"* %s eats their fries. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- TogglePlayerControllable(playerid,1);
- UnlockAchievement(playerid, 65);
- if(IsInBizzID[playerid] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 4;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- case 6://Burger
- {
- new Float:CurHealth;
- GetPlayerHealth(playerid,CurHealth);
- if(!PlayerImprisoned{playerid})
- {
- if(Cash[playerid] < 5)
- {
- SysMsg(playerid,"You don't have enough cash to buy that.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- GivePlayerCash(playerid,-5);
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have bought a Burger which costs $5");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "[Prison Cafe] Burger at no cost.");
- if(CurHealth + 20.0 < 100.0) SetPlayerHealthEx(playerid,CurHealth + 20.0);
- else SetPlayerHealthEx(playerid,100.0);
- format(gstr, sizeof(gstr),"* %s eats their grease-dripping burger. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- TogglePlayerControllable(playerid,1);
- UnlockAchievement(playerid, 65);
- if(IsInBizzID[playerid] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 5;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- case 7://Double Whopper Cheeseburger
- {
- new Float:CurHealth;
- GetPlayerHealth(playerid,CurHealth);
- if(!PlayerImprisoned{playerid})
- {
- if(Cash[playerid] < -5)
- {
- SysMsg(playerid,"You don't have enough cash to buy that.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- GivePlayerCash(playerid,-5);
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have bought a Double Whopper Cheeseburger for $20");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "[Prison Cafe] Double Whopper Cheeseburger at no cost.");
- if(CurHealth + 30.0 < 100.0) SetPlayerHealthEx(playerid,CurHealth + 30.0);
- else SetPlayerHealthEx(playerid,100.0);
- format(gstr, sizeof(gstr),"* %s eats a huge Double Whopper Cheeseburger . *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- TogglePlayerControllable(playerid,1);
- UnlockAchievement(playerid, 65);
- if(IsInBizzID[playerid] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 20;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- }
- }
- return true;
- }
- Dialog:FoodMenu(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- switch(listitem)
- {
- case 0://Small
- {
- new Float:CurHealth;
- GetPlayerHealth(playerid,CurHealth);
- if(Cash[playerid] < 2)
- {
- SysMsg(playerid,"You don't have enough cash to buy that.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- GivePlayerCash(playerid,-2);
- if(CurHealth + 30.0 < 100.0) SetPlayerHealthEx(playerid,CurHealth + 30.0);
- else SetPlayerHealthEx(playerid,100.0);
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have bought a Buster Meal which costs $2");
- format(gstr, sizeof(gstr),"* %s eats their Buster Meal. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- TogglePlayerControllable(playerid,1);
- UnlockAchievement(playerid, 65);
- if(IsInBizzID[playerid] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 2;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- case 1://Medium
- {
- new Float:CurHealth;
- GetPlayerHealth(playerid,CurHealth);
- if(Cash[playerid] < 5)
- {
- SysMsg(playerid,"You don't have enough cash to buy that.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- GivePlayerCash(playerid,-5);
- if(CurHealth + 50.0 < 100.0) SetPlayerHealthEx(playerid,CurHealth + 50.0);
- else SetPlayerHealthEx(playerid,100.0);
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have bought a Double D-Luxe which costs $5");
- format(gstr, sizeof(gstr),"* %s eats their medium pizza meal. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- TogglePlayerControllable(playerid,1);
- UnlockAchievement(playerid, 65);
- if(IsInBizzID[playerid] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 5;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- case 2://Large
- {
- new Float:CurHealth;
- GetPlayerHealth(playerid,CurHealth);
- if(Cash[playerid] < 10)
- {
- SysMsg(playerid,"You don't have enough cash to buy that.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- GivePlayerCash(playerid,-10);
- SetPlayerHealthEx(playerid,100.0);
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have bought a Full Rack Meal which costs $10");
- format(gstr, sizeof(gstr),"* %s eats their Full Rack meal. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- TogglePlayerControllable(playerid,1);
- if(IsInBizzID[playerid] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 10;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- case 3://Salad
- {
- new Float:CurHealth;
- GetPlayerHealth(playerid,CurHealth);
- if(Cash[playerid] < 10)
- {
- SysMsg(playerid,"You don't have enough cash to buy that.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- GivePlayerCash(playerid,-10);
- if(CurHealth + 25.0 < 100.0) SetPlayerHealthEx(playerid,CurHealth + 25.0);
- else SetPlayerHealthEx(playerid,100.0);
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have bought a salad meal which costs $10");
- format(gstr, sizeof(gstr),"* %s eats their salad. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- TogglePlayerControllable(playerid,1);
- UnlockAchievement(playerid, 65);
- if(IsInBizzID[playerid] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 10;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- }
- }
- return true;
- }
- Dialog:SexShopMenu(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(GetFreeWeaponObjectIndex(playerid) != -1)
- {
- if(strcmp("Long Purple Dildo - $3500", inputtext, true) == 0)
- {
- new slot = GetWeaponSlot(10);
- if(WeaponData[playerid][slot][Weapon] == 10) return SysMsg(playerid, "You cannot currently have a dildo. ((You already have a weapon in the dildo slot))");
- if(Cash[playerid] < 3500) return SysMsg(playerid, "You do not have enough money for this sex toy.");
- GivePlayerCash(playerid, -3500);
- GivePlayerWeaponEx(playerid, 10, 1, 7);
- SendClientMessage(playerid, COLOR_WHITE, "You have bought a Long Purple Dildo for $3,500. Have fun with it!");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 100;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- return true;
- }
- else if(strcmp("Small White Vibrator - $2995", inputtext, true) == 0)
- {
- new slot = GetWeaponSlot(11);
- if(WeaponData[playerid][slot][Weapon] == 11) return SysMsg(playerid, "You cannot currently have a dildo. ((You already have a weapon in the dildo slot))");
- if(Cash[playerid] < 2995) return SysMsg(playerid, "You do not have enough money for this sex toy.");
- GivePlayerCash(playerid, -2995);
- GivePlayerWeaponEx(playerid, 11, 1, 7);
- SendClientMessage(playerid, COLOR_WHITE, "You have bought a Small White Vibrator for $2,995. Have fun with it!");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 100;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- return true;
- }
- else if(strcmp("Large White Vibrator - $6250", inputtext, true) == 0)
- {
- new slot = GetWeaponSlot(10);
- if(WeaponData[playerid][slot][Weapon] == 12) return SysMsg(playerid, "You cannot currently have a dildo. ((You already have a weapon in the dildo slot))");
- if(Cash[playerid] < 6250) return SysMsg(playerid, "You do not have enough money for this sex toy.");
- GivePlayerCash(playerid, -6250);
- GivePlayerWeaponEx(playerid, 12, 1, 7);
- SendClientMessage(playerid, COLOR_WHITE, "You have bought a Large White Vibrator for $6,250. Have fun with it!");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 100;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- return true;
- }
- else if(strcmp("Silver Vibrator - $5000", inputtext, true) == 0)
- {
- new slot = GetWeaponSlot(10);
- if(WeaponData[playerid][slot][Weapon] == 13) return SysMsg(playerid, "You cannot currently have a dildo. ((You already have a weapon in the dildo slot))");
- if(Cash[playerid] < 5000) return SysMsg(playerid, "You do not have enough money for this sex toy.");
- GivePlayerCash(playerid, -5000);
- GivePlayerWeaponEx(playerid, 13, 1, 7);
- SendClientMessage(playerid, COLOR_WHITE, "You have bought a Silver Vibrator for $5,000. Have fun with it!");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 100;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- return true;
- }
- else if(strcmp("Nite Stick - $1200", inputtext, true) == 0)
- {
- new slot = GetWeaponSlot(10);
- if(WeaponData[playerid][slot][Weapon] == 3) return SysMsg(playerid, "You cannot currently have a sex toy. ((You already have a weapon in the nitestick slot))");
- if(Cash[playerid] < 1200) return SysMsg(playerid, "You do not have enough money for this sex toy.");
- GivePlayerCash(playerid, -1200);
- GivePlayerWeaponEx(playerid, 3, 1, 7);
- SendClientMessage(playerid, COLOR_WHITE, "You have bought a Nite Stick for $1,200. Have fun with it!");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 100;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- return true;
- }
- }
- else return SysMsg(playerid, "You can't carry anymore weapons right now.");
- }
- return true;
- }
- Dialog:DrugShopDialog(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(strcmp("Rolling Paper (x10) - $40", inputtext, true) == 0)
- {
- if(Inventory[playerid][RollingPaper] + 10 > MAX_ROLLINGPAPER) return SysMsg(playerid, "You can't carry another batch of Rolling Papers.");
- if(Cash[playerid] < 40) return SysMsg(playerid, "You do not have enough money for this item.");
- GivePlayerCash(playerid, -40);
- Inventory[playerid][RollingPaper] += 10;
- MySQLUpdateInt(SQLID[playerid], "RollingPaper", Inventory[playerid][RollingPaper], "players");
- format(gstr, sizeof(gstr), "You have bought 10 Rolling Papers for $40. You now have a total of %i.", Inventory[playerid][RollingPaper]);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 15;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Bong - $1350", inputtext, true) == 0)
- {
- if(Inventory[playerid][Bong] == 1) return SysMsg(playerid, "You already have a Bong.");
- if(Cash[playerid] < 1350) return SysMsg(playerid, "You do not have enough money for this item.");
- GivePlayerCash(playerid, -1350);
- Inventory[playerid][Bong] = 1;
- MySQLUpdateInt(SQLID[playerid], "Bong", Inventory[playerid][Bong], "players");
- SendClientMessage(playerid, COLOR_WHITE, "You have bought a Bong for $1,350.");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 100;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Weed Seed (x10) - $750", inputtext, true) == 0)
- {
- if(PlayerLevel[playerid] < 5) return SysMsg(playerid, "You need to be at least level 5 in order to buy this item.");
- if(Inventory[playerid][WeedSeed] + 10 > MAX_WEEDSEED) return SysMsg(playerid, "You can't carry another batch of Weed Seeds.");
- if(Cash[playerid] < 750) return SysMsg(playerid, "You do not have enough money for this item.");
- GivePlayerCash(playerid, -750);
- Inventory[playerid][WeedSeed] += 10;
- MySQLUpdateInt(SQLID[playerid], "HasWeedSeed", Inventory[playerid][WeedSeed], "players");
- format(gstr, sizeof(gstr), "You have bought 10 weed seeds for $750. You now have a total of %i.", Inventory[playerid][WeedSeed]);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 250;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- else if(strcmp("Bottle of distilled water - $6",inputtext,true) == 0)
- {
- if(Cash[playerid] < 6)
- {
- ShowMessage(playerid,"Shop Message","You don't have enough cash to buy that.", "Ok");
- return true;
- }
- if(Inventory[playerid][Water] + 1 > 24)
- {
- ShowMessage(playerid,"Shop Message","You may only have 24 bottles of water at any one time.", "Ok");
- return true;
- }
- GivePlayerCash(playerid, -6);
- Inventory[playerid][Water] += 1;
- MySQLUpdateFloat(SQLID[playerid], "HasWater", Inventory[playerid][Water], "players");
- SendClientMessage(playerid, COLOR_WHITE, "You have bought a bottle (1L) of distilled water for $6.");
- if(IsInBizzID[playerid] > 0 && BizzData[IsInBizzID[playerid]][BizzOwnerSQLID] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzEarnings] += 6;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "BizzEarnings", BizzData[IsInBizzID[playerid]][BizzEarnings], "bizz");
- if(BizzData[IsInBizzID[playerid]][BizzStock] > 0)
- {
- BizzData[IsInBizzID[playerid]][BizzStock] --;
- MySQLUpdateInt(BizzData[IsInBizzID[playerid]][BizzSQLID], "Stock", BizzData[IsInBizzID[playerid]][BizzStock], "bizz");
- }
- }
- }
- }
- return true;
- }
- Dialog:TruckingRoutes(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- IsTrucking[playerid] = 1;
- TruckIndex[playerid] = 0;
- new routeid = -1;
- new model = GetVehicleModel(GetPlayerVehicleID(playerid));
- if(strcmp("Select Random", inputtext, true) == 0)
- {
- if(model == 498) routeid = 20 + random(3); //last 3 only for boxville
- else routeid = random(sizeof(TruckRoutes)-3); //fisrt 20 only
- }
- else
- {
- if(model == 498) routeid = 20 + (listitem - 1);
- else routeid = listitem - 1;
- }
- TruckRouteId[playerid] = routeid;
- SetPlayerCheckpointEx(playerid, TruckRoutes[routeid][TruckRoutePoints][0], TruckRoutes[routeid][TruckRoutePoints][1], TruckRoutes[routeid][TruckRoutePoints][2], 7.0);
- if(model == 498)
- {
- SendClientMessage(playerid, COLOR_ORANGE, "[VAN COURIER JOB]");
- SendClientMessageF(playerid, COLOR_ORANGE, "Collect items from: %s", TruckRoutes[routeid][TruckRouteStart]);
- SendClientMessageF(playerid, COLOR_ORANGE, "Deliver to: %s", TruckRoutes[routeid][TruckRouteEnd]);
- SendClientMessageF(playerid, COLOR_ORANGE, "Contents: %s", TruckRoutes[routeid][TruckRouteLoad]);
- }
- else
- {
- SendClientMessage(playerid, COLOR_ORANGE, "[TRUCKING JOB]");
- SendClientMessageF(playerid, COLOR_ORANGE, "Collect load from: %s", TruckRoutes[routeid][TruckRouteStart]);
- SendClientMessageF(playerid, COLOR_ORANGE, "Deliver to: %s", TruckRoutes[routeid][TruckRouteEnd]);
- SendClientMessageF(playerid, COLOR_ORANGE, "Hauling: %s", TruckRoutes[routeid][TruckRouteLoad]);
- }
- SendClientMessage(playerid, COLOR_WHITE, "Go to the marker now and collect the load.");
- }
- return true;
- }
- Dialog:AdminCarList(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- strdel(inputtext, 3, strlen(inputtext));
- return cmd_acars(playerid, "");
- }
- return true;
- }
- Dialog:ClothingItemMenu(playerid, response, listitem, inputtext[])
- {
- /*new i, Float:xoff = 0.8007, Float:xstart = 2243.5764;*/
- if(response == 1)
- {
- /*SetPlayerPos(playerid, 2247.5, 35.90000153, 26.5);
- SetPlayerInterior(playerid, 5);
- SetPlayerVirtualWorldEx(playerid, playerid+159753);
- TogglePlayerControllable(playerid, 0);
- SetPlayerCameraPos(playerid, 2243.5764, 39.6202, 26.7999);
- SetPlayerCameraLookAt(playerid, 2243.5764, 49.6202, 26.7999);
- IsBrowsingMasks[playerid] = 1;*/
- if(listitem == 0)
- {
- BrowseMaskType[playerid] = 1;
- /*format(gstr, sizeof(gstr), "~b~%s~n~~w~< ~b~ 1 ~w~>", GetMaskDescription(Clothing_Masks[0]));
- PlayerTextDrawSetString(playerid, MaskHelpText[playerid], gstr);
- PlayerTextDrawShow(playerid, MaskHelpText[playerid]);
- for(i = 0; i < sizeof(Clothing_Masks); i++)
- {
- Clothing_Objects[playerid][i] = CreateDynamicObject(Clothing_Masks[i], xstart, 41.09999847, 26.89999962, -30.0, 0.0, -60.0, -1, 5, playerid);
- xstart += xoff;
- }
- SendClientMessage(playerid, COLOR_WHITE, "Use the left and right keys to select a mask then use the {009FFB}~k~~VEHICLE_ENTER_EXIT~ {FFFFFF}key to buy it for {009000}$25");
- SendClientMessage(playerid, COLOR_WHITE, "Type /cancelshop to return to the shop without making a purchase.");*/
- ShowModelSelectionMenu(playerid, "Masks", MODEL_SELECTION_ACESSORY, Clothing_Masks, sizeof Clothing_Masks, 0.0, 0.0, 0.0);
- }
- else if(listitem == 1)
- {
- BrowseMaskType[playerid] = 2;
- /*format(gstr, sizeof(gstr), "~b~%s~n~~w~< ~b~ 1 ~w~>", GetMaskDescription(Clothing_Bandanas[0]));
- PlayerTextDrawSetString(playerid, MaskHelpText[playerid], gstr);
- PlayerTextDrawShow(playerid, MaskHelpText[playerid]);
- for(i = 0; i < sizeof(Clothing_Bandanas); i++)
- {
- Clothing_Objects[playerid][i] = CreateDynamicObject(Clothing_Bandanas[i], xstart, 41.09999847, 26.89999962, -30.0, 0.0, -60.0, -1, 5, playerid);
- xstart += xoff;
- }
- SendClientMessage(playerid, COLOR_WHITE, "Use the left and right keys to select a mask then use the {009FFB}~k~~VEHICLE_ENTER_EXIT~ {FFFFFF}key to buy it for {009000}$20");
- SendClientMessage(playerid, COLOR_WHITE, "Type /cancelshop to return to the shop without making a purchase.");*/
- ShowModelSelectionMenu(playerid, "Bandanas", MODEL_SELECTION_ACESSORY, Clothing_Bandanas, sizeof Clothing_Bandanas, 0.0, 0.0, 0.0);
- }
- else if(listitem == 2)
- {
- BrowseMaskType[playerid] = 3;
- /*format(gstr, sizeof(gstr), "~b~%s~n~~w~< ~b~ 1 ~w~>", GetMaskDescription(Clothing_Hats[0]));
- PlayerTextDrawSetString(playerid, MaskHelpText[playerid], gstr);
- PlayerTextDrawShow(playerid, MaskHelpText[playerid]);
- for(i = 0; i < sizeof(Clothing_Hats); i++)
- {
- Clothing_Objects[playerid][i] = CreateDynamicObject(Clothing_Hats[i], xstart, 41.09999847, 26.89999962, -30.0, 0.0, -60.0, -1, 5, playerid);
- xstart += xoff;
- }
- SendClientMessage(playerid, COLOR_WHITE, "Use the left and right keys to select a mask then use the {009FFB}~k~~VEHICLE_ENTER_EXIT~ {FFFFFF}key to buy it for {009000}$25");
- SendClientMessage(playerid, COLOR_WHITE, "Type /cancelshop to return to the shop without making a purchase.");*/
- ShowModelSelectionMenu(playerid, "Hats", MODEL_SELECTION_ACESSORY, Clothing_Hats, sizeof Clothing_Hats, 0.0, 0.0, 0.0);
- }
- else if(listitem == 3)
- {
- BrowseMaskType[playerid] = 4;
- /*format(gstr, sizeof(gstr), "~b~%s~n~~w~< ~b~ 1 ~w~>", GetMaskDescription(Clothing_Helmets[0]));
- PlayerTextDrawSetString(playerid, MaskHelpText[playerid], gstr);
- PlayerTextDrawShow(playerid, MaskHelpText[playerid]);
- for(i = 0; i < sizeof(Clothing_Helmets); i++)
- {
- Clothing_Objects[playerid][i] = CreateDynamicObject(Clothing_Helmets[i], xstart, 41.09999847, 26.89999962, -30.0, 0.0, -60.0, -1, 5, playerid);
- xstart += xoff;
- }
- SendClientMessage(playerid, COLOR_WHITE, "Use the left and right keys to select a mask then use the {009FFB}~k~~VEHICLE_ENTER_EXIT~ {FFFFFF}key to buy it for {009000}$300");
- SendClientMessage(playerid, COLOR_WHITE, "Type /cancelshop to return to the shop without making a purchase.");*/
- ShowModelSelectionMenu(playerid, "Helmets", MODEL_SELECTION_ACESSORY, Clothing_Helmets, sizeof Clothing_Helmets, 0.0, 0.0, 0.0);
- }
- else if(listitem == 4)
- {
- BrowseMaskType[playerid] = 5;
- /*format(gstr, sizeof(gstr), "~b~%s~n~~w~< ~b~ 1 ~w~>", GetMaskDescription(Clothing_Hair[0]));
- PlayerTextDrawSetString(playerid, MaskHelpText[playerid], gstr);
- PlayerTextDrawShow(playerid, MaskHelpText[playerid]);
- for(i = 0; i < sizeof(Clothing_Hair); i++)
- {
- Clothing_Objects[playerid][i] = CreateDynamicObject(Clothing_Hair[i], xstart, 41.09999847, 26.89999962, -30.0, 0.0, -60.0, -1, 5, playerid);
- xstart += xoff;
- }
- SendClientMessage(playerid, COLOR_WHITE, "Use the left and right keys to select a mask then use the {009FFB}~k~~VEHICLE_ENTER_EXIT~ {FFFFFF}key to buy it for {009000}$25");
- SendClientMessage(playerid, COLOR_WHITE, "Type /cancelshop to return to the shop without making a purchase.");*/
- ShowModelSelectionMenu(playerid, "Hair", MODEL_SELECTION_ACESSORY, Clothing_Hair, sizeof Clothing_Hair, 0.0, 0.0, 0.0);
- }
- else if(listitem == 5)
- {
- BrowseMaskType[playerid] = 6;
- /*format(gstr, sizeof(gstr), "~b~%s~n~~w~< ~b~ 1 ~w~>", GetMaskDescription(Clothing_Sunglasses[0]));
- PlayerTextDrawSetString(playerid, MaskHelpText[playerid], gstr);
- PlayerTextDrawShow(playerid, MaskHelpText[playerid]);
- for(i = 0; i < sizeof(Clothing_Sunglasses); i++)
- {
- Clothing_Objects[playerid][i] = CreateDynamicObject(Clothing_Sunglasses[i], xstart, 41.09999847, 26.89999962, -30.0, 0.0, -60.0, -1, 5, playerid);
- xstart += xoff;
- }
- SendClientMessage(playerid, COLOR_WHITE, "Use the left and right keys to select a mask then use the {009FFB}~k~~VEHICLE_ENTER_EXIT~ {FFFFFF}key to buy it for {009000}$75");
- SendClientMessage(playerid, COLOR_WHITE, "Type /cancelshop to return to the shop without making a purchase.");*/
- ShowModelSelectionMenu(playerid, "Sunglasses", MODEL_SELECTION_ACESSORY, Clothing_Sunglasses, sizeof Clothing_Sunglasses, 0.0, 0.0, 0.0);
- }
- else if(listitem == 6)
- {
- BrowseMaskType[playerid] = 7;
- /*format(gstr, sizeof(gstr), "~b~%s~n~~w~< ~b~ 1 ~w~>", GetMaskDescription(Clothing_Watches[0]));
- PlayerTextDrawSetString(playerid, MaskHelpText[playerid], gstr);
- PlayerTextDrawShow(playerid, MaskHelpText[playerid]);
- for(i = 0; i < sizeof(Clothing_Watches); i++)
- {
- Clothing_Objects[playerid][i] = CreateDynamicObject(Clothing_Watches[i], xstart, 41.09999847, 26.89999962, -30.0, 0.0, -60.0, -1, 5, playerid);
- xstart += xoff;
- }
- SendClientMessage(playerid, COLOR_WHITE, "Use the left and right keys to select a mask then use the {009FFB}~k~~VEHICLE_ENTER_EXIT~ {FFFFFF}key to buy it for {009000}$50");
- SendClientMessage(playerid, COLOR_WHITE, "Type /cancelshop to return to the shop without making a purchase.");*/
- ShowModelSelectionMenu(playerid, "Watches", MODEL_SELECTION_ACESSORY, Clothing_Watches, sizeof Clothing_Watches, 0.0, 0.0, 0.0);
- }
- else if(listitem == 7)
- {
- BrowseMaskType[playerid] = 8;
- /*format(gstr, sizeof(gstr), "~b~%s~n~~w~< ~b~ 1 ~w~>", GetMaskDescription(Clothing_Misc[0]));
- PlayerTextDrawSetString(playerid, MaskHelpText[playerid], gstr);
- PlayerTextDrawShow(playerid, MaskHelpText[playerid]);
- for(i = 0; i < sizeof(Clothing_Misc); i++)
- {
- Clothing_Objects[playerid][i] = CreateDynamicObject(Clothing_Misc[i], xstart, 41.09999847, 26.89999962, -30.0, 0.0, -60.0, -1, 5, playerid);
- xstart += xoff;
- }
- SendClientMessage(playerid, COLOR_WHITE, "Use the left and right keys to select a mask then use the {009FFB}~k~~VEHICLE_ENTER_EXIT~ {FFFFFF}key to buy it for {009000}$50");
- SendClientMessage(playerid, COLOR_WHITE, "Type /cancelshop to return to the shop without making a purchase.");*/
- ShowModelSelectionMenu(playerid, "Miscellaneous", MODEL_SELECTION_ACESSORY, Clothing_Misc, sizeof Clothing_Misc, 0.0, 0.0, 0.0);
- }
- else if(listitem == 8)
- {
- BrowseMaskType[playerid] = 10;
- /*format(gstr, sizeof(gstr), "~b~%s~n~~w~< ~b~ 1 ~w~>", GetMaskDescription(Clothing_Tools[0]));
- PlayerTextDrawSetString(playerid, MaskHelpText[playerid], gstr);
- PlayerTextDrawShow(playerid, MaskHelpText[playerid]);
- for(i = 0; i < sizeof(Clothing_Tools); i++)
- {
- Clothing_Objects[playerid][i] = CreateDynamicObject(Clothing_Tools[i], xstart, 41.09999847, 26.89999962, -30.0, 0.0, -60.0, -1, 5, playerid);
- xstart += xoff;
- }
- SendClientMessage(playerid, COLOR_WHITE, "Use the left and right keys to select a mask then use the {009FFB}~k~~VEHICLE_ENTER_EXIT~ {FFFFFF}key to buy it for {009000}$100");
- SendClientMessage(playerid, COLOR_WHITE, "Type /cancelshop to return to the shop without making a purchase.");*/
- ShowModelSelectionMenu(playerid, "Tools", MODEL_SELECTION_ACESSORY, Clothing_Tools, sizeof Clothing_Tools, 0.0, 0.0, 0.0);
- }
- else if(listitem == 9)
- {
- if(IsCop(playerid)) {
- BrowseMaskType[playerid] = 9;
- /*format(gstr, sizeof(gstr), "~b~%s~n~~w~< ~b~ 1 ~w~>", GetMaskDescription(Clothing_Police[0]));
- PlayerTextDrawSetString(playerid, MaskHelpText[playerid], gstr);
- PlayerTextDrawShow(playerid, MaskHelpText[playerid]);
- for(i = 0; i < sizeof(Clothing_Police); i++)
- {
- Clothing_Objects[playerid][i] = CreateDynamicObject(Clothing_Police[i], xstart, 41.09999847, 26.89999962, -30.0, 0.0, -60.0, -1, 5, playerid);
- xstart += xoff;
- }
- SendClientMessage(playerid, COLOR_WHITE, "Use the left and right keys to select a mask then use the {009FFB}~k~~VEHICLE_ENTER_EXIT~ {FFFFFF}key to buy it for {009000}$50");
- SendClientMessage(playerid, COLOR_WHITE, "Type /cancelshop to return to the shop without making a purchase.");*/
- ShowModelSelectionMenu(playerid, "Police Items", MODEL_SELECTION_ACESSORY, Clothing_Police, sizeof Clothing_Police, 0.0, 0.0, 0.0);
- } else if(Faction[playerid] == FACTION_SACFD) {
- BrowseMaskType[playerid] = 11;
- /*format(gstr, sizeof(gstr), "~b~%s~n~~w~< ~b~ 1 ~w~>", GetMaskDescription(Clothing_FD[0]));
- PlayerTextDrawSetString(playerid, MaskHelpText[playerid], gstr);
- PlayerTextDrawShow(playerid, MaskHelpText[playerid]);
- for(i = 0; i < sizeof(Clothing_FD); i++)
- {
- Clothing_Objects[playerid][i] = CreateDynamicObject(Clothing_FD[i], xstart, 41.09999847, 26.89999962, -30.0, 0.0, -60.0, -1, 5, playerid);
- xstart += xoff;
- }
- SendClientMessage(playerid, COLOR_WHITE, "Use the left and right keys to select a mask then use the {009FFB}~k~~VEHICLE_ENTER_EXIT~ {FFFFFF}key to buy it for {009000}$100");
- SendClientMessage(playerid, COLOR_WHITE, "Type /cancelshop to return to the shop without making a purchase.");*/
- ShowModelSelectionMenu(playerid, "SACFD Items", MODEL_SELECTION_ACESSORY, Clothing_FD, sizeof Clothing_FD, 0.0, 0.0, 0.0);
- }
- }
- }
- else ClothesShop[playerid] = 0;
- return true;
- }
- Dialog:FactionEditMenu(playerid, response, listitem, inputtext[])
- {
- if(!response) return DeletePVar(playerid, "fEditf");
- switch(listitem)
- {
- case 0: Dialog_Show(playerid, FactionEditName, DIALOG_STYLE_INPUT, "{fFffff}Faction Edit Menu - Edit Faction Name", "{ffffff}Please enter the name you wish to apply to this faction:", "Edit", "Cancel");
- case 1: Dialog_Show(playerid, FactionEditAbrev, DIALOG_STYLE_INPUT, "{FFFFFF}Faction Edit Menu - Edit Faction Abbreviation", "{ffffff}Please enter the new abbreviation of this faction:", "Edit", "Cancel");
- case 2: Dialog_Show(playerid, FactionEditUber, DIALOG_STYLE_INPUT, "{ffffff}Faction Edit Menu - Edit Uber Rank", "{ffffff}Please enter the new uber rank for this faction:\n\t\t[MAX: 15]", "Edit", "Cancel");
- case 3: Dialog_Show(playerid, FactionEditLead, DIALOG_STYLE_INPUT, "{ffffff}Faction Edit Menu - Edit Leader Rank", "{ffffff}Please enter the new leader rank for this faction:", "Edit", "Cancel");
- case 4: Dialog_Show(playerid, FactionEditLeaderName, DIALOG_STYLE_INPUT, "{FFFFFF}Faction Edit Menu - Edit Leader", "{FFFFFF}Please enter the Full_Name of the new leader of the faction:", "Edit", "Cancel");
- case 5: Dialog_Show(playerid, FactionEditRadio, DIALOG_STYLE_INPUT, "{ffffff}Faction Edit Menu - Edit Radio Freq", "{ffffff}Please enter the new radio freq for this faction:", "Edit", "Cancel");
- case 6: Dialog_Show(playerid, FactionEditGang, DIALOG_STYLE_MSGBOX, "{ffffff}Faction Edit Menu - Edit Is Gang", "{ffffff}Is the faction selected a gang?", "Yes", "No");
- case 7: Dialog_Show(playerid, FactionEditActive, DIALOG_STYLE_MSGBOX, "{ffffff}Faction Edit Menu - Edit Is Active", "{ffffff}Is the faction selected an active faction?", "Yes", "No");
- }
- return true;
- }
- Dialog:FactionEditName(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- new id[8];
- format(id, 8, "%i", GetPVarInt(playerid, "fEditf"));
- cmd_fedit(playerid, id);
- return true;
- }
- if(strlen(inputtext) >= 4)
- {
- format(gstr, sizeof(gstr), "{ffffff}You have successfully changed the name of faction ID %i to {E0DD24}%s.", GetPVarInt(playerid, "fEditf"), inputtext);
- format(FACTIONS[GetPVarInt(playerid, "fEditf")][FactionName], 35, inputtext);
- MySQLUpdateString(FACTIONS[GetPVarInt(playerid, "fEditf")][FactionId], "FactionName", inputtext, "factions");
- Dialog_Show(playerid, 9999, DIALOG_STYLE_MSGBOX, "{ffffff}Edit Faction Menu - Faction Name Changed", gstr, "Close", "");
- DeletePVar(playerid, "fEditf");
- }
- else return Dialog_Show(playerid, FactionEditName, DIALOG_STYLE_INPUT, "{fFffff}Faction Edit Menu - Edit Faction Name", "{ffffff}Please enter the name you wish to apply to this faction:", "Edit", "Cancel");
- return true;
- }
- Dialog:FactionEditAbrev(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- new id[8];
- format(id, 8, "%i", GetPVarInt(playerid, "fEditf"));
- cmd_fedit(playerid, id);
- return true;
- }
- if(strlen(inputtext) >= 4 && strlen(inputtext) <= 20)
- {
- format(gstr, sizeof(gstr), "{ffffff}You have successfully changed the abbreviation of faction ID %i to {E0DD24}%s.", GetPVarInt(playerid, "fEditf"), inputtext);
- format(FACTIONS[GetPVarInt(playerid, "fEditf")][FNameShort], 20, inputtext);
- MySQLUpdateString(FACTIONS[GetPVarInt(playerid, "fEditf")][FactionId], "FNameShort", inputtext, "factions");
- Dialog_Show(playerid, 9999, DIALOG_STYLE_MSGBOX, "{ffffff}Edit Faction Menu - Faction Abv. Changed", gstr, "Close", "");
- DeletePVar(playerid, "fEditf");
- }
- else return Dialog_Show(playerid, FactionEditAbrev, DIALOG_STYLE_INPUT, "{FFFFFF}Faction Edit Menu - Edit Faction Abbreviation", "{ffffff}Please enter the new abbreviation of this faction:", "Edit", "Cancel");
- return true;
- }
- Dialog:FactionEditLead(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- new id[8];
- format(id, 8, "%i", GetPVarInt(playerid, "fEditf"));
- cmd_fedit(playerid, id);
- return true;
- }
- if(IsNumeric(inputtext))
- {
- format(gstr, sizeof(gstr), "{ffffff}You have successfully changed the leader rank of faction ID %i to {E0DD24}%s [ID %i].", GetPVarInt(playerid, "fEditf"), GetFactionRankName(GetPVarInt(playerid, "fEditf"), strval(inputtext)), strval(inputtext));
- FACTIONS[GetPVarInt(playerid, "fEditf")][FactionLeaderRank] = strval(inputtext);
- MySQLUpdateInt(FACTIONS[GetPVarInt(playerid, "fEditf")][FactionId], "LeaderRank", strval(inputtext), "factions");
- Dialog_Show(playerid, 9999, DIALOG_STYLE_MSGBOX, "{ffffff}Edit Faction Menu - Faction Leader Rank Changed.", gstr, "Close", "");
- DeletePVar(playerid, "fEditf");
- }
- else return Dialog_Show(playerid, FactionEditLead, DIALOG_STYLE_INPUT, "{ffffff}Faction Edit Menu - Edit Leader Rank", "{ffffff}Please enter the new leader rank for this faction:", "Edit", "Cancel");
- return true;
- }
- Dialog:FactionEditUber(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- new id[8];
- format(id, 8, "%i", GetPVarInt(playerid, "fEditf"));
- cmd_fedit(playerid, id);
- return true;
- }
- if(IsNumeric(inputtext))
- {
- format(gstr, sizeof(gstr), "{ffffff}You have successfully changed the uber rank of faction ID %i to {E0DD24}%s [ID %i].", GetPVarInt(playerid, "fEditf"), GetFactionRankName(GetPVarInt(playerid, "fEditf"), strval(inputtext)), strval(inputtext));
- FACTIONS[GetPVarInt(playerid, "fEditf")][FactionUberLeaderRank] = strval(inputtext);
- MySQLUpdateInt(FACTIONS[GetPVarInt(playerid, "fEditf")][FactionId], "UberLeaderRank", strval(inputtext), "factions");
- Dialog_Show(playerid, 9999, DIALOG_STYLE_MSGBOX, "{ffffff}Edit Faction Menu - Faction Uber Rank Changed.", gstr, "Close", "");
- DeletePVar(playerid, "fEditf");
- }
- else return Dialog_Show(playerid, FactionEditUber, DIALOG_STYLE_INPUT, "{ffffff}Faction Edit Menu - Edit Uber Rank", "{ffffff}Please enter the new uber rank for this faction:", "Edit", "Cancel");
- return true;
- }
- Dialog:FactionEditLeaderName(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- new id[8];
- format(id, 8, "%i", GetPVarInt(playerid, "fEditf"));
- cmd_fedit(playerid, id);
- return true;
- }
- if(strlen(inputtext) >= 5)
- {
- new sqlid = MySQLCheckAccount(inputtext, playerid);
- if(sqlid != -1)
- {
- new fac = -1;
- MySQLFetchInt(sqlid, "Faction", fac, "players");
- if(fac == GetPVarInt(playerid, "fEditf"))
- {
- format(gstr, sizeof(gstr), "{ffffff}You have successfully changed the leader of faction ID %i to {E0DD24}%s.", GetPVarInt(playerid, "fEditf"), inputtext);
- FACTIONS[GetPVarInt(playerid, "fEditf")][FactionLeader] = sqlid;
- MySQLUpdateInt(FACTIONS[GetPVarInt(playerid, "fEditf")][FactionId], "Leader", sqlid, "factions");
- Dialog_Show(playerid, 9999, DIALOG_STYLE_MSGBOX, "{ffffff}Edit Faction Menu - Faction Leader Changed.", gstr, "Close", "");
- DeletePVar(playerid, "fEditf");
- }
- }
- else return Dialog_Show(playerid, FactionEditLeaderName, DIALOG_STYLE_INPUT, "{FFFFFF}Faction Edit Menu - Edit Leader", "{FFFFFF}\t Not in specified faction:\nlease enter the Full_Name of the new leader of the faction:", "Edit", "Cancel");
- }
- else return Dialog_Show(playerid, FactionEditLeaderName, DIALOG_STYLE_INPUT, "{FFFFFF}Faction Edit Menu - Edit Leader", "{FFFFFF}Please enter the Full_Name of the new leader of the faction:", "Edit", "Cancel");
- return true;
- }
- Dialog:FactionEditRadio(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- new id[8];
- format(id, 8, "%i", GetPVarInt(playerid, "fEditf"));
- cmd_fedit(playerid, id);
- return true;
- }
- if(IsNumeric(inputtext))
- {
- format(gstr, sizeof(gstr), "{ffffff}You have successfully changed the radio frequency of faction ID %i to {E0DD24}%i MHz.", GetPVarInt(playerid, "fEditf"), strval(inputtext));
- FACTIONS[GetPVarInt(playerid, "fEditf")][FactionRadioChannel] = strval(inputtext);
- MySQLUpdateInt(FACTIONS[GetPVarInt(playerid, "fEditf")][FactionId], "RadioChannel", strval(inputtext), "factions");
- Dialog_Show(playerid, 9999, DIALOG_STYLE_MSGBOX, "{ffffff}Edit Faction Menu - Faction Radio Freq Changed.", gstr, "Close", "");
- DeletePVar(playerid, "fEditf");
- }
- else return Dialog_Show(playerid, FactionEditRadio, DIALOG_STYLE_INPUT, "{ffffff}Faction Edit Menu - Edit Radio Freq", "{ffffff}Please enter the new radio freq for this faction:", "Edit", "Cancel");
- return true;
- }
- Dialog:FactionEditGang(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- format(gstr, sizeof(gstr), "{ffffff}You have successfully set faction ID %i's gang status to {E0DD24}YES.", GetPVarInt(playerid, "fEditf"));
- FACTIONS[GetPVarInt(playerid, "fEditf")][FactionIsGang] = 1;
- MySQLUpdateInt(FACTIONS[GetPVarInt(playerid, "fEditf")][FactionId], "IsGang", 1, "factions");
- Dialog_Show(playerid, 9999, DIALOG_STYLE_MSGBOX, "{ffffff}Edit Faction Menu - Faction Gang Status.", gstr, "Close", "");
- }
- else if(!response)
- {
- format(gstr, sizeof(gstr), "{ffffff}You have successfully set faction ID %i's gang status to {E0DD24}NO.", GetPVarInt(playerid, "fEditf"));
- FACTIONS[GetPVarInt(playerid, "fEditf")][FactionIsGang] = 0;
- MySQLUpdateInt(FACTIONS[GetPVarInt(playerid, "fEditf")][FactionId], "IsGang", 0, "factions");
- Dialog_Show(playerid, 9999, DIALOG_STYLE_MSGBOX, "{ffffff}Edit Faction Menu - Faction Gang Status.", gstr, "Close", "");
- }
- DeletePVar(playerid, "fEditf");
- return true;
- }
- Dialog:FactionEditActive(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- format(gstr, sizeof(gstr), "{ffffff}You have successfully set faction ID %i's active status to {E0DD24}YES.", GetPVarInt(playerid, "fEditf"));
- FACTIONS[GetPVarInt(playerid, "fEditf")][FactionIsActive] = 1;
- MySQLUpdateInt(FACTIONS[GetPVarInt(playerid, "fEditf")][FactionId], "IsActive", 1, "factions");
- Dialog_Show(playerid, 9999, DIALOG_STYLE_MSGBOX, "{ffffff}Edit Faction Menu - Faction Active Status.", gstr, "Close", "");
- }
- else if(!response)
- {
- format(gstr, sizeof(gstr), "{ffffff}You have successfully set faction ID %i's active status to {E0DD24}NO.", GetPVarInt(playerid, "fEditf"));
- FACTIONS[GetPVarInt(playerid, "fEditf")][FactionIsActive] = 0;
- MySQLUpdateInt(FACTIONS[GetPVarInt(playerid, "fEditf")][FactionId], "IsActive", 0, "factions");
- Dialog_Show(playerid, 9999, DIALOG_STYLE_MSGBOX, "{ffffff}Edit Faction Menu - Faction Active Status.", gstr, "Close", "");
- }
- DeletePVar(playerid, "fEditf");
- return true;
- }
- Dialog:PhoneMenu(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- DeletePVar(playerid, "SMSViewingNumber");
- DeletePVar(playerid, "TextViewID");
- return true;
- }
- else
- {
- gstr[0] = EOS;
- if(strcmp(inputtext, "Call", true) == 0)
- {
- if(PhoneData[playerid][pPower] == 0) return SysMsg(playerid, "Your phone is off.");
- else return Dialog_Show(playerid, PhoneCall, DIALOG_STYLE_INPUT, "Call a number.", "Please enter the number you'd like to dial below.", "Call", "Cancel");
- }
- else if(strcmp(inputtext, "SMS", true) == 0)
- {
- if(PhoneData[playerid][pPower] == 0) return SysMsg(playerid, "Your phone is off.");
- return Dialog_Show(playerid, PhoneSMS1, DIALOG_STYLE_INPUT, "SMS a number", "Please enter the number you'd like to SMS below.", "Call", "Cancel");
- }
- else if(strcmp(inputtext, "Turn on", true) == 0) return cmd_pon(playerid);
- else if(strcmp(inputtext, "Turn off", true) == 0) return cmd_poff(playerid);
- else if(strcmp(inputtext, "Manage Contacts", true) == 0)
- {
- if(PhoneData[playerid][pPower] == 0) return SysMsg(playerid, "Your phone is off.");
- new ccount = GetContactsCount(playerid);
- if(ccount > 0) strcat(gstr, "View All Contacts\n");
- if(ccount < GetMaxContactLimitForPlayer(playerid)) strcat(gstr, "Create New Contact\n");
- if(ccount > 0) strcat(gstr, "Delete A Contact\nEdit A Contact\n");
- Dialog_Show(playerid, ContactsMenu, DIALOG_STYLE_LIST, "Contacts Menu", gstr, "Select", "Cancel");
- }
- else if(strcmp(inputtext, "View SMS History", true) == 0)
- {
- if(PhoneData[playerid][pPower] == 0) return SysMsg(playerid, "Your phone is off.");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM sms WHERE TextTo = %i OR TextFrom = %i GROUP BY TextTo ORDER BY id ASC LIMIT 20 OFFSET 0", PhoneData[playerid][pNumber], PhoneData[playerid][pNumber]);
- mysql_pquery(conn, mquery, "ShowSMSList", "i", playerid);
- }
- else if(strcmp(inputtext, "Phone Details", true) == 0) return cmd_pinfo(playerid);
- }
- return true;
- }
- Dialog:ContactsMenu(playerid, response, listitem, inputtext[])
- {
- if(!response) return DisplayPhoneMenu(playerid);
- gstr[0] = EOS;
- if(strcmp(inputtext, "View All Contacts", true) == 0)
- {
- for(new i = 0; i < MAX_PHONECONTACTS; i++)
- {
- if(PhoneContacts[playerid][i][cID] != 0)
- {
- format(sgstr, sizeof(sgstr), "%s (#%i)\n", PhoneContacts[playerid][i][ContactName], PhoneContacts[playerid][i][ContactNumber]);
- strcat(gstr, sgstr);
- }
- }
- Dialog_Show(playerid, ContactsView, DIALOG_STYLE_LIST, inputtext, gstr, "Call/SMS", "Back");
- return true;
- }
- else if(strcmp(inputtext, "Create New Contact", true) == 0)
- {
- Dialog_Show(playerid, ContactsAdd1, DIALOG_STYLE_INPUT, "Create New Contact", "Please enter the NAME of the new contact:", "Next", "Menu");
- return true;
- }
- else if(strcmp(inputtext, "Delete A Contact", true) == 0)
- {
- for(new i = 0; i < MAX_PHONECONTACTS; i++)
- {
- if(PhoneContacts[playerid][i][cID] != 0)
- {
- format(sgstr, sizeof(sgstr), "%s (#%i)\n", PhoneContacts[playerid][i][ContactName], PhoneContacts[playerid][i][ContactNumber]);
- strcat(gstr, sgstr);
- }
- }
- Dialog_Show(playerid, ContactsDelete, DIALOG_STYLE_LIST, "To delete a contact, highlight it then click 'Delete'", gstr, "Delete", "Back");
- return true;
- }
- else if(strcmp(inputtext, "Edit A Contact", true) == 0)
- {
- for(new i = 0; i < MAX_PHONECONTACTS; i++)
- {
- if(PhoneContacts[playerid][i][cID] != 0)
- {
- format(sgstr, sizeof(sgstr), "%s (#%i)\n", PhoneContacts[playerid][i][ContactName], PhoneContacts[playerid][i][ContactNumber]);
- strcat(gstr, sgstr);
- }
- }
- Dialog_Show(playerid, ContactsEditMenu, DIALOG_STYLE_LIST, "To edit a contact, highlight it then click 'Edit'", gstr, "Edit", "Back");
- return true;
- }
- return true;
- }
- Dialog:ContactsAdd1(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(isnull(inputtext) || strlen(inputtext) > 29) return Dialog_Show(playerid, ContactsAdd1, DIALOG_STYLE_INPUT, "Create New Contact", "Please enter the NAME of the new contact:", "Next", "Menu");
- format(NewContactName[playerid], 30, inputtext);
- Dialog_Show(playerid, ContactsAdd2, DIALOG_STYLE_INPUT, "Create New Contact", "Please enter the NUMBER for the new contact:", "Add", "Menu");
- }
- else DisplayPhoneMenu(playerid);
- return true;
- }
- Dialog:ContactsAdd2(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(strval(inputtext) == 0 || !IsNumeric(inputtext) || strval(inputtext) < 0 || strlen(inputtext) > 8) return Dialog_Show(playerid, ContactsAdd2, DIALOG_STYLE_INPUT, "Create New Contact", "Please enter the NUMBER for the new contact:", "Add", "Menu");
- for(new i = 0; i < MAX_PHONECONTACTS; i++)
- {
- if(PhoneContacts[playerid][i][cID] == 0)
- {
- PhoneContacts[playerid][i][ContactNumber] = strval(inputtext);
- format(PhoneContacts[playerid][i][ContactName], 30, NewContactName[playerid]);
- NewContactName[playerid][0] = EOS;
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO phonecontacts (PhoneNumber, ContactNumber, ContactName) VALUES (%i, %i, '%e')",
- PhoneData[playerid][pNumber], PhoneContacts[playerid][i][ContactNumber], PhoneContacts[playerid][i][ContactName]);
- mysql_pquery(conn, mquery, "InsetNewPhoneContact", "ii", playerid, i);
- break;
- }
- }
- DisplayPhoneMenu(playerid);
- return true;
- }
- else DisplayPhoneMenu(playerid);
- return true;
- }
- Dialog:ContactsDelete(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- new numstr[10];
- for(new i = 0; i < MAX_PHONECONTACTS; i++)
- {
- valstr(numstr, PhoneContacts[playerid][i][ContactNumber]);
- if(strfind(inputtext, PhoneContacts[playerid][i][ContactName]) != -1 && strfind(inputtext, numstr) != -1)
- {
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM phonecontacts WHERE id = %i", PhoneContacts[playerid][i][cID]);
- mysql_pquery(conn, mquery);
- PhoneContacts[playerid][i][ContactName][0] = EOS;
- PhoneContacts[playerid][i][ContactNumber] = 0;
- PhoneContacts[playerid][i][cID] = 0;
- DisplayPhoneMenu(playerid);
- break;
- }
- }
- }
- else DisplayPhoneMenu(playerid);
- return true;
- }
- Dialog:ContactsEditMenu(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- strdel(inputtext, strfind(inputtext, "(") - 1, strlen(inputtext));
- for(new i = 0; i < MAX_PHONECONTACTS; i++)
- {
- if(strmatch(inputtext, PhoneContacts[playerid][i][ContactName]))
- {
- EditContactID[playerid] = i;
- Dialog_Show(playerid, ContactsEditName, DIALOG_STYLE_INPUT, "Edit Contact", "Edit Contact NAME:", "Next", "Menu");
- return true;
- }
- }
- }
- else DisplayPhoneMenu(playerid);
- return true;
- }
- Dialog:ContactsEditName(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(isnull(inputtext)) return Dialog_Show(playerid, ContactsEditNumber, DIALOG_STYLE_INPUT, "Edit Contact", "Edit Contact NUMBER:", "Finish", "Menu");
- if(strlen(inputtext) > 29) return Dialog_Show(playerid, ContactsEditName, DIALOG_STYLE_INPUT, "Edit Contact", "Edit Contact NAME:", "Next", "Menu");
- format(PhoneContacts[playerid][EditContactID[playerid]][ContactName], 30, inputtext);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phonecontacts SET ContactName = '%e' WHERE id = %i", inputtext, PhoneContacts[playerid][EditContactID[playerid]][cID]);
- mysql_pquery(conn, mquery);
- Dialog_Show(playerid, ContactsEditNumber, DIALOG_STYLE_INPUT, "Edit Contact", "Edit Contact NUMBER:", "Finish", "Menu");
- }
- else DisplayPhoneMenu(playerid);
- return true;
- }
- Dialog:ContactsEditNumber(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(isnull(inputtext) || !IsNumeric(inputtext)) return DisplayPhoneMenu(playerid);
- if(strlen(inputtext) > 7) return Dialog_Show(playerid, ContactsEditNumber, DIALOG_STYLE_INPUT, "Edit Contact", "Edit Contact NUMBER:", "Finish", "Menu");
- PhoneContacts[playerid][EditContactID[playerid]][ContactNumber] = strval(inputtext);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phonecontacts SET ContactNumber = %i WHERE id = %i", PhoneContacts[playerid][EditContactID[playerid]][ContactNumber], PhoneContacts[playerid][EditContactID[playerid]][cID]);
- mysql_pquery(conn, mquery);
- DisplayPhoneMenu(playerid);
- }
- else DisplayPhoneMenu(playerid);
- return true;
- }
- Dialog:ContactsView(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- strdel(inputtext, 0, strfind(inputtext, "#") + 1);
- strdel(inputtext, strfind(inputtext, ")"), strlen(inputtext));
- format(sgstr, sizeof(sgstr), "Call (%i)\nSMS (%i)", strval(inputtext), strval(inputtext));
- Dialog_Show(playerid, ContactsActions, DIALOG_STYLE_LIST, "Select an action", sgstr, "Select", "Menu");
- }
- else DisplayPhoneMenu(playerid);
- return true;
- }
- Dialog:ContactsActions(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- new num = strval(inputtext[strfind(inputtext, " (") + 2]);
- if(listitem == 0) ProcessPhoneCall(playerid, num);
- else if(listitem == 1)
- {
- Dialog_Show(playerid, ContactsSMS, DIALOG_STYLE_INPUT, "SMS", "Message:", "Send", "Menu");
- ContactsSMSNumber[playerid] = num;
- }
- }
- else DisplayPhoneMenu(playerid);
- return true;
- }
- Dialog:PhoneCall(playerid, response, listitem, inputtext[])
- {
- if(!response) return DisplayPhoneMenu(playerid);
- else
- {
- if(!IsNumeric(inputtext) || isnull(inputtext)) return DisplayPhoneMenu(playerid);
- cmd_call(playerid, inputtext);
- format(sgstr, sizeof(sgstr), "/call %s", inputtext);
- FormatActionLog(playerid, sgstr);
- return true;
- }
- }
- Dialog:PhoneSMS1(playerid, response, listitem, inputtext[])
- {
- if(!response) return DisplayPhoneMenu(playerid);
- else
- {
- if(!IsNumeric(inputtext) || isnull(inputtext)) return DisplayPhoneMenu(playerid);
- SetPVarInt(playerid, "TempTextNumber", strval(inputtext));
- Dialog_Show(playerid, PhoneSMS2, DIALOG_STYLE_INPUT, "SMS", "Message:", "Send", "Cancel");
- return true;
- }
- }
- Dialog:PhoneSMS2(playerid, response, listitem, inputtext[])
- {
- if(!response) return DisplayPhoneMenu(playerid);
- else
- {
- if(isnull(inputtext)) return DisplayPhoneMenu(playerid) && DeletePVar(playerid, "TempTextNumber");
- format(sgstr, sizeof(sgstr), "%i %s", GetPVarInt(playerid, "TempTextNumber"), inputtext);
- cmd_txt(playerid, sgstr);
- format(sgstr, sizeof(sgstr), "/txt %s", sgstr);
- FormatActionLog(playerid, sgstr);
- DeletePVar(playerid, "TempTextNumber");
- return true;
- }
- }
- Dialog:ContactsSMS(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(strlen(inputtext) < 1) return Dialog_Show(playerid, ContactsSMS, DIALOG_STYLE_MSGBOX, "SMS", "Message:", "Send", "Menu");
- new sms_params[128];
- format(sms_params, sizeof(sms_params), "%i %s", ContactsSMSNumber[playerid], inputtext);
- cmd_txt(playerid, sms_params);
- format(sgstr, sizeof(sgstr), "/txt %s", sms_params);
- FormatActionLog(playerid, sgstr);
- ContactsSMSNumber[playerid] = 0;
- }
- else DisplayPhoneMenu(playerid);
- return true;
- }
- Dialog:SMSList(playerid, response, listitem, inputtext[])
- {
- if(!response) return DisplayPhoneMenu(playerid);
- if(IsNumeric(inputtext))
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM sms WHERE TextTo = %i AND TextFrom = %i OR TextTo = %i AND TextFrom = %i ORDER BY id DESC LIMIT 10",
- strval(inputtext), PhoneData[playerid][pNumber], PhoneData[playerid][pNumber], strval(inputtext));
- mysql_pquery(conn, mquery, "ShowPreviousTexts", "i", playerid);
- SetPVarInt(playerid, "SMSViewingNumber", strval(inputtext));
- }
- else
- {
- for(new c = 0; c < GetMaxContactLimitForPlayer(playerid); c++)
- {
- if(PhoneContacts[playerid][c][cID] != 0 && strmatch(inputtext, PhoneContacts[playerid][c][ContactName]))
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM sms WHERE TextTo = %i AND TextFrom = %i OR TextTo = %i AND TextFrom = %i ORDER BY id DESC LIMIT 10",
- PhoneContacts[playerid][c][ContactNumber], PhoneData[playerid][pNumber], PhoneData[playerid][pNumber], PhoneContacts[playerid][c][ContactNumber]);
- mysql_pquery(conn, mquery, "ShowPreviousTexts", "i", playerid);
- SetPVarInt(playerid, "SMSViewingNumber", PhoneContacts[playerid][c][ContactNumber]);
- break;
- }
- }
- }
- return true;
- }
- Dialog:SMSDetails(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM sms WHERE TextTo = %i OR TextFrom = %i GROUP BY TextTo ORDER BY id ASC LIMIT 20 OFFSET 0", PhoneData[playerid][pNumber], PhoneData[playerid][pNumber]);
- mysql_pquery(conn, mquery, "ShowSMSList", "i", playerid);
- MemberListIndex[playerid] = 0;
- return true;
- }
- if(strcmp(inputtext, "< Previous Page", true) == 0)
- {
- MemberListIndex[playerid] --;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM sms WHERE TextTo = %i AND TextFrom = %i OR TextTo = %i AND TextFrom = %i ORDER BY id DESC LIMIT 10 OFFSET %i",
- GetPVarInt(playerid, "SMSViewingNumber"), PhoneData[playerid][pNumber], PhoneData[playerid][pNumber], GetPVarInt(playerid, "SMSViewingNumber"), MemberListIndex[playerid] * 10);
- mysql_pquery(conn, mquery, "ShowPreviousTexts", "i", playerid);
- return true;
- }
- if(strcmp(inputtext, "> Next Page", true) == 0)
- {
- MemberListIndex[playerid] ++;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM sms WHERE TextTo = %i AND TextFrom = %i OR TextTo = %i AND TextFrom = %i ORDER BY id DESC LIMIT 10 OFFSET %i",
- GetPVarInt(playerid, "SMSViewingNumber"), PhoneData[playerid][pNumber], PhoneData[playerid][pNumber], GetPVarInt(playerid, "SMSViewingNumber"), MemberListIndex[playerid] * 10);
- mysql_pquery(conn, mquery, "ShowPreviousTexts", "i", playerid);
- return true;
- }
- if(MemberListIndex[playerid] == 0) SetPVarInt(playerid, "TextViewID", ViewingTextID[playerid][listitem]);
- else SetPVarInt(playerid, "TextViewID", ViewingTextID[playerid][listitem - 1]);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM sms WHERE id = %i", GetPVarInt(playerid, "TextViewID"));
- mysql_pquery(conn, mquery, "ShowSMSDetails", "i", playerid);
- return true;
- }
- Dialog:SMSActions(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM sms WHERE TextTo = %i AND TextFrom = %i OR TextTo = %i AND TextFrom = %i ORDER BY id DESC LIMIT 10 OFFSET %i",
- GetPVarInt(playerid, "SMSViewingNumber"), PhoneData[playerid][pNumber], PhoneData[playerid][pNumber], GetPVarInt(playerid, "SMSViewingNumber"), MemberListIndex[playerid] * 10);
- mysql_pquery(conn, mquery, "ShowPreviousTexts", "i", playerid);
- return true;
- }
- gstr[0] = EOS;
- if(PhoneData[playerid][pNumber] != GetPVarInt(playerid, "SMSViewingNumber")) strcat(gstr, "Reply\n");
- strcat(gstr, "Delete Text\nDelete All Texts From This Number");
- Dialog_Show(playerid, SMSFinalAction, DIALOG_STYLE_LIST, "Select An Action", gstr, "Select", "Cancel");
- return true;
- }
- Dialog:SMSFinalAction(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM sms WHERE id = %i", GetPVarInt(playerid, "TextViewID"));
- mysql_pquery(conn, mquery, "ShowSMSDetails", "i", playerid);
- return true;
- }
- if(strcmp(inputtext, "Reply", true) == 0)
- {
- ContactsSMSNumber[playerid] = GetPVarInt(playerid, "SMSViewingNumber");
- Dialog_Show(playerid, ContactsSMS, DIALOG_STYLE_INPUT, "SMS", "Message:", "Send", "Menu");
- return true;
- }
- else if(strcmp(inputtext, "Delete Text", true) == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM sms WHERE id = %i", GetPVarInt(playerid, "TextViewID"));
- mysql_pquery(conn, mquery);
- DeletePVar(playerid, "TextViewID");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM sms WHERE TextTo = %i AND TextFrom = %i OR TextTo = %i AND TextFrom = %i ORDER BY id DESC LIMIT 10 OFFSET %i",
- GetPVarInt(playerid, "SMSViewingNumber"), PhoneData[playerid][pNumber], PhoneData[playerid][pNumber], GetPVarInt(playerid, "SMSViewingNumber"), MemberListIndex[playerid] * 10);
- mysql_pquery(conn, mquery, "ShowPreviousTexts", "i", playerid);
- return true;
- }
- else if(strcmp(inputtext, "Delete All Texts From This Number", true) == 0)
- {
- Dialog_Show(playerid, SMSActionDeleteAll, DIALOG_STYLE_MSGBOX, "Are You Sure?", "Click 'Yes' if you're sure you want to delete all texts from this number\n{FF0000}THIS CANNOT BE UNDONE.{FFFFFF}", "Yes", "Cancel");
- return true;
- }
- return true;
- }
- Dialog:SMSActionDeleteAll(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- gstr[0] = EOS;
- if(PhoneData[playerid][pNumber] != GetPVarInt(playerid, "SMSViewingNumber")) strcat(gstr, "Reply\n");
- strcat(gstr, "Delete Text\nDelete All Texts From This Number");
- Dialog_Show(playerid, SMSFinalAction, DIALOG_STYLE_LIST, "Select An Action", gstr, "Select", "Cancel");
- }
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM sms WHERE TextTo = %i AND TextFrom = %i OR TextTo = %i AND TextFrom = %i",
- GetPVarInt(playerid, "SMSViewingNumber"), PhoneData[playerid][pNumber], PhoneData[playerid][pNumber], GetPVarInt(playerid, "SMSViewingNumber"));
- mysql_pquery(conn, mquery);
- DisplayPhoneMenu(playerid);
- return true;
- }
- Dialog:CCTVMenu(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- format(gstr, sizeof(gstr), "[CCTV] Now viewing camera: %s. Use /cctv again to switch camera or to exit.", inputtext);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- TogglePlayerControllable(playerid, 0);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorldEx(playerid, 0);
- TextDrawShowForPlayer(playerid, CCTV);
- if(strcmp(inputtext, "Dillimore North") == 0)
- {
- SetPlayerPos(playerid, 612.7672, -494.3958, -25);
- SetPlayerCameraPos(playerid, 612.7672, -494.3958, 20.0359);
- SetPlayerCameraLookAt(playerid, 621.5967, -489.7011, 17.6167);
- }
- else if(strcmp(inputtext, "Dillimore West") == 0)
- {
- SetPlayerPos(playerid, 652.1532, -521.2651, -20);
- SetPlayerCameraPos(playerid, 652.1532, -521.2651, 24.3359);
- SetPlayerCameraLookAt(playerid, 653.3719, -531.1906, 22.2568);
- }
- else if(strcmp(inputtext, "Blueberry North") == 0)
- {
- SetPlayerPos(playerid, 268.9444, -81.0767, -25);
- SetPlayerCameraPos(playerid, 268.9444, -81.0767, 10.0781);
- SetPlayerCameraLookAt(playerid, 260.5577, -75.6303, 7.3217);
- }
- else if(strcmp(inputtext, "Blueberry South") == 0)
- {
- SetPlayerPos(playerid, 241.9433, -221.0222, -30);
- SetPlayerCameraPos(playerid, 241.9433, -221.0222, 8.8781);
- SetPlayerCameraLookAt(playerid, 235.7867, -213.1421, 6.1217);
- }
- else if(strcmp(inputtext, "Blueberry Truck Terminal") == 0)
- {
- SetPlayerPos(playerid, 79.1378, -202.3514, -30);
- SetPlayerCameraPos(playerid, 79.1378, -202.3514, 9.4952);
- SetPlayerCameraLookAt(playerid, 76.3814, -211.9640, 6.7388);
- }
- else if(strcmp(inputtext, "Montgomery South") == 0)
- {
- SetPlayerPos(playerid, 1256.0991, 146.0510, -5);
- SetPlayerCameraPos(playerid, 1256.0991, 146.0510, 27.3457);
- SetPlayerCameraLookAt(playerid, 1257.6634, 155.9279, 24.4220);
- }
- else if(strcmp(inputtext, "Montgomery Hospital") == 0)
- {
- SetPlayerPos(playerid, 1230.5347, 362.1294, -5);
- SetPlayerCameraPos(playerid, 1230.5347, 362.1294, 27.5547);
- SetPlayerCameraLookAt(playerid, 1235.9898, 354.3388, 24.4645);
- }
- else if(strcmp(inputtext, "Montgomery East") == 0)
- {
- SetPlayerPos(playerid, 1362.1949, 303.1940, -5);
- SetPlayerCameraPos(playerid, 1362.1949, 303.1940, 27.4547);
- SetPlayerCameraLookAt(playerid, 1359.1047, 293.6835, 24.5309);
- }
- else if(strcmp(inputtext, "Palomino Creek East") == 0)
- {
- SetPlayerPos(playerid, 2301.4995, 44.1189, -5);
- SetPlayerCameraPos(playerid, 2301.4995, 44.1189, 34.3843);
- SetPlayerCameraLookAt(playerid, 2292.2333, 42.9812, 30.8006);
- }
- else if(strcmp(inputtext, "Palomino Creek Main St") == 0)
- {
- SetPlayerPos(playerid, 2353.0541, -74.6894, -5);
- SetPlayerCameraPos(playerid, 2353.0541, -74.6894, 34.4843);
- SetPlayerCameraLookAt(playerid, 2349.7985, -65.2342, 31.5606);
- }
- else if(strcmp(inputtext, "Palomino Creek South") == 0)
- {
- SetPlayerPos(playerid,2282.9187, -106.8438, -5);
- SetPlayerCameraPos(playerid, 2282.9187, -106.8438, 33.9753);
- SetPlayerCameraLookAt(playerid, 2280.1081, -97.6512, 31.2189);
- }
- else if(strcmp(inputtext, "Pay Toll East") == 0)
- {
- SetPlayerPos(playerid, 609.3961, 298.9533, -5);
- SetPlayerCameraPos(playerid, 609.3961, 298.9533, 27.3531);
- SetPlayerCameraLookAt(playerid, 611.2108, 308.2891, 24.2630);
- }
- else if(strcmp(inputtext, "Pay Toll West") == 0)
- {
- SetPlayerPos(playerid, -182.5277, 314.4974, -20);
- SetPlayerCameraPos(playerid, -182.5277, 314.4974, 19.8781);
- SetPlayerCameraLookAt(playerid, -184.9274, 305.5415, 16.1320);
- }
- else if(strcmp(inputtext, "Fort Carson East") == 0)
- {
- SetPlayerPos(playerid, -75.7118, 1188.4047, -20);
- SetPlayerCameraPos(playerid, -75.7118, 1188.4047, 26.9422);
- SetPlayerCameraLookAt(playerid, -66.0525, 1188.4047, 24.3540);
- }
- else if(strcmp(inputtext, "Fort Carson Central") == 0)
- {
- SetPlayerPos(playerid, -170.9734, 1088.7139, -20);
- SetPlayerCameraPos(playerid, -170.9734, 1088.7139, 25.9422);
- SetPlayerCameraLookAt(playerid, -178.2762, 1094.6276, 22.5220);
- }
- else if(strcmp(inputtext, "Fort Carson Medical Center") == 0)
- {
- SetPlayerPos(playerid, -265.6510, 1111.2851, -20);
- SetPlayerCameraPos(playerid, -265.6510, 1111.2851, 25.4422);
- SetPlayerCameraLookAt(playerid, -272.0788, 1103.6247, 22.5184);
- }
- else if(strcmp(inputtext, "Fort Carson Gas Station") == 0)
- {
- SetPlayerPos(playerid, -223.9068, 1188.4105, -20);
- SetPlayerCameraPos(playerid, -223.9068, 1188.4105, 23.9422);
- SetPlayerCameraLookAt(playerid, -229.3532, 1196.7972, 22.2057);
- }
- else if(strcmp(inputtext, "Fort Carson North Entrance") == 0)
- {
- SetPlayerPos(playerid, -107.4407, 1140.8190, -20);
- SetPlayerCameraPos(playerid, -107.4407, 1140.8190, 27.0499);
- SetPlayerCameraLookAt(playerid, -110.0469, 1149.9079, 23.7943);
- }
- else if(strcmp(inputtext, "Bone County East Gas Station") == 0)
- {
- SetPlayerPos(playerid, 682.3634, 1740.1688, -20);
- SetPlayerCameraPos(playerid, 682.3634, 1740.1688, 13.5995);
- SetPlayerCameraLookAt(playerid, 673.5339, 1735.4741, 10.5093);
- }
- else if(strcmp(inputtext, "Las Payasadas") == 0)
- {
- SetPlayerPos(playerid, -306.0853, 2707.3811, 25);
- SetPlayerCameraPos(playerid, -306.0853, 2707.3811, 69.5874);
- SetPlayerCameraLookAt(playerid, -296.7129, 2704.8698, 67.1681);
- }
- else if(strcmp(inputtext, "El Quebrados Central") == 0)
- {
- SetPlayerPos(playerid, -1538.3074, 2590.9545, 25);
- SetPlayerCameraPos(playerid, -1538.3074, 2590.9545, 63.7358);
- SetPlayerCameraLookAt(playerid, -1529.6472, 2595.9545, 61.1476);
- }
- else if(strcmp(inputtext, "El Quebrados East") == 0)
- {
- SetPlayerPos(playerid, -1460.0528, 2677.8237, -25);
- SetPlayerCameraPos(playerid, -1460.0528, 2677.8237, 63.7358);
- SetPlayerCameraLookAt(playerid, -1451.0837, 2674.0166, 61.4863);
- }
- else if(strcmp(inputtext, "Tiera Robada Junction") == 0)
- {
- SetPlayerPos(playerid, -1151.9119, 1764.0166, 10);
- SetPlayerCameraPos(playerid, -1151.9119, 1764.0166, 46.5723);
- SetPlayerCameraLookAt(playerid, -1156.9989, 1772.4827, 45.0080);
- }
- else if(strcmp(inputtext, "Las Barrancas") == 0)
- {
- SetPlayerPos(playerid, -848.6829, 1626.2034, -10);
- SetPlayerCameraPos(playerid, -848.6829, 1626.2034, 34.4874);
- SetPlayerCameraLookAt(playerid, -845.5239, 1617.0291, 32.0682);
- }
- else if(strcmp(inputtext, "Las Barrancas South") == 0)
- {
- SetPlayerPos(playerid, -832.8695, 1503.0887, -20);
- SetPlayerCameraPos(playerid, -832.8695, 1503.0887, 27.1279);
- SetPlayerCameraLookAt(playerid, -824.2092, 1498.0887, 24.2042);
- }
- else if(strcmp(inputtext, "Tiera Robada South") == 0)
- {
- SetPlayerPos(playerid, -625.9620, 1179.0612, -15);
- SetPlayerCameraPos(playerid, -625.9620, 1179.0612, 23.3069);
- SetPlayerCameraLookAt(playerid, -618.0138, 1173.4958, 20.8877);
- }
- else if(strcmp(inputtext, "Hunter Quarry Intersection") == 0)
- {
- SetPlayerPos(playerid, 300.1324, 870.0786, -10);
- SetPlayerCameraPos(playerid, 300.1324, 870.0786, 28.3269);
- SetPlayerCameraLookAt(playerid, 299.7898, 860.2683, 26.4188);
- }
- }
- else if(response == 0)
- {
- if(Faction[playerid] == FACTION_COP)
- {
- UsingCCTV{playerid} = false;
- SetPlayerPos(playerid, 650.4503, -569.6254, 1008.4362);
- SetPlayerInterior(playerid, 10);
- SetPlayerVirtualWorldEx(playerid, 10);
- }
- else if(Faction[playerid] == FACTION_PROP)
- {
- UsingCCTV{playerid} = false;
- SetPlayerPos(playerid, 1034.3674,-1115.4692,2025.2595);
- SetPlayerInterior(playerid, 187);
- SetPlayerVirtualWorldEx(playerid, 187);
- }
- TextDrawHideForPlayer(playerid, CCTV);
- FadeColorForPlayer(playerid, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0);
- TogglePlayerControllable(playerid, 1);
- SetCameraBehindPlayer(playerid);
- }
- return true;
- }
- Dialog:AjailList(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(AJailingPlayer[playerid] == -1 || !IsPlayerConnected(AJailingPlayer[playerid])) return SysMsg(playerid, "Player can no longer be Admin Jailed.");
- new reason[50], jailtime[3], playa = AJailingPlayer[playerid];
- strmid(reason, inputtext, 0, strfind(inputtext, "(") - 1);
- strmid(jailtime, inputtext, strfind(inputtext, "(") + 1, strfind(inputtext, " min)"));
- new jtime = strval(jailtime);
- if(strcmp(reason, "Other please specify..", false) == 0)
- {
- AJailingTime[playerid] = jtime;
- format(gstr, sizeof(gstr), "{FFFFFF}Admin Jail {FF4753}%s(ID %i){FFFFFF} for {FF4753}%i{FFFFFF} minutes.\n\nReason?", NameEx(playa), playa, AJailingTime[playerid]);
- Dialog_Show(playerid, AjailReason, DIALOG_STYLE_INPUT, "Reason for Admin Jail", gstr, "Continue", "Cancel");
- return true;
- }
- AdminJailData[playa][0] = 1;
- AdminJailData[playa][1] = jtime;
- //MySQLUpdateInt(SQLID[playa], "AdminJailTime", AdminJailData[playa][1], "players");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET AdminJailTime = %i WHERE id = %i", AdminJailData[playa][1], SQLID[playa]);
- mysql_pquery(conn, mquery);
- AJailPlayer(playa);
- SendClientMessageF(playa, COLOR_RED, "Admin %s has put you in the Admin Jail for %i minutes [Reason: %s]", NameEx(playerid), jtime, reason);
- format(gstr, sizeof(gstr), "Admin %s has Admin Jailed %s [Reason: %s]", NameEx(playerid), NameEx(playa), reason);
- SendClientMessageToAllLogged(COLOR_LIGHTBLUE, gstr);
- printf("[Cmd] Admin %s Has A-Jailed %s For %i Minute(s) [Reason: %s]", NameEx(playerid), NameEx(playa), jtime, reason);
- AJailingPlayer[playerid] = -1;
- AddToAdminRecord(SQLID[playa], SQLID[playerid], ADMIN_RECORD_TYPE_AJAIL, jtime, reason);
- format(gstr, sizeof(gstr), "AJailed for %s, %i min", reason, jtime);
- AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
- }
- return true;
- }
- Dialog:AjailReason(playerid, response, listitem, inputtext[])
- {
- if(response == 0)
- {
- AJailingPlayer[playerid] = -1;
- return true;
- }
- new playa = AJailingPlayer[playerid];
- if(isnull(inputtext))
- {
- format(gstr, sizeof(gstr), "{FFFFFF}Admin Jail {FF4753}%s(ID %i){FFFFFF} for {FF4753}%i{FFFFFF} minutes.\n\nReason?", NameEx(playa), playa, AJailingTime[playerid]);
- Dialog_Show(playerid, AjailReason, DIALOG_STYLE_INPUT, "Reason for Admin Jail", gstr, "Continue", "Cancel");
- return true;
- }
- new jtime = AJailingTime[playerid];
- AdminJailData[playa][0] = 1;
- AdminJailData[playa][1] = jtime;
- //MySQLUpdateInt(SQLID[playa], "AdminJailTime", AdminJailData[playa][1], "players");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET AdminJailTime = %i WHERE id = %i", AdminJailData[playa][1], SQLID[playa]);
- mysql_pquery(conn, mquery);
- AJailPlayer(playa);
- format(gstr, sizeof(gstr), "Admin %s has put you in the Admin Jail for %i minutes [Reason: %s]", NameEx(playerid), jtime, inputtext);
- SendClientMessage(playa, COLOR_RED, gstr);
- format(gstr, sizeof(gstr), "Admin %s has Admin Jailed %s [Reason: %s]", NameEx(playerid), NameEx(playa), inputtext);
- SendClientMessageToAllLogged(COLOR_LIGHTBLUE, gstr);
- printf("[Cmd] Admin %s Has A-Jailed %s For %i Minute(s) [Reason: %s]", NameEx(playerid), NameEx(playa), jtime, inputtext);
- AJailingPlayer[playerid] = -1;
- AJailingTime[playerid] = 0;
- AddToAdminRecord(SQLID[playa], SQLID[playerid], ADMIN_RECORD_TYPE_AJAIL, jtime, inputtext);
- format(gstr, sizeof(gstr), "AJailed for %s, %i min", inputtext, jtime);
- AdminLog(playerid, SQLID[playa], GetName(playa), gstr);
- return true;
- }
- Dialog:AdminRecordMenu(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- new name[MAX_PLAYER_NAME];
- format(name, sizeof(name), "%s", GetSQLName(ViewAdminRecord[playerid]));
- if(strcmp("VIEW GENERAL RECORD", inputtext, false) == 0)
- {
- LoadAdminRecordPage(playerid, 0, name);
- return true;
- }
- if(strcmp("View Kick Log", inputtext, true) == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,AdminSQLID,Reason,DateOfAction,Amount FROM adminrecord WHERE PlayerSQLID=%i AND RecordType=%i ORDER BY id DESC LIMIT 10", ViewAdminRecord[playerid], ADMIN_RECORD_TYPE_KICK);
- mysql_pquery(conn, mquery, "LoadAdminRecordPage", "dds", playerid, ADMIN_RECORD_TYPE_KICK, name);
- }
- else if(strcmp("View Perm Ban Log", inputtext, true) == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,AdminSQLID,Reason,DateOfAction,Amount FROM adminrecord WHERE PlayerSQLID=%i AND RecordType=%i ORDER BY id DESC LIMIT 10", ViewAdminRecord[playerid], ADMIN_RECORD_TYPE_PERMBAN);
- mysql_pquery(conn, mquery, "LoadAdminRecordPage", "dds", playerid, ADMIN_RECORD_TYPE_PERMBAN, name);
- }
- else if(strcmp("View Temp Ban Log", inputtext, true) == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,AdminSQLID,Reason,DateOfAction,Amount FROM adminrecord WHERE PlayerSQLID=%i AND RecordType=%i ORDER BY id DESC LIMIT 10", ViewAdminRecord[playerid], ADMIN_RECORD_TYPE_TEMPBAN);
- mysql_pquery(conn, mquery, "LoadAdminRecordPage", "dds", playerid, ADMIN_RECORD_TYPE_TEMPBAN, name);
- }
- else if(strcmp("View Date Ban Log", inputtext, true) == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,AdminSQLID,Reason,DateOfAction,Amount FROM adminrecord WHERE PlayerSQLID=%i AND RecordType=%i ORDER BY id DESC LIMIT 10", ViewAdminRecord[playerid], ADMIN_RECORD_TYPE_DATEBAN);
- mysql_pquery(conn, mquery, "LoadAdminRecordPage", "dds", playerid, ADMIN_RECORD_TYPE_DATEBAN, name);
- }
- else if(strcmp("View Admin Jail Log", inputtext, true) == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,AdminSQLID,Reason,DateOfAction,Amount FROM adminrecord WHERE PlayerSQLID=%i AND RecordType=%i ORDER BY id DESC LIMIT 10", ViewAdminRecord[playerid], ADMIN_RECORD_TYPE_AJAIL);
- mysql_pquery(conn, mquery, "LoadAdminRecordPage", "dds", playerid, ADMIN_RECORD_TYPE_AJAIL, name);
- }
- else if(strcmp("View Mute Log", inputtext, true) == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,AdminSQLID,Reason,DateOfAction,Amount FROM adminrecord WHERE PlayerSQLID=%i AND RecordType=%i ORDER BY id DESC LIMIT 10", ViewAdminRecord[playerid], ADMIN_RECORD_TYPE_MUTE);
- mysql_pquery(conn, mquery, "LoadAdminRecordPage", "dds", playerid, ADMIN_RECORD_TYPE_MUTE, name);
- }
- }
- return true;
- }
- Dialog:AdminRecordDetails(playerid, response, listitem, inputtext[])
- {
- if(response == 1) Dialog_Show(playerid, AdminRecordMenu, DIALOG_STYLE_LIST, "Admin Record", "{FFFFFF}VIEW {FFCE2E}GENERAL{FFFFFF} RECORD\nView {FFCE2E}Kick{FFFFFF} Log\nView {FFCE2E}Perm Ban{FFFFFF} Log\nView {FFCE2E}Temp Ban{FFFFFF} Log\nView {FFCE2E}Date Ban{FFFFFF} Log\nView {FFCE2E}Admin Jail{FFFFFF} Log\nView {FFCE2E}Mute{FFFFFF} Log", "Select", "Cancel");
- return true;
- }
- Dialog:FightDialog(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- SetPlayerSkinEx(playerid, cPlayersSkin[playerid]);
- SetCameraBehindPlayer(playerid);
- SetPlayerVirtualWorldEx(playerid, BizzData[IsInBizzID[playerid]][BizzVW]);
- TogglePlayerControllable(playerid, true);
- StopLoopingAnim(playerid);
- DeletePVar(playerid, "FStyleBuy");
- return true;
- }
- if(Cash[playerid] < 50000)
- {
- SysMsg(playerid, "You need $50,000 to learn this style.");
- SetPlayerSkinEx(playerid, cPlayersSkin[playerid]);
- SetPlayerVirtualWorldEx(playerid, BizzData[IsInBizzID[playerid]][BizzVW]);
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllable(playerid, true);
- StopLoopingAnim(playerid);
- DeletePVar(playerid, "FStyleBuy");
- return true;
- }
- GivePlayerCash(playerid, -50000);
- SetPlayerSkinEx(playerid, cPlayersSkin[playerid]);
- SetPlayerVirtualWorldEx(playerid, BizzData[IsInBizzID[playerid]][BizzVW]);
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllable(playerid, true);
- StopLoopingAnim(playerid);
- if(GetPVarInt(playerid, "FStyleBuy") == 2)
- {
- SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
- FightStyleLearned[playerid]{FS_KUNGFU} = true;
- UsingFightStyle{playerid} = FIGHT_STYLE_KUNGFU;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET FightStyle = %i, FightStyleLearnedKungFu = 1 WHERE id = %i", FIGHT_STYLE_KUNGFU, SQLID[playerid]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, COLOR_WHITE, "You have a new fighting style! [{4897FF}Kung Fu{FFFFFF}, Cost: {4897FF}$50,000{FFFFFF}]");
- SetPlayerSkinEx(playerid, cPlayersSkin[playerid]);
- }
- else if(GetPVarInt(playerid, "FStyleBuy") == 1)
- {
- SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
- FightStyleLearned[playerid]{FS_BOXING} = true;
- UsingFightStyle{playerid} = FIGHT_STYLE_BOXING;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET FightStyle = %i, FightStyleLearnedBoxing = 1 WHERE id = %i", FIGHT_STYLE_BOXING, SQLID[playerid]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, COLOR_WHITE, "You have a new fighting style! [{4897FF}Boxing{FFFFFF}, Cost: {4897FF}$50,000{FFFFFF}]");
- SetPlayerSkinEx(playerid, cPlayersSkin[playerid]);
- }
- DeletePVar(playerid, "FStyleBuy");
- return true;
- }
- Dialog:FactionMemberList(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- if(strcmp("> Next Page", inputtext, true) == 0)
- {
- MemberListIndex[playerid] ++;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Online,Name,FactionRank,FactionCustomRank FROM players WHERE Faction = %i ORDER BY FactionRank DESC LIMIT 20 OFFSET %i", MemberBrowsing[playerid], MemberListIndex[playerid] * 20);
- mysql_pquery(conn, mquery, "DisplayFactionMemberList", "dd", playerid, MemberListIndex[playerid]);
- }
- else if(strcmp("< Previous Page", inputtext, true) == 0)
- {
- MemberListIndex[playerid] --;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Online,Name,FactionRank,FactionCustomRank FROM players WHERE Faction = %i ORDER BY FactionRank DESC LIMIT 20 OFFSET %i", MemberBrowsing[playerid], MemberListIndex[playerid] * 20);
- mysql_pquery(conn, mquery, "DisplayFactionMemberList", "dd", playerid, MemberListIndex[playerid]);
- }
- else
- {
- if(!IsValidLeaderRank(MemberBrowsing[playerid], FactionRank[playerid])) return SysMsg(playerid, "You are not a high enough rank to access the member management options.");
- new playername[MAX_PLAYER_NAME];
- strmid(playername, inputtext, 0, strfind(inputtext, " "));
- MemberNameForAction[playerid] = playername;
- format(tgstr, sizeof(tgstr), "{FFFFFF}Perform Action on {009FFB}%s", playername);
- Dialog_Show(playerid, FactionMemberListActions, DIALOG_STYLE_LIST, tgstr, "{00FF00}Promote\n{FFA900}Demote\n{FF0000}Fire", "Select", "Cancel");
- }
- return true;
- }
- Dialog:FactionMemberListActions(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(listitem == 0) cmd_promote(playerid, MemberNameForAction[playerid]);
- else if(listitem == 1) cmd_demote(playerid, MemberNameForAction[playerid]);
- else if(listitem == 2) cmd_fire(playerid, MemberNameForAction[playerid]);
- MemberNameForAction[playerid][0] = EOS;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Online,Name,FactionRank,FactionCustomRank FROM players WHERE Faction = %i ORDER BY FactionRank DESC LIMIT 20 OFFSET %i", MemberBrowsing[playerid], MemberListIndex[playerid] * 20);
- mysql_pquery(conn, mquery, "DisplayFactionMemberList", "dd", playerid, MemberListIndex[playerid]);
- }
- else
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Online,Name,FactionRank,FactionCustomRank FROM players WHERE Faction = %i ORDER BY FactionRank DESC LIMIT 20 OFFSET %i", MemberBrowsing[playerid], MemberListIndex[playerid] * 20);
- mysql_pquery(conn, mquery, "DisplayFactionMemberList", "dd", playerid, MemberListIndex[playerid]);
- }
- return true;
- }
- Dialog:NavigationDialog(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- new type[6], description[60], a;
- strmid(type, inputtext, 0, strfind(inputtext, ": "));
- format(description, sizeof(description), inputtext[strfind(inputtext, ": ") + 2]);
- if(strcmp("house", type, true) == 0)
- {
- for(a = 0; a < MAX_HOUSES; a++)
- {
- if(strlen(HouseData[a][HouseDescription]) > 1 && strfind(HouseData[a][HouseDescription], description, true) != -1)
- {
- HasGPSWaypoint[playerid] = 1;
- format(gstr, sizeof(gstr), "Pocket GPS set to '%s'.", description);
- SendClientMessage(playerid, COLOR_ORANGE, gstr);
- SendSatNavText(playerid, "GPS voice says: Calculating route, please wait...");
- DisablePlayerRaceCheckpoint(playerid);
- SetPlayerRaceCheckpointEx(playerid, 2, HouseData[a][oPosX], HouseData[a][oPosY], HouseData[a][oPosZ], 0.0, 0.0, 0.0, 20.0);
- format(gstr, sizeof(gstr), "GPS voice says: Route to '%s' calculated, proceed to waypoint.", description);
- SendSatNavText(playerid, gstr);
- break;
- }
- }
- }
- else if(strcmp("bizz", type, true) == 0)
- {
- for(a = 0; a < MAX_BIZZ; a++)
- {
- if(strlen(BizzData[a][BizzDescription]) > 1 && strfind(BizzData[a][BizzDescription], description, true) != -1)
- {
- HasGPSWaypoint[playerid] = 1;
- format(gstr, sizeof(gstr), "Pocket GPS set to '%s'.", description);
- SendClientMessage(playerid, COLOR_ORANGE, gstr);
- SendSatNavText(playerid, "GPS voice says: Calculating route, please wait...");
- DisablePlayerRaceCheckpoint(playerid);
- if(IsMallBizz(a)) SetPlayerRaceCheckpointEx(playerid, 2, 123.621, 1057.21, 13.6159, 0.0, 0.0, 0.0, 20.0);
- else SetPlayerRaceCheckpointEx(playerid, 2, BizzData[a][oPosX], BizzData[a][oPosY], BizzData[a][oPosZ], 0.0, 0.0, 0.0, 20.0);
- format(gstr, sizeof(gstr), "GPS voice says: Route to '%s' calculated, proceed to waypoint.", description);
- SendSatNavText(playerid, gstr);
- break;
- }
- }
- }
- else if(strcmp("poi", type, true) == 0)
- {
- for(a = 0; a < MAX_INTERIORS; a++)
- {
- if(strlen(Interiors[a][InteriorName]) > 1 && strfind(Interiors[a][InteriorName], description, true) != -1)
- {
- HasGPSWaypoint[playerid] = 1;
- format(gstr, sizeof(gstr), "Pocket GPS set to '%s'.", description);
- SendClientMessage(playerid, COLOR_ORANGE, gstr);
- SendSatNavText(playerid, "GPS voice says: Calculating route, please wait...");
- DisablePlayerRaceCheckpoint(playerid);
- SetPlayerRaceCheckpointEx(playerid, 2, Interiors[a][oPosX], Interiors[a][oPosY], Interiors[a][oPosZ], 0.0, 0.0, 0.0, 20.0);
- format(gstr, sizeof(gstr), "GPS voice says: Route to '%s' calculated, proceed to waypoint.", description);
- SendSatNavText(playerid, gstr);
- break;
- }
- }
- }
- }
- return true;
- }
- Dialog:NewsRequest(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(strlen(inputtext) <= 1) return Dialog_Show(playerid, NewsRequest, DIALOG_STYLE_INPUT, "#726", "{FFFFFF}You've reached the SAN hotline. Please leave your contact information below.", "Select", "Hangup");
- format(gstr, sizeof(gstr), "[News Contact Request] %s (%i): %s", NameEx(playerid),PhoneData[playerid][pNumber], inputtext);
- new newsers = 0;
- foreach(new i: Player)
- {
- if(Logged{i} && Faction[i] == FACTION_NEWS)
- {
- newsers ++;
- SendClientMessage(i, COLOR_BLUEGREEN, gstr);
- SetPlayerMarkerForPlayer(i, playerid, COLOR_BLUEGREEN);
- }
- }
- SendClientMessage(playerid, COLOR_WHITE,"An employee should contact you soon. Thank you.");
- HangupPhone(playerid);
- if(newsers == 0)
- {
- SysMsg(playerid,"I'm sorry but our help desk is currently offline, try again later.");
- HangupPhone(playerid);
- }
- }
- else if(response == 0) HangupPhone(playerid);
- return true;
- }
- Dialog:NewsRequest2(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(strlen(inputtext) <= 1) return Dialog_Show(playerid, NewsRequest2, DIALOG_STYLE_INPUT, "#726", "{FFFFFF}Alright, can you tell us what is happening or what has happened?", "Select", "Hangup");
- format(gstr, sizeof(gstr), "[Reported News] %s (%i): %s", NameEx(playerid),PhoneData[playerid][pNumber], inputtext);
- new newsers = 0;
- foreach(new i: Player)
- {
- if(Logged{i} && Faction[i] == FACTION_NEWS)
- {
- newsers ++;
- SendClientMessage(i, COLOR_BLUEGREEN, gstr);
- SetPlayerMarkerForPlayer(i, playerid, COLOR_BLUEGREEN);
- }
- }
- SendClientMessage(playerid, COLOR_WHITE,"Alright, we'll try to send a reporter.Thanks for helping us making the news!");
- HangupPhone(playerid);
- if(newsers == 0)
- {
- SysMsg(playerid,"I'm sorry but our help desk is currently offline, try again later.");
- HangupPhone(playerid);
- }
- }
- else if(response == 0) HangupPhone(playerid);
- return true;
- }
- Dialog:StockDelivery(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- new b, a;
- gstr[0] = EOS;
- for(b = 0; b < MAX_BIZZ; b++)
- {
- if(strcmp(inputtext, BizzData[b][BizzDescription], false) == 0 && strlen(BizzData[b][BizzDescription]) > 1)
- {
- if(DeliverStockList[playerid][0] == 0)
- {
- DeliverStockList[playerid][0] = b;
- BizzData[b][BizzETDelivering] = 1;
- break;
- }
- if(DeliverStockList[playerid][1] == 0)
- {
- DeliverStockList[playerid][1] = b;
- BizzData[b][BizzETDelivering] = 1;
- break;
- }
- if(DeliverStockList[playerid][2] == 0)
- {
- DeliverStockList[playerid][2] = b;
- BizzData[b][BizzETDelivering] = 1;
- break;
- }
- }
- }
- if(DeliverStockList[playerid][2] > 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "You have chosen the maximum amount of businesses to deliver to, the job will start upon entering a delivery truck.");
- DeliveringStock[playerid] = 1;
- }
- else
- {
- format(gstr, sizeof(gstr), "{FFFFFF}Would you like to add more delivery destinations?\nYour current job is listed below:\n\n{4BB74C}");
- for(a = 0; a < 3; a++)
- {
- if(DeliverStockList[playerid][a] > 0)
- {
- strcat(gstr, BizzData[DeliverStockList[playerid][a]][BizzDescription]);
- strcat(gstr, "\n");
- }
- }
- Dialog_Show(playerid, StockDeliveryMore, DIALOG_STYLE_MSGBOX, "Business Delivery", gstr, "Yes", "No");
- }
- }
- return true;
- }
- Dialog:StockDeliveryMore(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- gstr[0] = EOS;
- new bcount;
- for(new b = 0; b < MAX_BIZZ; b++)
- {
- if(BizzData[b][BizzRequestStock] == 1 && BizzData[b][BizzETDelivering] == 0)
- {
- strcat(gstr, BizzData[b][BizzDescription]);
- strcat(gstr, "\n");
- bcount ++;
- if(bcount == 40) break;
- }
- }
- if(bcount > 0)
- {
- Dialog_Show(playerid, StockDelivery, DIALOG_STYLE_LIST, "List of businesses requesting a delivery", gstr, "Add to Job", "Cancel");
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "There are no more businesses to deliver to, the job will start upon entering a delivery truck.");
- DeliveringStock[playerid] = 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "You have chosen the businesses you will deliver to, the job will start upon entering a delivery truck.");
- DeliveringStock[playerid] = 1;
- }
- return true;
- }
- Dialog:NamechangeRequest1(playerid, response, listitem, inputtext[])
- {
- if(response == 1) Dialog_Show(playerid, NamechangeRequest2, DIALOG_STYLE_INPUT, "{FFEEA7}Change Name", "{9BE27F}STEP 1/4\n{FFFFFF}Enter your desired name below.\nIt must be in the format of Firstname_Lastname", "Next", "Cancel");
- return true;
- }
- Dialog:NamechangeRequest2(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(!IsValidRoleplayName(inputtext) || !IsValidCharacter(inputtext) || strlen(inputtext) < 5) return Dialog_Show(playerid, NamechangeRequest2, DIALOG_STYLE_INPUT, "{FFEEA7}Change Name", "{9BE27F}STEP 1/4\n{FFFFFF}Enter your desired name below.\nIt must be in the format of Firstname_Lastname\n\n{8B0000}Error: {FF4753}That name did not meet the format Firstname_Lastname.", "Next", "Cancel");
- if(strcmp(GetName(playerid), inputtext, false) == 0) return Dialog_Show(playerid, NamechangeRequest2, DIALOG_STYLE_INPUT, "{FFEEA7}Change Name", "{9BE27F}STEP 1/4\n{FFFFFF}Enter your desired name below.\nIt must be in the format of Firstname_Lastname\n\n{8B0000}Error: {FF4753}You already have that name.", "Next", "Cancel");
- if(MySQLCheckAccount(inputtext, playerid) > 0) return Dialog_Show(playerid, NamechangeRequest2, DIALOG_STYLE_INPUT, "{FFEEA7}Change Name", "{9BE27F}STEP 1/4\n{FFFFFF}Enter your desired name below.\nIt must be in the format of Firstname_Lastname\n\n{8B0000}Error: {FF4753}That name is already in use.", "Next", "Cancel");
- if(strlen(inputtext) > MAX_PLAYER_NAME-2) return Dialog_Show(playerid, NamechangeRequest2, DIALOG_STYLE_INPUT, "{FFEEA7}Change Name", "{9BE27F}STEP 1/4\n{FFFFFF}Enter your desired name below.\nIt must be in the format of Firstname_Lastname\n\n{8B0000}Error: {FF4753}That name was too long.", "Next", "Cancel");
- format(NameChange[playerid], MAX_PLAYER_NAME, inputtext);
- Dialog_Show(playerid, NamechangeRequest3, DIALOG_STYLE_LIST, "{FFEEA7}Change Name - STEP 2/4", "{FFFFFF}Do not clear my criminal record\t{9BE27F}($25,000)\n{FFFFFF}Clear my criminal record\t{9BE27F}($50,000)", "Next", "Cancel");
- }
- return true;
- }
- Dialog:NamechangeRequest3(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- WantsNameChange[playerid][1] = listitem;
- Dialog_Show(playerid, NamechangeRequest4, DIALOG_STYLE_INPUT, "{FFEEA7}Change Name", "{9BE27F}STEP 3/4\n{FFFFFF}What is the reason for changing your name?", "Next", "Cancel");
- }
- return true;
- }
- Dialog:NamechangeRequest4(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(strlen(inputtext) < 2) return Dialog_Show(playerid, NamechangeRequest4, DIALOG_STYLE_INPUT, "{FFEEA7}Change Name", "{9BE27F}STEP 3/4\n{FFFFFF}What is the reason for changing your name?", "Next", "Cancel");
- format(NameChangeReason[playerid], 50, inputtext);
- gstr[0] = EOS;
- new clearRec[10], fee;
- switch(WantsNameChange[playerid][1])
- {
- case 0:
- {
- format(clearRec, sizeof(clearRec), "No Change");
- fee = 25000;
- }
- case 1:
- {
- format(clearRec, sizeof(clearRec), "Clear");
- fee = 50000;
- }
- }
- format(gstr, sizeof(gstr), "{9BE27F}STEP 4/4\n{FFFFFF}Check that the details below are correct and click Confirm to send the request to all suitable Admins.\n\nCurrent Name: {8B0000}%s\n{FFFFFF}New Name: {8B0000}%s\n{FFFFFF}Criminal Record: {8B0000}%s\n{FFFFFF}Fee: {8B0000}$%i\n{FFFFFF}Reason: {8B0000}%s", NameEx(playerid), RPName(NameChange[playerid]), clearRec, fee, NameChangeReason[playerid]);
- Dialog_Show(playerid, NamechangeRequest5, DIALOG_STYLE_MSGBOX, "{FFEEA7}Change Name", gstr, "Confirm", "Cancel");
- }
- return true;
- }
- Dialog:NamechangeRequest5(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- WantsNameChange[playerid][0] = 1;
- foreach(new i: Player)
- {
- if(IsPlayerAdminLevelOK(i,1) || IsHelper{i})
- {
- SendClientMessageF(i, COLOR_WHITE, "* Player '%s' wants their name changed to '{FF0000}%s{FFFFFF}', use /confirmname to manage.", NameEx(playerid), RPName(NameChange[playerid]));
- }
- }
- format(gstr, sizeof(gstr),"Your name change request to %s has been sent to all suitable online Admins. They must first confirm it.", RPName(NameChange[playerid]));
- SendClientMessage(playerid, COLOR_DARKBLUE, gstr);
- }
- return true;
- }
- Dialog:VehicleCollection(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- for(new v = 0, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(strfind(inputtext, RepairData[v][rRegPlate]) != -1)
- {
- if(RepairData[v][rOwnerSQLID] == SQLID[playerid])
- {
- RepairData[v][rModel] = 0;
- RepairData[v][rOwnerSQLID] = 0;
- RepairData[v][rFaction] = 0;
- RepairData[v][rRegPlate][0] = 0;
- RepairData[v][OwnerNotified] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM vehicles WHERE id = %i", RepairData[v][rSQLID]);
- mysql_pquery(conn, mquery, "LoadGarageVehicle", "dd", playerid, v);
- return true;
- }
- else if(RepairData[v][rFaction] == Faction[playerid])
- {
- RepairData[v][rModel] = 0;
- RepairData[v][rOwnerSQLID] = 0;
- RepairData[v][rFaction] = 0;
- RepairData[v][rRegPlate][0] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM fveh WHERE id = %i", RepairData[v][rSQLID]);
- mysql_pquery(conn, mquery, "LoadGarageFVehicle", "dd", playerid, v);
- return true;
- }
- SysMsg(playerid, "You are not able to collect this vehicle as you either don't own it or its not in your faction.");
- }
- }
- SysMsg(playerid, "[Error:] An error has occurred and you have been unable to retrieve your vehicle, please contact an administrator if the issue persists.");
- }
- return true;
- }
- Dialog:ExteriorFurnitureEdit(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerEditOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- DeleteFurnEditPVars(playerid);
- return true;
- }
- new h = GetHouseForExteriorEdit(playerid);
- if(h == -1)
- {
- PlayerEditOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- DeleteFurnEditPVars(playerid);
- SysMsg(playerid, "Could not find a house for editing.");
- return true;
- }
- switch(listitem)
- {
- case 0: //Edit placement
- {
- GetDynamicObjectPos(PlayerEditOutdoorFurniture[playerid], FurnPosX[playerid], FurnPosY[playerid], FurnPosZ[playerid]);
- GetDynamicObjectRot(PlayerEditOutdoorFurniture[playerid], FurnRotX[playerid], FurnRotY[playerid], FurnRotZ[playerid]);
- EditDynamicObject(playerid, PlayerEditOutdoorFurniture[playerid]);
- }
- case 1: //Snap object
- {
- new count = 0, mfurniture[MAX_EHFURNITURE], desc[MAX_EHFURNITURE][32];
- for(new i = 0; i < MAX_EHFURNITURE; i++)
- {
- if(EFurnData[h][EFurnModel][i] > 0 && !EFurnData[h][EFurnPlaced][i])
- {
- mfurniture[count] = EFurnData[h][EFurnModel][i];
- format(desc[count], 32, "%s", GetHouseFurnitureName(EFurnData[h][EFurnModel][i]));
- count++;
- }
- }
- if(count == 0)
- {
- SysMsg(playerid, "You do not have any unplaced objects.");
- PlayerEditOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- DeleteFurnEditPVars(playerid);
- return true;
- }
- //else ShowModelSelectionMenu(playerid, "Snap an Object", MODEL_EFURNITURE_SNAP, mfurniture, desc, count, 0.0, 0.0, 90.0);
- return true;
- }
- case 2: //Duplicate
- {
- if(BuyFurnFrom[playerid] == -1)
- {
- DeleteFurnEditPVars(playerid);
- PlayerEditOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- return SysMsg(playerid, "You have not set where you'd like money to be taken from when buying furniture. Please use /payfurn to set this.");
- }
- for(new x = 0; x < MAX_FURNITURE; x++)
- {
- if(EFurnData[h][EFurnModel][GetPVarInt(playerid, "HFArrayIndex")] == FurniData[x][fModel])
- {
- if(BuyFurnFrom[playerid] == 1)
- {
- if(Cash[playerid] < FurniData[x][fPrice])
- {
- DeleteFurnEditPVars(playerid);
- PlayerEditOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- return SysMsg(playerid, "You do not have the required cash for this item.");
- }
- }
- else
- {
- if(BankBalance[playerid] < FurniData[x][fPrice])
- {
- DeleteFurnEditPVars(playerid);
- PlayerEditOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- return SysMsg(playerid, "You do not have the required cash for this item.");
- }
- }
- for(new slot = 0; slot < MAX_EHFURNITURE; slot++)
- {
- if(EFurnData[h][EFurnModel][slot] == 0)
- {
- new f = GetPVarInt(playerid, "HFArrayIndex"), Float:xp, Float:y, Float:z, Float:rx, Float:ry, Float:rz;
- GetDynamicObjectPos(EFurnData[h][EFurnObject][f], xp, y, z);
- GetDynamicObjectRot(EFurnData[h][EFurnObject][f], rx, ry, rz);
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO efurniture (Model,Placed,HouseSQLID,Xpos,Ypos,Zpos,Xrot,Yrot,Zrot) VALUES (%i,1,%i,%f,%f,%f,%f,%f,%f)", FurniData[x][fModel], HouseData[h][HouseSQLID], xp, y, z, rx, ry, rz);
- mysql_pquery(conn, mquery, "InsertExteriorFurni", "iii", playerid, slot, h);
- EFurnData[h][EFurnObject][slot] = CreateDynamicObject(EFurnData[h][EFurnModel][f], xp, y, z, rx, ry, rz, -1, -1, -1, HouseData[h][ExtStreamDist]);
- EFurnData[h][EFurnModel][slot] = FurniData[x][fModel];
- EFurnData[h][EFurnPlaced][slot] = true;
- PlayerEditOutdoorFurniture[playerid] = EFurnData[h][EFurnObject][slot];
- EditDynamicObject(playerid, PlayerEditOutdoorFurniture[playerid]);
- SetPVarInt(playerid, "HFArrayIndex", slot);
- if(BuyFurnFrom[playerid] == 0) //take money from the player's bank
- {
- BankBalance[playerid] -= FurniData[x][fPrice];
- mysql_pqueryf(conn, "UPDATE players SET Bank = %i WHERE id = %i", BankBalance[playerid], SQLID[playerid]);
- }
- else GivePlayerCash(playerid, -FurniData[x][fPrice]); //take money from their wallet.
- SendClientMessageF(playerid, COLOR_WHITE, "You have duplicated the furniture item.");
- return true;
- }
- }
- SysMsg(playerid, "Unable to find a slot. You have reached the exterior furniture limit.");
- DeleteFurnEditPVars(playerid);
- PlayerEditOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- return true;
- }
- }
- SysMsg(playerid, "A strange error has occurred.");
- DeleteFurnEditPVars(playerid);
- PlayerEditOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- return true;
- }
- case 3: //Align
- {
- new f = GetPVarInt(playerid, "HFArrayIndex"), Float:rx, Float:ry, Float:rz;
- GetDynamicObjectRot(EFurnData[h][EFurnObject][f], rx, ry, rz);
- new
- newrx = floatround(rx),
- newry = floatround(ry),
- newrz = floatround(rz);
- if(newrx < 45 && newrx > -1) newrx = 0;
- else if(newrx > 45 && newrx < 135) newrx = 90;
- else if(newrx > 135 && newrx < 225) newrx = 180;
- else if(newrx > 225 && newrx < 315) newrx = 270;
- else if(newrx > 315 && newrx <= 359) newrx = 360;
- else if(newrx > -45 && newrx < -1) newrx = 0;
- else if(newrx < -46 && newrx > -135) newrx = -90;
- else if(newrx < -136 && newrx > -225) newrx = -180;
- else if(newrx < -226 && newrx > -315) newrx = -270;
- else if(newrx < -316 && newrx >= -359) newrx = -360;
- else newrx = 0;
- if(newry < 45 && newry > -1) newry = 0;
- else if(newry > 45 && newry < 135) newry = 90;
- else if(newry > 135 && newry < 225) newry = 180;
- else if(newry > 225 && newry < 315) newry = 270;
- else if(newry > 315 && newry <= 359) newry = 360;
- else if(newry > -45 && newry < -1) newry = 0;
- else if(newry < -46 && newry > -135) newry = -90;
- else if(newry < -136 && newry > -225) newry = -180;
- else if(newry < -226 && newry > -315) newry = -270;
- else if(newry < -316 && newry >= -359) newry = -360;
- else newry = 0;
- if(newrz < 45 && newrz > -1) newrz = 0;
- else if(newrz > 45 && newrz < 135) newrz = 90;
- else if(newrz > 135 && newrz < 225) newrz = 180;
- else if(newrz > 225 && newrz < 315) newrz = 270;
- else if(newrz > 315 && newrz <= 359) newrz = 360;
- else if(newrz > -45 && newrz < -1) newrz = 0;
- else if(newrz < -46 && newrz > -135) newrz = -90;
- else if(newrz < -136 && newrz > -225) newrz = -180;
- else if(newrz < -226 && newrz > -315) newrz = -270;
- else if(newrz < -316 && newrz >= -359) newrz = -360;
- else newrz = 0;
- SetDynamicObjectRot(EFurnData[h][EFurnObject][f], newrx, newry, newrz);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE efurniture SET Xrot = %f, Yrot = %f, Zrot = %f WHERE id = %i", float(newrx), float(newry), float(newrz), EFurnData[h][EFurnSQLID][f]);
- mysql_pquery(conn, mquery);
- Dialog_Show(playerid, ExteriorFurnitureEdit, DIALOG_STYLE_LIST, "House Item", OFURNEDITSTR, "Select", "Close");
- return true;
- }
- case 4: //Put Away
- {
- new f = GetPVarInt(playerid, "HFArrayIndex");
- if(PlayerEditOutdoorFurniture[playerid] == EFurnData[h][EFurnObject][f])
- {
- SendClientMessage(playerid, COLOR_WHITE, "You have placed the item back into your House Item Inventory");
- DestroyDynamicObjectEx(PlayerEditOutdoorFurniture[playerid], "PlayerEditOutdoorFurniture[playerid]");
- EFurnData[h][EFurnPlaced][f] = false;
- EFurnData[h][EFurnObject][f] = 0;
- PlayerEditOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- DeleteFurnEditPVars(playerid);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE efurniture SET Xpos = 0.0, Ypos = 0.0, Zpos = 0.0, Xrot = 0.0, Yrot = 0.0, Zrot = 0.0, Placed = 0 WHERE id = %i", EFurnData[h][EFurnSQLID][f]);
- mysql_pquery(conn, mquery);
- }
- DeleteFurnEditPVars(playerid);
- return true;
- }
- }
- return true;
- }
- Dialog:ExteriorFurnitureBuy(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- Dialog_Show(playerid, ExteriorFurnitureBuy2, DIALOG_STYLE_LIST, "Select A Furniture Category", GetSubcategoriesFromMainCat(listitem), "Select", "Cancel");
- SetPVarInt(playerid, "FurnCat", listitem);
- return true;
- }
- Dialog:ExteriorFurnitureBuy2(playerid, response, listitem, inputtext[])
- {
- if(!response) return Dialog_Show(playerid, ExteriorFurnitureBuy, DIALOG_STYLE_LIST, "Select A Furniture Category", GetHouseCategoryList(), "Select", "Cancel");
- gstr[0] = EOS;
- strcat(gstr, "Nome da mobília\tCost\n");
- for(new x = 0; x < MAX_FURNITURE; x++)
- {
- if(FurniData[x][fSubCategory] == listitem && FurniData[x][fCategory] == GetPVarInt(playerid, "FurnCat") && FurniData[x][fModel] != 0 && FurniData[x][fExteriorAllow])
- {
- format(sgstr, sizeof(sgstr), "%s\t$%s\n", FurniData[x][fuName], format_cash(FurniData[x][fPrice]));
- strcat(gstr, sgstr);
- }
- }
- Dialog_Show(playerid, ExteriorFurnitureBuy3, DIALOG_STYLE_TABLIST_HEADERS, "Buy Furniture", gstr, "Select", "Cancel");
- return true;
- }
- Dialog:ExteriorFurnitureBuy3(playerid, response, listitem, inputtext[])
- {
- if(!response) return Dialog_Show(playerid, ExteriorFurnitureBuy2, DIALOG_STYLE_LIST, "Select A Furniture Category", GetSubcategoriesFromMainCat(GetPVarInt(playerid, "FurnCat")), "Selecionar", "Cancelar");
- new f = -1;
- for(new x = 0; x < MAX_FURNITURE; x++)
- {
- if(strmatch(inputtext, FurniData[x][fuName]))
- {
- f = x;
- break;
- }
- }
- if(f == -1) return SysMsg(playerid, "An error has occurred. Please contact an admin with the following error code: FBNF"); //this should generally never happen but it's just a fail-safe.
- new Float:pX, Float:pY, Float:pZ, Float:pA;
- GetPlayerPos(playerid, pX, pY, pZ);
- SetPlayerPos(playerid, pX - 0.05, pY - 0.05, pZ);
- GetXYInFrontOfPlayer(playerid, pX, pY, 1.0);
- GetPlayerFacingAngle(playerid, pA);
- PlayerBuyOutdoorFurniture[playerid][0] = CreateDynamicObject(FurniData[f][fModel], pX, pY, pZ - 0.5, 0.0, 0.0, pA, -1, -1, -1, HouseData[GetHouseForExteriorEdit(playerid)][ExtStreamDist]);
- PlayerBuyOutdoorFurniture[playerid][1] = f;
- EditDynamicObject(playerid, PlayerBuyOutdoorFurniture[playerid][0]);
- Streamer_Update(playerid);
- return true;
- }
- Dialog:ExteriorFurnitureBuy4(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "You have cancelled your purchase of {BCDCBC}%s{FFFFFF}.", FurniData[PlayerBuyOutdoorFurniture[playerid][1]][fuName]);
- DestroyDynamicObjectEx(PlayerBuyOutdoorFurniture[playerid][0], "PlayerBuyOutdoorFurniture[playerid][0] 0");
- PlayerBuyOutdoorFurniture[playerid][0] = INVALID_OBJECT_ID;
- PlayerBuyOutdoorFurniture[playerid][1] = -1;
- BuyFurnPos[playerid][0] = 0.0;
- BuyFurnPos[playerid][1] = 0.0;
- BuyFurnPos[playerid][2] = 0.0;
- BuyFurnPos[playerid][3] = 0.0;
- BuyFurnPos[playerid][4] = 0.0;
- BuyFurnPos[playerid][5] = 0.0;
- DeleteFurnEditPVars(playerid);
- return true;
- }
- new h = PlayerBuyOutdoorFurniture[playerid][1], toobroketoafford = 0;
- if(Cash[playerid] < FurniData[h][fPrice] && BuyFurnFrom[playerid] == 1) toobroketoafford = 1;
- else if(BankBalance[playerid] < FurniData[h][fPrice] && BuyFurnFrom[playerid] == 0) toobroketoafford = 1;
- if(toobroketoafford == 1)
- {
- DestroyDynamicObjectEx(PlayerBuyOutdoorFurniture[playerid][0], "PlayerBuyOutdoorFurniture[playerid][0] 1");
- PlayerBuyOutdoorFurniture[playerid][0] = INVALID_OBJECT_ID;
- PlayerBuyOutdoorFurniture[playerid][1] = -1;
- BuyFurnPos[playerid][0] = 0.0;
- BuyFurnPos[playerid][1] = 0.0;
- BuyFurnPos[playerid][2] = 0.0;
- BuyFurnPos[playerid][3] = 0.0;
- BuyFurnPos[playerid][4] = 0.0;
- BuyFurnPos[playerid][5] = 0.0;
- SysMsg(playerid, "You do not have the required cash for this item.");
- DeleteFurnEditPVars(playerid);
- return true;
- }
- new x = GetHouseForExteriorEdit(playerid);
- for(new slot = 0; slot < MAX_EHFURNITURE; slot++)
- {
- if(EFurnData[x][EFurnModel][slot] == 0)
- {
- DestroyDynamicObjectEx(PlayerBuyOutdoorFurniture[playerid][0], "PlayerBuyOutdoorFurniture[playerid][0] 2");
- PlayerBuyOutdoorFurniture[playerid][0] = INVALID_OBJECT_ID;
- PlayerBuyOutdoorFurniture[playerid][1] = -1;
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO efurniture (Model,Placed,Xpos,Ypos,Zpos,Xrot,Yrot,Zrot,HouseSQLID) VALUES (%i,1,%f,%f,%f,%f,%f,%f,%i)",
- FurniData[h][fModel], BuyFurnPos[playerid][0], BuyFurnPos[playerid][1], BuyFurnPos[playerid][2], BuyFurnPos[playerid][3], BuyFurnPos[playerid][4], BuyFurnPos[playerid][5], HouseData[x][HouseSQLID]);
- mysql_pquery(conn, mquery, "InsertExteriorFurni", "iii", playerid, slot, x);
- EFurnData[x][EFurnObject][slot] = CreateDynamicObject(FurniData[h][fModel], BuyFurnPos[playerid][0], BuyFurnPos[playerid][1], BuyFurnPos[playerid][2], BuyFurnPos[playerid][3], BuyFurnPos[playerid][4], BuyFurnPos[playerid][5], -1, -1, -1, HouseData[h][ExtStreamDist]);
- EFurnData[x][EFurnModel][slot] = FurniData[h][fModel];
- EFurnData[x][EFurnPlaced][slot] = true;
- Streamer_Update(playerid);
- BuyFurnPos[playerid][0] = 0.0;
- BuyFurnPos[playerid][1] = 0.0;
- BuyFurnPos[playerid][2] = 0.0;
- BuyFurnPos[playerid][3] = 0.0;
- BuyFurnPos[playerid][4] = 0.0;
- BuyFurnPos[playerid][5] = 0.0;
- break;
- }
- }
- if(!IsPlayerAdmin(playerid))
- {
- if(BuyFurnFrom[playerid] == 0) //take money from the player's bank
- {
- BankBalance[playerid] -= FurniData[h][fPrice];
- mysql_pqueryf(conn, "UPDATE players SET Bank = %i WHERE id = %i", BankBalance[playerid], SQLID[playerid]);
- }
- else GivePlayerCash(playerid, -FurniData[h][fPrice]); //take money from their wallet.
- }
- SendClientMessageF(playerid, COLOR_WHITE, "You have purchased a {BCDCBC}%s{FFFFFF} for {BCDCBC}$%i{FFFFFF}.", GetHouseFurnitureName(FurniData[h][fModel]), FurniData[h][fPrice]);
- DeleteFurnEditPVars(playerid);
- return true;
- }
- Dialog:FurniturePurchase(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- Dialog_Show(playerid, FurniturePurchase2, DIALOG_STYLE_LIST, "Select A Furniture Category", GetSubcategoriesFromMainCat(listitem), "Select", "Cancel");
- SetPVarInt(playerid, "FurnCat", listitem);
- return true;
- }
- Dialog:FurniturePurchase2(playerid, response, listitem, inputtext[])
- {
- if(!response) return Dialog_Show(playerid, FurniturePurchase, DIALOG_STYLE_LIST, "Select A Furniture Category", GetHouseCategoryList(), "Select", "Cancel");
- SetPVarInt(playerid, "FurnSubCat", listitem);
- gstr[0] = EOS;
- new mfurniture[MAX_FURNITURE], count;
- for(new x = 0; x < MAX_FURNITURE; x++)
- {
- if(FurniData[x][fSubCategory] == listitem && FurniData[x][fCategory] == GetPVarInt(playerid, "FurnCat") && FurniData[x][fModel] != 0)
- {
- mfurniture[count] = FurniData[x][fModel];
- count++;
- }
- }
- ShowModelSelectionMenu(playerid, "Buy furniture", MODEL_SELECTION_PFURNITURE, mfurniture, count, 0.0, 0.0, 50.0);
- return true;
- }
- Dialog:FurniturePurchase4(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- SendClientMessageF(playerid, COLOR_WHITE, "You have cancelled your purchase of {BCDCBC}%s{FFFFFF}.", FurniData[PlayerBuyFurniture[playerid][1]][fuName]);
- DestroyDynamicObjectEx(PlayerBuyFurniture[playerid][0], "PlayerBuyFurniture[playerid][0] 0");
- PlayerBuyFurniture[playerid][0] = INVALID_OBJECT_ID;
- PlayerBuyFurniture[playerid][1] = -1;
- BuyFurnPos[playerid][0] = 0.0;
- BuyFurnPos[playerid][1] = 0.0;
- BuyFurnPos[playerid][2] = 0.0;
- BuyFurnPos[playerid][3] = 0.0;
- BuyFurnPos[playerid][4] = 0.0;
- BuyFurnPos[playerid][5] = 0.0;
- DeleteFurnEditPVars(playerid);
- return true;
- }
- else
- {
- new h = PlayerBuyFurniture[playerid][1], toobroketoafford = 0;
- if(Cash[playerid] < FurniData[h][fPrice] && BuyFurnFrom[playerid] == 1) toobroketoafford = 1;
- else if(BankBalance[playerid] < FurniData[h][fPrice] && BuyFurnFrom[playerid] == 0) toobroketoafford = 1;
- if(toobroketoafford == 1)
- {
- DestroyDynamicObjectEx(PlayerBuyFurniture[playerid][0], "PlayerBuyFurniture[playerid][0] 1");
- PlayerBuyFurniture[playerid][0] = INVALID_OBJECT_ID;
- PlayerBuyFurniture[playerid][1] = -1;
- BuyFurnPos[playerid][0] = 0.0;
- BuyFurnPos[playerid][1] = 0.0;
- BuyFurnPos[playerid][2] = 0.0;
- BuyFurnPos[playerid][3] = 0.0;
- BuyFurnPos[playerid][4] = 0.0;
- BuyFurnPos[playerid][5] = 0.0;
- SysMsg(playerid, "You do not have the required cash for this item.");
- DeleteFurnEditPVars(playerid);
- return true;
- }
- for(new slot = 0; slot < GetMaxFurnitureForPlayer(playerid); slot++)
- {
- if(HouseData[IsInHouseID[playerid]][FurnModel][slot] == 0)
- {
- DestroyDynamicObjectEx(PlayerBuyFurniture[playerid][0], "PlayerBuyFurniture[playerid][0] 2");
- PlayerBuyFurniture[playerid][0] = INVALID_OBJECT_ID;
- PlayerBuyFurniture[playerid][1] = -1;
- new x = IsInHouseID[playerid];
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO hfurniture (Model,Placed,Xpos,Ypos,Zpos,Xrot,Yrot,Zrot,HouseSQLID) VALUES (%i,1,%f,%f,%f,%f,%f,%f,%i)",
- FurniData[h][fModel], BuyFurnPos[playerid][0], BuyFurnPos[playerid][1], BuyFurnPos[playerid][2], BuyFurnPos[playerid][3], BuyFurnPos[playerid][4], BuyFurnPos[playerid][5], HouseData[x][HouseSQLID]);
- mysql_pquery(conn, mquery, "InsertHouseFurni", "dd", playerid, slot);
- HouseData[x][FurnObject][slot] = CreateDynamicObject(FurniData[h][fModel], BuyFurnPos[playerid][0], BuyFurnPos[playerid][1], BuyFurnPos[playerid][2], BuyFurnPos[playerid][3], BuyFurnPos[playerid][4], BuyFurnPos[playerid][5], HouseData[x][HouseVW]);
- HouseData[x][FurnModel][slot] = FurniData[h][fModel];
- HouseData[x][FurnPlaced][slot] = 1;
- Streamer_Update(playerid);
- BuyFurnPos[playerid][0] = 0.0;
- BuyFurnPos[playerid][1] = 0.0;
- BuyFurnPos[playerid][2] = 0.0;
- BuyFurnPos[playerid][3] = 0.0;
- BuyFurnPos[playerid][4] = 0.0;
- BuyFurnPos[playerid][5] = 0.0;
- break;
- }
- }
- if(!IsPlayerAdmin(playerid))
- {
- if(BuyFurnFrom[playerid] == 0) //take money from the player's bank
- {
- BankBalance[playerid] -= FurniData[h][fPrice];
- mysql_pqueryf(conn, "UPDATE players SET Bank = %i WHERE id = %i", BankBalance[playerid], SQLID[playerid]);
- }
- else GivePlayerCash(playerid, -FurniData[h][fPrice]); //take money from their wallet.
- }
- SendClientMessageF(playerid, COLOR_WHITE, "You have purchased a {BCDCBC}%s{FFFFFF} for {BCDCBC}$%i{FFFFFF}.", GetHouseFurnitureName(FurniData[h][fModel]), FurniData[h][fPrice]);
- DeleteFurnEditPVars(playerid);
- return true;
- }
- }
- Dialog:ExteriorFurnRemoveAll(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- new h = GetHouseForExteriorEdit(playerid), count = 0;
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM efurniture WHERE HouseSQLID = %i AND Placed = 0", HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery);
- for(new f = 0; f < MAX_EHFURNITURE; f++)
- {
- if(!EFurnData[h][EFurnPlaced][f] && EFurnData[h][EFurnModel][f] != 0)
- {
- EFurnData[h][EFurnSQLID][f] = 0;
- EFurnData[h][EFurnModel][f] = 0;
- EFurnData[h][EFurnPlaced][f] = false;
- EFurnData[h][EFurnObject][f] = 0;
- count ++;
- }
- }
- SendClientMessageF(playerid, COLOR_WHITE, "You have removed {BCDCBC}%i{FFFFFF} unplaced furniture items", count);
- return true;
- }
- Dialog:ExteriorFurnPickupAll(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- new h = GetHouseForExteriorEdit(playerid), count = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE efurniture SET Placed = 0, Xpos = 0.0, Ypos = 0.0, Zpos = 0.0, Xrot = 0.0, Yrot = 0.0, Zrot = 0.0 WHERE HouseSQLID = %i AND Placed = 1", HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery);
- for(new f = 0; f < MAX_EHFURNITURE; f++)
- {
- if(EFurnData[h][EFurnPlaced][f] && EFurnData[h][EFurnModel][f] != 0)
- {
- DestroyDynamicObjectEx(EFurnData[h][EFurnObject][f], "EFurnData[h][EFurnObject][f]");
- EFurnData[h][EFurnPlaced][f] = false;
- EFurnData[h][EFurnObject][f] = 0;
- count ++;
- }
- }
- SendClientMessageF(playerid, COLOR_WHITE, "You have put away {BCDCBC}%i{FFFFFF} furniture items.", count);
- return true;
- }
- Dialog:FurnitureRemoveAll(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- new hid = IsInHouseID[playerid], counter = 0;
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM hfurniture WHERE HouseSQLID=%i AND Placed=0", HouseData[hid][HouseSQLID]);
- mysql_pquery(conn, mquery);
- for(new slot = 0; slot < MAX_HFURNITURE; slot++)
- {
- if(HouseData[hid][FurnPlaced][slot] == 0 && HouseData[hid][FurnModel][slot] > 0)
- {
- HouseData[hid][FurnSQLID][slot] = 0;
- HouseData[hid][FurnModel][slot] = 0;
- HouseData[hid][FurnPlaced][slot] = 0;
- HouseData[hid][FurnObject][slot] = 0;
- counter ++;
- }
- }
- format(gstr, sizeof(gstr), "You have removed {BCDCBC}%i{FFFFFF} unplaced furniture items.", counter);
- SendClientMessage(playerid, COLOR_WHITE, gstr);
- }
- return true;
- }
- Dialog:FurniturePickupAll(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- new hid = IsInHouseID[playerid], counter = 0, skip = 0;
- for(new slot = 0; slot < MAX_HFURNITURE; slot++)
- {
- if(HouseData[hid][FurnPlaced][slot] == 1 && HouseData[hid][FurnModel][slot] > 0)
- {
- if(HouseData[hid][FurnModel][slot] == WEED_OBJECT_GROWN) continue;
- if(HouseData[hid][FurnModel][slot] == WEED_OBJECT_POT)
- {
- for(new w = 0; w < MAX_WEED_PLANTS; w++)
- {
- if(WeedData[hid][PlantPotObj][w] == HouseData[hid][FurnObject][slot])
- {
- skip = 1;
- break;
- }
- }
- if(skip == 1)
- {
- skip = 0;
- continue;
- }
- }
- DestroyDynamicObjectEx(HouseData[hid][FurnObject][slot], "HouseData[hid][FurnObject][slot]");
- HouseData[hid][FurnPlaced][slot] = 0;
- HouseData[hid][FurnObject][slot] = 0;
- counter ++;
- }
- }
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET Placed = 0, Xpos = 0.0, Ypos = 0.0, Zpos = 0.0, Xrot = 0.0, Yrot = 0.0, Zrot = 0.0 WHERE HouseSQLID = %i AND Placed = 1", HouseData[hid][HouseSQLID]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_WHITE, "You have put away {BCDCBC}%i{FFFFFF} furniture items.", counter);
- }
- return true;
- }
- Dialog:FurnitureEdit(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- PlayerEditFurniture[playerid] = INVALID_OBJECT_ID;
- DeleteFurnEditPVars(playerid);
- return true;
- }
- new h = IsInHouseID[playerid], f = GetPVarInt(playerid, "HFArrayIndex");
- switch(listitem)
- {
- case 0: //Edit placement
- {
- GetDynamicObjectPos(PlayerEditFurniture[playerid], FurnPosX[playerid], FurnPosY[playerid], FurnPosZ[playerid]);
- GetDynamicObjectRot(PlayerEditFurniture[playerid], FurnRotX[playerid], FurnRotY[playerid], FurnRotZ[playerid]);
- EditDynamicObject(playerid, PlayerEditFurniture[playerid]);
- return true;
- }
- case 1: //Edit Texture
- {
- Dialog_Show(playerid, TextureSlot, DIALOG_STYLE_LIST, "Select Texture Slot", GetFreeTextureSlots(playerid, 1), "Set", "Cancel");
- return true;
- }
- case 2: //Remove Texture
- {
- Dialog_Show(playerid, TextureRemove, DIALOG_STYLE_LIST, "Remove A Texture", GetFreeTextureSlots(playerid, 0), "Okay", "Cancel");
- return true;
- }
- case 3: //Add texture color
- {
- Dialog_Show(playerid, TextureColor, DIALOG_STYLE_LIST, "Set Texture Color", GetFreeTextureSlots(playerid, 0), "Okay", "Cancel");
- return true;
- }
- case 4: //Remove texture color
- {
- Dialog_Show(playerid, TextureColorRemove, DIALOG_STYLE_LIST, "Remove Texture Color", GetFreeTextureSlots(playerid, 0), "Okay", "Cancel");
- return true;
- }
- case 5: //Snap an unplaced object to an existing object
- {
- new count = 0, mfurniture[MAX_HFURNITURE], desc[MAX_HFURNITURE][32];
- for(new i = 0; i < MAX_HFURNITURE; i++)
- {
- if(HouseData[h][FurnModel][i] > 0 && HouseData[h][FurnPlaced][i] == 0)
- {
- mfurniture[count] = HouseData[h][FurnModel][i];
- format(desc[count], 32, "%s", GetHouseFurnitureName(HouseData[h][FurnModel][i]));
- count++;
- }
- }
- if(count == 0)
- {
- SysMsg(playerid, "You do not have any unplaced objects.");
- PlayerEditFurniture[playerid] = INVALID_OBJECT_ID;
- DeleteFurnEditPVars(playerid);
- return true;
- }
- //else ShowModelSelectionMenu(playerid, "Snap an Object", MODEL_FURNITURE_SNAP, mfurniture, desc, count, 0.0, 0.0, 90.0);
- return true;
- }
- case 6: //duplicate an object.
- {
- if(BuyFurnFrom[playerid] == -1)
- {
- DeleteFurnEditPVars(playerid);
- PlayerEditFurniture[playerid] = INVALID_OBJECT_ID;
- return SysMsg(playerid, "You have not set where you'd like money to be taken from when buying furniture. Please use /payfurn to set this.");
- }
- for(new x = 0; x < MAX_FURNITURE; x++)
- {
- if(HouseData[IsInHouseID[playerid]][FurnModel][f] == FurniData[x][fModel])
- {
- if(BuyFurnFrom[playerid] == 1)
- {
- if(Cash[playerid] < FurniData[x][fPrice])
- {
- DeleteFurnEditPVars(playerid);
- PlayerEditFurniture[playerid] = INVALID_OBJECT_ID;
- return SysMsg(playerid, "You do not have the required cash for this item.");
- }
- }
- else
- {
- if(BankBalance[playerid] < FurniData[x][fPrice])
- {
- DeleteFurnEditPVars(playerid);
- PlayerEditFurniture[playerid] = INVALID_OBJECT_ID;
- return SysMsg(playerid, "You do not have the required cash for this item.");
- }
- }
- for(new slot = 0; slot < GetMaxFurnitureForPlayer(playerid); slot++)
- {
- if(HouseData[IsInHouseID[playerid]][FurnModel][slot] == 0)
- {
- new Float:xp, Float:y, Float:z, Float:rx, Float:ry, Float:rz;
- GetDynamicObjectPos(HouseData[h][FurnObject][f], xp, y, z);
- GetDynamicObjectRot(HouseData[h][FurnObject][f], rx, ry, rz);
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO hfurniture (Model,Placed,HouseSQLID,Xpos,Ypos,Zpos,Xrot,Yrot,Zrot) VALUES (%i,1,%i,%f,%f,%f,%f,%f,%f)", FurniData[x][fModel], HouseData[h][HouseSQLID], xp, y, z, rx, ry, rz);
- new Cache:result = mysql_query(conn, mquery);
- HouseData[h][FurnSQLID][slot] = cache_insert_id();
- cache_delete(result);
- HouseData[h][FurnObject][slot] = CreateDynamicObject(HouseData[h][FurnModel][f], xp, y, z, rx, ry, rz, HouseData[h][HouseVW]);
- HouseData[h][FurnModel][slot] = FurniData[x][fModel];
- HouseData[h][FurnPlaced][slot] = 1;
- //reapply textures/colors if any.
- new model, txd[64], txt[64], color, tcount;
- for(new k = 0; k < 15; k++)
- {
- if(tcount > MAX_TEXTURESLOTS) break;
- if(GetDynamicObjectMaterial(HouseData[h][FurnObject][f], k, model, txd, txt, color))
- {
- tcount ++;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET Material%iUsed = 1, Material%iIndex = %i, Material%iObject = %i, Material%iTxd = '%e', Material%iTexture = '%e', Material%iColor = %i WHERE id = %i",
- tcount, tcount, k, tcount, model, tcount, txd, tcount, txt, tcount, color, HouseData[h][FurnSQLID][slot]);
- mysql_pquery(conn, mquery);
- SetDynamicObjectMaterial(HouseData[h][FurnObject][slot], k, model, txd, txt, color);
- FurnitureIndex[h][slot][tcount] = k;
- }
- }
- PlayerEditFurniture[playerid] = HouseData[h][FurnObject][slot];
- EditDynamicObject(playerid, PlayerEditFurniture[playerid]);
- SetPVarInt(playerid, "HFArrayIndex", slot);
- if(BuyFurnFrom[playerid] == 0) //take money from the player's bank
- {
- BankBalance[playerid] -= FurniData[x][fPrice];
- mysql_pqueryf(conn, "UPDATE players SET Bank = %i WHERE id = %i", BankBalance[playerid], SQLID[playerid]);
- }
- else GivePlayerCash(playerid, -FurniData[x][fPrice]); //take money from their wallet.
- break;
- }
- }
- SendClientMessageF(playerid, COLOR_WHITE, "You have duplicated the furniture item.");
- return true;
- }
- }
- SysMsg(playerid, "A strange error has occurred.");
- DeleteFurnEditPVars(playerid);
- PlayerEditFurniture[playerid] = INVALID_OBJECT_ID;
- return true;
- }
- case 7: //Align an object's rotation.
- {
- new Float:rx, Float:ry, Float:rz;
- GetDynamicObjectRot(HouseData[h][FurnObject][f], rx, ry, rz);
- new
- newrx = floatround(rx),
- newry = floatround(ry),
- newrz = floatround(rz);
- if(newrx < 45 && newrx > -1) newrx = 0;
- else if(newrx > 45 && newrx < 135) newrx = 90;
- else if(newrx > 135 && newrx < 225) newrx = 180;
- else if(newrx > 225 && newrx < 315) newrx = 270;
- else if(newrx > 315 && newrx <= 359) newrx = 360;
- else if(newrx > -45 && newrx < -1) newrx = 0;
- else if(newrx < -46 && newrx > -135) newrx = -90;
- else if(newrx < -136 && newrx > -225) newrx = -180;
- else if(newrx < -226 && newrx > -315) newrx = -270;
- else if(newrx < -316 && newrx >= -359) newrx = -360;
- else newrx = 0;
- if(newry < 45 && newry > -1) newry = 0;
- else if(newry > 45 && newry < 135) newry = 90;
- else if(newry > 135 && newry < 225) newry = 180;
- else if(newry > 225 && newry < 315) newry = 270;
- else if(newry > 315 && newry <= 359) newry = 360;
- else if(newry > -45 && newry < -1) newry = 0;
- else if(newry < -46 && newry > -135) newry = -90;
- else if(newry < -136 && newry > -225) newry = -180;
- else if(newry < -226 && newry > -315) newry = -270;
- else if(newry < -316 && newry >= -359) newry = -360;
- else newry = 0;
- if(newrz < 45 && newrz > -1) newrz = 0;
- else if(newrz > 45 && newrz < 135) newrz = 90;
- else if(newrz > 135 && newrz < 225) newrz = 180;
- else if(newrz > 225 && newrz < 315) newrz = 270;
- else if(newrz > 315 && newrz <= 359) newrz = 360;
- else if(newrz > -45 && newrz < -1) newrz = 0;
- else if(newrz < -46 && newrz > -135) newrz = -90;
- else if(newrz < -136 && newrz > -225) newrz = -180;
- else if(newrz < -226 && newrz > -315) newrz = -270;
- else if(newrz < -316 && newrz >= -359) newrz = -360;
- else newrz = 0;
- SetDynamicObjectRot(HouseData[h][FurnObject][f], newrx, newry, newrz);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET Xrot = %f, Yrot = %f, Zrot = %f WHERE id = %i", float(newrx), float(newry), float(newrz), HouseData[h][FurnSQLID][f]);
- mysql_pquery(conn, mquery);
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", (IsWeedPlantObject(HouseData[h][FurnModel][f])) ? (WEEDEDITSTR) : (FURNEDITSTR), "Select", "Close");
- return true;
- }
- case 8: //Nudge an object's position
- {
- Dialog_Show(playerid, FurnitureNudge, DIALOG_STYLE_LIST, "Select the direction you'd like to nudge the object.", "North\nSouth\nEast\nWest\nUp\nDown", "Select", "Cancel");
- return true;
- }
- case 9: //Put Away
- {
- if(PlayerEditFurniture[playerid] == HouseData[h][FurnObject][f])
- {
- if(HouseData[h][FurnModel][f] == WEED_OBJECT_GROWN)
- {
- SendClientMessage(playerid, COLOR_WHITE, "You cannot put a marijuana plant away until it is harvested.");
- PlayerEditFurniture[playerid] = INVALID_OBJECT_ID;
- return true;
- }
- if(HouseData[h][FurnModel][f] == WEED_OBJECT_POT)
- {
- for(new w = 0; w < MAX_WEED_PLANTS; w++)
- {
- if(WeedData[h][PlantPotObj][w] == HouseData[h][FurnObject][f])
- {
- SendClientMessage(playerid, COLOR_WHITE, "You cannot put this plant pot away since it has a seed planted.");
- PlayerEditFurniture[playerid] = INVALID_OBJECT_ID;
- return true;
- }
- }
- }
- SendClientMessage(playerid, COLOR_WHITE, "You have placed the item back into your House Item Inventory");
- DestroyDynamicObjectEx(PlayerEditFurniture[playerid], "PlayerEditFurniture[playerid]");
- HouseData[h][FurnPlaced][f] = 0;
- HouseData[h][FurnObject][f] = 0;
- FurnitureIndex[h][f][0] = 0;
- FurnitureIndex[h][f][1] = 0;
- FurnitureIndex[h][f][2] = 0;
- PlayerEditFurniture[playerid] = INVALID_OBJECT_ID;
- DeleteFurnEditPVars(playerid);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET Xpos = NULL, Ypos = NULL, Zpos = NULL, Xrot = NULL, Yrot = NULL, Zrot = NULL, Placed = 0 WHERE id = %i", HouseData[h][FurnSQLID][f]);
- mysql_pquery(conn, mquery);
- RemoveAllFurnitureTextures(HouseData[h][FurnSQLID][f]);
- }
- return true;
- }
- case 10: //empty line for separating weed functions
- {
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", (IsWeedPlantObject(HouseData[h][FurnModel][f])) ? (WEEDEDITSTR) : (FURNEDITSTR), "Select", "Close");
- return true;
- }
- case 11: //plant
- {
- if(SQLID[playerid] != HouseData[h][HouseOwnerSQLID])
- {
- SysMsg(playerid, "You cannot edit weed as a guest furnisher.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- if(Inventory[playerid][WeedSeed] <= 0)
- {
- SendClientMessage(playerid, COLOR_WEED, "You do not have any weed seeds.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- for(new w = 0; w < MAX_WEED_PLANTS; w++)
- {
- if(WeedData[h][PlantPotObj][w] == HouseData[h][FurnObject][f])
- {
- SendClientMessage(playerid, COLOR_WEED, "This plant pot is already occupied.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- if(WeedData[h][PlantSQLID][w] == 0)
- {
- WeedData[h][PlantGrowth][w] = 0;
- WeedData[h][PlantWater][w] = 0;
- WeedData[h][PlantPotObj][w] = HouseData[h][FurnObject][f];
- WeedData[h][PlantFurnIndex][w] = f;
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO weed (HouseSQLID,Growth,Water,FurnSQLID) VALUES (%i,0,0,%i)", HouseData[h][HouseSQLID], HouseData[h][FurnSQLID][f]);
- new Cache:result = mysql_query(conn, mquery);
- WeedData[h][PlantSQLID][w] = cache_insert_id();
- cache_delete(result);
- Inventory[playerid][WeedSeed] --;
- MySQLUpdateFloat(SQLID[playerid], "HasWeedSeed", Inventory[playerid][WeedSeed], "players");
- SendClientMessage(playerid, COLOR_WEED, "You have planted a weed seed in this plant pot.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- }
- SendClientMessage(playerid, COLOR_WEED, "The plant pot you selected already has a plant growing.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- case 12: //check
- {
- if(SQLID[playerid] != HouseData[h][HouseOwnerSQLID])
- {
- SysMsg(playerid, "You cannot edit weed as a guest furnisher.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- for(new w = 0; w < MAX_WEED_PLANTS; w++)
- {
- if(WeedData[h][PlantPotObj][w] == HouseData[h][FurnObject][f])
- {
- FormatWeedLabel(playerid, WeedData[h][PlantGrowth][w], WeedData[h][PlantWater][w], CalculateWeedLight(h, HouseData[h][FurnObject][f]));
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- }
- SendClientMessage(playerid, COLOR_WEED, "This object does not have any weed planted in it.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- case 13: //harvest
- {
- if(SQLID[playerid] != HouseData[h][HouseOwnerSQLID])
- {
- SysMsg(playerid, "You cannot edit weed as a guest furnisher.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- if(HouseData[h][FurnModel][f] != WEED_OBJECT_GROWN && HouseData[h][FurnModel][f] != WEED_OBJECT_POT)
- {
- SendClientMessage(playerid, COLOR_WEED, "Please select a grown weed plant in order to harvest it.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- for(new w = 0; w < MAX_WEED_PLANTS; w++)
- {
- if(WeedData[h][PlantPotObj][w] == HouseData[h][FurnObject][f])
- {
- if(WeedData[h][PlantGrowth][w] < 300)
- {
- SendClientMessage(playerid, COLOR_WEED, "This plant is not ready to be harvested yet.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- new amountOfWeed = 0;
- switch(WeedData[h][PlantGrowth][w])
- {
- case 300..450: amountOfWeed = 3 + random(1);
- case 451..650: amountOfWeed = 5 + random(2);
- case 651..800: amountOfWeed = 7 + random(3);
- case 801..1000: amountOfWeed = 9 + random(4);
- }
- new Float:plantPos[6];
- GetDynamicObjectPos(HouseData[h][FurnObject][f], plantPos[0], plantPos[1], plantPos[2]);
- GetDynamicObjectRot(HouseData[h][FurnObject][f], plantPos[3], plantPos[4], plantPos[5]);
- DestroyDynamicObjectEx(HouseData[h][FurnObject][f], "HouseData[h][FurnObject][f]");
- HouseData[h][FurnObject][f] = CreateDynamicObject(WEED_OBJECT_POT, plantPos[0], plantPos[1], plantPos[2]-0.134, plantPos[3], plantPos[4], plantPos[5], HouseData[h][HouseVW], -1, -1);
- HouseData[h][FurnModel][f] = WEED_OBJECT_POT;
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM weed WHERE id=%i LIMIT 1", WeedData[h][PlantSQLID][w]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET Model = %i WHERE id = %i", WEED_OBJECT_POT, HouseData[h][FurnSQLID][f]);
- mysql_pquery(conn, mquery);
- WeedData[h][PlantGrowth][w] = 0;
- WeedData[h][PlantWater][w] = 0;
- WeedData[h][PlantPotObj][w] = 0;
- WeedData[h][PlantSQLID][w] = 0;
- WeedData[h][PlantFurnIndex][w] = 0;
- Inventory[playerid][Weed] += amountOfWeed;
- MySQLUpdateInt(SQLID[playerid], "Weed", Inventory[playerid][Weed], "players");
- SendClientMessageF(playerid, COLOR_WEED, "You have harvested {FFFFFF}%i grams{50C878} of weed from this plant.", amountOfWeed);
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- }
- SendClientMessage(playerid, COLOR_WEED, "This object does not have any weed planted in it.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- }
- case 14: //water
- {
- if(SQLID[playerid] != HouseData[h][HouseOwnerSQLID])
- {
- SysMsg(playerid, "You cannot edit weed as a guest furnisher.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- if(Inventory[playerid][Water] <= 0)
- {
- SendClientMessage(playerid, COLOR_WEED, "You do not have any water.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- for(new w = 0; w < MAX_WEED_PLANTS; w++)
- {
- if(WeedData[h][PlantPotObj][w] == HouseData[h][FurnObject][f])
- {
- if(WeedData[h][PlantWater][w] >= 1000)
- {
- SendClientMessage(playerid, COLOR_WEED, "Este planeta não precisa ser regada.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "Item de casa", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- WeedData[h][PlantWater][w] += 400;
- if(WeedData[h][PlantWater][w] > 1000) WeedData[h][PlantWater][w] = 1000;
- Inventory[playerid][Water] --;
- MySQLUpdateFloat(SQLID[playerid], "HasWater", Inventory[playerid][Water], "players");
- SaveWeedPlant(h, w);
- SendClientMessage(playerid, COLOR_WEED, "You have watered the weed plant.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- return true;
- }
- }
- SendClientMessage(playerid, COLOR_WEED, "You have watered the weed plant.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", WEEDEDITSTR, "Select", "Close");
- }
- }
- return true;
- }
- Dialog:FurnitureTextures(playerid, response, listitem, inputtext[])
- {
- if(!response) return Dialog_Show(playerid, TextureIndex, DIALOG_STYLE_LIST, "Selecione o Index da textura", GetFreeTextureIndex(playerid), "Set", "Cancelar");
- gstr[0] = EOS;
- SetPVarString(playerid, "TextureCat", inputtext);
- for(new x = 0; x < sizeof(FurnitureTextures); x++)
- {
- if(strcmp(inputtext, FurnitureTextures[x][textureCategory], true) == 0)
- {
- strcat(gstr, FurnitureTextures[x][textureDescription]);
- strcat(gstr, "\n");
- }
- }
- format(sgstr, sizeof(sgstr), "Furniture Textures: %s", inputtext);
- Dialog_Show(playerid, TextureHandle, DIALOG_STYLE_LIST, sgstr, gstr, "Use", "Close");
- return true;
- }
- Dialog:FurnitureNudge(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- new h = IsInHouseID[playerid], f = GetPVarInt(playerid, "HFArrayIndex");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", (IsWeedPlantObject(HouseData[h][FurnModel][f])) ? (WEEDEDITSTR) : (FURNEDITSTR), "Select", "Close");
- return true;
- }
- SetPVarInt(playerid, "FurnNudgeAxis", listitem + 1);
- Dialog_Show(playerid, FurnitureNudge2, DIALOG_STYLE_INPUT, "Furniture Nudge", "Enter the value you'd like to nudge the object by.", "Submit", "Cancel");
- return true;
- }
- Dialog:FurnitureNudge2(playerid, response, listitem, inputtext[])
- {
- if(!response) return Dialog_Show(playerid, FurnitureNudge, DIALOG_STYLE_LIST, "Select the direction you'd like to nudge the object.", "North\nSouth\nEast\nWest\nUp\nDown", "Select", "Cancel");
- if(!IsFloat(inputtext) && !IsNumeric(inputtext)) return Dialog_Show(playerid, FurnitureNudge2, DIALOG_STYLE_INPUT, "{FF0000}ERROR:{FFFFFF} Value must be numeric and contain a decimal.", "Enter the value you'd like to nudge the object by.", "Submit", "Cancel");
- if(floatstr(inputtext) > 1.0 || floatstr(inputtext) < 0.0) return Dialog_Show(playerid, FurnitureNudge2, DIALOG_STYLE_INPUT, "{FF0000}ERROR:{FFFFFF} Value must be less than 1.0 and greater than 0.0.", "Enter the value you'd like to nudge the object by.", "Submit", "Cancel");
- new h = IsInHouseID[playerid], f = GetPVarInt(playerid, "HFArrayIndex"), direction = GetPVarInt(playerid, "FurnNudgeAxis"), Float:value = floatstr(inputtext);
- new Float:x, Float:y, Float:z;
- GetDynamicObjectPos(HouseData[h][FurnObject][f], x, y, z);
- if(direction == 1) y += value; //north
- else if(direction == 2) y -= value; //south
- else if(direction == 3) x += value; //east
- else if(direction == 4) x -= value; //west
- else if(direction == 5) z += value; //up
- else if(direction == 6) z -= value; //down
- SetDynamicObjectPos(HouseData[h][FurnObject][f], x, y, z);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET Xpos = %f, Ypos = %f, Zpos = %f WHERE id = %i", x, y, z, HouseData[h][FurnSQLID][f]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_WHITE, "You have successfully nudged your furniture object by %.4f meters.", value);
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", (IsWeedPlantObject(HouseData[h][FurnModel][f])) ? (WEEDEDITSTR) : (FURNEDITSTR), "Select", "Close");
- return true;
- }
- Dialog:TextureHandle(playerid, response, listitem, inputtext[])
- {
- if(!response) return Dialog_Show(playerid, FurnitureTextures, DIALOG_STYLE_LIST, "Texture List", "Plain Colors\nPrinted Fabrics\nWood\nTile and Mosaic\nMarble, Stone, Bricks, Concrete\nMetals\nPoster, Paintings and Murals\nWallpapers\nMiscellaneous", "Select", "Exit");
- new t = -1;
- for(new x = 0; x < sizeof(FurnitureTextures); x++)
- {
- if(strcmp(inputtext, FurnitureTextures[x][textureDescription], true) == 0)
- {
- t = x;
- break;
- }
- }
- if(t == -1)
- {
- DeleteFurnEditPVars(playerid);
- SysMsg(playerid, "An error has occurred. Please submit a bug report with this code: DTH23");
- return true;
- }
- new ttxd[64], ttexture[64], tobject, idx, slot, h, findex;
- format(ttxd, 64, FurnitureTextures[t][furnitureTexture]);
- format(ttexture, 64, FurnitureTextures[t][furnitureTexture2]);
- tobject = FurnitureTextures[t][textureObjectID];
- h = IsInHouseID[playerid];
- idx = GetPVarInt(playerid, "HFArrayIndex");
- slot = GetPVarInt(playerid, "fslot");
- findex = GetPVarInt(playerid, "findex");
- if(FurnitureIndex[h][idx][slot - 1] != -1) SetDynamicObjectMaterial(PlayerEditFurniture[playerid], FurnitureIndex[h][idx][slot - 1], -1, "none", "none", 0);
- FurnitureIndex[h][idx][slot - 1] = findex;
- SetDynamicObjectMaterial(PlayerEditFurniture[playerid], findex, tobject, ttxd, ttexture);
- SendClientMessageF(playerid, COLOR_WHITE, "You have changed the texture on your furniture object to {BCDCBC}'%s.'", FurnitureTextures[t][textureDescription]);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET Material%iUsed = 1, Material%iIndex = %i, Material%iObject = %i, Material%iTxd = '%e', Material%iTexture = '%e', Material%iColor = 0 WHERE id = %i",
- slot, slot, findex, slot, tobject, slot, ttxd, slot, ttexture, slot, HouseData[h][FurnSQLID][idx]);
- mysql_pquery(conn, mquery);
- gstr[0] = EOS;
- new cat[32];
- GetPVarString(playerid, "TextureCat", cat, 32);
- for(new x = 0; x < sizeof(FurnitureTextures); x++)
- {
- if(strcmp(cat, FurnitureTextures[x][textureCategory], true) == 0)
- {
- strcat(gstr, FurnitureTextures[x][textureDescription]);
- strcat(gstr, "\n");
- }
- }
- format(sgstr, sizeof(sgstr), "Furniture Textures: %s", inputtext);
- Dialog_Show(playerid, TextureHandle, DIALOG_STYLE_LIST, sgstr, gstr, "Use", "Close");
- return true;
- }
- Dialog:TextureRemove(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- new h = IsInHouseID[playerid], f = GetPVarInt(playerid, "HFArrayIndex");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", (IsWeedPlantObject(HouseData[h][FurnModel][f])) ? (WEEDEDITSTR) : (FURNEDITSTR), "Select", "Close");
- return true;
- }
- new h = IsInHouseID[playerid], f = GetPVarInt(playerid, "HFArrayIndex"), index = FurnitureIndex[h][f][listitem];
- if(index == -1)
- {
- SysMsg(playerid, "This slot does not have a texture.");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", (IsWeedPlantObject(HouseData[h][FurnModel][f])) ? (WEEDEDITSTR) : (FURNEDITSTR), "Select", "Close");
- return true;
- }
- FurnitureIndex[h][f][listitem] = -1;
- SetDynamicObjectMaterial(PlayerEditFurniture[playerid], index, -1, "none", "none", 0);
- new slot = listitem + 1;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET Material%iUsed = 0, Material%iIndex = -1, Material%iObject = 0, Material%iTxd = 'none', Material%iTexture = 'none', Material%iColor = 0 WHERE id = %i",
- slot, slot, slot, slot, slot, slot, HouseData[h][FurnSQLID][f]);
- mysql_pquery(conn, mquery);
- Dialog_Show(playerid, TextureRemove, DIALOG_STYLE_LIST, "Remove A Texture", GetFreeTextureSlots(playerid, 0), "Okay", "Cancel");
- return true;
- }
- Dialog:TextureSlot(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- new h = IsInHouseID[playerid], f = GetPVarInt(playerid, "HFArrayIndex");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", (IsWeedPlantObject(HouseData[h][FurnModel][f])) ? (WEEDEDITSTR) : (FURNEDITSTR), "Select", "Close");
- return true;
- }
- if(listitem == MAX_TEXTURESLOTS)
- {
- SendSplitMessage(playerid, COLOR_WHITE, "A texture slot is the slot that you'll be saving the texture to on the database. Each furniture object can have up to 3 textures saved onto it, the texture slot is is simply the slot the particular texture will be saved to.");
- Dialog_Show(playerid, TextureSlot, DIALOG_STYLE_LIST, "Select Texture Slot", GetFreeTextureSlots(playerid, 1), "Set", "Cancel");
- return true;
- }
- else
- {
- SetPVarInt(playerid, "fslot", listitem + 1);
- SetPVarInt(playerid, "IndexSlot", listitem + 1);
- Dialog_Show(playerid, TextureIndex, DIALOG_STYLE_LIST, "Select Texture Index", GetFreeTextureIndex(playerid), "Set", "Cancel");
- return true;
- }
- }
- Dialog:TextureIndex(playerid, response, listitem, inputtext[])
- {
- if(!response) return Dialog_Show(playerid, TextureSlot, DIALOG_STYLE_LIST, "Select Texture Slot", GetFreeTextureSlots(playerid, 1), "Set", "Cancel");
- if(listitem == 10)
- {
- SendSplitMessage(playerid, COLOR_WHITE, "A texture index is a numeric value that signifies which part of your selected object will be manipulated. For example, let's say the object you're editing is a chair with a wooden frame and a standard couch cushion.");
- SendSplitMessage(playerid, COLOR_WHITE, "For this particular object, index 0 would be the couch cushion and index 1 would be the the frame. It should be noted that all objects have a random amount of indexes depending on the object, and all object indexes start at 0.");
- SendSplitMessage(playerid, COLOR_WHITE, "Some objects may have indexes that range from 0-4 while others may only have two. It's totally dependant on the object that you're editing, so play arond and find out what works for the object. If you have any questions, refer to the help seciton on the forum.");
- return Dialog_Show(playerid, TextureIndex, DIALOG_STYLE_LIST, "Select Texture Index", GetFreeTextureIndex(playerid), "Set", "Cancel");
- }
- SetPVarInt(playerid, "findex", listitem);
- Dialog_Show(playerid, FurnitureTextures, DIALOG_STYLE_LIST, "Texture List", "Plain Colors\nPrinted Fabrics\nWood\nTile and Mosaic\nMarble, Stone, Bricks, Concrete\nMetals\nPoster, Paintings and Murals\nWallpapers\nMiscellaneous\nTest Misc\nTest Questionable", "Select", "Exit");
- return true;
- }
- Dialog:TextureColor(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- new h = IsInHouseID[playerid], f = GetPVarInt(playerid, "HFArrayIndex");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", (IsWeedPlantObject(HouseData[h][FurnModel][f])) ? (WEEDEDITSTR) : (FURNEDITSTR), "Select", "Close");
- return true;
- }
- new h = IsInHouseID[playerid], f = GetPVarInt(playerid, "HFArrayIndex");
- if(FurnitureIndex[h][f][listitem] == -1)
- {
- Dialog_Show(playerid, TextureColor, DIALOG_STYLE_LIST, "Set Texture Color", GetFreeTextureSlots(playerid, 0), "Okay", "Cancel");
- SysMsg(playerid, "This object does not have a texture on that slot.");
- return true;
- }
- SetPVarInt(playerid, "FurnColorSlot", listitem);
- new sub[12], bigstr[3000];
- for(new x = 0; x < sizeof(MaterialColors); x++)
- {
- format(sub, 12, "%x", MaterialColors[x][ColorHex]);
- strdel(sub, 0, 2);
- format(sgstr, sizeof(sgstr), "{%s}%s\n", sub, MaterialColors[x][ColorName]);
- strcat(bigstr, sgstr);
- }
- Dialog_Show(playerid, TextureColorApply, DIALOG_STYLE_LIST, "Select a Color", bigstr, "Select", "Cancel");
- return true;
- }
- Dialog:TextureColorApply(playerid, response, listitem, inputtext[])
- {
- if(!response) return Dialog_Show(playerid, TextureColor, DIALOG_STYLE_LIST, "Set Texture Color", GetFreeTextureSlots(playerid, 0), "Okay", "Cancel");
- new col = MaterialColors[listitem][ColorHex], colstring[12], h = IsInHouseID[playerid], f = GetPVarInt(playerid, "HFArrayIndex");
- format(colstring, 12, "%x", col);
- strdel(colstring, 0, 2);
- new model, txd[24], texture[24], color, index, slot = GetPVarInt(playerid, "FurnColorSlot");
- index = FurnitureIndex[h][f][slot];
- GetDynamicObjectMaterial(HouseData[h][FurnObject][f], index, model, txd, texture, color);
- SetDynamicObjectMaterial(HouseData[h][FurnObject][f], index, model, txd, texture, col);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET Material%iUsed = 1, Material%iColor = %i WHERE id = %i", slot + 1, slot + 1, col, HouseData[h][FurnSQLID][f]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_WHITE, "You have changed the color of your furniture texture to {%s}%s.", colstring, MaterialColors[listitem][ColorName]);
- new sub[12], bigstr[3000];
- for(new x = 0; x < sizeof(MaterialColors); x++)
- {
- format(sub, 12, "%x", MaterialColors[x][ColorHex]);
- strdel(sub, 0, 2);
- format(sgstr, sizeof(sgstr), "{%s}%s\n", sub, MaterialColors[x][ColorName]);
- strcat(bigstr, sgstr);
- }
- Dialog_Show(playerid, TextureColorApply, DIALOG_STYLE_LIST, "Clothing - Select a Color", bigstr, "Select", "Cancel");
- return true;
- }
- Dialog:TextureColorRemove(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- new h = IsInHouseID[playerid], f = GetPVarInt(playerid, "HFArrayIndex");
- Dialog_Show(playerid, FurnitureEdit, DIALOG_STYLE_LIST, "House Item", (IsWeedPlantObject(HouseData[h][FurnModel][f])) ? (WEEDEDITSTR) : (FURNEDITSTR), "Select", "Close");
- return true;
- }
- new h = IsInHouseID[playerid], f = GetPVarInt(playerid, "HFArrayIndex"), index = FurnitureIndex[h][f][listitem], model, txd[24], texture[24], color;
- GetDynamicObjectMaterial(HouseData[h][FurnObject][f], index, model, txd, texture, color);
- if(color == 0)
- {
- SysMsg(playerid, "This object does not have a color assigned to it.");
- Dialog_Show(playerid, TextureColorRemove, DIALOG_STYLE_LIST, "Remove Texture Color", GetFreeTextureSlots(playerid, 0), "Okay", "Cancel");
- return true;
- }
- SetDynamicObjectMaterial(HouseData[h][FurnObject][f], index, model, txd, texture, 0);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET Material%iColor = 0 WHERE id = %i", listitem + 1, HouseData[h][FurnSQLID][f]);
- mysql_pquery(conn, mquery);
- Dialog_Show(playerid, TextureColorRemove, DIALOG_STYLE_LIST, "Remove Texture Color", GetFreeTextureSlots(playerid, 0), "Okay", "Cancel");
- return true;
- }
- Dialog:STPropertiesMenu(playerid, response, listitem, inputtext[])
- {
- if(!response) return true;
- else
- {
- if(listitem == 0)
- {
- MemberListIndex[playerid] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM traders ORDER BY SQLID ASC LIMIT 30 OFFSET %i", MemberListIndex[playerid]);
- mysql_pquery(conn, mquery, "DisplayPropertiesList", "ii", playerid, MemberListIndex[playerid]);
- return true;
- }
- else
- {
- MemberListIndex[playerid] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Description,Price FROM houses WHERE OwnerSQLID = 0 AND Description NOT LIKE '%%flat%%' ORDER BY id ASC LIMIT 30 OFFSET %i", MemberListIndex[playerid]);
- mysql_pquery(conn, mquery, "DisplayUnownedPropertiesList", "dd", playerid, MemberListIndex[playerid]);
- return true;
- }
- }
- }
- Dialog:STUnowned(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(strcmp("> Next Page", inputtext, true) == 0)
- {
- MemberListIndex[playerid] ++;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Description,Price FROM houses WHERE OwnerSQLID = 0 AND Description NOT LIKE '%%flat%%' ORDER BY id ASC LIMIT 30 OFFSET %i", MemberListIndex[playerid] * 30);
- mysql_pquery(conn, mquery, "DisplayUnownedPropertiesList", "ii", playerid, MemberListIndex[playerid]);
- return true;
- }
- else if(strcmp("< Previous Page", inputtext, true) == 0)
- {
- MemberListIndex[playerid] --;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Description,Price FROM houses WHERE OwnerSQLID = 0 AND Description NOT LIKE '%%flat%%' ORDER BY id ASC LIMIT 30 OFFSET %i", MemberListIndex[playerid] * 30);
- mysql_pquery(conn, mquery, "DisplayUnownedPropertiesList", "ii", playerid, MemberListIndex[playerid]);
- return true;
- }
- }
- else
- {
- MemberListIndex[playerid] = 0;
- return true;
- }
- return true;
- }
- Dialog:STPropertiesList(playerid, response, listitem, inputtext[])
- {
- if(response == 1)
- {
- if(strcmp("> Next Page", inputtext, true) == 0)
- {
- MemberListIndex[playerid] ++;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM traders ORDER BY SQLID ASC LIMIT 30 OFFSET %i", MemberListIndex[playerid] * 30);
- mysql_pquery(conn, mquery, "DisplayPropertiesList", "ii", playerid, MemberListIndex[playerid]);
- }
- else if(strcmp("< Previous Page", inputtext, true) == 0)
- {
- MemberListIndex[playerid] --;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM traders ORDER BY SQLID ASC LIMIT 30 OFFSET %i", MemberListIndex[playerid] * 30);
- mysql_pquery(conn, mquery, "DisplayPropertiesList", "ii", playerid, MemberListIndex[playerid]);
- }
- else
- {
- new assetName[300], assetID;
- strmid(assetName, inputtext, strfind(inputtext, ": ") + 2, strfind(inputtext, " ["));
- if(inputtext[0] == 'H')
- {
- assetID = GetHouseLocation(assetName);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM traders WHERE SQLID = %i AND ForSale = 1 LIMIT 1", HouseData[assetID][HouseSQLID]);
- new Cache:houseinfo = mysql_query(conn, mquery);
- new priiice = cache_get_field_content_int(0, "Price");
- if(cache_num_rows())
- {
- BuyProperty[playerid][0] = 1;
- BuyProperty[playerid][1] = assetID;
- format(assetName, sizeof(assetName), "{BCDCBC}%s{FFFFFF}\n\nCost: {4BB74C}$%s{FFFFFF}\n\nThis house is currently for sale.", HouseData[assetID][HouseDescription], format_cash(priiice));
- Dialog_Show(playerid, STPropertiesBuy, DIALOG_STYLE_MSGBOX, "SILVER TRADING", assetName, "BUY", "Back");
- }
- else
- {
- BuyProperty[playerid][0] = 0;
- BuyProperty[playerid][1] = 0;
- format(assetName, sizeof(assetName), "{BCDCBC}%s{FFFFFF}\n\nThis house is currently unavailable for purchase, check back later.", HouseData[assetID][HouseDescription]);
- Dialog_Show(playerid, STPropertiesBuy, DIALOG_STYLE_MSGBOX, "SILVER TRADING", assetName, "Back", "");
- }
- cache_delete(houseinfo);
- }
- else if(inputtext[0] == 'B')
- {
- assetID = GetBizzLocation(assetName);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Price FROM traders WHERE SQLID = %i AND Type = 2 AND ForSale = 1 LIMIT 1", BizzData[assetID][BizzSQLID]);
- new Cache:bizzinfo = mysql_query(conn, mquery);
- new priiice = cache_get_field_content_int(0, "Price");
- if(cache_num_rows())
- {
- BuyProperty[playerid][0] = 2;
- BuyProperty[playerid][1] = assetID;
- format(assetName, sizeof(assetName), "{BCDCBC}%s{FFFFFF}\n\nCost: {4BB74C}$%s{FFFFFF}\n\nThis business is currently for sale.", BizzData[assetID][BizzDescription], format_cash(priiice));
- Dialog_Show(playerid, STPropertiesBuy, DIALOG_STYLE_MSGBOX, "SILVER TRADING", assetName, "BUY", "Back");
- }
- else
- {
- BuyProperty[playerid][0] = 0;
- BuyProperty[playerid][1] = 0;
- format(assetName, sizeof(assetName), "{BCDCBC}%s{FFFFFF}\n\nThis business is currently unavailable for purchase, check back later.", BizzData[assetID][BizzDescription]);
- Dialog_Show(playerid, STPropertiesBuy, DIALOG_STYLE_MSGBOX, "SILVER TRADING", assetName, "Back", "");
- }
- cache_delete(bizzinfo);
- }
- }
- }
- return true;
- }
- Dialog:STPropertiesBuy(playerid, response, listitem, inputtext[])
- {
- if(response == 1 && BuyProperty[playerid][0] > 0)
- {
- if(BuyProperty[playerid][0] == 1) mysql_format(conn, mquery, sizeof(mquery), "SELECT id,Price FROM traders WHERE SQLID=%i AND Type=%i AND ForSale=1 LIMIT 1", HouseData[BuyProperty[playerid][1]][HouseSQLID], BuyProperty[playerid][0]);
- else mysql_format(conn, mquery, sizeof(mquery), "SELECT id,Price FROM traders WHERE SQLID=%i AND Type=%i AND ForSale=1 LIMIT 1", BizzData[BuyProperty[playerid][1]][BizzSQLID], BuyProperty[playerid][0]);
- mysql_pquery(conn, mquery, "BuyProperties", "i", playerid);
- }
- else if((response == 1 && BuyProperty[playerid][0] == 0) || response == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM traders ORDER BY Type ASC LIMIT 30 OFFSET %i", MemberListIndex[playerid] * 30);
- mysql_pquery(conn, mquery, "DisplayPropertiesList", "ii", playerid, MemberListIndex[playerid]);
- }
- return true;
- }
- Dialog:AskForMA(playerid, response, listitem, inputtext[])
- {
- if(!response) return KickPlayer(playerid, 5);
- if(isnull(inputtext)) return AskForMasterAccount(playerid);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,Password,State FROM masters WHERE Username = '%e'", inputtext);
- mysql_pquery(conn, mquery, "CheckMAState", "d", playerid);
- return true;
- }
- Dialog:ShowPlayerDrugs(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:GivePlayerDrugs(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:GivePlayerIngreds(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:GivePlayerDrugAmount(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:GivePlayerIngredAmount(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:SelectIngredients(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:SelectPlayerDrug(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:CombineDrugsError(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:CombinePlayerDrug(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:DropDrugs(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:SelectedIngredAmount(playerid, response, listitem, inputtext[])
- {
- if(!response)
- {
- if(CreatingDrugs[playerid][1] == 0)
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM ingredients WHERE ingOwner = %d AND ingOwnerType = 'P' AND ingType < 9 LIMIT 20", SQLID[playerid]);
- else
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM ingredients WHERE ingOwner = %d AND ingOwnerType = 'P' AND ingType > 8 LIMIT 20", SQLID[playerid]);
- mysql_pquery(conn, mquery, "RetrieveIngInfo", "ii", playerid, 0);
- return 1;
- }
- if(!IsNumeric(inputtext)) {
- format(gstr, sizeof(gstr), "{FFFFFF}Non-numeric value!\nHow many %s would you like to use in the creation process?", IngredName[DrugCombineData[playerid][CreatingDrugs[playerid][1] + 4]]);
- return Dialog_Show(playerid, SelectedIngredAmount, DIALOG_STYLE_INPUT, "{FFFFFF}Drug Creation - Ingredient Amount", gstr, "Confirm", "Cancel");
- }
- new amount = strval(inputtext);
- for(new i = 0; i < 10; i++)
- {
- if(TempIngData[playerid][ingType][i] == DrugCombineData[playerid][CreatingDrugs[playerid][1] + 4])
- {
- if(amount <= TempIngData[playerid][ingAmount][i])
- {
- TempIngData[playerid][ingAmount][i] -= amount;
- DrugCombineData[playerid][CreatingDrugs[playerid][1] + 12] = amount;
- DrugCombineData[playerid][CreatingDrugs[playerid][1] + 16] = TempIngData[playerid][ingID][i];
- format(gstr, sizeof(gstr), "%s (%d)", IngredName[TempIngData[playerid][ingType][i]], amount);
- PlayerTextDrawSetPreviewModel(playerid, DrugCombineP[playerid][CreatingDrugs[playerid][1]], TempIngData[playerid][ingModel][i]);
- DrugCombineData[playerid][CreatingDrugs[playerid][1]] = TempIngData[playerid][ingModel][i];
- PlayerTextDrawShow(playerid, DrugCombineP[playerid][CreatingDrugs[playerid][1]]);
- PlayerTextDrawSetString(playerid, DrugCombineP[playerid][4], gstr);
- PlayerTextDrawShow(playerid, DrugCombineP[playerid][4]);
- TextDrawShowForPlayer(playerid, DrugCombine[7]);
- MySQLUpdateInt(TempIngData[playerid][ingID][i], "ingAmount", TempIngData[playerid][ingAmount][i], "ingredients");
- return true;
- }
- else {
- format(gstr, sizeof(gstr), "{FFFFFF}Invalid amount!\nHow many %s would you like to use in the creation process?", IngredName[TempIngData[playerid][ingType][i]]);
- return Dialog_Show(playerid, SelectedIngredAmount, DIALOG_STYLE_INPUT, "{FFFFFF}Drug Creation - Ingredient Amount", gstr, "Confirm", "Cancel");
- }
- }
- }
- return true;
- }
- Dialog:DropIngredients(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:DisplayIngredients(playerid, response, listitem, inputtext[])
- {
- if(!response || strmatch(inputtext, "No ingredients to display.")) return true;
- if(strmatch(inputtext, "Next Page >>"))
- {
- if(CreatingDrugs[playerid][1] == 0)
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM ingredients WHERE ingOwner = %d AND ingOwnerType = 'P' AND ingType < 9 LIMIT 20 OFFSET 20", SQLID[playerid]);
- else
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM ingredients WHERE ingOwner = %d AND ingOwnerType = 'P' AND ingType > 8 LIMIT 20 OFFSET 20", SQLID[playerid]);
- mysql_pquery(conn, mquery, "RetrieveIngInfo", "ii", playerid, 1);
- return 1;
- }
- for(new i = 0; i < 20; i++)
- {
- if(strmatch(IngredName[i], inputtext))
- {
- DrugCombineData[playerid][CreatingDrugs[playerid][1] + 4] = i;
- format(gstr, sizeof(gstr), "{Ffffff}How many %s would you like to use in the creation process?", IngredName[i]);
- Dialog_Show(playerid, SelectedIngredAmount, DIALOG_STYLE_INPUT, "{FFFFFF}Drug Creation - Ingredient Amount", gstr, "Confirm", "Cancel");
- return true;
- }
- }
- return true;
- }
- Dialog:SetDrugName(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:SetDrugNameConfirm(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:SetDrugNameCancel(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:CreateDrugsEndProcess(playerid, response, listitem, inputtext[])
- {
- }
- Dialog:CreateDrugsConfirm(playerid, response, listitem, inputtext[])
- {
- }
- //Functions
- stock MoveFDGate(gateid) {
- new Float:P[3];
- GetDynamicObjectPos(FDGate[gateid], P[0], P[1], P[2]);
- if(P[2] < 28.00) { // Fechado
- MoveDynamicObject(FDGate[gateid], 2362.50, P[1], 29.32, 1.00, 0.00, 88.00, 0.00);
- return 0;
- } else { // Aberto
- MoveDynamicObject(FDGate[gateid], 2363.00, P[1], 27.42, 1.00, 0.00, 00.00, 0.00);
- return 1;
- }
- }
- stock GetSwimmingPointZ(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 50.0, 1962.15, -1198.71, 17.45)) return 19;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -1127.58, 2764.43, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -988.19, 2486.89, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -924.33, 2306.59, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -1104.15, 2175.83, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -1307.06, 2119.33, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -831.85, 2122.23, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -595.76, 2138.34, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -569.24, 2274.40, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 12.0, 1095.800, -674.950, 111.908)) return 113;
- if(IsPlayerInRangeOfPoint(playerid, 12.0, 224.500, -1185.725, 73.908)) return 76;
- if(IsPlayerInRangeOfPoint(playerid, 12.0, 193.700, -1230.608, 76.603)) return 79;
- if(IsPlayerInRangeOfPoint(playerid, 12.0, 1277.500, -805.200, 86.581)) return 88;
- if(IsPlayerInRangeOfPoint(playerid, 12.0, 2582.0, 2387.0, 16.0)) return 18;
- return 10;
- }
- stock OnePlayAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, freeze, lp)
- {
- if(gPlayerUsingLoopingAnim[playerid] == 1) TextDrawHideForPlayer(playerid,txtAnimHelper);
- StopLoopingAnim(playerid);
- ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, freeze, lp, 1);
- UnlockAchievement(playerid, 6);
- }
- stock LoopingAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, freeze, lp)
- {
- if(gPlayerUsingLoopingAnim[playerid] == 1) TextDrawHideForPlayer(playerid,txtAnimHelper);
- gPlayerUsingLoopingAnim[playerid] = 1;
- TextDrawShowForPlayer(playerid,txtAnimHelper);
- ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, freeze, lp, 1);
- UnlockAchievement(playerid, 6);
- }
- stock Float:GetPointZPos(const Float: fX, const Float: fY, &Float: fZ = 0.0)
- {
- if(!((-3000.0 < fX < 3000.0) && (-3000.0 < fY < 3000.0)))
- {
- return 0.0;
- }
- static File:s_hMap;
- if(!s_hMap)
- {
- s_hMap = fopen("SAfull.hmap", io_read);
- if(!s_hMap) return 0.0;
- }
- new afZ[1];
- fseek(s_hMap, ((6000 * (-floatround(fY, floatround_tozero) + 3000) + (floatround(fX, floatround_tozero) + 3000)) << 1));
- fblockread(s_hMap, afZ);
- return (fZ = ((afZ[0] >>> 16) * 0.01));
- }
- stock Float:DistanceCameraTargetToLocation(Float:CamX, Float:CamY, Float:CamZ, Float:ObjX, Float:ObjY, Float:ObjZ, Float:FrX, Float:FrY, Float:FrZ)
- {
- new Float:TGTDistance;
- TGTDistance = floatsqroot((CamX - ObjX) * (CamX - ObjX) + (CamY - ObjY) * (CamY - ObjY) + (CamZ - ObjZ) * (CamZ - ObjZ));
- new Float:tmpX, Float:tmpY, Float:tmpZ;
- tmpX = FrX * TGTDistance + CamX;
- tmpY = FrY * TGTDistance + CamY;
- tmpZ = FrZ * TGTDistance + CamZ;
- return floatsqroot((tmpX - ObjX) * (tmpX - ObjX) + (tmpY - ObjY) * (tmpY - ObjY) + (tmpZ - ObjZ) * (tmpZ - ObjZ));
- }
- stock DeleteFurnEditPVars(playerid)
- {
- DeletePVar(playerid, "BuyFState");
- DeletePVar(playerid, "findex");
- DeletePVar(playerid, "fslot");
- DeletePVar(playerid, "FurnCat");
- DeletePVar(playerid, "FurnColorSlot");
- DeletePVar(playerid, "FurnNudgeAxis");
- DeletePVar(playerid, "HFArrayIndex");
- DeletePVar(playerid, "IndexSlot");
- DeletePVar(playerid, "TextureCat");
- return true;
- }
- stock DeleteMDCPVars(playerid)
- {
- DeletePVar(playerid, "apbID");
- DeletePVar(playerid, "mdcAcc");
- DeletePVar(playerid, "mdcLicense");
- DeletePVar(playerid, "mdcOutViewing");
- DeletePVar(playerid, "mdcResponding");
- DeletePVar(playerid, "mdcViewing");
- return true;
- }
- stock ClearHouseFuritureVariables(h)
- {
- for(new f = 0; f < MAX_HFURNITURE; f++)
- {
- if(HouseData[h][FurnObject][f] != INVALID_OBJECT_ID) DestroyDynamicObject(HouseData[h][FurnObject][f]);
- HouseData[h][FurnSQLID][f] = 0;
- HouseData[h][FurnModel][f] = 0;
- HouseData[h][FurnPlaced][f] = 0;
- HouseData[h][FurnObject][f] = INVALID_OBJECT_ID;
- HouseData[h][DoorOpen][f] = false;
- HouseData[h][DoorLocked][f] = false;
- for(new i = 0; i < MAX_TEXTURESLOTS; i++)
- {
- FurnitureIndex[h][f][i] = -1;
- }
- }
- return true;
- }
- stock ClearOutdoorFurnitureVariables(h)
- {
- for(new f = 0; f < MAX_EHFURNITURE; f++)
- {
- if(EFurnData[h][EFurnObject][f] != INVALID_OBJECT_ID) DestroyDynamicObject(EFurnData[h][EFurnObject][f]);
- EFurnData[h][EFurnSQLID][f] = 0;
- EFurnData[h][EFurnModel][f] = 0;
- EFurnData[h][EFurnPlaced][f] = false;
- EFurnData[h][EFurnObject][f] = INVALID_OBJECT_ID;
- }
- return true;
- }
- stock RemoveAllFurnitureTextures(furnid)
- {
- mysql_pqueryf(conn, "UPDATE hfurniture SET Material1Used = 0, Material1Index = -1, Material1Object = -1, Material1Txd = 'none', Material1Texture = 'none',\
- Material2Used = 0, Material2Index = -1, Material2Object = -1, Material2Txd = 'none', Material2Texture = 'none',\
- Material3Used = 0, Material3Index = -1, Material3Object = -1, Material3Txd = 'none', Material3Texture = 'none' WHERE id = %i", furnid);
- return true;
- }
- stock GetHouseCategoryList()
- {
- gstr[0] = EOS;
- strcat(gstr, "Living Room\n"); //category id 0
- strcat(gstr, "Kitchen\n"); //category id 1
- strcat(gstr, "Bedroom\n"); //category id 2
- strcat(gstr, "Bathroom\n"); //category id 3
- strcat(gstr, "Office\n"); //category id 4
- strcat(gstr, "Electronics\n"); //category id 5
- strcat(gstr, "Decorations\n"); //category id 6
- strcat(gstr, "Hobby\n"); //category id 7
- strcat(gstr, "Construction\n"); //category id 8
- /* strcat(gstr, "Living Room\n"); //category id 0
- strcat(gstr, "Kitchen\n"); //category id 1
- strcat(gstr, "Bedroom\n"); //category id 2
- strcat(gstr, "Bathroom\n"); //category id 3
- strcat(gstr, "Office\n"); //category id 4
- strcat(gstr, "Electronics\n"); //category id 5
- strcat(gstr, "Decorations\n"); //category id 6
- strcat(gstr, "Hobby\n"); //category id 7
- strcat(gstr, "Construction\n"); //category id 8*/
- return gstr;
- }
- stock GetSubcategoriesFromMainCat(id)//furniture marcelo parei aqui
- {
- static Categories[128];
- enum CInfo
- {
- CatID,
- CatName[128 char]
- };
- static const CatInfo[][CInfo] =
- {
- {0, !"Couch\nSeats\nBar Stools\nChairs\nCoffee Tables\nTables\nRugs\nCupboards/Bookshelves/Cabinets"}, //Bedroom
- {1, !"Kitchen Sets\nSingle Counters\nKitchen Items\nFood Items\nDishes\nBottles"}, //Kitchen,
- {2, !"Beds\nDressers, Wardrobes and Cabinets"}, //Bedroom
- {3, !"Toilets\nSinks\nTubs and Showers\nTowels\nMisc"}, //Bathroom
- {4, !"Office Desks\nOffice Chairs\nFiling Cabinets\nCupboards and Racks\nMisc"}, //Office
- {5, !"Televisions\nHiFi\nVCRs and Consoles\nLamps\nMisc"}, //Electronics
- {6, !"Plants\nPhotos and Paintings\nStatues\nPosters\nMaps\nBooks and Magazines\nClothes\nRednecks Delight\nToys\nTrash\nGraffiti\nMisc"}, //Decoration
- {7, !"Gym\nBilliards\nMusic\nTools\nBar\nParty\nCasino\nSpecial Interest"}, //Hobby
- {8, !"Walls\nFloors\nDoors\nPillars\nMisc"} //Construction
- /* {0, !"Sofás\nPoltronas\nBancos de bar\nCadeiras\nMesas de café\nTabelas\nTapetes\nArmários/Estantes de livros/Armários"}, //Bedroom
- {1, !"Conjuntos de cozinha\nBalcões Únicos\nItens de cozinha"}, //Kitchen,
- {2, !"Camas\nAparelhadores, Roupeiros e Armários"}, //Bedroom
- {3, !"Sanitários\nPias\nBanheiras e Chuveiros\nToalhas\nDiversos"}, //Bathroom
- {4, !"Mesas de escritório\nCadeiras de escritório\nArmários\nArmários e Racks\nDiversos"}, //Office
- {5, !"Televisões\nHiFi\nVideocassetes e consoles\nLâmpadas\nDiversos"}, //Electronics
- {6, !"Plantas\nFotos e pinturas\nEstátuas\nPosters\nMaps\nLivros e Revistas\nRoupas\nObjetos caipira\nBrinquedos\nLixo\nGraffiti\nDiversos"}, //Decoration
- {7, !"Gym\nBilhar\nMúsica\nFerramentas\nBar\nFesta\nCasino\nInteresse especial"}, //Hobby
- {8, !"Paredes\nParedes(Abertura P/ Portas)\nPortas\nParedes(Abertura P/ Janelas)\nDiversos"} *////Construction
- /*, !"Couch\nSeats\nBar Stools\nChairs\nCoffee Tables\nTables\nRugs\nCupboards/Bookshelves/Cabinets"}, //Bedroom
- {1, !"Kitchen Sets\nSingle Counters\nKitchen Items\nFood Items\nDishes\nBottles"}, //Kitchen,
- {2, !"Beds\nDressers, Wardrobes and Cabinets"}, //Bedroom
- {3, !"Toilets\nSinks\nTubs and Showers\nTowels\nMisc"}, //Bathroom
- {4, !"Office Desks\nOffice Chairs\nFiling Cabinets\nCupboards and Racks\nMisc"}, //Office
- {5, !"Televisions\nHiFi\nVCRs and Consoles\nLamps\nMisc"}, //Electronics
- {6, !"Plants\nPhotos and Paintings\nStatues\nPosters\nMaps\nBooks and Magazines\nClothes\nRednecks Delight\nToys\nTrash\nGraffiti\nMisc"}, //Decoration
- {7, !"Gym\nBilliards\nMusic\nTools\nBar\nParty\nCasino\nSpecial Interest"}, //Hobby
- {8, !"Walls\nFloors\nDoors\nPillars\nMisc"} //Construction*/
- };
- for(new i = 0; i < sizeof(CatInfo); i++) if(CatInfo[i][CatID] == id)
- {
- strunpack(Categories, CatInfo[i][CatName]);
- return Categories;
- }
- strunpack(Categories, !"Unknown");
- return Categories;
- }
- /*stock GetHouseCategoryList()
- {
- gstr[0] = EOS;
- strcat(gstr, "Sala de estar\n"); //category id 0
- strcat(gstr, "Cozinha\n"); //category id 1
- strcat(gstr, "Quarto\n"); //category id 2
- strcat(gstr, "Banheiro\n"); //category id 3
- strcat(gstr, "Escritório\n"); //category id 4
- strcat(gstr, "Eletrônicos\n"); //category id 5
- strcat(gstr, "Decorações\n"); //category id 6
- strcat(gstr, "Passatempo\n"); //category id 7
- strcat(gstr, "Construção\n"); //category id 8
- return gstr;
- }
- stock GetSubcategoriesFromMainCat(id)
- {
- static Categories[128];
- enum CInfo
- {
- CatID,
- CatName[128 char]
- };
- static const CatInfo[][CInfo] =
- {
- {0, !"Sofás\nPoltronas\nBancos de bar\nCadeiras\nMesas de café\nTabelas\nTapetes\nArmários/Estantes de livros/Armários"}, //Bedroom
- {1, !"Conjuntos de cozinha\nBalcões Únicos\nItens da cozinha\nItens alimentares\nPratos\nGarrafas"}, //Kitchen,
- {2, !"Camas\nAparelhadores, Roupeiros e Armários"}, //Bedroom
- {3, !"Sanitários\nPias\nBanheiras e Chuveiros\nToalhas\nDiversos"}, //Bathroom
- {4, !"Mesas de escritório\nCadeiras de escritório\nArmários\nArmários e Racks\nDiversos"}, //Office
- {5, !"Televisões\nHiFi\nVideocassetes e consoles\nLâmpadas\nDiversos"}, //Electronics
- {6, !"Plantas\nFotos e pinturas\nEstátuas\nPosters\nMaps\nLivros e Revistas\nRoupas\nRednecks Delight\nToys\nLixo\nGraffiti\nDiversos"}, //Decoration
- {7, !"Gym\nBilhar\nMúsica\nFerramentas\nBar\nFesta\nCasino\nInteresse especial"}, //Hobby
- {8, !"Paredes\nAndares\nPortas\nPilares\nDiversos"} //Construction
- };
- for(new i = 0; i < sizeof(CatInfo); i++) if(CatInfo[i][CatID] == id)
- {
- strunpack(Categories, CatInfo[i][CatName]);
- return Categories;
- }
- strunpack(Categories, !"Unknown");
- return Categories;
- }*/
- /*stock GetHouseCategoryList()
- {
- gstr[0] = EOS;
- strcat(gstr, "Eletrodomésticos\n"); //category id 0
- strcat(gstr, "Conforto\n"); //category id 1
- strcat(gstr, "Decoração\n"); //category id 2
- strcat(gstr, "Entreterimentos\n"); //category id 3
- strcat(gstr, "Encanamento\n"); //category id 4
- strcat(gstr, "Armazenamento\n"); //category id 5
- strcat(gstr, "Miscellaneous\n"); //category id 6
- strcat(gstr, "Especial\n"); //category id 7
- strcat(gstr, "Vazio\n"); //category id 8//esse foi removido
- return gstr;
- }
- stock GetSubcategoriesFromMainCat(id)
- {
- static Categories[128];
- enum CInfo
- {
- CatID,
- CatName[128 char]
- };
- static const CatInfo[][CInfo] =
- {
- {0, !"Refrigeradores\nFogões\nLixeiras\nPequenos Eletrodomésticos\nDepósito de Lixo\nOutros Eleto-Domésticos"}, //Eletrodomesticos
- {1, !"Camas\nCadeiras\nPoltronas\nSofás\nBanquinhos\nTapetes\nMesas\nGabinetes"}, //Conforto,
- {2, !"Quadro\nPoster\nPlacas\nBandeiras\nTags\nPlantas\nIluminação\nEstatuas\nOutros"}, //Decoração
- {3, !"Equipamentos de Esporte\nTelevisões\nMáquinas de Jogo\nMídia Player\nStereo\ncelulars\nMúsicas"}, //Entreterimentos
- {4, !"Sanitários\nPias\nChiveiro\nBanheiras\nUltilitários"}, //Encanamento
- {5, !"Estante\nArmários\nGuarda-Roupas\nCriados-Mudos\nComodas\nBalcões"}, //Armazenamento
- {6, !"Papéis\nSujeira e Lixo\nComidas\nBebidas\nCozinha\nRoupas\nOutros"}, //Miscellaneous
- {7, !"Portas\nParedes(Média)\nParedes(Grande)\nParedes(Abertura P/ Portas)\nVidro\nEscadas\nCercas\nDrug Systems\nNatal"}, //Especial
- {8, !"Vazio\nVazio\nVazio\nVazio\nVazio"} //Removido
- };
- for(new i = 0; i < sizeof(CatInfo); i++) if(CatInfo[i][CatID] == id)
- {
- strunpack(Categories, CatInfo[i][CatName]);
- return Categories;
- }
- strunpack(Categories, !"Unknown");
- return Categories;
- }*/
- stock GetHouseFurnitureModelFromName(fname[])
- {
- for(new h = 1; h < MAX_FURNITURE; h++)
- {
- if(strlen(FurniData[h][fuName]) > 0 && strcmp(FurniData[h][fuName], fname, false) == 0) return FurniData[h][fModel];
- }
- return false;
- }
- stock GetMaxFurnitureForPlayer(playerid)
- {
- switch(IsDonator[playerid])
- {
- case 0: return 150;
- case 1: return 200;
- case 2: return 300;
- case 3: return 400;
- case 4: return MAX_HFURNITURE;
- }
- return 150;
- }
- stock GetFreeTextureSlots(playerid, tog = 0)
- {
- gstr[0] = EOS;
- new h = IsInHouseID[playerid], f = GetPVarInt(playerid, "HFArrayIndex");
- for(new i = 0; i < MAX_TEXTURESLOTS; i++)
- {
- if(FurnitureIndex[h][f][i] != -1) format(tgstr, sizeof(tgstr), "{00FF00}Texture %i\n", i + 1);
- else format(tgstr, sizeof(tgstr), "Textura %i\n", i + 1);
- strcat(gstr, tgstr);
- }
- if(tog == 1) strcat(gstr, "What is a texture slot?");
- return gstr;
- }
- stock GetFreeTextureIndex(playerid)
- {
- gstr[0] = EOS;
- new h = IsInHouseID[playerid], f = GetPVarInt(playerid, "HFArrayIndex");
- new slot = GetPVarInt(playerid, "IndexSlot");
- for(new x = 0; x < 10; x++)
- {
- if(FurnitureIndex[h][f][slot - 1] == x) format(sgstr, sizeof(sgstr), "{00FF00}Texture Index %i\n", x);
- else format(sgstr, sizeof(sgstr), "Texture Index %i\n", x);
- strcat(gstr, sgstr);
- }
- strcat(gstr, "What is a texture index?");
- return gstr;
- }
- stock GetFreeHouseFurnitureForHouse(playerid)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT NULL FROM hfurniture WHERE HouseSQLID = %i", HouseData[IsInHouseID[playerid]][HouseSQLID]);
- new Cache:result = mysql_query(conn, mquery);
- new mf = cache_num_rows();
- cache_delete(result);
- return mf;
- }
- stock GetFreeExteriorFurniture(playerid)
- {
- new h = GetHouseForExteriorEdit(playerid);
- if(h == -1) return 0;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT NULL FROM efurniture WHERE HouseSQLID = %i", HouseData[h][HouseSQLID]);
- new Cache:result = mysql_query(conn, mquery);
- new mf = cache_num_rows();
- cache_delete(result);
- return mf;
- }
- stock GetHouseFurnitureName(model)
- {
- new name[50];
- for(new h = 0; h < MAX_FURNITURE; h++)
- {
- if(FurniData[h][fModel] == model)
- {
- format(name, 50, FurniData[h][fuName]);
- return name;
- }
- }
- name = "Unknown";
- return name;
- }
- stock CanFurnishHouse(playerid, house)
- {
- if(house == -1) return false;
- if(IsPlayerAdmin(playerid)) return true;
- if(HasHouseKey[playerid][0] == house) return true;
- if(HasHouseKey[playerid][1] == house) return true;
- if(EditingHouseFurn[playerid] == HouseData[house][HouseSQLID]) return true;
- return false;
- }
- stock ProcessHouseDoorRam(playerid, h, f)
- {
- new Float:rx, Float:ry, Float:rz, Float:pX, Float:pY, Float:pZ, Float:oX, Float:oY, Float:oZ;
- GetDynamicObjectRot(HouseData[h][FurnObject][f], rx, ry, rz);
- GetPlayerPos(playerid, pX, pY, pZ);
- GetOffsetFromDynamicObject(pX, pY, pZ, HouseData[h][FurnObject][f], oX, oY, oZ);
- if(oY > 0.0) SetDynamicObjectRot(HouseData[h][FurnObject][f], rx, ry, rz - 90);
- else SetDynamicObjectRot(HouseData[h][FurnObject][f], rx, ry, rz + 90);
- HouseData[h][DoorOpen][f] = true;
- HouseData[h][DoorLocked][f] = false;
- HouseData[h][ZAdjust][f] = rz;
- return true;
- }
- stock GetPlayerHouseCount(playerid)
- {
- new count = 0;
- for(new x = 0; x < MAX_HOUSE_PER_PLAYER; x++)
- {
- if(HasHouseKey[playerid][x] != -1) count ++;
- }
- return count;
- }
- stock GetFreePlayerHouseSlot(playerid)
- {
- new count = 0;
- for(new x = 0; x < MAX_HOUSE_PER_PLAYER; x++)
- {
- count ++;
- if(HasHouseKey[playerid][x] == -1) return count - 1;
- }
- return -1;
- }
- stock GetHouseForExteriorEdit(playerid)
- {
- if(HasHouseKey[playerid][0] == -1 && HasHouseKey[playerid][1] == -1 && EditingHouseFurn[playerid] == -1) return -1;
- new Float:closestdist = 99999.0, Float:dist, id, x;
- for(new h = 0; h < MAX_HOUSE_PER_PLAYER; h++)
- {
- if(HasHouseKey[playerid][h] != -1)
- {
- x = HasHouseKey[playerid][h];
- dist = GetPlayerDistanceFromPoint(playerid, HouseData[x][oPosX], HouseData[x][oPosY], HouseData[x][oPosZ]);
- if(dist < closestdist)
- {
- closestdist = dist;
- id = x;
- }
- }
- }
- if(EditingHouseFurn[playerid] != -1)
- {
- x = EditingHouseFurn[playerid];
- dist = GetPlayerDistanceFromPoint(playerid, HouseData[x][oPosX], HouseData[x][oPosY], HouseData[x][oPosZ]);
- if(dist < closestdist)
- {
- closestdist = dist;
- id = x;
- }
- }
- return id;
- }
- stock HelperBroadcast(message[])
- {
- foreach(new i: Player)
- {
- if(IsHelper{i} && HelperMsgTog[i] == 0)
- {
- SendSplitMessage(i, COLOR_LIGHTGREEN, message);
- }
- }
- return true;
- }
- stock GivePlayerVest(playerid)
- {
- new vestobj;
- if(IsCop(playerid)) vestobj = -3000;
- else vestobj = 19515;
- for(new t = 0; t < MAX_TOYS; t++)
- {
- if(ToyInfo[playerid][t][tModelID] == vestobj)
- {
- new index = 7;
- AttachedObjects[playerid][index][aoToyID] = t;
- AttachedObjects[playerid][index][aoModelID] = vestobj;
- AttachedObjects[playerid][index][aoOffset][0] = ToyInfo[playerid][t][tOffset][0];
- AttachedObjects[playerid][index][aoOffset][1] = ToyInfo[playerid][t][tOffset][1];
- AttachedObjects[playerid][index][aoOffset][2] = ToyInfo[playerid][t][tOffset][2];
- AttachedObjects[playerid][index][aoRot][0] = ToyInfo[playerid][t][tRot][0];
- AttachedObjects[playerid][index][aoRot][1] = ToyInfo[playerid][t][tRot][1];
- AttachedObjects[playerid][index][aoRot][2] = ToyInfo[playerid][t][tRot][2];
- AttachedObjects[playerid][index][aoScale][0] = ToyInfo[playerid][t][tScale][0];
- AttachedObjects[playerid][index][aoScale][1] = ToyInfo[playerid][t][tScale][1];
- AttachedObjects[playerid][index][aoScale][2] = ToyInfo[playerid][t][tScale][2];
- AttachedObjects[playerid][index][aoBone] = ToyInfo[playerid][t][tBone];
- if(Faction[playerid] == FACTION_RESEARCH || CoolPersonList(playerid))
- {
- SetPlayerAttachedObject(playerid, index, ToyInfo[playerid][t][tModelID], ToyInfo[playerid][t][tBone], ToyInfo[playerid][t][tOffset][0], ToyInfo[playerid][t][tOffset][1], ToyInfo[playerid][t][tOffset][2], ToyInfo[playerid][t][tRot][0], ToyInfo[playerid][t][tRot][1], ToyInfo[playerid][t][tRot][2],
- ToyInfo[playerid][t][tScale][0], ToyInfo[playerid][t][tScale][1], ToyInfo[playerid][t][tScale][2], 0xFF1B1C1B);
- }
- else SetPlayerAttachedObject(playerid, index, ToyInfo[playerid][t][tModelID], ToyInfo[playerid][t][tBone], ToyInfo[playerid][t][tOffset][0], ToyInfo[playerid][t][tOffset][1], ToyInfo[playerid][t][tOffset][2], ToyInfo[playerid][t][tRot][0], ToyInfo[playerid][t][tRot][1], ToyInfo[playerid][t][tRot][2],
- ToyInfo[playerid][t][tScale][0], ToyInfo[playerid][t][tScale][1], ToyInfo[playerid][t][tScale][2]);
- return true;
- }
- }
- new t = GetFreeToyInfoSlot(playerid);
- SysMsg(playerid, "You have not set a custom position for a vest, use /editvest if you would like to set one.");
- new index = 7;
- ToyInfo[playerid][t][tModelID] = vestobj;
- ToyInfo[playerid][t][tOffset][0] = 0.091999;
- ToyInfo[playerid][t][tOffset][1] = 0.036000;
- ToyInfo[playerid][t][tOffset][2] = 0.011000;
- ToyInfo[playerid][t][tRot][0] = 0.0;
- ToyInfo[playerid][t][tRot][1] = 0.0;
- ToyInfo[playerid][t][tRot][2] = 0.0;
- ToyInfo[playerid][t][tScale][0] = 1.00;
- ToyInfo[playerid][t][tScale][1] = 1.115;
- ToyInfo[playerid][t][tScale][2] = 1.00;
- ToyInfo[playerid][t][tBone] = 1;
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO toys (tPlayer, tModelID, tOffsetX, tOffsetY, tOffsetZ, tRotX, tRotY, tRotZ, tScaleX, tScaleY, tScaleZ, tBone) VALUES (%i, %i, %f, %f, %f, %f, %f, %f, %f, %f, %f, 1)", SQLID[playerid], -3000, ToyInfo[playerid][t][tOffset][0],
- ToyInfo[playerid][t][tOffset][1], ToyInfo[playerid][t][tOffset][2], ToyInfo[playerid][t][tRot][0], ToyInfo[playerid][t][tRot][1], ToyInfo[playerid][t][tRot][2], ToyInfo[playerid][t][tScale][0], ToyInfo[playerid][t][tScale][1], ToyInfo[playerid][t][tScale][2]);
- new Cache:result = mysql_query(conn, mquery);
- ToyInfo[playerid][t][tID] = cache_insert_id();
- cache_delete(result);
- AttachedObjects[playerid][index][aoToyID] = t;
- AttachedObjects[playerid][index][aoModelID] = vestobj;
- AttachedObjects[playerid][index][aoOffset][0] = ToyInfo[playerid][t][tOffset][0];
- AttachedObjects[playerid][index][aoOffset][1] = ToyInfo[playerid][t][tOffset][1];
- AttachedObjects[playerid][index][aoOffset][2] = ToyInfo[playerid][t][tOffset][2];
- AttachedObjects[playerid][index][aoRot][0] = ToyInfo[playerid][t][tRot][0];
- AttachedObjects[playerid][index][aoRot][1] = ToyInfo[playerid][t][tRot][1];
- AttachedObjects[playerid][index][aoRot][2] = ToyInfo[playerid][t][tRot][2];
- AttachedObjects[playerid][index][aoScale][0] = ToyInfo[playerid][t][tScale][0];
- AttachedObjects[playerid][index][aoScale][1] = ToyInfo[playerid][t][tScale][1];
- AttachedObjects[playerid][index][aoScale][2] = ToyInfo[playerid][t][tScale][2];
- AttachedObjects[playerid][index][aoBone] = ToyInfo[playerid][t][tBone];
- if(Faction[playerid] == FACTION_RESEARCH)
- {
- SetPlayerAttachedObject(playerid, index, ToyInfo[playerid][t][tModelID], ToyInfo[playerid][t][tBone], ToyInfo[playerid][t][tOffset][0], ToyInfo[playerid][t][tOffset][1], ToyInfo[playerid][t][tOffset][2], ToyInfo[playerid][t][tRot][0], ToyInfo[playerid][t][tRot][1], ToyInfo[playerid][t][tRot][2],
- ToyInfo[playerid][t][tScale][0], ToyInfo[playerid][t][tScale][1], ToyInfo[playerid][t][tScale][2], 0xFF1B1C1B);
- }
- else SetPlayerAttachedObject(playerid, index, ToyInfo[playerid][t][tModelID], ToyInfo[playerid][t][tBone], ToyInfo[playerid][t][tOffset][0], ToyInfo[playerid][t][tOffset][1], ToyInfo[playerid][t][tOffset][2], ToyInfo[playerid][t][tRot][0], ToyInfo[playerid][t][tRot][1], ToyInfo[playerid][t][tRot][2],
- ToyInfo[playerid][t][tScale][0], ToyInfo[playerid][t][tScale][1], ToyInfo[playerid][t][tScale][2]);
- return true;
- }
- stock SavePlayerToy(playerid, id)
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE `toys` SET tPlayer = %i, tModelID = %i, tOffsetX = %f, tOffsetY = %f, tOffsetZ = %f, tRotX = %f, tRotY = %f, tRotZ = %f, tScaleX = %f, tScaleY = %f, tScaleZ = %f, tBone = %i, tOpt = %i, tColor = %i, tSpawn = %i WHERE id = %i",
- SQLID[playerid], ToyInfo[playerid][id][tModelID], ToyInfo[playerid][id][tOffset][0], ToyInfo[playerid][id][tOffset][1], ToyInfo[playerid][id][tOffset][2], ToyInfo[playerid][id][tRot][0], ToyInfo[playerid][id][tRot][1], ToyInfo[playerid][id][tRot][2],
- ToyInfo[playerid][id][tScale][0], ToyInfo[playerid][id][tScale][1], ToyInfo[playerid][id][tScale][2], ToyInfo[playerid][id][tBone], ToyInfo[playerid][id][tOptional], ToyInfo[playerid][id][tColor], ToyInfo[playerid][id][tSpawn], ToyInfo[playerid][id][tID]);
- mysql_pquery(conn, mquery);
- }
- stock ClearClothingSelection(playerid)
- {
- for(new x = 0; x < MAX_TOYS; x++)
- {
- ClothingSelected[playerid][x] = 0;
- }
- return true;
- }
- stock ClearToyData(playerid, id)
- {
- ToyInfo[playerid][id][tID] = 0;
- ToyInfo[playerid][id][tModelID] = 0;
- ToyInfo[playerid][id][tOffset][0] = 0;
- ToyInfo[playerid][id][tOffset][1] = 0;
- ToyInfo[playerid][id][tOffset][2] = 0;
- ToyInfo[playerid][id][tRot][0] = 0;
- ToyInfo[playerid][id][tRot][1] = 0;
- ToyInfo[playerid][id][tRot][2] = 0;
- ToyInfo[playerid][id][tScale][0] = 0;
- ToyInfo[playerid][id][tScale][1] = 0;
- ToyInfo[playerid][id][tScale][2] = 0;
- ToyInfo[playerid][id][tOptional] = 0;
- ToyInfo[playerid][id][tBone] = 0;
- ToyInfo[playerid][id][tMask] = 0;
- ToyInfo[playerid][id][FactionMask] = 0;
- ToyInfo[playerid][id][MaskWorn] = false;
- ToyInfo[playerid][id][tColor] = 0;
- ToyInfo[playerid][id][tSpawn] = false;
- }
- stock GetFreeToyInfoSlot(playerid)
- {
- for(new t = 0; t < MAX_TOYS; t++)
- {
- if(ToyInfo[playerid][t][tModelID] == 0) return t;
- }
- return true;
- }
- stock GetToyCount(playerid)
- {
- new count = 0;
- for(new t = 0; t < MAX_TOYS; t++)
- {
- if(ToyInfo[playerid][t][tID] != 0)
- {
- count ++;
- }
- }
- return count;
- }
- stock GetFreeWeaponObjectIndex(playerid)
- {
- for(new i = 8; i < 10; i++)
- {
- if(!IsPlayerAttachedObjectSlotUsed(playerid, i))
- {
- return i;
- }
- }
- return -1;
- }
- stock GetFreePlayerObjectIndex(playerid)
- {
- for(new i; i < 6; i++)
- {
- if(!IsPlayerAttachedObjectSlotUsed(playerid, i))
- {
- return i;
- }
- }
- return -1;
- }
- stock GetFreeTempObjectSlot()
- {
- for(new x = 0; x < MAX_TEMPOBJECTS; x++)
- {
- if(TempObjects[x][ObjectID] == INVALID_OBJECT_ID)
- {
- return x;
- }
- }
- return -1;
- }
- stock GetMaskDescription(componentid)
- {
- static MaskName[34];
- enum RCRP_MaskInfo
- {
- MaskObjectID,
- ModFullName[34 char]
- };
- static const RCRP_Masks[][RCRP_MaskInfo] =
- {
- {19350, !"Moustache 1"},
- {19351, !"Moustache 2"},
- {19085, !"Eye Patch"},
- {3026, !"Backpack"},
- {18952, !"Boxing Helmet"},
- {19093, !"White Hard Hat"},
- {19160, !"Yellow Hard Hat"},
- {19317, !"Bass Guitar"},
- {19318, !"Flying Guitar"},
- {19319, !"Warlock Guitar"},
- {19348, !"Cane"},
- {19421, !"White Headphones"},
- {19422, !"Black Headphones"},
- {19423, !"Red Headphones"},
- {19424, !"Blue Headphones"},
- {18911, !"Alien Face Bandana"},
- {18912, !"Black Face Bandana"},
- {18913, !"Green Face Bandana"},
- {18914, !"Camo Face Bandana"},
- {18915, !"Kaleidoscope Face Bandana"},
- {18916, !"Yellow Kaleidoscope Face Bandana"},
- {18917, !"Lightning Face Bandana"},
- {18918, !"Gray Face Bandana"},
- {18919, !"Beige Face Bandana"},
- {18920, !"Orange Kaleidoscope Face Bandana"},
- {19036, !"White Hockey mask"},
- {19037, !"Red Hockey mask"},
- {19038, !"Green Hockey mask"},
- {19067, !"Red Beanie"},
- {19068, !"Spiral Beanie"},
- {19069, !"Black Beanie"},
- {18964, !"Black Gangster Beanie"},
- {18965, !"Black Gangster Beanie"},
- {18954, !"Gray Sailor Beanie"},
- {18953, !"Black Sailor Beanie"},
- {18976, !"Blue Sports Helmet"},
- {18977, !"Red Biking Helmet"},
- {18978, !"White Biking Helmet"},
- {18979, !"Pink Biking Helmet"},
- {18645, !"Flame Biking Helmet"},
- {19006, !"Red Sunglasses"},
- {19007, !"Orange Sunglasses"},
- {19008, !"Green Sunglasses"},
- {19009, !"Blue Sunglasses"},
- {19010, !"Pink Sunglasses"},
- {19011, !"Spiral Sunglasses"},
- {19012, !"Black Sunglasses"},
- {19013, !"Eyeball Sunglasses"},
- {19014, !"Checkered Sunglasses"},
- {19015, !"Eye Glasses"},
- {19016, !"X-Ray Sunglasses"},
- {19017, !"Yellow Frameless Glasses"},
- {19018, !"Orange Frameless Glasses"},
- {19019, !"Red Frameless Glasses"},
- {19020, !"Blue Frameless Glasses"},
- {19021, !"Green Frameless Glasses"},
- {19022, !"Black Aviators"},
- {19023, !"Blue Aviators"},
- {19024, !"Purple Aviators"},
- {19025, !"Pink Aviators"},
- {19026, !"Red Aviators"},
- {19027, !"Orange Aviators"},
- {19028, !"Yellow Aviators "},
- {19029, !"Green Aviators"},
- {19030, !"Brown Glasses"},
- {19031, !"Yellow Glasses"},
- {19032, !"Red Glasses"},
- {19033, !"Black Glasses"},
- {19034, !"Checkered Glasses"},
- {19035, !"Lightning Glasses"},
- {18639, !"Black Hat"},
- {18934, !"Red Cap"},
- {18935, !"Sponge Cap"},
- {18926, !"Camo Cap"},
- {18929, !"Gangster Cap"},
- {18941, !"Black Baseball Cap"},
- {18942, !"Gray Baseball Cap"},
- {18943, !"Green Baseball Cap"},
- {18967, !"Black Bucket Hat"},
- {18968, !"Plaid Bucket Hat"},
- {18969, !"Orange Ridge Bucket Hat"},
- {18970, !"Pimp Cowboy Hat"},
- {19095, !"Brown Cowboy Hat"},
- {19096, !"Black Cowboy Hat"},
- {19097, !"Red Cowboy Hat"},
- {19098, !"Brown Cowboy Hat"},
- {19039, !"Gold Watch"},
- {19040, !"Silver Watch"},
- {19041, !"Black Gold Watch"},
- {19042, !"Gold Watch 2"},
- {19043, !"Silver Watch 2"},
- {18896, !"Black Head Bandana"},
- {18897, !"Blue Head Bandana"},
- {18898, !"Green Head Bandana"},
- {18899, !"Pink Head Bandana"},
- {18891, !"Blue Pattern Head Bandana"},
- {18892, !"Red Pattern Head Bandana"},
- {18893, !"Red and White Head Bandana"},
- {18894, !"Orange Weed Head Bandana"},
- {18895, !"Black Skull Head Bandana"},
- {18900, !"Tie-dye Head Bandana"},
- {18901, !"Tiger Head Bandana"},
- {18902, !"Sponge Head Bandana"},
- {18903, !"Pink Head Bandana"},
- {18904, !"Lightning Head Bandana"},
- {18905, !"Yellow Head Bandana"},
- {18906, !"Orange Ridge Head Bandana"},
- {18907, !"Tie-dye Head Bandana"},
- {18908, !"Blue Bubble Head Bandana"},
- {18909, !"Pocket Lint Head Bandana"},
- {18910, !"Red Head Bandana"},
- {18640, !"Black Afro"},
- {18975, !"Smaller Black Afro"},
- {19077, !"Black Hair"},
- {19136, !"Hat With Hair"},
- {19274, !"Orange Clown Afro"},
- {19516, !"Grey Afro"},
- {19517, !"Grey Hair"},
- {19518, !"Thick Grey Hair"},
- {19519, !"Grey Hair 2"},
- {19351, !"Moustache"},
- {19472, !"Gas Mask"},
- {19064, !"Santa Hat"},
- {19065, !"'Merry Xmas' Santa Hat"},
- {19066, !"'Happy Xmas' Santa Hat"},
- {19161, !"Cadet Cap"},
- {19099, !"Black Trooper Cowboy Hat"},
- {19100, !"Brown Trooper Cowboy Hat"},
- {19162, !"Blue Police Hat"},
- {19514, !"Grey Police Helmet"},
- {19200, !"Motorcycle Helmet"},
- {19141, !"Riot Helmet"},
- {19521, !"Ceremonial Helmet"},
- {19347, !"Gold Police Star"},
- {19774, !"Silver Police Badge"},
- {19775, !"Gold Police Badge"},
- {18636, !"Police Cap"},
- {18637, !"Riot Shield"},
- {18641, !"Flashlight"},
- {19559, !"Hiking Backpack"},
- {19623, !"Camera"},
- {19631, !"Sledge Hammer"},
- {19801, !"Balaclava"},
- {19878, !"Skateboard"},
- {19893, !"Open Laptop"},
- {19894, !"Closed Laptop"},
- {19610, !"Microphone"},
- {19528, !"Witch Hat"},
- {11704, !"Devil Mask"},
- {18974, !"Zorro Mask"},
- {19163, !"Gimp Mask"},
- {19557, !"Naughty Mask"},
- {18921, !"Black Beret"},
- {18922, !"Red Beret"},
- {18923, !"Blue Beret"},
- {18924, !"Army Beret"},
- {18925, !"French Beret"},
- {18927, !"Blue Camo Cap"},
- {18928, !"Funky Camo Cap"},
- {18930, !"Orange Flame Cap"},
- {18931, !"Blue Lightning Cap"},
- {18932, !"Bright Orange Funky Cap"},
- {18933, !"Grey Cap"},
- {18939, !"Blue Lightning Hat"},
- {18940, !"Blue Camo Hat"},
- {18944, !"Orange Boater Hat"},
- {18945, !"Grey Boater Hat"},
- {18946, !"Grey Boater Hat 2"},
- {18947, !"Black Bowler Hat"},
- {18948, !"Blue Bowler Hat"},
- {18949, !"Green Bowler Hat"},
- {18950, !"Red Bowler Hat"},
- {18951, !"Yellow Bowler Hat"},
- {19488, !"White Bowler Hat"},
- {18955, !"Bright Orange Pattern Cap"},
- {18956, !"Lightning Cap"},
- {18957, !"Blue Pattern Cap"},
- {18958, !"Yellow And Black Pattern Cap"},
- {18959, !"Army Camo Cap"},
- {18960, !"Purple Psychedelic Cap Rim UP"},
- {18961, !"Trucker Cap"},
- {18966, !"Pink & Orange Kaleidoscope Beanie"},
- {18971, !"B&W Checkered Cowboy Hat"},
- {18972, !"Orange And Black Cowboy Hat"},
- {18973, !"Snakeskin Cowboy Hat"},
- {18962, !"Gray Cowboy Hat"},
- {19486, !"Black Hat"},
- {19487, !"White Hat"},
- {19520, !"Black Pilot Cap"},
- {2054, !"White Captain Cap"},
- {19553, !"Straw Cowboy Hat"},
- {19554, !"Black Beanie"},
- {19558, !"Pizza Cap"},
- {19094, !"Burger Shot Hat"},
- {19137, !"Cluckin' Bell Hat"},
- {19101, !"Woodland Camo Helmet With Strap"},
- {19102, !"Urban Camo Helmet With Strap"},
- {19103, !"Desert Camo Helmet With Strap"},
- {19104, !"Mossy Camo Helmet With Strap"},
- {19105, !"Tiger Skin Helmet With Strap"},
- {19106, !"Woodland Camo Helmet"},
- {19107, !"Urban Camo Helmet"},
- {19108, !"Desert Camo Helmet"},
- {19109, !"Mossy Camo Helmet"},
- {19110, !"Tiger Skin Helmet"},
- {19111, !"White Helmet"},
- {19112, !"Pink Helmet"},
- {18936, !"Concrete Gray Helmet"},
- {18937, !"Red Helmet"},
- {18938, !"Blue Helmet"},
- {2052, !"Tommy Hat"},
- {2053, !"Jerry Hat"},
- {19114, !"Don't Shoot Me Helmet"},
- {19115, !"Skull Helmet"},
- {19116, !"Black Helmet"},
- {19117, !"Red Helmet"},
- {19118, !"Green Helmet"},
- {19119, !"Blue Helmet"},
- {19120, !"Yellow Helmet"},
- {18638, !"Construction Helmet"},
- {19044, !"Violet Sports Watch"},
- {19045, !"Pink Sports Watch"},
- {19046, !"Green Sports Watch"},
- {19047, !"Purple Sports Watch"},
- {19048, !"Trendy Lightning Watch"},
- {19049, !"Trendy Kaleidoscope Watch"},
- {19050, !"Trendy Blue Watch"},
- {19051, !"Trendy Gold Watch"},
- {19052, !"Trendy Pink Watch"},
- {19053, !"Trendy Snakeskin Watch"},
- {19349, !"Monocle"},
- {19469, !"White Scarf"},
- {19591, !"Chinese Paper Fan"},
- {18875, !"Pager"},
- {19090, !"Blue Pom Pom"},
- {19091, !"Red Pom Pom"},
- {19092, !"Green Pom Pom"},
- {19555, !"Boxing Glove Left Hand"},
- {19556, !"Boxing Glove Right Hand"},
- {19624, !"Suitcase"},
- {19921, !"Red Trendy Suitcase"},
- {11745, !"Duffel Bag"},
- {371, !"Rockstar Backpack"},
- {19904, !"Traffic Vest"},
- {19773, !"Holster"},
- {19078, !"Parrot"},
- {11712, !"Wooden Cross"},
- {19088, !"Rope"},
- {18632, !"Fishing Rod"},
- {18633, !"Wrench"},
- {18634, !"Crowbar"},
- {18635, !"Hammer"},
- {18644, !"Screwdriver"},
- {18890, !"Mop"},
- {19622, !"Broom"},
- {19352, !"Top Hat"},
- {19778, !"Rank Insignia 1"},
- {19779, !"Rank Insignia 2"},
- {19780, !"Rank Insignia 3"},
- {19781, !"Rank Insignia 4"},
- {19782, !"Rank Insignia 5"},
- {19783, !"Rank Insignia 6"},
- {19784, !"Rank Insignia 7"},
- {19785, !"Rank Insignia 8"},
- {19138, !"Black Police Glasses"},
- {19139, !"Red Police Glasses"},
- {19140, !"Blue Police Glasses"},
- {18642, !"Taser"},
- {19418, !"Handcuffs"},
- {19330, !"Yellow Firehat"},
- {19331, !"Black Firehat"}
- };
- for(new i = 0; i < sizeof(RCRP_Masks); i++) if(RCRP_Masks[i][MaskObjectID] == componentid)
- {
- strunpack(MaskName, RCRP_Masks[i][ModFullName]);
- return MaskName;
- }
- strunpack(MaskName, !"Unknown");
- return MaskName;
- }
- stock GetFreeHouseArraySlot()
- {
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(HouseData[h][HouseSQLID] == 0)
- {
- return h;
- }
- }
- return -1;
- }
- stock GetFreeGarageArraySlot()
- {
- for(new g = 0; g < MAX_GARAGES; g++)
- {
- if(GarageData[g][gID] == 0)
- {
- return g;
- }
- }
- return -1;
- }
- stock UpdateHousePickup(houseid)
- {
- DestroyDynamicPickup(HouseData[houseid][HousePickup]);
- if(HouseData[houseid][HouseOwnerSQLID] == 0) HouseData[houseid][HousePickup] = CreateDynamicPickup(19522, 23, HouseData[houseid][oPosX], HouseData[houseid][oPosY], HouseData[houseid][oPosZ], HouseData[houseid][HouseExtVW], -1, -1, 20.0);
- else HouseData[houseid][HousePickup] = CreateDynamicPickup(1314, 23, HouseData[houseid][oPosX], HouseData[houseid][oPosY], HouseData[houseid][oPosZ], HouseData[houseid][HouseExtVW], -1, -1, 20.0);
- return true;
- }
- stock GetHouseArrayFromID(houseid)
- {
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(HouseData[h][HouseSQLID] == houseid) return h;
- }
- return -1;
- }
- stock ProcessHouseKey(playerid)
- {
- new H = 0, hcount = 0, M = 0, mcount = 0;
- do
- {
- if(HouseData[H][HouseOwnerSQLID] == SQLID[playerid])
- {
- HasHouseKey[playerid][hcount] = H;
- hcount++;
- }
- H++;
- }
- while(H < MAX_HOUSES && hcount < MAX_HOUSE_PER_PLAYER);
- do
- {
- if(MotelData[M][RoomOwner] == SQLID[playerid])
- {
- RentRoom[playerid] = M;
- mcount = 1;
- }
- M++;
- }
- while(M < MAX_MOTELROOMS && mcount == 0);
- return true;
- }
- stock IsValidDoorObject(modelid)// /addobj 1495 Porta_de_malha azul 230 8 2
- {
- if(modelid == 1493) return true; //Porta de malha vermelha
- if(modelid == 1495) return true; //Porta de malha azul
- if(modelid == 1496) return true; //Porta cinzenta
- if(modelid == 1497) return true; //Porta de celeiro de madeira
- if(modelid == 1498) return true; //Porta branca de madeira
- if(modelid == 1500) return true; //Porta de malha de metal
- if(modelid == 1501) return true; //Porta De Malha De Madeira
- if(modelid == 1502) return true; //Porta de madeira
- if(modelid == 1504) return true; //Porta vermelha
- if(modelid == 1505) return true; //Porta azul
- if(modelid == 1506) return true; //Porta branca
- if(modelid == 1507) return true; //Porta amarela
- if(modelid == 1536) return true; //Porta de vidro escuro
- if(modelid == 1557) return true; //Porta de vidro fantasia
- if(modelid == 1567) return true; //Porta de madeira branca
- if(modelid == 1569) return true; //Porta com janela
- return false;
- }
- stock UpdateHouseLabel(houseid)
- {
- UpdateDynamic3DTextLabelText(HouseData[houseid][HouseLabel], COLOR_SKYBLUE, HouseData[houseid][HouseDescription]);
- return true;
- }
- stock GarageCheck(id, tog, spot = -1)
- {
- for(new v = 0, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(tog == 0) //outdoor check
- {
- if(GetVehicleVirtualWorld(v) == 0)
- {
- if(IsVehicleInRangeOfPoint(v, 5.0, GarageData[id][oPosX], GarageData[id][oPosY], GarageData[id][oPosZ])) return true;
- }
- }
- if(tog == 1) //indoor check
- {
- if(GetVehicleVirtualWorld(v) == GarageData[id][iVirtualWorld])
- {
- if(GarageData[id][gType] == 1)
- {
- if(IsVehicleInRangeOfPoint(v, 2.0, 1449.0339, -2518.7883, 13.7018)) return true;
- }
- else if(GarageData[id][gType] == 2)
- {
- if(IsVehicleInRangeOfPoint(v, 2.0, 1836.6912, -2440.2810, 13.7131)) return true;
- }
- else if(GarageData[id][gType] == 3)
- {
- if(spot == 0)
- {
- if(IsVehicleInRangeOfPoint(v, 2.0, 2081.5933, -2479.1887, 13.7145)) return true;
- }
- if(spot == 1)
- {
- if(IsVehicleInRangeOfPoint(v, 2.0, 2081.5930, -2473.1890, 13.9200)) return true;
- }
- }
- else if(GarageData[id][gType] == 4)
- {
- if(spot == 0)
- {
- if(IsVehicleInRangeOfPoint(v, 2.0, 1566.3131, -2562.6003, 13.7139)) return true;
- }
- if(spot == 1)
- {
- if(IsVehicleInRangeOfPoint(v, 2.0, 1566.2830, -2555.6000, 13.2960)) return true;
- }
- }
- else if(GarageData[id][gType] == 5)
- {
- if(IsVehicleInRangeOfPoint(v, 2.0, GarageData[id][iPosX], GarageData[id][iPosY], GarageData[id][iPosZ])) return true;
- }
- }
- }
- }
- return false;
- }
- stock FirePlayer(sqlid, toggle)
- {
- if(toggle == 1) //player is online
- {
- new playa = -1;
- foreach(new i: Player)
- {
- if(sqlid == SQLID[i])
- {
- playa = i;
- }
- }
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Faction = 0, FactionRank = 0, FactionCustomRank = '', MySpawnID = 1, BizzSpawn = 0, SubFactionSpawn = 0, RadioFrequency = %i, RadioSlot1 = %i, RadioSlot2 = %i, RadioSlot3 = %i WHERE id = %i", RadioFrequency[playa], RadioSlot[playa][0], RadioSlot[playa][1], RadioSlot[playa][2], SQLID[playa]);
- }
- else mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Faction = 0, FactionRank = 0, FactionCustomRank = '', MySpawnID = 1, BizzSpawn = 0, SubFactionSpawn = 0, RadioFrequency = 1000, RadioSlot1 = 1000, RadioSlot2 = 1000, RadioSlot3 = 1000 WHERE id = %i", sqlid);
- //set variables on db
- mysql_pquery(conn, mquery);
- //remove faction masks from account
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM toys WHERE tPlayer = %i AND FactionMask = 1", sqlid);
- mysql_pquery(conn, mquery);
- //delete any faction weapons that originated from the account
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM weapons WHERE WeaponOrigin = 3 AND OwnerSQLID = %i", sqlid);
- mysql_pquery(conn, mquery);
- return true;
- }
- stock FactionIgnoreSpeedCam(playerid)
- {
- if((Faction[playerid] == FACTION_COP || Faction[playerid] == FACTION_SACFD) && Duty[playerid] == 1) return true;
- if(Faction[playerid] == FACTION_RESEARCH) return true;
- if(Faction[playerid] == FACTION_PROP) return true;
- return false;
- }
- stock GetFactionName(playerid)
- {
- new fName[50];
- if(Faction[playerid] == 0)
- {
- fName = "Civil";
- }
- else
- {
- format(fName, 30, FACTIONS[Faction[playerid]][FactionName]);
- }
- return fName;
- }
- stock GetFactionRankName(faction, rank)
- {
- new rName[26];
- if(faction == FACTION_NONE || rank == 0) rName = "n/a";
- else format(rName, 32, FactionRanks[faction][rank - 1]);
- return rName;
- }
- stock GetFactionNameFromId(factionid)
- {
- new fName[24];
- if(factionid == 0) fName = "Civil";
- else format(fName, sizeof(fName), FACTIONS[factionid][FNameShort]);
- return fName;
- }
- stock GetFactionVehicleCreator(fv)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Creator FROM fveh WHERE id = %i", fv);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows())
- {
- new creator = cache_get_field_content_int(0, "Creator");
- cache_delete(result);
- return creator;
- }
- cache_delete(result);
- return false;
- }
- stock GetFactionMaxSkins(factionid)
- {
- new count = 0;
- for(new i = 0; i < 15; i++)
- {
- if(FACTIONS[factionid][FactionSkins][i] > 0) count ++;
- }
- return count;
- }
- stock RespawnFactionCar(v)
- {
- new bool:windows = WindowState{v};
- SetVehicleToRespawnEx(v);
- Siren{v} = false;
- ELMs{v} = false;
- if(VehicleBoots[v][1] == 0) ToggleVehicleTrunk(v, 0);
- else if(VehicleBoots[v][1] == 1) ToggleVehicleTrunk(v, 1);
- if(VehObject[v] != INVALID_OBJECT_ID)
- {
- DestroyDynamicObjectEx(VehObject[v], "VehObject[v] 0");
- VehObject[v] = INVALID_OBJECT_ID;
- }
- WindowState{v} = windows;
- VehicleBroke[v] = 0;
- EngineStatus[v] = 0;
- ToggleVehicleEngine(v, 0);
- ToggleVehicleLights(v, 0);
- ToggleVehicleTrunk(v, 0);
- ToggleVehicleBonnet(v, 0);
- ToggleVehicleLock(v, Locked{v});
- if(VehicleHasEngine(v) == 0)
- {
- EngineStatus[v] = 1;
- Fuel[v] = 100;
- ToggleVehicleEngine(v, 1);
- }
- if(FVehicleData[v][FVGovUnit3DText] != Text3D:INVALID_3DTEXT_ID) DestroyDynamic3DTextLabel(FVehicleData[v][FVGovUnit3DText]);
- FVehicleData[v][FVGovUnit3DText] = Text3D:INVALID_3DTEXT_ID;
- FVehicleData[v][FVGovUnit][0] = EOS;
- FVehicleData[v][FVGovUnitTog] = 0;
- if(VehObject[v] != INVALID_OBJECT_ID) DestroyDynamicObjectEx(VehObject[v], "VehObject[v] 1");
- if(vTaxiSign[v] != INVALID_OBJECT_ID) DestroyDynamicObjectEx(vTaxiSign[v], "vTaxiSign[v]");
- vTaxiSign[v] = INVALID_OBJECT_ID;
- VehObject[v] = INVALID_OBJECT_ID;
- Siren{v} = false;
- SnowPlow{v} = false;
- LinkVehicleToInteriorEx(v, FVehicleData[v][FVInterior]);
- SetVehicleVirtualWorld(v, FVehicleData[v][FVWorld]);
- return true;
- }
- stock CanUseMDC(playerid)
- {
- if(IsPlayerAdmin(playerid)) return true;
- new playerVehicleID = GetPlayerVehicleID(playerid);
- if(IsFactionVehicle(playerVehicleID) == FACTION_COP) return true;
- if(IsFactionVehicle(playerVehicleID) == FACTION_SACFD) return true;
- if(IsFactionVehicle(playerVehicleID) == FACTION_RESEARCH) return true;
- if(IsBike(playerVehicleID)) return false;
- if(IsPlayerInRangeOfPoint(playerid, 1.75, 325.0857,304.9024,999.1484)) return true; //pd de montgomery
- if(IsPlayerInRangeOfPoint(playerid, 1.75, -796.7911,-420.2244,1601.9928)) return true; //DPD cells
- if(IsPlayerInRangeOfPoint(playerid, 1.75, 650.9440,-572.1576,997.5959)) return true; //DPD Cells
- if(IsPlayerInRangeOfPoint(playerid, 1.75, 2367.9409,227.0800,2000.6639)) return true; //Station 49 Front Desk
- if(IsPlayerInRangeOfPoint(playerid, 1.75, 647.054077, -561.330749, 1001.085937)) return true; //DPD Front Desk
- if(IsPlayerInRangeOfPoint(playerid, 1.75, 324.928, 305.504, 999.148)) return true; //MPD, FPD, etc desk
- if(IsPlayerInRangeOfPoint(playerid, 1.75, 238.0451, -82.9925, 821.1760)) return true; // ?
- if(IsPlayerInRangeOfPoint(playerid, 1.75, 242.8300, -113.586, 825.6859)) return true; // ?
- if(IsPlayerInRangeOfPoint(playerid, 1.75, 362.6976,209.2520,1008.3828)) return true; // ?
- if(IsPlayerInRangeOfPoint(playerid, 1.75, 250.7136, 1412.7253, 10.5849)) return true; //DoC Gate Office
- if(IsPlayerInRangeOfPoint(playerid, 1.75, -1337.6696,-48.7392,17.7579)) return true; //DoC Main Interior
- if(IsPlayerInRangeOfPoint(playerid, 1.75, -1349.9988,-63.7959,14.2549)) return true; //DoC Booking Room
- return false;
- }
- stock CanSetST(playerid)
- {
- if(IsPlayerAdmin(playerid) || MasterAccount[playerid] == 5741 || MasterAccount[playerid] == 174) return true;
- return false;
- }
- stock PoliceMessage(msg[])
- {
- foreach(new t: Player)
- {
- if(Logged{t} && IsCop(t) && Duty[t] == 1)
- {
- SendClientMessageF(t, COLOR_BLUE, "[Police Message] %s", msg);
- }
- }
- return true;
- }
- stock ReportCrime(crime[])
- {
- foreach(new t: Player)
- {
- if(Logged{t} && Faction[t] == FACTION_COP && Duty[t] == 1 && RadioPoweredOn[t] == 1)
- {
- SendSplitRadioMessage(t, 0x967100FF, crime);
- }
- }
- return true;
- }
- stock ReportFire(fire[])
- {
- foreach(new t: Player)
- {
- if(Logged{t} && Faction[t] == FACTION_SACFD && Duty[t] == 1 && RadioPoweredOn[t] == 1)
- {
- SendSplitRadioMessage(t, 0x967100FF, fire);
- }
- else if(Logged{t} && Faction[t] == FACTION_COP && Duty[t] == 1 && RadioPoweredOn[t] == 1 && IsESU{t})
- {
- SendSplitRadioMessage(t, 0x967100FF, fire);
- }
- }
- return true;
- }
- stock HasGovTrunkAccess(playerid, vehicleid)
- {
- if(FVehicleData[vehicleid][FVFaction] == Faction[playerid] && Faction[playerid] == FACTION_COP) return true;
- if(FVehicleData[vehicleid][FVFaction] == Faction[playerid] && Faction[playerid] == FACTION_SACFD) return true;
- if(FVehicleData[vehicleid][FVFaction] == Faction[playerid] && Faction[playerid] == FACTION_RESEARCH) return true;
- if(FVehicleData[vehicleid][FVFaction] == Faction[playerid] && Faction[playerid] == FACTION_PROP) return true;
- else return false;
- }
- stock IsGovTrunk(vehicleid)
- {
- if(FVehicleData[vehicleid][FVFaction] == FACTION_COP) return true;
- if(FVehicleData[vehicleid][FVFaction] == FACTION_SACFD) return true;
- if(FVehicleData[vehicleid][FVFaction] == FACTION_RESEARCH) return true;
- if(FVehicleData[vehicleid][FVFaction] == FACTION_PROP) return true;
- else return false;
- }
- stock SendTruckingMessage(msg[])
- {
- foreach(new i: Player)
- {
- if(Logged{i} && Faction[i] == FACTION_TRUCKING)
- {
- SendSplitMessage(i, COLOR_WHITE, msg);
- }
- }
- return true;
- }
- stock IsInPrison(playerid)
- {
- if(GetPlayerInterior(playerid) == 6 && GetPlayerVirtualWorld(playerid) == 6161) return true;
- if(GetPlayerInterior(playerid) == 6 && GetPlayerVirtualWorld(playerid) == 6162) return true;
- if(GetPlayerInterior(playerid) == 6 && GetPlayerVirtualWorld(playerid) == 6163) return true;
- if(GetPlayerInterior(playerid) == 6 && GetPlayerVirtualWorld(playerid) == 6164) return true;
- if(GetPlayerInterior(playerid) == 6 && GetPlayerVirtualWorld(playerid) == 6165) return true;
- if(GetPlayerInterior(playerid) == 6 && GetPlayerVirtualWorld(playerid) == 6166) return true;
- return false;
- }
- stock JailPlayer(playerid, cellid)
- {
- if(cellid == 1) Teleport(playerid, -744.2262, -391.1415, 1405.0316, 270.0, 10, 10);
- else if(cellid == 2) Teleport(playerid, -743.8887, -387.3232, 1405.0316, 270.0, 10, 10);
- else if(cellid == 3) Teleport(playerid, -739.1190, -383.9186, 1405.0336, 270.0, 10, 10);
- else if(cellid == 4) Teleport(playerid, -735.3704, -383.8923, 1405.0316, 270.0, 10, 10);
- else if(cellid == 5) Teleport(playerid, -726.4100, -387.2504, 1405.0315, 270.0, 10, 10);
- RadioPoweredOn[playerid] = 0;
- PhoneData[playerid][pPower] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhonePower = 0 WHERE id = %i", PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- MySQLUpdateInt(SQLID[playerid], "RadioPower", RadioPoweredOn[playerid], "players");
- ResetPlayerWeaponsEx(playerid);
- ClearAnimations(playerid);
- SetCameraBehindPlayer(playerid);
- return true;
- }
- stock UnJailPlayer(playerid)
- {
- SetPlayerPos(playerid,617.5016,-593.5928,16.4163);
- SetPlayerFacingAngle(playerid,261.3485);
- SetPlayerVirtualWorldEx(playerid, 0);
- SetPlayerInterior(playerid,0);
- //ResetPlayerWeaponsEx(playerid);
- TogglePlayerControllable(playerid,1);
- ClearAnimations(playerid);
- SetCameraBehindPlayer(playerid);
- IsJailed[playerid] = 0;
- IsCuffed[playerid] = 0;
- JailTime[playerid] = 0;
- JailCell[playerid] = 0;
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- RemovePlayerAttachedObject(playerid, 6);
- SysMsg(playerid,"You have been released from Jail. Have a nice day and be careful out there!");
- return true;
- }
- stock ImprisonPlayer(playerid, cellid)
- {
- RadioPoweredOn[playerid] = 0;
- PhoneData[playerid][pPower] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhonePower = 0 WHERE id = %i", PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- MySQLUpdateInt(SQLID[playerid], "RadioPower", RadioPoweredOn[playerid], "players");
- SetPlayerInterior(playerid,6);
- SetPlayerVirtualWorldEx(playerid,6164);
- SetPlayerPos(playerid, PrisonCellsIn[cellid][0], PrisonCellsIn[cellid][1], PrisonCellsIn[cellid][2]);
- ResetPlayerWeaponsEx(playerid);
- SetTimerEx("UnFreezePlayer", 3000, 0, "d", playerid);
- TogglePlayerControllable(playerid,0);
- ClearAnimations(playerid);
- SetCameraBehindPlayer(playerid);
- return true;
- }
- stock ReleaseFromPrison(playerid)
- {
- PlayerImprisoned{playerid} = false;
- PrisonTime[playerid] = 0;
- MySQLUpdateInt(SQLID[playerid], "PrisonTime", PrisonTime[playerid], "players");
- SetUpPlayerSpawn(playerid);
- return true;
- }
- stock IsolatePlayer(playerid, isoid)
- {
- SetPlayerInterior(playerid, 6);
- SetPlayerVirtualWorldEx(playerid, 6162);
- SetPlayerPos(playerid, IsoCellsIn[isoid][0], IsoCellsIn[isoid][1], IsoCellsIn[isoid][2]);
- SetPlayerFacingAngle(playerid, IsoInAngles[isoid]);
- SetTimerEx("UnFreezePlayer", 3000, 0, "d", playerid);
- TogglePlayerControllable(playerid,0);
- ClearAnimations(playerid);
- SetCameraBehindPlayer(playerid);
- }
- stock ReleaseFromIsolation(playerid)
- {
- Isolated[playerid] = 0;
- IsolationTime[playerid] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET IsolationTime = 0 WHERE id = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery);
- SetPlayerInterior(playerid,6);
- SetPlayerVirtualWorldEx(playerid, 6164);
- SetPlayerPos(playerid, -1324.6801, -55.4974, 14.2529);
- SetPlayerFacingAngle(playerid,280.0);
- SetTimerEx("UnFreezePlayer", 3000, 0, "d", playerid);
- TogglePlayerControllable(playerid,0);
- ClearAnimations(playerid);
- SetCameraBehindPlayer(playerid);
- }
- stock FireStationBell()
- {
- foreach(new i: Player)
- {
- if(IsPlayerInRangeOfPoint(i, 50.0, 1461.7202, 435.8998, 20.2617) || IsPlayerInRangeOfPoint(i, 50.0, -513.0501,19.9486,1006.1156))
- {
- SendClientMessage(i, COLOR_EMOTE, "* Fire Station alarm bell rings as a call comes in! *");
- PlayerPlaySound(i, SOUND_FIREALARM_START, 0, 0, 0);
- SetTimerEx("DelayPlaySound", 6000, 0, "dd", i, SOUND_FIREALARM_END);
- }
- }
- }
- stock GetProblemType(sectorid,problemid)
- {
- new reason[64];
- if(sectorid == 0)//SASP
- {
- switch(problemid)
- {
- case 0: reason = "Abandoned Vehicle";
- case 1: reason = "Accident-Major";
- case 2: reason = "Accident-Minor";
- case 3: reason = "Alarm";
- case 4: reason = "Assault";
- case 5: reason = "Assist-Public";
- case 6: reason = "Burglary";
- case 7: reason = "Burglary (In Progress)";
- case 8: reason = "Criminal Mischief";
- case 9: reason = "Disturbance";
- case 10: reason = "DOA";
- case 11: reason = "Drunk";
- case 12: reason = "Drugs";
- case 13: reason = "DWI";
- case 14: reason = "Fight";
- case 15: reason = "Fire";
- case 16: reason = "Information";
- case 17: reason = "Injured/Sick Person";
- case 18: reason = "Miscellaneous";
- case 19: reason = "Missing Person";
- case 20: reason = "Officer In Trouble";
- case 21: reason = "Rape";
- case 22: reason = "Rape (In Progress)";
- case 23: reason = "Robbery";
- case 24: reason = "Shooting";
- case 25: reason = "Shooting (In Progress)";
- case 26: reason = "Suicide";
- case 27: reason = "Suspicious Person";
- case 28: reason = "Suspicious Vehicle";
- case 29: reason = "Threats";
- case 30: reason = "Threats Bomb";
- case 31: reason = "Traffic Related";
- case 32: reason = "Wanted Person";
- case 33: reason = "zOn Site Activity";
- case 34: reason = "zTraffic Stop";
- case 35: reason = "Assist Fire/EMS";
- }
- }
- if(sectorid == 1)//RCFD
- {
- switch(problemid)//RFPD
- {
- case 0: reason = "Aircraft Emergency";
- case 1: reason = "Accident-Major";
- case 2: reason = "Accident-Minor";
- case 3: reason = "Alarm";
- case 4: reason = "Arcing Electrical";
- case 5: reason = "Assist-Public";
- case 6: reason = "Bomb Threat";
- case 7: reason = "Entrapment";
- case 8: reason = "Explosion";
- case 9: reason = "Fire";
- case 10: reason = "Fire-Structure";
- case 11: reason = "Fire-Vehicle";
- case 12: reason = "Gas/Fuel-Leak";
- case 13: reason = "Hazardous Materials";
- case 14: reason = "Med-Sick Person";
- case 15: reason = "Med-Injured Person";
- case 16: reason = "Rescue";
- case 17: reason = "Rescue-Water";
- case 18: reason = "Rescue-Search";
- case 19: reason = "Train Derailment";
- case 20: reason = "zMiscellanious";
- case 21: reason = "zOn Site Activity";
- case 22: reason = "zSpecial Assignment";
- case 23: reason = "zStand By";
- case 24: reason = "Assist PD";
- }
- }
- return reason;
- }
- stock IsPlayerInRangeOfApertureSAM(playerid)
- {
- if((IsHelicopter(GetPlayerVehicleID(playerid)) || IsPlane(GetPlayerVehicleID(playerid))) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if(IsPlayerInDynamicArea(playerid, APArea)) return true;
- }
- return false;
- }
- stock IsValidLeaderRank(factionid, rank)
- {
- if(rank >= FACTIONS[factionid][FactionLeaderRank]) return true;
- else return false;
- }
- stock IsGang(factionid)
- {
- return FACTIONS[factionid][FactionIsGang];
- }
- stock IsFactionActive(factionid)
- {
- return FACTIONS[factionid][FactionIsActive];
- }
- stock CountOnlineFactionMembers(factionid)
- {
- new count = 0;
- foreach(new i: Player)
- {
- if(Logged{i} && Faction[i] == factionid) count ++;
- }
- return count;
- }
- stock IsFactionVehicle(VehicleID)
- {
- if(VehicleID <= 0 || VehicleID > MAX_VEHICLES) return false;
- if(FVehicleData[VehicleID][FVFaction] > 0) return FVehicleData[VehicleID][FVFaction];
- return false;
- }
- stock SpawnStretcher(playerid)
- {
- // Turn them around
- new Float:angle;
- GetPlayerFacingAngle(playerid, angle);
- SetPlayerFacingAngle(playerid, angle + 180);
- // Attach the stretcher
- AttachDynamicObjectToPlayer(StretcherEquipped[playerid], playerid, 0.0, 1.4, -1.0, 0.0, 0.0, 180.0);
- SendClientMessage(playerid, COLOR_WHITE, "You now have a stretcher. Use /stretcher for actions.");
- return true;
- }
- stock ReloadFaction(faction)
- {
- FACTIONS[faction][FactionName][0] = 0;
- FACTIONS[faction][FNameShort][0] = 0;
- FACTIONS[faction][FactionSpawn1][0] = 0;
- FACTIONS[faction][FactionSpawn1][1] = 0;
- FACTIONS[faction][FactionSpawn1][2] = 0;
- FACTIONS[faction][FactionSpawn1][3] = 0;
- FACTIONS[faction][FactionSpawn2][0] = 0;
- FACTIONS[faction][FactionSpawn2][1] = 0;
- FACTIONS[faction][FactionSpawn2][2] = 0;
- FACTIONS[faction][FactionSpawn2][3] = 0;
- FACTIONS[faction][FactionSpawn3][0] = 0;
- FACTIONS[faction][FactionSpawn3][1] = 0;
- FACTIONS[faction][FactionSpawn3][2] = 0;
- FACTIONS[faction][FactionSpawn3][3] = 0;
- FACTIONS[faction][FactionSpawn4][0] = 0;
- FACTIONS[faction][FactionSpawn4][1] = 0;
- FACTIONS[faction][FactionSpawn4][2] = 0;
- FACTIONS[faction][FactionSpawn4][3] = 0;
- FACTIONS[faction][FactionSpawn5][0] = 0;
- FACTIONS[faction][FactionSpawn5][1] = 0;
- FACTIONS[faction][FactionSpawn5][2] = 0;
- FACTIONS[faction][FactionSpawn5][3] = 0;
- FACTIONS[faction][FactionSpawnVW][0] = 0;
- FACTIONS[faction][FactionSpawnVW][1] = 0;
- FACTIONS[faction][FactionSpawnVW][2] = 0;
- FACTIONS[faction][FactionSpawnVW][3] = 0;
- FACTIONS[faction][FactionSpawnVW][4] = 0;
- FACTIONS[faction][FactionSpawnInt][0] = 0;
- FACTIONS[faction][FactionSpawnInt][1] = 0;
- FACTIONS[faction][FactionSpawnInt][2] = 0;
- FACTIONS[faction][FactionSpawnInt][3] = 0;
- FACTIONS[faction][FactionSpawnInt][4] = 0;
- FACTIONS[faction][FactionSpawn1Name][0] = 0;
- FACTIONS[faction][FactionSpawn2Name][0] = 0;
- FACTIONS[faction][FactionSpawn3Name][0] = 0;
- FACTIONS[faction][FactionIsGang] = 0;
- FACTIONS[faction][FactionIsActive] = 0;
- FACTIONS[faction][FactionBankBalance] = 0;
- FACTIONS[faction][FactionRadioChannel] = 0;
- FACTIONS[faction][FactionRankPay][0] = 0;
- FACTIONS[faction][FactionRankPay][1] = 0;
- FACTIONS[faction][FactionRankPay][2] = 0;
- FACTIONS[faction][FactionRankPay][3] = 0;
- FACTIONS[faction][FactionRankPay][4] = 0;
- FACTIONS[faction][FactionRankPay][5] = 0;
- FACTIONS[faction][FactionRankPay][6] = 0;
- FACTIONS[faction][FactionRankPay][7] = 0;
- FACTIONS[faction][FactionRankPay][8] = 0;
- FACTIONS[faction][FactionRankPay][9] = 0;
- FACTIONS[faction][FactionRankPay][10] = 0;
- FACTIONS[faction][FactionRankPay][11] = 0;
- FACTIONS[faction][FactionRankPay][12] = 0;
- FACTIONS[faction][FactionRankPay][13] = 0;
- FACTIONS[faction][FactionRankPay][14] = 0;
- FACTIONS[faction][FactionPayDayTax] = 0;
- FACTIONS[faction][FactionSkins][0] = 0;
- FACTIONS[faction][FactionSkins][1] = 0;
- FACTIONS[faction][FactionSkins][2] = 0;
- FACTIONS[faction][FactionSkins][3] = 0;
- FACTIONS[faction][FactionSkins][4] = 0;
- FACTIONS[faction][FactionSkins][5] = 0;
- FACTIONS[faction][FactionSkins][6] = 0;
- FACTIONS[faction][FactionSkins][7] = 0;
- FACTIONS[faction][FactionSkins][8] = 0;
- FACTIONS[faction][FactionSkins][9] = 0;
- FACTIONS[faction][FactionSkins][10] = 0;
- FACTIONS[faction][FactionSkins][11] = 0;
- FACTIONS[faction][FactionSkins][12] = 0;
- FACTIONS[faction][FactionSkins][13] = 0;
- FACTIONS[faction][FactionSkins][14] = 0;
- FACTIONS[faction][FactionLeaderRank] = 0;
- FACTIONS[faction][FactionUberLeaderRank] = 0;
- for(new x = 0; x < 15; x++)
- {
- FactionRanks[faction][x][0] = EOS;
- }
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE factions SET reload = 0 WHERE id = %i", faction);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM factions WHERE id = %i", faction);
- mysql_pquery(conn, mquery, "LoadFactions");
- return true;
- }
- stock IsAtFlame(playerid)
- {
- for(new i; i < MAX_FIRES; i++)
- {
- if(Flame[i][Spawned])
- {
- if(!IsPlayerInAnyVehicle(playerid) && (IsPlayerInRangeOfPoint(playerid, 2.2, Flame[i][F_Pos][0], Flame[i][F_Pos][1], Flame[i][F_Pos][2]+2.5) || IsPlayerInRangeOfPoint(playerid, 1.2, Flame[i][F_Pos][0], Flame[i][F_Pos][1], Flame[i][F_Pos][2]+1.5)))
- {
- return true;
- }
- }
- }
- return false;
- }
- stock GetFireID(Float:x, Float:y, Float:z, &Float:dist)
- {
- new id = -1;
- dist = 99999.99;
- for(new i; i < MAX_FIRES; i++)
- {
- if(DistanceBetweenPoints(x,y,z,Flame[i][F_Pos][0],Flame[i][F_Pos][1],Flame[i][F_Pos][2]) < dist)
- {
- dist = DistanceBetweenPoints(x,y,z,Flame[i][F_Pos][0],Flame[i][F_Pos][1],Flame[i][F_Pos][2]);
- id = i;
- }
- }
- return id;
- }
- stock GetFlameSlot()
- {
- for(new i = 0; i < MAX_FIRES; i++)
- {
- if(!Flame[i][Spawned]) { return i; }
- }
- return -1;
- }
- stock AimingAtFlame(playerid)
- {
- if(!IsInFireEngine(playerid) && !HoldingExtinguisher(playerid)) return -1;
- new id = -1, Float:dis = 99999.99, Float:dis2, Float:cx, Float:cy, Float:cz, Float:fx, Float:fy, Float:fz;
- GetPlayerCameraPos(playerid, cx, cy, cz);
- GetPlayerCameraFrontVector(playerid, fx, fy, fz);
- for(new i; i < MAX_FIRES; i++)
- {
- if(Flame[i][Spawned])
- {
- dis2 = DistanceCameraTargetToLocation(cx, cy, cz, Flame[i][F_Pos][0], Flame[i][F_Pos][1], Flame[i][F_Pos][2]+2.5, fx, fy, fz);
- if(IsPlayerInAnyVehicle(playerid) && dis2 < 8.0 && dis2 < dis)
- {
- dis = dis2;
- id = i;
- }
- else if(!IsPlayerInAnyVehicle(playerid) && dis2 < 1.5 && dis2 < dis)
- {
- dis = dis2;
- id = i;
- }
- }
- }
- if(id != -1 && !IsPlayerInRangeOfPoint(playerid, (IsPlayerInAnyVehicle(playerid) ? 50 : 5), Flame[id][F_Pos][0], Flame[id][F_Pos][1], Flame[id][F_Pos][2])) id = -1;
- return id;
- }
- stock IsInFireEngine(playerid)
- {
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 407 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 601) return true;
- return false;
- }
- stock HoldingExtinguisher(playerid)
- {
- if(GetPlayerWeapon(playerid) == 42 && !IsPlayerInAnyVehicle(playerid)) return true;
- else return false;
- }
- //MDC Functions
- stock NeedAnS(unit[], value)
- {
- new result[8];
- format(result, sizeof(result), unit);
- if(value > 1) strcat(result, "s");
- return result;
- }
- stock AddToMDC(sqlid, officerid, type, amount, reason[])
- {
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO mdc (SuspectSQLID, OfficerSQLID, OfficerName, OfficerRank, RecordType,Reason,Amount,cleared,removed, timestamp) VALUES (%i,%i,'%e','%e',%i,'%e',%i, 0, 0, %i)", sqlid, SQLID[officerid], NameRP(officerid), GetFactionRankName(Faction[officerid], FactionRank[officerid]), type, reason, amount, gettime());
- mysql_pquery(conn, mquery);
- return true;
- }
- stock IsWeedPlantObject(objectid)
- {
- if(objectid == WEED_OBJECT_POT || objectid == WEED_OBJECT_GROWN) return true;
- return false;
- }
- stock CalculateWeedLight(houseid, objectid)
- {
- new Float:wpos[3], Float:lpos[3], Float:dist, light = 10;
- GetDynamicObjectPos(objectid, wpos[0], wpos[1], wpos[2]);
- for(new i = 0; i < MAX_HFURNITURE; i++)
- {
- if(HouseData[houseid][FurnModel][i] == 1893 && HouseData[houseid][FurnPlaced][i] == 1)
- {
- GetDynamicObjectPos(HouseData[houseid][FurnObject][i], lpos[0], lpos[1], lpos[2]);
- if(lpos[2] < wpos[2]) continue; // if light is below plant then whats the point?? ehh?
- dist = DistanceBetweenPoints(wpos[0], wpos[1], wpos[2], lpos[0], lpos[1], lpos[2]);
- switch(floatround(dist))
- {
- case 0..1: light += 75;
- case 2..3: light += 50;
- case 4..5: light += 30;
- case 6..7: light += 20;
- case 8..10: light += 10;
- }
- if(light > 100) break;
- }
- }
- if(light > 100) light = 100;
- return light;
- }
- stock GetWeedGrowthAmount(water, light)
- {
- new grow = 4;
- switch(light)
- {
- case 0..30: grow -= 2;
- case 31..40: grow -= 1;
- case 41..70: grow += 1;
- case 71..101: grow += 2;
- }
- switch(water)
- {
- case 0..300: grow -= 2;
- case 301..400: grow -= 1;
- case 401..700: grow += 1;
- case 701..1001: grow += 2;
- }
- return grow;
- }
- stock SaveWeedPlant(h, s)
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weed SET Growth=%i, Water=%i WHERE id=%i LIMIT 1", WeedData[h][PlantGrowth][s], WeedData[h][PlantWater][s], WeedData[h][PlantSQLID][s]);
- mysql_pquery(conn, mquery);
- return true;
- }
- stock FormatWeedLabel(forwho, growth, water, light)
- {
- gstr[0] = EOS;
- SendClientMessage(forwho, COLOR_WHITE, "Weed Plant Information:");
- SendClientMessage(forwho, COLOR_WHITE, "");
- switch(growth)
- {
- case 0..100: SendClientMessageF(forwho, COLOR_WHITE, "Crescimento {000000}[{50C878}|{539C82}|||||||||{000000}]");
- case 101..200: SendClientMessageF(forwho, COLOR_WHITE, "Crescimento {000000}[{50C878}||{539C82}||||||||{000000}]");
- case 201..300: SendClientMessageF(forwho, COLOR_WHITE, "Crescimento {000000}[{50C878}|||{539C82}|||||||{000000}]");
- case 301..400: SendClientMessageF(forwho, COLOR_WHITE, "Crescimento {000000}[{50C878}||||{539C82}||||||{000000}]");
- case 401..500: SendClientMessageF(forwho, COLOR_WHITE, "Crescimento {000000}[{50C878}|||||{539C82}|||||{000000}]");
- case 501..600: SendClientMessageF(forwho, COLOR_WHITE, "Crescimento {000000}[{50C878}||||||{539C82}||||{000000}]");
- case 601..700: SendClientMessageF(forwho, COLOR_WHITE, "Crescimento {000000}[{50C878}|||||||{539C82}|||{000000}]");
- case 701..800: SendClientMessageF(forwho, COLOR_WHITE, "Crescimento {000000}[{50C878}||||||||{539C82}||{000000}]");
- case 801..900: SendClientMessageF(forwho, COLOR_WHITE, "Crescimento {000000}[{50C878}|||||||||{539C82}|{000000}]");
- case 901..1001: SendClientMessageF(forwho, COLOR_WHITE, "Crescimento {000000}[{50C878}||||||||||{000000}]");
- }
- switch(water)
- {
- case 0..100: SendClientMessageF(forwho, COLOR_WHITE, "Hidratação {000000}[{FF4300}|{E0EEFF}|||||||||{000000}]");
- case 101..200: SendClientMessageF(forwho, COLOR_WHITE, "Hidratação {000000}[{FF4300}||{E0EEFF}||||||||{000000}]");
- case 201..300: SendClientMessageF(forwho, COLOR_WHITE, "Hidratação {000000}[{FF4300}|||{E0EEFF}|||||||{000000}]");
- case 301..400: SendClientMessageF(forwho, COLOR_WHITE, "Hidratação {000000}[{FF4300}||||{E0EEFF}||||||{000000}]");
- case 401..500: SendClientMessageF(forwho, COLOR_WHITE, "Hidratação {000000}[{56A5FF}|||||{E0EEFF}|||||{000000}]");
- case 501..600: SendClientMessageF(forwho, COLOR_WHITE, "Hidratação {000000}[{56A5FF}||||||{E0EEFF}||||{000000}]");
- case 601..700: SendClientMessageF(forwho, COLOR_WHITE, "Hidratação {000000}[{56A5FF}|||||||{E0EEFF}|||{000000}]");
- case 701..800: SendClientMessageF(forwho, COLOR_WHITE, "Hidratação {000000}[{56A5FF}||||||||{E0EEFF}||{000000}]");
- case 801..900: SendClientMessageF(forwho, COLOR_WHITE, "Hidratação {000000}[{56A5FF}|||||||||{E0EEFF}|{000000}]");
- case 901..1001: SendClientMessageF(forwho, COLOR_WHITE, "Hidratação {000000}[{56A5FF}||||||||||{000000}]");
- }
- switch(light)
- {
- case 1..10: SendClientMessageF(forwho, COLOR_WHITE, "Luz {000000}[{FF4300}|{A3A5AE}|||||||||{000000}]");
- case 11..20: SendClientMessageF(forwho, COLOR_WHITE, "Luz {000000}[{FF4300}||{A3A5AE}||||||||{000000}]");
- case 21..30: SendClientMessageF(forwho, COLOR_WHITE, "Luz {000000}[{FF4300}|||{A3A5AE}|||||||{000000}]");
- case 31..40: SendClientMessageF(forwho, COLOR_WHITE, "Luz {000000}[{FFFF78}||||{A3A5AE}||||||{000000}]");
- case 41..50: SendClientMessageF(forwho, COLOR_WHITE, "Luz {000000}[{FFFF78}|||||{A3A5AE}|||||{000000}]");
- case 51..60: SendClientMessageF(forwho, COLOR_WHITE, "Luz {000000}[{FFFF78}||||||{A3A5AE}||||{000000}]");
- case 61..70: SendClientMessageF(forwho, COLOR_WHITE, "Luz {000000}[{FFFF78}|||||||{A3A5AE}|||{000000}]");
- case 71..80: SendClientMessageF(forwho, COLOR_WHITE, "Luz {000000}[{FFFF78}||||||||{A3A5AE}||{000000}]");
- case 81..90: SendClientMessageF(forwho, COLOR_WHITE, "Luz {000000}[{FFFF78}|||||||||{A3A5AE}|{000000}]");
- case 91..100: SendClientMessageF(forwho, COLOR_WHITE, "Luz {000000}[{FFFF78}||||||||||{000000}]");
- }
- return true;
- }
- stock UpdateBizzLabel(h)
- {
- if(BizzData[h][BizzType] == BIZZ_TYPE_STATIC && BizzData[h][IsSpecial] == 0) format(gstr, sizeof(gstr), "{FF0000}%s\n", BizzData[h][BizzDescription]);
- else
- {
- if(BizzData[h][EnterFee] >= 1) format(gstr, sizeof(gstr), "%s\nEntrance Fee: {FFFFFF}$%i", BizzData[h][BizzDescription], BizzData[h][EnterFee]);
- else format(gstr, sizeof(gstr), "%s", BizzData[h][BizzDescription]);
- }
- UpdateDynamic3DTextLabelText(BizzData[h][BizzLabel], COLOR_WHITE, gstr);
- return true;
- }
- stock IsMallBizz(bizzid)
- {
- switch(BizzData[bizzid][BizzSQLID])
- {
- case 195..204:
- {
- return true;
- }
- }
- return false;
- }
- stock ApplyBizzActorAnim(actorid, animid)
- {
- new x = animid;
- if(x != -1) ApplyActorAnimation(actorid, AnimData[x][AnimLibrary], AnimData[x][AnimationName], AnimData[x][AnimDelta], AnimData[x][AnimLoop], AnimData[x][AnimLockX], AnimData[x][AnimLockY], AnimData[x][AnimFreeze], AnimData[x][AnimTime]);
- return true;
- }
- stock SetActorSkin(actorid, skin)
- {
- new Float:x, Float:y, Float:z, Float:a, world;
- GetActorPos(actorid, x, y, z);
- GetActorFacingAngle(actorid, a);
- world = GetActorVirtualWorld(actorid);
- DestroyActor(actorid);
- actorid = CreateActor(skin, x, y, z, a);
- SetActorVirtualWorld(actorid, world);
- }
- stock SaveBizzActorData(bizz, actor)
- {
- new b = actor, sub[12], x = bizz;
- format(sub, sizeof(sub), "Actor%i", b + 1);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE bizz SET %s = '%i,%i,%f,%f,%f,%f,%i' WHERE id = %i",
- sub, BizzData[x][BizzActorSpawned][b], BizzData[x][BizzActorSkin][b], BizzData[x][BizzActorX][b], BizzData[x][BizzActorY][b], BizzData[x][BizzActorZ][b], BizzData[x][BizzActorAngle][b], BizzData[x][BizzActorAnim][b], BizzData[x][BizzSQLID]);
- mysql_pquery(conn, mquery);
- }
- stock DeleteBizzLabel(bizzid)
- {
- UpdateDynamic3DTextLabelText(BizzData[bizzid][BizzLabel], COLOR_WHITE, "");
- DestroyDynamic3DTextLabel(BizzData[bizzid][BizzLabel]);
- BizzData[bizzid][BizzLabel] = Text3D:INVALID_3DTEXT_ID;
- return true;
- }
- stock GetBizzLocation(bname[])
- {
- for(new i = 0; i < MAX_BIZZ; i++)
- {
- if(strfind(BizzData[i][BizzDescription], bname, true) != -1) return i;
- }
- return -1;
- }
- stock GetBizzIDFromSQL(id)
- {
- for(new b = 0; b < MAX_BIZZ; b++)
- {
- if(BizzData[b][BizzSQLID] == id) return b;
- }
- return -1;
- }
- stock ProcessBusinessKeys(playerid)
- {
- new bcount = 0;
- for(new b = 0; b < MAX_BIZZ; b++)
- {
- if(bcount == MAX_BIZZ_PER_PLAYER) break;
- if(BizzData[b][BizzOwnerSQLID] == SQLID[playerid])
- {
- PlayerBizzID[playerid][bcount] = b;
- bcount ++;
- }
- }
- return true;
- }
- stock GetBizzID(bizzname[])
- {
- new bizzid = -1;
- for(new b = 0; b < MAX_BIZZ; b++)
- {
- if(strcmp(bizzname, BizzData[b][BizzDescription], true) == 0 && strlen(BizzData[b][BizzDescription]) > 1)
- {
- bizzid = b;
- break;
- }
- }
- return bizzid;
- }
- stock IsBizzStockable(bizzid)
- {
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_GENERALSHOP_S) return 1800;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_GENERALSHOP_M) return 2100;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_GENERALSHOP_L) return 2400;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_CLOTHES_BINCO) return 3000;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_WEAPONS_1FLOOR) return 7500;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_CAFE) return 750;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_PIZZA) return 1350;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_CLUCKINBELL) return 1350;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_CLOTHES_SUBU) return 3300;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_CLOTHES_RICH) return 4500;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_WEAPONS_2FLOOR) return 9000;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_CLOTHES_PROLAPS) return 3900;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_ELECTRONICS) return 3750;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_SEX) return 6000;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_DRUGSHOP) return 4500;
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_CLOTHES_ZIP) return 3900;
- return false;
- }
- stock GetBizzDeliveryItem(bizzid)
- {
- new description[18];
- if(BizzData[bizzid][BizzType] == BIZZ_TYPE_GENERALSHOP_S) description = "Everyday Goods";
- else if(BizzData[bizzid][BizzType] == BIZZ_TYPE_GENERALSHOP_M) description = "Everyday Goods";
- else if(BizzData[bizzid][BizzType] == BIZZ_TYPE_GENERALSHOP_L) description = "Everyday Goods";
- else if(BizzData[bizzid][BizzType] == BIZZ_TYPE_CLOTHES_BINCO) description = "Clothes";
- else if(BizzData[bizzid][BizzType] == BIZZ_TYPE_WEAPONS_1FLOOR) description = "Weapon Ammo";
- else if(BizzData[bizzid][BizzType] == BIZZ_TYPE_CAFE) description = "Food";
- else if(BizzData[bizzid][BizzType] == BIZZ_TYPE_PIZZA) description = "Food";
- else if(BizzData[bizzid][BizzType] == BIZZ_TYPE_CLUCKINBELL) description = "Food";
- else if(BizzData[bizzid][BizzType] == BIZZ_TYPE_CLOTHES_SUBU) description = "Clothes";
- else if(BizzData[bizzid][BizzType] == BIZZ_TYPE_CLOTHES_RICH) description = "Clothes";
- else if(BizzData[bizzid][BizzType] == BIZZ_TYPE_WEAPONS_2FLOOR) description = "Weapon Ammo";
- else if(BizzData[bizzid][BizzType] == BIZZ_TYPE_CLOTHES_PROLAPS) description = "Clothes";
- else if(BizzData[bizzid][BizzType] == BIZZ_TYPE_ELECTRONICS) description = "Electronics";
- else if(BizzData[bizzid][BizzType] == BIZZ_TYPE_SEX) description = "Sex Toys";
- else if(BizzData[bizzid][BizzType] == BIZZ_TYPE_DRUGSHOP) description = "Medical Supplies";
- else description = "Goods";
- return description;
- }
- stock RefreshBizzActors()
- {
- for(new b = 0; b < MAX_BIZZ; b++)
- {
- for(new a = 0; a < 4; a++)
- {
- if(BizzData[b][BizzActorSpawned][a] == 1)
- {
- DestroyActor(BizzData[b][BizzActor][a]);
- BizzData[b][BizzActor][a] = CreateActor(BizzData[b][BizzActorSkin][a], BizzData[b][BizzActorX][a], BizzData[b][BizzActorY][a], BizzData[b][BizzActorZ][a], BizzData[b][BizzActorAngle][a]);
- SetActorInvulnerable(BizzData[b][BizzActor][a], true);
- SetActorVirtualWorld(BizzData[b][BizzActor][a], BizzData[b][BizzVW]);
- ApplyBizzActorAnim(BizzData[b][BizzActor][a], BizzData[b][BizzActorAnim][a]);
- }
- }
- }
- return true;
- }
- stock InitiateAdminJail(adminid, playerid)
- {
- if(InvalidPlayer(playerid) || !Logged{playerid}) return SysMsg(adminid,"That player is not connected and logged in.");
- if(IsPlayerNPC(playerid)) return SysMsg(adminid,"That player is a NPC.");
- if(IsDragging[adminid] == playerid) return SysMsg(adminid,"You can't jail the person you are dragging.");
- if(AdminJailData[playerid][0] == 1) return SysMsg(adminid,"That player is already in the Admin Jail.");
- if(IsPlayerAdminLevelOK(playerid, 1)) return SysMsg(adminid,"You may not Admin Jail an Admin.");
- AJailingPlayer[adminid] = playerid;
- gstr[0] = EOS;
- new caption[100];
- strcat(gstr, "{FFFFFF}Non-RP Swimming {FFA900}(20 min)\n");
- strcat(gstr, "{FFFFFF}Non-RPly changing clothes {FFA900}(20 min)\n");
- strcat(gstr, "{FFFFFF}Non-RP Driving {FFA900}(40 min)\n");
- strcat(gstr, "{FFFFFF}Asspulling {FFA900}(25 min)\n");
- strcat(gstr, "{FFFFFF}Using side job vehicles for personal use {FFA900}(15 min)\n");
- strcat(gstr, "{FFFFFF}Bunnyhopping {FFA900}(25 min)\n");
- strcat(gstr, "{FFFFFF}Mixing {FFA900}(40 min)\n");
- strcat(gstr, "{FFFFFF}Non-RP driving {FFA900}(40 min)\n");
- strcat(gstr, "{FFFFFF}Not roleplaying injuries {FFA900}(40 min)\n");
- strcat(gstr, "{FFFFFF}Not roleplaying an accident {FFA900}(40 min)\n");
- strcat(gstr, "{FFFFFF}Non-RP car jacking {FFA900}(30 min)\n");
- strcat(gstr, "{FFFFFF}Scamming a low level player {FFA900}(20 min)\n");
- strcat(gstr, "{FFFFFF}Robbing low level player {FFA900}(20 min)\n");
- strcat(gstr, "{FFD700}Other please specify.. {FFA900}(10 min)\n");
- strcat(gstr, "{FFD700}Other please specify.. {FFA900}(20 min)\n");
- strcat(gstr, "{FFD700}Other please specify.. {FFA900}(30 min)\n");
- strcat(gstr, "{FFD700}Other please specify.. {FFA900}(40 min)\n");
- strcat(gstr, "{FFD700}Other please specify.. {FFA900}(50 min)\n");
- strcat(gstr, "{FFD700}Other please specify.. {FFA900}(60 min)\n");
- strcat(gstr, "{FFD700}Other please specify.. {FFA900}(70 min)\n");
- strcat(gstr, "{FFD700}Other please specify.. {FFA900}(80 min)\n");
- strcat(gstr, "{FFD700}Other please specify.. {FFA900}(90 min)");
- format(caption, sizeof(caption), "{FF4753} Put {FFFFFF}%s(ID %i){FF4753} in Admin Jail", NameEx(playerid), playerid);
- Dialog_Show(adminid, AjailList, DIALOG_STYLE_LIST, caption, gstr, "Continue", "Cancel");
- return true;
- }
- stock AdminBroadcast(message[], tog, level = 1)
- {
- foreach(new i: Player)
- {
- if(AdminLevel[i] >= level)
- {
- if(tog == 1 && !AdminMsgToggle{i}) continue;
- SendSplitMessage(i, COLOR_RED, message);
- }
- }
- //IRC_SayF(IRCBot, IRC_ADMIN_CHANNEL, "4%s", message);
- //IRC_SayF(IRCTestBot, IRC_ADMIN_CHANNEL, "4%s", message);
- return true;
- }
- stock CoolPersonList(playerid)
- {
- if(SQLID[playerid] == 45599) return true;
- if(SQLID[playerid] == 53447) return true;
- if(SQLID[playerid] == 97783) return true;
- if(SQLID[playerid] == 102200) return true;
- return false;
- }
- stock PlayerStopEditingObject(playerid)
- {
- if(IsInHouseID[playerid] == -1) return true;
- if(!EditingAttachedObject[playerid]) return true;
- if(!GetPVarInt(playerid, "SelectingAnnoyingObject")) return true;
- if(!SelectingRoadblock{playerid}) return true;
- if(!RemovingRoadblock{playerid}) return true;
- if(!GetPVarInt(playerid, "FindingObject")) return true;
- return false;
- }
- stock pMinute(playerid)
- {
- if(Logged{playerid})
- {
- if(IsInHouseID[playerid] == -1 && IsInBizzID[playerid] == -1)
- {
- SetPlayerTime(playerid, gServerHour, gServerMinute);
- }
- if(!IsAFK{playerid})
- {
- TimeOnline[playerid] ++;
- TotalTimePlayed[playerid] ++;
- }
- ConnectedTime[playerid] ++;
- if(TotalTimePlayed[playerid] >= 60)
- {
- UnlockAchievement(playerid, 16);
- if(TotalTimePlayed[playerid] >= 500)
- {
- UnlockAchievement(playerid, 17);
- if(TotalTimePlayed[playerid] >= 40000)
- {
- UnlockAchievement(playerid, 30);
- }
- if(TotalTimePlayed[playerid] >= 50000)
- {
- UnlockAchievement(playerid, 68);
- }
- if(TotalTimePlayed[playerid] >= 100000)
- {
- UnlockAchievement(playerid, 69);
- }
- if(TotalTimePlayed[playerid] >= 150000)
- {
- UnlockAchievement(playerid, 70);
- }
- if(TotalTimePlayed[playerid] >= 200000)
- {
- UnlockAchievement(playerid, 71);
- }
- if(TotalTimePlayed[playerid] >= 300000)
- {
- UnlockAchievement(playerid, 72);
- }
- }
- }
- if(TruckSpamTime[playerid] > 0)
- {
- TruckSpamTime[playerid] --;
- }
- if(ET_GetOutTime[playerid] > 0)
- {
- ET_GetOutTime[playerid] --;
- if(ET_GetOutTime[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "You have got out the Truck so the job has been cancelled.");
- DisablePlayerCheckpoint(playerid);
- TruckIndex[playerid] = 0;
- IsTrucking[playerid] = 0;
- EmptyTruckingTrailer(TruckingTrailer[playerid]);
- DestroyVehicleEx(TruckingTrailer[playerid], "TruckingTrailer[playerid] 2");
- TruckingTrailer[playerid] = 0;
- }
- else
- {
- format(gstr, sizeof(gstr),"You must return to your truck within {FF0000}%i{FFFFFF} minutes to continue the job.", ET_GetOutTime[playerid]);
- SendClientMessage(playerid,COLOR_WHITE,gstr);
- }
- }
- if(DeliverSpamTime[playerid] > 0)
- {
- DeliverSpamTime[playerid] --;
- }
- if(TrashSpamTime[playerid] > 0)
- {
- TrashSpamTime[playerid] --;
- }
- if(CoalmineSpamTime[playerid] > 0)
- {
- CoalmineSpamTime[playerid] --;
- }
- if(VehicleBorrowKeyTime[playerid] > 0)
- {
- VehicleBorrowKeyTime[playerid] --;
- if(VehicleBorrowKeyTime[playerid] == 0)
- {
- VehicleBorrowKey[playerid] = 0;
- SendClientMessage(playerid, COLOR_YELLOW, "You no longer have your shared vehicle key. Your time limit has expired.");
- }
- }
- if(RentalCar[playerid] != 0)
- {
- RentalTime[playerid]++;
- if(RentalTime[playerid] == 60)
- {
- if(RentalRevoked{playerid})
- {
- new Float:xx,Float:yy,Float:zz, zzone[MAX_ZONE_NAME], color[2];
- GetPlayerPos(playerid,xx,yy,zz); GetPlayer2DZone(playerid,zzone,MAX_ZONE_NAME);
- GetVehicleColors(RentalCar[playerid], color[0], color[1]);
- SendClientMessage(playerid, COLOR_SKYBLUE, "[Text From County Rentals] Where the hell's our car?! You better get it back here before we get the police involved!");
- foreach(new t: Player)
- {
- if(Logged{t} && Faction[t] == FACTION_COP && Duty[t] == 1 && RadioPoweredOn[t] == 1)
- {
- format(gstr, sizeof(gstr), "[Radio - %i MHz] Dispatcher: Any units in the area of %s respond to a car theft.", FACTIONS[FACTION_COP][FactionRadioChannel], zzone);
- SendSplitRadioMessage(t, 0x967100FF, gstr);
- format(gstr, sizeof(gstr), "[Radio - %i MHz] Details: A man by the name of %s failed to pay for their rental car and hasn't brought it back yet. He's driving a(n) %s %s with the license plate %s.", FACTIONS[FACTION_COP][FactionRadioChannel], NameEx(playerid), VehicleColors[color[0]], GetVehicleName(RentalCar[playerid]), RentalData[RentalCar[playerid]][RentalPlate]);
- SendSplitRadioMessage(t, 0x967100FF, gstr);
- }
- }
- }
- else if(Cash[playerid] < RentalData[RentalCar[playerid]][RentalPrice])
- {
- RentalTime[playerid] = 0;
- RentalRevoked{playerid} = true;
- SendSplitMessage(playerid, COLOR_SKYBLUE, "[Text From County Rentals] It seems you don't have enough money to pay for your rental vehicle. Please bring it back to the lot within an hour. Thanks!");
- }
- else
- {
- RentalTime[playerid] = 0;
- GivePlayerCash(playerid, -RentalData[RentalCar[playerid]][RentalPrice]);
- SendClientMessageF(playerid, COLOR_SKYBLUE, "[Text From County Rentals] You've been charged an additional $%s to use our %s for another hour.", format_cash(RentalData[RentalCar[playerid]][RentalPrice]), GetVehicleName(RentalCar[playerid]));
- }
- }
- }
- if(IsAFK{playerid})
- {
- AwayMinutes[playerid]++;
- TogglePlayerControllable(playerid, 0);
- if(strcmp(AFKReason[playerid], "None", true) == 0) format(gstr, sizeof(gstr), "[Away From Keyboard]\nAway for %i minutes", AwayMinutes[playerid]);
- else format(gstr, sizeof(gstr), "[Away From Keyboard]\nAway for %i minutes\nReason: %s", AwayMinutes[playerid], AFKReason[playerid]);
- UpdateDynamic3DTextLabelText(AFK_Label[playerid], COLOR_GREEN, gstr);
- if(AwayMinutes[playerid] > 30)
- {
- if(AdminLevel[playerid] == 0)
- {
- IsAFK{playerid} = false;
- AFKReason[playerid][0] = EOS;
- AwayMinutes[playerid] = 0;
- format(gstr, sizeof(gstr),"[Auto Kick] Kicked %s (Reason: AFK time limit reached)",NameEx(playerid));
- SendClientMessageToAllLogged(COLOR_RED,gstr);
- KickPlayer(playerid, 18);
- }
- else
- {
- if(AwayMinutes[playerid] > 45 && !IsPlayerAdmin(playerid))
- {
- IsAFK{playerid} = false;
- AFKReason[playerid][0] = EOS;
- AwayMinutes[playerid] = 0;
- format(gstr, sizeof(gstr),"[Auto Kick] Kicked %s (Reason: Admin AFK time limit reached)",NameEx(playerid));
- SendClientMessageToAllLogged(COLOR_RED,gstr);
- KickPlayer(playerid, 19);
- }
- }
- }
- }
- else
- {
- if(IsPlayerMasked{playerid}) FormatHealthLabelText(playerid, HealthVar[playerid], ArmourVar[playerid], 2);
- }
- if(JobSpamTime[playerid] > 0)
- {
- JobSpamTime[playerid] --;
- }
- if(Muted[playerid] > 0)
- {
- Muted[playerid] --;
- if(Muted[playerid] == 0) SysMsg(playerid, "You are now unmuted.");
- }
- if(DOOCMuted[playerid] > 0)
- {
- DOOCMuted[playerid] --;
- if(DOOCMuted[playerid] == 0) SysMsg(playerid, "You are now unmuted from the Donator OOC Chat.");
- }
- if(AdminHidden[playerid]) mysql_pqueryf(conn, "UPDATE masters SET IncognitoTime = IncognitoTime + 1 WHERE id = %i", MasterAccount[playerid]);
- if(IsPlayerAdminLevelOK(playerid, 1) && ADuty[playerid] == 1)
- {
- if(IsPlayerPaused(playerid) && IsAFK{playerid})
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE masters SET AFKDutyTime = AFKDutyTime + 1 WHERE id = %i", MasterAccount[playerid]);
- mysql_pquery(conn, mquery);
- }
- }
- if(IsJailed[playerid] == 1 && JailTime[playerid] > 0)
- {
- JailTime[playerid] --;
- if(JailTime[playerid] == 0) UnJailPlayer(playerid);
- else SysMsgF(playerid, "Faltam %i antes de sair da prisão.", JailTime[playerid]);
- }
- if(PlayerImprisoned{playerid} && PrisonTime[playerid] > 0)
- {
- if(AdminJailData[playerid][0] == 0)
- {
- PrisonTime[playerid] --;
- }
- if(PrisonTime[playerid] == 0)
- {
- ReleaseFromPrison(playerid);
- SysMsg(playerid, "You have %i minutes left in Jail.");
- }
- }
- if(Isolated[playerid] == 1 && IsolationTime[playerid] > 0)
- {
- IsolationTime[playerid] --;
- if(IsolationTime[playerid] == 0)
- {
- ReleaseFromIsolation(playerid);
- SysMsg(playerid, "You have completed your prison sentence.");
- }
- }
- if(AdminJailData[playerid][0] == 1 && AdminJailData[playerid][1] > 0)
- {
- AdminJailData[playerid][1] --;
- if(AdminJailData[playerid][1] == 0) AUnJailPlayer(playerid);
- else
- {
- SysMsgF(playerid, "You have %i minutes left in the Admin Jail.", AdminJailData[playerid][1]);
- MySQLUpdateInt(SQLID[playerid], "AdminJailTime", AdminJailData[playerid][1], "players");
- }
- }
- if(LicenseSuspendTime[playerid][LICENSE_CAR] > 0) LicenseSuspendTime[playerid][LICENSE_CAR] --;
- if(LicenseSuspendTime[playerid][LICENSE_LGV] > 0) LicenseSuspendTime[playerid][LICENSE_LGV] --;
- if(LicenseSuspendTime[playerid][LICENSE_BIKE] > 0) LicenseSuspendTime[playerid][LICENSE_BIKE] --;
- if(LicenseSuspendTime[playerid][LICENSE_BOAT] > 0) LicenseSuspendTime[playerid][LICENSE_BOAT] --;
- if(LicenseSuspendTime[playerid][LICENSE_HELI] > 0) LicenseSuspendTime[playerid][LICENSE_HELI] --;
- if(LicenseSuspendTime[playerid][LICENSE_PLANE] > 0)LicenseSuspendTime[playerid][LICENSE_PLANE] --;
- if(ADuty[playerid] == 1)
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE masters SET DutyTime = DutyTime + 1, AdminScore = AdminScore + 1 WHERE id = %i", MasterAccount[playerid]);
- mysql_pquery(conn, mquery);
- }
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET JailTime = %i, PrisonTime = %i, AdminJailTime = %i, LicenseSuspendTime_Car = %i, LicenseSuspendTime_LargeVehicle = %i, LicenseSuspendTime_Bike = %i, LicenseSuspendTime_Boat = %i, LicenseSuspendTime_Helicopter = %i,LicenseSuspendTime_Plane = %i, IsolationTime = %i WHERE id = %i",
- JailTime[playerid], PrisonTime[playerid], AdminJailData[playerid][1], LicenseSuspendTime[playerid][LICENSE_CAR], LicenseSuspendTime[playerid][LICENSE_LGV], LicenseSuspendTime[playerid][LICENSE_BIKE],
- LicenseSuspendTime[playerid][LICENSE_BOAT], LicenseSuspendTime[playerid][LICENSE_HELI], LicenseSuspendTime[playerid][LICENSE_PLANE], IsolationTime[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- for(new x = 0; x < MAX_HOUSE_PER_PLAYER; x++)
- {
- if(HasHouseKey[playerid][x] != -1)
- {
- new lighting, newGrowth, thirsty, h = HasHouseKey[playerid][x];
- for(new weed = 0; weed < MAX_WEED_PLANTS; weed++)
- {
- if(WeedData[h][PlantPotObj][weed] == HouseData[h][FurnObject][WeedData[h][PlantFurnIndex][weed]])
- {
- lighting = CalculateWeedLight(h, WeedData[h][PlantPotObj][weed]);
- newGrowth = GetWeedGrowthAmount(WeedData[h][PlantWater][weed], lighting);
- switch(random(8))
- {
- case 0: thirsty = 15;
- case 1: thirsty = 13;
- case 2: thirsty = 10;
- case 3: thirsty = 6;
- case 4: thirsty = 5;
- case 5: thirsty = 4;
- default: thirsty = 3;
- }
- WeedData[h][PlantGrowth][weed] += newGrowth;
- WeedData[h][PlantWater][weed] -= thirsty;
- if(WeedData[h][PlantWater][weed] < 0) WeedData[h][PlantWater][weed] = 0;
- if(WeedData[h][PlantGrowth][weed] > 1000) WeedData[h][PlantGrowth][weed] = 1000;
- SaveWeedPlant(h, weed);
- new furn = WeedData[h][PlantFurnIndex][weed];
- if(WeedData[h][PlantGrowth][weed] > 300 && HouseData[h][FurnModel][furn] != WEED_OBJECT_GROWN)
- {
- new Float:plantPos[6];
- GetDynamicObjectPos(WeedData[h][PlantPotObj][weed], plantPos[0], plantPos[1], plantPos[2]);
- GetDynamicObjectRot(WeedData[h][PlantPotObj][weed], plantPos[3], plantPos[4], plantPos[5]);
- DestroyDynamicObjectEx(HouseData[h][FurnObject][furn], "HouseData[h][FurnObject][furn] 0");
- HouseData[h][FurnObject][furn] = CreateDynamicObject(WEED_OBJECT_GROWN, plantPos[0], plantPos[1], plantPos[2]+0.134, plantPos[3], plantPos[4], plantPos[5], HouseData[h][HouseVW]);
- HouseData[h][FurnModel][furn] = WEED_OBJECT_GROWN;
- WeedData[h][PlantPotObj][weed] = HouseData[h][FurnObject][furn];
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE hfurniture SET Model = %i WHERE id = %i", WEED_OBJECT_GROWN, HouseData[h][FurnSQLID][furn]);
- mysql_pquery(conn, mquery);
- }
- }
- }
- }
- }
- }
- return true;
- }
- stock randomEx(minnum = cellmin, maxnum = cellmax)
- {
- return random(maxnum - minnum + 1) + minnum;
- }
- stock QuickPCount()
- {
- foreach(new i: Player)
- {
- if(IsEditingHolster[i] == 0)
- {
- for(new weap = 7; weap < 10; weap++)
- {
- if(GetPlayerWeapon(i) >= 1)
- {
- if(AttachedObjects[i][weap][aoModelID] == dropObjectID[GetPlayerWeapon(i)])
- {
- if(IsHolstered[i][GetWeaponSlot(GetPlayerWeapon(i))] == 0)
- {
- RemovePlayerAttachedObject(i, weap);
- AttachedObjects[i][weap][aoBone] = 0;
- IsHolstered[i][GetWeaponSlot(GetPlayerWeapon(i))] = 1;
- break;
- }
- }
- }
- }
- }
- if(IsPlayerInAnyVehicle(i))
- {
- if(GetPlayerWeapon(i) == 24 || GetPlayerWeapon(i) == 27)
- {
- IsHolstered[i][GetWeaponSlot(GetPlayerWeapon(i))] = 1;
- SetPlayerArmedWeapon(i, 0);
- }
- if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
- {
- new Veh = GetPlayerVehicleID(i), col[4], Speed;
- if(SpeedFormat[i] == 0)
- {
- Speed = GetVehicleSpeed(Veh, 0);
- if(SpeedoActive[i] == 1)
- {
- if(Speed <= 60) format(col, 4, "~w~");
- else format(col, 4, "~r~");
- if(VehicleData[Veh][VehicleOwnerSQLID] > 0)
- {
- VehicleData[Veh][Mileage] += (Speed * 0.00009722222);
- format(tgstr, sizeof(tgstr), "~w~%s%i MPH", col, Speed);//Velocimetro
- format(ttgstr, sizeof(ttgstr), "~w~%i", floatround(VehicleData[Veh][Mileage]));
-
- }
- else if(RentalData[Veh][CarID] >= 1)
- {
- RentalData[Veh][CarMileage] += (Speed * 0.00009722222);
- format(tgstr, sizeof(tgstr), "~w~%s%i MPH", col, Speed);//Velocimetro
- format(ttgstr, sizeof(ttgstr), "~w~%i", floatround(RentalData[Veh][CarMileage]));
- }
- else {
- VehicleData[Veh][Mileage] += (Speed * 0.00009722222);
- format(tgstr, sizeof(tgstr), "~w~%s%i MPH", col, Speed);
- format(ttgstr, sizeof(ttgstr), "~w~%i", floatround(VehicleData[Veh][Mileage]));
- }
- PlayerTextDrawSetString(i, SpeedText[i], tgstr);
- PlayerTextDrawSetString(i, SpeedTextM[i], ttgstr);
- PlayerTextDrawShow(i, SpeedTextM[i]);
- PlayerTextDrawShow(i, SpeedText[i]);
- PlayerTextDrawShow(i, Speedo3dl[i]);
-
- }
- }
- else if(SpeedFormat[i] == 1)
- {
- Speed = GetVehicleSpeed(Veh, 1);
- if(SpeedoActive[i] == 1)
- {
- if(Speed <= 96) format(col, 4, "~w~");
- else format(col, 4, "~r~");
- if(VehicleData[Veh][VehicleOwnerSQLID] > 0)
- {
- VehicleData[Veh][Mileage] += (Speed * 0.00009722222);
- format(tgstr, sizeof(tgstr), "~w~%s%i KM/H", col, Speed);
- format(ttgstr, sizeof(ttgstr), "~w~%i", floatround(VehicleData[Veh][Mileage] * 1.621371192));
- }
- else if(RentalData[Veh][CarID] >= 1)
- {
- RentalData[Veh][CarMileage] += (Speed * 0.00009722222);
- format(tgstr, sizeof(tgstr), "~w~%s%i MPH", col, Speed);//Velocimetro
- format(ttgstr, sizeof(ttgstr), "~w~%i", floatround(RentalData[Veh][CarMileage] * 1.621371192));
- }
- else {
- VehicleData[Veh][Mileage] += (Speed * 0.00009722222);
- format(tgstr, sizeof(tgstr), "~w~%s%i KM/H", col, Speed);
- format(ttgstr, sizeof(ttgstr), "~w~%i", floatround(VehicleData[Veh][Mileage] * 1.621371192));
- }
- PlayerTextDrawSetString(i, SpeedTextM[i], ttgstr);
- PlayerTextDrawShow(i, SpeedTextM[i]);
- PlayerTextDrawSetString(i, SpeedText[i], tgstr);
- PlayerTextDrawShow(i, SpeedText[i]);
- PlayerTextDrawSetString(i, Speedo3dl[i], tgstr);
- PlayerTextDrawShow(i, Speedo3dl[i]);
- }
- }
- }
- }
- if(IsDragging[i] != -1)
- {
- new Float:X, Float:Y, Float:Z, Float:Ang, Interior, VW;
- Interior = GetPlayerInterior(i);
- VW = GetPlayerVirtualWorld(i);
- GetPlayerPos(i, X, Y, Z);
- GetPlayerFacingAngle(i, Ang);
- X += (0.75 * -floatsin(-Ang, degrees));
- Y += (0.75 * -floatcos(-Ang, degrees));
- SetPlayerPos(IsDragging[i], X, Y, Z);
- if(GetPlayerInterior(IsDragging[i]) != Interior) SetPlayerInterior(IsDragging[i], Interior);
- if(GetPlayerVirtualWorld(IsDragging[i]) != VW) SetPlayerVirtualWorldEx(IsDragging[i], VW);
- IsInHouseID[IsDragging[i]] = IsInHouseID[i];
- IsInBizzID[IsDragging[i]] = IsInBizzID[i];
- IsInGarageID[IsDragging[i]] = IsInGarageID[i];
- JourneyInterior[IsDragging[i]] = JourneyInterior[i];
- ShamalInterior[IsDragging[i]] = ShamalInterior[i];
- TropicInterior[IsDragging[i]] = TropicInterior[i];
- TrailerInterior[IsDragging[i]] = TrailerInterior[i];
- }
- if(StretcherEquipped[i] > 0 && StretcherPlayerID[i] >= 0)
- {
- if(IsPlayerConnected(StretcherPlayerID[i]))
- {
- new Float:playerpos[4];
- TogglePlayerControllable(StretcherPlayerID[i], 0);
- GetPlayerFacingAngle(i, playerpos[3]);
- SetPlayerFacingAngle(StretcherPlayerID[i], playerpos[3]);
- GetPlayerPos(i, playerpos[0], playerpos[1], playerpos[2]);
- GetXYInFrontOfPlayer(i, playerpos[0], playerpos[1], 2.0);
- SetPlayerPos(StretcherPlayerID[i], playerpos[0], playerpos[1], playerpos[2] + 0.5);
- SetCameraBehindPlayer(StretcherPlayerID[i]);
- SetPlayerVirtualWorldEx(StretcherPlayerID[i], GetPlayerVirtualWorld(i));
- SetPlayerInterior(StretcherPlayerID[i], GetPlayerInterior(i));
- OnePlayAnim(StretcherPlayerID[i],"BEACH", "bather", 4.0, 1, 0, 0, 1, -1);
- }
- else StretcherPlayerID[i] = -1;
- }
- }
- return true;
- }
- stock pSecond() //player second
- {
- foreach(new playerid: Player)
- {
- if(Logged{playerid})
- {
- pTimerCount[playerid]++;
- pTCount[playerid]++;
- if(pTimerCount[playerid] >= 60)
- {
- pTimerCount[playerid] = 0;
- pMinute(playerid);
- }
- if(!IsAFK{playerid}) DeleteAFKLabel(playerid);
- AFKSeconds[playerid] ++;
- new nametag[128];
- if(ADuty[playerid] == 1)
- {
- if(AFKSeconds[playerid] >= 2)
- {
- format(nametag, sizeof(nametag), "{%06x}%s {FFFFFF}(%d) {FF0000}[P]", GetPlayerColor(playerid) >>> 8, MasterAccountName[playerid], playerid);
- }
- else format(nametag, sizeof(nametag), "{%06x}%s {FFFFFF}(%d)", GetPlayerColor(playerid) >>> 8, MasterAccountName[playerid], playerid);
- }
- else
- {
- if(!MaskHideName{playerid}) {
- if(AFKSeconds[playerid] >= 2)
- {
- format(nametag, sizeof(nametag), "{%06x}%s {FFFFFF}(%d) {FF0000}[P]", GetPlayerColor(playerid) >>> 8, GetRPName(playerid), playerid);
- }
- else format(nametag, sizeof(nametag), "{%06x}%s {FFFFFF}(%d)", GetPlayerColor(playerid) >>> 8, GetRPName(playerid), playerid);
- } else nametag = "";
- }
- UpdateDynamic3DTextLabelText(NameTag[playerid], 0xFFFFFFFF, nametag);
- if(CallerID[playerid] != -1 || IsPhoneRinging[playerid] >= 0 && CallerID[playerid] != -1)
- {
- if(!HasPhoneSignal(playerid))
- {
- new playa = CallerID[playerid];
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USECELLPHONE)
- {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
- AttachedObjects[playerid][6][aoModelID] = 0;
- AttachedObjects[playerid][6][aoBone] = 0;
- RemovePlayerAttachedObject(playerid, 6);
- }
- if(GetPlayerSpecialAction(playa) == SPECIAL_ACTION_USECELLPHONE)
- {
- SetPlayerSpecialAction(playa, SPECIAL_ACTION_STOPUSECELLPHONE);
- AttachedObjects[playa][6][aoModelID] = 0;
- AttachedObjects[playa][6][aoBone] = 0;
- RemovePlayerAttachedObject(playa, 6);
- }
- SendClientMessage(playa, COLOR_GREY, "[Cellphone] {87CEFF}The line suddenly cuts out...");
- SendClientMessage(playerid, COLOR_GREY, "[Cellphone] {87CEFF}Your phone loses signal, as such you hang it up.");
- format(sgstr, sizeof(sgstr),"* %s puts their phone away as they lose signal. *",NameRP(playerid));
- SetPlayerChatBubble(playerid, sgstr, COLOR_EMOTE, 15.0, 6000);
- format(sgstr, sizeof(sgstr),"* %s puts their phone away. *",NameRP(playa));
- SetPlayerChatBubble(playa, sgstr, COLOR_EMOTE, 15.0, 6000);
- MobileSpeaker[playerid] = 0;
- CallerID[playerid] = -1;
- CallerID[playa] = -1;
- IsPhoneRinging[playerid] = -1;
- IsPhoneRinging[playa] = -1;
- }
- }
- JustDeletedVehicle{playerid} = false;
- if(JustEnteredVehicle[playerid] != 0) JustEnteredVehicle[playerid]--;
- foreach(new p: Player)
- {
- if(IsPlayerInRangeOfPoint(playerid, Boomboxes[p][BoomRange], Boomboxes[p][BoomPos][0], Boomboxes[p][BoomPos][1], Boomboxes[p][BoomPos][2]) && GetPlayerVirtualWorld(playerid) == 0)
- {
- if(Boomboxes[p][BoomOID] >= 1 && !IsPlayerInAnyVehicle(playerid) && strlen(Boomboxes[p][BoomStation]) >= 6 && Boomboxes[p][BoomIsPlaying] && ListeningBoom[playerid] != p)
- {
- ListeningBoom[playerid] = p;
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayerEx(playerid, Boomboxes[p][BoomStation], Boomboxes[p][BoomPos][0], Boomboxes[p][BoomPos][1], Boomboxes[p][BoomPos][2], Boomboxes[p][BoomRange], 1);
- }
- }
- }
- if(IsPlayerAdminLevelOK(playerid, 1))
- {
- if(ADuty[playerid] == 1)
- {
- if(AssistCount > 0) TextDrawShowForPlayer(playerid, AssistTD) && TextDrawShowForPlayer(playerid, AssistTD3dl);
- else TextDrawHideForPlayer(playerid, AssistTD) && TextDrawHideForPlayer(playerid, AssistTD3dl);
- if(ARCount > 0) TextDrawShowForPlayer(playerid, AdminRequestTD) && TextDrawShowForPlayer(playerid, AdminRequestTD3dl);
- else TextDrawHideForPlayer(playerid, AdminRequestTD) && TextDrawHideForPlayer(playerid, AdminRequestTD3dl);
- }
- else if(ADuty[playerid] == 0)
- {
- TextDrawHideForPlayer(playerid, AssistTD) && TextDrawHideForPlayer(playerid, AssistTD3dl);
- TextDrawHideForPlayer(playerid, AdminRequestTD) && TextDrawHideForPlayer(playerid, AdminRequestTD3dl);
- }
- }
- else if(IsHelper{playerid})
- {
- if(AssistCount > 0) TextDrawShowForPlayer(playerid, AssistTD) && TextDrawShowForPlayer(playerid, AssistTD3dl);
- else TextDrawHideForPlayer(playerid, AssistTD) && TextDrawHideForPlayer(playerid, AssistTD3dl);
- TextDrawHideForPlayer(playerid, AdminRequestTD) && TextDrawHideForPlayer(playerid, AdminRequestTD3dl);
- }
- else
- {
- TextDrawHideForPlayer(playerid, AssistTD);
- TextDrawHideForPlayer(playerid, AssistTD3dl);
- TextDrawHideForPlayer(playerid, AdminRequestTD);
- TextDrawHideForPlayer(playerid, AdminRequestTD3dl);
- }
- if(Siren{GetPlayerVehicleID(playerid)} || ELMs{GetPlayerVehicleID(playerid)})
- {
- for(new x = 0; x < sizeof(PaytollPos); x++)
- {
- if(PayTolls[x][1] == 1) continue;
- if(PayTollTimer[x] != -1) continue;
- new Float:rot[3], Float:pos[3], Float:a;
- GetDynamicObjectPos(PayTolls[x][0], pos[0], pos[1], pos[2]);
- GetDynamicObjectRot(PayTolls[x][0], rot[0], rot[1], rot[2]);
- if(rot[1] > 90) continue;
- new v = GetPlayerVehicleID(playerid);
- if(IsVehicleSpawned(v))
- {
- if(IsVehicleInRangeOfPoint(v, 50.0, PaytollPos[x][0], PaytollPos[x][1], PaytollPos[x][2]))
- {
- GetVehicleZAngle(v, a);
- if(a < 265.6862 && a > 131.1006)
- {
- if(x == 1 || x == 3)
- {
- MoveDynamicObject(PayTolls[x][0], pos[0], pos[1], pos[2]+0.001, 0.0007, rot[0], 0.0, rot[2]);
- PayTolls[x][1] = 1;
- KillTimer(PaytollCloseTimer[x]);
- PaytollCloseTimer[x] = SetTimerEx("CloseTollGate", 8000, 0, "df", x, 90.0);
- break;
- }
- }
- else if((a > 306.2560 && a < 360.0) || (a > 0.00 && a < 67.00))
- {
- if(x == 0 || x == 2)
- {
- MoveDynamicObject(PayTolls[x][0], pos[0], pos[1], pos[2]+0.001, 0.0007, rot[0], 0.0, rot[2]);
- PayTolls[x][1] = 1;
- KillTimer(PaytollCloseTimer[x]);
- PaytollCloseTimer[x] = SetTimerEx("CloseTollGate", 8000, 0, "df", x, 90.0);
- break;
- }
- }
- }
- }
- }
- }
- new vehicleid = GetPlayerVehicleID(playerid);
- new pstate = GetPlayerState(playerid);
- new Float: Health, Float:Armour;
- GetPlayerHealth(playerid, Health);
- GetPlayerArmour(playerid, Armour);
- if(Health < 50 && !Dead{playerid} && HitCount[playerid] != 0 && HasGunshotWound(playerid))
- {
- if(pTimerCount[playerid] == 30 || pTimerCount[playerid] == 0)
- {
- if(IsHeadshotted(playerid)) Health -= 5.0;
- else Health -= 2.0;
- if(Health <= 0.0) MakePlayerDead2(playerid);
- else SetPlayerHealthEx(playerid, Health);
- }
- }
- if(vehicleid <= 0)
- {
- //PlayerTextDrawHide(playerid, FuelText[playerid]);
- HideFuelTDForPlayer(playerid);
- PlayerTextDrawHide(playerid, SpeedText[playerid]);
- PlayerTextDrawHide(playerid, SpeedTextM[playerid]);
- PlayerTextDrawHide(playerid, Speedo3dl[playerid]);
- OcultarVeh03DL(playerid);
- TextDrawHideForPlayer(playerid, texmilhas3dl);
- TextDrawHideForPlayer(playerid, luzesTxD3dl);
- TextDrawHideForPlayer(playerid, texmilhas3dl1);
- TextDrawHideForPlayer(playerid, VehicleEngineText);
- TextDrawHideForPlayer(playerid, lockedTxD3dl);
- TextDrawHideForPlayer(playerid, unlockedTxD3dl);
- foreach(new p: Player)
- {
- if(IsSpectating[p] == playerid)
- {
- PlayerTextDrawHide(p, SpeedText[playerid]);
- PlayerTextDrawHide(p, SpeedTextM[playerid]);
- PlayerTextDrawHide(p, Speedo3dl[playerid]);
- }
- }
- }
- if(VehicleBroke[vehicleid] == 1)
- {
- if(pstate == PLAYER_STATE_DRIVER)
- {
- format(gstr, sizeof(gstr),"* A loud bang is heard as the %s comes to a dead stop. *",GetVehicleName(vehicleid));
- ProxDetector(20.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_RED, "This vehicle is broken and needs to be repaired.");
- VehicleBroke[vehicleid] = 2;
- if(IsOwnedCar(vehicleid)) VehicleData[vehicleid][Hotwired] = 0;
- if(DMV_Testing[playerid] == 1)
- {
- FailDMVTest(playerid, "Vehicle Engine Broken");
- }
- }
- }
- if(PlayerCalledTaxi[playerid] == 0 && GoldToggle[playerid] == 0 && ADuty[playerid] == 0 && BackupType[playerid] == 0 && Duty[playerid] == 0)
- {
- SetPlayerColor(playerid, 0xFFFFFF00);
- }
- new Float:PlayerPos[3];
- GetPlayerPos(playerid, PlayerPos[0], PlayerPos[1], PlayerPos[2]);
- if(LoginScreenID[playerid][1] > 0)
- {
- LoginScreenID[playerid][1] --;
- if(LoginScreenID[playerid][1] == 10)
- {
- //blah
- }
- else if(LoginScreenID[playerid][1] == 0)
- {
- LoginScreenID[playerid][0] ++;
- if(LoginScreenID[playerid][0] >= sizeof(ClassSelectionData))
- {
- LoginScreenID[playerid][0] = 0;
- }
- LoginScreenID[playerid][1] = 120;
- InterpolateCameraPos(playerid, ClassSelectionData[LoginScreenID[playerid][0]][0], ClassSelectionData[LoginScreenID[playerid][0]][1], ClassSelectionData[LoginScreenID[playerid][0]][2], ClassSelectionData[LoginScreenID[playerid][0]][6], ClassSelectionData[LoginScreenID[playerid][0]][7], ClassSelectionData[LoginScreenID[playerid][0]][8], 120000, CAMERA_MOVE);
- InterpolateCameraLookAt(playerid, ClassSelectionData[LoginScreenID[playerid][0]][3], ClassSelectionData[LoginScreenID[playerid][0]][4], ClassSelectionData[LoginScreenID[playerid][0]][5], ClassSelectionData[LoginScreenID[playerid][0]][9], ClassSelectionData[LoginScreenID[playerid][0]][10], ClassSelectionData[LoginScreenID[playerid][0]][11], 120000, CAMERA_MOVE);
- }
- }
- if(Cash[playerid] > 50000) UnlockAchievement(playerid, 4);
- if(Cash[playerid] == BankBalance[playerid]) UnlockAchievement(playerid, 34);
- if(TruckStat[playerid] >= 5) UnlockAchievement(playerid, 39);
- if(Cash[playerid] == 666666) UnlockAchievement(playerid, 45);
- if(IsDonator[playerid] > 0) UnlockAchievement(playerid, 31);
- if(GetPlayerOwnedVehicleCount(playerid) > 1 && (HasHouseKey[playerid][0] != -1 || HasHouseKey[playerid][1] != -1) && RentRoom[playerid] > 0 && (PlayerBizzID[playerid][0] != -1 || PlayerBizzID[playerid][1] != -1)) UnlockAchievement(playerid, 49);
- if(IsPlayerInAnyVehicle(playerid) && EngineStatus[vehicleid] == 1)
- {
- if(VehicleData[vehicleid][VehicleOwnerSQLID] > 0)
- {
- if(VehicleData[vehicleid][Mileage] - VehicleData[vehicleid][LastOilMileage] >= 475 && VehicleHasEngine(vehicleid))
- {
- OilTextToggle[playerid] = 1;
- if(OilTextToggle[playerid] == 1) TextDrawShowForPlayer(playerid, EngineOilTextY);
- if(VehicleData[vehicleid][Mileage] - VehicleData[vehicleid][LastOilMileage] >= 515)
- {
- if(OilTextToggle[playerid] == 1) TextDrawHideForPlayer(playerid, EngineOilTextY);
- OilTextToggle[playerid] = 3;
- if(OilTextToggle[playerid] == 3) TextDrawShowForPlayer(playerid, EngineOilTextR);
- }
- }
- }
- }
- if(AdvertSpamTime[playerid] > 0) AdvertSpamTime[playerid] --;
- if(HealSpamTime[playerid] > 0) HealSpamTime[playerid] --;
- if(PMSpamTime[playerid] > 0) PMSpamTime[playerid] --;
- if(SpeedCameraCooldown[playerid] > 0) SpeedCameraCooldown[playerid] --;
- if(IsTrucking[playerid] == 1)
- {
- //TruckingJobData[playerid][0] time in seconds till re-attach timeout
- //TruckingJobData[playerid][1] variable for 'needs to re-attach?'
- if((!IsTruck(vehicleid) && GetVehicleModel(vehicleid) != 498) && ET_GetOutTime[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "The job has been cancelled because you exited the truck.");
- DisablePlayerCheckpoint(playerid);
- TruckIndex[playerid] = 0;
- IsTrucking[playerid] = 0;
- TruckingJobData[playerid][0] = 0;
- TruckingJobData[playerid][1] = 0;
- }
- if((IsTrailerAttachedToVehicle(vehicleid) == 0 && TruckIndex[playerid] == 1 && WaitingForTruckTrailer[playerid] == 0) && TruckingJobData[playerid][1] != 1 && GetVehicleModel(vehicleid) != 498)
- {
- TruckingJobData[playerid][1] = 1;
- TruckingJobData[playerid][0] = 61;
- }
- if(TruckingJobData[playerid][1] == 1 && ET_GetOutTime[playerid] == 0 && GetVehicleModel(vehicleid) != 498)
- {
- if(IsTrailerAttachedToVehicle(vehicleid) == 0)
- {
- if(TruckingJobData[playerid][0] == 1)
- {
- SendClientMessage(playerid, COLOR_WHITE, "The job has been cancelled because you didn't re-attach the trailer in time.");
- DisablePlayerCheckpoint(playerid);
- TruckIndex[playerid] = 0;
- IsTrucking[playerid] = 0;
- TruckingJobData[playerid][0] = 0;
- TruckingJobData[playerid][1] = 0;
- EmptyTruckingTrailer(TruckingTrailer[playerid]);
- DestroyVehicleEx(TruckingTrailer[playerid], "TruckingTrailer[playerid] 3");
- TruckingTrailer[playerid] = 0;
- }
- else
- {
- TruckingJobData[playerid][0] --;
- format(gstr, sizeof(gstr), "~w~you have ~g~%i ~w~seconds to attach the trailer", TruckingJobData[playerid][0]);
- ShowInfoText(playerid, gstr, 1000);
- }
- }
- else
- {
- TruckingJobData[playerid][0] = 0;
- TruckingJobData[playerid][1] = 0;
- ShowInfoText(playerid, "~b~trailer attached", 3000);
- }
- }
- }
- if(DrunkLevel[playerid] > 0)
- {
- DrunkLevel[playerid] -= 500;
- SetPlayerDrunkLevel(playerid, DrunkLevel[playerid]);
- }
- if(DeliveringFuel[playerid] > 1)
- {
- //FuelJobData[playerid][0] time in seconds till re-attach timeout
- //FuelJobData[playerid][1] variable for 'needs to re-attach?'
- if((IsTrailerAttachedToVehicle(vehicleid) == 0 && WaitingForTruckTrailer[playerid] == 0) && FuelJobData[playerid][1] != 1 && ET_GetOutTime[playerid] == 0)
- {
- FuelJobData[playerid][1] = 1;
- FuelJobData[playerid][0] = 61;
- }
- if(FuelJobData[playerid][1] == 1)
- {
- if(IsTrailerAttachedToVehicle(vehicleid) == 0)
- {
- if(FuelJobData[playerid][0] == 1)
- {
- SendClientMessage(playerid, COLOR_WHITE, "The job has been cancelled because you didn't re-attach the trailer in time.");
- DisablePlayerCheckpoint(playerid);
- DeiveringFuelAmount[playerid] = 0;
- DeiveringFuelType[playerid] = 0;
- if(DeliveringFuel[playerid] >= 2)
- {
- DestroyVehicleEx(DeliveringFuelVeh[playerid][1], "DeliveringFuelVeh[playerid][1] 2");
- DestroyDynamic3DTextLabel(DeliveringFuelLabel[playerid]);
- DeliveringFuelLabel[playerid] = Text3D:INVALID_3DTEXT_ID;
- }
- DeliveringFuel[playerid] = 0;
- }
- else
- {
- FuelJobData[playerid][0] --;
- format(gstr, sizeof(gstr), "~w~you have ~g~%i ~w~seconds to attach the trailer..", FuelJobData[playerid][0]);
- ShowInfoText(playerid, gstr, 1000);
- }
- }
- else
- {
- FuelJobData[playerid][0] = 0;
- FuelJobData[playerid][1] = 0;
- ShowInfoText(playerid, "~b~trailer attached", 3000);
- }
- }
- }
- if(PlayerRubber[playerid] || PlayerTased[playerid])
- {
- new animlib[32], animname[32];
- GetAnimationName(GetPlayerAnimationIndex(playerid), animlib, 32, animname, 32);
- if(!strmatch(animname, "crckdeth2")) OnePlayAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 1, 1, 1, 0);
- }
- if(DeathTimer[playerid] == 0 && Dead{playerid} && !IsPlayerInAnyVehicle(playerid))
- {
- new animlib[32], animname[32];
- GetAnimationName(GetPlayerAnimationIndex(playerid), animlib, 32, animname, 32);
- if(!strmatch(animname, "FALL_skyDive_DIE")) OnePlayAnim(playerid, "PARACHUTE", "FALL_skyDive_DIE", 3.5, 0, 0, 0, 1, 0);
- }
- //player timers
- if(DeathTimer[playerid] >= 1)
- {
- format(tgstr, sizeof(tgstr), "~y~Death Timer:~w~ %i", DeathTimer[playerid]);
- PlayerTextDrawSetString(playerid, DeathText[playerid], tgstr);
- PlayerTextDrawShow(playerid, DeathText[playerid]);
- DeathTimer[playerid] --;
- new animlib[32], animname[32];
- GetAnimationName(GetPlayerAnimationIndex(playerid), animlib, 32, animname, 32);
- if(!IsPlayerInAnyVehicle(playerid) && !strmatch(animname, "Sweet_injuredloop")) OnePlayAnim(playerid, "SWEET", "Sweet_injuredloop", 4.0, 1, 0, 0, 1, 0);
- if(DeathTimer[playerid] == 0)
- {
- PlayerTextDrawSetString(playerid, DeathText[playerid], " ");
- PlayerTextDrawHide(playerid, DeathText[playerid]);
- new nlwcount = 0, lwcount = 0;
- for(new x = 0; x < HitCount[playerid]; x++)
- {
- if(Injuries[playerid][x][pWeaponID] < 15) nlwcount ++;
- else lwcount ++;
- }
- if(lwcount == 0 && nlwcount >= 1)
- {
- RevivePlayer(playerid);
- SendClientMessage(playerid, COLOR_WHITE, "Your death timer has expired. Since you did not have any lethal wounds, you have been put back on your feet.");
- }
- else SendClientMessage(playerid, COLOR_WHITE, "Your death timer has expired. You are now free to {FFFF82}/accept death{FFFFFF} if you wish.");
- }
- }
- //roadblock time
- for(new rbo = 0; rbo < MAX_PLAYERROADBLOCKS; rbo++)
- {
- if(RoadBlockTimer[playerid][rbo] > 0)
- {
- RoadBlockTimer[playerid][rbo] --;
- if(RoadBlockTimer[playerid][rbo] == 0)
- {
- DestroyRoadblock(playerid, rbo);
- SendClientMessage(playerid, COLOR_BLUE, "One of your roadblocks has been removed automatically.");
- }
- }
- }
- //teleport timer
- if(TeleportTimer[playerid] >= 1)
- {
- TeleportTimer[playerid] --;
- if(TeleportTimer[playerid] == 0)
- {
- TeleportPlayer(playerid);
- }
- }
- if(HospitalTimer[playerid] > 0)
- {
- HospitalTimer[playerid] --;
- if(HospitalTimer[playerid] == 0)
- {
- ReleaseHospitalizedPlayer(playerid);
- }
- }
- if(IsTrashMan[playerid] == 1)
- {
- if(TrashMissionData[playerid][1] > 0)
- {
- TrashMissionData[playerid][1] --;
- if(TrashMissionData[playerid][1] == 0)
- {
- SetVehicleToRespawnEx(TrashMissionData[playerid][0]);
- IsTrashMan[playerid] = 0;
- TrashIndex[playerid] = 0;
- TrashMissionData[playerid][0] = 0;
- TrashMissionData[playerid][1] = 0;
- TrashMissionData[playerid][2] = 0;
- ShowInfoText(playerid, "~r~Failed~n~~w~You didn't get back inside the truck in time", 5000);
- }
- else
- {
- format(gstr, sizeof(gstr), "~r~%i~w~ seconds to get back inside the Trashmaster", TrashMissionData[playerid][1]);
- ShowInfoText(playerid, gstr, 1100);
- }
- }
- }
- if(DrugSpamTimer[playerid] > 0)
- {
- DrugSpamTimer[playerid] --;
- if(DrugSpamTimer[playerid] == 0)
- {
- SetPlayerWeather(playerid, gServerWeather);
- DrunkLevel[playerid] = 0;
- SetPlayerDrunkLevel(playerid, 0);
- TextDrawHideForPlayer(playerid, WeedEffect);
- }
- }
- if(IsTied[playerid] > 0)
- {
- IsTied[playerid] --;
- if(IsTied[playerid] == 0)
- {
- TogglePlayerControllable(playerid, 1);
- IsTied[playerid] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "You have managed to get out of the rope.");
- format(gstr, sizeof(gstr),"* The rope around %s loosens and they manage to escape. *",NameRP(playerid));
- ProxDetector(20.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- }
- if(BurningMoney[playerid] == 1)
- {
- GivePlayerCash(playerid, -1);
- if(Cash[playerid] <= 0) BurningMoney[playerid] = 0;
- }
- if(IsDumper(vehicleid) && !IsPlayerInRangeOfPoint(playerid, 350.0, 611.5, 858.7, -42.9))
- {
- RemovePlayerFromVehicle(playerid);
- SetVehicleToRespawnEx(vehicleid);
- SendClientMessage(playerid, COLOR_WHITE, "Your Dumper has been respawned as you are too far from the quarry.");
- }
- if(InCarCharging[playerid] == 1 && IsPlayerInAnyVehicle(playerid))
- {
- PhoneData[playerid][pBattery] = floatadd(PhoneData[playerid][pBattery], 1);
- phonebateria(playerid);
- format(tgstr, sizeof(tgstr), "~w~Phone is recharging~n~~g~%.0f/100", PhoneData[playerid][pBattery]);
- ShowInfoText(playerid, tgstr, 1250);
- if(PhoneData[playerid][pBattery] >= 100)
- {
- PhoneData[playerid][pBattery] = 100;
- phonebateria(playerid);
- InCarCharging[playerid] = 0;
- SendClientMessage(playerid, COLOR_YELLOW, "Your phone is now fully charged.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET Battery = %i WHERE id = %i", floatround(PhoneData[playerid][pBattery]), PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- format(gstr, sizeof(gstr),"* %s removes the car charging kit as their phone is now fully charged. *",NameRP(playerid));
- ProxDetector(20.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- }
- else
- {
- if(InCarCharging[playerid] == 1)
- {
- InCarCharging[playerid] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET Battery = %i WHERE id = %i", floatround(PhoneData[playerid][pBattery]), PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- SendClientMessage(playerid, COLOR_YELLOW, "Your phone is no longer charging in the vehicle.");
- }
- }
- if(PhoneData[playerid][pPower] == 1 && PhoneData[playerid][pBattery] > 0)
- {
- PhoneData[playerid][pBattery] -= 0.001;
- if(PhoneData[playerid][pBattery] < 5.1 && PhoneData[playerid][pBattery] > 4.9)
- {
- if(IsSpectating[playerid] == -1)
- {
- format(sgstr, sizeof(sgstr),"*Beep Beep* Low battery on mobile phone. ((%s))", NameRP(playerid));
- ProxDetector(20.0,playerid,sgstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- PhoneData[playerid][pBattery] = 4.9;
- }
- if(floatround(PhoneData[playerid][pBattery]) == 0)
- {
- PhoneData[playerid][pPower] = 0;
- PhoneData[playerid][pBattery] = 0;
- SysMsg(playerid, "Your phone's battery has run out.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhonePower = 0 WHERE id = %i", PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- if(CallerID[playerid] != -1) cmd_hangup(playerid);
- }
- phonebateria(playerid);
- }
- if(GetPlayerDrunkLevel(playerid) > 10000 && pstate == PLAYER_STATE_ONFOOT && GetWalkingSpeed(playerid) > 0)
- {
- LoopingAnim(playerid, "PED", "WALK_DRUNK", 4.1, 1, 1, 1, 1, 1);
- }
- if(DMV_Testing[playerid] > 0 && DMV_Testing[playerid] < 10 && GetPlayerVehicleID(playerid) == DMV_TestVehicle[playerid])
- {
- DMV_TimeTaken[playerid] ++;
- new Float:vdmg, dmg_percent;
- GetVehicleHealth(DMV_TestVehicle[playerid], vdmg);
- dmg_percent = floatround((1000 - vdmg) / 10);
- new speed = GetVehicleSpeed(DMV_TestVehicle[playerid], 0);
- new textdraw[200];
- new next_speed_color[3];
- if(speed > TestData_Speeds[DMV_Testing[playerid]-1][DMV_Index[playerid]+1]) format(next_speed_color, 3, "u");
- else format(next_speed_color, 3, "g");
- format(textdraw, 200, "~w~Upcoming Speed Limit: ~%s~%i MPH~n~~w~Current Speed Limit: ~g~%i MPH~n~~w~Damage: ~g~%i/10 %%~n~~w~Time Taken: ~g~%i seconds", next_speed_color, TestData_Speeds[DMV_Testing[playerid]-1][DMV_Index[playerid]+1], DMV_SpeedLimit[playerid], dmg_percent, DMV_TimeTaken[playerid]);
- PlayerTextDrawSetString(playerid, DMV[playerid], textdraw);
- PlayerTextDrawShow(playerid, DMV[playerid]);
- if(dmg_percent >= 10)
- {
- new fail[50];
- format(fail, 50, "Damaged test vehicle too much (%i percent)", dmg_percent);
- FailDMVTest(playerid, fail);
- }
- if(speed > DMV_SpeedLimit[playerid] + 3)
- {
- new fail[50];
- format(fail, 50, "Speeding (%i MPH, Limit: %i MPH)", speed, DMV_SpeedLimit[playerid]);
- FailDMVTest(playerid, fail);
- }
- }
- if(EngineStartDelay[playerid] != 0)
- {
- switch(EngineStartDelay[playerid])
- {
- case 1: StartEngine(vehicleid, playerid);
- default: ShowInfoText(playerid, "~g~Engine Starting..", 1200);
- }
- EngineStartDelay[playerid] --;
- }
- if(MedKitAction[playerid] > 0)
- {
- MedKitAction[playerid] --;
- new Float:hp;
- if(MedKitActionPlayer[playerid] == -1)
- {
- GetPlayerHealth(playerid, hp);
- if(MedKitAction[playerid] == 18)
- {
- format(gstr, sizeof(gstr), "* %s grabs a small bottle of liquid and uses it to cleanse a wound. *", NameRP(playerid));
- ProxDetector(20.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(hp <= 90.0)
- {
- SetPlayerHealthEx(playerid, hp + 10.0);
- }
- }
- else if(MedKitAction[playerid] == 13)
- {
- format(gstr, sizeof(gstr), "* %s wraps a bandage around a bleeding wound. *", NameRP(playerid));
- ProxDetector(20.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(hp <= 90.0)
- {
- SetPlayerHealthEx(playerid, hp + 10.0);
- }
- }
- else if(MedKitAction[playerid] == 8)
- {
- format(gstr, sizeof(gstr), "* %s uses a pair of scissors to cut off some excess bandage. *", NameRP(playerid));
- ProxDetector(20.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else if(MedKitAction[playerid] == 3)
- {
- format(gstr, sizeof(gstr), "* %s's wounds stop bleeding and they begin to feel better. *", NameRP(playerid));
- ProxDetector(20.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(hp <= 90.0)
- {
- SetPlayerHealthEx(playerid, hp + 10.0);
- }
- }
- else if(MedKitAction[playerid] == 0)
- {
- Inventory[playerid][MedKit] = 0;
- MySQLUpdateInt(SQLID[playerid], "HasMedKit", Inventory[playerid][MedKit], "players");
- format(gstr, sizeof(gstr), "* Curado ((%s)) *", NameRP(playerid));
- ProxDetector(20.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- }
- else
- {
- new playa = MedKitActionPlayer[playerid];
- GetPlayerHealth(playa, hp);
- if(MedKitAction[playerid] == 18)
- {
- format(gstr, sizeof(gstr), "* %s grabs a small bottle of liquid and uses it to cleanse a wound on %s. *", NameRP(playerid), NameRP(playa));
- ProxDetector(20.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(hp <= 90.0)
- {
- SetPlayerHealthEx(playa, hp + 10.0);
- }
- }
- else if(MedKitAction[playerid] == 13)
- {
- format(gstr, sizeof(gstr), "* %s wraps a bandage around a bleeding wound on %s. *", NameRP(playerid), NameRP(playa));
- ProxDetector(20.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(hp <= 90.0)
- {
- SetPlayerHealthEx(playa, hp + 10.0);
- }
- }
- else if(MedKitAction[playerid] == 8)
- {
- format(gstr, sizeof(gstr), "* %s uses a pair of scissors to cut off some excess bandage on %s's wound. *", NameRP(playerid), NameRP(playa));
- ProxDetector(20.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else if(MedKitAction[playerid] == 3)
- {
- format(gstr, sizeof(gstr), "* %s's wounds stop bleeding and they begin to feel better. *", NameRP(playa));
- ProxDetector(20.0,playa,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- if(hp <= 90.0)
- {
- SetPlayerHealthEx(playa, hp + 10.0);
- }
- }
- else if(MedKitAction[playerid] == 0)
- {
- Inventory[playerid][MedKit] = 0;
- MySQLUpdateInt(SQLID[playerid], "HasMedKit", Inventory[playerid][MedKit], "players");
- MedKitActionPlayer[playerid] = -1;
- format(gstr, sizeof(gstr), "* Healed ((%s)) *", NameRP(playa));
- ProxDetector(20.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- }
- }
- if(Hotwiring[playerid][0] > 0)
- {
- Hotwiring[playerid][0] ++;
- if(Hotwiring[playerid][0] == 5)
- {
- format(gstr, sizeof(gstr),"* Uses a set of plyers to cut two wires inside the %s's steering column... *",GetVehicleName(Hotwiring[playerid][1]));
- SetPlayerChatBubble(playerid, gstr, COLOR_EMOTE, 15.0, 6000);
- SendClientMessage(playerid, COLOR_EMOTE, "* You use a set of plyers to cut two wires inside the vehicles steering column... *");
- }
- else if(Hotwiring[playerid][0] == 9)
- {
- SetPlayerChatBubble(playerid, "* Strips the plastic coating around the the end of the leads to reveal the metal wire... *", COLOR_EMOTE, 15.0, 6000);
- SendClientMessage(playerid, COLOR_EMOTE, "* You strip the plastic coating around the the end of the leads to reveal the metal wire... *");
- }
- else if(Hotwiring[playerid][0] == 13)
- {
- format(gstr, sizeof(gstr),"* Touches the ends of the two wires in an attempt to start the %s's ignition... *",GetVehicleName(Hotwiring[playerid][1]));
- SetPlayerChatBubble(playerid, gstr, COLOR_EMOTE, 15.0, 6000);
- SendClientMessage(playerid, COLOR_EMOTE, "* You touch the ends of the two wires in an attempt to start the vehicles ignition... *");
- }
- else if(Hotwiring[playerid][0] == 14)
- {
- if(random(100) < 50)
- {
- new engine, lights, alarm, doors, bonnet, boot, objective, v = Hotwiring[playerid][1];
- Hotwiring[playerid][0] = 0;
- Hotwiring[playerid][1] = 0; // Ensure to add a timer for "timer cooldown"
- VehicleData[v][Hotwired] = 0;
- format(gstr, sizeof(gstr),"* Fails to hotwire the %s's ignition... *",GetVehicleName(v));
- SetPlayerChatBubble(playerid, gstr, COLOR_EMOTE, 15.0, 6000);
- SendClientMessage(playerid, COLOR_EMOTE, "* You have failed to hotwire the vehicle and must try again... *");
- GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(v, engine, 1, 1, doors, bonnet, boot, objective);
- SetTimerEx("ToggleVehicleAlarm", 10000, 0, "dd", v, 0);
- }
- else
- {
- format(gstr, sizeof(gstr),"* The %s's engine jolts to life after a successful hotwire... *",GetVehicleName(Hotwiring[playerid][1]));
- SetPlayerChatBubble(playerid, gstr, COLOR_EMOTE, 15.0, 6000);
- SendClientMessage(playerid, COLOR_EMOTE, "* The vehicle's engine jolts to life after a successful hotwire... *");
- }
- }
- else if(Hotwiring[playerid][0] == 15)
- {
- format(gstr, sizeof(gstr),"* Sits back up in the %s and puts their screwdriver and plyers back into their toolbox after hotwiring... *",GetVehicleName(Hotwiring[playerid][1]));
- SetPlayerChatBubble(playerid, gstr, COLOR_EMOTE, 15.0, 6000);
- SendClientMessage(playerid, COLOR_EMOTE, "* You sit back up in the vehicle and put your screwdriver and plyers back into the toolbox... *");
- if(FuelTypeAfterRefuel[Hotwiring[playerid][1]] != GetVehicleFuelType(Hotwiring[playerid][1]) && FuelTypeAfterRefuel[Hotwiring[playerid][1]] > 0)
- {
- SetVehicleHealthEx(Hotwiring[playerid][1], 275.0);
- ToggleVehicleEngine(Hotwiring[playerid][1], 0);
- VehicleBroke[Hotwiring[playerid][1]] = 2;
- SendClientMessage(playerid, COLOR_RED, "> Wrong fuel type in vehicle!");
- format(gstr, sizeof(gstr),"* A loud crank is heard when %s turns on the %s's engine *", NameRP(playerid), GetVehicleName(Hotwiring[playerid][1]));
- ProxDetector(20.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- format(gstr, sizeof(gstr),"* A loud bang is heard as the %s comes to a dead stop. *",GetVehicleName(Hotwiring[playerid][1]));
- ProxDetector(20.0,playerid,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- SendClientMessage(playerid, COLOR_RED, "This vehicle is broken and needs to be repaired.");
- }
- EngineStatus[Hotwiring[playerid][1]] = 1;
- ToggleVehicleEngine(Hotwiring[playerid][1], 1);
- SendClientMessage(playerid, COLOR_WHITE, "> Engine {FF6600}Hotwired");
- ShowInfoText(playerid,"~g~Engine On",2000);
- //UpdateFuelText(Hotwiring[playerid][1], gstr);
- //PlayerTextDrawSetString(playerid, FuelText[playerid],gstr);
- //PlayerTextDrawShow(playerid,FuelText[playerid]);
- TextDrawHideForPlayer(playerid, VehicleEngineText);
- if(SpeedoActive[playerid] == 1) PlayerTextDrawShow(playerid,Speedo3dl[playerid]);
- foreach(new p: Player)
- {
- if(IsSpectating[p] == playerid)
- {
- PlayerTextDrawShow(p, Speedo3dl[playerid]);
- }
- }
- Hotwiring[playerid][0] = 0;
- Hotwiring[playerid][1] = 0;
- }
- }
- if(UsingCCTV{playerid})
- {
- FadeColorForPlayer(playerid, 63, 71, 76, 100, 63, 71, 76, 100, 1, 10);
- }
- if(vehicleid == 0 && OilTextToggle[playerid] > 0)
- {
- TextDrawHideForPlayer(playerid, EngineOilTextY);
- TextDrawHideForPlayer(playerid, EngineOilTextR);
- OilTextToggle[playerid] = 0;
- }
- if(pTCount[playerid] >= 5)
- {
- Streamer_Update(playerid);
- if(pstate == PLAYER_STATE_ONFOOT)
- {
- new clientID, clientAmmo;
- for(new w = 0; w < MAX_TOTAL_WEAPONS; w++)
- {
- GetPlayerWeaponData(playerid, w, clientID, clientAmmo);
- if(WeaponData[playerid][w][Weapon] > 0 && clientID > 0 && clientAmmo >= 0 && !WeaponsToBeSynced{playerid})
- {
- if(WeaponData[playerid][w][Weapon] == clientID)
- {
- WeaponData[playerid][w][WeaponAmmo] = clientAmmo;
- if(WeaponData[playerid][w][WeaponAmmo] == 0)
- {
- WeaponData[playerid][w][Weapon] = 0;
- }
- }
- else if(clientID > 0 && WeaponData[playerid][w][Weapon] == 0)
- {
- //
- }
- }
- }
- }
- if(TaxiMeter[playerid] == 1 && IsPlayerConnected(TaxiFareID[playerid]) && GetPlayerVehicleID(playerid) == GetPlayerVehicleID(TaxiFareID[playerid]))
- {
- TaxiFare[TaxiFareID[playerid]] += MyFareCharge[playerid];
- format(gstr, sizeof(gstr), "~w~taxi fare: ~g~$%i", TaxiFare[TaxiFareID[playerid]]);
- ShowInfoText(TaxiFareID[playerid], gstr, 5100);
- ShowInfoText(playerid, gstr, 5100);
- }
- if(BackupType[playerid] > 0)
- {
- new freq, faction;
- switch(BackupType[playerid])
- {
- case 1:
- {
- freq = FACTIONS[FACTION_SACFD][FactionRadioChannel];
- faction = FACTION_SACFD;
- }
- case 2:
- {
- freq = FACTIONS[FACTION_COP][FactionRadioChannel];
- faction = FACTION_COP;
- }
- }
- new newzone[MAX_ZONE_NAME];
- GetPlayer2DZone(playerid, newzone, MAX_ZONE_NAME);
- if(strcmp(newzone, BackupLocation[playerid], true) != 0)
- {
- format(BackupLocation[playerid], MAX_ZONE_NAME, newzone);
- format(gstr, sizeof(gstr), "[Radio - %i MHz] Departmental Dispatcher: %s %s from %s is now in the vicinity of %s.", freq, GetFactionRankName(Faction[playerid], FactionRank[playerid]), NameEx(playerid), FACTIONS[Faction[playerid]][FNameShort], newzone);
- foreach(new unit: Player)
- {
- if(IsPlayerNPC(unit) || !Logged{unit}) continue;
- if(RadioPoweredOn[unit] == 1 && RadioFrequency[unit] == freq && Faction[unit] == faction)
- {
- SendClientMessage(unit, 0x967100FF, gstr);
- }
- }
- }
- }
- pTCount[playerid] = 0;
- }
- SetPlayerScore(playerid, PlayerLevel[playerid]);
- if(OverdoseWaitEffect[playerid][1] == 6) //drug comment
- {
- if(OverdoseWaitEffect[playerid][2] < 100)
- {
- PlayerTextDrawColor(playerid, BlindfoldEffect[playerid], HexTransparency[BlackoutSeq[OverdoseWaitEffect[playerid][2]]]);
- PlayerTextDrawBoxColor(playerid, BlindfoldEffect[playerid], HexTransparency[BlackoutSeq[OverdoseWaitEffect[playerid][2]]]);
- PlayerTextDrawShow(playerid, BlindfoldEffect[playerid]);
- OverdoseWaitEffect[playerid][2]++;
- OverdoseWaitEffect[playerid][1]++;
- }
- else
- {
- OverdoseWaitEffect[playerid][1] = 8;
- OverdoseWaitEffect[playerid][4] = random(sizeof(tripMapLocs));
- OverdoseWaitEffect[playerid][5] = randomEx(10, floatround(DrugTakenData[OverdoseWaitEffect[playerid][4]][ovrDuration] / 2));
- ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0,1);
- }
- }
- if(OverdoseWaitEffect[playerid][1] == 7) OverdoseWaitEffect[playerid][1]--;
- new drugTakenCount[sizeof(BaseEffects)];
- for(new p = 0; p < 10; p++)
- {
- if(DrugsTaken[playerid][p] != -1)
- {
- if(DrugTakenData[DrugsTaken[playerid][p]][effTakenBy] >= 1)
- {
- drugTakenCount[DrugTakenData[DrugsTaken[playerid][p]][effDrugType]]++;
- if(DrugTakenData[DrugsTaken[playerid][p]][effActivated] == 0)
- {
- for(new x = 0; x < 6; x++)
- {
- switch(floatround(DrugTakenData[DrugsTaken[playerid][p]][effType][x]))
- {
- case 1:
- {
- DrugTypeAmountChange(playerid, p, x);
- if(HealthVar[playerid] > 100.0) {
- SetPlayerHealth(playerid, 100.0);
- }
- else
- {
- HealthVar[playerid] += DrugTakenData[DrugsTaken[playerid][p]][effAmount][x];
- SetPlayerHealthEx(playerid, HealthVar[playerid]);
- }
- }
- case 2:
- {
- DrugTypeAmountChange(playerid, p, x);
- if(ArmourVar[playerid] > 50.0) {
- ArmourVar[playerid] = 50.0;
- SetPlayerArmour(playerid, 50.0);
- }
- else
- {
- ArmourVar[playerid] += DrugTakenData[DrugsTaken[playerid][p]][effAmount][x];
- SetPlayerArmour(playerid, ArmourVar[playerid]);
- }
- }
- case 4:
- {
- MovementSpeed[playerid][1] = DrugTakenData[DrugsTaken[playerid][p]][effTimeTo];
- }
- case 5:
- {
- DrunkLevel[playerid] += floatround(DrugTakenData[DrugsTaken[playerid][p]][effAmount][x]);
- SetPlayerDrunkLevel(playerid, DrunkLevel[playerid]);
- }
- case 6:
- {
- DrugTypeAmountChange(playerid, p, x);
- DrugWeaponEffects[playerid][0] += DrugTakenData[DrugsTaken[playerid][p]][effAmount][x];
- }
- case 7:
- {
- DrugTypeAmountChange(playerid, p, x);
- DrugWeaponEffects[playerid][1] += DrugTakenData[DrugsTaken[playerid][p]][effAmount][x];
- }
- case 12:
- {
- DrugBadEffects[playerid][0] = 6;
- }
- }
- }
- DrugTakenData[DrugsTaken[playerid][p]][effActivated] = 1;
- }
- else if(DrugTakenData[DrugsTaken[playerid][p]][effActivated] == 1)
- {
- new amountOvr = 0;
- for(new drtk = 0; drtk < sizeof(BaseEffects); drtk++)
- drugTakenCount[drtk] = 0;
- for(new d = 0; d < 10; d++)
- if(DrugsTaken[playerid][d] != -1)
- drugTakenCount[DrugTakenData[DrugsTaken[playerid][d]][effDrugType]] ++;
- for(new ovr = 0; ovr < sizeof(BaseEffects); ovr++)
- amountOvr += drugTakenCount[ovr];
- if(amountOvr >= DrugTakenData[DrugsTaken[playerid][p]][ovrMax])
- {
- new alreadyOvr = 0;
- for(new ov = 0; ov < 10; ov++)
- {
- if(DrugsTaken[playerid][ov] == -1) continue;
- if(DrugTakenData[DrugsTaken[playerid][ov]][effActivated] == 4 || DrugTakenData[DrugsTaken[playerid][ov]][effActivated] == 5)
- {
- alreadyOvr = 1;
- }
- }
- if(!alreadyOvr)
- {
- for(new ov = 0; ov < 10; ov++)
- {
- DrugTakenData[DrugsTaken[playerid][p]][effActivated] = 4;
- if(DrugsTaken[playerid][p] == DrugsTaken[playerid][ov]) continue;
- if(DrugsTaken[playerid][ov] > 0)
- DrugTakenData[DrugsTaken[playerid][ov]][effActivated] = 5;
- }
- }
- MovementSpeed[playerid][0] = 0.0;
- DrugWeaponEffects[playerid][0] = 0.0;
- DrugWeaponEffects[playerid][1] = 0.0;
- break;
- }
- if(DrugTimePassed(playerid, p))
- {
- for(new x = 0; x < 6; x++)
- {
- switch(floatround(DrugTakenData[DrugsTaken[playerid][p]][effType][x]))
- {
- case 1:
- {
- if(HealthVar[playerid] > 100.0) {
- HealthVar[playerid] = 100.0;
- SetPlayerHealth(playerid, 100.0);
- }
- else {
- HealthVar[playerid] += DrugTakenData[DrugsTaken[playerid][p]][effAmount][x];
- SetPlayerHealth(playerid, HealthVar[playerid]);
- }
- }
- case 2:
- {
- if(ArmourVar[playerid] > 50.0) {
- ArmourVar[playerid] = 50.0;
- SetPlayerArmour(playerid, 50.0);
- }
- else
- {
- ArmourVar[playerid] += DrugTakenData[DrugsTaken[playerid][p]][effAmount][x];
- SetPlayerArmour(playerid, ArmourVar[playerid]);
- }
- }
- case 4:
- {
- if(DrugTakenData[DrugsTaken[playerid][p]][effTimeTo] <= floatround(floatmul(MovementSpeed[playerid][1], 0.45)) && DrugTakenData[DrugsTaken[playerid][p]][effTimeTo] > 2.5)
- {
- MovementSpeed[playerid][0] = DrugTakenData[DrugsTaken[playerid][p]][effAmount][x];
- MovementSpeed[playerid][1] = DrugTakenData[DrugsTaken[playerid][p]][effAmount][x] + 0.06;
- }
- }
- case 6:
- {
- DrugWeaponEffects[playerid][0] += DrugTakenData[DrugsTaken[playerid][p]][effAmount][x];
- }
- case 7:
- {
- DrugWeaponEffects[playerid][1] += DrugTakenData[DrugsTaken[playerid][p]][effAmount][x];
- }
- case 12:
- {
- DrugBadEffects[playerid][0]--;
- if(DrugBadEffects[playerid][0] == 0)
- {
- new Float:percVal[2], effRand;
- percVal[0] = DrugTakenData[DrugsTaken[playerid][p]][effAmount][x];
- percVal[1] = floatsub(1.0, DrugTakenData[DrugsTaken[playerid][p]][effAmount][x]);
- new Float:randChos = randomEx(50, 100);
- while(randChos > 0)
- {
- effRand = random(2);
- randChos = floatsub(randChos, percVal[effRand]);
- }
- if(effRand == 0)
- {
- format(gstr, sizeof(gstr), "%s lurches forward, violently vomiting up the contents of his stomach", NameRP(playerid));
- ProxDetector(20.0,playerid,gstr,COLOR_EMOTE,COLOR_EMOTE,COLOR_EMOTE,COLOR_EMOTE,COLOR_EMOTE);
- cmd_vomit(playerid, "");
- }
- }
- }
- case 13:
- {
- SetPlayerWeather(playerid, floatround(DrugTakenData[DrugsTaken[playerid][p]][effAmount][x]));
- }
- }
- }
- }
- DrugTakenData[DrugsTaken[playerid][p]][effTimeTo]--;
- if(DrugTakenData[DrugsTaken[playerid][p]][effTimeTo] == 0)
- {
- DrugTakenData[DrugsTaken[playerid][p]][effActivated] = 2;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM drugs WHERE id = %d", DrugTakenData[DrugsTaken[playerid][p]][effSQLID]);
- mysql_pquery(conn, mquery, "RedoingDrugsMate", "ii", playerid, DrugsTaken[playerid][p]);
- }
- }
- else if(DrugTakenData[DrugsTaken[playerid][p]][effActivated] == 2)
- {
- if(DrugTakenData[DrugsTaken[playerid][p]][effDuration] > 0)
- {
- if(DrugTakenData[DrugsTaken[playerid][p]][effDuration] <= DrugTakenData[DrugsTaken[playerid][p]][cmdStart])
- {
- if(DrugTimePassed(playerid, p))
- {
- for(new x = 0; x < 6; x++)
- {
- switch(floatround(DrugTakenData[DrugsTaken[playerid][p]][cmdType][x]))
- {
- case 1:
- {
- for(new e = 0; e < 5; e++)
- {
- if(floatround(DrugTakenData[DrugsTaken[playerid][p]][cmdType][x]) == floatround(DrugTakenData[DrugsTaken[playerid][p]][effType][e]))
- {
- if(DrugTakenData[DrugsTaken[playerid][p]][effDuration] == DrugTakenData[DrugsTaken[playerid][p]][cmdStart]) DrugTypeAmountChange(playerid, p, x);
- if(HealthVar[playerid] < 0) {
- SetPlayerHealth(playerid, 0.0);
- }
- else
- {
- HealthVar[playerid] -= floatmul(DrugTakenData[DrugsTaken[playerid][p]][effAmount][e], DrugTakenData[DrugsTaken[playerid][p]][cmdAmount][x]);
- SetPlayerHealth(playerid, HealthVar[playerid]);
- }
- }
- }
- }
- case 2:
- {
- for(new e = 0; e < 5; e++)
- {
- if(floatround(DrugTakenData[DrugsTaken[playerid][p]][cmdType][x]) == floatround(DrugTakenData[DrugsTaken[playerid][p]][effType][e]))
- {
- if(DrugTakenData[DrugsTaken[playerid][p]][effDuration] == DrugTakenData[DrugsTaken[playerid][p]][cmdStart]) DrugTypeAmountChange(playerid, p, x);
- if(ArmourVar[playerid] < 0) {
- SetPlayerArmour(playerid, 0.0);
- }
- else
- {
- ArmourVar[playerid] -= floatmul(DrugTakenData[DrugsTaken[playerid][p]][effAmount][e], DrugTakenData[DrugsTaken[playerid][p]][cmdAmount][x]);
- SetPlayerArmour(playerid, ArmourVar[playerid]);
- }
- }
- }
- }
- case 4:
- {
- if(DrugTakenData[DrugsTaken[playerid][p]][effDuration] <= floatround(floatmul(DrugTakenData[DrugsTaken[playerid][p]][cmdStart], 0.45)))
- {
- MovementSpeed[playerid][0] = 0.0;
- MovementSpeed[playerid][1] = 0.0;
- }
- }
- case 6:
- {
- if(DrugWeaponEffects[playerid][0] > 0)
- DrugWeaponEffects[playerid][0] -= DrugTakenData[DrugsTaken[playerid][p]][cmdAmount][x];
- }
- case 7:
- {
- if(DrugWeaponEffects[playerid][1] > 0)
- DrugWeaponEffects[playerid][1] -= DrugTakenData[DrugsTaken[playerid][p]][cmdAmount][x];
- }
- case 12:
- {
- for(new e = 0; e < 5; e++)
- {
- switch(DrugTakenData[DrugsTaken[playerid][p]][effAmount][e])
- {
- case 12:
- {
- DrugBadEffects[playerid][0] = 0;
- DrunkLevel[playerid] -= DrugTakenData[DrugsTaken[playerid][p]][effAmount][e];
- SetPlayerDrunkLevel(playerid, DrunkLevel[playerid]);
- break;
- }
- }
- }
- }
- case 13:
- {
- SetPlayerWeather(playerid, gServerWeather);
- }
- }
- }
- }
- }
- DrugTakenData[DrugsTaken[playerid][p]][effDuration]--;
- }
- }
- else if(DrugTakenData[DrugsTaken[playerid][p]][effActivated] == 3) //secondary comedown
- {
- new amountOvrt = 0;
- for(new drtk = 0; drtk < sizeof(BaseEffects); drtk++)
- drugTakenCount[drtk] = 0;
- for(new d = 0; d < 10; d++)
- if(DrugsTaken[playerid][d] != -1)
- drugTakenCount[DrugTakenData[DrugsTaken[playerid][d]][effDrugType]]++;
- for(new ovr = 0; ovr < sizeof(BaseEffects); ovr++)
- amountOvrt += drugTakenCount[ovr];
- for(new x = 0; x < 6; x++)
- {
- switch(floatround(DrugTakenData[DrugsTaken[playerid][p]][ovrType][x]))
- {
- case 9:
- {
- new ovrVal = amountOvrt - DrugTakenData[DrugsTaken[playerid][p]][ovrMax] + 1;
- new Float:percVal[2], effRand;
- if(ovrVal > 0) {
- percVal[0] = floatmul(DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x], ovrVal);
- percVal[1] = floatsub(1.0, floatmul(DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x], ovrVal));
- }
- else
- {
- percVal[0] = DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x];
- percVal[1] = floatsub(1.0, DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x]);
- }
- new Float:randChos = randomEx(75, 100);
- while(randChos > 0)
- {
- effRand = random(2);
- randChos = floatsub(randChos, percVal[effRand]);
- }
- if(effRand == 0)
- {
- SetPlayerHealthEx(playerid, 0.0);
- DrugTakenData[DrugsTaken[playerid][p]][effActivated] = 7;
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "Sobreviveu");
- DrugTakenData[DrugsTaken[playerid][p]][effActivated] = 8;
- }
- }
- }
- }
- }
- else if(DrugTakenData[DrugsTaken[playerid][p]][effActivated] == 4)
- {
- if(DrugTakenData[DrugsTaken[playerid][p]][ovrDuration] > 0)
- {
- new amountOvrt = 0;
- for(new drtk = 0; drtk < sizeof(BaseEffects); drtk++)
- drugTakenCount[drtk] = 0;
- for(new d = 0; d < 10; d++)
- if(DrugsTaken[playerid][d] != -1)
- drugTakenCount[DrugTakenData[DrugsTaken[playerid][d]][effDrugType]] ++;
- for(new ovr = 0; ovr < sizeof(BaseEffects); ovr++)
- amountOvrt += drugTakenCount[ovr];
- if(DrugTimePassed(playerid, p, amountOvrt))
- {
- printf("%d", DrugTakenData[DrugsTaken[playerid][p]][ovrDuration]);
- for(new x = 0; x < 6; x++)
- {
- switch(floatround(DrugTakenData[DrugsTaken[playerid][p]][ovrType][x]))
- {
- case 1:
- {
- if(DrugTakenData[DrugsTaken[playerid][p]][ovrDuration] == floatround(BaseEffects[DrugTakenData[DrugsTaken[playerid][p]][effDrugType]][baseOverdose][0])) DrugTypeAmountChange(playerid, p, x);
- if(HealthVar[playerid] < 0) {
- SetPlayerHealth(playerid, 2.0);
- }
- else
- {
- HealthVar[playerid] -= DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x];
- SetPlayerHealth(playerid, HealthVar[playerid]);
- }
- }
- case 2:
- {
- if(DrugTakenData[DrugsTaken[playerid][p]][ovrDuration] == floatround(BaseEffects[DrugTakenData[DrugsTaken[playerid][p]][effDrugType]][baseOverdose][0])) DrugTypeAmountChange(playerid, p, x);
- if(ArmourVar[playerid] < 0) {
- SetPlayerArmour(playerid, 0.0);
- }
- else
- {
- ArmourVar[playerid] -= DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x];
- SetPlayerArmour(playerid, ArmourVar[playerid]);
- }
- }
- case 5:
- {
- MovementSpeed[playerid][0] = DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x];
- MovementSpeed[playerid][1] = MovementSpeed[playerid][0] + 0.04;
- }
- case 8:
- {
- if(OverdoseWaitEffect[playerid][1] < 6)
- {
- new ovrVal = amountOvrt - DrugTakenData[DrugsTaken[playerid][p]][ovrMax] + 1;
- new Float:percVal[2], effRand;
- if(ovrVal > 0) {
- percVal[0] = floatmul(DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x], ovrVal);
- percVal[1] = floatsub(1.0, floatmul(DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x], ovrVal));
- }
- else
- {
- percVal[0] = DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x];
- percVal[1] = floatsub(1.0, DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x]);
- }
- new Float:randChos = randomEx(75, 100);
- while(randChos > 0)
- {
- effRand = random(2);
- randChos = floatsub(randChos, percVal[effRand]);
- }
- if(effRand == 0)
- {
- OverdoseWaitEffect[playerid][1]++;
- OverdoseWaitEffect[playerid][2] = 0;
- OverdoseWaitEffect[playerid][4] = DrugsTaken[playerid][p];
- if(OverdoseWaitEffect[playerid][1] == 5) SetPlayerWeather(playerid, 19);
- PlayerTextDrawColor(playerid, BlindfoldEffect[playerid], HexTransparency[OverdoseWaitEffect[playerid][1]]);
- PlayerTextDrawBoxColor(playerid, BlindfoldEffect[playerid], HexTransparency[OverdoseWaitEffect[playerid][1]]);
- PlayerTextDrawShow(playerid, BlindfoldEffect[playerid]);
- }
- }
- else if(OverdoseWaitEffect[playerid][5] > 0 && !IsValidActor(OverdoseWaitEffect[playerid][6]))
- {
- OverdoseWaitEffect[playerid][5]-=floatround(amountOvrt / 2);
- if(OverdoseWaitEffect[playerid][5] <= 0)
- {
- new Float:fPos[4];
- GetPlayerPos(playerid, fPos[0], fPos[1], fPos[2]);
- GetPlayerFacingAngle(playerid, fPos[3]);
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, tripMapLocs[OverdoseWaitEffect[playerid][4]][0] - 1, tripMapLocs[OverdoseWaitEffect[playerid][4]][1] - 1, tripMapLocs[OverdoseWaitEffect[playerid][4]][2]);
- SetPlayerCameraPos(playerid, tripMapLocs[OverdoseWaitEffect[playerid][4]][0], tripMapLocs[OverdoseWaitEffect[playerid][4]][1], tripMapLocs[OverdoseWaitEffect[playerid][4]][2]);
- SetPlayerCameraLookAt(playerid, tripMapLocs[OverdoseWaitEffect[playerid][4]][3], tripMapLocs[OverdoseWaitEffect[playerid][4]][4], tripMapLocs[OverdoseWaitEffect[playerid][4]][5]);
- Streamer_UpdateEx(playerid, tripMapLocs[OverdoseWaitEffect[playerid][4]][0], tripMapLocs[OverdoseWaitEffect[playerid][4]][1], tripMapLocs[OverdoseWaitEffect[playerid][4]][2]);
- SetPlayerWeather(playerid, floatround(tripMapLocs[OverdoseWaitEffect[playerid][4]][6]));
- OverdoseWaitEffect[playerid][6] = CreateActor(GetPlayerSkin(playerid), fPos[0], fPos[1], fPos[2], fPos[3]);
- ApplyActorAnimation(OverdoseWaitEffect[playerid][6], "PED","KO_skid_front",4.1,0,1,1,1,0);
- SetActorVirtualWorld(OverdoseWaitEffect[playerid][6], GetPlayerVirtualWorld(playerid));
- SetPlayerVirtualWorld(playerid, playerid + 1);
- TempInfo[playerid][tInt] = GetPlayerInterior(playerid);
- SetPlayerInterior(playerid, 0);
- OverdoseWaitEffect[playerid][5] = 2;
- }
- }
- else if(IsValidActor(OverdoseWaitEffect[playerid][6]))
- {
- if(OverdoseWaitEffect[playerid][5] == 2)
- {
- printf("%d Here #1", playerid);
- PlayerTextDrawBoxColor(playerid, BlindfoldEffect[playerid], HexTransparency[0]);
- PlayerTextDrawColor(playerid, BlindfoldEffect[playerid], HexTransparency[0]);
- PlayerTextDrawShow(playerid, BlindfoldEffect[playerid]);
- SetTimerEx("ReBlackout", 400, 0, "d", playerid);
- OverdoseWaitEffect[playerid][5]--;
- }
- else if(OverdoseWaitEffect[playerid][5] == 1)
- {
- OverdoseWaitEffect[playerid][5] = -1;
- }
- else
- {
- new Float:acPos[4];
- GetActorPos(OverdoseWaitEffect[playerid][6], acPos[0], acPos[1], acPos[2]);
- GetActorFacingAngle(OverdoseWaitEffect[playerid][6], acPos[3]);
- SetPlayerVirtualWorld(playerid, GetActorVirtualWorld(OverdoseWaitEffect[playerid][6]));
- DestroyActor(OverdoseWaitEffect[playerid][6]);
- SetPlayerPos(playerid, acPos[0], acPos[1], acPos[2]);
- SetPlayerInterior(playerid, TempInfo[playerid][tInt]);
- SetPlayerFacingAngle(playerid, acPos[3]);
- SetPlayerWeather(playerid, gServerWeather);
- ApplyAnimation(playerid, "PED","KO_skid_front",4.1,0,1,1,1,0);
- SetCameraBehindPlayer(playerid);
- }
- }
- }
- case 12:
- {
- if(OverdoseWaitEffect[playerid][0] <= 0 && OverdoseWaitEffect[playerid][1] < 8)
- {
- new ovrVal = amountOvrt - DrugTakenData[DrugsTaken[playerid][p]][ovrMax] + 1;
- new Float:percVal[2], effRand;
- if(ovrVal > 0) {
- percVal[0] = floatmul(DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x], ovrVal);
- percVal[1] = floatsub(1.0, floatmul(DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x], ovrVal));
- }
- else
- {
- percVal[0] = DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x];
- percVal[1] = floatsub(1.0, DrugTakenData[DrugsTaken[playerid][p]][ovrAmount][x]);
- }
- new Float:randChos = randomEx(75, 100);
- while(randChos > 0)
- {
- effRand = random(2);
- randChos = floatsub(randChos, percVal[effRand]);
- }
- if(effRand == 0)
- {
- OverdoseWaitEffect[playerid][0] = 30;
- format(gstr, sizeof(gstr), "%s lurches forward, violently vomiting up the contents of his stomach", NameRP(playerid));
- ProxDetector(20.0,playerid,gstr,COLOR_EMOTE,COLOR_EMOTE,COLOR_EMOTE,COLOR_EMOTE,COLOR_EMOTE);
- cmd_vomit(playerid, "");
- }
- }
- else OverdoseWaitEffect[playerid][0]--;
- }
- }
- // switch(DrugTakenData[DrugsTaken[playerid][p]][effType][x])
- // {
- // case 5:
- // {
- // printf("Move speed %d %d", DrugTakenData[DrugsTaken[playerid][p]][ovrDuration], floatround(BaseEffects[DrugTakenData[DrugsTaken[playerid][p]][effDrugType]][baseOverdose][0]));
- // if(DrugTakenData[DrugsTaken[playerid][p]][ovrDuration] >= floatround(BaseEffects[DrugTakenData[DrugsTaken[playerid][p]][effDrugType]][baseOverdose][0]))
- // {
- // DrunkLevel[playerid] += DrugTakenData[DrugsTaken[playerid][p]][effAmount][x] * 3;
- // OverdoseWaitEffect[playerid][3] = floatround(DrunkLevel[playerid] / (DrugTakenData[DrugsTaken[playerid][p]][ovrDuration] / 5));
- // print("Test");
- // MovementSpeed[playerid][0] = 0.035;
- // MovementSpeed[playerid][1] = MovementSpeed[playerid][0] + 0.04;
- // }
- // DrunkLevel[playerid] -= OverdoseWaitEffect[playerid][3];
- // }
- // }
- }
- DrugTakenData[DrugsTaken[playerid][p]][ovrDuration]--;
- }
- if(DrugTakenData[DrugsTaken[playerid][p]][ovrDuration] <= 0)
- {
- DrugTakenData[DrugsTaken[playerid][p]][effActivated] = 3;
- break;
- }
- }
- }
- }
- }
- }
- }
- }
- return true;
- }
- stock GetVehicleDriver(vehicleid)
- {
- foreach(new i: Player)
- {
- if(GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER) return i;
- }
- return -1;
- }
- stock GetOnlinePlayerCount()
- {
- new playerCount = 0;
- foreach(new i: Player)
- {
- if(Logged{i})
- {
- playerCount ++;
- }
- }
- return playerCount;
- }
- stock GetOnlineAdminCount()
- {
- new adminCount = 0;
- foreach(new i: Player)
- {
- if(IsPlayerAdminLevelOK(i, 1))
- {
- adminCount ++;
- }
- }
- return adminCount;
- }
- stock GetOnlineHelperCount()
- {
- new helperCount = 0;
- foreach(new i: Player)
- {
- if(IsHelper{i})
- {
- helperCount ++;
- }
- }
- return helperCount;
- }
- stock ShowInfoText(playerid, str[], time)
- {
- KillTimer(TextTimer[playerid]);
- PlayerTextDrawSetString(playerid, InfoText[playerid], str);
- PlayerTextDrawShow(playerid, InfoText[playerid]);
- TextTimer[playerid] = SetTimerEx("HideInfoText", time, 0, "d", playerid);
- return true;
- }
- stock ProxDetector(Float:dist, playerid, text[], col1, col2, col3, col4, col5)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:pX, Float:pY, Float:pZ, vWorld = GetPlayerVirtualWorld(playerid);
- new Float:this_dist;
- GetPlayerPos(playerid, pX, pY, pZ);
- foreach(new i: Player)
- {
- if(GetPlayerVirtualWorld(i) == vWorld)
- {
- this_dist = GetPlayerDistanceFromPoint(i, pX, pY, pZ);
- if(this_dist < dist/16) SendSplitMessage(i, col1, text);
- else if(this_dist < dist/8) SendSplitMessage(i, col2, text);
- else if(this_dist < dist/4) SendSplitMessage(i, col3, text);
- else if(this_dist < dist/2) SendSplitMessage(i, col4, text);
- else if(this_dist < dist) SendSplitMessage(i, col5, text);
- }
- }
- }
- return true;
- }
- stock SendSplitMessage(playerid, color, msg[])
- {
- new ml = 115, result[160], len = strlen(msg), repeat;
- if(len > ml)
- {
- repeat = (len / ml);
- for(new i = 0; i <= repeat; i++)
- {
- result[0] = 0;
- if(len - (i * ml) > ml)
- {
- strmid(result, msg, ml * i, ml * (i+1));
- format(result, sizeof(result), "%s", result);
- }
- else
- {
- strmid(result, msg, ml * i, len);
- format(result, sizeof(result), "%s", result);
- }
- SendClientMessage(playerid, color, result);
- }
- }
- else
- {
- SendClientMessage(playerid, color, msg);
- }
- return true;
- }
- stock SplitMessage(msg[])
- {
- new ml = 40, len = strlen(msg), repeat, assistextend[256];
- if(len > ml)
- {
- repeat = (len / ml);
- for(new i = 0; i <= repeat; i++)
- {
- assistextend[i][0] = 0;
- if(len - (i * ml) > ml)
- {
- strmid(assistextend[i], AssistanceMsg[t], ml * i, ml * (i+1));
- format(assistextend[i], sizeof(assistextend[]), "%s ...", assistextend[i]);
- }
- else
- {
- strmid(assistextend[i], AssistanceMsg[t], ml * i, len);
- format(assistextend[i], sizeof(assistextend[]), "%s", assistextend[i]);
- }
- }
- }
- if(strlen(assistextend[1] >= 1)) format(output2, 64, assistextend[1]);
- if(strlen(assistextend[2] >= 1)) format(output3, 64, assistextend[2]);
- }
- stock GetVehicleInfo(vehicleid, infotype, &Float:X, &Float:Y, &Float:Z, &Float:Angle)
- {
- new Float:mX, Float:mY, Float:mZ;
- GetVehicleModelInfo(GetVehicleModel(vehicleid), infotype, mX, mY, mZ);//Get the model's offset to the infotype
- Z += mZ;
- X += (mY * floatsin(-Angle, degrees));
- Y += (mY * floatcos(-Angle, degrees));
- Angle += 270.0;
- X += (mX * floatsin(-Angle, degrees));
- Y += (mX * floatcos(-Angle, degrees));
- Angle -= 270.0;
- return true;
- }
- stock SendSplitRadioMessage(playerid, color, msg[])
- {
- new ml = 128, result[160], len = strlen(msg), repeat;
- if(len > ml)
- {
- repeat = (len / ml);
- for(new i = 0; i <= repeat; i++)
- {
- result[0] = 0;
- if(len - (i * ml) > ml)
- {
- strmid(result, msg, ml * i, ml * (i+1));
- format(result, sizeof(result), "%s ...", result);
- }
- else
- {
- strmid(result, msg, ml * i, len);
- format(result, sizeof(result), "%s", result);
- }
- SendClientMessage(playerid, color, result);
- }
- }
- else
- {
- SendClientMessage(playerid, color, msg);
- }
- }
- stock AdminRecordName(type, vers = 0)
- {
- new name[24];
- switch(vers)
- {
- case 0:
- {
- switch(type)
- {
- case 1: format(name, 24, "Kicked");
- case 2: format(name, 24, "Perm Banned");
- case 3: format(name, 24, "Temp Banned");
- case 4: format(name, 24, "Date Banned");
- case 5: format(name, 24, "Muted");
- case 6: format(name, 24, "Admin Jailed");
- }
- }
- default:
- {
- switch(type)
- {
- case 1: format(name, 24, "Kick");
- case 2: format(name, 24, "Perm Ban");
- case 3: format(name, 24, "Temp Ban");
- case 4: format(name, 24, "Date Ban");
- case 5: format(name, 24, "Mute");
- case 6: format(name, 24, "Admin Jail");
- }
- }
- }
- return name;
- }
- stock ReleaseHospitalizedPlayer(playerid)
- {
- if(!IsInHospital{playerid}) return true;
- SetPlayerHealthEx(playerid, 100.0);
- if(NearestHospital[playerid] == 1)
- {
- SetPlayerPos(playerid, 1242.410400, 328.324157, 19.755510);
- SetPlayerFacingAngle(playerid, 337.314605);
- }
- else if(NearestHospital[playerid] == 2)
- {
- SetPlayerPos(playerid, -319.5080, 1051.3325, 20.3);
- SetPlayerFacingAngle(playerid, 0.0);
- }
- else if(NearestHospital[playerid] == 3)
- {
- SetPlayerPos(playerid, -2201.185546, -2307.431396, 30.625000);
- SetPlayerFacingAngle(playerid, 317.627349);
- }
- else if(NearestHospital[playerid] == 4)
- {
- SetPlayerPos(playerid, -2201.185546, -2307.431396, 30.625000);
- SetPlayerFacingAngle(playerid, 317.627349);
- }
- SetCameraBehindPlayer(playerid);
- SetPlayerSkin(playerid, cPlayersSkin[playerid]);
- IsInHospital{playerid} = false;
- HasJustDied[playerid] = 0;
- NearestHospital[playerid] = 0;
- TogglePlayerControllable(playerid,1);
- if(!PlayerImprisoned{playerid}) SendClientMessage(playerid, COLOR_LIGHTRED, "You have been discharged from hospital. Have a nice day and be careful out there!");
- else SendClientMessage(playerid, COLOR_LIGHTRED, "You have been discharged from the Prison Medical Center.");
- UnlockAchievement(playerid, 42);
- if(JailTime[playerid] > 0)
- {
- new cellid = random(4) + 1;
- JailPlayer(playerid, cellid);
- IsJailed[playerid] = 1;
- JailCell[playerid] = cellid;
- SendClientMessageF(playerid, COLOR_LIGHTBLUE, "You still have %i minutes of jail time to serve.",JailTime[playerid]);
- return true;
- }
- if(AdminJailData[playerid][1] > 0)
- {
- AJailPlayer(playerid);
- AdminJailData[playerid][0] = 1;
- SendClientMessageF(playerid, COLOR_RED, "You still have %i minutes left in the Admin Jail.",AdminJailData[playerid][1]);
- return true;
- }
- SetPlayerSkinEx(playerid, cPlayersSkin[playerid]);
- //SetTimerEx("ScrollWeap", 200, 0, "ddd", playerid, 1, GetPlayerWeapon(playerid));
- return true;
- }
- CMD:paydaytime(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return true;
- TimeOnline[playerid] = strval(params);
- return true;
- }
- stock PayDay(playerid)
- {
- new PayInterest = 0, BasicPay = 0, BizzPay = 0, BizzTax = 0, PayXP = 0, JobPay = 0, TotalPayout = 0, Tax = 0, fName[50], Float:INT_RATE = 0.001;
- if(BankBalance[playerid] >= 1 && BankBalance[playerid] <= 10000) INT_RATE = 0.015;
- else if(BankBalance[playerid] >= 10001 && BankBalance[playerid] <= 50000) INT_RATE = 0.013;
- else if(BankBalance[playerid] >= 50001 && BankBalance[playerid] <= 100000) INT_RATE = 0.011;
- else if(BankBalance[playerid] >= 100001 && BankBalance[playerid] <= 250000) INT_RATE = 0.009;
- else if(BankBalance[playerid] >= 250002 && BankBalance[playerid] <= 500000) INT_RATE = 0.005;
- else if(BankBalance[playerid] >= 500001 && BankBalance[playerid] <= 1000000) INT_RATE = 0.003;
- else if(BankBalance[playerid] >= 1000001 && BankBalance[playerid] <= 3000000) INT_RATE = 0.0009;
- else if(BankBalance[playerid] >= 3000001 && BankBalance[playerid] <= 5000000) INT_RATE = 0.0006;
- else if(BankBalance[playerid] >= 5000001 && BankBalance[playerid] <= 7500000) INT_RATE = 0.0004;
- else if(BankBalance[playerid] >= 7500001 && BankBalance[playerid] <= 10000000) INT_RATE = 0.00035;
- else if(BankBalance[playerid] >= 10000001) INT_RATE = 0.00025;
- new stack = floatround(TimeOnline[playerid] / 60);
- if(stack == 0) stack = 1;
- PayInterest = floatround((BankBalance[playerid] * INT_RATE) * stack);
- Tax += 60;
- if(Faction[playerid] == FACTION_NONE && (Job[playerid] != JOB_MECHANIC && Job[playerid] != JOB_TAXI))
- {
- fName = "Unemployed Benefits";
- BasicPay = 195;
- }
- else if(Faction[playerid] > FACTION_NONE)
- {
- format(fName, 50, GetFactionName(playerid));
- Tax += FACTIONS[Faction[playerid]][FactionPayDayTax];
- BasicPay = FACTIONS[Faction[playerid]][FactionRankPay][FactionRank[playerid]-1];
- }
- for(new biz = 0; biz < MAX_BIZZ_PER_PLAYER; biz++)
- {
- if(PlayerBizzID[playerid][biz] != -1)
- {
- BizzPay += BizzData[PlayerBizzID[playerid][biz]][Payout];
- BizzTax += floatround(0.10 * BizzData[PlayerBizzID[playerid][biz]][Payout]);
- }
- }
- if(Job[playerid] > 0)
- {
- switch(Job[playerid])
- {
- case JOB_MECHANIC,JOB_TAXI: JobPay = 300;
- }
- }
- TotalPayout = floatround((PayInterest + BasicPay + (BizzPay - BizzTax) + JobPay) - Tax);
- SendClientMessage(playerid, COLOR_WHITE, "======== [ PAYDAY ] ========");
- SendClientMessageF(playerid,COLOR_TURQUOISE,"Pay for %s(%s): {FFFFFF}$%s{00CDC6}", fName, GetFactionRankName(Faction[playerid], FactionRank[playerid]), format_cash(BasicPay));
- if(JobPay > 0)
- {
- new JobName[50];
- switch(Job[playerid])
- {
- case JOB_MECHANIC: JobName = "Mechanic";
- case JOB_TAXI: JobName = "Taxi Driver";
- }
- SendClientMessageF(playerid, COLOR_TURQUOISE, "Pay from %s job: {FFFFFF}$%i{00CDC6}", JobName, JobPay);
- }
- if(BizzPay > 0) SendClientMessageF(playerid, COLOR_TURQUOISE, "Business Payout: {FFFFFF}$%s{00CDC6}, Business Tax Deduction: {FFFFFF}$%s{00CDC6}, Total: {FFFFFF}$%s{00CDC6}", format_cash(BizzPay), format_cash(BizzTax), format_cash(BizzPay - BizzTax));
- PayXP = floatround((TimeOnline[playerid] / 30));
- if(PayXP == 0) PayXP = 1;
- if(TotalPayout < 0)
- {
- SendClientMessage(playerid, COLOR_RED, "Your Pay Day was below $0. Thanks to the Government, your minus funds were paid.");
- TotalPayout = 0;
- }
- PlayerXP[playerid] += PayXP;
- BankBalance[playerid] += TotalPayout;
- SendClientMessageF(playerid, COLOR_TURQUOISE, "Interest: {FFFFFF}+$%s{00CDC6}, Experience Points gained: {FFFFFF}%i{00CDC6} (%i Total), Tax Deduction: {FFFFFF}$%i{00CDC6}", format_cash(PayInterest), PayXP, PlayerXP[playerid], Tax);
- new donate[128], dcash, dxp;
- if(IsDonator[playerid] == 1)
- {
- dxp = (2 * stack);
- dcash = (750 * stack);
- PlayerXP[playerid] += dxp;
- BankBalance[playerid] += dcash;
- TotalPayout += dcash;
- if(stack == 1) format(donate, sizeof(donate), "[OOC] Donator Level 1 Bonus: +$750, +2 Experience Points");
- else format(donate, sizeof(donate), "[OOC] Donator Level 1 Bonus: +$%s, +%i Experience Points. ($750 + 2 exp bonus over %i stacked paydays)", format_cash(dcash), dxp, stack);
- }
- else if(IsDonator[playerid] == 2)
- {
- dxp = (3 * stack);
- dcash = (1500 * stack);
- PlayerXP[playerid] += dxp;
- BankBalance[playerid] += dcash;
- TotalPayout += dcash;
- if(stack == 1) format(donate, sizeof(donate), "[OOC] Donator Level 2 Bonus: +$1500, +3 Experience Points");
- else format(donate, sizeof(donate), "[OOC] Donator Level 2 Bonus: +$%s, +%i Experience Points. ($1500 + 3 exp bonus over %i stacked paydays)", format_cash(dcash), dxp, stack);
- }
- else if(IsDonator[playerid] == 3)
- {
- dxp = (4 * stack);
- dcash = (2250 * stack);
- PlayerXP[playerid] += dxp;
- BankBalance[playerid] += dcash;
- TotalPayout += dcash;
- if(stack == 1) format(donate, sizeof(donate), "[OOC] Donator Level 3 Bonus: +$2250, +4 Experience Points");
- else format(donate, sizeof(donate), "[OOC] Donator Level 3 Bonus: +$%s, +%i Experience Points. ($2250 + 4 exp bonus over %i stacked paydays)", format_cash(dcash), dxp, stack);
- }
- else if(IsDonator[playerid] >= 4)
- {
- dxp = (5 * stack);
- dcash = (3000 * stack);
- PlayerXP[playerid] += dxp;
- BankBalance[playerid] += dcash;
- TotalPayout += dcash;
- if(stack == 1) format(donate, sizeof(donate), "[OOC] Donator Level 4 Bonus: +$3000, +5 Experience Points");
- else format(donate, sizeof(donate), "[OOC] Donator Level 4 Bonus: +$%s, +%i Experience Points. ($3000 + 5 exp bonus * %i stacked paydays)", format_cash(dcash), dxp, stack);
- }
- SendClientMessageF(playerid,COLOR_TURQUOISE,"Total Payout: {FFFFFF}$%s{00CDC6}, New bank balance: {FFFFFF}$%s{00CDC6}",format_cash(TotalPayout),format_cash(BankBalance[playerid]));
- SendClientMessage(playerid,COLOR_DONATE, donate);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Bank = %i, PlayerXP = %i, ConnectedTime = 0 WHERE id = %i", BankBalance[playerid], PlayerXP[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- TimeOnline[playerid] = 0;
- if(CheckNumber[playerid] == 1337) UnlockAchievement(playerid, 29);
- CheckNumber[playerid] = 0;
- return true;
- }
- stock ShowPlayerStats(ofplayerid, forplayerid)
- {
- if(IsPlayerConnected(ofplayerid) && Logged{ofplayerid} && IsPlayerConnected(forplayerid) && Logged{forplayerid})
- {
- new Ping = GetPlayerPing(ofplayerid), sampver[32], JobName[50];
- switch(Job[ofplayerid])
- {
- case 0: JobName = "Unemployed";
- case JOB_MECHANIC: JobName = "Mechanic";
- case JOB_TAXI: JobName = "Taxi Driver";
- }
- GetPlayerVersion(ofplayerid, sampver, sizeof(sampver));
- SendClientMessageF(forplayerid, COLOR_YELLOW, "Account Statistics for %s(%s), ID %i [Connected with SA-MP %s. Ping: %ims. FPS: %i]", NameEx(ofplayerid), MasterAccountName[ofplayerid], ofplayerid, sampver, Ping, pFPS[ofplayerid]);
- SendClientMessageF(forplayerid, COLOR_LIGHTGREEN, "[Account] Account Level: %i | Experience Points: %i (%i points until level up [/buylevel]) | Weapon Skill: %i | Donator Level: %i", PlayerLevel[ofplayerid], PlayerXP[ofplayerid], (PlayerLevel[ofplayerid] * 10) - PlayerXP[ofplayerid], WeaponSkillLevel[ofplayerid], IsDonator[ofplayerid]);
- SendClientMessageF(forplayerid, COLOR_LIGHTGREEN, "[Player] Age: %i | Cash: $%s | Bank: $%s | Job: %s", GetPlayerAge(ofplayerid), format_cash(Cash[ofplayerid]), format_cash(BankBalance[ofplayerid]), JobName);
- if(Faction[ofplayerid] >= 1) SendClientMessageF(forplayerid, COLOR_LIGHTGREEN, "[Faction] Faction: %s (Faction ID %i) | Rank: %s (Rank %i)", GetFactionName(ofplayerid), Faction[ofplayerid], GetFactionRankName(Faction[ofplayerid], FactionRank[ofplayerid]), FactionRank[ofplayerid]);
- SendClientMessageF(forplayerid, COLOR_LIGHTGREEN, "[Miscellaneous] Total Deaths: %i | Total Kills: %i", MyDeaths[ofplayerid], MyKills[ofplayerid]);
- if(AdminLevel[ofplayerid] >= 1) SendClientMessageF(forplayerid, COLOR_LIGHTGREEN, "[Admin] Admin Level: %i | Duty Time: %i, Assist Points: %i, Total Score: %i", AdminLevel[ofplayerid], GetDutyTime(ofplayerid), GetAssistCount(ofplayerid), GetTotalScore(ofplayerid));
- if(IsHelper{ofplayerid}) SendClientMessageF(forplayerid, COLOR_LIGHTGREEN, "[Helper] Assist Points: %i", GetAssistCount(ofplayerid));
- SendSplitMessageF(forplayerid, COLOR_LIGHTGREEN, "[Session] Total time played (/ttp): %i minutes | Time since last payday: %i minutes", TotalTimePlayed[ofplayerid], TimeOnline[ofplayerid]);
- }
- return true;
- }
- stock GetAssistCount(playerid)
- {
- new count;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT AssistCount FROM masters WHERE id = %i", MasterAccount[playerid]);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows()) count = cache_get_field_content_int(0, "AssistCount");
- else count = 0;
- cache_delete(result);
- return count;
- }
- stock GetDutyTime(playerid)
- {
- new count;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT DutyTime FROM masters WHERE id = %i", MasterAccount[playerid]);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows()) count = cache_get_field_content_int(0, "DutyTime");
- else count = 0;
- cache_delete(result);
- return count;
- }
- stock GetTotalScore(playerid)
- {
- new count;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT AdminScore FROM masters WHERE id = %i", MasterAccount[playerid]);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows()) count = cache_get_field_content_int(0, "AdminScore");
- else count = 0;
- cache_delete(result);
- return count;
- }
- stock ShowPlayerLicenses(ofplayerid, forplayerid)
- {
- new YesNo1[20], YesNo2[24];
- SendClientMessageF(forplayerid,COLOR_ORANGE, "Licenses For %s:", NameEx(ofplayerid));
- new age, birthyear, birthmonth, birthday, thstndrd[3];
- mysql_format(conn, mquery, sizeof(mquery), "SELECT BirthYear, BirthMonth, BirthDate FROM players WHERE id = %i", SQLID[ofplayerid]);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows())
- {
- birthyear = cache_get_field_content_int(0, "BirthYear");
- birthmonth = cache_get_field_content_int(0, "BirthMonth");
- birthday = cache_get_field_content_int(0, "BirthDate");
- cache_delete(result);
- }
- age = gServerYear - birthyear;
- switch(birthday)
- {
- case 1,21,31: format(thstndrd, sizeof(thstndrd), "st");
- case 2,22: format(thstndrd, sizeof(thstndrd), "nd");
- case 3,23: format(thstndrd, sizeof(thstndrd), "rd");
- default: format(thstndrd, sizeof(thstndrd), "th");
- }
- SendClientMessageF(forplayerid, COLOR_YELLOW, "Date of Birth:{FFFFFF} %i%s of %s, %i. {FBFF00}Age:{FFFFFF} %i.", birthday, thstndrd, GetMonthName(birthmonth), birthyear, age);
- if(Licenses[ofplayerid][LICENSE_CAR] == 1) YesNo1 = "{00AF33}Yes{FBFF00}"; else YesNo1 = "{8C1717}No{FBFF00}";
- if(Licenses[ofplayerid][LICENSE_LGV] == 1) YesNo2 = "{00AF33}Yes{FBFF00}"; else YesNo2 = "{8C1717}No{FBFF00}";
- SendClientMessageF(forplayerid, COLOR_YELLOW, "[Vehicle] General Vehicle License(GVL-1): %s | Large Vehicle License(GVL-2): %s", YesNo1, YesNo2);
- if(Licenses[ofplayerid][LICENSE_BIKE] == 1) YesNo1 = "{00AF33}Yes{FBFF00}"; else YesNo1 = "{8C1717}No{FBFF00}";
- if(Licenses[ofplayerid][LICENSE_BOAT] == 1) YesNo2 = "{00AF33}Yes{FBFF00}"; else YesNo2 = "{8C1717}No{FBFF00}";
- SendClientMessageF(forplayerid, COLOR_YELLOW, "[Vehicle] Motorbike(MB): %s | Boat(B): %s", YesNo1, YesNo2);
- if(Licenses[ofplayerid][LICENSE_HELI] == 1) YesNo1 = "{00AF33}Yes{FBFF00}"; else YesNo1 = "{8C1717}No{FBFF00}";
- if(Licenses[ofplayerid][LICENSE_PLANE] == 1) YesNo2 = "{00AF33}Yes{FBFF00}"; else YesNo2 = "{8C1717}No{FBFF00}";
- SendClientMessageF(forplayerid, COLOR_YELLOW, "[Vehicle] Helicopter(A1): %s | Airplane(A2): %s", YesNo1, YesNo2);
- if(Inventory[ofplayerid][FishingPermit] == 1) YesNo1 = "{00AF33}Yes{FBFF00}"; else YesNo1 = "{8C1717}No{FBFF00}";
- if(WeaponLicense[ofplayerid] == 0) YesNo2 = "{8C1717}No{FBFF00}";
- if(WeaponLicense[ofplayerid] == -1) YesNo2 = "{8C1717}Expired";
- if(WeaponLicense[ofplayerid] == 1) YesNo2 = "{00AF33}A{FBFF00}";
- if(WeaponLicense[ofplayerid] == 2) YesNo2 = "{00AF33}B{FBFF00}";
- if(WeaponLicense[ofplayerid] == 3) YesNo2 = "{00AF33}C{FBFF00}";
- SendClientMessageF(forplayerid, COLOR_YELLOW, "[Other] Fishing Permit: %s | Firearms Permit: %s", YesNo1, YesNo2);
- if(LicenseSuspendTime[ofplayerid][LICENSE_CAR] > 0 || LicenseSuspendTime[ofplayerid][LICENSE_LGV] > 0 || LicenseSuspendTime[ofplayerid][LICENSE_BIKE] > 0 || LicenseSuspendTime[ofplayerid][LICENSE_BOAT] > 0 || LicenseSuspendTime[ofplayerid][LICENSE_HELI] > 0 || LicenseSuspendTime[ofplayerid][LICENSE_PLANE] > 0)
- {
- SendClientMessage(forplayerid,COLOR_ORANGE,"Suspended Licenses:");
- if(LicenseSuspendTime[ofplayerid][LICENSE_CAR] > 0) SendClientMessageF(forplayerid, COLOR_YELLOW, "[Suspended] Car License: {8C1717}%i{FBFF00} minutes remaining", LicenseSuspendTime[ofplayerid][LICENSE_CAR]);
- if(LicenseSuspendTime[ofplayerid][LICENSE_LGV] > 0) SendClientMessageF(forplayerid, COLOR_YELLOW, "[Suspended] Large Vehicle License: {8C1717}%i{FBFF00} minutes remaining", LicenseSuspendTime[ofplayerid][LICENSE_LGV]);
- if(LicenseSuspendTime[ofplayerid][LICENSE_BIKE] > 0) SendClientMessageF(forplayerid, COLOR_YELLOW, "[Suspended] Bike License: {8C1717}%i{FBFF00} minutes remaining", LicenseSuspendTime[ofplayerid][LICENSE_BIKE]);
- if(LicenseSuspendTime[ofplayerid][LICENSE_BOAT] > 0) SendClientMessageF(forplayerid, COLOR_YELLOW, "[Suspended] Boat License: {8C1717}%i{FBFF00} minutes remaining", LicenseSuspendTime[ofplayerid][LICENSE_BOAT]);
- if(LicenseSuspendTime[ofplayerid][LICENSE_HELI] > 0) SendClientMessageF(forplayerid, COLOR_YELLOW, "[Suspended] Helicopter License: {8C1717}%i{FBFF00} minutes remaining", LicenseSuspendTime[ofplayerid][LICENSE_HELI]);
- if(LicenseSuspendTime[ofplayerid][LICENSE_PLANE] > 0) SendClientMessageF(forplayerid, COLOR_YELLOW, "[Suspended] Plane License: {8C1717}%i{FBFF00} minutes remaining", LicenseSuspendTime[ofplayerid][LICENSE_PLANE]);
- }
- return true;
- }
- stock ShowPlayerInventory(ofplayerid, forplayerid)
- {
- gstr[0] = EOS;
- new InventoryHeader[64], sub[64];
- new item_Count = 0;
- if(Inventory[ofplayerid][MobilePhone] == 1)
- {
- strcat(gstr, "\nMobile Phone (/help phone)");
- item_Count ++;
- }
- if(Inventory[ofplayerid][Dice] == 1)
- {
- strcat(gstr, "\nDice (/rolldice)");
- item_Count ++;
- }
- if(Inventory[ofplayerid][FishingRod] == 1)
- {
- format(sub, sizeof(sub), "\nFishing Rod (Durability: %i%%)",FishingRodHealth[ofplayerid]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][FishingPermit] == 1)
- {
- strcat(gstr, "\nFishing Permit");
- item_Count ++;
- }
- if(Inventory[ofplayerid][FishingBait] >= 1)
- {
- format(sub, sizeof(sub), "\nFishing Bait (%i)",Inventory[ofplayerid][FishingBait]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][Radio] == 1)
- {
- strcat(gstr, "\nRadio (/r /ron /roff /rtune)");
- item_Count ++;
- }
- if(Inventory[ofplayerid][FuelCan][0] >= 0)
- {
- new sub2[32];
- if(Inventory[ofplayerid][FuelCan][1] == FUEL_DIESEL) sub2 = "Diesel";
- else sub2 = "Petrol";
- format(sub, sizeof(sub), "\nFuel Container (%i%% Full (%s), /refillfc)",Inventory[ofplayerid][FuelCan][0], sub2);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][Mask] == 1)
- {
- strcat(gstr, "\nMask (/mask /unmask /clothing)");
- item_Count ++;
- }
- if(Inventory[ofplayerid][Watch] == 1)
- {
- strcat(gstr, "\nWatch (/time /showtime)");
- item_Count ++;
- }
- if(Inventory[ofplayerid][Boombox] > 0)
- {
- switch(Inventory[ofplayerid][Boombox])
- {
- case 1: strcat(gstr, "\nSmall Boombox");
- case 2: strcat(gstr, "\nLarge Boombox");
- }
- item_Count++;
- }
- if(Inventory[ofplayerid][Fags] > 0)
- {
- format(sub, sizeof(sub), "\nCigarettes (%i)", Inventory[ofplayerid][Fags]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][Lighter] > 0)
- {
- format(sub, sizeof(sub), "\nLighter (%i%% full)", Inventory[ofplayerid][Lighter]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][GPS] == 1)
- {
- strcat(gstr, "\nPocket GPS (/gps /navigateto)");
- item_Count ++;
- }
- if(Inventory[ofplayerid][Weed] > 0)
- {
- format(sub, sizeof(sub), "\nWeed (%i grams)", Inventory[ofplayerid][Weed]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][MoonShine] > 0)
- {
- format(sub, sizeof(sub), "\nMoonShine (%i litres)", Inventory[ofplayerid][MoonShine]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][Cocaine] > 0)
- {
- format(sub, sizeof(sub), "\nCocaine (%i grams)", Inventory[ofplayerid][Cocaine]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][AmmoBox][AMMOBOX_PISTOL] > 0)
- {
- format(sub, sizeof(sub), "\nPistol Ammo (%i box)", Inventory[ofplayerid][AmmoBox][AMMOBOX_PISTOL]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][AmmoBox][AMMOBOX_SHOTGUN] > 0)
- {
- format(sub, sizeof(sub), "\nShotgun Ammo (%i box)", Inventory[ofplayerid][AmmoBox][AMMOBOX_SHOTGUN]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][AmmoBox][AMMOBOX_SMG] > 0)
- {
- format(sub, sizeof(sub), "\nSMG Ammo (%i box)", Inventory[ofplayerid][AmmoBox][AMMOBOX_SMG]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][AmmoBox][AMMOBOX_RIFLE] > 0)
- {
- format(sub, sizeof(sub), "\nRifle Ammo (%i box)", Inventory[ofplayerid][AmmoBox][AMMOBOX_RIFLE]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][AmmoBox][AMMOBOX_ASSAULT] > 0)
- {
- format(sub, sizeof(sub), "\nAssault Rifle Ammo (%i box)", Inventory[ofplayerid][AmmoBox][AMMOBOX_ASSAULT]);
- strcat(gstr, sub);
- item_Count ++;
- }
- for(new i = 0; i < 5; i++)
- {
- if(Clothes[ofplayerid][i] > 0)
- {
- strcat(gstr, "\nClothes (/clothes /changeclothes)");
- item_Count ++;
- break;
- }
- }
- if(Inventory[ofplayerid][Rope] == 1)
- {
- strcat(gstr, "\nRope (/tie /untie)");
- item_Count ++;
- }
- if(Inventory[ofplayerid][Notepad] == 1)
- {
- strcat(gstr, "\nPaper Notepad (/notepad)");
- item_Count ++;
- }
- if(Inventory[ofplayerid][Pen] > 0)
- {
- format(sub, sizeof(sub), "\nPen (%i%% ink)", Inventory[ofplayerid][Pen]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][Paper] > 0)
- {
- format(sub, sizeof(sub), "\nPaper (x%i)", Inventory[ofplayerid][Paper]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][CarAdapter] == 1)
- {
- strcat(gstr, "\nPhone Car Adapter (/recharge)");
- item_Count ++;
- }
- if(Inventory[ofplayerid][Checks] > 0)
- {
- format(sub, sizeof(sub), "\nCheck Book (x%i)", Inventory[ofplayerid][Checks]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][RollingPaper] > 0)
- {
- format(sub, sizeof(sub), "\nRolling Papers (x%i)", Inventory[ofplayerid][RollingPaper]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][Bong] == 1)
- {
- strcat(gstr, "\nBong");
- item_Count ++;
- }
- if(Inventory[ofplayerid][Calculator] == 1)
- {
- strcat(gstr, "\nBasic Calculator (/calc)");
- item_Count ++;
- }
- if(Inventory[ofplayerid][MedKit] == 1)
- {
- strcat(gstr, "\nFirst Aid Kit (/medkit)");
- item_Count ++;
- }
- if(Inventory[ofplayerid][Toolbox] == 1)
- {
- strcat(gstr, "\nToolbox (Various Tools)");
- item_Count ++;
- }
- if(Inventory[ofplayerid][EngineOil] == 1)
- {
- strcat(gstr, "\nEngine Oil");
- item_Count ++;
- }
- if(Inventory[ofplayerid][Water] > 0)
- {
- format(sub, sizeof(sub), "\nBottled water (%i L)", Inventory[ofplayerid][Water]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(Inventory[ofplayerid][WeedSeed] > 0)
- {
- format(sub, sizeof(sub), "\nWeed Seed (x%i)", Inventory[ofplayerid][WeedSeed]);
- strcat(gstr, sub);
- item_Count ++;
- }
- if(ofplayerid == forplayerid) format(InventoryHeader,56,"My Inventory - %i Items", item_Count);
- else format(InventoryHeader,56,"%s's Inventory - %i Items", NameEx(ofplayerid), item_Count);
- Dialog_Show(forplayerid, DIALOG_NONE, DIALOG_STYLE_LIST, InventoryHeader, gstr, "OK", "");
- return true;
- }
- stock SendSatNavText(playerid, msg[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(vehicleid == 0)
- {
- ProxDetector(20.0, playerid, msg, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- }
- else
- {
- if(WindowState{vehicleid} == WINDOWS_CLOSED)
- {
- foreach(new i: Player)
- {
- if(GetPlayerVehicleID(i) == vehicleid) SendClientMessage(i, COLOR_FADE3, msg);
- }
- }
- else
- {
- ProxDetector(20.0, playerid, msg, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- }
- }
- return true;
- }
- stock UnlockAchievement(playerid, achievementID)
- {
- if(!Logged{playerid}) return true;
- if(HasUnlockedAchievement[playerid][achievementID] == 0)
- {
- AchievementPoints[playerid] += AchievementData[achievementID][PointValue];
- HasUnlockedAchievement[playerid][achievementID] = 1;
- //format(gstr, sizeof(gstr), "Nome: %s\n\n%i Pontos - %s",AchievementData[achievementID][Name],AchievementData[achievementID][PointValue],AchievementData[achievementID][Info]);
- //Dialog_Show(playerid,DIALOG_NONE,DIALOG_STYLE_MSGBOX,"Conquista desbloqueada",gstr,"Continue","");
- //SetPlayerChatBubble(playerid,"* Conquista desbloqueada *", COLOR_LIGHTGREEN, 30.0,5000);
- SavePlayerAchievements(playerid);
- }
- return true;
- }
- stock DestroyRoadblock(playerid, idx)
- {
- if(RoadBlockObjects[playerid][idx] != INVALID_OBJECT_ID)
- {
- DestroyDynamicObjectEx(RoadBlockObjects[playerid][idx], "RoadBlockObjects[playerid][idx]");
- RoadBlockCount[playerid] --;
- RoadBlockObjects[playerid][idx] = INVALID_OBJECT_ID;
- RoadBlockTimer[playerid][idx] = -1;
- }
- }
- stock DestroyDynamicObjectEx(objectid, msg[])
- {
- #if DEBUG_OBJECT_DELETE == true
- printf("Object deletion! [Object ID: %i. Deletion Cause: %s]", objectid, msg);
- #else
- #pragma unused msg
- #endif
- DestroyDynamicObject(objectid);
- return true;
- }
- stock DestroyVehicleEx(v, msg[])
- {
- #if DEBUG_VEHICLE_DELETE == true
- if(VehicleData[v][IdVehicle] == v)
- {
- printf("Vehicle deletion! [Vehicle ID: %i, Vehicle SQLID: %i, Vehicle Owner: %i, Vehicle Regplate: %s, Deletion Cause: %s", v, VehicleData[v][VehSQLID], VehicleData[v][VehicleOwnerSQLID], VehicleData[v][RegPlate], msg);
- }
- #else
- #pragma unused msg
- #endif
- DestroyVehicle(v);
- return true;
- }
- stock GivePlayerWeapons(playerid)
- {
- for(new w = 0; w < MAX_TOTAL_WEAPONS; w++)
- {
- if(WeaponData[playerid][w][Weapon] > 0)
- {
- if(IsBanWeapon(WeaponData[playerid][w][Weapon]) && !IsPlayerAdmin(playerid))
- {
- WeaponData[playerid][w][Weapon] = 0;
- WeaponData[playerid][w][WeaponAmmo] = 0;
- continue;
- }
- GivePlayerWeaponEx(playerid, WeaponData[playerid][w][Weapon], WeaponData[playerid][w][WeaponAmmo], 5);
- }
- }
- SetPlayerArmedWeapon(playerid, 0);
- return true;
- }
- stock AJailPlayer(playerid)
- {
- new cellid = random(3) + 1;
- switch(cellid)
- {
- case 1: SetPlayerPos(playerid, 264.336395, 86.553993, 1001.039062);
- case 2: SetPlayerPos(playerid, 264.417968, 82.287590, 1001.039062);
- case 3: SetPlayerPos(playerid, 264.449401, 77.463584, 1001.039062);
- }
- SetPlayerFacingAngle(playerid, 270.0);
- SetPlayerInterior(playerid, 6);
- SetPlayerVirtualWorldEx(playerid, playerid);
- ResetPlayerWeaponsEx(playerid);
- TogglePlayerControllable(playerid, 0);
- ClearAnimations(playerid);
- SetCameraBehindPlayer(playerid);
- return true;
- }
- stock AUnJailPlayer(playerid)
- {
- SetPlayerPos(playerid,617.2560,-543.5859,16.4770);
- SetPlayerFacingAngle(playerid,270.0);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorldEx(playerid, 0);
- ResetPlayerWeaponsEx(playerid);
- TogglePlayerControllable(playerid,1);
- ClearAnimations(playerid);
- SetCameraBehindPlayer(playerid);
- AdminJailData[playerid][0] = 0;
- AdminJailData[playerid][1] = 0;
- SysMsg(playerid,"You have been released from the Admin Jail.");
- SetUpPlayerSpawn(playerid);
- return true;
- }
- stock IsPlayerPaused(playerid)
- {
- if(GetTickCount() > (PlayerPaused[playerid] + 2000)) return true;
- return false;
- }
- stock CreateVehicleObject(objectid, vehicleid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
- {
- new object = CreateDynamicObject(objectid, 0, 0, 0, 0, 0, 0);
- AttachDynamicObjectToVehicle(object, vehicleid, x, y, z, rx, ry, rz);
- return object;
- }
- stock CheckSpeedCameras(playerid, speed, vid)
- {
- if(SpeedCameraCooldown[playerid] > 0) return true;
- if(FactionIgnoreSpeedCam(playerid)) return true;
- if(IsBoat(vid) || IsPlane(vid) || IsHelicopter(vid) || IsPushBike(vid)) return true;
- if(aspawned{vid}) return true;
- if(ADuty[playerid] == 1) return true;
- if(speed > 65)
- {
- if(PoliceFineAmount[playerid] == -1) PoliceFineAmount[playerid] = 0;
- new ticket = ((speed * 2) + 200);
- PoliceFineAmount[playerid] += ticket;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET PoliceFine = %i WHERE id = %i", PoliceFineAmount[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- SpeedCameraCooldown[playerid] = 10;
- FadeColorForPlayer(playerid, 255, 255, 255, 255, 255, 255, 255, 0, 10, 0);
- foreach(new i: Player)
- {
- if(Logged{i} && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
- {
- FadeColorForPlayer(i, 255, 255, 255, 255, 255, 255, 255, 0, 10, 0);
- }
- }
- SendClientMessageF(playerid, COLOR_WHITE, "[Speed Camera] You are speeding! The limit here is 65 MPH and you were caught at %i MPH. [Ticket Amount: $%i]", speed, ticket);
- SendSplitMessageF(playerid, COLOR_WHITE, "[Speed Camera] Your speeding ticket has been added onto any fines you have. Your total fine is now $%s. You will have to pay the fine or the police may question you about it.", format_cash(PoliceFineAmount[playerid]));
- format(gstr, sizeof(gstr), "* The speed camera flashes as the vehicle drives past *");
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- return true;
- }
- stock PassDMVTest(playerid)
- {
- if(DMV_Testing[playerid] == 0) return false;
- TogglePlayerControllable(playerid, 0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "\n\n");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "[DMV] You have PASSED the practical test!");
- ShowInfoText(playerid, "~g~DMV Testing~n~~w~Result: ~g~Pass", 7000);
- SetTimerEx("PassDMVTest2", 7000, 0, "d", playerid);
- return true;
- }
- stock DestroyAllBoatTestObjects(playerid)
- {
- for(new i = 0; i < 75; i++)
- {
- DestroyDynamicObjectEx(BoatTestObjects[playerid][i], "BoatTestObjects[playerid][i]");
- }
- return true;
- }
- stock GetWalkingSpeed(playerid)
- {
- new Float:Px, Float:Py, Float:Pz, Float:Speed;
- GetPlayerVelocity(playerid, Px, Py, Pz);
- Speed = floatsqroot(floatpower(floatabs(Px),2) + floatpower(floatabs(Py),2) + floatpower(floatabs(Pz),2));
- return floatround(Speed * 100);
- }
- stock IsPlayerNearGasStation(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsPlane(GetPlayerVehicleID(playerid)) || IsHelicopter(GetPlayerVehicleID(playerid)))
- {
- if(IsPlayerInRangeOfPoint(playerid, 30.0, 364.6, 2486.39, 17)) return true; //Aviation
- if(IsPlayerInRangeOfPoint(playerid, 10.0, 282.734, 1985.98, 17.6406)) return true; //Aperture_Gas
- }
- else if(IsBoat(GetPlayerVehicleID(playerid)))
- {
- if(IsPlayerInRangeOfPoint(playerid, 15.0, -2206.6597, 2413.4763, 2.4790)) return true; //Bayside Boat Fuel
- if(IsPlayerInRangeOfPoint(playerid, 15.0, -2224.3342,2395.0005,2.4692)) return true; //Bayside Boat Fuel
- }
- else
- {
- if(IsPlayerInRangeOfPoint(playerid, 10.0, -242.597656, 1210.160644, 19.917188)) return true; //FC_Gas
- if(IsPlayerInRangeOfPoint(playerid, 15.0, 617.126, 1704.64, 6.9922)) return true; //BCE_Gas
- if(IsPlayerInRangeOfPoint(playerid, 10.0, -1328.932861, 2672.788574, 50.0625)) return true; //ELQ_Gas
- if(IsPlayerInRangeOfPoint(playerid, 10.0, -1327.437866, 2681.705566, 50.0625)) return true; //ELQ_Gas
- if(IsPlayerInRangeOfPoint(playerid, 10.0, -1464.871582, 1864.321655, 32.632812)) return true; //BCW_Gas
- if(IsPlayerInRangeOfPoint(playerid, 10.0, -1477.129638, 1863.631225, 32.632812)) return true; //BCW_Gas
- if(IsPlayerInRangeOfPoint(playerid, 10.0, 654.963134, -570.421020, 16.501491)) return true; //Dillimore_Gas
- if(IsPlayerInRangeOfPoint(playerid, 10.0, 654.968933, -559.746826, 16.501491)) return true; //Dillimore_Gas
- if(IsPlayerInRangeOfPoint(playerid, 10.0, 2278.452392, 29.398574, 26.469129)) return true; //Palomino_Gas
- if(IsPlayerInRangeOfPoint(playerid, 10.0, 1382.300415, 460.139129, 20.345203)) return true; //Montgomery_Gas
- if(IsPlayerInRangeOfPoint(playerid, 10.0, -89.014045, -1164.160766, 2.283989)) return true; //Flint_Gas
- if(IsPlayerInRangeOfPoint(playerid, 10.0, -93.252464, -1174.549316, 2.277766)) return true; //Flint_Gas
- if(IsPlayerInRangeOfPoint(playerid, 10.0, -1602.845214, -2710.095947, 48.533473)) return true; //APServices_Gas
- if(IsPlayerInRangeOfPoint(playerid, 10.0, -1608.747070, -2718.385009, 48.539062)) return true; //APServices_Gas
- if(IsPlayerInRangeOfPoint(playerid, 10.0, -2244.150146, -2560.713867, 31.921875)) return true; //AP_Gas
- }
- }
- return false;
- }
- stock GetMotelID(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 89.125534, 1182.618896, 20.664062)) return 1;
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 13.593950, 1188.600219, 21.320938)) return 2;
- if(IsPlayerInRangeOfPoint(playerid, 5.0, -9.583352, 1209.571655, 21.352746)) return 3;
- if(IsPlayerInRangeOfPoint(playerid, 5.0, -103.805709, 1210.550415, 21.735198)) return 4;
- if(IsPlayerInRangeOfPoint(playerid, 5.0, -779.544311, 2744.700439, 47.682723)) return 5;
- if(IsPlayerInRangeOfPoint(playerid, 5.0, -2201.568359, -2264.570556, 30.625)) return 6;
- if(IsPlayerInRangeOfPoint(playerid, 5.0, -1623.976562, -2693.890869, 48.74266)) return 7;
- if(IsPlayerInRangeOfPoint(playerid, 5.0, -818.3351, -1897.9431, 10.8704)) return 8;
- if(IsPlayerInRangeOfPoint(playerid, 5.0, -2343.6165,-1626.9683, 483.7802)) return 9;
- return false;
- }
- stock SetPlayerCheckpointEx(playerid, Float:x, Float:y, Float:z, Float:size)
- {
- SetTimerEx("New_SetPlayerCheckpoint", 400, 0, "dffff", playerid, x, y, z, size);
- }
- stock SetPlayerRaceCheckpointEx(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size)
- {
- SetTimerEx("New_SetPlayerRaceCheckpoint", 400, 0, "ddfffffff", playerid, type, x, y, z, nextx, nexty, nextz, size);
- }
- stock ShowMessage(playerid, caption[], info[], button[])
- {
- Dialog_Show(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, caption, info, button, "");
- return true;
- }
- stock GivePlayerCash(playerid, cash)
- {
- ConsumingMoney[playerid] = 1;
- Cash[playerid] += cash;
- GivePlayerMoney(playerid, cash);
- MySQLUpdateInt(SQLID[playerid], "Cash", Cash[playerid], "players");
- return true;
- }
- stock SetPlayerCash(playerid, cash)
- {
- ConsumingMoney[playerid] = 1;
- Cash[playerid] = cash;
- ResetPlayerMoney(playerid);
- GivePlayerMoney(playerid, cash);
- }
- stock CreatePTextdraws(playerid)
- {
- //character selection textdraws
- CharSelWelcome[playerid] = CreatePlayerTextDraw(playerid, 320.000000, 93.762977, "Welcome to GSRP, %s!");
- PlayerTextDrawLetterSize(playerid, CharSelWelcome[playerid], 0.291666, 1.512887);
- PlayerTextDrawAlignment(playerid, CharSelWelcome[playerid], 2);
- PlayerTextDrawColor(playerid, CharSelWelcome[playerid], -1);
- PlayerTextDrawSetShadow(playerid, CharSelWelcome[playerid], 0);
- PlayerTextDrawSetOutline(playerid, CharSelWelcome[playerid], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelWelcome[playerid], 255);
- PlayerTextDrawFont(playerid, CharSelWelcome[playerid], 1);
- PlayerTextDrawSetProportional(playerid, CharSelWelcome[playerid], 1);
- PlayerTextDrawSetShadow(playerid, CharSelWelcome[playerid], 0);
- CharSelInfoTD[playerid][0][0] = CreatePlayerTextDraw(playerid, 199.049240, 128.451812, "");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][0][0], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, CharSelInfoTD[playerid][0][0], 70.000000, 90.000000);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][0][0], 1);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][0][0], -1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][0][0], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][0][0], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][0][0], 0);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][0][0], 5);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][0][0], 0);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][0][0], 0);
- PlayerTextDrawSetSelectable(playerid, CharSelInfoTD[playerid][0][0], true);
- PlayerTextDrawSetPreviewModel(playerid, CharSelInfoTD[playerid][0][0], 0);
- PlayerTextDrawSetPreviewRot(playerid, CharSelInfoTD[playerid][0][0], 0.000000, 0.000000, 0.000000, 1.000000);
- CharSelInfoTD[playerid][1][0] = CreatePlayerTextDraw(playerid, 259.899780, 128.451812, "");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][1][0], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, CharSelInfoTD[playerid][1][0], 70.000000, 90.000000);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][1][0], 1);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][1][0], -1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][1][0], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][1][0], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][1][0], 0);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][1][0], 5);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][1][0], 0);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][1][0], 0);
- PlayerTextDrawSetSelectable(playerid, CharSelInfoTD[playerid][1][0], true);
- PlayerTextDrawSetPreviewModel(playerid, CharSelInfoTD[playerid][1][0], 0);
- PlayerTextDrawSetPreviewRot(playerid, CharSelInfoTD[playerid][1][0], 0.000000, 0.000000, 0.000000, 1.000000);
- CharSelInfoTD[playerid][2][0] = CreatePlayerTextDraw(playerid, 320.448974, 128.451812, "");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][2][0], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, CharSelInfoTD[playerid][2][0], 70.000000, 90.000000);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][2][0], 1);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][2][0], -1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][2][0], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][2][0], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][2][0], 0);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][2][0], 5);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][2][0], 0);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][2][0], 0);
- PlayerTextDrawSetSelectable(playerid, CharSelInfoTD[playerid][2][0], true);
- PlayerTextDrawSetPreviewModel(playerid, CharSelInfoTD[playerid][2][0], 0);
- PlayerTextDrawSetPreviewRot(playerid, CharSelInfoTD[playerid][2][0], 0.000000, 0.000000, 0.000000, 1.000000);
- CharSelInfoTD[playerid][3][0] = CreatePlayerTextDraw(playerid, 374.947418, 128.451812, "");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][3][0], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, CharSelInfoTD[playerid][3][0], 70.000000, 90.000000);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][3][0], 1);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][3][0], -1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][3][0], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][3][0], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][3][0], 0);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][3][0], 5);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][3][0], 0);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][3][0], 0);
- PlayerTextDrawSetSelectable(playerid, CharSelInfoTD[playerid][3][0], true);
- PlayerTextDrawSetPreviewModel(playerid, CharSelInfoTD[playerid][3][0], 0);
- PlayerTextDrawSetPreviewRot(playerid, CharSelInfoTD[playerid][3][0], 0.000000, 0.000000, 0.000000, 1.000000);
- CharSelInfoTD[playerid][0][1] = CreatePlayerTextDraw(playerid, 234.766998, 225.803619, "name1");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][0][1], 0.144996, 0.706072);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][0][1], 2);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][0][1], 0xFFFFFFFF);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][0][1], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][0][1], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][0][1], 255);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][0][1], 1);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][0][1], 1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][0][1], 0);
- CharSelInfoTD[playerid][1][1] = CreatePlayerTextDraw(playerid, 296.067260, 225.803619, "name2");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][1][1], 0.144996, 0.706072);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][1][1], 2);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][1][1], 0xFFFFFFFF);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][1][1], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][1][1], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][1][1], 255);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][1][1], 1);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][1][1], 1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][1][1], 0);
- CharSelInfoTD[playerid][2][1] = CreatePlayerTextDraw(playerid, 357.567260, 225.803619, "name3");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][2][1], 0.144996, 0.706072);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][2][1], 2);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][2][1], 0xFFFFFFFF);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][2][1], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][2][1], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][2][1], 255);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][2][1], 1);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][2][1], 1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][2][1], 0);
- CharSelInfoTD[playerid][3][1] = CreatePlayerTextDraw(playerid, 411.567260, 225.803619, "name4");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][3][1], 0.144996, 0.706072);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][3][1], 2);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][3][1], 0xFFFFFFFF);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][3][1], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][3][1], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][3][1], 255);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][3][1], 1);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][3][1], 1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][3][1], 0);
- CharSelInfoTD[playerid][0][2] = CreatePlayerTextDraw(playerid, 234.766998, 235.303619, "faction1");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][0][2], 0.144996, 0.706072);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][0][2], 2);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][0][2], 0xFFFFFFFF);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][0][2], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][0][2], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][0][2], 255);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][0][2], 1);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][0][2], 1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][0][2], 0);
- CharSelInfoTD[playerid][1][2] = CreatePlayerTextDraw(playerid, 295.766998, 235.303619, "faction2");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][1][2], 0.144996, 0.706072);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][1][2], 2);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][1][2], 0xFFFFFFFF);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][1][2], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][1][2], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][1][2], 255);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][1][2], 1);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][1][2], 1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][1][2], 0);
- CharSelInfoTD[playerid][2][2] = CreatePlayerTextDraw(playerid, 356.766998, 235.303619, "faction3");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][2][2], 0.144996, 0.706072);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][2][2], 2);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][2][2], 0xFFFFFFFF);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][2][2], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][2][2], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][2][2], 255);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][2][2], 1);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][2][2], 1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][2][2], 0);
- CharSelInfoTD[playerid][3][2] = CreatePlayerTextDraw(playerid, 411.266998, 235.303619, "faction4");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][3][2], 0.144996, 0.706072);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][3][2], 2);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][3][2], 0xFFFFFFFF);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][3][2], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][3][2], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][3][2], 255);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][3][2], 1);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][3][2], 1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][3][2], 0);
- CharSelInfoTD[playerid][0][3] = CreatePlayerTextDraw(playerid, 234.766998, 125.703689, "level1");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][0][3], 0.144996, 0.706072);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][0][3], 2);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][0][3], 0xFFFFFFFF);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][0][3], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][0][3], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][0][3], 255);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][0][3], 1);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][0][3], 1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][0][3], 0);
- CharSelInfoTD[playerid][1][3] = CreatePlayerTextDraw(playerid, 295.266998, 125.703689, "level2");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][1][3], 0.144996, 0.706072);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][1][3], 2);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][1][3], 0xFFFFFFFF);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][1][3], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][1][3], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][1][3], 255);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][1][3], 1);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][1][3], 1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][1][3], 0);
- CharSelInfoTD[playerid][2][3] = CreatePlayerTextDraw(playerid, 356.266998, 125.703689, "level3");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][2][3], 0.144996, 0.706072);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][2][3], 2);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][2][3], 0xFFFFFFFF);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][2][3], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][2][3], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][2][3], 255);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][2][3], 1);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][2][3], 1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][2][3], 0);
- CharSelInfoTD[playerid][3][3] = CreatePlayerTextDraw(playerid, 411.266998, 125.703689, "level4");
- PlayerTextDrawLetterSize(playerid, CharSelInfoTD[playerid][3][3], 0.144996, 0.706072);
- PlayerTextDrawAlignment(playerid, CharSelInfoTD[playerid][3][3], 2);
- PlayerTextDrawColor(playerid, CharSelInfoTD[playerid][3][3], 0xFFFFFFFF);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][3][3], 0);
- PlayerTextDrawSetOutline(playerid, CharSelInfoTD[playerid][3][3], 0);
- PlayerTextDrawBackgroundColor(playerid, CharSelInfoTD[playerid][3][3], 255);
- PlayerTextDrawFont(playerid, CharSelInfoTD[playerid][3][3], 1);
- PlayerTextDrawSetProportional(playerid, CharSelInfoTD[playerid][3][3], 1);
- PlayerTextDrawSetShadow(playerid, CharSelInfoTD[playerid][3][3], 0);
- /*
- FuelText[playerid] = CreatePlayerTextDraw(playerid, 521.0, 404.0, "~b~GAL ~l~I~w~IIIIIIIIII~l~I");
- PlayerTextDrawAlignment(playerid, FuelText[playerid], 0);
- PlayerTextDrawBackgroundColor(playerid, FuelText[playerid], 0x000000FF);
- PlayerTextDrawFont(playerid, FuelText[playerid], 2);
- PlayerTextDrawLetterSize(playerid, FuelText[playerid], 0.299999, 1.500000);
- PlayerTextDrawColor(playerid, FuelText[playerid], 0xFFFFFFFF);
- PlayerTextDrawSetOutline(playerid, FuelText[playerid], 1);
- PlayerTextDrawSetProportional(playerid, FuelText[playerid], 1);
- PlayerTextDrawSetShadow(playerid, FuelText[playerid], 1);
- */
- /* vidaTxd[playerid] = CreatePlayerTextDraw(playerid, 606.500000, 58.187500, "mdl-2000:Health-100");
- PlayerTextDrawLetterSize(playerid, vidaTxd[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, vidaTxd[playerid], 23.500000, 22.750000);
- PlayerTextDrawAlignment(playerid, vidaTxd[playerid], 1);
- PlayerTextDrawColor(playerid, vidaTxd[playerid], -1);
- PlayerTextDrawSetShadow(playerid, vidaTxd[playerid], 0);
- PlayerTextDrawSetOutline(playerid, vidaTxd[playerid], 0);
- PlayerTextDrawFont(playerid, vidaTxd[playerid], 4);
- coleteTxd[playerid] = CreatePlayerTextDraw(playerid, 605.000000, 36.312500, "mdl-2000:Armor-100");
- PlayerTextDrawLetterSize(playerid, coleteTxd[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, coleteTxd[playerid], 26.000000, 25.812500);
- PlayerTextDrawAlignment(playerid, coleteTxd[playerid], 1);
- PlayerTextDrawColor(playerid, coleteTxd[playerid], -1);
- PlayerTextDrawSetShadow(playerid, coleteTxd[playerid], 0);
- PlayerTextDrawSetOutline(playerid, coleteTxd[playerid], 0);
- PlayerTextDrawFont(playerid, coleteTxd[playerid], 4);*/
- //TEXTDRAW - BATERIA DO CELULAR
- textdrawBateria0[playerid] = CreatePlayerTextDraw(playerid, 609.500000, 74.375000, "mdl-2000:Phone-0");
- PlayerTextDrawLetterSize(playerid, textdrawBateria0[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, textdrawBateria0[playerid], 32.500000, 29.312500);
- PlayerTextDrawAlignment(playerid, textdrawBateria0[playerid], 2);
- PlayerTextDrawColor(playerid, textdrawBateria0[playerid], -1);
- PlayerTextDrawSetShadow(playerid, textdrawBateria0[playerid], 0);
- PlayerTextDrawSetOutline(playerid, textdrawBateria0[playerid], 0);
- PlayerTextDrawFont(playerid, textdrawBateria0[playerid], 4);
- textdrawBateria20[playerid] = CreatePlayerTextDraw(playerid, 609.500000, 74.375000, "mdl-2000:Phone-20");
- PlayerTextDrawLetterSize(playerid, textdrawBateria20[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, textdrawBateria20[playerid], 32.500000, 29.312500);
- PlayerTextDrawAlignment(playerid, textdrawBateria20[playerid], 2);
- PlayerTextDrawColor(playerid, textdrawBateria20[playerid], -1);
- PlayerTextDrawSetShadow(playerid, textdrawBateria20[playerid], 0);
- PlayerTextDrawSetOutline(playerid, textdrawBateria20[playerid], 0);
- PlayerTextDrawFont(playerid, textdrawBateria20[playerid], 4);
- textdrawBateria40[playerid] = CreatePlayerTextDraw(playerid, 609.500000, 74.375000, "mdl-2000:Phone-40");
- PlayerTextDrawLetterSize(playerid, textdrawBateria40[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, textdrawBateria40[playerid], 32.500000, 29.312500);
- PlayerTextDrawAlignment(playerid, textdrawBateria40[playerid], 2);
- PlayerTextDrawColor(playerid, textdrawBateria40[playerid], -1);
- PlayerTextDrawSetShadow(playerid, textdrawBateria40[playerid], 0);
- PlayerTextDrawSetOutline(playerid, textdrawBateria40[playerid], 0);
- PlayerTextDrawFont(playerid, textdrawBateria40[playerid], 4);
- textdrawBateria60[playerid] = CreatePlayerTextDraw(playerid, 609.500000, 74.375000, "mdl-2000:Phone-60");
- PlayerTextDrawLetterSize(playerid, textdrawBateria60[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, textdrawBateria60[playerid], 32.500000, 29.312500);
- PlayerTextDrawAlignment(playerid, textdrawBateria60[playerid], 2);
- PlayerTextDrawColor(playerid, textdrawBateria60[playerid], -1);
- PlayerTextDrawSetShadow(playerid, textdrawBateria60[playerid], 0);
- PlayerTextDrawSetOutline(playerid, textdrawBateria60[playerid], 0);
- PlayerTextDrawFont(playerid, textdrawBateria60[playerid], 4);
- textdrawBateria80[playerid] = CreatePlayerTextDraw(playerid, 609.500000, 74.375000, "mdl-2000:Phone-80");
- PlayerTextDrawLetterSize(playerid, textdrawBateria80[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, textdrawBateria80[playerid], 32.500000, 29.312500);
- PlayerTextDrawAlignment(playerid, textdrawBateria80[playerid], 2);
- PlayerTextDrawColor(playerid, textdrawBateria80[playerid], -1);
- PlayerTextDrawSetShadow(playerid, textdrawBateria80[playerid], 0);
- PlayerTextDrawSetOutline(playerid, textdrawBateria80[playerid], 0);
- PlayerTextDrawFont(playerid, textdrawBateria80[playerid], 4);
- textdrawBateria100[playerid] = CreatePlayerTextDraw(playerid, 609.500000, 74.375000, "mdl-2000:Phone-100");
- PlayerTextDrawLetterSize(playerid, textdrawBateria100[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, textdrawBateria100[playerid], 32.500000, 29.312500);
- PlayerTextDrawAlignment(playerid, textdrawBateria100[playerid], 2);
- PlayerTextDrawColor(playerid, textdrawBateria100[playerid], -1);
- PlayerTextDrawSetShadow(playerid, textdrawBateria100[playerid], 0);
- PlayerTextDrawSetOutline(playerid, textdrawBateria100[playerid], 0);
- PlayerTextDrawFont(playerid, textdrawBateria100[playerid], 4);
- InfoText[playerid] = CreatePlayerTextDraw(playerid, 320.0,394.0,"");
- PlayerTextDrawAlignment(playerid, InfoText[playerid],2);
- PlayerTextDrawBackgroundColor(playerid, InfoText[playerid],0x000000FF);
- PlayerTextDrawFont(playerid, InfoText[playerid],1);
- PlayerTextDrawLetterSize(playerid, InfoText[playerid],0.199999,1.1);
- PlayerTextDrawColor(playerid, InfoText[playerid],0xFFFFFF);
- PlayerTextDrawSetOutline(playerid, InfoText[playerid],1);
- PlayerTextDrawSetProportional(playerid, InfoText[playerid],1);
- PlayerTextDrawSetShadow(playerid, InfoText[playerid],1);
- DeathText[playerid] = CreatePlayerTextDraw(playerid, 570.0,240.0,"");
- PlayerTextDrawAlignment(playerid, DeathText[playerid],0);
- PlayerTextDrawBackgroundColor(playerid, DeathText[playerid],0x000000FF);
- PlayerTextDrawFont(playerid, DeathText[playerid],1);
- PlayerTextDrawLetterSize(playerid, DeathText[playerid],0.199999,1.1);
- PlayerTextDrawColor(playerid, DeathText[playerid],0xFFFFFF);
- PlayerTextDrawSetOutline(playerid, DeathText[playerid],1);
- PlayerTextDrawSetProportional(playerid, DeathText[playerid],1);
- PlayerTextDrawSetShadow(playerid, DeathText[playerid],1);
- SpeedText[playerid] = CreatePlayerTextDraw(playerid, 555.111389, 420.124511, "~w~0 KM");
- PlayerTextDrawAlignment(playerid, SpeedText[playerid],2);
- PlayerTextDrawBackgroundColor(playerid, SpeedText[playerid],0x000000FF);
- PlayerTextDrawFont(playerid, SpeedText[playerid],2);
- PlayerTextDrawLetterSize(playerid, SpeedText[playerid],0.317110, 1.241600);
- PlayerTextDrawColor(playerid, SpeedText[playerid],0xFFFFFFFF);
- PlayerTextDrawSetOutline(playerid, SpeedText[playerid],1);
- PlayerTextDrawSetProportional(playerid, SpeedText[playerid],1);
- PlayerTextDrawSetShadow(playerid, SpeedText[playerid],1);
-
- SpeedTextM[playerid] = CreatePlayerTextDraw(playerid, 598.666748, 343.466644, "~w~0");
- PlayerTextDrawAlignment(playerid, SpeedTextM[playerid],2);
- PlayerTextDrawBackgroundColor(playerid, SpeedTextM[playerid],0x000000FF);
- PlayerTextDrawFont(playerid, SpeedTextM[playerid],2);
- PlayerTextDrawLetterSize(playerid, SpeedTextM[playerid], 0.404222, 1.455644);
- PlayerTextDrawColor(playerid, SpeedTextM[playerid],0xFFFFFFFF);
- PlayerTextDrawSetOutline(playerid, SpeedTextM[playerid],1);
- PlayerTextDrawSetProportional(playerid, SpeedTextM[playerid],1);
- PlayerTextDrawSetShadow(playerid, SpeedTextM[playerid],1);
- Speedo3dl[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 354.375000, "mdl-2000:Speedo-0");
- PlayerTextDrawLetterSize(playerid, Speedo3dl[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, Speedo3dl[playerid], 88.000000, 92.750000);
- PlayerTextDrawAlignment(playerid, Speedo3dl[playerid], 1);
- PlayerTextDrawColor(playerid, Speedo3dl[playerid], -1);
- PlayerTextDrawSetShadow(playerid, Speedo3dl[playerid], 0);
- PlayerTextDrawSetOutline(playerid, Speedo3dl[playerid], 0);
- PlayerTextDrawFont(playerid, Speedo3dl[playerid], 4);
- Speedo3dl10[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 354.375000, "mdl-2000:Speedo-10");
- PlayerTextDrawLetterSize(playerid, Speedo3dl10[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, Speedo3dl10[playerid], 88.000000, 92.750000);
- PlayerTextDrawAlignment(playerid, Speedo3dl10[playerid], 1);
- PlayerTextDrawColor(playerid, Speedo3dl10[playerid], -1);
- PlayerTextDrawSetShadow(playerid, Speedo3dl10[playerid], 0);
- PlayerTextDrawSetOutline(playerid, Speedo3dl10[playerid], 0);
- PlayerTextDrawFont(playerid, Speedo3dl10[playerid], 4);
- Speedo3dl20[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 354.375000, "mdl-2000:Speedo-20");
- PlayerTextDrawLetterSize(playerid, Speedo3dl20[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, Speedo3dl20[playerid], 88.000000, 92.750000);
- PlayerTextDrawAlignment(playerid, Speedo3dl20[playerid], 1);
- PlayerTextDrawColor(playerid, Speedo3dl20[playerid], -1);
- PlayerTextDrawSetShadow(playerid, Speedo3dl20[playerid], 0);
- PlayerTextDrawSetOutline(playerid, Speedo3dl20[playerid], 0);
- PlayerTextDrawFont(playerid, Speedo3dl20[playerid], 4);
- Speedo3dl30[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 354.375000, "mdl-2000:Speedo-30");
- PlayerTextDrawLetterSize(playerid, Speedo3dl30[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, Speedo3dl30[playerid], 88.000000, 92.750000);
- PlayerTextDrawAlignment(playerid, Speedo3dl30[playerid], 1);
- PlayerTextDrawColor(playerid, Speedo3dl30[playerid], -1);
- PlayerTextDrawSetShadow(playerid, Speedo3dl30[playerid], 0);
- PlayerTextDrawSetOutline(playerid, Speedo3dl30[playerid], 0);
- PlayerTextDrawFont(playerid, Speedo3dl30[playerid], 4);
- Speedo3dl40[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 354.375000, "mdl-2000:Speedo-40");
- PlayerTextDrawLetterSize(playerid, Speedo3dl40[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, Speedo3dl40[playerid], 88.000000, 92.750000);
- PlayerTextDrawAlignment(playerid, Speedo3dl40[playerid], 1);
- PlayerTextDrawColor(playerid, Speedo3dl40[playerid], -1);
- PlayerTextDrawSetShadow(playerid, Speedo3dl40[playerid], 0);
- PlayerTextDrawSetOutline(playerid, Speedo3dl40[playerid], 0);
- PlayerTextDrawFont(playerid, Speedo3dl40[playerid], 4);
- Speedo3dl50[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 354.375000, "mdl-2000:Speedo-50");
- PlayerTextDrawLetterSize(playerid, Speedo3dl50[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, Speedo3dl50[playerid], 88.000000, 92.750000);
- PlayerTextDrawAlignment(playerid, Speedo3dl50[playerid], 1);
- PlayerTextDrawColor(playerid, Speedo3dl50[playerid], -1);
- PlayerTextDrawSetShadow(playerid, Speedo3dl50[playerid], 0);
- PlayerTextDrawSetOutline(playerid, Speedo3dl50[playerid], 0);
- PlayerTextDrawFont(playerid, Speedo3dl50[playerid], 4);
- Speedo3dl60[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 354.375000, "mdl-2000:Speedo-60");
- PlayerTextDrawLetterSize(playerid, Speedo3dl60[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, Speedo3dl60[playerid], 88.000000, 92.750000);
- PlayerTextDrawAlignment(playerid, Speedo3dl60[playerid], 1);
- PlayerTextDrawColor(playerid, Speedo3dl60[playerid], -1);
- PlayerTextDrawSetShadow(playerid, Speedo3dl60[playerid], 0);
- PlayerTextDrawSetOutline(playerid, Speedo3dl60[playerid], 0);
- PlayerTextDrawFont(playerid, Speedo3dl60[playerid], 4);
- Speedo3dl70[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 354.375000, "mdl-2000:Speedo-70");
- PlayerTextDrawLetterSize(playerid, Speedo3dl70[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, Speedo3dl70[playerid], 88.000000, 92.750000);
- PlayerTextDrawAlignment(playerid, Speedo3dl70[playerid], 1);
- PlayerTextDrawColor(playerid, Speedo3dl70[playerid], -1);
- PlayerTextDrawSetShadow(playerid, Speedo3dl70[playerid], 0);
- PlayerTextDrawSetOutline(playerid, Speedo3dl70[playerid], 0);
- PlayerTextDrawFont(playerid, Speedo3dl70[playerid], 4);
- Speedo3dl80[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 354.375000, "mdl-2000:Speedo-80");
- PlayerTextDrawLetterSize(playerid, Speedo3dl80[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, Speedo3dl80[playerid], 88.000000, 92.750000);
- PlayerTextDrawAlignment(playerid, Speedo3dl80[playerid], 1);
- PlayerTextDrawColor(playerid, Speedo3dl80[playerid], -1);
- PlayerTextDrawSetShadow(playerid, Speedo3dl80[playerid], 0);
- PlayerTextDrawSetOutline(playerid, Speedo3dl80[playerid], 0);
- PlayerTextDrawFont(playerid, Speedo3dl80[playerid], 4);
- Speedo3dl90[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 354.375000, "mdl-2000:Speedo-90");
- PlayerTextDrawLetterSize(playerid, Speedo3dl90[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, Speedo3dl90[playerid], 88.000000, 92.750000);
- PlayerTextDrawAlignment(playerid, Speedo3dl90[playerid], 1);
- PlayerTextDrawColor(playerid, Speedo3dl90[playerid], -1);
- PlayerTextDrawSetShadow(playerid, Speedo3dl90[playerid], 0);
- PlayerTextDrawSetOutline(playerid, Speedo3dl90[playerid], 0);
- PlayerTextDrawFont(playerid, Speedo3dl90[playerid], 4);
- pSpecTD[playerid] = CreatePlayerTextDraw(playerid, 320.000000, 370.000000, "");
- PlayerTextDrawAlignment(playerid, pSpecTD[playerid], 2);
- PlayerTextDrawBackgroundColor(playerid, pSpecTD[playerid], 255);
- PlayerTextDrawFont(playerid, pSpecTD[playerid], 1);
- PlayerTextDrawLetterSize(playerid, pSpecTD[playerid], 0.380000, 1.399999);
- PlayerTextDrawColor(playerid, pSpecTD[playerid], -1);
- PlayerTextDrawSetOutline(playerid, pSpecTD[playerid], 1);
- PlayerTextDrawSetProportional(playerid, pSpecTD[playerid], 1);
- DMV[playerid] = CreatePlayerTextDraw(playerid, 450.0,162.0,"~w~Upcoming Speed Limit: ~g~0 MPH~n~~w~Current Speed Limit: ~g~0 MPH~n~~w~Damage: ~g~0/10 %%~n~~w~Time Taken: ~g~0 seconds");
- PlayerTextDrawAlignment(playerid, DMV[playerid],0);
- PlayerTextDrawBackgroundColor(playerid, DMV[playerid],0x000000FF);
- PlayerTextDrawFont(playerid, DMV[playerid],1);
- PlayerTextDrawLetterSize(playerid, DMV[playerid],0.299999,1.4);
- PlayerTextDrawColor(playerid, DMV[playerid],COLOR_WHITE);
- PlayerTextDrawSetOutline(playerid, DMV[playerid],1);
- PlayerTextDrawSetProportional(playerid, DMV[playerid],1);
- PlayerTextDrawSetShadow(playerid, DMV[playerid],1);
- Signcheck[playerid] = CreatePlayerTextDraw(playerid,550.000000, 100.000000, "~g~~h~~h~Payday: ~w~0000");
- PlayerTextDrawAlignment(playerid, Signcheck[playerid],2);
- PlayerTextDrawBackgroundColor(playerid, Signcheck[playerid], 255);
- PlayerTextDrawLetterSize(playerid, Signcheck[playerid], 0.319999, 1.100000);
- PlayerTextDrawFont(playerid, Signcheck[playerid],2);
- PlayerTextDrawColor(playerid, Signcheck[playerid],COLOR_WHITE);
- PlayerTextDrawSetOutline(playerid, Signcheck[playerid],1);
- PlayerTextDrawSetProportional(playerid, Signcheck[playerid],1);
- //PlayerTextDrawSetShadow(playerid, Signcheck[playerid],1);
- /*MaskHelpText[playerid] = CreatePlayerTextDraw(playerid, 320.0,394.0,"~w~< ~b~100 ~w~>");
- PlayerTextDrawAlignment(playerid, MaskHelpText[playerid],2);
- PlayerTextDrawBackgroundColor(playerid, MaskHelpText[playerid],0x000000FF);
- PlayerTextDrawFont(playerid, MaskHelpText[playerid],1);
- PlayerTextDrawLetterSize(playerid, MaskHelpText[playerid],0.499999,2.3);
- PlayerTextDrawColor(playerid, MaskHelpText[playerid],COLOR_WHITE);
- PlayerTextDrawSetOutline(playerid, MaskHelpText[playerid],1);
- PlayerTextDrawSetProportional(playerid, MaskHelpText[playerid],1);
- PlayerTextDrawSetShadow(playerid, MaskHelpText[playerid],1);*/
- DrugCombineP[playerid][0] = CreatePlayerTextDraw(playerid, 242.000000, 318.022430, ""); //drug comment
- PlayerTextDrawLetterSize(playerid, DrugCombineP[playerid][0], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, DrugCombineP[playerid][0], 38.000041, 38.562938);
- PlayerTextDrawAlignment(playerid, DrugCombineP[playerid][0], 1);
- PlayerTextDrawColor(playerid, DrugCombineP[playerid][0], -1);
- PlayerTextDrawSetShadow(playerid, DrugCombineP[playerid][0], 0);
- PlayerTextDrawSetOutline(playerid, DrugCombineP[playerid][0], 0);
- PlayerTextDrawBackgroundColor(playerid, DrugCombineP[playerid][0], -256);
- PlayerTextDrawFont(playerid, DrugCombineP[playerid][0], 5);
- PlayerTextDrawSetProportional(playerid, DrugCombineP[playerid][0], 0);
- PlayerTextDrawSetShadow(playerid, DrugCombineP[playerid][0], 0);
- PlayerTextDrawSetSelectable(playerid, DrugCombineP[playerid][0], true);
- PlayerTextDrawSetPreviewModel(playerid, DrugCombineP[playerid][0], 18631);
- PlayerTextDrawSetPreviewRot(playerid, DrugCombineP[playerid][0], 90.000000, 35.000000, 70.000000, 1.000000);
- DrugCombineP[playerid][1] = CreatePlayerTextDraw(playerid, 283.000122, 317.192901, "");
- PlayerTextDrawLetterSize(playerid, DrugCombineP[playerid][1], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, DrugCombineP[playerid][1], 38.000000, 38.000000);
- PlayerTextDrawAlignment(playerid, DrugCombineP[playerid][1], 1);
- PlayerTextDrawColor(playerid, DrugCombineP[playerid][1], -1);
- PlayerTextDrawSetShadow(playerid, DrugCombineP[playerid][1], 0);
- PlayerTextDrawSetOutline(playerid, DrugCombineP[playerid][1], 0);
- PlayerTextDrawBackgroundColor(playerid, DrugCombineP[playerid][1], -256);
- PlayerTextDrawFont(playerid, DrugCombineP[playerid][1], 5);
- PlayerTextDrawSetProportional(playerid, DrugCombineP[playerid][1], 0);
- PlayerTextDrawSetShadow(playerid, DrugCombineP[playerid][1], 0);
- PlayerTextDrawSetSelectable(playerid, DrugCombineP[playerid][1], true);
- PlayerTextDrawSetPreviewModel(playerid, DrugCombineP[playerid][1], 18631);
- PlayerTextDrawSetPreviewRot(playerid, DrugCombineP[playerid][1], 90.000000, 35.000000, 70.000000, 1.000000);
- DrugCombineP[playerid][2] = CreatePlayerTextDraw(playerid, 321.666900, 315.948516, "");
- PlayerTextDrawLetterSize(playerid, DrugCombineP[playerid][2], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, DrugCombineP[playerid][2], 38.000000, 38.000000);
- PlayerTextDrawAlignment(playerid, DrugCombineP[playerid][2], 1);
- PlayerTextDrawColor(playerid, DrugCombineP[playerid][2], -1);
- PlayerTextDrawSetShadow(playerid, DrugCombineP[playerid][2], 0);
- PlayerTextDrawSetOutline(playerid, DrugCombineP[playerid][2], 0);
- PlayerTextDrawBackgroundColor(playerid, DrugCombineP[playerid][2], -256);
- PlayerTextDrawFont(playerid, DrugCombineP[playerid][2], 5);
- PlayerTextDrawSetProportional(playerid, DrugCombineP[playerid][2], 0);
- PlayerTextDrawSetShadow(playerid, DrugCombineP[playerid][2], 0);
- PlayerTextDrawSetSelectable(playerid, DrugCombineP[playerid][2], true);
- PlayerTextDrawSetPreviewModel(playerid, DrugCombineP[playerid][2], 18631);
- PlayerTextDrawSetPreviewRot(playerid, DrugCombineP[playerid][2], 90.000000, 35.000000, 70.000000, 1.000000);
- DrugCombineP[playerid][3] = CreatePlayerTextDraw(playerid, 363.667175, 316.778137, "");
- PlayerTextDrawLetterSize(playerid, DrugCombineP[playerid][3], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, DrugCombineP[playerid][3], 38.000000, 38.000000);
- PlayerTextDrawAlignment(playerid, DrugCombineP[playerid][3], 1);
- PlayerTextDrawColor(playerid, DrugCombineP[playerid][3], -1);
- PlayerTextDrawSetShadow(playerid, DrugCombineP[playerid][3], 0);
- PlayerTextDrawSetOutline(playerid, DrugCombineP[playerid][3], 0);
- PlayerTextDrawBackgroundColor(playerid, DrugCombineP[playerid][3], -256);
- PlayerTextDrawFont(playerid, DrugCombineP[playerid][3], 5);
- PlayerTextDrawSetProportional(playerid, DrugCombineP[playerid][3], 0);
- PlayerTextDrawSetShadow(playerid, DrugCombineP[playerid][3], 0);
- PlayerTextDrawSetSelectable(playerid, DrugCombineP[playerid][3], true);
- PlayerTextDrawSetPreviewModel(playerid, DrugCombineP[playerid][3], 18631);
- PlayerTextDrawSetPreviewRot(playerid, DrugCombineP[playerid][3], 90.000000, 35.000000, 70.000000, 1.000000);
- for(new i = 0; i < 4; i++)
- DrugCombineData[playerid][i] = 18631;
- DrugCombineP[playerid][4] = CreatePlayerTextDraw(playerid, 240.333587, 362.977813, "Agente base estimulante 1");
- PlayerTextDrawLetterSize(playerid, DrugCombineP[playerid][4], 0.193332, 0.894818);
- PlayerTextDrawAlignment(playerid, DrugCombineP[playerid][4], 1);
- PlayerTextDrawColor(playerid, DrugCombineP[playerid][4], -2139062017);
- PlayerTextDrawSetShadow(playerid, DrugCombineP[playerid][4], 0);
- PlayerTextDrawSetOutline(playerid, DrugCombineP[playerid][4], 0);
- PlayerTextDrawBackgroundColor(playerid, DrugCombineP[playerid][4], 255);
- PlayerTextDrawFont(playerid, DrugCombineP[playerid][4], 1);
- PlayerTextDrawSetProportional(playerid, DrugCombineP[playerid][4], 1);
- PlayerTextDrawSetShadow(playerid, DrugCombineP[playerid][4], 0);
- NewDrugTDP[playerid] = CreatePlayerTextDraw(playerid, 225.666595, 118.081489, "LD_NONE:explm01");
- PlayerTextDrawLetterSize(playerid, NewDrugTDP[playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, NewDrugTDP[playerid], 205.999862, 183.748062);
- PlayerTextDrawAlignment(playerid, NewDrugTDP[playerid], 1);
- PlayerTextDrawColor(playerid, NewDrugTDP[playerid], -1);
- PlayerTextDrawSetShadow(playerid, NewDrugTDP[playerid], 0);
- PlayerTextDrawSetOutline(playerid, NewDrugTDP[playerid], 0);
- PlayerTextDrawBackgroundColor(playerid, NewDrugTDP[playerid], 255);
- PlayerTextDrawFont(playerid, NewDrugTDP[playerid], 4);
- PlayerTextDrawSetProportional(playerid, NewDrugTDP[playerid], 0);
- PlayerTextDrawSetShadow(playerid, NewDrugTDP[playerid], 0);
- BlindfoldEffect[playerid] = CreatePlayerTextDraw(playerid, 0.0, 0.0, "_");
- PlayerTextDrawFont(playerid, BlindfoldEffect[playerid], 1);
- PlayerTextDrawLetterSize(playerid, BlindfoldEffect[playerid], 0.0, 50.0);
- PlayerTextDrawUseBox(playerid, BlindfoldEffect[playerid], true);
- PlayerTextDrawColor(playerid, BlindfoldEffect[playerid], 0);
- PlayerTextDrawBoxColor(playerid, BlindfoldEffect[playerid], COLOR_BLACK);
- return true;
- }
- stock CreateAllObjects()
- {
- //t0mbXD house grass
- new tmpobjid;
- tmpobjid = CreateDynamicObject(19552, 2239.027587, 41.496765, 24.090850, 90.600028, 0.100000, 0.000000, 159753, 5, -1, 300.00, 300.00);
- SetDynamicObjectMaterial(tmpobjid, 0, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- // new grass = CreateDynamicObject(11524, -1731.61719, 1916.03906, 8.00881, 0.00000, 0.00000, 0.00000, -1, -1, -1, 200.0, 200.0, SilverRectangle);
- // SetDynamicObjectMaterial(grass, 0, 8463, "vgseland", "Grass_128HV");
- //Placas com nome
- CreateDynamicObject(6189, 668.85333251953, -480.76791381836, 1917.4122314453, 0.0, 0.0, 0.0); // Post Office Ground
- CreateDynamicObject(14707, 1208.40527344, -2.27636719, 1160.51879883, 0.0, 0.0, 0.0); // Icy house ground
- CreateDynamicObject(6189, 1258.9625244141, 264.68673706055, 1272.8072509766, 0.0, 0.0, 0.0); //EMS ground
- CreateDynamicObject(14596, -672.10375977, 2618.67211914, 63.06771469, 0.0, 0.0, 180.0); // Aperture Base Ground
- CreateDynamicObject(5154, 1213.193359375, 291.5390625, 1327.5843505859, 0.0, 0.0, 0.0); //Ambulance ground
- CreateDynamicObject(6300, 1248.8973388672, 103.31694030762, 3165.6589355469, 0.0, 0.0, 0.0); // DMV Avard Ground
- CreateDynamicObject(7301, -208.80000305, 1053.19995117, 22.17000008, 45.0, 90.0, 0.0); // FC elec shop roof glitch fix
- CreateDynamicObject(8613,930.6300049,1658.8120117,11.4099998,0.0,0.0,0.0, 0, 0); //object(vgssstairs03_lvs) (1) fbi hq roof access stair
- CreateDynamicObject(1498, 308.67001342773, 312.10000610352, 1002.299987793, 0.0, 0.0, 0.0, 12345, 4); // komars object for blue dynasty roof room
- CreateDynamicObject(3337, 948.59997559, -186.39999390, 10.0, 0.0, 0.0, 176.0);
- new signage = CreateDynamicObject(3337, 948.59997559, -186.39999390, 10.0, 0.0, 0.0, 176.0);
- SetDynamicObjectMaterialText(signage, 1, "CAUTION\n\nBlind Summit\nSLOW", OBJECT_MATERIAL_SIZE_256x128, "Arial", 32, 1, 0xFFFFFFFF, 0, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- CreateDynamicObject(3337,-301.79998779,-2797.30004883,55.50000000,0.0,0.0,343.99996948); //service stn 1
- new serviceStn1 = CreateDynamicObject(3337,-301.79998779,-2797.30004883,55.50000000,0.0,0.0,343.99996948);
- SetDynamicObjectMaterialText(serviceStn1, 1, "FLINT COUNTY HWY\n\nServices 1 Mile\nAngel Pine 2 Miles", OBJECT_MATERIAL_SIZE_256x128, "Arial", 24, 1, 0xFFFFFFFF, 0, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- CreateDynamicObject(3337,-1013.09997559,-2843.19995117,66.19999695,0.0,0.0,357.99841309); //service stn 1
- new serviceStn2 = CreateDynamicObject(3337,-1013.09997559,-2843.19995117,66.19999695,0.0,0.0,357.99841309);
- SetDynamicObjectMaterialText(serviceStn2, 1, "Angel Pine Service Station\nFood - Fuel - Motel\n\n>> Next Right >>", OBJECT_MATERIAL_SIZE_256x128, "Arial", 24, 1, 0xFFFFFFFF, 0, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- CreateDynamicObject(3337,-117.69999695,1548.09997559,16.39999962,0.0,0.0,276.0); //aperture rules
- new aperSign1 = CreateDynamicObject(3337,-117.69999695,1548.09997559,16.39999962,0.0,0.0,276.0);
- SetDynamicObjectMaterialText(aperSign1, 1, "NOTICE\nHAVE ID READY FOR INSPECTION\nSTRICTLY NO PHOTOGRAPHY\nAUTHORIZED PERSONNEL ONLY", OBJECT_MATERIAL_SIZE_256x128, "Impact", 18, 1, 0xFFFFFFFF, 0, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- CreateDynamicObject(3337,-101.50000000,1549.80004883,16.39999962,0.0,0.0,275.99853516); //aperture sign
- new aperSign2 = CreateDynamicObject(3337,-101.50000000,1549.80004883,16.39999962,0.0,0.0,275.99853516);
- SetDynamicObjectMaterialText(aperSign2, 1, "Aperture CORPORATION\nSan Andreas\nResearch Facility", OBJECT_MATERIAL_SIZE_256x128, "Impact", 28, 1, 0xFFFFFFFF, 0, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- PayTolls[0][0] = 0;
- PayTolls[1][0] = 0;
- PayTolls[2][0] = 0;
- PayTolls[3][0] = 0;
- PayTolls[4][0] = 0;
- PayTolls[5][0] = 0;
- // ATM Bank Machines
- AtmObjectID[0] = CreateDynamicObject(2942, 2334.31900000, 57.43700000, 26.12700000, 0.0, 0.0, -270.0);
- AtmObjectID[1] = CreateDynamicObject(2942, 1289.75200000, 273.56800000, 19.19800000, 0.0, 0.0, -293.359);
- AtmObjectID[2] = CreateDynamicObject(2942, 1341.81347656, 215.34375000, 19.19000053, 0.0, 0.0, 156.63757324);
- AtmObjectID[3] = CreateDynamicObject(2942, 256.54600000, -62.21300000, 1.22100000, 0.0, 0.0, -720.859);
- AtmObjectID[4] = CreateDynamicObject(2942, 703.02148438, -494.71777344, 15.97900009, 0.0, 0.0, 179.13757324);
- AtmObjectID[5] = CreateDynamicObject(2942, 661.34863281, -554.77050781, 15.97900009, 0.0, 0.0, 269.13757324);
- AtmObjectID[6] = CreateDynamicObject(2942, 242.53222656, -184.89648438, 1.22099996, 0.0, 0.0, 270.85693359);
- AtmObjectID[7] = CreateDynamicObject(2942, -131.19999695, 1188.59997559, 19.39999962, 0.0, 0.0, 180.0);
- AtmObjectID[8] = CreateDynamicObject(2942, -856.50976562, 1533.20898438, 22.22994232, 0.0, 0.0, 90.0);
- AtmObjectID[9] = CreateDynamicObject(2942, -1215.40844727, 1825.91003418, 41.36164856, 0.0, 0.0, 45.67);
- AtmObjectID[10] = CreateDynamicObject(2942, -1475.02624512, 2610.81567383, 55.47883606, 0.0, 0.0, 0.0);
- AtmObjectID[11] = CreateDynamicObject(2942, 666.40185547, 1720.49011230, 6.83039951, 0.0, 0.0, 220.42041016);
- AtmObjectID[12] = CreateDynamicObject(2942, -1569.48681641, -2727.05493164, 48.38635635, 0.0, 0.0, 325.52026367);
- AtmObjectID[13] = CreateDynamicObject(2942, -2102.25488281, -2344.01367188, 30.26789856, 0.0, 0.0, 321.63574219);
- AtmObjectID[14] = CreateDynamicObject(2942, -2175.36132812, -2327.61328125, 30.24289894, 0.0, 0.0, 51.36108398);
- AtmObjectID[15] = CreateDynamicObject(2942, -2490.62890625, 2341.37695312, 4.62727451, 0.0, 0.0, 0.0);
- AtmObjectID[16] = CreateDynamicObject(19324, 1231.685, 184.435, 2090.9982, 0.000, 0.000, 90.000);
- new pontobus;
- // Bus Stops
- BusStopObjectIDStart = CreateDynamicObject(1257, -224.76104736328, -282.42523193359, 1.7166802883148, 0.0, 0.0, 39.699768066406);
- SetDynamicObjectMaterial(BusStopObjectIDStart, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(BusStopObjectIDStart, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(BusStopObjectIDStart, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(BusStopObjectIDStart, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(BusStopObjectIDStart, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, -132.69970703125, -196.73405456543, 2.2121233940125, 0.0, 0.0, 260.47985839844);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 163.93135070801, -220.71789550781, 1.8573167324066, 0.0, 0.0, 270.39978027344);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 241.78886413574, -150.34800720215, 1.8573167324066, 0.0, 0.0, 359.71984863281);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 241.52381896973, -54.284706115723, 1.8573167324066, 0.0, 0.0, 359.71435546875);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- CreateDynamicObject(1229, -164.43280029297, 821.59625244141, 22.796943664551, 0.0, 0.0, 41.684783935547);
- pontobus = CreateDynamicObject(1257, -181.73184204102, 1002.4036865234, 20.008571624756, 0.0, 0.0, 0.0);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, -302.54644775391, 1072.2980957031, 20.013582229614, 0.0, 0.0, 90.0);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, -217.71551513672, 1089.5737304688, 20.021379470825, 0.0, 0.0, 270.0);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, -181.61383056641, 1125.7497558594, 20.021379470825, 0.0, 0.0, 0.0);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, -106.66735076904, 1179.6512451172, 20.021379470825, 0.0, 0.0, 0.0);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, -35.94319152832, 1189.3256835938, 19.638566970825, 0.0, 0.0, 270.0);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 73.019882202148, 1189.3577880859, 19.001363754272, 0.0, 0.0, 270.0);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 169.38305664063, 1141.3850097656, 14.614506721497, 0.0, 0.0, 240.39221191406);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 212.32940673828, 980.05358886719, 28.781187057495, 0.0, 0.0, 196.54187011719);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 761.03314208984, 316.01037597656, 20.513566970825, 0.0, 0.0, 278.326171875);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 1218.7103271484, 270.53140258789, 19.826084136963, 0.0, 0.0, 246.56237792969);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- CreateDynamicObject(1229, 1231.5, 191.5, 19.833879470825, 0.0, 0.0, 156.5);
- pontobus = CreateDynamicObject(1257, 1290.1480712891, 229.79786682129, 19.833879470825, 0.0, 0.0, 335.88525390625);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 1363.7940673828, 272.12561035156, 19.833879470825, 0.0, 0.0, 335.88500976563);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 1373.8937988281, 417.85638427734, 20.030654907227, 0.0, 0.0, 335.88500976563);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 2335.3493652344, 165.2174987793, 26.763566970825, 0.0, 0.0, 180.38037109375);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 2337.4201660156, 55.883773803711, 26.758951187134, 0.0, 0.0, 180.37902832031);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 2336.474609375, -59.671306610107, 26.763566970825, 0.0, 0.0, 180.37902832031);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 2302.6323242188, -4.074146270752, 26.763566970825, 0.0, 0.0, 358.93408203125);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 2236.7082519531, 50.065700531006, 26.763566970825, 0.0, 0.0, 90.643829345703);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 1542.8361816406, 121.88629150391, 29.786001205444, 0.0, 0.0, 112.47766113281);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 803.69970703125, -521.57019042969, 16.615129470825, 0.0, 0.0, 90.637634277344);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 672.80126953125, -562.07550048828, 16.615129470825, 0.0, 0.0, 180.76559);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 674.59741210938, -643.81042480469, 16.615129470825, 0.0, 0.0, 180.763569);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 650.73724365234, -584.58666992188, 16.615129470825, 0.0, 0.0, 359.18701171875);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 688.642578125, -501.79782104492, 16.615129470825, 0.0, 0.0, 359.49884);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 652.77770996094, -451.82171630859, 16.622896194458, 0.0, 0.0, 359.18701171875);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 241.44309997559, -231.44331359863, 1.8573167324066, 0.0, 0.0, 359.18701171875);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, 158.21006774902, -203.77098083496, 1.8573167324066, 0.0, 0.0, 90.766784667969);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, -108.38774108887, -184.99769592285, 2.1516118049622, 0.0, 0.0, 80.838623046875);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, -266.32440185547, -256.23867797852, 2.0907263755798, 0.0, 0.0, 212.34216308594);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, -29.140232086182, -343.99710083008, 5.7088794708252, 0.0, 0.0, 140.87878417969);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, -23.649795532227, -334.97869873047, 5.7088794708252, 0.0, 0.0, 154.77270507813);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, -20.692115783691, -325.861328125, 5.7020435333252, 0.0, 0.0, 172.6328125);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- CreateDynamicObject(1229, -842.62719726563, 1455.1077880859, 15.67246723175, 0.0, 0.0, 0.0);
- pontobus = CreateDynamicObject(1257, -842.61694335938, 1600.0285644531, 27.144178390503, 0.0, 0.0, 17.954986572266);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- CreateDynamicObject(1229, -1174.4086914063, 1827.4357910156, 41.921005249023, 0.0, 0.0, 0.0);
- CreateDynamicObject(1229, -1334.8098144531, 2065.8264160156, 52.752716064453, 0.0, 0.0, 342.13513183594);
- CreateDynamicObject(1229, -1412.6398925781, 2607.2080078125, 56.395618438721, 0.0, 0.0, 81.830688476563);
- CreateDynamicObject(1229, -1539.3413085938, 2638.9106445313, 56.395618438721, 0.0, 0.0, 358.05114746094);
- pontobus = CreateDynamicObject(1257, -1478.6331787109, 2610.0971679688, 56.115127563477, 0.0, 0.0, 89.730010986328);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, -1453.5854492188, 2662.0412597656, 56.115127563477, 0.0, 0.0, 269.18518066406);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- pontobus = CreateDynamicObject(1257, -839.96447753906, 2718.6198730469, 45.877685546875, 0.0, 0.0, 273.15148925781);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- CreateDynamicObject(1229, -1291.9060058594, 2651.6408691406, 50.17045211792, 0.0, 0.0, 290.21020507813);
- pontobus = CreateDynamicObject(1257, -278.67706298828, 2623.0268554688, 63.261543273926, 0.0, 0.0, 273.14758300781);
- SetDynamicObjectMaterial(pontobus, 0, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 1, 18996, "mattextures", "policeshieldgls", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 2, 10101, "2notherbuildsfe", "ferry_build14", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 3, 2702, "pick_up", "CJ_red_FELT", 0x00000000);
- SetDynamicObjectMaterial(pontobus, 4, 19332, "balloon_texts", "balloon02", 0x00000000);
- CreateDynamicObject(1229, -737.28509521484, 2720.2546386719, 47.419593811035, 0.0, 0.0, 270.27026367188);
- pontobus = CreateDynamicObject(1257, 805.31579589844, 1944.2022705078, 6.8437194824219, 0.0, 0.0, 177.462890625);
- CreateDynamicObject(1229, 793.673828125, 1139.9768066406, 28.911281585693, 0.0, 0.0, 121.625);
- CreateDynamicObject(1229, 390.71780395508, 1026.8930664063, 29.330448150635, 0.0, 0.0, 89.730010986328);
- CreateDynamicObject(1229, 27.993556976318, 893.41784667969, 24.542490005493, 0.0, 0.0, 83.72998046875);
- //Toll Booth Stuff
- CreateDynamicObject(4639, -187.50259399, 265.40060425, 12.97782993, 0.0, 0.0, 254.99816895, 0, 0, -1);
- PayTolls[0][0] = CreateDynamicObject(968, -186.36549377, 268.80905151, 11.91311241, 0.0, 90.0, 164.99267578);
- CreateDynamicObject(4639, -199.29255676, 276.28802490, 12.77470493, 0.0, 0.0, 74.99816895, 0, 0, -1);
- PayTolls[1][0] = CreateDynamicObject(968, -200.45440674, 272.57699585, 11.91313148, 0.0, 90.0, 344.99267578);
- CreateDynamicObject(1226, -188.24328613, 268.11987305, 14.96254517, 0.0, 0.0, 344.99267578, 0, 0, -1);
- CreateDynamicObject(1226, -198.26855469, 273.65039062, 14.96254517, 0.0, 0.0, 164.99267578, 0, 0, -1);
- CreateDynamicObject(4639, 620.08282471, 343.06439209, 19.64984894, 0.0, 0.0, 304.99694824, 0, 0, -1);
- CreateDynamicObject(4639, 602.63604736, 342.97311401, 19.62626648, 0.0, 0.0, 124.99697876, 0, 0, -1);
- PayTolls[2][0] = CreateDynamicObject(968, 617.41333008, 346.93511963, 18.76787140, 0.0, 90.0, 214.99694824);
- PayTolls[3][0] = CreateDynamicObject(968, 605.54223633, 338.49548340, 18.76787140, 0.0, 90.0, 35.24694824);
- CreateDynamicObject(1226, 605.97314453, 341.07055664, 21.80410767, 0.0, 0.0, 214.99694824, 0, 0, -1);
- CreateDynamicObject(1226, 616.78125000, 344.86669922, 21.80410767, 0.0, 0.0, 34.99694824, 0, 0, -1);
- CreateDynamicObject(966, -200.24792480, 272.52893066, 11.07812500, 0.0, 0.0, 165.0, 0, 0, -1);
- CreateDynamicObject(966, -186.57862854, 268.86694336, 11.07812500, 0.0, 0.0, 344.99816895, 0, 0, -1);
- CreateDynamicObject(966, 617.26965332, 346.81945801, 17.92968750, 0.0, 0.0, 35.24267578, 0, 0, -1);
- CreateDynamicObject(966, 605.69757080, 338.63101196, 17.92968750, 0.0, 0.0, 215.23864746, 0, 0, -1);
- // Speed Cameras
- CreateDynamicObject(18880, 1369.40234375, -10.28515625, 32.73462677, 0.0, 0.0, 131.99523920, 0, 0); //montgomery view
- CreateDynamicObject(18880, 1378.34667969, -19.87597656, 32.75024796, 0.0, 0.0, 311.99523926, 0, 0); //montgomery view
- CreateDynamicObject(18880, 820.33007812, -162.55371094, 17.70354652, 0.0, 0.0, 83.99597168, 0, 0); //highway 48 (fern ridge area)
- CreateDynamicObject(18880, 831.44335938, -176.01562500, 17.38158417, 0.0, 0.0, 264.24316406, 0, 0); //highway 48 (fern ridge area)
- CreateDynamicObject(18880, 402.91210938, 150.30175781, 6.69789505, 0.0, 0.0, 129.99572754, 0, 0); //highway 46 (blueberry area)
- CreateDynamicObject(18880, 412.17871094, 138.59960938, 6.67972755, 0.0, 0.0, 311.99523926, 0, 0); //highway 46 (blueberry area)
- CreateDynamicObject(18880, 330.92172241, 1374.40954590, 6.48725891, 0.0, 0.0, 164.0, 0, 0); //route 7 (near the oil refinery)
- CreateDynamicObject(18880, 344.32153320, 1370.46325684, 6.48395348, 0.0, 0.0, 343.99841309, 0, 0); //route 7 (near the oil refinery)
- CreateDynamicObject(18880, 1837.73315430, 378.55950928, 18.10695457, 0.0, 0.0, 69.5, 0, 0); //highway 46 (between monty and pc)
- CreateDynamicObject(18880, 1833.79199219, 366.68319702, 17.95963478, 0.0, 0.0, 251.49951172, 0, 0); //highway 46 (between monty and pc)
- CreateDynamicObject(18880, 2053.50561523, 48.21620178, 26.32803345, 0.0, 0.0, 91.49902344, 0, 0); //pc red bridge
- CreateDynamicObject(18880, 2054.16333008, 33.18312836, 26.27503586, 0.0, 0.0, 271.49414062, 0, 0); //pc red bridge
- return true;
- }
- stock SetUpPlayerSpawn(playerid)
- {
- if((gettime() - TimerDisconnect[playerid]) <= 300)
- {
- SetSpawnInfo(playerid, 4, cPlayersSkin[playerid], RelogSpawnPos[playerid][0], RelogSpawnPos[playerid][1], RelogSpawnPos[playerid][2], 0.0,0,0,0,0,0,0);
- SetPlayerVirtualWorldEx(playerid, RelogSpawnInfo[playerid][1]);
- SetPlayerInterior(playerid, RelogSpawnInfo[playerid][0]);
- }
- else if(MySpawnID[playerid] == 1) //Noob
- {
- if(NoobSpawnID[playerid] == 2) SetSpawnInfo(playerid,4,cPlayersSkin[playerid], 769.065856, 359.666229, 19.917900, 184.387588,0,0,0,0,0,0); //north caravan park
- else if(NoobSpawnID[playerid] == 1) SetSpawnInfo(playerid,4,cPlayersSkin[playerid], 243.760513, -309.111663, 1.578125, 12.270160,0,0,0,0,0,0); //blueberry caravan park
- else if(NoobSpawnID[playerid] == 3) SetSpawnInfo(playerid,4,cPlayersSkin[playerid], 1282.459960, 170.554199, 20.329582, 338.116455,0,0,0,0,0,0); //montgomery caravan park
- else if(NoobSpawnID[playerid] == 4) SetSpawnInfo(playerid,4,cPlayersSkin[playerid], -232.849426, 1047.979125, 19.734390, 180.0,0,0,0,0,0,0); //fort carson
- else if(NoobSpawnID[playerid] == 5) SetSpawnInfo(playerid,4,cPlayersSkin[playerid], -2103.2407, -2524.0222, 30.6301, 332.8650, 0,0,0,0,0,0); //angel pine
- else SetSpawnInfo(playerid,4,cPlayersSkin[playerid],1282.459960, 170.554199, 20.329582, 338.116455,0,0,0,0,0,0);
- SetPlayerVirtualWorldEx(playerid, 0);
- SetPlayerInterior(playerid, 0);
- }
- else if(MySpawnID[playerid] == 2) //Factions
- {
- switch(SubFactionSpawn[playerid])
- {
- case 0,1:
- {
- SetSpawnInfo(playerid, 4, cPlayersSkin[playerid], FACTIONS[Faction[playerid]][FactionSpawn1][0], FACTIONS[Faction[playerid]][FactionSpawn1][1], FACTIONS[Faction[playerid]][FactionSpawn1][2], FACTIONS[Faction[playerid]][FactionSpawn1][3], 0, 0, 0, 0, 0, 0);
- SetPlayerInterior(playerid, FACTIONS[Faction[playerid]][FactionSpawnInt][0]);
- SetPlayerVirtualWorldEx(playerid, FACTIONS[Faction[playerid]][FactionSpawnVW][0]);
- }
- case 2:
- {
- SetSpawnInfo(playerid, 4, cPlayersSkin[playerid], FACTIONS[Faction[playerid]][FactionSpawn2][0], FACTIONS[Faction[playerid]][FactionSpawn2][1], FACTIONS[Faction[playerid]][FactionSpawn2][2], FACTIONS[Faction[playerid]][FactionSpawn2][3], 0, 0, 0, 0, 0, 0);
- SetPlayerInterior(playerid, FACTIONS[Faction[playerid]][FactionSpawnInt][1]);
- SetPlayerVirtualWorldEx(playerid, FACTIONS[Faction[playerid]][FactionSpawnVW][1]);
- }
- case 3:
- {
- SetSpawnInfo(playerid, 4, cPlayersSkin[playerid], FACTIONS[Faction[playerid]][FactionSpawn3][0], FACTIONS[Faction[playerid]][FactionSpawn3][1], FACTIONS[Faction[playerid]][FactionSpawn3][2], FACTIONS[Faction[playerid]][FactionSpawn3][3], 0, 0, 0, 0, 0, 0);
- SetPlayerInterior(playerid, FACTIONS[Faction[playerid]][FactionSpawnInt][2]);
- SetPlayerVirtualWorldEx(playerid, FACTIONS[Faction[playerid]][FactionSpawnVW][2]);
- }
- case 4:
- {
- SetSpawnInfo(playerid, 4, cPlayersSkin[playerid], FACTIONS[Faction[playerid]][FactionSpawn4][0], FACTIONS[Faction[playerid]][FactionSpawn4][1], FACTIONS[Faction[playerid]][FactionSpawn4][2], FACTIONS[Faction[playerid]][FactionSpawn4][3], 0, 0, 0, 0, 0, 0);
- SetPlayerInterior(playerid, FACTIONS[Faction[playerid]][FactionSpawnInt][3]);
- SetPlayerVirtualWorldEx(playerid, FACTIONS[Faction[playerid]][FactionSpawnVW][3]);
- }
- case 5:
- {
- SetSpawnInfo(playerid, 4, cPlayersSkin[playerid], FACTIONS[Faction[playerid]][FactionSpawn5][0], FACTIONS[Faction[playerid]][FactionSpawn5][1], FACTIONS[Faction[playerid]][FactionSpawn5][2], FACTIONS[Faction[playerid]][FactionSpawn5][3], 0, 0, 0, 0, 0, 0);
- SetPlayerInterior(playerid, FACTIONS[Faction[playerid]][FactionSpawnInt][4]);
- SetPlayerVirtualWorldEx(playerid, FACTIONS[Faction[playerid]][FactionSpawnVW][4]);
- }
- }
- }
- else if(MySpawnID[playerid] == 3) //Houses
- {
- for(new H = 0; H < MAX_HOUSES; H++)
- {
- if(HouseData[H][HouseOwnerSQLID] == SQLID[playerid] && HasHouseKey[playerid][SpawnAtHouse[playerid]] == H)
- {
- SetSpawnInfo(playerid,4,cPlayersSkin[playerid],HouseData[H][oPosX],HouseData[H][oPosY],HouseData[H][oPosZ],0.0,0,0,0,0,0,0);
- if(HouseData[H][HouseExtVW] > 0)
- {
- SetPlayerVirtualWorldEx(playerid, HouseData[H][HouseExtVW]);
- SetPlayerInterior(playerid, 2);
- Streamer_UpdateEx(playerid, HouseData[H][oPosX], HouseData[H][oPosY], HouseData[H][oPosZ], HouseData[H][HouseExtVW], 2);
- TogglePlayerControllable(playerid, 0);
- SetTimerEx("UnFreezePlayer", 5000, 0, "d", playerid);
- }
- else
- {
- SetPlayerVirtualWorldEx(playerid, 0);
- SetPlayerInterior(playerid, 0);
- }
- break;
- }
- }
- }
- else if(MySpawnID[playerid] == 4) //Motel Room
- {
- SetSpawnInfo(playerid, 4, cPlayersSkin[playerid], MotelData[RentRoom[playerid]][RoomX], MotelData[RentRoom[playerid]][RoomY], MotelData[RentRoom[playerid]][RoomZ], 0.0, 0, 0, 0, 0, 0, 0);
- SetPlayerVirtualWorldEx(playerid, 0);
- SetPlayerInterior(playerid, 0);
- }
- else if(MySpawnID[playerid] == 5) //Guest House
- {
- new gh = IsHouseGuest(playerid);
- SetSpawnInfo(playerid, 4, cPlayersSkin[playerid], HouseData[gh][oPosX], HouseData[gh][oPosY], HouseData[gh][oPosZ], 0.0, 0, 0, 0, 0, 0, 0);
- if(HouseData[gh][HouseExtVW] > 0)
- {
- SetPlayerVirtualWorldEx(playerid, HouseData[gh][HouseExtVW]);
- SetPlayerInterior(playerid, 2);
- Streamer_UpdateEx(playerid, HouseData[gh][oPosX], HouseData[gh][oPosY], HouseData[gh][oPosZ], HouseData[gh][HouseExtVW], 2);
- TogglePlayerControllable(playerid, 0);
- SetTimerEx("UnFreezePlayer", 3000, 0, "d", playerid);
- }
- else
- {
- SetPlayerVirtualWorldEx(playerid, 0);
- SetPlayerInterior(playerid, 0);
- }
- }
- else if(MySpawnID[playerid] == 6) //Journey
- {
- JourneyTimerPlayer[playerid] = SetTimerEx("JourneyTimer", 1000, 0, "d", playerid);
- }
- else if(MySpawnID[playerid] == 7) //Business
- {
- new b = -1;
- for(b = 0; b < MAX_BIZZ; b++)
- {
- if(BizzData[b][BizzSQLID] == BizzSpawn[playerid])
- {
- break;
- }
- }
- if(b == -1) SysMsg(playerid, "An error has occurred when trying to spawn you at your business.");
- else
- {
- SetSpawnInfo(playerid, 4, cPlayersSkin[playerid], BizzData[b][oPosX], BizzData[b][oPosY], BizzData[b][oPosZ], 0.0, 0, 0, 0, 0, 0, 0);
- SetPlayerVirtualWorldEx(playerid, BizzData[b][ExitVW]);
- SetPlayerInterior(playerid, 0); }
- }
- if(RelogSpawnSaved[playerid] == 1)
- {
- if(JourneyTimerPlayer[playerid] >= 1) KillTimer(JourneyTimerPlayer[playerid]);
- if(RelogSpawnPos[playerid][0] != 0.0)
- {
- SetSpawnInfo(playerid, 4, cPlayersSkin[playerid], RelogSpawnPos[playerid][0], RelogSpawnPos[playerid][1], RelogSpawnPos[playerid][2], 0.0, 0, 0, 0, 0, 0, 0);
- SetPlayerInterior(playerid, RelogSpawnInfo[playerid][0]);
- SetPlayerVirtualWorld(playerid, RelogSpawnInfo[playerid][1]);
- if(RelogSpawnInfo[playerid][1] >= 20000 && RelogSpawnInfo[playerid][1] <= 30000)
- {
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(HouseData[h][HouseVW] == RelogSpawnInfo[playerid][1])
- {
- IsInHouseID[playerid] = h;
- break;
- }
- }
- }
- if(RelogSpawnInfo[playerid][1] >= 40000 && RelogSpawnInfo[playerid][1] <= 49000)
- {
- for(new h = 0; h < MAX_BIZZ; h++)
- {
- if(BizzData[h][BizzVW] == RelogSpawnInfo[playerid][1])
- {
- IsInBizzID[playerid] = h;
- break;
- }
- }
- }
- }
- MySQLUpdateInt(SQLID[playerid], "SpawnSaved", 0, "players");
- RelogSpawnSaved[playerid] = 0;
- }
- SpawnPlayer(playerid);
- SpawnCheckTimer[playerid] = SetTimerEx("SpawnCheck", 1000, 0, "i", playerid);
- if(AdminLevel[playerid] > 0)
- {
- AdminMsgToggle{playerid} = true;
- AdminLog(playerid, 0, "", "Login (in-game)");
- }
- else
- {
- if(AdminJailData[playerid][1] > 0)
- {
- if(JourneyTimerPlayer[playerid] >= 1) KillTimer(JourneyTimerPlayer[playerid]);
- RelogSpawnSaved[playerid] = 0;
- AJailPlayer(playerid);
- AdminJailData[playerid][0] = 1;
- SendClientMessageF(playerid, COLOR_RED, "You still have %i minutes left in the Admin Jail.",AdminJailData[playerid][1]);
- }
- }
- if(JailTime[playerid] > 0)
- {
- if(JourneyTimerPlayer[playerid] >= 1) KillTimer(JourneyTimerPlayer[playerid]);
- RelogSpawnSaved[playerid] = 0;
- new cellid = random(4) + 1;
- JailPlayer(playerid, cellid);
- IsJailed[playerid] = 1;
- JailCell[playerid] = cellid;
- JourneyInterior[playerid] = 0;
- ShamalInterior[playerid] = 0;
- SendClientMessageF(playerid, COLOR_LIGHTBLUE, "You still have %i minutes of jail time to serve.",JailTime[playerid]);
- }
- if(PrisonTime[playerid] > 0)
- {
- if(JourneyTimerPlayer[playerid] >= 1) KillTimer(JourneyTimerPlayer[playerid]);
- PlayerImprisoned{playerid} = true;
- RelogSpawnSaved[playerid] = 0;
- new cellid = random(16);
- ImprisonPlayer(playerid, cellid);
- if(IsolationTime[playerid] > 0)
- {
- Isolated[playerid] = 1;
- new isoid = random(4);
- IsolatePlayer(playerid, isoid);
- }
- JourneyInterior[playerid] = 0;
- ShamalInterior[playerid] = 0;
- SendClientMessageF(playerid, COLOR_LIGHTBLUE, "You still have %i minutes of prison time to serve. (You can check with /timeleft)",PrisonTime[playerid]);
- if(Isolated[playerid] == 1) SendClientMessageF(playerid, COLOR_LIGHTBLUE, "You also have %i minutes left in isolation.", IsolationTime[playerid]);
- }
- return true;
- }
- stock SendClientMessageToAllLogged(color, message[])
- {
- foreach(new i: Player) if(Logged{i}) SendSplitMessage(i, color, message);
- return true;
- }
- stock KickPlayer(playerid, id)
- {
- SetTimerEx("KickPublic", 500, 0, "ii", playerid, id);
- return true;
- }
- stock EmptyTruckingTrailer(vehicleid)
- {
- new Float:x, Float:y, Float:z;
- GetVehiclePos(vehicleid, x, y, z);
- foreach(new i: Player)
- {
- if(TrailerInterior[i] >= 1 && TrailerInterior[i] == vehicleid)
- {
- SetPlayerPos(i, x, y, z);
- SetPlayerInterior(i, 0);
- SetPlayerVirtualWorld(i, GetVehicleVirtualWorld(vehicleid));
- TrailerInterior[i] = 0;
- }
- }
- return true;
- }
- stock PlayerPlayNearbySound(playerid, soundid)
- {
- new Float:plPos[3];
- GetPlayerPos(playerid, plPos[0], plPos[1], plPos[2]);
- foreach(new p: Player)
- {
- if(IsPlayerInRangeOfPoint(p, 5.0, plPos[0], plPos[1], plPos[2]))
- {
- PlayerPlaySound(p, soundid, plPos[0], plPos[1], plPos[2]);
- }
- }
- return true;
- }
- stock PlayAudioStreamForPlayerEx(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)
- {
- if(AudioToggle{playerid}) return true;
- else PlayAudioStreamForPlayer(playerid, url, posX, posY, posZ, distance, usepos);
- return true;
- }
- //come? da parte 6
- stock MySQLBanPlayer(playerid, banner[], reason[])
- {
- new datestring[50];
- new master = MySQLCheckMaster_AgainstSQLID(SQLID[playerid]);
- format(datestring, sizeof(datestring), "%s %s", GetDateString(), GetTimeStringAndSec());
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO bans (PSQLID, BannedIP, PlayerName, BanDate, BannedBy, Reason, MasterAccount) VALUES (%i, '%e', '%e', '%e', '%e', '%e', %i)", SQLID[playerid], PlayerIP[playerid], GetName(playerid), datestring, banner, reason, master);
- mysql_pquery(conn, mquery, "");
- for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(VehicleData[v][VehicleOwnerSQLID] == SQLID[playerid])
- {
- if(VehicleData[v][Hotwired] == 1)
- {
- VehicleData[v][Hotwired] = 0;
- }
- }
- }
- KickPlayer(playerid, 22);
- return true;
- }
- stock MySQLBanIP(ip[], banner[], reason[])
- {
- new datestring[56];
- format(datestring,128,"%s %s",GetDateString(),GetTimeStringAndSec());
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO bans (PSQLID, BannedIP, PlayerName, BanDate, BannedBy, Reason) VALUES (%i, '%e', '%e', '%e', '%e', '%e')", -1, ip, "n/a", datestring, banner, reason);
- mysql_pquery(conn, mquery, "");
- return true;
- }
- stock MySQLCheckIPBanned(ip[])
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM bans WHERE BannedIP = '%e' LIMIT 1", ip);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() > 0)
- {
- cache_delete(result);
- return true;
- }
- cache_delete(result);
- return false;
- }
- stock MySQLCheckAccountBanned(sqlid)
- {
- if(sqlid <= 0) return false;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT NULL FROM bans WHERE PSQLID=%i LIMIT 1", sqlid);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() > 0)
- {
- cache_delete(result);
- return true;
- }
- cache_delete(result);
- return false;
- }
- stock MySQLCheckTempBanned(sqlid, ip[])
- {
- new master = MySQLCheckMaster_AgainstSQLID(sqlid);
- if(master > 0) mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM tbans WHERE (PlayerSQLID=%i OR BannedIP='%e' OR MasterAccount=%i) AND Unbanned=0", sqlid, ip, master);
- else mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM tbans WHERE (PlayerSQLID=%i OR BannedIP='%e') AND Unbanned=0", sqlid, ip);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() > 0)
- {
- new banid = cache_get_field_content_int(0, "id");
- cache_delete(result);
- return banid;
- }
- cache_delete(result);
- return false;
- }
- stock MySQLUpdateInt(sqlid, sqlvalname[], sqlupdateint, table[])
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE %s SET %s = %i WHERE id = %i", table, sqlvalname, sqlupdateint, sqlid);
- mysql_pquery(conn, mquery);
- return true;
- }
- stock MySQLUpdateFloat(sqlid, sqlvalname[], Float:sqlupdatenum, table[])
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE %s SET %s = %f WHERE id = %i", table, sqlvalname, sqlupdatenum, sqlid);
- mysql_pquery(conn, mquery);
- return true;
- }
- stock MySQLUpdateString(sqlid, sqlvalname[], sqlupdatestr[], table[])
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE %s SET %s = '%e' WHERE id = %i", table, sqlvalname, sqlupdatestr, sqlid);
- mysql_pquery(conn, mquery);
- return true;
- }
- stock MySQLFetchString(sqlid, sqlvalname[], sqlresult[], table[])
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT %s FROM %s WHERE id = %i LIMIT 1", sqlvalname, table, sqlid);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() > 0) cache_get_field_content(0, sqlvalname, sqlresult, conn, 256);
- cache_delete(result);
- return true;
- }
- stock MySQLFetchInt(sqlid, sqlvalname[], &sqlresult, table[])
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT %s FROM %s WHERE id = %i LIMIT 1", sqlvalname, table, sqlid);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() > 0) sqlresult = cache_get_field_content_int(0, sqlvalname);
- cache_delete(result);
- return true;
- }
- stock MySQLCheckAccount(sqlplayersname[], playerid)
- {
- if(IsPlayerNPC(playerid)) return false;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM players WHERE Name = '%e' LIMIT 1", sqlplayersname);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() > 0)
- {
- new playerID = cache_get_field_content_int(0, "id");
- cache_delete(result);
- printf("[MySQL] %s(ID %i) Verificou a conta '%s' e pegou SQLID %i.", GetName(playerid), playerid, sqlplayersname, playerID);
- return playerID;
- }
- else
- {
- cache_delete(result);
- return false;
- }
- }
- stock MySQLCheckMaster_AgainstSQLID(char_sqlid)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT MasterAccount FROM players WHERE id = %i LIMIT 1", char_sqlid);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() > 0)
- {
- new masterID = cache_get_field_content_int(0, "MasterAccount");
- cache_delete(result);
- return masterID;
- }
- else
- {
- cache_delete(result);
- return false;
- }
- }
- stock MySQLCheckMaster_AgainstName(char_name[])
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM masters WHERE Username = '%e' LIMIT 1", char_name);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() > 0)
- {
- new masterID = cache_get_field_content_int(0, "id");
- cache_delete(result);
- return masterID;
- }
- else
- {
- cache_delete(result);
- return false;
- }
- }
- stock WipeAssets()
- {
- new house_count, bizz_count;
- gstr[0] = EOS;
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(HouseData[h][HouseOwnerSQLID] > 0)
- {
- if(IsAccountInactive(HouseData[h][HouseOwnerSQLID]))
- {
- format(gstr, sizeof(gstr), "[Inativo] A casa de %s foi vendida: %s", GetSQLName(HouseData[h][HouseOwnerSQLID]), HouseData[h][HouseDescription]);
- HouseData[h][HouseOwnerSQLID] = 0;
- HouseData[h][StoredWeed] = 0;
- HouseData[h][StoredCocaine] = 0;
- HouseData[h][StoredMoonShine] = 0;
- HouseData[h][HouseLocked] = 0;
- UpdateHousePickup(h);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE houses SET OwnerSQLID = 0, StoredWeed = 0, StoredCocaine = 0, StoredMoonShine = 0 WHERE id = %i", HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET Deleted = 1 WHERE HouseID = %i AND TrunkID = -1 AND FCarID = -1 AND Gunrack = -1 AND WeaponPossession = 0 AND Dropped = 0", HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM storedarmor WHERE HouseID = %i", HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET GuestHouseID = 0 WHERE GuestHouseID = %i", HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery);
- foreach(new i: Player)
- {
- if(GuestHouseID[i] == HouseData[h][HouseSQLID])
- {
- GuestHouseID[i] = 0;
- SendClientMessageF(i, COLOR_WHITE, "You are no longer a guest in %s as it has been wiped from its owner due to inactivity.", HouseData[h][HouseDescription]);
- }
- }
- house_count ++;
- }
- }
- }
- format(gstr, sizeof(gstr), "[Admin] %i houses have been automatically wiped from inactive owners.", house_count);
- AdminBroadcast(gstr, 0);
- for(new b = 0; b < MAX_BIZZ; b++)
- {
- if(BizzData[b][BizzOwnerSQLID] > 0)
- {
- if(IsAccountInactive(BizzData[b][BizzOwnerSQLID]))
- {
- format(gstr, sizeof(gstr), "[Inactive] Sold %s's business: %s", GetSQLName(BizzData[b][BizzOwnerSQLID]), BizzData[b][BizzDescription]);
- BizzData[b][BizzOwnerSQLID] = -5;
- MySQLUpdateInt(BizzData[b][BizzSQLID], "OwnerSQLID", BizzData[b][BizzOwnerSQLID], "bizz");
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM bizzmods WHERE BizzID = %i", BizzData[b][BizzSQLID]);
- mysql_pquery(conn, mquery);
- UpdateBizzLabel(b);
- bizz_count ++;
- }
- }
- }
- format(gstr, sizeof(gstr), "[Admin] %i businesses have been automatically wiped from inactive owners.", bizz_count);
- AdminBroadcast(gstr, 0);
- return true;
- }
- stock ClearMotelRooms()
- {
- new roomschecked, roomscleared;
- for(new m = 1; m < MAX_MOTELROOMS; m++)
- {
- if(MotelData[m][RoomDaysLeft] > 0)
- {
- roomschecked++;
- MotelData[m][RoomDaysLeft] --;
- if(MotelData[m][RoomDaysLeft] == 0)
- {
- roomscleared++;
- MotelData[m][RoomOwner] = 0;
- DestroyDynamicPickup(MotelData[m][RoomPickupID]);
- foreach(new mp: Player)
- {
- if(RentRoom[mp] == m)
- {
- SendClientMessage(mp, COLOR_ORANGE, "You have been evicted from your motel room since you did not extend your stay.");
- RentRoom[mp] = 0;
- MotelWaypoint[mp] = 0;
- if(MySpawnID[mp] == 4)
- {
- MySpawnID[mp] = 1;
- MySQLUpdateInt(SQLID[mp], "MySpawnID", MySpawnID[mp], "players");
- }
- }
- }
- }
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE motel SET RoomDaysLeft = %i, OwnerSQLID = %i WHERE id = %i", MotelData[m][RoomDaysLeft], MotelData[m][RoomOwner], m);
- mysql_tquery(conn, mquery);
- }
- }
- for(new x = 0; x < MAX_MOTELS; x++) UpdateMotelSign(x);
- format(gstr, sizeof(gstr), "[Admin] %i motels checked. %i inactive motel rooms have been cleared.", roomschecked, roomscleared);
- AdminBroadcast(gstr, 0);
- return true;
- }
- stock GetName(playerid)
- {
- new PlayerName[24];
- if(playerid != -1) GetPlayerName(playerid,PlayerName,24);
- return PlayerName;
- }
- stock NameEx(playerid)
- {
- new pName[24];
- if(playerid != -1)
- {
- GetPlayerName(playerid, pName, sizeof(pName));
- for(new i = 0 ; i < strlen(pName); i++)
- {
- if(pName[i] == '_')
- {
- pName[i] = ' ';
- }
- }
- }
- return pName;
- }
- stock AliasName(playerid)
- {
- new pName[24];
- GetPlayerName(playerid, pName, 24);
- for(new i = 0 ; i < strlen(pName); i++)
- {
- if(pName[i] == '_')
- {
- pName[i] = ' ';
- }
- }
- return pName;
- }
- stock NameRP(playerid)
- {
- new pName[24];
- if(IsPlayerMasked{playerid} && MaskHideName{playerid})
- {
- format(pName,sizeof(pName),"Stranger ((%i))", MaskLabelNumber[playerid]);
- return pName;
- }
- else
- {
- GetPlayerName(playerid, pName, 24);
- for(new i = 0 ; i < strlen(pName); i++)
- {
- if(pName[i] == '_')
- {
- pName[i] = ' ';
- }
- }
- return pName;
- }
- }
- stock SetPlayerForwardVelocity(playerid, Float:Velocity, Float:Z)
- {
- #pragma unused Z
- new Float:a, Float:aVel[3];
- new Float:SpeedX, Float:SpeedY;
- GetPlayerFacingAngle(playerid, a);
- SpeedX = floatsin(-a, degrees);
- SpeedY = floatcos(-a, degrees);
- GetPlayerVelocity(playerid, aVel[0], aVel[1], aVel[2]);
- SetPlayerVelocity(playerid, floatmul(Velocity, SpeedX), floatmul(Velocity, SpeedY), aVel[2]);
- }
- stock RPName(name[])
- {
- new newname[MAX_PLAYER_NAME];
- format(newname, MAX_PLAYER_NAME, name);
- for(new j; j < MAX_PLAYER_NAME; j++)
- {
- if(newname[j] == '_') newname[j] = ' ';
- }
- return newname;
- }
- stock DeleteMaskLabel(playerid)
- {
- if(MaskLabel[playerid] != Text3D:INVALID_3DTEXT_ID) DestroyDynamic3DTextLabel(MaskLabel[playerid]);
- MaskLabel[playerid] = Text3D:INVALID_3DTEXT_ID;
- return true;
- }
- stock DeleteAFKLabel(playerid)
- {
- DestroyDynamic3DTextLabel(AFK_Label[playerid]);
- AFK_Label[playerid] = Text3D:INVALID_3DTEXT_ID;
- IsAFK{playerid} = false;
- AFKReason[playerid][0] = EOS;
- AwayMinutes[playerid] = 0;
- return true;
- }
- stock DeleteHouseLabel(houseid)
- {
- UpdateDynamic3DTextLabelText(HouseData[houseid][HouseLabel], COLOR_WHITE, "");
- DestroyDynamic3DTextLabel(HouseData[houseid][HouseLabel]);
- HouseData[houseid][HouseLabel] = Text3D:INVALID_3DTEXT_ID;
- return true;
- }
- stock GetPlayersFirstName(playerid)
- {
- new SplitName[2][MAX_PLAYER_NAME];
- sscanf(GetName(playerid), "p<_>s[24]s[24]", SplitName[0], SplitName[1]);
- return SplitName[0];
- }
- stock GetPlayersLastName(playerid)
- {
- new SplitName[2][MAX_PLAYER_NAME];
- sscanf(GetName(playerid), "p<_>s[24]s[24]", SplitName[0], SplitName[1]);
- return SplitName[1];
- }
- stock GetPlayerAge(playerid)
- {
- new birthyear;
- MySQLFetchInt(SQLID[playerid], "BirthYear", birthyear, "players");
- return gServerYear - birthyear;
- }
- stock GetPlayerNameFromIP(ip[], pname[])
- {
- foreach(new i: Player)
- {
- if(strmatch(PlayerIP[i], ip))
- {
- GetPlayerName(i, pname, MAX_PLAYER_NAME);
- return i;
- }
- }
- return -1;
- }
- stock GetPlayerIDs(playername[])
- {
- new playa = -1;
- sscanf(playername, "u", playa);
- if(playa == -1) return INVALID_PLAYER_ID;
- else return playa;
- }
- stock GetPlayerPizzaDeliveryCount(playerid)
- {
- new count = 0;
- for(new x = 0; x < 10; x++)
- {
- if(PizzaHomes[playerid][x] != -1) count ++;
- }
- return count;
- }
- stock GetSQLName(id)
- {
- new returnSQLName[MAX_PLAYER_NAME] = "Server";
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Name FROM players WHERE id = %i LIMIT 1", id);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() > 0) cache_get_field_content(0, "Name", returnSQLName);
- cache_delete(result);
- return returnSQLName;
- }
- stock GetMasterName(id)
- {
- new returnSQLName[MAX_PLAYER_NAME] = "Server";
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Username FROM masters WHERE id = %i LIMIT 1", id);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows()) cache_get_field_content(0, "Username", returnSQLName, conn, MAX_PLAYER_NAME);
- cache_delete(result);
- return returnSQLName;
- }
- stock strmatch(const String1[], const String2[])
- {
- if((strcmp(String1, String2, true, strlen(String2)) == 0) && (strlen(String2) == strlen(String1))) return true;
- else return false;
- }
- stock GetHouseLocation(hname[])
- {
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(strfind(HouseData[i][HouseDescription], hname, true) != -1)
- return i;
- }
- return -1;
- }
- stock GetHouseIDFromSQLID(sqlid)
- {
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(HouseData[h][HouseSQLID] == sqlid)
- {
- return h;
- }
- }
- return -1;
- }
- stock GetBanID(accname[])
- {
- new ID;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM bans WHERE PlayerName='%e' LIMIT 1", accname);
- new Cache:result = mysql_query(conn, mquery);
- ID = cache_get_field_content_int(0, "id");
- if(cache_num_rows() == 0)
- {
- cache_delete(result);
- return false;
- }
- else
- {
- cache_delete(result);
- return ID;
- }
- }
- stock DeleteBan(banid)
- {
- if(banid > 0)
- {
- mysql_format(conn, mquery,128,"DELETE FROM bans WHERE id = %i", banid);
- mysql_pquery(conn, mquery, "");
- }
- return true;
- }
- stock IsPlayerIgnoringPlayer(playerid, ignoreid)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM `ignore` WHERE PlayerSQLID=%i AND IgnoringSQLID=%i LIMIT 1", SQLID[playerid], SQLID[ignoreid]);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() == 0)
- {
- cache_delete(result);
- return false;
- }
- else
- {
- cache_delete(result);
- return true;
- }
- }
- stock SetVehicleToRespawnEx(vehicleid)
- {
- SetVehicleToRespawn(vehicleid);
- return true;
- }
- stock IsValidRoleplayName(PlayerName[])
- {
- new i = 0;
- if(strfind(PlayerName, "_", true) == -1) return false;
- if(strfind(PlayerName, "[", true) != -1) return false;
- if(strfind(PlayerName, "]", true) != -1) return false;
- if(strfind(PlayerName, ".", true) != -1) return false;
- if(strfind(PlayerName, "@", true) != -1) return false;
- if(strfind(PlayerName, "'", true) != -1) return false;
- new FullName[2][MAX_PLAYER_NAME];
- sscanf(PlayerName, "p<_>s[24]s[24]", FullName[0], FullName[1]);
- if(strlen(FullName[0]) < 2) return false;
- if(strlen(FullName[1]) < 2) return false;
- new FirstLetter = FullName[0][0];
- if(FirstLetter >= 'A' && FirstLetter <= 'Z')
- {
- for(i = 0; i < strlen(PlayerName); i++)
- {
- if(strfind(PlayerName[i], "_") == 0)
- {
- new SecondLetter = PlayerName[i + 1];
- if(SecondLetter >= 'A' && SecondLetter <= 'Z') return true;
- }
- }
- }
- else
- {
- return false;
- }
- return false;
- }
- stock IsAlphanumeric(const string[])
- {
- new z = 0;
- for(new x, y = strlen(string); x != y; x++)
- {
- if((string[x] >= 48 && string[x] <= 57) || (string[x] >= 65 && string[x] <= 90) || (string[x] >= 97 && string[x] <= 122))
- {
- z++;
- }
- }
- if(z == strlen(string)) return true;
- else return false;
- }
- stock PlaySoundForPlayer(playerid, soundid, Float:x=0.0, Float:y=0.0, Float:z=0.0)
- {
- PlayerPlaySound(playerid, 0, 0, 0, 0);
- return PlayerPlaySound(playerid, soundid, x, y, z);
- }
- stock LoadPlayerAchievements(playerid)
- {
- new achs[MAX_ACHS*2], pos = 0, count = 1;
- MySQLFetchString(SQLID[playerid], "Achievements", achs, "players");
- while(count < MAX_ACHS)
- {
- new sub[3];
- strmid(sub, achs, pos, pos+1);
- HasUnlockedAchievement[playerid][count] = strval(sub);
- if(HasUnlockedAchievement[playerid][count] == 1)
- {
- AchievementPoints[playerid] += AchievementData[count][PointValue];
- }
- pos += 2;
- count ++;
- }
- return true;
- }
- stock SavePlayerAchievements(playerid)
- {
- new achs[MAX_ACHS*2];
- for(new i = 1; i < MAX_ACHS; i++)
- {
- if(HasUnlockedAchievement[playerid][i] == 1) strcat(achs, "1,");
- else strcat(achs, "0,");
- }
- MySQLUpdateString(SQLID[playerid], "Achievements", achs, "players");
- return true;
- }
- stock UpdateFuelStationSign(x)
- {
- format(gstr, sizeof(gstr), "%s Gas Station\nPetrol: {FFFFFF}%i / %i Gallons"ECOLOR_OOC"\nDiesel: {FFFFFF}%i / %i Gallons", FuelStations[x][StationDescription], FuelStations[x][PetrolAmount], FuelStations[x][PetrolAmountMax], FuelStations[x][DieselAmount], FuelStations[x][DieselAmountMax]);
- UpdateDynamic3DTextLabelText(FuelStations[x][SignLabel], COLOR_OOC, gstr);
- return true;
- }
- stock StartRefueling(playerid)
- {
- new Float:vPos1[4], vid = GetNearestVehicle(playerid);
- GetVehiclePos(vid, vPos1[0], vPos1[1], vPos1[2]);
- GetVehicleZAngle(vid, vPos1[3]);
- GetVehicleInfo(vid, VEHICLE_MODEL_INFO_PETROLCAP, vPos1[0], vPos1[1], vPos1[2], vPos1[3]);
- if(IsBoat(vid)) SysMsg(playerid, "Certain boats may require you to get back into the driver seat to refill them properly.");
- if(vPos1[0] == 0 && vPos1[1] == 0 && vPos1[2] == 0)
- {
- Dialog_Show(playerid, FuelType, DIALOG_STYLE_MSGBOX, "Vehicle Refuelling", "What type of fuel does your vehicle require?", "Petrol", "Diesel");
- pRefilling[playerid] = 3;
- return true;
- }
- else
- {
- SetPlayerCheckpointEx(playerid, vPos1[0], vPos1[1], vPos1[2], 1.0);
- pRefilling[playerid] = 2;
- }
- return true;
- }
- stock FormatHealthLabelText(playerid, Float:health, Float:armor, stage)
- {
- new masktext[150], formatval[2];
- formatval[0] = floatround(health);
- formatval[1] = floatround(armor);
- new maskdetails[30];
- if(ADuty[playerid] == 1) format(maskdetails, sizeof(maskdetails), "{00A6FF}Stranger_%i\n", MaskLabelNumber[playerid]);
- else format(maskdetails, sizeof(maskdetails), "{FFFFFF}Stranger_%i\n", MaskLabelNumber[playerid]);
- strcat(masktext, maskdetails, 150);
- if(formatval[1] > 0)
- {
- switch(formatval[1])
- {
- case 1..5: strcat(masktext, "{000000}[{FFFFFF}|{787878}|||||||||||||||||||{000000}]");
- case 6..10: strcat(masktext, "{000000}[{FFFFFF}||{787878}||||||||||||||||||{000000}]");
- case 11..15: strcat(masktext, "{000000}[{FFFFFF}|||{787878}|||||||||||||||||{000000}]");
- case 16..20: strcat(masktext, "{000000}[{FFFFFF}||||{787878}||||||||||||||||{000000}]");
- case 21..25: strcat(masktext, "{000000}[{FFFFFF}|||||{787878}|||||||||||||||{000000}]");
- case 26..30: strcat(masktext, "{000000}[{FFFFFF}||||||{787878}||||||||||||||{000000}]");
- case 31..35: strcat(masktext, "{000000}[{FFFFFF}|||||||{787878}|||||||||||||{000000}]");
- case 36..40: strcat(masktext, "{000000}[{FFFFFF}||||||||{787878}||||||||||||{000000}]");
- case 41..45: strcat(masktext, "{000000}[{FFFFFF}|||||||||{787878}|||||||||||{000000}]");
- case 46..50: strcat(masktext, "{000000}[{FFFFFF}||||||||||{787878}||||||||||{000000}]");
- case 51..55: strcat(masktext, "{000000}[{FFFFFF}|||||||||||{787878}|||||||||{000000}]");
- case 56..60: strcat(masktext, "{000000}[{FFFFFF}||||||||||||{787878}||||||||{000000}]");
- case 61..65: strcat(masktext, "{000000}[{FFFFFF}|||||||||||||{787878}|||||||{000000}]");
- case 66..70: strcat(masktext, "{000000}[{FFFFFF}||||||||||||||{787878}||||||{000000}]");
- case 71..75: strcat(masktext, "{000000}[{FFFFFF}|||||||||||||||{787878}|||||{000000}]");
- case 76..80: strcat(masktext, "{000000}[{FFFFFF}||||||||||||||||{787878}||||{000000}]");
- case 81..85: strcat(masktext, "{000000}[{FFFFFF}|||||||||||||||||{787878}|||{000000}]");
- case 86..90: strcat(masktext, "{000000}[{FFFFFF}||||||||||||||||||{787878}||{000000}]");
- case 91..95: strcat(masktext, "{000000}[{FFFFFF}|||||||||||||||||||{787878}|{000000}]");
- case 96..125: strcat(masktext, "{000000}[{FFFFFF}||||||||||||||||||||{000000}]");
- }
- strcat(masktext, "\n");
- }
- switch(formatval[0])
- {
- case 0: strcat(masktext, "{000000}[{8B0000}||||||||||||||||||||{000000}]");
- case 1..5: strcat(masktext, "{000000}[{FF4753}|{8B0000}|||||||||||||||||||{000000}]");
- case 6..10: strcat(masktext, "{000000}[{FF4753}||{8B0000}||||||||||||||||||{000000}]");
- case 11..15: strcat(masktext, "{000000}[{FF4753}|||{8B0000}|||||||||||||||||{000000}]");
- case 16..20: strcat(masktext, "{000000}[{FF4753}||||{8B0000}||||||||||||||||{000000}]");
- case 21..25: strcat(masktext, "{000000}[{FF4753}|||||{8B0000}|||||||||||||||{000000}]");
- case 26..30: strcat(masktext, "{000000}[{FF4753}||||||{8B0000}||||||||||||||{000000}]");
- case 31..35: strcat(masktext, "{000000}[{FF4753}|||||||{8B0000}|||||||||||||{000000}]");
- case 36..40: strcat(masktext, "{000000}[{FF4753}||||||||{8B0000}||||||||||||{000000}]");
- case 41..45: strcat(masktext, "{000000}[{FF4753}|||||||||{8B0000}|||||||||||{000000}]");
- case 46..50: strcat(masktext, "{000000}[{FF4753}||||||||||{8B0000}||||||||||{000000}]");
- case 51..55: strcat(masktext, "{000000}[{FF4753}|||||||||||{8B0000}|||||||||{000000}]");
- case 56..60: strcat(masktext, "{000000}[{FF4753}||||||||||||{8B0000}||||||||{000000}]");
- case 61..65: strcat(masktext, "{000000}[{FF4753}|||||||||||||{8B0000}|||||||{000000}]");
- case 66..70: strcat(masktext, "{000000}[{FF4753}||||||||||||||{8B0000}||||||{000000}]");
- case 71..75: strcat(masktext, "{000000}[{FF4753}|||||||||||||||{8B0000}|||||{000000}]");
- case 76..80: strcat(masktext, "{000000}[{FF4753}||||||||||||||||{8B0000}||||{000000}]");
- case 81..85: strcat(masktext, "{000000}[{FF4753}|||||||||||||||||{8B0000}|||{000000}]");
- case 86..90: strcat(masktext, "{000000}[{FF4753}||||||||||||||||||{8B0000}||{000000}]");
- case 91..95: strcat(masktext, "{000000}[{FF4753}|||||||||||||||||||{8B0000}|{000000}]");
- case 96..100: strcat(masktext, "{000000}[{FF4753}||||||||||||||||||||{000000}]");
- }
- strcat(masktext, "\n");
- if(stage == 1)
- {
- if(ADuty[playerid] == 0) MaskLabel[playerid] = CreateDynamic3DTextLabel(masktext, COLOR_WHITE, 0.0, 0.0, 0.1, 20.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20.0);
- else MaskLabel[playerid] = CreateDynamic3DTextLabel(maskdetails, COLOR_WHITE, 0.0, 0.0, 0.05, 20.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20.0);
- }
- else if(stage == 2)
- {
- if(ADuty[playerid] == 0) UpdateDynamic3DTextLabelText(MaskLabel[playerid], COLOR_WHITE, masktext);
- else UpdateDynamic3DTextLabelText(MaskLabel[playerid], COLOR_WHITE, maskdetails);
- }
- return true;
- }
- stock FormatActionLog(playerid, string[])
- {
- if(IsPlayerAdmin(playerid)) return true;
- if(strlen(ActionLog[playerid][49])) ActionLog[playerid][49]{0} = EOS;
- for(new x = 48; x != -1; x--)
- {
- strpack(ActionLog[playerid][x + 1], ActionLog[playerid][x]);
- ActionLog[playerid][x]{0} = EOS;
- }
- format(sgstr, sizeof(sgstr), "%s: %s", GetTimeStringAndSec(), string);
- strpack(ActionLog[playerid][0], sgstr);
- return true;
- }
- stock SendReport(playerid, playa, reason[])
- {
- format(Reports[24][ReporterName], 25, "%s", NameEx(playerid));
- format(Reports[24][ReportedName], 25, "%s", NameEx(playa));
- format(Reports[24][ReportReason], 150, "%s", reason);
- Reports[24][ReportTime] = gettime();
- SortDeepArray(Reports, ReportTime, .order = SORT_DESC);
- return true;
- }
- stock StringReplace(msg[], const find[], const replace[], bool:ignorecase=false, count=cellmax, maxlength=sizeof(msg))
- {
- if(isnull(find) || isnull(msg)) return false;
- new matches;
- for(new idx, flen = strlen(find), rlen = strlen(replace), pos = strfind(msg, find, ignorecase); pos != -1 && idx < maxlength && matches < count; pos = strfind(msg, find, ignorecase, idx))
- {
- strdel(msg, pos, pos + flen);
- if(rlen) strins(msg, replace, pos, maxlength);
- idx = pos + rlen;
- matches++;
- }
- return matches;
- }
- stock SetPlayerHealthEx(playerid, Float:value)
- {
- HealthVar[playerid] = value;
- SetPlayerHealth(playerid, value);
- MySQLUpdateFloat(SQLID[playerid], "Health", value, "players");
- if(IsPlayerMasked{playerid} && MaskHideName{playerid})
- {
- FormatHealthLabelText(playerid, HealthVar[playerid], ArmourVar[playerid], 2);
- }
- return true;
- }
- stock SetPlayerArmourEx(playerid, Float:value, type)
- {
- ArmourVar[playerid] = value;
- if(type == 1)
- {
- if(value < 1)
- {
- VestType[playerid] = 0;
- if(AttachedObjects[playerid][7][aoModelID] == -3000 || AttachedObjects[playerid][7][aoModelID] == 19515)
- {
- RemovePlayerAttachedObject(playerid, 7);
- AttachedObjects[playerid][7][aoModelID] = 0;
- AttachedObjects[playerid][7][aoBone] = 0;
- }
- RestrictedVest{playerid} = false;
- }
- if((value <= 1 || value <= 50)) //light vest
- {
- VestType[playerid] = 1;
- }
- if((value >= 51 && SwatMode[playerid] == 0)) //heavy vest
- {
- VestType[playerid] = 2;
- GivePlayerVest(playerid);
- }
- }
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Armour = %f, RestrictedVest = %i WHERE id = %i", ArmourVar[playerid], RestrictedVest{playerid}, SQLID[playerid]);
- mysql_pquery(conn, mquery);
- if(IsPlayerMasked{playerid} && MaskHideName{playerid}) FormatHealthLabelText(playerid, HealthVar[playerid], ArmourVar[playerid], 2);
- format(gstr, sizeof(gstr), "[%s] %s (%i) foi dado %.2f de colete.", GetServerTimeString(), NameEx(playerid), playerid, ArmourVar[playerid]);
- SetPlayerArmour(playerid, value);
- return true;
- }
- stock ClearTempInfo(playerid)
- {
- TempInfo[playerid][tSkin] = 0;
- TempInfo[playerid][tInt] = 0;
- TempInfo[playerid][tVW] = 0;
- TempInfo[playerid][tmX] = 0.0;
- TempInfo[playerid][tmY] = 0.0;
- TempInfo[playerid][tmZ] = 0.0;
- return true;
- }
- stock GetNextFreeLitterSpot()
- {
- for(new i = 0; i < MAX_LITTER; i++)
- {
- if(LitterPlaced[i] == 0) return i;
- }
- return -1;
- }
- stock IsNumeric(const string[])
- {
- new length = strlen(string);
- if(length == 0) return false;
- for(new i = 0; i < length; i++)
- {
- if((string[i] > '9' || string[i] < '0' && string[i] != '-' && string[i] != '+') || (string[i] == '-' && i != 0) || (string[i] == '+' && i != 0)) return false;
- }
- if(length == 1 && (string[0] == '-' || string[0] == '+')) return false;
- return true;
- }
- stock IsFloat(buf[])
- {
- new l = strlen(buf);
- new dcount = 0;
- for(new i=0; i<l; i++)
- {
- if(buf[i] == '.')
- {
- if(i == 0 || i == l-1) return 0;
- else
- {
- dcount++;
- }
- }
- if((buf[i] > '9' || buf[i] < '0') && buf[i] != '+' && buf[i] != '-' && buf[i] != '.') return 0;
- if(buf[i] == '+' || buf[i] == '-')
- {
- if(i != 0 || l == 1) return 0;
- }
- }
- if(dcount == 0 || dcount > 1) return 0;
- return 1;
- }
- stock format_cash(amount)
- {
- new formatted_amount[20];
- format(formatted_amount, sizeof(formatted_amount), "%i", amount);
- if(amount < 0)
- {
- strdel(formatted_amount, 0, 1);
- }
- new pos = strlen(formatted_amount);
- if(pos > 3)
- {
- strins(formatted_amount, ",", pos-3);
- if(pos > 6)
- {
- strins(formatted_amount, ",", pos-6);
- if(pos > 9)
- {
- strins(formatted_amount, ",", pos-9);
- }
- }
- }
- if(amount < 0)
- {
- strins(formatted_amount, "-", 0);
- }
- return formatted_amount;
- }
- stock GetPlayerID(playerid, name[])
- {
- new count = 0;
- new playa = -1;
- foreach(new i: Player)
- {
- if(strfind(GetName(i), name, true) != -1)
- {
- playa = i;
- count ++;
- }
- }
- if(count == 0)
- {
- return -1;
- }
- if(count > 1)
- {
- if(IsPlayerConnected(playerid)) SysMsg(playerid, "More than 1 player found, please search again.");
- return -1;
- }
- if(playa != -1)
- {
- return playa;
- }
- return -1;
- }
- stock GetRandomOnlinePlayer()
- {
- new Online[MAX_PLAYERS], Loop;
- foreach(new i: Player)
- {
- Online[Loop++] = i;
- }
- return (Loop == 0) ? (INVALID_PLAYER_ID) : (Online[random(Loop)]);
- }
- stock Get2DZone(Float:x, Float:y, zone[], len)
- {
- for(new i = 0; i != sizeof(gSAZones); i++ )
- {
- if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
- {
- return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
- }
- }
- return false;
- }
- stock GetPlayer2DZone(playerid, zone[], len)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- for(new i = 0; i != sizeof(gSAZones); i++)
- {
- if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
- {
- return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
- }
- }
- return false;
- }
- stock GetVehicle2DZone(vehicleid, zone[], len)
- {
- new Float:x, Float:y, Float:z;
- GetVehiclePos(vehicleid, x, y, z);
- for(new i = 0; i != sizeof(gSAZones); i++)
- {
- if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
- {
- return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
- }
- }
- return false;
- }
- stock GetPlayer3DZone(playerid, zone[], len)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- for(new i = 0; i != sizeof(gSAZones); i++)
- {
- if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4] && z >= gSAZones[i][SAZONE_AREA][2] && z <= gSAZones[i][SAZONE_AREA][5])
- {
- return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
- }
- }
- return false;
- }
- stock IsPlayerInZone(playerid, zone[])
- {
- new TmpZone[MAX_ZONE_NAME];
- GetPlayer3DZone(playerid, TmpZone, sizeof(TmpZone));
- for(new i = 0; i != sizeof(gSAZones); i++)
- {
- if(strfind(TmpZone, zone, true) != -1) return true;
- }
- return false;
- }
- stock IsPlayerInWater(playerid)
- {
- new index = GetPlayerAnimationIndex(playerid);
- return ((index >= 1538 && index <= 1542) || index == 1544 || index == 1250);
- }
- stock IsPlayerBehindPlayer(playerid, targetid, Float:dOffset)
- {
- if(!IsPlayerConnected(playerid) || !IsPlayerConnected(targetid)) return false;
- new Float:pa, Float:ta;
- GetPlayerFacingAngle(playerid, pa);
- GetPlayerFacingAngle(targetid, ta);
- if(AngleInRangeOfAngle(pa, ta, dOffset) && IsPlayerFacingPlayer(playerid, targetid, dOffset)) return true;
- return false;
- }
- stock SetPlayerToFacePlayer(playerid, targetid)
- {
- if(!IsPlayerConnected(playerid) || !IsPlayerConnected(targetid)) return false;
- new Float:pX, Float:pY, Float:pZ, Float:X, Float:Y, Float:Z, Float:ang;
- GetPlayerPos(targetid, X, Y, Z);
- GetPlayerPos(playerid, pX, pY, pZ);
- if(Y > pY) ang = (-acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
- else if(Y < pY && X < pX) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 450.0);
- else if(Y < pY) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
- if(X > pX) ang = (floatabs(floatabs(ang) + 180.0));
- else ang = (floatabs(ang) - 180.0);
- SetPlayerFacingAngle(playerid, ang);
- return false;
- }
- stock SendToInRangeBuilding(playerid, Float:dist, color, accent[], message[])
- {
- if(GetPlayerInterior(playerid) == 0)
- {
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, dist, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ]))
- {
- foreach(new p: Player)
- {
- if(IsInHouseID[p] == h)
- {
- if(IsPlayerInRangeOfPoint(p, dist, InsideIDs[HouseData[h][InsideID] - 1][InsideX], InsideIDs[HouseData[h][InsideID] - 1][InsideY], InsideIDs[HouseData[h][InsideID] - 1][InsideZ]) || IsPlayerInRangeOfPoint(p, dist, HouseData[h][intPosX], HouseData[h][intPosY], HouseData[h][intPosZ]))
- {
- if(strlen(accent) != 0) SendSplitMessageF(p, color, "[Fora] %s grita: [sotaque %s] %s", NameRP(playerid), accent, message);
- else SendSplitMessageF(p, color, "[Fora] %s grita: %s", NameRP(playerid), message);
- }
- }
- }
- }
- }
- for(new b = 0; b < MAX_BIZZ; b++)
- {
- if(IsPlayerInRangeOfPoint(playerid, dist, BizzData[b][oPosX], BizzData[b][oPosY], BizzData[b][oPosZ]))
- {
- foreach(new p: Player)
- {
- if(IsInBizzID[p] == b)
- {
- if(BizzData[b][IsSpecial] == 1)
- {
- if(IsPlayerInRangeOfPoint(p, dist, BizzData[b][iPosX], BizzData[b][iPosY], BizzData[b][iPosZ]))
- {
- if(strlen(accent) != 0) SendSplitMessageF(p, color, "[Fora] %s grita: [sotaque %s] %s", NameRP(playerid), accent, message);
- else SendSplitMessageF(p, color, "[Fora] %s grita: %s", NameRP(playerid), message);
- }
- }
- else
- {
- if(IsPlayerInRangeOfPoint(p, dist, BizzData[b][oPosX], BizzData[b][oPosY], BizzData[b][oPosZ]))
- {
- if(strlen(accent) != 0) SendSplitMessageF(p, color, "[Fora] %s grita: [sotaque %s] %s", NameRP(playerid), accent, message);
- else SendSplitMessageF(p, color, "[Fora] %s grita: %s", NameRP(playerid), message);
- }
- }
- }
- }
- }
- }
- for(new i = 0; i < MAX_INTERIORS; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, dist, Interiors[i][oPosX], Interiors[i][oPosY], Interiors[i][oPosZ]) && GetPlayerVirtualWorld(playerid) == Interiors[i][oVirtualWorld])
- {
- foreach(new p: Player)
- {
- if(IsPlayerInRangeOfPoint(p, dist, Interiors[i][iPosX], Interiors[i][iPosY], Interiors[i][iPosZ]))
- {
- if(strlen(accent) != 0) SendSplitMessageF(p, color, "[OUTSIDE] %s shouts: [%s accent] %s", NameRP(playerid), accent, message);
- else SendSplitMessageF(p, color, "[OUTSIDE] %s shouts: %s", NameRP(playerid), message);
- }
- }
- }
- }
- for(new g = 0; g < MAX_GARAGES; g++)
- {
- if(IsPlayerInRangeOfPoint(playerid, dist, GarageData[g][oPosX], GarageData[g][oPosY], GarageData[g][oPosZ]))
- {
- foreach(new i: Player)
- {
- if(IsInGarageID[i] == g)
- {
- if(GarageData[g][gType] == 4)
- {
- if(IsPlayerInRangeOfPoint(i, dist, GarageData[g][iPosX], GarageData[g][iPosY], GarageData[g][iPosZ]))
- {
- if(strlen(accent) != 0) SendSplitMessageF(i, color, "[OUTSIDE] %s shouts: [%s accent] %s", NameRP(playerid), accent, message);
- else SendSplitMessageF(i, color, "[OUTSIDE] %s shouts: %s", NameRP(playerid), message);
- }
- }
- else
- {
- if(IsPlayerInRangeOfPoint(i, dist, GInsideIDs[GarageData[g][gType] - 1][0], GInsideIDs[GarageData[g][gType] - 1][1], GInsideIDs[GarageData[g][gType] - 1][2]))
- {
- if(strlen(accent) != 0) SendSplitMessageF(i, color, "[OUTSIDE] %s shouts: [%s accent] %s", NameRP(playerid), accent, message);
- else SendSplitMessageF(i, color, "[OUTSIDE] %s shouts: %s", NameRP(playerid), message);
- }
- }
- }
- }
- }
- }
- }
- else
- {
- if(IsInHouseID[playerid] != -1)
- {
- new h = IsInHouseID[playerid];
- if(IsPlayerInRangeOfPoint(playerid, dist, InsideIDs[HouseData[h][InsideID] - 1][InsideX], InsideIDs[HouseData[h][InsideID] - 1][InsideY], InsideIDs[HouseData[h][InsideID] - 1][InsideZ]) || IsPlayerInRangeOfPoint(playerid, dist, HouseData[h][intPosX], HouseData[h][intPosY], HouseData[h][intPosZ]))
- {
- foreach(new p: Player)
- {
- if(IsPlayerInRangeOfPoint(p, dist, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ]))
- {
- if(GetPlayerVirtualWorld(p) == HouseData[h][HouseExtVW])
- {
- if(strlen(accent) != 0) SendSplitMessageF(p, color, "[OUTSIDE] %s shouts: [%s accent] %s", NameRP(playerid), accent, message);
- else SendSplitMessageF(p, color, "[OUTSIDE] %s shouts: %s", NameRP(playerid), message);
- }
- }
- }
- }
- }
- else if(IsInBizzID[playerid] != -1)
- {
- new b = IsInBizzID[playerid];
- if(BizzData[b][IsSpecial] == 1)
- {
- if(IsPlayerInRangeOfPoint(playerid, dist, BizzData[b][iPosX], BizzData[b][iPosY], BizzData[b][iPosZ]))
- {
- foreach(new t: Player)
- {
- if(IsPlayerInRangeOfPoint(t, dist, BizzData[b][oPosX], BizzData[b][oPosY], BizzData[b][oPosZ]))
- {
- if(strlen(accent) != 0) SendSplitMessageF(t, color, "[OUTSIDE] %s shouts: [%s accent] %s", NameRP(playerid), accent, message);
- else SendSplitMessageF(t, color, "[OUTSIDE] %s shouts: %s", NameRP(playerid), message);
- }
- }
- }
- }
- else
- {
- if(IsPlayerInRangeOfPoint(playerid, dist, BInsideIDs[BizzData[b][BizzType]][InsideX], BInsideIDs[BizzData[b][BizzType]][InsideY], BInsideIDs[BizzData[b][BizzType]][InsideZ]))
- {
- foreach(new o: Player)
- {
- if(IsPlayerInRangeOfPoint(o, dist, BizzData[b][oPosX], BizzData[b][oPosY], BizzData[b][oPosZ]))
- {
- if(strlen(accent) != 0) SendSplitMessageF(o, color, "[OUTSIDE] %s shouts: [%s accent] %s", NameRP(playerid), accent, message);
- else SendSplitMessageF(o ,color, "[OUTSIDE] %s shouts: %s", NameRP(playerid), message);
- }
- }
- }
- }
- }
- else if(IsInGarageID[playerid] != -1)
- {
- new g = IsInGarageID[playerid];
- if(GarageData[g][gType] == 4)
- {
- if(IsPlayerInRangeOfPoint(playerid, dist, GarageData[g][iPosX], GarageData[g][iPosY], GarageData[g][iPosZ]))
- {
- foreach(new I: Player)
- {
- if(IsPlayerInRangeOfPoint(I, dist, GarageData[g][oPosX], GarageData[g][oPosY], GarageData[g][oPosZ]))
- {
- if(strlen(accent) != 0) SendSplitMessageF(I, color, "[OUTSIDE] %s shouts: [%s accent] %s", NameRP(playerid), accent, message);
- else SendSplitMessageF(I, color, "[OUTSIDE] %s shouts: %s", NameRP(playerid), message);
- }
- }
- }
- }
- else
- {
- if(IsPlayerInRangeOfPoint(playerid, dist, GInsideIDs[GarageData[g][gType] - 1][0], GInsideIDs[GarageData[g][gType] - 1][1], GInsideIDs[GarageData[g][gType] - 1][2]))
- {
- foreach(new P: Player)
- {
- if(IsPlayerInRangeOfPoint(P, dist, GarageData[g][oPosX], GarageData[g][oPosY], GarageData[g][oPosZ]))
- {
- if(strlen(accent) != 0) SendSplitMessageF(P, color, "[OUTSIDE] %s shouts: [%s accent] %s", NameRP(playerid), accent, message);
- else SendSplitMessageF(P, color, "[OUTSIDE] %s shouts: %s", NameRP(playerid), message);
- }
- }
- }
- }
- }
- for(new i = 0; i < MAX_INTERIORS; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, dist, Interiors[i][iPosX], Interiors[i][iPosY], Interiors[i][iPosZ]) && GetPlayerVirtualWorld(playerid) == Interiors[i][iVirtualWorld])
- {
- foreach(new p: Player)
- {
- if(IsPlayerInRangeOfPoint(p, dist, Interiors[i][oPosX], Interiors[i][iPosY], Interiors[i][oPosZ]) && GetPlayerVirtualWorld(playerid) == Interiors[i][oVirtualWorld])
- {
- if(strlen(accent) != 0) SendSplitMessageF(p, color, "[OUTSIDE] %s shouts: [%s accent] %s", NameRP(playerid), accent, message);
- else SendSplitMessageF(p, color, "[OUTSIDE] %s shouts: %s", NameRP(playerid), message);
- }
- }
- }
- }
- }
- return false;
- }
- stock SetPlayerToFacePoint(playerid, Float:X, Float:Y)
- {
- if(!IsPlayerConnected(playerid)) return false;
- new Float:pX, Float:pY, Float:pZ, Float:ang;
- GetPlayerPos(playerid, pX, pY, pZ);
- if(Y > pY) ang = (-acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
- else if(Y < pY && X < pX) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 450.0);
- else if(Y < pY) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
- if(X > pX) ang = (floatabs(floatabs(ang) + 180.0));
- else ang = (floatabs(ang) - 180.0);
- SetPlayerFacingAngle(playerid, ang);
- return false;
- }
- stock IsPlayerFacingPlayer(playerid, targetid, Float:dOffset)
- {
- if(!IsPlayerConnected(playerid) || !IsPlayerConnected(targetid)) return false;
- new Float:pX, Float:pY, Float:pZ, Float:pA, Float:X, Float:Y, Float:Z, Float:ang;
- GetPlayerPos(targetid, pX, pY, pZ);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, pA);
- if(Y > pY) ang = (-acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
- else if(Y < pY && X < pX) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 450.0);
- else if(Y < pY) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
- if(AngleInRangeOfAngle(-ang, pA, dOffset)) return true;
- return false;
- }
- stock AngleInRangeOfAngle(Float:a1, Float:a2, Float:range)
- {
- a1 -= a2;
- if((a1 < range) && (a1 > -range)) return true;
- return false;
- }
- stock MatrixTransformVector(Float:vector[3], Float:m[4][4], &Float:resx, &Float:resy, &Float:resz)
- {
- resz = vector[2] * m[0][0] + vector[1] * m[0][1] + vector[0] * m[0][2] + m[0][3];
- resy = vector[2] * m[1][0] + vector[1] * m[1][1] + vector[0] * m[1][2] + m[1][3];
- resx = -(vector[2] * m[2][0] + vector[1] * m[2][1] + vector[0] * m[2][2] + m[2][3]);
- }
- stock RotatePointVehicleRotation(vehid, Float:Invector[3], &Float:resx, &Float:resy, &Float:resz, worldspace)
- {
- new Float:Quaternion[4];
- new Float:transformationmatrix[4][4];
- GetVehicleRotationQuat(vehid, Quaternion[0], Quaternion[1], Quaternion[2], Quaternion[3]);
- new Float:xx = Quaternion[0] * Quaternion[0];
- new Float:xy = Quaternion[0] * Quaternion[1];
- new Float:xz = Quaternion[0] * Quaternion[2];
- new Float:xw = Quaternion[0] * Quaternion[3];
- new Float:yy = Quaternion[1] * Quaternion[1];
- new Float:yz = Quaternion[1] * Quaternion[2];
- new Float:yw = Quaternion[1] * Quaternion[3];
- new Float:zz = Quaternion[2] * Quaternion[2];
- new Float:zw = Quaternion[2] * Quaternion[3];
- transformationmatrix[0][0] = 1 - 2 * ( yy + zz );
- transformationmatrix[0][1] = 2 * ( xy - zw );
- transformationmatrix[0][2] = 2 * ( xz + yw );
- transformationmatrix[0][3] = 0.0;
- transformationmatrix[1][0] = 2 * ( xy + zw );
- transformationmatrix[1][1] = 1 - 2 * ( xx + zz );
- transformationmatrix[1][2] = 2 * ( yz - xw );
- transformationmatrix[1][3] = 0.0;
- transformationmatrix[2][0] = 2 * ( xz - yw );
- transformationmatrix[2][1] = 2 * ( yz + xw );
- transformationmatrix[2][2] = 1 - 2 * ( xx + yy );
- transformationmatrix[2][3] = 0;
- transformationmatrix[3][0] = 0;
- transformationmatrix[3][1] = 0;
- transformationmatrix[3][2] = 0;
- transformationmatrix[3][3] = 1;
- MatrixTransformVector(Invector, transformationmatrix, resx, resy, resz);
- if(worldspace == 1)
- {
- new Float:fX, Float:fY, Float:fZ;
- GetVehiclePos(vehid, fX, fY, fZ);
- resx += fX;
- resy += fY;
- resz += fZ;
- }
- }
- stock AddToAdminRecord(playerid, adminid, type, amount, reason[])
- {
- new d, m, y, datestring[12], MAID = MySQLCheckMaster_AgainstSQLID(playerid);
- getdate(y, m, d);
- format(datestring, sizeof(datestring), "%i/%i/%i", d, m, y);
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO adminrecord (PlayerSQLID, PlayerMA, AdminSQLID,RecordType,Reason,Amount,DateOfAction) VALUES (%i,%i,%i,%i,'%e',%i,'%e')", playerid, MAID, adminid, type, reason, amount, datestring);
- mysql_pquery(conn, mquery, "");
- return true;
- }
- stock AdminLog(adminid, playersqlid, playername[], action[])
- {
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO adminlog (AdminName,AdminSQLID,IP,Timestamp,Action,AgainstName,AgainstSQLID) VALUES ('%e',%i,'%e',%i,'%e','%e',%i)", GetName(adminid), SQLID[adminid], PlayerIP[adminid], gettime(), action, playername, playersqlid);
- mysql_pquery(conn, mquery, "");
- return true;
- }
- stock GetDeathReasonName(killerid, reason)
- {
- new Message[55];
- if(!InvalidPlayer(killerid))
- {
- switch(reason)
- {
- case 0: Message = "Unarmed";
- case 1: Message = "Brass Knuckles";
- case 2: Message = "Golf Club";
- case 3: Message = "Night Stick";
- case 4: Message = "Knife";
- case 5: Message = "Baseball Bat";
- case 6: Message = "Shovel";
- case 7: Message = "Pool Cue";
- case 8: Message = "Katana";
- case 9: Message = "Chainsaw";
- case 10: Message = "Dildo";
- case 11: Message = "Dildo";
- case 12: Message = "Vibrator";
- case 13: Message = "Vibrator";
- case 14: Message = "Flowers";
- case 15: Message = "Cane";
- case 22: Message = "Pistol";
- case 23: Message = "Silenced Pistol";
- case 24: Message = "Desert Eagle";
- case 25: Message = "Shotgun";
- case 26: Message = "Sawn-off Shotgun";
- case 27: Message = "Combat Shotgun";
- case 28: Message = "MAC-10";
- case 29: Message = "MP5";
- case 30: Message = "AK-47";
- case 31:
- {
- if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
- {
- switch(GetVehicleModel(GetPlayerVehicleID(killerid)))
- {
- case 447: Message = "Sea Sparrow Machine Gun";
- default: Message = "M4";
- }
- }
- else
- {
- Message = "M4";
- }
- }
- case 32: Message = "TEC-9";
- case 33: Message = "Rifle";
- case 34: Message = "Sniper Rifle";
- case 37: Message = "Fire";
- case 38:
- {
- if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
- {
- switch(GetVehicleModel(GetPlayerVehicleID(killerid)))
- {
- case 425: Message = "Hunter Machine Gun";
- default: Message = "Minigun";
- }
- }
- else
- {
- Message = "Minigun";
- }
- }
- case 41: Message = "Spraycan";
- case 42: Message = "Fire Extinguisher";
- case 49: Message = "Vehicle Collision";
- case 50:
- {
- if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
- {
- switch(GetVehicleModel(GetPlayerVehicleID(killerid)))
- {
- case 417, 425, 447, 465, 469, 487, 488, 497, 501, 548, 563: Message = "Helicopter Blades";
- default: Message = "Vehicle Collision";
- }
- }
- else Message = "Vehicle Collision";
- format(Message, sizeof(Message), "%s [%s]", Message, GetVehicleName(GetPlayerVehicleID(killerid)));
- }
- case 51:
- {
- if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
- {
- switch(GetVehicleModel(GetPlayerVehicleID(killerid)))
- {
- case 425: Message = "Hunter Rockets";
- case 432: Message = "Rhino Turret";
- case 520: Message = "Hydra Rockets";
- default: Message = "Explosion";
- }
- }
- else
- {
- Message = "Explosion";
- }
- }
- default: Message = "Unknown Causes";
- }
- }
- if(InvalidPlayer(killerid))
- {
- switch (reason)
- {
- case 53: Message = "Drowned";
- case 54: Message = "Collision";
- case 55: Message = "Falling";
- default: Message = "Unknown Causes";
- }
- }
- return Message;
- }
- stock GetHospReason(killerid, reason)
- {
- new Message[32];
- if(!InvalidPlayer(killerid))
- {
- switch(reason)
- {
- case 0,1, 10, 11, 12, 13: Message = "Beaten to Death";
- case 2, 3, 5, 6, 7, 15: Message = "Blunt Trauma";
- case 4, 8: Message = "Stab Wounds";
- case 9: Message = "Decapitation";
- case 14: Message = "Hayfever";
- case 22..34, 38: Message = "Gunshot Wounds";
- case 37: Message = "Severe Burns";
- case 41, 42: Message = "Suffocation";
- case 49, 50: Message = "Vehicle Collision";
- case 51: Message = "Explosion";
- default: Message = "Unknown Causes";
- }
- }
- if(InvalidPlayer(killerid))
- {
- switch (reason)
- {
- case 53: Message = "Drowned";
- case 54: Message = "Collision";
- default: Message = "Unknown Causes";
- }
- }
- return Message;
- }
- stock SysMsg(playerid, msg[])
- {
- if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
- {
- SendClientMessage(playerid, COLOR_GREY, msg);
- }
- return true;
- }
- /*stock SysMsgIRC(bot, channel[], message[])
- {
- IRC_SayF(bot, channel, "14%s", message);
- return true;
- }*/
- stock GetObjectCount()
- {
- new TotalObjects = 0;
- for(new objectid = 0; objectid < MAX_OBJECTS; objectid++)
- {
- if(IsValidObject(objectid)) TotalObjects ++;
- }
- return TotalObjects;
- }
- stock GetDateString()
- {
- new DateStr[32], StNdRdTh[3], MonthName[11], Year, Month, Day;
- getdate(Year,Month,Day);
- StNdRdTh = "th";
- if(Day == 1||Day == 21||Day == 31) StNdRdTh = "st";
- else if(Day == 2||Day == 22) StNdRdTh = "nd";
- else if(Day == 3||Day == 23) StNdRdTh = "rd";
- switch(Month)
- {
- case 1: MonthName = "January";
- case 2: MonthName = "February";
- case 3: MonthName = "March";
- case 4: MonthName = "April";
- case 5: MonthName = "May";
- case 6: MonthName = "June";
- case 7: MonthName = "July";
- case 8: MonthName = "August";
- case 9: MonthName = "September";
- case 10: MonthName = "October";
- case 11: MonthName = "November";
- case 12: MonthName = "December";
- }
- format(DateStr,sizeof(DateStr),"%i%s %s %i",Day,StNdRdTh,MonthName,Year);
- return DateStr;
- }
- stock GetMonthName(Month)
- {
- new MonthName[12];
- switch(Month)
- {
- case 1: MonthName = "January";
- case 2: MonthName = "February";
- case 3: MonthName = "March";
- case 4: MonthName = "April";
- case 5: MonthName = "May";
- case 6: MonthName = "June";
- case 7: MonthName = "July";
- case 8: MonthName = "August";
- case 9: MonthName = "September";
- case 10: MonthName = "October";
- case 11: MonthName = "November";
- case 12: MonthName = "December";
- }
- return MonthName;
- }
- stock LastDayInMonth(Month)
- {
- switch(Month)
- {
- case 9,4,6,11: return 30;
- case 2: return 28;
- default: return 31;
- }
- return 30;
- }
- stock GetServerTimeString()
- {
- new AmPm[3], TimeStr[16], mn, hr, sec;
- gettime(hr, mn, sec);
- if(hr >= 0 && hr <= 11) AmPm = "AM";
- else if(hr >= 12 && hr <= 23) AmPm = "PM";
- format(TimeStr,sizeof(TimeStr),"%02d:%02d %s", hr, mn, AmPm);
- return TimeStr;
- }
- stock GetTimeString()
- {
- new AmPm[3], TimeStr[24];
- new hour = gServerHour;
- if(hour >= 0 && hour <= 11)
- {
- if(hour == 0) hour = 12;
- AmPm = "AM";
- }
- else if(hour >= 12 && hour <= 23)
- {
- if(hour != 12) hour -= 12;
- AmPm = "PM";
- }
- format(TimeStr,sizeof(TimeStr),"%02d:%02d:%02d %s", hour, gServerMinute, gServerSecond, AmPm);
- return TimeStr;
- }
- stock GetTimeString24()
- {
- new TimeStr[16];
- format(TimeStr,sizeof(TimeStr),"%02d:%02d:%02d", gServerHour, gServerMinute, gServerSecond);
- return TimeStr;
- }
- stock GetTimeStringAndSec()
- {
- new TimeStr[16];
- format(TimeStr,sizeof(TimeStr),"%02d:%02d:%02d", gServerHour, gServerMinute, gServerSecond);
- return TimeStr;
- }
- stock UnixDate(timestamp, sqlid, type)
- {
- if(sqlid > 0)
- {
- if(type == 1) MySQLFetchInt(sqlid, "LastLogin", timestamp, "players");
- else MySQLFetchInt(sqlid, "LastLogout", timestamp, "players");
- }
- new dateString[50];
- if(timestamp > 0)
- {
- new date[6];
- TimestampToDate(timestamp, date[2], date[1], date[0], date[3], date[4], date[5]);
- format(dateString, sizeof(dateString), "%s the %s %s %i at %02d:%02d:%02d", GetWeekDay(date[0], date[1], date[2]), GetDay(date[0]), GetMonthName(date[1]), date[2], date[3], date[4], date[5]);
- return dateString;
- }
- return dateString;
- }
- new MonthTimes[12][4] =
- {
- {31, 31, 2678400, 2678400},
- {28, 29, 2419200, 2505600},
- {31, 31, 2678400, 2678400},
- {30, 30, 2592000, 2592000},
- {31, 31, 2678400, 2678400},
- {30, 30, 2592000, 2592000},
- {31, 31, 2678400, 2678400},
- {31, 31, 2678400, 2678400},
- {30, 30, 2592000, 2592000},
- {31, 31, 2678400, 2678400},
- {30, 30, 2592000, 2592000},
- {31, 31, 2678400, 2678400}
- };
- stock TimestampToDate(Timestamp, &year, &month, &day, &hour, &minute, &second, HourGMT = 0, MinuteGMT = 0)
- {
- new tmp = 2;
- year = 1970;
- month = 1;
- Timestamp -= 172800; // Delete two days from the current timestamp. This is necessary, because the timestamp retrieved using gettime() includes two too many days.
- for(;;)
- {
- if(Timestamp >= 31536000)
- {
- year ++;
- Timestamp -= 31536000;
- tmp ++;
- if(tmp == 4)
- {
- if(Timestamp >= 31622400)
- {
- tmp = 0;
- year ++;
- Timestamp -= 31622400;
- }
- else break;
- }
- }
- else break;
- }
- for(new i = 0; i < 12; i ++)
- {
- if(Timestamp >= MonthTimes[i][2 + IsLeapYear(year)])
- {
- month ++;
- Timestamp -= MonthTimes[i][2 + IsLeapYear(year)];
- }
- else break;
- }
- day = 1 + (Timestamp / 86400);
- Timestamp %= 86400;
- hour = HourGMT + (Timestamp / 3600);
- Timestamp %= 3600;
- minute = MinuteGMT + (Timestamp / 60);
- second = (Timestamp % 60);
- if(minute > 59)
- {
- minute = 0;
- hour ++;
- if(hour > 23)
- {
- hour -= 24;
- day ++;
- if(day > MonthTimes[month][IsLeapYear(year)])
- {
- day = 1;
- month ++;
- if(month > 12)
- {
- month = 1;
- year ++;
- }
- }
- }
- }
- return true;
- }
- stock IsLeapYear(year)
- {
- if(year % 4 == 0) return true;
- else return false;
- }
- stock GetDay(Day)
- {
- new str[12];
- switch(Day)
- {
- case 1: str = "1";
- case 2: str = "2";
- case 3: str = "3";
- case 4: str = "4";
- case 5: str = "5";
- case 6: str = "6";
- case 7: str = "7";
- case 8: str = "8";
- case 9: str = "9";
- case 10: str = "10";
- case 11: str = "11";
- case 12: str = "12";
- case 13: str = "13";
- case 14: str = "14";
- case 15: str = "15";
- case 16: str = "16";
- case 17: str = "17";
- case 18: str = "18";
- case 19: str = "19";
- case 20: str = "20";
- case 21: str = "21";
- case 22: str = "22";
- case 23: str = "23";
- case 24: str = "24";
- case 25: str = "25";
- case 26: str = "26";
- case 27: str = "27";
- case 28: str = "28";
- case 29: str = "29";
- case 30: str = "30";
- case 31: str = "31";
- }
- return str;
- }
- stock GetWeekDay(day=0, month=0, year=0)
- {
- if(!day)
- getdate(year, month, day);
- new
- szWeekDay[17],
- j,
- e;
- if(month <= 2)
- {
- month += 12;
- --year;
- }
- j = year % 100;
- e = year / 100;
- switch((day + (month+1)*26/10 + j + j/4 + e/4 - 2*e) % 7)
- {
- case 0: szWeekDay = "Saturday";
- case 1: szWeekDay = "Sunday";
- case 2: szWeekDay = "Monday";
- case 3: szWeekDay = "Tuesday";
- case 4: szWeekDay = "Wednesday";
- case 5: szWeekDay = "Thursday";
- case 6: szWeekDay = "Friday";
- }
- return szWeekDay;
- }
- stock IsAccountInactive(sqlid)
- {
- new lastlogin;
- MySQLFetchInt(sqlid, "LastLogin", lastlogin, "players");
- if(gettime() - lastlogin > 2592000) return true;
- else return false;
- }
- stock IsSkinAvailable(skinid)
- {
- if(skinid > 30000 || skinid == 74 || skinid == 149 || skinid == 300 || skinid == 301 || skinid == 302 || skinid == 306 || skinid == 307 || skinid == 308 || skinid == 309 || skinid == 310 || skinid == 30000) return false;
- for(new i = 1; i < MAX_FACTIONS; i++)
- {
- if(FACTIONS[i][FactionIsGang] == 0)
- {
- for(new j = 0; j < 15; j++)
- {
- if(skinid == FACTIONS[i][FactionSkins][j]) return false;
- }
- }
- }
- return true;
- }
- stock IsValidRegChar(reg)
- {
- if((reg <= 'Z' && reg >= 'A') || (reg <= '9' && reg >= '0')) return true;
- return false;
- }
- stock IsValidCharacter(fname[])
- {
- if(strfind(fname, " ") != -1 || strfind(fname, "\\") != -1 || strfind(fname, "/") != -1 || strfind(fname, ":") != -1 || strfind(fname, "*") != -1 || strfind(fname, "?") != -1 || strfind(fname, "\"") != -1 || strfind(fname, "<") != -1 || strfind(fname, ">") != -1 || strfind(fname, "|") != -1 || strfind(fname, ".") != -1) return false; //"
- return true;
- }
- stock InvalidPlayer(playerid)
- {
- if(playerid == -1) return true;
- if(playerid == INVALID_PLAYER_ID) return true;
- if(playerid > MAX_PLAYERS) return true;
- return false;
- }
- stock IsPlayerInArea(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y) return true;
- return false;
- }
- stock IsPlayerNearATM(playerid)
- {
- for(new i = 0; i < sizeof(AtmObjectID); i++)
- {
- new Float:oX, Float:oY, Float:oZ;
- GetDynamicObjectPos(AtmObjectID[i], oX, oY, oZ);
- if(IsPlayerInRangeOfPoint(playerid, 1.75, oX, oY, oZ)) return AtmObjectID[i];
- }
- return false;
- }
- stock IsPlayerAtBar(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.5, 496.316528, -75.509094, 998.757812)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 3.5, 1215.36853, -13.024866, 1000.92187)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 3.5, 499.602142, -20.642665, 1000.67968)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 3.5, -224.80908, 1403.73596, 27.7734371)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 3.5, -2653.5288, 1407.22000, 906.273437)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 3.5, 1139.41406, -3.9287300, 1000.67187)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 3.5, 681.425659, -453.83151, -25.617180)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 3.5, 288.668609, -196.55690, 3091.12890)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 3.5, 1462.73876, -1058.7476, 213.445678)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 3.5, -323.2532, 1300.7740, 1050.1965)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 3.5, 295.1989, -161.1646, 19.2859)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 3.5, -147.0600,2166.9202,35.0268)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 3.5, 24.9786, 391.3047, 2255.9260)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 2.5, 1283.9235, 367.8702, 503.5490)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 2.5, 2250.3191, 45.7931, 4994.1548)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 2.5, 245.5997, -178.4272, 1017.9922)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 2.5, 1401.4512, 2053.8296, 591.7437)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 2.5, -1187.5392, -150.3212, -2.3504)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 2.5, 2330.8923, 17.2535, 996.3070)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 2.5, 252.3542, 1749.1310, 1008.3023)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 2.5, 205.0573, -102.8683, 801.5042)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 2.5, 149.9696, -172.2438, 501.4831)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 2.5, -1186.4799,-150.0452,-2.3504)) return true;
- return false;
- }
- stock GetNSEWBetweenPoints(Float:Px, Float:Py, Float:Pa, Float:fpX, Float:fpY)
- {
- Pa = floatabs(atan((fpY-Py)/(fpX-Px)));
- if(fpX <= Px && fpY >= Py) Pa = floatsub(180, Pa);
- else if(fpX < Px && fpY < Py) Pa = floatadd(Pa, 180);
- else if(fpX >= Px && fpY <= Py) Pa = floatsub(360.0, Pa);
- Pa = floatsub(Pa, 90.0);
- if(Pa >= 360.0) Pa = floatsub(Pa, 360.0);
- if(Pa < 0) Pa += 360.0; // Fix minus values
- new loc;
- if(Pa > 337.5 || Pa < 22.5) loc = 0; // North
- if(Pa > 157.5 && Pa < 202.5) loc = 1; // South
- if(Pa > 247.5 && Pa < 292.5) loc = 2; // East
- if(Pa > 67.5 && Pa < 112.5) loc = 3; // West
- if(Pa > 22.5 && Pa < 67.5) loc = 4; // North-West
- if(Pa > 112.5 && Pa < 157.5) loc = 5; // South-West
- if(Pa > 292.5 && Pa < 337.5) loc = 6; // North-East
- if(Pa > 202.5 && Pa < 247.5) loc = 7; // South-East
- new NSEW[][] =
- {
- "North", // 0
- "South", // 1
- "East", // 2
- "West", // 3
- "North-West", // 4
- "South-West", // 5
- "North-East", // 6
- "South-East" // 7
- };
- new locstr[16];
- format(locstr, sizeof(locstr), "%s", NSEW[loc]);
- return locstr;
- }
- stock GetNSEWBetweenPlayers(playerid, id) // Get the north/south/east/west string between playerid and id
- {
- new Float:Px, Float:Py, Float: Pa;
- GetPlayerPos(playerid, Px, Py, Pa);
- new Float:fpX, Float:fpY, Float: fpZ;
- GetPlayerPos(id, fpX, fpY, fpZ);
- Pa = floatabs(atan((fpY-Py)/(fpX-Px)));
- if(fpX <= Px && fpY >= Py) Pa = floatsub(180, Pa);
- else if(fpX < Px && fpY < Py) Pa = floatadd(Pa, 180);
- else if(fpX >= Px && fpY <= Py) Pa = floatsub(360.0, Pa);
- Pa = floatsub(Pa, 90.0);
- if(Pa >= 360.0) Pa = floatsub(Pa, 360.0);
- if(Pa < 0) Pa += 360.0; // Fix minus values
- new loc;
- if(Pa > 337.5 || Pa < 22.5) loc = 0; // North
- if(Pa > 157.5 && Pa < 202.5) loc = 1; // South
- if(Pa > 247.5 && Pa < 292.5) loc = 2; // East
- if(Pa > 67.5 && Pa < 112.5) loc = 3; // West
- if(Pa > 22.5 && Pa < 67.5) loc = 4; // North-West
- if(Pa > 112.5 && Pa < 157.5) loc = 5; // South-West
- if(Pa > 292.5 && Pa < 337.5) loc = 6; // North-East
- if(Pa > 202.5 && Pa < 247.5) loc = 7; // South-East
- new NSEW[][] = {
- "North", // 0
- "South", // 1
- "East", // 2
- "West", // 3
- "North-West", // 4
- "South-West", // 5
- "North-East", // 6
- "South-East" // 7
- };
- new locstr[16];
- format(locstr, sizeof(locstr), "%s", NSEW[loc]);
- return locstr;
- }
- stock Float:AngleBetweenPoints(Float:X, Float:Y, Float:PointX, Float:PointY)
- {
- new Float:fAngle;
- if(X > PointX && Y > PointY) fAngle = floatabs(atan2(floatsub(PointX, X), floatsub(PointY, Y)));
- if(X > PointX && Y <= PointY) fAngle = floatadd(floatabs(atan2(floatsub(Y, PointY), floatsub(PointX, X))), 270.0);
- if(X <= PointX && Y > PointY) fAngle = floatadd(floatabs(atan2(floatsub(PointY, Y), floatsub(X, PointX))), 90.0);
- if(X <= PointX && Y <= PointY) fAngle = floatadd(floatabs(atan2(floatsub(X, PointX), floatsub(Y, PointY))), 180.0);
- return fAngle >= 360.0 ? floatsub(fAngle, 360.0) : fAngle;
- }
- stock GetXYBehindPlayer(playerid, &Float:X, &Float:Y, Float:distance)
- {
- new Float:A;
- GetPlayerPos(playerid, X, Y, A);
- if(IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), A);
- else GetPlayerFacingAngle(playerid, A);
- X -= (distance * floatsin(-A, degrees));
- Y -= (distance * floatcos(-A, degrees));
- }
- stock GetXYBehindPoint(&Float:X, &Float:Y, Float:angle, Float:distance)
- {
- X -= (distance * floatsin(-angle, degrees));
- Y -= (distance * floatcos(-angle, degrees));
- }
- stock SetXYFromAngle(&Float:X, &Float:Y, Float:angle) // for dropping guns
- {
- X += (5 * floatsin(-angle, degrees));
- Y += (5 * floatcos(-angle, degrees));
- return true;
- }
- stock Float:GetPointAngleToPoint(Float:x2, Float:y2, Float:X, Float:Y)
- {
- new Float:DX, Float:DY;
- new Float:angle;
- DX = floatabs(floatsub(x2,X));
- DY = floatabs(floatsub(y2,Y));
- if(DY == 0.0 || DX == 0.0)
- {
- if(DY == 0 && DX > 0) angle = 0.0;
- else if(DY == 0 && DX < 0) angle = 180.0;
- else if(DY > 0 && DX == 0) angle = 90.0;
- else if(DY < 0 && DX == 0) angle = 270.0;
- else if(DY == 0 && DX == 0) angle = 0.0;
- }
- else
- {
- angle = atan(DX/DY);
- if(X > x2 && Y <= y2) angle += 90.0;
- else if(X <= x2 && Y < y2) angle = floatsub(90.0, angle);
- else if(X < x2 && Y >= y2) angle -= 90.0;
- else if(X >= x2 && Y > y2) angle = floatsub(270.0, angle);
- }
- return floatadd(angle, 90.0);
- }
- stock GetXYInFrontOfPoint(&Float:x, &Float:y, Float:angle, Float:distance)
- {
- x += (distance * floatsin(-angle, degrees));
- y += (distance * floatcos(-angle, degrees));
- }
- stock IsPlayerAimingAt(playerid, Float:x, Float:y, Float:z, Float:radius)
- {
- new Float:camera_x,Float:camera_y,Float:camera_z,Float:vector_x,Float:vector_y,Float:vector_z;
- GetPlayerCameraPos(playerid, camera_x, camera_y, camera_z);
- GetPlayerCameraFrontVector(playerid, vector_x, vector_y, vector_z);
- if(DistanceCameraTargetToLocation(camera_x, camera_y, camera_z, x, y, z, vector_x, vector_y, vector_z) < radius) return true;
- return false;
- }
- stock GetWeatherName(weatherid)
- {
- new wInfo[32];
- switch(weatherid)
- {
- case 0..6: wInfo = "Very Sunny, Hot";
- case 7: wInfo = "Cloudy, Dull";
- case 8: wInfo = "Rainy, Cloudy, Stormy";
- case 9: wInfo = "Foggy";
- case 10: wInfo = "Very Sunny, Hot";
- case 11: wInfo = "Very Sunny, Extremely Hot";
- case 12: wInfo = "Bright, Part Cloudy";
- case 13..15: wInfo = "Cloudy, Haze, Dull";
- case 16: wInfo = "Very Rainy, Stormy";
- case 17,18: wInfo = "Hot, Bright";
- case 19: wInfo = "Sandstorm";
- case 20: wInfo = "Dark, Cloudy, Slight Fog";
- case 23..26: wInfo = "Cool, Orange Skies";
- case 27: wInfo = "Cool, Dull";
- case 28,29: wInfo = "Clear, Bright";
- case 30,31: wInfo = "Dull, Cold, Cloudy";
- case 32: wInfo = "Slight Fog, Dull";
- case 33: wInfo = "Dark, Cloudy";
- case 34: wInfo = "Bright, Warm";
- case 35: wInfo = "Cloudy, Dark/Dull, Slight Rain";
- case 36,37: wInfo = "Bright, Warm, Slight Cloud";
- case 38: wInfo = "Very Cloudy, Dull";
- case 40,41: wInfo = "Orange, Warm, Slight Cloud";
- case 42: wInfo = "Dark/Dull, Very Foggy";
- case 43: wInfo = "Cold, Dark, Very Cloudy";
- default: wInfo = "<No Weather Info>";
- }
- return wInfo;
- }
- stock GetFreeTalkshowLine()
- {
- for(new x = 0; x < sizeof(TalkshowCallers); x++)
- {
- if(TalkshowCallers[x] == -1) return x;
- }
- return -1;
- }
- stock QualifiesForFreeToll(playerid)
- {
- if(DMV_Testing[playerid] != 0) return true;
- if((IsCop(playerid) || Faction[playerid] == FACTION_SACFD) && Duty[playerid] == 1 || Faction[playerid] == FACTION_RESEARCH) return true;
- if(IsDelivering[playerid] == 1) return true;
- if(PlayerLevel[playerid] == 1) return true;
- if(ADuty[playerid] == 1) return true;
- return false;
- }
- stock PreloadAnimLib(playerid, animlib[])
- {
- ApplyAnimation(playerid, animlib, "null", 0.0, 0, 0, 0, 0, 0, 1);
- return true;
- }
- stock Teleport(playerid, Float:x, Float:y, Float:z, Float:a, interior, vworld)
- {
- if(vworld != 0) Streamer_SetVisibleItems(STREAMER_TYPE_OBJECT, 1000, playerid);
- else Streamer_SetVisibleItems(STREAMER_TYPE_OBJECT, VisibleObjects[playerid], playerid);
- TogglePlayerControllable(playerid, false);
- SetPlayerVirtualWorldEx(playerid, vworld);
- SetPlayerInterior(playerid, interior);
- BeingTeleported{playerid} = true;
- SetPlayerPos(playerid, x, y, z);
- SetPlayerFacingAngle(playerid, a);
- TeleportTimer[playerid] = 5;
- return true;
- }
- stock TeleportPlayer(playerid)
- {
- BeingTeleported{playerid} = false;
- TogglePlayerControllable(playerid, true);
- return true;
- }
- stock LinkVehicleToInteriorEx(vehicleid, interiorid)
- {
- if(FVehicleData[vehicleid][FVSQLID] > 0)
- FVehicleData[vehicleid][TempFVInterior] = interiorid;
- LinkVehicleToInterior(vehicleid, interiorid);
- return true;
- }
- stock SetPlayerVirtualWorldEx(playerid, vworld)
- {
- SetPlayerVirtualWorld(playerid, vworld);
- if(IsPlayerMasked{playerid} && MaskHideName{playerid}) FormatHealthLabelText(playerid, HealthVar[playerid], ArmourVar[playerid], 2);
- return true;
- }
- stock AskForMasterAccount(playerid)
- {
- format(sgstr, sizeof(sgstr), "{FFFFFF}Please enter the Master Account username ascociated with the character {3D9140}%s{FFFFFF}\n\nTo avoid this step in the future, please connect with your Master Account username.", NameEx(playerid));
- Dialog_Show(playerid, AskForMA, DIALOG_STYLE_INPUT, "RCRP Login", sgstr, "Continue", "Quit");
- return true;
- }
- stock JustConnectedScreens(playerid)
- {
- ShowLoginBox(playerid);
- TogglePlayerSpectating(playerid, 1);
- LoginScreenID[playerid][0] = random(sizeof(ClassSelectionData));
- LoginScreenID[playerid][1] = 120;
- InterpolateCameraPos(playerid, ClassSelectionData[LoginScreenID[playerid][0]][0], ClassSelectionData[LoginScreenID[playerid][0]][1], ClassSelectionData[LoginScreenID[playerid][0]][2], ClassSelectionData[LoginScreenID[playerid][0]][6], ClassSelectionData[LoginScreenID[playerid][0]][7], ClassSelectionData[LoginScreenID[playerid][0]][8], 120000, CAMERA_MOVE);
- InterpolateCameraLookAt(playerid, ClassSelectionData[LoginScreenID[playerid][0]][3], ClassSelectionData[LoginScreenID[playerid][0]][4], ClassSelectionData[LoginScreenID[playerid][0]][5], ClassSelectionData[LoginScreenID[playerid][0]][9], ClassSelectionData[LoginScreenID[playerid][0]][10], ClassSelectionData[LoginScreenID[playerid][0]][11], 120000, CAMERA_MOVE);
- // Play login screen music
- switch(random(8))
- {
- case 0: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_gt7afvhjasdftu.mp3");
- case 1: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_5tf76yhasf6tds.mp3");
- case 2: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_gr5dqty6h3qxw6.mp3");
- case 3: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_oikicjwya8cq78.mp3");
- case 4: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_sed65tcs57gpjn.mp3");
- case 5: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_qd3w6758hjxcsa.mp3");
- case 6: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_5r4atgsdh7a56r.mp3");
- case 7: PlayAudioStreamForPlayer(playerid, "http://redcountyrp.com/audio/login_mnb12580gdcbtu.mp3");
- }
- return true;
- }
- stock ShowLoginBox(playerid)
- {
- format(sgstr, sizeof(sgstr), "{FFFFFF}Welcome back {3D9140}%s{FFFFFF}.\nPlease login with your password below:", GetName(playerid));
- Dialog_Show(playerid, LoginDialog, DIALOG_STYLE_PASSWORD, "Greenside Roleplay - Login", sgstr, "Login", "Quit");
- return true;
- }
- stock IsPlayerSpawned(playerid)
- {
- new statex = GetPlayerState(playerid);
- if(!IsInHospital{playerid} && statex != PLAYER_STATE_NONE && statex != PLAYER_STATE_WASTED && statex != PLAYER_STATE_SPECTATING) return true;
- else return false;
- }
- stock randomize(minnum = cellmin, maxnum = cellmax)
- {
- return random(maxnum - minnum + 1) + minnum;
- }
- stock SetPlayerSkinEx(playerid, skinid)
- {
- cPlayersSkin[playerid] = skinid;
- if(IsPlayerInAnyVehicle(playerid))
- {
- new vehicleid = GetPlayerVehicleID(playerid), CarSeatID = GetPlayerVehicleSeat(playerid);
- if(CarSeatID == 128) return SetPlayerSkin(playerid, skinid);
- RemovePlayerFromVehicle(playerid);
- SetPlayerSkin(playerid, skinid);
- PutPlayerInVehicle(playerid, vehicleid, CarSeatID);
- return true;
- }
- else SetPlayerSkin(playerid, skinid);
- return true;
- }
- stock GetVehicleRelativePos(vehicleid, &Float:x, &Float:y, &Float:z, Float:xoff=0.0, Float:yoff=0.0, Float:zoff=0.0)
- {
- new Float:rot;
- GetVehicleZAngle(vehicleid, rot);
- rot = 360 - rot;
- GetVehiclePos(vehicleid, x, y, z);
- x = floatsin(rot,degrees) * yoff + floatcos(rot,degrees) * xoff + x;
- y = floatcos(rot,degrees) * yoff - floatsin(rot,degrees) * xoff + y;
- z = zoff + z;
- }
- stock Pressing(playerid)
- {
- new keys, updown, leftright;
- GetPlayerKeys(playerid, keys, updown, leftright);
- return keys;
- }
- stock IsVehicleInRangeOfPoint(vehicleid, Float:radi, Float:x, Float:y, Float:z)
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetVehiclePos(vehicleid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return true;
- }
- return false;
- }
- stock IsPointInRangeOfPoint(Float:x, Float:y, Float:z, Float:x2, Float:y2, Float:z2, Float:range)
- {
- x2 -= x;
- y2 -= y;
- z2 -= z;
- return ((x2 * x2) + (y2 * y2) + (z2 * z2)) < (range * range);
- }
- // Weapon drop stuff
- stock DropGun(playerid, GType, GunModel, GunAmmo, Float:X, Float:Y, Float:Z, world, interior) //Type: 1 = Gun, 2 = weed, 3 = Moonshine, 4 = Crack, 5 = Mats, 6 = phone
- {
- if(GunModel != 0 && GunAmmo != 0)
- {
- for(new i = 0; i < MAX_GUNS; i++)
- {
- if(WeaponDrop[i][wX] == 0.0 && WeaponDrop[i][wY] == 0.0 && WeaponDrop[i][wZ] == 0.0)
- {
- WeaponDrop[i][Type] = GType;
- WeaponDrop[i][DropModel] = GunModel;
- WeaponDrop[i][DropAmmo] = GunAmmo;
- if(GType == 1) WeaponDrop[i][DropWeaponID] = WeaponData[playerid][GetWeaponSlot(WeaponDrop[i][DropModel])][WeaponID];
- WeaponDrop[i][wX] = X;
- WeaponDrop[i][wY] = Y;
- WeaponDrop[i][wZ] = Z;
- WeaponDrop[i][DropvWorld] = world;
- WeaponDrop[i][DropInt] = interior;
- WeaponDrop[i][gSpawned] = 1;
- if(GType == 6)
- {
- WeaponDrop[i][PhoneID] = PhoneData[playerid][pID];
- WeaponDrop[i][DropPhoneNumber] = PhoneData[playerid][pNumber];
- WeaponDrop[i][DropPhonePower] = PhoneData[playerid][pPower];
- ClearPhoneData(playerid);
- }
- if(GunModel == 1575 || GunModel == 1577 || GunModel == 1950) DropObject[i] = CreateDynamicObject(GunModel, X, Y, Z-1.15, 0.0, 0.0, 0.0, world, interior);
- else if(GunModel == 330) DropObject[i] = CreateDynamicObject(GunModel, X, Y, Z-0.9, 0, 90, 0, world, interior);
- else DropObject[i] = CreateDynamicObject(WeaponObjects[GunModel], X, Y, Z-1, 80.0, 0.0, 0.0, world, interior);
- break;
- }
- }
- }
- return true;
- }
- stock GetGunSlot()
- {
- for(new i = 0; i < MAX_GUNS; i++)
- {
- if(!WeaponDrop[i][gSpawned]) { return i; }
- }
- return -1;
- }
- // Fly spec
- stock StartFlyEditor(playerid)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- if(IsSpectating[playerid] != -1) cmd_spectateoff(playerid);
- if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);
- PfSpec[playerid][FlySpec] = 1;
- PfSpec[playerid][fsobj] = CreatePlayerObject(playerid, 19300, X, Y, Z, 0.0, 0.0, 0.0);
- PfSpec[playerid][fspeed] = 50;
- TempInfo[playerid][tSkin] = GetPlayerSkin(playerid);
- TempInfo[playerid][tInt] = GetPlayerInterior(playerid);
- TempInfo[playerid][tVW] = GetPlayerVirtualWorld(playerid);
- SendClientMessage(playerid, COLOR_WHITE, "You have entered Fly Spectate mode");
- SendClientMessage(playerid, COLOR_WHITE, "Use {FF0000}~k~~GO_FORWARD~ ~k~~GO_BACK~ ~k~~GO_LEFT~ ~k~~GO_RIGHT~{FFFFFF} to move the camera.");
- SendClientMessage(playerid, COLOR_WHITE, "Press {FF0000}~k~~PED_JUMPING~{FFFFFF} to speed up and {FF0000}~k~~PED_SPRINT~{FFFFFF} to slow down.");
- SendClientMessage(playerid, COLOR_WHITE, "To exit the spectate mode, type {FF0000}/fly{FFFFFF} again.");
- TogglePlayerSpectating(playerid, true);
- AttachCameraToPlayerObject(playerid, PfSpec[playerid][fsobj]);
- return true;
- }
- stock EndFlyEditor(playerid)
- {
- PfSpec[playerid][FlySpec] = 0;
- GetPlayerCameraPos(playerid, PfSpec[playerid][CamPos][0], PfSpec[playerid][CamPos][1], PfSpec[playerid][CamPos][2]);
- TogglePlayerSpectating(playerid, false);
- DestroyPlayerObject(playerid, PfSpec[playerid][fsobj]);
- SetPlayerSkinEx(playerid,TempInfo[playerid][tSkin]);
- SetPlayerInterior(playerid,TempInfo[playerid][tInt]);
- SetPlayerVirtualWorldEx(playerid,TempInfo[playerid][tVW]);
- SetPlayerPos(playerid, PfSpec[playerid][CamPos][0], PfSpec[playerid][CamPos][1], PfSpec[playerid][CamPos][2]);
- SyncPlayerWeapons(playerid);
- SetTimerEx("UnFreezePlayer", 200, 0, "d", playerid);
- PfSpec[playerid][CamPos][0] = 0;
- PfSpec[playerid][CamPos][1] = 0;
- PfSpec[playerid][CamPos][2] = 0;
- PfSpec[playerid][mdir] = 0;
- PfSpec[playerid][updownold] = 0;
- PfSpec[playerid][leftrightold] = 0;
- ClearTempInfo(playerid);
- return true;
- }
- stock GetMoveDirectionFromKeys(updown, leftright)
- {
- new direction = 0;
- if(leftright < 0)
- {
- if(updown < 0) direction = 7;//ForwardLest
- else if(updown > 0) direction = 5;//BackLeft
- else direction = 3;//Left
- }
- else if(leftright > 0)
- {
- if(updown < 0) direction = 8;//ForwardRight
- else if(updown > 0) direction = 6;//BackRight
- else direction = 4;//Right
- }
- else if(updown < 0) direction = 1;//Forward
- else if(updown > 0) direction = 2;//Back
- return direction;
- }
- stock MoveCamera(playerid)
- {
- new Float:fvector[3], Float:pCPos[3];
- GetPlayerCameraPos(playerid, pCPos[0], pCPos[1], pCPos[2]);
- GetPlayerCameraFrontVector(playerid, fvector[0], fvector[1], fvector[2]);
- new Float:X, Float:Y, Float:Z;
- GetNextCameraPosition(PfSpec[playerid][mdir], pCPos, fvector, X, Y, Z);
- MovePlayerObject(playerid, PfSpec[playerid][fsobj], X, Y, Z, PfSpec[playerid][fspeed]);
- PfSpec[playerid][lastmove] = GetTickCount();
- return true;
- }
- stock GetNextCameraPosition(move_mode, Float:pCPos[3], Float:fvector[3], &Float:X, &Float:Y, &Float:Z)
- {
- #define OFFSET_X (fvector[0]*6000.0)
- #define OFFSET_Y (fvector[1]*6000.0)
- #define OFFSET_Z (fvector[2]*6000.0)
- switch(move_mode)
- {
- case 1://Forward
- {
- X = pCPos[0]+OFFSET_X;
- Y = pCPos[1]+OFFSET_Y;
- Z = pCPos[2]+OFFSET_Z;
- }
- case 2://Back
- {
- X = pCPos[0]-OFFSET_X;
- Y = pCPos[1]-OFFSET_Y;
- Z = pCPos[2]-OFFSET_Z;
- }
- case 3://Left
- {
- X = pCPos[0]-OFFSET_Y;
- Y = pCPos[1]+OFFSET_X;
- Z = pCPos[2];
- }
- case 4://Right
- {
- X = pCPos[0]+OFFSET_Y;
- Y = pCPos[1]-OFFSET_X;
- Z = pCPos[2];
- }
- case 5://BackLeft
- {
- X = pCPos[0]+(-OFFSET_X - OFFSET_Y);
- Y = pCPos[1]+(-OFFSET_Y + OFFSET_X);
- Z = pCPos[2]-OFFSET_Z;
- }
- case 6://BackRight
- {
- X = pCPos[0]+(-OFFSET_X + OFFSET_Y);
- Y = pCPos[1]+(-OFFSET_Y - OFFSET_X);
- Z = pCPos[2]-OFFSET_Z;
- }
- case 7://ForwardLeft
- {
- X = pCPos[0]+(OFFSET_X - OFFSET_Y);
- Y = pCPos[1]+(OFFSET_Y + OFFSET_X);
- Z = pCPos[2]+OFFSET_Z;
- }
- case 8://ForwardRight
- {
- X = pCPos[0]+(OFFSET_X + OFFSET_Y);
- Y = pCPos[1]+(OFFSET_Y - OFFSET_X);
- Z = pCPos[2]+OFFSET_Z;
- }
- }
- }
- stock randomString(strDest[], strLen = 10)
- {
- while(strLen--)
- strDest[strLen] = random(2) ? (random(26) + (random(2) ? 'A' : 'A')) : (random(10) + '0');
- }
- stock IsSQLIDConnected(sqlid)
- {
- foreach(new i: Player)
- {
- if(sqlid == SQLID[i]) return true;
- }
- return false;
- }
- stock ResetPlayerVariables(playerid)
- {
- ClearTempInfo(playerid);
- ClearInjuriesForPlayer(playerid);
- ClearPhoneData(playerid);
- ClearClothingSelection(playerid);
- for(new k = 0; k < MAX_TOTAL_WEAPONS; k++)
- {
- if(WeaponData[playerid][k][WeaponID] >= 1)
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET WeaponAmmo = %i WHERE id = %i", WeaponData[playerid][k][WeaponAmmo], WeaponData[playerid][k][WeaponID]);
- mysql_pquery(conn, mquery);
- }
- }
- ResetWeaponVariables(playerid, 1, -1);
- if(CarryingCrate[playerid] >= 1)
- {
- new Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- RemovePlayerAttachedObject(playerid, 7);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- CarryingCrate[playerid] = 0;
- }
- hmData[playerid][hmActive] = 0;
- hmData[playerid][hmOldName][0] = EOS;
- hmData[playerid][hmNewName][0] = EOS;
- PlayerSelectedCharacter{playerid} = false;
- for(new id = 0; id < MAX_PLAYERS; id++)
- {
- if(FishingCrates[id][CrateOwner] == SQLID[playerid])
- {
- FishingCrates[id][CrateID] = 0;
- if(FishingCrates[id][FishingCrateObject] != INVALID_OBJECT_ID) DestroyDynamicObject(FishingCrates[id][FishingCrateObject]);
- FishingCrates[id][FishingCrateObject] = INVALID_OBJECT_ID;
- FishingCrates[id][CrateOwner] = 0;
- FishingCrates[id][CrateType] = 0;
- FishingCrates[id][CrateVehicle] = 0;
- FishingCrates[id][CrateLocX] = 0.0;
- FishingCrates[id][CrateLocY] = 0.0;
- FishingCrates[id][CrateLocZ] = 0.0;
- }
- if(id < MAX_TOTAL_WEAPONS)
- {
- WeaponCheatAlerted[id]{playerid} = false;
- }
- if(PaintLabels[playerid][id] != Text3D:INVALID_3DTEXT_ID)
- {
- DestroyDynamic3DTextLabel(PaintLabels[playerid][id]);
- PaintLabels[playerid][id] = Text3D:INVALID_3DTEXT_ID;
- }
- if(id < MAX_TEMPCLOTHES)
- {
- if(Clothing_Objects[playerid][id] != INVALID_OBJECT_ID)
- {
- Clothing_Objects[playerid][id] = INVALID_OBJECT_ID;
- }
- }
- if(id < MAX_VEH_PER_PLAYER)
- {
- PlayerCars[playerid][id][CarSQLID] = 0;
- PlayerCars[playerid][id][CarModel] = 0;
- PlayerCars[playerid][id][CarCol1] = 0;
- PlayerCars[playerid][id][CarCol2] = 0;
- PlayerCars[playerid][id][CarPosX] = 0.0;
- PlayerCars[playerid][id][CarPosY] = 0.0;
- PlayerCars[playerid][id][CarPosZ] = 0.0;
- PlayerCars[playerid][id][CarSpawned] = false;
- }
- if(id < MAX_TOYS) ClearToyData(playerid, id);
- if(id < 14) ModQueue[playerid][id] = 0;
- if(id < MAX_ACHS) HasUnlockedAchievement[playerid][id] = 0; //75
- if(id < MAX_PLAYERROADBLOCKS)
- {
- RoadBlockObjects[playerid][id] = INVALID_OBJECT_ID;
- RoadBlockTimer[playerid][id] = 0;
- }
- if(id < MAX_BIZZ_PER_PLAYER) PlayerBizzID[playerid][id] = -1;
- if(id < 5)
- {
- NotepadText[playerid][id] = "blank";
- Clothes[playerid][id] = 0;
- }
- if(id < 3)
- {
- DeliverStockList[playerid][id] = 0;
- RefuelStandPos[playerid][id] = 0.0;
- RadioSlot[playerid][id] = 0;
- }
- if(id < 10)
- {
- if(PizzaMarkers[playerid][id] != -1) DestroyDynamicMapIcon(PizzaMarkers[playerid][id]);
- PizzaHomes[playerid][id] = -1;
- PizzaMarkers[playerid][id] = -1;
- ViewingTextID[playerid][id] = 0;
- AttachedObjects[playerid][id][aoToyID] = 0;
- AttachedObjects[playerid][id][aoModelID] = 0;
- AttachedObjects[playerid][id][aoOffset][0] = 0.0;
- AttachedObjects[playerid][id][aoOffset][1] = 0.0;
- AttachedObjects[playerid][id][aoOffset][2] = 0.0;
- AttachedObjects[playerid][id][aoRot][0] = 0.0;
- AttachedObjects[playerid][id][aoRot][1] = 0.0;
- AttachedObjects[playerid][id][aoRot][2] = 0.0;
- AttachedObjects[playerid][id][aoScale][0] = 0.0;
- AttachedObjects[playerid][id][aoScale][1] = 0.0;
- AttachedObjects[playerid][id][aoScale][2] = 0.0;
- AttachedObjects[playerid][id][aoBone] = 0;
- AttachedObjects[playerid][id][aoColor] = 0;
- AttachedObjects[playerid][id][aoRemoved] = false;
- }
- if(id < 4)
- {
- CharSelectSQL[playerid][id] = 0;
- CharSelectSkin[playerid][id] = 0;
- CharSelectFaction[playerid][id] = 0;
- CharSelectLevel[playerid][id] = 0;
- }
- }
- if(MaskLabel[playerid] != Text3D:INVALID_3DTEXT_ID) DestroyDynamic3DTextLabel(MaskLabel[playerid]);
- MaskLabel[playerid] = Text3D:INVALID_3DTEXT_ID;
- if(IsPlayerMasked{playerid})
- {
- DeleteMaskLabel(playerid);
- MaskLabelNumber[playerid] = 0;
- MaskHideName{playerid} = false;
- IsPlayerMasked{playerid} = false;
- }
- if(IsAFK{playerid})
- {
- DeleteAFKLabel(playerid);
- TextDrawHideForPlayer(playerid, URAFK2);
- TextDrawHideForPlayer(playerid, URAFK3);
- }
- SpawnCheckTimer[playerid] = 0;
- VSelectOffset[playerid] = -1;
- VSelectID[playerid][0] = -1;
- VSelectID[playerid][1] = -1;
- VSelectID[playerid][2] = -1;
- pSpecLimit[playerid] = 0;
- pDrunkLevelLast[playerid] = 0;
- pFPS[playerid] = 0;
- HintToggle{playerid} = false;
- HasPizza{playerid} = false;
- PizzaIndex[playerid] = -1;
- HasEventWeapon{playerid} = false;
- SpawnAtHouse[playerid] = -1;
- UsingPaint{playerid} = false;
- FurnPosX[playerid] = 0.0;
- FurnPosY[playerid] = 0.0;
- FurnPosZ[playerid] = 0.0;
- FurnRotX[playerid] = 0.0;
- FurnRotY[playerid] = 0.0;
- FurnRotZ[playerid] = 0.0;
- IsESU{playerid} = false;
- CampfirePlaced[playerid] = INVALID_OBJECT_ID;
- BodyBagIndex[playerid] = -1;
- HasBodyBag{playerid} = false;
- EditingTempObject[playerid] = -1;
- PreTaserWeapon[playerid] = 0;
- EditingHouseFurn[playerid] = -1;
- RestrictedVest{playerid} = false;
- BuyFurnFrom[playerid] = -1;
- PMReplyID[playerid] = -1;
- HelperTog{playerid} = false;
- TrailerInterior[playerid] = 0;
- BizzSpawn[playerid] = 0;
- IPTog{playerid} = false;
- if(OrderingWeapons[playerid] != 0) FACTIONS[Faction[playerid]][FactionOrderingWeapons] = 0;
- DrunkLevel[playerid] = 0;
- JustDeletedVehicle{playerid} = false;
- VehicleShareOffer[playerid][0] = -1;
- HospitalTimer[playerid] = 0;
- PendingPaintjob[playerid] = -1;
- AudioToggle{playerid} = false;
- JourneyTimerPlayer[playerid] = 0;
- HeadshotsHit[playerid] = 0;
- ShotsFired[playerid] = 0;
- ShotsHit[playerid] = 0;
- TropicInterior[playerid] = 0;
- Dead{playerid} = false;
- SFRadius[playerid] = 0.0;
- RentalRevoked{playerid} = false;
- RentalTime[playerid] = 0;
- RentalCar[playerid] = 0;
- AdminHidden[playerid] = false;
- BuyFurnPos[playerid][0] = 0.0;
- BuyFurnPos[playerid][1] = 0.0;
- BuyFurnPos[playerid][2] = 0.0;
- BuyFurnPos[playerid][3] = 0.0;
- BuyFurnPos[playerid][4] = 0.0;
- BuyFurnPos[playerid][5] = 0.0;
- BeingBanned{playerid} = false;
- JustEnteredVehicle[playerid] = 0;
- MemberBrowsing[playerid] = 0;
- RemovingRoadblock{playerid} = false;
- EditingRoadblock[playerid] = -1;
- SelectingRoadblock{playerid} = false;
- ResettingMask[playerid] = -1;
- FishSpamTime[playerid] = 0;
- FightStyleLearned[playerid]{FS_BOXING} = false;
- FightStyleLearned[playerid]{FS_KUNGFU} = false;
- VisibleObjects[playerid] = 0;
- OrderCost[playerid] = 0;
- ACPauseTimer[playerid] = 0;
- EditingAttachedObject[playerid] = 0;
- HitCount[playerid] = 0;
- BeingHealed[playerid] = 0;
- HealID[playerid] = -1;
- HealedBy[playerid] = -1;
- Healing[playerid] = -1;
- TextTimer[playerid] = 0;
- VestType[playerid] = 0;
- TeleportTimer[playerid] = 0;
- IsDead[playerid] = 0;
- WeaponsOrdered[playerid][0] = 0;
- WeaponsOrdered[playerid][1] = 0;
- WeaponsOrdered[playerid][2] = 0;
- WeaponsOrdered[playerid][3] = 0;
- WeaponsOrdered[playerid][4] = 0;
- OrderingWeaponsIndex[playerid] = 0;
- OrderingWeapons[playerid] = 0;
- DeathTimer[playerid] = 0;
- mdcName[playerid][0] = EOS;
- pTimerCount[playerid] = 0;
- pTCount[playerid] = 0;
- ToyBeingEdited[playerid] = -1;
- CurrentWeapon[playerid] = -1;
- IsEditingHolster[playerid] = 0;
- HelperMsgTog[playerid] = 0;
- nameshidden[playerid] = 0;
- ptogf{playerid} = false;
- Logged{playerid} = false;
- JustSpawned{playerid} = false;
- AdminLevel[playerid] = 0;
- ADuty[playerid] = 0;
- IsSpectating[playerid] = -1;
- CallerID[playerid] = -1;
- CallerService[playerid] = -1;
- BeingAssistedBy[playerid] = -1;
- RequestingAdmin[playerid] = -1;
- FilledForm[playerid] = 0;
- Muted[playerid] = 0;
- DOOCMuted[playerid] = 0;
- Cash[playerid] = 0;
- ResetPlayerMoney(playerid);
- PlayerLevel[playerid] = 0;
- PlayerXP[playerid] = 0;
- cPlayersSkin[playerid] = 0;
- Faction[playerid] = 0;
- FactionCustomRank[playerid][0] = EOS;
- RelogSpawnPos[playerid][0] = 0.0;
- RelogSpawnPos[playerid][1] = 0.0;
- RelogSpawnPos[playerid][2] = 0.0;
- RelogSpawnSaved[playerid] = 1;
- Job[playerid] = 0;
- JobSpamTime[playerid] = 0;
- FactionRank[playerid] = 0;
- BankBalance[playerid] = 0;
- TimeOnline[playerid] = 0;
- GuestHouseID[playerid] = 0;
- TotalTimePlayed[playerid] = 0;
- CheckReady{playerid} = false;
- IsInHospital{playerid} = false;
- IsChangingSkin{playerid} = false;
- //IsBrowsingMasks[playerid] = 0;
- BrowseMaskType[playerid] = 0;
- IsAFK{playerid} = false;
- AwayMinutes[playerid] = 0;
- IsPlayingLottery{playerid} = false;
- LotteryNumber[playerid] = -1;
- IsJailed[playerid] = 0;
- IsCuffed[playerid] = 0;
- Duty[playerid] = 0;
- JobDuty[playerid] = 0;
- IsPhoneRinging[playerid] = -1;
- IsPlayerRefilling[playerid] = 0;
- TruckRouteId[playerid] = 0;
- IsTrucking[playerid] = 0;
- TruckIndex[playerid] = 0;
- TruckStat[playerid] = 0;
- TruckLevel[playerid] = 1;
- TruckSpamTime[playerid] = 0;
- DeliveringFuel[playerid] = 0;
- DeliveringFuelVeh[playerid][0] = 0;
- DeiveringFuelAmount[playerid] = 0;
- DeiveringFuelType[playerid] = 0;
- FishWeight[playerid][0] = -1;
- FishWeight[playerid][1] = -1;
- FishWeight[playerid][2] = -1;
- FishWeight[playerid][3] = -1;
- FishWeight[playerid][4] = -1;
- FishingRodHealth[playerid] = 100;
- BiggestFish[playerid] = 0;
- IsDelivering[playerid] = 0;
- DeliverIndex[playerid] = 0;
- DeliverStat[playerid] = 0;
- DeliverLevel[playerid] = 1;
- DeliverSpamTime[playerid] = 0;
- HasJustDied[playerid] = 0;
- NoobSpawnID[playerid] = -1;
- PlayerCalledTaxi[playerid] = 0;
- gPlayerUsingLoopingAnim[playerid] = 0;
- gPlayerAnimLibsPreloaded[playerid] = false;
- WeaponSkillLevel[playerid] = 1;
- TransferingMoneyTo[playerid] = -1;
- AchievementPoints[playerid] = 0;
- RoadBlockCount[playerid] = 0;
- WaitingForTruckTrailer[playerid] = 0;
- ViewingBuyableCar[playerid] = 0;
- MySpawnID[playerid] = 0;
- InvitedToJoinFaction[playerid] = 0;
- InvitedToJoinFactionBy[playerid] = 0;
- IsDrivingBus{playerid} = false;
- BusRouteIndex[playerid] = -1;
- WaitingAtStop{playerid} = false;
- DeliveringAtStop[playerid] = 0;
- ConsumingMoney[playerid] = 0;
- Licenses[playerid][LICENSE_CAR] = 0;
- Licenses[playerid][LICENSE_LGV] = 0;
- Licenses[playerid][LICENSE_BIKE] = 0;
- Licenses[playerid][LICENSE_BOAT] = 0;
- Licenses[playerid][LICENSE_HELI] = 0;
- Licenses[playerid][LICENSE_PLANE] = 0;
- LicenseSuspendTime[playerid][LICENSE_CAR] = 0;
- LicenseSuspendTime[playerid][LICENSE_LGV] = 0;
- LicenseSuspendTime[playerid][LICENSE_BIKE] = 0;
- LicenseSuspendTime[playerid][LICENSE_BOAT] = 0;
- LicenseSuspendTime[playerid][LICENSE_HELI] = 0;
- LicenseSuspendTime[playerid][LICENSE_PLANE] = 0;
- RadioFrequency[playerid] = -1;
- RadioPoweredOn[playerid] = 0;
- RadioSlotUsed[playerid] = 0;
- JailTime[playerid] = 0;
- IsPlayerMasked{playerid} = false;
- MaskHideName{playerid} = false;
- ShamalInterior[playerid] = 0;
- LastPlayerPos[playerid][0] = 0.0;
- LastPlayerPos[playerid][1] = 0.0;
- LastPlayerPos[playerid][2] = 0.0;
- TimeIsDisplayed{playerid} = false;
- PaycheckDisplayed{playerid} = true;
- CompletedTutorial{playerid} = false;
- SwatMode[playerid] = 0;
- IsDragging[playerid] = -1;
- ViewingMicksCar[playerid] = -1;
- ViewingMicksCarID[playerid] = -1;
- ViewingBuyBikes[playerid] = -1;
- ViewingBikeID[playerid] = -1;
- ViewingBoatID[playerid] = -1;
- ViewingBuyBoats[playerid] = -1;
- ViewingDV3ID[playerid] = -1;
- ViewingBuyDV3[playerid] = -1;
- ViewingDV4ID[playerid] = -1;
- ViewingBuyDV4[playerid] = -1;
- AcceptPM{playerid} = true;
- HasGPSWaypoint[playerid] = 0;
- TakeGunPlayer[playerid] = -1;
- TruckingJobData[playerid][0] = 0;
- TruckingJobData[playerid][1] = 0;
- PoliceFineAmount[playerid] = -1;
- UsingFightStyle{playerid} = FIGHT_STYLE_NORMAL;
- LastEventPos[playerid][0] = -1.0;
- LastEventPos[playerid][1] = -1.0;
- LastEventPos[playerid][2] = -1.0;
- LastEventIDs[playerid][0] = 0;
- LastEventIDs[playerid][1] = 0;
- CurrentArmourVar[playerid] = 0;
- CurrentHealthVar[playerid] = 0;
- IsHelper{playerid} = false;
- IsDonator[playerid] = 0;
- GoldToggle[playerid] = 0;
- AdminJailData[playerid][0] = 0;
- AdminJailData[playerid][1] = 0;
- OOCToggle[playerid] = 0;
- QuitFromFaction[playerid] = 0;
- DrugSpamTimer[playerid] = 0;
- JailCell[playerid] = 0;
- IsTied[playerid] = 0;
- TruckingTrailer[playerid] = 0;
- PlayerToBeDetained[playerid] = -1;
- PlayerToBeDetainedSeat[playerid] = -1;
- SubFactionSpawn[playerid] = 0;
- IsCoalmining[playerid] = 0;
- CoalmineIndex[playerid] = 0;
- CoalmineStat[playerid] = 0;
- CoalmineLevel[playerid] = 1;
- CoalmineSpamTime[playerid] = 0;
- AdvertSpamTime[playerid] = 0;
- WantsRescue[playerid] = 0;
- HealSpamTime[playerid] = 0;
- ToggleDOOC{playerid} = false;
- BackupType[playerid] = 0;
- BackupLocation[playerid][0] = 0;
- Accent[playerid][0] = 0;
- UsingAccent[playerid] = 0;
- SellingAsset[playerid][0] = 0; //yes/no
- SellingAsset[playerid][1] = -1; //playerid
- SellingAsset[playerid][2] = 0; //type
- SellingAsset[playerid][3] = -1; //id
- SellingAsset[playerid][4] = 0; //price
- SellingAsset[playerid][5] = -1;
- IsTrashMan[playerid] = 0;
- TrashIndex[playerid] = 0;
- TrashStat[playerid] = 0;
- TrashLevel[playerid] = 1;
- TrashSpamTime[playerid] = 0;
- TrashMissionData[playerid][0] = 0;
- TrashMissionData[playerid][1] = 0;
- TrashMissionData[playerid][2] = 0;
- SpeedFormat[playerid] = 0;
- SpeedoActive[playerid] = 1;
- LastNumber[playerid] = -1;
- TaxiFare[playerid] = 0;
- TaxiForceFare[playerid] = -1;
- TaxiFareID[playerid] = -1;
- TaxiMeter[playerid] = 0;
- MyFareCharge[playerid] = 0;
- PMSpamTime[playerid] = 0;
- TutorialIndex[playerid] = 0;
- MyDeaths[playerid] = 0;
- MyKills[playerid] = 0;
- AwaitingSpray[playerid] = 0;
- GoingToSprayVehicleID[playerid] = 0;
- RequestedToShake[playerid] = -1;
- RequestedToFShake[playerid] = -1;
- RequestedToKiss[playerid] = -1;
- JourneyInterior[playerid] = 0;
- MobileSpeaker[playerid] = 0;
- PagerStatus{playerid} = true;
- InCarCharging[playerid] = 0;
- Appearance[playerid][0] = EOS;
- VehicleBorrowKeyTime[playerid] = 0;
- VehicleBorrowKey[playerid] = 0;
- VehicleShareOffer[playerid][0] = -1;
- VehicleShareOffer[playerid][1] = 0;
- VehicleShareOffer[playerid][2] = 0;
- MaskLabelNumber[playerid] = 0;
- RentRoom[playerid] = 0;
- MotelWaypoint[playerid] = 0;
- IsInMotel[playerid] = 0;
- PasswordTries[playerid] = 0;
- UsingPayPhone[playerid] = 0;
- DMV_Testing[playerid] = 0;
- DMV_SpeedLimit[playerid] = 0;
- DMV_Index[playerid] = 0;
- DMV_ChosenTest[playerid] = 0;
- DMV_TestVehicle[playerid] = 0;
- DMV_TimeTaken[playerid] = 0;
- DMV_CanEndTest[playerid] = 0;
- ReleasingImpoundedVehicle[playerid] = 0;
- WantsNameChange[playerid][0] = 0;
- WantsNameChange[playerid][1] = 0;
- NameChange[playerid][0] = 0;
- NameChangeReason[playerid][0] = 0;
- StingerObjectID[playerid] = INVALID_OBJECT_ID;
- StingerAreaID[playerid] = -1;
- ClothesShop[playerid] = 0;
- WeaponLicense[playerid] = 0;
- SpeedCameraCooldown[playerid] = 0;
- BurningMoney[playerid] = 0;
- CheckNumber[playerid] = 0;
- PlayerChecks[playerid][0] = 0;
- PlayerChecks[playerid][1] = 0;
- PlayerChecks[playerid][2] = 0;
- NewsToggle{playerid} = true;
- AdminMsgToggle{playerid} = true;
- LillyCage{playerid} = false;
- RequestedToFrisk[playerid] = -1;
- RequestedToBlindfold[playerid] = -1;
- MedKitAction[playerid] = 0;
- MedKitActionPlayer[playerid] = -1;
- NewContactName[playerid][0] = 0;
- EditContactID[playerid] = 0;
- UsingCCTV{playerid} = false;
- FuelJobData[playerid][0] = 0;
- FuelJobData[playerid][1] = 0;
- OfferedMoveinFrom[playerid][0] = -1;
- OfferedMoveinFrom[playerid][1] = -1;
- WeaponsToBeSynced{playerid} = false;
- AJailingPlayer[playerid] = -1;
- AJailingTime[playerid] = 0;
- UsingFuelCan[playerid][0] = 0;
- UsingFuelCan[playerid][1] = 0;
- ViewAdminRecord[playerid] = 0;
- InOwnedVehicle[playerid] = 0;
- ET_GetOutTime[playerid] = 0;
- MemberListIndex[playerid] = 0;
- MemberNameForAction[playerid][0] = 0;
- AdvertsToggle{playerid} = true;
- ContactsSMSNumber[playerid] = 0;
- LastSMSNumber[playerid] = 0;
- Hotwiring[playerid][0] = 0;
- Hotwiring[playerid][1] = 0;
- StretcherEquipped[playerid] = 0;
- StretcherTimer[playerid] = -1;
- StretcherHolding[playerid] = 0;
- StretcherPlayerID[playerid] = -1;
- OilTextToggle[playerid] = 0;
- DeliveringStock[playerid] = 0;
- ChangeOilPos[playerid][0] = 0.0;
- ChangeOilPos[playerid][1] = 0.0;
- ChangeOilPos[playerid][2] = 0.0;
- ChangeOilVehID[playerid] = 0;
- EngineStartDelay[playerid] = 0;
- SidejobDamage[playerid] = 0;
- IsInFactionCar[playerid] = 0;
- MyTaxiCar[playerid] = 0;
- smask[playerid] = 0;
- scba[playerid] = 0;
- CanPlayerChoke{playerid} = true;
- PlayerChoking{playerid} = false;
- HasTaser{playerid} = false;
- HasRubberBullets{playerid} = false;
- HasActiveTruckingCall{playerid} = false;
- HasActiveMechanicCall{playerid} = false;
- strdel(MechanicCall[playerid], 0, 128);
- BMXBanned[playerid] = 0;
- TagBanned{playerid} = false;
- BeingTeleported{playerid} = false;
- strdel(TruckingCallMsg[playerid], 0, 128);
- PlayerTased[playerid] = 0;
- PlayerRubber[playerid] = 0;
- HasLaser{playerid} = false;
- PfSpec[playerid][CamPos][0] = 0;
- PfSpec[playerid][CamPos][1] = 0;
- PfSpec[playerid][CamPos][2] = 0;
- PfSpec[playerid][mdir] = 0;
- PfSpec[playerid][updownold] = 0;
- PfSpec[playerid][leftrightold] = 0;
- PfSpec[playerid][FlySpec] = 0;
- BuyProperty[playerid][0] = 0;
- BuyProperty[playerid][1] = 0;
- UsingATM{playerid} = false;
- LoginScreenID[playerid][0] = 0;
- LoginScreenID[playerid][1] = 0;
- LocalOOCEnabled{playerid} = true;
- PrisonTime[playerid] = 0;
- PlayerImprisoned{playerid} = false;
- IsolationTime[playerid] = 0;
- Isolated[playerid] = 0;
- PingKickExemption{playerid} = false;
- IsFrozen[playerid] = 0;
- ConnectedTime[playerid] = 0;
- FadePlayerConnect(playerid);
- TextDrawShowForPlayer(playerid, Website);
- TextDrawHideForPlayer(playerid, CCTV);
- TextDrawHideForPlayer(playerid, VehicleEngineText);
- if(PlayerPlaceFurniture[playerid] != INVALID_OBJECT_ID) OnPlayerEditDynamicObject(playerid, PlayerPlaceFurniture[playerid], 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- if(PlayerPlaceOutdoorFurniture[playerid] != INVALID_OBJECT_ID) OnPlayerEditDynamicObject(playerid, PlayerPlaceOutdoorFurniture[playerid], 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- if(PlayerBuyFurniture[playerid][0] != INVALID_OBJECT_ID) DestroyDynamicObjectEx(PlayerBuyFurniture[playerid][0], "PlayerBuyFurniture[playerid][0] 4");
- if(PlayerBuyOutdoorFurniture[playerid][0] != INVALID_OBJECT_ID) DestroyDynamicObjectEx(PlayerBuyOutdoorFurniture[playerid][0], "PlayerBuyOutdoorFurniture[playerid][0] 4");
- PlayerBuyFurniture[playerid][0] = INVALID_OBJECT_ID;
- PlayerBuyOutdoorFurniture[playerid][0] = INVALID_OBJECT_ID;
- PlayerPlaceFurniture[playerid] = INVALID_OBJECT_ID;
- PlayerEditFurniture[playerid] = INVALID_OBJECT_ID;
- PlayerEditOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- PlayerPlaceOutdoorFurniture[playerid] = INVALID_OBJECT_ID;
- PlayerBuyFurniture[playerid][1] = -1;
- PlayerBuyOutdoorFurniture[playerid][1] = -1;
- if(ScrapTimer[playerid] != 0) KillTimer(ScrapTimer[playerid]);
- ScrapTimer[playerid] = 0;
- PlayerTextDrawHide(playerid, BlindfoldEffect[playerid]);
- if(Blindfolded[playerid] == 1)
- {
- GangZoneHideForPlayer(playerid, BlindZone);
- Blindfolded[playerid] = 0;
- }
- Inventory[playerid][Phonebook] = 0;
- Inventory[playerid][Dice] = 0;
- Inventory[playerid][FishingRod] = 0;
- Inventory[playerid][FishingPermit] = 0;
- Inventory[playerid][FishingBait] = 0;
- Inventory[playerid][Radio] = 0;
- Inventory[playerid][FuelCan][0] = -1;
- Inventory[playerid][FuelCan][1] = 0;
- Inventory[playerid][Mask] = 0;
- Inventory[playerid][Watch] = 0;
- Inventory[playerid][Lighter] = 0;
- Inventory[playerid][Fags] = 0;
- Inventory[playerid][GPS] = 0;
- Inventory[playerid][Weed] = 0;
- Inventory[playerid][MoonShine] = 0;
- Inventory[playerid][Cocaine] = 0;
- Inventory[playerid][AmmoBox][AMMOBOX_PISTOL] = 0;
- Inventory[playerid][AmmoBox][AMMOBOX_SHOTGUN] = 0;
- Inventory[playerid][AmmoBox][AMMOBOX_SMG] = 0;
- Inventory[playerid][AmmoBox][AMMOBOX_RIFLE] = 0;
- Inventory[playerid][AmmoBox][AMMOBOX_ASSAULT] = 0;
- Inventory[playerid][Rope] = 0;
- Inventory[playerid][MobilePhone] = 0;
- Inventory[playerid][Notepad] = 0;
- Inventory[playerid][Pen] = 0;
- Inventory[playerid][Paper] = 0;
- Inventory[playerid][CarAdapter] = 0;
- Inventory[playerid][Checks] = 0;
- Inventory[playerid][RollingPaper] = 0;
- Inventory[playerid][Bong] = 0;
- Inventory[playerid][Calculator] = 0;
- Inventory[playerid][MedKit] = 0;
- Inventory[playerid][Toolbox] = 0;
- Inventory[playerid][EngineOil] = 0;
- Inventory[playerid][Boombox] = 0;
- Inventory[playerid][Blindfold] = 0;
- Inventory[playerid][Logs] = 0;
- Boomboxes[playerid][BoomPos][0] = 0.0;
- Boomboxes[playerid][BoomPos][1] = 0.0;
- Boomboxes[playerid][BoomPos][2] = 0.0;
- Boomboxes[playerid][BoomPos][3] = 0.0;
- Boomboxes[playerid][BoomObj] = INVALID_OBJECT_ID;
- Boomboxes[playerid][BoomRange] = 0;
- Boomboxes[playerid][BoomStation][0] = 0;
- Boomboxes[playerid][BoomOID] = -1;
- Boomboxes[playerid][BoomType] = -1;
- Boomboxes[playerid][BoomIsPlaying] = false;
- ListeningBoom[playerid] = -1;
- IsInHouseID[playerid] = -1;
- IsInBizzID[playerid] = -1;
- IsInGarageID[playerid] = -1;
- HasHouseKey[playerid][0] = -1;
- HasHouseKey[playerid][1] = -1;
- foreach(new i: Player)
- {
- if(PMReplyID[i] == playerid) PMReplyID[i] = -1;
- if(UsingPaint{i})
- {
- if(PaintLabels[i][playerid] != Text3D:INVALID_3DTEXT_ID)
- {
- DestroyDynamic3DTextLabel(PaintLabels[i][playerid]);
- PaintLabels[i][playerid] = Text3D:INVALID_3DTEXT_ID;
- }
- }
- }
- ArmourVar[playerid] = 0;
- return true;
- }
- stock ReturnBodyPartName(bodypart)
- {
- new BodyPartName[18];
- switch(bodypart)
- {
- case 3: BodyPartName = "Chest";
- case 4: BodyPartName = "Crotch";
- case 5: BodyPartName = "Left Arm";
- case 6: BodyPartName = "Right Arm";
- case 7: BodyPartName = "Left Leg";
- case 8: BodyPartName = "Right Leg";
- case 9: BodyPartName = "Head";
- }
- return BodyPartName;
- }
- stock HexToInt(string[])
- {
- if(string[0]==0) return 0;
- new i, cur=1, res=0;
- for(i=strlen(string);i>0;i--)
- {
- if(string[i-1]<58) res=res+cur*(string[i-1]-48); else res=res+cur*(string[i-1]-65+10);
- cur=cur*16;
- }
- return res;
- }
- stock SendPlayerToHospital(playerid)
- {
- if(PlayerImprisoned{playerid})
- {
- new r = random(16);
- SetSpawnInfo(playerid, 4, cPlayersSkin[playerid], PrisonCellsIn[r][0], PrisonCellsIn[r][1], PrisonCellsIn[r][2], 0.0, 0, 0, 0, 0, 0, 0);
- NearestHospital[playerid] = 4;
- }
- else
- {
- new Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- if(Pos[1] > 619) //Fort Carson
- {
- NearestHospital[playerid] = 2;
- }
- else if(IsPlayerInArea(playerid, -151.8124, -5862.293, -735.7062, -6212.63)) //Angel Pine
- {
- NearestHospital[playerid] = 3;
- }
- else //Montgomery
- {
- NearestHospital[playerid] = 1;
- }
- }
- if(IsInHouseID[playerid] != -1) IsInHouseID[playerid] = -1;
- if(IsInBizzID[playerid] != -1) IsInBizzID[playerid] = -1;
- if(IsInGarageID[playerid] != -1) IsInGarageID[playerid] = -1;
- Dead{playerid} = false;
- if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);
- ResetPlayerWeapons(playerid);
- if(HasJustDied[playerid] == 2)
- {
- for(new ao = 0; ao < 6; ao++)
- {
- if(AttachedObjects[playerid][ao][aoModelID] > 0)
- {
- SetPlayerAttachedObject(playerid, ao, AttachedObjects[playerid][ao][aoModelID], AttachedObjects[playerid][ao][aoBone], AttachedObjects[playerid][ao][aoOffset][0], AttachedObjects[playerid][ao][aoOffset][1],
- AttachedObjects[playerid][ao][aoOffset][2], AttachedObjects[playerid][ao][aoRot][0], AttachedObjects[playerid][ao][aoRot][1], AttachedObjects[playerid][ao][aoRot][2], AttachedObjects[playerid][ao][aoScale][0],
- AttachedObjects[playerid][ao][aoScale][1], AttachedObjects[playerid][ao][aoScale][2], AttachedObjects[playerid][ao][aoColor], AttachedObjects[playerid][ao][aoColor]);
- }
- }
- new HospitalBill;
- HasJustDied[playerid] = 0;
- SetPlayerHealthEx(playerid, 15.0);
- if(PlayerImprisoned{playerid})
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "\n");
- SendClientMessage(playerid, COLOR_LIGHTRED, "The Green Palms Correctional Facility medical staff has taken care of you and you have returned to a cell.");
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "\n");
- SendClientMessage(playerid, COLOR_LIGHTRED, "San Andreas Medical Service");
- SendClientMessageF(playerid, COLOR_LIGHTRED, "Patient: {FFFFFF}%s",NameEx(playerid));
- SendClientMessageF(playerid, COLOR_LIGHTRED, "Time of Arrival: {FFFFFF}%s",GetTimeString());
- SendClientMessageF(playerid, COLOR_LIGHTRED, "Attended by: {FFFFFF}%s",DoctorNames[random(sizeof(DoctorNames))]);
- if(Faction[playerid] == FACTION_SACFD)
- {
- HospitalBill = floatround(((25 * PlayerLevel[playerid]) + random(200)) / 2);
- if(HospitalBill < 100) HospitalBill = 100;
- SendClientMessageF(playerid,COLOR_LIGHTRED, "Hospital Bill: {FFFFFF}$%s (Employee)",format_cash(HospitalBill));
- }
- else
- {
- HospitalBill = (25 * PlayerLevel[playerid]) + random(200);
- if(HospitalBill < 100) HospitalBill = 100;
- SendClientMessageF(playerid,COLOR_LIGHTRED, "Hospital Bill: {FFFFFF}$%s",format_cash(HospitalBill));
- }
- HasJustDied[playerid] = 0;
- SpawnPlayer(playerid);
- new weapon_count = 0, w;
- for(w = 1; w < MAX_TOTAL_WEAPONS; w++)
- {
- if(IsActualGun(WeaponData[playerid][w][Weapon])) weapon_count ++;
- }
- if(weapon_count > 0)
- {
- if(IsCop(playerid) || Faction[playerid] == FACTION_RESEARCH || ADuty[playerid] == 1)
- {
- for(new we = 0; we < MAX_TOTAL_WEAPONS; we++)
- {
- if(WeaponData[playerid][we][Weapon] > 1)
- {
- GivePlayerWeaponEx(playerid, WeaponData[playerid][we][Weapon], WeaponData[playerid][we][WeaponAmmo], 5);
- break;
- }
- }
- SendClientMessage(playerid, COLOR_WHITE, "Hospital staff have allowed you to keep your {AF1E2D}weapons{FFFFFF} because of your profession.");
- }
- else
- {
- if(WeaponLicense[playerid] > 0)
- {
- for(w = 1; w < MAX_TOTAL_WEAPONS; w++)
- {
- if((WeaponData[playerid][w][Weapon] != 22 && WeaponData[playerid][w][Weapon] != 24 && WeaponData[playerid][w][Weapon] != 33 && WeaponData[playerid][w][Weapon] != 29 && WeaponData[playerid][w][Weapon] != 25) && IsActualGun(WeaponData[playerid][w][Weapon]))
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET WeaponPossession = 0, Deleted = 1 WHERE id = %i AND TrunkID = -1 AND FCarID = -1 AND Gunrack = -1 AND Dropped = 0 AND HouseID = -1", WeaponData[playerid][w][WeaponID]);
- mysql_pquery(conn, mquery);
- ResetWeaponVariables(playerid, 0, w);
- }
- }
- for(new we = 0; we < MAX_TOTAL_WEAPONS; we++)
- {
- if(WeaponData[playerid][we][Weapon] > 1)
- {
- GivePlayerWeaponEx(playerid, WeaponData[playerid][we][Weapon], WeaponData[playerid][we][WeaponAmmo], 5);
- break;
- }
- }
- SendClientMessage(playerid, COLOR_WHITE, "Hospital staff have allowed you to keep your {AF1E2D}legal weapons{FFFFFF} (if any) since you have a weapon license.");
- }
- else
- {
- for(w = 1; w < MAX_TOTAL_WEAPONS; w++)
- {
- if(IsActualGun(WeaponData[playerid][w][Weapon]))
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET WeaponPossession = 0, Deleted = 1 WHERE id = %i AND TrunkID = -1 AND FCarID = -1 AND Gunrack = -1 AND Dropped = 0 AND HouseID = -1", WeaponData[playerid][w][WeaponID]);
- mysql_pquery(conn, mquery);
- ResetWeaponVariables(playerid, 0, w);
- }
- }
- for(new we = 0; we < MAX_TOTAL_WEAPONS; we++)
- {
- if(WeaponData[playerid][we][Weapon] > 1)
- {
- GivePlayerWeaponEx(playerid, WeaponData[playerid][we][Weapon], WeaponData[playerid][we][WeaponAmmo], 5);
- break;
- }
- }
- SendClientMessage(playerid, COLOR_WHITE, "Hospital staff have confiscated your {AF1E2D}weapons.");
- }
- }
- }
- new findDrugs = random(100);
- if(findDrugs > 50)
- {
- if(Inventory[playerid][Weed] > 0)
- {
- Inventory[playerid][Weed] = 0;
- MySQLUpdateInt(SQLID[playerid], "Weed", Inventory[playerid][Weed], "players");
- SendClientMessage(playerid, COLOR_WHITE, "Hospital staff have confiscated your {AF1E2D}Weed.");
- }
- if(Inventory[playerid][Cocaine] > 0)
- {
- Inventory[playerid][Cocaine] = 0;
- MySQLUpdateInt(SQLID[playerid], "Cocaine", Inventory[playerid][Cocaine], "players");
- SendClientMessage(playerid, COLOR_WHITE, "Hospital staff have confiscated your {AF1E2D}Cocaine.");
- }
- if(Inventory[playerid][MoonShine] > 0)
- {
- Inventory[playerid][MoonShine] = 0;
- MySQLUpdateInt(SQLID[playerid], "MoonShine", Inventory[playerid][MoonShine], "players");
- SendClientMessage(playerid, COLOR_WHITE, "Hospital staff have confiscated your {AF1E2D}MoonShine.");
- }
- }
- SendClientMessage(playerid, COLOR_LIGHTRED, "\n");
- GivePlayerCash(playerid, -HospitalBill);
- FACTIONS[FACTION_SACFD][FactionBankBalance] += floatround(0.75 * HospitalBill);
- MySQLUpdateInt(FACTION_SACFD, "BankBalance", FACTIONS[FACTION_SACFD][FactionBankBalance], "factions");
- }
- if(!PlayerImprisoned{playerid})
- {
- IsInHospital{playerid} = true;
- HospitalTimer[playerid] = 60;
- }
- else
- {
- SetPlayerInterior(playerid, 6);
- SetPlayerVirtualWorldEx(playerid, 6164);
- SetPlayerHealthEx(playerid, 100.0);
- return true;
- }
- SetupHospitalCamera(playerid);
- if(ADuty[playerid] == 1) cmd_skiphosp(playerid, "");
- }
- return true;
- }
- stock GetRPName(playerid) {
- new n[25];
- GetPlayerName(playerid, n, 25);
- for(new i, k = strlen(n); i != k; i++) { if(n[i] == '_') { n[i] = ' '; break; } }
- return n;
- }
- stock OnPlayerSelectCharacter(playerid, sqlid, name[])
- {
- SetPlayerName(playerid, name);
- SQLID[playerid] = sqlid;
- SetPlayerColor(playerid, 0xFFFFFF00);
- for(new ban = 0; ban < MAX_TEMPBANS; ban++)
- {
- if(TempBans[ban][TempBanActive] == 1)
- {
- if(!strcmp(TempBans[ban][TempBanIP], PlayerIP[playerid], true))
- {
- SendClientMessage(playerid, COLOR_WHITE, "\n");
- SendClientMessageF(playerid,COLOR_WHITE, "{AF1E2D}TEMPORARILY BANNED: {FFFFFF}Your IP address {009900}%s{FFFFFF} has been temporarily banned from this server.", PlayerIP[playerid]);
- SendClientMessageF(playerid,COLOR_WHITE, "You will be automatically unbanned in {009900}%i minutes.", TempBans[ban][TempBanTime]);
- SendClientMessageF(playerid,COLOR_WHITE, "Reason for temporary ban: {009900}%s", TempBans[ban][TempBanReason]);
- SendClientMessageF(playerid, COLOR_WHITE, "Banned by: {009900}%s", GetSQLName(TempBans[ban][BanningAdmin]));
- KickPlayer(playerid, 23);
- return true;
- }
- if(TempBans[ban][TempBanSQLID] == SQLID[playerid])
- {
- SendClientMessage(playerid, COLOR_WHITE, "\n");
- SendClientMessageF(playerid,COLOR_WHITE, "{AF1E2D}TEMPORARILY BANNED: {FFFFFF}Your account {009900}%s{FFFFFF} has been temporarily banned from this server.", GetName(playerid));
- SendClientMessageF(playerid, COLOR_WHITE, "You will be automatically unbanned in {009900}%i minutes.", TempBans[ban][TempBanTime]);
- SendClientMessageF(playerid,COLOR_WHITE, "Reason for temporary ban: {009900}%s", TempBans[ban][TempBanReason]);
- SendClientMessageF(playerid, COLOR_WHITE, "Banned by: {009900}%s", GetSQLName(TempBans[ban][BanningAdmin]));
- KickPlayer(playerid, 24);
- return true;
- }
- }
- }
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Unbanned,UnbanDate,BanReason FROM tbans WHERE PlayerSQLID = %i OR MasterAccount = %i OR BannedIP = '%e'", SQLID[playerid], MasterAccount[playerid], PlayerIP[playerid]);
- mysql_pquery(conn, mquery, "CheckTempBans", "d", playerid);
- return true;
- }
- stock ClearPlayerData(playerid, reason)//disconectar save
- {
- new disconnectreason[32];
- switch(reason)
- {
- case 0: disconnectreason = "lost connection";
- case 1: disconnectreason = "disconnected";
- case 2: disconnectreason = "been kicked";
- case 3: disconnectreason = "used /logout";
- }
- for(new x = 0; x < MAX_REPORTS; x++)
- {
- if(strmatch(Reports[x][ReportedName], NameEx(playerid)))
- {
- Reports[x][ReporterName][0] = EOS;
- Reports[x][ReportedName][0] = EOS;
- Reports[x][ReportReason][0] = EOS;
- Reports[x][ReportTime] = 0;
- }
- }
- SortDeepArray(Reports, ReportTime, .order = SORT_DESC);
- if(RentalCar[playerid] != 0)
- {
- if(GetPlayerVehicleID(playerid) == RentalCar[playerid])
- {
- RemovePlayerFromVehicle(RentalCar[playerid]);
- }
- ToggleVehicleLock(RentalCar[playerid], false);
- Locked{RentalCar[playerid]} = false;
- SetVehicleToRespawnEx(RentalCar[playerid]);
- }
- // Destroy Roadblocks on Logoff
- for(new rbo = 0; rbo < MAX_PLAYERROADBLOCKS; rbo++)
- {
- if(RoadBlockObjects[playerid][rbo] != INVALID_OBJECT_ID)
- {
- DestroyRoadblock(playerid, rbo);
- }
- }
- // Destroy Stretchers on logoff
- if(StretcherEquipped[playerid] != 0)
- {
- DestroyDynamicObjectEx(StretcherEquipped[playerid], "StretcherEquipped[playerid]");
- StretcherEquipped[playerid] = 0;
- StretcherPlayerID[playerid] = -1;
- StretcherHolding[playerid] = 0;
- }
- new Float:xPP, Float:yP, Float:zP;
- GetPlayerPos(playerid, xPP, yP, zP);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET RelogSpawnX = %f, RelogSpawnY = %f, RelogSpawnZ = %f, RelogSpawnINT = %i, RelogSpawnVW = %i, SpawnSaved = 1 WHERE id = %i", xPP, yP, zP, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid), SQLID[playerid]);
- mysql_pquery(conn, mquery);
- for(new l = 1, p = GetVehiclePoolSize(); l <= p; l++)
- {
- if(VehicleData[l][VehicleOwnerSQLID] == SQLID[playerid] && VehicleData[l][Hotwired] == 0)
- {
- new Float:xP[4];
- GetVehiclePos(l, xP[0], xP[1], xP[2]);
- if(IsPlayerInRangeOfPoint(playerid, 20.0, xP[0], xP[1], xP[2]))
- {
- GetVehicleZAngle(VehicleData[l][IdVehicle], xP[3]);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET LogPosX = %f, LogPosY = %f, LogPosZ = %f, LogPosA = %f, VehicleSaved = 1 WHERE id = %i", xP[0], xP[1], xP[2], xP[3], VehicleData[l][VehSQLID]);
- mysql_pquery(conn, mquery);
- }
- }
- }
- if(DeliveringFuelLabel[playerid] != Text3D:INVALID_3DTEXT_ID)
- {
- DestroyDynamic3DTextLabel(DeliveringFuelLabel[playerid]);
- }
- DeliveringFuelLabel[playerid] = Text3D:INVALID_3DTEXT_ID;
- if(CampfirePlaced[playerid] != INVALID_OBJECT_ID) DestroyDynamicObjectEx(CampfirePlaced[playerid], "CampfirePlaced[playerid] 1");
- if(IsTrucking[playerid] == 1)
- {
- EmptyTruckingTrailer(TruckingTrailer[playerid]);
- DestroyVehicleEx(TruckingTrailer[playerid], "TruckingTrailer[playerid] 4");
- }
- if(Logged{playerid}) SavePlayerVehicles(playerid, 1);
- if(IsAFK{playerid})
- {
- DeleteAFKLabel(playerid);
- }
- if(Dead{playerid})
- {
- new weapon_count = 0, w;
- for(w = 1; w < MAX_TOTAL_WEAPONS; w++)
- {
- if(IsActualGun(WeaponData[playerid][w][Weapon])) weapon_count ++;
- }
- if(weapon_count > 0)
- {
- if(IsCop(playerid) || Faction[playerid] == FACTION_RESEARCH || ADuty[playerid] == 1)
- {
- for(new we = 0; we < MAX_TOTAL_WEAPONS; we++)
- {
- if(WeaponData[playerid][we][Weapon] > 1)
- {
- GivePlayerWeaponEx(playerid, WeaponData[playerid][we][Weapon], WeaponData[playerid][we][WeaponAmmo], 5);
- break;
- }
- }
- }
- else
- {
- if(WeaponLicense[playerid] > 0)
- {
- for(w = 1; w < MAX_TOTAL_WEAPONS; w++)
- {
- if((WeaponData[playerid][w][Weapon] != 22 && WeaponData[playerid][w][Weapon] != 24 && WeaponData[playerid][w][Weapon] != 33 && WeaponData[playerid][w][Weapon] != 29 && WeaponData[playerid][w][Weapon] != 25) && IsActualGun(WeaponData[playerid][w][Weapon]))
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET WeaponPossession = 0, Deleted = 1 WHERE id = %i AND TrunkID = -1 AND FCarID = -1 AND Gunrack = -1 AND Dropped = 0 AND HouseID = -1", WeaponData[playerid][w][WeaponID]);
- mysql_pquery(conn, mquery);
- ResetWeaponVariables(playerid, 0, w);
- }
- }
- for(new we = 0; we < MAX_TOTAL_WEAPONS; we++)
- {
- if(WeaponData[playerid][we][Weapon] > 1)
- {
- GivePlayerWeaponEx(playerid, WeaponData[playerid][we][Weapon], WeaponData[playerid][we][WeaponAmmo], 5);
- break;
- }
- }
- }
- else
- {
- for(w = 1; w < MAX_TOTAL_WEAPONS; w++)
- {
- if(IsActualGun(WeaponData[playerid][w][Weapon]))
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET WeaponPossession = 0, Deleted = 1 WHERE id = %i AND TrunkID = -1 AND FCarID = -1 AND Gunrack = -1 AND Dropped = 0 AND HouseID = -1", WeaponData[playerid][w][WeaponID]);
- mysql_pquery(conn, mquery);
- ResetWeaponVariables(playerid, 0, w);
- }
- }
- for(new we = 0; we < MAX_TOTAL_WEAPONS; we++)
- {
- if(WeaponData[playerid][we][Weapon] > 1)
- {
- GivePlayerWeaponEx(playerid, WeaponData[playerid][we][Weapon], WeaponData[playerid][we][WeaponAmmo], 5);
- break;
- }
- }
- }
- }
- }
- }
-
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET Battery = %i WHERE id = %i", floatround(PhoneData[playerid][pBattery]), PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- foreach(new i: Player)
- {
- if(IsSpectating[i] == playerid)
- {
- SendClientMessageF(i, COLOR_FADE3, "The player you were spectating has %s: %s(%i)", disconnectreason, NameEx(playerid),playerid);
- cmd_spectateoff(i);
- }
- if(IsDragging[i] == playerid)
- {
- IsDragging[i] = -1;
- }
- if(SellingAsset[i][1] == playerid)
- {
- SellingAsset[i][0] = 0; //yes/no
- SellingAsset[i][1] = -1; //playerid
- SellingAsset[i][2] = 0; //type
- SellingAsset[i][3] = -1; //id
- SellingAsset[i][4] = 0; //price
- SellingAsset[i][5] = -1;
- }
- if(SellingAsset[playerid][1] == i)
- {
- if(SellingAsset[playerid][2] == 1) SysMsgF(i,"The player that you were buying a house from has %s.", disconnectreason);
- else if(SellingAsset[playerid][2] == 2) SysMsgF(i,"The player that you were buying a business from has %s.", disconnectreason);
- else if(SellingAsset[playerid][2] == 3) SysMsgF(i,"The player that you were buying a vehicle from has %s.", disconnectreason);
- SellingAsset[playerid][0] = 0; //yes/no
- SellingAsset[playerid][1] = -1; //playerid
- SellingAsset[playerid][2] = 0; //type
- SellingAsset[playerid][3] = -1; //id
- SellingAsset[playerid][4] = 0; //price
- SellingAsset[playerid][5] = -1;
- }
- if(VehicleShareOffer[playerid][0] == playerid)
- {
- SysMsgF(playerid,"The player that you were offering a shared key has %s.", disconnectreason);
- VehicleShareOffer[i][0] = -1;
- VehicleShareOffer[i][1] = 0;
- VehicleShareOffer[i][2] = 0;
- }
- if(VehicleShareOffer[i][0] == i)
- {
- SysMsgF(i,"The player that was offering you a shared key has %s.", disconnectreason);
- VehicleShareOffer[playerid][0] = -1;
- VehicleShareOffer[playerid][1] = 0;
- VehicleShareOffer[playerid][2] = 0;
- }
- if(TaxiFareID[i] == playerid)
- {
- TaxiFareID[i] = -1;
- TaxiMeter[i] = 0;
- TaxiFare[playerid] = 0;
- }
- if(TaxiFareID[playerid] == i)
- {
- TaxiFareID[playerid] = -1;
- TaxiMeter[playerid] = 0;
- TaxiFare[i] = 0;
- }
- if(TaxiForceFare[i] == playerid)
- {
- TaxiForceFare[i] = -1;
- SysMsgF(i, "(( The customer has %s ending your possible fare. ))", disconnectreason);
- }
- if(TaxiForceFare[playerid] == i) SysMsgF(i, "(( The Taxi driver has %s ending your possible fare. ))", disconnectreason);
- if(AwaitingSpray[playerid] == 1)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- AwaitingSpray[playerid] = 0;
- GoingToSprayVehicleID[MechanicSpray[MechanicSpray[vehicleid][5]][0]] = 0;
- SendClientMessageF(MechanicSpray[vehicleid][0], COLOR_WHITE, "(( The customer (%s) has %s. The spray was cancelled. ))", NameEx(playerid), disconnectreason);
- MechanicSpray[vehicleid][0] = -1;
- MechanicSpray[vehicleid][1] = -1;
- MechanicSpray[vehicleid][2] = -1;
- MechanicSpray[vehicleid][3] = -1;
- MechanicSpray[vehicleid][4] = -1;
- MechanicSpray[vehicleid][5] = -1;
- }
- if(GoingToSprayVehicleID[playerid] > 0)
- {
- AwaitingSpray[MechanicSpray[GoingToSprayVehicleID[playerid]][1]] = 0;
- SendClientMessageF(MechanicSpray[GoingToSprayVehicleID[playerid]][0], COLOR_WHITE, "(( The Mechanic that was going to spray your car (%s) has %s. The spray was cancelled. ))", NameEx(playerid), disconnectreason);
- MechanicSpray[GoingToSprayVehicleID[playerid]][0] = -1;
- MechanicSpray[GoingToSprayVehicleID[playerid]][1] = -1;
- MechanicSpray[GoingToSprayVehicleID[playerid]][2] = -1;
- MechanicSpray[GoingToSprayVehicleID[playerid]][3] = -1;
- MechanicSpray[GoingToSprayVehicleID[playerid]][4] = -1;
- MechanicSpray[GoingToSprayVehicleID[playerid]][5] = -1;
- GoingToSprayVehicleID[playerid] = 0;
- }
- if(OfferedMoveinFrom[i][0] == playerid)
- {
- SysMsgF(i, "(( The player that was offering you to move into their house has %s. ))", disconnectreason);
- OfferedMoveinFrom[i][0] = -1;
- OfferedMoveinFrom[i][1] = -1;
- }
- if(OfferedMoveinFrom[playerid][0] == i)
- {
- SysMsgF(i, "(( The player you were offering to move into your house has %s. ))", disconnectreason);
- OfferedMoveinFrom[playerid][0] = -1;
- OfferedMoveinFrom[playerid][1] = -1;
- }
- }
-
- if(RequestingAdmin[playerid] != -1) RequestingAdmin[playerid] = -1;
- if(InterviewPlayer == playerid)
- {
- InterviewPlayer = -1;
- SysMsgF(Interviewer, "(( The person you were interviewing has %s, ending the interview. ))", disconnectreason);
- Interviewer = -1;
- }
- if(Interviewer == playerid)
- {
- Interviewer = -1;
- SysMsgF(InterviewPlayer, "(( The person that was interviewing you has %s, ending the interview. ))", disconnectreason);
- InterviewPlayer = -1;
- }
- if(TalkshowPlayer == playerid)
- {
- TalkshowPlayer = -1;
- SysMsgF(TalkshowHost, "(( The person you were on the line with has %s.))", disconnectreason);
- }
- if(TalkshowHost == playerid)
- {
- TalkshowHost = -1;
- TalkshowPlayer = -1;
- for(new x = 0; x < sizeof(TalkshowCallers); x++) TalkshowCallers[x] = -1;
- }
- new x = 0;
- if(Logged{playerid})
- {
- MySQLUpdateInt(SQLID[playerid], "Online", 0, "players");
- if(HasJustDied[playerid] == 1) HasJustDied[playerid] = 0;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET Cash = %i, LastLogout = %i WHERE id = %i", Cash[playerid], gettime(), SQLID[playerid]);
- mysql_pquery(conn, mquery);
- switch(reason)
- {
- case 0: format(sgstr, sizeof(sgstr), "%s has left the server. (Lost Connection)", NameEx(playerid));
- case 1: format(sgstr, sizeof(sgstr), "%s has left the server.", NameEx(playerid));
- case 2: format(sgstr, sizeof(sgstr), "%s has left the server. (Kicked)", NameEx(playerid));
- case 3: format(sgstr, sizeof(sgstr), "%s has used /logout.", NameEx(playerid));
- }
- new Float:Pos[3];
- if(IsSpectating[playerid] == -1)
- {
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- ProxDetector(20.0, playerid, sgstr, COLOR_FADE3, COLOR_FADE3, COLOR_FADE3, COLOR_FADE3, COLOR_FADE3);
- }
- foreach(new i: Player) if(IsPlayerAdminLevelOK(i, 1) && AdminMsgToggle{i} && !IsPlayerInRangeOfPoint(i, 20.0, Pos[0], Pos[1], Pos[2])) SendClientMessage(i, COLOR_FADE3, sgstr);
- if(CheckReady{playerid})
- {
- CheckReady{playerid} = false;
- CheckNumber[playerid] = 0;
- PlayerTextDrawSetString(playerid, Signcheck[playerid], "~g~~h~~h~Payday: ~w~0000");
- PlayerTextDrawHide(playerid, Signcheck[playerid]);
- }
- }
- if(CallerID[playerid] != -1)
- {
- new playa = CallerID[playerid];
- if(GetPlayerSpecialAction(playa) == SPECIAL_ACTION_USECELLPHONE)
- {
- SetPlayerSpecialAction(playa, SPECIAL_ACTION_STOPUSECELLPHONE);
- RemovePlayerAttachedObject(playerid, 6);
- }
- if(UsingPayPhone[playa] > 0)
- {
- PayPhoneInUse[UsingPayPhone[playa]-1] = 0;
- UsingPayPhone[playa] = 0;
- TogglePlayerControllable(playa, 1);
- SetCameraBehindPlayer(playa);
- SendClientMessage(playa,COLOR_GREY,"[Pay phone] {87CEFF}You hung up.");
- format(gstr, sizeof(gstr),"* %s puts the phone handset back. *",NameRP(playa));
- ProxDetector(15.0,playa,gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- SendClientMessage(playa,COLOR_GREY,"[Cellphone] {87CEFF}The line went dead...");
- CallerID[playa] = -1;
- CallerID[playerid] = -1;
- }
- if(UsingPayPhone[playerid] > 0)
- {
- PayPhoneInUse[UsingPayPhone[playerid]-1] = 0;
- UsingPayPhone[playerid] = 0;
- }
- if(DMV_TestVehicle[playerid] > 0)
- {
- new v = DMV_TestVehicle[playerid];
- AdminLocked{v} = false;
- foreach(new i: Player) Objective[v][i] = 0;
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(v, engine, lights, alarm, 0, bonnet, boot, 0);
- DestroyVehicleEx(v, "v 4");
- strdel(vMusicLink[v], 0, 256);
- vMusicPlaying{v} = false;
- DMV_TestVehicle[playerid] = 0;
- for(new i = 1, p = GetVehiclePoolSize(); i <= p; i++)
- {
- if(DMVCarForPlayer[i] == playerid)
- {
- DMVCarForPlayer[i] = -1;
- break;
- }
- }
- }
- if(Boomboxes[playerid][BoomObj] != INVALID_OBJECT_ID)
- {
- foreach(new p: Player)
- {
- if(IsPlayerInRangeOfPoint(p, Boomboxes[playerid][BoomRange], Boomboxes[playerid][BoomPos][0], Boomboxes[playerid][BoomPos][1], Boomboxes[playerid][BoomPos][2]))
- {
- StopAudioStreamForPlayer(p);
- ListeningBoom[p] = -1;
- }
- }
- Boomboxes[playerid][BoomOID] = 0;
- Boomboxes[playerid][BoomPos][0] = 0;
- Boomboxes[playerid][BoomPos][1] = 0;
- Boomboxes[playerid][BoomPos][2] = 0;
- Boomboxes[playerid][BoomPos][3] = 0;
- Boomboxes[playerid][BoomStation][0] = EOS;
- Boomboxes[playerid][BoomIsPlaying] = false;
- DestroyDynamicObjectEx(Boomboxes[playerid][BoomObj], "Boomboxes[playerid][BoomObj]");
- Boomboxes[playerid][BoomObj] = INVALID_OBJECT_ID;
- Boomboxes[playerid][BoomRange] = 0;
- DestroyDynamicArea(Boomboxes[playerid][BoomArea]);
- }
- if(IsPlayerRefilling[playerid] == 1)
- {
- KillTimer(FuelFillingTimer[playerid]);
- }
- if(WantsNameChange[playerid][0] == 1)
- {
- WantsNameChange[playerid][0] = 0;
- WantsNameChange[playerid][1] = 0;
- NameChange[playerid][0] = EOS;
- NameChangeReason[playerid][0] = EOS;
- }
- if(StingerObjectID[playerid] != INVALID_OBJECT_ID)
- {
- DestroyDynamicObjectEx(StingerObjectID[playerid], "StingerObjectID[playerid]");
- DestroyDynamicArea(StingerAreaID[playerid]);
- StingerAreaID[playerid] = -1;
- StingerObjectID[playerid] = INVALID_OBJECT_ID;
- }
- if(UsingCCTV{playerid})
- {
- UsingCCTV{playerid} = false;
- TextDrawHideForPlayer(playerid, CCTV);
- }
- if(StretcherEquipped[playerid])
- {
- DestroyDynamicObjectEx(StretcherEquipped[playerid], "StretcherEquipped[playerid]");
- StretcherEquipped[playerid] = 0;
- StretcherHolding[playerid] = 0;
- if(StretcherPlayerID[playerid] > -1)
- {
- TogglePlayerControllable(StretcherPlayerID[playerid], 1);
- ClearAnimations(StretcherPlayerID[playerid]);
- StretcherPlayerID[playerid] = -1;
- }
- }
- if(DeliveringStock[playerid] > 0)
- {
- if(DeliverStockList[playerid][0] > 0)
- {
- BizzData[DeliverStockList[playerid][0]][BizzETDelivering] = 0;
- DeliverStockList[playerid][0] = 0;
- }
- if(DeliverStockList[playerid][1] > 0)
- {
- BizzData[DeliverStockList[playerid][1]][BizzETDelivering] = 0;
- DeliverStockList[playerid][1] = 0;
- }
- if(DeliverStockList[playerid][2] > 0)
- {
- BizzData[DeliverStockList[playerid][2]][BizzETDelivering] = 0;
- DeliverStockList[playerid][2] = 0;
- }
- DeliveringStock[playerid] = 0;
- DeliveringAtStop[playerid] = 0;
- }
- for(x = 0; x < MAX_TEMPCLOTHES; x++)
- {
- if(Clothing_Objects[playerid][x] != INVALID_OBJECT_ID)
- {
- DestroyDynamicObjectEx(Clothing_Objects[playerid][x], "Clothing_Objects[playerid][x]");
- Clothing_Objects[playerid][x] = INVALID_OBJECT_ID;
- }
- }
- DisablePlayerCheckpoint(playerid);
- DisablePlayerRaceCheckpoint(playerid);
- Logged{playerid} = false;
- JustSpawned{playerid} = false;
- if(reason == 3) ResetPlayerVariables(playerid);
- return true;
- }
- stock ReeferID()
- {
- for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(GetVehicleModel(v) == 453) return v;
- }
- return true;
- }
- stock GetPlayerStateEx(playerid)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_NONE) format(sgstr, sizeof(sgstr), "Initializing the game client");
- else if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) format(sgstr, sizeof(sgstr), "On foot");
- else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) format(sgstr, sizeof(sgstr), "Driving a vehicle");
- else if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) format(sgstr, sizeof(sgstr), "Passenger in a vehicle");
- else if(GetPlayerState(playerid) == PLAYER_STATE_WASTED) format(sgstr, sizeof(sgstr), "Dead");
- else if(GetPlayerState(playerid) == PLAYER_STATE_SPAWNED) format(sgstr, sizeof(sgstr), "Spawned");
- else if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING) format(sgstr, sizeof(sgstr), "Spectating");
- else format(sgstr, sizeof(sgstr), "Unknown");
- return sgstr;
- }
- stock IsInBank(playerid)
- {
- if(Faction[playerid] == FACTION_PROP || IsPlayerAdmin(playerid)) return true;
- //SendClientMessage(playerid, COLOR_WHITE,"Bank: /bank /savings /withdraw /balance");
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 1104.2457,1051.6860,-19.9389)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 193.2175,-90.8767,1031.4844)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 186.2845,-91.0096,1031.4844)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 2315.873291, -14.205566,26.742187)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 1312.2740, 332.0277, 2521.0000)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 2315.5916, -7.2580, 26.7422)) return true;
- if(GetPlayerVirtualWorld(playerid) == 0) return false;
- return false;
- }
- stock HasGunshotWound(playerid)
- {
- for(new hit = 0; hit < HitCount[playerid]; hit++)
- {
- switch(Injuries[playerid][hit][pWeaponID])
- {
- case 23..34,38: return true;
- }
- }
- return false;
- }
- stock ShowInjuriesForPlayer(playerid, playa)
- {
- new injuriescount = 0, namestring[64];
- gstr[0] = EOS;
- strcat(gstr, "Injury Type\tLocation\tWeapon\n");
- for(new hit = 0; hit < HitCount[playa]; hit++)
- {
- if(Injuries[playa][hit][pBodypart] > 0)
- {
- switch(Injuries[playa][hit][pWeaponID])
- {
- case 0,1,2,3,5,6,7,10,11,12,13,14,15,41,42,43,44,45,46: // Blunt Weapons
- {
- format(sgstr, sizeof(sgstr), "Blunt Trauma\t%s\t%s\n", ReturnBodyPartName(Injuries[playa][hit][pBodypart]), GetWeaponNameFromID(Injuries[playa][hit][pWeaponID]));
- }
- case 4, 8, 9: // Stab Weapons
- {
- format(sgstr, sizeof(sgstr), "Stab Wound\t%s\t%s\n", ReturnBodyPartName(Injuries[playa][hit][pBodypart]), GetWeaponNameFromID(Injuries[playa][hit][pWeaponID]));
- }
- case 22..34,38: // Gunshot Wounds
- {
- format(sgstr, sizeof(sgstr), "Gunshot Wound\t%s\t%s\n", ReturnBodyPartName(Injuries[playa][hit][pBodypart]), GetWeaponNameFromID(Injuries[playa][hit][pWeaponID]));
- }
- case 16,17,18,35,36,37,39,40,51: // Explosion/Burn
- {
- format(sgstr, sizeof(sgstr), "Explosion/Burn\t%s\t%s\n", ReturnBodyPartName(Injuries[playa][hit][pBodypart]), GetWeaponNameFromID(Injuries[playa][hit][pWeaponID]));
- }
- default: // Unknown wound
- {
- format(sgstr, sizeof(sgstr), "Unknown\t%s\t%s\n", ReturnBodyPartName(Injuries[playa][hit][pBodypart]), GetWeaponNameFromID(Injuries[playa][hit][pWeaponID]));
- }
- }
- injuriescount ++;
- strcat(gstr, sgstr);
- }
- }
- format(namestring, sizeof(namestring), "Injuries of %s", NameRP(playa));
- if(injuriescount > 0) Dialog_Show(playerid, 9999, DIALOG_STYLE_TABLIST_HEADERS, namestring, gstr, "Close", "");
- else ShowMessage(playerid, namestring, "No injuries.", "Done");
- return true;
- }
- stock ShowCorpseInjuriesToPlayer(playerid, corpseid)
- {
- new injuriescount = 0, injuries[100], namestring[64];
- gstr[0] = EOS;
- format(namestring, sizeof(namestring), "Injuries of %s", CorpseData[corpseid][CorpseName]);
- strcat(gstr, "Injury Type\tLocation\tWeapon\n");
- for(new hit = 0; hit < CorpseData[corpseid][CorpseInjuryCount]; hit++)
- {
- if(CorpseInjuries[corpseid][hit][pBodypart] > 0)
- {
- switch(CorpseInjuries[corpseid][hit][pWeaponID])
- {
- case 0,1,2,3,5,6,7,10,11,12,13,14,15,41,42,43,44,45,46: // Blunt Weapons
- {
- format(injuries, sizeof(injuries), "Blunt Trauma\t%s\t%s\n", ReturnBodyPartName(CorpseInjuries[corpseid][hit][pBodypart]), GetWeaponNameFromID(CorpseInjuries[corpseid][hit][pWeaponID]));
- }
- case 4, 8, 9: // Stab Weapons
- {
- format(injuries, sizeof(injuries), "Stab Wound\t%s\t%s\n", ReturnBodyPartName(CorpseInjuries[corpseid][hit][pBodypart]), GetWeaponNameFromID(CorpseInjuries[corpseid][hit][pWeaponID]));
- }
- case 22..34,38: // Gunshot Wounds
- {
- format(injuries, sizeof(injuries), "Gunshot Wound\t%s\t%s\n", ReturnBodyPartName(CorpseInjuries[corpseid][hit][pBodypart]), GetWeaponNameFromID(CorpseInjuries[corpseid][hit][pWeaponID]));
- }
- case 16,17,18,35,36,37,39,40,51: // Explosion/Burn
- {
- format(injuries, sizeof(injuries), "Explosion/Burn\t%s\t%s\n", ReturnBodyPartName(CorpseInjuries[corpseid][hit][pBodypart]), GetWeaponNameFromID(CorpseInjuries[corpseid][hit][pWeaponID]));
- }
- default: // Unknown wound
- {
- format(injuries, sizeof(injuries), "Unknown\t%s\t%s\n", ReturnBodyPartName(CorpseInjuries[corpseid][hit][pBodypart]), GetWeaponNameFromID(CorpseInjuries[corpseid][hit][pWeaponID]));
- }
- }
- injuriescount ++;
- strcat(gstr, injuries);
- }
- }
- if(injuriescount == 0) ShowMessage(playerid, namestring, "No injuries.", "Done");
- else Dialog_Show(playerid, 9999, DIALOG_STYLE_TABLIST_HEADERS, namestring, gstr, "Close", "");
- return true;
- }
- stock SetCorpseInjuries(playerid, corpse)
- {
- CorpseData[corpse][CorpseInjuryCount] = HitCount[playerid];
- for(new x = 0; x < CorpseData[corpse][CorpseInjuryCount]; x++)
- {
- CorpseInjuries[corpse][x][pWeaponID] = Injuries[playerid][x][pWeaponID];
- CorpseInjuries[corpse][x][pBodypart] = Injuries[playerid][x][pBodypart];
- }
- return true;
- }
- stock ClearInjuriesForPlayer(playerid)
- {
- for(new injuries = 0; injuries < MAX_WEAPON_HITS; injuries++)
- {
- Injuries[playerid][injuries][pWeaponID] = 0;
- Injuries[playerid][injuries][pBodypart] = 0;
- }
- HitCount[playerid] = 0;
- PlayerTextDrawHide(playerid, DeathText[playerid]);
- return true;
- }
- stock SetDeathTimer(playerid)
- {
- DeathTimer[playerid] = 600;
- for(new x = 0; x < HitCount[playerid]; x++)
- {
- if(Injuries[playerid][x][pBodypart] >= 1)
- {
- if(Injuries[playerid][x][pBodypart] == 9)
- {
- DeathTimer[playerid] = 60;
- break;
- }
- else DeathTimer[playerid] -= GetWeaponDeathTimerValue(Injuries[playerid][x][pWeaponID], Injuries[playerid][x][pBodypart]);
- }
- }
- if(DeathTimer[playerid] == 600) DeathTimer[playerid] = 60;
- if(DeathTimer[playerid] <= -1) DeathTimer[playerid] = 60;
- return true;
- }
- stock GetWeaponDeathTimerValue(weaponid, bodypart)
- {
- new Float:seconds;
- switch(weaponid)
- {
- case 0..15: seconds += 5; //melee weapons
- case 22..24: seconds += 70; //pistols
- case 25..27: seconds += 120; //shotguns
- case 28, 32: seconds += 60; //micro uzi and tec
- case 29: seconds += 75; //mp5
- case 30: seconds += 95; //ak
- case 31: seconds += 90; //m4
- case 33: seconds += 200; //rifle
- case 34: seconds += 250; //sniper
- //default: seconds += 60;
- }
- if(weaponid > 15)
- {
- switch(bodypart)
- {
- case 3: seconds += seconds * 0.2; //torso
- case 4: seconds += seconds * 0.3; //groin
- case 5, 6: seconds += seconds * 0.4; //leftarm rightarm
- case 7, 8: seconds += seconds * 0.4; //left leg right leg
- //case 9 aka head will return default seconds as defined above
- }
- }
- new b = floatround(seconds);
- return b;
- }
- stock RevivePlayer(playerid)
- {
- new v = -1, seat = -1;
- if(IsPlayerInAnyVehicle(playerid))
- {
- v = GetPlayerVehicleID(playerid);
- seat = GetPlayerVehicleSeat(playerid);
- }
- Dead{playerid} = false;
- SetPlayerHealthEx(playerid, 100);
- TogglePlayerControllable(playerid, true);
- TogglePlayerSpectating(playerid, false);
- SetCameraBehindPlayer(playerid);
- HasJustDied[playerid] = 0;
- DeathTimer[playerid] = 0;
- ClearInjuriesForPlayer(playerid);
- ClearAnimations(playerid, 1);
- DestroyDynamic3DTextLabel(LabelFerido[playerid]);
- if(v != -1) PutPlayerInVehicle(playerid, v, seat);
- return true;
- }
- stock MakePlayerDead2(playerid)
- {
- Dead{playerid} = true;
- SetDeathTimer(playerid);
- SetPlayerHealthEx(playerid, 15);
- TogglePlayerControllable(playerid, false);
- if(IsPlayerInAnyVehicle(playerid)) OnePlayAnim(playerid, "ped", "CAR_dead_LHS", 4.0, 0, 0, 0, 1, 0);
- else OnePlayAnim(playerid, "SWEET", "Sweet_injuredloop", 4.0, 1, 0, 0, 1, 0);
- SendSplitMessage(playerid, COLOR_WHITE, "You have been {E20000}downed.{FFFFFF} You may choose to {44C300}/accept death{FFFFFF} after your death timer expires or wait until you are healed.");
- SyncPlayerWeapons(playerid);
- return true;
- }
- stock MakePlayerDead(playerid)
- {
- if(HasJustDied[playerid] == 1 && !Dead{playerid})
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- TempInfo[playerid][tmX] = X;
- TempInfo[playerid][tmY] = Y;
- TempInfo[playerid][tmZ] = Z;
- TempInfo[playerid][tSkin] = GetPlayerSkin(playerid);
- TempInfo[playerid][tInt] = GetPlayerInterior(playerid);
- TempInfo[playerid][tVW] = GetPlayerVirtualWorld(playerid);
- Dead{playerid} = true;
- SetDeathTimer(playerid);
- }
- return true;
- }
- stock TriggerPlayerDeath(playerid)
- {
- if(CarryingCrate[playerid] >= 1)
- {
- new Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- RemovePlayerAttachedObject(playerid, 7);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- CarryingCrate[playerid] = 0;
- }
- StopAudioStreamForPlayer(playerid);
- if(IsCuffed[playerid] == 1) IsCuffed[playerid] = 0;
- PlayerEditFurniture[playerid] = INVALID_OBJECT_ID;
- if(IsSpectating[playerid] >= 0)
- {
- TogglePlayerSpectating(playerid, 0);
- IsSpectating[playerid] = -1;
- }
- if(gPlayerUsingLoopingAnim[playerid] == 1)
- {
- gPlayerUsingLoopingAnim[playerid] = 0;
- TextDrawHideForPlayer(playerid,txtAnimHelper);
- }
- if(IsTrucking[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_WHITE, "The job has been cancelled because you died.");
- DisablePlayerCheckpoint(playerid);
- TruckIndex[playerid] = 0;
- SidejobDamage[playerid] = 0;
- EmptyTruckingTrailer(TruckingTrailer[playerid]);
- DestroyVehicleEx(TruckingTrailer[playerid], "TruckingTrailer[playerid] 5");
- TruckingTrailer[playerid] = 0;
- }
- if(IsDelivering[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_WHITE, "The job has been cancelled because you died.");
- DisablePlayerCheckpoint(playerid);
- IsDelivering[playerid] = 0;
- SidejobDamage[playerid] = 0;
- }
- if(IsDrivingBus{playerid})
- {
- SendClientMessage(playerid, COLOR_WHITE, "The job has been cancelled because you died.");
- BusRouteIndex[playerid] = -1;
- IsDrivingBus{playerid} = false;
- WaitingAtStop{playerid} = false;
- SidejobDamage[playerid] = 0;
- }
- if(IsCoalmining[playerid] > 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "The job has been cancelled because you died.");
- DisablePlayerCheckpoint(playerid);
- CoalmineIndex[playerid] = 0;
- IsCoalmining[playerid] = 0;
- SidejobDamage[playerid] = 0;
- }
- if(IsTrashMan[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_WHITE, "The job has been cancelled because you died.");
- DisablePlayerCheckpoint(playerid);
- IsTrashMan[playerid] = 0;
- SidejobDamage[playerid] = 0;
- TrashIndex[playerid] = 0;
- }
- if(DeliveringFuel[playerid] > 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "The job has been cancelled because you died.");
- DisablePlayerCheckpoint(playerid);
- DeiveringFuelAmount[playerid] = 0;
- DeiveringFuelType[playerid] = 0;
- if(DeliveringFuel[playerid] >= 2) DestroyVehicleEx(DeliveringFuelVeh[playerid][1], "DeliveringFuelVeh[playerid][1] 3");
- if(DeliveringFuelLabel[playerid] != Text3D:INVALID_3DTEXT_ID)
- {
- DestroyDynamic3DTextLabel(DeliveringFuelLabel[playerid]);
- DeliveringFuelLabel[playerid] = Text3D:INVALID_3DTEXT_ID;
- }
- DeliveringFuel[playerid] = 0;
- }
- if(DeliveringStock[playerid] > 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "The job has been cancelled because you died.");
- DisablePlayerRaceCheckpoint(playerid);
- if(DeliverStockList[playerid][0] > 0)
- {
- BizzData[DeliverStockList[playerid][0]][BizzETDelivering] = 0;
- DeliverStockList[playerid][0] = 0;
- }
- if(DeliverStockList[playerid][1] > 0)
- {
- BizzData[DeliverStockList[playerid][1]][BizzETDelivering] = 0;
- DeliverStockList[playerid][1] = 0;
- }
- if(DeliverStockList[playerid][2] > 0)
- {
- BizzData[DeliverStockList[playerid][2]][BizzETDelivering] = 0;
- DeliverStockList[playerid][2] = 0;
- }
- DeliveringStock[playerid] = 0;
- DeliveringAtStop[playerid] = 0;
- }
- if(CallerID[playerid] != -1)
- {
- if(GetPlayerSpecialAction(CallerID[playerid]) == SPECIAL_ACTION_USECELLPHONE)
- {
- SetPlayerSpecialAction(CallerID[playerid], SPECIAL_ACTION_STOPUSECELLPHONE);
- RemovePlayerAttachedObject(playerid, 6);
- }
- SendClientMessage(CallerID[playerid],COLOR_GREY,"[Cellphone] {87CEFF}The line went dead...");
- CallerID[CallerID[playerid]] = -1;
- CallerID[playerid] = -1;
- }
- if(DMV_Testing[playerid] > 0)
- {
- if(DMV_Testing[playerid] == 4) DestroyAllBoatTestObjects(playerid);
- new v = DMV_TestVehicle[playerid];
- AdminLocked{v} = false;
- foreach(new i: Player) Objective[v][i] = 0;
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(v, engine, lights, alarm, 0, bonnet, boot, 0);
- DisablePlayerRaceCheckpoint(playerid);
- DestroyVehicleEx(v, "v 5");
- strdel(vMusicLink[v], 0, 256);
- vMusicPlaying{v} = false;
- DMV_TestVehicle[playerid] = 0;
- DMV_Testing[playerid] = 0;
- for(new i = 1, x = GetVehiclePoolSize(); i <= x; i++)
- {
- if(DMVCarForPlayer[i] == playerid)
- {
- DMVCarForPlayer[i] = -1;
- break;
- }
- }
- }
- if(MedKitAction[playerid] > 0)
- {
- MedKitAction[playerid] = 0;
- MedKitActionPlayer[playerid] = -1;
- }
- ListeningBoom[playerid] = -1;
- //for(new ao = 0; ao < 10; ao++)
- //{
- // RemovePlayerAttachedObject(playerid, ao);
- //}
- if(StretcherEquipped[playerid] > 0)
- {
- DestroyDynamicObjectEx(StretcherEquipped[playerid], "StretcherEquipped[playerid]");
- StretcherEquipped[playerid] = 0;
- StretcherHolding[playerid] = 0;
- if(StretcherPlayerID[playerid] >= 0)
- {
- TogglePlayerControllable(StretcherPlayerID[playerid], 1);
- ClearAnimations(StretcherPlayerID[playerid]);
- StretcherPlayerID[playerid] = -1;
- }
- }
- IsDead[playerid] = 0;
- HasJustDied[playerid] = 1;
- CanPlayerChoke{playerid} = true;
- smask[playerid] = 0;
- scba[playerid] = 0;
- PlayerChoking{playerid} = false;
- return true;
- }
- stock TaxiMessage(msg[])
- {
- foreach(new i: Player)
- {
- if(Logged{i} && Job[i] == JOB_TAXI && JobDuty[i] == 1)
- {
- SendClientMessage(i, COLOR_YELLOW, msg);
- }
- }
- return true;
- }
- stock TaxiMarker(playerid)
- {
- foreach(new i: Player)
- {
- if(Logged{i} && Job[i] == JOB_TAXI && JobDuty[i] == 1)
- {
- SetPlayerMarkerForPlayer(i, playerid, COLOR_YELLOW);
- }
- }
- return true;
- }
- stock TaxiCount()
- {
- new count = 0;
- foreach(new i: Player)
- {
- if(Logged{i} && Job[i] == JOB_TAXI && JobDuty[i] == 1) count ++;
- }
- return count;
- }
- stock IsSuitableTaxiCar(vehicleid)
- {
- if(vehicleid == 0) return false;
- new modelid = GetVehicleModel(vehicleid);
- if(modelid == 420) return true; //Taxi
- if(modelid == 438) return true; //Cabbie
- if(modelid == 426) return true; //Premier
- if(modelid == 418) return true; //Moonbeam
- if(modelid == 445) return true; //Admiral
- return false;
- }
- stock ProcessPhoneCall(playerid, NumberCalled)
- {
- format(gstr, sizeof(gstr),"* %s takes out their phone and dials some numbers... *",NameRP(playerid));
- SetPlayerChatBubble(playerid, gstr, COLOR_EMOTE, 15.0, 6000);
- PlayerPlaySound(playerid, 3600, 0, 0, 0);
- if(NumberCalled < 1) return SysMsg(playerid,"Invalid network number.");
- if(NumberCalled > 9999999) return SysMsg(playerid,"Invalid network number.");
- if(NumberCalled == PhoneData[playerid][pNumber]) return SysMsg(playerid,"You can't call your own phone.");
- if(NumberCalled == 891)
- {
- if(FACTIONS[Faction[playerid]][FactionIsGang] == 1 && IsValidLeaderRank(Faction[playerid], FactionRank[playerid]))
- {
- if(FACTIONS[Faction[playerid]][FactionOrderingWeapons] == 1)
- {
- SysMsg(playerid, "Somebody from your faction is already processing a weapon order.");
- HangupPhone(playerid);
- }
- ShowPlayerWeaponSelectionDialog(playerid, Faction[playerid]);
- }
- else SysMsg(playerid,"Operator: \"That number is either invalid or busy.\"");
- return true;
- }
- if(NumberCalled == 444) //Cabbie Company
- {
- if(GetPlayerInterior(playerid) != 0 && GetPlayerVirtualWorld(playerid) != 0)
- {
- SysMsg(playerid, "You cannot call taxis indoors.");
- HangupPhone(playerid);
- return true;
- }
- if(Dead{playerid}) return true;
- Dialog_Show(playerid, TaxiMenu, DIALOG_STYLE_LIST, "Cabbie Co - Select the service you require", "Taxi", "Select", "Hangup");
- CallerService[playerid] = 444;
- return true;
- }
- if(NumberCalled == 911) //Police & EMS
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- if(AttachedObjects[playerid][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 6);
- }
- AttachedObjects[playerid][6][aoModelID] = 330;
- AttachedObjects[playerid][6][aoBone] = 6;
- SetPlayerAttachedObject(playerid, 6, 330, 6);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
- }
- SendClientMessage(playerid, COLOR_WHITE, "You have reached the San Andreas emergency switchboard. Do you require Police, Fire or EMS?");
- CallerService[playerid] = 911;
- return true;
- }
- if(NumberCalled == 726) //News
- {
- new newsers = 0;
- foreach(new i: Player) if(Logged{i} && Faction[i] == FACTION_NEWS) newsers ++;
- if(newsers == 0) return SysMsg(playerid, "'I'm sorry but our help desk is currently offline, try again later.'");
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- if(AttachedObjects[playerid][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 6);
- }
- AttachedObjects[playerid][6][aoModelID] = 330;
- AttachedObjects[playerid][6][aoBone] = 6;
- SetPlayerAttachedObject(playerid, 6, 330, 6);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
- }
- SendClientMessage(playerid, COLOR_WHITE, "Thank you for calling SANNEWS. Press 1 if you'd like to speak to an employee, 2 if you'd like to report news and...");
- SendClientMessage(playerid, COLOR_WHITE, "...3 if you'd like to talk on our talkshow!");
- CallerService[playerid] = 726;
- return true;
- }
- if(NumberCalled == 927) //Elite Trucking
- {
- new truckers = 0;
- foreach(new i: Player)
- {
- if(Logged{i} && Faction[i] == FACTION_TRUCKING)
- {
- truckers++;
- }
- }
- if(truckers == 0) return SysMsg(playerid, "'You're through to Elite Trucking, our help desk is currently unavailable. Please call back later.'");
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- if(AttachedObjects[playerid][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 6);
- }
- AttachedObjects[playerid][6][aoModelID] = 330;
- AttachedObjects[playerid][6][aoBone] = 6;
- SetPlayerAttachedObject(playerid, 6, 330, 6);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
- }
- SendClientMessage(playerid, COLOR_WHITE, "You're through to the Elite Trucking Hotline, how can we help you today?");
- CallerService[playerid] = 927;
- return true;
- }
- if(NumberCalled == 118) //Mechanic
- {
- new mechanics = 0;
- foreach(new i: Player)
- {
- if(Logged{i} && Job[i] == JOB_MECHANIC)
- {
- mechanics++;
- }
- }
- if(mechanics == 0) return SysMsg(playerid, "'Hi there, we regret to inform you that there are currently no mechanics on duty. Please try again later.'");
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- if(AttachedObjects[playerid][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 6);
- }
- AttachedObjects[playerid][6][aoModelID] = 330;
- AttachedObjects[playerid][6][aoBone] = 6;
- SetPlayerAttachedObject(playerid, 6, 330, 6);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
- }
- SendClientMessage(playerid, COLOR_WHITE, "'You've reached the San Andreas Mechanic Service, how may we assist you today?");
- CallerService[playerid] = 118;
- return true;
- }
- if(NumberCalled >= 9999999999)
- {
- return SendErrorCallMessage(playerid);
- }
- if(PhoneData[playerid][pCredit] - PHONE_CALL_COST < 0) return SysMsg(playerid,"You don't have enough phone credit to make this call.");
- foreach(new i: Player)
- {
- if(Logged{i})
- {
- if(PhoneData[i][pNumber] == NumberCalled && CallerID[i] == -1 && IsPhoneRinging[i] == -1 && PhoneData[i][pPower] == 1 && Inventory[i][MobilePhone] == 1 && !IsPlayerInWater(i))
- {
- if(!HasPhoneSignal(i)) return SysMsg(playerid,"Phone number was found but is currently unreachable.");
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- if(AttachedObjects[playerid][6][aoModelID] != 0)
- {
- RemovePlayerAttachedObject(playerid, 6);
- }
- AttachedObjects[playerid][6][aoModelID] = 330;
- AttachedObjects[playerid][6][aoBone] = 6;
- SetPlayerAttachedObject(playerid, 6, 330, 6);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
- }
- SetPlayerChatBubble(i, "* Phone rings *", COLOR_EMOTE, 15.0, 6000);
- new j, callingstring[30], callerstring[30];
- format(callingstring, sizeof(callingstring), "%i", NumberCalled);
- format(callerstring, sizeof(callerstring), "%i", PhoneData[playerid][pNumber]);
- for(j = 0; j < MAX_PHONECONTACTS; j++)
- {
- if(PhoneContacts[playerid][j][ContactNumber] == NumberCalled)
- {
- format(callingstring, sizeof(callingstring), PhoneContacts[playerid][j][ContactName]);
- break;
- }
- }
- for(j = 0; j < MAX_PHONECONTACTS; j++)
- {
- if(PhoneContacts[i][j][ContactNumber] == PhoneData[playerid][pNumber])
- {
- format(callerstring, sizeof(callerstring), PhoneContacts[i][j][ContactName]);
- break;
- }
- }
- SendClientMessageF(i,COLOR_GREY,"Your phone is ringing (caller: %s)... Use '/pickup' or '/p' to answer it.",callerstring);
- SendClientMessageF(playerid,COLOR_GREY,"You are calling '%s'... Use '/hangup' or '/h' to cancel.",callingstring);
- CallerID[playerid] = i;
- IsPhoneRinging[i] = playerid;
- LastNumber[playerid] = NumberCalled;
- MobileSpeaker[playerid] = 0;
- PhoneData[playerid][pCredit] -= PHONE_CALL_COST;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhoneCredit = %i WHERE id = %i", PhoneData[playerid][pCredit], PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- return true;
- }
- }
- }
- SysMsg(playerid,"Operator: \"That number is either invalid or busy.\"");
- return true;
- }
- stock ProcessTextMessage(playerid, number, message[])
- {
- if(number < 1 || number > 9999999) return SysMsg(playerid,"Invalid network number.");
- if(PhoneData[playerid][pCredit] - PHONE_TEXT_COST < 0) return SysMsg(playerid,"You don't have enough phone credit to send this SMS.");
- foreach(new i: Player)
- {
- if(PhoneData[i][pNumber] == number && PhoneData[i][pPower] == 1 && Inventory[i][MobilePhone] == 1)
- {
- if(!HasPhoneSignal(i)) return SysMsg(playerid,"\"Im sorry, your message could not be delivered, please try again later.\"");
- new j, forstring[30], tostring[30];
- format(forstring, sizeof(forstring), "%i", number);
- format(tostring, sizeof(tostring), "%i", PhoneData[playerid][pNumber]);
- for(j = 0; j < MAX_PHONECONTACTS; j++)
- {
- if(PhoneContacts[playerid][j][ContactNumber] == number)
- {
- format(forstring, sizeof(forstring), PhoneContacts[playerid][j][ContactName]);
- break;
- }
- }
- for(j = 0; j < MAX_PHONECONTACTS; j++)
- {
- if(PhoneContacts[i][j][ContactNumber] == PhoneData[playerid][pNumber])
- {
- format(tostring, sizeof(tostring), PhoneContacts[i][j][ContactName]);
- break;
- }
- }
- SendSplitMessageF(i,COLOR_SKYBLUE,"[Text From %s] %s",tostring,message);
- SendSplitMessageF(playerid, COLOR_RED, "[Text To %s] %s",forstring,message);
- SetPlayerChatBubble(playerid, "* Presses a few buttons on their phone. *", COLOR_EMOTE, 15.0, 6000);
- format(gstr, sizeof(gstr),"* %s's phone buzzes twice. *",NameRP(i));
- SetPlayerChatBubble(i, gstr, COLOR_EMOTE, 15.0, 6000);
- LastSMSNumber[i] = PhoneData[playerid][pNumber];
- PhoneData[playerid][pCredit] -= PHONE_TEXT_COST;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE phones SET PhoneCredit = %i WHERE id = %i", PhoneData[playerid][pCredit], PhoneData[playerid][pID]);
- mysql_pquery(conn, mquery);
- new StNdRdTh[4], Year, Month, Day;
- getdate(Year, Month, Day);
- StNdRdTh = "th";
- if(Day == 1||Day == 21||Day == 31) StNdRdTh = "st";
- else if(Day == 2||Day == 22) StNdRdTh = "nd";
- else if(Day == 3||Day == 23) StNdRdTh = "rd";
- format(sgstr, sizeof(sgstr), "%s on the %i%s of %s %i", GetTimeStringAndSec(), Day, StNdRdTh, GetMonthName(Month), gServerYear);
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO sms (TextTo, TextFrom, TextMessage, TextTime) VALUES (%i, %i, '%e', '%e')", number, PhoneData[playerid][pNumber], message, sgstr);
- mysql_pquery(conn, mquery);
- return true;
- }
- }
- SysMsg(playerid,"\"Your message could not be delivered, please try again later.\"");
- return true;
- }
- stock ProcessPhoneChat(playerid, vid, text[], Float:range)
- {
- new vw = GetPlayerVirtualWorld(playerid), Float:pos[3];
- GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- if(vid > 0 && VehicleHasWindows(vid))
- {
- if(WindowState{vid} == WINDOWS_CLOSED)
- {
- if(UsingAccent[playerid] == 1) format(gstr, sizeof(gstr),"%s says (cellphone): [%s accent] %s", NameRP(playerid), Accent[playerid], text);
- else format(gstr, sizeof(gstr),"%s says (cellphone): %s", NameRP(playerid), text);
- foreach(new i: Player)
- {
- new VehId = GetPlayerVehicleID(i);
- if(VehId == vid)
- {
- SendSplitMessage(i, COLOR_FADE3, gstr);
- }
- }
- FormatActionLog(playerid, gstr);
- }
- else
- {
- if(UsingAccent[playerid] == 1) format(gstr, sizeof(gstr),"%s says (cellphone): [%s accent] %s", NameRP(playerid), Accent[playerid], text);
- else format(gstr, sizeof(gstr),"%s says (cellphone): %s", NameRP(playerid), text);
- ProxDetector(range, playerid, gstr, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- FormatActionLog(playerid, gstr);
- }
- }
- else
- {
- if(IsInBizzID[playerid] != -1 || IsInHouseID[playerid] != -1)
- {
- if(UsingAccent[playerid] == 1) format(gstr, sizeof(gstr),"%s says (cellphone): [%s accent] %s", NameRP(playerid), Accent[playerid], text);
- else format(gstr, sizeof(gstr),"%s says (cellphone): %s", NameRP(playerid), text);
- foreach(new i: Player)
- {
- if(GetPlayerVirtualWorld(i) == vw && IsPlayerInRangeOfPoint(i, range, pos[0], pos[1], pos[2]))
- {
- SendSplitMessage(i,COLOR_FADE3,gstr);
- }
- }
- FormatActionLog(playerid, gstr);
- }
- else
- {
- if(UsingAccent[playerid] == 1)
- {
- if(UsingPayPhone[playerid] > 0) format(gstr, sizeof(gstr),"%s says (pay phone): [%s accent] %s", NameRP(playerid), Accent[playerid], text);
- else format(gstr, sizeof(gstr),"%s says (cellphone): [%s accent] %s", NameRP(playerid), Accent[playerid], text);
- }
- else
- {
- if(UsingPayPhone[playerid] > 0) format(gstr, sizeof(gstr),"%s says (pay phone): %s", NameRP(playerid), text);
- else format(gstr, sizeof(gstr),"%s says (cellphone): %s", NameRP(playerid), text);
- }
- ProxDetector(range, playerid, gstr, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- FormatActionLog(playerid, gstr);
- }
- }
- if(CallerID[playerid] != -1 && IsPhoneRinging[CallerID[playerid]] == -1)
- {
- new playa = CallerID[playerid];
- if(MobileSpeaker[playa] == 0)
- {
- if(range == 4.0)
- {
- if(UsingAccent[playerid] == 1) format(gstr, sizeof(gstr),"(Cellphone) A voice quietly says: [%s accent] %s", Accent[playerid], text);
- else format(gstr, sizeof(gstr),"(Cellphone) A voice quietly says: %s", text);
- }
- else
- {
- if(UsingAccent[playerid] == 1) format(gstr, sizeof(gstr),"(Cellphone) A voice says: [%s accent] %s", Accent[playerid], text);
- else format(gstr, sizeof(gstr),"(Cellphone) A voice says: %s", text);
- }
- SendSplitMessage(playa, COLOR_WHITE, gstr);
- }
- else
- {
- if(UsingAccent[playerid] == 1) format(gstr, sizeof(gstr),"(%s's Cellphone, loudspeaker) [%s accent] : %s", NameRP(playa), Accent[playerid], text);
- else format(gstr, sizeof(gstr),"(%s's Cellphone, loudspeaker) : %s", NameRP(playa), text);
- ProxDetector(range, playa, gstr, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- }
- }
- if(CallerService[playerid] == 911)
- {
- gstr[0] = EOS;
- if(!strcmp(text, "police", true) || !strcmp(text, "sd", true) || !strcmp(text, "cops", true) || !strcmp(text, "SASP", true))
- {
- SendClientMessage(playerid, COLOR_WHITE, "911 Dispatch: What is going on?");
- strcat(gstr,"Abandoned Vehicle\nAccident-Major\nAccident-Minor");
- strcat(gstr,"\nAlarm\nAssault\nAssist-Public\nBurglary\nBurglary (In Progress)\nCriminal Mischief");
- strcat(gstr,"\nDisturbance\nDOA\nDrunk\nDrugs\nDWI\nFight\nFire\nInformation\nInjured/Sick Person");
- strcat(gstr,"\nMiscellaneous\nMissing Person\nOfficer In Trouble\nRape\nRape (In Progress)\nRobbery\nShooting\nShooting (In Progress)\nSuicide");
- strcat(gstr,"\nSuspicious Person\nSuspicious Vehicle\nThreats\nThreats Bomb\nTraffic Related\n");
- Dialog_Show(playerid, MakePDCall, DIALOG_STYLE_LIST, "Please Select a Problem Type", gstr, "Choose", "Cancel");
- PlayerRequest[playerid] = 0;
- return false;
- }
- else if(!strcmp(text, "fire", true) || !strcmp(text, "ems", true) || !strcmp(text, "fd", true) || !strcmp(text, "sacfd", true) || !strcmp(text, "firefighters", true) || !strcmp(text, "medics", true) || !strcmp(text, "paramedics", true))
- {
- SendClientMessage(playerid, COLOR_WHITE, "911 Dispatch: What is going on at your location?");
- strcat(gstr,"Aircraft Emergency\nAccident-Major\nAccident-Minor\nAlarm\nArcing Electrical\nAssist-Public");
- strcat(gstr,"\nBomb Threat\nEntrapment\nExplosion\nFire\nFire-Structure\nFire-Vehicle\nGas/Fuel-Leak");
- strcat(gstr,"\nHazardous Materials\nMed-Sick Person\nMed-Injured Person\nRescue\nRescue-Water\nRescue-Search\nTrain Derailment");
- Dialog_Show(playerid, MakeFDCall, DIALOG_STYLE_LIST, "Please Select a Problem Type", gstr, "Choose", "Cancel");
- PlayerRequest[playerid] = 1;
- return false;
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "911 Dispatch: Sorry I don't quite understand you. Did you say Police, Fire, or EMS?");
- return false;
- }
- }
- if(CallerService[playerid] == 912)
- {
- if(strlen(text) < 6)
- {
- SendClientMessage(playerid, COLOR_WHITE, "911 Dispatch: Sorry I don't understand. Can you give us some more details?");
- return false;
- }
- format(CallInfo[playerid], 128, text);
- SendClientMessage(playerid, COLOR_WHITE, "911 Dispatch: OK we have sent the information to the responders. Can I have your name?");
- CallerService[playerid] = 913;
- return false;
- }
- if(CallerService[playerid] == 913)
- {
- if(strlen(text) >= 25)
- {
- SendClientMessage(playerid, COLOR_WHITE, "911 Dispatch: Sorry I don't understand. Can I have your name please? ((Name is too long))");
- return false;
- }
- new Float:xx,Float:yy,Float:zz, zzone[MAX_ZONE_NAME];
- GetPlayerPos(playerid,xx,yy,zz); GetPlayer2DZone(playerid,zzone,MAX_ZONE_NAME);
- new cPhoneNumber, namey[MAX_PLAYER_NAME];
- if(UsingPayPhone[playerid] > 0)
- {
- format(namey, MAX_PLAYER_NAME, "N/A");
- cPhoneNumber = 1000 + UsingPayPhone[playerid];
- }
- if(!UsingPayPhone[playerid])
- {
- format(namey, MAX_PLAYER_NAME, NameEx(playerid));
- cPhoneNumber = PhoneData[playerid][pNumber];
- }
- if(PlayerRequest[playerid] == 0)
- {
- format(gstr, sizeof(gstr), "[Radio - %i MHz] Dispatcher: Any units in the area of %s respond to a(n) %s", FACTIONS[FACTION_COP][FactionRadioChannel],zzone, GetProblemType(0, CallType[playerid]));
- ReportCrime(gstr);
- SendClientMessage(playerid, COLOR_WHITE, "911 Dispatch: Okay we will have our closest available unit en route to your location right away.");//hang up
- HangupPhone(playerid);
- }
- if(PlayerRequest[playerid] == 1)
- {
- format(gstr, sizeof(gstr), "[Radio - %i MHz] Dispatcher: Red County Fire Department, Respond for a(n) %s at %s", FACTIONS[FACTION_SACFD][FactionRadioChannel],GetProblemType(1, CallType[playerid]),zzone);
- ReportFire(gstr);
- FireStationBell();
- SendClientMessage(playerid, COLOR_WHITE, "911 Dispatch: Okay we will have our closest available unit en route to your location right away.");//hang up
- HangupPhone(playerid);
- }
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO 911calls (callerSQLID, callerNumber, serviceType, emerReason, nameGiven, nameRetrieved, location, emergencyInfo, timestamp) VALUES (%i, %i, %i, %i, '%e', '%e', '%e', '%e', %i)", SQLID[playerid], cPhoneNumber,
- PlayerRequest[playerid], CallType[playerid], text, namey, zzone, CallInfo[playerid], gettime());
- mysql_pquery(conn, mquery);
- CallInfo[playerid][0] = 0;
- CallType[playerid] = -1;
- PlayerRequest[playerid] = -1;
- return false;
- }
- if(CallerService[playerid] == 927)
- {
- if(strlen(text) == 0) return SendClientMessage(playerid, COLOR_WHITE, "Sorry, I didn't quite get that, can you repeat that please?");
- else
- {
- HasActiveTruckingCall{playerid} = true;
- strpack(TruckingCallMsg[playerid], text);
- format(gstr, sizeof(gstr), "Elite Trucking Hotline: [PN: %i] [Name: %s] %s", PhoneData[playerid][pNumber], NameEx(playerid), text);
- SendTruckingMessage(gstr);
- HangupPhone(playerid);
- }
- }
- if(CallerService[playerid] == 118)
- {
- if(isnull(text)) return SendClientMessage(playerid, COLOR_WHITE, "Sorry, you're gonna have to speak up. Can you say that again?");
- HasActiveMechanicCall{playerid} = true;
- strpack(MechanicCall[playerid], text);
- foreach(new i: Player)
- {
- if(Logged{i} && Job[i] == JOB_MECHANIC && i != playerid)
- {
- SendClientMessage(i, COLOR_WHITE, "A call for a mechanic has just come in! ((Use /viewmechaniccalls to respond.))");
- }
- }
- HangupPhone(playerid);
- }
- if(CallerService[playerid] == 726)
- {
- if(strval(text) == 1) //call member
- {
- Dialog_Show(playerid, NewsRequest, DIALOG_STYLE_INPUT, "#726", "{FFFFFF}You've reached the news help desk. How can we assist you today?", "Select", "Hangup");
- }
- else if(strval(text) == 2) //Report News
- {
- Dialog_Show(playerid, NewsRequest2, DIALOG_STYLE_INPUT, "#726", "{FFFFFF}Okay, can you tell us what is happening or what has happened?", "Select", "Hangup");
- }
- else if(strval(text) == 3)
- {
- if(TalkshowHost == -1)
- {
- SysMsg(playerid, "There are currently no talk shows live.");
- HangupPhone(playerid);
- }
- else if(!SANCallers)
- {
- SysMsg(playerid, "The current talk show is currently not accepting callers. We're sorry.");
- HangupPhone(playerid);
- }
- else if(GetFreeTalkshowLine() == -1)
- {
- SysMsg(playerid, "All of our lines are currently busy. Please try again later.");
- HangupPhone(playerid);
- }
- else
- {
- new x, manfound = 0;
- for(x = 0; x < 5; x++)
- {
- if(TalkshowCallers[x] == playerid)
- {
- SysMsg(playerid, "You are already waiting in the queue.");
- HangupPhone(playerid);
- manfound = 1;
- }
- }
- if(manfound == 0)
- {
- x = GetFreeTalkshowLine();
- TalkshowCallers[x] = playerid;
- SendClientMessageF(playerid, COLOR_PINK, "You are caller number %i! We will contact you soon if we decide to put you on air!", x + 1);
- foreach(new i: Player) if(Logged{i} && Faction[i] == FACTION_NEWS) SendClientMessage(i, COLOR_PINK, "[TALKSHOW NOTICE] A new call has come in. Use /callers to view details.");
- HangupPhone(playerid);
- }
- }
- }
- }
- return false;
- }
- stock HasPhoneSignal(playerid)
- {
- if(IsInHouseID[playerid] != -1 || IsInBizzID[playerid] != -1) return true;
- if(IsPlayerInRangeOfPoint(playerid, 40.0, 322.8956,1795.4436,899.3750)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 50.0, -1271.2010, -2061.0656, 22.9706)) return true;
- if(IsPlayerInRangeOfPoint(playerid, 50.0, -185.9363,1886.0468,102.80237)) return true;
- if(IsPlayerInArea(playerid, -2172.085, -2931.147, -980.9415, -2172.085)) return false;
- if(IsPlayerInArea(playerid, 46.7115, -1599.869, -1564.835, -2989.536)) return false;
- if(IsPlayerInArea(playerid, 945.9079, -2989.536, 2989.536, 2697.589)) return false;
- if(IsPlayerInArea(playerid, 2966.18, 1868.46, -315.3026, -899.1964)) return false;
- if(IsPlayerInArea(playerid, 548.8602, -934.23, 2872.757, 2195.441)) return false;
- if(!IsPlayerInArea(playerid, 3000.0, -3000.0, 3000.0, -3000.0)) return false;
- return true;
- }
- stock ClearPhoneData(playerid)
- {
- PhoneData[playerid][pID] = 0;
- PhoneData[playerid][pNumber] = 0;
- PhoneData[playerid][pOwnerSQLID] = 0;
- PhoneData[playerid][pPosessorID] = 0;
- PhoneData[playerid][pBattery] = 0;
- PhoneData[playerid][pCredit] = 0;
- PhoneData[playerid][pPower] = 0;
- PhoneData[playerid][pOwnerName][0] = EOS;
- PhoneData[playerid][PhonePossession] = 0;
- phonebateria(playerid);
- for(new x = 0; x < MAX_PHONECONTACTS; x++)
- {
- PhoneContacts[playerid][x][ContactName][0] = EOS;
- PhoneContacts[playerid][x][ContactNumber] = 0;
- PhoneContacts[playerid][x][cID] = 0;
- }
- Inventory[playerid][MobilePhone] = 0;
- return true;
- }
- stock IsPhoneNumberUsed(phonenumber)
- {
- new ID;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM phones WHERE PhoneNumber=%i LIMIT 1", phonenumber);
- new Cache:result = mysql_query(conn, mquery);
- ID = cache_get_field_content_int(0, "id");
- if(cache_num_rows() == 0)
- {
- cache_delete(result);
- return false;
- }
- else
- {
- cache_delete(result);
- return ID;
- }
- }
- stock HangupPhone(playerid)
- {
- CallerID[playerid] = -1;
- CallerService[playerid] = -1;
- if(UsingPayPhone[playerid] > 0)
- {
- PayPhoneInUse[UsingPayPhone[playerid]-1] = 0;
- UsingPayPhone[playerid] = 0;
- TogglePlayerControllable(playerid, 1);
- SetCameraBehindPlayer(playerid);
- SendClientMessage(playerid,COLOR_GREY,"[Pay phone] {87CEFF}You hung up.");
- format(gstr, sizeof(gstr),"* %s puts the phone handset back. *",NameRP(playerid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- else
- {
- SendClientMessage(playerid,COLOR_GREY,"[Cellphone] {87CEFF}You hung up.");
- format(gstr, sizeof(gstr),"* %s puts their phone away. *",NameRP(playerid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- }
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USECELLPHONE)
- {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
- RemovePlayerAttachedObject(playerid, 6);
- }
- return true;
- }
- stock IsRentalCar(vehicleid)
- {
- if(vehicleid != INVALID_VEHICLE_ID && RentalData[vehicleid][CarSQLID] >= 1) return true;
- return false;
- }
- stock UpdateRentalVehMileage()
- {
- for(new v = 0, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(IsRentalCar(v))
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE rentals SET Mileage = %i WHERE id = %i", floatround(RentalData[v][CarMileage]), RentalData[v][CarSQLID]);
- mysql_pquery(conn, mquery);
- }
- }
- return true;
- }
- stock GetAmountTillJobLevelup(jobID, curLevel, curStat)
- {
- if(jobID == 1) //Trucking
- {
- if(curLevel == 1) return 5 - curStat;
- if(curLevel == 2) return 25 - curStat;
- if(curLevel == 3) return 75 - curStat;
- if(curLevel == 4) return 150 - curStat;
- if(curLevel == 5) return false;
- }
- else if(jobID == 2) //varrering
- {
- if(curLevel == 1) return 5 - curStat;
- if(curLevel == 2) return 25 - curStat;
- if(curLevel == 3) return 75 - curStat;
- if(curLevel == 4) return 150 - curStat;
- if(curLevel == 5) return false;
- }
- else if(jobID == 3) //Deliver
- {
- if(curLevel == 1) return 5 - curStat;
- if(curLevel == 2) return 25 - curStat;
- if(curLevel == 3) return 75 - curStat;
- if(curLevel == 4) return 150 - curStat;
- if(curLevel == 5) return false;
- }
- else if(jobID == 4) //Coalminer
- {
- if(curLevel == 1) return 5 - curStat;
- if(curLevel == 2) return 25 - curStat;
- if(curLevel == 3) return 75 - curStat;
- if(curLevel == 4) return 150 - curStat;
- if(curLevel == 5) return false;
- }
- else if(jobID == 5) //Trash
- {
- if(curLevel == 1) return 5 - curStat;
- if(curLevel == 2) return 25 - curStat;
- if(curLevel == 3) return 75 - curStat;
- if(curLevel == 4) return 150 - curStat;
- if(curLevel == 5) return false;
- }
- return -1;
- }
- stock WeaponCheck(playerid, weaponid)
- {
- new scount = 0, pcount = 0;
- for(new x = 0; x < MAX_TOTAL_WEAPONS; x++)
- {
- if(GetWeaponType(WeaponData[playerid][x][Weapon]) == 1) scount ++;
- if(GetWeaponType(WeaponData[playerid][x][Weapon]) == 2) pcount ++;
- }
- if(scount == 1 && pcount == 1 && IsActualGun(weaponid)) return false;
- if(scount == 2 && IsActualGun(weaponid)) return false;
- if(pcount == 1 && GetWeaponType(weaponid) == 2) return false;
- return true;
- }
- stock WeaponLicenseCheck(playerid, weaponid)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM weapons WHERE WeaponID = %i AND WeaponOrigin = 4 AND CreatorSQLID = %i AND Deleted = 0", weaponid, SQLID[playerid]);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows())
- {
- cache_delete(result);
- return true;
- }
- else
- {
- cache_delete(result);
- return false;
- }
- }
- stock IsBanWeapon(weaponid)
- {
- new len = sizeof(BannedWeapons);
- for(new i = 0; i < len; i++)
- {
- if(BannedWeapons[i] == weaponid) return true;
- }
- return false;
- }
- stock GivePlayerWeaponEx(playerid, weaponid, ammo, type, wepid = -1, newwep = -1, adminID = -1)
- {
- //types are 1 = admin refund, 2 = illegal weapon, 3 faction wep 4 = weapon license wep, 5 = no mysql changes (used for giving weapons back after a player is hospitalized/for an event, etc), 6 = given item, picked up item, etc 7 = bought item
- //newwep is a check to see if the weapon is being created or if it's being transferred, if the weapon is being transferred it will simply update the owner on the database.
- format(gstr, sizeof(gstr), "[%s] %s (%i) has been given %s with %i ammo.", GetServerTimeString(), NameEx(playerid), playerid, weaponstring[weaponid], ammo);
- if(ammo > GetDefaultWeaponAmmo(weaponid)) ammo = GetDefaultWeaponAmmo(weaponid);
- new slot = GetWeaponSlot(weaponid);
- GivePlayerWeapon(playerid, weaponid, ammo);
- if(type != 5)
- {
- new ts = gettime();
- if(newwep == 0 && type == 6)
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET OwnerSQLID = %i, WeaponPossession = 1, TrunkID = -1, HouseID = -1, FCarID = -1, Gunrack = -1, Dropped = 0 WHERE id = %i", SQLID[playerid], wepid);
- mysql_pquery(conn, mquery);
- }
- else
- {
- if(type == 1)
- {
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO weapons (CreatorSQLID, OwnerSQLID, WeaponID, WeaponAmmo, WeaponOrigin, Timestamp) VALUES (%i, %i, %i, %i, %i, %i)", adminID, SQLID[playerid], weaponid, ammo, type, ts);
- new Cache:result = mysql_query(conn, mquery);
- WeaponData[playerid][slot][WeaponID] = cache_insert_id();
- WeaponData[playerid][slot][WeaponTimestamp] = ts;
- WeaponData[playerid][slot][wCreatorSQLID] = adminID;
- WeaponData[playerid][slot][Weapon] = weaponid;
- WeaponData[playerid][slot][wOwnerSQLID] = SQLID[playerid];
- WeaponData[playerid][slot][WeaponAmmo] = ammo;
- WeaponData[playerid][slot][WeaponType] = GetWeaponType(weaponid);
- WeaponData[playerid][slot][WeaponOrigin] = type;
- WeaponData[playerid][slot][WeaponPossession] = 1;
- cache_delete(result);
- }
- else
- {
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO weapons (CreatorSQLID, OwnerSQLID, WeaponID, WeaponAmmo, WeaponOrigin, Timestamp) VALUES (%i, %i, %i, %i, %i, %i)", SQLID[playerid], SQLID[playerid], weaponid, ammo, type, ts);
- new Cache:result = mysql_query(conn, mquery);
- WeaponData[playerid][slot][WeaponID] = cache_insert_id();
- WeaponData[playerid][slot][WeaponTimestamp] = ts;
- WeaponData[playerid][slot][wCreatorSQLID] = SQLID[playerid];
- WeaponData[playerid][slot][Weapon] = weaponid;
- WeaponData[playerid][slot][wOwnerSQLID] = SQLID[playerid];
- WeaponData[playerid][slot][WeaponAmmo] = ammo;
- WeaponData[playerid][slot][WeaponType] = GetWeaponType(weaponid);
- WeaponData[playerid][slot][WeaponOrigin] = type;
- WeaponData[playerid][slot][WeaponPossession] = 1;
- cache_delete(result);
- }
- }
- }
- for(new ht; ht < sizeof(unholsterWeap); ht++)
- {
- if(weaponid == unholsterWeap[ht]) return true;
- }
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM toys WHERE tPlayer = %i AND tModelID = %i", SQLID[playerid], dropObjectID[weaponid]);
- mysql_pquery(conn, mquery, "NewHolsterCheck", "dd", playerid, weaponid);
- return true;
- }
- stock SyncPlayerWeapons(playerid)
- {
- WeaponsToBeSynced{playerid} = true;
- ResetPlayerWeapons(playerid);
- for(new Slot = 0; Slot < MAX_TOTAL_WEAPONS; Slot++)
- {
- if(WeaponData[playerid][Slot][WeaponAmmo] == 0 && WeaponData[playerid][Slot][WeaponID] >= 1 && (!HasTaser{playerid} && WeaponData[playerid][Slot][Weapon] != WEAPON_SILENCED))
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET WeaponPossession = 0, Deleted = 1, FCarID = -1, HouseID = -1, TrunkID = -1, Dropped = 0 WHERE id = %i", WeaponData[playerid][Slot][WeaponID]);
- mysql_pquery(conn, mquery);
- ResetWeaponVariables(playerid, 0, Slot);
- }
- else if(WeaponData[playerid][Slot][Weapon] > 0 && WeaponData[playerid][Slot][WeaponAmmo] > 0)
- {
- if(Slot > 0) IsHolstered[playerid][Slot] = 1;
- GivePlayerWeapon(playerid, WeaponData[playerid][Slot][Weapon], WeaponData[playerid][Slot][WeaponAmmo]);
- }
- }
- for(new o = 8; o < 10; o++)
- {
- RemovePlayerAttachedObject(playerid, o);
- AttachedObjects[playerid][o][aoBone] = 0;
- AttachedObjects[playerid][o][aoModelID] = 0;
- }
- WeaponsToBeSynced{playerid} = false;
- SetPlayerArmedWeapon(playerid, 0);
- return true;
- }
- stock ResetPlayerWeaponsEx(playerid)
- {
- ResetPlayerWeapons(playerid);
- for(new Slot = 0; Slot < MAX_TOTAL_WEAPONS; Slot++)
- {
- if(WeaponData[playerid][Slot][WeaponOrigin] == 3)
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET Deleted = 1, WeaponPossession = 0 WHERE id = %i", WeaponData[playerid][Slot][WeaponID]);
- mysql_pquery(conn, mquery);
- }
- else
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET WeaponPossession = 0, Deleted = 1 WHERE id = %i AND TrunkID = -1 AND FCarID = -1 AND Gunrack = -1 AND Dropped = 0 AND HouseID = -1", WeaponData[playerid][Slot][WeaponID]);
- mysql_pquery(conn, mquery);
- }
- ResetWeaponVariables(playerid, 0, Slot);
- if(Slot > 0) IsHolstered[playerid][Slot] = 1;
- }
- for(new o = 8; o < 10; o++)
- {
- RemovePlayerAttachedObject(playerid, o);
- AttachedObjects[playerid][o][aoBone] = 0;
- AttachedObjects[playerid][o][aoModelID] = 0;
- }
- return true;
- }
- stock GetWeaponNameFromID(gunid)
- {
- new wName[24];
- if(gunid == 21) format(wName, 24, "Heavy Armor");
- else if(gunid < 0 || gunid > 47) format(wName, 24, "INVALID");
- else format(wName, 24, WeaponNames[gunid]);
- return wName;
- }
- stock GetWeaponIdFromName(wepname[])
- {
- for(new i = 0; i < sizeof(WeaponNames); i++)
- {
- if(strfind(WeaponNames[i],wepname,true) != -1) return i;
- }
- return -1;
- }
- stock IsActualGun(id)
- {
- switch(id)
- {
- case -1,0,2,3,5,6,7,10,11,12,13,14,15,40,41,42,43,44,45,46,47: return false;
- }
- return true;
- }
- stock IsWMD(id)
- {
- if((id > 34 && id < 40) || id == 16 || id == 51) return true;
- return false;
- }
- stock ResetWeaponVariables(playerid, all, id = -1)
- {
- if(all == 1)
- {
- for(new x = 0; x < MAX_TOTAL_WEAPONS; x++)
- {
- WeaponData[playerid][x][WeaponID] = 0;
- WeaponData[playerid][x][WeaponPossession] = 0;
- WeaponData[playerid][x][wCreatorSQLID] = 0;
- WeaponData[playerid][x][wOwnerSQLID] = 0;
- WeaponData[playerid][x][WeaponType] = 0;
- WeaponData[playerid][x][Weapon] = 0;
- WeaponData[playerid][x][WeaponAmmo] = 0;
- WeaponData[playerid][x][WeaponOrigin] = 0;
- WeaponData[playerid][x][WeaponTimestamp] = 0;
- }
- return true;
- }
- else
- {
- WeaponData[playerid][id][WeaponID] = 0;
- WeaponData[playerid][id][WeaponPossession] = 0;
- WeaponData[playerid][id][wCreatorSQLID] = 0;
- WeaponData[playerid][id][wOwnerSQLID] = 0;
- WeaponData[playerid][id][WeaponType] = 0;
- WeaponData[playerid][id][Weapon] = 0;
- WeaponData[playerid][id][WeaponAmmo] = 0;
- WeaponData[playerid][id][WeaponOrigin] = 0;
- WeaponData[playerid][id][WeaponTimestamp] = 0;
- return true;
- }
- }
- stock TransferWeaponData(fromplayerid, toplayerid, id)
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weapons SET OwnerSQLID = %i WHERE id = %i", SQLID[toplayerid], WeaponData[fromplayerid][id][WeaponID]);
- mysql_pquery(conn, mquery);
- WeaponData[toplayerid][id][WeaponID] = WeaponData[fromplayerid][id][WeaponID];
- WeaponData[toplayerid][id][WeaponPossession] = WeaponData[fromplayerid][id][WeaponPossession];
- WeaponData[toplayerid][id][wCreatorSQLID] = WeaponData[fromplayerid][id][wCreatorSQLID];
- WeaponData[toplayerid][id][wOwnerSQLID] = SQLID[toplayerid];
- WeaponData[toplayerid][id][WeaponType] = WeaponData[fromplayerid][id][WeaponType];
- WeaponData[toplayerid][id][Weapon] = WeaponData[fromplayerid][id][Weapon];
- WeaponData[toplayerid][id][WeaponAmmo] = WeaponData[fromplayerid][id][WeaponAmmo];
- WeaponData[toplayerid][id][WeaponOrigin] = WeaponData[fromplayerid][id][WeaponOrigin];
- WeaponData[toplayerid][id][WeaponTimestamp] = WeaponData[fromplayerid][id][WeaponTimestamp];
- ResetWeaponVariables(fromplayerid, 0, id);
- return true;
- }
- stock GetVehicleModTypeFromName(text[])
- {
- new type = -1;
- if(strfind(text, "Spoiler", true) != -1) type = 0;
- if(strfind(text, "Hood", true) != -1) type = 1;
- if(strfind(text, "Roof", true) != -1) type = 2;
- if(strfind(text, "Sideskirt", true) != -1) type = 3;
- if(strfind(text, "Light", true) != -1) type = 4;
- if(strfind(text, "Nitrous", true) != -1) type = 5;
- if(strfind(text, "Exhaust", true) != -1) type = 6;
- if(strfind(text, "Wheels", true) != -1) type = 7;
- if(strfind(text, "Hydraulics", true) != -1) type = 9;
- if(strfind(text, "Front Bumper", true) != -1) type = 10;
- if(strfind(text, "Rear Bumper", true) != -1) type = 11;
- if(strfind(text, "Right Vent", true) != -1) type = 12;
- if(strfind(text, "Left Vent", true) != -1) type = 13;
- return type;
- }
- stock IsVehicleUpgradeCompatible(model, componentid) // by AirKite
- {
- switch(model)
- {
- case 400:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1013: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1021: return true;
- case 1024: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 401:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1003: return true;
- case 1004: return true;
- case 1005: return true;
- case 1006: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1013: return true;
- case 1017: return true;
- case 1019: return true;
- case 1020: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1142: return true;
- case 1143: return true;
- case 1144: return true;
- }
- }
- case 404:
- {
- switch(componentid)
- {
- case 1000: return true;
- case 1002: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1013: return true;
- case 1016: return true;
- case 1017: return true;
- case 1019: return true;
- case 1020: return true;
- case 1021: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 405:
- {
- switch(componentid)
- {
- case 1000: return true;
- case 1001: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1014: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1021: return true;
- case 1023: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 410:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1003: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1013: return true;
- case 1017: return true;
- case 1019: return true;
- case 1020: return true;
- case 1021: return true;
- case 1023: return true;
- case 1024: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 415:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1003: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1017: return true;
- case 1018: return true;
- case 1019: return true;
- case 1023: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 418:
- {
- switch(componentid)
- {
- case 1002: return true;
- case 1006: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1016: return true;
- case 1020: return true;
- case 1021: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 420:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1003: return true;
- case 1004: return true;
- case 1005: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1019: return true;
- case 1021: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 421:
- {
- switch(componentid)
- {
- case 1000: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1014: return true;
- case 1016: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1021: return true;
- case 1023: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 422:
- {
- switch(componentid)
- {
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1013: return true;
- case 1017: return true;
- case 1019: return true;
- case 1020: return true;
- case 1021: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 426:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1003: return true;
- case 1004: return true;
- case 1005: return true;
- case 1006: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1019: return true;
- case 1021: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 436:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1003: return true;
- case 1006: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1013: return true;
- case 1017: return true;
- case 1019: return true;
- case 1020: return true;
- case 1021: return true;
- case 1022: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 439:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1003: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1013: return true;
- case 1017: return true;
- case 1023: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1142: return true;
- case 1143: return true;
- case 1144: return true;
- case 1145: return true;
- }
- }
- case 477:
- {
- switch(componentid)
- {
- case 1006: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1017: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1021: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 478:
- {
- switch(componentid)
- {
- case 1004: return true;
- case 1005: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1012: return true;
- case 1013: return true;
- case 1020: return true;
- case 1021: return true;
- case 1022: return true;
- case 1024: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 489:
- {
- switch(componentid)
- {
- case 1000: return true;
- case 1002: return true;
- case 1004: return true;
- case 1005: return true;
- case 1006: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1013: return true;
- case 1016: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1024: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 491:
- {
- switch(componentid)
- {
- case 1003: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1014: return true;
- case 1017: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1021: return true;
- case 1023: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1142: return true;
- case 1143: return true;
- case 1144: return true;
- case 1145: return true;
- }
- }
- case 492:
- {
- switch(componentid)
- {
- case 1000: return true;
- case 1004: return true;
- case 1005: return true;
- case 1006: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1016: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 496:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1002: return true;
- case 1003: return true;
- case 1006: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1011: return true;
- case 1017: return true;
- case 1019: return true;
- case 1020: return true;
- case 1023: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1142: return true;
- case 1143: return true;
- }
- }
- case 500:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1013: return true;
- case 1019: return true;
- case 1020: return true;
- case 1021: return true;
- case 1024: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 516:
- {
- switch(componentid)
- {
- case 1000: return true;
- case 1002: return true;
- case 1004: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1015: return true;
- case 1016: return true;
- case 1017: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1021: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 517:
- {
- switch(componentid)
- {
- case 1002: return true;
- case 1003: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1016: return true;
- case 1017: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1023: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1142: return true;
- case 1143: return true;
- case 1144: return true;
- case 1145: return true;
- }
- }
- case 518:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1003: return true;
- case 1005: return true;
- case 1006: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1013: return true;
- case 1017: return true;
- case 1018: return true;
- case 1020: return true;
- case 1023: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1142: return true;
- case 1143: return true;
- case 1144: return true;
- case 1145: return true;
- }
- }
- case 527:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1014: return true;
- case 1015: return true;
- case 1017: return true;
- case 1018: return true;
- case 1020: return true;
- case 1021: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 529:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1003: return true;
- case 1006: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1011: return true;
- case 1012: return true;
- case 1017: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1023: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 534:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1100: return true;
- case 1101: return true;
- case 1106: return true;
- case 1122: return true;
- case 1123: return true;
- case 1124: return true;
- case 1125: return true;
- case 1126: return true;
- case 1127: return true;
- case 1178: return true;
- case 1179: return true;
- case 1180: return true;
- case 1185: return true;
- }
- }
- case 535:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1109: return true;
- case 1110: return true;
- case 1113: return true;
- case 1114: return true;
- case 1115: return true;
- case 1116: return true;
- case 1117: return true;
- case 1118: return true;
- case 1119: return true;
- case 1120: return true;
- case 1121: return true;
- }
- }
- case 536:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1103: return true;
- case 1104: return true;
- case 1105: return true;
- case 1107: return true;
- case 1108: return true;
- case 1128: return true;
- case 1181: return true;
- case 1182: return true;
- case 1183: return true;
- case 1184: return true;
- }
- }
- case 540:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1004: return true;
- case 1006: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1017: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1023: return true;
- case 1024: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1142: return true;
- case 1143: return true;
- case 1144: return true;
- case 1145: return true;
- }
- }
- case 542:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1014: return true;
- case 1015: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1021: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1144: return true;
- case 1145: return true;
- }
- }
- case 546:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1002: return true;
- case 1004: return true;
- case 1006: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1017: return true;
- case 1018: return true;
- case 1019: return true;
- case 1023: return true;
- case 1024: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1142: return true;
- case 1143: return true;
- case 1144: return true;
- case 1145: return true;
- }
- }
- case 547:
- {
- switch(componentid)
- {
- case 1000: return true;
- case 1003: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1016: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1021: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1142: return true;
- case 1143: return true;
- }
- }
- case 549:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1003: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1011: return true;
- case 1012: return true;
- case 1017: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1023: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1142: return true;
- case 1143: return true;
- case 1144: return true;
- case 1145: return true;
- }
- }
- case 550:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1003: return true;
- case 1004: return true;
- case 1005: return true;
- case 1006: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1023: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1142: return true;
- case 1143: return true;
- case 1144: return true;
- case 1145: return true;
- }
- }
- case 551:
- {
- switch(componentid)
- {
- case 1002: return true;
- case 1003: return true;
- case 1005: return true;
- case 1006: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1016: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1021: return true;
- case 1023: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 558:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1088: return true;
- case 1089: return true;
- case 1090: return true;
- case 1091: return true;
- case 1092: return true;
- case 1093: return true;
- case 1094: return true;
- case 1095: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1163: return true;
- case 1164: return true;
- case 1165: return true;
- case 1166: return true;
- case 1167: return true;
- case 1168: return true;
- }
- }
- case 559:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1025: return true;
- case 1065: return true;
- case 1066: return true;
- case 1067: return true;
- case 1068: return true;
- case 1069: return true;
- case 1070: return true;
- case 1071: return true;
- case 1072: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1158: return true;
- case 1159: return true;
- case 1160: return true;
- case 1161: return true;
- case 1162: return true;
- case 1173: return true;
- }
- }
- case 560:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1025: return true;
- case 1026: return true;
- case 1027: return true;
- case 1028: return true;
- case 1029: return true;
- case 1030: return true;
- case 1031: return true;
- case 1032: return true;
- case 1033: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1138: return true;
- case 1139: return true;
- case 1140: return true;
- case 1141: return true;
- case 1169: return true;
- case 1170: return true;
- }
- }
- case 561:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1025: return true;
- case 1055: return true;
- case 1056: return true;
- case 1057: return true;
- case 1058: return true;
- case 1059: return true;
- case 1060: return true;
- case 1061: return true;
- case 1062: return true;
- case 1063: return true;
- case 1064: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1154: return true;
- case 1155: return true;
- case 1156: return true;
- case 1157: return true;
- }
- }
- case 562:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1025: return true;
- case 1034: return true;
- case 1035: return true;
- case 1036: return true;
- case 1037: return true;
- case 1038: return true;
- case 1039: return true;
- case 1040: return true;
- case 1041: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1146: return true;
- case 1147: return true;
- case 1148: return true;
- case 1149: return true;
- case 1171: return true;
- case 1172: return true;
- }
- }
- case 565:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1025: return true;
- case 1045: return true;
- case 1046: return true;
- case 1047: return true;
- case 1048: return true;
- case 1049: return true;
- case 1050: return true;
- case 1051: return true;
- case 1052: return true;
- case 1053: return true;
- case 1054: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1150: return true;
- case 1151: return true;
- case 1152: return true;
- case 1153: return true;
- }
- }
- case 567:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1102: return true;
- case 1129: return true;
- case 1130: return true;
- case 1131: return true;
- case 1132: return true;
- case 1133: return true;
- case 1186: return true;
- case 1187: return true;
- case 1188: return true;
- case 1189: return true;
- }
- }
- case 575:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1025: return true;
- case 1042: return true;
- case 1043: return true;
- case 1044: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1099: return true;
- case 1174: return true;
- case 1175: return true;
- case 1176: return true;
- case 1177: return true;
- }
- }
- case 576:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1134: return true;
- case 1135: return true;
- case 1136: return true;
- case 1137: return true;
- case 1190: return true;
- case 1191: return true;
- case 1192: return true;
- case 1193: return true;
- }
- }
- case 580:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1006: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1017: return true;
- case 1018: return true;
- case 1020: return true;
- case 1023: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 585:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1003: return true;
- case 1006: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1013: return true;
- case 1017: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1023: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1142: return true;
- case 1143: return true;
- case 1144: return true;
- case 1145: return true;
- }
- }
- case 589:
- {
- switch(componentid)
- {
- case 1000: return true;
- case 1004: return true;
- case 1005: return true;
- case 1006: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1013: return true;
- case 1016: return true;
- case 1017: return true;
- case 1018: return true;
- case 1020: return true;
- case 1024: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1144: return true;
- case 1145: return true;
- }
- }
- case 600:
- {
- switch(componentid)
- {
- case 1004: return true;
- case 1005: return true;
- case 1006: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1013: return true;
- case 1017: return true;
- case 1018: return true;
- case 1020: return true;
- case 1022: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- case 603:
- {
- switch(componentid)
- {
- case 1001: return true;
- case 1006: return true;
- case 1007: return true;
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1017: return true;
- case 1018: return true;
- case 1019: return true;
- case 1020: return true;
- case 1023: return true;
- case 1024: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- case 1142: return true;
- case 1143: return true;
- case 1144: return true;
- case 1145: return true;
- }
- }
- case 402,403,406..409,411..414,416,419,423,424,427..429,431..435,437,438,440..445,448,450,451,455..459,461..463,466..468,470,471,474,475,479..486,490,494,495,498,499,502..510,514,515,521..526,528,530..533,541,552,543..545,554..557,566,568,578,571..574,579,581..584,586..588,591,594,596..599,601,602,604..611:
- {
- switch(componentid)
- {
- case 1008: return true;
- case 1009: return true;
- case 1010: return true;
- case 1025: return true;
- case 1073: return true;
- case 1074: return true;
- case 1075: return true;
- case 1076: return true;
- case 1077: return true;
- case 1078: return true;
- case 1079: return true;
- case 1080: return true;
- case 1081: return true;
- case 1082: return true;
- case 1083: return true;
- case 1084: return true;
- case 1085: return true;
- case 1087: return true;
- case 1096: return true;
- case 1097: return true;
- case 1098: return true;
- }
- }
- }
- return 0;
- }
- stock IsActualVehicleMod(componentid)
- {
- switch(componentid)
- {
- case 1008: return false;
- case 1009: return false;
- case 1010: return false;
- case 1025: return false;
- case 1073: return false;
- case 1074: return false;
- case 1075: return false;
- case 1076: return false;
- case 1077: return false;
- case 1078: return false;
- case 1079: return false;
- case 1080: return false;
- case 1081: return false;
- case 1082: return false;
- case 1083: return false;
- case 1084: return false;
- case 1085: return false;
- case 1087: return false;
- case 1096: return false;
- case 1097: return false;
- case 1098: return false;
- }
- return true;
- }
- stock GetVehicleModName(componentid)
- {
- static ModName[32];
- enum RCRP_ModInfo
- {
- ModComponentID,
- ModFullName[64 char]
- };
- static const RCRP_Mods[][RCRP_ModInfo] =
- {
- {1000, !"Pro Spoiler"},
- {1001, !"Win Spoiler"},
- {1002, !"Drag Spoiler"},
- {1003, !"Alpha Spoiler"},
- {1004, !"Champ Scoop"},
- {1005, !"Fury Scoop"},
- {1006, !"Roof Scoop"},
- {1007, !"Right Sideskirt"},
- {1008, !"Nitrous x5"},
- {1009, !"Nitrous x2"},
- {1010, !"Nitrous x10"},
- {1011, !"Race Scoop"},
- {1012, !"Worx Scoop"},
- {1013, !"Round Fog Lights"},
- {1014, !"Champ Spoiler"},
- {1015, !"Race Spoiler"},
- {1016, !"Worx Spoiler"},
- {1017, !"Left Sideskirt"},
- {1018, !"Upswept Exhaust"},
- {1019, !"Twin Exhaust"},
- {1020, !"Large Exhaust"},
- {1021, !"Medium Exhaust"},
- {1022, !"Small Exhaust"},
- {1023, !"Fury Spoiler"},
- {1024, !"Square Fog Lights"},
- {1025, !"Offroad Wheels"},
- {1026, !"Right Alien Sideskirt"},
- {1027, !"Left Alien Sideskirt"},
- {1028, !"Alien Exhaust"},
- {1029, !"X-Flow Exhaust"},
- {1030, !"Right X-Flow Sideskirt"},
- {1031, !"Left X-Flow Sideskirt"},
- {1032, !"Alien Roof Vent"},
- {1033, !"X-Flow Roof Vent"},
- {1034, !"Alien Exhaust"},
- {1035, !"X-Flow Roof Vent"},
- {1036, !"Right Alien Sideskirt"},
- {1037, !"X-Flow Exhaust"},
- {1038, !"Alien Roof Vent"},
- {1039, !"Right X-Flow Sideskirt"},
- {1040, !"Left Alien Sideskirt"},
- {1041, !"Left X-Flow Sideskirt"},
- {1042, !"Right Chrome Sideskirt"},
- {1043, !"Slamin Exhaust"},
- {1044, !"Chrome Exhaust"},
- {1045, !"X-Flow Exhaust"},
- {1046, !"Alien Exhaust"},
- {1047, !"Right Alien Sideskirt"},
- {1048, !"Right X-Flow Sideskirt"},
- {1049, !"Alien Spoiler"},
- {1050, !"X-Flow Spoiler"},
- {1051, !"Left Alien Sideskirt"},
- {1052, !"Left X-Flow Sideskirt"},
- {1053, !"X-Flow Roof Vent"},
- {1054, !"Alien Roof Vent"},
- {1055, !"Alien Roof Vent"},
- {1056, !"Right Alien Sideskirt"},
- {1057, !"Right X-Flow Sideskirt"},
- {1058, !"X-Flow Spoiler"},
- {1059, !"X-Flow Exhaust"},
- {1060, !"Alien Spoiler"},
- {1061, !"X-Flow Roof Vent"},
- {1062, !"Left Alien Sideskirt"},
- {1063, !"Left X-Flow Sideskirt"},
- {1064, !"Alien Exhaust"},
- {1065, !"Alien Exhaust"},
- {1066, !"X-Flow Exhaust"},
- {1067, !"Alien Roof Vent"},
- {1068, !"X-Flow Roof Vent"},
- {1069, !"Right Alien Sideskirt"},
- {1070, !"Right X-Flow Sideskirt"},
- {1071, !"Left Alien Sideskirt"},
- {1072, !"Left X-Flow Sideskirt"},
- {1073, !"Shadow Wheels"},
- {1074, !"Mega Wheels"},
- {1075, !"Rimshine Wheels"},
- {1076, !"Wires Wheels"},
- {1077, !"Classic Wheels"},
- {1078, !"Twist Wheels"},
- {1079, !"Cutter Wheels"},
- {1080, !"Stitch Wheels"},
- {1081, !"Grove Wheels"},
- {1082, !"Import Wheels"},
- {1083, !"Dollar Wheels"},
- {1084, !"Trance Wheels"},
- {1085, !"Atomic Wheels"},
- {1086, !"Stereo"},
- {1087, !"Hydraulics"},
- {1088, !"Alien Roof Vent"},
- {1089, !"X-Flow Exhaust"},
- {1090, !"Right Alien Sideskirt"},
- {1091, !"X-Flow Roof Vent"},
- {1092, !"Alien Exhaust"},
- {1093, !"Left X-Flow Sideskirt"},
- {1094, !"Left Alien Sideskirt"},
- {1095, !"Right X-Flow Sideskirt"},
- {1096, !"Ahab Wheels"},
- {1097, !"Virtual Wheels"},
- {1098, !"Access Wheels"},
- {1099, !"Left Chrome Sideskirt"},
- {1100, !"Chrome Grill"},
- {1101, !"Left Chrome Flames Sideskirt"},
- {1102, !"Left Chrome Strip Sideskirt"},
- {1103, !"Convertible Roof"},
- {1104, !"Chrome Exhaust"},
- {1105, !"Slamin Exhaust"},
- {1106, !"Left Chrome Arches Sideskirt"},
- {1107, !"Left Chrome Strip Sideskirt"},
- {1108, !"Right Chrome Strip Sideskirt"},
- {1109, !"Chrome Rear Bullbars"},
- {1110, !"Slamin Rear Bullbars"},
- {1111, !"Front Sign"},
- {1112, !"Front Sign"},
- {1113, !"Chrome Exhaust"},
- {1114, !"Slamin Exhaust"},
- {1115, !"Chrome Front Bullbars"},
- {1116, !"Slamin Front Bullbars"},
- {1117, !"Chrome Front Bumper"},
- {1118, !"Right Chrome Trim Sideskirt"},
- {1119, !"Right Wheelcovers Sideskirt"},
- {1120, !"Left Chrome Trim Sideskirt"},
- {1121, !"Left Wheelcovers Sideskirt"},
- {1122, !"Right Chrome Flames Sideskirt"},
- {1123, !"Bullbar Chrome Bars"},
- {1124, !"Left Chrome Arches Sideskirt"},
- {1125, !"Bullbar Chrome Lights"},
- {1126, !"Chrome Exhaust"},
- {1127, !"Slamin Exhaust"},
- {1128, !"Vinyl Hardtop Roof"},
- {1129, !"Chrome Exhaust"},
- {1130, !"Hardtop Roof"},
- {1131, !"Softtop Roof"},
- {1132, !"Slamin Exhaust"},
- {1133, !"Right Chrome Strip Sideskirt"},
- {1134, !"Right Chrome Strip Sideskirt"},
- {1135, !"Slamin Exhaust"},
- {1136, !"Chrome Exhaust"},
- {1138, !"Alien Spoiler"},
- {1139, !"X-Flow Spoiler"},
- {1140, !"X-Flow Rear Bumper"},
- {1141, !"Alien Rear Bumper"},
- {1142, !"Left Oval Vents"},
- {1143, !"Right Oval Vents"},
- {1144, !"Left Square Vents"},
- {1145, !"Right Square Vents"},
- {1146, !"X-Flow Spoiler"},
- {1147, !"Alien Spoiler"},
- {1148, !"X-Flow Rear Bumper"},
- {1149, !"Alien Rear Bumper"},
- {1150, !"Alien Rear Bumper"},
- {1151, !"X-Flow Rear Bumper"},
- {1152, !"X-Flow Front Bumper"},
- {1153, !"Alien Front Bumper"},
- {1154, !"Alien Rear Bumper"},
- {1155, !"Alien Front Bumper"},
- {1156, !"X-Flow Rear Bumper"},
- {1157, !"X-Flow Front Bumper"},
- {1158, !"X-Flow Spoiler"},
- {1159, !"Alien Rear Bumper"},
- {1160, !"Alien Front Bumper"},
- {1161, !"X-Flow Rear Bumper"},
- {1162, !"Alien Spoiler"},
- {1163, !"X-Flow Spoiler"},
- {1164, !"Alien Spoiler"},
- {1165, !"X-Flow Front Bumper"},
- {1166, !"Alien Front Bumper"},
- {1167, !"X-Flow Rear Bumper"},
- {1168, !"Alien Rear Bumper"},
- {1169, !"Alien Front Bumper"},
- {1170, !"X-Flow Front Bumper"},
- {1171, !"Alien Front Bumper"},
- {1172, !"X-Flow Front Bumper"},
- {1173, !"X-Flow Front Bumper"},
- {1174, !"Chrome Front Bumper"},
- {1175, !"Slamin Front Bumper"},
- {1176, !"Chrome Rear Bumper"},
- {1177, !"Slamin Rear Bumper"},
- {1178, !"Slamin Rear Bumper"},
- {1179, !"Chrome Front Bumper"},
- {1180, !"Chrome Rear Bumper"},
- {1181, !"Slamin Front Bumper"},
- {1182, !"Chrome Front Bumper"},
- {1183, !"Slamin Rear Bumper"},
- {1184, !"Chrome Rear Bumper"},
- {1185, !"Slamin Front Bumper"},
- {1186, !"Slamin Rear Bumper"},
- {1187, !"Chrome Rear Bumper"},
- {1188, !"Slamin Front Bumper"},
- {1189, !"Chrome Front Bumper"},
- {1190, !"Slamin Front Bumper"},
- {1191, !"Chrome Front Bumper"},
- {1192, !"Chrome Rear Bumper"},
- {1193, !"Slamin Rear Bumper"}
- };
- for(new i = 0; i < sizeof(RCRP_Mods); i++)
- {
- if(RCRP_Mods[i][ModComponentID] == componentid)
- {
- strunpack(ModName, RCRP_Mods[i][ModFullName]);
- return ModName;
- }
- }
- strunpack(ModName, !"Unknown");
- return ModName;
- }
- stock IsSuitablePaintjobCar(vehicleid)
- {
- new model = GetVehicleModel(vehicleid);
- if(model == 483) return true; //camper
- if(model == 534) return true; //remington
- if(model == 535) return true; //slamvan
- if(model == 536) return true; //blade
- if(model == 558) return true; //uranus
- if(model == 559) return true; //jester
- if(model == 560) return true; //sultan
- if(model == 561) return true; //stratum
- if(model == 562) return true; //elegy
- if(model == 565) return true; //flash
- if(model == 567) return true; //savanna
- if(model == 575) return true; //broadway
- if(model == 576) return true; //tornado
- return false;
- }
- stock IsPlayerInInvalidNosVehicle(vehicleid)
- {
- new InvalidNosVehicles[30] =
- {
- 581,523,462,521,463,522,461,448,468,586,
- 509,481,510,472,473,493,595,484,430,453,
- 452,446,454,590,569,537,538,570,449,463
- };
- new VehModel = GetVehicleModel(vehicleid);
- for(new i = 0; i < 30; i++)
- {
- if(VehModel == InvalidNosVehicles[i])
- {
- return true;
- }
- }
- return false;
- }
- stock CanVehicleHaveHydraulics(vehicleid)
- {
- new InvalidVehicles[29] =
- {
- 581,523,462,521,463,522,461,448,468,586,
- 509,481,510,472,473,493,595,484,430,453,
- 452,446,454,590,569,537,538,570,449
- };
- new VehModel = GetVehicleModel(vehicleid);
- for(new i = 0; i < 29; i++)
- {
- if(VehModel == InvalidVehicles[i])
- {
- return false;
- }
- }
- return true;
- }
- stock GetVehicleRepairMultiplier(model)
- {
- switch(model)
- {
- case 480,555,522,470,580,494,502,503,559,603,506,487,469,409: return 17;
- case 533,439,521,562,602,587,477,545,423,402,560,495: return 10;
- case 411,541,415,451,429: return 35;
- default: return true;
- }
- return true;
- }
- stock CalculateRepairPrice(vehicleid, option)
- {
- new price = 0, panels, doors, lights, tires, Float:health;
- switch(option)
- {
- case 1:
- {
- GetVehicleHealth(vehicleid, health);
- price = (50 + floatround(1000 - health));
- }
- case 2:
- {
- GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
- new
- spoiler = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_SPOILER),
- hood = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_HOOD),
- roof = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_ROOF),
- lamps = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_LAMPS),
- exhaust = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_EXHAUST),
- wheels = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_WHEELS),
- fbumper = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_FRONT_BUMPER),
- rbumper = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_REAR_BUMPER),
- rvent = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_VENT_RIGHT),
- lvent = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_VENT_LEFT);
- //vehicle damage
- if(panels > 0)
- {
- price += 150;
- if(spoiler >= 1000) price += 500;
- if(hood >= 1000) price += 300;
- if(roof >= 1000) price += 500;
- if(exhaust>= 1000) price += 200;
- }
- if(doors > 0)
- {
- price += 125;
- if(rvent >= 1000) price += 500;
- if(lvent >= 1000) price += 500;
- }
- if(lights > 0)
- {
- price += 75;
- if(lamps>= 1000) price += 150;
- if(fbumper >= 1000) price += 500;
- if(rbumper >= 1000) price += 500;
- }
- if(tires > 0)
- {
- price += 100;
- if(wheels >= 1000) price += 200;
- }
- }
- case 3:
- {
- GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
- if(tires == 0) price = 0;
- else
- {
- new wheel = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_WHEELS);
- price = 75;
- if(wheel >= 1000) price += 200;
- }
- }
- case 4:
- {
- GetVehicleHealth(vehicleid, health);
- price = (50 + floatround(1000 - health));
- GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
- new
- spoiler = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_SPOILER),
- hood = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_HOOD),
- roof = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_ROOF),
- lamps = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_LAMPS),
- exhaust = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_EXHAUST),
- wheels = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_WHEELS),
- fbumper = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_FRONT_BUMPER),
- rbumper = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_REAR_BUMPER),
- rvent = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_VENT_RIGHT),
- lvent = GetVehicleComponentInSlot(vehicleid, CARMODTYPE_VENT_LEFT);
- //vehicle damage
- if(panels > 0)
- {
- price += 150;
- if(spoiler >= 1000) price += 500;
- if(hood >= 1000) price += 300;
- if(roof >= 1000) price += 500;
- if(exhaust>= 1000) price += 200;
- }
- if(doors > 0)
- {
- price += 125;
- if(rvent >= 1000) price += 500;
- if(lvent >= 1000) price += 500;
- }
- if(lights > 0)
- {
- price += 75;
- if(lamps>= 1000) price += 150;
- if(fbumper >= 1000) price += 500;
- if(rbumper >= 1000) price += 500;
- }
- if(tires > 0)
- {
- price += 100;
- if(wheels >= 1000) price += 200;
- }
- }
- case 5: price = 50;
- }
- return price;
- }
- stock HotwireCar(playerid, VehID)
- {
- Hotwiring[playerid][0] = 1;
- Hotwiring[playerid][1] = VehID;
- if(VehicleData[VehID][IdVehicle] == VehID)
- {
- VehicleData[VehID][HotwireTime] = gettime() + 1800;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET HotwireExpiration = %i WHERE id = %i", VehicleData[VehID][HotwireTime], VehicleData[VehID][VehSQLID]);
- mysql_pquery(conn, mquery);
- VehicleData[VehID][Hotwired] = 1;
- }
- SetPlayerChatBubble(playerid, "* Reaches under the steering column and rips open a panel using a screwdriver... *", COLOR_EMOTE, 15.0, 6000);
- SendClientMessage(playerid, COLOR_EMOTE, "* You reach under the steering column and rip open a panel using a screwdriver revealing wiring... *");
- ShowInfoText(playerid,"~r~hotwiring...",4000);
- return true;
- }
- stock SavePlayerVehicles(playerid, num)
- {
- new savestring[3072];
- for(new l = 1, x = GetVehiclePoolSize(); l <= x; l++)
- {
- if(VehicleData[l][VehicleOwnerSQLID] == SQLID[playerid] && SQLID[playerid] > 0 && VehicleData[l][Hotwired] == 0)
- {
- if(!VehicleData[l][Impounded] && !VehicleData[l][NeedsRecovery] && VehicleData[l][GarageRepairID] == 0)
- {
- if(VehicleData[l][ForSale] && num == 1)
- {
- VehicleData[l][ForSale] = false;
- VehicleData[l][ForSalePrice] = 0;
- DestroyDynamic3DTextLabel(VehicleData[l][ForSaleLabel]);
- VehicleData[l][ForSaleLabel] = Text3D:INVALID_3DTEXT_ID;
- }
- }
- new Float:health, panels, doors, lights, tires;
- GetVehicleHealth(l, health);
- GetVehicleDamageStatus(l, panels, doors, lights, tires);
- if(health < 250) health = 250;
- mysql_format(conn, savestring, sizeof(savestring), "UPDATE vehicles SET Fuel = %f, Mileage = %.2f, LastOilMileage = %.2f, IsLocked = %i, Price = %i, Color1 = %i, Color2 = %i, ImpoundTime = %i",
- Fuel[l], VehicleData[l][Mileage], VehicleData[l][LastOilMileage], Locked{l}, VehicleData[l][VehiclePrice], VehicleData[l][vColor1], VehicleData[l][vColor2], VehicleData[l][ImpoundTime]);
- mysql_format(conn, savestring, sizeof(savestring), "%s, TicketAmount = %i, VWorld = %i, TrunkCash = %i, TrunkWeed = %i, TrunkCocaine = %i, TrunkMoonShine = %i, TrunkPhone = %i, VehiclePaintjob = %i",
- savestring, VehicleData[l][TicketAmount], VehicleData[l][VirtualWorld], VehicleData[l][TrunkCash], VehicleData[l][TrunkWeed], VehicleData[l][TrunkCocaine], VehicleData[l][TrunkMoonShine], VehicleData[l][TrunkPhone], VehicleData[l][VehiclePaintjob]);
- mysql_format(conn, savestring, sizeof(savestring), "%s, ForSale = %i, ForSalePrice = %i, DamageHealth = %.2f, DamagePanels = %i, DamageDoors = %i, DamageLights = %i, DamageTires = %i, NeedsRecovery = %i",
- savestring, VehicleData[l][ForSale], VehicleData[l][ForSalePrice], health, panels, doors, lights, tires, VehicleData[l][NeedsRecovery]);
- mysql_format(conn, savestring, sizeof(savestring), "%s, Mod1 = %i, Mod2 = %i, Mod3 = %i, Mod4 = %i, Mod5 = %i, Mod6 = %i, Mod7 = %i, Mod8 = %i, Mod9 = %i, Mod10 = %i, Mod11 = %i, Mod12 = %i, Mod13 = %i, Mod14 = %i WHERE id = %i",
- savestring, VehicleData[l][VehicleMod][0], VehicleData[l][VehicleMod][1], VehicleData[l][VehicleMod][2], VehicleData[l][VehicleMod][3], VehicleData[l][VehicleMod][4], VehicleData[l][VehicleMod][5], VehicleData[l][VehicleMod][6], VehicleData[l][VehicleMod][7], VehicleData[l][VehicleMod][8], VehicleData[l][VehicleMod][9], VehicleData[l][VehicleMod][10], VehicleData[l][VehicleMod][11], VehicleData[l][VehicleMod][12], VehicleData[l][VehicleMod][13], VehicleData[l][VehSQLID]);
- mysql_pquery(conn, savestring);
- if(num == 1)
- {
- DestroyVehicleEx(l, "l");
- ClearVehicleData(l);
- }
- }
- }
- return true;
- }
- stock ToggleVehicleEngine(vehicleid, toggle)
- {
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(vehicleid, toggle, lights, alarm, doors, bonnet, boot, objective);
- return true;
- }
- stock ToggleVehicleLights(vehicleid, toggle)
- {
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(vehicleid, engine, toggle, alarm, doors, bonnet, boot, objective);
- return true;
- }
- stock ToggleVehicleTrunk(vehicleid, toggle)
- {
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, toggle, objective);
- return true;
- }
- stock ToggleVehicleBonnet(vehicleid, toggle)
- {
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, toggle, boot, objective);
- return true;
- }
- stock ToggleVehicleLock(vehicleid, toggle)
- {
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(vehicleid, engine, lights, alarm, toggle, bonnet, boot, objective);
- return true;
- }
- stock IsTrailer(vehicleid)
- {
- new ModelID = GetVehicleModel(vehicleid);
- if(ModelID == 435) return true; //trailer 1
- if(ModelID == 450) return true; //trailer 2
- if(ModelID == 591) return true; //trailer 3
- return false;
- }
- stock IsBoat(vehicleid)
- {
- new ModelID = GetVehicleModel(vehicleid);
- new vehModelArray[10] = {472,473,493,595,484,430,453,452,446,454};
- for(new v = 0; v < 10; v++)
- {
- if(ModelID == vehModelArray[v]) return true;
- }
- return false;
- }
- stock IsBike(vehicleid)
- {
- new ModelID = GetVehicleModel(vehicleid);
- new vehModelArray[14] = {581,509,481,462,521,463,510,522,461,448,471,468,586,523};
- for(new v = 0; v < sizeof(vehModelArray); v++)
- {
- if(ModelID == vehModelArray[v]) return true;
- }
- return false;
- }
- stock IsPushBike(vehicleid)
- {
- new ModelID = GetVehicleModel(vehicleid);
- if(ModelID == 509 || ModelID == 481 || ModelID == 510) return true;
- else return false;
- }
- stock IsHelicopter(vehicleid)
- {
- new ModelID = GetVehicleModel(vehicleid);
- new vehModelArray[9] = {548,425,417,487,488,497,563,447,469};
- for(new v = 0; v < 9; v++)
- {
- if(ModelID == vehModelArray[v]) return true;
- }
- return false;
- }
- stock IsPlane(vehicleid)
- {
- new ModelID = GetVehicleModel(vehicleid);
- new vehModelArray[11] = {592,577,511,512,593,520,553,476,519,460,513};
- for(new v = 0; v < 11; v++)
- {
- if(ModelID == vehModelArray[v]) return true;
- }
- return false;
- }
- stock IsLargeVeh(vehicleid)
- {
- new ModelID = GetVehicleModel(vehicleid);
- new vehModelArray[28] = {499, 498, 609, 524, 578, 455, 403, 414, 443, 514, 515, 408, 556, 573, 556, 557, 444, 433, 431, 437, 427, 407, 544, 432, 406, 428, 486, 532};
- for(new v = 0; v < 28; v++)
- {
- if(ModelID == vehModelArray[v]) return true;
- }
- return false;
- }
- stock IsCopCar(vehicleid)
- {
- new ModelID = GetVehicleModel(vehicleid);
- if(ModelID == 599 || ModelID == 598 || ModelID == 427 || ModelID == 528 || ModelID == 596 || ModelID == 597 || ModelID == 497 || ModelID == 523) return true;
- return false;
- }
- stock IsFireCar(vehicleid)
- {
- new ModelID = GetVehicleModel(vehicleid);
- if(ModelID == 407 || ModelID == 544 || ModelID == 490) return true;
- return false;
- }
- stock IsDumper(vehicleid)
- {
- if(vehicleid == Dumper1 || vehicleid == Dumper2) return true;
- return false;
- }
- stock IsCop(playerid)
- {
- if(Faction[playerid] == FACTION_COP) return true;
- else return false;
- }
- stock IsBus(vehicleid)
- {
- new ModelID = GetVehicleModel(vehicleid);
- if(ModelID == 431) return true;
- return false;
- }
- stock IsPizzaCar(vehicleid)
- {
- if(vehicleid == PizzaCar1 || vehicleid == PizzaCar2) return true;
- return false;
- }
- stock IsEmsCar(vehicleid)
- {
- new ModelID = GetVehicleModel(vehicleid);
- if(ModelID == 416 || ModelID == 490) return true;
- return false;
- }
- stock IsTowingVehicle(vehicleid)
- {
- new ModelID = GetVehicleModel(vehicleid);
- if(ModelID == 525 || ModelID == 531) return true;
- return false;
- }
- stock IsTruck(vehicleid)
- {
- new ModelID = GetVehicleModel(vehicleid);
- if(ModelID == 403 || ModelID == 514 || ModelID == 515) return true;
- return false;
- }
- stock IsOwnedCar(vehicleid)
- {
- if(vehicleid != INVALID_VEHICLE_ID && VehicleData[vehicleid][VehSQLID] >= 1) return true;
- return false;
- }
- stock IsFactionCar(vehicleid)
- {
- if(vehicleid != INVALID_VEHICLE_ID && FVehicleData[vehicleid][FVSQLID] >= 1) return true;
- return false;
- }
- stock IsServerCar(vehicleid)
- {
- if(IsRentalCar(vehicleid)) return false;
- if(IsOwnedCar(vehicleid)) return false;
- if(IsFactionCar(vehicleid)) return false;
- if(aspawned{vehicleid}) return false;
- if(vehicleid == PizzaCar1 || vehicleid == PizzaCar2 || vehicleid == Dumper1 || vehicleid == Dumper2 || vehicleid == MaintTruck1 || vehicleid == MaintTruck2) return true;
- return true;
- }
- stock GetVehicleName(vehicleid)
- {
- new vehname[20];
- if(GetVehicleModel(vehicleid) != 0) format(vehname, 20, VehicleNames[GetVehicleModel(vehicleid) - 400]);
- return vehname;
- }
- stock GetVehicleNameEx(modelid)
- {
- new vehname[20];
- if(modelid >= 400 && modelid <= 611) format(vehname, 20, VehicleNames[modelid - 400]);
- return vehname;
- }
- stock VehicleHasWindows(vehicleid)
- {
- new model = GetVehicleModel(vehicleid);
- if(model == 0) return 0;
- return CoreVehicleData[model-400][vdata_windows];
- }
- stock GetVehicleSeatCount(vehicleid)
- {
- new model = GetVehicleModel(vehicleid);
- if(model == 0) return 0;
- return CoreVehicleData[model-400][vdata_seatcount];
- }
- stock VehicleHasEngine(vehicleid)
- {
- new model = GetVehicleModel(vehicleid);
- if(model == 0) return 0;
- new value = CoreVehicleData[model-400][vdata_fueltype];
- if(value == FUEL_NONE) return false;
- return true;
- }
- stock VehicleHasTrunk(vehicleid)
- {
- new model = GetVehicleModel(vehicleid);
- if(model == 0) return 0;
- new value = CoreVehicleData[model-400][vdata_trunklimit];
- if(value == 0) return false;
- return true;
- }
- stock GetVehicleFuelType(vehicleid)
- {
- new model = GetVehicleModel(vehicleid);
- if(model == 0) return 0;
- return CoreVehicleData[model-400][vdata_fueltype];
- }
- stock GetVehicleTrunkLimit(vehicleid)
- {
- new model = GetVehicleModel(vehicleid);
- if(model == 0) return 0;
- return CoreVehicleData[model-400][vdata_trunklimit];
- }
- stock GetVehicleAvailableSeat(vehicleid)
- {
- new seats = GetVehicleSeatCount(vehicleid);
- for(new i = 0; i < seats; i ++)
- {
- if(!IsVehicleSeatUsed(vehicleid, i)) return i;
- }
- return false;
- }
- stock GetDefaultWeaponAmmo(weaponid)
- {
- new wdef;
- if(weaponid == 22) wdef = 85; //colt 45
- else if(weaponid == 24) wdef = 70; //deagle
- else if(weaponid == 23) wdef = 85; //silenced
- else if(weaponid == 25) wdef = 50; //shotgun
- else if(weaponid == 26) wdef = 50; //sawed off
- else if(weaponid == 27) wdef = 70; //spas 12
- else if(weaponid == 28) wdef = 200; //uzi
- else if(weaponid == 32) wdef = 200; //tec
- else if(weaponid == 29) wdef = 150; //mp5
- else if(weaponid == 30) wdef = 150; //ak
- else if(weaponid == 31) wdef = 200; //m4
- else if(weaponid == 33) wdef = 50; //rifle
- else if(weaponid == 34) wdef = 50; //sniper
- else if(weaponid == 18) wdef = 5; //molotov
- else if(weaponid == 41) wdef = 5000; //spraycan
- else if(weaponid == 42) wdef = 5000; //fire ext
- else wdef = 50;
- return wdef;
- }
- stock IsVehicleSeatUsed(vehicleid, seat)
- {
- foreach(new i: Player)
- {
- if(IsPlayerInVehicle(i, vehicleid) && GetPlayerVehicleSeat(i) == seat)
- {
- return true;
- }
- }
- return false;
- }
- stock GetVehiclePetrolCapPos(vehiclemodel, &Float:posX, &Float:posY)
- {
- for(new i = 0; i < sizeof(VehiclePetrolCapPos); i++)
- {
- if(floatround(VehiclePetrolCapPos[i][0]) == vehiclemodel)
- {
- posX = VehiclePetrolCapPos[i][1];
- posY = VehiclePetrolCapPos[i][2];
- break;
- }
- }
- return true;
- }
- stock GetWeaponSlot(weaponid)
- {
- new Slot = 0;
- switch(weaponid)
- {
- case 0, 1: Slot = 0;
- case 2, 3, 4, 5, 6, 7, 8, 9: Slot = 1;
- case 22, 23, 24: Slot = 2;
- case 25, 26, 27: Slot = 3;
- case 28, 29, 32: Slot = 4;
- case 30, 31: Slot = 5;
- case 33, 34: Slot = 6;
- case 35, 36, 37, 38: Slot = 7;
- case 16, 17, 18, 39: Slot = 8;
- case 41, 42, 43: Slot = 9;
- case 10, 11, 12, 13, 14, 15: Slot = 10;
- case 44, 45, 46: Slot = 11;
- case 40: Slot = 12;
- default: Slot = 0;
- }
- return Slot;
- }
- stock GetWeaponType(weaponid)
- {
- //weapon type 0 = sidearm, weapon type 1 primary weapon
- new type = 0;
- switch(weaponid)
- {
- case 22,23,24,28,32: type = 1; //9mm Pistol
- case 25,26,27,29,30,31,33,34: type = 2;
- }
- return type;
- }
- stock GetVehicleEnginePos(vehiclemodel, &Float:posY)
- {
- for(new i = 0; i < sizeof(VehicleEnginePos); i++)
- {
- if(floatround(VehicleEnginePos[i][0]) == vehiclemodel)
- {
- posY = VehicleEnginePos[i][1];
- break;
- }
- }
- return true;
- }
- stock GetVehicleLockStatus(vehicleid)
- {
- new str[12];
- if(Locked{vehicleid}) str = "Locked";
- else str = "Unlocked";
- return str;
- }
- stock GetNewRegPlate()
- {
- new plate[MAX_REG_PLATE];
- new chars[26][] = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
- new nums[9][] = {"1","2","3","4","5","6","7","8","9"};
- strcat(plate, chars[random(sizeof(chars))]);
- strcat(plate, chars[random(sizeof(chars))]);
- strcat(plate, nums[random(sizeof(nums))]);
- strcat(plate, nums[random(sizeof(nums))]);
- strcat(plate, chars[random(sizeof(chars))]);
- strcat(plate, nums[random(sizeof(nums))]);
- strcat(plate, chars[random(sizeof(chars))]);
- do
- {
- strcat(plate, chars[random(sizeof(chars))]);
- strcat(plate, chars[random(sizeof(chars))]);
- strcat(plate, nums[random(sizeof(nums))]);
- strcat(plate, nums[random(sizeof(nums))]);
- strcat(plate, chars[random(sizeof(chars))]);
- strcat(plate, nums[random(sizeof(nums))]);
- strcat(plate, chars[random(sizeof(chars))]);
- }
- while(IsRegPlateUsed(plate));
- return plate;
- }
- stock IsRegPlateUsed(plate[])
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM vehicles WHERE RegPlate='%e' LIMIT 1", plate);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() == 0)
- {
- cache_delete(result);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM fveh WHERE RegPlate='%e' LIMIT 1", plate);
- new Cache:result2 = mysql_query(conn, mquery);
- if(cache_num_rows() == 0)
- {
- cache_delete(result2);
- for(new i = 0; i < MAX_SERVER_CARS; i++)
- {
- if(strmatch(RandomDriverData[i][1], plate))
- {
- return true;
- }
- }
- return false;
- }
- }
- return true;
- }
- stock IsVehicleSpawned(vehicleid)
- {
- new Float:VX, Float:VY, Float:VZ;
- GetVehiclePos(vehicleid, VX, VY, VZ);
- if(VX == 0.0 && VY == 0.0 && VZ == 0.0) return false;
- return true;
- }
- stock VehicleHasDriver(vehicleid)
- {
- foreach(new i: Player)
- {
- if(GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER) return true;
- }
- return false;
- }
- stock VehicleIsOccupied(vehicleid)
- {
- foreach(new i: Player)
- {
- if(GetPlayerVehicleID(i) == vehicleid) return true;
- }
- return false;
- }
- stock VehicleBeingTowed(vehicleid)
- {
- for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(GetVehicleTrailer(v) == vehicleid) return true;
- }
- return false;
- }/*
- stock UpdateFuelText(vehicleid, FuelStr[])
- {
- new fuelbars[30];
- switch(floatround(Fuel[vehicleid]))
- {
- case 0: fuelbars = "~l~I~r~IIIIIIIIII~l~I";
- case 1..10: fuelbars = "~l~I~r~I~w~IIIIIIIII~l~I";
- case 11..20: fuelbars = "~l~I~w~I~r~I~w~IIIIIIII~l~I";
- case 21..30: fuelbars = "~l~I~w~II~r~I~w~IIIIIII~l~I";
- case 31..40: fuelbars = "~l~I~w~III~r~I~w~IIIIII~l~I";
- case 41..50: fuelbars = "~l~I~w~IIII~r~I~w~IIIII~l~I";
- case 51..60: fuelbars = "~l~I~w~IIIII~r~I~w~IIII~l~I";
- case 61..70: fuelbars = "~l~I~w~IIIIII~r~I~w~III~l~I";
- case 71..80: fuelbars = "~l~I~w~IIIIIII~r~I~w~II~l~I";
- case 81..90: fuelbars = "~l~I~w~IIIIIIII~r~I~w~I~l~I";
- case 91..100: fuelbars = "~l~I~w~IIIIIIIII~r~I~l~I";
- }
-
- format(FuelStr, 40, "~g~GAS %s", fuelbars);
- return true;
- }*/
- stock GetVehicleModelIdFromName(vehname[])
- {
- for(new i = 0; i < 211; i++)
- {
- if(strfind(VehicleNames[i], vehname, true) != -1) return i + 400;
- }
- return -1;
- }
- stock GetOwnedVehicleCount()
- {
- new TotalCars = 0;
- for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(VehicleData[v][VehicleOwnerSQLID] > 0) TotalCars ++;
- }
- return TotalCars;
- }
- stock GetPlayerOwnedVehicleCount(playerid)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT NULL FROM vehicles WHERE OwnerSQLID = %i", SQLID[playerid]);
- new Cache:result = mysql_query(conn, mquery);
- new count = cache_num_rows();
- cache_delete(result);
- return count;
- }
- stock GetPlayerVehicleCount(playerid)
- {
- new count;
- for(new x = 0; x < MAX_VEH_PER_PLAYER; x++)
- {
- if(PlayerCars[playerid][x][CarSQLID] != 0) count ++;
- }
- return count;
- }
- stock GetClosestVehicle(playerid)
- {
- if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
- {
- new closestVehicle = 0;
- new Float:closestDist;
- new Float:x1,Float:y1,Float:z1;
- GetVehiclePos(1,x1,y1,z1);
- closestDist = GetPlayerDistanceFromPoint(playerid, x1, y1, z1);
- new Float:vx,Float:vy,Float:vz;
- GetVehiclePos(1,vx,vy,vz);
- new Float:px,Float:py,Float:pz;
- GetPlayerPos(playerid,px,py,pz);
- closestDist = DistanceBetweenPoints(vx, vy, vz, px, py, pz);
- for(new vehicleid = 1, x = GetVehiclePoolSize(); vehicleid <= x; vehicleid++)
- {
- new Float:tmpDist;
- GetVehiclePos(vehicleid,x1,y1,z1);
- tmpDist = GetPlayerDistanceFromPoint(playerid, x1, y1, z1);
- if(tmpDist < closestDist && GetVehicleVirtualWorld(vehicleid) == GetPlayerVirtualWorld(playerid))
- {
- closestDist = tmpDist;
- closestVehicle = vehicleid;
- }
- }
- return closestVehicle;
- }
- return 0;
- }
- stock MySQLCreateVehicleEntry(playerid, Float:X, Float:Y, Float:Z, Float:Ang, price, model, c1, c2, ownersqlid, donator, reg[])
- {
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO vehicles (Price,VehicleModel,RegPlate,LastX,LastY,LastZ,LastRot,IsLocked,Color1,Color2,OwnerSQLID,DonatorCar,DamageHealth,Fuel) VALUES (%i,%i,'%e',%f,%f,%f,%f,%i,%i,%i,%i,%i,1000.0,100.0)", price, model, reg, X, Y, Z, Ang, 0, c1, c2, ownersqlid, donator);
- mysql_pquery(conn, mquery, "CreateVehicleEntry", "ii", playerid, price);
- return true;
- }
- stock MySQLCheckVehicle(Model, Price, reg[])
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM vehicles WHERE Price = %i AND VehicleModel = %i AND RegPlate = '%e' ORDER BY id DESC LIMIT 1", Price, Model, reg);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows() == 0)
- {
- cache_delete(result);
- return false;
- }
- else
- {
- new VehicleID;
- VehicleID = cache_get_field_content_int(0, "id");
- cache_delete(result);
- return VehicleID;
- }
- }
- stock MySQLCheckVehicleArmor(vehicleid)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM storedarmor WHERE TrunkID = %i", vehicleid);
- new Cache:result = mysql_query(conn, mquery);
- new count = cache_num_rows();
- cache_delete(result);
- if(count >= 5) return false;
- return true;
- }
- stock MySQLCheckFVehArmor(vehicleid)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM storedarmor WHERE FCarID = %i", vehicleid);
- new Cache:result = mysql_query(conn, mquery);
- new count = cache_num_rows();
- cache_delete(result);
- if(count >= 5) return false;
- return true;
- }
- stock ClearVehicleData(v)
- {
- //personal car data
- VehicleData[v][VehSQLID] = 0;
- VehicleData[v][VehicleModel] = 0;
- VehicleData[v][VehicleOwnerSQLID] = 0;
- VehicleData[v][LastX] = 0.0;
- VehicleData[v][LastY] = 0.0;
- VehicleData[v][LastZ] = 0.0;
- VehicleData[v][LastRot] = 0.0;
- VehicleData[v][RegPlate][0] = 0;
- VehicleData[v][FuelRemaining] = 0.0;
- VehicleData[v][Mileage] = 0.0;
- VehicleData[v][LastOilMileage] = 0.0;
- VehicleData[v][VehiclePrice] = 0;
- VehicleData[v][vColor1] = 0;
- VehicleData[v][vColor2] = 0;
- VehicleData[v][ImpoundTime] = 0;
- VehicleData[v][ImpoundedBy] = 0;
- VehicleData[v][ImpoundFee] = 0;
- VehicleData[v][Impounded] = false;
- VehicleData[v][ImpoundReason][0] = 0;
- VehicleData[v][TicketAmount] = 0;
- VehicleData[v][VirtualWorld] = 0;
- VehicleData[v][DonatorCar] = false;
- VehicleData[v][TrunkCash] = 0;
- VehicleData[v][TrunkWeed] = 0;
- VehicleData[v][TrunkCocaine] = 0;
- VehicleData[v][TrunkMoonShine] = 0;
- VehicleData[v][ForSale] = false;
- VehicleData[v][ForSalePrice] = 0;
- VehicleData[v][NeedsRecovery] = false;
- VehicleData[v][GarageRepairID] = 0;
- VehicleData[v][GarageCollectTime] = 0;
- VehicleData[v][Hotwired] = 0;
- VehicleData[v][HotwireTime] = 0;
- VehicleData[v][PlateToggle] = false;
- VehicleData[v][IdVehicle] = 0;
- if(VehicleData[v][ForSaleLabel] != Text3D:INVALID_3DTEXT_ID) DestroyDynamic3DTextLabel(VehicleData[v][ForSaleLabel]);
- VehicleData[v][ForSaleLabel] = Text3D:INVALID_3DTEXT_ID;
- for(new z = 0; z < 14; z++) VehicleData[v][VehicleMod][z] = 0;
- //faction car data
- FVehicleData[v][FVSQLID] = 0;
- FVehicleData[v][FVModel] = 0;
- FVehicleData[v][FVCol1] = 0;
- FVehicleData[v][FVCol2] = 0;
- FVehicleData[v][FVFaction] = 0;
- FVehicleData[v][FVMinRank] = 0;
- FVehicleData[v][LocationX] = 0.0;
- FVehicleData[v][LocationY] = 0.0;
- FVehicleData[v][LocationZ] = 0.0;
- FVehicleData[v][LocationR] = 0.0;
- FVehicleData[v][FVInterior] = 0;
- FVehicleData[v][TempFVInterior] = 0;
- FVehicleData[v][FVWorld] = 0;
- FVehicleData[v][FTrunkCash] = 0;
- FVehicleData[v][FTrunkWeed] = 0;
- FVehicleData[v][FTrunkCocaine] = 0;
- FVehicleData[v][FTrunkMoonShine] = 0;
- FVehicleData[v][FVMod][CARMODTYPE_NITRO] = 0;
- FVehicleData[v][FVMod][CARMODTYPE_HYDRAULICS] = 0;
- FVehicleData[v][FImpounded] = false;
- FVehicleData[v][FImpoundTime] = 0;
- FVehicleData[v][FImpoundFee] = 0;
- FVehicleData[v][FImpoundedBy] = 0;
- FVehicleData[v][FImpoundReason][0] = 0;
- FVehicleData[v][FVRegPlate][0] = 0;
- FVehicleData[v][FVGovUnit][0] = 0;
- if(FVehicleData[v][FVGovUnit3DText] != Text3D:INVALID_3DTEXT_ID) DestroyDynamic3DTextLabel(FVehicleData[v][FVGovUnit3DText]);
- FVehicleData[v][FVGovUnit3DText] = Text3D:INVALID_3DTEXT_ID;
- for(new z = 0; z < 14; z++) FVehicleData[v][FVMod][z] = 0;
- //General vehicle variables
- if(VehObject[v] != INVALID_OBJECT_ID) DestroyDynamicObjectEx(VehObject[v], "VehObject[v] 1");
- if(vTaxiSign[v] != INVALID_OBJECT_ID) DestroyDynamicObjectEx(vTaxiSign[v], "vTaxiSign[v]");
- vTaxiSign[v] = INVALID_OBJECT_ID;
- VehObject[v] = INVALID_OBJECT_ID;
- Siren{v} = false;
- SnowPlow{v} = false;
- if(EmergencyLights[v] == 1)
- {
- ELMs{v} = false;
- EmergencyLights[v] = 0;
- }
- aspawned{v} = false;
- DMVCarForPlayer[v] = -1;
- VCPauseTimer[v] = 0;
- Locked{v} = false;
- strdel(vMusicLink[v], 0, 256);
- vMusicPlaying{v} = false;
- }
- stock TrunkXY(playerid, vehicleid)
- {
- new
- Float:x,
- Float:y,
- Float:z,
- Float:sX,
- Float:sY,
- Float:sZ;
- GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, sX, sY, sZ);
- GetVehicleRelativePos(vehicleid, x, y, z, 0.0, (-sY + 1.4) / 2.0);
- return IsPlayerInRangeOfPoint(playerid, 2.0, x, y, z);
- }
- stock GetVehicleSpeed(vehicleid, type)
- {
- new Float:speed_x, Float:speed_y, Float:speed_z, Float:temp_speed, round_speed;
- GetVehicleVelocity(vehicleid, speed_x, speed_y, speed_z);
- if(type == 0) temp_speed = floatsqroot(((speed_x*speed_x) + (speed_y*speed_y)) + (speed_z*speed_z)) * 85.4166672;
- else temp_speed = temp_speed = floatsqroot(((speed_x*speed_x) + (speed_y*speed_y)) + (speed_z*speed_z)) * 136.666667;
- round_speed = floatround(temp_speed);
- return round_speed;
- }
- stock GetNearestVehicle(playerid)
- {
- new Float:x, Float:y, Float:z;
- new Float:dist, Float:closedist=9999, closeveh = INVALID_VEHICLE_ID;
- if(IsPlayerInAnyVehicle(playerid)) return GetPlayerVehicleID(playerid);
- for(new i = 1, v = GetVehiclePoolSize(); i <= v; i++)
- {
- if(GetVehiclePos(i, x, y, z))
- {
- dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
- if(dist < 20)
- {
- if(dist < closedist)
- {
- closedist = dist;
- closeveh = i;
- }
- }
- }
- }
- return closeveh;
- }
- stock FuelDecrease()
- {
- //new FuelStr[42];
- for(new i = 1, x = GetVehiclePoolSize(); i <= x; i++)
- {
- if(IsVehicleSpawned(i) && EngineStatus[i] == 1)
- {
- if(VehicleHasEngine(i) == 1)
- {
- if(Fuel[i] > 0)
- {
- new Float:speed = GetVehicleSpeed(i, 0), Float:div = 46.0;
- speed = floatadd(speed, 0.2);
- speed = floatdiv(speed, div);
- speed = floatadd(speed, 0.3);
- Fuel[i] = floatsub(Fuel[i], speed);
- VehicleData[i][FuelRemaining] = Fuel[i];
- //UpdateFuelText(i, FuelStr);
- foreach(new p: Player)
- {
- if(GetPlayerVehicleID(p) == i && GetPlayerState(p) == PLAYER_STATE_DRIVER)
- {
- switch(Fuel[i])
- {
- case 0,10,20,30,40,50,60,70,80,90: PlayerPlaySound(p, SOUND_FUEL_DECREASE, 0.0, 0.0, 0.0);
- }
- //PlayerTextDrawSetString(p, FuelText[p], FuelStr);
- //PlayerTextDrawShow(p, FuelText[p]);
- if(Fuel[i] < 10) TextDrawShowForPlayer(p, LowFuelText);
- else TextDrawHideForPlayer(p, LowFuelText);
- break;
- }
- }
- }
- else
- {
- EngineStatus[i] = 0;
- ToggleVehicleEngine(i, 0);
- foreach(new p: Player)
- {
- if(GetPlayerVehicleID(p) == i && GetPlayerState(p) == PLAYER_STATE_DRIVER)
- {
- ShowInfoText(p,"~h~~h~No fuel in this vehicle!",2500);
- SendClientMessage(p,COLOR_YELLOW,"This vehicle has no fuel left in the tank");
- TextDrawHideForPlayer(p, LowFuelText);
- if(VehicleData[i][Hotwired] == 1) VehicleData[i][Hotwired] = 0;
- if(DMV_Testing[p] == 1)
- {
- FailDMVTest(p, "Ran out of fuel");
- }
- break;
- }
- }
- }
- }
- else
- {
- Fuel[i] = 100;
- foreach(new p: Player)
- {
- if(GetPlayerVehicleID(p) == i && GetPlayerState(p) == PLAYER_STATE_DRIVER)
- {
- //PlayerTextDrawSetString(p, FuelText[p], "~g~GAS ~w~N/A");
- //PlayerTextDrawShow(p, FuelText[p]);
- break;
- }
- }
- }
- }
- }
- return true;
- }
- stock IsVehicleOccupied(vehicleid)
- {
- foreach(new i: Player)
- {
- if(GetPlayerVehicleID(i) == vehicleid)
- {
- return true;
- }
- }
- return false;
- }
- stock IsStingerVehicle(vehicleid)
- {
- if(IsPlane(vehicleid) || IsHelicopter(vehicleid) || IsBoat(vehicleid)) return false;
- return true;
- }
- stock StartEngine(vehicleid, playerid)
- {
- EngineStatus[vehicleid] = 1;
- ToggleVehicleEngine(vehicleid, 1);
- SendClientMessage(playerid, COLOR_WHITE, "> Engine {4BB74C}Started");
- format(gstr, sizeof(gstr), "* The %s's engine is now on. *", GetVehicleName(vehicleid));
- ProxDetector(15.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- ShowInfoText(playerid, "~g~~n~~n~Engine On", 2000);
- //UpdateFuelText(vehicleid, gstr);
- //PlayerTextDrawSetString(playerid, FuelText[playerid], gstr);
- //PlayerTextDrawShow(playerid, FuelText[playerid]);
- if(SpeedoActive[playerid] == 1) PlayerTextDrawShow(playerid, Speedo3dl[playerid]);
- foreach(new p: Player)
- {
- if(IsSpectating[p] == playerid)
- {
- PlayerTextDrawHide(p, Speedo3dl[playerid]);
- }
- }
- if(Fuel[vehicleid] < 10) TextDrawShowForPlayer(playerid, LowFuelText);
- return true;
- }
- stock encode_tires(tire1, tire2, tire3, tire4)
- {
- return tire1 | (tire2 << 1) | (tire3 << 2) | (tire4 << 3);
- }
- stock encode_tires_bike(rear, front)
- {
- return rear | (front << 1);
- }
- stock encode_lights(light1, light2, light3, light4)
- {
- return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);
- }
- stock RepairVehicleEx(vehicleid)
- {
- format(gstr, sizeof(gstr), "[%s] Vehicle ID %i (%s) has been fully repaired.", GetServerTimeString(), vehicleid, GetVehicleName(vehicleid));
- RepairVehicle(vehicleid);
- SetVehicleHealthEx(vehicleid, 1000);
- return true;
- }
- stock SetVehicleHealthEx(vehicleid, Float:VehicleHealth)
- {
- format(gstr, sizeof(gstr), "[%s] Vehicle ID %i (%s) has been set to %.1f HP.", GetServerTimeString(), vehicleid, GetVehicleName(vehicleid), VehicleHealth);
- SetVehicleHealth(vehicleid, VehicleHealth);
- return true;
- }
- stock CreateVehicleEx(model, Float:x, Float:y, Float:z, Float:a, col1, col2, r_delay, numberplate[] = "", siren = 0)
- {
- new id = CreateVehicle(model, x, y, z, a, col1, col2, r_delay, siren), regplate[32];
- if(col1 != -1) CarColor[id][0] = col1;
- if(col2 != -1) CarColor[id][1] = col2;
- if(strlen(numberplate) == 0)
- {
- format(regplate, sizeof(regplate), "GSRP%i", id);
- SetVehicleNumberPlate(id, regplate);
- }
- else SetVehicleNumberPlate(id, numberplate);
- VehicleSpawnedBy[id][0] = 0;
- VehicleSpawnedBy[id][1] = gettime();
- SetVehicleToRespawnEx(id);
- return id;
- }
- stock CreateLockedVehicle(model, Float:x, Float:y, Float:z, Float:rz, col1, col2, respawn_delay)
- {
- new vid = CreateVehicleEx(model, x, y, z, rz, col1, col2, respawn_delay);
- Locked{vid} = true;
- ToggleVehicleLock(vid, 1);
- new regplate[32];
- format(regplate, sizeof(regplate), "GSRP%i", vid);
- SetVehicleNumberPlate(vid, regplate);
- return vid;
- }
- stock ChangeVehicleColorEx(vehicleid, color1, color2)
- {
- ChangeVehicleColor(vehicleid, color1, color2);
- if(CarColor[vehicleid][0] != color1) CarColor[vehicleid][0] = color1;
- if(CarColor[vehicleid][1] != color2) CarColor[vehicleid][1] = color2;
- return true;
- }
- stock GetVehicleColors(vehicleid, &color1, &color2)
- {
- color1 = CarColor[vehicleid][0];
- color2 = CarColor[vehicleid][1];
- return true;
- }
- stock ProcessVehicleShopPurchase(vehicleid, price, model, playerid, donator=0)
- {
- new Float:X, Float:Y, Float:Z, Float:A;
- new colors[5] = {1, 3, 79, 44, 8};
- GetVehiclePos(vehicleid, X, Y, Z);
- GetVehicleZAngle(vehicleid, A);
- new color = colors[random(sizeof(colors))];
- new regplate[MAX_REG_PLATE];
- format(regplate, MAX_REG_PLATE, GetNewRegPlate());
- DestroyVehicleEx(vehicleid, "vehicleid 1");
- ClearVehicleData(vehicleid);
- MySQLCreateVehicleEntry(playerid, X, Y, Z, A, price, model, color, color, SQLID[playerid], donator, regplate);
- GivePlayerCash(playerid, -price);
- SetPlayerVirtualWorldEx(playerid, 0);
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllable(playerid, 1);
- UnlockAchievement(playerid, 58);
- return true;
- }
- stock GetRepairGarageName(garageid)
- {
- new garage[24];
- switch(garageid)
- {
- case 0: garage = "Unknown";
- case 1: garage = "Palomino Creek Garage";
- case 2: garage = "Dillimore Garage";
- case 3: garage = "Fort Carson Garage";
- case 4: garage = "El Quebrados Garage";
- case 5: garage = "Verdant Meadows Garage";
- case 6: garage = "Bayside Marina";
- case 7: garage = "Angel Pine Garage";
- }
- return garage;
- }
- stock ApplyTrunkAnimation(playerid)
- {
- if(IsPlayerInAnyVehicle(playerid)) return true;
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK) OnePlayAnim(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
- else OnePlayAnim(playerid, "BD_FIRE", "wash_up", 4.0, 0, 0, 0, 0, 0);
- return true;
- }
- GREENSIDE::ShowPlayerWeaponSelectionDialog(playerid, factionID)
- {
- if(gettime() <= FACTIONS[factionID][FactionWeaponTime])
- {
- new time = (FACTIONS[factionID][FactionWeaponTime] - gettime()) / 60;
- SendClientMessageF(playerid, COLOR_WHITE, "(([Weapon Run] You have to wait %i minute(s) untill you can use this feature again.))", time);
- HangupPhone(playerid);
- }
- else
- {
- PlayerPlaySound(playerid, 3600, 0, 0, 0);
- Dialog_Show(playerid, CrateSelection, DIALOG_STYLE_LIST, "The call is answered...", "Order Weapons\nCancel", "Submit", "Cancel");
- SendClientMessage(playerid, COLOR_WHITE, "YOU WILL NOT BE ABLE TO START ANOTHER WEAPON RUN FOR THREE HOURS IF YOU CLOSE THIS DIALOG.");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE factions SET WeaponTime = %i WHERE id = %i", gettime() + 10800, factionID);
- mysql_pquery(conn, mquery);
- FACTIONS[factionID][FactionWeaponTime] = gettime() + 10800;
- }
- return true;
- }
- GREENSIDE::LoadPlayerWeapons(playerid)
- {
- new slot, wep;
- for(new i, x = cache_num_rows(); i < x; i++)
- {
- wep = cache_get_field_content_int(i, "WeaponID");
- slot = GetWeaponSlot(wep);
- WeaponData[playerid][slot][WeaponID] = cache_get_field_content_int(i, "id");
- WeaponData[playerid][slot][Weapon] = wep;
- WeaponData[playerid][slot][WeaponAmmo] = cache_get_field_content_int(i, "WeaponAmmo");
- WeaponData[playerid][slot][WeaponPossession] = cache_get_field_content_int(i, "WeaponPossession");
- WeaponData[playerid][slot][wCreatorSQLID] = cache_get_field_content_int(i, "CreatorSQLID");
- WeaponData[playerid][slot][wOwnerSQLID] = cache_get_field_content_int(i, "OwnerSQLID");
- WeaponData[playerid][slot][WeaponType] = GetWeaponType(WeaponData[playerid][slot][Weapon]);
- WeaponData[playerid][slot][WeaponOrigin] = cache_get_field_content_int(i, "WeaponOrigin");
- WeaponData[playerid][slot][WeaponTimestamp] = cache_get_field_content_int(i, "Timestamp");
- GivePlayerWeapon(playerid, WeaponData[playerid][slot][Weapon], WeaponData[playerid][slot][WeaponAmmo]);
- }
- return true;
- }
- GREENSIDE::SendErrorCallMessage(playerid)
- {
- TurnOffCall(playerid)=phones;
- return 1;
- }
- GREENSIDE::CreateVehicleEntry(playerid, price)
- {
- new id = cache_insert_id();
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM vehicles WHERE id = %i", id);
- mysql_pquery(conn, mquery, "LoadPurchaseVehicle", "ii", playerid, price);
- return true;
- }
- GREENSIDE::LoadGarageVehicle(playerid, v)
- {
- if(cache_num_rows())
- {
- new vidx = CreateVehicle(411, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0), Float:health, tires, panels, lights, doors, fishc;
- ClearVehicleData(vidx);
- VehicleData[vidx][VehSQLID] = cache_get_field_content_int(0, "id");
- VehicleData[vidx][VehicleModel] = cache_get_field_content_int(0, "VehicleModel");
- VehicleData[vidx][VehicleOwnerSQLID] = cache_get_field_content_int(0, "OwnerSQLID");
- VehicleData[vidx][LastX] = cache_get_field_content_float(0, "LastX");
- VehicleData[vidx][LastY] = cache_get_field_content_float(0, "LastY");
- VehicleData[vidx][LastZ] = cache_get_field_content_float(0, "LastZ");
- VehicleData[vidx][LastRot] = cache_get_field_content_float(0, "LastRot");
- cache_get_field_content(0, "RegPlate", VehicleData[vidx][RegPlate], conn, MAX_REG_PLATE);
- VehicleData[vidx][FuelRemaining] = cache_get_field_content_float(0, "Fuel");
- VehicleData[vidx][Mileage] = cache_get_field_content_float(0, "Mileage");
- VehicleData[vidx][LastOilMileage] = cache_get_field_content_float(0, "LastOilMileage");
- Locked{vidx} = bool:cache_get_field_content_int(0, "IsLocked");
- VehicleData[vidx][VehiclePrice] = cache_get_field_content_int(0, "Price");
- VehicleData[vidx][vColor1] = cache_get_field_content_int(0, "Color1");
- VehicleData[vidx][vColor2] = cache_get_field_content_int(0, "Color2");
- VehicleData[vidx][TicketAmount] = cache_get_field_content_int(0, "TicketAmount");
- VehicleData[vidx][VirtualWorld] = cache_get_field_content_int(0, "VWorld");
- VehicleData[vidx][DonatorCar] = bool:cache_get_field_content_int(0, "DonatorCar");
- VehicleData[vidx][TrunkCash] = cache_get_field_content_int(0, "TrunkCash");
- VehicleData[vidx][TrunkWeed] = cache_get_field_content_int(0, "TrunkWeed");
- VehicleData[vidx][TrunkCocaine] = cache_get_field_content_int(0, "TrunkCocaine");
- VehicleData[vidx][TrunkMoonShine] = cache_get_field_content_int(0, "TrunkMoonShine");
- VehicleData[vidx][TrunkPhone] = cache_get_field_content_int(0, "TrunkPhone");
- VehicleData[vidx][ForSale] = bool:cache_get_field_content_int(0, "ForSale");
- VehicleData[vidx][ForSalePrice] = cache_get_field_content_int(0, "ForSalePrice");
- health = cache_get_field_content_float(0, "DamageHealth");
- panels = cache_get_field_content_int(0, "DamagePanels");
- doors = cache_get_field_content_int(0, "DamageDoors");
- lights = cache_get_field_content_int(0, "DamageLights");
- tires = cache_get_field_content_int(0, "DamageTires");
- VehicleData[vidx][NeedsRecovery] = bool:cache_get_field_content_int(0, "NeedsRecovery");
- new garage = cache_get_field_content_int(0, "GarageRepairID");
- VehicleData[vidx][PlateToggle] = bool:cache_get_field_content_int(0, "PlateToggle");
- VehicleData[vidx][VehiclePaintjob] = cache_get_field_content_int(0, "VehiclePaintjob");
- fishc = cache_get_field_content_int(0, "FishCrate");
- MySQLUpdateInt(VehicleData[vidx][VehSQLID], "GarageRepairID", 0, "vehicles");
- MySQLUpdateInt(VehicleData[vidx][VehSQLID], "GarageCollectTime", 0, "vehicles");
- DestroyVehicleEx(vidx, "vidx 0");
- switch(garage)
- {
- case 1: //palomino creek
- {
- VehicleData[vidx][IdVehicle] = CreateVehicleEx(VehicleData[vidx][VehicleModel], 2441.300537, 116.527976, 26.349056 + 1, 270.0, VehicleData[vidx][vColor1], VehicleData[vidx][vColor2], -1, VehicleData[vidx][RegPlate]);
- }
- case 2: //dillimore
- {
- VehicleData[vidx][IdVehicle] = CreateVehicleEx(VehicleData[vidx][VehicleModel], 719.557006, -471.663574, 16.218591 + 1, 180.0, VehicleData[vidx][vColor1], VehicleData[vidx][vColor2], -1, VehicleData[vidx][RegPlate]);
- }
- case 3: //fort carson
- {
- VehicleData[vidx][IdVehicle] = CreateVehicleEx(VehicleData[vidx][VehicleModel], -85.196937, 1119.541992, 19.617189 + 1, 180.0, VehicleData[vidx][vColor1], VehicleData[vidx][vColor2], -1, VehicleData[vidx][RegPlate]);
- }
- case 4: //el q
- {
- VehicleData[vidx][IdVehicle] = CreateVehicleEx(VehicleData[vidx][VehicleModel], -1420.370117, 2595.696777, 55.583492 + 1, 90.0, VehicleData[vidx][vColor1], VehicleData[vidx][vColor2], -1, VehicleData[vidx][RegPlate]);
- }
- case 5: VehicleData[vidx][IdVehicle] = CreateVehicleEx(VehicleData[vidx][VehicleModel], 339.544250, 2502.484619, 16.359373 + 1, 90.0, VehicleData[vidx][vColor1], VehicleData[vidx][vColor2], -1, VehicleData[vidx][RegPlate]);//airstrip
- case 6: VehicleData[vidx][IdVehicle] = CreateVehicleEx(VehicleData[vidx][VehicleModel], -2238.6045, 2405.2800, 0.0099 + 1, 318.0417, VehicleData[vidx][vColor1], VehicleData[vidx][vColor2], -1, VehicleData[vidx][RegPlate]); //bayside marina
- case 7: VehicleData[vidx][IdVehicle] = CreateVehicleEx(VehicleData[vidx][VehicleModel], -2224.9514, -2322.6760, 30.6101 + 1, 230.7137, VehicleData[vidx][vColor1], VehicleData[vidx][vColor2], -1, VehicleData[vidx][RegPlate]);
- }
- if(fishc != 0)
- {
- new c = GetFreeFishCrateSlot();
- FishingCrates[c][CrateID] = c;
- FishingCrates[c][CrateVehicle] = vidx;
- FishingCrates[c][CrateOwner] = SQLID[playerid];
- FishingCrates[c][CrateType] = fishc;
- }
- ChangeVehiclePaintjob(VehicleData[vidx][IdVehicle], VehicleData[vidx][VehiclePaintjob]);
- for(new m = 0; m < 14; m++)
- {
- format(sgstr, sizeof(sgstr), "Mod%i", m+1); // Database starts from 1, variable starts from 0
- VehicleData[vidx][VehicleMod][m] = cache_get_field_content_int(0, sgstr);
- if(VehicleData[vidx][VehicleMod][m] && IsVehicleUpgradeCompatible(VehicleData[vidx][VehicleModel], VehicleData[vidx][VehicleMod][m])) AddVehicleComponent(VehicleData[vidx][IdVehicle], VehicleData[vidx][VehicleMod][m]);
- }
- SetVehicleVirtualWorld(VehicleData[vidx][IdVehicle], 0);
- PutPlayerInVehicle(playerid, VehicleData[vidx][IdVehicle], 0);
- SendClientMessageF(playerid, COLOR_WHITE, "You have collected the %s from the garage and the requested work has been completed.", GetVehicleNameEx(VehicleData[vidx][VehicleModel]));
- if(JobDuty[playerid] == 1)
- {
- if(MyTaxiCar[playerid] == VehicleData[vidx][IdVehicle])
- {
- switch(GetVehicleModel(VehicleData[vidx][IdVehicle]))
- {
- case 445:
- {
- vTaxiSign[vidx] = CreateVehicleObject(19308, VehicleData[vidx][IdVehicle], 0.0, 0.0, 0.915, 0.0, 0.0, 90.0);
- }
- case 426:
- {
- vTaxiSign[vidx] = CreateVehicleObject(19308, VehicleData[vidx][IdVehicle], 0.0, 0.0, 0.9325, 0.0, 0.0, 90.0);
- }
- case 418:
- {
- vTaxiSign[vidx] = CreateVehicleObject(19308, VehicleData[vidx][IdVehicle], 0.0, 0.0, 1.12, 0.0, 0.0, 90.0);
- }
- }
- }
- }
- if(health < 250) health = 250;
- SetVehicleHealthEx(VehicleData[vidx][IdVehicle], health);
- UpdateVehicleDamageStatus(VehicleData[vidx][IdVehicle], panels, doors, lights, tires);
- if(!VehicleData[vidx][PlateToggle]) SetVehicleNumberPlate(vidx, VehicleData[vidx][RegPlate]);
- else SetVehicleNumberPlate(VehicleData[vidx][IdVehicle], " ");
- EngineStatus[VehicleData[vidx][IdVehicle]] = 0;
- ToggleVehicleEngine(VehicleData[vidx][IdVehicle], 0);
- VehicleLights[VehicleData[vidx][IdVehicle]] = 0;
- ToggleVehicleLights(VehicleData[vidx][IdVehicle], 0);
- VehicleBoots[VehicleData[vidx][IdVehicle]][0] = 0;
- VehicleBoots[VehicleData[vidx][IdVehicle]][1] = 0;
- ToggleVehicleBonnet(VehicleData[vidx][IdVehicle], 0);
- ToggleVehicleTrunk(VehicleData[vidx][IdVehicle], 0);
- Fuel[VehicleData[vidx][IdVehicle]] = VehicleData[vidx][FuelRemaining];
- VehicleBroke[vidx] = 0;
- aspawned{VehicleData[vidx][IdVehicle]} = false;
- DMVCarForPlayer[VehicleData[vidx][IdVehicle]] = -1;
- RepairData[v][rSQLID] = 0;
- RepairData[v][rGarage] = 0;
- RepairData[v][rTime] = 0;
- RepairData[v][rColor1] = 0;
- RepairData[v][rColor2] = 0;
- if(Locked{vidx})
- {
- ToggleVehicleLock(VehicleData[vidx][IdVehicle], 1);
- }
- if(VehicleData[vidx][ForSale])
- {
- format(sgstr, sizeof(sgstr), "FOR SALE BY OWNER\n%s - $%s\n Contact %i for more info.", GetVehicleName(vidx), format_cash(VehicleData[vidx][ForSalePrice]), PhoneData[playerid][pNumber]);
- VehicleData[vidx][ForSaleLabel] = CreateDynamic3DTextLabel(sgstr, COLOR_SIGN, 0.0, 0.0, 0.0, 10.0, INVALID_PLAYER_ID, VehicleData[vidx][IdVehicle], 1, -1, -1, -1, 10);
- }
- }
- return true;
- }
- GREENSIDE::ProcessVehicleKeys(playerid)
- {
- if(!cache_num_rows()) return true;
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- PlayerCars[playerid][i][CarSQLID] = cache_get_field_content_int(i, "id");
- PlayerCars[playerid][i][CarModel] = cache_get_field_content_int(i, "VehicleModel");
- PlayerCars[playerid][i][CarCol1] = cache_get_field_content_int(i, "Color1");
- PlayerCars[playerid][i][CarCol2] = cache_get_field_content_int(i, "Color2");
- PlayerCars[playerid][i][CarPosX] = cache_get_field_content_float(i, "LastX");
- PlayerCars[playerid][i][CarPosY] = cache_get_field_content_float(i, "LastY");
- PlayerCars[playerid][i][CarPosZ] = cache_get_field_content_float(i, "LastZ");
- PlayerCars[playerid][i][CarSpawned] = bool:cache_get_field_content_int(i, "Spawned");
- if(PlayerCars[playerid][i][CarSpawned])
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM vehicles WHERE id = %i", PlayerCars[playerid][i][CarSQLID]);
- mysql_pquery(conn, mquery, "LoadPlayerCar", "i", playerid);
- }
- }
- return true;
- }
- GREENSIDE::LoadPlayerCar(playerid)
- {
- if(!cache_num_rows()) return SysMsg(playerid, "An error occurred while trying to spawn your saved vehicle.");
- new vidx, Float:health, panels, doors, lights, tires, Float:LogPos[4], vehiclesaved, fishc;
- vidx = CreateVehicle(411, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0);
- ClearVehicleData(vidx);
- VehicleData[vidx][VehSQLID] = cache_get_field_content_int(0, "id");
- VehicleData[vidx][VehicleModel] = cache_get_field_content_int(0, "VehicleModel");
- VehicleData[vidx][VehicleOwnerSQLID] = cache_get_field_content_int(0, "OwnerSQLID");
- VehicleData[vidx][LastX] = cache_get_field_content_float(0, "LastX");
- VehicleData[vidx][LastY] = cache_get_field_content_float(0, "LastY");
- VehicleData[vidx][LastZ] = cache_get_field_content_float(0, "LastZ");
- VehicleData[vidx][LastRot] = cache_get_field_content_float(0, "LastRot");
- cache_get_field_content(0, "RegPlate", VehicleData[vidx][RegPlate], conn, MAX_REG_PLATE);
- VehicleData[vidx][FuelRemaining] = cache_get_field_content_float(0, "Fuel");
- VehicleData[vidx][Mileage] = cache_get_field_content_float(0, "Mileage");
- VehicleData[vidx][LastOilMileage] = cache_get_field_content_float(0, "LastOilMileage");
- Locked{vidx} = bool:cache_get_field_content_int(0, "IsLocked");
- VehicleData[vidx][VehiclePrice] = cache_get_field_content_int(0, "Price");
- VehicleData[vidx][vColor1] = cache_get_field_content_int(0, "Color1");
- VehicleData[vidx][vColor2] = cache_get_field_content_int(0, "Color2");
- VehicleData[vidx][ImpoundTime] = cache_get_field_content_int(0, "ImpoundTime");
- VehicleData[vidx][ImpoundedBy] = cache_get_field_content_int(0, "ImpoundedBy");
- VehicleData[vidx][ImpoundFee] = cache_get_field_content_int(0, "ImpoundFee");
- VehicleData[vidx][Impounded] = bool:cache_get_field_content_int(0, "Impounded");
- cache_get_field_content(0, "ImpoundReason", VehicleData[vidx][ImpoundReason], conn, 64);
- VehicleData[vidx][TicketAmount] = cache_get_field_content_int(0, "TicketAmount");
- VehicleData[vidx][VirtualWorld] = cache_get_field_content_int(0, "VWorld");
- VehicleData[vidx][VehicleInterior] = cache_get_field_content_int(0, "Interior");
- VehicleData[vidx][DonatorCar] = bool:cache_get_field_content_int(0, "DonatorCar");
- VehicleData[vidx][TrunkCash] = cache_get_field_content_int(0, "TrunkCash");
- VehicleData[vidx][TrunkWeed] = cache_get_field_content_int(0, "TrunkWeed");
- VehicleData[vidx][TrunkCocaine] = cache_get_field_content_int(0, "TrunkCocaine");
- VehicleData[vidx][TrunkMoonShine] = cache_get_field_content_int(0, "TrunkMoonShine");
- VehicleData[vidx][TrunkPhone] = cache_get_field_content_int(0, "TrunkPhone");
- VehicleData[vidx][ForSale] = bool:cache_get_field_content_int(0, "ForSale");
- VehicleData[vidx][ForSalePrice] = cache_get_field_content_int(0, "ForSalePrice");
- health = cache_get_field_content_float(0, "DamageHealth");
- panels = cache_get_field_content_int(0, "DamagePanels");
- doors = cache_get_field_content_int(0, "DamageDoors");
- lights = cache_get_field_content_int(0, "DamageLights");
- tires = cache_get_field_content_int(0, "DamageTires");
- VehicleData[vidx][NeedsRecovery] = bool:cache_get_field_content_int(0, "NeedsRecovery");
- VehicleData[vidx][GarageRepairID] = cache_get_field_content_int(0, "GarageRepairID");
- VehicleData[vidx][GarageCollectTime] = cache_get_field_content_int(0, "GarageCollectTime");
- LogPos[0] = cache_get_field_content_float(0, "LogPosX");
- LogPos[1] = cache_get_field_content_float(0, "LogPosY");
- LogPos[2] = cache_get_field_content_float(0, "LogPosZ");
- LogPos[3] = cache_get_field_content_float(0, "LogPosA");
- vehiclesaved = cache_get_field_content_int(0, "VehicleSaved");
- VehicleData[vidx][HotwireTime] = cache_get_field_content_int(0, "HotwireExpiration");
- VehicleData[vidx][PlateToggle] = bool:cache_get_field_content_int(0, "PlateToggle");
- VehicleData[vidx][VehiclePaintjob] = cache_get_field_content_int(0, "VehiclePaintjob");
- fishc = cache_get_field_content_int(0, "FishCrate");
- new isin = -1;
- if(!VehicleData[vidx][Impounded] && !VehicleData[vidx][NeedsRecovery] && VehicleData[vidx][GarageRepairID] == 0 && VehicleData[vidx][HotwireTime] < gettime())
- {
- DestroyVehicleEx(vidx, "vidx 1");
- if(LastLogout[playerid] < gettime() - 603) vehiclesaved = 0;
- VehicleData[vidx][IdVehicle] = CreateVehicleEx(VehicleData[vidx][VehicleModel], VehicleData[vidx][LastX], VehicleData[vidx][LastY], VehicleData[vidx][LastZ], VehicleData[vidx][LastRot], VehicleData[vidx][vColor1], VehicleData[vidx][vColor2], -1, VehicleData[vidx][RegPlate]);
- if(vehiclesaved == 1)
- {
- SetVehiclePos(VehicleData[vidx][IdVehicle], LogPos[0], LogPos[1], LogPos[2]);
- SetVehicleZAngle(VehicleData[vidx][IdVehicle], LogPos[3]);
- }
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET LogPosX = 0.0, LogPosY = 0.0, LogPosZ = 0.0, LogPosA = 0.0, VehicleSaved = 0 WHERE id = %i", VehicleData[vidx][VehSQLID]);
- mysql_pquery(conn, mquery);
- if(fishc != 0)
- {
- new c = GetFreeFishCrateSlot();
- FishingCrates[c][CrateID] = c;
- FishingCrates[c][CrateVehicle] = vidx;
- FishingCrates[c][CrateOwner] = SQLID[playerid];
- FishingCrates[c][CrateType] = fishc;
- }
- for(new m = 0; m < 14; m++)
- {
- format(sgstr, sizeof(sgstr), "Mod%i", m+1);
- VehicleData[vidx][VehicleMod][m] = cache_get_field_content_int(0, sgstr);
- if(VehicleData[vidx][VehicleMod][m] != 0 && IsVehicleUpgradeCompatible(VehicleData[vidx][VehicleModel], VehicleData[vidx][VehicleMod][m])) AddVehicleComponent(VehicleData[vidx][IdVehicle], VehicleData[vidx][VehicleMod][m]);
- }
- ChangeVehiclePaintjob(VehicleData[vidx][IdVehicle], VehicleData[vidx][VehiclePaintjob]);
- if(health < 250) health = 250;
- SetVehicleHealthEx(VehicleData[vidx][IdVehicle], health);
- UpdateVehicleDamageStatus(VehicleData[vidx][IdVehicle], panels, doors, lights, tires);
- SetVehicleParamsCarWindows(VehicleData[vidx][IdVehicle], 1, 1, 1, 1);
- SetVehicleVirtualWorld(VehicleData[vidx][IdVehicle], VehicleData[vidx][VirtualWorld]);
- LinkVehicleToInterior(VehicleData[vidx][IdVehicle], VehicleData[vidx][VehicleInterior]);
- if(!VehicleData[vidx][PlateToggle]) SetVehicleNumberPlate(vidx, VehicleData[vidx][RegPlate]);
- else SetVehicleNumberPlate(VehicleData[vidx][IdVehicle], " ");
- EngineStatus[VehicleData[vidx][IdVehicle]] = 0;
- ToggleVehicleEngine(VehicleData[vidx][IdVehicle], 0);
- VehicleLights[VehicleData[vidx][IdVehicle]] = 0;
- ToggleVehicleLights(VehicleData[vidx][IdVehicle], 0);
- VehicleBoots[VehicleData[vidx][IdVehicle]][0] = 0;
- VehicleBoots[VehicleData[vidx][IdVehicle]][1] = 0;
- ToggleVehicleBonnet(VehicleData[vidx][IdVehicle], 0);
- ToggleVehicleTrunk(VehicleData[vidx][IdVehicle], 0);
- VehicleBroke[vidx] = 0;
- Fuel[VehicleData[vidx][IdVehicle]] = VehicleData[vidx][FuelRemaining];
- VehicleBroke[VehicleData[vidx][IdVehicle]] = 0;
- aspawned{VehicleData[vidx][IdVehicle]} = false;
- DMVCarForPlayer[VehicleData[vidx][IdVehicle]] = -1;
- if(Locked{vidx})
- {
- ToggleVehicleLock(VehicleData[vidx][IdVehicle], 1);
- }
- if(VehicleData[vidx][ForSale])
- {
- new forsale[128];
- format(forsale, sizeof(forsale), "FOR SALE BY OWNER\n%s - $%s\n Contact %i for more info.", GetVehicleName(vidx), format_cash(VehicleData[vidx][ForSalePrice]), PhoneData[playerid][pNumber]);
- VehicleData[vidx][ForSaleLabel] = CreateDynamic3DTextLabel(forsale, COLOR_SIGN, 0.0, 0.0, 0.0, 10.0, INVALID_PLAYER_ID, VehicleData[vidx][IdVehicle], 1, -1, -1, -1, 10);
- }
- }
- else if(VehicleData[vidx][Impounded])
- {
- for(new a = 1, p = GetVehiclePoolSize(); a <= p; a++)
- {
- if(strlen(ImpoundData[a][iRegPlate]) >= 1)
- {
- if(strmatch(ImpoundData[a][iRegPlate], VehicleData[vidx][RegPlate]))
- {
- isin = 1;
- break;
- }
- }
- }
- if(isin == -1)
- {
- for(new im = 1, p = GetVehiclePoolSize(); im <= p; im++)
- {
- if(ImpoundData[im][iModel] < 400)
- {
- ImpoundData[im][iModel] = VehicleData[vidx][VehicleModel];
- ImpoundData[im][iSQLID] = VehicleData[vidx][VehSQLID];
- ImpoundData[im][iOwnerSQLID] = VehicleData[vidx][VehicleOwnerSQLID];
- ImpoundData[im][iImpoundedBy] = VehicleData[vidx][ImpoundedBy];
- ImpoundData[im][iImpoundFee] = VehicleData[vidx][ImpoundFee];
- ImpoundData[im][iImpoundTime] = VehicleData[vidx][ImpoundTime];
- ImpoundData[im][iColor1] = VehicleData[vidx][vColor1];
- ImpoundData[im][iColor2] = VehicleData[vidx][vColor2];
- format(ImpoundData[im][iImpoundReason], 64, VehicleData[vidx][ImpoundReason]);
- format(ImpoundData[im][iRegPlate], MAX_REG_PLATE, VehicleData[vidx][RegPlate]);
- ImpoundData[im][iVehType] = 1;
- ImpoundData[im][iFaction] = 0;
- DestroyVehicleEx(vidx, "vidx 2");
- ClearVehicleData(vidx);
- break;
- }
- }
- }
- else
- {
- DestroyVehicleEx(vidx, "vidx 3");
- ClearVehicleData(vidx);
- }
- }
- else if(VehicleData[vidx][GarageRepairID] >= 1)
- {
- for(new v = 1, p = GetVehiclePoolSize(); v <= p; v++)
- {
- if(RepairData[v][rSQLID] == VehicleData[vidx][VehSQLID])
- {
- isin = 2;
- break;
- }
- }
- if(isin != 2 && isin != 1)
- {
- for(new v = 1, p = GetVehiclePoolSize(); v <= p; v++)
- {
- if(RepairData[v][rModel] < 400)
- {
- RepairData[v][rModel] = VehicleData[vidx][VehicleModel];
- RepairData[v][rSQLID] = VehicleData[vidx][VehSQLID];
- RepairData[v][rOwnerSQLID] = VehicleData[vidx][VehicleOwnerSQLID];
- RepairData[v][rFaction] = 0;
- format(RepairData[v][rRegPlate], MAX_REG_PLATE, VehicleData[vidx][RegPlate]);
- RepairData[v][rTime] = VehicleData[vidx][GarageCollectTime];
- RepairData[v][rGarage] = VehicleData[vidx][GarageRepairID];
- DestroyVehicleEx(vidx, "vidx 4");
- ClearVehicleData(vidx);
- break;
- }
- }
- }
- else
- {
- DestroyVehicleEx(vidx, "vidx 5");
- ClearVehicleData(vidx);
- }
- }
- else
- {
- DestroyVehicleEx(vidx, "vidx 6");
- ClearVehicleData(vidx);
- }
- return true;
- }
- GREENSIDE::LoadPlayerContacts(playerid)
- {
- if(!cache_num_rows()) return true;
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- PhoneContacts[playerid][i][cID] = cache_get_field_content_int(i, "id");
- PhoneContacts[playerid][i][ContactNumber] = cache_get_field_content_int(i, "ContactNumber");
- cache_get_field_content(i, "ContactName", PhoneContacts[playerid][i][ContactName], conn, 30);
- }
- return true;
- }
- GREENSIDE::InsetNewPhoneContact(playerid, slot)
- {
- PhoneContacts[playerid][slot][cID] = cache_insert_id();
- return true;
- }
- GREENSIDE::ShowPreviousTexts(playerid)
- {
- if(!cache_num_rows()) return SysMsg(playerid, "No previous texts found.");
- gstr[0] = EOS;
- if(MemberListIndex[playerid] > 0) strcat(gstr, "{FFD700}< Previous Page\n");
- new number, textmessage[200];
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- ViewingTextID[playerid][i] = cache_get_field_content_int(i, "id");
- number = cache_get_field_content_int(i, "TextFrom");
- cache_get_field_content(i, "TextMessage", textmessage);
- if(strlen(textmessage) > 50)
- {
- strdel(textmessage, 51, sizeof(textmessage));
- strins(textmessage, "...", 51);
- }
- if(number == PhoneData[playerid][pNumber]) format(sgstr, sizeof(sgstr), "{FF0000}[TO]{FFFFFF} %s\n", textmessage);
- else format(sgstr, sizeof(sgstr), "{00FF00}[FROM]{FFFFFF} %s\n", textmessage);
- strcat(gstr, sgstr);
- }
- if(cache_num_rows() >= 10) strcat(gstr, "\n{FFD700}> Next Page");
- Dialog_Show(playerid, SMSDetails, DIALOG_STYLE_TABLIST, "View Recent Texts", gstr, "View", "Cancel");
- return true;
- }
- GREENSIDE::ShowSMSDetails(playerid)
- {
- if(!cache_num_rows()) return SysMsg(playerid, "A strange error has occurred. Please post a bug report with this error: SMSD1");
- new texttime[64], textfrom[30], number, textby, textmessage[200];
- number = cache_get_field_content_int(0, "TextFrom");
- cache_get_field_content(0, "TextTime", texttime);
- cache_get_field_content(0, "TextMessage", textmessage);
- textby = cache_get_field_content_int(0, "TextTo");
- if(strlen(textmessage) > 100) strins(textmessage, "\n", 101, sizeof(textmessage));
- if(number != PhoneData[playerid][pNumber])
- {
- format(textfrom, 30, "%i", number);
- for(new j = 0; j < MAX_PHONECONTACTS; j++)
- {
- if(PhoneContacts[playerid][j][ContactNumber] == number)
- {
- format(textfrom, sizeof(textfrom), PhoneContacts[playerid][j][ContactName]);
- break;
- }
- }
- format(sgstr, sizeof(sgstr), "Text From %s", textfrom);
- }
- else
- {
- format(textfrom, 30, "%i", textby);
- for(new j = 0; j < MAX_PHONECONTACTS; j++)
- {
- if(PhoneContacts[playerid][j][ContactNumber] == textby)
- {
- format(textfrom, sizeof(textfrom), PhoneContacts[playerid][j][ContactName]);
- break;
- }
- }
- format(sgstr, sizeof(sgstr), "Text To %s", textfrom);
- }
- format(gstr, sizeof(gstr), "%s\n\n%s", textmessage, texttime);
- Dialog_Show(playerid, SMSActions, DIALOG_STYLE_MSGBOX, sgstr, gstr, "Select", "Cancel");
- return true;
- }
- GREENSIDE::ShowSMSList(playerid)
- {
- if(!cache_num_rows()) return SysMsg(playerid, "No text messages found.");
- gstr[0] = EOS;
- new textby, textfrom[30], numbersfound[MAX_PHONECONTACTS];
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- new bool:skip = false;
- textby = cache_get_field_content_int(i, "TextFrom");
- if(textby == PhoneData[playerid][pNumber]) textby = cache_get_field_content_int(i, "TextTo");
- valstr(textfrom, textby);
- numbersfound[i] = textby;
- for(new k = 0; k < MAX_PHONECONTACTS; k++)
- {
- if(k == i) continue;
- if(numbersfound[k] == textby) skip = true;
- }
- if(skip) continue;
- for(new j = 0; j < MAX_PHONECONTACTS; j++)
- {
- if(PhoneContacts[playerid][j][ContactNumber] == textby)
- {
- format(textfrom, 30, PhoneContacts[playerid][j][ContactName]);
- break;
- }
- }
- format(sgstr, sizeof(sgstr), "%s\n", textfrom);
- strcat(gstr, sgstr);
- }
- Dialog_Show(playerid, SMSList, DIALOG_STYLE_LIST, "Text Messages", gstr, "View", "Cancel");
- return true;
- }
- GREENSIDE::MyCarsRecovery(playerid, text[], Vcount)
- {
- format(gstr, sizeof(gstr), text);
- for(new v = 0, x = cache_num_rows(); v < x; v++)
- {
- new model = cache_get_field_content_int(v, "VehicleModel");
- format(gstr, sizeof(gstr), "%s%s - Needs Recovery (/recovervehicle)\n", gstr, GetVehicleNameEx(model));
- }
- if(VehicleBorrowKey[playerid] > 0)
- {
- Vcount ++;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT VehicleModel,OwnerSQLID FROM vehicles WHERE id = %i LIMIT 1", VehicleBorrowKey[playerid]);
- mysql_pquery(conn, mquery, "MyBorrowedCars", "ds", playerid, gstr);
- }
- else
- {
- if(Vcount > 0)
- {
- strcat(gstr, "\nUse /recovervehicle to respawn your vehicles.");
- ShowMessage(playerid, "My Cars", gstr, "Ok");
- }
- else
- {
- strcat(gstr, "You don't have any vehicles.");
- ShowMessage(playerid, "My Cars", gstr, "Ok");
- }
- }
- return true;
- }
- GREENSIDE::TheirCarsRecovery(playerid, playa, text[], Vcount)
- {
- format(sgstr,sizeof(sgstr),"%s's Cars",GetName(playa));
- format(gstr, sizeof(gstr), text);
- for(new v = 0, x = cache_num_rows(); v < x; v++)
- {
- new model = cache_get_field_content_int(v, "VehicleModel");
- format(gstr, sizeof(gstr), "%s%s - Needs Recovery (/recovervehicle)\n", gstr, GetVehicleNameEx(model));
- }
- if(Vcount > 0)
- {
- ShowMessage(playerid, sgstr, gstr, "Ok");
- }
- else
- {
- strcat(gstr, "They don't have any vehicles.");
- ShowMessage(playerid, sgstr, gstr, "Ok");
- }
- return true;
- }
- GREENSIDE::MyBorrowedCars(playerid, textBody[])
- {
- new text[400];
- format(text, 400, textBody);
- if(cache_num_rows() <= 0)
- {
- VehicleBorrowKey[playerid] = 0;
- VehicleBorrowKeyTime[playerid] = 0;
- MySQLUpdateInt(SQLID[playerid], "BorrowKey", 0, "players");
- MySQLUpdateInt(SQLID[playerid], "BorrowKeyTime", 0, "players");
- }
- else
- {
- new borrow_model, borrow_owner;
- borrow_model = cache_get_field_content_int(0, "VehicleModel");
- borrow_owner = cache_get_field_content_int(0, "OwnerSQLID");
- strcat(text, "\nMy Shared Key: ");
- strcat(text, GetVehicleNameEx(borrow_model));
- strcat(text, " (Owner: ");
- strcat(text, GetSQLName(borrow_owner));
- strcat(text, ")");
- }
- strcat(text, "\nUse /recovervehicle to respawn your vehicles.");
- ShowMessage(playerid, "My Cars", text, "Ok");
- return true;
- }
- GREENSIDE::DisplayRecoverVehicle(playerid)
- {
- if(cache_num_rows())
- {
- new model, spoiler, hood, roof, lamps, exhaust, wheels, fbumper, rbumper, rvent, lvent, price = 1000;
- gstr[0] = EOS;
- for(new v = 0, x = cache_num_rows(); v < x; v++)
- {
- model = cache_get_field_content_int(v, "VehicleModel");
- spoiler = cache_get_field_content_int(0, "Mod1"),
- hood = cache_get_field_content_int(0, "Mod2"),
- roof = cache_get_field_content_int(0, "Mod3"),
- lamps = cache_get_field_content_int(0, "Mod5"),
- exhaust = cache_get_field_content_int(0, "Mod7"),
- wheels = cache_get_field_content_int(0, "Mod8"),
- fbumper = cache_get_field_content_int(0, "Mod11"),
- rbumper = cache_get_field_content_int(0, "Mod12"),
- rvent = cache_get_field_content_int(0, "Mod13"),
- lvent = cache_get_field_content_int(0, "Mod14");
- //vehicle damage
- if(spoiler >= 1000) price += 500;
- if(hood >= 1000) price += 300;
- if(roof >= 1000) price += 500;
- if(exhaust >= 1000) price += 200;
- if(rvent >= 1000) price += 500;
- if(lvent >= 1000) price += 500;
- if(lamps >= 1000) price += 150;
- if(fbumper >= 1000) price += 500;
- if(rbumper >= 1000) price += 500;
- if(wheels >= 1000) price += 200;
- format(gstr, sizeof(gstr), "%s%s ($%i)\n", gstr, GetVehicleNameEx(model), price*GetVehicleRepairMultiplier(model));
- }
- Dialog_Show(playerid, VehicleRecover, DIALOG_STYLE_LIST, "Recover Vehicle Menu", gstr, "Recover", "Cancel");
- }
- else Dialog_Show(playerid, 9999, DIALOG_STYLE_MSGBOX, "Recover Vehicle Menu", "You don't have any vehicles that require recovery.", "Close", "");
- return true;
- }
- GREENSIDE::FinishFuelCanRefilling(playerid)
- {
- RemovePlayerAttachedObject(playerid, HOLD_OBJECT_MISC);
- StopLoopingAnim(playerid);
- return true;
- }
- GREENSIDE::LoadPurchaseVehicle(playerid, price)
- {
- if(cache_num_rows())
- {
- new vidx = CreateVehicleEx(411, 0.0, 0.0, 1000.0, 0.0, 0, 0, -1);
- ClearVehicleData(vidx);
- VehicleData[vidx][VehSQLID] = cache_get_field_content_int(0, "id");
- VehicleData[vidx][VehicleModel] = cache_get_field_content_int(0, "VehicleModel");
- VehicleData[vidx][VehicleOwnerSQLID] = cache_get_field_content_int(0, "OwnerSQLID");
- VehicleData[vidx][LastX] = cache_get_field_content_float(0, "LastX");
- VehicleData[vidx][LastY] = cache_get_field_content_float(0, "LastY");
- VehicleData[vidx][LastZ] = cache_get_field_content_float(0, "LastZ");
- VehicleData[vidx][LastRot] = cache_get_field_content_float(0, "LastRot");
- cache_get_field_content(0, "RegPlate", VehicleData[vidx][RegPlate], conn, MAX_REG_PLATE);
- VehicleData[vidx][FuelRemaining] = cache_get_field_content_float(0, "Fuel");
- VehicleData[vidx][Mileage] = cache_get_field_content_float(0, "Mileage");
- VehicleData[vidx][LastOilMileage] = cache_get_field_content_float(0, "LastOilMileage");
- Locked{vidx} = bool:cache_get_field_content_int(0, "IsLocked");
- VehicleData[vidx][VehiclePrice] = cache_get_field_content_int(0, "Price");
- VehicleData[vidx][vColor1] = cache_get_field_content_int(0, "Color1");
- VehicleData[vidx][vColor2] = cache_get_field_content_int(0, "Color2");
- VehicleData[vidx][TicketAmount] = cache_get_field_content_int(0, "TicketAmount");
- VehicleData[vidx][VirtualWorld] = cache_get_field_content_int(0, "VWorld");
- VehicleData[vidx][DonatorCar] = bool:cache_get_field_content_int(0, "DonatorCar");
- VehicleData[vidx][TrunkCash] = cache_get_field_content_int(0, "TrunkCash");
- VehicleData[vidx][TrunkWeed] = cache_get_field_content_int(0, "TrunkWeed");
- VehicleData[vidx][TrunkCocaine] = cache_get_field_content_int(0, "TrunkCocaine");
- VehicleData[vidx][TrunkMoonShine] = cache_get_field_content_int(0, "TrunkMoonShine");
- VehicleData[vidx][TrunkPhone] = cache_get_field_content_int(0, "TrunkPhone");
- VehicleData[vidx][ForSale] = bool:cache_get_field_content_int(0, "ForSale");
- VehicleData[vidx][ForSalePrice] = cache_get_field_content_int(0, "ForSalePrice");
- VehicleData[vidx][NeedsRecovery] = bool:cache_get_field_content_int(0, "NeedsRecovery");
- VehicleData[vidx][GarageRepairID] = cache_get_field_content_int(0, "GarageRepairID");
- VehicleData[vidx][GarageCollectTime] = cache_get_field_content_int(0, "GarageCollectTime");
- VehicleData[vidx][VehiclePaintjob] = cache_get_field_content_int(0, "VehiclePaintjob");
- DestroyVehicleEx(vidx, "vidx 7");
- VehicleData[vidx][IdVehicle] = CreateVehicleEx(VehicleData[vidx][VehicleModel], VehicleData[vidx][LastX], VehicleData[vidx][LastY], VehicleData[vidx][LastZ], VehicleData[vidx][LastRot], VehicleData[vidx][vColor1], VehicleData[vidx][vColor2], -1, VehicleData[vidx][RegPlate]);
- SetVehicleHealthEx(VehicleData[vidx][IdVehicle], 1000.0);
- for(new m = 0; m < 14; m++)
- {
- format(sgstr, sizeof(sgstr), "Mod%i", m+1); // Database starts from 1, variable starts from 0
- VehicleData[vidx][VehicleMod][m] = cache_get_field_content_int(0, sgstr);
- if(VehicleData[vidx][VehicleMod][m] && IsVehicleUpgradeCompatible(VehicleData[vidx][VehicleModel], VehicleData[vidx][VehicleMod][m])) AddVehicleComponent(VehicleData[vidx][IdVehicle], VehicleData[vidx][VehicleMod][m]);
- }
- SetVehicleVirtualWorld(VehicleData[vidx][IdVehicle], VehicleData[vidx][VirtualWorld]);
- EngineStatus[VehicleData[vidx][IdVehicle]] = 0;
- ToggleVehicleEngine(VehicleData[vidx][IdVehicle], 0);
- VehicleLights[VehicleData[vidx][IdVehicle]] = 0;
- ToggleVehicleLights(VehicleData[vidx][IdVehicle], 0);
- VehicleBoots[VehicleData[vidx][IdVehicle]][0] = 0;
- VehicleBoots[VehicleData[vidx][IdVehicle]][1] = 0;
- ToggleVehicleBonnet(VehicleData[vidx][IdVehicle], 0);
- ToggleVehicleTrunk(VehicleData[vidx][IdVehicle], 0);
- Fuel[VehicleData[vidx][IdVehicle]] = 80.0;
- aspawned{VehicleData[vidx][IdVehicle]} = false;
- VehicleBroke[vidx] = 0;
- DMVCarForPlayer[VehicleData[vidx][IdVehicle]] = -1;
- if(Locked{vidx})
- {
- ToggleVehicleLock(VehicleData[vidx][IdVehicle], 1);
- }
- if(VehicleData[vidx][ForSale])
- {
- new forsale[128];
- format(forsale, sizeof(forsale), "FOR SALE BY OWNER\n%s - $%s\n Contact %i for more info.", GetVehicleName(vidx), format_cash(VehicleData[vidx][ForSalePrice]), PhoneData[playerid][pNumber]);
- VehicleData[vidx][ForSaleLabel] = CreateDynamic3DTextLabel(forsale, COLOR_SIGN, 0.0, 0.0, 0.0, 10.0, INVALID_PLAYER_ID, VehicleData[vidx][IdVehicle], 1, -1, -1, -1, 10);
- }
- if(!VehicleData[vidx][DonatorCar])
- {
- SendClientMessageF(playerid,COLOR_GOLD, "You Have Purchased This %s For $%s.",GetVehicleName(vidx),format_cash(price));
- SendClientMessage(playerid,COLOR_GOLD, "Vehicle ownership commands can be found at: '/help Vehicle'");
- ShowInfoText(playerid,"~b~Vehicle Acquired",5000);
- PutPlayerInVehicle(playerid, vidx, 0);
- }
- else
- {
- SendClientMessageF(playerid,COLOR_GOLD,"Welcome to your brand new %s, courtesy of RC-RP as a thank you for your donation.",GetVehicleName(vidx));
- SendClientMessage(playerid,COLOR_GOLD,"Vehicle ownership commands can be found at: '/help Vehicle'");
- ShowInfoText(playerid,"~b~Vehicle Acquired",5000);
- PutPlayerInVehicle(playerid, vidx, 0);
- }
- }
- return true;
- }
- GREENSIDE::LoadRecoveredVehicle(playerid)
- {
- if(cache_num_rows())
- {
- new
- Float:health, panels, doors, tires, lights, price = 1000,
- spoiler = cache_get_field_content_int(0, "Mod1"),
- hood = cache_get_field_content_int(0, "Mod2"),
- roof = cache_get_field_content_int(0, "Mod3"),
- lamps = cache_get_field_content_int(0, "Mod5"),
- exhaust = cache_get_field_content_int(0, "Mod7"),
- wheels = cache_get_field_content_int(0, "Mod8"),
- fbumper = cache_get_field_content_int(0, "Mod11"),
- rbumper = cache_get_field_content_int(0, "Mod12"),
- rvent = cache_get_field_content_int(0, "Mod13"),
- lvent = cache_get_field_content_int(0, "Mod14");
- //vehicle damage
- if(spoiler >= 1000) price += 500;
- if(hood >= 1000) price += 300;
- if(roof >= 1000) price += 500;
- if(exhaust >= 1000) price += 200;
- if(rvent >= 1000) price += 500;
- if(lvent >= 1000) price += 500;
- if(lamps >= 1000) price += 150;
- if(fbumper >= 1000) price += 500;
- if(rbumper >= 1000) price += 500;
- if(wheels >= 1000) price += 200;
- new mod = cache_get_field_content_int(0, "VehicleModel");
- price = price * GetVehicleRepairMultiplier(mod);
- if(Cash[playerid] < price) return SysMsgF(playerid, "You need $%i to recover this vehicle.", price);
- new vidx = CreateVehicle(411, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0);
- ClearVehicleData(vidx);
- VehicleData[vidx][VehSQLID] = cache_get_field_content_int(0, "id");
- VehicleData[vidx][VehicleModel] = cache_get_field_content_int(0, "VehicleModel");
- VehicleData[vidx][VehicleOwnerSQLID] = cache_get_field_content_int(0, "OwnerSQLID");
- VehicleData[vidx][LastX] = cache_get_field_content_float(0, "LastX");
- VehicleData[vidx][LastY] = cache_get_field_content_float(0, "LastY");
- VehicleData[vidx][LastZ] = cache_get_field_content_float(0, "LastZ");
- VehicleData[vidx][LastRot] = cache_get_field_content_float(0, "LastRot");
- cache_get_field_content(0, "RegPlate", VehicleData[vidx][RegPlate], conn, MAX_REG_PLATE);
- VehicleData[vidx][FuelRemaining] = cache_get_field_content_float(0, "Fuel");
- VehicleData[vidx][Mileage] = cache_get_field_content_float(0, "Mileage");
- VehicleData[vidx][LastOilMileage] = cache_get_field_content_float(0, "LastOilMileage");
- Locked{vidx} = bool:cache_get_field_content_int(0, "IsLocked");
- VehicleData[vidx][VehiclePrice] = cache_get_field_content_int(0, "Price");
- VehicleData[vidx][vColor1] = cache_get_field_content_int(0, "Color1");
- VehicleData[vidx][vColor2] = cache_get_field_content_int(0, "Color2");
- VehicleData[vidx][TicketAmount] = cache_get_field_content_int(0, "TicketAmount");
- VehicleData[vidx][VirtualWorld] = cache_get_field_content_int(0, "VWorld");
- VehicleData[vidx][VehicleInterior] = cache_get_field_content_int(0, "Interior");
- VehicleData[vidx][DonatorCar] = bool:cache_get_field_content_int(0, "DonatorCar");
- VehicleData[vidx][TrunkCash] = cache_get_field_content_int(0, "TrunkCash");
- VehicleData[vidx][TrunkWeed] = cache_get_field_content_int(0, "TrunkWeed");
- VehicleData[vidx][TrunkCocaine] = cache_get_field_content_int(0, "TrunkCocaine");
- VehicleData[vidx][TrunkMoonShine] = cache_get_field_content_int(0, "TrunkMoonShine");
- VehicleData[vidx][ForSale] = bool:cache_get_field_content_int(0, "ForSale");
- VehicleData[vidx][ForSalePrice] = cache_get_field_content_int(0, "ForSalePrice");
- health = cache_get_field_content_float(0, "DamageHealth");
- panels = cache_get_field_content_int(0, "DamagePanels");
- doors = cache_get_field_content_int(0, "DamageDoors");
- lights = cache_get_field_content_int(0, "DamageLights");
- tires = cache_get_field_content_int(0, "DamageTires");
- VehicleData[vidx][PlateToggle] = bool:cache_get_field_content_int(0, "PlateToggle");
- VehicleData[vidx][VehiclePaintjob] = cache_get_field_content_int(0, "VehiclePaintjob");
- DestroyVehicleEx(vidx, "vidx 8");
- VehicleData[vidx][IdVehicle] = CreateVehicleEx(VehicleData[vidx][VehicleModel], VehicleData[vidx][LastX], VehicleData[vidx][LastY], VehicleData[vidx][LastZ], VehicleData[vidx][LastRot], VehicleData[vidx][vColor1], VehicleData[vidx][vColor2], -1, VehicleData[vidx][RegPlate]);
- ChangeVehiclePaintjob(VehicleData[vidx][IdVehicle], VehicleData[vidx][VehiclePaintjob]);
- if(health < 250) health = 250;
- SetVehicleHealthEx(VehicleData[vidx][IdVehicle], 1000.0);
- UpdateVehicleDamageStatus(VehicleData[vidx][IdVehicle], panels, doors, lights, tires);
- for(new m = 0; m < 14; m++)
- {
- format(sgstr, sizeof(sgstr), "Mod%i", m+1); // Database starts from 1, variable starts from 0
- VehicleData[vidx][VehicleMod][m] = cache_get_field_content_int(0, sgstr);
- if(VehicleData[vidx][VehicleMod][m] && IsVehicleUpgradeCompatible(VehicleData[vidx][VehicleModel], VehicleData[vidx][VehicleMod][m])) AddVehicleComponent(VehicleData[vidx][IdVehicle], VehicleData[vidx][VehicleMod][m]);
- }
- ChangeVehiclePaintjob(VehicleData[vidx][IdVehicle], VehicleData[vidx][VehiclePaintjob]);
- if(!VehicleData[vidx][PlateToggle]) SetVehicleNumberPlate(vidx, VehicleData[vidx][RegPlate]);
- else SetVehicleNumberPlate(VehicleData[vidx][IdVehicle], " ");
- SetVehicleVirtualWorld(VehicleData[vidx][IdVehicle], VehicleData[vidx][VirtualWorld]);
- LinkVehicleToInterior(VehicleData[vidx][IdVehicle], VehicleData[vidx][VehicleInterior]);
- EngineStatus[VehicleData[vidx][IdVehicle]] = 0;
- ToggleVehicleEngine(VehicleData[vidx][IdVehicle], 0);
- VehicleLights[VehicleData[vidx][IdVehicle]] = 0;
- ToggleVehicleLights(VehicleData[vidx][IdVehicle], 0);
- VehicleBoots[VehicleData[vidx][IdVehicle]][0] = 0;
- VehicleBoots[VehicleData[vidx][IdVehicle]][1] = 0;
- ToggleVehicleBonnet(VehicleData[vidx][IdVehicle], 0);
- ToggleVehicleTrunk(VehicleData[vidx][IdVehicle], 0);
- Fuel[VehicleData[vidx][IdVehicle]] = 100.0;
- VehicleBroke[vidx] = 0;
- aspawned{VehicleData[vidx][IdVehicle]} = false;
- DMVCarForPlayer[VehicleData[vidx][IdVehicle]] = -1;
- if(Locked{vidx})
- {
- ToggleVehicleLock(VehicleData[vidx][IdVehicle], 1);
- }
- if(VehicleData[vidx][ForSale])
- {
- new forsale[128];
- format(forsale, sizeof(forsale), "FOR SALE BY OWNER\n%s - $%s\n Contact %i for more info.", GetVehicleName(vidx), format_cash(VehicleData[vidx][ForSalePrice]), PhoneData[playerid][pNumber]);
- VehicleData[vidx][ForSaleLabel] = CreateDynamic3DTextLabel(forsale, COLOR_SIGN, 0.0, 0.0, 0.0, 10.0, INVALID_PLAYER_ID, VehicleData[vidx][IdVehicle], 1, -1, -1, -1, 10);
- }
- MySQLUpdateInt(VehicleData[vidx][VehSQLID], "NeedsRecovery", 0, "vehicles");
- GivePlayerCash(playerid, -price);
- format(gstr, sizeof(gstr),"You have respawned your %s(%i). It cost $%i.", GetVehicleNameEx(mod), vidx, price);
- SendClientMessage(playerid,COLOR_GOLD,gstr);
- }
- return true;
- }
- GREENSIDE::BuyVehicleFromShop(playerid)
- {
- if(cache_num_rows() >= MAX_VEH_PER_PLAYER) return SysMsg(playerid,"You cannot buy any more vehicles.");
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 643.642395, -492.949493, 16.335937))
- {
- SetPlayerVirtualWorldEx(playerid, (playerid + 1000));
- SetPlayerCameraPos(playerid, 638.8969, -493.5531, 16.9359);
- SetPlayerCameraLookAt(playerid, 642.8041, -502.7581, 16.0643);
- SetPlayerPos(playerid, 637.978820, -493.737030, 16.335937);
- TogglePlayerControllable(playerid, 0);
- ViewingMicksCar[playerid] = 0;
- format(gstr, sizeof(gstr), "Vehicle Name: %s\nPrice: $%s\n\nPress F6 And Type /Exit To Quit The Shop", GetVehicleNameEx(MicksVehicleData[0][0]), format_cash(MicksVehicleData[0][1]));
- ViewingMicksCarID[playerid] = CreateVehicle(MicksVehicleData[0][0], 643.115173, -501.142303, 16.079319, 0.0, -1, -1, -1);
- SetVehicleVirtualWorld(ViewingMicksCarID[playerid], (playerid + 1000));
- Dialog_Show(playerid, ViewCars, DIALOG_STYLE_MSGBOX, "Dillimore Automotive Dealership", gstr, "Next", "Buy");
- return true;
- }
- return true;
- }
- GREENSIDE::BuyBikeFromShop(playerid)
- {
- if(cache_num_rows() >= MAX_VEH_PER_PLAYER) return SysMsg(playerid, "You cannot buy any more vehicles.");
- SetPlayerVirtualWorldEx(playerid, (playerid + 1000));
- SetPlayerCameraPos(playerid, 704.0340, -529.0277, 16.9359);
- SetPlayerCameraLookAt(playerid, 701.2777, -519.4151, 16.9359);
- SetPlayerPos(playerid, 711.845581, -523.327453, 16.335937);
- TogglePlayerControllable(playerid, 0);
- ViewingBuyBikes[playerid] = 0;
- format(gstr, sizeof(gstr), "Vehicle Name: %s\nPrice: $%s\n\nPress F6 And Type /Exit To Quit The Shop", GetVehicleNameEx(BuyMotorbikeData[0][0]), format_cash(BuyMotorbikeData[0][1]));
- ViewingBikeID[playerid] = CreateVehicle(BuyMotorbikeData[0][0], 701.821472, -522.654357, 15.876281, 117.476898, -1, -1, -1); //CarSelection
- SetVehicleVirtualWorld(ViewingBikeID[playerid], (playerid + 1000));
- Dialog_Show(playerid, ViewBikes, DIALOG_STYLE_MSGBOX, "Motorbike Dealership", gstr, "Next", "Buy");
- return true;
- }
- GREENSIDE::BuyBoatFromShop(playerid)
- {
- if(cache_num_rows() >= MAX_VEH_PER_PLAYER) return SysMsg(playerid, "You cannot buy any more vehicles.");
- SetPlayerVirtualWorldEx(playerid, (playerid + 1000));
- SetPlayerCameraPos(playerid, -2184.2893,2434.2036,13.8967);
- SetPlayerCameraLookAt(playerid, -2207.0972, 2424.8665, 0.1369);
- TogglePlayerControllable(playerid, 0);
- format(gstr, sizeof(gstr), "Vehicle Name: %s\nPrice: $%s\n\nPress F6 And Type /Exit To Quit The Shop", GetVehicleNameEx(BuyBoatData[0][0]), format_cash(BuyBoatData[0][1]));
- ViewingBuyBoats[playerid] = 0;
- ViewingBoatID[playerid] = CreateVehicle(BuyBoatData[0][0], -2207.0972, 2424.8665, 0.1369, 44.3222, -1, -1, -1); //CarSelection
- SetVehicleVirtualWorld(ViewingBoatID[playerid], (playerid + 1000));
- Dialog_Show(playerid, ViewBoats, DIALOG_STYLE_MSGBOX, "Boat Dealership", gstr, "Next", "Buy");
- return true;
- }
- GREENSIDE::ProcessDonationVehicle(playerid, rewardCarModel)
- {
- if(cache_num_rows() >= MAX_VEH_PER_PLAYER) return SysMsg(playerid,"You cannot buy any more vehicles.");
- for(new x = 1, v = GetVehiclePoolSize(); x <= v; x++)
- {
- if(VehicleData[x][VehicleOwnerSQLID] == SQLID[playerid])
- {
- if(VehicleData[x][DonatorCar]) return SysMsg(playerid, "You already have a donor vehicle.");
- }
- }
- new interior, vw;
- interior = GetPlayerInterior(playerid);
- vw = GetPlayerVirtualWorld(playerid);
- if(interior > 0 || vw > 0) return SysMsg(playerid, "Please leave all interiors before requesting a vehicle.");
- new Float:X, Float:Y, Float:Z, Float:A;
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- X += (5 * floatsin(-A, degrees));
- Y += (5 * floatcos(-A, degrees));
- new carid = CreateVehicleEx(rewardCarModel, X, Y, Z, A, 1, 1, -1);
- ToggleVehicleEngine(carid, 0);
- EngineStatus[carid] = 0;
- ProcessVehicleShopPurchase(carid, 0, rewardCarModel, playerid, 1);
- MySQLUpdateInt(SQLID[playerid], "DonationCarModel", 0, "players");
- new info[128];
- format(info, sizeof(info), "{FFFFFF}Your donor vehicle was collected: {E0BA2A}%s", GetVehicleNameEx(rewardCarModel));
- ShowMessage(playerid, "Vehicle Donate", info, "Thank you!");
- return true;
- }
- //come? da parte 7
- GREENSIDE::SetCDV(playerid, Car, vehicleid)
- {
- new nextchange = cache_get_field_content_int(0, "NextChangable");
- if(nextchange > gettime()) return SysMsgF(playerid, "You may not change this vehicle for another %i minutes.", floatround((nextchange - gettime())/60));
- if(VehicleData[vehicleid][VehicleModel] == Car) return SysMsg(playerid, "You already have this vehicle.");
- new AutoDenyVehicles[84] =
- {
- 406, 407, 408, 416, 417, 425, 427, 428, 430, 431, 432, 433, 435, 437, 441, 443, 444, 447, 449, 450, 460, 464, 465, 476, 486,
- 488, 490, 493, 494, 497, 501, 502, 503, 511, 512, 513, 519, 520, 522, 523, 528, 532, 537, 538, 539, 544, 548, 553, 556, 557,
- 563, 564, 569, 570, 573, 574, 577, 582, 584, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 601, 606, 607, 608, 610, 611
- };
- for(new dv = 0; dv < sizeof(AutoDenyVehicles); dv++)
- {
- if(AutoDenyVehicles[dv] == Car) return SysMsg(playerid,"That vehicle is either no longer being accepted or has been blocked from selection.");
- }
- if(IsDonator[playerid] == 3)
- {
- new acceptablevehicle = 0;
- if(Car == 541) acceptablevehicle = 1;
- if(Car == 521) acceptablevehicle = 1;
- if(Car == 487) acceptablevehicle = 1;
- if(acceptablevehicle == 0)
- {
- for(new x = 0; x < sizeof(BuyMotorbikeData); x++)
- {
- if(BuyMotorbikeData[x][0] == Car)
- {
- acceptablevehicle = 1;
- break;
- }
- }
- }
- if(acceptablevehicle == 0)
- {
- for(new x = 0; x < sizeof(BuyBoatData); x++)
- {
- if(BuyBoatData[x][0] == Car)
- {
- acceptablevehicle = 1;
- break;
- }
- }
- }
- if(acceptablevehicle == 0)
- {
- for(new x = 0; x < sizeof(MicksVehicleData); x++)
- {
- if(MicksVehicleData[x][0] == Car)
- {
- acceptablevehicle = 1;
- break;
- }
- }
- }
- if(acceptablevehicle == 0) return SysMsg(playerid, "You cannot have this vehicle at your donator level.");
- }
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET VehicleModel = %i, ChangeDVeh = 0, NextChangable = %i WHERE id = %i", Car, gettime() + 21600, VehicleData[vehicleid][VehSQLID]);
- mysql_pquery(conn, mquery);
- for(new x = 0; x < 14; x++)
- {
- VehicleData[vehicleid][VehicleMod][x] = 0;
- }
- SavePlayerVehicles(playerid, 0);
- SendClientMessageF(playerid, COLOR_WHITE, "Your donator vehicle has been changed to a(n) %s. Please relog for this change to take effect.", GetVehicleNameEx(Car));
- if(Car == 481 || Car == 509 || Car == 510) SendClientMessageF(playerid, COLOR_WHITE, "Keep in mind that if you abuse your bike, you will suffer a permanent bike ban which cannot be removed. Do not abuse it. The ban won't be removed under any circumstances.", GetVehicleNameEx(Car));
- return true;
- }
- GREENSIDE::DelayedVehicleDeath(vehicleid)
- {
- DestroyVehicleEx(vehicleid, "vehicleid 2");
- return true;
- }
- GREENSIDE::ShowTrunkGuns(playerid)
- {
- gstr[0] = EOS;
- if(cache_num_rows() == 0) return SysMsg(playerid, "There are no weapons in this vehicle.");
- else
- {
- new weapon, ammo, id;
- for(new w = 0, x = cache_num_rows(); w < x; w++)
- {
- id = cache_get_field_content_int(w, "id");
- weapon = cache_get_field_content_int(w, "WeaponID");
- ammo = cache_get_field_content_int(w, "WeaponAmmo");
- if(IsActualGun(weapon)) format(sgstr, sizeof(sgstr), "{89B9D9}%i. %s{FFFFFF} with %i ammo. (ID: %i)\n", w+1, GetWeaponNameFromID(weapon), ammo, id);
- else format(sgstr, sizeof(sgstr), "{89B9D9}%i. %s{FFFFFF}. (ID: %i)\n", w+1, GetWeaponNameFromID(weapon), ammo, id);
- strcat(gstr, sgstr);
- }
- ShowMessage(playerid, "Weapon List", gstr, "Ok");
- }
- return true;
- }
- GREENSIDE::ToggleVehicleAlarm(vehicleid, toggle)
- {
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(vehicleid, engine, lights, toggle, doors, bonnet, boot, objective);
- return true;
- }
- GREENSIDE::DeliveryContinue(playerid)
- {
- new bizzid = DeliverStockList[playerid][DeliveringStock[playerid] - 2];
- BizzData[bizzid][BizzStock] = 300;
- BizzData[bizzid][BizzRequestStock] = 0;
- BizzData[bizzid][BizzETDelivering] = 0;
- MySQLUpdateInt(BizzData[bizzid][BizzSQLID], "Stock", 100, "bizz");
- MySQLUpdateInt(BizzData[bizzid][BizzSQLID], "RequestStock", 0, "bizz");
- new earnings = IsBizzStockable(bizzid);
- DeliveringStock[playerid] ++;
- DeliveringAtStop[playerid] = 0;
- GivePlayerCash(playerid, earnings);
- SendClientMessageF(playerid, COLOR_WHITE, "%s has successfully been restocked. You have earned {4BB74C}$%i", BizzData[bizzid][BizzDescription], earnings);
- new moveon = 0;
- if(DeliveringStock[playerid] == 5)
- {
- moveon = 0;
- }
- else if(DeliverStockList[playerid][DeliveringStock[playerid] - 2] > 0)
- {
- moveon = 1;
- }
- if(moveon == 1)
- {
- bizzid = DeliverStockList[playerid][DeliveringStock[playerid] - 2];
- SendClientMessageF(playerid, COLOR_LIGHTGREEN, "[Business Stock Delivery %i] Delivering %s to %s", DeliveringStock[playerid] - 1, GetBizzDeliveryItem(bizzid), BizzData[bizzid][BizzDescription]);
- DisablePlayerRaceCheckpoint(playerid);
- SetPlayerRaceCheckpoint(playerid, 2, BizzData[bizzid][oPosX], BizzData[bizzid][oPosY], BizzData[bizzid][oPosZ], 0.0, 0.0, 0.0, 20.0);
- }
- else
- {
- new bonus = 0;
- if(DeliverStockList[playerid][0] > 0) bonus += 200;
- if(DeliverStockList[playerid][1] > 0) bonus += 350;
- if(DeliverStockList[playerid][2] > 0) bonus += 450;
- DisablePlayerRaceCheckpoint(playerid);
- GivePlayerCash(playerid, bonus);
- SendClientMessageF(playerid, COLOR_LIGHTGREEN, "You have completed all of your delivery locations, the job is now finished and you get a bonus of $%i.", bonus);
- DeliveringStock[playerid] = 0;
- DeliveringAtStop[playerid] = 0;
- DeliverStockList[playerid][0] = 0;
- DeliverStockList[playerid][1] = 0;
- DeliverStockList[playerid][2] = 0;
- }
- return true;
- }
- GREENSIDE::BusRouteContinue(playerid)
- {
- BusRouteIndex[playerid] ++;
- WaitingAtStop{playerid} = false;
- GivePlayerCash(playerid, 10);
- ShowInfoText(playerid,"~W~+~G~$10",2000);
- DisablePlayerRaceCheckpoint(playerid);
- SetPlayerRaceCheckpoint(playerid, 2, BusRoute[BusRouteIndex[playerid]][0], BusRoute[BusRouteIndex[playerid]][1], BusRoute[BusRouteIndex[playerid]][2], 0.0, 0.0, 0.0, 5.0);
- new busBizzID = GetBizzID("Red County Transport LTD");
- if(busBizzID != -1)
- {
- BizzData[busBizzID][BizzEarnings] += 10;
- MySQLUpdateInt(BizzData[busBizzID][BizzSQLID], "BizzEarnings", BizzData[busBizzID][BizzEarnings], "bizz");
- }
- }
- GREENSIDE::ProcessPhonebookRequest(playerid, name[])
- {
- new NumbersFound = cache_num_rows();
- if(NumbersFound == 0) return SendClientMessageF(playerid, COLOR_WHITE, "There was 0 phone numbers found for the name: '%s'.", name);
- new ResultName[24], ResultNumber[20];
- SendClientMessageF(playerid, COLOR_WHITE, "There was %i phone numbers found for the name: '%s', they are listed below:", NumbersFound, name);
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "OwnerName", ResultName);
- cache_get_field_content(i, "PhoneNumber", ResultNumber);
- SendClientMessageF(playerid, COLOR_WHITE, "%s - %i", ResultName, strval(ResultNumber));
- }
- return true;
- }
- stock GetContactsCount(playerid)
- {
- new count = 0;
- for(new i = 0; i < MAX_PHONECONTACTS; i++)
- {
- if(PhoneContacts[playerid][i][cID] != 0) count ++;
- }
- return count;
- }
- stock GetMaxContactLimitForPlayer(playerid)
- {
- switch(IsDonator[playerid])
- {
- case 0: return 10;
- case 1: return 15;
- case 2: return 20;
- case 3: return 25;
- case 4: return MAX_PHONECONTACTS;
- }
- return 10;
- }
- stock DisplayPhoneMenu(playerid)
- {
- new caption[40];
- gstr[0] = EOS;
- format(caption, sizeof(caption), "Phone Menu (My #: %i)", PhoneData[playerid][pNumber]);
- strcat(gstr, "Call\nSMS\nView SMS History\nManage Contacts\n");
- if(PhoneData[playerid][pPower] == 0) strcat(gstr, "Turn On\n");
- else strcat(gstr, "Turn Off\n");
- strcat(gstr, "Phone Details");
- Dialog_Show(playerid, PhoneMenu, DIALOG_STYLE_LIST, caption, gstr, "Select", "Exit");
- return true;
- }
- GREENSIDE::LoadPlayerPhone(playerid)
- {
- if(cache_num_rows())
- {
- PhoneData[playerid][PhonePossession] = cache_get_field_content_int(0, "PhonePossession");
- PhoneData[playerid][pOwnerSQLID] = cache_get_field_content_int(0, "OwnerSQLID");
- PhoneData[playerid][pPosessorID] = cache_get_field_content_int(0, "PhonePossessor");
- PhoneData[playerid][pID] = cache_get_field_content_int(0, "id");
- PhoneData[playerid][pNumber] = cache_get_field_content_int(0, "PhoneNumber");
- PhoneData[playerid][pBattery] = cache_get_field_content_float(0, "Battery");
- PhoneData[playerid][pCredit] = cache_get_field_content_int(0, "PhoneCredit");
- PhoneData[playerid][pPower] = cache_get_field_content_int(0, "PhonePower");
- PhoneData[playerid][ShowPhonebook] = bool:cache_get_field_content_int(0, "ShowPhonebook");
- cache_get_field_content(0, "OwnerName", PhoneData[playerid][pOwnerName], conn, 24);
- Inventory[playerid][MobilePhone] = 1;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM phonecontacts WHERE PhoneNumber = %i LIMIT %i", PhoneData[playerid][pNumber], GetMaxContactLimitForPlayer(playerid));
- mysql_pquery(conn, mquery, "LoadPlayerContacts", "i", playerid);
- }
- return true;
- }
- GREENSIDE::FinishOilChange(playerid, vehicleid)
- {
- VehicleData[vehicleid][LastOilMileage] = VehicleData[vehicleid][Mileage];
- MySQLUpdateFloat(VehicleData[vehicleid][VehSQLID], "LastOilMileage", VehicleData[vehicleid][LastOilMileage], "vehicles");
- RemovePlayerAttachedObject(playerid, HOLD_OBJECT_MISC);
- TogglePlayerControllable(playerid, 1);
- DisablePlayerCheckpoint(playerid);
- ClearAnimations(playerid);
- ToggleVehicleBonnet(vehicleid, 0);
- VehicleBoots[vehicleid][0] = 0;
- ChangeOilPos[playerid][0] = 0.0;
- ChangeOilPos[playerid][1] = 0.0;
- ChangeOilPos[playerid][2] = 0.0;
- ChangeOilVehID[playerid] = 0;
- format(gstr, sizeof(gstr),"* %s has changed the %s's engine oil and closed the bonnet. *", NameRP(playerid), GetVehicleName(vehicleid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- return true;
- }
- /*GREENSIDE::CheckIPIRC(botid, channel[], str[])
- {
- IRC_SayF(botid, channel, "8Account names that match that IP [%s]:", str);
- if(!cache_num_rows()) return IRC_Say(botid, channel, "8None");
- new char_name[MAX_PLAYER_NAME];
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "Name", char_name);
- IRC_SayF(botid, channel, "8%s", char_name);
- }
- return true;
- }
- GREENSIDE::CheckSerialIRC(botid, channel[], serial[])
- {
- IRC_SayF(botid, channel, "8Account names that match that serial [%s]:", serial);
- if(!cache_num_rows()) return IRC_Say(botid, channel, "8None");
- new char_name[MAX_PLAYER_NAME];
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "Name", char_name);
- IRC_SayF(botid, channel, "8%s", char_name);
- }
- return true;
- }*/
- GREENSIDE::CheckDeath(playerid)
- {
- if(Dead{playerid})
- {
- SetPlayerPos(playerid, TempInfo[playerid][tmX], TempInfo[playerid][tmY], TempInfo[playerid][tmZ]);
- SetPlayerInterior(playerid, TempInfo[playerid][tInt]);
- SetPlayerVirtualWorldEx(playerid, TempInfo[playerid][tVW]);
- SetPlayerHealthEx(playerid, 15);
- SetPlayerSkinEx(playerid, TempInfo[playerid][tSkin]);
- TogglePlayerControllable(playerid, false);
- OnePlayAnim(playerid, "SWEET", "Sweet_injuredloop", 4.0, 1, 0, 0, 0, 0);
- SendSplitMessage(playerid, COLOR_WHITE, "You have been {E20000}downed.{FFFFFF} You may chose to {44C300}/accept death{FFFFFF} after your death timer expires or wait until you are healed.");
- new jbstring[50];
- format(jbstring, 50, "Player injured, use /injuries %i to examine.", playerid);
- LabelFerido[playerid] = CreateDynamic3DTextLabel(jbstring, COLOR_WHITE, 0.0, 0.0, 0.0, 20.0, playerid);
- SyncPlayerWeapons(playerid);
- Dead{playerid} = true;
- new weapon_count = 0, w;
- for(w = 1; w < MAX_TOTAL_WEAPONS; w++)
- {
- if(IsActualGun(WeaponData[playerid][w][Weapon])) weapon_count ++;
- }
- if(weapon_count > 0)
- {
- for(new we = 0; we < MAX_TOTAL_WEAPONS; we++)
- {
- if(WeaponData[playerid][we][Weapon] > 1)
- {
- GivePlayerWeaponEx(playerid, WeaponData[playerid][we][Weapon], WeaponData[playerid][we][WeaponAmmo], 5);
- break;
- }
- }
- }
- }
- return true;
- }
- GREENSIDE::DeathLog(playerid)
- {
- SetPlayerSkinEx(playerid, cPlayersSkin[playerid]);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- SyncPlayerWeapons(playerid);
- SetTimerEx("AnimTimer", 100, 0, "d", playerid);
- return true;
- }
- GREENSIDE::OnPlayerFish(playerid, type)
- {
- if(!IsPlayerConnected(playerid) || IsPlayerNPC(playerid)) return true;
- new Random = random(16);
- if(AttachedObjects[playerid][7][aoModelID] == 18632)
- {
- RemovePlayerAttachedObject(playerid, 7);
- AttachedObjects[playerid][7][aoModelID] = 0;
- AttachedObjects[playerid][7][aoBone] = 0;
- }
- FishSpamTime[playerid] = 0;
- if(type == 1) //pier
- {
- if(Random == 1)
- {
- SendClientMessage(playerid, COLOR_BLUE, "You have reeled in some seaweed. You throw it back in.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 3)
- {
- SendClientMessage(playerid, COLOR_BLUE, "You have reeled in a rusty can. You throw it back in.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 4)
- {
- SendClientMessage(playerid, COLOR_BLUE, "You have reeled in an old smashed TV. You throw it back in.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 5)
- {
- SendClientMessage(playerid, COLOR_BLUE, "You have reeled in a flat car tire. You throw it back in.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 7)
- {
- SendClientMessage(playerid, COLOR_BLUE, "You have reeled in a propeller. You throw it back in.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 8)
- {
- SendClientMessage(playerid, COLOR_BLUE, "You have reeled in a broken fire extinguisher. You throw it back in.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 9)
- {
- SendClientMessage(playerid, COLOR_BLUE, "You have reeled in glass bottle. You throw it back in.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 11)
- {
- SendClientMessage(playerid, COLOR_BLUE, "You have reeled in a dead fish. You throw it back in.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 13)
- {
- SendClientMessage(playerid, COLOR_BLUE, "You have reeled in a plank of wood. You throw it back in.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 14)
- {
- SendClientMessage(playerid, COLOR_BLUE, "You have reeled in a Cola bottle. You throw it back in.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 15)
- {
- new CashRand = random(500);
- format(gstr, sizeof(gstr),"You have reeled in a bag of money. You found $%i.",CashRand);
- SendClientMessage(playerid,COLOR_BLUE,gstr);
- GivePlayerCash(playerid,CashRand);
- TogglePlayerControllable(playerid,1);
- return true;
- }
- new FishNameId,WeightRegion,Weight;
- FishNameId = random(sizeof(FishNames));
- WeightRegion = random(3);
- if(WeightRegion == 0)
- {
- format(gstr, sizeof(gstr),"* %s has caught a small sized %s. *",NameRP(playerid),FishNames[FishNameId]);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- Weight = random(7) + random(7) + 1; //max 15
- }
- else if(WeightRegion == 1)
- {
- format(gstr, sizeof(gstr),"* %s has caught a reasonably sized %s. *",NameRP(playerid),FishNames[FishNameId]);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- Weight = random(10) + random(10) + 10; //max 30
- }
- else if(WeightRegion == 2)
- {
- format(gstr, sizeof(gstr),"* %s has caught a large sized %s. *",NameRP(playerid),FishNames[FishNameId]);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- Weight = random(20) + random(20) + 20; //max 60
- }
- format(gstr, sizeof(gstr),"You have caught a %s weighing %i Lbs.",FishNames[FishNameId],Weight);
- SendClientMessage(playerid,COLOR_BLUE,gstr);
- if(Weight > BiggestFish[playerid])
- {
- format(gstr, sizeof(gstr),"You have beaten your biggest fish record: Was %i Lbs, Now %i Lbs",BiggestFish[playerid],Weight);
- SendClientMessage(playerid,COLOR_BLUE,gstr);
- BiggestFish[playerid] = Weight;
- MySQLUpdateInt(SQLID[playerid], "BiggestFish", BiggestFish[playerid], "players");
- }
- UnlockAchievement(playerid,18);
- if(Weight >= 50)
- {
- UnlockAchievement(playerid,19);
- }
- new SlotToUse = -1;
- if(FishWeight[playerid][0] == -1) SlotToUse = 0;
- else if(FishWeight[playerid][1] == -1) SlotToUse = 1;
- else if(FishWeight[playerid][2] == -1) SlotToUse = 2;
- else if(FishWeight[playerid][3] == -1) SlotToUse = 3;
- else if(FishWeight[playerid][4] == -1) SlotToUse = 4;
- FishWeight[playerid][SlotToUse] = Weight;
- format(FishName[playerid][SlotToUse], 12, FishNames[FishNameId]);
- new str[14];
- format(str, sizeof(str), "Fish%iName", SlotToUse + 1);
- MySQLUpdateString(SQLID[playerid], str, FishName[playerid][SlotToUse], "players");
- format(str, sizeof(str), "Fish%iWeight", SlotToUse + 1);
- MySQLUpdateInt(SQLID[playerid], str, FishWeight[playerid][SlotToUse], "players");
- SendClientMessageF(playerid, COLOR_BLUE, "You put the %s into fish slot %i. Type /fishes to view all your caught fish.",FishNames[FishNameId],SlotToUse+1);
- FishSpamTime[playerid] = 0;
- TogglePlayerControllable(playerid,1);
- ClearAnimations(playerid, 1);
- return true;
- }
- if(type == 2) //reefer
- {
- if(Random <= 5)
- {
- SendClientMessage(playerid, COLOR_BLUE, "You have reeled in some seaweed. You throw it back in.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 6)
- {
- SendClientMessage(playerid, COLOR_BLUE, "You have reeled in a rusty can. You throw it back in.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 7)
- {
- SendClientMessage(playerid, COLOR_BLUE, "You have reeled in a flat car tire. You throw it back in.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 8)
- {
- SendClientMessage(playerid, COLOR_BLUE, "You have reeled in a dead fish. You throw it back in.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 9)
- {
- SendClientMessage(playerid, COLOR_BLUE, "Line Snapped! You put a new Line on the Rod.");
- TogglePlayerControllable(playerid,1);
- return true;
- }
- else if(Random == 15)
- {
- new CashRand = random(1000);
- SendClientMessageF(playerid, COLOR_BLUE, "You have reeled in a bag of money. You found $%i.",CashRand);
- GivePlayerCash(playerid,CashRand);
- TogglePlayerControllable(playerid,1);
- return true;
- }
- new Weight, WeightRegion, FishNameId, whalechance, bool:haswhale = false, ReeferFishNames[5][12] = {"Shark", "Mackerel", "Swordfish", "Bass", "Pollack"};
- FishNameId = random(sizeof(ReeferFishNames));
- WeightRegion = random(5);
- whalechance = random(1500);
- if(whalechance == 69)
- {
- format(gstr, sizeof(gstr),"* %s has caught a colossal sized whale. *",NameRP(playerid));
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- Weight = random(50000) + random(50000) + 50000; //max 150,000
- haswhale = true;
- SendClientMessageF(playerid, COLOR_BLUE, "You have caught a whale weighing %i Lbs.", Weight);
- }
- if(!haswhale)
- {
- if(WeightRegion == 0 || WeightRegion == 1)
- {
- format(gstr, sizeof(gstr),"* %s has caught a large sized %s. *",NameRP(playerid),ReeferFishNames[FishNameId]);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- Weight = random(20) + random(15) + 15; //max 30ish
- }
- else if(WeightRegion == 2 || WeightRegion == 3)
- {
- format(gstr, sizeof(gstr),"* %s has caught a very large sized %s. *",NameRP(playerid),ReeferFishNames[FishNameId]);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- Weight = random(25) + random(25) + 15; //max 60ish
- }
- else if(WeightRegion == 4)
- {
- format(gstr, sizeof(gstr),"* %s has caught a MASSIVE %s. *",NameRP(playerid),ReeferFishNames[FishNameId]);
- ProxDetector(20.0, playerid, gstr, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE, COLOR_EMOTE);
- Weight = random(50) + random(50) + 50; //max 150
- }
- SendClientMessageF(playerid, COLOR_BLUE, "You have caught a %s weighing %i Lbs.",ReeferFishNames[FishNameId],Weight);
- }
- if(Weight > BiggestFish[playerid])
- {
- SendClientMessageF(playerid, COLOR_BLUE, "You have beaten your biggest fish record: Was %i Lbs, Now %i Lbs",BiggestFish[playerid],Weight);
- BiggestFish[playerid] = Weight;
- MySQLUpdateInt(SQLID[playerid], "BiggestFish", BiggestFish[playerid], "players");
- }
- UnlockAchievement(playerid,18);
- if(Weight >= 50)
- {
- UnlockAchievement(playerid,19);
- }
- new SlotToUse = -1;
- if(FishWeight[playerid][0] == -1) SlotToUse = 0;
- else if(FishWeight[playerid][1] == -1) SlotToUse = 1;
- else if(FishWeight[playerid][2] == -1) SlotToUse = 2;
- else if(FishWeight[playerid][3] == -1) SlotToUse = 3;
- else if(FishWeight[playerid][4] == -1) SlotToUse = 4;
- FishWeight[playerid][SlotToUse] = Weight;
- FishName[playerid][SlotToUse] = ReeferFishNames[FishNameId];
- new str[14];
- format(str, sizeof(str), "Fish%iName", SlotToUse + 1);
- MySQLUpdateString(SQLID[playerid], str, FishName[playerid][SlotToUse], "players");
- format(str, sizeof(str), "Fish%iWeight", SlotToUse + 1);
- MySQLUpdateInt(SQLID[playerid], str, FishWeight[playerid][SlotToUse], "players");
- SendClientMessageF(playerid, COLOR_BLUE, "You put the %s into fish slot %i. Type /fishes to view all your caught fish.",ReeferFishNames[FishNameId],SlotToUse+1);
- FishSpamTime[playerid] = 0;
- TogglePlayerControllable(playerid,1);
- }
- return true;
- }
- GREENSIDE::StopLoopingAnim(playerid)
- {
- gPlayerUsingLoopingAnim[playerid] = 0;
- TextDrawHideForPlayer(playerid,txtAnimHelper);
- ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0, 1);
- }
- stock GetOffsetFromDynamicObject(Float:posX, Float:posY, Float:posZ, objectid, &Float:X, &Float:Y, &Float:Z)
- {
- new Float:pX, Float:pY, Float:pZ;
- GetDynamicObjectPos(objectid, pX, pY, pZ);
- new Float:rX, Float:rY, Float:rZ;
- GetDynamicObjectRot(objectid, rX, rY, rZ);
- new Float:oX, Float:oY;
- oX = posX - pX;
- oY = posY - pY;
- X = oX*floatcos(rZ, degrees)+oY*floatsin(rZ, degrees);
- Y = -oX*floatsin(rZ, degrees)+oY*floatcos(rZ, degrees);
- Z = posZ - pZ;
- }
- GREENSIDE::ProcessHouseDoorRequest(playerid)
- {
- if(IsInHouseID[playerid] != -1)
- {
- new h = IsInHouseID[playerid], Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:dist, Float:closestdist = 9999999.0, f = -1;
- for(new p = 0; p < MAX_HFURNITURE; p++)
- {
- if(IsValidDoorObject(HouseData[h][FurnModel][p]))
- {
- GetDynamicObjectPos(HouseData[h][FurnObject][p], x, y, z);
- dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
- if(dist < closestdist)
- {
- f = p;
- closestdist = dist;
- }
- }
- }
- if(f == -1) return SysMsg(playerid, "Error.");
- GetDynamicObjectPos(HouseData[h][FurnObject][f], x, y, z);
- if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z))
- {
- if(HouseData[h][DoorLocked][f]) return SysMsg(playerid, "This door is locked.");
- GetDynamicObjectRot(HouseData[h][FurnObject][f], rx, ry, rz);
- HouseData[h][DoorOpen][f] = !HouseData[h][DoorOpen][f];
- if(!HouseData[h][DoorOpen][f])
- {
- SetDynamicObjectRot(HouseData[h][FurnObject][f], rx, ry, HouseData[h][ZAdjust][f]);
- HouseData[h][ZAdjust][f] = 0.0;
- }
- else
- {
- new Float:pX, Float:pY, Float:pZ, Float:oX, Float:oY, Float:oZ;
- GetPlayerPos(playerid, pX, pY, pZ);
- GetOffsetFromDynamicObject(pX, pY, pZ, HouseData[h][FurnObject][f], oX, oY, oZ);
- if(oY > 0.0) SetDynamicObjectRot(HouseData[h][FurnObject][f], rx, ry, rz - 90);
- else SetDynamicObjectRot(HouseData[h][FurnObject][f], rx, ry, rz + 90);
- HouseData[h][ZAdjust][f] = rz;
- }
- }
- }
- return true;
- }
- GREENSIDE::ProcessFurnitureEmpty()
- {
- new fsql, delete;
- for(new x = 0, i = cache_num_rows(); x < i; x++)
- {
- delete = 1;
- fsql = cache_get_field_content_int(x, "HouseSQLID");
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(HouseData[h][HouseSQLID] == fsql)
- {
- delete = 0;
- break;
- }
- }
- if(delete == 1)
- {
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM hfurniture WHERE HouseSQLID = %i", fsql);
- mysql_pquery(conn, mquery);
- }
- }
- return true;
- }
- GREENSIDE::ShowFurnitureCount(playerid)
- {
- new fc;
- if(!cache_num_rows()) fc = 0;
- else fc = cache_num_rows();
- SendSplitMessageF(playerid, COLOR_WHITE, "You have placed %i objects in your house (placed and unplaced). Your furniture limit is %i, meaning you can place %i more objects before exceeding it.", fc, GetMaxFurnitureForPlayer(playerid), GetMaxFurnitureForPlayer(playerid) - fc);
- return true;
- }
- GREENSIDE::MySQLCreateFurnitureEntry(playerid, ModelID, text[], Price, Donator)
- {
- new sqlfID = -1;
- sqlfID = cache_get_field_content_int(0, "id");
- if(sqlfID >= MAX_FURNITURE) return SysMsg(playerid, "The maximum amount of furniture has been reached.");
- FurniData[sqlfID][fModel] = ModelID;
- format(FurniData[sqlfID][fuName], 50, text);
- FurniData[sqlfID][fPrice] = Price;
- return sqlfID;
- }
- GREENSIDE::DisplayPropertiesList(playerid, pageIndex)
- {
- gstr[0] = EOS;
- if(cache_num_rows())
- {
- new type, forsale, desc[100];
- for(new p = 0, x = cache_num_rows(); p < x; p++)
- {
- type = cache_get_field_content_int(p, "Type");
- forsale = cache_get_field_content_int(p, "ForSale");
- cache_get_field_content(p, "Description", desc);
- if(type == 1) strcat(gstr, "{FF4753}House: {FFFFFF}");
- else if(type == 2) strcat(gstr, "{6896F1}Business: {FFFFFF}");
- strcat(gstr, desc);
- if(forsale == 1) strcat(gstr, " [{BCDCBC}FOR SALE{FFFFFF}]\n");
- else strcat(gstr, " [{BCDCBC}Awaiting Valuation{FFFFFF}]\n");
- }
- if(MemberListIndex[playerid] > 0) strcat(gstr, "{FFD700}< Previous Page");
- if(cache_num_rows() >= 15) strcat(gstr, "\n{FFD700}> Next Page");
- Dialog_Show(playerid, STPropertiesList, DIALOG_STYLE_LIST, "Silver Trading", gstr, "View", "Exit");
- }
- else SendClientMessage(playerid,COLOR_GOLD,"We currently have no acquisitions for sale.");
- return true;
- }
- GREENSIDE::DisplayUnownedPropertiesList(playerid, index)
- {
- if(cache_num_rows() == 0) return SendClientMessage(playerid, COLOR_WHITE, "There are currently no unowned properties for sale.");
- gstr[0] = EOS;
- new description[128], price;
- strcat(gstr, "Address\tCost\n");
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "Description", description);
- price = cache_get_field_content_int(i, "Price");
- format(sgstr, sizeof(gstr), "{FF4753}%s{FFFFFF}\t$%s\n", description, format_cash(price));
- strcat(gstr, sgstr);
- }
- if(MemberListIndex[playerid] > 0) strcat(gstr, "{FFD700}< Previous Page");
- if(cache_num_rows() >= 15) strcat(gstr, "\n{FFD700}> Next Page");
- Dialog_Show(playerid, STUnowned, DIALOG_STYLE_TABLIST_HEADERS, "Unowned Homes", gstr, "Neat!", "");
- return true;
- }
- GREENSIDE::LoadPlayerToys(playerid)
- {
- new id = 0, indexcount = 0;
- for(new i, x = cache_num_rows(); i < x; i++)
- {
- ToyInfo[playerid][id][tID] = cache_get_field_content_int(i, "id");
- ToyInfo[playerid][id][tModelID] = cache_get_field_content_int(i, "tModelID");
- ToyInfo[playerid][id][tOffset][0] = cache_get_field_content_float(i, "tOffsetX");
- ToyInfo[playerid][id][tOffset][1] = cache_get_field_content_float(i, "tOffsetY");
- ToyInfo[playerid][id][tOffset][2] = cache_get_field_content_float(i, "tOffsetZ");
- ToyInfo[playerid][id][tRot][0] = cache_get_field_content_float(i, "tRotX");
- ToyInfo[playerid][id][tRot][1] = cache_get_field_content_float(i, "tRotY");
- ToyInfo[playerid][id][tRot][2] = cache_get_field_content_float(i, "tRotZ");
- ToyInfo[playerid][id][tScale][0] = cache_get_field_content_float(i, "tScaleX");
- ToyInfo[playerid][id][tScale][1] = cache_get_field_content_float(i, "tScaleY");
- ToyInfo[playerid][id][tScale][2] = cache_get_field_content_float(i, "tScaleZ");
- ToyInfo[playerid][id][tBone] = cache_get_field_content_int(i, "tBone");
- ToyInfo[playerid][id][tOptional] = cache_get_field_content_int(i, "tOpt");
- ToyInfo[playerid][id][tMask] = cache_get_field_content_int(i, "tMask");
- ToyInfo[playerid][id][FactionMask] = cache_get_field_content_int(i, "FactionMask");
- ToyInfo[playerid][id][tColor] = cache_get_field_content_int(i, "tColor");
- ToyInfo[playerid][id][tSpawn] = bool:cache_get_field_content_int(i, "tSpawn");
- if(ToyInfo[playerid][id][tSpawn] && indexcount < 6)
- {
- new index = indexcount;
- AttachedObjects[playerid][index][aoToyID] = ToyInfo[playerid][id][tID];
- AttachedObjects[playerid][index][aoModelID] = ToyInfo[playerid][id][tModelID];
- AttachedObjects[playerid][index][aoOffset][0] = ToyInfo[playerid][id][tOffset][0];
- AttachedObjects[playerid][index][aoOffset][1] = ToyInfo[playerid][id][tOffset][1];
- AttachedObjects[playerid][index][aoOffset][2] = ToyInfo[playerid][id][tOffset][2];
- AttachedObjects[playerid][index][aoRot][0] = ToyInfo[playerid][id][tRot][0];
- AttachedObjects[playerid][index][aoRot][1] = ToyInfo[playerid][id][tRot][1];
- AttachedObjects[playerid][index][aoRot][2] = ToyInfo[playerid][id][tRot][2];
- AttachedObjects[playerid][index][aoScale][0] = ToyInfo[playerid][id][tScale][0];
- AttachedObjects[playerid][index][aoScale][1] = ToyInfo[playerid][id][tScale][1];
- AttachedObjects[playerid][index][aoScale][2] = ToyInfo[playerid][id][tScale][2];
- AttachedObjects[playerid][index][aoBone] = ToyInfo[playerid][id][tBone];
- AttachedObjects[playerid][index][aoColor] = ToyInfo[playerid][id][tColor];
- ToyInfo[playerid][id][MaskWorn] = true;
- indexcount ++;
- }
- id ++;
- }
- GivePlayerWeapons(playerid);
- return true;
- }
- GREENSIDE::NewHolsterCheck(playerid, weaponid)
- {
- if(!cache_num_rows())
- {
- new t = GetFreeToyInfoSlot(playerid);
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO toys (tPlayer, tModelID, tOffsetX, tOffsetY, tOffsetZ, tRotX, tRotY, tRotZ, tScaleX, tScaleY, tScaleZ, tBone) VALUES (%i, %i, %f, %f, %f, %f, %f, %f, %f, %f, %f, %i)", SQLID[playerid], dropObjectID[weaponid],
- DefaultHolster[weaponid][0], DefaultHolster[weaponid][1], DefaultHolster[weaponid][2], DefaultHolster[weaponid][3], DefaultHolster[weaponid][4], DefaultHolster[weaponid][5], DefaultHolster[weaponid][6],
- DefaultHolster[weaponid][7], DefaultHolster[weaponid][8], DefaultHolsterBone[weaponid]);
- mysql_pquery(conn, mquery, "SaveNewHolster", "iii", playerid, weaponid, t);
- return true;
- }
- else SyncPlayerWeapons(playerid);
- return true;
- }
- GREENSIDE::SaveNewHolster(playerid, weaponid, slot)
- {
- ToyInfo[playerid][slot][tID] = cache_insert_id();
- ToyInfo[playerid][slot][tModelID] = dropObjectID[weaponid];
- ToyInfo[playerid][slot][tOffset][0] = DefaultHolster[weaponid][0];
- ToyInfo[playerid][slot][tOffset][1] = DefaultHolster[weaponid][1];
- ToyInfo[playerid][slot][tOffset][2] = DefaultHolster[weaponid][2];
- ToyInfo[playerid][slot][tRot][0] = DefaultHolster[weaponid][3];
- ToyInfo[playerid][slot][tRot][1] = DefaultHolster[weaponid][4];
- ToyInfo[playerid][slot][tRot][2] = DefaultHolster[weaponid][5];
- ToyInfo[playerid][slot][tScale][0] = DefaultHolster[weaponid][6];
- ToyInfo[playerid][slot][tScale][1] = DefaultHolster[weaponid][7];
- ToyInfo[playerid][slot][tScale][2] = DefaultHolster[weaponid][8];
- ToyInfo[playerid][slot][tBone] = DefaultHolsterBone[weaponid];
- ToyInfo[playerid][slot][tOptional] = 0;
- SyncPlayerWeapons(playerid);
- return true;
- }
- GREENSIDE::SaveNewMask(playerid, modelid)
- {
- new t = GetFreeToyInfoSlot(playerid);
- ToyInfo[playerid][t][tID] = cache_insert_id();
- ToyInfo[playerid][t][tModelID] = modelid;
- ToyInfo[playerid][t][tOffset][0] = 0.0;
- ToyInfo[playerid][t][tOffset][1] = 0.0;
- ToyInfo[playerid][t][tOffset][2] = 0.0;
- ToyInfo[playerid][t][tRot][0] = 0.0;
- ToyInfo[playerid][t][tRot][1] = 0.0;
- ToyInfo[playerid][t][tRot][2] = 0.0;
- ToyInfo[playerid][t][tScale][0] = 1;
- ToyInfo[playerid][t][tScale][1] = 1;
- ToyInfo[playerid][t][tScale][2] = 1;
- ToyInfo[playerid][t][tBone] = 2;
- ToyInfo[playerid][t][tOptional] = 0;
- ToyInfo[playerid][t][tMask] = 1;
- Inventory[playerid][Mask] = 1;
- MySQLUpdateInt(SQLID[playerid], "HasMask", Inventory[playerid][Mask], "players");
- return true;
- }
- GREENSIDE::InsertHouseFurni(playerid, slot)
- {
- HouseData[IsInHouseID[playerid]][FurnSQLID][slot] = cache_insert_id();
- return true;
- }
- GREENSIDE::InsertExteriorFurni(playerid, slot, house)
- {
- EFurnData[house][EFurnSQLID][slot] = cache_insert_id();
- return true;
- }
- GREENSIDE::ShowHouseGuests(playerid)
- {
- new totalguests = cache_num_rows();
- if(totalguests == 0) return SysMsg(playerid, "You do not have any house guests.");
- gstr[0] = EOS;
- new name[MAX_PLAYER_NAME], login, GuestOnline = 0, col[12];
- for(new i, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "Name", name);
- login = cache_get_field_content_int(i, "LastLogin");
- GuestOnline = 0;
- foreach(Player, p)
- {
- if(strfind(name, GetName(p)) != -1)
- {
- GuestOnline = 1;
- }
- }
- if(GuestOnline == 1) format(col, sizeof(col), "00FF00");
- else format(col, sizeof(col), "FF0000");
- format(sgstr, sizeof(sgstr), "{%s}%s{FFFFFF} Last Login: %s \n", col, name, UnixDate(login, 0, 0));
- strcat(gstr, sgstr);
- }
- format(sgstr, sizeof(sgstr), "House Guests (%i)", totalguests);
- Dialog_Show(playerid, DIALOG_NONE, DIALOG_STYLE_LIST, sgstr, gstr, "Okay", "");
- return true;
- }
- GREENSIDE::ProcessGuestEviction(playerid, h)
- {
- if(cache_num_rows() == 0) return SysMsg(playerid, "This person does not currently live in your house.");
- new sqlid = cache_get_field_content_int(0, "id"), playeronline = 0;
- foreach(new i: Player)
- {
- if(HouseData[h][HouseSQLID] == GuestHouseID[i] && SQLID[i] == sqlid && Logged{i})
- {
- SendClientMessageF(i, COLOR_WHITE, "%s has just evicted you from their house.", NameEx(playerid));
- GuestHouseID[i] = 0;
- if(MySpawnID[i] == 5)
- {
- MySpawnID[i] = 1;
- MySQLUpdateInt(SQLID[i], "MySpawnID", MySpawnID[i], "players");
- }
- playeronline = 1;
- break;
- }
- }
- if(playeronline == 0) MySQLUpdateInt(sqlid, "MySpawnID", 1, "players");
- SendClientMessageF(playerid,COLOR_GOLD,"You have evicted %s from your house.", GetSQLName(sqlid));
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET GuestHouseID = 0 WHERE id = %i", sqlid);
- mysql_pquery(conn, mquery);
- return true;
- }
- GREENSIDE::ShowHouseGuns(playerid)
- {
- if(cache_num_rows() == 0) return SysMsg(playerid, "You have no weapons in your house.");
- new weapons[750], substr[75], weapon, ammo, id;
- strcat(weapons, "{FFFFFF}You have the following weapons in your house:\n\n");
- for(new w = 0, x = cache_num_rows(); w < x; w++)
- {
- id = cache_get_field_content_int(w, "id");
- weapon = cache_get_field_content_int(w, "WeaponID");
- ammo = cache_get_field_content_int(w, "WeaponAmmo");
- format(substr, sizeof(substr), "{89B9D9}%i. %s{FFFFFF} with %i ammo. (ID: %i)\n", w+1, GetWeaponNameFromID(weapon), ammo, id);
- strcat(weapons, substr);
- }
- ShowMessage(playerid, "House Weapons", weapons, "Close");
- return true;
- }
- GREENSIDE::IsHouseOwner(playerid, houseid)
- {
- for(new x = 0; x < MAX_HOUSE_PER_PLAYER; x++)
- {
- if(HasHouseKey[playerid][x] == houseid && HasHouseKey[playerid][x] != -1) return true;
- }
- return false;
- }
- GREENSIDE::IsHouseOwnerSQL(playerid, houseid)
- {
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(HouseData[h][HouseSQLID] == houseid && HouseData[h][HouseOwnerSQLID] == SQLID[playerid]) return true;
- }
- return false;
- }
- GREENSIDE::IsHouseGuest(playerid)
- {
- if(SQLID[playerid] == 0) return false;
- if(GuestHouseID[playerid] == 0) return false;
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(HouseData[h][HouseSQLID] == GuestHouseID[playerid]) return h;
- }
- return false;
- }
- GREENSIDE::IsHouseGuestSQL(playerid)
- {
- if(SQLID[playerid] == 0) return false;
- if(GuestHouseID[playerid] == 0) return false;
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(HouseData[h][HouseSQLID] == GuestHouseID[playerid]) return HouseData[h][HouseSQLID];
- }
- return false;
- }
- GREENSIDE::LoadFactions()
- {
- new InitialTicks = GetTickCount();
- for(new f = 0, r = cache_num_rows(); f < r; f++)
- {
- new fact = cache_get_field_content_int(f, "id");
- FACTIONS[fact][FactionId] = fact;
- cache_get_field_content(f, "FactionName", FACTIONS[fact][FactionName], conn, 32);
- cache_get_field_content(f, "FNameShort", FACTIONS[fact][FNameShort], conn, 32);
- FACTIONS[fact][FactionLeader] = cache_get_field_content_int(f, "Leader");
- FACTIONS[fact][FactionLeaderRank] = cache_get_field_content_int(f, "LeaderRank");
- FACTIONS[fact][FactionUberLeaderRank] = cache_get_field_content_int(f, "UberLeaderRank");
- FACTIONS[fact][FactionSpawn1][0] = cache_get_field_content_float(f, "Spawn1X");
- FACTIONS[fact][FactionSpawn1][1] = cache_get_field_content_float(f, "Spawn1Y");
- FACTIONS[fact][FactionSpawn1][2] = cache_get_field_content_float(f, "Spawn1Z");
- FACTIONS[fact][FactionSpawn1][3] = cache_get_field_content_float(f, "Spawn1A");
- FACTIONS[fact][FactionSpawn2][0] = cache_get_field_content_float(f, "Spawn2X");
- FACTIONS[fact][FactionSpawn2][1] = cache_get_field_content_float(f, "Spawn2Y");
- FACTIONS[fact][FactionSpawn2][2] = cache_get_field_content_float(f, "Spawn2Z");
- FACTIONS[fact][FactionSpawn2][3] = cache_get_field_content_float(f, "Spawn2A");
- FACTIONS[fact][FactionSpawn3][0] = cache_get_field_content_float(f, "Spawn3X");
- FACTIONS[fact][FactionSpawn3][1] = cache_get_field_content_float(f, "Spawn3Y");
- FACTIONS[fact][FactionSpawn3][2] = cache_get_field_content_float(f, "Spawn3Z");
- FACTIONS[fact][FactionSpawn3][3] = cache_get_field_content_float(f, "Spawn3A");
- FACTIONS[fact][FactionSpawn4][0] = cache_get_field_content_float(f, "Spawn4X");
- FACTIONS[fact][FactionSpawn4][1] = cache_get_field_content_float(f, "Spawn4Y");
- FACTIONS[fact][FactionSpawn4][2] = cache_get_field_content_float(f, "Spawn4Z");
- FACTIONS[fact][FactionSpawn4][3] = cache_get_field_content_float(f, "Spawn4A");
- FACTIONS[fact][FactionSpawn5][0] = cache_get_field_content_float(f, "Spawn5X");
- FACTIONS[fact][FactionSpawn5][1] = cache_get_field_content_float(f, "Spawn5Y");
- FACTIONS[fact][FactionSpawn5][2] = cache_get_field_content_float(f, "Spawn5Z");
- FACTIONS[fact][FactionSpawn5][3] = cache_get_field_content_float(f, "Spawn5A");
- FACTIONS[fact][FactionSpawnVW][0] = cache_get_field_content_int(f, "Spawn1VW");
- FACTIONS[fact][FactionSpawnVW][1] = cache_get_field_content_int(f, "Spawn2VW");
- FACTIONS[fact][FactionSpawnVW][2] = cache_get_field_content_int(f, "Spawn3VW");
- FACTIONS[fact][FactionSpawnVW][3] = cache_get_field_content_int(f, "Spawn4VW");
- FACTIONS[fact][FactionSpawnVW][4] = cache_get_field_content_int(f, "Spawn5VW");
- FACTIONS[fact][FactionSpawnInt][0] = cache_get_field_content_int(f, "Spawn1Int");
- FACTIONS[fact][FactionSpawnInt][1] = cache_get_field_content_int(f, "Spawn2Int");
- FACTIONS[fact][FactionSpawnInt][2] = cache_get_field_content_int(f, "Spawn3Int");
- FACTIONS[fact][FactionSpawnInt][3] = cache_get_field_content_int(f, "Spawn4Int");
- FACTIONS[fact][FactionSpawnInt][4] = cache_get_field_content_int(f, "Spawn5Int");
- cache_get_field_content(f, "Spawn1Name", FACTIONS[fact][FactionSpawn1Name], conn, 32);
- cache_get_field_content(f, "Spawn2Name", FACTIONS[fact][FactionSpawn2Name], conn, 32);
- cache_get_field_content(f, "Spawn3Name", FACTIONS[fact][FactionSpawn3Name], conn, 32);
- cache_get_field_content(f, "Spawn4Name", FACTIONS[fact][FactionSpawn4Name], conn, 32);
- cache_get_field_content(f, "Spawn5Name", FACTIONS[fact][FactionSpawn5Name], conn, 32);
- FACTIONS[fact][FactionIsGang] = cache_get_field_content_int(f, "IsGang");
- FACTIONS[fact][FactionIsActive] = cache_get_field_content_int(f, "IsActive");
- FACTIONS[fact][FactionBankBalance] = cache_get_field_content_int(f, "BankBalance");
- FACTIONS[fact][FactionRadioChannel] = cache_get_field_content_int(f, "RadioChannel");
- FACTIONS[fact][FactionPayDayTax] = cache_get_field_content_int(f, "PayDayTax");
- FACTIONS[fact][FactionWeaponTime] = cache_get_field_content_int(f, "WeaponTime");
- new jbstring[10];
- for(new i; i != MAX_FACTION_DOORS; i++) {
- format(jbstring, 10, "door%i", i);
- FACTIONS[fact][FactionDoors][i] = cache_get_field_content_int(f, jbstring) - 1;
- }
- for(new x = 0; x < 15; x++)
- {
- format(tgstr, 12, "RankName%i", x + 1);
- cache_get_field_content(f, tgstr, FactionRanks[fact][x], conn, 32);
- format(tgstr, 12, "Skin%i", x+1);
- FACTIONS[fact][FactionSkins][x] = cache_get_field_content_int(f, tgstr);
- format(tgstr, 12, "Rank%iPay", x + 1);
- FACTIONS[fact][FactionRankPay][x] = cache_get_field_content_int(f, tgstr);
- }
- GetFMOTD(fact);
- }
- printf("%i facções carregadas. [%is]", cache_num_rows(), GetTickCount() - InitialTicks);
- return true;
- }
- GREENSIDE::LoadFactionDoors() {
- new InitialTicks = GetTickCount();
- for(new f = 0, r = cache_num_rows(); f != r; f++)
- {
- new door = cache_get_field_content_int(f, "id") - 1;
- FacDoor[door][fdPosA][0] = cache_get_field_content_float(f, "Ax");
- FacDoor[door][fdPosA][1] = cache_get_field_content_float(f, "Ay");
- FacDoor[door][fdPosA][2] = cache_get_field_content_float(f, "Az");
- FacDoor[door][fdPosA][3] = cache_get_field_content_float(f, "Ar");
- FacDoor[door][fdPosF][0] = cache_get_field_content_float(f, "Fx");
- FacDoor[door][fdPosF][1] = cache_get_field_content_float(f, "Fy");
- FacDoor[door][fdPosF][2] = cache_get_field_content_float(f, "Fz");
- FacDoor[door][fdPosF][3] = cache_get_field_content_float(f, "Fr");
- FacDoor[door][fdStatus] = cache_get_field_content_int(f, "Status");
- FacDoor[door][fdModel] = cache_get_field_content_int(f, "Model");
- if(!FacDoor[door][fdStatus]) {
- FacDoor[door][fdID] = CreateDynamicObject(FacDoor[door][fdModel], FacDoor[door][fdPosF][0], FacDoor[door][fdPosF][1], FacDoor[door][fdPosF][2], 0.0, 0.0, FacDoor[door][fdPosF][3]);
- } else {
- FacDoor[door][fdID] = CreateDynamicObject(FacDoor[door][fdModel], FacDoor[door][fdPosA][0], FacDoor[door][fdPosA][1], FacDoor[door][fdPosA][2], 0.0, 0.0, FacDoor[door][fdPosA][3]);
- }
- }
- printf("%i portas de facções carregadas. [%is]", cache_num_rows(), GetTickCount() - InitialTicks);
- return true;
- }
- GREENSIDE::LoadFactionVehicles()
- {
- new x = -1, InitialTicks = GetTickCount();
- for(new i, r = cache_num_rows(); i < r; i++)
- {
- x = CreateVehicle(411, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0);
- ClearVehicleData(x);
- FVehicleData[x][FVSQLID] = cache_get_field_content_int(i, "id");
- FVehicleData[x][FVModel] = cache_get_field_content_int(i, "Model");
- FVehicleData[x][FVCol1] = cache_get_field_content_int(i, "Col1");
- FVehicleData[x][FVCol2] = cache_get_field_content_int(i, "Col2");
- FVehicleData[x][FVFaction] = cache_get_field_content_int(i, "Faction");
- FVehicleData[x][FVMinRank] = cache_get_field_content_int(i, "MinRank");
- FVehicleData[x][LocationX] = cache_get_field_content_float(i, "LocationX");
- FVehicleData[x][LocationY] = cache_get_field_content_float(i, "LocationY");
- FVehicleData[x][LocationZ] = cache_get_field_content_float(i, "LocationZ");
- FVehicleData[x][LocationR] = cache_get_field_content_float(i, "LocationR");
- FVehicleData[x][FVInterior] = cache_get_field_content_int(i, "Interior");
- FVehicleData[x][FVWorld] = cache_get_field_content_int(i, "VWorld");
- FVehicleData[x][FTrunkCash] = cache_get_field_content_int(i, "TrunkCash");
- FVehicleData[x][FTrunkWeed] = cache_get_field_content_int(i, "TrunkWeed");
- FVehicleData[x][FTrunkCocaine] = cache_get_field_content_int(i, "TrunkCocaine");
- FVehicleData[x][FTrunkMoonShine] = cache_get_field_content_int(i, "TrunkMoonShine");
- FVehicleData[x][FTrunkPhone] = cache_get_field_content_int(i, "TrunkPhone");
- FVehicleData[x][FVMod][CARMODTYPE_NITRO] = cache_get_field_content_int(i, "FVModNos");
- FVehicleData[x][FVMod][CARMODTYPE_HYDRAULICS] = cache_get_field_content_int(i, "FVModHyd");
- FVehicleData[x][FImpounded] = bool:cache_get_field_content_int(i, "Impounded");
- FVehicleData[x][FImpoundTime] = cache_get_field_content_int(i, "ImpoundTime");
- FVehicleData[x][FImpoundFee] = cache_get_field_content_int(i, "ImpoundFee");
- FVehicleData[x][FImpoundedBy] = cache_get_field_content_int(i, "ImpoundedBy");
- cache_get_field_content(i, "ImpoundReason", FVehicleData[x][FImpoundReason], conn, 32);
- new garage, collecttime, siren;
- garage = cache_get_field_content_int(i, "GarageRepairID");
- collecttime = cache_get_field_content_int(i, "GarageCollectTime");
- siren = cache_get_field_content_int(i, "HasSiren");
- cache_get_field_content(i, "RegPlate", FVehicleData[x][FVRegPlate], conn, MAX_REG_PLATE);
- Locked{x} = bool:cache_get_field_content_int(i, "Locked");
- if(Locked{x}) ToggleVehicleLock(x, true);
- if(!FVehicleData[x][FImpounded] && garage == 0)
- {
- DestroyVehicleEx(x, "x 0");
- FVehicleData[x][FactionVehID] = CreateVehicleEx(FVehicleData[x][FVModel], FVehicleData[x][LocationX], FVehicleData[x][LocationY], FVehicleData[x][LocationZ], FVehicleData[x][LocationR], FVehicleData[x][FVCol1], FVehicleData[x][FVCol2], -1, "", siren);
- SetVehicleNumberPlate(FVehicleData[x][FactionVehID], FVehicleData[x][FVRegPlate]);
- LinkVehicleToInteriorEx(FVehicleData[x][FactionVehID], FVehicleData[x][FVInterior]);
- SetVehicleVirtualWorld(FVehicleData[x][FactionVehID], FVehicleData[x][FVWorld]);
- if(FVehicleData[x][FVGovUnitTog] == 1)
- {
- DestroyDynamic3DTextLabel(FVehicleData[x][FVGovUnit3DText]);
- FVehicleData[x][FVGovUnit3DText] = Text3D:INVALID_3DTEXT_ID;
- }
- FVehicleData[x][FVGovUnitTog] = 0;
- FVehicleData[x][FVGovUnit][0] = 0;
- VehicleBroke[x] = 0;
- Siren{x} = false;
- ELMs{x} = false;
- aspawned{x} = false;
- continue;
- }
- new isin = -1, freeid = -1;
- if(FVehicleData[x][FImpounded])
- {
- for(new a = 0; a < MAX_VEHICLES; a++)
- {
- if(ImpoundData[a][iModel] < 400 && freeid == -1) freeid = a;
- if(strlen(ImpoundData[a][iRegPlate]) >= 1)
- {
- if(strmatch(ImpoundData[a][iRegPlate], FVehicleData[x][FVRegPlate]))
- {
- isin = 1;
- break;
- }
- }
- }
- if(isin == -1)
- {
- new im = freeid;
- ImpoundData[im][iModel] = FVehicleData[x][FVModel];
- ImpoundData[im][iSQLID] = FVehicleData[x][FVSQLID];
- ImpoundData[im][iImpoundedBy] = FVehicleData[x][FImpoundedBy];
- ImpoundData[im][iImpoundFee] = FVehicleData[x][FImpoundFee];
- ImpoundData[im][iImpoundTime] = FVehicleData[x][FImpoundTime];
- ImpoundData[im][iColor1] = FVehicleData[x][FVCol1];
- ImpoundData[im][iColor2] = FVehicleData[x][FVCol2];
- format(ImpoundData[im][iImpoundReason], 64, FVehicleData[x][FImpoundReason]);
- format(ImpoundData[im][iRegPlate], MAX_REG_PLATE, FVehicleData[x][FVRegPlate]);
- ImpoundData[im][iVehType] = 2;
- ImpoundData[im][iFaction] = FVehicleData[x][FVFaction];
- ImpoundData[im][iOwnerSQLID] = 0;
- DestroyVehicleEx(x, "x 1");
- ClearVehicleData(x);
- }
- }
- if(collecttime > 0 && garage >= 1)
- {
- for(new v = 0; v < MAX_VEHICLES; v++)
- {
- if(RepairData[v][rModel] < 400)
- {
- RepairData[v][rModel] = FVehicleData[x][FVModel];
- RepairData[v][rSQLID] = FVehicleData[x][FVSQLID];
- RepairData[v][rOwnerSQLID] = 0;
- RepairData[v][rFaction] = FVehicleData[x][FVFaction];
- format(RepairData[v][rRegPlate], MAX_REG_PLATE, FVehicleData[x][FVRegPlate]);
- RepairData[v][rTime] = collecttime;
- RepairData[v][rGarage] = garage;
- DestroyVehicleEx(x, "x 2");
- ClearVehicleData(x);
- break;
- }
- }
- }
- }
- printf("%i veículos de facção. [%is]", cache_num_rows(), GetTickCount() - InitialTicks);
- return true;
- }
- GREENSIDE::Fire(playerid, sqlid)
- {
- new faction, frank, name[MAX_PLAYER_NAME];
- if(!cache_num_rows()) return SysMsg(playerid, "That player doesn't exist in the database.");
- faction = cache_get_field_content_int(0, "Faction");
- frank = cache_get_field_content_int(0, "FactionRank");
- cache_get_field_content(0, "Name", name);
- if(faction != Faction[playerid]) return SysMsg(playerid, "That player isn't in the same faction as you.");
- if(frank >= FactionRank[playerid]) return SysMsg(playerid, "You can't fire an equal or higher-ranking member of the faction.");
- SendClientMessageF(playerid,COLOR_ORANGE, "You have successfully fired %s.", RPName(name));
- FirePlayer(sqlid, 0);
- return true;
- }
- GREENSIDE::PromoteF(playerid)
- {
- if(!cache_num_rows()) return SysMsg(playerid, "Name not found in the database, please use Firstname_Lastname when searching.");
- new currentFaction, currentRank, actualName[50], sqlid;
- sqlid = cache_get_field_content_int(0, "id");
- currentFaction = cache_get_field_content_int(0, "Faction");
- currentRank = cache_get_field_content_int(0, "FactionRank");
- cache_get_field_content(0, "Name", actualName);
- if(Faction[playerid] != currentFaction) return SysMsg(playerid,"They are not in the same Faction as you.");
- if(currentRank == FACTIONS[Faction[playerid]][FactionUberLeaderRank]) return SysMsg(playerid,"They are already the highest rank.");
- if(currentRank + 1 > FactionRank[playerid]) return SysMsg(playerid,"You cannot promote higher than your current rank.");
- currentRank ++;
- MySQLUpdateInt(sqlid, "FactionRank", currentRank, "players");
- //new oldSub[2], newSub[2], oldRank;
- //oldRank = currentRank - 1;
- //FactionLog(SQLID[playerid], sqlid, 2, oldSub, newSub, oldRank, currentRank, Faction[playerid]);
- SendClientMessageF(playerid,COLOR_ORANGE,"You have promoted %s! They are now rank %i (%s)",actualName,currentRank,GetFactionRankName(Faction[playerid], currentRank));
- return true;
- }
- GREENSIDE::GetPlayerFaction(playerid) return Faction[playerid];
- stock ShowImpoundList(playerid, index)
- {
- new count = 0, sub[100];
- gstr[0] = EOS;
- for(new v = 0, x = MAX_VEHICLES; v < x; v++)
- {
- if(ImpoundData[v][iModel] > 399)
- {
- if(count >= 15 * index && count < 15 * (index + 1))
- {
- if(ImpoundData[v][iImpoundTime] > 0) format(sub, 100, "%s - %i minutes left - $%i release fee\n", GetVehicleNameEx(ImpoundData[v][iModel]), ImpoundData[v][iImpoundTime], ImpoundData[v][iImpoundFee]);
- else format(sub, 100, "%s - AWAITING COLLECTION - $%i release fee\n", GetVehicleNameEx(ImpoundData[v][iModel]), ImpoundData[v][iImpoundFee]);
- strcat(gstr, sub);
- ClothingSelected[playerid][count] = v;
- }
- count ++;
- }
- }
- if(index > 0) strcat(gstr, "\n{FBFF00}<< Previous Page");
- if(count >= 15 * (index + 1)) strcat(gstr, "\n{FBFF00}Next Page >>");
- MemberListIndex[playerid] = index;
- if(count == 0) return SysMsg(playerid,"(( There are no impounded vehicles of online players. ))");
- Dialog_Show(playerid, ImpoundMenu, DIALOG_STYLE_LIST, "All Impounded Vehicles", gstr, "Details", "Exit");
- return true;
- }
- GREENSIDE::LoadImpoundedFVehicle(playerid)
- {
- new x = -1;
- if(cache_num_rows())
- {
- x = CreateVehicle(411, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0);
- ClearVehicleData(x);
- FVehicleData[x][FVSQLID] = cache_get_field_content_int(0, "id");
- FVehicleData[x][FVModel] = cache_get_field_content_int(0, "Model");
- FVehicleData[x][FVCol1] = cache_get_field_content_int(0, "Col1");
- FVehicleData[x][FVCol2] = cache_get_field_content_int(0, "Col2");
- FVehicleData[x][FVFaction] = cache_get_field_content_int(0, "Faction");
- FVehicleData[x][FVMinRank] = cache_get_field_content_int(0, "MinRank");
- FVehicleData[x][LocationX] = cache_get_field_content_float(0, "LocationX");
- FVehicleData[x][LocationY] = cache_get_field_content_float(0, "LocationY");
- FVehicleData[x][LocationZ] = cache_get_field_content_float(0, "LocationZ");
- FVehicleData[x][LocationR] = cache_get_field_content_float(0, "LocationR");
- FVehicleData[x][FVInterior] = cache_get_field_content_int(0, "Interior");
- FVehicleData[x][FVWorld] = cache_get_field_content_int(0, "VWorld");
- FVehicleData[x][FTrunkCash] = cache_get_field_content_int(0, "TrunkCash");
- FVehicleData[x][FTrunkWeed] = cache_get_field_content_int(0, "TrunkWeed");
- FVehicleData[x][FTrunkCocaine] = cache_get_field_content_int(0, "TrunkCocaine");
- FVehicleData[x][FTrunkMoonShine] = cache_get_field_content_int(0, "TrunkMoonShine");
- FVehicleData[x][FTrunkPhone] = cache_get_field_content_int(0, "TrunkPhone");
- FVehicleData[x][FVMod][CARMODTYPE_NITRO] = cache_get_field_content_int(0, "FVModNos");
- FVehicleData[x][FVMod][CARMODTYPE_HYDRAULICS] = cache_get_field_content_int(0, "FVModHyd");
- FVehicleData[x][FImpounded] = false;
- FVehicleData[x][FImpoundTime] = 0;
- FVehicleData[x][FImpoundFee] = 0;
- FVehicleData[x][FImpoundedBy] = 0;
- FVehicleData[x][FImpoundReason][0] = EOS;
- cache_get_field_content(0, "RegPlate", FVehicleData[x][FVRegPlate], conn, MAX_REG_PLATE);
- Locked{x} = bool:cache_get_field_content_int(0, "Locked");
- if(Locked{x}) ToggleVehicleLock(x, true);
- DestroyVehicleEx(x, "x 3");
- FVehicleData[x][FactionVehID] = CreateVehicleEx(FVehicleData[x][FVModel], FVehicleData[x][LocationX], FVehicleData[x][LocationY], FVehicleData[x][LocationZ], 270.0, FVehicleData[x][FVCol1], FVehicleData[x][FVCol2], -1, FVehicleData[x][FVRegPlate]);
- SetVehiclePos(FVehicleData[x][FactionVehID], 626.7276, -593.44635, 16.569581);
- SetVehicleZAngle(FVehicleData[x][FactionVehID], 270.0);
- SetVehicleNumberPlate(FVehicleData[x][FactionVehID], FVehicleData[x][FVRegPlate]);
- FVehicleData[x][TempFVInterior] = FVehicleData[x][FVInterior];
- LinkVehicleToInteriorEx(FVehicleData[x][FactionVehID], 0);
- SetVehicleVirtualWorld(FVehicleData[x][FactionVehID], 0);
- if(FVehicleData[x][FVGovUnitTog] == 1)
- {
- DestroyDynamic3DTextLabel(FVehicleData[x][FVGovUnit3DText]);
- FVehicleData[x][FVGovUnit3DText] = Text3D:INVALID_3DTEXT_ID;
- }
- FVehicleData[x][FVGovUnitTog] = 0;
- FVehicleData[x][FVGovUnit][0] = 0;
- Siren{x} = false;
- ELMs{x} = false;
- aspawned{x} = false;
- DMVCarForPlayer[x] = -1;
- PutPlayerInVehicle(playerid, x, 0);
- }
- return true;
- }
- GREENSIDE::LoadGarageFVehicle(playerid, v)
- {
- new x = -1;
- if(cache_num_rows())
- {
- x = CreateVehicle(411, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0);
- ClearVehicleData(x);
- FVehicleData[x][FVSQLID] = cache_get_field_content_int(0, "id");
- FVehicleData[x][FVModel] = cache_get_field_content_int(0, "Model");
- FVehicleData[x][FVCol1] = cache_get_field_content_int(0, "Col1");
- FVehicleData[x][FVCol2] = cache_get_field_content_int(0, "Col2");
- FVehicleData[x][FVFaction] = cache_get_field_content_int(0, "Faction");
- FVehicleData[x][FVMinRank] = cache_get_field_content_int(0, "MinRank");
- FVehicleData[x][LocationX] = cache_get_field_content_float(0, "LocationX");
- FVehicleData[x][LocationY] = cache_get_field_content_float(0, "LocationY");
- FVehicleData[x][LocationZ] = cache_get_field_content_float(0, "LocationZ");
- FVehicleData[x][LocationR] = cache_get_field_content_float(0, "LocationR");
- FVehicleData[x][FVInterior] = cache_get_field_content_int(0, "Interior");
- FVehicleData[x][FVWorld] = cache_get_field_content_int(0, "VWorld");
- FVehicleData[x][FTrunkCash] = cache_get_field_content_int(0, "TrunkCash");
- FVehicleData[x][FTrunkWeed] = cache_get_field_content_int(0, "TrunkWeed");
- FVehicleData[x][FTrunkPhone] = cache_get_field_content_int(0, "TrunkPhone");
- FVehicleData[x][FTrunkCocaine] = cache_get_field_content_int(0, "TrunkCocaine");
- FVehicleData[x][FTrunkMoonShine] = cache_get_field_content_int(0, "TrunkMoonShine");
- FVehicleData[x][FVMod][CARMODTYPE_NITRO] = cache_get_field_content_int(0, "FVModNos");
- FVehicleData[x][FVMod][CARMODTYPE_HYDRAULICS] = cache_get_field_content_int(0, "FVModHyd");
- FVehicleData[x][FImpounded] = bool:cache_get_field_content_int(0, "Impounded");
- FVehicleData[x][FImpoundTime] = cache_get_field_content_int(0, "ImpoundTime");
- FVehicleData[x][FImpoundFee] = cache_get_field_content_int(0, "ImpoundFee");
- FVehicleData[x][FImpoundedBy] = cache_get_field_content_int(0, "ImpoundedBy");
- cache_get_field_content(0, "ImpoundReason", FVehicleData[x][FImpoundReason], conn, 32);
- cache_get_field_content(0, "RegPlate", FVehicleData[x][FVRegPlate], conn, MAX_REG_PLATE);
- new garage = cache_get_field_content_int(0, "GarageRepairID");
- new siren = cache_get_field_content_int(0, "HasSiren");
- Locked{x} = bool:cache_get_field_content_int(0, "Locked");
- if(Locked{x}) ToggleVehicleLock(x, true);
- DestroyVehicleEx(x, "x 4");
- FVehicleData[x][FactionVehID] = CreateVehicleEx(FVehicleData[x][FVModel], FVehicleData[x][LocationX], FVehicleData[x][LocationY], FVehicleData[x][LocationZ], FVehicleData[x][LocationR], FVehicleData[x][FVCol1], FVehicleData[x][FVCol2], -1, FVehicleData[x][FVRegPlate], siren);
- FVehicleData[x][TempFVInterior] = FVehicleData[x][FVInterior];
- new Float:angle;
- switch(garage)
- {
- case 1: //palomino creek
- {
- angle = 270.0;
- SetVehiclePos(x, 2441.300537, 116.527976, 26.349056);
- LinkVehicleToInteriorEx(x, 0);
- SetVehicleVirtualWorld(x, 0);
- }
- case 2: //dillimore
- {
- angle = 180.0;
- SetVehiclePos(x, 719.557006, -471.663574, 16.218591);
- LinkVehicleToInteriorEx(x, 0);
- SetVehicleVirtualWorld(x, 0);
- }
- case 3: //fort carson
- {
- angle = 180.0;
- SetVehiclePos(x, -85.196937, 1119.541992, 19.617189);
- LinkVehicleToInteriorEx(x, 0);
- SetVehicleVirtualWorld(x, 0);
- }
- case 4: //el q
- {
- angle = 90.0;
- SetVehiclePos(x, -1420.370117, 2595.696777, 55.583492);
- LinkVehicleToInteriorEx(x, 0);
- SetVehicleVirtualWorld(x, 0);
- }
- case 5: //airstrip
- {
- angle = 90.0;
- SetVehiclePos(x, 339.544250, 2502.484619, 16.359373);
- LinkVehicleToInteriorEx(x, 0);
- SetVehicleVirtualWorld(x, 0);
- }
- case 6: //bayside marina
- {
- angle = 318.0;
- SetVehiclePos(x, -2238.6045, 2405.2800, 0.0099);
- LinkVehicleToInteriorEx(x, 0);
- SetVehicleVirtualWorld(x, 0);
- }
- case 7: //Angel Pine
- {
- angle = 230.7137;
- SetVehiclePos(x, -2224.9514, -2322.6760, 30.6101);
- LinkVehicleToInteriorEx(x, 0);
- SetVehicleVirtualWorld(x, 0);
- }
- }
- SetVehicleNumberPlate(FVehicleData[x][FactionVehID], FVehicleData[x][FVRegPlate]);
- if(FVehicleData[x][FVGovUnitTog] == 1)
- {
- DestroyDynamic3DTextLabel(FVehicleData[x][FVGovUnit3DText]);
- FVehicleData[x][FVGovUnit3DText] = Text3D:INVALID_3DTEXT_ID;
- }
- FVehicleData[x][FVGovUnitTog] = 0;
- PutPlayerInVehicle(playerid, x, 0);
- SetVehicleZAngle(x, angle);
- FVehicleData[x][FVGovUnit][0] = 0;
- VehicleBroke[x] = 0;
- RepairData[v][rSQLID] = 0;
- RepairData[v][rGarage] = 0;
- RepairData[v][rTime] = 0;
- RepairData[v][rColor1] = 0;
- RepairData[v][rColor2] = 0;
- RepairData[v][OwnerNotified] = 0;
- Siren{x} = false;
- ELMs{x} = false;
- aspawned{x} = false;
- DMVCarForPlayer[x] = -1;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE fveh SET GarageRepairID = 0, GarageCollectTime = 0 WHERE id = %i", FVehicleData[x][FVSQLID]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid, COLOR_WHITE, "Você coletou o %s da garagem e o trabalho requisitado foi terminado.", GetVehicleName(FVehicleData[x][FactionVehID]));
- }
- return true;
- }
- GREENSIDE::DisplayFactionMemberList(playerid, pageindex)
- {
- new onlineCount = 0, totalMembers = 0;
- gstr[0] = EOS;
- totalMembers = cache_num_rows();
- if(totalMembers == 0)
- {
- SysMsg(playerid,"Nenhum membro encontrado.");
- return true;
- }
- new MemberName[MAX_PLAYER_NAME], MemberRank[3], MemberSubRank[16], MemberOnline, col[7];
- for(new i, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "Name", MemberName);
- cache_get_field_content(i, "FactionRank", MemberRank);
- cache_get_field_content(i, "FactionCustomRank", MemberSubRank);
- MemberOnline = cache_get_field_content_int(i, "Online");
- if(MemberOnline == 1)
- {
- format(col, sizeof(col), "00FF00");
- onlineCount++;
- }
- else format(col, sizeof(col), "FF0000");
- new sub[100];
- if(strlen(MemberSubRank) > 0) format(sub, sizeof(sub), "{%s}%s{FFFFFF} (Rank %i: %s, %s)\n", col, MemberName, strval(MemberRank), GetFactionRankName(MemberBrowsing[playerid], strval(MemberRank)), MemberSubRank);
- else format(sub, sizeof(sub), "{%s}%s{FFFFFF} (Rank %i: %s)\n", col, MemberName, strval(MemberRank), GetFactionRankName(MemberBrowsing[playerid], strval(MemberRank)));
- strcat(gstr, sub);
- }
- if(MemberListIndex[playerid] > 0) strcat(gstr, "{FFD700}< Página anterior");
- if(totalMembers >= 20) strcat(gstr, "\n{FFD700}> Próxima Página");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM players WHERE Faction = %i", MemberBrowsing[playerid]);
- mysql_pquery(conn, mquery, "GetTotalFactionMemberCount", "isi", playerid, gstr, onlineCount);
- return true;
- }
- GREENSIDE::GetTotalFactionMemberCount(playerid, str[], onlineCount)
- {
- format(sgstr,128,"Members of %s {FFFFFF}(%i/%i Online)", FACTIONS[MemberBrowsing[playerid]][FactionName], onlineCount, cache_num_rows());
- Dialog_Show(playerid, FactionMemberList, DIALOG_STYLE_LIST, sgstr, str, "Manage", "Close");
- return true;
- }
- //fire functions
- GREENSIDE::FireUpdate()
- {
- for(new i = 0; i < MAX_FIRES; i++)
- {
- if(Flame[i][Spawned] != 0)
- {
- SpreadFire(i);
- }
- }
- foreach(new playerid: Player)
- {
- if(CanPlayerChoke{playerid} && IsAtFlame(playerid))
- {
- PlayerChoke(playerid);
- PlayerChoking{playerid} = true;
- }
- if(!CanPlayerChoke{playerid} && smask[playerid]==0 && !PlayerChoking{playerid})
- {
- CanPlayerChoke{playerid} = true;
- }
- new f = AimingAtFlame(playerid);
- if(f != -1)
- {
- if(ExtTimer[playerid] == -1 && (f != -1 && Pressing(playerid) & KEY_FIRE))
- {
- new time, Float:x, Float:y, Float:z;
- if(f != -1)
- {
- if(IsPlayerInAnyVehicle(playerid)) time = 4;
- else time = 8;
- }
- time *= 1000;
- if(f > -1)
- {
- x = Flame[f][F_Pos][0];
- y = Flame[f][F_Pos][1];
- z = Flame[f][F_Pos][2];
- DestroySmoke(f);
- Flame[f][AfterSmoke][0] = CreateDynamicObject(18727, x, y, z, 0.0, 0.0, 0.0);
- Flame[f][AfterSmoke][1] = CreateDynamicObject(18727, x+1, y, z, 0.0, 0.0, 0.0);
- Flame[f][AfterSmoke][2] = CreateDynamicObject(18727, x-1, y, z, 0.0, 0.0, 0.0);
- Flame[f][AfterSmoke][3] = CreateDynamicObject(18727, x, y+1, z, 0.0, 0.0, 0.0);
- Flame[f][AfterSmoke][4] = CreateDynamicObject(18727, x, y-1, z, 0.0, 0.0, 0.0);
- SetTimerEx("DestroySmoke", time, 0, "d", f);
- }
- ExtTimer[playerid] = SetTimerEx("FireTimer", time, 0, "dd", playerid, f);
- }
- }
- }
- return true;
- }
- GREENSIDE::PlaceFire(Float:x, Float:y, Float:z, firesize, vworld, interiorid, bool:WillSpread)
- {
- new slot = GetFlameSlot();
- if(slot == -1) return true;
- Flame[slot][Spawned] = 1;
- Flame[slot][F_Pos][0] = x;
- Flame[slot][F_Pos][1] = y;
- Flame[slot][F_Pos][2] = z - 2.5;
- Flame[slot][SpreadTimer] = 0;
- Flame[slot][FlameInterior][0] = vworld;
- Flame[slot][FlameInterior][1] = interiorid;
- Flame[slot][CanSpread] = WillSpread;
- if(interiorid != 0 || vworld != 0) Flame[slot][CanSpread] = false;
- if(firesize == 1)
- {
- Flame[slot][FID] = CreateDynamicObject(18689, Flame[slot][F_Pos][0], Flame[slot][F_Pos][1], Flame[slot][F_Pos][2], 0.0, 0.0, 0.0, vworld, interiorid);
- Flame[slot][Size] = 1;
- Flame[slot][Smoke][1] = INVALID_OBJECT_ID;
- }
- else if(firesize == 2)
- {
- Flame[slot][FID] = CreateDynamicObject(18690, Flame[slot][F_Pos][0], Flame[slot][F_Pos][1], Flame[slot][F_Pos][2], 0.0, 0.0, 0.0, vworld, interiorid);
- Flame[slot][Size] = 2;
- Flame[slot][Smoke][1] = INVALID_OBJECT_ID;
- }
- else if(firesize == 3)
- {
- Flame[slot][FID] = CreateDynamicObject(18691, Flame[slot][F_Pos][0], Flame[slot][F_Pos][1], Flame[slot][F_Pos][2], 0.0, 0.0, 0.0, vworld, interiorid);
- Flame[slot][Smoke][1] = CreateDynamicObject(18726, Flame[slot][F_Pos][0], Flame[slot][F_Pos][1], Flame[slot][F_Pos][2], 0.0, 0.0, 0.0);
- Flame[slot][Size] = 3;
- }
- return slot;
- }
- GREENSIDE::SpreadFire(id)
- {
- Flame[id][SpreadTimer] += 1;
- new srand = random(90);
- if(Flame[id][CanSpread] && Flame[id][Spawned] == 1 && Flame[id][SpreadTimer] > srand && srand > 20)
- {
- Flame[id][CanSpread] = false;
- Flame[id][SpreadTimer] = 0;
- PlaceFire(Flame[id][F_Pos][0]+randomize(-5,5), Flame[id][F_Pos][1]+randomize(-5,5), GetPointZPos(Flame[id][F_Pos][0]+1, Flame[id][F_Pos][1]+1.5), randomize(1,3), Flame[id][FlameInterior][0], Flame[id][FlameInterior][1], true);
- }
- if(Flame[id][CanSpread] && Flame[id][Spawned] == 1 && Flame[id][SpreadTimer] < srand && srand < 20)
- {
- Flame[id][CanSpread] = true;
- Flame[id][SpreadTimer] = 1;
- }
- for(new v = 1, x2 = GetVehiclePoolSize(); v <= x2; v++)
- {
- new Float:distance,Float:x, Float:y, Float:z;
- GetVehiclePos(v,x,y,z);
- distance = DistanceBetweenPoints(x,y,z,Flame[id][F_Pos][0], Flame[id][F_Pos][1], Flame[id][F_Pos][2]);
- if(distance < 5)
- {
- VehicleInFire(v);
- }
- }
- }
- GREENSIDE::PlayerChoke(playerid)
- {
- GetPlayerHealth(playerid, PlayerHealth[playerid]);
- if(PlayerChoking{playerid} && PlayerHealth[playerid] < 21)
- {
- OnePlayAnim(playerid, "ped", "KO_shot_stom", 4.0, 0, 0, 0, 1, -1);
- SendClientMessage(playerid, COLOR_WHITE, "You passed out from lack of oxygen");
- PlayerChoking{playerid} = false;
- CanPlayerChoke{playerid} = false;
- }
- if(PlayerHealth[playerid] > 20)
- {
- SetPlayerHealthEx(playerid,PlayerHealth[playerid]-3);
- }
- }
- GREENSIDE::VehicleInFire(id)
- {
- new Float:vhealth,Float:x, Float:y, Float:z;
- GetVehicleHealth(id, vhealth);
- GetVehiclePos(id,x,y,z);
- if(VehicleCanBurn[id] == 1 && VehicleOnFire[id] == 0 && vhealth > 300)
- {
- SetVehicleHealthEx(id,vhealth-20);
- VehicleBurning[id] = 1;
- }
- if(VehicleBurning[id] == 1 && VehicleCanBurn[id] == 1 && VehicleOnFire[id] == 0 && vhealth <= 300)
- {
- //PlaceVehicleFire(id,3);
- VehicleOnFire[id] = 1;
- VehicleBurning[id] = 0;
- VehicleCanBurn[id] = 0;
- SetVehicleHealthEx(id, 275.0);
- ToggleVehicleEngine(id, 0);
- VehicleBroke[id] = 2;
- }
- }
- GREENSIDE::PlaceVehicleFire(id, firesize)
- {
- new slot = GetFlameSlot();
- if(slot == -1) return slot;
- new Float:x, Float:y, Float:z;
- GetVehiclePos(id,x,y,z);
- Flame[slot][Spawned] = 1;
- Flame[slot][F_Pos][0] = x;
- Flame[slot][F_Pos][1] = y;
- Flame[slot][F_Pos][2] = z;
- Flame[slot][CanSpread] = false;
- Flame[slot][SpreadTimer] = 0;
- if(firesize== 1)
- {
- Flame[slot][FID] = CreateDynamicObject(18689, Flame[slot][F_Pos][0], Flame[slot][F_Pos][1], Flame[slot][F_Pos][2], 0.0, 0.0, 0.0);
- AttachDynamicObjectToVehicle(Flame[slot][FID],id, 0, 0, -0.5, 0.0, 0.0, 0.0);
- Flame[slot][Size] = 1;
- }
- else if(firesize== 2)
- {
- Flame[slot][FID] = CreateDynamicObject(18690, Flame[slot][F_Pos][0], Flame[slot][F_Pos][1], Flame[slot][F_Pos][2], 0.0, 0.0, 0.0);
- AttachDynamicObjectToVehicle(Flame[slot][FID],id, 0, 0, -0.5, 0.0, 0.0, 0.0);
- Flame[slot][Size] = 2;
- }
- else if(firesize== 3)
- {
- Flame[slot][FID] = CreateDynamicObject(18691, Flame[slot][F_Pos][0], Flame[slot][F_Pos][1], Flame[slot][F_Pos][2], 0.0, 0.0, 0.0);
- AttachDynamicObjectToVehicle(Flame[slot][FID],id, 0, 0, -0.5, 0.0, 0.0, 0.0);
- Flame[slot][Smoke][1] = CreateDynamicObject(18726, Flame[slot][F_Pos][0], Flame[slot][F_Pos][1], Flame[slot][F_Pos][2], 0.0, 0.0, 0.0);
- AttachDynamicObjectToVehicle(Flame[slot][Smoke][1],id, 0, 0, -0.5, 0.0, 0.0, 0.0);
- Flame[slot][Size] = 3;
- }
- return slot;
- }
- GREENSIDE::RemoveFire(id)
- {
- if(Flame[id][FID] != INVALID_OBJECT_ID) DestroyDynamicObjectEx(Flame[id][FID], "Flame[id][FID]");
- if(Flame[id][Smoke][1] != INVALID_OBJECT_ID) DestroyDynamicObjectEx(Flame[id][Smoke][1], "Flame[id][Smoke][1]");
- Flame[id][FID] = INVALID_OBJECT_ID;
- Flame[id][Smoke][1] = INVALID_OBJECT_ID;
- Flame[id][Spawned] = 0;
- Flame[id][F_Pos][0] = 0.0;
- Flame[id][F_Pos][1] = 0.0;
- Flame[id][F_Pos][2] = 0.0;
- Flame[id][CanSpread] = false;
- Flame[id][SpreadTimer] = 0;
- DestroySmoke(id);
- return true;
- }
- GREENSIDE::DestroySmoke(id)
- {
- for(new i; i < 5; i++)
- {
- if(Flame[id][AfterSmoke][i] != INVALID_OBJECT_ID) DestroyDynamicObjectEx(Flame[id][AfterSmoke][i], "Flame[id][AfterSmoke][i]");
- Flame[id][AfterSmoke][i] = INVALID_OBJECT_ID;
- }
- return true;
- }
- GREENSIDE::FireTimer(playerid, id)
- {
- new f = AimingAtFlame(playerid);
- if(id < -1 && (f == id)) return true;
- else if(Flame[id][Spawned] && (Pressing(playerid) & KEY_FIRE && f == id))
- {
- RemoveFire(id);
- }
- KillTimer(ExtTimer[playerid]);
- ExtTimer[playerid] = -1;
- return true;
- }
- GREENSIDE::AssignFVehSiren(playerid, vehicleid)
- {
- new vsql = FVehicleData[vehicleid][FVSQLID], bool:siren = bool:cache_get_field_content_int(0, "HasSiren");
- siren = !siren;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE fveh SET HasSiren = %i WHERE id = %i", siren, vsql);
- mysql_pquery(conn, mquery);
- DestroyVehicleEx(vehicleid, "vehicleid 3");
- ClearVehicleData(vehicleid);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM fveh WHERE id = %i", vsql);
- mysql_pquery(conn, mquery, "LoadFactionVehicles");
- if(siren) SendClientMessage(playerid, COLOR_BLUE, "This faction vehicle will now spawn with a siren.");
- else SendClientMessage(playerid, COLOR_BLUE, "This vehicle will no longer spawn with a siren.");
- return true;
- }
- GREENSIDE::mdcNameSearch(playerid, step)
- {
- new lics[6], licsus[6], weaplic, fac;
- if(cache_num_rows())
- {
- cache_get_field_content(0, "Name", mdcName[playerid], conn, MAX_PLAYER_NAME);
- SetPVarInt(playerid, "mdcAcc", cache_get_field_content_int(0, "id"));
- lics[0] = cache_get_field_content_int(0, "LicenseCar");
- lics[1] = cache_get_field_content_int(0, "LicenseLargeVehicle");
- lics[2] = cache_get_field_content_int(0, "LicenseBike");
- lics[3] = cache_get_field_content_int(0, "LicenseBoat");
- lics[4] = cache_get_field_content_int(0, "LicenseHelicopter");
- lics[5] = cache_get_field_content_int(0, "LicensePlane");
- licsus[0] = cache_get_field_content_int(0, "LicenseSuspendTime_Car");
- licsus[1] = cache_get_field_content_int(0, "LicenseSuspendTime_LargeVehicle");
- licsus[2] = cache_get_field_content_int(0, "LicenseSuspendTime_Bike");
- licsus[3] = cache_get_field_content_int(0, "LicenseSuspendTime_Boat");
- licsus[4] = cache_get_field_content_int(0, "LicenseSuspendTime_Helicopter");
- licsus[5] = cache_get_field_content_int(0, "LicenseSuspendTime_Plane");
- fac = cache_get_field_content_int(0, "Faction");
- new dob[3], name[MAX_PLAYER_NAME];
- dob[0] = cache_get_field_content_int(0, "BirthDate");
- dob[1] = cache_get_field_content_int(0, "BirthMonth");
- dob[2] = cache_get_field_content_int(0, "BirthYear");
- format(gstr, sizeof(gstr), "{ffffff}________________________________________________\n");
- for(new lv; lv < strlen(mdcName[playerid]); lv++)
- name[lv] = toupper(mdcName[playerid][lv]);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM weaponlicenses WHERE OwnerSQLID = %i", GetPVarInt(playerid, "mdcAcc"));
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows()) weaplic = cache_get_field_content_int(0, "LicenseType");
- cache_delete(result);
- if(step == 1)
- {
- format(sgstr, sizeof(sgstr), "{ffffff}%s - Dashboard", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameHome, DIALOG_STYLE_LIST, sgstr, "{ffffff}Personal Information\nVehicular Information\n \nAdd New Charge\nOutstanding Charges\nPrevious Charges\n \nMost Recent Fines\nMost Recent Jails", "Select", "Return");
- }
- else if(step == 2)
- {
- new occupation[35];
- if(fac == 0 || FACTIONS[fac][FactionIsGang] == 1 || fac == FACTION_RESEARCH) occupation = "Unemployed";
- else format(occupation, 35, FACTIONS[fac][FactionName]);
- format(gstr, sizeof(gstr), "%s\nName Search Results for: %s\n\nFull Name: \t [ %s ]\nDOB: \t \t [ %02d/%02d/%i ]\nEmployer: \t [ %s ]\n\n", gstr, RPName(mdcName[playerid]), RPName(name), dob[0], dob[1], dob[2], occupation);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT PhoneNumber FROM phones WHERE OwnerSQLID = %i", GetPVarInt(playerid, "mdcAcc"));
- new Cache:cellnumber = mysql_query(conn, mquery);
- if(!cache_num_rows()) format(gstr, sizeof(gstr), "%sPhone Number: [ N/A ]", gstr);
- else
- {
- if(cache_num_rows() > 1) strcat(gstr, "Phone Number(s):\n");
- else strcat(gstr, "Phone Number:\n");
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- format(tgstr, sizeof(tgstr), "%i\n", cache_get_field_content_int(i, "PhoneNumber"));
- strcat(gstr, tgstr);
- }
- }
- cache_delete(cellnumber);
- new lic[7][19];
- for(new vl; vl < 6; vl++)
- {
- if(lics[vl] == 1)
- {
- if(licsus[vl] >= 1) format(lic[vl], sizeof(lic[]), "{FF6600}X{ffffff}");
- else format(lic[vl], sizeof(lic[]), "X");
- }
- else if(lics[vl] == 0) format(lic[vl], sizeof(lic[]), " ");
- }
- if(weaplic == 1) format(lic[6], 17, "A");
- else if(weaplic == 2) format(lic[6], 17, "B");
- else if(weaplic == 3) format(lic[6], 17, "C");
- else if(weaplic == -1) format(lic[6], 17, "Expired");
- else format(lic[6], 17, "None");
- format(gstr, sizeof(gstr), "%s\n\nVehicle Licenses:\n GVL [%s] HVL [%s] MB [%s] B [%s] A1 [%s] A2 [%s]\nFirearms Permit [ %s ]\n________________________________________________\n\t\t Domestic Address(es):", gstr,
- lic[0], lic[1], lic[2], lic[3], lic[4], lic[5], lic[6]);
- new homesfound = 0;
- for(new hf = 0; hf < MAX_HOUSES; hf++)
- {
- if(HouseData[hf][HouseOwnerSQLID] == GetPVarInt(playerid, "mdcAcc"))
- {
- new zone[MAX_ZONE_NAME];
- Get2DZone(HouseData[hf][oPosX], HouseData[hf][oPosY], zone, MAX_ZONE_NAME);
- format(sgstr, sizeof(sgstr), "\n%s\n%s\n", HouseData[hf][HouseDescription], zone);
- strcat(gstr, sgstr);
- homesfound ++;
- }
- }
- if(homesfound == 0) strcat(gstr, "\nNone found on record.\n");
- strcat(gstr, "________________________________________________");
- format(sgstr, sizeof(sgstr), "{FFFFFF}%s - Personal Information ", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameDetails, DIALOG_STYLE_MSGBOX, sgstr, gstr, "Menu", "Return");
- }
- else if(step == 3)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT VehicleModel,RegPlate FROM `vehicles` WHERE OwnerSQLID = %i", GetPVarInt(playerid, "mdcAcc"));
- mysql_pquery(conn, mquery, "mdcVehicleSearch", "i", playerid);
- }
- else if(step == 4)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT OwnerSQLID,VehicleModel,RegPlate FROM `vehicles` WHERE RegPlate = '%e'", mdcPlate[playerid]);
- mysql_pquery(conn, mquery, "mdcPlateSearch", "iisi", playerid, 2, mdcPlate[playerid], 0);
- }
- }
- else
- {
- if(step == 4)
- {
- mysql_pquery(conn, "SELECT OwnerSQLID,VehicleModel,RegPlate FROM `vehicles` WHERE RegPlate = '0'", "mdcPlateSearch", "iisi", playerid, 2, mdcPlate[playerid], -1);
- return 1;
- }
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- Dialog_Show(playerid, MDC_NameDetails, DIALOG_STYLE_MSGBOX, "{ffffff}MDC - {ff0000}Name Search", "{ffffff}The name you specified doesn't exist in the database.", "Close", "");
- return 1;
- }
- return 1;
- }
- GREENSIDE::mdcNameMenu(playerid, step)
- {
- switch(step)
- {
- case 1:
- {
- new lic[6][32], licsus[6];
- new gvl1 = cache_get_field_content_int(0, "LicenseCar"), large = cache_get_field_content_int(0, "LicenseLargeVehicle");
- new bike = cache_get_field_content_int(0, "LicenseBike"), boat = cache_get_field_content_int(0, "LicenseBoat");
- new heli = cache_get_field_content_int(0, "LicenseHelicopter"), plane = cache_get_field_content_int(0, "LicensePlane");
- licsus[0] = cache_get_field_content_int(0, "LicenseSuspendTime_Car");
- licsus[1] = cache_get_field_content_int(0, "LicenseSuspendTime_LargeVehicle");
- licsus[2] = cache_get_field_content_int(0, "LicenseSuspendTime_Bike");
- licsus[3] = cache_get_field_content_int(0, "LicenseSuspendTime_Boat");
- licsus[4] = cache_get_field_content_int(0, "LicenseSuspendTime_Helicopter");
- licsus[5] = cache_get_field_content_int(0, "LicenseSuspendTime_Plane");
- if(gvl1 >= 1)
- {
- lic[0] = "Car License";
- if(licsus[0] >= 1) lic[0] = "{FF6600}Car License";
- }
- else lic[0] = "{666666}Car License";
- if(large >= 1)
- {
- lic[1] = "Large Vehicle License";
- if(licsus[1] >= 1) lic[1] = "{ff6600}Large Vehicle License";
- }
- else lic[1] = "{666666}Large Vehicle License";
- if(bike >= 1)
- {
- lic[2] = "Bike License";
- if(licsus[2] >= 1) lic[2] = "{ff6600}Bike License";
- }
- else lic[2] = "{666666}Bike License";
- if(boat >= 1)
- {
- lic[3] = "Boat License";
- if(licsus[3] >= 1) lic[3] = "{ff6600}Boat License";
- }
- else lic[3] = "{666666}Boat License";
- if(heli >= 1)
- {
- lic[4] = "Heli License";
- if(licsus[4] >= 1) lic[4] = "{ff6600}Heli License";
- }
- else lic[4] = "{666666}Heli License";
- if(plane >= 1)
- {
- lic[5] = "Plane License";
- if(licsus[5] >= 1) lic[5] = "{ff6600}Plane License";
- }
- else lic[5] = "{666666}Plane License";
- format(gstr, sizeof(gstr), "%s\n%s\n%s\n%s\n%s\n%s", lic[0], lic[1], lic[2], lic[3], lic[4], lic[5]);
- Dialog_Show(playerid, MDC_NameLicenses, DIALOG_STYLE_LIST, "{FFFFFF}MDC - License Menu", gstr, "Select", "Close");
- }
- case 2:
- {
- new sqlid = cache_get_field_content_int(0, "id");
- new weaplic, wepgiver, time;
- mysql_format(conn, mquery, sizeof(mquery), "SELECT LicenseType,GivingOfficer,Timestamp FROM weaponlicenses WHERE OwnerSQLID = %i", sqlid);
- new Cache:result = mysql_query(conn, mquery);
- if(cache_num_rows())
- {
- weaplic = cache_get_field_content_int(0, "LicenseType");
- wepgiver = cache_get_field_content_int(0, "GivingOfficer");
- time = cache_get_field_content_int(0, "Timestamp");
- }
- cache_delete(result);
- new lic2[16];
- if(weaplic == 0) lic2 = "{666666}None";
- else if(weaplic == 1) lic2 = "{00ff00}A";
- else if(weaplic == 2) lic2 = "{00ff00}B";
- else if(weaplic == -1) lic2 = "{666666}Expired";
- else lic2 = "{00ff00}C";
- if(weaplic == 0)
- {
- if(Faction[playerid] == 1) format(gstr, sizeof(gstr), "Current: [%s{FFFFFF}]\nGrant Weapon License", lic2);
- else format(gstr, sizeof(gstr), "Current: [%s{FFFFFF}]\n{666666}Grant Weapon License", lic2);
- }
- else if(weaplic == -1)
- {
- if(Faction[playerid] == 1) format(gstr, sizeof(gstr), "Current: [%s{FFFFFF}]\n\nRevoke Weapon License", lic2);
- else format(gstr, sizeof(gstr), "Current: [%s{FFFFFF}]\n{666666}\nRevoke Weapon License", lic2);
- }
- else
- {
- if(Faction[playerid] == 1) format(gstr, sizeof(gstr), "Current: [%s{FFFFFF}, Granted by %s on \n%s]\nChange Weapon License\nRevoke Weapon License", lic2, GetSQLName(wepgiver), UnixDate(time, 0, 0));
- else format(gstr, sizeof(gstr), "Current: [%s{FFFFFF}, Granted by %s on \n%s]\n{666666}Change Weapon License\nRevoke Weapon License", lic2);
- }
- Dialog_Show(playerid, MDC_NameWeaponLicense, DIALOG_STYLE_LIST, "{FFFFFF}MDC - License Menu", gstr, "Select", "Return");
- }
- }
- return true;
- }
- GREENSIDE::mdcVehLicense(playerid, lic)
- {
- new header[50];
- if(cache_num_rows())
- {
- new lics[6], licsus[6], licname[6][24];
- lics[0] = cache_get_field_content_int(0, "LicenseCar");
- lics[1] = cache_get_field_content_int(0, "LicenseLargeVehicle");
- lics[2] = cache_get_field_content_int(0, "LicenseBike");
- lics[3] = cache_get_field_content_int(0, "LicenseBoat");
- lics[4] = cache_get_field_content_int(0, "LicenseHelicopter");
- lics[5] = cache_get_field_content_int(0, "LicensePlane");
- licsus[0] = cache_get_field_content_int(0, "LicenseSuspendTime_Car");
- licsus[1] = cache_get_field_content_int(0, "LicenseSuspendTime_LargeVehicle");
- licsus[2] = cache_get_field_content_int(0, "LicenseSuspendTime_Bike");
- licsus[3] = cache_get_field_content_int(0, "LicenseSuspendTime_Boat");
- licsus[4] = cache_get_field_content_int(0, "LicenseSuspendTime_Helicopter");
- licsus[5] = cache_get_field_content_int(0, "LicenseSuspendTime_Plane");
- licname[0] = "Car License";
- licname[1] = "Large Vehicle License";
- licname[2] = "Bike License";
- licname[3] = "Boat License";
- licname[4] = "Heli License";
- licname[5] = "Plane License";
- if(licsus[lic] >= 1 && lics[lic] == 1)
- {
- format(gstr, sizeof(gstr), "{ffffff}STATUS :\t[ {ff6600}SUSPENDED{FFFFFF} ]\nRevoke %s", licname[lic]);
- //if(IsValidLeaderRank(Faction[playerid], FactionRank[playerid])) format(gstr, sizeof(gstr), "\nUnsuspend %s", licname[lic]);
- }
- else if(lics[lic] == 1)
- {
- format(gstr, sizeof(gstr), "{ffffff}STATUS :\t[ {00ff00}VALID{FFFFFF} ]\nRevoke %s\nSuspend %s", licname[lic], licname[lic]);
- }
- else
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,WeaponLicense FROM `players` WHERE Name = '%e'", mdcName[playerid]);
- mysql_pquery(conn, mquery, "mdcNameMenu", "ii", playerid, 1);
- return true;
- }
- format(header, sizeof(header), "{FFFFFF}%s - %s Menu", RPName(mdcName[playerid]), licname[lic]);
- Dialog_Show(playerid, MDC_NameLicensesEdit, DIALOG_STYLE_LIST, header, gstr, "Select", "Return");
- }
- return true;
- }
- GREENSIDE::mdcRecentCharge(playerid, type)
- {
- new reason[128], rank[32], name[32], date[6];
- if(cache_num_rows())
- {
- gstr[0] = EOS;
- new ttime = gettime();
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "Reason", reason);
- cache_get_field_content(i, "OfficerRank", rank);
- cache_get_field_content(i, "OfficerName", name);
- new amount = cache_get_field_content_int(i, "Amount"), time = cache_get_field_content_int(i, "timestamp");
- if(time != 0) TimestampToDate(time, date[2], date[1], date[0], date[3], date[4], date[5]);
- if(type == 2)
- {
- if(time != 0)
- {
- if(time > ttime - 100)
- {
- if(strlen(name) >= 2) format(gstr, sizeof(gstr), "%s[%02d:%02d] %s ($%i) | %s %s\n", gstr, date[3], date[4], reason, amount, rank, name);
- else format(gstr, sizeof(gstr), "%s[%02d:%02d] %s ($%i) | N/A\n", gstr, date[3], date[4], reason, amount);
- }
- else
- {
- if(strlen(name) >= 2) format(gstr, sizeof(gstr), "%s[%02d/%02d %02d:%02d] %s ($%i) | %s %s\n", gstr, date[0], date[1], date[3], date[4], reason, amount, rank, name);
- else format(gstr, sizeof(gstr), "%s[%02d/%02d %02d:%02d] %s ($%i) | N/A\n", gstr, date[0], date[1], date[3], date[4], reason, amount);
- }
- }
- else
- {
- if(strlen(name) >= 2) format(gstr, sizeof(gstr), "%s[--/-- --:--] %s ($%i) | %s %s\n", gstr, reason, amount, rank, name);
- else format(gstr, sizeof(gstr), "%s[--/-- --:--] %s ($%i) | N/A\n", gstr, reason, amount);
- }
- }
- else if(type == 1)
- {
- if(time != 0)
- {
- if(time > ttime - 100)
- {
- if(strlen(name) >= 2) format(gstr, sizeof(gstr), "%s[%02d:%02d] %s (%i minutes) | %s %s\n", gstr, date[3], date[4], reason, amount, rank, name);
- else format(gstr, sizeof(gstr), "%s[%02d:%02d] %s (%i minutes) | N/A\n", gstr, date[3], date[4], reason, amount);
- }
- else
- {
- if(strlen(name) >= 2) format(gstr, sizeof(gstr), "%s[%02d/%02d %02d:%02d] %s (%i minutes) | %s %s\n", gstr, date[0], date[1], date[3], date[4], reason, amount, rank, name);
- else format(gstr, sizeof(gstr), "%s[%02d/%02d %02d:%02d] %s (%i minutes) | N/A\n", gstr, date[0], date[1], date[3], date[4], reason, amount);
- }
- }
- else
- {
- if(strlen(name) >= 2) format(gstr, sizeof(gstr), "%s[--/-- --:--] %s (%i minutes) | %s %s\n", gstr, reason, amount, rank, name);
- else format(gstr, sizeof(gstr), "%s[--/-- --:--] %s (%i minutes) | N/A\n", gstr, reason, amount);
- }
- }
- }
- format(reason, 128, "{FFFFFF}%s - Recent Charges", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameInfo, DIALOG_STYLE_LIST, reason, gstr, "Return", "Close");
- }
- else if(type == 2)
- {
- format(reason, 128, "{FFFFFF}There are no recent fines in the database for: %s", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameInfo, DIALOG_STYLE_MSGBOX, "{FFFFFF}Recent Charges - {FF0000}ERROR", reason, "Close", "");
- }
- else if(type == 1)
- {
- format(reason, 128, "{FFFFFF}There are no recent jails in the database for: %s", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameInfo, DIALOG_STYLE_MSGBOX, "{FFFFFF}Recent Charges - {FF0000}ERROR", reason, "Close", "");
- }
- return 1;
- }
- GREENSIDE::mdcPlateSearch(playerid, step, plate[], extraid)
- {
- new platee[14];
- gstr[0] = EOS;
- if(cache_num_rows() || extraid >= 0)
- {
- new model;
- if(step == 1)
- {
- SetPVarInt(playerid, "mdcAcc", cache_get_field_content_int(0, "OwnerSQLID"));
- mysql_format(conn, mquery, sizeof(mquery), "SELECT LicenseCar,LicenseLargeVehicle,LicenseBike,LicenseBoat,LicenseHelicopter,LicensePlane,LicenseSuspendTime_Car,LicenseSuspendTime_LargeVehicle,LicenseSuspendTime_Bike,LicenseSuspendTime_Boat,LicenseSuspendTime_Helicopter,LicenseSuspendTime_Plane,Name,id,WeaponLicense,Faction,BirthDate,BirthMonth,BirthYear FROM `players` WHERE id = %i", GetPVarInt(playerid, "mdcAcc"));
- mysql_pquery(conn, mquery, "mdcNameSearch", "ii", playerid, 4);
- }
- if(step == 2)
- {
- model = cache_get_field_content_int(0, "VehicleModel");
- cache_get_field_content(0, "RegPlate", platee, conn, MAX_REG_PLATE);
- format(sgstr, sizeof(sgstr), "{FFFFFF}%s - Plate Search Results", platee);
- format(gstr, sizeof(gstr), "{FFFFFF}________________________________________________\n\nDETAILS FOR: %s\n\nModel: %s\nPlate: %s\nOwned by: %s\n\n________________________________________________", platee, VehicleNames[model - 400], platee, RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_PlateError, DIALOG_STYLE_MSGBOX, sgstr, gstr, "Close", "");
- return 1;
- }
- if(step == 3)
- {
- format(sgstr, sizeof(sgstr), "{FFFFFF}%s - Plate Search Results", plate);
- if(FACTIONS[FVehicleData[extraid][FVFaction]][FactionIsGang] == 0)
- format(gstr, sizeof(gstr), "{FFFFFF}________________________________________________\n\nDETAILS FOR: %s\n\nModel: %s\nPlate: %s\nOwned by: %s\n\n________________________________________________", plate, GetVehicleNameEx(FVehicleData[extraid][FVModel]), plate, FACTIONS[FVehicleData[extraid][FVFaction]][FactionName]);
- else
- {
- new name[MAX_PLAYER_NAME];
- MySQLFetchString(FACTIONS[FVehicleData[extraid][FVFaction]][FactionLeader], "Name", name, "players");
- format(gstr, sizeof(gstr), "{FFFFFF}________________________________________________\n\nDETAILS FOR: %s\n\nModel: %s\nPlate: %s\nOwned by: %s\n\n________________________________________________", plate, GetVehicleNameEx(FVehicleData[extraid][FVModel]), plate, RPName(name));
- }
- Dialog_Show(playerid, MDC_PlateError, DIALOG_STYLE_MSGBOX, sgstr, gstr, "Close", "");
- return 1;
- }
- if(step == 4)
- {
- format(sgstr, sizeof(sgstr), "{FFFFFF}%s - Plate Search Results", plate);
- format(gstr, sizeof(gstr), "{FFFFFF}________________________________________________\n\nDETAILS FOR: %s\n\nModel: %s\nPlate: %s\nOwned by: %s\n\n________________________________________________", plate, GetVehicleName(extraid + 1), plate, RandomDriverData[extraid][0]);
- Dialog_Show(playerid, MDC_PlateError, DIALOG_STYLE_MSGBOX, sgstr, gstr, "Close", "");
- return 1;
- }
- }
- else
- {
- if(step == 1 || step == 2)
- {
- for(new fv = 1, x = GetVehiclePoolSize(); fv <= x; fv++)
- {
- if(strmatch(FVehicleData[fv][FVRegPlate], plate))
- {
- mdcPlateSearch(playerid, 3, FVehicleData[fv][FVRegPlate], fv);
- return 1;
- }
- }
- mdcPlateSearch(playerid, 3, plate, -1);
- }
- else if(step == 3)
- {
- for(new sv = 0; sv < sizeof(RandomDriverData); sv++)
- {
- if(strmatch(RandomDriverData[sv][1], plate))
- {
- mdcPlateSearch(playerid, 4, plate, sv);
- return 1;
- }
- }
- mdcPlateSearch(playerid, 4, plate, -1);
- }
- else if(step == 4)
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- for(new pl = 0; pl < sizeof(mdcPlate[]) ; pl++) mdcPlate[playerid][pl] = toupper(mdcPlate[playerid][pl]);
- format(sgstr, sizeof(sgstr), "{ffffff}The plate '%s' you specified doesn't exist in the database.", mdcPlate[playerid]);
- Dialog_Show(playerid, MDC_PlateError, DIALOG_STYLE_MSGBOX, "{ffffff}MDC - {ff0000}Plate Search", sgstr, "Close", "");
- }
- }
- return 1;
- }
- GREENSIDE::mdcVehicleSearch(playerid)
- {
- if(cache_num_rows())
- {
- format(gstr, sizeof(gstr), "{ffffFf}________________________________________________\n\n\t\tList of Owned Vehicles:");
- for(new l = 0, r = cache_num_rows(); l < r; l++)
- {
- new model, plate[10];
- model = cache_get_field_content_int(l, "VehicleModel");
- cache_get_field_content(l, "RegPlate", plate, conn, MAX_REG_PLATE);
- format(gstr, sizeof(gstr), "%s\n\nModel: %s\nPlate: %s\n", gstr, VehicleNames[model - 400], plate);
- }
- }
- else format(gstr, sizeof(gstr), "{ffffff}________________________________________________\n\n\t\tNo registered vehicles found\n");
- format(sgstr, sizeof(sgstr), "{ffffff}%s - Vehicular Information ", RPName(mdcName[playerid]));
- format(gstr, sizeof(gstr), "%s________________________________________________", gstr);
- Dialog_Show(playerid, MDC_NameInfo, DIALOG_STYLE_MSGBOX, sgstr, gstr, "Close", "");
- return 1;
- }
- GREENSIDE::mdc911(playerid)
- {
- gstr[0] = EOS;
- if(cache_num_rows())
- {
- for(new p, x = cache_num_rows(); p < x; p++)
- {
- new desc[128], zone[32], responding, cleared, c[5], r[5], type, reason;
- cache_get_field_content(p, "emergencyInfo", desc, conn, 128);
- cache_get_field_content(p, "location", zone, conn, 32);
- reason = cache_get_field_content_int(p, "emerReason");
- type = cache_get_field_content_int(p, "serviceType");
- responding = cache_get_field_content_int(p, "unitsRes");
- cleared = cache_get_field_content_int(p, "callCleared");
- if(strlen(desc) >= 5)
- {
- if(cleared == 1) format(c, 5, "[C]");
- else format(c, 5, "[-]");
- if(responding >= 1) format(r, 5, "[%i]", responding);
- else format(r, 5, "[-]");
- if(strlen(desc) >= 42)
- {
- strdel(desc, 40, 128);
- format(desc, 128, "%s...", desc);
- }
- format(gstr, sizeof(gstr), "%s%s %s | %s in %s\n", gstr, c, r, GetProblemType(type, reason), zone);
- }
- }
- Dialog_Show(playerid, MDC_911List, DIALOG_STYLE_LIST, "{ffffff}MDC - Recent 911 Calls", gstr, "Select", "Return");
- }
- else Dialog_Show(playerid, MDC_911Error, DIALOG_STYLE_MSGBOX, "{ffffff}MDC - No 911s", "{ffffff}There are no 911 calls currently in the database.", "Close", "");
- return true;
- }
- GREENSIDE::mdc911Details(playerid)
- {
- if(cache_num_rows())
- {
- new desc[128], number, zone[32], reason, name[MAX_PLAYER_NAME], nam[MAX_PLAYER_NAME], time, date[6], type, unitres[130], addinfo[135], res, clear, c[45];
- cache_get_field_content(0, "emergencyInfo", desc, conn, 128);
- cache_get_field_content(0, "location", zone, conn, 32);
- type = cache_get_field_content_int(0, "serviceType");
- number = cache_get_field_content_int(0, "callerNumber");
- time = cache_get_field_content_int(0, "timestamp");
- reason = cache_get_field_content_int(0, "emerReason");
- cache_get_field_content(0, "nameGiven", name, conn, MAX_PLAYER_NAME);
- cache_get_field_content(0, "nameRetrieved", nam);
- cache_get_field_content(0, "unitsResponding", unitres);
- cache_get_field_content(0, "addInfo", addinfo);
- res = cache_get_field_content_int(0, "unitsRes");
- clear = cache_get_field_content_int(0, "callCleared");
- if(clear == 1) format(c, 45, " {00FF00} [CLEARED]{FFFFFF}\n");
- else if(clear == 0 && res >= 1) format(c, 45, "{FF8000}[UNITS RESPONDING]{FFFFFF}\n");
- else format(c, 45, " {FF0000} [UNANSWERED]{FFFFFF}\n");
- if(strlen(desc) >= 42) strins(desc, "\n", 42);
- if(strlen(addinfo) <= 3) format(addinfo, sizeof(addinfo), "None");
- else if(strlen(addinfo) >= 53)
- {
- strins(addinfo, "\n", strfind(addinfo, " ", true, 50) + 1);
- if(strlen(addinfo) >= 98) strins(addinfo, "\n", strfind(addinfo, " ", true, 96) + 1);
- }
- new units[5][14];
- sscanf(unitres, "p<,>s[14]s[14]s[14]s[14]s[14]", units[0], units[1], units[2], units[3], units[4]);
- unitres[0] = 0;
- for(new u = 0; u < 5; u++)
- {
- if(strlen(units[u]) >= 1)
- {
- if(u >= 1) strcat(unitres, ", ");
- if(u == 2) strcat(unitres, "\n");
- strcat(unitres, units[u]);
- }
- }
- SetPVarInt(playerid, "mdcResponding", res);
- TimestampToDate(time, date[2], date[1], date[0], date[3], date[4], date[5]);
- if(clear == 0 && res >= 1)
- format(gstr, sizeof(gstr), "{FFFFFF}________________________________________________\n\n \t DETAILS OF 911 CALL RECORDING:\n\n\t\t%s\nUnits Responding: %s\n{A9C4E4}{FFFFFF}Caller Name: %s [%s]\nReason for Call: %s\nTime of Call: %02d/%02d/%i %02d:%02d\nNumber Called From: %i\nLocation of Call: %s\nCall Details: %s\n\nAdditional Info: \n%s\n________________________________________________", c,
- unitres, nam, RPName(name), GetProblemType(type, reason), date[0], date[1], date[2], date[3], date[4], number, zone, desc, addinfo);
- else
- format(gstr, sizeof(gstr), "{FFFFFF}________________________________________________\n\n \t DETAILS OF 911 CALL RECORDING:\n\n\t\t%s\n{A9C4E4}{FFFFFF}Caller Name: %s [%s]\nReason for Call: %s\nTime of Call: %02d/%02d/%i %02d:%02d\nNumber Called From: %i\nLocation of Call: %s\nCall Details: %s\n\nAdditional Info: \n%s\n________________________________________________", c,
- nam, RPName(name), GetProblemType(type, reason), date[0], date[1], date[2], date[3], date[4], number, zone, desc, addinfo);
- format(sgstr, sizeof(sgstr), "{FFFFFF}911 Call Detail | Call ID %i", number);
- Dialog_Show(playerid, MDC_911Details, DIALOG_STYLE_MSGBOX, sgstr, gstr, "Menu", "Return");
- }
- return true;
- }
- GREENSIDE::mdcSetResponding(playerid)
- {
- if(cache_num_rows())
- {
- new res, clear, unitres[160], units[5][14], time, type;
- cache_get_field_content(0, "unitsResponding", unitres);
- res = cache_get_field_content_int(0, "unitsRes");
- type = cache_get_field_content_int(0, "serviceType");
- clear = cache_get_field_content_int(0, "callCleared");
- time = cache_get_field_content_int(0, "timestamp");
- if(res <= 4)
- {
- if(clear == 0)
- {
- sscanf(unitres, "p<,>s[14]s[14]s[14]s[14]s[14]", units[0], units[1], units[2], units[3], units[4]);
- unitres[0] = 0;
- for(new fv = 1, x = GetVehiclePoolSize(); fv <= x; fv++)
- {
- if(FVehicleData[fv][FactionVehID] == GetPlayerVehicleID(playerid))
- {
- if(strlen(FVehicleData[fv][FVGovUnit]) >= 2)
- {
- for(new lo = 0; lo < 5; lo++)
- {
- if(strfind(units[lo], FVehicleData[fv][FVGovUnit]) != -1)
- {
- units[lo][0] = EOS;
- for(new li = 0; li < 5; li++)
- {
- if(strlen(units[li]) >= 2)
- {
- if(strlen(unitres) <= 1) format(unitres, 160, "%s", units[li]);
- else format(unitres, 160, "%s, %s", unitres, units[li]);
- }
- }
- mysql_format(conn, unitres, 160, "UPDATE 911calls SET unitsRes = unitsRes - 1, unitsResponding = '%e' WHERE timestamp = %i", unitres, time);
- mysql_pquery(conn, unitres);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT emergencyInfo,location,serviceType,callerNumber,timestamp,emerReason,nameGiven,nameRetrieved,unitsResponding,addInfo,unitsRes,callCleared FROM `911calls` WHERE serviceType = %i ORDER BY timestamp DESC LIMIT 1 OFFSET %i", type, GetPVarInt(playerid, "mdcViewing"));
- mysql_pquery(conn, mquery, "mdc911Details", "i", playerid);
- return true;
- }
- }
- unitres[0] = 0;
- for(new lo = 0; lo < 5; lo++)
- {
- if(strlen(units[lo]) <= 0)
- {
- format(units[lo], 14, FVehicleData[fv][FVGovUnit]);
- for(new li = 0; li < 5; li++)
- {
- if(strlen(units[li]) >= 2)
- {
- if(strlen(unitres) <= 1) format(unitres, 160, "%s", units[li]);
- else format(unitres, 160, "%s, %s", unitres, units[li]);
- }
- }
- mysql_format(conn, unitres, 160, "UPDATE 911calls SET unitsRes = unitsRes + 1, unitsResponding = '%e' WHERE timestamp = %i", unitres, time);
- mysql_pquery(conn, unitres);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT emergencyInfo,location,serviceType,callerNumber,timestamp,emerReason,nameGiven,nameRetrieved,unitsResponding,addInfo,unitsRes,callCleared FROM `911calls` WHERE serviceType = %i ORDER BY timestamp DESC LIMIT 1 OFFSET %i", type, GetPVarInt(playerid, "mdcViewing"));
- mysql_pquery(conn, mquery, "mdc911Details", "i", playerid);
- return true;
- }
- }
- }
- else
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- return Dialog_Show(playerid, MDC_911MenuError, DIALOG_STYLE_MSGBOX, "MDC - Responding Error", "{FFFFFF}You need to have a unit label set in order to set yourself responding.", "Close", "");
- }
- }
- }
- }
- else
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- return Dialog_Show(playerid, MDC_911MenuError, DIALOG_STYLE_MSGBOX, "MDC - Responding Error", "{FFFFFF}This call has been cleared and is no longer active.", "Close", "");
- }
- }
- else
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- return Dialog_Show(playerid, MDC_911MenuError, DIALOG_STYLE_MSGBOX, "MDC - Responding Error", "{FFFFFF}There are already enough units responding to this call.", "Close", "");
- }
- }
- return true;
- }
- GREENSIDE::mdcContactCaller(playerid)
- {
- if(cache_num_rows())
- {
- new caller = cache_get_field_content_int(0, "callerNumber"), num[12];
- valstr(num, caller);
- if(caller >= 1000) cmd_call(playerid, num);
- }
- else
- {
- PlayerPlayNearbySound(playerid, MDC_ERROR);
- return Dialog_Show(playerid, MDC_911MenuError, DIALOG_STYLE_MSGBOX, "MDC - Responding Error", "{FFFFFF}There are already enough units responding to this call.", "Close", "");
- }
- return true;
- }
- GREENSIDE::mdcClearCall(playerid)
- {
- if(cache_num_rows())
- {
- new clear = cache_get_field_content_int(0, "callCleared"), time = cache_get_field_content_int(0, "timestamp");
- if(clear == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE 911calls SET unitsRes = 0, unitsResponding = '', callCleared = 1 WHERE timestamp = %i", time);
- mysql_pquery(conn, mquery);
- return Dialog_Show(playerid, MDC_911MenuError, DIALOG_STYLE_MSGBOX, "{FFFFFF}MDC - Clear call", "{FFFFFF}You have successfully cleared the 911 call.", "Return", "");
- }
- else return Dialog_Show(playerid, MDC_911MenuError, DIALOG_STYLE_MSGBOX, "{FFFFFF}MDC - Clear call", "{FFFFFF}This call has already been cleared.", "Return", "");
- }
- return true;
- }
- GREENSIDE::mdcAddInfo(playerid, message[])
- {
- if(cache_num_rows())
- {
- new timestamp = cache_get_field_content_int(0, "timestamp");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE 911calls SET addInfo = '%e' WHERE timestamp = %i", message, timestamp);
- mysql_pquery(conn, mquery);
- Dialog_Show(playerid, MDC_911MenuError, DIALOG_STYLE_MSGBOX, "{FFFFFF}MDC - Add Info", "{FFFFFF}You have successfully added information to the 911 call.", "Return", "");
- }
- return true;
- }
- GREENSIDE::mdcNameOutstanding(playerid)
- {
- if(cache_num_rows())
- {
- gstr[0] = EOS;
- for(new mo, r = cache_num_rows(); mo < r; mo++)
- {
- if(mo < 35)
- {
- new charge[34], time, date[6];
- time = cache_get_field_content_int(mo, "timestamp");
- cache_get_field_content(mo, "Reason", charge);
- if(time != 0)
- {
- TimestampToDate(time, date[2], date[1], date[0], date[3], date[4], date[5]);
- format(gstr, sizeof(gstr), "%s[%02d/%02d | %02d:%02d] - %s\n", gstr, date[0], date[1], date[3], date[4], charge);
- }
- else
- {
- format(gstr, sizeof(gstr), "%s[--/-- | --:--] - %s\n", gstr, charge);
- }
- }
- }
- format(sgstr, sizeof(sgstr), "{FFFFFF}%s - Outstanding Charges", RPName(mdcName[playerid]));
- Dialog_Show(playerid, MDC_NameOutstanding, DIALOG_STYLE_LIST, sgstr, gstr, "Select", "Return");
- }
- else
- {
- PlayerPlayNearbySound(playerid, MDC_SELECT);
- new name[MAX_PLAYER_NAME];
- for(new i; i < strlen(mdcName[playerid]); i++)
- name[i] = toupper(mdcName[playerid][i]);
- format(sgstr, sizeof(sgstr), "{ffffff}No outstanding charges exist in the database for: %s", RPName(name));
- Dialog_Show(playerid, MDC_PrevMenuError, DIALOG_STYLE_MSGBOX, "{ffffff}Outstanding Charges - {ff0000}Not Found", sgstr, "Close", "");
- }
- return 1;
- }
- GREENSIDE::mdcOutstandingDetails(playerid)
- {
- gstr[0] = EOS;
- if(cache_num_rows())
- {
- new offname[MAX_PLAYER_NAME], offrank[32], reason[34], time;
- time = cache_get_field_content_int(0, "timestamp");
- cache_get_field_content(0, "OfficerName", offname);
- cache_get_field_content(0, "OfficerRank", offrank);
- cache_get_field_content(0, "Reason", reason);
- if(time != 0)
- {
- new date[6];
- TimestampToDate(time, date[2], date[1], date[0], date[3], date[4], date[5]);
- format(gstr, sizeof(gstr), "{FFFFFF}________________________________________________\n\tDETAILS OF OUTSTANDING CHARGES:\n\nSubmitted by: %s %s\nSubmitted on: %02d/%02d/%i - %02d:%02d\nCharge: %s\n\n________________________________________________",
- offrank, offname, date[0], date[1], date[2], date[3], date[4], reason);
- }
- else
- {
- format(gstr, sizeof(gstr), "{FFFFFF}________________________________________________\n\tDETAILS OF OUTSTANDING CHARGES:\n\nSubmitted by: %s %s\nSubmitted on: No date recorded\nCharge: %s\n\n________________________________________________",
- offrank, offname, reason);
- }
- Dialog_Show(playerid, MDC_NameoutDetails, DIALOG_STYLE_MSGBOX, "{FFFFFF}MDC - Charge Details", gstr, "Menu", "Close");
- }
- return true;
- }
- GREENSIDE::mdcOutstandingClear(playerid, step)
- {
- if(cache_num_rows())
- {
- new id = cache_get_field_content_int(0, "id"), clear = cache_get_field_content_int(0, "cleared"), removed = cache_get_field_content_int(0, "removed");
- switch(step)
- {
- case 1:
- {
- if(clear == 0 && removed == 0)
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE mdc SET cleared = 1 WHERE id = %i", id);
- mysql_pquery(conn, mquery);
- return Dialog_Show(playerid, MDC_OutMenuError, DIALOG_STYLE_MSGBOX, "{FFFFFF}MDC - Clear Outstanding", "{FFFFFF}You have successfully cleared the charge.", "Return", "");
- }
- else return Dialog_Show(playerid, MDC_OutMenuError, DIALOG_STYLE_MSGBOX, "{FFFFFF}MDC - Clear Outstanding", "{FFFFFF}This charge has already been cleared.", "Return", "");
- }
- case 2:
- {
- if(clear == 0 && removed == 0)
- {
- new time = cache_get_field_content_int(0, "timestamp"), date[6], reason[34];
- cache_get_field_content(0, "Reason", reason);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE mdc SET cleared = 1, removed = 1 WHERE id = %i", id);
- mysql_pquery(conn, mquery);
- TimestampToDate(time, date[2], date[1], date[0], date[3], date[4], date[5]);
- format(gstr, sizeof(gstr), "[%s] %s removed charge (%s | %s) [%02d/%02d/%02d %02d:%02d:%02d]", GetServerTimeString(), NameEx(playerid), mdcName[playerid], reason, date[0], date[1], date[2], date[3], date[4], date[5]);
- return Dialog_Show(playerid, MDC_OutMenuError, DIALOG_STYLE_MSGBOX, "{FFFFFF}MDC - Remove Outstanding", "{FFFFFF}You have successfully removed the charge.", "Return", "");
- }
- else return Dialog_Show(playerid, MDC_OutMenuError, DIALOG_STYLE_MSGBOX, "{FFFFFF}MDC - Remove Outstanding", "{FFFFFF}This charge has already been removed.", "Return", "");
- }
- }
- }
- return true;
- }
- GREENSIDE::mdcNamePrevious(playerid, offset)
- {
- if(cache_num_rows())
- {
- gstr[0] = EOS;
- for(new lo = 0, x = cache_num_rows(); lo < x; lo++)
- {
- new reason[34], time, date[6];
- cache_get_field_content(lo, "Reason", reason);
- time = cache_get_field_content_int(lo, "timestamp");
- if(time != 0)
- {
- TimestampToDate(time, date[2], date[1], date[0], date[3], date[4], date[5]);
- format(gstr, sizeof(gstr), "%s[%02d/%02d %02d:%02d] %s\n", gstr, date[0], date[1], date[3], date[4], reason);
- }
- else
- {
- format(gstr, sizeof(gstr), "%s[--/-- --:--] %s\n", gstr, reason);
- }
- }
- Dialog_Show(playerid, MDC_NamePrevious, DIALOG_STYLE_LIST, "{ffffff}MDC - Previous Charge", gstr, "Select", "Return");
- }
- else
- {
- new name[MAX_PLAYER_NAME];
- for(new i; i < strlen(mdcName[playerid]); i++)
- name[i] = toupper(mdcName[playerid][i]);
- format(sgstr, sizeof(sgstr), "{ffffff}There are no previous charges in the database for: %s.", RPName(name));
- return Dialog_Show(playerid, MDC_PrevMenuError, DIALOG_STYLE_MSGBOX, "{FFFFFF}MDC - Previous Charge", sgstr, "Return", "");
- }
- return 1;
- }
- GREENSIDE::mdcPreviousDetails(playerid)
- {
- gstr[0] = EOS;
- if(cache_num_rows())
- {
- new offname[MAX_PLAYER_NAME], offrank[32], reason[34], time;
- time = cache_get_field_content_int(0, "timestamp");
- cache_get_field_content(0, "OfficerName", offname);
- cache_get_field_content(0, "OfficerRank", offrank);
- cache_get_field_content(0, "Reason", reason);
- if(time != 0)
- {
- new date[6];
- TimestampToDate(time, date[2], date[1], date[0], date[3], date[4], date[5]);
- format(gstr, sizeof(gstr), "{FFFFFF}________________________________________________\n\t DETAILS OF PREVIOUS CHARGES:\n\nSubmitted by: %s %s\nSubmitted on: %02d/%02d/%i - %02d:%02d\nCharge: %s\n\n________________________________________________",
- offrank, offname, date[0], date[1], date[2], date[3], date[4], reason);
- }
- else
- {
- format(gstr, sizeof(gstr), "{FFFFFF}________________________________________________\n\t DETAILS OF PREVIOUS CHARGES:\n\nSubmitted by: %s %s\nSubmitted on: No date recorded\nCharge: %s\n\n________________________________________________",
- offrank, offname, reason);
- }
- Dialog_Show(playerid, MDC_NamePrevDetails, DIALOG_STYLE_MSGBOX, "{FFFFFF}MDC - Charge Details", gstr, "Return", "");
- }
- return true;
- }
- GREENSIDE::LoadAPBS()
- {
- if(cache_num_rows())
- {
- for(new l = 0, x = cache_num_rows(); l < x; l++)
- {
- apbData[l][apbSQLID] = cache_get_field_content_int(l, "apbBy");
- apbData[l][apbTime] = cache_get_field_content_int(l, "apbTimestamp");
- cache_get_field_content(l, "apbString", apbData[l][apbString], conn, 128);
- }
- }
- for(new l = 0, x = cache_num_rows(); l < x; l++)
- {
- new frank, ftion;
- MySQLFetchString(apbData[l][apbSQLID], "Name", apbData[l][apbBy], "players");
- MySQLFetchInt(apbData[l][apbSQLID], "FactionRank", frank, "players");
- MySQLFetchInt(apbData[l][apbSQLID], "Faction", ftion, "players");
- format(apbData[l][apbRank], 128, GetFactionRankName(ftion, frank));
- }
- return true;
- }
- GREENSIDE::LoadRemovedAPBs(playerid)
- {
- gstr[0] = EOS;
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- new apbmess[128], apbremovedby[MAX_PLAYER_NAME], apbremovetime;
- cache_get_field_content(i, "apbString", apbmess);
- cache_get_field_content(i, "apbRemovedBy", apbremovedby);
- apbremovetime = cache_get_field_content_int(i, "apbRemovedTime");
- new mess[135];
- format(mess, 135, "%s", apbmess);
- if(strlen(mess) >= 59)
- {
- strdel(mess, 70, sizeof(mess));
- strins(mess, "...", 70);
- }
- new date[6];
- TimestampToDate(apbremovetime, date[2], date[1], date[0], date[3], date[4], date[5]);
- format(gstr, sizeof(gstr), "%s[%02d/%02d %02d:%02d] - %s - %s\n", gstr, date[0], date[1], date[3], date[4], apbremovedby, mess);
- }
- if(strlen(gstr) >= 10) Dialog_Show(playerid, MDC_CreateS, DIALOG_STYLE_LIST, "MDC - Removed APBs", gstr, "Return", "");
- else Dialog_Show(playerid, MDC_CreateS, DIALOG_STYLE_MSGBOX, "MDC - Removed APBs", "{FFFFFF}There are no APBs that have been deleted.", "Return", "");
- return true;
- }
- GREENSIDE::BuyProperties(playerid)
- {
- if(cache_num_rows())
- {
- new asset_price = cache_get_field_content_int(0, "Price");
- if(BuyProperty[playerid][0] == 1)
- {
- if(GetPlayerHouseCount(playerid) >= MAX_HOUSE_PER_PLAYER) return SysMsg(playerid, "You already have two homes.");
- if(Cash[playerid] < asset_price) return SysMsg(playerid, "You do not have enough money to buy this house.");
- new h = BuyProperty[playerid][1];
- GivePlayerCash(playerid, -asset_price);
- FACTIONS[FACTION_PROP][FactionBankBalance] += asset_price;
- MySQLUpdateInt(FACTION_PROP, "BankBalance", FACTIONS[FACTION_PROP][FactionBankBalance], "factions");
- format(gstr, sizeof(gstr),"[%s] %s(%i) buys house %i for $%i from Silver Trading. (Total: $%i)", GetServerTimeString(), NameEx(playerid), playerid, HouseData[h][HouseDescription], asset_price, Cash[playerid]);
- HouseData[h][HouseOwnerSQLID] = SQLID[playerid];
- ProcessHouseKey(playerid);
- MySpawnID[playerid] = 3;
- if(HasHouseKey[playerid][0] == h) SpawnAtHouse[playerid] = 0;
- else if(HasHouseKey[playerid][1] == h) SpawnAtHouse[playerid] = 1;
- MySQLUpdateInt(HouseData[h][HouseSQLID], "OwnerSQLID", SQLID[playerid], "houses");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET GuestHouseID = 0 WHERE GuestHouseID = %i", HouseData[h][HouseSQLID]);
- mysql_pquery(conn, mquery);
- foreach(new i: Player) if(HouseData[h][HouseSQLID] == GuestHouseID[i]) GuestHouseID[i] = 0;
- MySQLUpdateInt(SQLID[playerid], "MySpawnID", MySpawnID[playerid], "players");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET MySpawnID = %i, SpawnAtHouse = %i WHERE id = %i", MySpawnID[playerid], SpawnAtHouse[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM traders WHERE SQLID=%i AND Type=%i AND ForSale=1 LIMIT 1", HouseData[h][HouseSQLID], BuyProperty[playerid][0]);
- mysql_pquery(conn, mquery);
- SendClientMessageF(playerid,COLOR_GOLD,"You have purchased %s for $%s.", HouseData[h][HouseDescription], format_cash(asset_price));
- ShowInfoText(playerid,"~w~PROPERTY ACQUIRED",5000);
- UnlockAchievement(playerid, 9);
- }
- else if(BuyProperty[playerid][0] == 2)
- {
- new bizzCount = 0, b = BuyProperty[playerid][1];
- for(new biz = 0; biz < MAX_BIZZ_PER_PLAYER; biz++)
- {
- if(PlayerBizzID[playerid][biz] != -1)
- {
- bizzCount ++;
- }
- }
- if(bizzCount +1 > MAX_BIZZ_PER_PLAYER) return SysMsg(playerid,"You can't have any more businesses.");
- if(Cash[playerid] < asset_price) return SysMsg(playerid, "You do not have enough money to buy this business.");
- BizzData[b][BizzOwnerSQLID] = SQLID[playerid];
- MySQLUpdateInt(BizzData[b][BizzSQLID], "OwnerSQLID", SQLID[playerid], "bizz");
- GivePlayerCash(playerid, -asset_price);
- FACTIONS[FACTION_PROP][FactionBankBalance] += asset_price;
- MySQLUpdateInt(FACTION_PROP, "BankBalance", FACTIONS[FACTION_PROP][FactionBankBalance], "factions");
- format(gstr, sizeof(gstr),"[%s] %s(%i) buys business %i for $%i from Silver Trading. (Total: $%i)", GetServerTimeString(), NameEx(playerid), playerid, BizzData[b][BizzDescription], asset_price, Cash[playerid]);
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM traders WHERE SQLID=%i AND Type=%i AND ForSale=1 LIMIT 1", BizzData[b][BizzSQLID], BuyProperty[playerid][0]);
- mysql_pquery(conn, mquery);
- for(new i = 0; i < MAX_BIZZ_PER_PLAYER; i++)
- {
- if(PlayerBizzID[playerid][i] == -1)
- {
- PlayerBizzID[playerid][i] = b;
- break;
- }
- }
- UpdateBizzLabel(b);
- SendClientMessageF(playerid,COLOR_GOLD, "You have purchased %s for $%s.",BizzData[b][BizzDescription],format_cash(asset_price));
- SendClientMessageF(playerid,COLOR_GOLD,"You Will Now Receive An Extra $%s Every PayDay.",format_cash(BizzData[b][Payout]));
- ShowInfoText(playerid,"~g~BUSINESS ACQUIRED",5000);
- }
- BuyProperty[playerid][0] = 0;
- BuyProperty[playerid][1] = 0;
- }
- else SysMsg(playerid, "This asset is no longer available for purchase, as someone else has already bought it or it was removed.");
- return true;
- }
- GREENSIDE::InsertNewBusiness(playerid, NewBizzCost, NewPayout, bType)
- {
- new bizzID = cache_insert_id(), vw = bizzID+40000;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE bizz SET Price = %i, Payout = %i, BizzType = %i, BizzVW = %i, OwnerSQLID = 0 WHERE id = %i", NewBizzCost, NewPayout, bType, vw, bizzID);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM bizz WHERE id = %i", bizzID);
- mysql_pquery(conn, mquery, "LoadBizzes");
- return true;
- }
- GREENSIDE::IsBizzOwner(playerid, bizzid)
- {
- if(BizzData[bizzid][BizzOwnerSQLID] == SQLID[playerid]) return bizzid;
- return false;
- }
- GREENSIDE::IsBizzMod(playerid, bizzid)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id FROM bizzmods WHERE BizzID = %i AND ModSQLID = %i", BizzData[bizzid][BizzSQLID], SQLID[playerid]);
- new Cache:result = mysql_query(conn, mquery);
- if(!cache_num_rows()) return cache_delete(result) && false;
- return cache_delete(result) && true;
- }
- GREENSIDE::ProcessManagerRemoval(playerid, sqlid, b, fullname[])
- {
- if(!cache_num_rows()) return SysMsg(playerid, "That player is not a manager of this business.");
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM bizzmods WHERE BizzID = %i AND ModSQLID = %i", BizzData[b][BizzSQLID], sqlid);
- mysql_pquery(conn, mquery);
- foreach(new i: Player)
- {
- if(SQLID[i] == sqlid && Logged{i})
- {
- SendClientMessageF(i, COLOR_BLUE, "You are no longer a manager of %s.", BizzData[b][BizzDescription]);
- }
- }
- SendClientMessageF(playerid, COLOR_BLUE, "You have removed %s as a manager of %s.", fullname, BizzData[b][BizzDescription]);
- return true;
- }
- GREENSIDE::ShowManagerList(playerid)
- {
- if(!cache_num_rows()) return SysMsg(playerid, "You do not have any business managers.");
- gstr[0] = EOS;
- new color[8], ManagerOnline, sub[64], managerIDs[64];
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- managerIDs[i] = cache_get_field_content_int(i, "ModSQLID");
- }
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- foreach(Player, p)
- {
- if(strfind(GetSQLName(managerIDs[i]), GetName(p)) != -1)
- {
- ManagerOnline = 1;
- break;
- }
- }
- if(ManagerOnline == 1) format(color, sizeof(color), "00FF00");
- else format(color, sizeof(color), "FF0000");
- format(sub, sizeof(sub), "{%s}%s\n", color, RPName(GetSQLName(managerIDs[i])));
- strcat(gstr, sub);
- }
- Dialog_Show(playerid, DIALOG_NONE, DIALOG_STYLE_LIST, "Business Managers", gstr, "Okay", "");
- return true;
- }
- stock DrugTypeAmountChange(playerid, drug, effpos)
- {
- switch(DrugTakenData[DrugsTaken[playerid][drug]][effActivated])
- {
- case 0:
- {
- switch(DrugTakenData[DrugsTaken[playerid][drug]][effDrugType])
- {
- case 0 .. 2:
- {
- DrugTakenData[DrugsTaken[playerid][drug]][effAmount][effpos] = floatdiv(DrugTakenData[DrugsTaken[playerid][drug]][effAmount][effpos], DrugTakenData[DrugsTaken[playerid][drug]][effTimeTo]);
- }
- case 3 .. 5:
- {
- DrugTakenData[DrugsTaken[playerid][drug]][effAmount][effpos] = floatdiv(DrugTakenData[DrugsTaken[playerid][drug]][effAmount][effpos], floatdiv(DrugTakenData[DrugsTaken[playerid][drug]][effTimeTo], 5));
- }
- }
- }
- case 2:
- {
- DrugTakenData[DrugsTaken[playerid][drug]][cmdAmount][effpos] = floatdiv(DrugTakenData[DrugsTaken[playerid][drug]][cmdAmount][effpos], floatdiv(DrugTakenData[DrugsTaken[playerid][drug]][cmdStart], 5));
- }
- case 4:
- {
- DrugTakenData[DrugsTaken[playerid][drug]][ovrAmount][effpos] = floatdiv(DrugTakenData[DrugsTaken[playerid][drug]][ovrAmount][effpos], floatdiv(DrugTakenData[DrugsTaken[playerid][drug]][ovrDuration], 5));
- }
- }
- return true;
- }
- stock DrugTimePassed(playerid, drug, dat = 0)
- {
- #pragma unused dat
- if(DrugTakenData[DrugsTaken[playerid][drug]][effActivated] == 1)
- {
- if(DrugTakenData[DrugsTaken[playerid][drug]][effTimeTo] >= 1)
- {
- switch(DrugTakenData[DrugsTaken[playerid][drug]][effDrugType])
- {
- case 0 .. 2:
- {
- return true;
- }
- case 3 .. 5:
- {
- if(DrugTakenData[DrugsTaken[playerid][drug]][effTimeTo] % 5 == 0) return true;
- else DrugTakenData[DrugsTaken[playerid][drug]][effTimeTo] --;
- }
- }
- }
- }
- else if(DrugTakenData[DrugsTaken[playerid][drug]][effActivated] == 2)
- {
- if(DrugTakenData[DrugsTaken[playerid][drug]][effDuration] % 5 == 0) return true;
- else DrugTakenData[DrugsTaken[playerid][drug]][effDuration]--;
- }
- else if(DrugTakenData[DrugsTaken[playerid][drug]][effActivated] == 4)
- {
- return true;
- }
- return false;
- }
- GREENSIDE::ReBlackout(i)
- {
- PlayerTextDrawBoxColor(i, BlindfoldEffect[i], HexTransparency[9]);
- PlayerTextDrawColor(i, BlindfoldEffect[i], HexTransparency[9]);
- PlayerTextDrawShow(i, BlindfoldEffect[i]);
- return true;
- }
- GREENSIDE::MakeVeh(playerid, cost, c1, c2, bool:donator, mileage, lastoiled, ownerSQLID)
- {
- if(ownerSQLID > 0)
- {
- if(cache_num_rows() >= MAX_VEH_PER_PLAYER)
- {
- SysMsg(playerid,"They can't have any more cars.");
- return true;
- }
- }
- new Float:X, Float:Y, Float:Z, Float:Rot, model, vid, sqlid;
- vid = GetPlayerVehicleID(playerid);
- GetVehiclePos(vid,X,Y,Z);
- GetVehicleZAngle(vid,Rot);
- ChangeVehicleColorEx(vid,c1,c2);
- model = GetVehicleModel(vid);
- new regplate[MAX_REG_PLATE];
- format(regplate, MAX_REG_PLATE, GetNewRegPlate());
- DestroyVehicleEx(vid, "vid 2");
- ClearVehicleData(vid);
- MySQLCreateVehicleEntry(playerid, X, Y, Z, Rot, cost, model, c1, c2, ownerSQLID, donator, regplate);
- sqlid = MySQLCheckVehicle(model, cost, regplate);
- if(ownerSQLID > 0)
- {
- foreach(new i: Player)
- {
- if(SQLID[i] == ownerSQLID)
- {
- SendClientMessage(i, COLOR_GOLD, "You have been given a Donator vehicle.");
- SendClientMessage(i, COLOR_GOLD, "Vehicle ownership commands can be found at: '/help Vehicle'");
- ShowInfoText(i, "~b~vehicle ACQUIRED", 5000);
- break;
- }
- }
- //VehicleData[vid][VehicleOwnerSQLID] = ownerSQLID;
- MySQLUpdateInt(sqlid, "OwnerSQLID", ownerSQLID, "vehicles");
- }
- return true;
- }
- GREENSIDE::CreateFVeh()
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM `fveh` WHERE id = %i", cache_insert_id());
- mysql_pquery(conn, mquery, "LoadFactionVehicles");
- return true;
- }
- GREENSIDE::Float:GetHitAccuracy(playerid)
- {
- new Float:h, Float:f, Float:accuracy;
- if(ShotsFired[playerid] == 0) accuracy = 0.0;
- else
- {
- h = float(ShotsHit[playerid]);
- f = float(ShotsFired[playerid]);
- accuracy = (h / f) * 100;
- }
- return accuracy;
- }
- GREENSIDE::Float:GetHeadshotAccuracy(playerid)
- {
- new Float:h, Float:s, Float:accuracy;
- if(ShotsFired[playerid] == 0) accuracy = 0.0;
- else if(HeadshotsHit[playerid] == 0) accuracy = 0.0;
- else
- {
- h = float(ShotsHit[playerid]);
- s = float(HeadshotsHit[playerid]);
- accuracy = (s / h) * 100;
- }
- return accuracy;
- }
- GREENSIDE::CheckAccountData(playerid, sqlid, maid)
- {
- new regdate[100], isOnline, accDisabled, regIP[20], numstr[10], recentIP[20], recentSerial[128];
- gstr[0] = EOS;
- if(cache_num_rows())
- {
- cache_get_field_content(0, "RegisterDate", regdate, conn, 100);
- cache_get_field_content(0, "IP", regIP, conn, 20);
- cache_get_field_content(0, "RecentIP", recentIP, conn, 20);
- cache_get_field_content(0, "RecentSerial", recentSerial, conn, 128);
- accDisabled = cache_get_field_content_int(0, "AccountDisabled");
- isOnline = cache_get_field_content_int(0, "Online");
- }
- else return SysMsg(playerid, "No account data found.");
- strcat(gstr, "ACCOUNT INFORMATION\n\nID: ");
- valstr(numstr, sqlid);
- strcat(gstr, numstr);
- strcat(gstr, "\nName: ");
- strcat(gstr, GetSQLName(sqlid));
- strcat(gstr, "\nMaster Account: ");
- strcat(gstr, GetMasterName(maid));
- strcat(gstr, "\nRegister Date: ");
- if(strlen(regdate) > 1) strcat(gstr, regdate);
- else strcat(gstr, "Pre 1.0");
- strcat(gstr, "\nRegister IP: ");
- strcat(gstr, regIP);
- strcat(gstr, "\nMost Recent IP: ");
- strcat(gstr, recentIP);
- strcat(gstr, "\nMost Recent Game Serial: ");
- strcat(gstr, recentSerial);
- strcat(gstr, "\nLast Login: ");
- strcat(gstr, UnixDate(-1, sqlid, 1));
- strcat(gstr, "\nAccount Disabled: ");
- switch(accDisabled)
- {
- case 1: strcat(gstr, "Yes");
- case 0: strcat(gstr, "No");
- }
- strcat(gstr, "\nOnline: ");
- switch(isOnline)
- {
- case 1: strcat(gstr, "Yes");
- case 0: strcat(gstr, "No");
- }
- strcat(gstr, "\nAccount Banned: ");
- if(MySQLCheckAccountBanned(sqlid) == 1) strcat(gstr, "Yes");
- else strcat(gstr, "No");
- strcat(gstr, "\nRegister IP Banned: ");
- if(MySQLCheckIPBanned(regIP) == 1) strcat(gstr, "Yes");
- else strcat(gstr, "No");
- strcat(gstr, "\nDate Banned (character or master): ");
- if(MySQLCheckTempBanned(sqlid, recentIP) > 0) strcat(gstr, "Yes");
- else strcat(gstr, "No");
- strcat(gstr, "\n");
- ShowMessage(playerid, "Account Check", gstr, "Done");
- return true;
- }
- /*
- GREENSIDE::WhoIsPrime(playerid, tsqlid, tmasterid, infos[])
- {
- if(cache_num_rows())
- {
- gstr[0] = EOS;
- new master_details[5][75];
- format(gstr, sizeof(gstr), gstr);
- cache_get_field_content(0, "Username", master_details[1]);
- strcat(gstr, "{FFFFFF}Below are details relating to the character {BDBDBD}");
- strcat(gstr, master_details[1]);
- strcat(gstr, "\n\n{F3EEA0}Master Account:\n");
- cache_get_field_content(0, "EMail", master_details[2]);
- cache_get_field_content(0, "GeoDetails", master_details[3]);
- cache_get_field_content(0, "RegTimeStamp", master_details[4]);
- strcat(gstr, "{FFFFFF}ID {BDBDBD}");
- valstr(master_details[0], tmasterid);
- strcat(gstr, master_details[0]);
- strcat(gstr, "\n{FFFFFF}Username {BDBDBD}");
- strcat(gstr, master_details[1]);
- strcat(gstr, "\n{FFFFFF}Email {BDBDBD}");
- strcat(gstr, master_details[2]);
- strcat(gstr, "\n{FFFFFF}Geo {BDBDBD}");
- if(strlen(master_details[3]) > 0)
- {
- for(new c = 0; c < 240; c++)
- {
- if(strcmp(master_details[3], PCountry[c][1], true) == 0)
- {
- strcat(gstr, PCountry[c][0]);
- strcat(gstr, " (");
- strcat(gstr, master_details[3]);
- strcat(gstr, ")");
- break;
- }
- }
- }
- else
- {
- strcat(gstr, "Unknown");
- }
- strcat(gstr, "\n{FFFFFF}Registration Date {BDBDBD}");
- strcat(gstr, master_details[4]);
- strcat(gstr, "\n\n{F3EEA0}Full character list of MA:");
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Name, id, Online FROM players WHERE MasterAccount= %i ORDER BY id ASC LIMIT 4", tmasterid);
- mysql_pquery(conn, mquery, "WhoIsPlayers", "dss", playerid, gstr, master_details[1]);
- }
- ShowMessage(playerid, "", "No data found.", "OK");
- return true;
- }*/
- GREENSIDE::WhoIsPlayers(playerid, info[], maname[])
- {
- new sqlid1, char_name[MAX_PLAYER_NAME], infos[1024], online;
- format(infos, 1024, info);
- for(new i, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "Name", char_name);
- sqlid1 = cache_get_field_content_int(i, "id");
- online = cache_get_field_content_int(i, "Online");
- valstr(gstr, sqlid1);
- strcat(infos, "\n{FFFFFF}SQLID ");
- strcat(infos, gstr);
- if(online == 1) strcat(infos, " {00FF00}");
- else strcat(infos, " {BDBDBD}");
- strcat(infos, char_name);
- }
- format(gstr, sizeof(gstr), "Info for {00FF00}%s", maname);
- ShowMessage(playerid, gstr, infos, "Done");
- return true;
- }
- GREENSIDE::AdminWarnings(playerid, sqlid)
- {
- new info[2048], rowAdminName[MAX_PLAYER_NAME], rowReason[100], rowDatestamp[12];
- strcat(info, "{249CFF}List of the most recent warnings\n{FFFFFF}A maximum of 15 will be displayed\n\n");
- for(new i, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "AdminName", rowAdminName);
- cache_get_field_content(i, "Datestamp", rowDatestamp);
- cache_get_field_content(i, "Reason", rowReason);
- strcat(info, "{FFFFFF}[");
- strcat(info, rowDatestamp);
- strcat(info, "] {249CFF}Warned by ");
- strcat(info, rowAdminName);
- strcat(info, ": '");
- strcat(info, rowReason);
- strcat(info, "'\n");
- }
- if(cache_num_rows() == 0) return SysMsg(playerid,"This player has no warnings to show.");
- ShowMessage(playerid, GetSQLName(sqlid), info, "Thanks!");
- return true;
- }
- GREENSIDE::ViewDateBans(playerid)
- {
- if(!cache_num_rows()) return SysMsg(playerid,"No date bans are currently active.");
- SendClientMessage(playerid, COLOR_RED, "List of active date bans:");
- new pname[MAX_PLAYER_NAME], bannedip[18], banreason[50], unbandate[40];
- for(new i, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "PlayerName", pname);
- cache_get_field_content(i, "BannedIP", bannedip);
- cache_get_field_content(i, "BanReason", banreason);
- cache_get_field_content(i, "UnbanDate", unbandate);
- SendClientMessageF(playerid, COLOR_WHITE, "%s (%s) | Reason: '%s' | Expires: %s\n", pname, bannedip, banreason, unbandate);
- }
- return true;
- }
- GREENSIDE::ReloadBanHosts(playerid)
- {
- for(new i, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "BannedHost", HostBans[i]);
- }
- SysMsg(playerid,"Host bans reloaded");
- AdminLog(playerid, 0, "", "Reloaded host bans from database");
- return true;
- }
- GREENSIDE::checkIP(playerid, str[])
- {
- SendClientMessageF(playerid, COLOR_GOLD, "Account names that match that IP [%s]:", str);
- if(!cache_num_rows()) return SendClientMessage(playerid, COLOR_WHITE, "None");
- new char_name[MAX_PLAYER_NAME];
- for(new i, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "Name", char_name);
- SendClientMessage(playerid, COLOR_WHITE, char_name);
- }
- return true;
- }
- GREENSIDE::CheckSerial(playerid, serial[])
- {
- SendClientMessageF(playerid, COLOR_GOLD, "Account names that match that serial [%s]:", serial);
- new char_name[MAX_PLAYER_NAME];
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "Name", char_name);
- SendClientMessage(playerid, COLOR_WHITE, char_name);
- }
- return true;
- }
- GREENSIDE::Float:GetXYInFrontOfPlayer(playerid, &Float:X, &Float:Y, Float:distance)
- {
- new Float:A;
- GetPlayerPos(playerid, X, Y, A);
- if(IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), A);
- else GetPlayerFacingAngle(playerid, A);
- X += (distance * floatsin(-A, degrees));
- Y += (distance * floatcos(-A, degrees));
- return A;
- }
- GREENSIDE::Float:DistanceBetweenPoints(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2)
- {
- return floatadd(floatadd(floatsqroot(floatpower(floatsub(x1,x2),2)),floatsqroot(floatpower(floatsub(y1,y2),2))),floatsqroot(floatpower(floatsub(z1,z2),2)));
- }
- GREENSIDE::CheckPlayerBans(playerid)
- {
- if(cache_num_rows() != 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, " ");
- SendClientMessageF(playerid,COLOR_WHITE, "{AF1E2D}BANNED: {FFFFFF}This account {009900}%s{FFFFFF} has been banned from this server.",PlayerIP[playerid]);
- SendClientMessage(playerid, COLOR_WHITE, "Visit http://redcountyrp.com/forum/ if you think your ban is invalid or want to appeal.");
- KickPlayer(playerid, 25);
- return true;
- }
- else
- {
- foreach(new j: Player)
- {
- if(j == playerid) continue;
- if(MasterAccount[j] == MasterAccount[playerid])
- {
- SendClientMessage(playerid, COLOR_WHITE, "\n");
- SendClientMessageF(playerid,COLOR_WHITE, "The Master Account {009900}%s{FFFFFF} is already connected to the server.",GetName(playerid));
- return KickPlayer(playerid, 26);
- }
- }
- SetPlayerInterior(playerid, 0);
- SetPlayerColor(playerid, 0xBFFFBC00);
- SetPlayerFightingStyle(playerid, UsingFightStyle{playerid});
- SetPlayerTime(playerid, gServerHour, gServerMinute);
- // Reset player weapon skills
- SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 1);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 1);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 1);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 1);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 1);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 1);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 1);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 1);
- SendClientMessageF(playerid, COLOR_GOLD, "Welcome to Greenside Roleplay, %s {FFFFFF}[Version %s (C) xOmega %i - greensiderp.com.br]", GetName(playerid), VERSION, gServerYear);
- foreach(new i: Player)
- {
- if(IsPlayerAdminLevelOK(i, 1) && AdminMsgToggle{i})
- {
- if(!IPTog{i}) SendClientMessageF(i, COLOR_FADE3, "%s has joined the server! ID: {FFFFFF}%i {AAAAAA}(IP: {FFFFFF}%s{AAAAAA})", GetName(playerid), playerid, PlayerIP[playerid]);
- else SendClientMessageF(i, COLOR_FADE3, "%s has joined the server! ID: {FFFFFF}%i {AAAAAA}", GetName(playerid), playerid);
- }
- }
- JustConnectedScreens(playerid);
- }
- return true;
- }
- GREENSIDE::LoginMasterAccount(playerid)
- {
- if(cache_num_rows() != 0)
- {
- new lastLogin, howLongAgo[32], diff, days, hr, mins;
- lastLogin = cache_get_field_content_int(0, "LastLog");
- diff = gettime() - lastLogin;
- while(diff > 86400)
- {
- days++;
- diff -= 86400;
- }
- while(diff > 3600)
- {
- hr++;
- diff -= 3600;
- }
- while(diff > 60)
- {
- mins++;
- diff -= 60;
- }
- if(days > 0 && hr > 0) format(howLongAgo, sizeof(howLongAgo), "%i %s and %i %s", days, NeedAnS("day", days), hr, NeedAnS("hour", hr));
- else if(days > 0 && hr == 0) format(howLongAgo, sizeof(howLongAgo), "%i %s", days, NeedAnS("day", days));
- else if(hr > 0 && mins > 0) format(howLongAgo, sizeof(howLongAgo), "%i %s and %i %s", hr, NeedAnS("hour", hr), mins, NeedAnS("minute", mins));
- else if(hr > 0 && mins == 0) format(howLongAgo, sizeof(howLongAgo), "%i %s", hr, NeedAnS("hour", hr));
- else if(mins > 0 && diff > 0) format(howLongAgo, sizeof(howLongAgo), "%i %s and %i %s", mins, NeedAnS("minute", mins), diff, NeedAnS("second", diff));
- else if(mins > 0 && diff == 0) format(howLongAgo, sizeof(howLongAgo), "%i %s", mins, NeedAnS("minute", mins));
- else format(howLongAgo, sizeof(howLongAgo), "%i %s", diff, NeedAnS("second", diff));
- cache_get_field_content(0, "Username", MasterAccountName[playerid]);
- PasswordTries[playerid] = 0;
- MasterAccountLogged{playerid} = true;
- MyCharacters[playerid][0] = 0;
- MyCharacters[playerid][1] = 0;
- MyCharacters[playerid][2] = 0;
- MyCharacters[playerid][3] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "");
- SendClientMessageF(playerid, COLOR_WHITE, "You have {09B300}successfully{FFFFFF} logged in as {09B300}%s{FFFFFF}.", GetName(playerid));
- SendClientMessageF(playerid, COLOR_WHITE, "Last Login: %s, %s ago", UnixDate(lastLogin, -1, 0), howLongAgo);
- SendClientMessage(playerid, COLOR_WHITE, "");
- SendClientMessage(playerid, COLOR_WHITE, "");
- gstr[0] = EOS;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE masters SET RecentIP = '%e', RecentSerial = '%e', LastLog = %i WHERE id = %i", PlayerIP[playerid], PlayerSerial[playerid], gettime(), MasterAccount[playerid]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "INSERT INTO connections (MasterAccount, IP, Timestamp, Type, Serial) VALUES (%i, '%e', %i, 0, '%e')", MasterAccount[playerid], PlayerIP[playerid], gettime(), PlayerSerial[playerid]);
- mysql_pquery(conn, mquery);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT Name,id,Faction,Skin,PlayerLevel FROM players WHERE Username = '%e' ORDER BY id ASC LIMIT 4", GetName(playerid));
- mysql_pquery(conn, mquery, "ShowMainMenu", "d", playerid);
- }
- else
- {
- SendClientMessage(playerid, -1, "An error has occurred with your Master Account, please re-join to see if this resolves the issue.");
- SendClientMessage(playerid, -1, "If the issue persists, contact an administrator for assistance using the support ticket system.");
- return KickPlayer(playerid, 27);
- }
- return true;
- }
- GREENSIDE::ShowMainMenu(playerid)
- {
- if(cache_num_rows())
- {
- new charsfound = cache_num_rows();
- /*
- if(charsfound == 1)
- {
- new name[MAX_PLAYER_NAME + 1], sql;
- sql = cache_get_field_content_int(0, "id");
- cache_get_field_content(0, "Name", name, conn, MAX_PLAYER_NAME + 1);
- OnPlayerSelectCharacter(playerid, sql, name);
- }
- else
- {
- */
- for(new x = 0; x < charsfound; x++)
- {
- MyCharacters[playerid][x] = cache_get_field_content_int(x, "id");
- CharSelectSQL[playerid][x] = cache_get_field_content_int(x, "id");
- CharSelectSkin[playerid][x] = cache_get_field_content_int(x, "Skin");
- CharSelectFaction[playerid][x] = cache_get_field_content_int(x, "Faction");
- CharSelectLevel[playerid][x] = cache_get_field_content_int(x, "PlayerLevel");
- }
- for(new x = 0; x < 4; x++)
- {
- if(CharSelectSQL[playerid][x] != 0)
- {
- PlayerTextDrawSetPreviewModel(playerid, CharSelInfoTD[playerid][x][0], CharSelectSkin[playerid][x]);
- format(sgstr, sizeof(sgstr), "%s", GetSQLName(CharSelectSQL[playerid][x]));
- PlayerTextDrawSetString(playerid, CharSelInfoTD[playerid][x][1], sgstr);
- format(sgstr, sizeof(sgstr), "%s", GetFactionNameFromId(CharSelectFaction[playerid][x]));
- PlayerTextDrawSetString(playerid, CharSelInfoTD[playerid][x][2], sgstr);
- format(sgstr, sizeof(sgstr), "Level %i", CharSelectLevel[playerid][x]);
- PlayerTextDrawSetString(playerid, CharSelInfoTD[playerid][x][3], sgstr);
- PlayerTextDrawShow(playerid, CharSelInfoTD[playerid][x][0]);
- PlayerTextDrawShow(playerid, CharSelInfoTD[playerid][x][1]);
- PlayerTextDrawShow(playerid, CharSelInfoTD[playerid][x][2]);
- PlayerTextDrawShow(playerid, CharSelInfoTD[playerid][x][3]);
- }
- }
- format(sgstr, sizeof(sgstr), "Welcome to GSRP, %s!", GetName(playerid));
- PlayerTextDrawSetString(playerid, CharSelWelcome[playerid], sgstr);
- PlayerTextDrawShow(playerid, CharSelWelcome[playerid]);
- TextDrawShowForPlayer(playerid, CharSelBackground);
- TextDrawShowForPlayer(playerid, CharSelHeader);
- TextDrawShowForPlayer(playerid, CharSelX);
- SelectTextDraw(playerid, COLOR_GREY);
- }
- /*
- }
- */
- else SendClientMessage(playerid, -1, "{84BE6A}No characters to play yet. Please make a character on the UCP.");
- return true;
- }
- GREENSIDE::CheckTempBans(playerid)
- {
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- new unbanned = cache_get_field_content_int(i, "Unbanned");
- if(!unbanned)
- {
- new unbandate[40], banreason[50], banningadmin[25];
- cache_get_field_content(i, "UnbanDate", unbandate);
- cache_get_field_content(i, "BanReason", banreason);
- cache_get_field_content(i, "BannedBy", banningadmin);
- SendClientMessage(playerid, COLOR_WHITE, "\n");
- SendClientMessageF(playerid, COLOR_WHITE, "{AF1E2D}TEMPORARLY BANNED: {FFFFFF}Your account {009900}%s{FFFFFF} has been temporarily banned from this server.", GetName(playerid));
- SendClientMessageF(playerid, COLOR_WHITE, "You will be automatically unbanned on: {009900}%s", unbandate);
- SendClientMessageF(playerid,COLOR_WHITE, "Reason for temporary ban: {009900}%s", banreason);
- SendClientMessageF(playerid,COLOR_WHITE, "Banned by: {009900}%s", banningadmin);
- KickPlayer(playerid, 28);
- return true;
- }
- }
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM players WHERE id = %i", SQLID[playerid]);
- mysql_pquery(conn, mquery, "OnCharacterLogin", "d", playerid);
- return true;
- }
- stock SetupHospitalCamera(playerid)
- {
- if(NearestHospital[playerid] == 1)
- {
- SetPlayerPos(playerid,1237.5080, 311.3325, 21.3845);
- switch(random(3))
- {
- case 0:
- {
- SetPlayerCameraPos(playerid, 1200.2313, 303.1777, 27.5845);
- SetPlayerCameraLookAt(playerid, 1210.1567, 304.3964, 25.8480);
- }
- case 1:
- {
- SetPlayerCameraPos(playerid, 1236.7987, 353.4057, 23.8062);
- SetPlayerCameraLookAt(playerid, 1238.0174, 343.4802, 23.8062);
- }
- case 2:
- {
- SetPlayerCameraPos(playerid, 1268.2092, 331.3218, 22.6062);
- SetPlayerCameraLookAt(playerid, 1258.7540, 328.0661, 20.5271);
- }
- }
- }
- else if(NearestHospital[playerid] == 2)
- {
- SetPlayerPos(playerid, -320.381256, 1040.574340, 22.314844);
- SetPlayerCameraPos(playerid, -288.4595, 1066.7110, 25.4998);
- SetPlayerCameraLookAt(playerid, -296.1200, 1060.2832, 24.4545);
- }
- else if(NearestHospital[playerid] == 3)
- {
- SetPlayerPos(playerid, -2200.494140, -2300.194824, 31.375000);
- SetPlayerCameraPos(playerid, -2188.5778, -2296.6152, 30.8749);
- SetPlayerCameraLookAt(playerid, -2197.8320, -2299.9833, 32.6114);
- }
- SetPlayerVirtualWorldEx(playerid, 0);
- SetPlayerInterior(playerid, 0);
- TogglePlayerControllable(playerid, 0);
- return true;
- }
- GREENSIDE::ShowCharacters(playerid)
- {
- new num = cache_num_rows();
- if(num == 0) SendClientMessageF(playerid,COLOR_WHITE, "There is only {FF4753}1{FFFFFF} character associated with the Master Account {FF4753}%s", MasterAccountName[playerid]);
- else SendClientMessageF(playerid,COLOR_WHITE, "There are {FF4753}%i{FFFFFF} characters associated with the Master Account {FF4753}%s", num, MasterAccountName[playerid]);
- new char_name[MAX_PLAYER_NAME];
- for(new i = 0; i < num; i++)
- {
- cache_get_field_content(i, "Name", char_name);
- SendClientMessage(playerid, COLOR_SKYBLUE, char_name);
- }
- SendClientMessage(playerid, COLOR_WHITE, "More details and advanced options are available online at {FF4753}greensiderp.com.br/login");
- return true;
- }
- GREENSIDE::MAInfo(playerid)
- {
- new ma_email[100], ma_lastlog, ma_lastip[18], ma_state;
- cache_get_field_content(0, "EMail", ma_email);
- cache_get_field_content(0, "RecentIP", ma_lastip);
- ma_lastlog = cache_get_field_content_int(0, "LastLog");
- ma_state = cache_get_field_content_int(0, "State");
- SendClientMessage(playerid,COLOR_SKYBLUE,"[Master Account]");
- SendClientMessageF(playerid, COLOR_WHITE, "Username: {FF4753}%s{FFFFFF} | Email: {FF4753}%s", MasterAccountName[playerid], ma_email);
- SendClientMessageF(playerid,COLOR_WHITE, "Last Login: {FF4753}%s{FFFFFF} from IP {FF4753}%s", UnixDate(ma_lastlog, -1, 0), ma_lastip);
- switch(ma_state)
- {
- case 1: // Active
- {
- SendClientMessageF(playerid, COLOR_WHITE, "State: {FF4753}Your account is in good standing.");
- }
- }
- }
- GREENSIDE::ProcessDonation(playerid)
- {
- gstr[0] = EOS;
- new rewardCash = 0, rewardWLevel = 0, rewardPLevel = 0, rewardDLevel = 0, rewardCarModel = 0, refundXP = 0, numbervalue[10];
- if(cache_num_rows())
- {
- rewardCash = cache_get_field_content_int(0, "DonationCash");
- rewardWLevel = cache_get_field_content_int(0, "DonationWLevel");
- rewardPLevel = cache_get_field_content_int(0, "DonationPLevel");
- rewardDLevel = cache_get_field_content_int(0, "DonationDLevel");
- rewardCarModel = cache_get_field_content_int(0, "DonationCarModel");
- refundXP = cache_get_field_content_int(0, "RefundXP");
- }
- if(rewardCash == 0 && rewardWLevel == 0 && rewardPLevel == 0 && rewardDLevel == 0 && rewardCarModel == 0 && refundXP == 0) return SysMsg(playerid, "You do not have any donation rewards to get at this time.");
- format(gstr, sizeof(gstr), "{E0BA2A}%s{FFFFFF},\nYou have collected the following rewards for donating:\n\n", NameEx(playerid));
- strcat(gstr, "Cash: {E0BA2A}$");
- if(rewardCash > 0)
- {
- GivePlayerCash(playerid, rewardCash);
- MySQLUpdateInt(SQLID[playerid], "DonationCash", 0, "players");
- MySQLUpdateInt(SQLID[playerid], "Cash", Cash[playerid], "players");
- }
- valstr(numbervalue, rewardCash);
- strcat(gstr, numbervalue);
- strcat(gstr, "{FFFFFF}\nPlayer Levels: {E0BA2A}+");
- if(rewardPLevel > 0)
- {
- PlayerLevel[playerid] += rewardPLevel;
- MySQLUpdateInt(SQLID[playerid], "DonationPLevel", 0, "players");
- MySQLUpdateInt(SQLID[playerid], "PlayerLevel", PlayerLevel[playerid], "players");
- }
- valstr(numbervalue, rewardPLevel);
- strcat(gstr, numbervalue);
- strcat(gstr, "{FFFFFF}\nDowntime XP: {E0BA2A}+");
- if(refundXP > 0)
- {
- PlayerXP[playerid] += refundXP;
- MySQLUpdateInt(SQLID[playerid], "PlayerXP", PlayerXP[playerid], "players");
- MySQLUpdateInt(SQLID[playerid], "RefundXP", 0, "players");
- }
- valstr(numbervalue, refundXP);
- strcat(gstr, numbervalue);
- strcat(gstr, "{FFFFFF}\nWeapon Skill Levels: {E0BA2A}+");
- if(rewardWLevel > 0)
- {
- WeaponSkillLevel[playerid] += rewardWLevel;
- if(WeaponSkillLevel[playerid] > 10) WeaponSkillLevel[playerid] = 10;
- new newSkill = WeaponSkillLevel[playerid] * 100;
- new SkillOneHand;
- if(newSkill > 999)
- {
- newSkill = 999;
- SkillOneHand = 998;
- }
- SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, SkillOneHand);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, SkillOneHand);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, SkillOneHand);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, newSkill);
- MySQLUpdateInt(SQLID[playerid], "DonationWLevel", 0, "players");
- MySQLUpdateInt(SQLID[playerid], "WeaponSkill", WeaponSkillLevel[playerid], "players");
- }
- valstr(numbervalue, rewardWLevel);
- strcat(gstr, numbervalue);
- strcat(gstr, "{FFFFFF}\nDonator Level: {E0BA2A}");
- valstr(numbervalue, rewardDLevel);
- strcat(gstr, numbervalue);
- strcat(gstr, "{FFFFFF}\nDonator Vehicle: {E0BA2A}");
- if(rewardCarModel > 0)
- {
- strcat(gstr, GetVehicleNameEx(rewardCarModel));
- strcat(gstr, "{FFFFFF} (Use /donationvehicle to spawn this)");
- }
- else
- {
- strcat(gstr, "None");
- }
- strcat(gstr, "\n\n{FFFFFF}Thank you for your donation. All of the above (except vehicles) have been added to your account.");
- ShowMessage(playerid, "Donation Rewards", gstr, "Thanks!");
- gstr[0] = EOS;
- format(gstr, sizeof(gstr),"[%s] %s(%i) gets $%i from donation. (Total: $%i)", GetServerTimeString(), NameEx(playerid), playerid, rewardCash, Cash[playerid]);
- if(rewardDLevel > 0 && IsDonator[playerid] < rewardDLevel)
- {
- IsDonator[playerid] = rewardDLevel;
- MySQLUpdateInt(SQLID[playerid], "DonationDLevel", 0, "players");
- MySQLUpdateInt(SQLID[playerid], "IsDonator", rewardDLevel, "players");
- gstr[0] = EOS;
- format(gstr, sizeof(gstr),"Congratulations to %s. They now have the rank of Level %i Donator.",NameEx(playerid),rewardDLevel);
- SendClientMessageToAllLogged(COLOR_DONATE, gstr);
- }
- return true;
- }
- GREENSIDE::AgeCheck(playerid)
- {
- if(cache_num_rows())
- {
- new age, birthyear, birthmonth, birthday, thstndrd[3];
- birthyear = cache_get_field_content_int(0, "BirthYear");
- birthmonth = cache_get_field_content_int(0, "BirthMonth");
- birthday = cache_get_field_content_int(0, "BirthDate");
- age = gServerYear - birthyear;
- switch(birthday)
- {
- case 1,21,31: format(thstndrd, sizeof(thstndrd), "st");
- case 2,22: format(thstndrd, sizeof(thstndrd), "nd");
- case 3,23: format(thstndrd, sizeof(thstndrd), "rd");
- default: format(thstndrd, sizeof(thstndrd), "th");
- }
- SendClientMessageF(playerid, COLOR_WHITE, "Your birthday is set at: %i%s of %s %i", birthday, thstndrd, GetMonthName(birthmonth), birthyear);
- SendClientMessageF(playerid, COLOR_WHITE, "The current roleplay year is %i, making you %i years old.", gServerYear, age);
- SendClientMessage(playerid, COLOR_WHITE, "You can change your date of birth by using /changedob. Use /findyear with your desired age.");
- }
- return true;
- }
- GREENSIDE::LastOnlineCheck(playerid)
- {
- if(cache_num_rows() == 1)
- {
- new in, out, diff, h, m, name[MAX_PLAYER_NAME];
- cache_get_field_content(0, "Name", name);
- out = cache_get_field_content_int(0, "LastLogout");
- in = cache_get_field_content_int(0, "LastLogin");
- SendClientMessageF(playerid, COLOR_WHITE, "[%s] Last Login: {6896F1}%s", name, UnixDate(in, -1, 1));
- SendClientMessageF(playerid, COLOR_WHITE, "Last Logout: {6896F1}%s", UnixDate(out, -1, 2));
- if(in > out)
- {
- diff = gettime() - in;
- while(diff > 3600)
- {
- diff -= 3600;
- h++;
- }
- while(diff > 60)
- {
- diff -= 60;
- m++;
- }
- SendClientMessageF(playerid, COLOR_WHITE, "Currently online for: {6896F1}%i hours and %i minutes", h, m);
- }
- else
- {
- diff = out - in;
- while(diff > 3600)
- {
- diff -= 3600;
- h++;
- }
- while(diff > 60)
- {
- diff -= 60;
- m++;
- }
- SendClientMessageF(playerid, COLOR_WHITE, "Was logged in for: {6896F1}%i hours and %i minutes", h, m);
- }
- }
- else return SysMsg(playerid, "That name was not found. Please include first name, last name and an underscore.");
- return true;
- }
- GREENSIDE::ProcessRoomRental(playerid, motel, params[])
- {
- if(!cache_num_rows()) return SendClientMessage(playerid,COLOR_GOLD,"I'm sorry but we are currently fully booked.");
- else
- {
- if(isnull(params)) return SysMsg(playerid,"Usage: /rentroom [amount of days to stay]");
- new daystostay = strval(params);
- if(daystostay < 1 || daystostay > 7) return SysMsg(playerid,"You may only stay for up to 7 days.");
- new ID = cache_get_field_content_int(0, "id");
- new fee;
- switch(MotelData[ID][MotelID])
- {
- case 1,4,5: fee = 100 * daystostay;
- case 2,7: fee = 200 * daystostay;
- case 3,8,9: fee = 500 * daystostay;
- case 6: fee = 150 * daystostay;
- }
- if(Cash[playerid] < fee) return SysMsg(playerid,"You don't have enough money to rent a room here.");
- MotelData[ID][RoomOwner] = SQLID[playerid];
- RentRoom[playerid] = ID;
- GivePlayerCash(playerid, -fee);
- MotelData[ID][RoomLocked] = 1;
- MotelData[ID][RoomDaysLeft] = daystostay;
- MySpawnID[playerid] = 4;
- MySQLUpdateInt(SQLID[playerid], "MySpawnID", MySpawnID[playerid], "players");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE motel SET OwnerSQLID = %i, RoomLocked = 1, RoomDaysLeft = %i WHERE id = %i", SQLID[playerid], daystostay, ID);
- mysql_pquery(conn, mquery);
- MotelWaypoint[playerid] = 1;
- SetPlayerCheckpointEx(playerid, MotelData[ID][RoomX], MotelData[ID][RoomY], MotelData[ID][RoomZ], 1.5);
- MotelData[ID][RoomPickupID] = CreateDynamicPickup(1273, 23, MotelData[ID][RoomX], MotelData[ID][RoomY], MotelData[ID][RoomZ], 0, 0, -1, 10.0);
- SendClientMessageF(playerid, COLOR_GOLD, "You are now renting room %i for %i day(s) costing $%i. To cancel this rent use /unrentroom and to stay longer use /extendrent.", ID, daystostay, fee);
- SendClientMessage(playerid, COLOR_GOLD, "A checkpoint has been marked at your room.");
- format(gstr, sizeof(gstr),"~w~Motel Room ACQUIRED~n~~n~total rent ~g~-$%i",fee);
- ShowInfoText(playerid, gstr, 6000);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE motel SET OwnerSQLID = %i, RoomLocked = 1, RoomDaysLeft = %i WHERE id = %i", SQLID[playerid], daystostay, ID);
- mysql_tquery(conn, mquery, "UpdateMotelSign", "i", MotelData[ID][MotelID] - 1);
- }
- return true;
- }
- GREENSIDE::CheckMAState(playerid)
- {
- if(mysql_errno() != 0)
- printf("Error No = %i", mysql_errno(conn));
- if(cache_num_rows() != 0)
- {
- MasterAccount[playerid] = cache_get_field_content_int(0, "id");
- cache_get_field_content(0, "Password", MasterAccountPass[playerid]);
- new ma_status = cache_get_field_content_int(0, "State");
- switch(ma_status)
- {
- case 0,6:
- {
- SendClientMessage(playerid, COLOR_WHITE, "Your Master Account is currently pending review from an Administrator, please visit redcountyrp.com/login to check the status.");
- return KickPlayer(playerid, 29);
- }
- case 2:
- {
- SendClientMessage(playerid, COLOR_WHITE, "Your Master Account is currently disabled which means you may not use it or the characters associated with it.");
- return KickPlayer(playerid, 30);
- }
- case 3,4,5:
- {
- SendClientMessage(playerid, COLOR_WHITE, "Your Master Account requires action from yourself, please visit greenside-roleplay.com.br/login to check the status.");
- return KickPlayer(playerid, 31);
- }
- }
- GetPlayerIp(playerid, PlayerIP[playerid], 16);
- gpci(playerid, PlayerSerial[playerid], 128);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT NULL FROM bans WHERE BannedIP = '%e' OR MasterAccount = %i LIMIT 1", PlayerIP[playerid], MasterAccount[playerid]);
- mysql_pquery(conn, mquery, "CheckPlayerBans", "d", playerid);
- }
- else
- {
- if(gServerUptime > 5) // Protection for bots.
- {
- SendClientMessage(playerid, COLOR_WHITE, "");
- SendClientMessage(playerid, COLOR_WHITE, "");
- SendClientMessage(playerid, COLOR_WHITE, "");
- SendClientMessage(playerid, COLOR_WHITE, "The Master Account you are attempting to login with does not seem to exist.");
- SendClientMessage(playerid, COLOR_WHITE, "Please visit {09B300}greenside-roleplay.com.br/register{FFFFFF} to create a Master Account if you do not have one.");
- SendClientMessage(playerid, COLOR_WHITE, "Otherwise, ensure you are connecting with your Master Account name, not a character name.");
- return KickPlayer(playerid, 32);
- }
- return true;
- }
- return true;
- }
- GREENSIDE::QuickCount()
- {
- //loop to "break down" damaged vehicles and process ELM.
- for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
- {
- new Float:vh;
- GetVehicleHealth(v, vh);
- if(vh <= 355.0)
- {
- if(VehicleBroke[v] == 0)
- {
- EngineStatus[v] = 0;
- ToggleVehicleEngine(v, 0);
- VehicleBroke[v] = 1;
- }
- if(vh < 355.0) SetVehicleHealthEx(v, 355.0);
- }
- if(ELMs{v})
- {
- new panels, doors, lights, tires, elm;
- GetVehicleDamageStatus(v, panels, doors, lights, tires);
- switch(EmergencyLights[v])
- {
- case 1:
- {
- EmergencyLights[v] = 0;
- elm = 1;
- }
- case 0:
- {
- elm = 2;
- EmergencyLights[v] = 1;
- }
- }
- if(elm == 1) lights = encode_lights(0, 1, 0, 0);
- else if(elm == 2) lights = encode_lights(0, 0, 1, 0);
- UpdateVehicleDamageStatus(v, panels, doors, lights, tires);
- }
- if(VCPauseTimer[v] != 0) VCPauseTimer[v] --;
- if(RepairData[v][rSQLID] >= 1 && RepairData[v][rTime] < gettime() && RepairData[v][OwnerNotified] == 0)
- {
- foreach(new i: Player)
- {
- if(RepairData[v][rOwnerSQLID] == SQLID[i] && RepairData[v][rFaction] == 0)
- {
- if(Inventory[i][MobilePhone] == 1)
- {
- SendSplitMessageF(i, COLOR_SKYBLUE, "[Text From The %s] The work on your %s has been completed. You are free to stop by and pick it up at any time.", GetRepairGarageName(RepairData[v][rGarage]), GetVehicleNameEx(RepairData[v][rModel]));
- RepairData[v][OwnerNotified] = 1;
- break;
- }
- }
- }
- }
- }
- QuickPCount();
- return true;
- }
- GREENSIDE::OneSecTimer()
- {
- OneSecTimerCount ++;
- FuelDecreaseCounter ++;
- gServerSecond ++;
- if(gServerSecond >= 60)
- {
- gServerSecond = 0;
- gServerMinute ++;
- if(gServerMinute >= 60)
- {
- UpdateRentalVehMileage();
- gServerMinute = 0;
- gServerHour ++;
- if(gServerHour > 23)
- {
- gServerHour = 0;
- WipeAssets();
- ClearMotelRooms();
- new y, m, d;
- getdate(y, m, d);
- gServerYear = y;
- }
- }
- OneMinTimer();
- }
- if((gServerSecond % 10) == 0) //drug comment
- {
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- for(new fu = 0; fu < MAX_HFURNITURE; fu++)
- {
- if(HouseData[h][DrugTimer][fu] >= 2)
- {
- HouseData[h][DrugTimer][fu]-=10;
- if(HouseData[h][DrugTimer][fu] <= 1)
- {
- HouseData[h][DrugTimer][fu] = 1;
- foreach(new p: Player)
- {
- if(IsInHouseID[p] == h)
- {
- new Float:oP[3];
- GetDynamicObjectPos(HouseData[h][FurnObject][fu], oP[0], oP[1], oP[2]);
- PlayerPlaySound(p, 6401, oP[0], oP[1], oP[2]);
- }
- }
- }
- }
- }
- }
- }
- if(gOOCDelay > 0) gOOCDelay --;
- new count = 0, arcount = 0, as[6];
- foreach(new i: Player)
- {
- if(NeedsAssistance[i] > 0)
- {
- count++;
- }
- if(RequestingAdmin[i] > 0)
- {
- arcount++;
- }
- }
- if(AssistCount != count)
- {
- AssistCount = count;
- format(as, 8, "%i", AssistCount);
- TextDrawSetString(AssistTD, as);
- }
- if(ARCount != arcount)
- {
- ARCount = arcount;
- format(as, 8, "%i", ARCount);
- TextDrawSetString(AdminRequestTD, as);
- }
- if(FadvertSpamTime > 0) FadvertSpamTime--;
- if(OneSecTimerCount >= 5)
- {
- for(new v = 0; v < MAX_FUEL_STATIONS; v++)
- {
- if(FuelStations[v][PetrolAmount] < 0) FuelStations[v][PetrolAmount] = 0;
- if(FuelStations[v][DieselAmount] < 0) FuelStations[v][DieselAmount] = 0;
- }
- OneSecTimerCount = 0;
- }
- if(FuelDecreaseCounter > 40)
- {
- FuelDecreaseCounter = 0;
- FuelDecrease();
- }
- TextDrawSetString(TimeText, GetTimeString());
- TextDrawSetString(TimeText24, GetTimeString24());
- FireUpdate();
- pSecond();
- return true;
- }
- GREENSIDE::ShowStoredArmor(playerid, type)
- {
- if(!cache_num_rows()) return SysMsg(playerid, (type == 2) ? ("There is no armor in this vehicle.") : ("There is no armor in your house."));
- gstr[0] = EOS;
- new atype, amount, id;
- for(new x = 0, r = cache_num_rows(); x < r; x++)
- {
- atype = cache_get_field_content_int(x, "ArmorType");
- amount = cache_get_field_content_int(x, "ArmorAmount");
- id = cache_get_field_content_int(x, "id");
- if(atype == 1) format(sgstr, sizeof(sgstr), "Light Armor Vest - Armor: %i [ID: %i]\n", amount, id);
- else format(sgstr, sizeof(sgstr), "Heavy Armor Vest - Armor: %i [ID: %i]\n", amount, id);
- strcat(gstr, sgstr);
- }
- if(type == 2) Dialog_Show(playerid, StoreArmorHouse, DIALOG_STYLE_LIST, "Select an armor vest", gstr, "Select", "Cancel");
- else Dialog_Show(playerid, StoreArmorTrunk, DIALOG_STYLE_LIST, "Select an armor vest", gstr, "Select", "Cancel");
- return true;
- }
- GREENSIDE::SetupTutorial(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- GameTextForPlayer(playerid, "~g~Tutorial", 3000, 1);
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, 810.3811, -186.6689, 25.7614);
- SetPlayerCameraPos(playerid, 810.3811, -186.6689, 25.7614);
- SetPlayerCameraLookAt(playerid, 800.4191, -185.7973, 25.7614);
- SetPlayerVirtualWorldEx(playerid, 0);
- TutorialIndex[playerid] = 2;
- Logged{playerid} = false;
- JustSpawned{playerid} = false;
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, 908.6558, -572.4293, 111.9606);
- SetPlayerCameraPos(playerid, 908.6558, -572.4293, 111.9606);
- SetPlayerCameraLookAt(playerid, 914.8125, -564.5492, 110.7419);
- gstr[0] = EOS;
- strcat(gstr, "This tutorial will benefit you as a new player by explaining the various features the server has to offer. ");
- strcat(gstr, "Here on Red County Roleplay, you are expected to roleplay at a realistic standard.\nThere are many specific rules lied out on our forums which must always be followed. You can find the list of rules on our forum at http://redcountyrp.com/forum.\n");
- strcat(gstr, "Throughout this tutorial you will be given information about useful commands. Don't forget to check /help once the tutorial is finished just in case you forget any.\n");
- strcat(gstr, "Another way of getting help is via the Assistance system, you can ask questions using /assistance where Helpers and Admins should respond with an answer.\n");
- strcat(gstr, "To begin, you will be given a basic overview of the most prominent systems on the server: the house system, the businesses system and the vehicle system.\n");
- Dialog_Show(playerid, TutorialDialog, DIALOG_STYLE_MSGBOX, "Introduction", gstr, "Continue", "");
- }
- return true;
- }
- GREENSIDE::CancelPlayerHandShake(requester, shakee)
- {
- if(RequestedToShake[shakee] == requester)
- {
- RequestedToShake[shakee] = -1;
- SysMsg(shakee, "The hand shake has timed-out.");
- SysMsg(requester, "Your hand shake has timed-out.");
- }
- return true;
- }
- GREENSIDE::CancelPlayerKiss(requester, kissee)
- {
- if(RequestedToKiss[kissee] == requester)
- {
- RequestedToKiss[kissee] = -1;
- SysMsg(kissee, "The kiss has timed-out.");
- SysMsg(requester, "Your kiss has timed-out.");
- }
- return true;
- }
- GREENSIDE::CancelPlayerFrisk(requester, friskee)
- {
- if(RequestedToFrisk[friskee] == requester)
- {
- RequestedToFrisk[friskee] = -1;
- SysMsg(friskee, "The frisk has timed-out.");
- SysMsg(requester, "Your frisk has timed-out.");
- }
- return true;
- }
- GREENSIDE::CancelPlayerBlindfold(requester, blindee)
- {
- if(RequestedToBlindfold[blindee] == requester)
- {
- RequestedToBlindfold[blindee] = -1;
- SysMsg(blindee, "The blindfold request has timed-out.");
- SysMsg(requester, "Your blindfold request has timed-out.");
- }
- return true;
- }
- GREENSIDE::DelayPlaySound(playerid, soundid)
- {
- PlayerPlaySound(playerid, soundid, 0, 0, 0);
- }
- stock FlashVehicleLights(vehicleid)
- {
- if(VehicleLights[vehicleid] == 1)
- {
- LightsFlash(vehicleid, 2);
- SetTimerEx("LightsFlash", 200, 0, "dd", vehicleid, 1);
- SetTimerEx("LightsFlash", 400, 0, "dd", vehicleid, 2);
- SetTimerEx("LightsFlash", 600, 0, "dd", vehicleid, 1);
- }
- else
- {
- LightsFlash(vehicleid, 1);
- SetTimerEx("LightsFlash", 200, 0, "dd", vehicleid, 2);
- SetTimerEx("LightsFlash", 400, 0, "dd", vehicleid, 1);
- SetTimerEx("LightsFlash", 600, 0, "dd", vehicleid, 2);
- }
- return true;
- }
- GREENSIDE::LightsFlash(vehicleid, stage)
- {
- switch(stage)
- {
- case 1: ToggleVehicleLights(vehicleid, 1);
- case 2: ToggleVehicleLights(vehicleid, 0);
- }
- }
- GREENSIDE::CheckTBans()
- {
- new playername[MAX_PLAYER_NAME], playerip[20], daysbanned[3], rowid;
- for(new i, x = cache_num_rows(); i < x; i++)
- {
- cache_get_field_content(i, "PlayerName", playername);
- cache_get_field_content(i, "BannedIP", playerip);
- cache_get_field_content(i, "DaysBanned", daysbanned);
- rowid = cache_get_field_content_int(i, "id");
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE tbans SET Unbanned = 1 WHERE PlayerName = '%e'", playername);
- mysql_pquery(conn, mquery);
- format(gstr, sizeof(gstr), "[Admin] %s (IP: %s, BanID: %i) has been unbanned after a %s day ban.", playername, playerip, rowid, daysbanned);
- AdminBroadcast(gstr, 1);
- print(gstr);
- }
- return true;
- }
- GREENSIDE::OneMinTimer()
- {
- Streamer_ProcessActiveItems();
- RefreshBizzActors();
- mysql_pquery(conn, "SELECT id, reload FROM factions", "ProcessUCPFactionReload");
- OneMinTimerCount ++;
- gServerUptime ++;
- gServerWeatherDelay ++;
- new pizzacarused = 0;
- foreach(new i: Player)
- {
- if(IsDelivering[i] == 1)
- {
- pizzacarused = 1;
- break;
- }
- }
- if(pizzacarused == 0)
- {
- SetVehicleToRespawn(PizzaCar1);
- SetVehicleToRespawn(PizzaCar2);
- }
- //SetWorldTime(gServerHour);
- if(gServerWeatherDelay == 50)
- {
- gServerUpcomingWeather = random(21);
- // No storms or fog
- while(gServerUpcomingWeather == 8 || gServerUpcomingWeather == 16 || gServerUpcomingWeather == 19) gServerUpcomingWeather = random(21);
- foreach(new i: Player) if(Logged{i} && Faction[i] == FACTION_NEWS) SendClientMessageF(i, COLOR_PINK, "[Weather Data] Expected weather forecast: %s", GetWeatherName(gServerUpcomingWeather));
- }
- else if(gServerWeatherDelay == 60)
- {
- gServerWeatherDelay = 0;
- gServerWeather = gServerUpcomingWeather;
- SetWeather(gServerWeather);
- gServerUpcomingWeather = -1;
- foreach(new i: Player)
- {
- if(GetPlayerInterior(i) == 0 && GetPlayerVirtualWorld(i) == 0) SetPlayerWeather(i, gServerWeather);
- else SetPlayerWeather(i, 1);
- }
- }
- if(OneMinTimerCount == 5 || OneMinTimerCount == 10 || OneMinTimerCount == 15)
- {
- for(new v = 1, x = GetVehiclePoolSize(); v <= x; v++)
- {
- if(VehicleData[v][Hotwired] == 1 && VehicleData[v][HotwireTime] < gettime())
- {
- if(!IsVehicleOccupied(v))
- {
- new bool:connected = false;
- foreach(new i: Player) if(SQLID[i] == VehicleData[v][VehicleOwnerSQLID]) connected = true;
- if(connected == false)
- {
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE vehicles SET HotwireExpiration = 0 WHERE id = %i", VehicleData[v][VehSQLID]);
- mysql_pquery(conn, mquery);
- DestroyVehicleEx(v, "v 6");
- ClearVehicleData(v);
- }
- }
- }
- }
- }
- if(OneMinTimerCount >= 15)
- {
- InactivityCheck();
- foreach(new i: Player)
- {
- if(!Logged{i} || HintToggle{i}) continue;
- // SendClientMessage(i, COLOR_WHITE, Messages[random(sizeof(Messages))]);
- }
- OneMinTimerCount = 0;
- new cd, cm, cy;
- getdate(cy, cm, cd);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,PlayerName,BannedIP,DaysBanned FROM tbans WHERE UnbanD=%i AND UnbanM=%i AND UnbanY=%i AND Unbanned=0", cd, cm, cy);
- mysql_pquery(conn, mquery, "CheckTBans");
- }
- if(gServerMinute == 0)
- {
- foreach(new i: Player)
- {
- if(Logged{i})
- {
- if(TimeOnline[i] >= 30)
- {
- CheckReady{i} = true;
- CheckNumber[i] = (random(8000) + 1111);
- SendClientMessage(i, COLOR_WHITE, "{ffffff}Payday disponível, use {07df00}/payday{ffffff} em qualquer prefeitura para receber seu pagamento.");
- format(tgstr, sizeof(tgstr), "~g~~h~~h~Payday: ~w~%i", CheckNumber[i]);
- PlayerTextDrawSetString(i, Signcheck[i], tgstr);
- PlayerTextDrawShow(i, Signcheck[i]);
- }
- else SysMsg(i,"You have not been playing long enough to get a Payday.");
- }
- }
- //format(gstr, sizeof(gstr),"[Loteria de Montgomery] Sorteia o número: %i",WinningLotteryNumber);
- //SendClientMessageToAllLogged(COLOR_MAGENTA,gstr);
- new winners = 0;
- new share = 0;
- new onlywinner = -1;
- foreach(new i: Player)
- {
- if(Logged{i} && IsPlayingLottery{i} && !IsPlayerNPC(i))
- {
- format(gstr, sizeof(gstr),"Your Lottery number is: %i.",LotteryNumber[i]);
- SendClientMessage(i, COLOR_MAGENTA, gstr);
- if(LotteryNumber[i] == WinningLotteryNumber)
- {
- winners ++;
- onlywinner = i;
- }
- }
- }
- if(winners == 0)
- {
- LotteryJackpot += 5000;
- //format(gstr, sizeof(gstr), "[Loteria] Ninguém ganhou o jackpot no valor de $%s, o prêmio será acumulado para o próximo sorteio.", format_cash(LotteryJackpot));
- //SendClientMessageToAllLogged(COLOR_PINK, gstr);
- }
- else if(winners == 1)
- {
- //format(gstr, sizeof(gstr), "Somente %s acertou o número sorteado do jackpot, recebendo uma quantidade de $%s dólares.", NameEx(onlywinner), format_cash(LotteryJackpot));
- //SendClientMessageToAllLogged(COLOR_PINK, gstr);
- GivePlayerCash(onlywinner, LotteryJackpot);
- LotteryJackpot = 5000;
- UnlockAchievement(onlywinner, 41);
- }
- else if(winners > 1)
- {
- share = LotteryJackpot / winners;
- //format(gstr, sizeof(gstr), "%i pessoas acertaram o número sorteado, portanto o prêmio no valor de $%s dólares será divido igualmente entre os vencedores. [ $%s C/D]", winners, format_cash(LotteryJackpot), format_cash(share));
- //SendClientMessageToAllLogged(COLOR_PINK, gstr);
- new winner_string[128], str_count = 0;
- format(winner_string, 128, "Winners: ");
- foreach(new i: Player)
- {
- if(Logged{i} && IsPlayingLottery{i} && LotteryNumber[i] == WinningLotteryNumber && !IsPlayerNPC(i))
- {
- if(str_count != 0)
- {
- strcat(winner_string, ", ");
- }
- strcat(winner_string, NameEx(i));
- str_count ++;
- GivePlayerCash(i, share);
- UnlockAchievement(i, 41);
- }
- }
- strcat(winner_string, "!");
- SendClientMessageToAllLogged(COLOR_PINK, winner_string);
- LotteryJackpot = 5000;
- }
- WinningLotteryNumber = 0;
- foreach(new i: Player)
- {
- if(Logged{i} && IsPlayingLottery{i} && !IsPlayerNPC(i))
- {
- LotteryNumber[i] = -1;
- IsPlayingLottery{i} = false;
- }
- }
- }
- else if(gServerMinute == 30)
- {
- foreach(new i: Player)
- {
- if(Logged{i} && CheckReady{i})
- {
- SendClientMessage(i, COLOR_SKYBLUE, "Your Payday has expired and you can no longer receive it.");
- CheckReady{i} = false;
- CheckNumber[i] = 0;
- PlayerTextDrawSetString(i, Signcheck[i], "~g~~h~~h~Payday: ~w~0000");
- PlayerTextDrawHide(i, Signcheck[i]);
- }
- }
- }
- else if(gServerMinute == 55)
- {
- WinningLotteryNumber = random(99) + 1;
- //SendClientMessageToAllLogged(COLOR_PINK,"O sorteio da Loteria começa em 5 minutos! Você pode comprar bilhetes em qualquer loja 24/7.");
- }
- else if(gServerMinute == 59)
- {
- //SendClientMessageToAllLogged(COLOR_PINK,"O sorteio da Loteria começa em 1 minuto! Você pode comprar bilhetes em qualquer loja 24/7.");
- }
- if(MinutesUntilGMX > 0)
- {
- MinutesUntilGMX --;
- if(MinutesUntilGMX >= 1)
- {
- format(gstr, sizeof(gstr), "(( Reminder: Server will be restarted in %i minutes. ))", MinutesUntilGMX);
- SendClientMessageToAllLogged(COLOR_WHITE, gstr);
- }
- else
- {
- foreach(new i: Player)
- {
- SetPlayerName(i, MasterAccountName[i]);
- }
- SetTimer("DelayedGameModeExit", 1000, false);
- MinutesUntilGMX = 0;
- return true;
- }
- }
- // Litter System
- if(gLitterCount < MAX_LITTER)
- {
- new litter_idx = random(sizeof(LitterSpawns));
- if(LitterPlaced[litter_idx] > 0)
- {
- litter_idx = GetNextFreeLitterSpot();
- }
- if(litter_idx != -1)
- {
- LitterPlaced[litter_idx] = CreateDynamicObject(LitterObjects[random(sizeof(LitterObjects))], LitterSpawns[litter_idx][0], LitterSpawns[litter_idx][1], LitterSpawns[litter_idx][2], 0.0, 0.0, float(random(360)));
- gLitterCount ++;
- }
- }
- new idx, x;
- for(idx = 0; idx < MAX_TEMPBANS; idx++)
- {
- if(TempBans[idx][TempBanActive] == 1)
- {
- TempBans[idx][TempBanTime] --;
- if(TempBans[idx][TempBanTime] == 0)
- {
- format(gstr, sizeof(gstr), "[Admin] The temporary ban for %s(IP: %s) has expired and they are now unbanned.", GetSQLName(TempBans[idx][TempBanSQLID]), TempBans[idx][TempBanIP]);
- AdminBroadcast(gstr, 1);
- TempBans[idx][TempBanActive] = 0;
- TempBans[idx][TempBanReason][0] = 0;
- TempBans[idx][TempBanIP][0] = 0;
- TempBans[idx][TempBanTime] = 0;
- TempBans[idx][TempBanSQLID] = 0;
- TempBans[idx][BanningAdmin] = 0;
- }
- }
- }
- for(idx = 0; idx < MAX_FUEL_STATIONS; idx++)
- {
- MySQLUpdateInt(FuelStations[idx][StationID], "Petrol", FuelStations[idx][PetrolAmount], "fuel");
- MySQLUpdateInt(FuelStations[idx][StationID], "Diesel", FuelStations[idx][DieselAmount], "fuel");
- }
- for(idx = 1, x = GetVehiclePoolSize(); idx <= x; idx++)
- {
- if(ImpoundData[idx][iModel] > 399)
- {
- if(ImpoundData[idx][iImpoundTime] > 0)
- {
- ImpoundData[idx][iImpoundTime]--;
- }
- }
- }
- mysql_pquery(conn, "UPDATE vehicles SET ImpoundTime = ImpoundTime -1 WHERE ImpoundTime != 0");
- mysql_pquery(conn, "UPDATE fveh SET ImpoundTime = ImpoundTime -1 WHERE ImpoundTime != 0");
- return true;
- }
- GREENSIDE::ProcessUCPFactionReload()
- {
- new fid, reload;
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- fid = cache_get_field_content_int(i, "id");
- reload = cache_get_field_content_int(i, "reload");
- if(reload == 1) ReloadFaction(fid);
- }
- return true;
- }
- GREENSIDE::RemovePlayerDriveby(playerid)
- {
- JustEnteredVehicle[playerid] = 0;
- new Float:DBX, Float:DBY, Float:DBZ;
- GetPlayerPos(playerid, DBX, DBY, DBZ);
- SetPlayerPos(playerid, DBX, DBY, floatadd(DBZ, 2.5)); // Slap Player.
- DeletePVar(playerid, "DriveBy");
- SetTimerEx("PlaceDBBackInVehicle", 225, false, "iiii", playerid, GetPlayerVehicleID(playerid), GetPlayerVehicleSeat(playerid), GetPlayerWeapon(playerid));
- return true;
- }
- GREENSIDE::PlaceDBBackInVehicle(playerid, pVehicleID, pSeatID, pWeapon)
- {
- if(!IsPlayerConnected(playerid) || GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return false;
- PutPlayerInVehicle(playerid, pVehicleID, pSeatID);
- if(pWeapon != 27 || pWeapon != 24 || pWeapon != 34) SetPlayerArmedWeapon(playerid, pWeapon);
- return true;
- }
- GREENSIDE::AnimTimer(playerid)
- {
- IsDead[playerid] = 1;
- }
- GREENSIDE::UnFreezePlayer(playerid)
- {
- TogglePlayerControllable(playerid, 1);
- IsFrozen[playerid] = 0;
- }
- GREENSIDE::FreezePlayer(playerid)
- {
- TogglePlayerControllable(playerid, 0);
- IsFrozen[playerid] = 1;
- }
- GREENSIDE::HideInfoText(playerid)
- {
- PlayerTextDrawHide(playerid, InfoText[playerid]);
- PlayerTextDrawSetString(playerid, InfoText[playerid], " ");
- TextTimer[playerid] = 0;
- return true;
- }
- GREENSIDE::IsPlayerAdminLevelOK(playerid, adminlevel)
- {
- if(IsPlayerAdmin(playerid) || AdminLevel[playerid] >= adminlevel) return true;
- return false;
- }
- GREENSIDE::ShowGeneralARecord(playerid, name[])
- {
- new punishments[7];
- for(new i = 0, r = cache_num_rows(); i < r; i++)
- {
- punishments[cache_get_field_content_int(i, "RecordType")] = cache_get_field_content_int(i, "punishments");
- }
- strcat(gstr, "{FFFFFF}GENERAL ADMIN RECORD\n{249CFF}");
- strcat(gstr, name);
- format(sgstr, sizeof(sgstr), "\n\n{FFFFFF}Total Times Kicked: {249CFF}%i\n", punishments[ADMIN_RECORD_TYPE_KICK]);
- strcat(gstr, sgstr);
- format(sgstr, sizeof(sgstr), "{FFFFFF}Total Times Perm Banned: {249CFF}%i\n", punishments[ADMIN_RECORD_TYPE_PERMBAN]);
- strcat(gstr, sgstr);
- format(sgstr, sizeof(sgstr), "{FFFFFF}Total Times Temp Banned: {249CFF}%i\n", punishments[ADMIN_RECORD_TYPE_TEMPBAN]);
- strcat(gstr, sgstr);
- format(sgstr, sizeof(sgstr), "{FFFFFF}Total Times Date Banned: {249CFF}%i\n", punishments[ADMIN_RECORD_TYPE_DATEBAN]);
- strcat(gstr, sgstr);
- format(sgstr, sizeof(sgstr), "{FFFFFF}Total Times Admin Jailed: {249CFF}%i\n", punishments[ADMIN_RECORD_TYPE_AJAIL]);
- strcat(gstr, sgstr);
- format(sgstr, sizeof(sgstr), "{FFFFFF}Total Times Muted: {249CFF}%i\n", punishments[ADMIN_RECORD_TYPE_MUTE]);
- strcat(gstr, sgstr);
- Dialog_Show(playerid, AdminRecordDetails, DIALOG_STYLE_MSGBOX, "Admin Record", gstr, "Go Back", "Exit");
- return true;
- }
- GREENSIDE::LoadAdminRecordPage(playerid, page, name[])
- {
- new count = cache_num_rows(), sqlid[10], adates[10][12], adminid[10], reason[10][150], recsub[164], amounts[10];
- gstr[0] = EOS;
- switch(page)
- {
- case 0:
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT COUNT(*) AS punishments, RecordType FROM adminrecord WHERE PlayerSQLID = %i GROUP BY RecordType", ViewAdminRecord[playerid]);
- mysql_pquery(conn, mquery, "ShowGeneralARecord", "is", playerid, name);
- }
- default:
- {
- if(!cache_num_rows())
- {
- format(tgstr, sizeof(tgstr), "No %s Record Founds", AdminRecordName(page, 1));
- Dialog_Show(playerid, AdminRecordDetails, DIALOG_STYLE_MSGBOX, "Admin Record", tgstr, "Go Back", "Exit");
- }
- format(sgstr, sizeof(sgstr), "{FFFFFF}%s Record for {249CFF} %s{FFFFFF}\n\n", AdminRecordName(page, 1), name);
- strcat(gstr, sgstr);
- format(sgstr, sizeof(sgstr), "{FFFFFF}Details of the 10 most recent %ss:", AdminRecordName(page, 1));
- strcat(gstr, sgstr);
- for(new i; i < count; i++)
- {
- sqlid[i] = cache_get_field_content_int(i, "id");
- adminid[i] = cache_get_field_content_int(i, "AdminSQLID");
- cache_get_field_content(i, "Reason", reason[i], conn, 150);
- cache_get_field_content(i, "DateOfAction", adates[i], conn, 16);
- amounts[i] = cache_get_field_content_int(i, "Amount");
- }
- for(new i; i < count; i++)
- {
- format(recsub, sizeof(recsub), "\n{FFFFFF}[%s] {249CFF}%s by %s, reason: %s", adates[i], AdminRecordName(page), GetSQLName(adminid[i]), reason[i]);
- if(page == ADMIN_RECORD_TYPE_TEMPBAN) format(recsub, sizeof(recsub), "\n{FFFFFF}[%s] {249CFF}Temp Banned by %s, reason: %s, time: %i hr(s)", adates[i], GetSQLName(adminid[i]), reason[i], amounts[i]/60);
- if(page == ADMIN_RECORD_TYPE_AJAIL) format(recsub, sizeof(recsub), "\n{FFFFFF}[%s]{249CFF} Admin Jailed by %s for %i mins, reason: %s", adates[i], GetSQLName(adminid[i]), amounts[i], reason[i]);
- if(page == ADMIN_RECORD_TYPE_MUTE) format(recsub, sizeof(recsub), "\n{FFFFFF}[%s]{249CFF} Muted by %s for %i minutes", adates[i], GetSQLName(adminid[i]), amounts[i]);
- strcat(gstr, recsub);
- }
- Dialog_Show(playerid, AdminRecordDetails, DIALOG_STYLE_MSGBOX, "Admin Record", gstr, "Go Back", "Exit");
- }
- }
- return true;
- }
- GREENSIDE::OnCharacterLogin(playerid)
- {
- if(cache_num_rows() != 0)
- {
- new accountDisabled = cache_get_field_content_int(0, "AccountDisabled");
- if(accountDisabled == 1)
- {
- SendClientMessageF(playerid,COLOR_GOLD,"%s: Your account has been disabled.", GetName(playerid));
- KickPlayer(playerid, 34);
- return true;
- }
- cPlayersSkin[playerid] = cache_get_field_content_int(0, "Skin");
- SQLID[playerid] = cache_get_field_content_int(0, "id");
- Cash[playerid] = cache_get_field_content_int(0, "Cash");
- BankBalance[playerid] = cache_get_field_content_int(0, "Bank");
- PlayerLevel[playerid] = cache_get_field_content_int(0, "PlayerLevel");
- PlayerXP[playerid] = cache_get_field_content_int(0, "PlayerXP");
- Faction[playerid] = cache_get_field_content_int(0, "Faction");
- Job[playerid] = cache_get_field_content_int(0, "Job");
- JobSpamTime[playerid] = cache_get_field_content_int(0, "JobSpamTime");
- FactionRank[playerid] = cache_get_field_content_int(0, "FactionRank");
- TotalTimePlayed[playerid] = cache_get_field_content_int(0, "TotalTimePlayed");
- TimeOnline[playerid] = cache_get_field_content_int(0, "ConnectedTime");
- GuestHouseID[playerid] = cache_get_field_content_int(0, "GuestHouseID");
- TruckStat[playerid] = cache_get_field_content_int(0, "TruckingStat");
- TruckLevel[playerid] = cache_get_field_content_int(0, "TruckingLevel");
- TruckSpamTime[playerid] = cache_get_field_content_int(0, "TruckingSpamTime");
- Inventory[playerid][FishingPermit] = cache_get_field_content_int(0, "FishingPermit");
- Inventory[playerid][FishingRod] = cache_get_field_content_int(0, "FishingRod");
- Inventory[playerid][FishingBait] = cache_get_field_content_int(0, "FishingBait");
- BiggestFish[playerid] = cache_get_field_content_int(0, "BiggestFish");
- FishWeight[playerid][0] = cache_get_field_content_int(0, "Fish1Weight");
- FishWeight[playerid][1] = cache_get_field_content_int(0, "Fish2Weight");
- FishWeight[playerid][2] = cache_get_field_content_int(0, "Fish3Weight");
- FishWeight[playerid][3] = cache_get_field_content_int(0, "Fish4Weight");
- FishWeight[playerid][4] = cache_get_field_content_int(0, "Fish5Weight");
- DeliverStat[playerid] = cache_get_field_content_int(0, "DeliverStat");
- DeliverLevel[playerid] = cache_get_field_content_int(0, "DeliverLevel");
- DeliverSpamTime[playerid] = cache_get_field_content_int(0, "DeliverSpamTime");
- FishingRodHealth[playerid] = cache_get_field_content_int(0, "FishingRodHealth");
- Inventory[playerid][Phonebook] = cache_get_field_content_int(0, "HasPhonebook");
- Inventory[playerid][Dice] = cache_get_field_content_int(0, "HasDice");
- Inventory[playerid][Watch] = cache_get_field_content_int(0, "HasWatch");
- NoobSpawnID[playerid] = cache_get_field_content_int(0, "NoobSpawnID");
- WeaponSkillLevel[playerid] = cache_get_field_content_int(0, "WeaponSkill");
- MySpawnID[playerid] = cache_get_field_content_int(0, "MySpawnID");
- SpawnAtHouse[playerid] = cache_get_field_content_int(0, "SpawnAtHouse");
- BizzSpawn[playerid] = cache_get_field_content_int(0, "BizzSpawn");
- DrugLevel[playerid] = cache_get_field_content_int(0, "DrugLevel");
- Licenses[playerid][LICENSE_CAR] = cache_get_field_content_int(0, "LicenseCar");
- Licenses[playerid][LICENSE_LGV] = cache_get_field_content_int(0, "LicenseLargeVehicle");
- Licenses[playerid][LICENSE_BIKE] = cache_get_field_content_int(0, "LicenseBike");
- Licenses[playerid][LICENSE_BOAT] = cache_get_field_content_int(0, "LicenseBoat");
- Licenses[playerid][LICENSE_HELI] = cache_get_field_content_int(0, "LicenseHelicopter");
- Licenses[playerid][LICENSE_PLANE] = cache_get_field_content_int(0, "LicensePlane");
- LicenseSuspendTime[playerid][LICENSE_CAR] = cache_get_field_content_int(0, "LicenseSuspendTime_Car");
- LicenseSuspendTime[playerid][LICENSE_LGV] = cache_get_field_content_int(0, "LicenseSuspendTime_LargeVehicle");
- LicenseSuspendTime[playerid][LICENSE_BIKE] = cache_get_field_content_int(0, "LicenseSuspendTime_Bike");
- LicenseSuspendTime[playerid][LICENSE_BOAT] = cache_get_field_content_int(0, "LicenseSuspendTime_Boat");
- LicenseSuspendTime[playerid][LICENSE_HELI] = cache_get_field_content_int(0, "LicenseSuspendTime_Helicopter");
- LicenseSuspendTime[playerid][LICENSE_PLANE] = cache_get_field_content_int(0, "LicenseSuspendTime_Plane");
- Inventory[playerid][Radio] = cache_get_field_content_int(0, "HasRadio");
- RadioFrequency[playerid] = cache_get_field_content_int(0, "RadioFrequency");
- RadioSlot[playerid][0] = cache_get_field_content_int(0, "RadioSlot1");
- RadioSlot[playerid][1] = cache_get_field_content_int(0, "RadioSlot2");
- RadioSlot[playerid][2] = cache_get_field_content_int(0, "RadioSlot3");
- RadioSlotUsed[playerid] = cache_get_field_content_int(0, "RadioSlotInUse");
- Inventory[playerid][Mask] = cache_get_field_content_int(0, "HasMask");
- Inventory[playerid][FuelCan][0] = cache_get_field_content_int(0, "HasFuelCan");
- Inventory[playerid][FuelCan][1] = cache_get_field_content_int(0, "HasFuelCanType");
- Inventory[playerid][Fags] = cache_get_field_content_int(0, "HasFags");
- Inventory[playerid][Lighter] = cache_get_field_content_int(0, "HasLighter");
- JailTime[playerid] = cache_get_field_content_int(0, "JailTime");
- PrisonTime[playerid] = cache_get_field_content_int(0, "PrisonTime");
- Inventory[playerid][GPS] = cache_get_field_content_int(0, "HasGPS");
- Inventory[playerid][Weed] = cache_get_field_content_int(0, "Weed");
- Inventory[playerid][MoonShine] = cache_get_field_content_int(0, "MoonShine");
- Inventory[playerid][Cocaine] = cache_get_field_content_int(0, "Cocaine");
- UsingFightStyle{playerid} = cache_get_field_content_int(0, "FightStyle");
- FightStyleLearned[playerid]{FS_BOXING} = bool:cache_get_field_content_int(0, "FightStyleLearnedBoxing");
- FightStyleLearned[playerid]{FS_KUNGFU} = bool:cache_get_field_content_int(0, "FightStyleLearnedKungFu");
- Inventory[playerid][AmmoBox][AMMOBOX_PISTOL] = cache_get_field_content_int(0, "AmmoBoxPistol");
- Inventory[playerid][AmmoBox][AMMOBOX_SHOTGUN] = cache_get_field_content_int(0, "AmmoBoxShotgun");
- Inventory[playerid][AmmoBox][AMMOBOX_SMG] = cache_get_field_content_int(0, "AmmoBoxSMG");
- Inventory[playerid][AmmoBox][AMMOBOX_RIFLE] = cache_get_field_content_int(0, "AmmoBoxRifle");
- Inventory[playerid][AmmoBox][AMMOBOX_ASSAULT] = cache_get_field_content_int(0, "AmmoBoxAssaultR");
- HealthVar[playerid] = cache_get_field_content_int(0, "Health");
- ArmourVar[playerid] = cache_get_field_content_int(0, "Armour");
- IsDonator[playerid] = cache_get_field_content_int(0, "IsDonator");
- AdminJailData[playerid][1] = cache_get_field_content_int(0, "AdminJailTime");
- Inventory[playerid][Rope] = cache_get_field_content_int(0, "HasRope");
- SubFactionSpawn[playerid] = cache_get_field_content_int(0, "SubFactionSpawn");
- TrashStat[playerid] = cache_get_field_content_int(0, "TrashStat");
- TrashLevel[playerid] = cache_get_field_content_int(0, "TrashLevel");
- TrashSpamTime[playerid] = cache_get_field_content_int(0, "TrashSpamTime");
- CoalmineStat[playerid] = cache_get_field_content_int(0, "CoalmineStat");
- CoalmineLevel[playerid] = cache_get_field_content_int(0, "CoalmineLevel");
- CoalmineSpamTime[playerid] = cache_get_field_content_int(0, "CoalmineSpamTime");
- Inventory[playerid][Notepad] = cache_get_field_content_int(0, "HasNotepad");
- Clothes[playerid][0] = cache_get_field_content_int(0, "SkinSet1");
- Clothes[playerid][1] = cache_get_field_content_int(0, "SkinSet2");
- Clothes[playerid][2] = cache_get_field_content_int(0, "SkinSet3");
- Clothes[playerid][3] = cache_get_field_content_int(0, "SkinSet4");
- Clothes[playerid][4] = cache_get_field_content_int(0, "SkinSet5");
- MyDeaths[playerid] = cache_get_field_content_int(0, "Deaths");
- MyKills[playerid] = cache_get_field_content_int(0, "Kills");
- SpeedFormat[playerid] = cache_get_field_content_int(0, "SpeedoFormat");
- RadioPoweredOn[playerid] = cache_get_field_content_int(0, "RadioPower");
- Inventory[playerid][Paper] = cache_get_field_content_int(0, "HasPaper");
- Inventory[playerid][Pen] = cache_get_field_content_int(0, "HasPen");
- Inventory[playerid][CarAdapter] = cache_get_field_content_int(0, "HasCarAdapter");
- VehicleBorrowKey[playerid] = cache_get_field_content_int(0, "BorrowKey");
- VehicleBorrowKeyTime[playerid] = cache_get_field_content_int(0, "BorrowKeyTime");
- Muted[playerid] = cache_get_field_content_int(0, "Muted");
- DOOCMuted[playerid] = cache_get_field_content_int(0, "DOOCMuted");
- ShoutAnimToggle{playerid} = bool:cache_get_field_content_int(0, "ShoutAnimToggle");
- TalkAnimToggle{playerid} = bool:cache_get_field_content_int(0, "TalkAnimToggle");
- Inventory[playerid][Checks] = cache_get_field_content_int(0, "Checks");
- PlayerChecks[playerid][0] = cache_get_field_content_int(0, "Check1");
- PlayerChecks[playerid][1] = cache_get_field_content_int(0, "Check2");
- PlayerChecks[playerid][2] = cache_get_field_content_int(0, "Check3");
- Inventory[playerid][RollingPaper] = cache_get_field_content_int(0, "RollingPaper");
- Inventory[playerid][Bong] = cache_get_field_content_int(0, "Bong");
- Inventory[playerid][Calculator] = cache_get_field_content_int(0, "HasCalculator");
- Inventory[playerid][MedKit] = cache_get_field_content_int(0, "HasMedKit");
- Inventory[playerid][Toolbox] = cache_get_field_content_int(0, "HasToolbox");
- Inventory[playerid][EngineOil] = cache_get_field_content_int(0, "HasEngineOil");
- PoliceFineAmount[playerid] = cache_get_field_content_int(0, "PoliceFine");
- FilledForm[playerid] = cache_get_field_content_int(0, "FilledForm");
- MyFareCharge[playerid] = cache_get_field_content_int(0, "FareRate");
- Inventory[playerid][WeedSeed] = cache_get_field_content_int(0, "HasWeedSeed");
- IsolationTime[playerid] = cache_get_field_content_int(0, "IsolationTime");
- PingKickExemption{playerid} = bool:cache_get_field_content_int(0, "PingKickExemption");
- cache_get_field_content(0, "Fish1Name", FishName[playerid][0], conn, 25);
- cache_get_field_content(0, "Fish2Name", FishName[playerid][1], conn, 25);
- cache_get_field_content(0, "Fish3Name", FishName[playerid][2], conn, 25);
- cache_get_field_content(0, "Fish4Name", FishName[playerid][3], conn, 25);
- cache_get_field_content(0, "Fish5Name", FishName[playerid][4], conn, 25);
- cache_get_field_content(0, "Accent", Accent[playerid], conn, 25);
- cache_get_field_content(0, "LooksLike", Appearance[playerid], conn, 128);
- cache_get_field_content(0, "Notepad1", NotepadText[playerid][0], conn, 80);
- cache_get_field_content(0, "Notepad2", NotepadText[playerid][1], conn, 80);
- cache_get_field_content(0, "Notepad3", NotepadText[playerid][2], conn, 80);
- cache_get_field_content(0, "Notepad4", NotepadText[playerid][3], conn, 80);
- cache_get_field_content(0, "Notepad5", NotepadText[playerid][4], conn, 80);
- cache_get_field_content(0, "FactionCustomRank", FactionCustomRank[playerid], conn, 32);
- SavedWaypoint[playerid][0] = cache_get_field_content_float(0, "SavedWaypointX");
- SavedWaypoint[playerid][1] = cache_get_field_content_float(0, "SavedWaypointY");
- SavedWaypoint[playerid][2] = cache_get_field_content_float(0, "SavedWaypointZ");
- Inventory[playerid][Water] = cache_get_field_content_int(0, "HasWater");
- Inventory[playerid][Boombox] = cache_get_field_content_int(0, "Boombox");
- Inventory[playerid][Blindfold] = cache_get_field_content_int(0, "HasBlindfold");
- Inventory[playerid][Logs] = cache_get_field_content_int(0, "HasLogs");
- IsBoomBanned[playerid] = cache_get_field_content_int(0, "BoomBanned");
- RelogSpawnSaved[playerid] = cache_get_field_content_int(0, "SpawnSaved");
- RelogSpawnPos[playerid][0] = cache_get_field_content_float(0, "RelogSpawnX");
- RelogSpawnPos[playerid][1] = cache_get_field_content_float(0, "RelogSpawnY");
- RelogSpawnPos[playerid][2] = cache_get_field_content_float(0, "RelogSpawnZ");
- RelogSpawnInfo[playerid][0] = cache_get_field_content_int(0, "RelogSpawnINT");
- RelogSpawnInfo[playerid][1] = cache_get_field_content_int(0, "RelogSpawnVW");
- EditingHouseFurn[playerid] = cache_get_field_content_int(0, "GuestFurnish");
- if(strfind(FactionCustomRank[playerid], "ESU") != -1 && !IsESU{playerid} && Faction[playerid] == FACTION_COP) IsESU{playerid} = true;
- if(ArmourVar[playerid] >= 1)
- {
- RestrictedVest{playerid} = bool:cache_get_field_content_int(0, "RestrictedVest");
- }
- SetUpPlayerSpawn(playerid);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM toys WHERE tPlayer = %i LIMIT %i", SQLID[playerid], MAX_TOYS);
- mysql_tquery(conn, mquery, "LoadPlayerToys", "d", playerid);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM weapons WHERE OwnerSQLID = %i AND WeaponPossession = 1 AND TrunkID = -1 AND HouseID = -1 AND FCarID = -1 AND Deleted = 0 AND Dropped = 0", SQLID[playerid]);
- mysql_tquery(conn, mquery, "LoadPlayerWeapons", "d", playerid);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM phones WHERE PhonePossessor = %i AND PhonePossession = 1", SQLID[playerid]);
- mysql_tquery(conn, mquery, "LoadPlayerPhone", "d", playerid);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM weaponlicenses WHERE OwnerSQLID = %i", SQLID[playerid]);
- mysql_tquery(conn, mquery, "ProcessWeaponLicense", "d", playerid);
- mysql_format(conn, mquery, sizeof(mquery), "SELECT id,VehicleModel,Color1,Color2,LastX,LastY,LastZ,Spawned FROM vehicles WHERE OwnerSQLID = %i AND HotwireExpiration < %i LIMIT %i", SQLID[playerid], gettime(), MAX_VEH_PER_PLAYER);
- mysql_tquery(conn, mquery, "ProcessVehicleKeys", "d", playerid);
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE players SET LastLogin = %i, Online = 1, RecentIP = '%e', RecentSerial = '%e' WHERE id = %i", gettime(), PlayerIP[playerid], PlayerSerial[playerid], SQLID[playerid]);
- mysql_tquery(conn, mquery);
- LastLogout[playerid] = cache_get_field_content_int(0, "LastLogout");
- if(LastLogout[playerid] < gettime() - 300)
- {
- RelogSpawnSaved[playerid] = 0;
- mysql_pqueryf(conn, "UPDATE players SET SpawnSaved = 0 WHERE id = %i", SQLID[playerid]);
- }
- ProcessHouseKey(playerid);
- ProcessBusinessKeys(playerid);
- LoadPlayerAchievements(playerid);
- TogglePlayerSpectating(playerid, 0);
- new newSkill = WeaponSkillLevel[playerid] * 100;
- new SkillOneHand;
- if(newSkill > 999)
- {
- newSkill = 999;
- SkillOneHand = 900;
- }
- SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, newSkill-10);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, SkillOneHand);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, SkillOneHand);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, newSkill);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, newSkill);
- if(UsingFightStyle{playerid} == 0) UsingFightStyle{playerid} = FIGHT_STYLE_NORMAL;
- SetPlayerFightingStyle(playerid, UsingFightStyle{playerid});
- if(strlen(Accent[playerid]) > 1) UsingAccent[playerid] = 1;
- if(MySpawnID[playerid] == 0)
- {
- MySpawnID[playerid] = 1;
- MySQLUpdateInt(SQLID[playerid], "MySpawnID", MySpawnID[playerid], "players");
- }
- if(MySpawnID[playerid] == 3 && HasHouseKey[playerid][0] == -1 && HasHouseKey[playerid][1] == -1)
- {
- MySpawnID[playerid] = 1;
- MySQLUpdateInt(SQLID[playerid], "MySpawnID", MySpawnID[playerid], "players");
- }
- if(MySpawnID[playerid] == 5 && IsHouseGuest(playerid) == 0)
- {
- MySpawnID[playerid] = 1;
- MySQLUpdateInt(SQLID[playerid], "MySpawnID", MySpawnID[playerid], "players");
- }
- if(MySpawnID[playerid] == 7)
- {
- new found;
- for(new b = 0; b < MAX_BIZZ; b++)
- {
- if(BizzData[b][BizzOwnerSQLID] == SQLID[playerid])
- {
- found = 1;
- break;
- }
- }
- if(found == 0)
- {
- MySpawnID[playerid] = 1;
- BizzSpawn[playerid] = 0;
- mysql_pqueryf(conn, "UPDATE players SET MySpawnID = %i, BizzSpawn = %i WHERE id = %i", MySpawnID[playerid], BizzSpawn[playerid], SQLID[playerid]);
- }
- }
- mysql_format(conn, mquery, sizeof(mquery), "SELECT MaxVisibleObjects,AdminLevel,Helper,BMXBanned,CompletedTutorial,UserNote,TagBanned FROM masters WHERE id = %i", MasterAccount[playerid]);
- mysql_pquery(conn, mquery, "OnCharacterStep", "d", playerid);
- }
- return true;
- }
- GREENSIDE::OnCharacterStep(playerid)
- {
- if(cache_num_rows() != 0)
- {
- new usernote[128];
- VisibleObjects[playerid] = cache_get_field_content_int(0, "MaxVisibleObjects");
- AdminLevel[playerid] = cache_get_field_content_int(0, "AdminLevel");
- IsHelper{playerid} = bool:cache_get_field_content_int(0, "Helper");
- BMXBanned[playerid] = cache_get_field_content_int(0, "BMXBanned");
- TagBanned{playerid} = bool:cache_get_field_content_int(0, "TagBanned");
- CompletedTutorial{playerid} = bool:cache_get_field_content_int(0, "CompletedTutorial");
- cache_get_field_content(0, "UserNote", usernote, conn, 128);
- StopAudioStreamForPlayer(playerid);
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- SetPlayerCash(playerid, Cash[playerid]);
- LoginScreenID[playerid][0] = 0;
- LoginScreenID[playerid][1] = 0;
- SendClientMessage(playerid, COLOR_WHITE, " ");
- SendClientMessageF(playerid, COLOR_WHITE, "You have selected the character {09B300}%s{FFFFFF}.", NameEx(playerid));
- SendClientMessageF(playerid,0x42D3FFFF,"Admin Level: %i | Player Level: %i | XP Points: %i | Faction: %s (%s)", AdminLevel[playerid], PlayerLevel[playerid], PlayerXP[playerid], GetFactionName(playerid), GetFactionRankName(Faction[playerid], FactionRank[playerid]));
- if(PoliceFineAmount[playerid] > 0) SendClientMessageF(playerid, COLOR_BLUE, "You have a pending fine of $%s, use /accept fine to pay it.", format_cash(PoliceFineAmount[playerid]));
- if(IsPlayerAdminLevelOK(playerid, 1)) GetMOTD(playerid, 1-1); //Admin MOTD
- if(IsHelper{playerid}) GetMOTD(playerid, 2-1); //ajudaer MOTD
- if(Faction[playerid] != 0) SendFMOTD(playerid, Faction[playerid]); //Faction MOTD
- GetMOTD(playerid, 3-1); //Player MOTD
- if(strlen(usernote)) SendSplitMessageF(playerid, COLOR_WHITE, "Notification from an admin: %s", usernote);
- Logged{playerid} = true;
- JustSpawned{playerid} = true;
- if(FilledForm[playerid] > 1)
- {
- GameTextForPlayer(playerid," ",100,3);
- SetPlayerVirtualWorld(playerid,playerid+55);
- SetPlayerPos(playerid,2267.866210,-83.283271,26.524759);
- SetPlayerFacingAngle(playerid,206.946899);
- SetPlayerCameraPos(playerid, 2269.4924, -90.9186, 28.4990);
- SetPlayerCameraLookAt(playerid, 2265.9086, -81.5828, 28.4990);
- TogglePlayerControllable(playerid,0);
- SpawnPlayer(playerid);
- new citregText[190];
- format(citregText,190,"Hello And Welcome to Greenside %s! \n\nBefore You Can Start Your Life Here, You Must Complete The Citizen Registration Form.\nTo Start, Click Continue.",NameEx(playerid));
- Dialog_Show(playerid,CitizenReg1,DIALOG_STYLE_MSGBOX,"RCRP - Citizen Registration",citregText,"Continue","");
- }
- else
- {
- UnlockAchievement(playerid,1);
- if(!CompletedTutorial{playerid})
- {
- SendClientMessage(playerid, COLOR_WHITE, "> You have not completed the Tutorial. Please read it now.");
- ShowInfoText(playerid, "~w~The ~b~tutorial ~w~is now starting", 2100);
- SetTimerEx("SetupTutorial", 2000, 0, "d", playerid);
- }
- }
- if(MySpawnID[playerid] == 3)
- {
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(HouseData[h][HouseOwnerSQLID] == SQLID[playerid] && strlen(HouseData[h][DoorNoteMessage]) > 1)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"> You have a note on your house door, go inside to look at it.");
- }
- }
- }
- if(PhoneData[playerid][pBattery] <= 0) PhoneData[playerid][pPower] = 0;
- SendClientMessageF(playerid, COLOR_WHITE, "{84FFB8}[The last login for this character was]{ffffff} %s.", UnixDate(-1, SQLID[playerid], 1));
- SendClientMessage(playerid, COLOR_WHITE, " ");
- new refunds = 0;
- refunds = cache_get_field_content_int(0, "Refunds");
- if(refunds > 0)
- {
- SendClientMessageF(playerid,COLOR_WHITE, "SERVER: You have been refunded $%s. Check your bank.", format_cash(refunds));
- BankBalance[playerid] += refunds;
- MySQLUpdateInt(SQLID[playerid], "Bank", BankBalance[playerid], "players");
- MySQLUpdateInt(SQLID[playerid], "Refunds", 0, "players");
- }
- //SetPlayerArmourEx(playerid, ArmourVar[playerid], 1);
- foreach(new p: Player)
- {
- if(p != playerid && IsPlayerMasked{p}) FormatHealthLabelText(p, HealthVar[p], ArmourVar[p], 2);
- }
- if(FilledForm[playerid] <= 1) SetUpPlayerSpawn(playerid);
- }
- return true;
- }
- GREENSIDE::Countdown()
- {
- IsCounting --;
- if(IsCounting > 0)
- {
- format(tgstr, sizeof(tgstr), "~n~~n~~n~~n~~h~~h~~b~%i", IsCounting);
- GameTextForAll(tgstr, 1000, 3);
- }
- else if(IsCounting == 0)
- {
- GameTextForAll("~g~GO", 3500, 0);
- }
- else
- {
- IsCounting = 0;
- KillTimer(CountdownTimer);
- }
- return true;
- }
- //functions for use in filterscripts such as the gate fs, map fs and etc.
- GREENSIDE::GetPlayerMA(playerid)
- {
- return MasterAccount[playerid];
- }
- GREENSIDE::AttachTrailerToVehicleEx(trailerid, vehicleid, playerid)
- {
- if(IsVehicleSpawned(trailerid) && IsVehicleSpawned(vehicleid))
- {
- if(IsVehicleStreamedIn(trailerid, playerid))
- {
- AttachTrailerToVehicle(trailerid, vehicleid);
- SetTimerEx("SetTrailerDone",2000,0,"d", playerid);
- }
- else
- {
- WaitingForTruckTrailer[playerid] = 1;
- SetTimerEx("AttachTrailerToVehicleEx",2500,0,"ddd",trailerid, vehicleid, playerid);
- }
- }
- }
- GREENSIDE::SetTrailerDone(playerid) WaitingForTruckTrailer[playerid] = 0;
- GREENSIDE::ScrapCar(playerid, vehicleid)
- {
- if(!IsPlayerConnected(playerid) || !Logged{playerid}) return false;
- new Float:cost = (0.25 * VehicleData[vehicleid][VehiclePrice]);
- GivePlayerCash(playerid, floatround(cost));
- SendClientMessageF(playerid, COLOR_WHITE, "Your %s has been scrapped for $%s.", GetVehicleName(vehicleid), format_cash(floatround(cost)));
- BeingScrapped{vehicleid} = false;
- mysql_format(conn, mquery, sizeof(mquery), "DELETE FROM vehicles WHERE id = %i", VehicleData[vehicleid][VehSQLID]);
- mysql_pquery(conn, mquery);
- if(IsBoat(vehicleid))
- {
- SetPlayerPos(playerid, -2192.6199, 2409.2146, 4.9583);
- SetPlayerFacingAngle(playerid, 230.3229);
- TogglePlayerControllable(playerid, 1);
- SetCameraBehindPlayer(playerid);
- }
- else
- {
- SetPlayerPos(playerid, 218.149, 93.0901, 3.89062);
- SetPlayerFacingAngle(playerid, 193.402740);
- TogglePlayerControllable(playerid, 1);
- SetCameraBehindPlayer(playerid);
- }
- DestroyVehicleEx(vehicleid, "vehicleid 4");
- ClearVehicleData(vehicleid);
- return true;
- }
- GREENSIDE::OnPlayerBetFinished(playerid, cash, horseid)
- {
- new Winner = random(5) + 1;
- SendClientMessageF(playerid, COLOR_WHITE, "Race Finished: The winner was horse #%i. Your horse was number #%i.",Winner,horseid);
- if(Winner == horseid)
- {
- new Prize = cash * (random(3) + 2);
- GivePlayerCash(playerid,Prize);
- format(gstr, sizeof(gstr),"You have won $%i.",Prize);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, gstr);
- UnlockAchievement(playerid,15);
- }
- else SendClientMessage(playerid, COLOR_RED, "You have not won this bet.");
- HasBet[playerid] = 0;
- TogglePlayerControllable(playerid,true);
- SetCameraBehindPlayer(playerid);
- return true;
- }
- GREENSIDE::UnTazePlayer(playerid)
- {
- ClearAnimations(playerid);
- TogglePlayerControllable(playerid,1);
- return true;
- }
- GREENSIDE::DestroyStretcher(playerid, objectid)
- {
- DestroyDynamicObjectEx(StretcherEquipped[playerid], "StretcherEquipped[playerid] 3");
- StretcherTimer[playerid] = -1;
- StretcherEquipped[playerid] = -1;
- StretcherHolding[playerid] = 0;
- }
- GREENSIDE::Refilling(playerid, vehicleid, type, fuelstation, totalcost)
- {
- new freefuel = 0;
- if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && vehicleid > 0)
- {
- if(pRefilling[playerid] == 4)
- {
- if(Fuel[vehicleid] <= 99.9)
- {
- if(IsFactionVehicle(vehicleid) == FACTION_COP || IsFactionVehicle(vehicleid) == FACTION_SACFD || IsDonator[playerid] >= 4)
- {
- freefuel = 1;
- }
- if(Cash[playerid] >= 5 || IsDonator[playerid] == 4 || freefuel == 1)
- {
- if(fuelstation >= 0)
- {
- switch(type)
- {
- case FUEL_GASOLINA:
- {
- if(FuelStations[fuelstation][PetrolAmount] <= 0)
- {
- FuelStations[fuelstation][PetrolAmount] = 0;
- cmd_me(playerid, "pulls the pump nozzle out of the fuel tank, placing it back into the fuel pump.");
- SendClientMessage(playerid,COLOR_YELLOW,"The gas station has ran out of Petrol.");
- FuelTypeAfterRefuel[vehicleid] = type;
- IsPlayerRefilling[playerid] = 0;
- pRefilling[playerid] = 0;
- TogglePlayerControllable(playerid, 1);
- DeletePVar(playerid, "fillType");
- return true;
- }
- Fuel[vehicleid] = floatadd(5.0, floatround(Fuel[vehicleid]));
- if(Fuel[vehicleid] >= 100.0) Fuel[vehicleid] = 100.0;
- if(freefuel == 1) totalcost = 0;
- else totalcost += 5;
- format(gstr, sizeof(gstr), "~y~FUEL: ~w~%i%%~n~~y~TOTAL COST: ~w~$%i", floatround(Fuel[vehicleid]), totalcost);
- ShowInfoText(playerid,gstr,2000);
- if(freefuel == 0) GivePlayerCash(playerid, -5);
- FuelStations[fuelstation][PetrolAmount] --;
- UpdateFuelStationSign(fuelstation);
- DeletePVar(playerid, "fillType");
- SetTimerEx("Refilling", 1000, 0, "ddddd", playerid, vehicleid, type, fuelstation, totalcost);
- }
- case FUEL_DIESEL:
- {
- if(FuelStations[fuelstation][DieselAmount] <= 0)
- {
- FuelStations[fuelstation][DieselAmount] = 0;
- cmd_me(playerid, "pulls the pump nozzle out of the fuel tank, placing it back into the fuel pump.");
- SendClientMessage(playerid,COLOR_YELLOW,"The gas station has ran out of Diesel.");
- FuelTypeAfterRefuel[vehicleid] = type;
- IsPlayerRefilling[playerid] = 0;
- pRefilling[playerid] = 0;
- TogglePlayerControllable(playerid, 1);
- DeletePVar(playerid, "fillType");
- return true;
- }
- Fuel[vehicleid] = floatadd(5.0, floatround(Fuel[vehicleid]));
- if(Fuel[vehicleid] >= 100.0) Fuel[vehicleid] = 100.0;
- if(freefuel == 1) totalcost = 0;
- else totalcost += 5;
- format(gstr, sizeof(gstr), "~y~FUEL: ~w~%i%%~n~~y~TOTAL COST: ~w~$%i", floatround(Fuel[vehicleid]), totalcost);
- ShowInfoText(playerid,gstr,2000);
- if(freefuel == 0) GivePlayerCash(playerid, -10);
- FuelStations[fuelstation][DieselAmount] --;
- UpdateFuelStationSign(fuelstation);
- DeletePVar(playerid, "fillType");
- SetTimerEx("Refilling", 1000, 0, "ddddd", playerid, vehicleid, type, fuelstation, totalcost);
- }
- }
- }
- }
- else
- {
- cmd_me(playerid, "pulls the pump nozzle out of the fuel tank, placing it back into the fuel pump.");
- SendClientMessage(playerid,COLOR_GREY,"You don't have enough money for any more fuel.");
- IsPlayerRefilling[playerid] = 0;
- pRefilling[playerid] = 0;
- FuelTypeAfterRefuel[vehicleid] = type;
- TogglePlayerControllable(playerid, 1);
- DeletePVar(playerid, "fillType");
- return true;
- }
- }
- else
- {
- cmd_me(playerid, "pulls the pump nozzle out of the fuel tank, placing it back into the fuel pump.");
- SendClientMessage(playerid,COLOR_GREY,"You have successfully refilled your vehicle fully.");
- IsPlayerRefilling[playerid] = 0;
- pRefilling[playerid] = 0;
- FuelTypeAfterRefuel[vehicleid] = type;
- TogglePlayerControllable(playerid, 1);
- DeletePVar(playerid, "fillType");
- return true;
- }
- }
- else
- {
- cmd_me(playerid, "pulls the pump nozzle out of the fuel tank, placing it back into the fuel pump.");
- format(gstr, sizeof(gstr), "~y~FUEL: ~w~%i%%~n~~y~TOTAL COST: ~w~$%i", floatround(Fuel[vehicleid]), totalcost);
- if(Fuel[vehicleid] == 100) UnlockAchievement(playerid, 8);
- ShowInfoText(playerid,gstr,2000);
- IsPlayerRefilling[playerid] = 0;
- FuelTypeAfterRefuel[vehicleid] = type;
- TogglePlayerControllable(playerid, 1);
- DeletePVar(playerid, "fillType");
- }
- }
- return true;
- }
- GREENSIDE::PassDMVTest2(playerid)
- {
- if(DMV_Testing[playerid] == 0) return false;
- AdminLocked{DMV_TestVehicle[playerid]} = false;
- Objective[DMV_TestVehicle[playerid]][playerid] = 0;
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(DMV_TestVehicle[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(DMV_TestVehicle[playerid], engine, lights, alarm, 0, bonnet, boot, 0);
- new name_o_test[24];
- switch(DMV_Testing[playerid])
- {
- case 1:
- {
- format(name_o_test, 24, "CAR");
- Licenses[playerid][LICENSE_CAR] = 1;
- MySQLUpdateInt(SQLID[playerid], "LicenseCar", Licenses[playerid][0], "players");
- }
- case 2:
- {
- format(name_o_test, 24, "LARGE VEHICLE");
- Licenses[playerid][LICENSE_LGV] = 1;
- MySQLUpdateInt(SQLID[playerid], "LicenseLargeVehicle", Licenses[playerid][LICENSE_LGV], "players");
- }
- case 3:
- {
- format(name_o_test, 24, "MOTORBIKE");
- Licenses[playerid][LICENSE_BIKE] = 1;
- MySQLUpdateInt(SQLID[playerid], "LicenseBike", Licenses[playerid][LICENSE_BIKE], "players");
- }
- case 4:
- {
- format(name_o_test, 24, "BOAT");
- Licenses[playerid][LICENSE_BOAT] = 1;
- MySQLUpdateInt(SQLID[playerid], "LicenseBoat", Licenses[playerid][LICENSE_BOAT], "players");
- }
- case 5:
- {
- format(name_o_test, 24, "HELICOPTER");
- Licenses[playerid][LICENSE_HELI] = 1;
- MySQLUpdateInt(SQLID[playerid], "LicenseHelicopter", Licenses[playerid][LICENSE_HELI], "players");
- }
- case 6:
- {
- format(name_o_test, 24, "AIRPLANE");
- Licenses[playerid][LICENSE_PLANE] = 1;
- MySQLUpdateInt(SQLID[playerid], "LicensePlane", Licenses[playerid][LICENSE_PLANE], "players");
- }
- }
- if(DMV_Testing[playerid] == 4) DestroyAllBoatTestObjects(playerid);
- DisablePlayerRaceCheckpoint(playerid);
- DestroyVehicleEx(DMV_TestVehicle[playerid], "DMV_TestVehicle[playerid] 0");
- DMV_TestVehicle[playerid] = 0;
- DMV_Testing[playerid] = 0;
- DMV_CanEndTest[playerid] = 1;
- for(new i = 1, x = GetVehiclePoolSize(); i <= x; i++)
- {
- if(DMVCarForPlayer[i] == playerid)
- {
- DMVCarForPlayer[i] = -1;
- }
- }
- ShowInfoText(playerid, "~h~Congratulations!", 60000);
- PlayerTextDrawHide(playerid, DMV[playerid]);
- SetPlayerInterior(playerid, 1);
- SetPlayerPos(playerid, 1246.142089, 99.759391, 3174.713623);
- SetPlayerFacingAngle(playerid, 139.0);
- SetPlayerCameraPos(playerid, 1239.6740, 93.7060, 3177.7160);
- SetPlayerCameraLookAt(playerid, 1248.8095, 97.7733, 3176.4973);
- TogglePlayerControllable(playerid, 0);
- OnePlayAnim(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1);
- PlayerPlaySound(playerid, SOUND_DMV_PASS_START, 0, 0, 0);
- SendClientMessageF(playerid, COLOR_LIGHTGREEN, "[DMV] You have been granted a %s license. You may now drive this type of vehicle legally.", name_o_test);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "To continue, please type /endtest.");
- return true;
- }
- GREENSIDE::FailDMVTest(playerid, reason[])
- {
- if(DMV_Testing[playerid] == 0) return false;
- TogglePlayerControllable(playerid, 0);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "\n\n");
- format(gstr, sizeof(gstr), "[DMV] You have failed the driving test. [Reason: %s]", reason);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, gstr);
- ShowInfoText(playerid, "~g~DMV Testing~n~~w~Result: ~r~Fail", 17000);
- for(new i = 1, x = GetVehiclePoolSize(); i <= x; i++)
- {
- if(DMVCarForPlayer[i] == playerid)
- {
- DMVCarForPlayer[i] = -1;
- }
- }
- SetTimerEx("FailDMVTest2", 7000, 0, "d", playerid);
- return true;
- }
- GREENSIDE::FailDMVTest2(playerid)
- {
- if(DMV_Testing[playerid] == 0) return false;
- AdminLocked{DMV_TestVehicle[playerid]} = false;
- Objective[DMV_TestVehicle[playerid]][playerid] = 0;
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(DMV_TestVehicle[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(DMV_TestVehicle[playerid], engine, lights, alarm, 0, bonnet, boot, 0);
- if(DMV_Testing[playerid] == 4) DestroyAllBoatTestObjects(playerid);
- DisablePlayerRaceCheckpoint(playerid);
- DestroyVehicleEx(DMV_TestVehicle[playerid], "DMV_TestVehicle[playerid] 1");
- DMV_TestVehicle[playerid] = 0;
- DMV_Testing[playerid] = 0;
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorldEx(playerid, 0);
- SetPlayerPos(playerid, 1251.018798, 134.651306, 19.948959);
- SetPlayerFacingAngle(playerid, 68.0);
- SetPlayerCameraPos(playerid, 1234.6062, 120.5352, 26.9489);
- SetPlayerCameraLookAt(playerid, 1244.1168, 123.6254, 23.8587);
- TogglePlayerControllable(playerid, 0);
- SetTimerEx("PlayerFinishedDMV", 10000, 0, "d", playerid);
- return true;
- }
- GREENSIDE::PlayerFinishedDMV(playerid)
- {
- PlayerTextDrawHide(playerid, DMV[playerid]);
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllable(playerid, 1);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "You may resit your test at any point but fees will still be charged.");
- return true;
- }
- GREENSIDE::InactivityCheck()
- {
- foreach(new player: Player)
- {
- if(Logged{player})
- {
- new Float:CurPos[3];
- GetPlayerPos(player, CurPos[0], CurPos[1], CurPos[2]);
- if(CurPos[0] == LastPlayerPos[player][0] && CurPos[1] == LastPlayerPos[player][1] && CurPos[2] == LastPlayerPos[player][2])
- {
- if(!IsAFK{player})
- {
- gstr[0] = EOS;
- TogglePlayerControllable(player, 0);
- format(gstr, sizeof(gstr),"[Auto Kick] Kicked %s (Reason: Inactive)",NameEx(player));
- SendClientMessageToAllLogged(COLOR_RED,gstr);
- KickPlayer(player, 35);
- }
- }
- LastPlayerPos[player][0] = CurPos[0];
- LastPlayerPos[player][1] = CurPos[1];
- LastPlayerPos[player][2] = CurPos[2];
- }
- }
- return true;
- }
- GREENSIDE::New_SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size)
- {
- DisablePlayerCheckpoint(playerid);
- return SetPlayerCheckpoint(playerid, x, y, z, size);
- }
- GREENSIDE::New_SetPlayerRaceCheckpoint(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size)
- {
- DisablePlayerRaceCheckpoint(playerid);
- return SetPlayerRaceCheckpoint(playerid, type, x, y, z, nextx, nexty, nextz, size);
- }
- GREENSIDE::JourneyTimer(playerid)
- {
- new journeyid;
- for(new x = 1, v = GetVehiclePoolSize(); x <= v; x++)
- {
- if(VehicleData[x][VehicleModel] == 508)
- {
- if(VehicleData[x][VehicleOwnerSQLID] == SQLID[playerid])
- {
- journeyid = VehicleData[x][IdVehicle];
- break;
- }
- }
- }
- if(journeyid > 0)
- {
- SetSpawnInfo(playerid, 4, cPlayersSkin[playerid], 2216.6523, -465.2169, 1023.7059, 0.0, 0, 0, 0, 0, 0, 0);
- SetPlayerInterior(playerid, 1);
- SetPlayerVirtualWorldEx(playerid, journeyid);
- JourneyInterior[playerid] = journeyid;
- TogglePlayerControllable(playerid, 0);
- SetTimerEx("UnFreezePlayer", 5000, 0, "d", playerid);
- }
- else
- {
- SetSpawnInfo(playerid,4,cPlayersSkin[playerid],1282.459960, 170.554199, 20.329582, 338.116455,0,0,0,0,0,0);
- SetPlayerVirtualWorldEx(playerid, 0);
- SetPlayerInterior(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- SysMsg(playerid, "SPAWN ERROR: Attempted to spawn in Journey resulted in no Journey to spawn in. Spawn set to noob spawn.");
- MySpawnID[playerid] = 1;
- MySQLUpdateInt(SQLID[playerid], "MySpawnID", MySpawnID[playerid], "players");
- }
- return true;
- }
- GREENSIDE::KickPublic(playerid, reason)
- {
- printf("man down %i", reason);
- Kick(playerid);
- return true;
- }
- GREENSIDE::LoadImpoundedVehicle(playerid)
- {
- if(cache_num_rows())
- {
- new vidx = CreateVehicle(411, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0), Float:health, tires, panels, lights, doors, fishc;
- ClearVehicleData(vidx);
- VehicleData[vidx][VehSQLID] = cache_get_field_content_int(0, "id");
- VehicleData[vidx][VehicleModel] = cache_get_field_content_int(0, "VehicleModel");
- VehicleData[vidx][VehicleOwnerSQLID] = cache_get_field_content_int(0, "OwnerSQLID");
- VehicleData[vidx][LastX] = cache_get_field_content_float(0, "LastX");
- VehicleData[vidx][LastY] = cache_get_field_content_float(0, "LastY");
- VehicleData[vidx][LastZ] = cache_get_field_content_float(0, "LastZ");
- VehicleData[vidx][LastRot] = cache_get_field_content_float(0, "LastRot");
- cache_get_field_content(0, "RegPlate", VehicleData[vidx][RegPlate], conn, MAX_REG_PLATE);
- VehicleData[vidx][FuelRemaining] = cache_get_field_content_float(0, "Fuel");
- VehicleData[vidx][Mileage] = cache_get_field_content_float(0, "Mileage");
- VehicleData[vidx][LastOilMileage] = cache_get_field_content_float(0, "LastOilMileage");
- Locked{vidx} = bool:cache_get_field_content_int(0, "IsLocked");
- VehicleData[vidx][VehiclePrice] = cache_get_field_content_int(0, "Price");
- VehicleData[vidx][vColor1] = cache_get_field_content_int(0, "Color1");
- VehicleData[vidx][vColor2] = cache_get_field_content_int(0, "Color2");
- VehicleData[vidx][TicketAmount] = cache_get_field_content_int(0, "TicketAmount");
- VehicleData[vidx][VirtualWorld] = cache_get_field_content_int(0, "VWorld");
- VehicleData[vidx][DonatorCar] = bool:cache_get_field_content_int(0, "DonatorCar");
- VehicleData[vidx][TrunkCash] = cache_get_field_content_int(0, "TrunkCash");
- VehicleData[vidx][TrunkWeed] = cache_get_field_content_int(0, "TrunkWeed");
- VehicleData[vidx][TrunkCocaine] = cache_get_field_content_int(0, "TrunkCocaine");
- VehicleData[vidx][TrunkMoonShine] = cache_get_field_content_int(0, "TrunkMoonShine");
- VehicleData[vidx][TrunkPhone] = cache_get_field_content_int(0, "TrunkPhone");
- VehicleData[vidx][ForSale] = bool:cache_get_field_content_int(0, "ForSale");
- VehicleData[vidx][ForSalePrice] = cache_get_field_content_int(0, "ForSalePrice");
- health = cache_get_field_content_float(0, "DamageHealth");
- panels = cache_get_field_content_int(0, "DamagePanels");
- doors = cache_get_field_content_int(0, "DamageDoors");
- lights = cache_get_field_content_int(0, "DamageLights");
- tires = cache_get_field_content_int(0, "DamageTires");
- VehicleData[vidx][NeedsRecovery] = bool:cache_get_field_content_int(0, "NeedsRecovery");
- VehicleData[vidx][GarageRepairID] = 0;
- VehicleData[vidx][GarageCollectTime] = 0;
- VehicleData[vidx][PlateToggle] = bool:cache_get_field_content_int(0, "PlateToggle");
- VehicleData[vidx][VehiclePaintjob] = cache_get_field_content_int(0, "VehiclePaintjob");
- fishc = cache_get_field_content_int(0, "FishCrate");
- MySQLUpdateInt(VehicleData[vidx][VehSQLID], "GarageRepairID", 0, "vehicles");
- MySQLUpdateInt(VehicleData[vidx][VehSQLID], "GarageCollectTime", 0, "vehicles");
- DestroyVehicleEx(vidx, "vidx 9");
- VehicleData[vidx][IdVehicle] = CreateVehicleEx(VehicleData[vidx][VehicleModel], 626.7276, -593.44635, 16.569581, 270.0, VehicleData[vidx][vColor1], VehicleData[vidx][vColor2], -1, VehicleData[vidx][RegPlate]);
- ChangeVehiclePaintjob(VehicleData[vidx][IdVehicle], VehicleData[vidx][VehiclePaintjob]);
- if(fishc != 0)
- {
- new c = GetFreeFishCrateSlot();
- FishingCrates[c][CrateID] = c;
- FishingCrates[c][CrateVehicle] = vidx;
- FishingCrates[c][CrateOwner] = SQLID[playerid];
- FishingCrates[c][CrateType] = fishc;
- }
- if(health < 250) health = 250;
- SetVehicleHealthEx(VehicleData[vidx][IdVehicle], health);
- UpdateVehicleDamageStatus(VehicleData[vidx][IdVehicle], panels, doors, lights, tires);
- for(new m = 0; m < 14; m++)
- {
- format(sgstr, sizeof(sgstr), "Mod%i", m+1); // Database starts from 1, variable starts from 0
- VehicleData[vidx][VehicleMod][m] = cache_get_field_content_int(0, sgstr);
- if(VehicleData[vidx][VehicleMod][m] && IsVehicleUpgradeCompatible(VehicleData[vidx][VehicleModel], VehicleData[vidx][VehicleMod][m])) AddVehicleComponent(VehicleData[vidx][IdVehicle], VehicleData[vidx][VehicleMod][m]);
- }
- if(!VehicleData[vidx][PlateToggle]) SetVehicleNumberPlate(vidx, VehicleData[vidx][RegPlate]);
- else SetVehicleNumberPlate(VehicleData[vidx][IdVehicle], " ");
- EngineStatus[VehicleData[vidx][IdVehicle]] = 0;
- ToggleVehicleEngine(VehicleData[vidx][IdVehicle], 0);
- VehicleLights[VehicleData[vidx][IdVehicle]] = 0;
- ToggleVehicleLights(VehicleData[vidx][IdVehicle], 0);
- VehicleBoots[VehicleData[vidx][IdVehicle]][0] = 0;
- VehicleBoots[VehicleData[vidx][IdVehicle]][1] = 0;
- ToggleVehicleBonnet(VehicleData[vidx][IdVehicle], 0);
- ToggleVehicleTrunk(VehicleData[vidx][IdVehicle], 0);
- Fuel[VehicleData[vidx][IdVehicle]] = VehicleData[vidx][FuelRemaining];
- VehicleBroke[vidx] = 0;
- aspawned{VehicleData[vidx][IdVehicle]} = false;
- DMVCarForPlayer[VehicleData[vidx][IdVehicle]] = -1;
- if(Locked{vidx})
- {
- ToggleVehicleLock(VehicleData[vidx][IdVehicle], 1);
- }
- if(VehicleData[vidx][ForSale])
- {
- new forsale[128];
- format(forsale, sizeof(forsale), "FOR SALE BY OWNER\n%s - $%s\n Contact %i for more info.", GetVehicleName(vidx), format_cash(VehicleData[vidx][ForSalePrice]), PhoneData[playerid][pNumber]);
- VehicleData[vidx][ForSaleLabel] = CreateDynamic3DTextLabel(forsale, COLOR_SIGN, 0.0, 0.0, 0.0, 10.0, INVALID_PLAYER_ID, VehicleData[vidx][IdVehicle], 1, -1, -1, -1, 10);
- }
- PutPlayerInVehicle(playerid, vidx, 0);
- }
- return true;
- }
- GREENSIDE::ProcessWeaponLicense(playerid)
- {
- if(!cache_num_rows()) return WeaponLicense[playerid] = 0;
- new ExpireTime;
- ExpireTime = cache_get_field_content_int(0, "ExpirationTime");
- if(gettime() >= ExpireTime)
- {
- WeaponLicense[playerid] = -1;
- mysql_format(conn, mquery, sizeof(mquery), "UPDATE weaponlicenses SET LicenseType = %i WHERE OwnerSQLID = %i", WeaponLicense[playerid], SQLID[playerid]);
- mysql_pquery(conn, mquery);
- }
- else WeaponLicense[playerid] = cache_get_field_content_int(0, "LicenseType");
- return true;
- }
- GREENSIDE::LoadMotels()
- {
- new x, InitialTicks = GetTickCount();
- for(new i = 0, p = cache_num_rows(); i < p; i++)
- {
- x = cache_get_field_content_int(i, "id");
- MotelData[x][MotelID] = cache_get_field_content_int(i, "MotelID");
- MotelData[x][RoomX] = cache_get_field_content_float(i, "OutsideX");
- MotelData[x][RoomY] = cache_get_field_content_float(i, "OutsideY");
- MotelData[x][RoomZ] = cache_get_field_content_float(i, "OutsideZ");
- MotelData[x][RoomLocked] = cache_get_field_content_int(i, "RoomLocked");
- MotelData[x][RoomOwner] = cache_get_field_content_int(i, "OwnerSQLID");
- MotelData[x][RoomDaysLeft] = cache_get_field_content_int(i, "RoomDaysLeft");
- if(MotelData[x][RoomOwner] > 0) MotelData[x][RoomPickupID] = CreateDynamicPickup(1314, 23, MotelData[x][RoomX], MotelData[x][RoomY], MotelData[x][RoomZ], 0, -1, -1, 10);
- }
- printf("%i quartos de motel carregados. [%is]", x, GetTickCount() - InitialTicks);
- return true;
- }
- GREENSIDE::LoadAchievements()
- {
- new i, r, InitialTicks = GetTickCount(), id;
- for(i = 0, r = cache_num_rows(); i < r; i++)
- {
- id = cache_get_field_content_int(i, "id");
- AchievementData[id][PointValue] = cache_get_field_content_int(i, "AchPoints");
- cache_get_field_content(i, "AchName", AchievementData[id][Name], conn, 30);
- cache_get_field_content(i, "AchDescription", AchievementData[id][Info], conn, 150);
- }
- printf("%i conquistas carregadas. [%is]", i, GetTickCount() - InitialTicks);
- return true;
- }
- GREENSIDE::LoadFuelStations()
- {
- new x, i, InitialTicks = GetTickCount();
- for(x = 0, i = cache_num_rows(); x < i; x++)
- {
- FuelStations[x][StationID] = cache_get_field_content_int(x, "id");
- FuelStations[x][PetrolAmount] = cache_get_field_content_int(x, "Petrol");
- FuelStations[x][DieselAmount] = cache_get_field_content_int(x, "Diesel");
- FuelStations[x][PetrolAmountMax] = cache_get_field_content_int(x, "PetrolMax");
- FuelStations[x][DieselAmountMax] = cache_get_field_content_int(x, "DieselMax");
- cache_get_field_content(x, "Description", FuelStations[x][StationDescription], 1, 64);
- FuelStations[x][SignX] = cache_get_field_content_float(x, "SignX");
- FuelStations[x][SignY] = cache_get_field_content_float(x, "SignY");
- FuelStations[x][SignZ] = cache_get_field_content_float(x, "SignZ");
- format(gstr, sizeof(gstr), "%s Gas Station\nPetrol: {FFFFFF}%i / %i Gallons"ECOLOR_OOC"\nDiesel: {FFFFFF}%i / %i Gallons", FuelStations[x][StationDescription], FuelStations[x][PetrolAmount], FuelStations[x][PetrolAmountMax], FuelStations[x][DieselAmount], FuelStations[x][DieselAmountMax]);
- FuelStations[x][SignLabel] = CreateDynamic3DTextLabel(gstr, COLOR_OOC, FuelStations[x][SignX], FuelStations[x][SignY], FuelStations[x][SignZ], 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 25);
- }
- printf("%i Posto de gasolina carregados. [%is]", x, GetTickCount()-InitialTicks);
- return true;
- }
- GREENSIDE::LoadMotelInfo(motelid, type)
- {
- if(!cache_num_rows()) return true;
- new totalrooms, freerooms, fee;
- switch(motelid)
- {
- case 1,4,5: fee = 100;
- case 2,7: fee = 200;
- case 3,8,9: fee = 500;
- case 6: fee = 150;
- }
- totalrooms = cache_get_field_content_int(0, "totalrooms");
- freerooms = cache_get_field_content_int(0, "freerooms");
- format(sgstr, sizeof(sgstr), "{FFFFFF}MOTEL\n{FF72DB}Total Rooms: {FFFFFF}%i\n{FF72DB}Available Rooms: {FFFFFF}%i\n{FF72DB}Rent Fee: {FFFFFF}$%i", totalrooms, freerooms, fee);
- if(type == 1) MotelLabels[motelid] = CreateDynamic3DTextLabel(sgstr, COLOR_PINK, motelcords[motelid][0], motelcords[motelid][1], motelcords[motelid][2], 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 25);
- else UpdateDynamic3DTextLabelText(MotelLabels[motelid], COLOR_PINK, sgstr);
- return true;
- }
- GREENSIDE::UpdateMotelSign(motel)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT (SELECT COUNT(*) FROM motel WHERE OwnerSQLID = 0 AND MotelID = %i) AS freerooms, (SELECT COUNT(*) FROM motel WHERE MotelID = %i) AS totalrooms", motel + 1, motel + 1);
- mysql_pquery(conn, mquery, "LoadMotelInfo", "ii", motel, 0);
- return true;
- }
- GREENSIDE::CloseTollGate(objectid, Float:rotty)
- {
- new Float:pos[3], Float:rot[3];
- GetDynamicObjectPos(PayTolls[objectid][0], pos[0], pos[1], pos[2]);
- GetDynamicObjectRot(PayTolls[objectid][0], rot[0], rot[1], rot[2]);
- MoveDynamicObject(PayTolls[objectid][0], pos[0], pos[1], pos[2]-0.001, 0.0005, rot[0], rotty, rot[2]);
- PayTolls[objectid][1] = 0;
- return true;
- }
- GREENSIDE::LaunchMissile(playerid)
- {
- new Float:vx, Float:vy, Float:vz;
- GetVehiclePos(GetPlayerVehicleID(playerid), vx, vy, vz);
- CreateExplosion(vx, vy, vz, 7, 18.0);
- return true;
- }
- GREENSIDE::UnfreezeRubber(playerid)
- {
- PlayerRubber[playerid] = 0;
- LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- GREENSIDE::UnfreezeTased(playerid)
- {
- PlayerTased[playerid] = 0;
- LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
- return true;
- }
- stock GetMOTD(playerid, motdid)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT message FROM motd WHERE motdid = %i", motdid);
- mysql_pquery(conn, mquery, "SendMOTDResult", "ii", playerid, motdid);
- return true;
- }
- GREENSIDE::SendMOTDResult(playerid, motdid)
- {
- if(!cache_num_rows()) return true;
- new motd[128];
- cache_get_field_content(0, "message", motd);
- switch(motdid)
- {
- case 0: SendClientMessageF(playerid, COLOR_RED, "[Admin MOTD]: %s", motd);
- case 1: SendClientMessageF(playerid, COLOR_LIGHTGREEN, "[Helper MOTD]: %s", motd);
- case 2: SendClientMessageF(playerid, COLOR_WHITE, "[Player MOTD]: %s", motd);
- }
- return true;
- }
- stock GetFMOTD(fid)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT fmotd FROM fmotd WHERE fid = %i", fid);
- mysql_pquery(conn, mquery, "RetrieveFMOTD", "i", fid);
- return true;
- }
- GREENSIDE::RetrieveFMOTD(fid)
- {
- if(cache_num_rows()) cache_get_field_content(0, "fmotd", FACTIONS[fid][FMOTD], conn, 128);
- return true;
- }
- stock SendFMOTD(playerid, fid)
- {
- SendClientMessageF(playerid, 0x80BCFFFF, "[Faction MOTD]: %s", FACTIONS[fid][FMOTD]);
- return true;
- }
- GREENSIDE::RelogMALogin(playerid)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM masters WHERE id = %i LIMIT 1", MasterAccount[playerid]);
- mysql_pquery(conn, mquery, "LoginMasterAccount", "d", playerid);
- }
- GREENSIDE::CameraLoginDown(playerid, x,y,z)
- {
- InterpolateCameraPos(playerid,x,y,z+1000,x,y,z,5,CAMERA_MOVE);
- InterpolateCameraLookAt(playerid,x,y,z,x,y,z,5,CAMERA_MOVE);
- }
- GREENSIDE::CameraReset(playerid)
- {
- SetCameraBehindPlayer(playerid);
- }
- GREENSIDE::DelayedGameModeExit() GameModeExit();
- GREENSIDE::Float:PlayerPosX(playerid)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y ,z);
- return x;
- }
- GREENSIDE::Float:PlayerPosY(playerid)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y ,z);
- return y;
- }
- GREENSIDE::Float:PlayerPosZ(playerid)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y ,z);
- return z;
- }
- GREENSIDE::Float:PlayerPosA(playerid)
- {
- new Float:a;
- GetPlayerFacingAngle(playerid, a);
- return a;
- }
- //Bizz, house loading and etc.
- GREENSIDE::LoadBizzes()
- {
- new x, InitialTicks = GetTickCount();
- for(new i = 0, r = cache_num_rows(); i < r; i++)
- {
- BizzData[x][BizzSQLID] = cache_get_field_content_int(i, "id");
- cache_get_field_content(i, "Description", BizzData[x][BizzDescription], conn, 64);
- BizzData[x][oPosX] = cache_get_field_content_float(i, "oPosX");
- BizzData[x][oPosY] = cache_get_field_content_float(i, "oPosY");
- BizzData[x][oPosZ] = cache_get_field_content_float(i, "oPosZ");
- BizzData[x][iPosX] = cache_get_field_content_float(i, "iPosX");
- BizzData[x][iPosY] = cache_get_field_content_float(i, "iPosY");
- BizzData[x][iPosZ] = cache_get_field_content_float(i, "iPosZ");
- BizzData[x][Payout] = cache_get_field_content_int(i, "Payout");
- BizzData[x][BizzPrice] = cache_get_field_content_int(i, "Price");
- BizzData[x][BizzType] = cache_get_field_content_int(i, "BizzType");
- BizzData[x][EnterFee] = cache_get_field_content_int(i, "EnterFee");
- BizzData[x][BizzEarnings] = cache_get_field_content_int(i, "BizzEarnings");
- BizzData[x][BizzLocked] = bool:cache_get_field_content_int(i, "Locked");
- BizzData[x][BizzStock] = cache_get_field_content_int(i, "Stock");
- BizzData[x][BizzRequestStock] = cache_get_field_content_int(i, "RequestStock");
- BizzData[x][IsSpecial] = cache_get_field_content_int(i, "IsSpecial");
- BizzData[x][BizzOwnerSQLID] = cache_get_field_content_int(i, "OwnerSQLID");
- BizzData[x][InteriorID] = cache_get_field_content_int(i, "InteriorID");
- BizzData[x][BizzVW] = cache_get_field_content_int(i, "BizzVW");
- BizzData[x][ExitVW] = cache_get_field_content_int(i, "ExitVW");
- BizzData[x][BizzLights] = false;
- BizzData[x][BizzOccupants] = 0;
- BizzData[x][BizzPickup] = CreateDynamicPickup(1239, 23,BizzData[x][oPosX],BizzData[x][oPosY],BizzData[x][oPosZ], -1, -1, -1, 10);
- BizzData[x][BizzLabel] = CreateDynamic3DTextLabel("", COLOR_WHITE, BizzData[x][oPosX],BizzData[x][oPosY],BizzData[x][oPosZ]+0.5, 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 10.0);
- UpdateBizzLabel(x);
- new Actors[64], actorsub[12];
- for(new a = 0; a < 4; a++)
- {
- format(actorsub, 12, "Actor%i", a + 1);
- cache_get_field_content(i, actorsub, Actors, conn, 64);
- BizzData[x][BizzActor][a] = -1;
- sscanf(Actors, "p<,>iiffffi", BizzData[x][BizzActorSpawned][a], BizzData[x][BizzActorSkin][a], BizzData[x][BizzActorX][a], BizzData[x][BizzActorY][a], BizzData[x][BizzActorZ][a], BizzData[x][BizzActorAngle][a], BizzData[x][BizzActorAnim][a]);
- if(BizzData[x][BizzActorSpawned][a] == 1)
- {
- BizzData[x][BizzActor][a] = CreateActor(BizzData[x][BizzActorSkin][a], BizzData[x][BizzActorX][a], BizzData[x][BizzActorY][a], BizzData[x][BizzActorZ][a], BizzData[x][BizzActorAngle][a]);
- SetActorInvulnerable(BizzData[x][BizzActor][a], true);
- SetActorVirtualWorld(BizzData[x][BizzActor][a], BizzData[x][BizzVW]);
- ApplyBizzActorAnim(BizzData[x][BizzActor][a], BizzData[x][BizzActorAnim][a]);
- }
- }
- x ++;
- }
- printf("%i Empresas carregadas. [%is]", cache_num_rows(), GetTickCount() - InitialTicks);
- return true;
- }
- GREENSIDE::LoadWeedPlants(x, hf)
- {
- if(cache_num_rows())
- {
- for(new i = 0; i < MAX_WEED_PLANTS; i++)
- {
- if(WeedData[x][PlantSQLID][i] == 0)
- {
- WeedData[x][PlantWater][i] = cache_get_field_content_int(i, "Water");
- WeedData[x][PlantGrowth][i] = cache_get_field_content_int(i, "Growth");
- WeedData[x][PlantSQLID][i] = cache_get_field_content_int(i, "id");
- WeedData[x][PlantPotObj][i] = HouseData[x][FurnObject][hf];
- WeedData[x][PlantFurnIndex][i] = hf;
- break;
- }
- }
- }
- return true;
- }
- GREENSIDE::LoadGarages()
- {
- new id, InitialTicks = GetTickCount();
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- GarageData[id][gID] = cache_get_field_content_int(i, "id");
- GarageData[id][gHouseID] = GetHouseIDFromSQLID(cache_get_field_content_int(i, "HouseSQLID"));
- GarageData[id][gType] = cache_get_field_content_int(i, "GarageType");
- GarageData[id][oPosX] = cache_get_field_content_float(i, "OutsideX");
- GarageData[id][oPosY] = cache_get_field_content_float(i, "OutsideY");
- GarageData[id][oPosZ] = cache_get_field_content_float(i, "OutsideZ");
- GarageData[id][iPosX] = cache_get_field_content_float(i, "InsideX"); //inside xyz only used if garage type is 5 for custom garages
- GarageData[id][iPosY] = cache_get_field_content_float(i, "InsideY");
- GarageData[id][iPosZ] = cache_get_field_content_float(i, "InsideZ");
- GarageData[id][iAngle] = cache_get_field_content_float(i, "InsideAngle");
- GarageData[id][oAngle] = cache_get_field_content_float(i, "OutsideAngle");
- GarageData[id][oVehicleAngle] = cache_get_field_content_float(i, "OutsideVAngle");
- GarageData[id][iVehicleAngle] = cache_get_field_content_float(i, "InsideVAngle");
- GarageData[id][iVirtualWorld] = cache_get_field_content_int(i, "InsideVW");
- GarageData[id][oVirtualWorld] = cache_get_field_content_int(i, "OutsideVW");
- GarageData[id][InsideInt] = cache_get_field_content_int(i, "InsideInt");
- GarageData[id][GarageLocked] = cache_get_field_content_int(i, "Locked");
- GarageData[id][UseHouse] = bool:cache_get_field_content_int(i, "UseHouse");
- GarageData[id][GaragePickup] = CreateDynamicPickup(1318, 23, GarageData[id][oPosX], GarageData[id][oPosY], GarageData[id][oPosZ], -1, -1, -1, 10);
- id ++;
- }
- printf("%i garagens carregadas. [%is]", id, GetTickCount() - InitialTicks);
- return true;
- }
- GREENSIDE::LoadHouses(toggle)
- {
- new h = 0, InitialTicks = GetTickCount(), i, x, pickupmodel;
- if(toggle == 1) h = GetFreeHouseArraySlot();
- for(i = 0, x = cache_num_rows(); i < x; i++)
- {
- HouseData[h][HouseSQLID] = cache_get_field_content_int(i, "id");
- HouseData[h][oPosX] = cache_get_field_content_float(i, "oPosX");
- HouseData[h][oPosY] = cache_get_field_content_float(i, "oPosY");
- HouseData[h][oPosZ] = cache_get_field_content_float(i, "oPosZ");
- HouseData[h][intPosX] = cache_get_field_content_float(i, "intPosX");
- HouseData[h][intPosY] = cache_get_field_content_float(i, "intPosY");
- HouseData[h][intPosZ] = cache_get_field_content_float(i, "intPosZ");
- HouseData[h][HouseInterior] = cache_get_field_content_int(i, "HouseInterior");
- HouseData[h][HouseExtVW] = cache_get_field_content_int(i, "ExtVW");
- HouseData[h][HousePrice] = cache_get_field_content_int(i, "Price");
- HouseData[h][HouseOwnerSQLID] = cache_get_field_content_int(i, "OwnerSQLID");
- HouseData[h][HouseLocked] = cache_get_field_content_int(i, "HouseLocked");
- HouseData[h][InsideID] = cache_get_field_content_int(i, "InsideID");
- HouseData[h][StoredCash] = cache_get_field_content_int(i, "StoredCash");
- HouseData[h][StoredWeed] = cache_get_field_content_int(i, "StoredWeed");
- HouseData[h][StoredCocaine] = cache_get_field_content_int(i, "StoredCocaine");
- HouseData[h][StoredMoonShine] = cache_get_field_content_int(i, "StoredMoonShine");
- HouseData[h][StoredPhone] = cache_get_field_content_int(i, "StoredPhone");
- HouseData[h][HouseVW] = cache_get_field_content_int(i, "HouseVW");
- HouseData[h][ExtStreamDist] = cache_get_field_content_float(i, "ExteriorStreamDistance");
- HouseData[h][HouseLights] = false;
- HouseData[h][HouseOccupants] = 0;
- cache_get_field_content(i, "Description", HouseData[h][HouseDescription], conn, 64);
- cache_get_field_content(i, "DoorNote", HouseData[h][DoorNoteMessage], conn, 64);
- if(HouseData[h][HouseOwnerSQLID] == 0) pickupmodel = 19522;
- else pickupmodel = 1273;
- HouseData[h][HousePickup] = CreateDynamicPickup(pickupmodel, 23, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ], HouseData[h][HouseExtVW], -1, -1, 20.0);
- if(HouseData[h][HouseExtVW] > 0) HouseData[h][HouseLabel] = CreateDynamic3DTextLabel(HouseData[h][HouseDescription][strfind(HouseData[h][HouseDescription], "Flat ")+5], COLOR_LIGHTBLUE, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ]+0.5, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 15.0);
- else HouseData[h][HouseLabel] = CreateDynamic3DTextLabel(HouseData[h][HouseDescription], COLOR_SKYBLUE, HouseData[h][oPosX], HouseData[h][oPosY], HouseData[h][oPosZ]+0.5, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0, -1, -1, 15.0);
- if(HouseData[h][HouseLocked] == 1 && HouseData[h][HouseOwnerSQLID] == 0) HouseData[h][HouseLocked] = 0;
- for(new w = 0; w < MAX_WEED_PLANTS; w++)
- {
- WeedData[h][PlantGrowth][w] = 0;
- WeedData[h][PlantWater][w] = 0;
- WeedData[h][PlantPotObj][w] = INVALID_OBJECT_ID;
- WeedData[h][PlantSQLID][w] = 0;
- WeedData[h][PlantFurnIndex][w] = 0;
- }
- h++;
- }
- printf("%i casas carregadas. [%is]", i, GetTickCount() - InitialTicks);
- return true;
- }
- GREENSIDE::LoadFurniture()
- {
- new i, x, InitialTicks = GetTickCount();
- for(i = 0, x = cache_num_rows(); i < x; i++)
- {
- FurniData[i][fModel] = cache_get_field_content_int(i, "Model");
- cache_get_field_content(i, "Name", FurniData[i][fuName], conn, 64);
- FurniData[i][fPrice] = cache_get_field_content_int(i, "Price");
- FurniData[i][fCategory] = cache_get_field_content_int(i, "Category");
- FurniData[i][fSubCategory] = cache_get_field_content_int(i, "SubCategory");
- FurniData[i][fExteriorAllow] = bool:cache_get_field_content_int(i, "AllowOutdoors");
- }
- printf("%i objetos furniture carregados. [%is]", i, GetTickCount() - InitialTicks);
- return true;
- }
- GREENSIDE::LoadHouseFurniture()
- {
- new idx, x, r, lastsqlid, lastarray, sqlid, InitialTicks = GetTickCount(), i, matobject[3], mattxd[3][128], mattexture[3][128],
- Float:furnx, Float:furny, Float:furnz, Float:furnrx, Float:furnry, Float:furnrz, texturecolor[3];
- for(i = 0, r = cache_num_rows(); i < r; i++)
- {
- sqlid = cache_get_field_content_int(i, "HouseSQLID");
- if(i == 0 || sqlid != lastsqlid) x = GetHouseArrayFromID(sqlid);
- if(x != lastarray)
- {
- idx = 0;
- lastarray = x;
- }
- lastsqlid = sqlid;
- HouseData[x][FurnSQLID][idx] = cache_get_field_content_int(i, "id");
- HouseData[x][FurnModel][idx] = cache_get_field_content_int(i, "Model");
- HouseData[x][FurnPlaced][idx] = cache_get_field_content_int(i, "Placed");
- HouseData[x][DoorLocked][idx] = bool:cache_get_field_content_int(i, "Locked");
- HouseData[x][DoorOpen][idx] = false;
- HouseData[x][ZAdjust][idx] = 0.0;
- if(HouseData[x][FurnPlaced][idx] == 1)
- {
- furnx = cache_get_field_content_float(i, "Xpos");
- furny = cache_get_field_content_float(i, "Ypos");
- furnz = cache_get_field_content_float(i, "Zpos");
- furnrx = cache_get_field_content_float(i, "Xrot");
- furnry = cache_get_field_content_float(i, "Yrot");
- furnrz = cache_get_field_content_float(i, "Zrot");
- HouseData[x][FurnObject][idx] = CreateDynamicObject(HouseData[x][FurnModel][idx], furnx, furny, furnz, furnrx, furnry, furnrz, HouseData[x][HouseVW], -1, -1, 500, 500);
- if(cache_get_field_content_int(i, "Material1Used") == 1)
- {
- FurnitureIndex[x][idx][0] = cache_get_field_content_int(i, "Material1Index");
- matobject[0] = cache_get_field_content_int(i, "Material1Object");
- cache_get_field_content(i, "Material1Txd", mattxd[0], conn, 128);
- cache_get_field_content(i, "Material1Texture", mattexture[0], conn, 128);
- texturecolor[0] = cache_get_field_content_int(i, "Material1Color");
- SetDynamicObjectMaterial(HouseData[x][FurnObject][idx], FurnitureIndex[x][idx][0], matobject[0], mattxd[0], mattexture[0], texturecolor[0]);
- }
- if(cache_get_field_content_int(i, "Material2Used") == 1)
- {
- FurnitureIndex[x][idx][1] = cache_get_field_content_int(i, "Material2Index");
- matobject[1] = cache_get_field_content_int(i, "Material2Object");
- cache_get_field_content(i, "Material2Txd", mattxd[1], conn, 128);
- cache_get_field_content(i, "Material2Texture", mattexture[1], conn, 128);
- texturecolor[1] = cache_get_field_content_int(i, "Material2Color");
- SetDynamicObjectMaterial(HouseData[x][FurnObject][idx], FurnitureIndex[x][idx][1], matobject[1], mattxd[1], mattexture[1], texturecolor[1]);
- }
- if(cache_get_field_content_int(i, "Material3Used") == 1)
- {
- FurnitureIndex[x][idx][2] = cache_get_field_content_int(i, "Material3Index");
- matobject[2] = cache_get_field_content_int(i, "Material3Object");
- cache_get_field_content(i, "Material3Txd", mattxd[2], conn, 328);
- cache_get_field_content(i, "Material3Texture", mattexture[2], conn, 328);
- texturecolor[2] = cache_get_field_content_int(i, "Material3Color");
- SetDynamicObjectMaterial(HouseData[x][FurnObject][idx], FurnitureIndex[x][idx][2], matobject[2], mattxd[2], mattexture[2], texturecolor[2]);
- }
- if(HouseData[x][FurnModel][idx] == WEED_OBJECT_POT || HouseData[x][FurnModel][idx] == WEED_OBJECT_GROWN)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM weed WHERE FurnSQLID = %i LIMIT 1", HouseData[x][FurnSQLID][idx]);
- mysql_pquery(conn, mquery, "LoadWeedPlants", "dd", x, idx);
- }
- HouseData[x][FurnPlaced][idx] = 1;
- }
- idx ++;
- }
- printf("%i mobília interior carregadas. [%is]", i, GetTickCount() - InitialTicks);
- return true;
- }
- GREENSIDE::LoadExteriorHouseFurniture()
- {
- new InitialTicks = GetTickCount(), i, r, sqlid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, lastarray, idx, h, lastsqlid;
- for(i = 0, r = cache_num_rows(); i < r; i++)
- {
- sqlid = cache_get_field_content_int(i, "HouseSQLID");
- if(i == 0 || sqlid != lastsqlid) h = GetHouseArrayFromID(sqlid);
- if(h != lastarray)
- {
- idx = 0;
- lastarray = h;
- }
- lastsqlid = sqlid;
- EFurnData[h][EFurnSQLID][idx] = cache_get_field_content_int(i, "id");
- EFurnData[h][EFurnModel][idx] = cache_get_field_content_int(i, "Model");
- EFurnData[h][EFurnPlaced][idx] = bool:cache_get_field_content_int(i, "Placed");
- if(EFurnData[h][EFurnPlaced])
- {
- x = cache_get_field_content_float(i, "Xpos");
- y = cache_get_field_content_float(i, "Ypos");
- z = cache_get_field_content_float(i, "Zpos");
- rx = cache_get_field_content_float(i, "Xrot");
- ry = cache_get_field_content_float(i, "Yrot");
- rz = cache_get_field_content_float(i, "Zrot");
- EFurnData[h][EFurnObject][idx] = CreateDynamicObject(EFurnData[h][EFurnModel][idx], x, y, z, rx, ry, rz, -1, -1, 1, 50.0);
- }
- idx++;
- }
- printf("%i mobília exteriores carregadas. [%is]", i, GetTickCount() - InitialTicks);
- return true;
- }
- GREENSIDE::LoadInteriors()
- {
- new id = 0, InitialTicks = GetTickCount();
- for(new i = 0, x = cache_num_rows(); i < x; i++)
- {
- Interiors[id][interiorID] = cache_get_field_content_int(i, "id");
- Interiors[id][oPosX] = cache_get_field_content_float(i, "OutsideX");
- Interiors[id][oPosY] = cache_get_field_content_float(i, "OutsideY");
- Interiors[id][oPosZ] = cache_get_field_content_float(i, "OutsideZ");
- Interiors[id][iPosX] = cache_get_field_content_float(i, "InsideX");
- Interiors[id][iPosY] = cache_get_field_content_float(i, "InsideY");
- Interiors[id][iPosZ] = cache_get_field_content_float(i, "InsideZ");
- Interiors[id][iAngle] = cache_get_field_content_float(i, "InsideAngle");
- Interiors[id][oAngle] = cache_get_field_content_float(i, "OutsideAngle");
- Interiors[id][iInteriorID] = cache_get_field_content_int(i, "InsideINT");
- Interiors[id][oInteriorID] = cache_get_field_content_int(i, "OutsideINT");
- Interiors[id][iVirtualWorld] = cache_get_field_content_int(i, "InsideVW");
- Interiors[id][oVirtualWorld] = cache_get_field_content_int(i, "OutsideVW");
- cache_get_field_content(i, "InteriorName", Interiors[id][InteriorName], conn, 50);
- Interiors[id][InteriorNavTo] = cache_get_field_content_int(i, "ShowGPS");
- Interiors[id][IntFaction] = cache_get_field_content_int(i, "Faction");
- Interiors[id][IntFactionRank] = cache_get_field_content_int(i, "Rank");
- id ++;
- }
- printf("%i interiores carregados. [%is]", id, GetTickCount() - InitialTicks);
- return true;
- }
- GREENSIDE::LoadAllPickups()
- {
- new x = 0, InitialTicks = GetTickCount();
- for(new i, r = cache_num_rows(); i < r; i++)
- {
- cache_get_field_content(i, "PickupText", PickupData[x][PickupText], conn, 150);
- PickupData[x][PickupSQLID] = cache_get_field_content_int(i, "id");
- PickupData[x][Xpos] = cache_get_field_content_float(i, "posX");
- PickupData[x][Ypos] = cache_get_field_content_float(i, "posY");
- PickupData[x][Zpos] = cache_get_field_content_float(i, "posZ");
- PickupData[x][PickupModel] = cache_get_field_content_int(i, "Model");
- PickupData[x][WorldID] = cache_get_field_content_int(i, "vWorld");
- PickupData[x][PickupType] = cache_get_field_content_int(i, "Type");
- if(PickupData[x][PickupModel] > 0) PickupData[x][IGPickupID] = CreateDynamicPickup(PickupData[x][PickupModel],PickupData[x][PickupType],PickupData[x][Xpos],PickupData[x][Ypos],PickupData[x][Zpos],PickupData[x][WorldID], -1, -1, 20);
- x++;
- }
- printf("%i pickups carregadas. [%is]", x, GetTickCount() - InitialTicks);
- return true;
- }
- GREENSIDE::LoadNewRentalCar(playerid)
- {
- mysql_format(conn, mquery, sizeof(mquery), "SELECT * FROM rentals WHERE id = %i", cache_insert_id());
- mysql_pquery(conn, mquery, "LoadRentalCars");
- return true;
- }
- GREENSIDE::LoadRentalCars()
- {
- new pos[64], InitialTicks = GetTickCount(), i, x;
- for(i = 0, x = cache_num_rows(); i < x; i++)
- {
- new v = CreateVehicle(411, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0);
- ClearVehicleData(v);
- RentalData[v][CarSQLID] = cache_get_field_content_int(i, "id");
- RentalData[v][CarModel] = cache_get_field_content_int(i, "Model");
- RentalData[v][RentalPrice] = cache_get_field_content_int(i, "Price");
- RentalData[v][rColor1] = cache_get_field_content_int(i, "Color1");
- RentalData[v][rColor2] = cache_get_field_content_int(i, "Color2");
- RentalData[v][CarMileage] = cache_get_field_content_float(i, "Mileage");
- cache_get_field_content(i, "Position", pos, conn, 64);
- cache_get_field_content(i, "RegPlate", RentalData[v][RentalPlate], conn, 12);
- sscanf(pos, "p<,>ffff", RentalData[v][rPosX], RentalData[v][rPosY], RentalData[v][rPosZ], RentalData[v][rRot]);
- DestroyVehicleEx(v, "v 7");
- RentalData[v][CarID] = CreateVehicleEx(RentalData[v][CarModel], RentalData[v][rPosX], RentalData[v][rPosY], RentalData[v][rPosZ], RentalData[v][rRot], RentalData[v][rColor1], RentalData[v][rColor2], -1, RentalData[v][RentalPlate]);
- LinkVehicleToInterior(RentalData[v][CarID], 2);
- SetVehicleVirtualWorld(RentalData[v][CarID], 1);
- }
- printf("%i veículos alugados carregados. [%is]", i, GetTickCount()-InitialTicks);
- return true;
- }
- stock IsValidModel(id)
- {
- if(id < 320 || id > 20000) return true;
- if(id >= 18659 && id <= 18667) return true;
- return false;
- }
- stock HideFuelTDForPlayer(playerid) {
- //TextDrawHideForPlayer(playerid, texmilhas3dl);//milhas
- TextDrawHideForPlayer(playerid, fuel3dl);
- TextDrawHideForPlayer(playerid, fuel3dl12);
- TextDrawHideForPlayer(playerid, fuel3dl25);
- TextDrawHideForPlayer(playerid, fuel3dl37);
- TextDrawHideForPlayer(playerid, fuel3dl50);
- TextDrawHideForPlayer(playerid, fuel3dl65);
- TextDrawHideForPlayer(playerid, fuel3dl75);
- TextDrawHideForPlayer(playerid, fuel3dl87);
- TextDrawHideForPlayer(playerid, fuel3dl100);
- return 1;
- }
- stock OcultarVeh03DL(playerid) {
- //TextDrawHideForPlayer(playerid, texmilhas3dl);//milhas
- //PlayerTextDrawHide(playerid, Speedo3dl[playerid]);
- PlayerTextDrawHide(playerid, Speedo3dl10[playerid]);
- PlayerTextDrawHide(playerid, Speedo3dl20[playerid]);
- PlayerTextDrawHide(playerid, Speedo3dl30[playerid]);
- PlayerTextDrawHide(playerid, Speedo3dl40[playerid]);
- PlayerTextDrawHide(playerid, Speedo3dl50[playerid]);
- PlayerTextDrawHide(playerid, Speedo3dl60[playerid]);
- PlayerTextDrawHide(playerid, Speedo3dl70[playerid]);
- PlayerTextDrawHide(playerid, Speedo3dl80[playerid]);
- PlayerTextDrawHide(playerid, Speedo3dl90[playerid]);
- return 1;
- }
- GREENSIDE::PutPlayerInShip(playerid)
- {
- Teleport(playerid, -2887.7366, 1914.3883, -18.6266, 0.0, 1, 1331);
- return true;
- }
- GREENSIDE::ConnectTrainBot()
- {
- ConnectNPC("Train_Bot","TrainBot");
- BotVehicle = AddStaticVehicleEx(538, 1721.343017, -1955.853027, 13.442980, 0.0, -1, -1, 600); // Train
- return true;
- }
- GREENSIDE::ProcessHKeys()
- {
- foreach(new i: Player)
- {
- HasHouseKey[i][0] = -1;
- HasHouseKey[i][1] = -1;
- ProcessHouseKey(i);
- }
- return true;
- }
- GREENSIDE::ProcessBKeys()
- {
- foreach(new i: Player)
- {
- PlayerBizzID[i][0] = -1;
- PlayerBizzID[i][0] = -1;
- ProcessBusinessKeys(i);
- }
- return true;
- }
- GREENSIDE::SpawnCheck(playerid)
- {
- if(!Logged{playerid} && !IsPlayerNPC(playerid)) KickPlayer(playerid, 2);
- SpawnCheckTimer[playerid] = 0;
- return true;
- }
- GREENSIDE::phonebateria(playerid) //PhoneData[playerid][pBattery] // 0 20 40 60 80 100
- {
- switch(floatround(PhoneData[playerid][pBattery]))
- {
- case 99..100: PlayerTextDrawShow(playerid, textdrawBateria100[playerid]) && PlayerTextDrawHide(playerid, textdrawBateria80[playerid]);
- case 80..98: PlayerTextDrawShow(playerid, textdrawBateria80[playerid]) && PlayerTextDrawHide(playerid, textdrawBateria60[playerid]);
- case 60..79: PlayerTextDrawShow(playerid, textdrawBateria60[playerid]) && PlayerTextDrawHide(playerid, textdrawBateria40[playerid]);
- case 40..59: PlayerTextDrawShow(playerid, textdrawBateria40[playerid]) && PlayerTextDrawHide(playerid, textdrawBateria20[playerid]);
- case 20..39: PlayerTextDrawShow(playerid, textdrawBateria20[playerid]) && PlayerTextDrawHide(playerid, textdrawBateria0[playerid]);
- case 1..19: PlayerTextDrawShow(playerid, textdrawBateria20[playerid]) && PlayerTextDrawHide(playerid, textdrawBateria0[playerid]);
- case 0: PlayerTextDrawShow(playerid, textdrawBateria0[playerid]);
- }
- return true;
- }
- GREENSIDE::newhudVxC(playerid) //PhoneData[playerid][pBattery] // 0 20 40 60 80 100
- {
- TextDrawShowForPlayer(playerid, Textdraw0);
- TextDrawShowForPlayer(playerid, Textdraw1);
- return true;
- }
- forward ObjetosLoad(playerid);
- public ObjetosLoad(playerid)
- {
- TogglePlayerControllable(playerid, 1);
- GameTextForPlayer(playerid, "~g~Objetos Carregados ...", 5000, 1);
- return 1;
- }
- // ======== FORA DO GAMEMODE
- // COMANDOS
- #include "..\comandos\Admins.pwn"
- #include "..\comandos\drogas.pwn"
- #include "..\comandos\creditos.pwn"
- // OUTROS
- #include "..\pickup\pickup.pwn"
- #include "..\pickup\pos.pwn"
- //
- /*================================================================================
- PLUGINS:
- MySQL R39-3 http://forum.sa-mp.com/showthread.php?t=56564
- Streamer 2.7.7 http://forum.sa-mp.com/showthread.php?t=102865
- sscanf 2.8.1 http://forum.sa-mp.com/showthread.php?t=570927
- Whirlpool 1.0 http://forum.sa-mp.com/showthread.php?t=65290
- OTHER RESOURCES:
- foreach 19 http://forum.sa-mp.com/showthread.php?t=570868
- i-zcmd 0.2.2 http://forum.sa-mp.com/showthread.php?t=576114
- ================================================================================*/
|