[Ajuda]Comando
#1

Meu comando nao ta setando "tempo" para o id do comando

pawn Код:
if(strcmp(cmd,"/BanirTempo", true)==0)
{
    new
    aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
        if(IsPlayerAdmin(playerid))
        {
            new
            id,
            tempo,
            tmp[256];
            tmp = strtok(cmdtext, idx);
            id = strval(tmp);
            tmp = strtok(cmdtext, idx);
            tempo = strval(tmp);
               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, Vermelho, "(ERRO) Vocк sу pode banir com uma razгo apropriada.");
                   return 1;
               }
               if(!strlen(tmp))
               {
                   SendClientMessage(playerid, Vermelho, "[>] Digite: /BanirTempo [Id] [Tempo]");
                   return 1;
               }
               if(!strlen(tmp))
               {
                   SendClientMessage(playerid, Vermelho, "[>] /BanirTempo [Id] [Tempo]");
                   return 1;
               }
               if(tempo >= 200)
               {
                   SendClientMessage(playerid, Vermelho, "[>] O Tempo maximo й 500 min");
                   return 1;
               }
               new idname[MAX_PLAYER_NAME];
               GetPlayerName(id, idname, MAX_PLAYER_NAME);
               format(file2, sizeof(file2), PASTA_CONTAS, idname);
               if(IsPlayerConnected(id))
               {
                   if(tempo >= 1)
                   {
                       dini_IntSet(file2, "minutosbanidos", tempo);
                       format(string, sizeof(string), "O Adminstrador %s [ID: %d] Baniu Temporariamente o Jogador %s, por: %d minutos (Motivo: %s)", aname, playerid, idname ,tempo ,result);
                       SendClientMessageToAll(0x11B1FFAA, string);
                   }
               }
               else
               {
                   SendClientMessage(playerid, Vermelho, "(ERRO) Jogador nгo conectado.");
                   return 1;
               }
        }
}
Reply


Messages In This Thread
[Ajuda]Comando - by DrTHE - 22.12.2011, 11:17
Re: [Ajuda]Comando - by rjjj - 22.12.2011, 11:34

Forum Jump:


Users browsing this thread: 1 Guest(s)