SA-MP Forums Archive
Admin Tag - 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: Admin Tag (/showthread.php?tid=515547)



Admin Tag - GeekSiMo - 26.05.2014

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


Re: Admin Tag - PawnOX - 26.05.2014

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


Re: Admin Tag - GeekSiMo - 26.05.2014

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


Re: Admin Tag - PawnOX - 26.05.2014

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


Re: Admin Tag - GeekSiMo - 26.05.2014

i don't want that !


Re: Admin Tag - Abagail - 26.05.2014

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



Re: Admin Tag - GeekSiMo - 26.05.2014

But They Can't Log in !!


Re: Admin Tag - Stinged - 26.05.2014

What?


Re: Admin Tag - Jay_Dixon - 26.05.2014

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



Re: Admin Tag - Zex Tan - 27.05.2014

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.