Hello, i need a small script which stores the last message player sent in chat, and then compare it with the one he sent now, in case both are same, a message should be sent to him "do not repeat yourself".
Thanks.
cant talk, it keeps saying do not repeat yourself (message i had put into condition)
Posts: 2,593
Threads: 34
Joined: Dec 2007
pawn Код:
new pLastMsg[MAX_PLAYERS][129 char];
public OnPlayerConnect(playerid)
{
pLastMsg[playerid] = !"fghsfhdf";
return 1;
}
public OnPlayerText(playerid, text[])
{
if(!strcmp(text, pLastMsg[playerid], true))
{
//Have wrote the same message
//Do something
//return 0; to prevent sending the message
}
strpack(pLastMsg[playerid], text, sizeof(pLastMsg[]));
return 1;
}