Question - Weapons
#1

Hello. A couple of days matches the record of arms and often saves me ammo to -1. And here I question whether the function is GetPlayerWeaponData bugs? Because so many servers have a record of weapons, and in each example, I can not save the MP5, AK47, etc. Please help
Reply
#2

Uhhhhmmm... What??
I kinda don't get it....
Reply
#3

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.
Reply
#4

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?
Reply
#5

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....
Reply
#6

So why not save me always good ammunition? Does this function has bugs?
Reply
#7

Quote:
Originally Posted by MrLeNy
So why not save me always good ammunition? Does this function has bugs?
something with dini_IntSet?..
Reply
#8

Quote:
Originally Posted by gamer_Z
Quote:
Originally Posted by MrLeNy
So why not save me always good ammunition? Does this function has bugs?
something with dini_IntSet?..
wine feature dini
Reply
#9

does this work:
http://forum.sa-mp.com/index.php?topic=104807.0
?
btw.. Polak? ;d
Reply
#10

Quote:
Originally Posted by gamer_Z
does this work:
http://forum.sa-mp.com/index.php?topic=104807.0
?
btw.. Polak? ;d
on this system I had the same thing ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)