PDA

View Full Version : Simple command fix


lewismichaelbbc
11/06/2012, 08:04 PM
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

ReneG
11/06/2012, 09:07 PM
http://wiki.sa-mp.com/wiki/ShowPlayerDialog