Can some one help me do a damn /enter and /exit command
#3

Do it in steps:

Step 1: Recognize the command /enter
Step 2: Check if the player is at the /enter position (Using PlayerToPoint (Posted Below))
Step 3: If the above is true, set the players new position inside the prison

pawn Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    tempposx = (oldposx -x);
    tempposy = (oldposy -y);
    tempposz = (oldposz -z);
    if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
    {
        return 1;
    }
    return 0;
}
Usage:
pawn Код:
if(PlayerToPoint(distance,playerid,X-Value,Y-Value,Z-Value))
{
    //Move the player
}
else
{
    //Send error message / do not move player
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)