12.04.2009, 04:38
Yes, I understand that this is very easy to code. I also understand that similar code is probably easily found elsewhere. But I generally prefer to create my own scripts, and because I needed this, well, here it is. It does nothing more than display the name of a vehicle after a player enters it. Hopefully it saves someone some time.
Edit: If you discover any error with the vehicle names (I can guarantee there's at least one), please let me know.
Main code:
Usage code (to be inserted into OnPlayerStateChange):
Edit: If you discover any error with the vehicle names (I can guarantee there's at least one), please let me know.
Main code:
Код:
new g_vehicle_names[][18] = { //blank strings represent unenterable vehicles "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perennial", "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", "", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "", "Romero", "Packer", "Monster", "Admiral", "Squallo", "Seasparrow", "Pizza Boy", "", "", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "", "", "Glendale", "Oceanic", "Sanchez", "Sparrow", "Patriot", "Quadbike", "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", "", "Hotring Racer", "Hotring Racer", "Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stuntplane", "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV-1000", "Cement Truck", "Tow Truck", "Fortune", "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine Harvester", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Brown Streak", "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Fire Truck", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility Van", "Nevada", "Yosemite", "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "", "Flash", "Tahoma", "Savanna", "Bandito", "", "", "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT400", "DFT-30", "Huntley", "Stafford", "BF-400", "News Van", "Tug", "", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club", "", "", "Andromada", "Dodo", "", "Launch", "Police Car", //Los Santos "Police Car", //San Fierro "Police Car", //Las Venturas "Ranger", "Picador", "SWAT Tank", "Alpha", "Phoenix", "Glendale", "Sadler", "", "", "", "Boxburg" }; display_vehicle_name(player_id) { new vehicle_id = GetPlayerVehicleID(player_id); new vehicle_index = GetVehicleModel(vehicle_id) - 400; GameTextForPlayer(player_id, g_vehicle_names[vehicle_index], 6000, 1); }
Код:
if (newstate == 2) { display_vehicle_name(playerid); }