Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define FILTERSCRIPT
- #pragma tabsize 0
- #define GasMax 100
- #define Abastecendo 5000
- #define RunOutTime 15000
- #define AMARELO 0xFFFF00AA
- #define VERMELHO 0xFF000096
- #define AZUL 0x33AA33A
- #define SLOT 1
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- forward Petrobras(playerid);
- forward Texaco(playerid);
- forward APetrobras(playerid);
- forward ATexaco(playerid);
- forward Float:GetDistanceBetweenPlayerToPoint(p1,Float:px,Float:py,Float:pz);
- forward Veiculoparado();
- forward Checargas();
- forward Velocimetro();
- forward Tontura(playerid);
- forward Semcinto(playerid);
- forward Comcinto(playerid);
- forward Capacete(playerid);
- forward RetirarlogoasTextDraw(playerid);
- enum SavePlayerPosEnum
- {
- Float:LastX,
- Float:LastY,
- Float:LastZ
- };
- new Text:Fundo;
- new Text:Velocidade;
- new Text:Modelo;
- new Text:Gasolina;
- new Text:Motor;
- new Text:Cinto;
- new CSEG[MAX_PLAYERS];
- new TempoChecargas;
- new TempoVeiculoparado;
- new Gas[MAX_VEHICLES];
- new AbasPetro[MAX_PLAYERS];
- new AbasTexaco[MAX_PLAYERS];
- new SavePlayerPos[MAX_PLAYERS][SavePlayerPosEnum];
- new UpdateSeconds = 1;
- new Float:CarroMotor;
- new string[256];
- new Float:x1;
- new Float:y1;
- new Float:z1;
- new Float:x2;
- new Float:y2;
- new Float:z2;
- new spe;
- new Float:pos[4];
- new Petrobrasup;
- new Texacoup;
- new PrecoPetro;
- new PrecoTexaco;
- new Float:x;
- new Float:y;
- new Float:z;
- new Float:Distancia;
- new TempoVelocimetro;
- new Valor;
- new Modelos[][] ={"Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial",
- "Sentinel","Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
- "Voodoo", "Pony", "Mule", "Cheetah", "Ambulancia", "Leviathan", "Moonbeam",
- "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
- "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
- "Rhino", "Barracks", "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", "Boxvillde", "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", "Stratium",
- "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",
- "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
- "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Carro Policial",
- "Carro Policial", "Carro Policial", "Ranger Policial", "Picador", "S.W.A.T", "Alpha",
- "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
- "Tiller", "Utility Trailer"
- };
- public OnPlayerConnect(playerid)
- {
- CSEG[playerid] = 0;
- return 1;
- }
- public RetirarlogoasTextDraw(playerid)
- {
- TextDrawHideForPlayer(playerid,Velocidade);
- TextDrawHideForPlayer(playerid,Modelo);
- TextDrawHideForPlayer(playerid,Gasolina);
- TextDrawHideForPlayer(playerid,Motor);
- TextDrawHideForPlayer(playerid,Cinto);
- return 1;
- }
- public OnFilterScriptInit()
- {
- print("------------------[VELOCITACHI 0.1]------------------");
- print("Velocitachi: Ok");
- print("Cinto de Segurança: Ok");
- print("Gasolina System: Ok");
- print("Petrobras: Ok");
- print("Texaco: Ok");
- print("Petrobras: Ok");
- print("Capacete: Ok");
- print("---------------FS By hitachi_uchila------------------");
- print("Digite /velocitachi in game para ver os Creditos");
- for(new c = 0;c < MAX_VEHICLES;c++)
- {
- Gas[c] = GasMax;
- }
- TempoVeiculoparado = SetTimer("Veiculoparado", RunOutTime, 1);
- TempoChecargas = SetTimer("Checargas", RunOutTime, 1);
- TempoVelocimetro = SetTimer("Velocimetro",500,1);
- Fundo = TextDrawCreate(640.000000, 102.000000," ~n~ ~n~ ~n~ ~n~ ");
- TextDrawBackgroundColor(Fundo,255);
- TextDrawFont(Fundo,1);
- TextDrawLetterSize(Fundo, 0.300000, 0.800000);
- TextDrawColor(Fundo, -1);
- TextDrawSetOutline(Fundo,0);
- TextDrawSetProportional(Fundo,0);
- TextDrawUseBox(Fundo,1);
- TextDrawBoxColor(Fundo,1010580610);
- TextDrawTextSize(Fundo,482.000000, 405.000000);
- Velocidade = TextDrawCreate(488.000000, 131.000000, "Velocidade: ~w~");
- TextDrawBackgroundColor(Velocidade, 255);
- TextDrawFont(Velocidade, 1);
- TextDrawLetterSize(Velocidade, 0.400000, 1.000000);
- TextDrawColor(Velocidade, -16776961);
- TextDrawSetOutline(Velocidade, 0);
- TextDrawSetProportional(Velocidade, 1);
- TextDrawSetShadow(Velocidade, 1);
- Modelo = TextDrawCreate(486.000000, 101.000000, "Modelo: ~w~");
- TextDrawBackgroundColor(Modelo, 255);
- TextDrawFont(Modelo, 1);
- TextDrawLetterSize(Modelo, 0.400000, 1.000000);
- TextDrawColor(Modelo, -16776961);
- TextDrawSetOutline(Modelo, 0);
- TextDrawSetProportional(Modelo, 1);
- TextDrawSetShadow(Modelo, 1);
- Gasolina = TextDrawCreate(487.000000, 121.000000, "Gasolina:~w~");
- TextDrawBackgroundColor(Gasolina, 255);
- TextDrawFont(Gasolina, 1);
- TextDrawLetterSize(Gasolina, 0.400000, 1.000000);
- TextDrawColor(Gasolina, -16776961);
- TextDrawSetOutline(Gasolina, 0);
- TextDrawSetProportional(Gasolina, 1);
- TextDrawSetShadow(Gasolina, 1);
- Motor = TextDrawCreate(487.000000, 111.000000, "Motor: ~w~");
- TextDrawBackgroundColor(Motor, 255);
- TextDrawFont(Motor, 1);
- TextDrawLetterSize(Motor, 0.400000, 1.000000);
- TextDrawColor(Motor, -16776961);
- TextDrawSetOutline(Motor, 0);
- TextDrawSetProportional(Motor, 1);
- TextDrawSetShadow(Motor, 1);
- Cinto = TextDrawCreate(489.000000, 140.000000, "Cinto: ");
- TextDrawBackgroundColor(Cinto, 255);
- TextDrawFont(Cinto, 1);
- TextDrawLetterSize(Cinto, 0.400000, 1.000000);
- TextDrawColor(Cinto, -16776961);
- TextDrawSetOutline(Cinto, 0);
- TextDrawSetProportional(Cinto, 1);
- TextDrawSetShadow(Cinto, 1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- KillTimer(TempoVeiculoparado);
- KillTimer(TempoChecargas);
- KillTimer(TempoVelocimetro);
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- CSEG[playerid] = 0;
- if(IsABike(GetPlayerVehicleID(playerid)))
- {
- Capacete(playerid);
- SetTimerEx("Capacete", 3000, 0, "i", playerid);
- SendClientMessage(playerid,VERMELHO,"[SERVER] Use /capacete para colocar! ");
- GameTextForPlayer(playerid, "~y~Coloque ~n~ o ~n~ ~g~Capacete", 3000, 4);
- TextDrawShowForPlayer(playerid,Modelo);
- TextDrawShowForPlayer(playerid,Velocidade);
- TextDrawShowForPlayer(playerid,Motor);
- TextDrawShowForPlayer(playerid,Gasolina);
- TextDrawShowForPlayer(playerid,Fundo);
- TextDrawShowForPlayer(playerid,Cinto);
- }
- else
- {
- SendClientMessage(playerid,VERMELHO,"[SERVER] Use /cinto para colocar! ");
- GameTextForPlayer(playerid, "~y~Coloque ~n~ o ~n~ ~g~Cinto de Seguranca", 3000, 4);
- TextDrawShowForPlayer(playerid,Modelo);
- TextDrawShowForPlayer(playerid,Velocidade);
- TextDrawShowForPlayer(playerid,Motor);
- TextDrawShowForPlayer(playerid,Gasolina);
- TextDrawShowForPlayer(playerid,Fundo);
- TextDrawShowForPlayer(playerid,Cinto);
- }
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- RetirarlogoasTextDraw(playerid);
- TextDrawHideForPlayer(playerid,Modelo);
- TextDrawHideForPlayer(playerid,Fundo);
- TextDrawHideForPlayer(playerid,Velocidade);
- TextDrawHideForPlayer(playerid,Gasolina);
- TextDrawHideForPlayer(playerid,Motor);
- Capacete(playerid);
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(CSEG[playerid] == 0)
- {
- Capacete(playerid);
- }
- }
- else
- {
- Capacete(playerid);
- RetirarlogoasTextDraw(playerid);
- }
- return 1;
- }
- public OnVehicleDamageStatusUpdate(vehicleid, playerid)
- {
- new Acidente = floatround(Valor/1600);
- if(Acidente > 16)
- {
- if(CSEG[playerid] == 0)
- {
- new Float:VIDA,Float:TakiX,Float:TakiY,Float:TakiZ;
- GetPlayerHealth(playerid, VIDA);
- SetPlayerHealth(playerid, VIDA-25.0);
- SendClientMessage(playerid,VERMELHO,"[SERVER] Voce bateu e esse Acidente foi feio, Voce deve estar meio zomzo! ");
- SetTimerEx("Tontura", 30000, 0, "i", playerid);
- SetPlayerDrunkLevel(playerid, 500000);
- if(VelocidadeKM(playerid) >= 120)
- {
- SendClientMessage(playerid,VERMELHO,"[SERVER] Voce bateu tão forte que seu carro explodiu! ");
- CreateExplosion(TakiX, TakiY, TakiZ, 6, 10);
- CreateExplosion(TakiX-2,TakiY-2,TakiZ+1, 0, 4.5);
- RemovePlayerFromVehicle(playerid);
- GetPlayerPos(playerid, TakiX,TakiY,TakiZ);
- SetPlayerPos(playerid, TakiX-17,TakiY-8,TakiZ-15);
- }
- }
- else
- {
- SetTimerEx("Tontura", 30000, 0, "i", playerid);
- SetPlayerDrunkLevel(playerid, 1000);
- new Float:VIDA;
- GetPlayerHealth(playerid, VIDA);
- SetPlayerHealth(playerid, VIDA-3.0);
- }
- }
- return 1;
- }
- public Tontura(playerid)
- {
- SetPlayerDrunkLevel(playerid, 0);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/abastecer", true)){
- if(IsPlayerConnected(playerid)){
- if(Petrobras(playerid)){
- GameTextForPlayer(playerid,"~y~Aguarde Enquanto o Frentista Reabastece seu Veiculo!",2000,3);
- SetTimer("APetrobras",Abastecendo,0);
- AbasPetro[playerid] = 1;}
- if(Texaco(playerid)){
- GameTextForPlayer(playerid,"~r~Aguarde Enquanto o Frentista Reabastece seu Veiculo!",2000,3);
- SetTimer("ATexaco",Abastecendo,0);
- AbasTexaco[playerid] = 1;}
- else{
- SendClientMessage(playerid,0xAFAFAFAA," Voce pode Comprar mais Gasolina Apenas em Postos!");}}
- return 1;}
- if(!strcmp(cmdtext, "/cinto", true)){
- if(IsPlayerInAnyVehicle(playerid)){
- if(CSEG[playerid] == 1)
- {
- SendClientMessage(playerid,AZUL,"[SERVER] Cinto de Segurança Retirado!");
- CSEG[playerid] = 0;
- return 1;
- }
- if(CSEG[playerid] == 0)
- {
- SendClientMessage(playerid,AZUL,"[SERVER] Cinto de Segurança Colocado!");
- CSEG[playerid] = 1;
- }
- return 1;}}
- if(!strcmp(cmdtext, "/capacete", true)){
- if(IsABike(GetPlayerVehicleID(playerid))){
- if(CSEG[playerid] == 1)
- {
- SendClientMessage(playerid,AZUL,"[SERVER] Capacete Retirado!");
- Capacete(playerid);
- CSEG[playerid] = 0;
- return 1;
- }
- if(CSEG[playerid] == 0)
- {
- SendClientMessage(playerid,AZUL,"[SERVER] Capacete Colocado!");
- TogglePlayerControllable(playerid, 0);
- ApplyAnimation(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0);
- SetTimerEx("Colocarcapacete", 4500, 0, "i", playerid);
- CSEG[playerid] = 1;
- }
- return 1;}}
- if(!strcmp(cmdtext, "/velocitachi", true))
- {
- SendClientMessage(playerid,AZUL,"____________________CREDITOS_____________________");
- SendClientMessage(playerid,0xAFAFAFAA,"Cinto de Segurança: hitachi_uchila");
- SendClientMessage(playerid,0xAFAFAFAA,"Velocimetro: hitachi_uchila");
- SendClientMessage(playerid,0xAFAFAFAA,"Capacete: Não Lembro Aperfeiçoado por: hitachi_uchila");
- SendClientMessage(playerid,0xAFAFAFAA,"Cinto de Segurança: hitachi_uchila");
- SendClientMessage(playerid,0xAFAFAFAA,"Posto de Gasolina : hitachi_uchila");
- SendClientMessage(playerid,0xAFAFAFAA,"Stock De Getar A Velocidade : Dark Team PT");
- return 1;}
- return 0;
- }
- forward Colocarcapacete(playerid);
- public Colocarcapacete(playerid)
- {
- new newstate;
- new oldstate;
- OnPlayerStateChange(playerid,newstate,oldstate);
- TogglePlayerControllable(playerid, 1);
- if(IsABike(GetPlayerVehicleID(playerid)))
- {
- switch(GetPlayerSkin(playerid))
- {
- #define SPAO{%0,%1,%2,%3,%4,%5} SetPlayerAttachedObject(playerid, SLOT, 18645, 2, (%0), (%1), (%2), (%3), (%4), (%5));
- case 0, 65, 74, 149, 208, 273: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 75.000000, 0.000000}
- case 1..6, 8, 14, 16, 22, 27, 29, 33, 41..49, 82..84, 86, 87, 119, 289: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 77.000000, 0.000000}
- case 7, 10: SPAO{0.090000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
- case 9: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
- case 11..13: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
- case 15: SPAO{0.059999, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
- case 17..21: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 23..26, 28, 30..32, 34..39, 57, 58, 98, 99, 104..118, 120..131: SPAO{0.079999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 40: SPAO{0.050000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 50, 100..103, 148, 150..189, 222: SPAO{0.070000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 51..54: SPAO{0.100000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 55, 56, 63, 64, 66..73, 75, 76, 78..81, 133..143, 147, 190..207, 209..219, 221, 247..272, 274..288, 290..293: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 59..62: SPAO{0.079999, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 77: SPAO{0.059999, 0.019999, 0.000000, 87.000000, 82.000000, 0.000000}
- case 85, 88, 89: SPAO{0.070000, 0.039999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 90..97: SPAO{0.050000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 132: SPAO{0.000000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 144..146: SPAO{0.090000, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
- case 220: SPAO{0.029999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 223, 246: SPAO{0.070000, 0.050000, 0.000000, 88.000000, 82.000000, 0.000000}
- case 224..245: SPAO{0.070000, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 294: SPAO{0.070000, 0.019999, 0.000000, 91.000000, 84.000000, 0.000000}
- case 295: SPAO{0.050000, 0.019998, 0.000000, 86.000000, 82.000000, 0.000000}
- case 296..298: SPAO{0.064999, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 299: SPAO{0.064998, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- RetirarlogoasTextDraw(playerid);
- RemovePlayerFromVehicle(playerid);
- TextDrawHideForPlayer(playerid,Modelo);
- TextDrawHideForPlayer(playerid,Fundo);
- TextDrawHideForPlayer(playerid,Velocidade);
- TextDrawHideForPlayer(playerid,Gasolina);
- TextDrawHideForPlayer(playerid,Motor);
- Capacete(playerid);
- return 1;
- }
- public Velocimetro()
- {
- for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
- {
- if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
- {
- format(string,sizeof(string),"Modelo: ~w~%s", Modelos[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
- TextDrawSetString(Modelo, string);
- TextDrawShowForPlayer(playerid, Modelo);
- GetVehicleHealth(GetPlayerVehicleID(playerid), CarroMotor);
- TextDrawHideForPlayer(playerid, Motor);
- format(string,sizeof(string),"Motor: ~w~ %0.0f%%", CarroMotor);
- TextDrawSetString(Motor, string);
- TextDrawShowForPlayer(playerid, Motor);
- format(string,sizeof(string),"Gasolina:~w~ %d% Lts", Gas[GetPlayerVehicleID(playerid)]);
- TextDrawSetString(Gasolina, string);
- TextDrawShowForPlayer(playerid, Gasolina);
- format(string,sizeof(string),"Velocidade:~w~%d Km/h", VelocidadeKM(playerid));
- TextDrawSetString(Velocidade, string);
- TextDrawShowForPlayer(playerid, Velocidade);
- if(CSEG[playerid] == 0){
- TextDrawSetString(Cinto, "Cinto:~w~ Nao");
- TextDrawShowForPlayer(playerid, Cinto);}
- if(CSEG[playerid] == 1){
- TextDrawSetString(Cinto, "Cinto:~g~Sim");
- TextDrawShowForPlayer(playerid, Cinto);}
- if(IsABike(GetPlayerVehicleID(playerid))){
- if(CSEG[playerid] == 1){
- TextDrawSetString(Cinto, "Capacete:~g~Sim");
- TextDrawShowForPlayer(playerid, Cinto);}
- if(CSEG[playerid] == 0){
- TextDrawSetString(Cinto, "Capacete:~w~ Nao");
- TextDrawShowForPlayer(playerid, Cinto);}}
- }
- else
- {
- RetirarlogoasTextDraw(playerid);
- TextDrawHideForPlayer(playerid,Velocidade);
- TextDrawHideForPlayer(playerid,Modelo);
- TextDrawHideForPlayer(playerid,Gasolina);
- TextDrawHideForPlayer(playerid,Motor);
- TextDrawHideForPlayer(playerid,Cinto);
- }
- }
- }
- public Float:GetDistanceBetweenPlayerToPoint(p1,Float:px,Float:py,Float:pz)
- {
- if(!IsPlayerConnected(p1))
- return -1.00;
- GetPlayerPos(p1,x1,y1,z1);
- x2 = px;
- y2 = py;
- z2 = pz;
- return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
- }
- public Petrobras(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsPlayerInRangeOfPoint(playerid,15.0,1004.0070,-939.3102,42.1797) || IsPlayerInRangeOfPoint(playerid,15.0,1944.3260,-1772.9254,13.3906))
- {//LS
- return 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid,15.0,2202.2349,2474.3494,10.5258) || IsPlayerInRangeOfPoint(playerid,15.0,614.9333,1689.7418,6.6968))
- {//LV
- return 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid,15.0,2113.7390,920.1079,10.5255) || IsPlayerInRangeOfPoint(playerid,15.0,-1327.7218,2678.8723,50.0625))
- {//LV
- return 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid,15.0,-2029.4968,156.4366,28.9498) || IsPlayerInRangeOfPoint(playerid,15.0,-2408.7590,976.0934,45.4175))
- {//SF
- return 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid,15.0,-2243.9629,-2560.6477,31.8841) || IsPlayerInRangeOfPoint(playerid,15.0,-1676.6323,414.0262,6.9484))
- {//Between LS and SF
- return 1;
- }
- }
- return 0;
- }
- public Texaco(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsPlayerInRangeOfPoint(playerid,15.0,-1328.8250,2677.2173,49.7665) || IsPlayerInRangeOfPoint(playerid,15.0,70.3882,1218.6783,18.5165))
- {//LV
- return 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid,15.0,2146.5759,2750.8442,10.6447) || IsPlayerInRangeOfPoint(playerid,15.0,2146.8779,2739.6157,10.6435))
- {//LV2
- return 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid,15.0,-90.5515,-1169.4578,2.4079) || IsPlayerInRangeOfPoint(playerid,15.0,-1609.7958,-2718.2048,48.5391))
- {//LS
- return 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid,15.0,1595.3046,2191.1331,10.6454) || IsPlayerInRangeOfPoint(playerid,15.0,1596.3274,2206.7070,10.6449))
- {//LV3
- return 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid,15.0,-736.9305,2742.6138,47.0158))
- {//Landtankstelle
- return 1;
- }
- }
- return 0;
- }
- public Checargas()
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- if(IsPlayerConnected(i))
- {
- if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
- {
- if(Gas[GetPlayerVehicleID(i)] >= 1)
- {
- Gas[GetPlayerVehicleID(i)]--;
- }
- }
- }
- }
- return 1;
- }
- public Veiculoparado()
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(IsPlayerInAnyVehicle(i))
- {
- GetPlayerPos(i, x, y, z);
- Distancia = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
- Valor = floatround(Distancia * 3600);
- if(UpdateSeconds > 1)
- {
- Valor = floatround(Valor / UpdateSeconds);
- }
- if(Valor == 0)
- {
- Gas[GetPlayerVehicleID(i)]++;
- }
- SavePlayerPos[i][LastX] = x;
- SavePlayerPos[i][LastY] = y;
- SavePlayerPos[i][LastZ] = z;
- }
- }
- }
- return 1;
- }
- public APetrobras()
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- Petrobrasup = GasMax - Gas[GetPlayerVehicleID(i)];
- if(AbasPetro[i] == 1)
- {
- PrecoPetro = Petrobrasup * 10;
- if(GetPlayerMoney(i) >= PrecoPetro)
- {
- Gas[GetPlayerVehicleID(i)] += Petrobrasup;
- format(string,sizeof(string),"[PETROBRAS]Enchemos o seu Tanque Por Apenas R$%d!",PrecoPetro);
- SendClientMessage(i,AMARELO,string);
- SendClientMessage(i,AMARELO,"A Petrobras Agradeçe a Sua Preferencia! VOLTE SEMPRE !");
- GivePlayerMoney(i,-PrecoPetro);
- if(PrecoPetro > 0)
- PrecoPetro = 0;
- AbasPetro[i] = 0;
- }
- else
- {
- format(string,sizeof(string),"[PETROBRAS]Você Precisa de R$%d para encher o Tanque!",PrecoPetro);
- SendClientMessage(i,AMARELO,string);
- }
- }
- }
- }
- return 1;
- }
- public ATexaco()
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- Texacoup = GasMax - Gas[GetPlayerVehicleID(i)];
- if(AbasTexaco[i] == 1)
- {
- PrecoTexaco = Texacoup * 10;
- if(GetPlayerMoney(i) >= PrecoTexaco)
- {
- Gas[GetPlayerVehicleID(i)] += Texacoup;
- format(string,sizeof(string),"[TEXACO]Enchemos o seu Tanque Por Apenas R$%d!",PrecoTexaco);
- SendClientMessage(i,VERMELHO,string);
- GivePlayerMoney(i,-PrecoTexaco);
- if(PrecoTexaco > 0)
- PrecoTexaco = 0;
- AbasTexaco[i] = 0;
- }
- else
- {
- format(string,sizeof(string),"[TEXACO]Você Precisa de R$%d para encher o Tanque!",PrecoTexaco);
- SendClientMessage(i,VERMELHO,string);
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate) //All this made Hiddos, so credits to him :D
- {
- if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
- {
- if(IsABike(GetPlayerVehicleID(playerid)))
- {
- switch(GetPlayerSkin(playerid))
- {
- #define SPAO{%0,%1,%2,%3,%4,%5} SetPlayerAttachedObject(playerid, SLOT, 18645, 2, (%0), (%1), (%2), (%3), (%4), (%5));
- case 0, 65, 74, 149, 208, 273: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 75.000000, 0.000000}
- case 1..6, 8, 14, 16, 22, 27, 29, 33, 41..49, 82..84, 86, 87, 119, 289: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 77.000000, 0.000000}
- case 7, 10: SPAO{0.090000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
- case 9: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
- case 11..13: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
- case 15: SPAO{0.059999, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
- case 17..21: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 23..26, 28, 30..32, 34..39, 57, 58, 98, 99, 104..118, 120..131: SPAO{0.079999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 40: SPAO{0.050000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 50, 100..103, 148, 150..189, 222: SPAO{0.070000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 51..54: SPAO{0.100000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 55, 56, 63, 64, 66..73, 75, 76, 78..81, 133..143, 147, 190..207, 209..219, 221, 247..272, 274..288, 290..293: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 59..62: SPAO{0.079999, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 77: SPAO{0.059999, 0.019999, 0.000000, 87.000000, 82.000000, 0.000000}
- case 85, 88, 89: SPAO{0.070000, 0.039999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 90..97: SPAO{0.050000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 132: SPAO{0.000000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 144..146: SPAO{0.090000, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
- case 220: SPAO{0.029999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 223, 246: SPAO{0.070000, 0.050000, 0.000000, 88.000000, 82.000000, 0.000000}
- case 224..245: SPAO{0.070000, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 294: SPAO{0.070000, 0.019999, 0.000000, 91.000000, 84.000000, 0.000000}
- case 295: SPAO{0.050000, 0.019998, 0.000000, 86.000000, 82.000000, 0.000000}
- case 296..298: SPAO{0.064999, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
- case 299: SPAO{0.064998, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
- }
- }
- }
- else
- {
- }
- return 1;
- }
- public Capacete(playerid){
- RemovePlayerAttachedObject(playerid, SLOT);
- return 1;}
- stock IsABike(vehicleid) //Made by me :D
- {
- new result;
- new model = GetVehicleModel(vehicleid);
- switch(model)
- {
- case 509, 481, 510, 462, 448, 581, 522, 461, 521, 523, 463, 586, 468, 471: result = model;
- default: result = 0;
- }
- return result;
- }
- stock VelocidadeKM(playerid)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- GetVehicleVelocity(GetPlayerVehicleID(playerid), pos[0], pos[1], pos[2]);
- pos[3] = floatmul(floatsqroot(floatadd(floatadd(floatpower(pos[0], 2), floatpower(pos[1], 2)), floatpower(pos[2], 2))), 170.0);
- spe = floatround(pos[3] * 1);
- }
- else
- return false;
- return spe;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement