Help with onplayertext
#5

pawn Код:
public OnPlayerText(playerid,text[])
{
       new string[128], name[MAX_PLAYER_NAME];
       GetPlayerName(playerid, name, sizeof name);
       if(PInfo[playerid][pAdminDuty] == 1)
       {
              format(string, sizeof(string), "Administrator %s: %s", name, text);
              return SendClientMessageToAll(COLOR_GOLD, string);
        }
   
       if(PInfo[playerid][Level] > 1 && text[0] == '.')
       {
               format(string, sizeof(string),"[ADMIN CHAT] %s[%d]: %s", name, playerid, text[1]);
               return MessageToAdmins(COLOR_MEDIUMSEAGREEN, string);
        }
        return 1;
}
Its because the callback returns 0. Just replace with 1 like this^

EDIT: i have edited the code, basically removed string Prefix because there is no need for it. You directly plot it it ing the main string manualy. And some simplifications!
Reply


Messages In This Thread
Help with onplayertext - by Nabster - 19.02.2015, 08:39
Re: Help with onplayertext - by JeaSon - 19.02.2015, 08:50
Re: Help with onplayertext - by Nabster - 19.02.2015, 09:01
Re: Help with onplayertext - by Nabster - 20.02.2015, 05:59
Re: Help with onplayertext - by Gammix - 20.02.2015, 06:05
Re: Help with onplayertext - by Nabster - 20.02.2015, 06:41
Re: Help with onplayertext - by Gammix - 20.02.2015, 06:47
Re: Help with onplayertext - by Nabster - 20.02.2015, 06:51
Re: Help with onplayertext - by Excips - 20.02.2015, 07:00

Forum Jump:


Users browsing this thread: 2 Guest(s)