PDA

View Full Version : Veh Names


Micko123
22/12/2016, 09:57 PM
new vID = GetVehicleModel(GetPlayerVehicleID(i));
switch(vID)
{
case 411:
{

Can I somehow instead of vehicle's ID type name of it..??

BiosMarcel
22/12/2016, 10:00 PM
use ******!

judging your "wonderful" sentence, i think u need this.


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", "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", "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", "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", "Police Car",
"Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
"Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
"Tiller", "Utility Trailer"
};

getVehicleName(vehicleid)
{
new carName[30];
format(carName, sizeof(carName),"%s", vehicleNames[GetVehicleModel(vehicleid) - 400]);
return carName;
}

If you want name to id , you ahve to reverse the function, loop thru the array and get the id

CutX
22/12/2016, 10:02 PM
new vID = GetVehicleModel(GetPlayerVehicleID(i));
switch(vID)
{
case 411:
{

Can I somehow instead of vehicle's ID type name of it..??

see my post here: http://forum.sa-mp.com/showthread.php?t=624489
so no, it has to be a constant (or list of constants) following the "case"

Micko123
22/12/2016, 10:03 PM
Okay thx man :)

Vince
22/12/2016, 10:10 PM
You can make an enum of all vehicle names then you can use that. It would purely be for the benefit of the programmer.

enum
{
VEHICLE_LANDSTAL = 400,
VEHICLE_BRAVURA,
VEHICLE_BUFFALO,
// ...
}

ISmokezU
22/12/2016, 10:11 PM
see my post here: http://forum.sa-mp.com/showthread.php?t=624489
so no, it has to be a constant (or list of constants) following the "case"

Click the number behind the hashtag (#) sign next time for a single post. in your case (http://forum.sa-mp.com/showpost.php?p=3814560&postcount=2)

CutX
22/12/2016, 10:15 PM
Click the number behind the hashtag (#) sign next time for a single post. in your case (http://forum.sa-mp.com/showpost.php?p=3814560&postcount=2)

ya i know but i also wanted him to see what Konstantinos posted there after me.
since i wasn't sure of how the things work Konstantinos speaks of there,
i didn't say so specifically but thought @op might know so ill give him the whole thread

so ya, im not sure if it's only relevant for that other thread but apparently,
you can do some neat stuff with streamer which might allow what @op hoped to be abel to do
it's got me curious ever since i read that...