on player text issue
#1

I am making it for players cant sand duplicate messages but I have an issue. could someone please help me fix this to where it woks?



Thank you

here it is:
Код:
if(strcmp(PlayerInfo[playerid][LastTextSaid],str,true)==0)
	{
		SendClientMessage(playerid, COLOR_RED, "YOU CANNOT SEND DUPLICATE MESSAGES");
	}
	else
	{
		SetPlayerChatBubble(playerid,str,COLOR_WHITE,30,10000);
		PlayerInfo[playerid][LastTextSaid] = str;
		SendClientMessage(playerid, COLOR_YELLOW, PlayerInfo[playerid][LastTextSaid]);
	}
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strcmp(PlayerInfo[playerid][LastTextSaid], str, true) == 0)
    {
        SendClientMessage(playerid, COLOR_RED, "YOU CANNOT SEND DUPLICATE MESSAGES");
        return 1;
    }
    else
    {
        SetPlayerChatBubble(playerid, str ,COLOR_WHITE,30,10000);
        format(PlayerInfo[playerid][LastTextSaid], 128, str);
        SendClientMessage(playerid, COLOR_YELLOW, PlayerInfo[playerid][LastTextSaid]);
    }
    return 0;
}
Reply
#3

that is the same thing that I have I am not returning onplayertext to 1. I do not want it to be displayed in the server chat.
Reply
#4

SendClientMessage doesn't display in the server chat, it sends the message to the player... wtf is wrong with you
Reply
#5

that's what I mean. it displays it to every1. wtf is wrong with you
Reply
#6

Quote:
Originally Posted by jeffery30162
Посмотреть сообщение
that's what I mean. it displays it to every1. wtf is wrong with you
Return 0 instead of 1.
Reply
#7

Try this
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strcmp(PlayerInfo[playerid][LastTextSaid], str, true) == 0)
    {
        return SendClientMessage(playerid, COLOR_RED, "YOU CANNOT SEND DUPLICATE MESSAGES");
    }
    else
    {
        SetPlayerChatBubble(playerid, str ,COLOR_WHITE,30,10000);
        format(PlayerInfo[playerid][LastTextSaid], 128, str);
        SendClientMessage(playerid, COLOR_YELLOW, PlayerInfo[playerid][LastTextSaid]);
    }
    return 0;
}
Reply
#8

that didnt work either\
Reply
#9

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strcmp(PlayerInfo[playerid][LastTextSaid], text, true))
    {  
         SendClientMessage(playerid, COLOR_RED, "YOU CANNOT SEND DUPLICATE MESSAGES");  
         return 0;
    }
    else
    {
        SetPlayerChatBubble(playerid, text,COLOR_WHITE,30,10000);
        format(PlayerInfo[playerid][LastTextSaid], 128, text);
        SendClientMessage(playerid, COLOR_YELLOW, PlayerInfo[playerid][LastTextSaid]);
        return 0;
    }
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)