SA-MP Forums Archive
Put tag front the name - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Put tag front the name (/showthread.php?tid=606387)



Put tag front the name - henkas - 03.05.2016

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


Re: Put tag front the name - oMa37 - 03.05.2016

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);




Re: Put tag front the name - henkas - 03.05.2016

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


Re: Put tag front the name - oMa37 - 03.05.2016

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;




Re: Put tag front the name - henkas - 03.05.2016

Still same


Re: Put tag front the name - bgedition - 03.05.2016

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);



Re: Put tag front the name - henkas - 03.05.2016

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;
}



Re: Put tag front the name - henkas - 03.05.2016

Ideas how i should check are him admin? Without errors?


Re: Put tag front the name - Micko123 - 03.05.2016

Dude use your own enum for checking the admin


Re: Put tag front the name - henkas - 03.05.2016

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?