#1

hola tengo un problema es que cuando uno muere el clima es de dia pero cuando muero de nuevo se pone de noche como puedo poner el clima que corra bien .
Reply
#2

Este es un codigo que encontrй en la wiki de SA:MP, espero que te sirva

pawn Код:
//Example to sync time between players
 
 
static i_ServerSeconds;
static i_ServerMinutes;
static i_ServerHours;
 
forward ProcessGameTime();
 
public OnGameModeInit()
{
    SetTimer("ProcessGameTime", 1000, 1);
}
 
public ProcessGameTime()
{
    i_ServerSeconds++;
 
    // One minute has passed...
    if(i_ServerSeconds == 60)
    {
        // Reset the second counter
        i_ServerSeconds = 0;
 
        // Increment the minute counter
        i_ServerMinutes++;
 
        // One hour has passed
        if(i_ServerMinutes == 60)
        {
            i_ServerMinutes = 0;
            i_ServerHours++;
 
            if(i_ServerHours == 24)
            {
                // One day has passed
                i_ServerHours = 0;
            }
        }
    }
}
 
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    UpdatePlayerTime(playerid);
}
 
 
stock UpdatePlayerTime(playerid)
{
    SetPlayerTime(playerid, i_ServerHours, i_ServerMinutes);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)