Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Sa-Mp Include Tacho Helper
- *
- * (c) by Kaliber, 2012
- *
- */
- #include <a_samp>
- #if !defined VERBRENNEN
- #define VERBRENNEN 15
- #endif
- #pragma tabsize 0 //Nur hier in pastebin
- forward _OnPlayerCommandText(playerid,cmdtext[]);
- forward _OnGameModeInit();
- forward Global_Tank();
- static const VehicleName[212][] = {
- "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", "Barracks", "Hotknife",
- "Trailer 1", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo",
- "Seasparrow", "Pizzaboy", "Tram", "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", "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 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", "Dune", "Sweeper", "Broadway",
- "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer 3", "Emperor", "Wayfarer", "Euros", "Hotdog",
- "Club", "Freight Carriage", "Trailer 4", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car (LSPD)", "Police Car (SFPD)",
- "Police Car (LVPD)", "Police Ranger", "Picador", "S.W.A.T", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage Trailer A",
- "Luggage Trailer B", "Stairs", "Boxville", "Tiller", "Utility Trailer" };
- static c_Tank[MAX_VEHICLES];
- stock bool:Tank_Check(vehicleid)
- {
- if(c_Tank[vehicleid] > 0) return true;
- return false;
- }
- stock bool:IsPlayerAtTanke(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 1944.4954,-1772.7089,13.3906)||
- IsPlayerInRangeOfPoint(playerid, 5.0, 1004.2097,-940.1768,42.1797)||
- IsPlayerInRangeOfPoint(playerid, 5.0, 651.8976,-564.9250,16.3359)||
- IsPlayerInRangeOfPoint(playerid, 5.0, -90.8697,-1169.0400,2.4194)||
- IsPlayerInRangeOfPoint(playerid, 5.0, -1605.8799,-2714.1003,48.5335)||
- IsPlayerInRangeOfPoint(playerid, 5.0, -2244.3743,-2561.0940,31.9219)||
- IsPlayerInRangeOfPoint(playerid, 5.0, -2029.6212,156.7755,28.8359)||
- IsPlayerInRangeOfPoint(playerid, 5.0, -1675.8535,413.2264,7.1797)||
- IsPlayerInRangeOfPoint(playerid, 5.0, -2405.9473,976.4783,45.2969)||
- IsPlayerInRangeOfPoint(playerid, 5.0, -1328.2087,2677.4607,50.0625)||
- IsPlayerInRangeOfPoint(playerid, 5.0, -737.0900,2742.5413,47.2266)||
- IsPlayerInRangeOfPoint(playerid, 5.0, 611.6671,1694.5723,6.9922)||
- IsPlayerInRangeOfPoint(playerid, 5.0, 70.5098,1218.7645,18.8123)||
- IsPlayerInRangeOfPoint(playerid, 5.0, -1470.9233,1864.3240,32.6328)||
- IsPlayerInRangeOfPoint(playerid, 5.0, 2149.5557,2747.8027,10.8203)||
- IsPlayerInRangeOfPoint(playerid, 5.0, 2640.1379,1106.3120,10.8203)||
- IsPlayerInRangeOfPoint(playerid, 5.0, 1596.4186,2199.0229,10.8203)||
- IsPlayerInRangeOfPoint(playerid, 5.0, 2202.3293,2474.0010,10.8203)||
- IsPlayerInRangeOfPoint(playerid, 5.0, 2114.8806,920.3449,10.8203)) return true;
- return false;
- }
- stock GetVehicleSpeed(vehicleid)
- {
- new Float:Q[3];
- GetVehicleVelocity(vehicleid,Q[0],Q[1],Q[2]);
- return floatround(floatsqroot(Q[0]*Q[0]+Q[1]*Q[1]+Q[2]*Q[2])*170);
- }
- stock GetVehicleName(vehicleid)
- {
- return VehicleName[GetVehicleModel(vehicleid)-400];
- }
- stock GetTank(vehicleid)
- {
- return c_Tank[vehicleid];
- }
- public OnPlayerCommandText(playerid,cmdtext[])
- {
- if(!strcmp(cmdtext, "/fill", true))
- {
- if(!IsPlayerAtTanke(playerid)) return SendClientMessage(playerid,0xFF0000FF,"Du befindest dich an keiner Tankstelle !");
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF0000FF,"Du befindest dich in keinem Auto !");
- new veh = GetPlayerVehicleID(playerid);
- if(c_Tank[veh] > 50) return SendClientMessage(playerid,0xFF0000FF,"In deinem Tank befinden sich noch mehr als 50% !");
- new liter = 100-c_Tank[veh];
- CallRemoteFunction("OnPlayerTank", "ii", playerid,liter);
- c_Tank[veh] = 100;
- return 1;
- }
- return CallLocalFunction("OnPlayerCommandText","is",playerid,cmdtext);
- }
- #if defined _ALS_OnPlayerCommandText
- #undef OnPlayerCommandText
- #else
- #define _ALS_OnPlayerCommandText
- #endif
- #define OnPlayerCommandText _OnPlayerCommandText
- public OnGameModeInit()
- {
- for(new v; v<MAX_VEHICLES; v++) c_Tank[v] = 100;
- SetTimer("Global_Tank", 1000*VERBRENNEN, 1);
- return CallLocalFunction("OnGameModeInit","");
- }
- #if defined _ALS_OnGameModeInit
- #undef OnGameModeInit
- #else
- #define _ALS_OnGameModeInit
- #endif
- #define OnGameModeInit _OnGameModeInit
- public Global_Tank()
- {
- new v,engine,lights,alarm,doors,bonnet,boot,objective,i;
- for(; v<MAX_VEHICLES; v++) {
- GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
- if(!engine) continue;
- if(c_Tank[v] == 0) {
- SetVehicleParamsEx(v,0,lights,alarm,doors,bonnet,boot,objective);
- for(; i<MAX_PLAYERS; i++) {
- if(!IsPlayerConnected(i) || GetPlayerVehicleID(i) != v) continue;
- CallRemoteFunction("OnVehicleEmpty", "i", i); break; } } continue;
- c_Tank[v]--; }
- return 1;
- }
- forward OnPlayerTank(playerid,liter);
- forward OnVehicleEmpty(playerid);
Advertisement
Add Comment
Please, Sign In to add comment