SA-MP Forums Archive
Enabling Interior weapons... - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Enabling Interior weapons... (/showthread.php?tid=64085)



Enabling Interior weapons... - Outbreak - 01.02.2009

... For Certain interiors..

Is it possible to enable interior weapons for one interior?

I only want it to be within a certain area too..

So for example, if i was liberty city, thats interior 1, would i be able to enable weapons for interior one in the liberty city area?

And for the thers in interior one weapons will be disabled..

Is it possible?


Re: Enabling Interior weapons... - AlExAlExAlEx - 01.02.2009

IfPlayerToPoint..
or
IsPlayerInArea


Re: Enabling Interior weapons... - Outbreak - 01.02.2009

I've used that for disabling players weapons and returning them once they leave an area, but never used it to enable weapons in an interior...

How would that work?


Re: Enabling Interior weapons... - Backwardsman97 - 02.02.2009

Use OnPlayerInteriorChange and use GetPlayerWeaponData to store their weapons when they enter the interior and give it back when they leave.

pawn Code:
new pW[MAX_PLAYERS][13]
new pA[MAX_PLAYERS][13];

public OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
{
    if(newinteriorid == 0 && oldinteriorid == //interiorwithnoweapons)
    {
        for(new w=0;w<13;w++)
        {
            GivePlayerWeapon(playerid,pW[playerid][w],pA[playerid][w]);
        }
    }
    if(newinteriorid == //interiorwithnoweapons)
    {
        for(new w=0;w<13;w++)
        {
            GetPlayerWeaponData(playerid,w,pW[playerid][w],pA[playerid][w]);
            ResetPlayerWeapons(playerid);
        }
    }
}
Try that.