Question about arrays
#2

Quote:
Originally Posted by Outbreak
I've got a spawn weapons feature, and im trying to create something to see what weapons each player has...

The weapons are stored in an array, im wondering is it possible to store, 12 weapons in an array, all with varying ammo..

Then use another function to extract the info on what weapons the player has...
I've already got a command to see what weapons the player is carrying.. This isnt what im asking...

I want to store weapon info in 1 array, then be able to extract the info and display it as weapons id and ammo amount.

Is it possible?
Yes it is,

pawn Code:
new wInfo[13][2]; // 13 slots of gunz change it to the right amount :p? 0 = the gun 1 = the ammo

for(new i=0;i<14;++)
{
 GetPlayerWeaponData(playerid, i, wInfo[i][0], wInfo[i][1]);
}
Reply


Messages In This Thread
Question about arrays - by Outbreak - 23.04.2009, 20:32
Re: Question about arrays - by Think - 23.04.2009, 20:37
Re: Question about arrays - by lavamike - 23.04.2009, 20:38
Re: Question about arrays - by Outbreak - 23.04.2009, 21:16
Re: Question about arrays - by Think - 23.04.2009, 21:20
Re: Question about arrays - by 1337pr0 - 23.04.2009, 22:56

Forum Jump:


Users browsing this thread: 1 Guest(s)