31.07.2016, 14:18
Quote:
Код:
new Float:Temperature[MAX_PLAYERS]; Код:
Temperature[playerid] = 36.6; Код:
new temperature[128]; format(temperature,sizeof(temperature),"Temperature:%0.1f",Temperature[playerid]); PlayerTextDrawSetString(playerid, HudTD[playerid][2], temperature); if(Weather == 8 || Weather == 16 || Weather == 20) { new i = random(27); if(i == 6) { Temperature[playerid] -= 0.1; if(Temperature[playerid] == 31) SM(playerid,0x00FF00FF,"{B9BCBD}TEST"); else if(Temperature[playerid] == 24) { SM(playerid,0x00FF00FF,"{B9BCBD}TEST"); Temperature[playerid] = 36.6; SetPlayerHealth(playerid, 0); } } } |
lets do a debugging.
PHP код:
if(Weather == 8 || Weather == 16 || Weather == 20)
{
printf("Passed 1st if the value of weather = %d",Weather);
new i = random(27);
if(i == 6)
{
printf("Passed 2nd if the value of i = %d",i);
Temperature[playerid] -= 0.1;
printf("Temperature = %d",Temperature[playerid]);
if(Temperature[playerid] == 31) SM(playerid,0x00FF00FF,"{B9BCBD}TEST");
else if(Temperature[playerid] == 24)
{
SM(playerid,0x00FF00FF,"{B9BCBD}TEST");
Temperature[playerid] = 36.6;
SetPlayerHealth(playerid, 0);
}
}
}