01.05.2009, 08:11
Use PlayerToPoint
Example:
pawn Код:
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;
}
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerToPoint(Float:radi, i, Float:x, Float:y, Float:z)//Change Radi to the radius away from the pickup and x, y and Z as the pickup co-ordonates!
{
//Show the Textdraw. Although a Gametext would be easier.