Scripting help: Getvehiclename
#1

hello, I need some help from the expert about what function should I input at vehiclename.


Код:
new CarNames[][cartypes] =
{
	{416,"ambulan"},
	{445,"admiral"},
	{602,"alpha"},
	{485,"baggage"},
	{568,"bandito"},
	{429,"banshee"},
	{499,"benson"},
	{424,"bfinject"},
	{536,"blade"},
	{496,"blistac"},
	{504,"bloodra"},
	{422,"bobcat"},
	{609,"boxburg"},
	{498,"boxville"},
	{401,"bravura"},
	{575,"broadway"},
	{518,"buccanee"},
	{402,"buffalo"},
	{541,"bullet"},
	{482,"burrito"},
	{431,"bus"},
	{438,"cabbie"},
	{457,"caddy"},
	{527,"cadrona"},
	{483,"camper"},
	{524,"cement"},
	{415,"cheetah"},
	{542,"clover"},
	{589,"club"},
	{480,"comet"},
	{596,"copcarla"},
	{599,"copcarru"},
	{597,"copcarsf"},
	{598,"copcarvg"},
	{578,"dft30"},
	{486,"dozer"},
	{507,"elegant"},
	{562,"elegy"},
	{585,"emperor"},
	{427,"enforcer"},
	{419,"esperant"},
	{587,"euros"},
	{490,"fbiranch"},
	{528,"fbitruck"},
	{533,"feltzer"},
	{544,"firela"},
	{407,"firetruck"},
	{565,"flash"},
	{455,"flatbed"},
	{530,"forklift"},
	{526,"fortune"},
	{466,"glendale"},
	{604,"glenshit"},
	{492,"greenwoo"},
	{474,"hermes"},
	{434,"hotknife"},
	{502,"hotrina"},
	{503,"hotrinb"},
	{494,"hotring"},
	{579,"huntley"},
	{545,"hustler"},
	{411,"infernus"},
	{546,"intruder"},
	{559,"jester"},
	{508,"journey"},
	{571,"kart"},
	{400,"landstal"},
	{403,"linerun"},
	{517,"majestic"},
	{410,"manana"},
	{551,"merit"},
	{500,"mesa"},
	{418,"moonbeam"},
	{572,"mower"},
	{423,"mrwhoop"},
	{516,"nebula"},
	{582,"newsvan"},
	{467,"oceanic"},
	{404,"peren"},
	{514,"petro"},
	{603,"phoenix"},
	{600,"picador"},
	{413,"pony"},
	{426,"premier"},
	{436,"previon"},
	{547,"primo"},
	{489,"rancher"},
	{441,"rcbandit"},
	{594,"rccam"},
	{564,"rctiger"},
	{515,"rdtrain"},
	{479,"regina"},
	{534,"remingtn"},
	{505,"rnchlure"},
	{442,"romero"},
	{440,"rumpo"},
	{475,"sabre"},
	{543,"sadler"},
	{605,"sadlshit"},
	{495,"sandking"},
	{567,"savanna"},
	{428,"securica"},
	{405,"sentinel"},
	{535,"slamvan"},
	{458,"solair"},
	{580,"stafford"},
	{439,"stallion"},
	{561,"stratum"},
	{409,"stretch"},
	{560,"sultan"},
	{550,"sunrise"},
	{506,"supergt"},
	{601,"swatvan"},
	{574,"sweeper"},
	{566,"tahoma"},
	{549,"tampa"},
	{420,"taxi"},
	{459,"topfun"},
	{576,"tornado"},
	{583,"tug"},
	{451,"turismo"},
	{558,"uranus"},
	{552,"utility"},
	{540,"vincent"},
	{491,"virgo"},
	{412,"voodoo"},
	{478,"walton"},
	{421,"washing"},
	{529,"willard"},
	{555,"windsor"},
	{456,"yankee"},
	{554,"yosemite"},
	{477,"zr3"},
// ================== BIKES =======
	{581,"bf400"},
	{523,"copbike"},
	{462,"faggio"},
	{521,"fcr900"},
	{463,"freeway"},
	{522,"nrg500"},
	{461,"pcj600"},
	{448,"pizzaboy"},
	{468,"sanchez"},
	{586,"wayfarer"},
	{509,"bike"},
	{481,"bmx"},
	{510,"mtbike"},
	{471,"quad"},
// ================== SEA =======
	{472,"coastg"},
	{473,"dinghy"},
	{493,"jetmax"},
	{595,"launch"},
	{484,"marquis"},
	{430,"predator"},
	{453,"reefer"},
	{452,"speeder"},
	{446,"squalo"},
	{454,"tropic"},
// ================== AIR =======
	{548,"gobob"},
	{425,"hunter"},
	{417,"leviathn"},
	{487,"maverick"},
	{497,"polmav"},
	{563,"raindanc"},
	{501,"rcgoblin"},
	{465,"rcraider"},
	{447,"seaspar"},
	{469,"sparrow"},
	{488,"vcnmav"},
	{592,"androm"},
	{577,"at400"},
	{511,"beagle"},
	{512,"cropdust"},
	{593,"dodo"},
	{520,"hydra"},
	{553,"nevada"},
	{464,"rcbaron"},
	{476,"rustler"},
	{519,"shamal"},
	{460,"skimmer"},
	{513,"stunt"},
	{539,"vortex"},
// ================== HEAVY =======
	{588,"hotdog"},
	{437,"coach"},
	{532,"combine"},
	{433,"barracks"},
	{414,"mule"},
	{443,"packer"},
	{470,"patriot"},
	{432,"rhino"},
	{525,"towtruck"},
	{531,"tractor"},
	{408,"trash"},
	{406,"dumper"},
	{573,"duneride"},
	{444,"monster"},
	{556,"monstera"},
	{557,"monsterb"},
	{435,"artict1"},
	{450,"artict2"},
	{591,"artict3"},
	{606,"bagboxa"},
	{607,"bagboxb"},
	{610,"farmtr1"},
	{584,"petrotr"},
	{608,"tugstair"},
	{611,"utiltr1"},
	{590,"freibox"},
	{569,"freiflat"},
	{537,"freight"},
	{538,"streak"},
	{570,"streakc"},
	{449,"tram"}
};
Код:
format(string, sizeof(string), "6[VEHICLE] %s has bought a %s for $%s from the %s!", PlayerName(playerid), GetVehicleName(GetPlayerVehicleID(playerid)), number_format(bikes[listitem][bikeprice]), biz[tmpid][bizname]);
				iEcho(string);
			    return 1;
Reply
#2

Use an Enum like :

pawn Код:
enum cartypes
{
    CarModel, // Holds the model-ID of the car
        CarName[50] // Holds the name of the car
}
Then you can use it like :

pawn Код:
format(string, sizeof(string), "6[VEHICLE] %s has bought a %s for $%s from the %s!", PlayerName(playerid), CarNames[GetPlayerVehicleID(playerid)][CarName], number_format(bikes[listitem][bikeprice]), biz[tmpid][bizname]);
Hopefully it works!
Reply
#3

Hello!

Take this enum from the user before me, and this row has to be like this:
PHP код:
format(stringsizeof(string), "6[VEHICLE] %s has bought a %s for $%s from the %s!"PlayerName(playerid), CarNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400][CarName], number_format(bikes[listitem][bikeprice]), biz[tmpid][bizname]); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)