SA-MP Forums Archive
How to disable weapons in certain interiors ? [Rep+] - 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: How to disable weapons in certain interiors ? [Rep+] (/showthread.php?tid=461875)



How to disable weapons in certain interiors ? [Rep+] - NiceWizard - 03.09.2013

Hello ,

Does any1 can help me with interiors ? I want to block/disable weapons in Ammu-Nation so player can't fight with each other inside the shop . I have co-ordinates but don't know how to do that

Does any1 also know how I can close all interiors and have only open the selected one which I choose ? I know I can use -> DisableInteriorEnterExits(); but how I can open the selected interiors which I'm interested in for example Ammu-Nation or any other ?

Every help is appreciated.
I will give Rep+ to people who help me to solve the problem.

Thanks
NiceWizard


Respuesta: How to disable weapons in certain interiors ? [Rep+] - recor - 04.09.2013

pawn Код:
public OnGameModeInit()
{
    AllowInteriorWeapons(0);
    return 1;
}



Re : How to disable weapons in certain interiors ? [Rep+] - Matnix - 04.09.2013

Somethings like that?

pawn Код:
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    if(GetPlayerInterior(playerid) == ID) // Amunation Interior
    {
        SetPlayerArmedWeapon(playerid, 0);
        return 0;
    }
    return 1;
}
Quote:

Does any1 also know how I can close all interiors and have only open the selected one which I choose ? I know I can use -> DisableInteriorEnterExits(); but how I can open the selected interiors which I'm interested in for example Ammu-Nation or any other ?

You will have to use DisableInteriorEnterExits(); and then creating a pickup who will allow you to teleport to ammunation interioir.


Re: Re : How to disable weapons in certain interiors ? [Rep+] - NiceWizard - 04.09.2013

Can I do that for multiple shops like this :

pawn Код:
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    if(GetPlayerInterior(playerid) == ID) // Amunation Interior
    if(GetPlayerInterior(playerid) == ID) // Different Interior 1
    if(GetPlayerInterior(playerid) == ID) // Different Interior 2
    {
        SetPlayerArmedWeapon(playerid, 0);
        return 0;
    }
    return 1;
}
Will this work like this ?