💻
pasteware
  • Introduction
  • Namespaces
    • engine_client
    • global_vars
    • renderer
    • config
    • math
    • input
    • cheat
  • Hooks
    • CreateMove
    • PaintTraverse
    • FrameStageNotify
  • Types
    • CUserCmd
    • ang_t
    • vec3_t
    • vec2_t
    • color_t
Powered by GitBook
On this page
  • random_int( min, max ): int
  • random_float( min, max ): float
  • ticks_to_time( ticks ): float
  • time_to_ticks( time ): int

Was this helpful?

  1. Namespaces

math

random_int( min, max ): int

Returns a random integer between the two given numbers

Type

Name

Description

int

min

The minimum number that can be generated

int

max

The maximum number that can be generated

print( math.random_int( 5, 10 ) );

random_float( min, max ): float

Returns a random float between the two given numbers

Type

Name

Description

float

min

The minimum number that can be generated

float

max

The maximum number that can be generated

print( math.random_float( 3.25, 9.92 ) );

ticks_to_time( ticks ): float

Converts game ticks into time

Type

Name

Description

int

ticks

The amount of game ticks to convert to time

print( math.ticks_to_time( 64 ) );

time_to_ticks( time ): int

Converts time into game ticks

Type

Name

Description

float

time

The amount of time to convert to game ticks

print( math.time_to_ticks( 1.0 ) );
PreviousconfigNextinput

Last updated 4 years ago

Was this helpful?