CLEO Help [HELP] im stuck

CLEO related
Status
Not open for further replies.

GoodMan

Active member
Joined
Jun 4, 2014
Messages
142
Reaction score
0
Hello, need some hlep, i don't know what im doing WRONG!
2 hours trying to make it work but i can't

this script its supposed to spam my chat while a player is holding micro smg in him(only while hes holding it)

but i shows nothin , what i did wrong?

{$CLEO .cs}
0000: NOP

:LABEL_1
wait 0
if
0B23:  samp is_player_connected 1@
jf @LABEL_1
0B20: samp 31@ = actor_handle_by_samp_player_id 1@
if
056D:   actor 1@ defined
jf @LABEL_1
if
02D8:   actor 1@ current_weapon == 32
jf @LABEL_1
0B2B: samp 2@ = get_player_id_by_actor_handle 31@
3@ = SAMP.GetPlayerNickname(2@)
4@ = SAMP.GetPlayerHealthByActorHandle(31@)
5@ = Samp.GetPlayerArmorByActorHandle(31@)
6@ = Samp.GetPlayerScore(2@)
7@ = SAMP.GetPlayerPing(2@)
chatmsg "%s %d %d $%d %d has microsg, run motherfucker" -1 3@ 4@ 5@ 6@ 7@
jump @LABEL_1
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,151
Solutions
5
Reaction score
893
Location
Lithuania
PHP:
{$CLEO .cs}

0000: NOP

repeat
wait 0
until 0afa:

while true
wait 0
FOR 1@ = 0 to 999

if
0B23:  samp is_player_connected 1@
then
    0B20: samp 31@ = actor_handle_by_samp_player_id 1@
    0B20: samp 30@ = actor_handle_by_samp_player_id $PLAYER_ACTOR
    if and
    not 31@ == 30@ // not same id like you
    056D:   actor 31@ defined
    then
        if
        02D8:   actor 31@ current_weapon == 32
        then
            3@ = SAMP.GetPlayerNickname(31@)
            4@ = SAMP.GetPlayerHealthByActorHandle(31@)
            5@ = Samp.GetPlayerArmorByActorHandle(31@)
            6@ = Samp.GetPlayerScore(31@)
            7@ = SAMP.GetPlayerPing(31@)
            chatmsg "%s %d %d $%d %d has microsg, run motherfucker" -1 3@ 4@ 5@ 6@ 7@
        end
    end
end
end
end
 

_=Gigant=_

Well-known member
Joined
Mar 21, 2017
Messages
353
Reaction score
16
GoodMan said:
Hello, need some hlep, i don't know what im doing WRONG!
2 hours trying to make it work but i can't


Code:
{$CLEO}
0000:

repeat 
wait 0
until Samp.Available()

0B34: "pstats" @GetInfo

while true
wait 0
end

:GetInfo
wait 0
SAMP.IsCommandTyped(0@)
if
0AD4: 0@ = scan_string 0@ format "%d" 1@
if
SAMP.IsPlayerConnected(1@)
then
0B20: samp 2@ = actor_handle_by_samp_player_id 1@
if
056D: actor 2@ defined
THEN
0B2A: samp 3@ = get_player_ping 1@
0B36: samp 4@ = get_player_nickname 1@
0B25: samp 5@ = get_player_health 1@
0B26: samp 6@ = get_player_armor 1@
0470: 7@  = actor 2@ current_weapon
0B65: samp 8@ = player 1@ score
0665: get_actor 2@ model_to 1@
0AF8: samp add_message_to_chat "{FF0000}Info Of {FFFFFF}%s :: Skin:%d :: Ping %d :: {FF0000}Health %d {FFFFFF}:: Armor %d :: Weapon ID %d :: Score %d" 4000 4@ 1@ 3@ 5@ 6@ 7@ 8@
end
end
cmdret

/pstats <player id> and message in chat will pop up

https://s17.postimg.org/57xg1gwkf/sa-mp-109.png
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
@Parazitas
does it actually work?

"056D: actor 1@ defined" - should be using 31@ (gta ped id) instead of 1@ (samp id) as far as I know
"SAMP.GetPlayerNickname(31@)" - does it work with gta ped id too?
"6@ = Samp.GetPlayerScore(2@)" - 2@ is not initialized anywhere
"7@ = SAMP.GetPlayerPing(2@)" - same
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,151
Solutions
5
Reaction score
893
Location
Lithuania
monday said:
@Parazitas
does it actually work?

"056D:   actor 1@ defined"                        - should be using 31@ (gta ped id) instead of 1@ (samp id) as far as I know
"SAMP.GetPlayerNickname(31@)"        - does it work with gta ped id too?
"6@ = Samp.GetPlayerScore(2@)"        - 2@ is not initialized anywhere
"7@ = SAMP.GetPlayerPing(2@)"           - same

I NOT TESTED.
 

GoodMan

Active member
Joined
Jun 4, 2014
Messages
142
Reaction score
0
I'm very glad guys, i couln't make it work without all of you
Here is the code i choose and i modified it a little to make it work:

Code:
{$CLEO .cs}

0000: NOP

repeat
wait 0
until 0AFA:  is_samp_available

while true
wait 1000
FOR 1@ = 0 to 999

if
0B23:  samp is_player_connected 1@
then
    0B20: samp 31@ = actor_handle_by_samp_player_id 1@
    //0B20: samp 30@ = actor_handle_by_samp_player_id $PLAYER_ACTOR
    if //and
    //not 31@ == 30@ // not same id like you
    056D:   actor 31@ defined
    then
        if
        02D8:   actor 31@ current_weapon == 32
        then
        0B2B: samp 2@ = get_player_id_by_actor_handle 31@

            3@ = SAMP.GetPlayerNickname(2@)
            4@ = SAMP.GetPlayerHealthByActorHandle(2@)
            5@ = Samp.GetPlayerArmorByActorHandle(2@)
            6@ = Samp.GetPlayerScore(2@)
            7@ = SAMP.GetPlayerPing(2@)
            8@ = SAMP.GetPlayerColor(2@)
            chatmsg "(%d)%s {ff6d6d}%d {8a959b}%d {008000}$%d {00ecff}%d {404040}has tec-9" 8@ 2@ 3@ 4@ 5@ 6@ 7@
        end
    end
end
end
end
As i said my intention is to spam mainchat with text and this is what it does, thanks!

Because first version drops my fps a little i added a delay of 1000 sec and works better but i made a second version and here is it:

Code:
{$CLEO .cs}

0000: NOP

repeat
wait 0
until 0AFA:  is_samp_available
0B6D: render 10@ = create_font "tahoma" height 7 flags 0x5

while true
wait 0
FOR 1@ = 0 to 999

if
0B23:  samp is_player_connected 1@
then
    0B20: samp 31@ = actor_handle_by_samp_player_id 1@
    if
    056D:   actor 31@ defined
    then
        if
        02D8:   actor 31@ current_weapon == 32
        then
        0B2B: samp 2@ = get_player_id_by_actor_handle 31@

            3@ = SAMP.GetPlayerNickname(2@)
            4@ = SAMP.GetPlayerHealthByActorHandle(2@)
            5@ = Samp.GetPlayerArmorByActorHandle(2@)
            6@ = Samp.GetPlayerScore(2@)
            7@ = SAMP.GetPlayerPing(2@)
            8@ = SAMP.GetPlayerColor(2@)
            0AC8: 20@ = 256
            0AD3: 20@ = "(%d)%s {ff6d6d}%d {8a959b}%d {008000}$%d {00ecff}%d {404040}has UZI" 2@ 3@ 4@ 5@ 6@ 7@
            0B6F: render font 10@ draw_text 20@ pos 5 140 color 8@
            0AC9: 20@
        end
    end
end
end
end
V2 draws a font instead of spamin mainchat like first version but the problem is, if more than 1 player is holding tec9, then, cleo will keep rendering player info into same pos, i mean, draws the text over itself, is there a way to make a separate pos if more than 1 player is holding tec9?

not necessary but im curious.. THNAKS A LOT
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,151
Solutions
5
Reaction score
893
Location
Lithuania
PHP:
{$CLEO .cs}

0000: NOP

repeat
wait 0
until 0AFA:  is_samp_available
0B6D: 10@ = CREATE_FONT "tahoma" HEIGHT 7 FLAGS 0x5
0BFC: set_global_var "font" = 10@

while true
wait 0
FOR 1@ = 0 to 999

if
0B23:  samp is_player_connected 1@
then
   0B20: samp 31@ = actor_handle_by_samp_player_id 1@
   if
   056D:   actor 31@ defined
   then
       if
       02D8:   actor 31@ current_weapon == 32
       then
       0B2B: samp 2@ = get_player_id_by_actor_handle 31@

           3@ = SAMP.GetPlayerNickname(2@)
           4@ = SAMP.GetPlayerHealthByActorHandle(2@)
           5@ = Samp.GetPlayerArmorByActorHandle(2@)
           6@ = Samp.GetPlayerScore(2@)
           7@ = SAMP.GetPlayerPing(2@)
           8@ = SAMP.GetPlayerColor(2@)
           0AC8: 20@ = 256
           0AD3: 20@ = "(%d)%s {ff6d6d}%d {8a959b}%d {008000}$%d {00ecff}%d {404040}has UZI" 2@ 3@ 4@ 5@ 6@ 7@
           0BFD: 10@ = get_global_var "font"
           0B6F: render font 10@ draw_text 20@ pos 5 140 color 8@
           0AC9: 20@
       end
   end
end
end
end
 
Status
Not open for further replies.
Top