PDA

View Full Version : Detect if player is in interior.


Admigo
17/11/2011, 03:54 PM
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

Sascha
17/11/2011, 03:57 PM
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"


http://wiki.sa-mp.com/wiki/OnPlayerInteriorChange
http://wiki.sa-mp.com/wiki/GetPlayerInterior


ID = 0 no interior

HyperZ
17/11/2011, 03:58 PM
GetPlayerInterior (http://wiki.sa-mp.com/wiki/GetPlayerInterior)

Edit: Too late.

nuriel8833
17/11/2011, 05:38 PM
There are 2 options.

Option 1:

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:

public OnPlayerInteriorChange(playerid,newinteriorid,oldi nteriorid)
{
if(newinteriorid == 1)
SendClientMessage(playerid,0xFF0000FF,"You have entered an interior!);
return 1;
}

Calgon
17/11/2011, 05:40 PM
There's no need to respond to a thread hours after it has already been resolved...