06.08.2009, 21:36
This is what I would do, I made a simple function to set a string so that you don't need to use string = string;, which will give you trouble if the target string is a different size.
Now this is what I would do for an anti-repeat in OnPlayerText:
pawn Код:
stock strset(source[],destination[])
{
for(new i; i < strlen(source); i++)
{
destination[i] = source[i];
}
}
pawn Код:
new LastSentance[MAX_PLAYERS][128]; //At top of script
public OnPlayerText(playerid,text[])
{
if(strcmp(LastSentance[playerid],text,true) == 0)
{
SendClientMessage(playerid,red,"Please don't repeat yourself!");
return 0;
}
strset(text,LastSentance[playerid]);
return 1;
}