Detect if player is in interior.
#1

Heey all,
How can i detect if a player is in an interior and how i can detect if player is not in interior?

Thanks Admigo
Reply
#2

pawn Код:
new interiorID = GetPlayerInterior(playerid);
if(interiorID == 0)
  SendClientMessage(playerid,0x999999AA, "You are not in an interior");
else
  SendClientMessage(playerid, 0x999999AA, "You are in an interior");
alternatively you can use "OnPlayerInteriorChange"


https://sampwiki.blast.hk/wiki/OnPlayerInteriorChange
https://sampwiki.blast.hk/wiki/GetPlayerInterior


ID = 0 no interior
Reply
#3

GetPlayerInterior

Edit: Too late.
Reply
#4

There are 2 options.

Option 1:
pawn Код:
new Int = GetPlayerInterior(playerid);
if(Int == 0) SendClientMessage(playerid,0xFF0000FF,"You are not in any interior");
else SendClientMessage(playerid,0xFF0000FF,"You are in an interior");
Option 2:
pawn Код:
public OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
{
    if(newinteriorid == 1)
    SendClientMessage(playerid,0xFF0000FF,"You have entered an interior!);
    return 1;
}
Reply
#5

There's no need to respond to a thread hours after it has already been resolved...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)