Asta la inceput: forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
Undeva in script:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
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;
}
Comanda:
if(strcmp(cmd, "/teleport", true) == 0)
{
if(PlayerToPoint(3.0,playerid,X,Y,Z))
{
//restul codului
} PS: Nush daca ai inteles...Sper sa fie de folos.