16.05.2013, 19:02
Hello, I'm using 2 for loops in my car dealership, to either check the names and the pickup id's this is what I got on OnPlayerPickUpPickup
And here is the loading part of the pickups:
Now here is the problem when In-game and trying to pickup that pickup, it doesn't show me the dialog with the vehicle names that it should.
Anyone has a clue why this is happening and if it's smart to do 2 loops?
-Kevin
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new i; i < sizeof(DealerShips); i++)
{
if(pickupid == DealerShips[i][PickupID]) break;
new VehiclesString[250];
for(new d; d < sizeof(DealerShipVehicles); d++)
{
if(DealerShipVehicles[d][DealershipNumber] == DealerShips[i][DealerShipID])
{
new vModel = DealerShipVehicles[d][VModel];
format(VehiclesString, sizeof(VehiclesString), "%s(%d)\n",VehicleFriendlyNames[vModel-400],DealerShipVehicles[d][VPrice]);
}
}
ShowPlayerDialog(playerid, dealership1, DIALOG_STYLE_LIST, DealerShips[i][DealershipName], VehiclesString, "Buy", "Cancel");
}
return 1;
}
pawn Код:
public LoadDealerships(playerid)
{
for(new i; i < sizeof(DealerShips); i++)
{
new string[128];
DealerShips[i][PickupID] = CreateDynamicPickup(1239,23,DealerShips[i][LocX],DealerShips[i][LocY],DealerShips[i][LocZ]);
format(string, sizeof(string), "{FFFF00}%s", DealerShips[i][DealershipName]);
DealerShips[i][labeltext] = Create3DTextLabel(string,0xFFFFFFFF,DealerShips[i][LocX],DealerShips[i][LocY],DealerShips[i][LocZ],15.0,0,0);
}
print("Dealerships has been loaded");
return 1;
}
Anyone has a clue why this is happening and if it's smart to do 2 loops?
-Kevin