Question about arrays
#5

Quote:
Originally Posted by Outbreak
would it worl if i used this below..

if the saved weapon array was "pInfo[playerid][SpawnWeaps]"

ammo array is "pInfo[playerid][SpawnAmmo]"

pawn Code:
new plSweaps[12];
new plAmmo[12];

format(plSweaps[0], 16, pInfo[playerid][SpawnWeaps][0]);//I'll only make 4 of these to keep the post short
format(plSweaps[1], 16, pInfo[playerid][SpawnWeaps][1]);//In the real code thre would be 12.
format(plSweaps[2], 16, pInfo[playerid][SpawnWeaps][2]);
format(plSweaps[3], 16, pInfo[playerid][SpawnWeaps][3]);

format(plAmmo[0], 16, pInfo[playerid][SpawnAmmo][0]);
format(plAmmo[1], 16, pInfo[playerid][SpawnAmmo][1]);
format(plAmmo[2], 16, pInfo[playerid][SpawnAmmo][2]);
format(plAmmo[3], 16, pInfo[playerid][SpawnAmmo][3]);
Would this work? if i was wanting to save each weapon ID and ammo amount?
would be easier by doing this:

pawn Code:
for(new i=0;i<12;++)
{
 GetPlayerWeaponData(playerid, i, pInfo[playerid][SpawnWeaps][i], pInfo[playerid][SpawnAmmo][i]);
}
than save it or something.
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)