09.05.2010, 16:02
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)
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.
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);
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;
}

