Locating vehicles - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Locating vehicles (
/showthread.php?tid=580628)
Locating vehicles -
Vanter - 06.07.2015
So I want when a player spawns, he finds a list of his vehicles and locations, but lets get to the vehicles only for now and I'll add the locations once I know how to list the vehicles
PHP код:
//That's how I get the vehicle owner/s name, and I know how to match it when a player name
new file[60],vehicleowner[24];
for(new i = 0; i < MAX_VEHICLES_BUILT; i++)
{
format(file,sizeof(file),"Vehicles/%i.ini",i);
if(fexist(file))
{
INI_ParseFile(file, "LoadVehicles_%s", .bExtra = true, .extra = i);
format(vehicleowner, sizeof(vehicleowner), "%s", VInfo[i][Owner]);
//matching with a name
if(strcmp(pName,VInfo[i][Owner]) == 0)
The question here is how to make a list of cars in chat like:
1. Infernus -will addd the location here later
2. Bullet -wl;l add the location here later
3. FCR -........
thank you
Re: Locating vehicles -
Jefff - 06.07.2015
You need have array with vehicle names then in loading
VInfo[i][Model] or for vehicleid VInfo[i][vID] = CreateVehicle(...
and SendClientMessage(playerid,-1, VehicleName[VInfo[i][Model] - 400]);
or
SendClientMessage(playerid,-1, VehicleName[GetVehicleModel(VInfo[i][vID]) - 400]);