SA-MP Forums Archive
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: Chat problem! (/showthread.php?tid=353219)



Chat problem! - RyanPetersons - 22.06.2012

if we type something in the chat, it doesn't comes in that chat and no one can see the chat that peoples writes?


Re: Chat problem! - RyanPetersons - 22.06.2012

Can anyone reply of this solution pls?


Re: Chat problem! - Jarnu - 22.06.2012

Post your OnPlayerText code. please.


Re: Chat problem! - [KHK]Khalid - 22.06.2012

Explain more please. Also check your OnPlayerText callback whether it returns 0 or 1 cause if it's 0 the message won't be sent.


Re: Chat problem! - RyanPetersons - 22.06.2012

Of gamemode of fs'es?

pawn Код:
public OnPlayerText(playerid,text[])
    {
    if (!player[playerid][calling] || player[playerid][caller] == 255)
    {
        new string[128];
        format(string, 255, "(%d) %s", player[playerid][number], text);
        SendPlayerMessageToAll(playerid, string);
    }
    else
    {
        new str[158];
        GetPlayerName(playerid, str, 16);
        format(str, sizeof(str), "(Cellphone)%s : %s", str, text);
        SendClientMessage(player[playerid][caller], 0xBFC0C2FF, str);
        SendClientMessage(playerid, 0xBFC0C2FF, str);
    }
    //=============================== 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 0;
    }
//=============================== 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 0;
    }
//=============================== 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 0;
    }
//================================ Muted =======================================
    if(User[playerid][Muted] == 1)
    {
        SendClientMessage(playerid, Red, "==--You are muted, noone can hear you!--==");
        }
        return 0;
    }



Re: Chat problem! - RyanPetersons - 22.06.2012

I gave it now can you reply?


Respuesta: Chat problem! - Chris1337 - 22.06.2012

pawn Код:
if(User[playerid][Muted] == 1)
{
    {
        SendClientMessage(playerid, Red, "==--You are muted, noone can hear you!--==");
        return 0;
    }
   return 1;
}