Commands.
#7

1. Get co-ordinates to the entrance of the building. So I would go infront of the building I want them to be able to enter, then type "/save BuildingCoords", or whatever name you wish.

2. I would create a pickup, like an "i", to show that you can enter that building. (Pickup Reference: https://sampwiki.blast.hk/wiki/AddStaticPickup)

Код:
public OnGameModeInIt()
AddStaticPickup(1239, 1, x, y, z, -1);
The first number is the pickup ID, (****** search Samp Pickup ID's), second is the type (1 = can't be picked up, always exists), the x and y and z are the coordinates of the entrance that we got. The -1 is the virtual world, (-1 = Shows in all virtual worlds)

Then, you will need to create a new command under on player command text, "/enter". Below is how it should look, if I didn't make a mistake.
Код:
public OnPlayerCommandText (playerid, cmdtext[])
{
	if (strcmp("/enter", cmdtext, true) == 0)
	{
		if(IsPlayerInRangeOfPoint(playerid, (How many feet away you can be from the entrance), x, y, z))
		{
		SetPlayerPos(playerid, x, y, z);
		return 1;
		}
		else
		{
		SendClientMessage(playerid, COLOR_(Whatever Color), "You are not at the entrance to any building!");
		}
	}
	return 0;
}
Reply


Messages In This Thread
Commands. - by Luis- - 09.05.2010, 15:21
Re: Commands. - by ViruZZzZ_ChiLLL - 09.05.2010, 15:22
Re: Commands. - by Luis- - 09.05.2010, 15:34
Re: Commands. - by Backwardsman97 - 09.05.2010, 15:37
Re: Commands. - by luckie12 - 09.05.2010, 15:41
Re: Commands. - by ViruZZzZ_ChiLLL - 09.05.2010, 15:46
Re: Commands. - by TKZ227 - 09.05.2010, 16:02
Re: Commands. - by luigifan9 - 09.05.2010, 16:06
Re: Commands. - by ViruZZzZ_ChiLLL - 09.05.2010, 16:07
Re: Commands. - by Luis- - 09.05.2010, 17:09

Forum Jump:


Users browsing this thread: 1 Guest(s)