cannot find chat message
#1



I tried to find this under OnPlayerText OnCOmmandReceive still couldnt find this line. And if you ask for onplayercommandtext there is none in my script.

Where do you think it come?

OnPlayerText
Код:
    CallLocalFunction("StoreChatLine", "ds", playerid, text);
    if(text[0] == ADMCHATKEY && pInfo[playerid][pLevel] >= 1)
	{
		format(Jstring,sizeof(Jstring),">> [Admin Chat] %s(%d): %s",GetName(playerid), playerid,text[1]);
		foreach(Player, i) if(pInfo[i][pLevel] >= 1) SendClientMessage(i,Admchat,Jstring);
		WriteToLog(Jstring,"AdminChat");
	    return 0;
	}
    if(pInfo[playerid][Muted] == 1)
	{
		SendClientMessage(playerid,red,">> You are muted, you are not allowed to talk!");
		return 0;
	}
	if(text[0] == DONATORCHATKEY && pInfo[playerid][pLevel] >= 1)
	{
		format(Jstring,sizeof(Jstring),">> [V.I.P Chat] %s(%d): %s",GetName(playerid), playerid,text[1]);
		foreach(Player, i) if(pInfo[i][pLevel] >= 1) SendClientMessage(i,Admchat,Jstring);
		WriteToLog(Jstring,"VIPChatLog");
	    return 0;
	}
	if(IsDisabledChat == 1)
	{
		format(Jstring,sizeof(Jstring),"***Chat is disabled by %s",AdmName);
		SendClientMessage(playerid,red,Jstring);
	    return 0;
	}
	if(AntiSpam == 1 && pInfo[playerid][Muted] == 0)
	{
           GetPVarString(playerid, "ChatMsg",CTMSG,128);
           if(!strcmp(CTMSG, text,  false))
           {
              pInfo[playerid][SpamWarns]++;
              if(pInfo[playerid][SpamWarns] < MAX_SPAM_WARNS)SendClientMessage(playerid,red,">> WARNING: Do not repeat or you will be muted!");
              if(pInfo[playerid][SpamWarns] >= MAX_SPAM_WARNS)
              {
		          format(Jstring,sizeof(Jstring),">> %s(%d) has been automatically muted for %d seconds | REASON: Spam ",GetName(playerid),playerid,AUTO_MUTE_TIME);
				  SendClientMessageToAll(red, Jstring);
				  pInfo[playerid][Muted] = 1;
				  SetTimerEx("UnmutePlayer",AUTO_MUTE_TIME*1000,false,"d",playerid);
				  return 0;
			  }
		   }
		   else pInfo[playerid][SpamWarns] = 0;
		   SetPVarString(playerid,"ChatMsg",text);
	}
	if(AntiForbiddenWords == 1 && IsBadWord(text))
	for(new i = WordSt, l = WordSt + WordEn; i < l; i++) text[i] = '•';
	if(AntiAdv == 1)
	{
	    if(IsAdvertisement(text))
	    {
           if(AdminImmunity == 1 && pInfo[playerid][pLevel] >= 2) return 1;
           ShowPlayerDialog(playerid,JDIALOGS+200,DIALOG_STYLE_MSGBOX,"{FF0000}Advertising is NOT allowed on this server","{FF0000}You have been kicked from the server | REASON : \"Advertising\"","OK","");
		   SetTimerEx("KickPlayer",100,false,"d",playerid);
		   format(Jstring,sizeof(Jstring),"%s(%d) has been kicked | REASON: \"Advertising\"",GetName(playerid),playerid);
		   SendClientMessageToAll(red, Jstring);
		   format(Jstring,sizeof(Jstring),"%s(%d) has been automatically kicked for 'Advertising' (%s)",GetName(playerid),playerid,text);
		   SendToAdmins(orange,Jstring);
		   format(Jstring,sizeof(Jstring),"[SYSTEM KICK] %s has been kicked for 'Advertising' (%s)",GetName(playerid),text);
		   WriteToLog(Jstring,"KickLog");
		   return 0;
		}
	}
OnPlayerCommandReceived
Код:
	if(pInfo[playerid][Jailed] == 1 && pInfo[playerid][pLevel] == 0)
    {
	  SendClientMessage(playerid,red,"You can not use commands in Jail");
	  return 0;
	}
	if(ReadCommands == 1)
	{
      format(Cmdstr, sizeof(Cmdstr), ">>> %s(%d) Used command: %s", GetName(playerid),playerid,cmdtext);
      foreach(Player, i)
	  {
		if(pInfo[i][pLevel] >= 1 && pInfo[i][pLevel] > pInfo[playerid][pLevel] && i != playerid)
		{
		   SendClientMessage(i, Cmdcolor, Cmdstr);
		}
Reply
#2

Show all OnPlayerText
Reply
#3

Quote:
Originally Posted by HardRock
Посмотреть сообщение
Show all OnPlayerText
Код:
public OnPlayerText(playerid, text[])
{

    SetPlayerChatBubble(playerid, text, 0xFFFFFFFF, 100.0, 10000);
    
    CallLocalFunction("StoreChatLine", "ds", playerid, text);
    if(text[0] == ADMCHATKEY && pInfo[playerid][pLevel] >= 1)
	{
		format(Jstring,sizeof(Jstring),">> [Admin Chat] %s(%d): %s",GetName(playerid), playerid,text[1]);
		foreach(Player, i) if(pInfo[i][pLevel] >= 1) SendClientMessage(i,Admchat,Jstring);
		WriteToLog(Jstring,"AdminChat");
	    return 0;
	}
    if(pInfo[playerid][Muted] == 1)
	{
		SendClientMessage(playerid,red,">> You are muted, you are not allowed to talk!");
		return 0;
	}
	if(text[0] == DONATORCHATKEY && pInfo[playerid][pLevel] >= 1)
	{
		format(Jstring,sizeof(Jstring),">> [V.I.P Chat] %s(%d): %s",GetName(playerid), playerid,text[1]);
		foreach(Player, i) if(pInfo[i][pLevel] >= 1) SendClientMessage(i,Admchat,Jstring);
		WriteToLog(Jstring,"VIPChatLog");
	    return 0;
	}
	if(IsDisabledChat == 1)
	{
		format(Jstring,sizeof(Jstring),"***Chat is disabled by %s",AdmName);
		SendClientMessage(playerid,red,Jstring);
	    return 0;
	}
	if(AntiSpam == 1 && pInfo[playerid][Muted] == 0)
	{
           GetPVarString(playerid, "ChatMsg",CTMSG,128);
           if(!strcmp(CTMSG, text,  false))
           {
              pInfo[playerid][SpamWarns]++;
              if(pInfo[playerid][SpamWarns] < MAX_SPAM_WARNS)SendClientMessage(playerid,red,">> WARNING: Do not repeat or you will be muted!");
              if(pInfo[playerid][SpamWarns] >= MAX_SPAM_WARNS)
              {
		          format(Jstring,sizeof(Jstring),">> %s(%d) has been automatically muted for %d seconds | REASON: Spam ",GetName(playerid),playerid,AUTO_MUTE_TIME);
				  SendClientMessageToAll(red, Jstring);
				  pInfo[playerid][Muted] = 1;
				  SetTimerEx("UnmutePlayer",AUTO_MUTE_TIME*1000,false,"d",playerid);
				  return 0;
			  }
		   }
		   else pInfo[playerid][SpamWarns] = 0;
		   SetPVarString(playerid,"ChatMsg",text);
	}
	if(AntiForbiddenWords == 1 && IsBadWord(text))
	for(new i = WordSt, l = WordSt + WordEn; i < l; i++) text[i] = '•';
	if(AntiAdv == 1)
	{
	    if(IsAdvertisement(text))
	    {
           if(AdminImmunity == 1 && pInfo[playerid][pLevel] >= 2) return 1;
           ShowPlayerDialog(playerid,JDIALOGS+200,DIALOG_STYLE_MSGBOX,"{FF0000}Advertising is NOT allowed on this server","{FF0000}You have been kicked from the server | REASON : \"Advertising\"","OK","");
		   SetTimerEx("KickPlayer",100,false,"d",playerid);
		   format(Jstring,sizeof(Jstring),"%s(%d) has been kicked | REASON: \"Advertising\"",GetName(playerid),playerid);
		   SendClientMessageToAll(red, Jstring);
		   format(Jstring,sizeof(Jstring),"%s(%d) has been automatically kicked for 'Advertising' (%s)",GetName(playerid),playerid,text);
		   SendToAdmins(orange,Jstring);
		   format(Jstring,sizeof(Jstring),"[SYSTEM KICK] %s has been kicked for 'Advertising' (%s)",GetName(playerid),text);
		   WriteToLog(Jstring,"KickLog");
		   return 0;
		}
	}
	return 1;
}
Reply
#4

can anyone pelase help me with this?
Reply
#5

Try and search and find it: CTRL + F, type something like "Test: Hi", in the box or whatever it says.

What's StoreChatLine? Maybe it has something in there.
Reply
#6

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
Try and search and find it: CTRL + F, type something like "Test: Hi", in the box or whatever it says.

What's StoreChatLine? Maybe it has something in there.
The Test: Hi doesn't do anything I just show it to see that it doesnt show the ID of the player.

Here is the storechatline

Код:
public StoreChatLine(playerid,text[])
{
	 for(new i = 0; i < MAX_CHAT_MSGS_STORE-1; i++)
	 ChatMessages[i] = ChatMessages[i+1];
	 format(Jstring,sizeof(Jstring),"%s(ID: %d): %s",GetName(playerid),playerid,text);
	 ChatMessages[MAX_CHAT_MSGS_STORE-1] = Jstring;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)