SA-MP Forums Archive
if(IsPlayerInInterior); - 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: if(IsPlayerInInterior); (/showthread.php?tid=467013)



if(IsPlayerInInterior); - AnonScripter - 30.09.2013

How can i make something like:

pawn Код:
if(IsPlayerInInterior & VirtualWorld bla bla)
instead of:

pawn Код:
if(IsPlayerInDynamicCP)
i want it to make the command works everywhere the player is in the interior, not only in the checkpoint.


Re: if(IsPlayerInInterior); - AphexCCFC - 30.09.2013

pawn Код:
if(GetPlayerInterior(playerid) == whatever interior id here && GetPlayerVirtualWorld(playerid) == whatever virtual world here))



Re: if(IsPlayerInInterior); - BlackBank - 30.09.2013

Or you could use a define for that(Put somewhere above your script):
pawn Код:
#define IsPlayerInInterior(%0) (GetPlayerInterior(%0) != 0)
And then call it:
pawn Код:
if(IsPlayerInInterior(playerid))



Re: if(IsPlayerInInterior); - AnonScripter - 30.09.2013

thanks all +rep


Re: if(IsPlayerInInterior); - AphexCCFC - 30.09.2013

Quote:
Originally Posted by BlackBank3
Посмотреть сообщение
Or you could use a define for that(Put somewhere above your script):
pawn Код:
#define IsPlayerInInterior(%0) (GetPlayerInterior(%0) != 0)
And then call it:
pawn Код:
if(IsPlayerInInterior(playerid))
Legend! Just taught me this too hehe. This makes it so the command will be called if the player is in ANY interior though, right? (Not sure if that was the case). I'mma rep you though cause you have just made some of my code a lot easier to apply


Re: if(IsPlayerInInterior); - BlackBank - 30.09.2013

Quote:
Originally Posted by AphexCCFC
Посмотреть сообщение
Legend! Just taught me this too hehe. This makes it so the command will be called if the player is in ANY interior though, right? (Not sure if that was the case).
Yep, that's right.


Re: if(IsPlayerInInterior); - AphexCCFC - 30.09.2013

Quote:
Originally Posted by BlackBank3
Посмотреть сообщение
Yep, that's right.
Thanks. Edited my post above incase you missed it.


Re: if(IsPlayerInInterior); - Pottus - 30.09.2013

Quote:
Originally Posted by BlackBank3
Посмотреть сообщение
Or you could use a define for that(Put somewhere above your script):
pawn Код:
#define IsPlayerInInterior(%0) (GetPlayerInterior(%0) != 0)
And then call it:
pawn Код:
if(IsPlayerInInterior(playerid))
That doesn't make sense to me the player is always in an interior even if they are in interior 0 what it should check is if a player is in a specified interior...

pawn Код:
#define IsPlayerInInterior(%0,%1) (GetPlayerInterior(%0) == %1)



Re: if(IsPlayerInInterior); - xganyx - 01.10.2013

pawn Код:
stock IsPlayerInInterior(playerid,interiorid)
{
    if(GetPlayerInterior(playerid) == interiorid)
    {
        return 1;
    }
}



Re: if(IsPlayerInInterior); - Jefff - 01.10.2013

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
That doesn't make sense to me the player is always in an interior even if they are in interior 0 what it should check is if a player is in a specified interior...

pawn Код:
#define IsPlayerInInterior(%0,%1) (GetPlayerInterior(%0) == %1)
He want if( IsPlayerInAnyInterior( playerid ) ) except 0