Disable guns when enter in interiors?
#1

Hi all,i need to disable guns when i enter in interiors (Ammunation,Cluckinbell ecc.)

When i enter,i cant use weapons,when i exit,i've the weapons again

Thanks!
Reply
#2

AllowInteriorWeapons(0);
Reply
#3

lol i tried now and doesn't work..
Reply
#4

pawn Код:
public OnPlayerUpdate(playerid) {
    if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
        SetPlayerArmedWeapon(playerid, 0);
        return 0;
    }
    return 1;
}
Reply
#5

Thank u so much!
Reply
#6

Quote:
Originally Posted by Conroy
Посмотреть сообщение
Where did you have it? It's supposed to go under "OnGameModeInIt".
Reply
#7

Quote:
Originally Posted by Dreftas
Посмотреть сообщение
pawn Код:
public OnPlayerUpdate(playerid) {
    if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
        SetPlayerArmedWeapon(playerid, 0);
        return 0;
    }
    return 1;
}
Many Thanks for this, works perfectly!
Reply
#8

I've got a question about almost the same thing,
is it possible to choose which interiors you want to disable?
Reply
#9

Quote:
Originally Posted by OleKristian95
Посмотреть сообщение
I've got a question about almost the same thing,
is it possible to choose which interiors you want to disable?
Yes it is possible, if you want to disable weapon on interior 3 you can just do something like this

pawn Код:
if(GetPlayerInterior(playerid) == 3 && GetPlayerWeapon(playerid) != 0)
{
       SetPlayerArmedWeapon(playerid, 0);
       return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)