SA-MP Forums Archive
when admin chat - 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: when admin chat (/showthread.php?tid=365980)



when admin chat - [LHT]Bally - 04.08.2012

How do i make it so that if a player is admin and they type in the chatbox that it says Admin: <message>

so basically if ur admin level it says admin infront of ur name

admin is defined like so
pawn Код:
if(APlayerData[playerid][PlayerLevel] == 0) return SendClientMessage(playerid,0xff0000ff,"You aren't an admin");
and also when they spawn It says Admin blaa has come on duty


Re: when admin chat - awsomedude - 04.08.2012

try this https://sampforum.blast.hk/showthread.php?tid=335123


Re: when admin chat - V_LOPE - 04.08.2012

pawn Код:
public OnPlayerText(playerid, text[])
{
  switch (APlayerData[playerid][PlayerLevel])
  {
    case 0:
    {
           new string[128];
           format(string,sizeof(string),"%s[%i]: {FFFFFF}%s",PlayerName2(playerid),playerid,text);
           printf(string);
           SendClientMessageToAll(GetPlayerColor(playerid),string);
        }
        case 1:
        {
           new aName[MAX_PLAYER_NAME], string2[128];
           GetPlayerName(playerid, aName,sizeof(aName));
           format(string2,sizeof(string2),"Admin %s[%i]: %s",aName,playerid,text);
           printf(string2);
           SendClientMessageToAll(0xF600F6FF,string2);
        }
    }
   return 0;
}
Something Like that?


Re: when admin chat - Ranama - 05.08.2012

Quote:

and also when they spawn It says Admin blaa has come on duty

Like this?

pawn Код:
OnPlayerSpawn(playerid){
if(APlayerData[playerid][PlayerLevel] == 1)SendClientMessageToAll(0xff0000ff, "Admin blaa has come on duty");
}
Hope it helped


Re: when admin chat - Revo - 05.08.2012

IDENTATION Ranama


Re: when admin chat - Youice - 05.08.2012

if I understood you right, then here is the code:

Код:
CMD:adminchat(playerid, params[])
{
	new
		str[185],
		aname[MAX_PLAYER_NAME]
	;
	GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
	if(PInfo[playerid][pAdmin] >= 1)//if admin level is greater than 1
	{
	    if(sscanf(params, "s", str)) return SendClientMessage(playerid, -1, "USAGE: /adminchat [text]");
	    format(str, 185, "Admin %s says: %s", aname, params);
	}
	else SendClientMessage(playerid, -1, "You are not authorized to use that command!");
	return 1;
}