Rexzor
Member
- Joined
- Feb 17, 2017
- Messages
- 16
- Reaction score
- 0
Hello Ugbase, I found on Russian website spec detector, but they say it was tested only on DRP server. Can you edit this to work on other servers too?
Here is a script.
	
	
	
		
			
			Here is a script.
		Code:
	
	{$ CLEO .cs}
{$ NOSOURCE}
0000: NOP
Const
// --- Vars ---
SPECTATE_STATUS = 0 // Are you currently watching the player
LAST_TIME = 1 // Time of the last RPC_SCRSETPLAYERDRUNKLEVEL
// --- ID RPC ---
RPC_SCRSETPLAYERDRUNKLEVEL = 35 // [ID RPC] If the admin starts to monitor, this RPC is sent
DRUNK_LEVEL = 2000 // Parameter that sets the modes to determine FPS
// --- ID TextDraw ---
ID_TEXTDRAW_STATUS = 431 // ID of the text of the tree reporting the shadowing
end
03A4: name_thread 'SD_MAIN'
// We are waiting for the launch of SAMP
repeat
    wait 100
until SAMP.Available ()
// Clear the status of shadowing
0AB3: var SPECTATE_STATUS = FALSE
// Display the information about the script
0C3A: 1 @ = string "{5e0fa3} [SpectateDetector] {ffe0a5} Author: {7db302} Mor" pointer
chatmsg 1 @ 0xffffe0a5
0BE3: raknet setup_incoming_rpc_hook @SPECTATE_DETECTOR
: MAIN_CYCLE
wait 100
0AB4: 0 @ = var SPECTATE_STATUS
if 0 @ == TRUE
then
    0AB4: 1 @ = var LAST_TIME
    01BD: 2 @ = current_time_in_ms
    0062: 2 @ - = 1 @
    if 04B5: 2 @> = 60000 // If a minute has passed since the last RPC, the shadowing has stopped
    then
        // The surveillance stopped ...
        0C5E: samp textdraw ID_TEXTDRAW_STATUS delete
        0AB3: var SPECTATE_STATUS = FALSE
    end
end
jump @MAIN_CYCLE
: SPECTATE_DETECTOR
    0BE5: raknet 25 @ = get_hook_param 1
    if 25 @ == RPC_SCRSETPLAYERDRUNKLEVEL
    then
        0BE5: raknet 26 @ = get_hook_param 0
        0BF3: raknet 26 @ = bit_stream 26 @ get_data_ptr
        0A8D: 27 @ = read_memory 26 @ size 4 virtual_protect 0
        if 27 @ == DRUNK_LEVEL
        then
            0BFA: push_vars
      
            0AB4: 3 @ = var SPECTATE_STATUS
            if 04A4: 3 @ == TRUE
            then
                // Another package came ...
          
                // Update the time of the last RPC_SCRSETPLAYERDRUNKLEVEL
                01BD: 4 @ = current_time_in_ms
                0AB3: var LAST_TIME = 4 @
          
                else if 0039: 3 @ == FALSE
                then
                    // The surveillance started ...
                    0AB3: var SPECTATE_STATUS = TRUE
              
                    01BD: 4 @ = current_time_in_ms
                    0AB3: var LAST_TIME = 4 @
              
                    // Create text
                    0C48: samp textdraw ID_TEXTDRAW_STATUS create "~ r ~ SPECTATE" pos 130.0 150.0
                    0C4A: samp textdraw ID_TEXTDRAW_STATUS set_align 2
                    0C4B: samp textdraw ID_TEXTDRAW_STATUS set_proportional TRUE
                    0C4C: samp textdraw ID_TEXTDRAW_STATUS set_style 2
                    0C4E: samp textdraw ID_TEXTDRAW_STATUS set_outline 1 color 0xff000000
                    0C52: samp textdraw ID_TEXTDRAW_STATUS set_letter_size 1.0 1.0 color -1
                end
            end
      
            0BFB: pop_vars
        end
    end
    0BE0: raknet hook_ret TRUE 
				 
 
		