Facebook
From Tinct Owl, 3 Years ago, written in Plain Text.
This paste is a reply to Auto Find V2 from IbraJ - go back
Embed
Viewing differences between Auto Find V2 and Re: Auto Find V2
{$CLEO .cs}
0000:

31@ = 0
alloc 14@ 260
alloc 15@ 260
alloc 16@ 260
alloc 17@ 260

:SAMP
wait 0
if 
  SAMP.Available()
jf @SAMP
if
  0AAB:   file_exists "CLEO\ini\find.ini"
jf @notfound
chatmsg "Auto Find V2 created by Ibrahim Jmel!" 0x3C92FF
0AF0: 1@ = get_int_from_ini_file "cleo\ini\find.ini" section "FIND" key "ID"
0AF0: 19@ = get_int_from_ini_file "cleo\ini\find.ini" section "FIND" key "DELAY"
0AF4: 14@ = read_string_from_ini_file "cleo\ini\find.ini" section "STRINGS" key "SETFIND"
0AF4: 15@ = read_string_from_ini_file "cleo\ini\find.ini" section "STRINGS" key "DELAY"
0AF4: 16@ = read_string_from_ini_file "cleo\ini\find.ini" section "STRINGS" key "ACTIVATION"
0AF4: 17@ = read_string_from_ini_file "cleo\ini\find.ini" section "STRINGS" key "DEACTIVATION"

:Commands
wait 0
if
  Player.Defined(0)
jf @Commands
0B34: samp register_client_command 14@ to_label @setfind
0B34: samp register_client_command 15@ to_label @delay
0B34: samp register_client_command 16@ to_label @Activation
0B34: samp register_client_command 17@ to_label @Deactivation

:Body
wait 0
if and 
  31@ == 1
  0B61:  samp is_local_player_spawned
jf @Body
say "/find %d" 1@
wait 19@
jump @Body

//-----------------------------// Registered commands //----------------------------------------//

:setfind
wait 0
0B35: samp 0@ = get_last_command_params
if
  0AD4: 0@ = scan_string 0@ format "%d" 1@ //IF and SET
jf @false_1
if
  0B23:  samp is_player_connected 1@
jf @false_2
3@ = SAMP.GetPlayerNickname(1@)
4@ = SAMP.GetPlayerPing(1@)
5@ = SAMP.GetPlayerScore(1@)
chatmsg "Auto Find has been adjusted on %s | ID: %d | Level: %d | Ping: %d" -1 3@ 1@ 5@ 4@
0AF1: write_int 1@ to_ini_file "cleo\ini\find.ini" section "FIND" key "ID"
SAMP.CmdRet()

:delay
wait 0
0B35: samp 7@ = get_last_command_params
if
  0AD4: $NOT_USED = scan_string 7@ format "%d" 19@ //IF and SET
jf @false_3
chatmsg "Auto Find delay has been adjusted to: %d ms" -1 19@
0AF1: write_int 19@ to_ini_file "cleo\ini\find.ini" section "FIND" key "DELAY"
SAMP.CmdRet()

:Activation
wait 0
31@ = 1
chatmsg "Auto Find V2 is {5eff00}Enabled!" -1
SAMP.CmdRet()

:Deactivation
wait 0
31@ = 0
chatmsg "Auto find V2 is {ff0000}Disabled!" -1
SAMP.CmdRet()



//------------------------------------// Error messsages //------------------------------------------//


:notfound
wait 0
if
  8AAB: not  file_exists "CLEO\ini\find.ini"
jf @SAMP
0ACD: "~r~Find.ini is missing therefore modification will not initiate." 4000
0A93: end_custom_thread

:false_1
wait 0
chatmsg "{ff0000}Incorrect Usage:{FFFFFF} /find [id]" -1
SAMP.CmdRet()

:false_2
wait 0
chatmsg "{ff0000}Error:{FFFFFF} Player is not connected!" -1
SAMP.CmdRet()

:false_3
wait 0
chatmsg "{ff0000}Incorrect Usage:{FFFFFF} /delay [ms] (Example: 1000 ms = 1 second)" -1
SAMP.CmdRet()