Sari la conținut
@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.

 

Partajează acest post


Link spre post
Distribuie pe alte site-uri

No, bun, si asa cel oferit de tni nu are sursa(transfer). Iau de aici . :)))

Partajează acest post


Link spre post
Distribuie pe alte site-uri

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();
        }
    }
}

}
*/

 

Partajează acest post


Link spre post
Distribuie pe alte site-uri

Join the conversation

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

Vizitator
Răspunde la acest topic...

×   Ai lipit un conținut cu formatare.   Elimină formatare

  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.


×
×
  • Creează nouă...