Modificare plugin cerere_wcd

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

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

10 Oct 2019, 09: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?
RoyalServer
@IONUTZ
Membru, skill +1
Membru, skill +1
Posts: 284
Joined: 17 Dec 2017, 23:11
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 5 times
Been thanked: 14 times

10 Oct 2019, 11: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: 259
Joined: 14 Aug 2009, 11:50
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Detinator server CS: Da
Location: Birmingham

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.
//
@IONUTZ
Membru, skill +1
Membru, skill +1
Posts: 284
Joined: 17 Dec 2017, 23:11
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 5 times
Been thanked: 14 times

10 Oct 2019, 20:08

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

10 Oct 2019, 20: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: 259
Joined: 14 Aug 2009, 11:50
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Detinator server CS: Da
Location: Birmingham

14 Oct 2019, 09:03

Nimeni?
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3844
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 594 times
Contact:

14 Oct 2019, 11: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( )
		}
	}
}
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
Post Reply

Return to “Modificari pluginuri”

  • Information