CLEO Help Cleo scripts on player nicknames

CLEO related
Status
Not open for further replies.

BigMan

Member
Joined
Nov 30, 2017
Messages
22
Reaction score
0
Hello guys, i wanna ask u h[font=arial, sans-serif]ow to make cleo script only on a player nickname PVZ: Script made on nick Blablabla_Blablala 
[size=medium][font=arial, sans-serif]and if another nickname script does not work automatically. 
[font=arial, sans-serif]I think you understand about that Sorry for bad english[/font][/font]
[/font][/size]


[font=arial, sans-serif][size=medium][font=arial, sans-serif][font=arial, sans-serif]@springfield[/font][/font][/font][/size]
[font=arial, sans-serif][size=medium][font=arial, sans-serif][font=arial, sans-serif]@opcode[/font][/font][/font][/size]
 

Edvincik

Well-known member
Joined
Mar 15, 2016
Messages
399
Reaction score
26
BigMan said:
Hello guys, i wanna ask u h[font=arial, sans-serif]ow to make cleo script only on a player nickname PVZ: Script made on nick Blablabla_Blablala 
[size=medium][font=arial, sans-serif]and if another nickname script does not work automatically. 
[font=arial, sans-serif]I think you understand about that Sorry for bad english[/font][/font]
[/font][/size]


[font=arial, sans-serif][size=medium][font=arial, sans-serif][font=arial, sans-serif]@springfield[/font][/font][/font][/size]
[font=arial, sans-serif][size=medium][font=arial, sans-serif][font=arial, sans-serif]@opcode[/font][/font][/font][/size]

Use 0C18
 

BigMan

Member
Joined
Nov 30, 2017
Messages
22
Reaction score
0
Malchik said:
BigMan said:
Hello guys, i wanna ask u h[font=arial, sans-serif]ow to make cleo script only on a player nickname PVZ: Script made on nick Blablabla_Blablala 
[size=medium][font=arial, sans-serif]and if another nickname script does not work automatically. 
[font=arial, sans-serif]I think you understand about that Sorry for bad english[/font][/font]
[/font][/size]


[font=arial, sans-serif][size=medium][font=arial, sans-serif][font=arial, sans-serif]@springfield[/font][/font][/font][/size]
[font=arial, sans-serif][size=medium][font=arial, sans-serif][font=arial, sans-serif]@opcode[/font][/font][/font][/size]

Use 0C18

What next?
 

Edvincik

Well-known member
Joined
Mar 15, 2016
Messages
399
Reaction score
26
BigMan said:
Malchik said:
BigMan said:
Hello guys, i wanna ask u h[font=arial, sans-serif]ow to make cleo script only on a player nickname PVZ: Script made on nick Blablabla_Blablala 
[size=medium][font=arial, sans-serif]and if another nickname script does not work automatically. 
[font=arial, sans-serif]I think you understand about that Sorry for bad english[/font][/font]
[/font][/size]


[font=arial, sans-serif][size=medium][font=arial, sans-serif][font=arial, sans-serif]@springfield[/font][/font][/font][/size]
[font=arial, sans-serif][size=medium][font=arial, sans-serif][font=arial, sans-serif]@opcode[/font][/font][/font][/size]

Use 0C18

What next?
Get player nickname and then compare it with 0C18
 

BigMan

Member
Joined
Nov 30, 2017
Messages
22
Reaction score
0
0B36: samp 4@ = get_player_nickname 1@
0C18: 4@ = strstr string1 0@ string2 "Blablabla_Blablabla" 1@

/// what am i doing wrong?
 

_=Gigant=_

Well-known member
Joined
Mar 21, 2017
Messages
353
Reaction score
16
BigMan said:
0B36: samp 4@ = get_player_nickname 1@
0C18: 4@ = strstr string1 0@ string2 "Blablabla_Blablabla" 1@

/// what am i doing wrong?

0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR 
0B36: samp 0@ = get_player_nickname 0@
printf "Name: %s" 3000 0@ 

so...

Code:
{$CLEO .cs}
0000:

repeat
wait 10
until Samp.Available()

0B34: ".name" @MyName

while true 
wait 0
end

:MyName
wait 0
0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR 
0B36: samp 0@ = get_player_nickname 0@
printf "Name: %s" 400 0@ 
cmdret

Get player current skin id code will be

[font=Monaco, Consolas, Courier, monospace]0665: get_actor $PLAYER_ACTOR model_to 0@[/font]
[font=Monaco, Consolas, Courier, monospace]printf "Skin ID: %d" 4000 0@[/font]

Code:
{$CLEO .cs}
0000:

repeat
wait 10
until Samp.Available()

0B34: ".skin" @MySkin

while true 
wait 0
end

:MySkin
wait 0
0665: get_actor $PLAYER_ACTOR model_to 0@
printf "Skin ID: %d" 4000 0@
cmdret

Get Player Ping code will be 

0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR 
0B2A: samp 0@ = get_player_ping 0@
printf "Ping: %d" 3000 0@

Code:
{$CLEO .cs}
0000:

repeat
wait 10
until Samp.Available()

0B34: ".ping" @MyPing

while true 
wait 0
end

:MyPing
wait 0
0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR 
0B2A: samp 0@ = get_player_ping 0@
printf "Ping: %d" 3000 0@
cmdret

[attachment=5376]
[attachment=5377]
[attachment=5378]
 

Attachments

  • MyName.cs
    17.5 KB · Views: 22
  • MyPing.cs
    17.5 KB · Views: 17
  • MySkin.cs
    17.5 KB · Views: 17

BigMan

Member
Joined
Nov 30, 2017
Messages
22
Reaction score
0
_=Gigant=_ said:
BigMan said:
0B36: samp 4@ = get_player_nickname 1@
0C18: 4@ = strstr string1 0@ string2 "Blablabla_Blablabla" 1@

/// what am i doing wrong?

0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR 
0B36: samp 0@ = get_player_nickname 0@
printf "Name: %s" 3000 0@ 

so...

Code:
{$CLEO .cs}
0000:

repeat
wait 10
until Samp.Available()

0B34: ".name" @MyName

while true 
wait 0
end

:MyName
wait 0
0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR 
0B36: samp 0@ = get_player_nickname 0@
printf "Name: %s" 400 0@ 
cmdret

Get player current skin id code will be

[font=Monaco, Consolas, Courier, monospace]0665: get_actor $PLAYER_ACTOR model_to 0@[/font]
[font=Monaco, Consolas, Courier, monospace]printf "Skin ID: %d" 4000 0@[/font]

Code:
{$CLEO .cs}
0000:

repeat
wait 10
until Samp.Available()

0B34: ".skin" @MySkin

while true 
wait 0
end

:MySkin
wait 0
0665: get_actor $PLAYER_ACTOR model_to 0@
printf "Skin ID: %d" 4000 0@
cmdret

Get Player Ping code will be 

0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR 
0B2A: samp 0@ = get_player_ping 0@
printf "Ping: %d" 3000 0@

Code:
{$CLEO .cs}
0000:

repeat
wait 10
until Samp.Available()

0B34: ".ping" @MyPing

while true 
wait 0
end

:MyPing
wait 0
0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR 
0B2A: samp 0@ = get_player_ping 0@
printf "Ping: %d" 3000 0@
cmdret
 
[font=arial, sans-serif]LOL you not understand what I mean[/font]
 

_=Gigant=_

Well-known member
Joined
Mar 21, 2017
Messages
353
Reaction score
16
use 
Render.DrawText() 
SAMP.Convert3DCoordsToScreen()
alt + lctrl + 2 

i think you'll need 0AA6: call_method for this idk
 

BigMan

Member
Joined
Nov 30, 2017
Messages
22
Reaction score
0
I mean cleo script created on the player name pvz: Blabla_Blabla and if another player use it, with another name, the cleo script would not work for him.
 

Edvincik

Well-known member
Joined
Mar 15, 2016
Messages
399
Reaction score
26
BigMan said:
0B36: samp 4@ = get_player_nickname 1@
0C18: 4@ = strstr string1 0@ string2 "Blablabla_Blablabla" 1@

/// what am i doing wrong?

you have to get the nick and then check it with if condition and 0C18
 

BigMan

Member
Joined
Nov 30, 2017
Messages
22
Reaction score
0
Malchik said:
BigMan said:
0B36: samp 4@ = get_player_nickname 1@
0C18: 4@ = strstr string1 0@ string2 "Blablabla_Blablabla" 1@

/// what am i doing wrong?

you have to get the nick and then check it with if condition and 0C18

Krc lietuvis tu gal? o jei ne tai

I have not forgotten about coding names
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Get the local player name .
0B36: samp 0@ = get_player_nickname $PLAYER_CHAR
Compare with 'Blablabla_Blablabla'.
0C21: stricmp string1 0@ string2 "Blablabla_Blablabla"
Based on the result, either allow script or end it using
0A93: end_custom_thread

This is trivial, it can easily be bypassed.
 

BigMan

Member
Joined
Nov 30, 2017
Messages
22
Reaction score
0
springfield said:
Get the local player name .
0B36: samp 0@ = get_player_nickname $PLAYER_CHAR
Compare with 'Blablabla_Blablabla'.
0C21: stricmp string1 0@ string2 "Blablabla_Blablabla"
Based on the result, either allow script or end it using
0A93: end_custom_thread

This is trivial, it can easily be bypassed.

u meen 0B29: samp get_local_name "Blabla_Blabla" not set_local_name ?
 

Edvincik

Well-known member
Joined
Mar 15, 2016
Messages
399
Reaction score
26
springfield said:
If you want to check the current player name, you need to GET it, not set it. Or i've misunderstood what you want to achieve.

You understood everything correctly, he's just a dumb
 

BigMan

Member
Joined
Nov 30, 2017
Messages
22
Reaction score
0
springfield said:
If you want to check the current player name, you need to GET it, not set it. Or i've misunderstood what you want to achieve.

I mean cleo script created on the player name pvz: Blabla_Blabla and if another player use it, with another name, the cleo script would not work for him.
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
BigMan said:
I mean cleo script created on the player name pvz: Blabla_Blabla and if another player use it, with another name, the cleo script would not work for him.

And where is the problem? The concept is simple
1. Get the local player name(the player who is using the script) -> use SF opcode 0B36
2. Compare the name as string against "Blabla_Blabla" using opcode 0C21.
3. Based on the result from op. 0C21 either allow script execution or terminate it.
 

BigMan

Member
Joined
Nov 30, 2017
Messages
22
Reaction score
0
springfield said:
BigMan said:
I mean cleo script created on the player name pvz: Blabla_Blabla and if another player use it, with another name, the cleo script would not work for him.

And where is the problem? The concept is simple
1. Get the local player name(the player who is using the script) -> use SF opcode 0B36
2. Compare the name as string against "Blabla_Blabla" using opcode 0C21.
3. Based on the result from op. 0C21 either allow script execution or terminate it.


[font=arial, sans-serif]I dont understand this. 3. Based on the result from op. 0C21 either allow script execution or terminate it. [font=arial, sans-serif][size=medium]how to execute[/font][/font][/size]
[font=arial, sans-serif][font=arial, sans-serif][size=medium]for execution i have to use 0C14 opcode?[/font][/font][/size]
 
Status
Not open for further replies.
Top