SA-MP Forums Archive
How to fix chat problem - 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: How to fix chat problem (/showthread.php?tid=354078)



How to fix chat problem - RyanPetersons - 25.06.2012

Hello .. I got a problem in chat whatever i write in chat nothing appears .. what mistake i did if anyone knows it kindly give a reply .. thanks
regards ,
Ryan_Petersons


Re: How to fix chat problem - Hawky133 - 25.06.2012

This is caused by something under "OnPlayerText".

Look for anything that uses "return 0;" as this prevents your message from being sent.

However, without your code, I can't suggest much more.


Re: How to fix chat problem - Jstylezzz - 25.06.2012

If you could show us some code

If you show us your OnPlayerText code, i'm sure we can help you

EDIT: lolz, Hawky beat me to it xD


Re: How to fix chat problem - RyanPetersons - 25.06.2012

pawn Код:
public OnPlayerText(playerid, text[])
{
//=============================== Anti Swear ===================================
    if(ServerInfo[AntiSwear] == 1 && User[playerid][Level] < ServerInfo[MaxAdminLevel])
    for(new s = 0; s < BadWordsCount; s++)
    {
        new pos;
        while((pos = strfind(text,BadWords[s],true)) != -1)
        for(new i = pos, j = pos + strlen(BadWords[s]); i < j; i++) text[i] = '*';
    }
//=============================== Admin Chat ===================================
    if(text[0] == '#' && User[playerid][Level] >= 1) {
        new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"Admin Chat: %s: %s",string,text[1]);
        MessageToAdmins(Green,string);
        SaveIn("AdmChatLog",string);
        return 1;
    }
//=============================== Vip Chat =====================================
    if(text[0] == '*' && User[playerid][Vip] >= 1) {
        new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"Vip Chat: %s: %s",string,text[1]);
        MessageToVips(Green,string);
        SaveIn("VipChatLog",string);
        return 1;
    }
//=============================== ServerTeam Chat ==============================
    if(text[0] == '-' && User[playerid][ServerTeam] >= 1) {
        new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"ServerTeam Chat: %s: %s",string,text[1]);
        MessageToServerTeam(Green,string);
        SaveIn("ServerTeamChatLog",string);
        return 1;
    }
//================================ Muted =======================================
    if(User[playerid][Muted] == 1)
    {
        SendClientMessage(playerid, Red, "==--You are muted, noone can hear you!--==");
         }
        return 1;
    }



Re: How to fix chat problem - Revo - 25.06.2012

Seems like you have a bracket too much at Player muted.


Re: How to fix chat problem - Dan_Barocu - 25.06.2012

PHP код:
//================================ Muted =======================================
     
if(User[playerid][Muted] == 1)
    {
        
SendClientMessage(playeridRed"==--You are muted, noone can hear you!--==");
        return 
1;
    } 
Like this it works?