View Single Post
Old 23/04/2009, 08:37 PM   #2
Think's Avatar
Join Date: Nov 2007
Posts: 810
Reputation: 39
Default Re: Question about arrays

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]);
"If we cant stand strong alone, there is no fucking way we can stand strong united" - Kevin T Thoms
Think is offline