Raised This Month: $51 Target: $400
 12% 

Compilation error admin chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pegasus6
Member
Join Date: Nov 2018
Old 08-09-2019 , 18:00   Compilation error admin chat
Reply With Quote #1

Hello
I have this RangAdminChat and when i want to compile the source these errors appears :
Code:
/// furien_rang_chat.sma
Scripting Compiler\furien_rang_chat.sma(15) : error 001: expected token: "}", but found "-string-"
Scripting Compiler\furien_rang_chat.sma(206) : error 032: array index out of bounds (variable "Rang")
Scripting Compiler\furien_rang_chat.sma(302) : error 032: array index out of bounds (variable "Rang")
//
// 3 Errors.
// Could not locate output file compiled\furien_rang_chat.amx (compile failed).
//
// Compilation Time: 0.23 sec
Here is the source :
Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Chat/Hud"
#define VERSION "4.0"
#define AUTHOR "Aragon*"

#define TEAM_CT_NAME	"Anti Furien"
#define TEAM_T_NAME	"Furien"

new Rang[][][] = {
	{"Fondator",	"abcdefghijklmnopqrstu"},
	{"Owner",	"abcdegfhijmnopqrs"},
	{"Co-Owner"	"bcdefijmnopqrs"},
	{"GOD",		"bcdefijmnopqr"},
	{"Administrator",	"bcdefijmnopq"},
	{"Helper",	"bcehi},
	{"Slot",	"b"},
	{"V.I.P",	"bct"}
}

enum COLOR {
	NORMAL = 1,
	GREEN, 
	TEAM_COLOR, 
	GREY, 
	RED, 
	BLUE,
};

new Values[][] = {
	{255, 255, 255},
	{255, 0, 0},
	{0, 255, 0},
	{0, 0, 255}, 
	{255, 255, 0}, 
	{255, 0, 255}, 
	{0, 255, 255}, 
	{227, 96, 8}, 
	{45, 89, 116}, 
	{103, 44, 38}
}

new Float:Position[][] = {
	{0.05, 0.55}, 
	{-1.0, 0.2}, 
	{-1.0, 0.7}
}

new Float:BDPosition[][] = {
	{0.50, 0.40},
	{0.56, 0.44},
	{0.60, 0.50},
	{0.56, 0.56},
	{0.50, 0.60},
	{0.44, 0.56},
	{0.40, 0.50},
	{0.44, 0.44}
}

new Float:Flooding[33] = {0.0, ...}
new Flood[33] = {0, ...}
new MessageChannel, PlayerPos[33]

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)

	register_concmd("amx_say", "CmdSay", ADMIN_CHAT, "<message> - sends message to all players")
	register_concmd("amx_psay", "CmdPrivateSay", ADMIN_CHAT, "<name or #userid> <message> - sends private message")
	
	register_clcmd("say","Say");
	register_clcmd("say_team","SayTeam");
	register_clcmd("svip", "ServerIP");
	
	RegisterHam(Ham_TakeDamage,"player","HAM_TakeDamage");
}

public ServerIP(id) {
	new ServerIp[20];
	get_user_ip(0, ServerIp, charsmax(ServerIp)); 
	client_print(id, print_chat, "%s", ServerIp);
}
	
public CmdSay(id, level, cid) {
	if (cmd_access(id, level, cid, 2)) {
		new Message[192], Nick[32];
		read_args(Message, sizeof(Message) - 1);
		remove_quotes(Message);
		get_user_name(id, Nick, sizeof(Nick) - 1);
		
		ColorChat(0, GREEN, "(ALL)^x03 %s :^x01 %s", Nick, Message);
	}
}

public CmdPrivateSay(id, level, cid) {
	if (cmd_access(id, level, cid, 3)) {
		new Nick[32]
		read_argv(1, Nick, 31)
		new Target = cmd_target(id, Nick, 0)
		
		if (Target) {
			new Length = strlen(Nick) + 1
			
			new Message[192], TargetName[32]
			get_user_name(id, Nick, 31)
			get_user_name(Target, TargetName, 31); 
			read_args(Message, 191)
			
			if(Message[0] == '"' && Message[Length] == '"') {
				Message[0] = ' '
				Message[Length] = ' '
				Length += 2
			}
			
			remove_quotes(Message[Length])
			if(id != Target) {
				ColorChat(id, GREEN, "(%s)^x03 %s^x04 :^x01 %s", Nick, TargetName, Message[Length])
				ColorChat(Target, GREEN, "(%s)^x03 %s^x04 :^x01 %s", Nick, TargetName, Message[Length])
			}
		}
	}
	return PLUGIN_CONTINUE
}

public Say(id) {
	new Float:MaxChat = 0.5
	
	if (MaxChat && !(get_user_flags(id) & ADMIN_IMMUNITY)) {
		new Float:Time = get_gametime()
		
		if (Flooding[id] > Time) {
			if (Flood[id] >= 3) {
				client_print(id, print_notify, "** Stop flooding the server! **")
				Flooding[id] = Time + MaxChat + 3.0
				return PLUGIN_HANDLED
			}
			Flood[id]++
		}
		else if (Flood[id])
			Flood[id]--
		
		Flooding[id] = Time + MaxChat
	}
	
	new Nick[32];
	get_user_name(id, Nick, sizeof(Nick) - 1);
	
	new Message[192];
	read_args(Message, sizeof(Message) - 1);
	remove_quotes(Message);
	
	if(equali(Message,"") || is_user_bot(id))
		return PLUGIN_CONTINUE;
	
	new Said[6], i = 0
	read_argv(1, Said, 5)
	
	while(Said[i] == '@')
		i++
	
	if (i && i <= 3 && access(id, ADMIN_CHAT)) {	
		new Color = 0			
		switch(Said[i]) {
			case 'r': 
				Color = 1
			case 'g': 
				Color = 2
			case 'b': 
				Color = 3
			case 'y': 
				Color = 4
			case 'm': 
				Color = 5
			case 'c': 
				Color = 6
			case 'o': 
				Color = 7
			
		}
		new n, s = i
		if (Color) {
			n++
			s++
		}
		while (Said[s] && isspace(Said[s])) {
			n++
			s++
		}
		
		if (++MessageChannel > 6 || MessageChannel < 3)
			MessageChannel = 3
		
		new Float:VerticalPosition = Position[i-1][1] + float(MessageChannel) / 35.0
		
		new HMessage[128];
		formatex(HMessage,sizeof(HMessage)-1,"%s : %s", Nick, Message[i+n])
		
		HudMessage(0, HMessage, Values[Color][0], Values[Color][1], Values[Color][2], Position[i-1][0], VerticalPosition, 0, 12.0, 6.0, 0.1, 1.5)
		client_print(0, print_notify, "%s : %s", Nick, Message[i+n])
		return PLUGIN_HANDLED;
	}
	
	else if(is_user_admin(id)) {
		for(new i = 0; i < sizeof Rang; i++) {
			if(get_user_flags(id) == read_flags(Rang [i][1])) {
				switch(get_user_team(id)) {
					case 1: 
						ColorChat(0, RED, "%s%s^x04 (%s) :^x01 %s", is_user_alive(id) ? "" : "*Mort* ", Nick, Rang[i][0], Message);
					case 2:
						ColorChat(0, BLUE, "%s%s^x04 (%s) :^x01 %s", is_user_alive(id) ? "" : "*Mort* ", Nick, Rang[i][0], Message);
					case 3:
						ColorChat(0, GREY, "%s^x04 (%s) :^x01 %s",Nick, Rang[i][0], Message);
				}
				return PLUGIN_HANDLED;
			}
		}
		
		switch(get_user_team(id)) {
			case 1: 
				ColorChat(0, RED, "%s%s^x04 :^x01 %s", is_user_alive(id) ? "" : "*Mort* ", Nick, Message);
			case 2:
				ColorChat(0, BLUE, "%s%s^x04 :^x01 %s", is_user_alive(id) ? "" : "*Mort* ", Nick, Message);
			case 3:
				ColorChat(0, GREY, "%s^x04 :^x01 %s",Nick, Message);
		}
		return PLUGIN_HANDLED;
	}
	else {
		switch(get_user_team(id)) {
			case 1: 
				ColorChat(0, RED, "%s%s^x04 :^x01 %s", is_user_alive(id) ? "" : "*Mort* ", Nick, Message);
			case 2:
				ColorChat(0, BLUE, "%s%s^x04 :^x01 %s", is_user_alive(id) ? "" : "*Mort* ", Nick, Message);
			case 3:
				ColorChat(0, GREY, "%s^x04 :^x01 %s",Nick, Message);
		}
		return PLUGIN_HANDLED;
		
	}
	return PLUGIN_CONTINUE;
}

public SayTeam(id) {
	new Float:MaxChat = 0.5
	
	if (MaxChat && !(get_user_flags(id) & ADMIN_IMMUNITY)) {
		new Float:Time = get_gametime()
		
		if (Flooding[id] > Time) {
			if (Flood[id] >= 3) {
				client_print(id, print_notify, "** Stop flooding the server! **")
				Flooding[id] = Time + MaxChat + 3.0
				return PLUGIN_HANDLED
			}
			Flood[id]++
		}
		else if (Flood[id])
			Flood[id]--
		
		Flooding[id] = Time + MaxChat
	}
	
	new Nick[32];
	get_user_name(id, Nick, sizeof(Nick) - 1);
	
	static Message[192];
	read_args(Message, sizeof(Message) - 1);
	remove_quotes(Message);
	
	if(equali(Message,"") || is_user_bot(id))
		return PLUGIN_CONTINUE;
	
	new Said[2]
	read_argv(1, Said, 1)
	
	if (Said[0] == '@') {
		if (is_user_admin(id))
			ColorChat(id, RED, "(ADMIN)^x04 %s^x03 :^x01 %s", Nick, Message[1]);
		else
			ColorChat(id, RED, "(PLAYER)^x04 %s^x03 :^x01 %s", Nick, Message[1]);
		
		new Players[32], Num;
		get_players(Players, Num, "c");
		
		for (new i = 0; i < Num; ++i) {
			if (Players[i] != id && get_user_flags(Players[i]) & ADMIN_CHAT) {
				if (is_user_admin(id))
					ColorChat(Players[i], RED, "(ADMIN)^x04 %s^x03 :^x01 %s", Nick, Message[1]);
				else
					ColorChat(Players[i], RED, "(PLAYER)^x04 %s^x03 :^x01 %s", Nick, Message[1]);
			}
		}
		return PLUGIN_HANDLED;
	}
	
	else if(is_user_admin(id)) {
		for(new i = 0; i < sizeof Rang; i++) {
			new Players[32],Num;
			get_players(Players, Num, "c");
			
			if(get_user_flags(id) == read_flags(Rang [i][1])) {
				for(new X = 0; X < Num; X++) {
					switch(get_user_team(id)) {
						case 1: {
							if(get_user_team(Players[X]) == 1)
								ColorChat(Players[X], RED, "%s(%s) %s^x04 (%s) :^x01 %s", is_user_alive(id) ? "" : "*Mort* ", TEAM_T_NAME, Nick, Rang[i][0], Message);
						}
						case 2: {
							if(get_user_team(Players[X]) == 2)
								ColorChat(Players[X], BLUE, "%s(%s) %s^x04 (%s) :^x01 %s", is_user_alive(id) ? "" : "*Mort* ", TEAM_CT_NAME, Nick, Rang[i][0], Message);
						}
						case 3: {
							if(get_user_team(Players[X]) == 3)
								ColorChat(Players[X], GREY, "(Spectator) %s^x04 (%s) :^x01 %s",Nick, Rang[i][0], Message);
						}
					}
				}
				return PLUGIN_HANDLED;
			}
		}
		new Players[32],Num;
		get_players(Players, Num, "c");
		
		for(new X = 0; X < Num; X++) {
			switch(get_user_team(id)) {
				case 1: {
					if(get_user_team(Players[X]) == 1)
						ColorChat(Players[X], RED, "%s(%s) %s^x04 :^x01 %s", is_user_alive(id) ? "" : "*Mort* ", TEAM_T_NAME, Nick, Message);
				}
				case 2: {
					if(get_user_team(Players[X]) == 2)
						ColorChat(Players[X], BLUE, "%s(%s) %s^x04 :^x01 %s", is_user_alive(id) ? "" : "*Mort* ", TEAM_CT_NAME, Nick, Message);
				}
				case 3: {
					if(get_user_team(Players[X]) == 3)
						ColorChat(Players[X], GREY, "(Spectator) %s^x04 :^x01 %s",Nick, Message);
				}
			}
		}
		return PLUGIN_HANDLED;
	}
	else {
		new Players[32],Num;
		get_players(Players, Num, "c");
		
		for(new X = 0; X < Num; X++) {
			switch(get_user_team(id)) {
				case 1: {
					if(get_user_team(Players[X]) == 1)
						ColorChat(Players[X], RED, "%s(%s) %s^x04 :^x01 %s", is_user_alive(id) ? "" : "*Mort* ", TEAM_T_NAME, Nick, Message);
				}
				case 2: {
					if(get_user_team(Players[X]) == 2)
						ColorChat(Players[X], BLUE, "%s(%s) %s^x04 :^x01 %s", is_user_alive(id) ? "" : "*Mort* ", TEAM_CT_NAME, Nick, Message);
				}
				case 3: {
					if(get_user_team(Players[X]) == 3)
						ColorChat(Players[X], GREY, "(Spectator) %s^x04 :^x01 %s",Nick, Message);
				}
			}
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public HAM_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) {
	if(is_user_connected(attacker) && is_user_connected(victim) && attacker != victim)  {
		if(is_user_alive(attacker) && get_user_team(victim) != get_user_team(attacker)) {
			new Pos = ++PlayerPos[attacker]
			if(Pos >= sizeof(BDPosition))
				Pos = PlayerPos[attacker] = 0
			
			new Damage[16];
			formatex(Damage,sizeof(Damage)-1,"%d", floatround(damage));
			
			HudMessage(attacker, Damage, 50, 205, 50, Float:BDPosition[Pos][0], Float:BDPosition[Pos][1], 2, 1.0, 2.5, 0.02, 0.02)
		}
	}
}


#define clamp_byte(%1)       ( clamp( %1, 0, 255 ) )
#define pack_color(%1,%2,%3) ( %3 + ( %2 << 8 ) + ( %1 << 16 ) )
				
stock HudMessage(const id, const message[], red = 0, green = 160, blue = 0, Float:x = -1.0, Float:y = 0.65, effects = 2, Float:fxtime = 6.0, Float:holdtime = 3.0, Float:fadeintime = 0.1, Float:fadeouttime = 1.5) {
	new count = 1, players[32];
	
	if(id) players[0] = id;
	else get_players(players, count, "ch"); {
		for(new i = 0; i < count; i++) {
			if(is_user_connected(players[i])) {	
				new color = pack_color(clamp_byte(red), clamp_byte(green), clamp_byte(blue))
				
				message_begin(MSG_ONE_UNRELIABLE, SVC_DIRECTOR, _, players[i]);
				write_byte(strlen(message) + 31);
				write_byte(DRC_CMD_MESSAGE);
				write_byte(effects);
				write_long(color);
				write_long(_:x);
				write_long(_:y);	
				write_long(_:fadeintime);
				write_long(_:fadeouttime);
				write_long(_:holdtime);
				write_long(_:fxtime);
				write_string(message);
				message_end();
			}
		}
	}
}

new TeamName[][] =  {
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
};

stock ColorChat(id, COLOR:type, const msg[],...) {
	new Message[252];
	switch(type) {
		case NORMAL:
			Message[0] = 0x01;
		case GREEN:
			Message[0] = 0x04;
		default:
		Message[0] = 0x03;
	}
	
	vformat(Message[1], 251, msg, 4);
	Message[192] = '^0';
	new Team, ColorChange, index, MSG_Type;
	
	if(id) {
		MSG_Type = MSG_ONE;
		index = id;
	}
	else {
		index = FindPlayer();
		MSG_Type = MSG_ALL;
	}
	
	Team = get_user_team(index);
	ColorChange = ColorSelection(index, MSG_Type, type);
	
	ShowColorMessage(index, MSG_Type, Message);
	
	if(ColorChange) 
		Team_Info(index, MSG_Type, TeamName[Team]);
}

stock ShowColorMessage(id, type, message[]) {
	static bool:saytext_used;
	static get_user_msgid_saytext;
	
	if(!saytext_used) {
		get_user_msgid_saytext = get_user_msgid("SayText");
		saytext_used = true;
	}
	message_begin(type, get_user_msgid_saytext, _, id);
	write_byte(id);
	write_string(message);
	message_end();   
}

stock Team_Info(id, type, team[]) {
	static bool:teaminfo_used;
	static get_user_msgid_teaminfo;
	
	if(!teaminfo_used) {
		get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
		teaminfo_used = true;
	}
	message_begin(type, get_user_msgid_teaminfo, _, id);
	write_byte(id);
	write_string(team);
	message_end();
	
	return 1;
}

stock ColorSelection(index, type, COLOR:Type) {
	switch(Type) {
		case RED:
			return Team_Info(index, type, TeamName[1]);
		case BLUE:
			return Team_Info(index, type, TeamName[2]);
		case GREY:
			return Team_Info(index, type, TeamName[0]);
	}
	return 0;
}

stock FindPlayer() {
	new i = -1;
	
	while(i <= get_maxplayers()) {
		if(is_user_connected(++i))
			return i;
	}
	
	return -1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Pegasus6 is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 08-09-2019 , 18:11   Re: Compilation error admin chat
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Chat/Hud"
#define VERSION "4.0"
#define AUTHOR "Aragon*"

#define TEAM_CT_NAME    "Anti Furien"
#define TEAM_T_NAME    "Furien"

new Rang[][][] = {
    {
"Fondator",    "abcdefghijklmnopqrstu"},
    {
"Owner",    "abcdegfhijmnopqrs"},
    {
"Co-Owner",    "bcdefijmnopqrs"},
    {
"GOD",        "bcdefijmnopqr"},
    {
"Administrator",    "bcdefijmnopq"},
    {
"Helper",    "bcehi"},
    {
"Slot",    "b"},
    {
"V.I.P",    "bct"}
}

enum COLOR {
    
NORMAL 1,
    
GREEN
    
TEAM_COLOR
    
GREY
    
RED
    
BLUE,
};

new 
Values[][] = {
    {
255255255},
    {
25500},
    {
02550},
    {
00255}, 
    {
2552550}, 
    {
2550255}, 
    {
0255255}, 
    {
227968}, 
    {
4589116}, 
    {
1034438}
}

new 
Float:Position[][] = {
    {
0.050.55}, 
    {-
1.00.2}, 
    {-
1.00.7}
}

new 
Float:BDPosition[][] = {
    {
0.500.40},
    {
0.560.44},
    {
0.600.50},
    {
0.560.56},
    {
0.500.60},
    {
0.440.56},
    {
0.400.50},
    {
0.440.44}
}

new 
Float:Flooding[33] = {0.0, ...}
new 
Flood[33] = {0, ...}
new 
MessageChannelPlayerPos[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_concmd("amx_say""CmdSay"ADMIN_CHAT"<message> - sends message to all players")
    
register_concmd("amx_psay""CmdPrivateSay"ADMIN_CHAT"<name or #userid> <message> - sends private message")
    
    
register_clcmd("say","Say");
    
register_clcmd("say_team","SayTeam");
    
register_clcmd("svip""ServerIP");
    
    
RegisterHam(Ham_TakeDamage,"player","HAM_TakeDamage");
}

public 
ServerIP(id) {
    new 
ServerIp[20];
    
get_user_ip(0ServerIpcharsmax(ServerIp)); 
    
client_print(idprint_chat"%s"ServerIp);
}
    
public 
CmdSay(idlevelcid) {
    if (
cmd_access(idlevelcid2)) {
        new 
Message[192], Nick[32];
        
read_args(Messagesizeof(Message) - 1);
        
remove_quotes(Message);
        
get_user_name(idNicksizeof(Nick) - 1);
        
        
ColorChat(0GREEN"(ALL)^x03 %s :^x01 %s"NickMessage);
    }
}

public 
CmdPrivateSay(idlevelcid) {
    if (
cmd_access(idlevelcid3)) {
        new 
Nick[32]
        
read_argv(1Nick31)
        new 
Target cmd_target(idNick0)
        
        if (
Target) {
            new 
Length strlen(Nick) + 1
            
            
new Message[192], TargetName[32]
            
get_user_name(idNick31)
            
get_user_name(TargetTargetName31); 
            
read_args(Message191)
            
            if(
Message[0] == '"' && Message[Length] == '"') {
                
Message[0] = ' '
                
Message[Length] = ' '
                
Length += 2
            
}
            
            
remove_quotes(Message[Length])
            if(
id != Target) {
                
ColorChat(idGREEN"(%s)^x03 %s^x04 :^x01 %s"NickTargetNameMessage[Length])
                
ColorChat(TargetGREEN"(%s)^x03 %s^x04 :^x01 %s"NickTargetNameMessage[Length])
            }
        }
    }
    return 
PLUGIN_CONTINUE
}

public 
Say(id) {
    new 
Float:MaxChat 0.5
    
    
if (MaxChat && !(get_user_flags(id) & ADMIN_IMMUNITY)) {
        new 
Float:Time get_gametime()
        
        if (
Flooding[id] > Time) {
            if (
Flood[id] >= 3) {
                
client_print(idprint_notify"** Stop flooding the server! **")
                
Flooding[id] = Time MaxChat 3.0
                
return PLUGIN_HANDLED
            
}
            
Flood[id]++
        }
        else if (
Flood[id])
            
Flood[id]--
        
        
Flooding[id] = Time MaxChat
    
}
    
    new 
Nick[32];
    
get_user_name(idNicksizeof(Nick) - 1);
    
    new 
Message[192];
    
read_args(Messagesizeof(Message) - 1);
    
remove_quotes(Message);
    
    if(
equali(Message,"") || is_user_bot(id))
        return 
PLUGIN_CONTINUE;
    
    new 
Said[6], 0
    read_argv
(1Said5)
    
    while(
Said[i] == '@')
        
i++
    
    if (
&& <= && access(idADMIN_CHAT)) {    
        new 
Color 0            
        
switch(Said[i]) {
            case 
'r'
                
Color 1
            
case 'g'
                
Color 2
            
case 'b'
                
Color 3
            
case 'y'
                
Color 4
            
case 'm'
                
Color 5
            
case 'c'
                
Color 6
            
case 'o'
                
Color 7
            
        
}
        new 
ni
        
if (Color) {
            
n++
            
s++
        }
        while (
Said[s] && isspace(Said[s])) {
            
n++
            
s++
        }
        
        if (++
MessageChannel || MessageChannel 3)
            
MessageChannel 3
        
        
new Float:VerticalPosition Position[i-1][1] + float(MessageChannel) / 35.0
        
        
new HMessage[128];
        
formatex(HMessage,sizeof(HMessage)-1,"%s : %s"NickMessage[i+n])
        
        
HudMessage(0HMessageValues[Color][0], Values[Color][1], Values[Color][2], Position[i-1][0], VerticalPosition012.06.00.11.5)
        
client_print(0print_notify"%s : %s"NickMessage[i+n])
        return 
PLUGIN_HANDLED;
    }
    
    else if(
is_user_admin(id)) {
        for(new 
0sizeof Rangi++) {
            if(
get_user_flags(id) == read_flags(Rang [i][1])) {
                switch(
get_user_team(id)) {
                    case 
1
                        
ColorChat(0RED"%s%s^x04 (%s) :^x01 %s"is_user_alive(id) ? "" "*Mort* "NickRang[i][0], Message);
                    case 
2:
                        
ColorChat(0BLUE"%s%s^x04 (%s) :^x01 %s"is_user_alive(id) ? "" "*Mort* "NickRang[i][0], Message);
                    case 
3:
                        
ColorChat(0GREY"%s^x04 (%s) :^x01 %s",NickRang[i][0], Message);
                }
                return 
PLUGIN_HANDLED;
            }
        }
        
        switch(
get_user_team(id)) {
            case 
1
                
ColorChat(0RED"%s%s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "NickMessage);
            case 
2:
                
ColorChat(0BLUE"%s%s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "NickMessage);
            case 
3:
                
ColorChat(0GREY"%s^x04 :^x01 %s",NickMessage);
        }
        return 
PLUGIN_HANDLED;
    }
    else {
        switch(
get_user_team(id)) {
            case 
1
                
ColorChat(0RED"%s%s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "NickMessage);
            case 
2:
                
ColorChat(0BLUE"%s%s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "NickMessage);
            case 
3:
                
ColorChat(0GREY"%s^x04 :^x01 %s",NickMessage);
        }
        return 
PLUGIN_HANDLED;
        
    }
}

public 
SayTeam(id) {
    new 
Float:MaxChat 0.5
    
    
if (MaxChat && !(get_user_flags(id) & ADMIN_IMMUNITY)) {
        new 
Float:Time get_gametime()
        
        if (
Flooding[id] > Time) {
            if (
Flood[id] >= 3) {
                
client_print(idprint_notify"** Stop flooding the server! **")
                
Flooding[id] = Time MaxChat 3.0
                
return PLUGIN_HANDLED
            
}
            
Flood[id]++
        }
        else if (
Flood[id])
            
Flood[id]--
        
        
Flooding[id] = Time MaxChat
    
}
    
    new 
Nick[32];
    
get_user_name(idNicksizeof(Nick) - 1);
    
    static 
Message[192];
    
read_args(Messagesizeof(Message) - 1);
    
remove_quotes(Message);
    
    if(
equali(Message,"") || is_user_bot(id))
        return 
PLUGIN_CONTINUE;
    
    new 
Said[2]
    
read_argv(1Said1)
    
    if (
Said[0] == '@') {
        if (
is_user_admin(id))
            
ColorChat(idRED"(ADMIN)^x04 %s^x03 :^x01 %s"NickMessage[1]);
        else
            
ColorChat(idRED"(PLAYER)^x04 %s^x03 :^x01 %s"NickMessage[1]);
        
        new 
Players[32], Num;
        
get_players(PlayersNum"c");
        
        for (new 
0Num; ++i) {
            if (
Players[i] != id && get_user_flags(Players[i]) & ADMIN_CHAT) {
                if (
is_user_admin(id))
                    
ColorChat(Players[i], RED"(ADMIN)^x04 %s^x03 :^x01 %s"NickMessage[1]);
                else
                    
ColorChat(Players[i], RED"(PLAYER)^x04 %s^x03 :^x01 %s"NickMessage[1]);
            }
        }
        return 
PLUGIN_HANDLED;
    }
    
    else if(
is_user_admin(id)) {
        for(new 
0sizeof Rangi++) {
            new 
Players[32],Num;
            
get_players(PlayersNum"c");
            
            if(
get_user_flags(id) == read_flags(Rang [i][1])) {
                for(new 
0NumX++) {
                    switch(
get_user_team(id)) {
                        case 
1: {
                            if(
get_user_team(Players[X]) == 1)
                                
ColorChat(Players[X], RED"%s(%s) %s^x04 (%s) :^x01 %s"is_user_alive(id) ? "" "*Mort* "TEAM_T_NAMENickRang[i][0], Message);
                        }
                        case 
2: {
                            if(
get_user_team(Players[X]) == 2)
                                
ColorChat(Players[X], BLUE"%s(%s) %s^x04 (%s) :^x01 %s"is_user_alive(id) ? "" "*Mort* "TEAM_CT_NAMENickRang[i][0], Message);
                        }
                        case 
3: {
                            if(
get_user_team(Players[X]) == 3)
                                
ColorChat(Players[X], GREY"(Spectator) %s^x04 (%s) :^x01 %s",NickRang[i][0], Message);
                        }
                    }
                }
                return 
PLUGIN_HANDLED;
            }
        }
        new 
Players[32],Num;
        
get_players(PlayersNum"c");
        
        for(new 
0NumX++) {
            switch(
get_user_team(id)) {
                case 
1: {
                    if(
get_user_team(Players[X]) == 1)
                        
ColorChat(Players[X], RED"%s(%s) %s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "TEAM_T_NAMENickMessage);
                }
                case 
2: {
                    if(
get_user_team(Players[X]) == 2)
                        
ColorChat(Players[X], BLUE"%s(%s) %s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "TEAM_CT_NAMENickMessage);
                }
                case 
3: {
                    if(
get_user_team(Players[X]) == 3)
                        
ColorChat(Players[X], GREY"(Spectator) %s^x04 :^x01 %s",NickMessage);
                }
            }
        }
        return 
PLUGIN_HANDLED;
    }
    else {
        new 
Players[32],Num;
        
get_players(PlayersNum"c");
        
        for(new 
0NumX++) {
            switch(
get_user_team(id)) {
                case 
1: {
                    if(
get_user_team(Players[X]) == 1)
                        
ColorChat(Players[X], RED"%s(%s) %s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "TEAM_T_NAMENickMessage);
                }
                case 
2: {
                    if(
get_user_team(Players[X]) == 2)
                        
ColorChat(Players[X], BLUE"%s(%s) %s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "TEAM_CT_NAMENickMessage);
                }
                case 
3: {
                    if(
get_user_team(Players[X]) == 3)
                        
ColorChat(Players[X], GREY"(Spectator) %s^x04 :^x01 %s",NickMessage);
                }
            }
        }
        return 
PLUGIN_HANDLED;
    }
}

public 
HAM_TakeDamage(victiminflictorattackerFloat:damagedamage_type) {
    if(
is_user_connected(attacker) && is_user_connected(victim) && attacker != victim)  {
        if(
is_user_alive(attacker) && get_user_team(victim) != get_user_team(attacker)) {
            new 
Pos = ++PlayerPos[attacker]
            if(
Pos >= sizeof(BDPosition))
                
Pos PlayerPos[attacker] = 0
            
            
new Damage[16];
            
formatex(Damage,sizeof(Damage)-1,"%d"floatround(damage));
            
            
HudMessage(attackerDamage5020550Float:BDPosition[Pos][0], Float:BDPosition[Pos][1], 21.02.50.020.02)
        }
    }
}


#define clamp_byte(%1)       ( clamp( %1, 0, 255 ) )
#define pack_color(%1,%2,%3) ( %3 + ( %2 << 8 ) + ( %1 << 16 ) )
                
stock HudMessage(const id, const message[], red 0green 160blue 0Float:= -1.0Float:0.65effects 2Float:fxtime 6.0Float:holdtime 3.0Float:fadeintime 0.1Float:fadeouttime 1.5) {
    new 
count 1players[32];
    
    if(
idplayers[0] = id;
    else 
get_players(playerscount"ch"); {
        for(new 
0counti++) {
            if(
is_user_connected(players[i])) {    
                new 
color pack_color(clamp_byte(red), clamp_byte(green), clamp_byte(blue))
                
                
message_begin(MSG_ONE_UNRELIABLESVC_DIRECTOR_players[i]);
                
write_byte(strlen(message) + 31);
                
write_byte(DRC_CMD_MESSAGE);
                
write_byte(effects);
                
write_long(color);
                
write_long(_:x);
                
write_long(_:y);    
                
write_long(_:fadeintime);
                
write_long(_:fadeouttime);
                
write_long(_:holdtime);
                
write_long(_:fxtime);
                
write_string(message);
                
message_end();
            }
        }
    }
}

new 
TeamName[][] =  {
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
};

stock ColorChat(idCOLOR:type, const msg[],...) {
    new 
Message[252];
    switch(
type) {
        case 
NORMAL:
            
Message[0] = 0x01;
        case 
GREEN:
            
Message[0] = 0x04;
        default:
        
Message[0] = 0x03;
    }
    
    
vformat(Message[1], 251msg4);
    
Message[192] = '^0';
    new 
TeamColorChangeindexMSG_Type;
    
    if(
id) {
        
MSG_Type MSG_ONE;
        
index id;
    }
    else {
        
index FindPlayer();
        
MSG_Type MSG_ALL;
    }
    
    
Team get_user_team(index);
    
ColorChange ColorSelection(indexMSG_Typetype);
    
    
ShowColorMessage(indexMSG_TypeMessage);
    
    if(
ColorChange
        
Team_Info(indexMSG_TypeTeamName[Team]);
}

stock ShowColorMessage(idtypemessage[]) {
    static 
bool:saytext_used;
    static 
get_user_msgid_saytext;
    
    if(!
saytext_used) {
        
get_user_msgid_saytext get_user_msgid("SayText");
        
saytext_used true;
    }
    
message_begin(typeget_user_msgid_saytext_id);
    
write_byte(id);
    
write_string(message);
    
message_end();   
}

stock Team_Info(idtypeteam[]) {
    static 
bool:teaminfo_used;
    static 
get_user_msgid_teaminfo;
    
    if(!
teaminfo_used) {
        
get_user_msgid_teaminfo get_user_msgid("TeamInfo");
        
teaminfo_used true;
    }
    
message_begin(typeget_user_msgid_teaminfo_id);
    
write_byte(id);
    
write_string(team);
    
message_end();
    
    return 
1;
}

stock ColorSelection(indextypeCOLOR:Type) {
    switch(
Type) {
        case 
RED:
            return 
Team_Info(indextypeTeamName[1]);
        case 
BLUE:
            return 
Team_Info(indextypeTeamName[2]);
        case 
GREY:
            return 
Team_Info(indextypeTeamName[0]);
    }
    return 
0;
}

stock FindPlayer() {
    new 
= -1;
    
    while(
<= get_maxplayers()) {
        if(
is_user_connected(++i))
            return 
i;
    }
    
    return -
1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 08-09-2019 at 20:53.
iceeedr is offline
Send a message via Skype™ to iceeedr
Old 08-09-2019, 18:40
Pegasus6
This message has been deleted by Pegasus6. Reason: fail
Pegasus6
Member
Join Date: Nov 2018
Old 08-09-2019 , 18:41   Re: Compilation error admin chat
Reply With Quote #3

Quote:
Originally Posted by iceeedr View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Chat/Hud"
#define VERSION "4.0"
#define AUTHOR "Aragon*"

#define TEAM_CT_NAME    "Anti Furien"
#define TEAM_T_NAME    "Furien"

new Rang[][] = {
    {
"Fondator",    "abcdefghijklmnopqrstu"},
    {
"Owner",    "abcdegfhijmnopqrs"},
    {
"Co-Owner",    "bcdefijmnopqrs"},
    {
"GOD",        "bcdefijmnopqr"},
    {
"Administrator",    "bcdefijmnopq"},
    {
"Helper",    "bcehi"},
    {
"Slot",    "b"},
    {
"V.I.P",    "bct"}
}

enum COLOR {
    
NORMAL 1,
    
GREEN
    
TEAM_COLOR
    
GREY
    
RED
    
BLUE,
};

new 
Values[][] = {
    {
255255255},
    {
25500},
    {
02550},
    {
00255}, 
    {
2552550}, 
    {
2550255}, 
    {
0255255}, 
    {
227968}, 
    {
4589116}, 
    {
1034438}
}

new 
Float:Position[][] = {
    {
0.050.55}, 
    {-
1.00.2}, 
    {-
1.00.7}
}

new 
Float:BDPosition[][] = {
    {
0.500.40},
    {
0.560.44},
    {
0.600.50},
    {
0.560.56},
    {
0.500.60},
    {
0.440.56},
    {
0.400.50},
    {
0.440.44}
}

new 
Float:Flooding[33] = {0.0, ...}
new 
Flood[33] = {0, ...}
new 
MessageChannelPlayerPos[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_concmd("amx_say""CmdSay"ADMIN_CHAT"<message> - sends message to all players")
    
register_concmd("amx_psay""CmdPrivateSay"ADMIN_CHAT"<name or #userid> <message> - sends private message")
    
    
register_clcmd("say","Say");
    
register_clcmd("say_team","SayTeam");
    
register_clcmd("svip""ServerIP");
    
    
RegisterHam(Ham_TakeDamage,"player","HAM_TakeDamage");
}

public 
ServerIP(id) {
    new 
ServerIp[20];
    
get_user_ip(0ServerIpcharsmax(ServerIp)); 
    
client_print(idprint_chat"%s"ServerIp);
}
    
public 
CmdSay(idlevelcid) {
    if (
cmd_access(idlevelcid2)) {
        new 
Message[192], Nick[32];
        
read_args(Messagesizeof(Message) - 1);
        
remove_quotes(Message);
        
get_user_name(idNicksizeof(Nick) - 1);
        
        
ColorChat(0GREEN"(ALL)^x03 %s :^x01 %s"NickMessage);
    }
}

public 
CmdPrivateSay(idlevelcid) {
    if (
cmd_access(idlevelcid3)) {
        new 
Nick[32]
        
read_argv(1Nick31)
        new 
Target cmd_target(idNick0)
        
        if (
Target) {
            new 
Length strlen(Nick) + 1
            
            
new Message[192], TargetName[32]
            
get_user_name(idNick31)
            
get_user_name(TargetTargetName31); 
            
read_args(Message191)
            
            if(
Message[0] == '"' && Message[Length] == '"') {
                
Message[0] = ' '
                
Message[Length] = ' '
                
Length += 2
            
}
            
            
remove_quotes(Message[Length])
            if(
id != Target) {
                
ColorChat(idGREEN"(%s)^x03 %s^x04 :^x01 %s"NickTargetNameMessage[Length])
                
ColorChat(TargetGREEN"(%s)^x03 %s^x04 :^x01 %s"NickTargetNameMessage[Length])
            }
        }
    }
    return 
PLUGIN_CONTINUE
}

public 
Say(id) {
    new 
Float:MaxChat 0.5
    
    
if (MaxChat && !(get_user_flags(id) & ADMIN_IMMUNITY)) {
        new 
Float:Time get_gametime()
        
        if (
Flooding[id] > Time) {
            if (
Flood[id] >= 3) {
                
client_print(idprint_notify"** Stop flooding the server! **")
                
Flooding[id] = Time MaxChat 3.0
                
return PLUGIN_HANDLED
            
}
            
Flood[id]++
        }
        else if (
Flood[id])
            
Flood[id]--
        
        
Flooding[id] = Time MaxChat
    
}
    
    new 
Nick[32];
    
get_user_name(idNicksizeof(Nick) - 1);
    
    new 
Message[192];
    
read_args(Messagesizeof(Message) - 1);
    
remove_quotes(Message);
    
    if(
equali(Message,"") || is_user_bot(id))
        return 
PLUGIN_CONTINUE;
    
    new 
Said[6], 0
    read_argv
(1Said5)
    
    while(
Said[i] == '@')
        
i++
    
    if (
&& <= && access(idADMIN_CHAT)) {    
        new 
Color 0            
        
switch(Said[i]) {
            case 
'r'
                
Color 1
            
case 'g'
                
Color 2
            
case 'b'
                
Color 3
            
case 'y'
                
Color 4
            
case 'm'
                
Color 5
            
case 'c'
                
Color 6
            
case 'o'
                
Color 7
            
        
}
        new 
ni
        
if (Color) {
            
n++
            
s++
        }
        while (
Said[s] && isspace(Said[s])) {
            
n++
            
s++
        }
        
        if (++
MessageChannel || MessageChannel 3)
            
MessageChannel 3
        
        
new Float:VerticalPosition Position[i-1][1] + float(MessageChannel) / 35.0
        
        
new HMessage[128];
        
formatex(HMessage,sizeof(HMessage)-1,"%s : %s"NickMessage[i+n])
        
        
HudMessage(0HMessageValues[Color][0], Values[Color][1], Values[Color][2], Position[i-1][0], VerticalPosition012.06.00.11.5)
        
client_print(0print_notify"%s : %s"NickMessage[i+n])
        return 
PLUGIN_HANDLED;
    }
    
    else if(
is_user_admin(id)) {
        for(new 
0sizeof Rangi++) {
            if(
get_user_flags(id) == read_flags(Rang [i][1])) {
                switch(
get_user_team(id)) {
                    case 
1
                        
ColorChat(0RED"%s%s^x04 (%s) :^x01 %s"is_user_alive(id) ? "" "*Mort* "NickRang[i][0], Message);
                    case 
2:
                        
ColorChat(0BLUE"%s%s^x04 (%s) :^x01 %s"is_user_alive(id) ? "" "*Mort* "NickRang[i][0], Message);
                    case 
3:
                        
ColorChat(0GREY"%s^x04 (%s) :^x01 %s",NickRang[i][0], Message);
                }
                return 
PLUGIN_HANDLED;
            }
        }
        
        switch(
get_user_team(id)) {
            case 
1
                
ColorChat(0RED"%s%s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "NickMessage);
            case 
2:
                
ColorChat(0BLUE"%s%s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "NickMessage);
            case 
3:
                
ColorChat(0GREY"%s^x04 :^x01 %s",NickMessage);
        }
        return 
PLUGIN_HANDLED;
    }
    else {
        switch(
get_user_team(id)) {
            case 
1
                
ColorChat(0RED"%s%s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "NickMessage);
            case 
2:
                
ColorChat(0BLUE"%s%s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "NickMessage);
            case 
3:
                
ColorChat(0GREY"%s^x04 :^x01 %s",NickMessage);
        }
        return 
PLUGIN_HANDLED;
        
    }
}

public 
SayTeam(id) {
    new 
Float:MaxChat 0.5
    
    
if (MaxChat && !(get_user_flags(id) & ADMIN_IMMUNITY)) {
        new 
Float:Time get_gametime()
        
        if (
Flooding[id] > Time) {
            if (
Flood[id] >= 3) {
                
client_print(idprint_notify"** Stop flooding the server! **")
                
Flooding[id] = Time MaxChat 3.0
                
return PLUGIN_HANDLED
            
}
            
Flood[id]++
        }
        else if (
Flood[id])
            
Flood[id]--
        
        
Flooding[id] = Time MaxChat
    
}
    
    new 
Nick[32];
    
get_user_name(idNicksizeof(Nick) - 1);
    
    static 
Message[192];
    
read_args(Messagesizeof(Message) - 1);
    
remove_quotes(Message);
    
    if(
equali(Message,"") || is_user_bot(id))
        return 
PLUGIN_CONTINUE;
    
    new 
Said[2]
    
read_argv(1Said1)
    
    if (
Said[0] == '@') {
        if (
is_user_admin(id))
            
ColorChat(idRED"(ADMIN)^x04 %s^x03 :^x01 %s"NickMessage[1]);
        else
            
ColorChat(idRED"(PLAYER)^x04 %s^x03 :^x01 %s"NickMessage[1]);
        
        new 
Players[32], Num;
        
get_players(PlayersNum"c");
        
        for (new 
0Num; ++i) {
            if (
Players[i] != id && get_user_flags(Players[i]) & ADMIN_CHAT) {
                if (
is_user_admin(id))
                    
ColorChat(Players[i], RED"(ADMIN)^x04 %s^x03 :^x01 %s"NickMessage[1]);
                else
                    
ColorChat(Players[i], RED"(PLAYER)^x04 %s^x03 :^x01 %s"NickMessage[1]);
            }
        }
        return 
PLUGIN_HANDLED;
    }
    
    else if(
is_user_admin(id)) {
        for(new 
0sizeof Rangi++) {
            new 
Players[32],Num;
            
get_players(PlayersNum"c");
            
            if(
get_user_flags(id) == read_flags(Rang [i][1])) {
                for(new 
0NumX++) {
                    switch(
get_user_team(id)) {
                        case 
1: {
                            if(
get_user_team(Players[X]) == 1)
                                
ColorChat(Players[X], RED"%s(%s) %s^x04 (%s) :^x01 %s"is_user_alive(id) ? "" "*Mort* "TEAM_T_NAMENickRang[i][0], Message);
                        }
                        case 
2: {
                            if(
get_user_team(Players[X]) == 2)
                                
ColorChat(Players[X], BLUE"%s(%s) %s^x04 (%s) :^x01 %s"is_user_alive(id) ? "" "*Mort* "TEAM_CT_NAMENickRang[i][0], Message);
                        }
                        case 
3: {
                            if(
get_user_team(Players[X]) == 3)
                                
ColorChat(Players[X], GREY"(Spectator) %s^x04 (%s) :^x01 %s",NickRang[i][0], Message);
                        }
                    }
                }
                return 
PLUGIN_HANDLED;
            }
        }
        new 
Players[32],Num;
        
get_players(PlayersNum"c");
        
        for(new 
0NumX++) {
            switch(
get_user_team(id)) {
                case 
1: {
                    if(
get_user_team(Players[X]) == 1)
                        
ColorChat(Players[X], RED"%s(%s) %s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "TEAM_T_NAMENickMessage);
                }
                case 
2: {
                    if(
get_user_team(Players[X]) == 2)
                        
ColorChat(Players[X], BLUE"%s(%s) %s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "TEAM_CT_NAMENickMessage);
                }
                case 
3: {
                    if(
get_user_team(Players[X]) == 3)
                        
ColorChat(Players[X], GREY"(Spectator) %s^x04 :^x01 %s",NickMessage);
                }
            }
        }
        return 
PLUGIN_HANDLED;
    }
    else {
        new 
Players[32],Num;
        
get_players(PlayersNum"c");
        
        for(new 
0NumX++) {
            switch(
get_user_team(id)) {
                case 
1: {
                    if(
get_user_team(Players[X]) == 1)
                        
ColorChat(Players[X], RED"%s(%s) %s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "TEAM_T_NAMENickMessage);
                }
                case 
2: {
                    if(
get_user_team(Players[X]) == 2)
                        
ColorChat(Players[X], BLUE"%s(%s) %s^x04 :^x01 %s"is_user_alive(id) ? "" "*Mort* "TEAM_CT_NAMENickMessage);
                }
                case 
3: {
                    if(
get_user_team(Players[X]) == 3)
                        
ColorChat(Players[X], GREY"(Spectator) %s^x04 :^x01 %s",NickMessage);
                }
            }
        }
        return 
PLUGIN_HANDLED;
    }
}

public 
HAM_TakeDamage(victiminflictorattackerFloat:damagedamage_type) {
    if(
is_user_connected(attacker) && is_user_connected(victim) && attacker != victim)  {
        if(
is_user_alive(attacker) && get_user_team(victim) != get_user_team(attacker)) {
            new 
Pos = ++PlayerPos[attacker]
            if(
Pos >= sizeof(BDPosition))
                
Pos PlayerPos[attacker] = 0
            
            
new Damage[16];
            
formatex(Damage,sizeof(Damage)-1,"%d"floatround(damage));
            
            
HudMessage(attackerDamage5020550Float:BDPosition[Pos][0], Float:BDPosition[Pos][1], 21.02.50.020.02)
        }
    }
}


#define clamp_byte(%1)       ( clamp( %1, 0, 255 ) )
#define pack_color(%1,%2,%3) ( %3 + ( %2 << 8 ) + ( %1 << 16 ) )
                
stock HudMessage(const id, const message[], red 0green 160blue 0Float:= -1.0Float:0.65effects 2Float:fxtime 6.0Float:holdtime 3.0Float:fadeintime 0.1Float:fadeouttime 1.5) {
    new 
count 1players[32];
    
    if(
idplayers[0] = id;
    else 
get_players(playerscount"ch"); {
        for(new 
0counti++) {
            if(
is_user_connected(players[i])) {    
                new 
color pack_color(clamp_byte(red), clamp_byte(green), clamp_byte(blue))
                
                
message_begin(MSG_ONE_UNRELIABLESVC_DIRECTOR_players[i]);
                
write_byte(strlen(message) + 31);
                
write_byte(DRC_CMD_MESSAGE);
                
write_byte(effects);
                
write_long(color);
                
write_long(_:x);
                
write_long(_:y);    
                
write_long(_:fadeintime);
                
write_long(_:fadeouttime);
                
write_long(_:holdtime);
                
write_long(_:fxtime);
                
write_string(message);
                
message_end();
            }
        }
    }
}

new 
TeamName[][] =  {
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
};

stock ColorChat(idCOLOR:type, const msg[],...) {
    new 
Message[252];
    switch(
type) {
        case 
NORMAL:
            
Message[0] = 0x01;
        case 
GREEN:
            
Message[0] = 0x04;
        default:
        
Message[0] = 0x03;
    }
    
    
vformat(Message[1], 251msg4);
    
Message[192] = '^0';
    new 
TeamColorChangeindexMSG_Type;
    
    if(
id) {
        
MSG_Type MSG_ONE;
        
index id;
    }
    else {
        
index FindPlayer();
        
MSG_Type MSG_ALL;
    }
    
    
Team get_user_team(index);
    
ColorChange ColorSelection(indexMSG_Typetype);
    
    
ShowColorMessage(indexMSG_TypeMessage);
    
    if(
ColorChange
        
Team_Info(indexMSG_TypeTeamName[Team]);
}

stock ShowColorMessage(idtypemessage[]) {
    static 
bool:saytext_used;
    static 
get_user_msgid_saytext;
    
    if(!
saytext_used) {
        
get_user_msgid_saytext get_user_msgid("SayText");
        
saytext_used true;
    }
    
message_begin(typeget_user_msgid_saytext_id);
    
write_byte(id);
    
write_string(message);
    
message_end();   
}

stock Team_Info(idtypeteam[]) {
    static 
bool:teaminfo_used;
    static 
get_user_msgid_teaminfo;
    
    if(!
teaminfo_used) {
        
get_user_msgid_teaminfo get_user_msgid("TeamInfo");
        
teaminfo_used true;
    }
    
message_begin(typeget_user_msgid_teaminfo_id);
    
write_byte(id);
    
write_string(team);
    
message_end();
    
    return 
1;
}

stock ColorSelection(indextypeCOLOR:Type) {
    switch(
Type) {
        case 
RED:
            return 
Team_Info(indextypeTeamName[1]);
        case 
BLUE:
            return 
Team_Info(indextypeTeamName[2]);
        case 
GREY:
            return 
Team_Info(indextypeTeamName[0]);
    }
    return 
0;
}

stock FindPlayer() {
    new 
= -1;
    
    while(
<= get_maxplayers()) {
        if(
is_user_connected(++i))
            return 
i;
    }
    
    return -
1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
Thank you, it compiles but the plugin doesn't work anymore I do have admin acces and when i write someting in the chat those Admin Rangs dont appear

Last edited by Pegasus6; 08-09-2019 at 18:47.
Pegasus6 is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 08-09-2019 , 20:53   Re: Compilation error admin chat
Reply With Quote #4

Code edited, try again.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-10-2019 , 07:21   Re: Compilation error admin chat
Reply With Quote #5

I suggest you use a better plugin instead of that hardcoded one.

https://forums.alliedmods.net/showthread.php?t=297952
https://forums.alliedmods.net/showthread.php?t=272418
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Pegasus6
Member
Join Date: Nov 2018
Old 08-10-2019 , 12:02   Re: Compilation error admin chat
Reply With Quote #6

Quote:
Originally Posted by iceeedr View Post
Code edited, try again.
WORK ! Thank you man, i apreciate tha, you'r awesome
Pegasus6 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode