17.03.2015, 17:17
So, I dun goofed some how...
I was mucking around with a speedo code I was working on (Snippet below that isn't working) and whenever I enter the vehicle, the name is shown as None, and the Speed as 0 KPH, however, I cannot figure out why, some help would be appreciated, cheers.
Code:
Oh, and to clarify, the GetVehicleNameFromModel is fine in other areas, but, just in case:
I was mucking around with a speedo code I was working on (Snippet below that isn't working) and whenever I enter the vehicle, the name is shown as None, and the Speed as 0 KPH, however, I cannot figure out why, some help would be appreciated, cheers.
Code:
Код:
public Speedometer(playerid) { sv[3] = GetVehicleVelocity(GetPlayerVehicleID(playerid),sv[0],sv[1],sv[2]); sv[3] = (floatsqroot(((sv[0]*sv[0])+(sv[1]*sv[1])+(sv[2]*sv[2]))* 181.5)); sv[3] = floatround(sv[3],floatround_round); format(fquery,sizeof(fquery),"Vehicle: %s~n~Speed: %i KPH",GetVehicleNameFromModel(GetVehicleModel(GetPlayerVehicleID(playerid))),sv[3]); PlayerTextDrawSetString(playerid,Speedo[playerid],fquery); return 1; }
Код:
new const VehicleNames[][] = { "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perenniel", "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", "Squallo", "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", "SAN News Maverick", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring Racer", "Sandking", "Blista Compact", "Police Maverick", "Boxville", "Benson", "Mesa", "RC Goblin", "Hotring Racer 2", "Hotring Racer 3", "Bloodring Banger", "Rancher 2", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stuntplane", "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Towtruck", "Fortune", "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine Harvester", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Brownstreak", "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck LA", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility Van", "Nevada", "Yosemite", "Windsor", "Monster A", "Monster B", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat Trailer", "Streak Trailer", "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT400", "DFT-30", "Huntley", "Stafford", "BF-400", "Newsvan", "Tug", "Petrol Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club", "Freight Box Trailer", "Article Trailer 3", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car (LSPD)", "Police Car (SFPD)", "Police Car (LVPD)", "Police Ranger", "Picador", "S.W.A.T.", "Alpha", "Phoenix", "Glendale Shit", "Sadler Shit", "Baggage Trailer A", "Baggage Trailer B", "Tug Stairs Trailer", "Boxville 2", "Farm Trailer", "Utility Trailer" }; stock GetVehicleNameFromModel(modelid) { format(cname,sizeof(cname),"%s",VehicleNames[GetVehicleModel(modelid) - 400]); return cname; }