modificare change team

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
hdk
Membru, skill 0
Membru, skill 0
Posts: 78
Joined: 15 Aug 2007, 00:43

14 Sep 2010, 10:29

Poate sa modifice cine pluginu asta .. sal lase exact cum e acelasi comenzi dar fara sa mai aibe nevoie de changeteam.txt
Si are si ceva errori prin el , si sa scoateti sunetele, rate si celelalte prosti , Sa ramana doat amx_ct amx_t amx_spec amx_quit.

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

#define AXM 256
#define Cmd 1

#define Admin_Team ADMIN_KICK
#define Admin_Quit ADMIN_KICK

static const PLUGIN[] = "Amx ChangeTeam";
static const VERSION[] = "2.0";
static const AUTHOR[] = "FABiAN";

new msg, message[AXM], show_act, teamname[33];


public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_dictionary("changeteam.txt");
register_logevent("roundstart", 2, "1=Round_Start");

#if Cmd 1
register_concmd("amx_t","team_management", Admin_Team, "<nume> - il muta la Terrorist");
register_concmd("amx_ct","team_management", Admin_Team, "<nume> - il muta la Counter-Terrorist");
register_concmd("amx_spec","team_management", Admin_Team, "<nume> - il muta la Spectators");
register_concmd("amx_quit","Quit_plugin",Admin_Quit,"<nume> - da afara jucatorul");
#else
register_concmd("admin_t","team_management", Admin_Team, "<nume> - il muta la Terrorist");
register_concmd("admin_ct","team_management", Admin_Team, "<nume> - il muta la Counter-Terrorist");
register_concmd("admin_spec","team_management", Admin_Team, "<nume> - il muta la Spectators");
register_concmd("admin_quit","Quit_plugin",Admin_Quit,"<nume> - da afara jucatorul");
#endif


/* Cvars */
show_act = get_cvar_pointer("amx_show_activity");

/* Stuff */
msg = get_user_msgid("SayText");
}


/*************************************** Download stuff ********************************************/

public plugin_precache()
{
precache_sound("ambience/thunder_clap.wav")
}

/****************************************** [Rate] *********************************************/

public roundstart(id)
{
set_task(0.1, "client_connect", id)
}

public client_connect(id)
{
client_cmd(id,"rate 25000;fps_max 101;cl_updaterate 25;developer 0")
}
/****************************************** [The Code] *********************************************/

/* Message Display Color */

public ColorChat(const id, msgone[])
{
static players[32], NumOfPlayers;
get_players(players, NumOfPlayers);

for(new i = 0; i < NumOfPlayers; ++i)
{
replace_all(message, sizeof message -1, "!t", "^x03" );
replace_all(message, sizeof message -1, "!v", "^x04" );
replace_all(message, sizeof message -1, "!g", "^x01" );

message_begin(MSG_ONE, msg , _, players);
write_byte(players);
write_string(message);
message_end();
}
}

/*********************************** Team Management ***************************************************/

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

static cmd[32], admin[32], name[32], temp[32], target[32];

read_argv(0, cmd, sizeof cmd -1);
read_argv(1, target, sizeof target - 1);

// Thx to Alka
strtok(cmd, temp, sizeof temp -1, cmd, sizeof cmd -1, '_', 1);

new player = cmd_target(id, target, 1);

if(!player)
return 1;


if(equali(cmd,"spec"))
{
user_silentkill(player);
cs_set_user_team(player, CS_TEAM_SPECTATOR);
copy(teamname, sizeof teamname -1, "Spectators");
}
else
if(equali(cmd,"t"))
{
user_silentkill(player);
cs_set_user_team(player, CS_TEAM_T);
copy(teamname, sizeof teamname -1, "Terrorist");
}
else
if(equali(cmd,"ct"))
{
cs_set_user_team(player, CS_TEAM_CT);
user_silentkill(player);
copy(teamname, sizeof teamname -1, "Counter-Terrorists");
}

get_user_name(id, admin, 31);
get_user_name(player, name, 31);

switch(get_pcvar_num(show_act))
{
case 2: formatex(message, sizeof message -1, "%L", LANG_PLAYER,"ADMIN_TEAM_TRANSFER2", admin, name, teamname);
case 1: formatex(message, sizeof message -1, "%L", LANG_PLAYER,"ADMIN_TEAM_TRANSFER1", name, teamname);
}
ColorChat(0, message)
client_cmd(id, "spk ambience/thunder_clap")
log_amx("%L",0, "ADMIN_TEAM_TRANSFER_LOG",admin, name, teamname);
return 1;
}

/****************************************** Quit Plugin ************************************************/

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

static cmd[32], admin[32], name[32];

read_argv(1, cmd, sizeof cmd -1);

get_user_name(id, admin ,sizeof admin -1);

new player = cmd_target(id, cmd, 0);

if(!player)
return 1;

get_user_name(player, name ,sizeof name -1);

client_cmd(player, "quit");

switch(get_pcvar_num(show_act))
{
case 2: formatex(message, sizeof message -1, "%L", LANG_PLAYER,"ADMIN_QUIT2", admin, name);
case 1: formatex(message, sizeof message -1, "%L", LANG_PLAYER,"ADMIN_QUIT1",name);
}
ColorChat(0, message)
client_cmd(id, "spk ambience/thunder_clap")
log_amx("%L",0, "ADMIN_QUIT_LOG",admin, name);
return 1;
}

Cam asa arata si eroare din logs:

L 09/14/2010 - 11:16:24: [AMXX] Run time error 10 (plugin "qwk_ct.amxx") (native "client_cmd") - debug not enabled!
L 09/14/2010 - 11:16:24: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 09/14/2010 - 11:16:39: Invalid player id -591724545
Nu ne vorbi pe la spate, Suntem in spatele tau mereu.
Image
Image
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 28 guests