Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
|
05-07-2018
, 11:59
Re: Normal Chat not working
|
#13
|
I would change this:
Code:
public checkMsg (id, bool:teamSay )
{
new type
static tags [][] = { "", "^1[^4OWNER^1]", "^1[^4ADMIN^1]", "^1[^4VIP^1]" } /* Prefix are here */
if(OWNER (id )) type = 1
else if(ADMIN (id )) type = 2
else if(VIP (id )) type = 3
else type = 0
if(type == 0) return PLUGIN_CONTINUE setMsg (id, tags [type ], bool: is_user_alive(id ), teamSay )
return PLUGIN_HANDLED }
->
Code:
public checkMsg (id, bool:teamSay )
{
new type
static tags [][] = { "", "^1[^4OWNER^1]", "^1[^4ADMIN^1]", "^1[^4VIP^1]" } /* Prefix are here */
if(OWNER (id )) type = 1
else if(ADMIN (id )) type = 2
else if(VIP (id )) type = 3
else return PLUGIN_CONTINUE
setMsg (id, tags [type ], bool: is_user_alive(id ), teamSay )
return PLUGIN_HANDLED_MAIN }
and
Code:
stock setMsg (index, type [], bool:is_alive, bool:is_teamSay )
{
new nMsg [192],szArg [192], szName [32], szTeam [32], players [32], num
get_user_name(index, szName, charsmax (szName ))
get_user_team(index, szTeam, charsmax (szTeam ))
read_args(szArg, charsmax (szArg ))
remove_quotes(szArg )
#if defined HIDE_SLASH
if (!szArg[0] || szArg[0] == '/') return PLUGIN_HANDLED #endif
if(is_alive )
{
if(is_teamSay ) {
formatex (nMsg, charsmax (nMsg ), "^1(%s) %s ^3%s ^1: ^4%s", szTeam, type, szName, szArg )
get_players(players, num, "ae", szTeam )
for(new i;i < num; i++ ) client_print_color (players [i ], 0, nMsg )
}
else {
formatex (nMsg, charsmax (nMsg ), "%s ^3%s ^1: ^4%s", type, szName, szArg )
client_print_color (0, 0, nMsg )
}
}
else
{
if(is_teamSay ) {
formatex (nMsg, charsmax (nMsg ), "^1*DEAD* (%s) %s ^3%s ^1: ^4%s", szTeam, type, szName, szArg )
get_players(players, num, "be", szTeam )
for(new i;i < num; i++ ) client_print_color (players [i ], 0, nMsg )
}
else {
formatex (nMsg, charsmax (nMsg ), "^1*DEAD* %s ^3%s ^1: ^4%s", type, szName, szArg )
get_players(players, num, "b")
for(new i;i < num; i++ ) client_print_color (players [i ], 0, nMsg )
}
}
return PLUGIN_HANDLED }
->
Code:
stock setMsg (index, type [], bool:is_alive, bool:is_teamSay )
{
new nMsg [192],szArg [192], szName [32], szTeam [32], players [32], num
get_user_name(index, szName, charsmax (szName ))
get_user_team(index, szTeam, charsmax (szTeam ))
read_args(szArg, charsmax (szArg ))
remove_quotes(szArg )
#if defined HIDE_SLASH
if (!szArg[0] || szArg[0] == '/') return #endif
if(is_alive )
{
if(is_teamSay ) {
formatex (nMsg, charsmax (nMsg ), "^1(%s) %s ^3%s ^1: ^4%s", szTeam, type, szName, szArg )
get_players(players, num, "ae", szTeam )
for(new i;i < num; i++ ) client_print_color (players [i ], 0, nMsg )
}
else {
formatex (nMsg, charsmax (nMsg ), "%s ^3%s ^1: ^4%s", type, szName, szArg )
client_print_color (0, 0, nMsg )
}
}
else
{
if(is_teamSay ) {
formatex (nMsg, charsmax (nMsg ), "^1*DEAD* (%s) %s ^3%s ^1: ^4%s", szTeam, type, szName, szArg )
get_players(players, num, "be", szTeam )
for(new i;i < num; i++ ) client_print_color (players [i ], 0, nMsg )
}
else {
formatex (nMsg, charsmax (nMsg ), "^1*DEAD* %s ^3%s ^1: ^4%s", type, szName, szArg )
get_players(players, num, "b")
for(new i;i < num; i++ ) client_print_color (players [i ], 0, nMsg )
}
}
}
The spacing on the highlighted lines is weird for some reason, you get the point.
I honestly didn't read through anything except the highlighted lines. Sure there are other things I would've written differently, but if it works there's really no reason.
__________________
Last edited by Black Rose; 05-07-2018 at 12:10.
|
|