[Ajuda]Proibir numeros
#3

pawn Код:
if(strcmp(cmd, "/anuncio", true) == 0 || strcmp(cmd, "/an", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк precisa se logar primeiro !");
                return 1;
            }
            if(PlayerInfo[playerid][pLevel] < 2)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк precisa ter nнvel 2 para usar essa funзгo !");
                return 1;
            }
                 if(IsNumeric(result))
{
SendClientMessage(playerid, COLOR_GREY, "   Sem Numeros Filho da Puta !");
                return 1;

}
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: (/an)uncio [texto]");
                return 1;
            }

            if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
            {
                format(string, sizeof(string), "   Por favor, tente novamente mais tarde, espere %d segundos entre os anъncios !",  (addtimer/1000));
                SendClientMessage(playerid, COLOR_GRAD2, string);
                return 1;

            }
            new payout = idx * 5;
            if(GetPlayerMoney(playerid) < payout)
            {
                format(string, sizeof(string), "* Vocк usou %d caracteres que custam $%d, vocк nгo tem dinheiro suficiente.", offset, payout);
                SendClientMessage(playerid, COLOR_WHITE, string);
                return 1;
            }
            SafeGivePlayerMoney(playerid, - payout);
            SBizzInfo[7][sbTill] += payout;
            ExtortionSBiz(7, payout);
            format(string, sizeof(string), "Anъncio: %s, Contato: %s Tel: %d",result, sendername, PlayerInfo[playerid][pPnumber]);
            OOCNews(TEAM_GROVE_COLOR,string);
            format(string, sizeof(string), "~r~Pagou $%d~n~~w~O Anъncio contйm: %d caracteres", payout, idx);
            GameTextForPlayer(playerid, string, 5000, 1);
            if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
        }
        return 1;
    }
Final GM:
pawn Код:
stock IsNumeric(const string[]) {
    new length=strlen(string);
    if (length==0) return false;
    for (new i = 0; i < length; i++) {
        if (
        (string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+')
        || (string[i]=='-' && i!=0)                                             //
        || (string[i]=='+' && i!=0)                                             //
        ) return false;
    }
    if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
    return true;
}
Reply


Messages In This Thread
[Ajuda]Proibir numeros - by keller012 - 08.07.2010, 15:56
Re: [Ajuda]Proibir numeros - by keller012 - 08.07.2010, 21:30
Re: [Ajuda]Proibir numeros - by ipsBruno - 08.07.2010, 21:54
Re: [Ajuda]Proibir numeros - by keller012 - 08.07.2010, 22:02
Re: [Ajuda]Proibir numeros - by keller012 - 08.07.2010, 22:24
Re: [Ajuda]Proibir numeros - by GTA.Drifter - 16.09.2010, 01:22
Re: [Ajuda]Proibir numeros - by keller012 - 16.09.2010, 01:57
Re: [Ajuda]Proibir numeros - by Canabis - 16.09.2010, 09:50
Re: [Ajuda]Proibir numeros - by TiagoPS - 16.09.2010, 13:23

Forum Jump:


Users browsing this thread: 1 Guest(s)