SA-MP Forums Archive
Simple command fix - 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: Simple command fix (/showthread.php?tid=350225)



Simple command fix - lewismichaelbbc - 11.06.2012

How can i make this car, list all the cars in the dealership system in a dialog?

Код:
dcmd_playerscars(playerid, params[])
{
	new giveplayerid;
	if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /playerscars [playerid]");
	new playername[24];
	GetPlayerName(giveplayerid, playername, sizeof(playername));
	new info[256], bool:found;
	for(new i=1; i < MAX_DVEHICLES; i++)
	{
		if(VehicleCreated[i] == VEHICLE_PLAYER && strcmp(VehicleOwner[i], playername) == 0)
		{
			found = true;
			format(info, sizeof(info), "%sID: %d  Name: %s\n", info, i, VehicleNames[VehicleModel[i]-400]);
		}
	}
	if(!found) return SendClientMessage(playerid, COLOR_RED, "He don't have any vehicles!");
	ShowPlayerDialog(playerid, DIALOG_FINDVEHICLE, DIALOG_STYLE_LIST, "Find his car", info, "Find", "Cancel");
	return 1;
}
Thanks


Re: Simple command fix - ReneG - 11.06.2012

https://sampwiki.blast.hk/wiki/ShowPlayerDialog