Help Help with skin ignore

kazkaS

Well-Known Member
Joined
Mar 30, 2018
Messages
96
Likes
1
Points
8
#1
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 [email protected] = 0 to 1000           
if 
0B20: samp [email protected] = actor_handle_by_samp_player_id [email protected]
then   
0665: get_actor [email protected] model_to [email protected]

If
[email protected] <= 6.0 // distance
THen
If and
[email protected] == TRUE
Not samp.ChatInputOpened
Key_Down 100
Then
if or 
Not [email protected] == 121 
Not [email protected] == 265
Not [email protected] == 266
Not [email protected] == 267
Not [email protected] == 285
Not [email protected] == 286
Not [email protected] == 287
Not [email protected] == 288
then
say "/check %i" [email protected]
wait 105 
end
end  
END
What i doing wrong? Code not full
 
OP
OP
kazkaS

kazkaS

Well-Known Member
Joined
Mar 30, 2018
Messages
96
Likes
1
Points
8
#6

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
921
Likes
4
Points
68
#7
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 [email protected] by that time using something like "chatmsg "var11=%d" -1 [email protected]" ?

Or is "say" line never reached at all?
 
OP
OP
kazkaS

kazkaS

Well-Known Member
Joined
Mar 30, 2018
Messages
96
Likes
1
Points
8
#9
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 [email protected] by that time using something like "chatmsg "var11=%d" -1 [email protected]" ?

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

Well-Known Member
Joined
Jun 23, 2014
Messages
921
Likes
4
Points
68
#10
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" [email protected]":
"chatmsg "var11=%d" -1 [email protected]"

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)
 
OP
OP
kazkaS

kazkaS

Well-Known Member
Joined
Mar 30, 2018
Messages
96
Likes
1
Points
8
#11
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" [email protected]":
"chatmsg "var11=%d" -1 [email protected]"

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

Well-Known Member
Joined
Jun 23, 2014
Messages
921
Likes
4
Points
68
#16
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 [email protected] == 121
Not [email protected] == 265
Not [email protected] == 266
Not [email protected] == 267
Not [email protected] == 285
Not [email protected] == 286
Not [email protected] == 287
Not [email protected] == 288
then
chatmsg "%d skin is NOT ignored (command is typed)" -1 [email protected]
0485:  return_true
else
chatmsg "%d skin is ignored" -1 [email protected]
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 [email protected]
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

Well-Known Member
Joined
Jan 2, 2017
Messages
699
Likes
5
Points
23
Location
Lithuania
Website
ugbase.eu
#18
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: [email protected] = player $PLAYER_CHAR targeted_actor //IF and SET
then
   0B2B: samp [email protected] = get_player_id_by_actor_handle [email protected]
   if
   056D: actor [email protected] defined
   then
       0665: get_actor [email protected] model_to [email protected]
       0AB1: @SkinIgnored 1 skin [email protected]
   end
end

end

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