Raised This Month: $32 Target: $400
 8% 

Solved screenshot more then one image


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nacknic
Senior Member
Join Date: Mar 2019
Old 04-05-2020 , 05:15   screenshot more then one image
Reply With Quote #1

by my friend help bug more then one screenshot fixed, the code her:

Code:
public ssFunc(id) {
    
    if( get_user_flags(id) & ADMIN_KICK )
    {
        new player[32]
        new num
        get_players( player, num )
        
        for( new i; i < num; i++ ) {
            
            client_print( player[i], print_chat, "[Frag] Anti-Cheat: screenshot has been taken" )
            client_cmd( player[i], ";snapshot" );
                    
        }
        return 1
        
    }
    else
        return client_print( id, print_chat, "[Frag] Anti-Cheat: you do not have access" )
}
i upgraded the code:
Code:
#include <amxmodx>

public plugin_init() {
	
	register_clcmd("say", "ssFunc" )
	
}

public ssFunc(id) {
	
	new c[51], cLeft[51]
	
	read_args( c, 50 ) // read all args
	remove_quotes(c) 
	split( c, cLeft, 50, c, 50, " " )
	
	if( equali(cLeft, "!ss" ) && !c[0] && ( get_user_flags(id) & ADMIN_IMMUNITY ) ) {
		
		client_print( 0, print_chat, "[Frag] Anti-Cheat: receives a screenshot from all players...")
		
		new player[32]
		new num
		
		get_players( player, num )
		
		for( new i; i < num; i++ ) {
			
			client_print( player[i], print_chat, "[Frag] Anti-Cheat: screenshot has been taken" )
			client_cmd( player[i], ";snapshot" )
		}
		
	} else if( equali(cLeft, "!ss") && is_str_num(c[0]) && ( get_user_flags(id) & ADMIN_KICK || get_user_flags(id) & ADMIN_IMMUNITY ) ) {
		
		new cid = str_to_num(c[0])
		
		if( cid > 0 && cid <= get_maxplayers() && is_user_connected(cid) ) {
			
			client_print( 0, print_chat, "[Frag] Anti-Cheat: receives a screenshot from specific player" )
			client_print( cid, print_chat, "[Frag] Anti-Cheat: screenshot has been taken" )
			client_cmd( cid, ";snapshot" )
		}
	}
	
}

Last edited by nacknic; 04-07-2020 at 04:31.
nacknic is offline
headshot910
Member
Join Date: Apr 2012
Old 04-05-2020 , 05:23   Re: screenshot not working why ?
Reply With Quote #2

i think you got the wrong index :

PHP Code:
client_print0print_chat"[Frag] Anti-Cheat: screenshot has been taken" )
client_cmd0"wait;wait;snapshot" 
0 is for the HLDS i think. The 'real' player should start from 1. So, instead of only HLDS take screen shot you should use client_cmd on all available player if that's what you want.

change to ->>
PHP Code:
for(new i=0;i<=get_maxplayers();i++)
{
    
client_printiprint_chat"[Frag] Anti-Cheat: screenshot has been taken" )
    
client_cmdi"wait;wait;snapshot" )

__________________
Hi!
I'm here!
headshot910 is offline
thEsp
BANNED
Join Date: Aug 2017
Old 04-05-2020 , 06:01   Re: screenshot not working why ?
Reply With Quote #3

Quote:
Originally Posted by nacknic View Post
i tried screenshot plugins from alliedmodderes, not works (only prints).

i do very very simple one by my self not work either:
Code:
#include <amxmodx>

public plugin_init( ) {
	register_clcmd("say !ss", "ssf")
}

public ssf ( ) {
	
        client_print( 0, print_chat, "[Frag] Anti-Cheat: screenshot has been taken" )
        client_cmd( 0, "wait;wait;snapshot" )	
	
}

i tried with no single one wait, try with one, two... not working (try with hlds + real server on ftp both not working)
Seriously you're still working on this?
thEsp is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-05-2020 , 07:24   Re: screenshot not working why ?
Reply With Quote #4

Quote:
Originally Posted by headshot910 View Post
i think you got the wrong index :

PHP Code:
client_print0print_chat"[Frag] Anti-Cheat: screenshot has been taken" )
client_cmd0"wait;wait;snapshot" 
0 is for the HLDS i think. The 'real' player should start from 1. So, instead of only HLDS take screen shot you should use client_cmd on all available player if that's what you want.

change to ->>
PHP Code:
for(new i=0;i<=get_maxplayers();i++)
{
    
client_printiprint_chat"[Frag] Anti-Cheat: screenshot has been taken" )
    
client_cmdi"wait;wait;snapshot" )

0 is for all players. So your code does the exact same thing, except it's inefficient. You should use "get_players" to loop through all connected players, instead of all indexes from 1 to 32.
__________________

Last edited by OciXCrom; 04-05-2020 at 07:24.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
nacknic
Senior Member
Join Date: Mar 2019
Old 04-05-2020 , 12:42   Re: screenshot not working why ?
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
0 is for all players. So your code does the exact same thing, except it's inefficient. You should use "get_players" to loop through all connected players, instead of all indexes from 1 to 32.
i did this lol before looking her, but have still bug its do 2 pic not 1 not k
now why:
Code:
public plugin_init( ) {
	
	register_concmd("say !ss", "ssFunc" )
}


public ssFunc(id) {
	
	if( is_user_connected(id), get_user_flags(id) & ADMIN_LEVEL_A ) {
		
		new player[32]
		new num
		get_players( player, num )
		
		for( new i = 0; i < num; i++ ) {
			
			client_print( player[i], print_chat, "[Frag] Anti-Cheat: screenshot has been taken" )
			client_cmd( player[i], ";snapshot" );
					
		}
		
	} else client_print( id, print_chat, "[Frag] Anti-Cheat: you do not have access" )
}
i tried in for loop if( is_user_connected(player[i]) ) again its do 2 pic

another question, i want find the very basic admin i dont know if its :
ADMIN_IMMUNITY or ADMIN_LEVEL_A i sew there level a b c d e f g h... A = simple or owner ?
nacknic is offline
nacknic
Senior Member
Join Date: Mar 2019
Old 04-05-2020 , 12:43   Re: screenshot not working why ?
Reply With Quote #6

Quote:
Originally Posted by thEsp View Post
Seriously you're still working on this?
my anti cheat work! i try woth another people, but i upgrade version its my 1.1.

why so negative ?
nacknic is offline
nacknic
Senior Member
Join Date: Mar 2019
Old 04-05-2020 , 12:44   Re: screenshot not working why ?
Reply With Quote #7

Quote:
Originally Posted by headshot910 View Post
i think you got the wrong index :

PHP Code:
client_print0print_chat"[Frag] Anti-Cheat: screenshot has been taken" )
client_cmd0"wait;wait;snapshot" 
0 is for the HLDS i think. The 'real' player should start from 1. So, instead of only HLDS take screen shot you should use client_cmd on all available player if that's what you want.

change to ->>
PHP Code:
for(new i=0;i<=get_maxplayers();i++)
{
    
client_printiprint_chat"[Frag] Anti-Cheat: screenshot has been taken" )
    
client_cmdi"wait;wait;snapshot" )

yes after i try i get this... THANK YOU (and i was thinking the screenshot needed to be in userdata folder and its not its in cstrike

Last edited by nacknic; 04-05-2020 at 12:45.
nacknic is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-05-2020 , 15:16   Re: screenshot not working why ?
Reply With Quote #8

Quote:
Originally Posted by nacknic View Post
i did this lol before looking her, but have still bug its do 2 pic not 1 not k
now why:
Code:
public plugin_init( ) {
	
	register_concmd("say !ss", "ssFunc" )
}


public ssFunc(id) {
	
	if( is_user_connected(id), get_user_flags(id) & ADMIN_LEVEL_A ) {
		
		new player[32]
		new num
		get_players( player, num )
		
		for( new i = 0; i < num; i++ ) {
			
			client_print( player[i], print_chat, "[Frag] Anti-Cheat: screenshot has been taken" )
			client_cmd( player[i], ";snapshot" );
					
		}
		
	} else client_print( id, print_chat, "[Frag] Anti-Cheat: you do not have access" )
}
i tried in for loop if( is_user_connected(player[i]) ) again its do 2 pic

another question, i want find the very basic admin i dont know if its :
ADMIN_IMMUNITY or ADMIN_LEVEL_A i sew there level a b c d e f g h... A = simple or owner ?
Don't use "register_concmd" - this is for commands that can be executed via the server's and client's console You need only client console, so use "register_clcmd".

The "is_user_connected" check is not needed - if a player is not connected, how would he execute the command in the first place?

Like I said in my previous post - this code is the exact same as the other one.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DJBosma
Member
Join Date: Dec 2009
Old 04-06-2020 , 02:07   Re: screenshot not working why ?
Reply With Quote #9

I don't understand how any of these changes are going to work, as client_cmd doesn't work either.
DJBosma is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-06-2020 , 02:53   Re: screenshot not working why ?
Reply With Quote #10

Why I remember this as "SlowHacking", perform commands on clients which suppose not to work.
*edit
Is screenshot cmd filtered out of this restriction ?

Last edited by Bacardi; 04-06-2020 at 02:56.
Bacardi is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode