Array problem
#7

Ahhhh, I did something else and finally got it working, I simply added

PHP Code:
#define MAX_CONTENT_HOLD 255
new Item_CurrentlyBrowing[MAX_PLAYERS][MAX_CONTENT_HOLD],
    
Price_CurrentlyBrowing[MAX_PLAYERS][MAX_CONTENT_HOLD],
    
Ammo_CurrentlyBrowing[MAX_PLAYERS][MAX_CONTENT_HOLD];
Item_CurrentlyBrowing[playerid][resultsfound] = ShopData[z][x][ContentWeapon];
                     
Price_CurrentlyBrowing[playerid][resultsfound] = ShopData[z][x][ContentAmmo];
                     
Ammo_CurrentlyBrowing[playerid][resultsfound] = ShopData[z][x][ContentPrice];
                    
resultsfound += 1
And then
PHP Code:
GivePlayerWeapon(playerid,Item_CurrentlyBrowing[playerid][listitem],Ammo_CurrentlyBrowing[playerid][listitem]);
              
GivePlayerMoney(playerid,-Price_CurrentlyBrowing[playerid][listitem]);
              
              new 
string[128];
              
format(string,sizeof(string),"Weapon ID: %i :: Price; %i$ :: Ammo: %i",Item_CurrentlyBrowing[playerid][listitem],Ammo_CurrentlyBrowing[playerid][listitem],Price_CurrentlyBrowing[playerid][listitem]);
            
SendClientMessage(playerid,COLOR_RED,string); 
And it seems to work!


Quote:

A per-player variable would be useful I guess if there are many shops.

Thanks for the suggestion bro! I highly appreciate it and thanks for all the help!
Reply


Messages In This Thread
Array problem - by TwinkiDaBoss - 15.06.2016, 19:23
Re: Array problem - by Konstantinos - 15.06.2016, 19:35
Re: Array problem - by TwinkiDaBoss - 15.06.2016, 19:40
Re: Array problem - by Konstantinos - 15.06.2016, 19:48
Re: Array problem - by TwinkiDaBoss - 15.06.2016, 19:57
Re: Array problem - by Konstantinos - 15.06.2016, 20:05
Re: Array problem - by TwinkiDaBoss - 15.06.2016, 20:13

Forum Jump:


Users browsing this thread: 1 Guest(s)