Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
@LeX

CSDM Transfer (csdm_transfer.amxx)

Recommended Posts

 

CSDM Transfer
(Versiune: 1.0 | Autor: Setta0629)

 

Note:

Pluginul a fost editat sa rezolve bugrile care nu iti da respawn sau nu iti mai arata meniul armelor sau nu iti apare tinta

Am editat pluginul aranjand codul din doua surse, autorii fiind Setta0629 si daNzEt, dar l-am lasat pe Setta0629 pentru ca am lucrat mai mult in sursa lui

Nu sunt scripter, de aceea voi lasa sursa sa fie si vizibila pentru optimizari sau daca e gresit codul sa fie reeditat, apropo vreau si eu pluginul :) 

Nu am gasit link-urile oficiale asa ca am pus link-ul de unde le-am luat eu, dintr-o cerere, acolo se afla abele pluginuri

 

  • Descriere: Acest plugin este util atat jucatorilor cat si adminilor pentru a te muta  sau a transfera jucatori intre echipe rezolvand bugul de respawn si este color

 

  • Link official: Link
  • Link de download: click
  • Sursa:
    Spoiler
    #include <amxmodx>
    #include <cstrike>
    #include <amxmisc>
    #include <colorchat>
    #include <csdm>
    
    public plugin_init()
    {    
    	register_plugin("CSDM Transfer", "1.0", "Setta0629 # Fix Respawn")
    	register_clcmd("say !cs","cmdcs");
    	register_clcmd("say_team !cs","cmdcs")
    	register_clcmd("say !spec","cmdspec");
    	register_clcmd("say_team !spec","cmdspec");
    	register_clcmd("say !ct","cmdct");
    	register_clcmd("say_team !ct","cmdct");
    	register_clcmd("say !t","cmdt")
    	register_clcmd("say_team !t","cmdt")
    	register_concmd("amx_ct", "cmd_ct", ADMIN_LEVEL_D,"- <name>")
    	register_concmd("amx_t", "cmd_t", ADMIN_LEVEL_D,"- <name>")
    	register_concmd("amx_spec", "cmd_spec", ADMIN_LEVEL_D,"- <name>")
    	
    }
    
    public cmd_ct(id, level, cid)
    {
    	new arg[32]
    	
    	read_argv(1, arg, 31);
    	
    	new player = cmd_target(id, arg, 2)
    	
    	if (!player)	
    	
    		return PLUGIN_HANDLED
    		
    	cs_set_user_team (player ,CS_TEAM_CT)
    	
    	
    	user_silentkill(player)
    	csdm_respawn (player)
    	
    	static Admin[32], name2[32]
    	
    	get_user_name(id,Admin,31)
    	get_user_name(player,name2, 31)
    	
    	log_amx("Admin %s: Task amx_ct %s",Admin, name2);
    	
    	ColorChat(0,TEAM_COLOR,"^x04[Transfer]^x01[^x04%s^x01]: l-a mutat pe [^x04%s^x01] la echipa^x04 [Counter-Tero]", Admin, name2)
    	
    	return PLUGIN_HANDLED
    }
    
    public cmd_t(id, level, cid)
    {
    		
    	new arg[32]
    	
    	read_argv(1, arg, 31);
    	
    	new player = cmd_target(id, arg, 2)
    	
    	if (!player)
    	
    		return PLUGIN_HANDLED
    	
    	cs_set_user_team (player ,CS_TEAM_T)
    	
    	user_silentkill(player)
    	csdm_respawn (player)
    	
    	static Admin[32], name2[32]
    	
    	get_user_name(id,Admin,31)
    	get_user_name(player,name2, 31)
    	
    	log_amx("Admin %s: Task amx_t %s",Admin, name2);
    	
    	ColorChat(0,TEAM_COLOR,"^x04[Transfer]^x01[^x04%s^x01]: l-a mutat pe [^x04%s^x01] la echipa^x04 [Terorist]", Admin, name2)
    	
    	return PLUGIN_HANDLED
    }
    
    public cmd_spec(id, level, cid)
    {
    	
    	new arg[32]
    	read_argv(1, arg, 31)
    	
    	new player = cmd_target(id, arg, 2)
    	
    	if (!player)
    	
    		return PLUGIN_HANDLED
    		
    	cs_set_user_team (player ,CS_TEAM_SPECTATOR)
    	
    	user_silentkill(player)
    	
    	static Admin[32], name2[32]
    	
    	get_user_name(id,Admin,31)
    	get_user_name(player,name2, 31)
    	
    	log_amx("Admin %s: Task amx_spec %s",Admin, name2);
    	
    	ColorChat(0,TEAM_COLOR,"^x04[Transfer]^x01[^x04%s^x01]: l-a mutat pe [^x04%s^x01] la^x04 [SPECTATORI]", Admin, name2)
    	
    	return PLUGIN_HANDLED
    }
    
    public cmdcs (x)
    {
    	new name[32]
    	get_user_name(x, name, 31)
    	
    	cs_set_user_team (x , random_num (1, 2))
    	csdm_respawn (x)
    	
    	ColorChat(0,TEAM_COLOR,"^x04[Transfer]^x01[^x04%s^x01] s-a mutat^x04 [Random]", name )
    	
    	return PLUGIN_HANDLED
    }
    
    public cmdspec (x)
    {
    	new name[32]
    	get_user_name(x, name, 31)
    	
    	cs_set_user_team (x ,CS_TEAM_SPECTATOR)
    	user_silentkill (x)
    	
    	return PLUGIN_HANDLED
    }
    
    public cmdct(id)
    {
    	new name[32]
    	get_user_name(id, name, 31)
    	
    	cs_set_user_team(id ,CS_TEAM_CT)
    	user_silentkill (id)
    	
    	ColorChat(0,TEAM_COLOR,"^x04[Transfer]^x01[^x04%s^x01] s-a mutat^x04 [Counter-Tero]", name )
    	
    	return PLUGIN_HANDLED
    }
    
    public cmdt(id)
    {
    	new name[32]
    	get_user_name(id, name, 31)
    	
    	cs_set_user_team(id,CS_TEAM_T)
    	user_silentkill (id)
    	
    	ColorChat(0,TEAM_COLOR,"^x04[Transfer]^x01[^x04%s^x01] s-a mutat^x04 [Terorist]", name )
    	
    	return PLUGIN_HANDLED
    }
    

 

  • Comenzi:

Comenzi publice (se tasteaza in chat) 

!t - Transfer la echipa Terorist

!ct - Tranfer la echipa Counter-Terorist

!spec - Transfer la Spectatori (comanda nu va afisa nici un text de informare despre transfer in chat)

!cs - Transfer Random

Comenzi Admin:

amx_t <nume> - Transfera jucatorul la echipa Terorist

amx_ct <nume> - Transfera jucatorul la echipa Counter-Terorist

amx_spec <nume> - Transfera jucatorul la Spectatori

 

  • Module necesare: 
  • cstrike
  • csdm

 

  • Instalare:
  1. Copiem fisierul csdm_transfer.sma in addons\amxmodx\scripting
  2. Copiem fisierul csdm_transfer.amxx in addons\amxmodx\plugins
  3. Deschidem addons/amxmodx/configs/plugins.ini si adaugam la urma :
 
csdm_transfer.amxx
  • Imagini:
Spoiler

 

w92x9gw.jpg

22zluZo.jpg

sViXt22.jpg

IqkDfzH.jpg

 

 

Ps: Pluginul a fost compilat cu succes pe platforma amxmodx 1.9.0 (in dezvoltare) si nu afecteaza cu nimic versiunea 1.8.3

Citat

AMX Mod X Compiler 1.9.0.5234
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

Header size:            948 bytes
Code size:             7880 bytes
Data size:             5048 bytes
Stack/heap size:      16384 bytes
Total requirements:   30260 bytes
Done.

 

Share this post


Link to post
Share on other sites

Nu am putut sa dau edit la primul post asa ca postez aici updateul. 

In prezent am facut mai multe update-uri si am ajuns la versiune 1.5 dar am uitat sau nu am putut da edit la primul post.

Acesta este codul sursa, Il puteti optimiza cum doriti, si il puteti compila chiar voi.

Am adăugat un stock in locul sertarului "colorchat", dar apoi m-am gandit de ce sa folosesc un stock sau un sertar cand optiunile de color chat sunt deja definite.

Puteti alege cum doriti, cu stock sau fara.

Ce au fost remediate/modificate?

Acum plugin-ul verifica daca jucatorii au acces la comanda.

Au fost remediate problemele care tineau de jucatorii cu imunitate, acum nu se mai pot transfera jucatorii cu imunitate de catre cei ce nu au.

La comanda in chat "!spec" mesajul de transfer va fi afisat doar adminilor, nu cred as vrea ca un codat sa stie cand ma pun spec.

A fost adaugata si comanda amx_cs  <nume> - transfera un jucator random

 

Spoiler

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

#define NUME "CSDM Transfer"
#define VERSIUNE "1.5"
#define AUTOR "Setta0629 # Fix Respawn"
#define PLUGIN_HANDLED 1

public plugin_init()
{    
register_plugin (NUME, VERSIUNE, AUTOR);

register_clcmd("say !cs","cmdcs");
register_clcmd("say_team !cs","cmdcs");
register_clcmd("say !spec","cmdspec");
register_clcmd("say_team !spec","cmdspec");
register_clcmd("say !ct","cmdct");
register_clcmd("say_team !ct","cmdct");
register_clcmd("say !t","cmdt");
register_clcmd("say_team !t","cmdt");

register_concmd("amx_ct", "cmd_ct", ADMIN_KICK,"<name>");
register_concmd("amx_t", "cmd_t", ADMIN_KICK,"<name>");
register_concmd("amx_spec", "cmd_spec", ADMIN_KICK,"<name>");
register_concmd("amx_cs", "cmd_cs", ADMIN_KICK,"<name>");


}

public cmd_ct(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return 1

new arg[32]

read_argv(1, arg, 31);

new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)

if (!player)    
    return 1
    
cs_set_user_team (player ,CS_TEAM_CT)
    
user_silentkill(player)
csdm_respawn (player)
    
static Admin[32], name2[32]
    
get_user_name(id,Admin,31)
get_user_name(player,name2, 31)
    
log_amx("Admin %s: Task amx_ct %s",Admin, name2);
    
    
client_print_color(0, print_team_grey, "^4[^3Transfer^4] ^1[^4%s^1]: l-a mutat pe [^4%s^1] la [^4Counter-Tero^1]", Admin, name2)
    
    // default | functioneaza cu stock-ul print_color    
    //print_color(0, "!g[Transfer]!y [!g%s!y]: l-a mutat pe [!g%s!y] la echipa [!gCounter-Tero!y]", Admin, name2)
    
return 1
}

public cmd_t(id, level, cid)
{
    if (!cmd_access(id, level, cid, 2))
        return 1
    
    new arg[32]
    
    read_argv(1, arg, 31);
    
    new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
    
    if (!player)    
        return 1
    
    cs_set_user_team (player ,CS_TEAM_T)
    
    
    user_silentkill(player)
    csdm_respawn (player)
    
    static Admin[32], name2[32]
    
    get_user_name(id,Admin,31)
    get_user_name(player,name2, 31)
    
    log_amx("Admin %s: Task amx_t %s",Admin, name2);
    
    client_print_color(0, print_team_grey, "^4[^3Transfer^4]^1 [^4%s^1]: l-a mutat pe [^4%s^1] la [^4Terotist^1]", Admin, name2)
    
    // default | functioneaza cu stock-ul print_color
    //print_color(0, "!g[Transfer]!y [!g%s!y]: l-a mutat pe [!g%s!y] la echipa!y [!gTerorist!y]", Admin, name2)
    
    return 1 
}

public cmd_spec(id, level, cid)
{
    if (!cmd_access(id, level, cid, 2))
        return 1
    
    new arg[32]
    read_argv(1, arg, 31)
    
    new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
    
    if (!player)
        return 1
    
    cs_set_user_team (player ,CS_TEAM_SPECTATOR)
    
    user_silentkill(player)
    
    static Admin[32], name2[32]
    
    get_user_name(id,Admin,31)
    get_user_name(player,name2, 31)
    
    log_amx("Admin %s: Task amx_spec %s",Admin, name2);
    
    client_print_color(0, print_team_grey, "^4[^3Transfer^4] ^1[^4%s^1]: l-a mutat pe [^4%s^1] la [^4SPECTATORI^1]", Admin, name2)
    
    //default | fnuctioneaza cu stock-ul print_color
    //print_color(0, "!g[Transfer]!y [!g%s!y]: l-a mutat pe [!g%s!y] la [!gSPECTATORI!y]", Admin, name2)
    
    return 1
    
}

public cmd_cs(id, level, cid)
{
    if (!cmd_access(id, level, cid, 2))
        return 1
    
    new arg[32]
    read_argv(1, arg, 31)
    
    new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
    
    if (!player)
        return 1
    
    
    user_silentkill(player);
    
    cs_set_user_team (player, random_num (1, 2))
    
    csdm_respawn (player)
    
    static Admin[32], name2[32]
    
    get_user_name(id, Admin,31)
    get_user_name(player,name2, 31)
    
    log_amx("Admin %s: Task amx_cs %s",Admin, name2);
    
    client_print_color(0, print_team_grey, "^4[^3Transfer^4] ^1[^4%s^1]: l-a mutat pe [^4%s^1] [^4Random^1]", Admin, name2)
    
    //default | functioneaza cu stock-ul print_color
    //print_color(0,"!g[Transfer]!y [!g%s!y]: l-a mutat pe [!g%s!y] [!gRandom!y]", Admin, name2)
    
    return 1
}

public cmdcs(x)
{
    new name[32]

    get_user_name(x, name, 31);
    user_silentkill (x);
    
    cs_set_user_team(x , random_num (1, 2));
    csdm_respawn(x);
    
    client_print_color(0, print_team_grey, "^4[^3Transfer^4] ^1[^4%s^1] s-a mutat [^4Random^1]", name )
    
    // default | functioneaza cu stock-ul print_color
    //print_color(0,"!g[Transfer]!y [!g%s!y] s-a mutat [!gRandom!y]", name )
    
    return 1
}

public cmdspec(x)
{
    new name[32]
    
    new players[MAX_PLAYERS], inum, pl
    
    get_user_name(x, name, 31)
    get_players(players, inum, "ch")
    
    cs_set_user_team (x ,CS_TEAM_SPECTATOR)
    user_silentkill (x)
    
    for (new i = 0; i < inum; ++i)
    {
        pl = players
        if (access(pl, ADMIN_CHAT))
            client_print_color(pl, print_team_grey, "^4[^3Transfer^4] ^1[^4%s^1] s-a mutat [^4SPECTATOR^1]", name )
    }
    
    return 1
}
public cmdct(id)
{
    new name[32]
    get_user_name(id, name, 31)
    
    cs_set_user_team(id ,CS_TEAM_CT)
    user_silentkill (id)
    csdm_respawn (id)
    
    client_print_color(0, print_team_grey, "^4[^3Transfer^4] ^1[^4%s^1] s-a mutat [^4Counter-Tero^1]", name )
    
    // default | functioneaza cu stock-ul print_color
    //print_color(0,"!g[Transfer]!y [!g%s!y] s-a mutat [!gCounter-Tero!y]", name )
    
    return 1
}

public cmdt(id)
{
    new name[32]
    get_user_name(id, name, 31)
    
    cs_set_user_team(id,CS_TEAM_T)
    user_silentkill (id)
    csdm_respawn (id)
    
    client_print_color(0, print_team_grey, "^4[^3Transfer^4] ^1[^4%s^1] s-a mutat [^4Terorist^1]", name )
    
    // default | functioneaza cu stock-ul print_color
    //print_color(0, "!g[Transfer]!y [!g%s!y] s-a mutat [!gTerorist!y]", name )
    
    return 1
}
/*
stock print_color(const id, const input[], any:...)
{
    new count = 1, players[32]
    
    static msg[191]
    vformat(msg, 190, input, 3)
    
    replace_all( msg, 190, "!g", "^4" ) //- verde
    replace_all( msg, 190, "!y", "^1" ) //- galben
    replace_all( msg, 190, "!t", "^3" ) //- echipa
    
    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();
        }
    }
}

}
*/

 

Share this post


Link to post
Share on other sites

Si am zis sa mai vin cu un update, plugin-ul a suferit modificari in offline nepublicate si de aceea si aceasta versiune

Celelalte versiuni prezentau bug-uri

- Optimizari 

- Comanda suplimentara !play pentru respawn a fost adaugata

Spoiler
/*
Atentie !!!
Acest plugin este creat exclusiv pentru sistemul CSDM



*Acest plugin a fost editat de mine pentru a rezolva acel bug pentru transferarea juacatorilor

*Nu sariti in cap acum daca apar probleme, nu sunt scripter si nici nu sunt obligat sa ofer support

*Acest plugin a fost deja testat pe noul engine, reHLDS ce ruleaza un sistem CSDM functional

*Acest plugin a fost testat si compilat pe urmatoarele versiuni de amxmodx: 
1.8.3 si amxmodx in pragul beta 1.9.0

Autorul plugin-ului original este Setta0629
Editarile mele:
- Oprimizari plugin
- Integrarea comenzilor adminilori (jucatorii sunt verificati daca au imunitate in mod default este setat flag-ul "a" )
- Rezolvarea bug-ului prin adaugarea unei comenzi suplimentare pentru respawn si aranjarea codului pentru comenzile amdinilor

In acest update au fost scoase comenzile:
* /random - revenire in joc random team			| Comanda publica
* amx_random - intrarea unui jucatori random team	| Comanda admin
*/

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


new const Version[] = "1.6.2";


//Identificatori pentru comenzile in chat (pot fi schimbate)
new const play[]	= "!play";
new const ct[]		= "!ct";
new const t[]		= "!t";
new const spec[]	= "!spec";


public plugin_init()
{    
	register_plugin ("CSDM Transfer", Version, "Setta0629 + Edit @LeX"); 
	
	register_concmd("amx_ct",	 "cmd_ct",	 ADMIN_KICK,"<nume> - Transfera un jucator al echipa 'Counter-Terorist' .");
	register_concmd("amx_t",	 "cmd_t",	 ADMIN_KICK,"<nume> - Transfera un jucator al echipa 'Terorist' .");
	register_concmd("amx_spec",	 "cmd_spec",	 ADMIN_KICK,"<nume> - Transfera un jucator al echipa 'spectator' .");
	
	register_clcmd("say",		 "Comenzi_Chat");
	register_clcmd("say_team",	 "Comenzi_Chat");
	
	
} 

public Comenzi_Chat(id) 
{
	new Mesaj[192];
	
	read_args(Mesaj, charsmax(Mesaj));
	remove_quotes(Mesaj);
	
	
	if ( equal(Mesaj, play, charsmax(play)))
	{
		if(is_user_alive(id))
		{
			client_print_color(id, print_team_red, "^4* ^1^3Nu poți primi ^4Respawn ^3dacă ești în viață!");
			return PLUGIN_HANDLED;
		}
		
		if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
		{
			client_print_color(id, print_team_red, "^4* ^1^3Nu poți folosi comanda când ești ^4Spectator^3.");
			return PLUGIN_HANDLED;
		}
		
		csdm_respawn (id);
		client_print_color(id, print_team_default, "^4* ^1Ai primit ^3Respawn ^1cu succes !");
		
		return PLUGIN_HANDLED;
	}
	
	
	if ( equal(Mesaj, spec, charsmax(spec)))
	{
		
		if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
		{
			client_print_color(id, print_team_grey, "^4* ^1Ești deja ^3Spectator.");
			return PLUGIN_HANDLED;
		}
		
		cs_set_user_team (id ,CS_TEAM_SPECTATOR);
		
		user_silentkill (id);
		
		client_print_color(id, print_team_grey,"^4* ^1Te-ai transferat ^3Sepctator.");
		return PLUGIN_HANDLED;
	}
	
	
	if ( equal(Mesaj, ct, charsmax(ct)))
	{
		if(cs_get_user_team(id) == CS_TEAM_CT)
		{
			client_print_color(id, print_team_blue, "^4* ^1Ești deja la echipa ^3Counter-Terrorist.");
			return PLUGIN_HANDLED;
		}
		cs_set_user_team(id ,CS_TEAM_CT);
		user_silentkill (id);
		csdm_respawn (id);
		
		client_print_color(id, print_team_blue, "^4* ^1Te-ai transferat la echipa ^3Counter-Terrorist." );
		return PLUGIN_HANDLED;
	} 
	
	
	if ( equal(Mesaj, t, charsmax(t)))
	{
		if(cs_get_user_team(id) == CS_TEAM_T)
		{
			client_print_color(id, print_team_blue, "^4* ^1Ești deja la echipa ^3Terrorist.");
			return PLUGIN_HANDLED;
		}
		
		cs_set_user_team(id,CS_TEAM_T);
		user_silentkill (id);
		csdm_respawn (id);
		
		client_print_color(id, print_team_red, "^4* ^1Te-ai transferat la echipa ^3Terrorist.");
		return PLUGIN_HANDLED;
	}
	return PLUGIN_HANDLED;
}

public cmd_ct(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED ;
	new arg[32] ;
	read_argv(1, arg, 31); 
	new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF);
	if (!player)
		return PLUGIN_HANDLED;
	
	cs_set_user_team (player ,CS_TEAM_CT);
	
	user_silentkill(player);
	csdm_respawn (player);
	
	static Admin[32], name2[32];
	
	get_user_name(id,Admin,31);
	get_user_name(player,name2, 31);
	
	log_amx("Admin %s: Task amx_ct %s",Admin, name2);
	
	
	client_print_color(0, print_team_blue, "^4* ^1Administratorul ^4%s ^1Îl mută pe ^4%s ^1la echipa ^3Counter-Terrorist.", Admin, name2);
	return PLUGIN_HANDLED;
} 

public cmd_t(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED;
	
	new arg[32];
	
	read_argv(1, arg, 31);
	
	new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF);
	
	if (!player)    
		return PLUGIN_HANDLED;
	
	cs_set_user_team (player ,CS_TEAM_T);
	
	
	user_silentkill(player);
	csdm_respawn (player);
	
	static Admin[32], name2[32];
	
	get_user_name(id,Admin,31);
	get_user_name(player,name2, 31);
	
	log_amx("Admin %s: Task amx_t %s",Admin, name2);
	
	client_print_color(0, print_team_red, "^4* ^1Administratorul ^4%s ^1Îl mută pe ^4%s ^1la echipa ^3Terrorist.", Admin, name2);
	return PLUGIN_HANDLED;
} 

public cmd_spec(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED;
	
	new arg[32];
	read_argv(1, arg, 31);
	
	new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF);
	
	if (!player)
		return PLUGIN_HANDLED;
	
	cs_set_user_team (player ,CS_TEAM_SPECTATOR);
	
	user_silentkill(player);
	
	static Admin[32], name2[32];
	
	get_user_name(id,Admin,31);
	get_user_name(player,name2, 31);
	
	log_amx("Admin %s: Task amx_spec %s",Admin, name2);
	
	client_print_color(0, print_team_grey, "^4* ^1Administratorul ^4%s ^1Îl mută pe ^4%s ^3Spectator.", Admin, name2);
	return PLUGIN_HANDLED;
	
} 

 

Edit: 

Aici va aparea intotdeauna cea mai recenta versiune: https://pastebin.com/5uQVHjYz

Edited by @LeX

Share this post


Link to post
Share on other sites

Si vin cu inca un update de data aceasta sper sa fie mai ok decat cel precedent

Link download (plugin-ul este compilat in amxmodx 1.8.3): Click here

Link sursa unde gasim si fisierul lang: github

Pentru a nu exista eventuale neplaceri in a intra pe aceste site-uri (unii au pc mai slab si le ia foarte mult timp) voi posta si continutul lor:

CSDM-Transfer.sma

Spoiler
#include <amxmodx>
#include <cstrike>
#include <amxmisc>
#include <csdm>

new const 	
		Versiune[] 	= "1.6.3",
		Build 		= 18,
		Data[] 		= "04.10.2019",
		NumePlugin[] 	= "CSDM Transfer",
		Autor[]		= "Setta0629 + Edit @LeX";

new		
	cvar_pub_chat,
	cvar_adm_chat;

public plugin_init()
{    
	
	register_plugin(NumePlugin, Versiune, Autor);
	
	register_concmd("amx_ct", "cmd_ct", ADMIN_KICK,"<nume> - Transfera un jucator la echipa 'Counter-Terorist' .");
	register_concmd("amx_t", "cmd_t", ADMIN_KICK,"<nume> - Transfera un jucator la echipa 'Terorist' .");
	register_concmd("amx_spec", "cmd_spec", ADMIN_KICK,"<nume> - Transfera un jucator la echipa 'spectator' .");
	register_concmd("amx_play", "cmd_respawn", ADMIN_KICK,"<nume> - Ofera 'respawn' unui jucator .");
	
	register_cvar("csdm_transfer", Versiune, FCVAR_SERVER | FCVAR_SPONLY);
	
	register_dictionary("csdm_transfer.txt");
	
	cvar_pub_chat = register_cvar("csdm_transfer_adm", "1");
	cvar_adm_chat = register_cvar("csdm_transfer_pub", "1");
	
	register_clcmd("say",		 "Comenzi_Chat");
	register_clcmd("say_team",	 "Comenzi_Chat");
}

public Comenzi_Chat(id) 
{
	new Mesaj[192];
	
	read_argv(1, Mesaj, 31);
	remove_quotes(Mesaj);
	
	if( equal(Mesaj, "!csdm_transfer" ))
	{
		client_print_color(0, print_team_default, "^3[CSDM Transfer] ^1 Detineti versiunea :^4 %s^1. Bulid :^4 %d^1. Data lansarii versiunii:^4 %s^1.", Versiune, Build, Data);
		return 1;
	}
	
	if( equal(Mesaj, "!play" ))
	{
		
		if(is_user_alive(id))
		{
			client_print_color(id, print_team_red, "%L", LANG_PLAYER, "CSDM_TRANSFER_PLAY_AL");
			return 1;
		}
		
		if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
		{
			client_print_color(id, print_team_red, "%L", LANG_PLAYER, "CSDM_TRANSFER_PLAY_SP");
			return 1;
		}
		csdm_respawn (id);
		
		if(get_pcvar_num(cvar_pub_chat) == 1)
		{
			client_print_color(id, print_team_default, "%L", LANG_PLAYER, "CSDM_TRANSFER_PLAY_RSP");
			return 1;
		}
		return 1;
	}
	
	if( equal(Mesaj, "!spec" ))
	{	
		if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
		{
			client_print_color(id, print_team_grey, "%L", LANG_PLAYER, "CSDM_TRANSFER_PUB_AL_SPEC");
			return 1;
		}
		
		cs_set_user_team (id ,CS_TEAM_SPECTATOR);
		
		user_silentkill (id);
		
		if(get_pcvar_num(cvar_pub_chat) == 1)
		{
			client_print_color(id, print_team_grey, "%L", LANG_PLAYER,"CSDM_TRANSFER_PUB_SPEC");
			return 1;
		}
		return 1;
	}
	
	if ( equal(Mesaj, "!ct" ))
	{
		if(cs_get_user_team(id) == CS_TEAM_CT)
		{
			client_print_color(id, print_team_blue, "%L", LANG_PLAYER, "CSDM_TRANSFER_PUB_AL_CT");
			return 1;
		}
		cs_set_user_team(id ,CS_TEAM_CT);
		user_silentkill (id);
		csdm_respawn (id);
		
		if(get_pcvar_num(cvar_pub_chat) == 1)
		{	
			client_print_color(id, print_team_blue, "%L", LANG_PLAYER, "CSDM_TRANSFER_PUB_CT");
			return 1;
		}
		return 1;
	} 
	
	if ( equal(Mesaj, "!t" ))
	{
		if(cs_get_user_team(id) == CS_TEAM_T)
		{
			client_print_color(id, print_team_red, "%L", LANG_PLAYER, "CSDM_TRANSFER_PUB_AL_T");
			return 1;
		}
		cs_set_user_team(id,CS_TEAM_T);
		
		user_silentkill (id);
		csdm_respawn (id);
		
		if(get_pcvar_num(cvar_pub_chat) == 1)
		{
			client_print_color(id, print_team_red, "%L", LANG_PLAYER, "CSDM_TRANSFER_PUB_T");
			return 1;
		}
		return 1;
	}
	return 0;
}

public cmd_respawn(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return 1 ;
	
	new arg[32] ;
	read_argv(1, arg, 31); 
	new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF);
	if (!player)
		return 1;
	
	static Admin[32], name2[32];
	
	get_user_name(id,Admin,31);
	get_user_name(player,name2, 31);
	
	
	if(is_user_alive(player))
	{
		console_print(id, "Nu poti oferi respawn jucatorului '%s' cat timp este in viata !", name2);
		return 1;
	}
	
	if(cs_get_user_team(player) == CS_TEAM_SPECTATOR)
	{
		console_print(id,"Nu poti oferi respawn jucatorului '%s' cat timp este Spectator !", name2);
		return 1;
	}
	
	csdm_respawn (player);
	
	log_amx("Admin %s: Task amx_play %s",Admin, name2);
	
	if(get_pcvar_num(cvar_adm_chat) == 1)
	{
		client_print_color(0, print_team_grey, "%L", LANG_PLAYER, "CSDM_TRANSFER_ADM_RSP", Admin, name2);
		return 1;
	}
	return 1;
} 

public cmd_ct(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return 1 ;
	
	new arg[32] ;
	read_argv(1, arg, 31); 
	new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF);
	if (!player)
		return 1;
	
	if(cs_get_user_team(player) == CS_TEAM_CT)
	{
		console_print(id, "Jucatorul este deja in echipa Counter-Terorist");
		return 1;
	}
	
	cs_set_user_team (player ,CS_TEAM_CT);
	
	user_silentkill(player);
	csdm_respawn (player);
	
	static Admin[32], name2[32];
	
	get_user_name(id,Admin,31);
	get_user_name(player,name2, 31);
	
	log_amx("Admin %s: Task amx_ct %s",Admin, name2);
	
	if(get_pcvar_num(cvar_adm_chat) == 1)
	{
		client_print_color(0, print_team_blue, "%L", LANG_PLAYER, "CSDM_TRANSFER_ADM_CT", Admin, name2);
		return 1;
	}
	return 1;
} 

public cmd_t(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return 1;
	
	new arg[32];
	
	read_argv(1, arg, 31);
	
	new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF);
	
	if (!player)    
		return 1;
	
	if(cs_get_user_team(player) == CS_TEAM_T)
	{
		console_print(id, "Jucatorul este deja in echipa Terrorist");
		return 1;
	}
	
	cs_set_user_team (player ,CS_TEAM_T);
	
	
	user_silentkill(player);
	csdm_respawn (player);
	
	static Admin[32], name2[32];
	
	get_user_name(id,Admin,31);
	get_user_name(player,name2, 31);
	
	log_amx("Admin %s: Task amx_t %s",Admin, name2);
	
	if(get_pcvar_num(cvar_adm_chat) == 1)
	{
		client_print_color(0, print_team_red, "%L", LANG_PLAYER, "CSDM_TRANSFER_ADM_T", Admin, name2);
		return 1;
	}
	return 1;
} 

public cmd_spec(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return 1;
	
	new arg[32];
	read_argv(1, arg, 31);
	
	new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF);
	
	if (!player)
		return 1;
	
	if(cs_get_user_team(player) == CS_TEAM_SPECTATOR)
	{
		console_print(id, "Jucatorul este deja Spectator");
		return 1;
	}
	
	cs_set_user_team (player ,CS_TEAM_SPECTATOR);
	
	user_silentkill(player);
	
	static Admin[32], name2[32];
	
	get_user_name(id,Admin,31);
	get_user_name(player,name2, 31);
	
	log_amx("Admin %s: Task amx_spec %s",Admin, name2);
	
	if(get_pcvar_num(cvar_adm_chat) == 1)
	{
		client_print_color(0, print_team_grey, "%L", LANG_PLAYER, "CSDM_TRANSFER_ADM_SPEC", Admin, name2);
		return 1;
	}
	return 1;
}

 

csdm_transfer.txt (fisier Lang):

Spoiler
[ro]
CSDM_TRANSFER_PUB_T 		= ^4* ^1Te-ai transferat la echipa ^3Terrorist.
CSDM_TRANSFER_PUB_AL_T 		= ^4* ^1Ești deja la echipa ^3Terrorist.

CSDM_TRANSFER_PUB_CT 		= ^4* ^1Te-ai transferat la echipa ^3Counter-Terrorist.
CSDM_TRANSFER_PUB_AL_CT 	= ^4* ^1Ești deja la echipa ^3Counter-Terrorist.

CSDM_TRANSFER_PUB_SPEC 		= ^4* ^1Te-ai transferat ^3Sepctator.
CSDM_TRANSFER_PUB_AL_SPEC 	= ^4* ^1Ești deja ^3Spectator.

CSDM_TRANSFER_PLAY_SP 		= ^4* ^3Nu poți folosi comanda când ești ^4Spectator^3.
CSDM_TRANSFER_PLAY_AL 		= ^4* ^3Nu poți primi ^4Respawn ^3dacă ești în viață !
CSDM_TRANSFER_PLAY_RSP 		= ^4* ^1Ai primit ^3Respawn ^1cu succes !

CSDM_TRANSFER_ADM_T 		= ^4* ^1Administratorul ^4%s ^1Îl mută pe ^4%s ^1la echipa ^3Terrorist.
CSDM_TRANSFER_ADM_CT 		= ^4* ^1Administratorul ^4%s ^1Îl mută pe ^4%s ^1la echipa ^3Counter-Terrorist.
CSDM_TRANSFER_ADM_SPEC 		= ^4* ^1Administratorul ^4%s ^1Îl mută pe ^4%s ^3Spectator.
CSDM_TRANSFER_ADM_RSP 		= ^4* ^1Administratorul ^4%s ^1Îi oferă ^3Respawn ^1jucatorului ^4%s.


[en]
CSDM_TRANSFER_PUB_T 		= ^4* ^1Te-ai transferat la echipa ^3Terrorist.
CSDM_TRANSFER_PUB_AL_T 		= ^4* ^1Ești deja la echipa ^3Terrorist.

CSDM_TRANSFER_PUB_CT 		= ^4* ^1Te-ai transferat la echipa ^3Counter-Terrorist.
CSDM_TRANSFER_PUB_AL_CT 	= ^4* ^1Ești deja la echipa ^3Counter-Terrorist.

CSDM_TRANSFER_PUB_SPEC 		= ^4* ^1Te-ai transferat ^3Sepctator.
CSDM_TRANSFER_PUB_AL_SPEC 	= ^4* ^1Ești deja ^3Spectator.

CSDM_TRANSFER_PLAY_SP 		= ^4* ^3Nu poți folosi comanda când ești ^4Spectator^3.
CSDM_TRANSFER_PLAY_AL 		= ^4* ^3Nu poți primi ^4Respawn ^3dacă ești în viață !
CSDM_TRANSFER_PLAY_RSP 		= ^4* ^1Ai primit ^3Respawn ^1cu succes !

CSDM_TRANSFER_ADM_T 		= ^4* ^1Administratorul ^4%s ^1Îl mută pe ^4%s ^1la echipa ^3Terrorist.
CSDM_TRANSFER_ADM_CT 		= ^4* ^1Administratorul ^4%s ^1Îl mută pe ^4%s ^1la echipa ^3Counter-Terrorist.
CSDM_TRANSFER_ADM_SPEC 		= ^4* ^1Administratorul ^4%s ^1Îl mută pe ^4%s ^3Spectator.
CSDM_TRANSFER_ADM_RSP 		= ^4* ^1Administratorul ^4%s ^1Îi oferă ^3Respawn ^1jucatorului ^4%s.

 

 

Update 1.6.3:

  • BugFix, suprapunere peste cfg_slash sau unul similar, comenzile adaugate in cfg_slash, !t nume, !ct nume nu se pot executa
  • Adaugare fisier lang pentru mesajele in chat pentru o editare a mesajelor fara compilare
  • A fost introdusa comanda in chat !csdm_transfer pentru informatii despre plugin
  • Adaugare Cvar pentru controlul mesajelor in chat (default pentru fiecare este 1):
  •   * csdm_transfer_adm     1 = activat, 0 = dezactivat | Mesajele referitoare la afisarea activitatii adminilor in chat         | Mesaje Admini
  •   * csdm_transfer_chat     1 = activat, 0 = dezactivat | Mesajele referitoare la afisarea activitatii publice a jucatorilor     | Mesaje Jucatori
Edited by @LeX

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


About Us

Fioriginal.Ro Gaming community

© FiOriginal.ro

Important Links

Rules

Important Links

Making a comeback
×
×
  • Create New...