PDA

View Full Version : How To Make enterable building?


NayanIndia
04/02/2015, 03:00 PM
how to make an enterable building when player uses /enter and /exit cmds he can enter

Karan007
04/02/2015, 03:14 PM
if(!strcmp(cmdtext, "/enter", true))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, FLOAT:X,FLOAT:Y,FLOAT:Z))
{
SetPlayerPos(playerid, FLOAT:X,FLOAT:Y,FLOAT:Z);
SetPlayerInterior(playerid, [Add Your Interior Here!]);
}
}
if(!strcmp(cmdtext, "/exit", true))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, FLOAT:X,FLOAT:Y,FLOAT:Z))
{
SetPlayerPos(playerid, FLOAT:X,FLOAT:Y,FLOAT:Z);
SetPlayerInterior(playerid, [Add Your Interior Here]);
}
}

Go In-Game Do /save Where You Want To Make Limit When They Do /Enter Then They Will Enter And Same To The Exit. And Don't Forget To Add Your Interior!And Add It Under The Callback OnPlayerCommandText.

MBilal
04/02/2015, 03:42 PM
Ok you have to do simple thing

Go inside the Interior which You want or which or make where you want player to enter Type
/save Name

And the location outside the house or building where you want to player Enter inside the Building
Press /save Name .

Now

You can do

SetPlayerPosition(playerid,x,y,z); // these X,Y,Z which You save for Interior or for Enter Point.


Go under On PlayerKeyState
And
make Some thing Like this.

if(newkeys & KEY_SECONDARY_ATTACK) // if he press F or Enter
{
//Police Towards ..
if IsPlayerInRangeOfPoint(playerid,1.0,-18.8034,2122.5828,17.3427) *then //This is Location where you Enter inside the Building
{
SetPlayerPos(playerid,-101.4980,2293.4893,17.5543);//it will set your Postion here.. You can change X,Y,Z
}
if IsPlayerInRangeOfPoint(playerid, 1.0,-101.4980,2293.4893,17.5543) *then// same for this
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid,-18.8034,2122.5828,17.3427);
}
}