CLEO Help Print text in chat samp

CLEO related
Status
Not open for further replies.

kakaka

Active member
Joined
Jun 7, 2014
Messages
59
Reaction score
0
Hello guys. I want to my cleo prints a text when I press a key. But when I press the key, it just cleans the chat.

Code:
// This file was decompiled using SASCM.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007
{$CLEO .cs}

//-------------MAIN---------------
thread 'LUKASS' 

:noname_1
wait 0 
if 
0AB0:   key_pressed 88
else_jump @noname_1 
0AF8: samp add_message_to_chat "hello" color 0xFFFFFF
jump  @noname_2

	


:noname_2
jump @noname_1
return

SS:
xBFC5Yi.jpg
 

kakaka

Active member
Joined
Jun 7, 2014
Messages
59
Reaction score
0
pepeelpubero link said:
You have the SB Data of sampfuncs?

Im downloaded and worked,Very thanks .

can you teach me how to make a command.when I type /test "NICKNAME",  print a text with the "NICKNAME" of the player that I have chosen in the chat?

I can do with id :
Code:
0B35: samp 31@ = get_last_command_params
0AD4:   0@ = scan_string 31@ format "%d" 1@
            0AF8: samp add_message_to_chat "{0xff6347}  you typed : %d " color 0xff6347 1@

i do of the %i is for the numbers,but when i add %s,no printing nothing.
 

pepeelpubero

Well-known member
Joined
Jan 21, 2014
Messages
433
Reaction score
1
%s = text
%d = numbers

I think you need a command to see player id, that is what you want?

With this if you aim a player and you press the number 1 it will say Nickname and ID of the aimed player, see the SS.

Code:
{$CLEO .cs}

0000: NOP

:PEPE_1
wait 0
if
key_down 49 // KEY 1 NOT NUMPAD.
jf @PEPE_1
if
0AD2: 0@ = player $PLAYER_CHAR targeted_actor 
0B2B: samp 1@ = get_player_id_by_actor_handle 0@ //gets the id of the player we are aiming.
0B36: samp 2@ = get_player_nickname 1@ // gets the nickname from 1@ = id of player aimed. 
0AF8: samp add_message_to_chat "I'm aiming to %s - ID %d." color 0xFF6347 2@ 1@ // this will say the nickname and ID of targeted player.
wait 1000
jump @PEPE_1

For example:
AEmRYQZ.png


With this you can get nickname and id of the player putting his NICKNAME. I don't know how to put a condition is the player you put is correct or not, wait an admin or moderator.  :watchout:

Taken from blasthack and modified.

Use: /getidnick [NICKNAME]

Code:
{$CLEO .cs}

0000: NOP
 
if 0@ = SAMP.Base()
then
    while not SAMP.Available()
        wait 500
    end
    0B34: samp register_client_command "getidnick" to_label @cmd
else end_thread
end
 
while true
    wait 0
end
 
:cmd
0B35: samp 0@ = get_last_command_params
0C17: 1@ = strlen 0@
if not 1@ == 0
then
    0ab1: @get_playerid_by_name 1 0@ 1@                                  
    0B36: samp 3@ = get_player_nickname 1@
    0AF8: samp add_message_to_chat "Player nickname: %s ==== ID: %d." color 0xFF6347 3@ 1@ 
else 0AF8: samp add_message_to_chat "Use /getidnick [nickname]" color 0xFF6347
end
0B43: samp cmd_ret
 
:get_playerid_by_name
for 1@ = 0 to 1000
    if SAMP.IsPlayerConnected(1@)
    then
        2@ = SAMP.GetPlayerNickname(1@)
        if 0C14: strcmp string1 0@ string2 2@
        then break
        end
    end
end
0ab2: 1 1@

SS:
gLGbO4N.png


The first code is chat.cs and the second code is idandnick.cs on the attachments.
 

Attachments

  • chat.cs
    17.7 KB · Views: 241
  • idandnick.cs
    18.3 KB · Views: 60

kakaka

Active member
Joined
Jun 7, 2014
Messages
59
Reaction score
0
Its worked,i love you =D thanks man

But you can tell me how to do print text when the player is logging?
 
Status
Not open for further replies.
Top