admin tag nob
#1
necesito arreglar este plugins que los vivos no lean a los muertos  

osea los admin y los vip supremo

Código PHP:
#include <amxmodx>
#include <amxmisc>

enum _:__TagData SZTAG[32] , SZFLAG[2] };
new const 
__Tags[][__TagData] =
{
"[Admin]" "l" },
"[Vip Supremo]" "s" }
}

new 
gSzTag33 ][ 32 ], gPlayerName33 ][ 32 ], gMaxPlayers;

public 
plugin_init()
{
register_plugin"Admin Tag(Para noobs)" "0.1" "kikizon" );

register_clcmd"say" "clcmdSay" );
register_clcmd"say_team" "clcmdSayTeam" );

gMaxPlayers get_maxplayers();
}

public 
client_putinserverindex )
{
get_user_nameindex gPlayerName[index], 31 );
gSzTag[index][0] = EOS;

new 
i;
for( 
sizeof __Tags ; ++)
{
if( 
has_flagindex __Tags[i][SZFLAG]))
{
copygSzTag[index] , 31 __Tags[i][SZTAG] );
break;
}
}
}

public 
client_infochangedindex )
{
new 
oldname[32], newname[32];
get_user_nameindex oldname31 );
get_user_infoindex "name"newname31 );

if( !
equal(oldnamenewname))
copygPlayerName[index], 31newname );
}

public 
clcmdSay(index)
{
static 
said[191]; read_args(said190); remove_quotes(said); replace_all(said190"%"""); replace_all(said190"#""");

if (!
ValidMessage(said1)) return PLUGIN_CONTINUE;

static 
color[11], prefix[128]; get_user_team(indexcolor10);
formatex(prefix127"%s^x04%s^x03 %s"is_user_alive(index)?"^x01":"^x01*DEAD* "gSzTag[index], gPlayerName[index]);

if (
is_user_admin(index)) format(saidcharsmax(said), "^x04%s"said);

format(saidcharsmax(said), "%s^x01 : %s"prefixsaid);

static 
iteam[11];

for (
1<= gMaxPlayers; ++i)
{
if (!
is_user_connected(i)) continue;

get_user_team(iteam10);
changeTeamInfo(icolor);
writeMessage(isaid);
changeTeamInfo(iteam);
}
    
return PLUGIN_HANDLED_MAIN;
}

public 
clcmdSayTeamindex )
{
static 
said[191]; read_args(said190); remove_quotes(said); replace_all(said190"%"""); replace_all(said190"#""");

if (!
ValidMessage(said1)) return PLUGIN_CONTINUE;

static 
playerTeamplayerTeamName[20]; playerTeam get_user_team(index);

switch (
playerTeam)
{
case 
1formatexplayerTeamName19"^x01(^x03 TT^x01 ) " );
case 
2formatexplayerTeamName19"^x01(^x03 CT^x01 ) " );
default: 
formatexplayerTeamName19"^x01(^x03 SPEC^x01 ) " );
}

static 
color[11], prefix[128]; get_user_team(indexcolor10); 
formatex(prefix127"%s%s^x04%s^x03 %s"is_user_alive(index)?"^x01":"^x01*DEAD* "playerTeamNamegSzTag[index], gPlayerName[index]);

if (
is_user_admin(index)) format(saidcharsmax(said), "^x04%s"said);

format(saidcharsmax(said), "%s^x01 : %s"prefixsaid);

static 
iteam[11];
for (
1<= gMaxPlayers; ++i)
{
if (!
is_user_connected(i) || get_user_team(i) != playerTeam) continue;

get_user_team(iteam10);
changeTeamInfo(icolor);
writeMessage(isaid);
changeTeamInfo(iteam);


return 
PLUGIN_HANDLED_MAIN;
}

stock ValidMessage(text[], maxcount
{
static 
lenicount;
len strlen(text);
count 0;

if (!
len) return false;

for (
0len; ++i
{
if (
text[i] != ' '
{
++
count;

if (
count >= maxcount)
return 
true;
}
}

return 
false;
}

public 
changeTeamInfo(playerteam[])
{
static 
msgteamInfo;
if( !
msgteamInfo msgteamInfo get_user_msgid"TeamInfo" );

message_begin(MSG_ONEmsgteamInfo_player);
write_byte(player);
write_string(team);
message_end();
}

public 
writeMessage(playermessage[])
{
static 
msgSayText;
if( !
msgSayText msgSayText get_user_msgid"SayText" );

message_begin(MSG_ONEmsgSayText, {000}, player);
write_byte(player);
write_string(message);
message_end();

Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)