if(IsPlayerInInterior);
#1

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.
Reply
#2

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

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))
Reply
#4

thanks all +rep
Reply
#5

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
Reply
#6

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.
Reply
#7

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

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)
Reply
#9

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

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
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)