This is giving me the same weapon 12 times.
#9

I don't understand about your variables value.

PlayerWeapons is not a weapon id ? Is it a boolean ( 1 Or 0 ) ?

WepModel and WepAmmo is script defined value ? Not load from mysql ?

I suggest to use PlayerWeapons and PlayerAmmos for store value.

Example
pawn Код:
for(new w=0; w < 13; w++)
                {
                    new string[12];
                    format(string, sizeof(string), "Weapon%d", w);
                    mysql_get_field(string, QueryString);
                    PlayerWeapons[playerid][w] = strval(QueryString); //this should be weapon id
                    format(string, sizeof(string), "Ammo%d", w);
                    mysql_get_field(string, QueryString);
                    PlayerAmmo[playerid][w] = strval(QueryString);
                }

// And give weapon to  player.

for(new w = 0; w < 13; w++)
                {

                        if(PlayerAmmo[playerid][w] > 0)
                        {
                            GivePlayerWeapon(playerid,PlayerWeapons[playerid][w],PlayerAmmo[playerid][w]);

                        }// this would work.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)