[HELP]Admin in front of my name
#1

hello guys my question is that how could i make a script wich puts (Admin) at admins name... im yousing LuxAdmin system pls help In chat of course
Reply
#2

Have you tried using ******? It's a searching engine.
Here, this is the link! www.******.com

No, really, THERE ARE TONS OF TOPICS like this.
Reply
#3

Use OnPlayerText callback, samp wiki's example will help you and check if playerid is admin. If he is, edit the format and add the Admin tag in front of the name. Else, send it as normal. Don't forget to return false for sending the custom chat and not the default.
Reply
#4

Exactly what Dwane said, but in code format:

pawn Code:
public OnPlayerText(playerid, text[]) //This is called every time a player tries to type something, other than a command, such as when talking to other players
{
    if(IsPlayerAdmin(playerid)) //If they are an admin, you can replace this with your own admin variable
    {
        new string[150], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(string,sizeof(string),"[ADMIN] %s: %s", name, text); //Editing the format and adding admin tag in front of name
        SendClientMessageToAll(0xFFFF00FF, string); //Sends message to all
        return 0; //Return false for sending custom chat, so it doesn't send your message twice
    }
    return 1; //Otherwise return 1 and send the message as normal
}
Reply
#5

click here to get code
Reply
#6

https://sampforum.blast.hk/showthread.php?tid=403345
Reply
#7

Thanks guys,but i have some errors here:
Code:
C:\Users\Hunor\Desktop\tag.pwn(1) : warning 235: public function lacks forward declaration (symbol "OnPlayerText")
C:\Users\Hunor\Desktop\tag.pwn(3) : error 017: undefined symbol "IsPlayerAdmin"
C:\Users\Hunor\Desktop\tag.pwn(5) : error 017: undefined symbol "MAX_PLAYER_NAME"
C:\Users\Hunor\Desktop\tag.pwn(5) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\Hunor\Desktop\tag.pwn(5) : error 036: empty statement
C:\Users\Hunor\Desktop\tag.pwn(5) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#8

lol, do you have
pawn Code:
#include <a_samp>
at the top of your script?
Reply
#9

No, he doesn't have it.
Reply
#10

OK i made it but how can i change that the [ADMIN]to have a colour but my name another
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)