It is currently 22 Jan 2019 02:05






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

Joined: 27 Sep 2015 10:27
Posts: 41
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();
}
}
}
}


07 Aug 2018 23:55
Profile multumesc YIM WWW
Super moderator
Super moderator
User avatar

Joined: 10 Jul 2013 20:26
Posts: 2279
Location: Constanta
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Super moderator
Nume anterior: Do[N]e ;3
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");
}

_________________
DR.EXTREAMCS.COM - Enjoy!

Image


08 Aug 2018 09:40
Profile multumesc
Membru, skill 0
Membru, skill 0
User avatar

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


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

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


Last edited by Jah# on 24 Sep 2018 15:03, edited 1 time in total.



11 Aug 2018 22:19
Profile multumesc YIM WWW
Manager ZOMBIE
Manager ZOMBIE
User avatar

Joined: 26 Jan 2016 10:24
Posts: 1864
Location: Chişinău, Republic Of Moldova
Detinator Steam: Da
CS Status: segmentation fault
SteamID: /ID/gypower
Reputatie: Super moderator
Manager ZOMBIE
Membru Club eXtreamCS (3 luni)
Fond eXtream: 0
Mutat in Counter-Strike 1.6 » Programarea CS-ului » Modificari pluginuri

_________________
Tranzactii efectuate cu succes.
| Afiseaza codul
https://www.extreamcs.com/forum/anunturi/vand-cont-rockstar-gta-15euro-paypal-t349363.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


24 Sep 2018 15:06
Profile multumesc
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 37 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