Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Taking Out Weapon

$
0
0
Okay, I want to make that you have to bring out your weapon from your inventory, before you can use it, like disabling GTA:SA weapon switch, whenever you switch weapon you'll get back to fist. But I don't why it doesn't work. Everytime I buy a weapon from a business, I can still change it likewise.
Code:

OnPlayerUpdate

if (GetPlayerWeapon(playerid) > 1 && (PlayerInfo[playerid][pHoldWeapon] > 0))
                  SetPlayerArmedWeapon(playerid, 0);

Code:

stock HoldWeapon(playerid, weaponid)
{
        RemovePlayerAttachedObject(playerid, 4);

        PlayerInfo[playerid][pHoldWeapon] = weaponid;

        if (weaponid != 0)
        {
                SetPlayerAttachedObject(playerid, 4, GetWeaponModel(weaponid), 6);
                  SetPlayerArmedWeapon(playerid, 0);
        }
        return 1;
}


Business
Code:

if(listitem == 1)
                        {
                                if (GetPlayerCash(playerid) >= BizInfo[PlayerInfo[playerid][InBusiness]][bProductsPrice1])
                                {
                                        GivePlayerCash(playerid, -BizInfo[PlayerInfo[playerid][InBusiness]][bProductsPrice1]);
                                        BizInfo[PlayerInfo[playerid][InBusiness]][bMoney] += BizInfo[PlayerInfo[playerid][InBusiness]][bProductsPrice1];
                                        BizInfo[PlayerInfo[playerid][InBusiness]][bSupplies] --;
                                        GivePlayerValidWeapon(playerid, 33, 5);
                                        format(string, sizeof(string), "[NOTICE]: {FFFFFF}Winchester Model 70 Purchased.");
                                        SendClientMessageEx(playerid, COLOR_LIGHTGREEN, string);

                                }
                                else
                                {
                                        SendClientMessageEx(playerid, COLOR_BRIGHTRED, "[ERROR]: {FFFFFF}You don't have the cash for this item!");

                                }

                        }


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>