Cars in /stats problem
#4

for example, we don't have any vehicles in Slot 2:

pawn Код:
if(Player[id][PlayerCarModel2] <= 0) Player[id][PlayerCarModel2] = 399;
it means if the Vehicle Model in Slot 2 (Player[id][PlayerCarModel2]) is 0 or less, then we set the Player[id][PlayerCarModel2] to 399

so, when we use the "format":
pawn Код:
format(string, sizeof(string), "Vehicle 1: %s | Vehicle 2: %s | Vehicle 3: %s | Vehicle 4: %s | Vehicle 5: %s", VehicleNamesNoID[Player[id][PlayerCarModel]-399], VehicleNamesNoID[Player[id][PlayerCarModel2]-399], VehicleNamesNoID[Player[id][PlayerCarModel3]-399], VehicleNamesNoID[Player[id][PlayerCarModel4]-399], VehicleNamesNoID[Player[id][PlayerCarModel5]-399]);
The "Player[id][PlayerCarModel2]" was 399 (not 0, because we have set the Player[id][PlayerCarModel2] to 399), so Player[id][PlayerCarModel2] - 399 = 0. The result is VehicleNamesNoID[Player[id][PlayerCarModel2]-399] = VehicleNamesNoID[0] = "None". then "SendClientMessage" called.

after that:
pawn Код:
if(Player[id][PlayerCarModel2] == 399) Player[id][PlayerCarModel2] = 0;
if the "Player[id][PlayerCarModel2]" is 399, then we change it to 0 to avoid any bugs.


Sorry if this explanation makes you more confused . And Sorry for my bad English .
Reply


Messages In This Thread
Cars in /stats problem - by Euan Hughes - 18.07.2012, 12:07
Re: Cars in /stats problem - by Andi_Evandy - 18.07.2012, 12:25
Re: Cars in /stats problem - by Euan Hughes - 18.07.2012, 12:51
Re: Cars in /stats problem - by Andi_Evandy - 18.07.2012, 13:11

Forum Jump:


Users browsing this thread: 1 Guest(s)