SA-MP Forums Archive
on player text issue - 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: on player text issue (/showthread.php?tid=522544)



on player text issue - jeffery30162 - 28.06.2014

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]);
	}



Re: on player text issue - Jack_Leslie - 28.06.2014

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;
}



Re: on player text issue - jeffery30162 - 28.06.2014

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.


Re: on player text issue - Jack_Leslie - 28.06.2014

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


Re: on player text issue - jeffery30162 - 28.06.2014

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


Re: on player text issue - Jack_Leslie - 28.06.2014

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.


Re: on player text issue - awsomedude - 28.06.2014

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;
}



Re: on player text issue - jeffery30162 - 29.06.2014

that didnt work either\


Re: on player text issue - AroseKhanNiazi - 29.06.2014

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;
    }
}