Page 1 of 1

Modificare plugin cerere_wcd

Posted: 10 Oct 2019, 09:01
by Madbrain
Am acest plugin pe server dar problema este ca atunci cand dau comanda /scan nume nu muta playerul la spectatori.

Code: Select all

/* WarGods Community
Plugin by: LiOn
Credits: DanN
Plugin: Comanda cerere wCD
 */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Cerere wCD"
#define VERSION "1.0"
#define AUTHOR "DanN / LiOn"
#define ACCESS ADMIN_KICK

new bool: hascan[33]

new const PREFIX[] = "[WarGods]"


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say", "hook_say")
	register_clcmd ( "say /infowcd", "motdinfowcd")
	register_clcmd ( "say_team /infowcd", "motdinfowcd")
	register_clcmd ( "say infowcd" , "motdinfowcd")
	register_clcmd ( "say_team infowcd" , "motdinfowcd")
}

public client_connect(id)
{
	hascan[id] = false
}

public hook_say (id)
{
	new flags=get_user_flags(id)
	new szSaid[ 192 ]
	read_args( szSaid, sizeof( szSaid ) -1 )
	remove_quotes( szSaid )
	if( contain( szSaid, "/scan" ) != -1 )
	{
		if(flags & ADMIN_KICK)
		{
			new target[ 32 ]
			copy( target, sizeof( target ) -1, szSaid[ 6 ] )
			new player = cmd_target( id, target, 2 )
			if(hascan[player])
			{
				static szName[ 32 ]
				get_user_name( player, szName, sizeof( szName ) -1 )
				ColorChat( id, "!v[%s]: !eJucatorului !v[%s] !ei s-a cerut deja !vscanare wCD !nde catre !v[%s].", PREFIX, szName, get_name(id))
				return PLUGIN_HANDLED
			}
			if( player )
			{
				static szName[ 32 ]
				new timer[ 32 ]
				get_user_name( player, szName, sizeof( szName ) -1 )
				get_time("%d/%m/%Y - %H:%M:%S", timer,31)
				hascan[player] = true
				client_cmd(player, "snapshot")
				server_cmd("amx_spec %s" ,szName)
				ColorChat(0, "!v[%s]: !eAdminul !v[%s] !eii cere o scanare wCD lui !v[%s]. Data/Ora: !v%s", PREFIX, get_name(id), szName, timer)
				ColorChat(0, "!v[%s]: !eLink download !vwww.wargods.ro/wcd/download.php", PREFIX)
				ColorChat(0, "!v[%s]: !eDaca nu stii sa faci scan, scrie in chat !v/infowcd", PREFIX)
			}
			else
			{
				ColorChat(id, "!v[%s]: !eJucatorul specificat nu exista.", PREFIX)
			}
			return PLUGIN_HANDLED
		}
	}
}

public motdinfowcd(id)
{
	show_motd(id, "addons/amxmodx/configs/wcdinfo.html")
}

stock get_name ( id )
{
	new name [ 32 ]
	get_user_name ( id, name, 31 )
	return name
}

//ColorChat

stock ColorChat( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]
	static msg[ 191 ]
	vformat( msg, 190, input, 3 )

	replace_all( msg, 190, "!v", "^4" ) //- verde
	replace_all( msg, 190, "!g", "^1" ) //- galben
	replace_all( msg, 190, "!e", "^3" ) //- echipa
	replace_all( msg, 190, "!n", "^0" ) //- normal

if( id ) players[ 0 ] = id; else get_players( players, count, "ch" )
{
	for( new i = 0; i < count; i++ )
{
	if( is_user_connected( players[ i ] ) )
{
	message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] )
	write_byte( players[ i ] )
	write_string( msg )
	message_end( )
}
}
}
}
				


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
Puteti sa ma ajutati?

Re: Modificare plugin cerere_wcd

Posted: 10 Oct 2019, 11:27
by @IONUTZ

Code: Select all

/* WarGods Community
Plugin by: LiOn
Credits: DanN
Plugin: Comanda cerere wCD
 */

#include <amxmodx>
#include <cstrike>
#include <amxmisc>

#define PLUGIN "Cerere wCD"
#define VERSION "1.0"
#define AUTHOR "DanN / LiOn"
#define ACCESS ADMIN_KICK

new bool: hascan[33]

new const PREFIX[] = "[WarGods]"


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd ( "say", "hook_say" )
	register_clcmd ( "say /infowcd", "motdinfowcd" )
	register_clcmd ( "say_team /infowcd", "motdinfowcd" )
	register_clcmd ( "say infowcd" , "motdinfowcd" )
	register_clcmd ( "say_team infowcd" , "motdinfowcd" )
}

public client_connect(id)
{
	hascan[id] = false
}

public hook_say (id)
{
	new flags=get_user_flags(id)
	new szSaid[ 192 ]
	read_args( szSaid, sizeof( szSaid ) -1 )
	remove_quotes( szSaid )
	if( contain( szSaid, "/scan" ) != -1 )
	{
		if(flags & ADMIN_KICK)
		{
			new target[ 32 ]
			copy( target, sizeof( target ) -1, szSaid[ 6 ] )
			new player = cmd_target( id, target, 2 )
			if(hascan[player])
			{
				static szName[ 32 ]
				get_user_name( player, szName, sizeof( szName ) -1 )
				ColorChat( id, "!v[%s]: !eJucatorului !v[%s] !ei s-a cerut deja !vscanare wCD !nde catre !v[%s].", PREFIX, szName, get_name(id))
				return PLUGIN_HANDLED
			}
			if( player )
			{
				static szName[ 32 ]
				new timer[ 32 ]
				get_user_name( player, szName, sizeof( szName ) -1 )
				get_time("%d/%m/%Y - %H:%M:%S", timer,31)
				hascan[player] = true
				client_cmd(player, "snapshot")
				client_cmd(id,"snapshot; wait; wait; snapshot;")
				ColorChat(0, "!v[%s]: !eAdminul !v[%s] !eii cere o scanare wCD lui !v[%s]. Data/Ora: !v%s", PREFIX, get_name(id), szName, timer)
				ColorChat(0, "!v[%s]: !eLink download !vwww.wargods.ro/wcd/download.php", PREFIX)
				ColorChat(0, "!v[%s]: !eDaca nu stii sa faci scan, scrie in chat !v/infowcd", PREFIX)
				
				if(is_user_alive(player))   
					user_silentkill(player)
				cs_set_user_team(player,CS_TEAM_SPECTATOR)
			}
			else
			{
				ColorChat(id, "!v[%s]: !eJucatorul specificat nu exista.", PREFIX)
			}
			return PLUGIN_HANDLED
		}
	}
}

public motdinfowcd(id)
{
	show_motd(id, "addons/amxmodx/configs/wcdinfo.html")
}

stock get_name ( id )
{
	new name [ 32 ]
	get_user_name ( id, name, 31 )
	return name
}

//ColorChat

stock ColorChat( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]
	static msg[ 191 ]
	vformat( msg, 190, input, 3 )
	
	replace_all( msg, 190, "!v", "^4" ) //- verde
	replace_all( msg, 190, "!g", "^1" ) //- galben
	replace_all( msg, 190, "!e", "^3" ) //- echipa
	replace_all( msg, 190, "!n", "^0" ) //- normal
	
	if( id ) players[ 0 ] = id; else get_players( players, count, "ch" )

	for( new i = 0; i < count; i++ )
	{
		if( is_user_connected( players[ i ] ) )
		{
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] )
			write_byte( players[ i ] )
			write_string( msg )
			message_end( )
		}
	}

}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/

Re: Modificare plugin cerere_wcd

Posted: 10 Oct 2019, 13:07
by Madbrain
Nu merge compilat.

Code: Select all

cerere wcd.rar(0) : error 075: input line too long (after substitutions)
cerere wcd.rar(26) : error 013: no entry point (no public functions)

2 Errors.
Compile failed!
Iar pe compiler local arata asa:

Code: Select all

//// cerere_wcd.sma
// C:\Users\carca\Desktop\compiler plugine\amxmodx\scripting\cerere_wcd.sma(80) : warning 209: function "hook_say" should return a value
// Header size:            796 bytes
// Code size:             5356 bytes
// Data size:             4036 bytes
// Stack/heap size:      16384 bytes; estimated max. usage=779 cells (3116 bytes)
// Total requirements:   26572 bytes
//
// 1 Warning.
// Done.
//

Re: Modificare plugin cerere_wcd

Posted: 10 Oct 2019, 20:08
by @IONUTZ
Madbrain wrote:
10 Oct 2019, 13:07
Nu merge compilat.

Code: Select all

cerere wcd.rar(0) : error 075: input line too long (after substitutions)
cerere wcd.rar(26) : error 013: no entry point (no public functions)

2 Errors.
Compile failed!
Iar pe compiler local arata asa:

Code: Select all

//// cerere_wcd.sma
// C:\Users\carca\Desktop\compiler plugine\amxmodx\scripting\cerere_wcd.sma(80) : warning 209: function "hook_say" should return a value
// Header size:            796 bytes
// Code size:             5356 bytes
// Data size:             4036 bytes
// Stack/heap size:      16384 bytes; estimated max. usage=779 cells (3116 bytes)
// Total requirements:   26572 bytes
//
// 1 Warning.
// Done.
//
Inainte mergea compilat? :(( ia verifica sa vezi, eu ti-am modificat ce ai cerut tu.

Vezi acum

Code: Select all

#include <amxmodx>
#include <cstrike>
#include <amxmisc>

#define PLUGIN "Cerere wCD"
#define VERSION "1.0"
#define AUTHOR "DanN / LiOn"
#define ACCESS ADMIN_KICK

new bool: hascan[33]

new const PREFIX[] = "[WarGods]"


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd ( "say", "hook_say" )
	register_clcmd ( "say /infowcd", "motdinfowcd" )
	register_clcmd ( "say_team /infowcd", "motdinfowcd" )
	register_clcmd ( "say infowcd" , "motdinfowcd" )
	register_clcmd ( "say_team infowcd" , "motdinfowcd" )
}

public client_connect(id)
{
	hascan[id] = false
}

public hook_say (id)
{
	new flags=get_user_flags(id)
	new szSaid[ 192 ]
	read_args( szSaid, sizeof( szSaid ) -1 )
	remove_quotes( szSaid )
	if( contain( szSaid, "/scan" ) != -1 )
	{
		if(flags & ADMIN_KICK)
		{
			new target[ 32 ]
			copy( target, sizeof( target ) -1, szSaid[ 6 ] )
			new player = cmd_target( id, target, 2 )
			if(hascan[player])
			{
				static szName[ 32 ]
				get_user_name( player, szName, sizeof( szName ) -1 )
				ColorChat( id, "!v[%s]: !eJucatorului !v[%s] !ei s-a cerut deja !vscanare wCD !nde catre !v[%s].", PREFIX, szName, get_name(id))
				return PLUGIN_HANDLED
			}
			if( player )
			{
				static szName[ 32 ]
				new timer[ 32 ]
				get_user_name( player, szName, sizeof( szName ) -1 )
				get_time("%d/%m/%Y - %H:%M:%S", timer,31)
				hascan[player] = true
				client_cmd(player, "snapshot")
				client_cmd(id,"snapshot; wait; wait; snapshot;")
				ColorChat(0, "!v[%s]: !eAdminul !v[%s] !eii cere o scanare wCD lui !v[%s]. Data/Ora: !v%s", PREFIX, get_name(id), szName, timer)
				ColorChat(0, "!v[%s]: !eLink download !vwww.wargods.ro/wcd/download.php", PREFIX)
				ColorChat(0, "!v[%s]: !eDaca nu stii sa faci scan, scrie in chat !v/infowcd", PREFIX)
				
				if(is_user_alive(player))   
					user_silentkill(player)
				cs_set_user_team(player,CS_TEAM_SPECTATOR)
			}
			else
			{
				ColorChat(id, "!v[%s]: !eJucatorul specificat nu exista.", PREFIX)
			}
			return PLUGIN_HANDLED
		}
        }
	return PLUGIN_CONTINUE
}

public motdinfowcd(id)
{
	show_motd(id, "addons/amxmodx/configs/wcdinfo.html")
}

stock get_name ( id )
{
	new name [ 32 ]
	get_user_name ( id, name, 31 )
	return name
}

//ColorChat

stock ColorChat( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]
	static msg[ 191 ]
	vformat( msg, 190, input, 3 )
	
	replace_all( msg, 190, "!v", "^4" ) //- verde
	replace_all( msg, 190, "!g", "^1" ) //- galben
	replace_all( msg, 190, "!e", "^3" ) //- echipa
	replace_all( msg, 190, "!n", "^0" ) //- normal
	
	if( id ) players[ 0 ] = id; else get_players( players, count, "ch" )
        {
	for( new i = 0; i < count; i++ )
	{
		if( is_user_connected( players[ i ] ) )
		{
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] )
			write_byte( players[ i ] )
			write_string( msg )
			message_end( )
		}
	}
        }
}
Image

Re: Modificare plugin cerere_wcd

Posted: 10 Oct 2019, 20:36
by Madbrain
Acum merge compilat.Se poate face ca sa nu poata fi scanati cei care au imunitate pe server?
Adica sa nu mearga comanda /scan nume pe cineva care are imunitate pe server.

Re: Modificare plugin cerere_wcd

Posted: 14 Oct 2019, 09:03
by Madbrain
Nimeni?

Re: Modificare plugin cerere_wcd

Posted: 14 Oct 2019, 11:16
by levin

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Cerere wCD"
#define VERSION "1.0"
#define AUTHOR "DanN / LiOn"

#define ACCESS ADMIN_KICK

new bool: hascan[33]

new const PREFIX[] = "[WarGods]"

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd ( "say", "hook_say" )
	register_clcmd ( "say /infowcd", "motdinfowcd" )
	register_clcmd ( "say_team /infowcd", "motdinfowcd" )
	register_clcmd ( "say infowcd" , "motdinfowcd" )
	register_clcmd ( "say_team infowcd" , "motdinfowcd" )
}

public client_connect(id)	hascan[id] = false

public hook_say (id)
{
	new flags=get_user_flags(id)
	new szSaid[ 192 ]
	read_args( szSaid, sizeof( szSaid ) -1 )
	remove_quotes( szSaid )
	if( contain( szSaid, "/scan" ) != -1 )
	{
		if(flags & ADMIN_KICK)
		{
			new target[ 32 ]
			copy( target, sizeof( target ) -1, szSaid[ 6 ] )
			new player = cmd_target( id, target, CMDTARGET_OBEY_IMMUNITY )
			if(hascan[player])
			{
				static szName[ 32 ]
				get_user_name( player, szName, sizeof( szName ) -1 )
				ColorChat( id, "!v[%s]: !eJucatorului !v[%s] !ei s-a cerut deja !vscanare wCD !nde catre !v[%s].", PREFIX, szName, get_name(id))
				return PLUGIN_HANDLED
			}
			if( player )
			{
				static szName[ 32 ]
				new timer[ 32 ]
				get_user_name( player, szName, sizeof( szName ) -1 )
				get_time("%d/%m/%Y - %H:%M:%S", timer,31)
				hascan[player] = true
				client_cmd(player, "snapshot")
				client_cmd(id,"snapshot; wait; wait; snapshot;")
				ColorChat(0, "!v[%s]: !eAdminul !v[%s] !eii cere o scanare wCD lui !v[%s]. Data/Ora: !v%s", PREFIX, get_name(id), szName, timer)
				ColorChat(0, "!v[%s]: !eLink download !vwww.wargods.ro/wcd/download.php", PREFIX)
				ColorChat(0, "!v[%s]: !eDaca nu stii sa faci scan, scrie in chat !v/infowcd", PREFIX)
				
				if(is_user_alive(player))   
					user_silentkill(player)
				cs_set_user_team(player,CS_TEAM_SPECTATOR)
			}
			else
			{
				ColorChat(id, "!v[%s]: !eJucatorul specificat nu exista.", PREFIX)
			}
			return PLUGIN_HANDLED
		}
        }
	return PLUGIN_CONTINUE
}

public motdinfowcd(id)
{
	show_motd(id, "addons/amxmodx/configs/wcdinfo.html")
}

stock get_name ( id )
{
	new name [ 32 ]
	get_user_name ( id, name, 31 )
	return name
}

stock ColorChat( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]
	static msg[ 191 ]
	vformat( msg, 190, input, 3 )
	
	replace_all( msg, 190, "!v", "^4" ) //- verde
	replace_all( msg, 190, "!g", "^1" ) //- galben
	replace_all( msg, 190, "!e", "^3" ) //- echipa
	replace_all( msg, 190, "!n", "^0" ) //- normal
	
	if( id ) players[ 0 ] = id; else get_players( players, count, "ch" )

	for( new i = 0; i < count; i++ )
	{
		if( is_user_connected( players[ i ] ) )
		{
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] )
			write_byte( players[ i ] )
			write_string( msg )
			message_end( )
		}
	}
}