12.11.2012, 01:07
Anyone know how to make an admin tag? For instance:
Example Roleplay
[name]
Administrator
Example Roleplay
[name]
Administrator
public OnPlayerSpawn(playerid)
{
if(pinfo[playerid][pAdmin] > 0) // change the array to your script array for admins.
{
new aname[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, sizeof(aname));
format(name,sizeof(name),"[Admin]%s",aname) // setting admin tag with his name into a string.
SetPlayername(playerid,name);
}
return 1;
}
He wants to set it for an admin. OnPlayerText will keep on changing his name once he type's something in the chat!
|
public OnPlayerText(playerid, text[])
{
new AMSG[250];
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
new msg[250];
if(PlayerInfo[playerid][pAdmin] >= 3)
{
format(AMSG,sizeof(AMSG),"[Senior Admin]: %s says: %s ", Name, msg);
SendClientMessageToAll(GREEN, AMSG);
}
return 1;
}
new Text3D:ADU[MAX_PLAYERS];
CMD:togadmintag(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
ADU[playerid] = Create3DTextLabel("Administrator",0xE20000FF,30.0,40.0,50.0,8,1);
Attach3DTextLabelToPlayer(ADU[playerid], playerid, 0.0, 0.0, 0.25);
}
return 1;
}