CLEO Help Help with skin ignore

CLEO related
Status
Not open for further replies.

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
So im trying to make cleo when i press numpad 4, its says /check id. So the problem is, i want to make it with skin ignore. Example if player wearing skin id 285, then script will not say /check id.
Code:

Code:
 for 9@ = 0 to 1000           
if 
0B20: samp 10@ = actor_handle_by_samp_player_id 9@
then   
0665: get_actor 10@ model_to 11@

If
7@ <= 6.0 // distance
THen
If and
13@ == TRUE
Not samp.ChatInputOpened
Key_Down 100
Then
if or 
Not 11@ == 121 
Not 11@ == 265
Not 11@ == 266
Not 11@ == 267
Not 11@ == 285
Not 11@ == 286
Not 11@ == 287
Not 11@ == 288
then
say "/check %i" 0@
wait 105 
end
end  
END

What i doing wrong? Code not full
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
it's a logic mistake

[shcode=python]if or
Not 11@ == 121
Not 11@ == 265
Not 11@ == 266
Not 11@ == 267
Not 11@ == 285
Not 11@ == 286
Not 11@ == 287
Not 11@ == 288
then[/shcode]

This condition will always return true, it should be "if and"
 

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
monday said:
it's a logic mistake

[shcode=python]if or
Not 11@ == 121
Not 11@ == 265
Not 11@ == 266
Not 11@ == 267
Not 11@ == 285
Not 11@ == 286
Not 11@ == 287
Not 11@ == 288
then[/shcode]

This condition will always return true, it should be "if and"
I was tried it to, same problem.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
so what's the actual problem? Is the code reaching the "say" line? If that's the case then did you try to check what is the state of 11@ by that time using something like "chatmsg "var11=%d" -1 11@" ?

Or is "say" line never reached at all?
 

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
monday said:
so what's the actual problem? Is the code reaching the "say" line? If that's the case then did you try to check what is the state of 11@ by that time using something like "chatmsg "var11=%d" -1 11@" ?

Or is "say" line never reached at all?

I mean if i nearly player, and press numpad 4, its say /check id. So i trying to do, if nearly player is wearing skin 285 and other, so cleo will not say /check id to that man whos wearing skin 285. Sorry for bad english.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
but that's the aim, the goal, so you wrote some code to reach that goal, tested it and I assume you encountered a problem right? And the problem was:
1. "/check" command being sent despite skin being one of the ones to be ignored?
2. No command being sent at all for any skin?

If the first of the options above was the problem then I'd start with adding the following line above the "say "/check %i" 0@":
"chatmsg "var11=%d" -1 11@"

Then check in game and observe the chat looking for "var11=" line after you press numpad 4

Btw make sure that you dont have 2 versions of the same cleo mod in cleo folder at the same time (e.g. 1 called "my_mod.cs" and the other one "my_mod[1].cs)
 

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
monday said:
but that's the aim, the goal, so you wrote some code to reach that goal, tested it and I assume you encountered a problem right? And the problem was:
1. "/check" command being sent despite skin being one of the ones to be ignored?
2. No command being sent at all for any skin?

If the first of the options above was the problem then I'd start with adding the following line above the "say "/check %i" 0@":
"chatmsg "var11=%d" -1 11@"

Then check in game and observe the chat looking for "var11=" line after you press numpad 4

Btw make sure that you dont have 2 versions of the same cleo mod in cleo folder at the same time (e.g. 1 called "my_mod.cs" and the other one "my_mod[1].cs)

The problem is that its still say /check on players whos wearing skin 285.
Yes, "/check" command being sent despite skin being one of the ones to be ignored.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
idk why it doesn't work because the condition you posted earlier was alright (if changed to "if and")
Code:
{$CLEO}
0000:

repeat
wait 50
until 0AFA:  is_samp_available

0AB1: call_scm_func @SkinNotIgnored 1 skin 285
0AB1: call_scm_func @SkinNotIgnored 1 skin 288
0AB1: call_scm_func @SkinNotIgnored 1 skin 121
0AB1: call_scm_func @SkinNotIgnored 1 skin 50

end_thread

:SkinNotIgnored
if and
Not 0@ == 121
Not 0@ == 265
Not 0@ == 266
Not 0@ == 267
Not 0@ == 285
Not 0@ == 286
Not 0@ == 287
Not 0@ == 288
then
chatmsg "%d skin is NOT ignored (command is typed)" -1 0@
0485:  return_true
else
chatmsg "%d skin is ignored" -1 0@
059A:  return_false
end
ret 0

The chat output of that code is:
285 skin is ignored
288 skin is ignored
121 skin is ignored
50 skin is NOT ignored (command is typed)

You could use that function like:
Code:
if 0AB1: call_scm_func @SkinNotIgnored 1 skin 11@
then
//send command
end
(just comment out the debug chatmsg lines)


If it still doesn't work you could just post the full code you're using

Btw I'm using cleo 4.1 in case if it makes any difference
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
If i not doing wrong , this skin ignore you can use when try create aim

[shcode=cpp]
{$CLEO}
0000:

repeat
wait 50
until 0AFA:  is_samp_available

while true
wait 0

if
0AD2: 0@ = player $PLAYER_CHAR targeted_actor //IF and SET
then
   0B2B: samp 1@ = get_player_id_by_actor_handle 0@
   if
   056D: actor 1@ defined
   then
       0665: get_actor 1@ model_to 2@
       0AB1: @SkinIgnored 1 skin 2@
   end
end

end

:SkinNotIgnored
if and
0@ == 121
0@ == 265
0@ == 266
0@ == 267
0@ == 285
0@ == 286
0@ == 287
0@ == 288
then
   printf "%d skin is ignored" 1337 0@
   059A:  return_false 
else
   0485:  return_true
   printf "%d skin is NOT ignored (command is typed)" 1337 0@
end
ret 0
[/shcode]
 
Status
Not open for further replies.
Top