#3

Depende lo que quieres hacer. Si es algo bien basico, puedes hacer algo asi:
pawn Код:
public OnPlayerText(playerid, text[])
{
    for(new i, j=strlen(text); i<j; i++)
        if('0' <= text[i] <= '9')
            text[i] = '*';
    return 1;
}
Si buscas algo mas avanzado entonces podrias hacer algo asi:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new nums, dots, ddots, len;
    len = strlen(text);
    for(new i; i<len; i++)
    {
        if('0' <= text[i] <= '9')
            nums++;
        else if(text[i] == '.')
            dots++;
        else if(text[i] == ':')
            ddots++;
    }
    if(nums > 7 && dots > 2 && ddots > 0)
        for(new i; i<len; i++)
            if('0' <= text[i] <= '9')
                text[i] = '*';
    return 1;
}
Reply


Messages In This Thread
CHAT - by Parka - 16.08.2012, 17:13
Respuesta: CHAT - by Fede.Zink - 16.08.2012, 17:35
Respuesta: CHAT - by TheChaoz - 17.08.2012, 01:44
Respuesta: CHAT - by Parka - 17.08.2012, 02:12
Respuesta: CHAT - by Bu11Sh0t - 17.08.2012, 02:20
Respuesta: CHAT - by TheChaoz - 17.08.2012, 02:21
Respuesta: CHAT - by Parka - 17.08.2012, 02:27
Respuesta: CHAT - by OTACON - 17.08.2012, 04:58

Forum Jump:


Users browsing this thread: 3 Guest(s)