CLEO Help Cleo mod working on a specified server

CLEO related
Status
Not open for further replies.

alborosie

Active member
Joined
Aug 16, 2017
Messages
67
Reaction score
3
Hello. Anyone know a method to make a cleo mod working on a single or two servers?
If the player is connected to one of the specified server, the mod will work fine.
Else, he will receive a message into the chat to contact the developer of the mod in the Connecting screen.
Thanks! <3
 

batonkal

Active member
Joined
May 6, 2017
Messages
102
Reaction score
16
Location
Bosnia and Herzegovina
0AC8: 1@ = allocate_memory_size 256
0B39: samp get_current_server_address 1@ port 2@
0AC9: free_allocated_memory 1@

something like this, 1@ is a string(IP), 2@ is a number(port)
 

alborosie

Active member
Joined
Aug 16, 2017
Messages
67
Reaction score
3
DNS will be turned into IP.
i've tried this but don't work
PHP:
0AC8: 1@ = allocate_memory_size 256
0B39: samp get_current_server_address 1@ port 2@
0AC9: free_allocated_memory 1@
if 1@ = 'ruby.nephrite.ro' and 2@ = '7777'
then
chatmsg "works"
else
chatmsg "Don't works"
                  end
 

JaggerJam

Active member
Joined
Sep 14, 2017
Messages
98
Solutions
1
Reaction score
21
Na scriptere
Code:
{$CLEO}
0000:

repeat
wait 0
until SAMP.Available()

alloc 0@ 128
0B3A: samp 0@ = get_current_server_name

if 0C18: 1@ = strstr string1 0@ string2 "ruby"
then
    chatmsg "CLEO working" -1
else
    chatmsg "CLEO stopped" -1
    0A93: end_custom_thread
end

free 0@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
937
Location
Lithuania
Na scriptere
Code:
{$CLEO}
0000:

repeat
wait 0
until SAMP.Available()

alloc 0@ 128
0B3A: samp 0@ = get_current_server_name

if 0C18: 1@ = strstr string1 0@ string2 "ruby"
then
    chatmsg "CLEO working" -1
else
    chatmsg "CLEO stopped" -1
    0A93: end_custom_thread
end

free 0@

i TESTED THIS METHOD..., IF OWNER CHANGE SERVER NAME , CLEO STOP WORK...
 
Last edited:

batonkal

Active member
Joined
May 6, 2017
Messages
102
Reaction score
16
Location
Bosnia and Herzegovina
PHP:
 0AC8: 1@ = allocate_memory_size 256
 0B39: samp get_current_server_address 1@ port 2@
 if //and
 0C18: 2@ = strstr string1 1@ string2 "193.203.39.36" 
 //    3@ == 7777
 then
   0ACD: show_text_highpriority "yes" time 100
 else
   0ACD: show_text_highpriority "no" time 100
 end
 0AC9: free_allocated_memory 1@

try this to check ip
 

alborosie

Active member
Joined
Aug 16, 2017
Messages
67
Reaction score
3
PHP:
 0AC8: 1@ = allocate_memory_size 256
0B39: samp get_current_server_address 1@ port 2@
if //and
0C18: 2@ = strstr string1 1@ string2 "193.203.39.36"
//    3@ == 7777
then
   0ACD: show_text_highpriority "yes" time 100
else
   0ACD: show_text_highpriority "no" time 100
end
0AC9: free_allocated_memory 1@

try this to check ip
crash
 

alborosie

Active member
Joined
Aug 16, 2017
Messages
67
Reaction score
3
PHP:
 0AC8: 1@ = allocate_memory_size 256
0B39: samp get_current_server_address 1@ port 2@
if //and
0C18: 2@ = strstr string1 1@ string2 "193.203.39.36"
//    3@ == 7777
then
   0ACD: show_text_highpriority "yes" time 100
else
   0ACD: show_text_highpriority "no" time 100
end
0AC9: free_allocated_memory 1@

try this to check ip
WORKED THANKS!!
 

batonkal

Active member
Joined
May 6, 2017
Messages
102
Reaction score
16
Location
Bosnia and Herzegovina
PHP:
{$CLEO .cs}
0000: NOP
wait 10000

while true
wait 0

if
 0AB0: key_pressed 90
then
 0AC8: 1@ = allocate_memory_size 256
 0B39: samp get_current_server_address 1@ port 2@
 0AD1: show_formatted_text_highpriority "%s" time 2000 1@
 if //and
 0C18: 2@ = strstr string1 1@ string2 "193.203.39.36" 
 //    3@ == 7777
 then
   0ACD: show_text_highpriority "yes" time 100
 else
   0ACD: show_text_highpriority "no" time 100
 end
 0AC9: free_allocated_memory 1@
 wait 500
 
end

end

Idk, this works for me. Try editing this code to suit your needs.
 
Status
Not open for further replies.
Top