03.08.2009, 18:50
pawn Code:
if(strcmp(cmd, "/enter", true) == 0) // Checks if the string "cmd" is equal to "/enter".
{
if(PlayerToPoint(5.0,playerid, x,y,z) || PlayerToPoint(5.0,playerid, x,y,z) || PlayerToPoint(5.0,playerid, x,y,z)) // A custom function to get the distance between a player and a coordinate.
{
SetPlayerPos(playerid, interior:x,interior:y,interior:z); // Sets a players position because he is close enough to the above coordinate
}
else
{
SendClientMessage(playerid, COLOR_BLUE,"You must be at a house entrance to enter."); // Sends the player a message to inform them they are not close enough
}
return 1; // Tells the script to end the function here
}

