How to script a HQ/EnterableHouse. {Give A Tutorial Please}
#1

Hello, i got a roleplay server. i want script an HQ, not a buyable house. Just a icon when i press enter it enters the house
Please help me, please tell how i do this, Thank you.
Reply
#2

Quote:
Originally Posted by watzab
Hello, i got a roleplay server. i want script an HQ, not a buyable house. Just a icon when i press enter it enters the house
Please help me, please tell how i do this, Thank you.
Here you go.

First we make a PickUp in the front of the door.
Quote:

CreatePickup(1239, 2, [HQ Door Position], -1);

And we make a /enter command to enter if the player is near the door.
Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/enter", cmdtext, true, 6) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, [Position])
SetPlayerInterior(playerid, [Interior of the HQ]);
SetPlayerPos(playerid, [Player Position in the HQ]);
return 1;
}
return SendClientMessage(playerid, COLOR_GREY, "* There is no door in range to enter.");
}

And a little /exit command for you.
Quote:

if(strcmp("/exit", cmdtext, true, 6) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, [By the door Inside the HQ position])) {
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, [Position for in front of the door out of the HQ]);
return 1;
}
return SendClientMessage(playerid, COLOR_GREY, "* There is no door in range to exit.");
}

I hope this will help you

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)