08.09.2013, 01:13
For me the best way is by using OnPlayerText(playerid);.
Example code ;
and, if you don't want him to use your tag :
Example code ;
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[154];
new pname[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, pname, sizeof(pname)); // GetTheName.
if(IsPlayerAdmin(playerid)) // if he is admins
{
format(string, sizeof(string), "[AU] %s : %s", name, text); // like : [AU] Matnix : Hello world!
SendClientMessageToAll(string); // send the message with your tag.
}
else // if he isn't an admins.
{
format(string, sizeof(string), "%s : %s", name, text);
SendClientMessageToAll(string); // send the message without tag.
}
return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
new name[24];
GetPlayerName(playerid,name,sizeof(name));
if(strfind(name,"[AU]",true) != -1)
{
if(IsPlayerAdmin(playerid))
{
// set the admins name to the new one with a tags.
}
else
{
// kick him with a message to inform him he can't use this tags.
}
}
return 1;
}