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



[Help] Admin Tag - StopFondlinMe - 12.11.2012

Anyone know how to make an admin tag? For instance:
Example Roleplay
[name]
Administrator


Re: [Help] Admin Tag - Ballu Miaa - 12.11.2012

You can SetPlayerName() for admins under OnPlayerSpawn() callback.

will be like:
pawn Код:
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;
}



Respuesta: [Help] Admin Tag - ThePhenix - 12.11.2012

Wouldn't better to post it under OnPlayerText?


Re: Respuesta: [Help] Admin Tag - Ballu Miaa - 12.11.2012

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
Wouldn't better to post it under OnPlayerText?
He wants to set it for an admin. OnPlayerText will keep on changing his name once he type's something in the chat!


Re: [Help] Admin Tag - StopFondlinMe - 12.11.2012

I want it to be like..

CMD: togadmintag

and then the other shit below it haha

I don't know how to script.


Respuesta: Re: Respuesta: [Help] Admin Tag - ThePhenix - 12.11.2012

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
He wants to set it for an admin. OnPlayerText will keep on changing his name once he type's something in the chat!
I thought he wanted to do it.

When an admin talks in the chat will be:

[ADMIN]%s, name);

PHP код:
public OnPlayerText(playeridtext[])
{
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 "Namemsg);
            
SendClientMessageToAll(GREENAMSG);
        }
return 
1;




Re: [Help] Admin Tag - StopFondlinMe - 12.11.2012

Guys I just want a tag for the admins like on their head.

Like in the example above.


Re: [Help] Admin Tag - Ballu Miaa - 12.11.2012

Sort it out yourself. We are here to help not to spoon feed!


Re: [Help] Admin Tag - StopFondlinMe - 12.11.2012

Can you just help me figure this out? I am learning.


Respuesta: [Help] Admin Tag - ThePhenix - 12.11.2012

I think it will be like this:

PHP код:
new Text3D:ADU[MAX_PLAYERS];
CMD:togadmintag(playeridparams[])
    {
        if(
IsPlayerConnected(playerid))
        {
            
ADU[playerid] = Create3DTextLabel("Administrator",0xE20000FF,30.0,40.0,50.0,8,1);
            
Attach3DTextLabelToPlayer(ADU[playerid], playerid0.00.00.25);
        }
        return 
1;
    }