Nametags
#1

Hello,
My adminduty command is this :


Код:
CMD:adminduty(playerid, params[]) {
	if(playerVariables[playerid][pAdminLevel] >= 1) {
		if(!strcmp(playerVariables[playerid][pAdminName], "(null)", true)) {
			return SendClientMessage(playerid, COLOR_GREY, "You don't have an admin name set. Contact a Head Admin (or higher) first.");
		}
		else {
		    switch(playerVariables[playerid][pAdminDuty]) {
				case 0: {
				    playerVariables[playerid][pAdminDuty] = 1;
				    for(new i = 0; i < MAX_PLAYERS; i++)
					ShowPlayerNameTagForPlayer(i, playerid,  false);
				    GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
					GetPlayerHealth(playerid, playerVariables[playerid][pHealth]);
					GetPlayerArmour(playerid, playerVariables[playerid][pArmour]);
					SetPlayerName(playerid, playerVariables[playerid][pAdminName]);
					SetPlayerColor(playerid, 0x00000FF);
					SetPlayerHealth(playerid, 500000.0);
					format(szMessage, sizeof(szMessage), "Notice: {FFFFFF}Admin %s (%s) is now on administrative duty.", playerVariables[playerid][pAdminName], playerVariables[playerid][pNormalName]);
				}
				case 1: {
				    playerVariables[playerid][pAdminDuty] = 0;
					SetPlayerName(playerid, playerVariables[playerid][pNormalName]);
					SetPlayerColor(playerid, 0xFFFFFFFF);
					for(new i = 0; i < MAX_PLAYERS; i++)
					ShowPlayerNameTagForPlayer(playerid, i, true);
					SetPlayerHealth(playerid, playerVariables[playerid][pHealth]);
					SetPlayerArmour(playerid, playerVariables[playerid][pArmour]);
					format(szMessage, sizeof(szMessage), "Notice: {FFFFFF}Admin %s (%s) is now off administrative duty.", playerVariables[playerid][pAdminName], playerVariables[playerid][pNormalName]);
				}
			}
			submitToAdmins(szMessage, COLOR_HOTORANGE);
		}
	}
	return 1;
}
And I want to make that this come above my head with this command :

Код:
CMD:togtag(playerid, params[]) {
if(playerVariables[playerid][pAdminLevel] >= 1) {
new Text3D:label = Create3DTextLabel("AM-RP Administator\nOn Duty", 0xFF0000FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.5);
SendClientMessage(playerid, 0xFFFFFFF, "You got you're tag");
} else {
SendClientMessage(playerid, COLOR_WHITE, "You are not autorized to use this command");
return 1;


}
}
This works but I want that the Player's name is above the head to hopefully you guys can help me

EDIT: and sometimes the admin's name is still seeable and I want to remove it while on duty.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)