CLEO Help Get player ID.

CLEO related
Status
Not open for further replies.

magyi

Member
Joined
May 4, 2017
Messages
10
Reaction score
0
Hello, somebody can help me?
I try to make a test log for S.I in sanny builder , but i dont know how to get player id ... not player nickname.
 

magyi

Member
Joined
May 4, 2017
Messages
10
Reaction score
0
Dont work man..


:cmd_27
SAMP.IsCommandTyped(20@)
if
0AD4: 20@ = scan_string 20@ format "%d" 21@
then
0B2B: samp 1@ = get_player_id_by_actor_handle 0@
chatmsg "{6699ff}Hello %s" 1@

else
print "~y~/glg ID-ul lui." 2000
end
SAMP.CmdRet()
 

magyi

Member
Joined
May 4, 2017
Messages
10
Reaction score
0
Man dont work ..
:cmd_27
SAMP.IsCommandTyped(20@)
if
0AD4: 20@ = scan_string 20@ format "%d" 21@
then
0B2B: samp 1@ = get_player_id_by_actor_handle 21@
chatmsg "{6699ff}Hello %i" 21@

else
print "~y~/glg ID-ul lui." 2000
end
SAMP.CmdRet()


common
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,131
Solutions
5
Reaction score
884
Location
Lithuania
I not rly understad what you trying make, but maybe you mean this .

[shcode=cpp]
{$CLEO .cs}
0000:


REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

0B34: "playerid" @Command

alloc 21@ 200

WHILE TRUE
   WAIT 0
END

:Command
0B35: samp 20@ = get_last_command_params
if
0AD4: 20@ = scan_string 20@ format "%d" 21@
then
0B2B: samp 1@ = get_player_id_by_actor_handle 0@
chatmsg "{6699ff}Hello %d" 21@
else
print "~y~/glg ID-ul lui." 2000
end
[/shcode]
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
You already have the player ID, 21@ contains the ID you've used in the /glg <id> command.
Your question is vague, try adding more details or a concrete explanation.
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
0AD4 requires valid return variable, chatmsg requires color (integer) as the second parameter, otherwise you'll crash
Anyway springfield is right, if you did want this code to do something else but print Hello and an input number, then it's your problem you haven't explained it correctly
Code:
SAMP.IsCommandTyped(20@)
if
0AD4: $NOT_USED = 20@ "%d" 21@
then
chatmsg "Hello %i" 0xFFFFFF 21@
else
print "~y~/glg ID-ul lui." 2000
end
SAMP.CmdRet()
 

magyi

Member
Joined
May 4, 2017
Messages
10
Reaction score
0
Okey so IF i inser the command /glg + ID should to say Hello and id player ex: ''Hello 282'' you know?


supahdupahnubah said:
Well, you really shouldn't crash with my code above
http://imgur.com/a/42xeO


[font=arial, sans-serif]That's what I wanted[/font]


supahdupahnubah said:
0AD4 requires valid return variable, chatmsg requires color (integer) as the second parameter, otherwise you'll crash
Anyway springfield is right, if you did want this code to do something else but print Hello and an input number, then it's your problem you haven't explained it correctly
Code:
SAMP.IsCommandTyped(20@)
if
0AD4: $NOT_USED = 20@ "%d" 21@
then
chatmsg "Hello %i" 0xFFFFFF 21@
else
print "~y~/glg ID-ul lui." 2000
end
SAMP.CmdRet()
THX MAN YOU ARE THE BEST ! :d
 
Status
Not open for further replies.
Top