Put tag front the name
#1

Hello guys i have one question how need make tag like that [Admin]Name_Name: your text right new my write system is simple so how i should edit this?
Код:
            if(team[playerid] == TEAM_HUMAN)
			{
			format(stringbig,sizeof(stringbig),"(%d): {FFFFFF}%s",playerid, text);
	  		SendPlayerMessageToAll(playerid,stringbig);
	  		}
My admin variable "AdminLevel" and "pInfo"
I was made it bat then just sending two message because my code was luck like this
Код:
			{
			new string[150], name[MAX_PLAYER_NAME];
			format(stringbig,sizeof(stringbig),"(%d): {FFFFFF}%s",playerid, text);
	  		SendPlayerMessageToAll(playerid,stringbig);
	  		if(IsPlayerAdmin(playerid)) //If they are an admin, you can replace this with your own admin variable
            GetPlayerName(playerid, name, MAX_PLAYER_NAME);
            format(string,sizeof(string),"[ADMIN] %s: %s", name, text); //Editing the format and adding admin tag in front of name
            SendClientMessageToAll(0xFFFF00FF, string); //Sends message to all
I really know i do something wrong somehow i need clode the first and later check are him admin bat if i put these simbols { } or else:0 i just get a lot error so biggest problem i just dont know how need close and check again
Reply
#2

Something like this:
PHP код:
  if(pInfo[playerid][AdminLevel] >= 1// Level 1 and up
{
    
format(stringbig,sizeof(stringbig),"[Administrator](%d): {FFFFFF}%s",playeridtext);
    
SendPlayerMessageToAll(playerid,stringbig);

Reply
#3

Its the biggest problem if i put this i got error a lot
Reply
#4

Try this.

PHP код:
  if(pInfo[playerid][AdminLevel] >= 1// Level 1 and up
{
    new 
stringbig[128];
    
format(stringbig,sizeof(stringbig),"[Administrator](%d): {FFFFFF}%s",playeridtext);
    
SendPlayerMessageToAll(playerid,stringbig);
    return 
1;

Reply
#5

Still same
Reply
#6

This might work!
Код:
if(IsPlayerAdmin(playerid)) {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    format(string,sizeof(string),"[ADMIN] %s: %s", name, text);
} else if(team[playerid] == TEAM_HUMAN) {
    format(stringbig,sizeof(stringbig),"(%d): {FFFFFF}%s",playerid, text);
}
SendPlayerMessageToAll(playerid,stringbig);
Reply
#7

Here how luck all speak system without tag
Код:
		if(pInfo[playerid][pLogged] == 1)
		{
	        new stringbig[356];
	        if(pInfo[playerid][IsPlayerMuted] == 1) {
	            SendClientMessage(playerid,-1,""chat" You are muted");
	            return 0;
			}
            if(team[playerid] == TEAM_HUMAN)
			{
			format(stringbig,sizeof(stringbig),"(%d): {FFFFFF}%s",playerid, text);
	  		SendPlayerMessageToAll(playerid,stringbig);
	  		}
            if(team[playerid] == TEAM_ZOMBIE)
			{
			format(stringbig,sizeof(stringbig),"(%d): {FFFFFF}%s",playerid, text);
	  		SendPlayerMessageToAll(playerid,stringbig);
	  		}
            {
                SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 10000);
            }
	    }
	}
	else
	{
		SendClientMessage(playerid, -1, ""chat""COL_LIGHTBLUE" You are muted.");
		return 0;
	}
	return 0;
}
Reply
#8

Ideas how i should check are him admin? Without errors?
Reply
#9

Dude use your own enum for checking the admin
Reply
#10

Ok know how need so check bat when i try do open code like } ar close { i got a lot error just
Код:
if(team[playerid] == TEAM_HUMAN)
			{
			format(stringbig,sizeof(stringbig),"(%d): {FFFFFF}%s",playerid, text);
	  		SendPlayerMessageToAll(playerid,stringbig);
	  		}
                        if(pInfo[i][AdminLevel] >= 1)
                       {
                        if(IsPlayerAdmin(playerid)) //If they are an admin, you can replace this with your own admin variable
            GetPlayerName(playerid, name, MAX_PLAYER_NAME);
            format(string,sizeof(string),"[ADMIN] %s: %s", name, text); //Editing the format and adding admin tag in front of name
            SendClientMessageToAll(0xFFFF00FF, string);
            }
           //and same thing whit next team
I do mistake whit symbol } i do something wrong. Do u understand my?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)