Modificare plugin /t/ct/spec [Rezolvat]

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori

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

14 Sep 2019, 17:41

Am acest plugin pe server si are un anunt in el de genul:
"Tasteaza in chat /comenzi pentr a vedea o lista cu comenzile tale !"
Problema este ca nu functioneaza aceasta comanda plus nu merge sa muti un jucator bagand comanda in chat /t nume ,/ct nume sau /spec nume,doar folosind comanda in consola amx_t,ct,spec nume.
Va atasez mai jos sursa pluginului
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "plugin_comenzi"
#define VERSION "1.0"
#define AUTHOR "Rusu"  //update CoD2.0

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)

    register_clcmd("say /spec","spec");
    register_clcmd("say_team /spec","spec");
    register_clcmd("say /ct","ct");
    register_clcmd("say_team /ct","ct");
    register_clcmd("say /t","t")
    register_clcmd("say_team /t","t")
    register_concmd ( "amx_t", "swap_team", ADMIN_KICK, "<name> - mutare jucator la Teroristi" );
    register_concmd ( "amx_ct", "swap_team", ADMIN_KICK, "<name> - mutare jucator la Counter-Teroristi" );
    register_concmd ( "amx_spec", "swap_team", ADMIN_KICK, "<name> - mutare jucator la Spectatori" );

    set_task( 100.0, "mesaj", 0, "", 0, "b" );
}
 
public spec(id)
{
    cs_set_user_team(id,CS_TEAM_SPECTATOR);

    if(is_user_alive(id))
    user_silentkill(id);

    return PLUGIN_CONTINUE;
}

public ct(id)
{
    cs_set_user_team(id,CS_TEAM_CT);
    user_silentkill(id);

    return PLUGIN_CONTINUE;
}

public t(id)
{
    cs_set_user_team(id,CS_TEAM_T);
    user_silentkill(id);

    return PLUGIN_CONTINUE;
}

public mesaj()
{
    client_print(0, print_chat, "Tasteaza in chat /comenzi pentr a vedea o lista cu comenzile tale !");
}

public comenzi(id)
{
    console_print( id, "---- Comenzi disponibile pe server ----" );
    console_print( id, "---------------------------------------" );
    console_print( id, "/spec - pe say & say_team si te transferi la spectatori" );
    console_print( id, "/ct - pe say & say_team si te transferi la CT" );
    console_print( id, "/t - pe say & say_team si te transferi la tero" );

    client_cmd( id, "toggleconsole" );

    return PLUGIN_HANDLED;
}


public swap_team ( id, level, cid ) {
    if( ! cmd_access ( id, level, cid, 2 ) )
        return PLUGIN_HANDLED;
    
    new szArg[ 10 ], target[ 32 ], szPlayerName[ 32 ], szAdminName[ 32 ];
    
    read_argv( 0, szArg, 9 );
    read_argv( 1, target, 31 );
    
    new player = cmd_target ( id, target, 11 );
    
    if( ! player ) 
        return PLUGIN_HANDLED;
    
    get_user_name ( player, szPlayerName, 31 );
    get_user_name ( id, szAdminName, 31 );
    
    switch ( szArg[ 4 ] ) {
        case 't': 
        {
            user_silentkill ( player );
            cs_set_user_team ( player, 1 );
            show_activity ( id, szAdminName, "mutare %s la Teroristi.", szPlayerName );
        }
        
        
        case 'c': 
        {
            user_silentkill ( player );
            cs_set_user_team ( player, 2 );
            show_activity ( id, szAdminName, "mutare %s la Counter-Teroristi.", szPlayerName );
        }
        
        case 's': 
        {
            user_silentkill ( player );
            cs_set_user_team ( player, 3 );
            show_activity ( id, szAdminName, "mutare %s la Spectatori.", szPlayerName );
        }
        
    }
    
    return PLUGIN_CONTINUE;
}
Se pot rezolva aceste probleme?
IG-BOOST.org - Instagram Followers Best, Cheap, Reliable
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2440
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: 372 times
Contact:

14 Sep 2019, 21:38

Code: Select all

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

#define SWAP_ACC ADMIN_KICK

public plugin_init()
{
	register_clcmd("say","SF")
	register_clcmd("say_team","SF")
	register_concmd ( "amx_sw", "swap_team", SWAP_ACC, "<name> <t/ct/spec>" );
	
	set_task( 100.0, "mesaj", 0, .flags="b" );
}

public SF(id)
{
	new arg[195],text[32],tinta[32],player
	read_args(arg,charsmax(arg))
	remove_quotes(arg)
	
	parse(arg,text,charsmax(text),tinta,charsmax(tinta))
	if(equali(text,"/spec"))
	{
		if(equali(tinta,""))
		{
			if(cs_get_user_team(id)!=CS_TEAM_SPECTATOR)
			{
				if(is_user_alive(id))	user_silentkill(id)
				cs_set_user_team(id,CS_TEAM_SPECTATOR)
			}
		}
		else
		{
			if(access(id,SWAP_ACC))
			{
				player=cmd_target(id,tinta,CMDTARGET_NO_BOTS)
				if(!player)	return PLUGIN_HANDLED
				if(is_user_alive(player)||cs_get_user_team(player)==CS_TEAM_SPECTATOR)	user_silentkill(player)
				cs_set_user_team(player,CS_TEAM_SPECTATOR)
			}
		}
		return PLUGIN_HANDLED
	}
	else if(equali(text,"/ct"))
	{
		if(equali(tinta,""))
		{
			if(cs_get_user_team(id)!=CS_TEAM_CT)
			{
				if(is_user_alive(id))	user_silentkill(id)
				cs_set_user_team(id,CS_TEAM_CT)
			}
		}
		else
		{
			if(access(id,SWAP_ACC))
			{
				player=cmd_target(id,tinta,CMDTARGET_NO_BOTS)
				if(!player||cs_get_user_team(player)==CS_TEAM_CT)	return PLUGIN_HANDLED
				if(is_user_alive(player))	user_silentkill(player)
				cs_set_user_team(player,CS_TEAM_CT)
			}
		}
		return PLUGIN_HANDLED
	}
	else if(equali(text,"/t"))
	{
		if(equali(tinta,""))
		{
			if(cs_get_user_team(id)!=CS_TEAM_T)
			{
				if(is_user_alive(id))	user_silentkill(id)
				cs_set_user_team(id,CS_TEAM_T)
			}
		}
		else
		{
			if(access(id,SWAP_ACC))
			{
				player=cmd_target(id,tinta,CMDTARGET_NO_BOTS)
				if(!player||cs_get_user_team(player)==CS_TEAM_T)	return PLUGIN_HANDLED
				if(is_user_alive(player))	user_silentkill(player)
				cs_set_user_team(player,CS_TEAM_T)
			}
		}
		return PLUGIN_HANDLED
	}
	else if(equali(text,"/comenzi"))	comenzi(id)
	return PLUGIN_CONTINUE
}

public mesaj()	client_print(0, print_chat, "Tasteaza in chat /comenzi pentr a vedea o lista cu comenzile tale !");

public comenzi(id)
{
	console_print( id, "---- Comenzi disponibile pe server ----" );
	console_print( id, "---------------------------------------" );
	console_print( id, "/spec - pe say & say_team si te transferi la spectatori" );
	console_print( id, "/ct - pe say & say_team si te transferi la CT" );
	console_print( id, "/t - pe say & say_team si te transferi la tero" );
	
	client_cmd( id, "toggleconsole" );
}


public swap_team ( id, level, cid ) {
	if( ! cmd_access ( id, level, cid, 3 ) )	return PLUGIN_HANDLED;
	
	new szArg[ 32 ], szPlayerName[ 32 ], szAdminName[ 32 ];
	read_argv( 1, szArg, charsmax(szArg) );
	
	new player = cmd_target ( id, szArg, CMDTARGET_NO_BOTS );
	
	if( ! player )	return PLUGIN_HANDLED;
	
	get_user_name ( player, szPlayerName, 31 );
	get_user_name ( id, szAdminName, 31 );
	
	switch ( szArg[ 1 ] ) {
		case 't': 
		{
			if(cs_get_user_team(player)==CS_TEAM_T)	return PLUGIN_HANDLED
			if(is_user_alive(player))	user_silentkill ( player );
			cs_set_user_team ( player, CS_TEAM_T );
			client_print ( 0,print_chat, "%s mutare %s la Teroristi.",szAdminName, szPlayerName );
		}
		case 'c': 
		{
			if(cs_get_user_team(player)==CS_TEAM_CT)	return PLUGIN_HANDLED
			if(is_user_alive(player))	user_silentkill ( player );
			cs_set_user_team ( player, CS_TEAM_CT );
			client_print ( 0,print_chat, "%s mutare %s la Counter-Teroristi.",szAdminName, szPlayerName );
		}
		case 's': 
		{
			if(cs_get_user_team(player)==CS_TEAM_SPECTATOR)	return PLUGIN_HANDLED
			if(is_user_alive(player))	user_silentkill ( player );
			cs_set_user_team ( player, CS_TEAM_SPECTATOR );
			client_print ( 0,print_chat, "%s mutare %s la Spectatori.",szAdminName, szPlayerName );
		}
	}
	
	return PLUGIN_HANDLED
}
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.
User avatar
Madbrain
Membru, skill +1
Membru, skill +1
Posts: 275
Joined: 14 Aug 2009, 10:50
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Detinator server CS: Da
Location: Birmingham

15 Sep 2019, 08:14

Multumesc frumos @L E V I N.
Merge foarte bine.
User avatar
cs_all
Moderator
Moderator
Posts: 755
Joined: 17 Dec 2013, 19:51
Detinator Steam: Da
Reputatie: Moderator
Fost Membru Club eXtreamCS (o luna)
Location: New Orleans
Has thanked: 1 time
Been thanked: 2 times

18 Sep 2019, 12:33

Madbrain wrote:
15 Sep 2019, 08:14
Multumesc frumos @L E V I N.
Merge foarte bine.
Marcat ca "Rezolvat"
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests