CLEO Help get player id by knowing his name

CLEO related
Status
Not open for further replies.

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
simple but hard :/

i tried all methods that have gone through my head

can someone brighten me?

[shcode=cpp] 
alloc 0@ 36
format "Name" 0@
0B2B: samp 2@ = get_player_id_by_actor_handle 0@
free 0@
[/shcode]
 

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
52
Location
LongForgotten <-> 0x32789
doroftel said:
supahdupahnubah said:
doroftel said:
supahdupahnubah said:
actor handle != player name
simple but hard

supahdupahnubah != smart

help me :8

nigga you just insulted me, aint gonna help ya nauw

joo nigga taht didn't was a insult :/

lmfao you dont even know the != operator, it stands for "not"
So for example "8 != 7" means 8 isnt 7
You just typed: "supahdupahnubah isn't smart"

Thats kind of a insult. Imo it is.

Anyways, what supahdupahnubah meant that actor handle isnt a player name, its the handle of actor stored in a variable, you have to loop through all players and check if the SAMP.GetSAMPPlayerNameByID or whatever it is or what you wanna do output matches with your 0@ a.k.a the name string. use for loops, max player is 1000 but there are better way to loop for example use opcode.exe's ForAll Peds function
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
Anyways, what supahdupahnubah meant that actor handle isnt a player name, its the handle of actor stored in a variable, you have to loop through all players and check if the SAMP.GetSAMPPlayerNameByID or whatever it is or what you wanna do output matches with your 0@ a.k.a the name string. use for loops, max player is 1000 but there are better way to loop for example use opcode.exe's ForAll Peds function


i didnt knew about this opcode SAMP.GetPlayerNickname() igot what i hv to do :8 ty luv ya


for the tards that had the same problem

[shcode=cpp]
while true
wait 0
if 056D: actor $PLAYER_ACTOR defined
then
for 0@ = 0 to 999
1@ = SAMP.GetPlayerNickname(0@)
if 0C29: 2@ = stristr string1 1@ string2 "name"
then
chatmsg " mada faka i caught you " -1
chatmsg " %d" -1 0@
end
end
end
end
[/shcode]
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
im curious script will have enought time 2check all players(0-999) in just 350 ms (not more/not less cause im streamd out after)  ??

[shcode=cpp]
 if 20@ == 1
        then
            for 0@ = 0 to 999
            1@ = SAMP.GetPlayerNickname(0@)
            if 0C29: 2@ = stristr string1 1@ string2 "Kelton"
              then
                  0B20: samp 2@ = actor_handle_by_samp_player_id 0@
                  if 056D:   actor 2@ defined
                    then
                        20@ = 0
                        0B32:
                    end    
              end
            end
        end
end       [/shcode]

i could make a simple test if 0@ = 999 then chatmsg , if i get this message less than 350 ms(i could record to see frame by frame ) but i don't think its same thing, will my cpu influences it?
 

Kenshiro

Active member
Joined
Aug 20, 2017
Messages
43
Reaction score
0
Location
Oblivion
doroftel said:
im curious script will have enought time 2check all players(0-999) in just 350 ms (not more/not less cause im streamd out after)  ??

[shcode=cpp]
 if 20@ == 1
        then
            for 0@ = 0 to 999
            1@ = SAMP.GetPlayerNickname(0@)
            if 0C29: 2@ = stristr string1 1@ string2 "Kelton"
              then
                  0B20: samp 2@ = actor_handle_by_samp_player_id 0@
                  if 056D:   actor 2@ defined
                    then
                        20@ = 0
                        0B32:
                    end    
              end
            end
        end
end       [/shcode]

i could make a simple test if 0@ = 999 then chatmsg , if i get this message less than 350 ms(i could record to see frame by frame ) but i don't think its same thing, will my cpu influences it?

:no:
 
Status
Not open for further replies.
Top