SA-MP Forums Archive
OnPlayerText BUG - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerText BUG (/showthread.php?tid=550678)



OnPlayerText BUG - hesambia - 14.12.2014

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


Re: OnPlayerText BUG - hesambia - 15.12.2014

Bump.
PLEASE ANSWER IT!!!


Re: OnPlayerText BUG - Abagail - 15.12.2014

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;
}



Re: OnPlayerText BUG - hesambia - 15.12.2014

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


Respuesta: OnPlayerText BUG - !R1Ch@rD! - 15.12.2014

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


Re: OnPlayerText BUG - hesambia - 15.12.2014

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!


Re: OnPlayerText BUG - hesambia - 15.12.2014

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


Re: OnPlayerText BUG - hesambia - 15.12.2014

Fixed.
There was a bug in my anticheat.