Quote:
Originally Posted by the_chaoz
1є q nada ese codigo se esta ejecutando?
2є si quieres sacarle 10.0 de vida debes utilizar algo asi:
pawn Код:
new Float:Health = GetPlayerHealth(playerid); SetPlayerHealth(playerid, Health-10.0);
|
Se esta ejecutando, me da todo "pawn compiler" pero la funcion no anda :S
Tengo todo asн:
pawn Код:
public Clock(playerid)
{
new string[256];
new string2[256];
new year, month, day;
new hour, minute, second;
getdate(year, month, day);
gettime(hour,minute,second);
new mtext[20];
getdate(year, month, day);
if(month == 1) { mtext = "Enero"; }
else if(month == 2) { mtext = "Febrero"; }
else if(month == 3) { mtext = "Marzo"; }
else if(month == 4) { mtext = "Abril"; }
else if(month == 5) { mtext = "Mayo"; }
else if(month == 6) { mtext = "Junio"; }
else if(month == 7) { mtext = "Julio"; }
else if(month == 8) { mtext = "Augosto"; }
else if(month == 9) { mtext = "Septiembre"; }
else if(month == 10) { mtext = "Octubre"; }
else if(month == 11) { mtext = "Noviembre"; }
else if(month == 12) { mtext = "Diciembre"; }
format(string, sizeof(string), "%d %s, %d", day, mtext, year);
TextDrawSetString(Text:Textdraw99, string);
format(string2, sizeof(string2), "%d:%d:%d", hour, minute, second);
TextDrawSetString(Text:Textdraw88, string2);
if(hour == 6 && minute == 0 && second == 0 && hour == 7 && minute == 0 && second == 0) { SetWeather(1); return 1;} // 6:00 y 7:00 Horas
else if(hour == 8 && minute == 0 && second == 0) { SetWorldTime(8); SetWeather(1); SendClientMessageToAll(COLOR_WHITE,"SERVER: ЎEl gallo canta! Una nueva jornada comienza!. ЎQue tengas un buen dнa!"); return 1;}//8:00 Horas
else if(hour == 9 && minute == 0 && second == 0 && hour == 10 && minute == 0 && second == 0) { SetWeather(2); return 1;} // 9:00 y 10:00 Horas
else if(hour == 11 && minute == 0 && second == 0 && hour == 12 && minute == 0 && second == 0) { SetWeather(3); return 1;} // 11:00 y 12:00 Horas
else if(hour == 13 && minute == 0 && second == 0) { SetWeather(4); return 1;} // 13:00 Horas
else if(hour == 14 && minute == 0 && second == 0) { SetWorldTime(14); SetWeather(4); SendClientMessageToAll(COLOR_WHITE,"SERVER: ЎUuuy! que Hambre... es un buen momento para ir a comer algo."); SendClientMessageToAll(COLOR_WHITE,"** Empiezas a tener hambre, come algo."); JugadorHambre[playerid] = 0; SetTimer("TienesHambre", 1000, false); return 1;}// 14:00 Horas
else if(hour == 15 && minute == 0 && second == 0 && hour == 16 && minute == 0 && second == 0) { SetWeather(7); return 1;}// 15:00 y 16:00 Horas
else if(hour == 17 && minute == 0 && second == 0 && hour == 18 && minute == 0 && second == 0) { SetWeather(15); return 1;}// 17:00 y 18:00 Horas
else if(hour == 19 && minute == 0 && second == 0) { SetWeather(17); return 1;}// 19:00 Horas
else if(hour == 20 && minute == 45 && second == 0) { SetWorldTime(23); SetWeather(5); SendClientMessageToAll(COLOR_WHITE,"SERVER: La jornada del dia termina, reunete con tu familia y disfruta una rica cena"); return 1;}// 20:45 Horas
else if(hour == 21 && minute == 0 && second == 0) { SetWeather(35); return 1;}// 21:00 Horas
else if(hour == 22 && minute == 0 && second == 0) { SetWorldTime(0); SetWeather(20); SendClientMessageToAll(COLOR_WHITE,"SERVER: Ya es tarde, ve a descansar. Recuerda que andar solo por la noche es peligroso."); return 1;}// 22:00 Horas
else if(hour == 23 && minute == 0 && second == 0 && hour == 0 && minute == 0 && second == 0 && hour == 1 && minute == 0 && second == 0 && hour == 2 && minute == 0 && second == 0 && hour == 3 && minute == 0 && second == 0 && hour == 4 && minute == 0 && second == 0 && hour == 5 && minute == 0 && second == 0) { SetWeather(38); return 1;}
return 1;
}
public TienesHambre(playerid)
{
if(IsPlayerConnected(playerid))
{
new Float:health;
GetPlayerHealth(playerid, health);
if(JugadorHambre[playerid] != 0)
{
if(health < 80) {
SetPlayerHealth(playerid, health - 10.0);
SendClientMessage(playerid, COLOR_WHITE,"** Tienes demasiada hambre, empiezas a perder fuerza y eres propenso a un desmayo.");
SetTimer("TienesHambre1", 180000, true);
return 1;
}
}
}
return 1;
}
public TienesHambre1(playerid)
{
if(IsPlayerConnected(playerid))
{
if(JugadorHambre[playerid] != 0)
{
SendClientMessage(playerid, COLOR_WHITE,"** Te has desmayado por falta de comida.");
ApplyAnimation(playerid,"CRACK","crckdeth2",4.0,0,0,0,1,1);
TogglePlayerControllable(playerid,false);
return 1;
}
}
return 1;
}
El:
pawn Код:
SetTimer("TienesHambre", 1000, false);
Lo tengo en un segundo solo para testear, y no esperar 30 minutos que seria medio garron para testear jeje