SA-MP Forums Archive
Weapon check code :s [Fixed] - 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: Weapon check code :s [Fixed] (/showthread.php?tid=85380)



Weapon check code :s [Fixed] - 6tynine - 07.07.2009

Were here can I check a player has Weapon "30". I know there is a GivePlayerWeapon(playerid,30,100); inside, But its to purchase bullets.


Re: Weapon check code :s - woot - 07.07.2009

https://sampwiki.blast.hk/wiki/GetPlayerWeapon

He needs to have the weapon in his hand to "buy bullets" then.


Re: Weapon check code :s - 6tynine - 07.07.2009

Edit: Fixed


Re: Weapon check code :s - happyface - 07.07.2009

Quote:
Originally Posted by M4DKiLLA
Edit: Fixed
sorry for adding this after you already fixed it, but I started awhile ago so I will post anyway.

pawn Код:
else if (strcmp(text,"7",true) == 0)
    {
        new playerWeapons = GetPlayerWeapon(playerid);
               
        if(playerWeapons == 23)
        {
            new Playermoney = GetPlayerMoney(playerid);

            if (Playermoney < 100)
            {
                SendClientMessage(playerid,red,"You Do not have enough Cash");
                return 1;
            }
       
            GivePlayerMoney(playerid, -100);
            GivePlayerWeapon(playerid,23,300);
            buyammu1[playerid] = 1;
        }
        else
        {
            SendClientMessage(playerid,red,"You Need to buy a Silencer to buy this ammo");
        }
        return 0;
    }