Admin Tag
#1

I want To make An Admin Tag Like [ADMIN] In Chat !! Can Someone Help Me ??
Reply
#2

Quote:
Originally Posted by GeekSiMo
Посмотреть сообщение
I want To make An Admin Tag Like [ADMIN] In Chat !! Can Someone Help Me ??
Very easy

OnPlayerText,

Make an [ADMIN] if Player is admin. :3 then send it
Reply
#3

But I want see it also when i do Tab to see Players
Reply
#4

Quote:
Originally Posted by GeekSiMo
Посмотреть сообщение
But I want see it also when i do Tab to see Players
ohh you mean Admin Name TAG??

Then change their name to [ADMIN] %s, Playername[playerid] when they go on duty. /aduty
Reply
#5

i don't want that !
Reply
#6

Get their name, and then put [ADMIN] in-front of it,

pawn Код:
new pName[16], string[126];
GetPlayersName(playerid, pName);
format(string, sizeof(string), "[ADMIN]%s", pName);
SetPlayerName(playerid, string);
Reply
#7

But They Can't Log in !!
Reply
#8

What?
Reply
#9

Right, now I'm going to assume that you don't have a registration system here, just a login and play type thing? Or something, I honestly don't understand the request you're putting in here. But if you want to see it in "Tab" as well. Your best bet honestly would be to use a SetPlayerName.

But putting it like that in tab means that people can also impersonate your admins. So if you don't have a registration system, make one. And if it'd be a MySQL thing, borrow tags thing. I'd try and help you more, but reading your posts, I seriously didn't understand what you were asking for that much. Even when others got it wrong too.

Код:
CMD:name(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] >= 9999) {
	    new giveplayerid, result[21];
	    new sendername[MAX_PLAYER_NAME];
	    new tmp[MAX_PLAYER_NAME];
	    if(!sscanf(params, "us[21]", giveplayerid, result)) {
	        format(PlayerInfo[giveplayerid][pAdminName], 21, "%s", result);
	        strcat(sendername, PlayerName(playerid));
	        new string[128];
	        new escstr[MAX_PLAYER_NAME];
	        mysql_real_escape_string(tmp,escstr);
	        format(string, sizeof(string), "UPDATE `userinfo` SET `AdminName`='%s' WHERE `id`=%d ;", escstr, PlayerInfo[playerid][pSQLID]);
	        format(string, sizeof(string), "Envision-Bot: %s has set your AdminName to %s.", sendername, tmp, PlayerInfo[giveplayerid][pAdminName]);
	        SendClientMessage(playerid, COLOR_ORANGE, string);
	        format(string, sizeof(string), "Envision-Bot: %s has set %s's Admin Name to: %s.", PlayerName(playerid), PlayerName(giveplayerid), PlayerInfo[giveplayerid][pAdminName]);
	        ABroadCast(COLOR_YELLOW2, string, 1);
		} else {
		    SendClientMessage(playerid, COLOR_GREY, "Invalid player!");
		}
	} else {
		SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Name [PlayerID/PartOfName] [Admin Name]");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "Set's the players Admin Name.");
	}
	return 1;
}

CMD:title(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] >= 9999) {
	    new giveplayerid, result[21];
	    new sendername[MAX_PLAYER_NAME];
	    new tmp[MAX_PLAYER_NAME];
	    if(!sscanf(params, "us[21]", giveplayerid,  result)) {
	        format(PlayerInfo[giveplayerid][pAdminTitle], 21, "%s", result);
	        strcat(sendername, PlayerName(playerid));
	        new string[128];
	        new escstr[MAX_PLAYER_NAME];
	        mysql_real_escape_string(tmp,escstr);
	        format(string, sizeof(string), "UPDATE `userinfo` SET `AdminTitle`='%s' WHERE `id`=%d ;", escstr, PlayerInfo[playerid][pSQLID]);
	        format(string, sizeof(string), "Envision-Bot: %s has change your AdminTitle to %s.", sendername, tmp, PlayerInfo[giveplayerid][pAdminTitle]);
			SendClientMessage(giveplayerid, COLOR_ORANGE, string);
			format(string, sizeof(string), "Envision-Bot: %s has set %s's Admin Title to: %s.", PlayerName(playerid), PlayerName(giveplayerid), PlayerInfo[giveplayerid][pAdminTitle]);
			ABroadCast(COLOR_YELLOW2, string, 1);
		}
		else {
		    SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");
		}
	} else {
		SendClientMessage(playerid, COLOR_WHITE, "USAGE: /SetAdminTitle [PlayerID/PartOfName] [Admin Title]");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "Set's the players Admin title.");
	}
	return 1;
}
Reply
#10

If you want a perm. admin tag then set their username where you save their data. If you want a temporary admin tag, then use SetPlayerName.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)