gunshop
#1

i made a gun show but how can i save the guns that the player has?
PlayerInfo[playerid][GUNs?!?!?] = IDONTKNOW!!!
plz help!?!?!?!
Reply
#2

PlayerInfo[playerid][slot][weaponid][ammo]

And save it from

GetPlayerWeaponData(playerid, slot, &weapon, &ammo)
Reply
#3

I think max dimensions you can have is 3... You can't store for ex. weapon ammo in the ammo array.
You could do something like this:

pawn Код:
new weapons[13][2];
In other words, you have 13 x 2 variables, of which first part will store weapons and the second part will store ammo. But with arrays you can store data at once and access them dynamically.

pawn Код:
for (new i = 0; i < 13; i++)
{
    GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
}
//- SA-MP Wiki
Now we've stored all the weapon data in an array containing 13 slots.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)