SA-MP Forums Archive
Listing player owned 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: Listing player owned Vehicles (/showthread.php?tid=417811)



Listing player owned Vehicles - Jonesy96 - 22.02.2013

Hey, I'm having a problem listing the vehicles owned by a player through the database. I want it so when they do /vlist it loops through the database until it's found all vehicles owned by that player and then lists them all.

After I've managed to list it I'm going to edit it so it shows the model name rather than the ID, I'm just using this for test purposes at the moment.

When I run the command in the code tags below, it just loops a bunch of: Model ID - 0

Код:
CMD:vlist(playerid, params[]) {
	new string[128];
	for(new i = 1; i < MAX_VEHICLES; i++)
	{
		if(pvVariables[i][pvOwnerId] == playerVariables[i][pInternalID])
		{
			format(string, 128, "Model ID - %d", pvVariables[playerid][pvModel]);
			SendClientMessage(playerid,COLOR_YELLOW,string);
		}
	}
	return 1;
}
Thanks.


Re: Listing player owned Vehicles - Jonesy96 - 22.02.2013

Still having troubles.