Add Player's name to car's name?
#9

pawn Код:
format(pCarName, sizeof(pCarName),"%s'%s", PlayerInfo[playerid][UserName], PlayerInfo[playerid][CarID]); //
This will output the car id not the vehicle's name.

Why not use the GetVehicleName function?


pawn Код:
stock GetVehicleName(vehicleid)
{
    new String[150];
    format(String,sizeof(String),"%s",VehicleNames[GetVehicleModel(vehicleid) - 400]);
    return String;
}


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"
};




This is what I have in my gm, might help you.
pawn Код:
car= Dealership_AddVehicle(DealershipID, vModel, vPaint, vComponents, vX, vY, vZ, vR, C1, C2);
                    new string5[150];
                   
     format(string5,sizeof(string5),"%s's %s" , VehicleData[car][Owner],GetVehicleName(car));
      new Text3D:ownedby = Create3DTextLabel(string5,0x00FF00FF,0.0,0.0,0.0,300.0,0,0);
Reply


Messages In This Thread
Add Player's name to car's name? - by Hyperfire - 12.02.2013, 09:53
Re: Add Player's name to car's name? - by Da_Noob - 12.02.2013, 10:45
Re: Add Player's name to car's name? - by Jstylezzz - 12.02.2013, 11:03
Re: Add Player's name to car's name? - by DrDoom151 - 12.02.2013, 11:07
Re: Add Player's name to car's name? - by Jstylezzz - 12.02.2013, 11:08
Re: Add Player's name to car's name? - by Hyperfire - 12.02.2013, 12:46
Re: Add Player's name to car's name? - by Neil. - 12.02.2013, 12:51
Re: Add Player's name to car's name? - by Hyperfire - 12.02.2013, 20:33
Re: Add Player's name to car's name? - by Neil. - 12.02.2013, 21:07
Re: Add Player's name to car's name? - by Hyperfire - 12.02.2013, 21:38

Forum Jump:


Users browsing this thread: 1 Guest(s)