Posts: 1,047
Threads: 23
Joined: Jun 2009
u need to get all data , and returning -1 would mean there is no weapon in that slot(?)
anyway saving weapons has somewhere been posted already here on forum samp.. just @search.
Posts: 1,047
Threads: 23
Joined: Jun 2009
Quote:
Originally Posted by MrLeNy
I have a code of record:
Код:
for(new slot; slot < 13; slot++)
{
new weaponid, ammo, WeapString[32], AmmoString[32];
GetPlayerWeaponData(playerid, slot, weaponid, ammo);
format(WeapString, sizeof(WeapString), "Bron%d", slot);
format(AmmoString, sizeof(AmmoString), "Ammo%d", slot);
dini_IntSet(PlayerFile(playerid), WeapString, weaponid);
dini_IntSet(PlayerFile(playerid), AmmoString, ammo);
}
And the problem is that I like AK47 ammo in the weapon 350, and saves me a -1. And here I have a question how to fix it?
|
from wiki...
pawn Код:
//common use: get all weapons and store info in an array containing 13 slots
//first value is weapon id and second is ammo
new weapons[13][2];
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
}
so your code should be good....
Posts: 161
Threads: 39
Joined: Sep 2009
Reputation:
0
So why not save me always good ammunition? Does this function has bugs?
Posts: 1,047
Threads: 23
Joined: Jun 2009
Quote:
Originally Posted by MrLeNy
So why not save me always good ammunition? Does this function has bugs?
|
something with dini_IntSet?..
Posts: 1,047
Threads: 23
Joined: Jun 2009