SA-MP Forums Archive
Problem with weapon ammu. - 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: Problem with weapon ammu. (/showthread.php?tid=363303)



Problem with weapon ammu. - Marven - 27.07.2012

hello there samp community, i am having problem with this oskin cmd the problem is when someone uses it, it is giving more ammo of the weapon, i want that if the player is holding the weapon then it should not give him more ammu of that weapon. here is the code.

pawn Код:
CMD:oskin(playerid, params[])
{
    if (PlayerOrg[playerid] == 0) return SendClientMessage(playerid, COLOR_RED,"You are not a member of an organization");
    {
        if (PlayerOrg[playerid] == 1)
        {
            if(GetPlayerSkin(playerid) != 108)
            {
                SetPlayerSkin(playerid,108);
                SetPlayerColor(playerid,COLOR_YELLOW);
                {
                if(GetPlayerWeapon(playerid) != 5 && GetPlayerWeapon(playerid) !=32)
                GivePlayerWeapon(playerid,5,1);
                GivePlayerWeapon(playerid,32,350);
                }
                SetPlayerArmour(playerid, 100);
                SendClientMessage(playerid,COLOR_YELLOW,"You have changed to your First organization skin!");
                return 1;
            }
            if(GetPlayerSkin(playerid) == 108)
            {
                SetPlayerSkin(playerid,109);
                SetPlayerColor(playerid,COLOR_YELLOW);
                SendClientMessage(playerid,COLOR_YELLOW,"You have changed to your second organization skin!");
                SetPlayerArmour(playerid, 100);
                {
                if(GetPlayerWeapon(playerid) != 5 && GetPlayerWeapon(playerid) !=32)
                GivePlayerWeapon(playerid,5,1);
                GivePlayerWeapon(playerid,32,350);
                }
                return 1;
            }
        }
    }
    return 1;
}



AW: Problem with weapon ammu. - dalkgamler - 27.07.2012

i think you should use GetPlayerArmedWeapon


Re: AW: Problem with weapon ammu. - Marven - 27.07.2012

Quote:
Originally Posted by dalkgamler
Посмотреть сообщение
i think you should use GetPlayerArmedWeapon
never used this before can you show me with my code?


Re: Problem with weapon ammu. - newbienoob - 27.07.2012

http://forum.sa-mp.com/showpost.php?...59&postcount=6


AW: Problem with weapon ammu. - dalkgamler - 27.07.2012

i think its if(GetPlayerArmedWeapon(playerid)==weaponid)


AW: Problem with weapon ammu. - dalkgamler - 27.07.2012

oh sorry i thougt you mean something else