change player weapon interior
#1

I want to ask how to change the interior when a player enters somewhere inside like the casino.
Example: I went inside the casino and I cannot use my weapons cause it automatically rolled to fist for me so I can't even change to any of the weapons......
Here are my codes
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(!IsPlayerConnected(playerid)) return 0;
    //Weapons in interiors
    if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
        SetPlayerArmedWeapon(playerid,0);
        return 0;
    }
    return 1;
}
Reply
#2

I don't see where the problem is? What do you want to do exactly?
Reply
#3

just like this ?
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerInterior(playerid) != 0||1||2||3||4||5||6||7||8||9||10)
    {
     if(GetPlayerWeapon(playerid))
     {
      SetPlayerArmedWeapon(playerid,0);
     }
   }
    return 1;
}
Reply
#4

Means, when I enter an interior such as lspd (the yellow arrow). I tried to roll to my weapons to use, but it automatically rolled back to fist, lol I came here to rob cops with guns, not to punch with hands......
Reply
#5

I want the weapons allowed to use in the interiors.
Reply
#6

Then remove that piece of code? What exactly is the problem?
Reply
#7

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

AllowInteriorWeapons(1) in OnGameModeInit

If you have a code where disallow you to use weapons in interior: remove it.
Reply
#8

It came a lot of errors when I remove it, also it stopped working when I add on the "AllowInteriorWeapons(1)"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)