Question - Weapons - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Question - Weapons (
/showthread.php?tid=149498)
Question - Weapons -
MrLeNy - 22.05.2010
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
Re: Question - Weapons -
ViruZZzZ_ChiLLL - 22.05.2010
Uhhhhmmm... What??

I kinda don't get it....
Re: Question - Weapons -
Gamer_Z - 22.05.2010
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.
Re: Question - Weapons -
MrLeNy - 22.05.2010
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?
Re: Question - Weapons -
Gamer_Z - 22.05.2010
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....
Re: Question - Weapons -
MrLeNy - 22.05.2010
So why not save me always good ammunition? Does this function has bugs?
Re: Question - Weapons -
Gamer_Z - 22.05.2010
Quote:
Originally Posted by MrLeNy
So why not save me always good ammunition? Does this function has bugs?
|
something with dini_IntSet?..
Re: Question - Weapons -
MrLeNy - 22.05.2010
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
Re: Question - Weapons -
Gamer_Z - 22.05.2010
does this work:
http://forum.sa-mp.com/index.php?topic=104807.0
?
btw.. Polak? ;d
Re: Question - Weapons -
MrLeNy - 22.05.2010
Quote:
Originally Posted by gamer_Z
|
on this system I had the same thing ...