I don't know if it work in AHK script... but it's possible to make it with Cleo.alberto98 said:How to obtain the nearlest player coordinatest with ahk script. Is it possible? Thank's.
{$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
:imoverit: Maybe someone could help you just wait ! Sadly, I don't know anything about AHK scripting so i couldn't help you.alberto98 said:I know with cleo, but i need ahk script . Thank's for answer.
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 somethingalberto98 said:I already found this, but no one of this functions can help me. I posted here as last solution.
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 ""
}
No, as Springfield said it before in my topic...Edvincik said:@_C1ph3r_
That might be solution for warningspec?