[Ajuda] Clima/Tempo
#1

pawn Код:
if(strcmp(cmd, "/tod", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /tod [Hora] [Clima (0-23)]");
                return 1;
            }
            new hour;
            hour = strval(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1337)
            {
                if(PoderosoInfo[playerid][pTrampo] < 1)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "{FFFFFF}Vocк nгo estб trabalhando! {E31919}{E31919}(/jogar)");
                    return 1;
                }
                SetWorldTime(hour);
                format(string, sizeof(string), "   O admin %s definiu a hora para %d.",sendername,hour);
                BroadCast(COLOR_GRAD1, string);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando !");
            }
        }
        return 1;
    }
Cosegui fazer para ele mudar a HORA mais n consigo para mudar o CLIMA :/ alguйm poderia me ajudar awe?
Reply
#2

pawn Код:
if(strcmp(cmd, "/tempo", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 1337)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
                return true;
            }
            if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1341)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/jogar)");
                return true;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USE: /tempo [tempo id]");
                return true;
            }
            new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            new weather;
            weather = strval(tmp);
            if(weather < 0||weather > 45) { SendClientMessage(playerid, COLOR_GREY, "   Tempo id de 0 ~ 45 !"); return true; }
            SetWeather(weather);
            SendClientMessage(playerid, COLOR_GREY, "Tempo setado!");
        }
        return true;
    }
Tente isso e me avise por favor!
Reply
#3

nгo era bem isso cara tipo queria um pra definir HORA E CLIMA tipo eu digitasse /tod [hora] [clima], Consegui colocar o clima mas ele ta entrando em conflito com a HORA tipo coloco a hora pras 21h o tempo fica 21 tbm n da pra alterar, acho que esqueci algo mais n consigo identificar, segue o cуdigo abaixo!

pawn Код:
if(strcmp(cmd, "/tod", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Use: /tod [Hora] [Clima]");
                return 1;
            }
            new hour;
            new Weather;
            hour = strval(tmp);
            Weather = strval (tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1337)
            {
                if(PoderosoInfo[playerid][pTrampo] < 1)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/jogar)");
                    return 1;
                }
                SetWorldTime(hour);
                SetWeather(Weather);
                format(string, sizeof(string), "   O admin %s definiu a hora para %d e o clima para %d.",sendername,hour,Weather);
                BroadCast(COLOR_GRAD1, string);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando !");
            }
        }
        return 1;
    }
Reply
#4

O Meu E Assim E Funciona Direitinho

PHP код:
    if(strcmp(cmd"/sethora"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /sethora [hora do dia] (0-23)");
                return 
true;
            }
            new 
hour2;
            
hour2 strval(tmp);
            if (
PlayerInfo[playerid][pAdmin] >= 2)
            {
       if(
admtrampando[playerid] < && PlayerInfo[playerid][pAdmin] != DONO)
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo estб trabalhando! (/trabalhar)");
                    return 
true;
                }
                
SetWorldTime(hour2);
                
format(stringsizeof(string), "   Tempo Definido Para %d Horas."hour2);
                
BroadCast(COLOR_GRAD1string);
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo estб autorizado a usar o comando!");
            }
        }
        return 
true;
    } 
Reply
#5

Mais ai no caso sу altera a hora :/ dai eu ja fiz o cуdigo, eu acabei o cуdigo acima mais n ta dando para por o clima pois qdo pхe a HORA o clima fica a mesma coisa :/ Tipo hora 21 o clima fica 21 tbm, segue o cуdigo abaixo dnovo!

pawn Код:
if(strcmp(cmd, "/tod", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /tod [Hora] [Clima]");
                return 1;
            }
            new hour;
            new Weather;
            hour = strval(tmp);
            Weather = strval (tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1337)
            {
                if(PoderosoInfo[playerid][pTrampo] < 1)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/jogar)");
                    return 1;
                }
                SetWorldTime(hour);
                SetWeather(Weather);
                format(string, sizeof(string), "   O admin %s definiu a hora para %d e o clima para %d.",sendername,hour,Weather);
                BroadCast(COLOR_GRAD1, string);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando !");
            }
        }
        return 1;
    }
Reply
#6

Usa o Meu Cara So Troca o /sethora por /tod ou do jeito que voce Quiser!!!!
Reply
#7

O seu no caso altera sуmente a HORA que 1 que altere a HORA e o CLIMA ex. /tod [hora] [clima], ex. hora definida para 21 clima para 45 o cуdigo q eu fiz ta certo mas quando coloco a hora o tempo sai a mesma coisa que a hora, ex do bug. coloco 21h o clima fica 21 tbm, quero poder por Hora 21 clima 12 por ex, mais errei algo n consigo descobrir se alguйm me ajudar AGRADEЗO D+!!

pawn Код:
if(strcmp(cmd, "/tod", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /tod [Hora] [Clima]");
                return 1;
            }
            new hour;
            new Weather;
            hour = strval(tmp);
            Weather = strval (tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1337)
            {
                if(PoderosoInfo[playerid][pTrampo] < 1)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/jogar)");
                    return 1;
                }
                SetWorldTime(hour);
                SetWeather(Weather);
                format(string, sizeof(string), "   O admin %s definiu a hora para %d e o clima para %d.",sendername,hour,Weather);
                BroadCast(COLOR_GRAD1, string);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando !");
            }
        }
        return 1;
    }
Reply
#8

Alguйm ai sabe??
Reply
#9

meu deus esses caras sгo dйbeis. atй eu que sou burro entendi o que ele quer e os caras ficam insistindo. pegaram comando do GM baixado da net e pensam q й isso q o cara quer.
Reply
#10

iae alguйm tem a soluзгo por favor
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)