Annoying problem
#7

Код:
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;
}
note: this is just a quick copy paste without indentation or error checking, but you should get the idea.
Reply


Messages In This Thread
Annoying problem - by mrcoolballs - 08.09.2010, 02:21
Re: Annoying problem - by Norn - 08.09.2010, 02:32
Re: Annoying problem - by Rachael - 08.09.2010, 03:03
Re: Annoying problem - by Backwardsman97 - 08.09.2010, 03:04
Re: Annoying problem - by mrcoolballs - 08.09.2010, 03:20
Re: Annoying problem - by bigcomfycouch - 08.09.2010, 03:24
Re: Annoying problem - by Rachael - 08.09.2010, 03:29
Re: Annoying problem - by Backwardsman97 - 08.09.2010, 03:31
Re: Annoying problem - by bigcomfycouch - 08.09.2010, 03:31

Forum Jump:


Users browsing this thread: 1 Guest(s)