SA-MP Forums Archive
Editing Something in the IC Chat - 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: Editing Something in the IC Chat (/showthread.php?tid=499139)



Editing Something in the IC Chat - Drago987 - 06.03.2014

Hello,can someone tell me how to Edit the IC Chat to like when a player has a mask on him so it Says "Stranger Says: %s" in the IC Chat ? i've Searched for the ProxDetector but no results.


Re: Editing Something in the IC Chat - BKarner - 06.03.2014

You can do it in:
"OnPlayerText".

You'll need to create your own checks and formats.


Re: Editing Something in the IC Chat - Drago987 - 06.03.2014

i've found this
pawn Код:
new accent[64];
    GetPlayerAccent(playerid, accent);
    if(PlayerInfo[playerid][pAccent] != 0 && PlayerInfo[playerid][pAccent] != 1 && PlayerInfo[playerid][pMask] == 1)
    {
        format(string, sizeof(string), "%s %s says: %s", accent, sendername, text);
        ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
    }
    else
    {
        format(string, sizeof(string), "%s says: %s", sendername, text);
        ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
    }
   
    if(PlayerInfo[playerid][pMask] == 1)
    {
        format(string, sizeof(string), "%s Stranger says: %s", accent, text);
        ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
    }
   

    if(PlayerInfo[playerid][pBugged] == 1)
    {
        format(string, sizeof(string), "(bug) %s: %s", GetPlayerNameEx(playerid), text);
        SendBugMessage(2, COLOR_LIGHTGREEN, string);
        SendBugMessage(1, COLOR_LIGHTGREEN, string);
        SendBugMessage(7, COLOR_LIGHTGREEN, string);
        SendBugMessage(18, COLOR_LIGHTGREEN, string);
        SendBugMessage(19, COLOR_LIGHTGREEN, string);
    }
    foreach(Player, i)
    {
        if(PlayerInfo[i][pAdmin] > 1 && BigEar[i] == 3)
        {
            format(string, sizeof(string), "(BE) %s: %s", GetPlayerNameEx(playerid), text);
            SendClientMessageEx(i, COLOR_WHITE, string);
        }
    }
    return 0;
}
but it Sends the Message Twice Like this
Код:
Player_Name: %s
Stranger:%s
Can you tell me how to fix it ?


Re: Editing Something in the IC Chat - EiresJason - 06.03.2014

Try this.

pawn Код:
if(PlayerInfo[playerid][pMask] == 1)
    {
        format(string, sizeof(string), "%s Stranger says: %s", accent, text);
        ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
        return 0;
   
}
EDIT: Put it at the top of the callback, under GetPlayerAccent.


Re: Editing Something in the IC Chat - Drago987 - 06.03.2014

Quote:
Originally Posted by EiresJason
Посмотреть сообщение
Try this.

pawn Код:
if(PlayerInfo[playerid][pMask] == 1)
    {
        format(string, sizeof(string), "%s Stranger says: %s", accent, text);
        ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
        return 0;
   
}
Still the Same


Re: Editing Something in the IC Chat - EiresJason - 06.03.2014

Like this.
pawn Код:
public OnPlayerText(playerid,text[])
{
    new accent[64];
    GetPlayerAccent(playerid, accent);
    if(PlayerInfo[playerid][pMask] == 1)
    {
        format(string, sizeof(string), "%s Stranger says: %s", accent, text);
        ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
        return 0;
    }
    if(PlayerInfo[playerid][pAccent] != 0 && PlayerInfo[playerid][pAccent] != 1 && PlayerInfo[playerid][pMask] == 1)
    {
        format(string, sizeof(string), "%s %s says: %s", accent, sendername, text);
        ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
    }
    else
    {
        format(string, sizeof(string), "%s says: %s", sendername, text);
        ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
    }  

    if(PlayerInfo[playerid][pBugged] == 1)
    {
        format(string, sizeof(string), "(bug) %s: %s", GetPlayerNameEx(playerid), text);
        SendBugMessage(2, COLOR_LIGHTGREEN, string);
        SendBugMessage(1, COLOR_LIGHTGREEN, string);
        SendBugMessage(7, COLOR_LIGHTGREEN, string);
        SendBugMessage(18, COLOR_LIGHTGREEN, string);
        SendBugMessage(19, COLOR_LIGHTGREEN, string);
    }
    foreach(Player, i)
    {
        if(PlayerInfo[i][pAdmin] > 1 && BigEar[i] == 3)
        {
            format(string, sizeof(string), "(BE) %s: %s", GetPlayerNameEx(playerid), text);
            SendClientMessageEx(i, COLOR_WHITE, string);
        }
    }
    return 0;
}



Re: Editing Something in the IC Chat - ConnorHunter - 06.03.2014

pawn Код:
for(new i; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                ShowPlayerNameTagForPlayer(i, playerid, 0);
            }
        }



Re: Editing Something in the IC Chat - XK - 06.03.2014

It says 2 messages because at this:
pawn Код:
new accent[64];
    GetPlayerAccent(playerid, accent);
    if(PlayerInfo[playerid][pAccent] != 0 && PlayerInfo[playerid][pAccent] != 1 && PlayerInfo[playerid][pMask] == 0)
    {
        format(string, sizeof(string), "%s %s says: %s", accent, sendername, text);
        ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
    }
Look at this line :
pawn Код:
if(PlayerInfo[playerid][pAccent] != 0 && PlayerInfo[playerid][pAccent] != 1 && PlayerInfo[playerid][pMask] == 1)
It should be : but dont use this,use the code at the end
pawn Код:
if(PlayerInfo[playerid][pAccent] != 0 && PlayerInfo[playerid][pAccent] != 1 && PlayerInfo[playerid][pMask] == 0)
The problem that you have player with mask on say two things,and it should be 0 not 1,now it will work...
So the code will be: copy it and replace it with your code
pawn Код:
new accent[64];
    GetPlayerAccent(playerid, accent);
    if(PlayerInfo[playerid][pAccent] != 0 && PlayerInfo[playerid][pAccent] != 1)
    {
        if(PlayerInfo[playerid][pMask] == 0) // because if you keep it with the paccent like before at "else" it will say another message...
        {
                format(string, sizeof(string), "%s %s says: %s", accent, sendername, text);
                ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
        }
    }
    else
    {
        format(string, sizeof(string), "%s says: %s", sendername, text);
        ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
    }
   
    if(PlayerInfo[playerid][pMask] == 1)
    {
        format(string, sizeof(string), "%s Stranger says: %s", accent, text);
        ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
    }
   

    if(PlayerInfo[playerid][pBugged] == 1)
    {
        format(string, sizeof(string), "(bug) %s: %s", GetPlayerNameEx(playerid), text);
        SendBugMessage(2, COLOR_LIGHTGREEN, string);
        SendBugMessage(1, COLOR_LIGHTGREEN, string);
        SendBugMessage(7, COLOR_LIGHTGREEN, string);
        SendBugMessage(18, COLOR_LIGHTGREEN, string);
        SendBugMessage(19, COLOR_LIGHTGREEN, string);
    }
    foreach(Player, i)
    {
        if(PlayerInfo[i][pAdmin] > 1 && BigEar[i] == 3)
        {
            format(string, sizeof(string), "(BE) %s: %s", GetPlayerNameEx(playerid), text);
            SendClientMessageEx(i, COLOR_WHITE, string);
        }
    }
    return 0;
}