CLEO Help Need help

CLEO related
Status
Not open for further replies.

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
Hello, soo i trying to make a simple cleo who's getting another's players ping, and the problem is that i getting just null player nickname...

Code:
{$CLEO .cs}
0000: NOP
REPEAT
wait 0
until Samp.Available
0B34: "test" @TEST
while true 
wait 0
end

:TEST
0B36: samp 1@ = get_player_nickname 2@
0B2A: samp 2@ = get_player_ping 1@
ChatMsg "{FFFFFF}Player: %s | Ping: %d." -1 1@ 2@
CmdRet
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,133
Solutions
5
Reaction score
885
Location
Lithuania
[shcode=cpp]
:ping
0B35: samp 0@ = get_last_command_params
if 0AD4: $NOT_USED = scan_string 0@ "%d" 1@
then
if 0B23: samp is_player_connected 1@
then
0B2B: samp 2@ = get_player_id_by_actor_handle 1@
0B36: samp 3@ = get_player_nickname 2@
0B2A: samp 4@ = get_player_ping 2@
chatmsg "Player.: %s with ID: %d" -1 3@ 4@
end
end
Samp.CmdRet()
[/shcode]
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
but with that code you have to input actor handle instead of ID and then it attempts to check if player is connected by the handle instead of ID


0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0B36: samp 3@ = get_player_nickname 0@
0B2A: samp 4@ = get_player_ping 0@


or

Code:
:ping
0B35: samp 0@ = get_last_command_params
if 0AD4: $NOT_USED = scan_string 0@ "%d" 1@
then 
    if 0B23:  samp is_player_connected 1@
    then 
        0B36: samp 3@ = get_player_nickname 1@
        0B2A: samp 4@ = get_player_ping 1@
        chatmsg "Player: %s with ID: %d" -1 3@ 4@
    end
end
Samp.CmdRet()
 

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
@parazitas
@monday
thanks,  i delete this 0B2B: samp 2@ = get_player_id_by_actor_handle 1@ and its works!
 
Status
Not open for further replies.
Top