CLEO Help / Q when connecting specific players

CLEO related
Status
Not open for further replies.

ollydbg

Active member
Joined
Jun 3, 2017
Messages
39
Reaction score
23
Hi, I'm looking for a cleo that when connecting a specific player to a list, immediately get me out of the server.

example:
I am connected to a server and if this user Carlos_Martin is connected disconnect me from the server.
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
273
method 1;
loop through all connected players every 500ms, check their names, if they match Carlos_Martin, disconnect.
method 2;
hook incomging RPCs, specifically RPC_SCRSERVERJOIN, same as above, compare the name, and disconnect.

some opcodes you'd need;
0B23:  samp is_player_connected 1@
0B36: samp 2@ = get_player_nickname 1@
0C21: stricmp string1 0@ string2 1@
0BE3: raknet setup_incoming_rpc_hook 0@
0B28: samp disconnect_with_reason 1@

[shcode=cpp]
struct RPC_SCRSERVERJOIN
{
   uint16_t sPlayerId;
   uint32_t dwColor;
   uint8_t bIsNPC;
   uint8_t nLength;
   char szName[nLength];
};
[/shcode]
 

0BE4

Active member
Joined
Jan 15, 2017
Messages
124
Reaction score
2
If you are new i recommend you use Method 1... Method 2 is much better to be but it will take a lot more coding skills
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
937
Location
Lithuania
ollydbg said:
Hi, I'm looking for a cleo that when connecting a specific player to a list, immediately get me out of the server.

example:
I am connected to a server and if this user Carlos_Martin is connected disconnect me from the server.

One time i creating something similar like you want..., so i edited and here is code.... 
[shcode=cpp]
{$CLEO .cs}
0000:
 
 
REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY 
 
0AC8: 3@ = allocate_memory_size 260
 
 
WHILE TRUE
   WAIT 0
    
IF 0B61:  samp is_local_player_spawned
THEN
   0AF4: 3@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName1"
   0AF4: 3@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName2"
   0AF4: 3@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName3"
   0AF4: 3@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName4"
   0AF4: 3@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName5"
   0AF4: 3@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName6"
   0AF4: 3@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName7"
   0AF4: 3@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName8"
   0AF4: 3@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName9"
   0AF4: 3@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName10"
   FOR 0@ = 0 TO 1000
       IF 0B23: samp is_player_connected 0@
       THEN
           0B36: samp 1@ = get_player_nickname 0@
           IF 0C14: strcmp string1 1@ string2 3@
           THEN
           say "/q"
           wait 1000 /// Anti spam
           END   /// END 0B61:  samp is_local_player_spawned
       END   /// END FOR 0@ = 0 TO 1000
   END   /// END 0B23: samp is_player_connected 0@
END   /// END 0C14: strcmp string1 1@ string2 3@
 
END   /// END WHILE TRUE
[/shcode]
 

ollydbg

Active member
Joined
Jun 3, 2017
Messages
39
Reaction score
23
0BE4 said:
If you are new i recommend you use Method 1... Method 2 is much better to be but it will take a lot more coding skills

You give me the file .ini running
 

ollydbg

Active member
Joined
Jun 3, 2017
Messages
39
Reaction score
23
Create the file but it does not seem to work ..

Cleo / INI / Players.ini

Inside the .ini file add

Carlos_Martin
 

0BE4

Active member
Joined
Jan 15, 2017
Messages
124
Reaction score
2
easyyyyyyyyyyyy... make a file named players.ini with a section named players with names under it from player1 to player10.
 

0BE4

Active member
Joined
Jan 15, 2017
Messages
124
Reaction score
2
yup... you keep setting 3@...

it's like saying
Hey 3@ is "Hello"
Hey 3@ is "Hello2"
Hey 3@ is "Hello3"
Hey 3@ is "Hello4"
Hey 3@ is "Hello5"

Keep checking if 3@ is online... all past definitions get thrown in the trash
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
937
Location
Lithuania
ollydbg said:
Create the file but it does not seem to work ..

Cleo / INI / Players.ini

Inside the .ini file add

Carlos_Martin

Cleo/INI/Players.ini
File name: Players.ini

File inside.:
[shcode=cpp]
[Players]
PlayerName1=Big_Stick
PlayerName2=
PlayerName3=
PlayerName4=
PlayerName5=
PlayerName6=
PlayerName7=
PlayerName8=
PlayerName9=
PlayerName10=
[/shcode]

Cleo code.:
[shcode=cpp]
{$CLEO .cs}
0000:
  
  
REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY 
  
0AC8: 3@ = allocate_memory_size 260
0AC8: 4@ = allocate_memory_size 260  
0AC8: 5@ = allocate_memory_size 260 
0AC8: 6@ = allocate_memory_size 260
0AC8: 7@ = allocate_memory_size 260
0AC8: 8@ = allocate_memory_size 260
0AC8: 9@ = allocate_memory_size 260
0AC8: 10@ = allocate_memory_size 260
0AC8: 11@ = allocate_memory_size 260
0AC8: 12@ = allocate_memory_size 260
 
WHILE TRUE
   WAIT 0
     
IF 0B61:  samp is_local_player_spawned
THEN
   0AF4: 3@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName1"
   0AF4: 4@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName2"
   0AF4: 5@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName3"
   0AF4: 6@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName4"
   0AF4: 7@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName5"
   0AF4: 8@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName6"
   0AF4: 9@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName7"
   0AF4: 10@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName8"
   0AF4: 11@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName9"
   0AF4: 12@ = read_string_from_ini_file "CLEO\INI\Players.ini" section "Players" key "PlayerName10"
   FOR 0@ = 0 TO 1000
       IF 0B23: samp is_player_connected 0@
       THEN
           0B36: samp 1@ = get_player_nickname 0@
           IF OR 
           0C14: strcmp string1 1@ string2 3@
           0C14: strcmp string1 1@ string2 4@
           0C14: strcmp string1 1@ string2 5@
           0C14: strcmp string1 1@ string2 6@
           0C14: strcmp string1 1@ string2 7@
           0C14: strcmp string1 1@ string2 8@
           0C14: strcmp string1 1@ string2 9@
           0C14: strcmp string1 1@ string2 10@ 
           THEN
           say "/q"
           wait 1000 /// Anti spam
           END   /// END 0B61:  samp is_local_player_spawned
           
           IF OR 
           0C14: strcmp string1 1@ string2 11@
           0C14: strcmp string1 1@ string2 12@ 
           THEN
           say "/q"
           wait 1000 /// Anti spam
           END   /// END 0B61:  samp is_local_player_spawned
           
       END   /// END FOR 0@ = 0 TO 1000
   END   /// END 0B23: samp is_player_connected 0@
END   /// END 0C14: strcmp string1 1@ string2 3@
  
END   /// END WHILE TRUE
[/shcode]
 
Status
Not open for further replies.
Top