{$CLEO .cs} 0000: :SAMP wait 0 if SAMP.Available() jf @SAMP 0AF8: samp add_message_to_chat "AdvanceVst created by Ibrahim Jmel" color 0x3C92FF alloc 28@ 256 alloc 27@ 50 alloc 26@ 256 :Cfile wait 0 if 0AAB: file_exists "CLEO\ini\guard.ini" jf @Cfile gosub @version //settings 0AF4: 0@v = read_string_from_ini_file "cleo\ini\guard.ini" section "settings" key "key/cheat" 0AF0: 1@ = get_int_from_ini_file "cleo\ini\guard.ini" section "settings" key "samecolor" 0AF0: 30@ = get_int_from_ini_file "cleo\ini\guard.ini" section "settings" key "autorun" 0AF0: 2@ = get_int_from_ini_file "cleo\ini\guard.ini" section "settings" key "delay" 0AF0: 3@ = get_int_from_ini_file "cleo\ini\guard.ini" section "settings" key "log" 0AF0: 6@ = get_int_from_ini_file "cleo\ini\guard.ini" section "settings" key "lognumber" //player 0AF0: 4@ = get_int_from_ini_file "cleo\ini\guard.ini" section "player" key "armorcheck" 0AF0: 5@ = get_int_from_ini_file "cleo\ini\guard.ini" section "player" key "price" //ignore 0AF4: v$text1 = read_string_from_ini_file "cleo\ini\guard.ini" section "ignore" key "player1" 0AF4: v$text2 = read_string_from_ini_file "cleo\ini\guard.ini" section "ignore" key "player2" 0AF4: v$text3 = read_string_from_ini_file "cleo\ini\guard.ini" section "ignore" key "player3" 0AF4: v$text4 = read_string_from_ini_file "cleo\ini\guard.ini" section "ignore" key "player4" 0AF4: v$text5 = read_string_from_ini_file "cleo\ini\guard.ini" section "ignore" key "player5" 0AF4: v$text6 = read_string_from_ini_file "cleo\ini\guard.ini" section "ignore" key "player6" 0AF4: v$text7 = read_string_from_ini_file "cleo\ini\guard.ini" section "ignore" key "player7" 0AF4: v$text8 = read_string_from_ini_file "cleo\ini\guard.ini" section "ignore" key "player8" 0AF4: v$text9 = read_string_from_ini_file "cleo\ini\guard.ini" section "ignore" key "player9" :Commands wait 0 if Player.Defined(0) jf @Commands 0B34: samp register_client_command ".evst" to_label @activate 0B34: samp register_client_command ".dvst" to_label @deactivate 0B34: samp register_client_command ".change" to_label @trigger 0B34: samp register_client_command ".checkcolor" to_label @color 0B34: samp register_client_command ".delay" to_label @delay 0B34: samp register_client_command ".log" to_label @log 0B34: samp register_client_command ".checkarmor" to_label @armor 0B34: samp register_client_command ".setprice" to_label @price 0B34: samp register_client_command ".shownames" to_label @shownames 0B34: samp register_client_command ".setname1" to_label @name1 0B34: samp register_client_command ".setname2" to_label @name2 0B34: samp register_client_command ".setname3" to_label @name3 0B34: samp register_client_command ".setname4" to_label @name4 0B34: samp register_client_command ".setname5" to_label @name5 0B34: samp register_client_command ".setname6" to_label @name6 0B34: samp register_client_command ".setname7" to_label @name7 0B34: samp register_client_command ".setname8" to_label @name8 0B34: samp register_client_command ".setname9" to_label @name9 0B34: samp register_client_command ".cmds" to_label @cmds //-----------------------// Structure //--------------------------------// :color_armor wait 0 if 30@ == 1 jf @color_armor if and 1@ == 1 4@ == 1 jf @ecolor if and 0ADC: 0@v not SAMP.ChatInputOpened() jf @color_armor 0AB1: call @nearest 0 distance 17@ id 18@ 19@ = SAMP.GetSAMPPlayerIDByActorHandle($PLAYER_ACTOR) 20@ = SAMP.GetPlayerColor(18@) 21@ = SAMP.GetPlayerColor(19@) 23@ = SAMP.GetPlayerNickname(18@) 0B26: samp 22@ = get_player_armor 18@ if and 003B: 20@ == 21@ // (int) 22@ < 45 not 22@ > 45 jf @color_armor if 8C21: 23@ v$text1 jf @color_armor if 8C21: 23@ v$text2 jf @color_armor if 8C21: 23@ v$text3 jf @color_armor if 8C21: 23@ v$text4 jf @color_armor if 8C21: 23@ v$text5 jf @color_armor if 8C21: 23@ v$text6 jf @color_armor if 8C21: 23@ v$text7 jf @color_armor if 8C21: 23@ v$text8 jf @color_armor if 8C21: 23@ v$text9 jf @color_armor wait 2@ say "/vest %d %d" 18@ 5@ gosub @log_work jump @color_armor :ecolor wait 0 if 30@ == 1 jf @ecolor if and not 4@ == 1 1@ == 1 jf @earmor if and 0ADC: 0@v not SAMP.ChatInputOpened() jf @ecolor 0AB1: call @nearest 0 distance 17@ id 18@ 19@ = SAMP.GetSAMPPlayerIDByActorHandle($PLAYER_ACTOR) 20@ = SAMP.GetPlayerColor(18@) 21@ = SAMP.GetPlayerColor(19@) 23@ = SAMP.GetPlayerNickname(18@) if 003B: 20@ == 21@ // (int) jf @ecolor if 8C21: 23@ v$text1 jf @color_armor if 8C21: 23@ v$text2 jf @color_armor if 8C21: 23@ v$text3 jf @color_armor if 8C21: 23@ v$text4 jf @color_armor if 8C21: 23@ v$text5 jf @color_armor if 8C21: 23@ v$text6 jf @color_armor if 8C21: 23@ v$text7 jf @color_armor if 8C21: 23@ v$text8 jf @color_armor if 8C21: 23@ v$text9 jf @color_armor wait 2@ say "/vest %d %d" 18@ 5@ gosub @log_work jump @ecolor :earmor wait 0 if 30@ == 1 jf @earmor if and not 1@ == 1 4@ == 1 jf @none if and 0ADC: 0@v not SAMP.ChatInputOpened() jf @earmor 0AB1: call @nearest 0 distance 17@ id 18@ 23@ = SAMP.GetPlayerNickname(18@) 0B26: samp 22@ = get_player_armor 18@ if and 22@ < 45 not 22@ > 45 jf @earmor if 8C21: 23@ v$text1 jf @color_armor if 8C21: 23@ v$text2 jf @color_armor if 8C21: 23@ v$text3 jf @color_armor if 8C21: 23@ v$text4 jf @color_armor if 8C21: 23@ v$text5 jf @color_armor if 8C21: 23@ v$text6 jf @color_armor if 8C21: 23@ v$text7 jf @color_armor if 8C21: 23@ v$text8 jf @color_armor if 8C21: 23@ v$text9 jf @color_armor wait 2@ say "/vest %d %d" 18@ 5@ gosub @log_work jump @earmor :none wait 0 if 30@ == 1 jf @none if and not 4@ == 1 not 1@ == 1 jf @color_armor if and 0ADC: 0@v not SAMP.ChatInputOpened() jf @none 0AB1: call @nearest 0 distance 17@ id 18@ 23@ = SAMP.GetPlayerNickname(18@) if 8C21: 23@ v$text1 jf @color_armor if 8C21: 23@ v$text2 jf @color_armor if 8C21: 23@ v$text3 jf @color_armor if 8C21: 23@ v$text4 jf @color_armor if 8C21: 23@ v$text5 jf @color_armor if 8C21: 23@ v$text6 jf @color_armor if 8C21: 23@ v$text7 jf @color_armor if 8C21: 23@ v$text8 jf @color_armor if 8C21: 23@ v$text9 jf @color_armor wait 2@ say "/vest %d %d" 18@ 5@ gosub @log_work jump @none //---------------------------// Call labels //----------------------------// :nearest 3@ = 1000.0 4@ = 0xFFFFFF 0A8D: 0@ = read_memory 0xB74490 size 4 virtual_protect 0 0@ += 4 0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0 for 1@ = 0 to 35584 step 0x100 0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0 0@++ if and 2@ >= 0x00 2@ < 0x80 then 005A: 2@ += 1@ if or 003C: $PLAYER_ACTOR == 2@ // LOCAL_PLAYER == REMOTE_PLAYER 856D: NOT actor 2@ defined // REMOTE PLAYER IS NOT DEFINED then continue end 0AB1: call @distanceBetweenActor 1 remote_player_handle 2@ retr_dist_to 5@ if 0025: 3@ > 5@ // Max. dist > cur. then 0087: 3@ = 5@ // Max. dist = cur. 0085: 4@ = 2@ // Save remote player handle end end end if 4@ = SAMP.GetSAMPPlayerIDByActorHandle(4@) then 0485: return_true else 059A: return_false end 0AB2: ret 2 3@ 4@ :distanceBetweenActor Actor.StorePos(0@, 1@, 2@, 3@) Actor.StorePos($PLAYER_ACTOR, 4@, 5@, 6@) 050A: 7@ = distance_between_XYZ 4@ 5@ 6@ and_XYZ 1@ 2@ 3@ 0AB2: ret 1 7@ :log_work wait 0 if 3@ == 1 jf @log_return 0AB1: call @Get_Date_Time 0 26@ 0AF0: 6@ = get_int_from_ini_file "cleo\ini\guard.ini" section "settings" key "lognumber" 0AD3: 28@ "Name: %s | ID: %d | Price: %d | Time: %s" 23@ 18@ 5@ 26@ // info 0AD3: 27@ "CLEO\ini\%s #%d.txt" 23@ 6@ // directory 6@ += 1 :logfile wait 0 if 0A9A: 26@ = openfile 27@ mode 'at+' // IF and SET jf @logfile if 26@ > 1 jf @log_return 0AD9: write_formatted_text "%s" in_file 26@ 28@ 0AF1: write_int 6@ to_ini_file "cleo\ini\guard.ini" section "settings" key "lognumber" File.Close(26@) return :log_return wait 0 if 3@ == 0 jf @log_work return :Get_Date_Time alloc 1@ 30 alloc 4@ 256 0AD3: 4@ = format "nodatefound" 0AA2: 2@ = load_library "kernel32.dll" // IF and SET if 0AA4: 3@ = get_proc_address "GetLocalTime" library 2@ then 0A8C: write_memory 1@ size 2 value 1 virtual_protect 1 0AA5: call_function 3@ num_params 1 pop 0 1@ //0AC7: 31@ = var 1@ offset 0085: 31@ = 1@ // (int) 0A8D: 20@ = read_memory 31@ size 2 virtual_protect 1 31@ += 2 0A8D: 21@ = read_memory 31@ size 2 virtual_protect 1 31@ += 2 0A8D: 22@ = read_memory 31@ size 2 virtual_protect 1 31@ += 2 0A8D: 23@ = read_memory 31@ size 2 virtual_protect 1 31@ += 2 0A8D: 24@ = read_memory 31@ size 2 virtual_protect 1 31@ += 2 0A8D: 25@ = read_memory 31@ size 2 virtual_protect 1 31@ += 2 0A8D: 26@ = read_memory 31@ size 2 virtual_protect 1 0AD3: 4@ = format "%d/%d/%d %d/%d/%d" 23@ 21@ 20@ 24@ 25@ 26@ end 0AA3: free_library 2@ free 1@ 0AB2: ret 1 4@ :version wait 0 0C65: 25@ = download_url "http://download2263.mediafire.com/4vio5me0f2hg/5r1475fedkco54s/version.ini" to_file "version.ini" 0AF2: 32@ = get_float_from_ini_file "version.ini" section "info" key "version" 0AF2: 33@ = get_float_from_ini_file "cleo\ini\guard.ini" section "info" key "version" :version_true wait 0 if 0045: 32@ == 33@ // (float) jf @version_false return :version_false wait 0 if 8045: 32@ == 33@ jf @version_true 0AD1: "Your version of ~g~AdvanceVst~w~ is not the ~r~latest one~w~ %0.1f. Download it now!" 8000 32@ 0A93: end_custom_thread //--------------------------------// Command labels //------------------------------------// :activate wait 0 30@ = 1 0AF8: "Advance guardnear has been: {04ff00}Enabled{FFFFFF}." -1 SAMP.CmdRet() :deactivate wait 0 30@ = 0 0AF8: "Advance guardnear has been: {ff0019}Disabled{FFFFFF}." -1 SAMP.CmdRet() :trigger wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%s" 0@v //IF and SET jf @trigger2 0AF5: write_string 0@v to_ini_file "cleo\ini\guard.ini" section "settings" key "key/cheat" 0AF8: "Key has been changed to: %s" -1 0@v SAMP.CmdRet() :trigger2 wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%d" 0@ //IF and SET jf @triggerF 0AD3: 0@v = format "%d" 0@ 0AF5: write_string 0@v to_ini_file "cleo\ini\guard.ini" section "settings" key "key/cheat" 0AF8: "Key has been changed to: %s" -1 0@v SAMP.CmdRet() :color wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%d" 1@ //IF and SET jf @colorE if 1@ == 1 jf @colorF 0AF1: write_int 1@ to_ini_file "cleo\ini\guard.ini" section "settings" key "samecolor" 0AF8: "Same color mode of guardnear has been: {04ff00}Enabled{FFFFFF}." -1 SAMP.CmdRet() :colorF wait 0 if 1@ == 0 jf @color2 0AF1: write_int 1@ to_ini_file "cleo\ini\guard.ini" section "settings" key "samecolor" 0AF8: "Same color mode of guardnear has been: {ff0019}Disabled{FFFFFF}." -1 SAMP.CmdRet() :color2 wait 0 if and not 1@ == 1 not 1@ == 0 jf @color 0AF8: "{ff0019}Error{FFFFFF}: Either you enable it (/.checkcolor 1) or disable it (/.checkcolor 0). The mod cannot expect more numbers" -1 SAMP.CmdRet() :delay wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%d" 2@ //IF and SET jf @delayE 0AF1: write_int 2@ to_ini_file "cleo\ini\guard.ini" section "settings" key "delay" 0AF8: "Delay of guardnear has been adjusted to: %d" -1 2@ SAMP.CmdRet() :log wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%d" 3@ //IF and SET jf @logE if 3@ == 1 jf @logF 0AF1: write_int 3@ to_ini_file "cleo\ini\guard.ini" section "settings" key "log" 0AF8: "Log mode of guardnear has been: {04ff00}Enabled{FFFFFF}." -1 SAMP.CmdRet() :logF wait 0 if 3@ == 0 jf @logF2 0AF1: write_int 3@ to_ini_file "cleo\ini\guard.ini" section "settings" key "log" 0AF8: "Log mode of guardnear has been: {ff0019}Disabled{FFFFFF}." -1 SAMP.CmdRet() :logF2 wait 0 if and not 3@ == 1 not 3@ == 0 jf @log 0AF8: "{ff0019}Error{FFFFFF}: Either you enable it (/.log 1) or disable it (/.log 0). The mod cannot expect more numbers" -1 SAMP.CmdRet() :armor wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%d" 4@ //IF and SET jf @armorE if 4@ == 1 jf @armorF 0AF1: write_int 4@ to_ini_file "cleo\ini\guard.ini" section "player" key "armorcheck" 0AF8: "Armor check of guardnear has been: {04ff00}Enabled{FFFFFF}." -1 SAMP.CmdRet() :armorF wait 0 if 4@ == 0 jf @armorF2 0AF1: write_int 4@ to_ini_file "cleo\ini\guard.ini" section "player" key "armorcheck" 0AF8: "Armor check of guardnear has been: {ff0019}Disabled{FFFFFF}." -1 SAMP.CmdRet() :armorF2 wait 0 if and not 4@ == 1 not 4@ == 0 jf @armor 0AF8: "{ff0019}Error{FFFFFF}: Either you enable it (/.checkarmor 1) or disable it (/.checkarmor 0). The mod cannot expect more numbers" -1 SAMP.CmdRet() :price wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%d" 5@ //IF and SET jf @priceE 0AF1: write_int 5@ to_ini_file "cleo\ini\guard.ini" section "player" key "price" 0AF8: "Selling price of vest has been fixed to: $%d" -1 5@ SAMP.CmdRet() :shownames wait 0 0AF8: "1st Row: %s" -1 v$text1 0AF8: "2nd Row: %s" -1 v$text2 0AF8: "3rd Row: %s" -1 v$text3 0AF8: "4th Row: %s" -1 v$text4 0AF8: "5th Row: %s" -1 v$text5 0AF8: "6th Row: %s" -1 v$text6 0AF8: "7th Row: %s" -1 v$text7 0AF8: "8th Row: %s" -1 v$text8 0AF8: "9th Row: %s" -1 v$text9 SAMP.CmdRet() :name1 wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%s" v$text1 //IF and SET jf @nameE 0AF5: write_string v$text1 to_ini_file "cleo\ini\guard.ini" section "ignore" key "player1" 0AF8: "Player: %s has been added to the ignore list (1)" -1 v$text1 0A92: create_custom_thread "AdvanceVst.cs" 004E: SAMP.CmdRet() :name2 wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%s" v$text2 //IF and SET jf @nameE 0AF5: write_string v$text2 to_ini_file "cleo\ini\guard.ini" section "ignore" key "player2" 0AF8: "Player: %s has been added to the ignore list (2)" -1 v$text2 0A92: create_custom_thread "AdvanceVst.cs" 004E: SAMP.CmdRet() :name3 wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%s" v$text3 //IF and SET jf @nameE 0AF5: write_string v$text3 to_ini_file "cleo\ini\guard.ini" section "ignore" key "player3" 0AF8: "Player: %s has been added to the ignore list (3)" -1 v$text3 0A92: create_custom_thread "AdvanceVst.cs" 004E: SAMP.CmdRet() :name4 wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%s" v$text4 //IF and SET jf @nameE 0AF5: write_string v$text4 to_ini_file "cleo\ini\guard.ini" section "ignore" key "player4" 0AF8: "Player: %s has been added to the ignore list (4)" -1 v$text4 0A92: create_custom_thread "AdvanceVst.cs" 004E: SAMP.CmdRet() :name5 wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%s" v$text5 //IF and SET jf @nameE 0AF5: write_string v$text5 to_ini_file "cleo\ini\guard.ini" section "ignore" key "player5" 0AF8: "Player: %s has been added to the ignore list (5)" -1 v$text5 0A92: create_custom_thread "AdvanceVst.cs" 004E: SAMP.CmdRet() :name6 wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%s" v$text6 //IF and SET jf @nameE 0AF5: write_string v$text6 to_ini_file "cleo\ini\guard.ini" section "ignore" key "player6" 0AF8: "Player: %s has been added to the ignore list (6)" -1 v$text6 0A92: create_custom_thread "AdvanceVst.cs" 004E: SAMP.CmdRet() :name7 wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%s" v$text7 //IF and SET jf @nameE 0AF5: write_string v$text7 to_ini_file "cleo\ini\guard.ini" section "ignore" key "player7" 0AF8: "Player: %s has been added to the ignore list (7)" -1 v$text7 0A92: create_custom_thread "AdvanceVst.cs" 004E: SAMP.CmdRet() :name8 wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%s" v$text8 //IF and SET jf @nameE 0AF5: write_string v$text8 to_ini_file "cleo\ini\guard.ini" section "ignore" key "player8" 0AF8: "Player: %s has been added to the ignore list (8)" -1 v$text8 0A92: create_custom_thread "AdvanceVst.cs" 004E: SAMP.CmdRet() :name9 wait 0 0B35: samp 31@ = get_last_command_params if 0AD4: $NONE = scan_string 31@ format "%s" v$text9 //IF and SET jf @nameE 0AF5: write_string v$text9 to_ini_file "cleo\ini\guard.ini" section "ignore" key "player9" 0AF8: "Player: %s has been added to the ignore list (9)" -1 v$text9 0A92: create_custom_thread "AdvanceVst.cs" 004E: SAMP.CmdRet() :cmds wait 0 0AF8: "//----------------// Thank you for downloading the Advance guardnear //-------------------//" 0x3C92FF 0AF8: "> /.evst - To enable the Advance guardnear" 0xFFFFFF 0AF8: "> /.dvst - To disable the Advance guardnear" 0xFFFFFF 0AF8: "> /.change [text] - To change the current key (it can also be a cheat)" 0xFFFFFF 0AF8: "> /.setname[1-9] [name] - To append any player into the ignore list" 0xFFFFFF 0AF8: "> /.delay [ms] - To add delay after pressing the key (Recommended: '0')" 0xFFFFFF 0AF8: "> /.checkcolor [0/1] - To enable/disable the same color mode" 0xFFFFFF 0AF8: "> /.setprice [amount] - Set the price of the vest that you will sell" 0xFFFFFF 0AF8: "> /.checkarmor [0/1] - To enable/disable the armor mode" 0xFFFFFF 0AF8: "> /.log [0/1] - To enable the log mode" 0xFFFFFF 0AF8: "> /.shownames - To see all names of the ignore list" 0xFFFFFF 0AF8: "> /.cmds - To view all commands in-game." 0xFFFFFF 0AF8: "//---------------// If you have any question, contact me on my discord (IbraJ#7112) //--------------------//" 0x3C92FF SAMP.CmdRet() //------------------// Error messages //-----------------------// :CfileF wait 0 if 8AAB: "CLEO\ini\guard.ini" jf @Cfile 0ACD: "~r~guard.ini is not found therefore modification will not start!" 5000 0A93: end_custom_thread :triggerF wait 0 0AF8: "{ff0019}Incorrect usage{FFFFFF}: /.change [string] (string can be a character, number or a full cheat)" -1 SAMP.CmdRet() :colorE wait 0 0AF8: "{ff0019}Incorrect usage{FFFFFF}: /.checkcolor (0/1) [0 = disable, 1 = enable]" -1 SAMP.CmdRet() :delayE wait 0 0AF8: "{ff0019}Incorrect usage{FFFFFF}: /.delay [ms] (1000 ms = 1 second)" -1 SAMP.CmdRet() :logE wait 0 0AF8: "{ff0019}Incorrect usage{FFFFFF}: /.log (0/1) [0 = disable, 1 = enable]" -1 SAMP.CmdRet() :armorE wait 0 0AF8: "{ff0019}Incorrect usage{FFFFFF}: /.checkarmor (0/1) [0 = disable, 1 = enable]" -1 SAMP.CmdRet() :priceE wait 0 0AF8: "{ff0019}Incorrect usage{FFFFFF}: /.setprice [price]" -1 SAMP.CmdRet() :nameE wait 0 0AF8: "{ff0019}Incorrect usage{FFFFFF}: /.setname[1-9] [firstname_lastname]" -1 SAMP.CmdRet()