Quote:
Originally Posted by Jose_grana
[J]ulian, estube probando el codigo pero siempre me da el primer mensaje
pawn Код:
if (strcmp("/prueba", cmdtext, true, 10) == 0) { new time[2]; gettime(time[0], time[1], time[1]); if(20 > time[0] < 6) // creo que es asн, pero anda probando. { SendClientMessage(playerid, 0x002DFFFF, " Funciona");//Este mensaje da igual la hora que sea } else { SendClientMessage(playerid, 0x002DFFFF, " No funciona"); } return 1; }
Aqui mi comando de cambiar la hora
pawn Код:
if(strcmp(cmd, "/Hora", true) == 0) { if(PlayerInfo[playerid][pAdmin] < 1) { SendClientMessage(playerid, Rojo, "* No formas parte del Staff! "); return 1; } if(IsPlayerConnected(playerid)) { tmp = strtokex(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, Gris, "USO: /Hora [Tiempo del dia] (0-23)"); return 1; } new HoraActual = strval(tmp); SetWorldTime(HoraActual); format(string, sizeof(string), "* Tiempo ajustado a %d Horas.", HoraActual); SendClientMessageToAll(Blanco, string); } return 1; }
|
pawn Код:
if (strcmp("/prueba", cmdtext, true, 10) == 0)
{
new time[2];
gettime(time[0], time[1], time[1]);
if(time[0] >= 6 && time[0] <= 20) // creo que es asн, pero anda probando.
{
SendClientMessage(playerid, 0x002DFFFF, " Funciona");//Este mensaje da igual la hora que sea
}
else
{
SendClientMessage(playerid, 0x002DFFFF, " No funciona");
}
return 1;
}
asi te deberia de andar