17.03.2014, 16:51
Hi there, basically. I'm re-writing this system I am making the maximum vehicle slots based upon the player level. i.e Level 10 = 10 vehicles max. Instead of adding 10 slots, I'm simply setting the owner of the vehicle on the vehicle table.
Is there a way I can check without a mass of if statements in the command and just check how many times it needs to be done or do I have to do this like below?
(this is to display all owned vehicles).
Is there a way I can check without a mass of if statements in the command and just check how many times it needs to be done or do I have to do this like below?
(this is to display all owned vehicles).
pawn Код:
if(VehicleSlot1[playerid] != 0)
{
new name1 = GetVehicleModel(VehicleSlot1[playerid]) - 400;
format(second, sizeof(second), "%s - ID(%d) - Slot: 1 - Plate: %s\n",VehicleNames[name1], VehicleSlot1[playerid], VehPlate[VehicleSlot1[playerid]]);
strcat(string, second);
}
if(VehicleSlot2[playerid] != 0)
{
new name2 = GetVehicleModel(VehicleSlot2[playerid]) - 400;
format(second, sizeof(second), "%s - ID(%d) - Slot: 2 - Plate: %s\n",VehicleNames[name2], VehicleSlot2[playerid], VehPlate[VehicleSlot2[playerid]]);
strcat(string, second);
}
if(VehicleSlot3[playerid] != 0)
{
new name3 = GetVehicleModel(VehicleSlot3[playerid]) - 400;
format(second, sizeof(second), "%s - ID(%d) - Slot: 3 - Plate: %s", VehicleNames[name3], VehicleSlot3[playerid], VehPlate[VehicleSlot3[playerid]]);
strcat(string, second);
}