Temperature
#4

Quote:
Originally Posted by iulicxd
Посмотреть сообщение
Код:
new Float:Temperature[MAX_PLAYERS];
OnPlayerConnect & OnPlayerDisconnect:
Код:
Temperature[playerid] = 36.6;
Timer one second:
Код:
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);
			 }
	    }
	}
REPEAT:TEXTDRAW show correctly temperature but problem is that message not display when temperature is 31.0 and 24.0.
From what i see from your code it should pass two if conditions to make this if make condtion true.That means weather should be 8 or 16 or 20 and the variable i which is generated by random function (that generates 0 to 26 values) and then this if condition comes i hope that you dont have any other strings attached to this part.
lets do a debugging.

PHP код:
if(Weather == || Weather == 16 || Weather == 20)
    {
printf("Passed 1st if the value of weather = %d",Weather);
        new 
random(27);
        if(
== 6)
        {
                         
printf("Passed 2nd if the value of i = %d",i);
             
Temperature[playerid] -= 0.1;
             
printf("Temperature = %d",Temperature[playerid]);
             if(
Temperature[playerid] == 31SM(playerid,0x00FF00FF,"{B9BCBD}TEST");
             else if(
Temperature[playerid] == 24)
             {
                
SM(playerid,0x00FF00FF,"{B9BCBD}TEST");
                
Temperature[playerid] = 36.6;
                
SetPlayerHealth(playerid0);
             }
        }
    } 
Tell what is printing on log..
Reply


Messages In This Thread
Temperature - by iulicxd - 31.07.2016, 14:03
Re: Temperature - by SyS - 31.07.2016, 14:05
Re: Temperature - by iulicxd - 31.07.2016, 14:09
Re: Temperature - by SyS - 31.07.2016, 14:18
Re: Temperature - by iulicxd - 31.07.2016, 15:23
Re: Temperature - by SyS - 31.07.2016, 15:29

Forum Jump:


Users browsing this thread: 3 Guest(s)