I need help - 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)
+--- Thread: I need help (
/showthread.php?tid=581818)
I need help -
ALoX12 - 15.07.2015
It doesn't getting weapons. It says THere's no weapon.
PHP код:
case 0: // Store weapons
{
file = INI_Open(filename);
Loop(weap, 14, 1)
{
format(tmp, sizeof(tmp), "Weapon%d", weap);
format(tmp2, sizeof(tmp2), "Weapon%dAmmo", weap);
GetPlayerWeaponData(playerid, weap, hInfo[h][Weapon][weap], hInfo[h][Ammo][weap]);
if(hInfo[h][Ammo][weap] < 1 || (weap == 11 && hInfo[h][Weapon][weap] != 46)) continue;
INI_WriteInt(file, tmp, hInfo[h][Weapon][weap]);
INI_WriteInt(file, tmp2, hInfo[h][Ammo][weap]);
SendGun(playerid, hInfo[h][Weapon][weap], -hInfo[h][Ammo][weap]);
tmpcount++;
}
INI_Close(file);
switch(tmpcount)
{
case 0: ShowInfoBox(playerid, E_NO_WEAPONS, tmpcount);
default: ShowInfoBox(playerid, I_HS_WEAPONS1, tmpcount, AddS(tmpcount));
}
I just downloaded this script from somewhere but i want it saves weapons. It doesn't getting weapons.
NOTE: I m not saying saving. it doesn't getting.
and i am using this in my script for anti weapons
PHP код:
stock SendGun(playerid, weaponid, ammo)
{
new slot = GetWeaponSlot(weaponid);
Weapons[playerid][slot] = weaponid;
GivePlayerWeapon(playerid, weaponid, ammo);
}