Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- #include progress
- enum pINFO {
- Bar:E_FUEL,
- Bar:E_VCARRO,
- Bar:E_LOADSV,
- }
- new
- Text:VelocimetroCR[ MAX_PLAYERS ],
- pData[ MAX_PLAYERS] [ pINFO ],
- pZolina[MAX_VEHICLES],
- VehicleNames[212][] =
- {
- {"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},
- {"Dumper"},{"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},
- {"Pony"},{"Mule"},{"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},
- {"Washington"},{"Bobcat"},{"Mr. Whoopee"},{"BF. Injection"},{"Hunter"},{"Premier"},{"Enforcer"},
- {"Securicar"},{"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Article Trailer"},
- {"Previon"},{"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
- {"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Article Trailer 2"},{"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"},{"Cropdust"},{"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 LA"},{"Hustler"},{"Intruder"},
- {"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},{"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},
- {"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},{"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},
- {"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},{"Bandito"},{"Freight Flat"},{"Streak Carriage"},
- {"Kart"},{"Mower"},{"Dunerider"},{"Sweeper"},{"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},
- {"Stafford"},{"BF-400"},{"Newsvan"},{"Tug"},{"Article Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Mobile Hotdog"},
- {"Club"},{"Freight Carriage"},{"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},
- {"Police Car (SFPD)"},{"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T Van"},{"Alpha"},
- {"Phoenix"},{"Glendale"},{"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},
- {"Boxville"},{"Farm Plow"},{"Utility Trailer"}
- }
- ;
- public OnFilterScriptInit(){
- SetTimer("GasolinaBus", 10000, true);
- for(new i; i != MAX_PLAYERS; ++i){
- VelocimetroCR[i] = TextDrawCreate(472.000000, 403.000000, "Infernus");
- TextDrawBackgroundColor(VelocimetroCR[i], 255);
- TextDrawFont(VelocimetroCR[i], 2);
- TextDrawLetterSize(VelocimetroCR[i], 0.210000, 0.900000);
- TextDrawColor(VelocimetroCR[i], -1);
- TextDrawSetOutline(VelocimetroCR[i], 1);
- TextDrawSetProportional(VelocimetroCR[i], 1);
- }
- return true;
- }
- public OnPlayerConnect(playerid){
- pData[playerid][E_VCARRO] = CreateProgressBar(474.00, 413.00, 133.50, 7.19, -16776961, 100.0);
- pData[playerid][E_FUEL] = CreateProgressBar(474.00, 426.00, 133.50, 3.20, -16776961, 100.0);
- SetProgressBarMaxValue(pData[playerid][E_VCARRO], 300);
- return true;
- }
- public OnPlayerCommandText(playerid, cmdtext[]){
- if(!strcmp(cmdtext,"/abastecer", true)){
- if(!IsPlayerInAnyVehicle(playerid)){
- return SendClientMessage(playerid, -1, "Você não está em nenhum veículo!");
- }
- if(pZolina[GetPlayerVehicleID(playerid)] >= 100){
- return SendClientMessage(playerid, -1, "O Tanque já está cheio!");
- }
- pZolina[GetPlayerVehicleID(playerid)] += 50;
- GivePlayerMoney(playerid, -10000);
- SendClientMessage(playerid, -1, "Você adicionou +50 litros de gasolina! (R$: 10.000)");
- return true;
- }
- return true;
- }
- public OnPlayerUpdate(playerid){
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
- if(pZolina[GetPlayerVehicleID(playerid)] == 0){
- new mot, lu, alar, por, cap, porma, ob;
- GetVehicleParamsEx(GetPlayerVehicleID(playerid), mot, lu, alar, por, cap, porma, ob);
- SetVehicleParamsEx(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
- }else{
- new mot, lu, alar, por, cap, porma, ob;
- GetVehicleParamsEx(GetPlayerVehicleID(playerid), mot, lu, alar, por, cap, porma, ob);
- SetVehicleParamsEx(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
- }
- static vl;
- vl = GetPlayerSpeed(playerid);
- TextDrawSetString(VelocimetroCR[playerid], VehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid)) - 400]);
- TextDrawShowForPlayer(playerid, VelocimetroCR[playerid]);
- SetProgressBarValue(pData[playerid][E_VCARRO], vl);
- UpdateProgressBar(pData[playerid][E_VCARRO], playerid);
- SetProgressBarValue(pData[playerid][E_FUEL], pZolina[GetPlayerVehicleID(playerid)]);
- UpdateProgressBar(pData[playerid][E_FUEL], playerid);
- }else{
- HideProgressBarForPlayer(playerid, pData[playerid][E_VCARRO]);
- HideProgressBarForPlayer(playerid, pData[playerid][E_FUEL]);
- TextDrawHideForPlayer(playerid, VelocimetroCR[playerid]);
- }
- }
- //
- forward GasolinaBus();
- public GasolinaBus(){
- for(new i; i != MAX_PLAYERS; ++i){
- if(IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER){
- if(pZolina[GetPlayerVehicleID(i)] != 0){
- pZolina[GetPlayerVehicleID(i)] -= 5;
- }
- }
- }
- }
- stock GetPlayerSpeed(playerid)
- {
- new Float:ST[4];
- if(IsPlayerInAnyVehicle(playerid))
- GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
- else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
- ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625;
- return floatround(ST[3]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement