SA-MP Forums Archive
Better ways of doing this? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Better ways of doing this? (/showthread.php?tid=330619)



Better ways of doing this? - 2KY - 01.04.2012

pawn Code:
new
    wTicks,
    wHour, wMinute;

SetTimer("RotateTime", 1000, 1 );

stock RotateTime( )
{
    wMinute ++;
    if( wTicks == 360000 ) { wHour ++, wTicks = 0; }
    for( new i; i < MAX_PLAYERS; i ++ )
    {
        SetPlayerTime( i, wHour, wMinute );
    }
    wTicks ++;
    return true;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    new hour, minute;
    GetPlayerTime( playerid, hour, minute );
    SetPlayerTime( playerid, hour-6, minute );
    return 1;
}
Also, would this result in lag..?