How to make a /robatm command only available when your near an ATM
#10

Quote:
Originally Posted by mineralo
Посмотреть сообщение
Код:
stock 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;
}
use this, its useful to detecte is near a place like
pawn Код:
if(PlayerToPoint(4,playerid,0,0,0)
{
//your code
}
else
{
SendClientMessage(playerid,COLOR,"You're not near it !");
}
I dont get anything in that code...
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)