when admin chat
#1

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
Reply
#2

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

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?
Reply
#4

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
Reply
#5

IDENTATION Ranama
Reply
#6

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


Forum Jump:


Users browsing this thread: 2 Guest(s)