OnPlayerText BUG
#1

PHP код:
public OnPlayerText(playeridtext[]) {
    new 
txt[128];
    if (
strlen(text) > && text[0] == '!' && text[1] == '!') {
        if (
PlayerInfo[playerid][pAdmin] < 1) {
            
SendChatMessage(playerid, -1Error("Admin Permissions Needed!"));
            return 
0;
        }
        
strdel(text,0,2);
        
format(txt,sizeof(txt),"[ADMIN] %s (Rate: %d): %s",GetPlayerNameEx(playerid),PlayerInfo[playerid][pAdmin],text);
        
SendAdminMessage(COLOR_LIME,txt);
        return 
0;
    }
    if (
IsPlayerTalkingWithCellphone(playerid)) {
        
format(txt,sizeof(txt),"[MOBILE] %s : %s",GetPlayerNameEx(playerid),text);
        
SendLocalMessage(TALK_RANGE,playerid,txt,COLOR_CHAT_ONE,COLOR_CHAT_TWO,COLOR_CHAT_THREE,COLOR_CHAT_FOUR,COLOR_CHAT_FIVE);
        
SendChatMessage(GetPlayerCaller(playerid),COLOR_CHAT_ONE,txt);
        return 
0;
    }
    if (
strlen(text) > && text[0] == '(' && text[1] == '(' && text[strlen(text) - 1] == ')' && text[strlen(text) - 2] == ')') {
        
strdel(text,0,2);
        
strdel(text,strlen(text) - 2,strlen(text) - 1);
        
format(txt,sizeof(txt),"%s : (( %s ))",GetPlayerNameEx(playerid),text);
    }
    else {
        
format(txt,sizeof(txt),"%s Says: %s",GetPlayerNameEx(playerid),text);
    }
    
SendLocalMessage(TALK_RANGE,playerid,txt,COLOR_CHAT_ONE,COLOR_CHAT_TWO,COLOR_CHAT_THREE,COLOR_CHAT_FOUR,COLOR_CHAT_FIVE);
    
SetPlayerChatBubble(playerid,text,COLOR_White,50.0,CHAT_BUBBLE_TIME);
    return 
0;

This Callback is does not working. I was placed a print under the 'public OnPlayerText' and typed something in chat in-game and print wasen't worked!
(Sorry for english)

[EDIT] Note: i have a macro similar to this: #define SendChatMessage SendClientMessage
Reply
#2

Bump.
PLEASE ANSWER IT!!!
Reply
#3

Do you have this in any of your scripts running? Is this on a gamemode, or filterscript? Try placing this in a filterscript, and then try typing something. Something should appear in the server console / log:

pawn Код:
public OnPlayerText(playerid,text[])
{
        new name[24];
        GetPlayerName(playerid, name, 24);
        printf("[CHAT]%s: %s(ID: %d)", name, text, playerid);
        return true;
}
Reply
#4

yes, its on a gamemode.
also, its print into console / log; but the callback is wont working.
Reply
#5

those of [admin ] Because not you put the case That detects the administrator ? bone understand?
Reply
#6

i understand, but its do not fix my problem. this script was successfully working; but from 1 week past, this problem was created.

for example, if i place a
PHP код:
public OnPlayerText(playeridtext[]) {
    return 
1;

, its dont work and chat wont printed!
Reply
#7

BUMP.
PLEASE ANSWER!!!!!!
IMPORTANT WORK FOR Tehran-RP SERVER!!!!!!
Reply
#8

Fixed.
There was a bug in my anticheat.
Reply


Forum Jump:


Users browsing this thread: