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

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