08.09.2010, 03:29
Код:
forward CustomPickups();
...
SetTimer("CustomPickups",2000,true);
...
public CustomPickups()
{
for(new i = 0;i < MAX_PLAYERS;i++)
{
if(PlayerToPoint(2.0,i,0.0,0.0,0.0)) //insert pickup co-ordinates here
{
GameTextForPlayer(i,"bla bla",2000,3);
}
else if(PlayerToPoint(2.0,i,0.0,0.0,0.0))
{
GameTextForPlayer(i,"bla bla",2000,3);
}
}
return 1;
}
...
stock 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;
if(SpectateVehicle[playerid])
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;
}

