19.10.2015, 11:35
pawn Код:
if( PVeh[ slot ][ i ][ VehicleTimer ] < TimeNow )
Example:
pawn Код:
// When you want to start the despawn timer.
PVeh[slot][i][VehicleTimer] = SetTimerEx("DespawnVehicle", DS_TIME, false, "ii", slot, i);
// When you want to cancel the despawn timer.
KillTimer(PVeh[slot][i][VehicleTimer]);
forward DespawnVehicle(slot, vehicle);
public DespawnVehicle(slot, vehicle)
{
if( PVeh[ slot ][ vehicle ][ VehicleStatus ] == 1 )
{
#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 );
return 1;
}
return 0;
}

