w00t ?
#8

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.

pawn Код:
stock strset(source[],destination[])
{
    for(new i; i < strlen(source); i++)
    {
        destination[i] = source[i];
    }
}
Now this is what I would do for an anti-repeat in OnPlayerText:

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


Messages In This Thread
w00t ? - by UsaBoy91 - 06.08.2009, 17:58
Re: w00t ? - by kaisersouse - 06.08.2009, 18:06
Re: w00t ? - by UsaBoy91 - 06.08.2009, 18:14
Re: w00t ? - by UsaBoy91 - 06.08.2009, 18:33
Re: w00t ? - by kaisersouse - 06.08.2009, 18:35
Re: w00t ? - by UsaBoy91 - 06.08.2009, 18:37
Re: w00t ? - by UsaBoy91 - 06.08.2009, 20:48
Re: w00t ? - by JaTochNietDan - 06.08.2009, 21:36
Re: w00t ? - by UsaBoy91 - 07.08.2009, 09:01
Re: w00t ? - by kc - 07.08.2009, 09:03

Forum Jump:


Users browsing this thread: 1 Guest(s)