CLEO Help Little help please.

CLEO related
Status
Not open for further replies.

alberto98

Member
Joined
Feb 5, 2017
Messages
8
Reaction score
0
How to obtain the nearlest player coordinatest with ahk script. Is it possible? Thank's.
 

_C1ph3r_

Active member
Joined
Feb 5, 2017
Messages
91
Reaction score
3
alberto98 said:
How to obtain the nearlest player coordinatest with ahk script. Is it possible? Thank's.
I don't know if it work in AHK script... but it's possible to make it with Cleo.

Author: blackHat
http://ugbase.eu/Thread-Check-for-closest-player-to-you
Code:
{$CLEO}

0000: NOP


:START
wait 0 
IF AND
056D:   actor $PLAYER_ACTOR defined 
0AB0:   key_pressed 49 //key 1 to start the loop
then   
REPEAT
wait 0 
// GET ALL STREAMED PEDS     
0A8D: 29@ = read_memory 0xB74490 size 4 virtual_protect 0
000A: 29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
for 30@ = 0 to 35584 step 0x100
    0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
    000A: 29@ += 0x1
    if and
        0029:  31@ >= 0x00 
        001B:  0x80 > 31@
    then 
        005A: 31@ += 30@
        // GOT THE PED. 31@ = THE PLAYER (PED)
IF
056D:   actor 31@ defined     //check if the actor defined
then
//-----THIS IS OUR CHECKING-----\\
actor.StorePos($PLAYER_ACTOR, 1@ , 2@ , 3@) //store your position
actor.StorePos(31@, 4@ , 5@ , 6@)                   //store the target position

IF 
7@ < 100.0   // this will check if the target is less than 100 meter away from you ,float is better to use (.0)
then
//HERE YOU CAN ADD THINGS YOU WANT TO HAPPEN OR IF YOU HAVE MORE CONDITIONS



ELSE
IF 
7@ > 100.0  //this will check if the target is more than 100 meter away 
then 
// here put things that will run if the target is away more than 100 meter 



//----ends----\\
end
end
end
end
end
//----ends----\\
until key_down 48 // key 0  will stop the loop 
END
jump @START
 

_C1ph3r_

Active member
Joined
Feb 5, 2017
Messages
91
Reaction score
3
alberto98 said:
I know with cleo, but i need ahk script . Thank's for answer.
:imoverit: Maybe someone could help you just wait ! Sadly, I don't know anything about AHK scripting :( so i couldn't help you.
 

_C1ph3r_

Active member
Joined
Feb 5, 2017
Messages
91
Reaction score
3
alberto98 said:
I already found this, but no one of this functions can help me. I posted here as last solution.
Tag someone who has knowledge about AHK Scripting, so they could help you. Or maybe use Google or go to another hacking community like: Blast.hk or something
 

Scraatch

Active member
Joined
Jan 14, 2017
Messages
76
Reaction score
2
Location
Germany
Code:
if(!A_IsAdmin){
	Run *RunAs "%A_ScriptFullPath%",, UseErrorLevel
	if(ErrorLevel){
		MsgBox, 262165, Error, Start as an Admin
		IfMsgBox, Retry
			Reload
		else
			ExitApp
	}
	return
}
#Include %A_ScriptDir%\SAMP.ahk
#SingleInstance, force
#UseHook
#NoEnv
#Persistent
#IfWinActive, GTA:SA:MP

;###################################################################################################################################################################################################################################

:?:/Closestplayercoords::
{
	ClosestPlayerId := getClosestPlayerId()
    PlayerUsername := getPlayerNameById(ClosestPlayerId)
	othercoords := getTargetPos(ClosestPlayerId)
	AddChatMessage("Player: " . PlayerUsername . "(ID: " . ClosestPlayerId . ")")
	AddChatMessage("X| " . othercoords[1] . " Y| " . othercoords[2] . " Z| " . othercoords[3] . "")
}
return

getTargetPos(dwId) {
    dwId += 0
    dwId := Floor(dwId)
    if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
        return ""
    
    if(iRefreshScoreboard+iUpdateTick > A_TickCount)
    {
        if(oScoreboardData[dwId])
        {
			if(oScoreboardData[dwId].HasKey("PED"))
				return getPedCoordinates(oScoreboardData[dwId].PED)
			if(oScoreboardData[dwId].HasKey("MPOS"))
				return oScoreboardData[dwId].MPOS
		}
        return ""
    }
    
    if(oScoreboardData[dwId])
    {
		if(oScoreboardData[dwId].HasKey("PED"))
			return getPedCoordinates(oScoreboardData[dwId].PED)
		if(oScoreboardData[dwId].HasKey("MPOS"))
			return oScoreboardData[dwId].MPOS
	}
    return ""
}
You need the SAMP UDF
 

_C1ph3r_

Active member
Joined
Feb 5, 2017
Messages
91
Reaction score
3
Edvincik said:
@_C1ph3r_
That might be solution for warningspec?
No, as Springfield said it before in my topic...
The spectator doesn't send you anything including their Ped so you couldn't detect if they're watching you by checking the closet ped.
 
Status
Not open for further replies.
Top