It is currently 15 Aug 2018 16:12






Reply to topic  [ 4 posts ] 
 Modificare plugin 
Author Message
Membru, skill 0
Membru, skill 0
User avatar

Joined: 27 Sep 2015 11:27
Posts: 40
Location: MD, or. Cahul
Detinator Steam: Da
SteamID: STEAM_0:0:857918
Fond eXtream: 0
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[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}


08 Aug 2018 00:55
Profile multumesc YIM WWW
Fost moderator
Fost moderator
User avatar

Joined: 10 Jul 2013 21:26
Posts: 1612
Location: Constanta
Detinator Steam: Da
CS Status: Nope
Detinator server CS: Nope
SteamID: Nope
Reputatie: Fost Moderator
Fond eXtream: 0
înlocuiește "plugin_inot" cu asta
Code:
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");
}

_________________
:information_source: Ofer Servere Counter-Strike 1,6 moca la 10 euro
Image


08 Aug 2018 10:40
Profile multumesc YIM WWW
Membru, skill 0
Membru, skill 0
User avatar

Joined: 27 Sep 2015 11:27
Posts: 40
Location: MD, or. Cahul
Detinator Steam: Da
SteamID: STEAM_0:0:857918
Fond eXtream: 0
Am incercat si nu merge asa.


08 Aug 2018 21:55
Profile multumesc YIM WWW
Membru, skill 0
Membru, skill 0
User avatar

Joined: 27 Sep 2015 11:27
Posts: 40
Location: MD, or. Cahul
Detinator Steam: Da
SteamID: STEAM_0:0:857918
Fond eXtream: 0
L-am gasit aici. TC !


11 Aug 2018 23:19
Profile multumesc YIM WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: Xeno985 and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  

În cazul în care aveți probleme cu contul trimiteți un email sau mesaj la servicii_extream[arond]yahoo[punct]com

Powered by phpBB® Forum Software © phpBB Group