OnPlayerText Help.
#1

Hey guys,

i have this script under OnPlayerText :-
Code:
if(pInfo[playerid][Adminlevel] >= 1 && text[0] == '#')
    {
         new msg[128], pName[MAX_PLAYER_NAME];
         GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
         format(msg, sizeof(msg), "[ADMIN CHAT] %s: %s", pName, text[1]);
         SendMessageToAdmins(msg);
    }
    if(pInfo[playerid][VIPlevel] >= 1 && text[0] == '*')
    {
         new msg[128], pName[MAX_PLAYER_NAME];
         GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
         format(msg, sizeof(msg), "[VIP CHAT] %s: %s", pName, text[1]);
         SendMessageToVIPs(msg);
    }
Its working but if someone types, it given an message with #(message) in the Chat.It shows to everyplayer.
Please fix it.
Reply
#2

pawn Code:
Return 0
If you want the text to stop from being sent

EDIT: Return 1 on the callback and return 0 on your code after you send the message.
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=335123
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)