31.07.2012, 07:36
Hello, i'm using the component include and I am having a problem with a command I am making,
"ChosenComp[playerid]" always gets the last one in the dialog, I know why it's doing it but I don't know how to stop it. I want it to get whatever component I select and save it to "ChosenComp[playerid]" for use with another part of the command.
Thanks.
pawn Код:
CMD:enter(playerid, params[]) {
if(IsPlayerInRangeOfPoint(playerid, 1.5, 92.5586,-164.7990,2.3208)) {
new component, count=1, String[1500];
while(GetVehicleCompatibleUpgrades(GetVehicleModel(GetPlayerVehicleID(playerid)), count, component))
{
format(String, sizeof String, "%s%s [%d]\n", String, GetComponentName(component), component);
ShowPlayerDialog(playerid, DIALOG_MODS, DIALOG_STYLE_LIST, "Car Mods", String, "Select", "Cancel");
count++;
ChosenComp[playerid] = component;
}
}
return 1;
}
Thanks.