Modificare plugin [rezolvat!]

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
CAHULMD
Membru, skill 0
Membru, skill 0
Posts: 41
Joined: 27 Sep 2015, 11:27
Detinator Steam: Da
SteamID: STEAM_0:0:857918
Fond eXtream: 0
Location: MD, or. Cahul
Contact:

08 Aug 2018, 00:55

Doresc sa transfer jucatori nu doar din consola doar si direct din chat (say)
Ex: /ct <nume sau parte din nume> ; /t <nume> ; /spec <nume>
Transfer.sma | Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init()
{
	register_plugin("Team Transfer", "1.0", "Alex");
	register_concmd("amx_ct", "cmdct", ADMIN_SLAY, "Transfera jucatorul la echipa Counter-Terrorist");
	register_concmd("amx_t", "cmdt", ADMIN_SLAY, "Transfera jucatorul la echipa Terrorist");
	register_concmd("amx_spec", "cmdspec", ADMIN_SLAY, "Transfera jucatorul la Spectator");
}

public cmdct(id, level, cid)
{ 
	if (!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}

	new arg[32], cmd[32];
	read_argv(0,cmd,31);
	read_argv(1,arg,31);
	new player = cmd_target(id,arg,CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF);

	if (!player)
	{
		return PLUGIN_HANDLED;
	}

	if (cs_get_user_team(player) == CS_TEAM_CT)
	{
		console_print(id, "* Jucatorul este deja in echipa CT");
		return PLUGIN_HANDLED;
	}
	
	new name[32], name2[32];
	get_user_name(id,name,31);
	get_user_name(player,name2, 31);

	if (is_user_alive (player) )
	{
		user_silentkill(player);
	}

	cs_set_user_team(player,CS_TEAM_CT);
    	log_amx("Admin %s: task amx_ct %s",name, name2);
	ColorChat(0, "^1ADMIN^4 %s^1: transfer^4 %s^1 to^4 CT", name, name2);

	return PLUGIN_HANDLED;
}

public cmdt(id, level, cid)
{ 
	if (!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}

	new arg[32], cmd[32];
	read_argv(0,cmd,31);
	read_argv(1,arg,31);
	new player = cmd_target(id,arg,CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF);

	if (!player)
	{
		return PLUGIN_HANDLED;
	}

	if (cs_get_user_team(player) == CS_TEAM_T)
	{
		console_print(id, "* Jucatorul este deja in echipa T");
		return PLUGIN_HANDLED;
	}
	
	new name[32], name2[32];
	get_user_name(id,name,31);
	get_user_name(player,name2, 31);

	if (is_user_alive (player) )
	{
		user_silentkill(player);
	}
	
	cs_set_user_team(player,CS_TEAM_T);
    	log_amx("Admin %s: task amx_t %s",name, name2);
	ColorChat(0, "^1ADMIN^4 %s^1: transfer^4 %s^1 to^4 TERRORIST", name, name2);

	return PLUGIN_HANDLED;
}

public cmdspec(id, level, cid)
{ 
	if (!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}

	new arg[32], cmd[32];
	read_argv(0,cmd,31);
	read_argv(1,arg,31);
	new player = cmd_target(id,arg,CMDTARGET_ALLOW_SELF);

	if (!player)
	{
		return PLUGIN_HANDLED;
	}

	if (cs_get_user_team(player) == CS_TEAM_SPECTATOR)
	{
		console_print(id, "* Jucatorul este deja in spectatori");
		return PLUGIN_HANDLED;
	}
	
	new name[32], name2[32];
	get_user_name(id,name,31);
	get_user_name(player,name2, 31);

	if (is_user_alive (player) )
	{
		user_silentkill(player);
	}

	cs_set_user_team(player,CS_TEAM_SPECTATOR);
    	log_amx("Admin %s: task amx_spec %s",name, name2);
	ColorChat(0, "^1ADMIN^4 %s^1: transfer^4 %s^1 to^4 SPECTATOR", name, name2);

	return PLUGIN_HANDLED;
}

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

    replace_all(msg, 190, "!g", "^4") // Green Color
    replace_all(msg, 190, "!n", "^1") // Default Color
    replace_all(msg, 190, "!t", "^3") // Team Color

    if (id) players[0] = id; else get_players(players, count, "ch")
    {
        for (new i = 0; i < count; i++)
        {
            if (is_user_connected(players))
            {
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
                write_byte(players);
                write_string(msg);
                message_end();
            }
        }
    }
}
RoyalServer
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2548
Joined: 10 Jul 2013, 21:26
Detinator Steam: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 26 times
Been thanked: 61 times
Contact:

08 Aug 2018, 10:40

înlocuiește "plugin_inot" cu asta

Code: Select all

public plugin_init()
{
	register_plugin("Team Transfer", "1.0", "Alex");
	register_concmd("amx_ct", "cmdct", ADMIN_SLAY, "Transfera jucatorul la echipa Counter-Terrorist");
	register_concmd("amx_t", "cmdt", ADMIN_SLAY, "Transfera jucatorul la echipa Terrorist");
	register_concmd("amx_spec", "cmdspec", ADMIN_SLAY, "Transfera jucatorul la Spectator");

register_clcmd("say /ct", "cmdct", ADMIN_SLAY, "Transfera jucatorul la echipa Counter-Terrorist");
	register_clcmd("say /t", "cmdt", ADMIN_SLAY, "Transfera jucatorul la echipa Terrorist");
	register_clcmd("say /spec", "cmdspec", ADMIN_SLAY, "Transfera jucatorul la Spectator");
}
no...
User avatar
CAHULMD
Membru, skill 0
Membru, skill 0
Posts: 41
Joined: 27 Sep 2015, 11:27
Detinator Steam: Da
SteamID: STEAM_0:0:857918
Fond eXtream: 0
Location: MD, or. Cahul
Contact:

08 Aug 2018, 21:55

Am incercat si nu merge asa.
User avatar
CAHULMD
Membru, skill 0
Membru, skill 0
Posts: 41
Joined: 27 Sep 2015, 11:27
Detinator Steam: Da
SteamID: STEAM_0:0:857918
Fond eXtream: 0
Location: MD, or. Cahul
Contact:

11 Aug 2018, 23:19

L-am gasit aici. TC !
Last edited by j a h k 0- on 24 Sep 2018, 16:03, edited 1 time in total.
User avatar
j a h k 0-
Membru, skill +4
Membru, skill +4
Posts: 1536
Joined: 26 Jan 2016, 10:24
Detinator Steam: Da
CS Status: segmentation fault
SteamID: /ID/jkhalibu
Reputatie: Utilizator neserios
Restrictie moderator [permanent]
Membru Club eXtreamCS (3 luni)
Nume anterior: Jah#
Fond eXtream: 0
Location: Chişinău, Republic Of Moldova
Has thanked: 69 times
Been thanked: 13 times
Contact:

24 Sep 2018, 16:06

Mutat in Counter-Strike 1.6 » Programarea CS-ului » Modificari pluginuri
Tranzactii efectuate cu succes.
| Afiseaza codul
anunturi/vand-cont-rockstar-gta-15euro- ... 49363.html
anunturi/vand-cont-rockstar-gta-euro-paypal-t349373.html
anunturi/cumpar-tema-ipb-t349335.html
anunturi/recomandare-utilizatori-pentru-tranzactii-t323814-60.html
anunturi/recomandare-utilizatori-pentru-tranzactii-t323814-72.html
post2692853.html#p2692853
anunturi/addons-furien-classic-cyby-t348802.html
Image
| Afiseaza codul
Image
Image
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests