Check if Player is in the Right interrior
#1

Hello,
any ideas, how can i check if a player is in the Right interrior. So far, i know how, but seems, some Interriors has same ID's. Also i'm want to give a "Name" for the Right interrior id.

I'm found some ID's on this webpage, but seem's some interrior's have the same ID's. How can i know, if the Right ID's and text, will be picked up? Or i did, something wrong, and there is a other way?

For example
Код HTML:
new interiorID = GetPlayerInterior(playerid);
if(interiorID == 15 || interiorID == 3 || interiorID == 15)
{
     SendClientMessage(playerid, COLOR, "* Hah, go inside first!");
     return 1;
}
else if(interiorID == 15) dyrikz = "Jefferson motel";
else if(interiorID == 3) dyrikz = "Bike School";
else if(interiorID == 15) dyrikz = "Bloodbowl";

new zin[450];
format(zin,sizeof(zin),"*You are in %s",interior);
return 1;
}
Thanks a lot!
Reply
#2

What I would recommend is the usage of switch to deal with this, especially if you are planning to add more interior's in the future.

Furthermore, although certain interiors may correlate ID's, their position will differ, this is where the IsPlayerInRangeOfPoint feature will be useful to determine which interior the player is in.

Let me know whether the following is suitable:

Код:
new interiorID = GetPlayerInterior(playerid);

switch (interiorID)
{
	case 0:
	{
		//player is not inside interior
		SendClientMessage (playerid, -1, "Hah, go inside first!");
	}

	case 3:
	{
		//define as bike school
	}
	
	case 15:
	{
		if (IsPlayerInRangeOfPoint(playerid, 100.0, 2215.454833,-1147.475585,1025.796875))
		{
			//define as jefferson motel
		}
		
		else
		{	
			//define as bloodbowl
		}
	}
}
Bare in mind, ID interior's 3 and 15 hold more places than those which you have listed, so you will have to check for those position too, if they are available within your gamemode.
Reply
#3

When an interior world is requested then all the buildings that are assigned to that world are loaded. Meaning if you request interior 15 then the Jefferson motel, the bloodbowl stadium and the binco will all get loaded and it is actually possible to fly between them through the void if you can clip through a wall somewhere with a jetpack (or using airbreak). This is particularly true for the "World of Coq" interior in world 1. You will be able to actually see the Transfender interior floating in the void a few meters away.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)