CLEO Help Getting own player's ID and username

CLEO related
Status
Not open for further replies.

Lukahlyo

Member
Joined
Nov 11, 2018
Messages
20
Reaction score
1
This crashes every time. What can I possibly be doing wrong here?

PHP:
{$CLEO .cs}

0000:

REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
   WAIT 0


REPEAT
   WAIT 0
UNTIL 0B61:  samp is_local_player_spawned
WHILE TRUE
    WAIT 0
    0AC8: 2@ = allocate_memory_size 260
    0AC8: 3@ = allocate_memory_size 260
    IF
        player.Defined($PLAYER_ACTOR)
        THEN
        wait 0
        0B36: samp 2@ = get_player_nickname $PLAYER_ACTOR
        0B65: samp 3@ = player $PLAYER_ACTOR score
        0AF8: samp add_message_to_chat "DEBUG: %d %s" 3@ 2@ color 0x009999
        END
    END
END
 

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
The 0B36: samp 2@ = get_player_nickname requires the ID, not handle, so:

PHP:
{$CLEO .cs}
0000:

repeat
wait 10
until Samp.Available()

while true
wait 0
    0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR
    0B36: samp 1@ = get_player_nickname 0@
    printf "Name: %s ID: %d" 400 1@ 0@ 
end
 
Last edited:
Status
Not open for further replies.
Top