01.05.2009, 06:55
how to make when player stands on/near pickup, textdraw is shown. when he goes away, textdraw will disappear.
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;
}
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.