GetTickCount() it's buggy?
#1

Hello guys, I'm trying to use GetTickCount() with a dealearship system on my server but i have some problems.

pawn Код:
#define DS_TIME 60000 // 1 Minute in miliseconds

// I'm using this when the player left his vehicle
PVeh[ slot ][ playerid ][ VehicleTimer ] = GetTickCount( ) + DS_TIME;

// All good but the car it's despawned right after the player left his vehicle...

// In this 1 second timer i'm checking if that 1 minute has been passed
public CheckCar( ) // It's runing once per seccond
{
    new TimeNow = GetTickCount( );

    foreach( Player, i )
    {
        if( GetPersonalVehiclesNumber( i ) > 0 )
        {
            for( new slot=0; slot<MAX_SLOTS; slot++ )
            {
                if( PVeh[ slot ][ i ][ VehicleStatus ] == 1 )
                {
                    if( PVeh[ slot ][ i ][ VehicleTimer ] - TimeNow < DS_TIME )
                    {
                        #if defined DEBUG
                            printf( "Vehicle[slot:%d] has been despanwned(C:%d / D:%d)", slot, GetTickCount( ), PVeh[ slot ][ i ][ VehicleTimer ] );
                        #endif
                        DeSpawnPlayerVehicle( slot, i );
                        InfoTD_MSG( i, 7000, "~r~~h~Personal Vehicle~n~~w~~h~Your ~g~~h~%s(%d) ~w~~h~has been despawned~n~~y~~h~Reason: ~w~~h~1 minute out of activity", VehicleNames[ PVeh[ slot ][ i ][ VehicleModelID ] - 400 ], slot );
                    }
                }
            }
        }
    }
}
Reply


Messages In This Thread
GetTickCount() it's buggy? - by nGen.SoNNy - 19.10.2015, 11:14
Re: GetTickCount() it's buggy? - by Threshold - 19.10.2015, 11:35
Re: GetTickCount() it's buggy? - by nGen.SoNNy - 19.10.2015, 12:10
Re: GetTickCount() it's buggy? - by Threshold - 19.10.2015, 13:53
Re: GetTickCount() it's buggy? - by PrO.GameR - 19.10.2015, 13:54
Re: GetTickCount() it's buggy? - by nGen.SoNNy - 19.10.2015, 14:07
Re: GetTickCount() it's buggy? - by PrO.GameR - 19.10.2015, 22:13
Re: GetTickCount() it's buggy? - by nGen.SoNNy - 19.10.2015, 22:26
Re: GetTickCount() it's buggy? - by PrO.GameR - 19.10.2015, 22:38
Re: GetTickCount() it's buggy? - by Threshold - 20.10.2015, 01:56

Forum Jump:


Users browsing this thread: 1 Guest(s)