SA-MP Forums Archive
Disable guns when enter in interiors? - 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: Disable guns when enter in interiors? (/showthread.php?tid=175234)



Disable guns when enter in interiors? - Face9000 - 08.09.2010

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!


Re: Disable guns when enter in interiors? - Conroy - 08.09.2010

AllowInteriorWeapons(0);


Re: Disable guns when enter in interiors? - Face9000 - 08.09.2010

lol i tried now and doesn't work..


Re: Disable guns when enter in interiors? - Dreftas - 08.09.2010

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



Re: Disable guns when enter in interiors? - Face9000 - 08.09.2010

Thank u so much!


Re: Disable guns when enter in interiors? - Las Venturas CNR - 08.09.2010

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


Re: Disable guns when enter in interiors? - macmac - 20.03.2012

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!


Re: Disable guns when enter in interiors? - OleKristian95 - 20.03.2012

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


Re: Disable guns when enter in interiors? - Reklez - 21.03.2012

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;
}