16.07.2015, 04:52
Hey guys.. I need your lil' help. I'm trying to make a system that will Show player Textdraw with Distance if He is in 10m of range from object. But If He leaves that range then the Textdraw will hide. I tried to use Else Statement in onPlayerUpdate. it was something like if Distance>10 then Hide Player object. But Instead of doing what I thought. It was not even showing the Textdraws. So, Please Help me to Make a system that will show TextDraw if player is in 10m of range and will hide if player leaves that 10m range.
Код:
public OnPlayerUpdate(playerid) { for(new i=1;i<MAX_TREASURE;i++){ new Float:x,Float:y,Float:z; GetObjectPos(treasure[i],x,y,z); if(IsPlayerInRangeOfPoint(playerid,11,x,y,z)){ new Float: Distance = GetPlayerDistanceFromPoint(playerid, x, y, z),Dis[44]; format(Dis, sizeof(Dis), "%.2f", Distance); PlayerTextDrawSetString(playerid, Textdraw1[playerid], Dis); PlayerTextDrawShow(playerid, Textdraw0[playerid]); PlayerTextDrawShow(playerid, Textdraw1[playerid]); } } return 1; }