AHK Overlay (Samp udfEx)

PeterL

Member
Joined
Dec 26, 2014
Messages
16
Reaction score
0
Hi,
Can somebody help me with this Overlay?
Code:
SetParam("use_window", "1")
SetParam("window", "GTA:SA:MP")

Settimer, Nameoverlay, 250

Nameoverlay := -1

foo(o)
{
 if(!o)
  return
 Position := o.POS
 PlayerPosition := getCoordinates()
 Distanz := getDist(PlayerPosition,Position)
 TextSetString(NameOverlay,"`n{FFFFFF}" o.NAME "(" o.ID ") Distance:({0000ff}" Round(Distanz) "{ffffff}) HP: {FF0000}" Round(o.HP) "")
}


Nameoverlay:
    if(Nameoverlay == -1)
    {
        Nameoverlay := TextCreate("Arial", 5,  true, false, 628, 188, 0xFFFFFFFF, "", false, true)
    }
  callFuncForAllStreamedInPlayers("foo", 300)
return
It should look like this http://abload.de/img/sa-mp-85123f4k.png
 

PeterL

Member
Joined
Dec 26, 2014
Messages
16
Reaction score
0
Thx thats the Code at the moment
Code:
Settimer, Overlay, 500
 
 
foo(o)
{
 if(!o)
  return
 Position := o.POS
 PlayerPosition := getCoordinates()
 Distanz := getDist(PlayerPosition,Position)
 
 ;TextSetString(Overlay,"" o.NAME "(" o.ID ") Distance:({0000ff}" Round(Distanz) "{ffffff}) HP: {FF0000}" Round(o.HP) "")
 TextCreate("Arial", 5,  true, false, 628, A_Index*10 +200/200, 0xFFFFFFFF, "" o.NAME "(" o.ID ") Distance:({0000ff}" Round(Distanz) "{ffffff}) HP: {FF0000}" Round(o.HP) "", false, true)
}
 
 
Overlay:
  callFuncForAllStreamedInPlayers("foo", 300)
return
But the Overlay is buggy how can i refresh it without overlaps?
 

0x_

Wtf I'm not new....
Staff member
Administrator
Joined
Feb 18, 2013
Messages
1,123
Reaction score
174
By not creating the Text, instead create it once and edit the string.
 

AnalFatal

Active member
Joined
Sep 16, 2014
Messages
27
Reaction score
0
refresh it
Loop, 10        ; 10 players showed
TextSetString(Texts%A_Index%, callfuncforallstreamedinplayers("foo")
 

PeterL

Member
Joined
Dec 26, 2014
Messages
16
Reaction score
0
AnalFatal link said:
refresh it
Loop, 10        ; 10 players showed
TextSetString(Texts%A_Index%, callfuncforallstreamedinplayers("foo")
No the Syntax is callfuncforallstreamedinplayers("Function", Distance)
 
Top