Query id cars
#1

Hi, i have above code , and i want to put every id of cars on "model" , to create a car with specific different pos position from database.

Код:
 mysql_format(1, load_vehicles, "SELECT * FROM `vehicles` WHERE `model` = '%i'", aVehicleNames[i][Model]);
Код:
enum vehicle_names_info
{
	Name[24],
	Model
}

new aVehicleNames[212][vehicle_names_info] =
{
	{"Landstalker", 400},
	{"Bravura", 401},
	{"Buffalo", 402},
	{"Linerunner", 403},
	{"Perrenial", 404},
	{"Sentinel", 405},
	{"Dumper", 406},
	{"Firetruck", 407},
	{"Trashmaster", 408},
	{"Stretch", 409},
	{"Manana", 410},
	{"Infernus", 411},
	{"Voodoo", 412},
	{"Pony", 413},
	{"Mule", 414},
	{"Cheetah", 415},
	{"Ambulance", 416},
	{"Leviathan", 417},
	{"Moonbeam", 418},
	{"Esperanto", 419},
	{"Taxi", 420},
	{"Washington", 421},
	{"Bobcat", 422},
	{"Mr Whoopee", 423},
	{"BF Injection", 424},
	{"Hunter", 425},
	{"Premier", 426},
	{"Enforcer", 427},
	{"Securivehicle", 428},
	{"Banshee", 429},
	{"Predator", 430},
	{"Bus", 431},
	{"Rhino", 432},
	{"Barracks", 433},
	{"Hotknife", 434},
	{"Trailer 1", 435},
	{"Previon", 436},
	{"Coach", 437},
	{"Cabbie", 438},
	{"Stallion", 439},
	{"Rumpo", 440},
	{"RC Bandit", 441},
	{"Romero", 442},
	{"Packer", 443},
	{"Monster", 444},
	{"Admiral", 445},
	{"Squalo", 446},
	{"Seasparrow", 447},
	{"Pizzaboy", 448},
	{"Tram", 449},
	{"Trailer 2", 450},
	{"Turismo", 451},
	{"Speeder", 452},
	{"Reefer", 453},
	{"Tropic", 454},
	{"Flatbed", 455},
	{"Yankee", 456},
	{"Caddy", 457},
	{"Solair", 458},
	{"Berkley's RC Van", 459},
	{"Skimmer", 460},
	{"PCJ-600", 461},
	{"Faggio", 462},
	{"Freeway", 463},
	{"RC Baron", 464},
	{"RC Raider", 465},
	{"Glendale", 466},
	{"Oceanic", 467},
	{"Sanchez", 468},
	{"Sparrow", 469},
	{"Patriot", 470},
	{"Quad", 471},
	{"Coastguard", 472},
	{"Dinghy", 473},
	{"Hermes", 474},
	{"Sabre", 475},
	{"Rustler", 476},
	{"ZR-350", 477},
	{"Walton", 478},
	{"Regina", 479},
	{"Comet", 480},
	{"BMX", 481},
	{"Burrito", 482},
	{"Camper", 483},
	{"Marquis", 484},
	{"Baggage", 485},
	{"Dozer", 486},
	{"Maverick", 487},
	{"News Chopper", 488},
	{"Rancher", 489},
	{"FBI Rancher", 490},
	{"Virgo", 491},
	{"Greenwood", 492},
	{"Jetmax", 493},
	{"Hotring", 494},
	{"Sandking", 495},
	{"Blista Compact", 496},
	{"Police Maverick", 497},
	{"Boxville", 498},
	{"Benson", 499},
	{"Mesa", 500},
	{"RC Goblin", 501},
	{"Hotring Racer A", 502},
	{"Hotring Racer B", 503},
	{"Bloodring Banger", 504},
	{"Rancher", 505},
	{"Super GT", 506},
	{"Elegant", 507},
	{"Journey", 508},
	{"Bike", 509},
	{"Mountain Bike", 510},
	{"Beagle", 511},
	{"Cropdust", 512},
	{"Stunt", 513},
	{"Tanker", 514},
	{"Roadtrain", 515},
	{"Nebula", 516},
	{"Majestic", 517},
	{"Buccaneer", 518},
	{"Shamal", 519},
	{"Hydra", 520},
	{"FCR-900", 521},
	{"NRG-500", 522},
	{"HPV1000", 523},
	{"Cement Truck", 524},
	{"Tow Truck", 525},
	{"Fortune", 526},
	{"Cadrona", 527},
	{"FBI Truck", 528},
	{"Willard", 529},
	{"Forklift", 530},
	{"Tractor", 531},
	{"Combine", 532},
	{"Feltzer", 533},
	{"Remington", 534},
	{"Slamvan", 535},
	{"Blade", 536},
	{"Freight", 537},
	{"Streak", 538},
	{"Vortex", 539},
	{"Vincent", 540},
	{"Bullet", 541},
	{"Clover", 542},
	{"Sadler", 543},
	{"Firetruck LA", 544},
	{"Hustler", 545},
	{"Intruder", 546},
	{"Primo", 547},
	{"vehiclegobob", 548},
	{"Tampa", 549},
	{"Sunrise", 550},
	{"Merit", 551},
	{"Utility", 552},
	{"Nevada", 553},
	{"Yosemite", 554},
	{"Windsor", 555},
	{"Monster A", 556},
	{"Monster B", 557},
	{"Uranus", 558},
	{"Jester", 559},
	{"Sultan", 560},
	{"Stratum", 561},
	{"Elegy", 562},
	{"Raindance", 563},
	{"RC Tiger", 564},
	{"Flash", 565},
	{"Tahoma", 566},
	{"Savanna", 567},
	{"Bandito", 568},
	{"Freight Flat", 569},
	{"Streak vehicleriage", 570},
	{"Kart", 571},
	{"Mower", 572},
	{"Duneride", 573},
	{"Sweeper", 574},
	{"Broadway", 575},
	{"Tornado", 576},
	{"AT-400", 577},
	{"DFT-30", 578},
	{"Huntley", 579},
	{"Stafford", 580},
	{"BF-581", 581},
	{"Newsvan", 582},
	{"Tug", 583},
	{"Trailer 3", 584},
	{"Emperor", 585},
	{"Wayfarer", 586},
	{"Euros", 587},
	{"Hotdog", 588},
	{"Club", 589},
	{"Freight vehicleriage", 590},
	{"Trailer 3", 591},
	{"Andromada", 592},
	{"Dodo", 593},
	{"RC Cam", 594},
	{"Launch", 595},
	{"Police vehicle (LSPD)", 596},
	{"Police vehicle (SFPD)", 597},
	{"Police vehicle (LVPD)", 598},
	{"Police Ranger", 599},
	{"Picador", 600},
	{"S.W.A.T. Van", 601},
	{"Alpha", 602},
	{"Phoenix", 603},
	{"Glendale", 604},
	{"Sadler", 605},
	{"Luggage Trailer A", 606},
	{"Luggage Trailer B", 607},
	{"Stair Trailer", 608},
	{"Boxville", 609},
	{"Farm Plow", 610},
	{"Utility Trailer", 611}
};

forward PersonalVehicles(carid);
public PersonalVehicles(carid)
{
	
	return 1;
}
new model;
forward Load_PersonalVehicles(carid);
public Load_PersonalVehicles(carid)
{
	
	for(new i = 0; i<sizeof(aVehicleNames); i++)
	{
		printf("Name: %s, Model: %i",  aVehicleNames[i][Name],aVehicleNames[i][Model]);
		mysql_format(1, load_vehicles, "SELECT * FROM `vehicles` WHERE `model` = '%i'", aVehicleNames[i][Model]);
		mysql_function_query(1 , load_vehicles, true, "Query_Load_PersoanalVehicles", "d",carid );
	}
	return 1;
}
Код:
forward Query_Load_PersoanalVehicles(carid,i);
public Query_Load_PersoanalVehicles(carid,i)
{
	new Float:carsx,Float:carsy,Float:carsz,Float:carsa;

	cache_get_data(rows_vehicle, fields_vehicle, 1);
	carsx = cache_get_row_float(0, 4);
	carsy = cache_get_row_float(0, 5);
	carsz = cache_get_row_float(0, 6);
	carsa = cache_get_row_float(0, 7);
	
	if(rows_vehicle >= 1)
	{
		CreateVehicle(aVehicleNames[i][Model],carsx, carsy, carsz, carsa, 0, 1, 60);
	}
	else print("Nu s-au gasit vehicule ");
}
Reply
#2

Somebody please?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)