Modificare plugin cerere_wcd

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori

Post Reply
User avatar
Madbrain
Membru, skill +1
Membru, skill +1
Posts: 276
Joined: 14 Aug 2009, 10:50
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Detinator server CS: Da
Location: Birmingham

10 Oct 2019, 08:01

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?
eXtreamSHOP
@IONUTZ
Membru, skill +1
Membru, skill +1
Posts: 202
Joined: 17 Dec 2017, 23:11
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 2 times
Been thanked: 3 times

10 Oct 2019, 10:27

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 }
*/
User avatar
Madbrain
Membru, skill +1
Membru, skill +1
Posts: 276
Joined: 14 Aug 2009, 10:50
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Detinator server CS: Da
Location: Birmingham

10 Oct 2019, 12: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.
//
@IONUTZ
Membru, skill +1
Membru, skill +1
Posts: 202
Joined: 17 Dec 2017, 23:11
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 2 times
Been thanked: 3 times

10 Oct 2019, 19:08

Madbrain wrote:
10 Oct 2019, 12: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
User avatar
Madbrain
Membru, skill +1
Membru, skill +1
Posts: 276
Joined: 14 Aug 2009, 10:50
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Detinator server CS: Da
Location: Birmingham

10 Oct 2019, 19:36

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.
User avatar
Madbrain
Membru, skill +1
Membru, skill +1
Posts: 276
Joined: 14 Aug 2009, 10:50
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Detinator server CS: Da
Location: Birmingham

14 Oct 2019, 08:03

Nimeni?
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2455
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 36 times
Been thanked: 375 times
Contact:

14 Oct 2019, 10:16

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( )
		}
	}
}
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici.
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests