31.12.2010, 19:09
Topo GM!
10.0 - Raio
playerid - Funзгo que o player serб usado
246.6891 - X
66.9642 - Y
1003.6406 - Z
pawn Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
pawn Код:
if(strcmp(cmd, "/trampar", true) == 0)
{
if(PlayerToPoint([COLOR="RoyalBlue"]10.0[/COLOR], [COLOR="Olive"]playerid[/COLOR],[COLOR="SandyBrown"]246.6891[/COLOR],[COLOR="YellowGreen"]66.9642[/COLOR],[COLOR="Purple"]1003.6406[/COLOR])
{
SendClientMessage(playerid, COR1, ("Vocк estб trampando");
return 1;
}
}
playerid - Funзгo que o player serб usado
246.6891 - X
66.9642 - Y
1003.6406 - Z
pawn Код:
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;
}