CLEO Help Get server player name and check from file

CLEO related
Status
Not open for further replies.

Parazitas

God
Joined
Jan 2, 2017
Messages
3,113
Solutions
5
Reaction score
878
Location
Lithuania
How i can get server player name from file with opcode:
0A9A: 0@ = openfile "settings.ini" mode 0x72 ?

I tired use this opcode:
0AF4: 0@v = read_string_from_ini_file "cleo\config.ini" section "SectionName" key "stringKey"

Code for explane:
[shcode=cpp]
{$CLEO .cs}

0000: NOP

repeat
wait 0
until 0afa:

while true
wait 0
for 1@ = 0 to 1000

if
0B61:  samp is_local_player_spawned
then      
    if 0B23: samp is_player_connected 1@
    then
        0B36: samp 2@ = get_player_nickname 1@
        0A9A: 0@ = openfile "settings.txt" mode 0x72
        if
        0C14: strcmp string1 0@ string2 2@
        then 
            printf "Name: %s" 1337 0@
        end
    end
end



end // end for 1@ = 0 to 1000
end // end while true


[/shcode]

@supahdupahnubah
@springfield
@0x32789
etc...
 

WaTTi

Well-known member
Joined
Jan 4, 2015
Messages
260
Reaction score
8
Code:
0A9A: 0@ = openfile "settings.txt" mode "rt" // maybe you should try "cleo\settings.txt" ? 
alloc 1@ 26
alloc 2@ 26

for 3@ = 0 to 100
    if 0B23: 3@ 
    then 
        0B36: samp 2@ = get_player_nickname 3@// get the nick
        while 0AD6:   end_of_file 0@ reached
        wait 0
            0AD7: read_string_from_file 0@ to 1@ size 26   // read the line in the file     
            if 0C14: strcmp string1 0@ string2 1@
            then chatmsg "boy %s is online." -1 0@
            end
        end
    end
end

    
 
Status
Not open for further replies.
Top