SA-MP Forums Archive
Help, my normal chat doesn't work. - 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: Help, my normal chat doesn't work. (/showthread.php?tid=482550)



Help, my normal chat doesn't work. - Flaken - 21.12.2013

So, basically I've a hosted tab server, the scripts allover working fine.

But when I tried to chat ''test'', it doesn't appears, no messages from players.

Why ?


Re: Help, my normal chat doesn't work. - arakuta - 21.12.2013

returning 0 at OnPlayerSpawn prevents de defaul chat to be sent.


Re: Help, my normal chat doesn't work. - iZN - 21.12.2013

Quote:
Originally Posted by arakuta
Посмотреть сообщение
returning 0 at OnPlayerSpawn prevents de defaul chat to be sent.
What?

Please show your OnPlayerText callback without any script we can't assist you.


AW: Help, my normal chat doesn't work. - atzeex - 21.12.2013

Maybe you use a Command to Chat with another Players ^^


Re: Help, my normal chat doesn't work. - TFoCap - 21.12.2013

wtf? you guys reply so quick to retarded ass shit like this but you never reply to my posts


Re: Help, my normal chat doesn't work. - Flaken - 22.12.2013

arakute please spesific it more...


Re: Help, my normal chat doesn't work. - Flaken - 22.12.2013

heres my OnPlayerText script

Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '*' && PInfo[playerid][Admin] >= 1)
    {
        new str[256]; GetPlayerName(playerid,str,sizeof(str));
        format(str,sizeof(str),"Admin Chat: {B4B5B7}%s: %s",str,text[1]);
        AdminPrivateChat(COLOR_RED,str);
        SaveLogs("AdminChat",str);
        return 0;
    }
    if(text[0] == '@' && PInfo[playerid][VIP] == 1)
    {
        new str[256]; GetPlayerName(playerid,str,sizeof(str));
        format(str,sizeof(str),"VIP Chat: {B4B5B7}%s: %s",str,text[1]);
        VIPPrivateChat(COLOR_YELLOW,str);
        SaveLogs("VIPChat",str);
        return 0;
    }
    if(PInfo[playerid][pMute] == 1) {
    SendClientMessage(playerid, COLOR_RED, "You are muted, no one can hear you!");
    return 0; }
    return 0;
}
I've changed the ''return 1'' into ''return 0'' as it was told above.


Re: Help, my normal chat doesn't work. - Vince - 22.12.2013

Uhm no. The last one's got to be 'return 1'.


Re: Help, my normal chat doesn't work. - Flaken - 22.12.2013

The problem seems to be still appeared...


Re: Help, my normal chat doesn't work. - CutX - 22.12.2013

use "else if" and also the callback must return 1 for normal chat.
that'll work:

PHP код:
public OnPlayerText(playeridtext[])
{
    if(
text[0] == '*' && PInfo[playerid][Admin] >= 1)
    {
        new 
str[256]; GetPlayerName(playerid,str,sizeof(str));
        
format(str,sizeof(str),"Admin Chat: {B4B5B7}%s: %s",str,text[1]);
        
AdminPrivateChat(COLOR_RED,str);
        
SaveLogs("AdminChat",str);
        return 
0;
    }
    else if(
text[0] == '@' && PInfo[playerid][VIP] == 1)
    {
        new 
str[256]; GetPlayerName(playerid,str,sizeof(str));
        
format(str,sizeof(str),"VIP Chat: {B4B5B7}%s: %s",str,text[1]);
        
VIPPrivateChat(COLOR_YELLOW,str);
        
SaveLogs("VIPChat",str);
        return 
0;
    }
    else if(
PInfo[playerid][pMute] == 1)
    {
        
SendClientMessage(playeridCOLOR_RED"You are muted, no one can hear you!");
        return 
0;
    }
    
    return 
1;

Quote:
Originally Posted by SA-MP Wiki
Returning 0 in this callback will stop the text from being sent