└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # onetapapi 2 | 3 | 4 | |Contents| 5 | |--------| 6 | |[Globals](#0)| 7 | |[UI](#1)| 8 | |[Entity](#2)| 9 | |[Render](#3)| 10 | |[Convar](#4)| 11 | |[Event](#5)| 12 | |[Trace](#6)| 13 | |[User CMD](#7)| 14 | |[Sound](#8)| 15 | |[Local](#9)| 16 | |[Cheat](#q)| 17 | |[Input](#w)| 18 | |[World](#e)| 19 | |[AntiAim](#r)| 20 | |[Exploit](#a)| 21 | |[RageBot](#s)| 22 | |[Material](#d)| 23 | 24 | --- 25 | 26 | ## Globals 27 | |-------------------------------| 28 | 29 | **IN OT V3 CRACK NOT WORKS** [ **ChokedCommands** ] 30 | Syntax: Globals.ChokedCommands() 31 | **Returns** amount of choked commands. 32 | ```java 33 | function choked_commands() 34 | { 35 | var choked = Globals.ChokedCommands(); 36 | Cheat.Print(choked+'\n'); 37 | 38 | } 39 | Cheat.RegisterCallback("CreateMove", "choked_commands") 40 | ``` 41 | 42 | [ **REALTIME** ] 43 | Syntax: Globals.Realtime() 44 | **Returns** time in seconds since CS:GO was started. 45 | ```java 46 | realtime = Globals.Realtime(); 47 | ``` 48 | 49 | [ **FRAMETIME** ] 50 | Syntax: Globals.Frametime() 51 | **Returns** time in seconds it took to render the frame. 52 | ```java 53 | frametime = Globals.Frametime(); 54 | ``` 55 | 56 | [ **CURTIME** ] 57 | Syntax: Globals.Curtime() 58 | **Returns** the game time in seconds. 59 | ```java 60 | var curTime = Globals.Curtime(); 61 | Cheat.Print("Current game time in seconds: " + curTime); 62 | ``` 63 | [ **TICKINTERVAL** ] 64 | Syntax: Globals.TickInterval() 65 | **Returns** the game time in seconds. 66 | ```java 67 | var tickInterval = Globals.TickInterval(); 68 | Cheat.Print("Tick interval: " + tickInterval); 69 | ``` 70 | 71 | [ **TICKRATE** ] 72 | Syntax: Globals.Tickrate() 73 | **Returns** server tick settings, usually 64 or 128. 74 | ```java 75 | var tickrate = Globals.Tickrate(); 76 | Cheat.Print("Server tickrate: " + tickrate); 77 | ``` 78 | [ **TICKCOUNT** ] 79 | Syntax: Globals.Tickcount() 80 | **Returns** amount of ticks elapsed on the server. 81 | ```java 82 | var tickcount = Globals.Tickcount(); 83 | Cheat.Print("Ticks elapsed on server: " + tickcount); 84 | ``` 85 | 86 | [ **TICKCOUNT** ] 87 | Syntax: Globals.FrameStage() 88 | Used to get current frame stage 89 | 90 | **Returns** 91 | 0 = FRAME_START 92 | 1 = FRAME_NET_UPDATE_START 93 | 2 = FRAME_NET_UPDATE_POSTDATAUPDATE_START 94 | 3 = FRAME_NET_UPDATE_POSTDATAUPDATE_END 95 | 4 = FRAME_NET_UPDATE_END 96 | 5 = FRAME_RENDER_START 97 | 6 = FRAME_RENDER_END 98 | 99 | ```java 100 | var current_stage = Globals.FrameStage(); 101 | Cheat.Print(current_stage); 102 | // Prints current stage. 103 | ``` 104 | 105 | [back to Contents](#-1) 106 | 107 | ## UI 108 | |-------------------------------| 109 | 110 | [ **ADDLABEL** ] 111 | string text. 112 | ```java 113 | UI.AddLabel("Test"); 114 | ``` 115 | 116 | [ **TOGGLEHOTKEY** ] 117 | Syntax: UI.ToggleHotkey(...item) 118 | Can be used to toggle a hotkey or simulate key press. 119 | **Return Values:** 1 is key is active, 0 if the key is inactive 120 | ```java 121 | UI.ToggleHotkey("Rage", "GENERAL", "Exploits", "Doubletap"); 122 | function toggleDoubletap() 123 | { 124 | 125 | var isKeyActive = UI.IsHotkeyActive( "Rage", "GENERAL", "Exploits", "Doubletap" ); 126 | Cheat.Print( "Key is: " + isKeyActive + "\n"); 127 | 128 | } 129 | Global.RegisterCallback("CreateMove", "toggleDoubletap"); 130 | ``` 131 | 132 | [ **ADDTEXTBOX** ] 133 | Syntax: UI.AddTextbox("string") 134 | Adds a textbox in which you can input text and read it later on. 135 | **Returns** an array of strings. 136 | ```java 137 | var textbox; 138 | 139 | function test( ) { 140 | var test = UI.GetString.apply( this, textbox ); 141 | 142 | Cheat.Print( test + "\n" ); 143 | } 144 | 145 | function init( ) { 146 | checkbox = UI.AddTextbox( "Test" ); 147 | Cheat.RegisterCallback( "Draw", "test" ); 148 | } 149 | 150 | init( ); 151 | ``` 152 | 153 | [ **SETCOLOR** ] 154 | Syntax: UI.SetColor(...item) 155 | Used to set precise RGBA color codes in color picker. 156 | ```java 157 | function HSVtoRGB(h, s, v) { 158 | var r, g, b, i, f, p, q, t; 159 | if (arguments.length === 1) { 160 | s = h.s, v = h.v, h = h.h; 161 | } 162 | i = Math.floor(h * 6); 163 | f = h * 6 - i; 164 | p = v * (1 - s); 165 | q = v * (1 - f * s); 166 | t = v * (1 - (1 - f) * s); 167 | switch (i % 6) { 168 | case 0: r = v, g = t, b = p; break; 169 | case 1: r = q, g = v, b = p; break; 170 | case 2: r = p, g = v, b = t; break; 171 | case 3: r = p, g = q, b = v; break; 172 | case 4: r = t, g = p, b = v; break; 173 | case 5: r = v, g = p, b = q; break; 174 | } 175 | return { 176 | r: Math.round(r * 255), 177 | g: Math.round(g * 255), 178 | b: Math.round(b * 255) 179 | }; 180 | } 181 | 182 | function rainbowColors( ) 183 | { 184 | tickcount = Globals.Tickcount(); 185 | color = HSVtoRGB(tickcount % 350 / 350, 1, 1, 1, 255); 186 | UI.SetColor("Visual", "ENEMIES", "ESP", "Glow", [color.r, color.g, color.b, 255]); 187 | 188 | } 189 | Cheat.RegisterCallback("Draw", "rainbowColors"); 190 | ``` 191 | 192 | 193 | [ **ADDCOLORPICKER** ] 194 | Syntax: UI.AddColorPicker(string name) 195 | Adds a color picker. 196 | ```java 197 | colorpicker = UI.AddColorPicker("example"); 198 | ``` 199 | 200 | [ **ADDMULTIDROPDOWN** ] 201 | Syntax: UI.AddMultiDropdown(name, items) 202 | Will create a dropdown in which you can select more items under Misc - JAVASCRIPT - Script items. 203 | ```java 204 | UI.AddMultiDropdown( "Test", [ "one", "two", "three", "four" ] ); 205 | ``` 206 | 207 | [ **ISMENUOPEN** ] 208 | Syntax: UI.IsMenuOpen() 209 | **Returns** true if the menu is open, false otherwise. 210 | ```java 211 | if (UI.IsMenuOpen( ) == true) 212 | { 213 | Cheat.Print("Menu is open"); 214 | } 215 | ``` 216 | 217 | [ **ADDDROPDOWN** ] 218 | Syntax: UI.AddHotkey(name) 219 | Will create a dropdown with items under Misc - JAVASCRIPT - Script items. 220 | ```java 221 | UI.AddDropdown( "Test", [ "one", "two", "three", "four" ] ); 222 | ``` 223 | 224 | [ **ADDHOTKEY** ] 225 | Syntax: UI.AddHotkey(name) 226 | Create a label with a key picker control under Misc - JAVASCRIPT - Script items. 227 | ```java 228 | UI.AddHotkey( "Test" ); 229 | ``` 230 | 231 | [ **ADDSLIDERFLOAT** ] 232 | Syntax: UI.AddSliderFloat(name, min_value, max_value) 233 | Create a floating point slider under Misc - JAVASCRIPT - Script items. 234 | ```java 235 | UI.AddSliderFloat( "Test", 0.0, 2.5 ); 236 | ``` 237 | 238 | [ **ADDSLIDERINT** ] 239 | Syntax: UI.AddSliderInt(name, min_value, max_value) 240 | Create a integer slider under Misc - JAVASCRIPT - Script items. 241 | ```java 242 | UI.AddSliderInt( "Test", 0, 100 ); 243 | ``` 244 | 245 | [ **ADDCHECKBOX** ] 246 | Syntax: UI.AddSliderInt(name, min_value, max_value) 247 | Create a checkbox control under Misc - JAVASCRIPT - Script items. 248 | ```java 249 | UI.AddCheckbox( "Test" ); 250 | ``` 251 | 252 | [ **ISHOTKEYACTIVE** ] 253 | Syntax: UI.AddSliderInt(name, min_value, max_value) 254 | Can be used to determine whether or not hotkey is active. 255 | **Return values** undefined if an item could not be found, or if the item doesn't contain a key picker; otherwise 1 if the key is active, 0 if the key is inactive. 256 | ```java 257 | function isKeyActive() 258 | { 259 | var isKeyActive = UI.IsHotkeyActive( "Legit", "GENERAL", "General", "Enabled" ); 260 | Cheat.Print( "Key is: " + isKeyActive + "\n" ); 261 | // Above line will print 0 or 1 depending whether the hotkey is active or not. 262 | } 263 | ``` 264 | 265 | [ **GETCOLOR** ] 266 | Syntax: UI.GetColor(...item) 267 | Can be used to get precise RGBA color codes from color picker. 268 | **Return values** undefined if an item could not be found, or if the item doesn't contain a color picker 269 | ```java 270 | function ammoColor() 271 | { 272 | var ammo_color = UI.GetColor( "Visuals", "SELF", "ESP", "Ammo" ); 273 | Cheat.Print( "Ammo color is: " + ammo_color + "\n" ); 274 | // Above line will print RGBA value of ammo color picker. 275 | } 276 | ``` 277 | 278 | [ **GETSTRING** ] 279 | Syntax: UI.GetString (...item) 280 | **Returns** a string representation of an item's current value. 281 | 282 | UI item searches are not explicit: the search will return the first found item. This means that **UI.GetValue( "Legit", "Triggerbot", "Enabled" )** will return the same value as **UI.GetValue( "Legit", "GENERAL", "Triggerbot", "Enabled" ). ** 283 | 284 | All script-added items are located in a groupbox within the misc tab, under javascript group called "Script items". Searching for ( "Script Items", *item name* ) is certain to return a script control. 285 | ```java 286 | function hitboxesEnabled() 287 | { 288 | var hb = UI.GetString( "Legit", "GENERAL", "Default config", "Hitboxes" ); 289 | Cheat.Print( "enabled hitboxes: " + hb + "\n" ); 290 | // Above line will print enabled hitboxes in default legit config into in-game console when this script is loaded. 291 | } 292 | ``` 293 | 294 | [ **SETENABLED** ] 295 | Syntax: UI.SetEnabled (...item) 296 | Changes menu item(s) visibility. 297 | 298 | UI item searches are not explicit: the search will return the first found item. This means that **UI.GetValue( "Legit", "Triggerbot", "Enabled" )** will return the same value as **UI.GetValue( "Legit", "GENERAL", "Triggerbot", "Enabled" )**. 299 | 300 | All script-added items are located in a groupbox within the misc tab, under javascript group called "Script items". Searching for ( "Script Items", *item name* ) is certain to return a script control. 301 | UI.SetEnabled does not work on tabs/subtabs. 302 | 303 | 304 | ```java 305 | function hideTriggerbotCheckbox() 306 | { 307 | UI.SetEnabled( "Legit", "GENERAL", "Triggerbot", "Enabled", false ); 308 | // Above line will hide the triggerbot "Enabled" checkbox however, its value can still be changed and accessed. 309 | } 310 | ``` 311 | 312 | [ **SETVALUE** ] 313 | Syntax: UI.SetValue (...item, value) 314 | Sets the value of an UI item's setting. 315 | **Return values** undefined if an item could not be found, setting value otherwise 316 | UI item searches are not explicit: the search will return the first found item. This means that **UI.GetValue( "Legit", "Triggerbot", "Enabled" )** will return the same value as **UI.GetValue( "Legit", "GENERAL", "Triggerbot", "Enabled" ). ** 317 | 318 | All script-added items are located in a groupbox within the misc tab, under javascript group called "Script items". Searching for ( "Script Items", *item name* ) is certain to return a script control. 319 | 320 | ```java 321 | function enableMagnet() 322 | { 323 | UI.SetValue( "Legit", "GENERAL", "Triggerbot", "Magnet", true ); 324 | UI.SetValue( "Legit", "GENERAL", "General", "Reaction time", 0.2 ); 325 | } 326 | // This function will enable triggerbot magnet option and set aimbot reaction time to 0.2 327 | ``` 328 | 329 | [ **GETVALUE** ] 330 | Syntax: UI.GetValue (...item) 331 | Returns the value of UI item's setting. 332 | 333 | UI item searches are not explicit: the search will return the first found item. This means that **UI.GetValue( "Legit", "Triggerbot", "Enabled" )** will return the same value as **UI.GetValue( "Legit", "GENERAL", "Triggerbot", "Enabled" )**. 334 | 335 | All script-added items are located in a groupbox within the misc tab, under javascript group called "Script items". Searching for ( "Script Items", *item name* ) is certain to return a script control. 336 | ```java 337 | function enableMagnet() 338 | { 339 | UI.SetValue( "Legit", "GENERAL", "Triggerbot", "Magnet", true ); 340 | UI.SetValue( "Legit", "GENERAL", "General", "Reaction time", 0.2 ); 341 | } 342 | // This function will enable triggerbot magnet option and set aimbot reaction time to 0.2 343 | ``` 344 | 345 | [back to Contents](#-1) 346 | 347 | 348 | ## Entity 349 | |-------------------------------| 350 | 351 | [ **GETRENDERBOX** ] 352 | Syntax: Entity.GetRenderBox(entity_index) 353 | **Returns** an array object with state (valid/invalid), min X, min Y, max X, max Y 354 | ```java 355 | var target = 0 356 | function onCM(){ 357 | target = Ragebot.GetTarget() 358 | } 359 | function onDraw(){ 360 | var pos = Entity.GetRenderBox(target) 361 | var font = Render.AddFont("Verdana", 8, 400) 362 | var a = pos[3] - pos[1] 363 | a /= 2 364 | a += pos[1] 365 | Render.StringCustom(a,pos[2] - 30,1,"TARGET", [255,255,255,255], font) 366 | } 367 | Cheat.RegisterCallback("CreateMove", "onCM") 368 | Cheat.RegisterCallback("Draw", "onDraw") 369 | ``` 370 | 371 | [ **GETWEAPONS** ] 372 | Syntax: Entity.GetWeapons( entity_index ) 373 | **Returns** an array of weapons of the entity. 374 | ```java 375 | localplayer_weapons = Entity.GetWeapons(Entity.GetLocalPlayer()) 376 | ``` 377 | 378 | 379 | [ **GETENTITIESBYCLASSID** ] 380 | Syntax: Entity.GetEntitiesByClassID( int classid ) 381 | **Returns** entities of given Class ID. 382 | ```java 383 | entities = Entity.GetEntities(); 384 | cEnt = Entity.GetEntitiesByClassID(131); 385 | for ( i = 0; i < cEnt.length; i++) 386 | { 387 | cName = Entity.GetName(cEnt[i]); 388 | 389 | Cheat.Print("Entity class: " + cName + "\n"); 390 | ``` 391 | 392 | 393 | [ **GETHITBOXPOSITION** ] 394 | Syntax: Entity.GetHitboxPosition(int ent_index, int hitbox_index) 395 | **Returns** an array object with X, Y, Z for hitbox position. 396 | 397 | **Hitbox indexes:** 398 | HITBOX_HEAD = 0 399 | HITBOX_NECK = 1 400 | HITBOX_PELVIS = 2 401 | HITBOX_BODY = 3 402 | HITBOX_THORAX = 4 403 | HITBOX_CHEST = 5 404 | HITBOX_UPPER_CHEST = 6 405 | HITBOX_LEFT_THIGH = 7 406 | HITBOX_RIGHT_THIGH = 8 407 | HITBOX_LEFT_CALF = 9 408 | HITBOX_RIGHT_CALF = 10 409 | HITBOX_LEFT_FOOT = 11 410 | HITBOX_RIGHT_FOOT = 12 411 | HITBOX_LEFT_HAND = 13 412 | HITBOX_RIGHT_HAND = 14 413 | HITBOX_LEFT_UPPER_ARM = 15 414 | HITBOX_LEFT_FOREARM = 16 415 | HITBOX_RIGHT_UPPER_ARM = 17 416 | HITBOX_RIGHT_FOREARM = 18 417 | 418 | ```java 419 | enemies = Entity.GetEnemies(); 420 | for (i=0; iRENDER 805 | |-------------------------------| 806 | 807 | [ **FILLEDCIRCLE** ] 808 | Syntax:Render.FilledCircle(x, y, r, color) 809 | Draws a filled circle with the given position, radius, and RGBA color. 810 | **Returns** true on success or false on failure. 811 | ```java 812 | function drawCircle() 813 | { 814 | Render.FilledCircle( 150, 150, 50, [ 255, 255, 255, 255 ] ); 815 | } 816 | 817 | Cheat.RegisterCallback("Draw", "drawCircle") 818 | // This function will draw filled circle on screen. 819 | ``` 820 | 821 | [ **TEXTUREDRECT** ] 822 | Syntax:Render.TexturedRect( x, y, width, height, texture ); 823 | Draws a textured rectangle with the given position, size, and texture. 824 | **Returns** true on success or false on failure. 825 | ```java 826 | function drawTexture() 827 | { 828 | forumBG = Render.AddTexture("ot/scripts/forumclr.png"); 829 | Render.TexturedRect( 300, 300, 100, 100, forumBG ); 830 | } 831 | Cheat.RegisterCallback("Draw", "drawTexture"); 832 | ``` 833 | 834 | [ **TEXTUREDRECT** ] 835 | Syntax:Render.TexturedRect( x, y, width, height, texture ); 836 | Draws a textured rectangle with the given position, size, and texture. 837 | **Returns** true on success or false on failure. 838 | ```java 839 | function drawTexture() 840 | { 841 | forumBG = Render.AddTexture("ot/scripts/forumclr.png"); 842 | Render.TexturedRect( 300, 300, 100, 100, forumBG ); 843 | } 844 | Cheat.RegisterCallback("Draw", "drawTexture"); 845 | ``` 846 | 847 | [ **ADDTEXTURE** ] 848 | Syntax:Render.AddTexture( path ); 849 | Adds a texture. 850 | **Returns** texture identifier. 851 | 852 | **Notes:** 853 | - Path is relative to CSGO folder, so you don't need full path. 854 | - Supports the following formats: 855 | .bmp 856 | .dds 857 | .dib 858 | .hdr 859 | .jpg 860 | .pfm 861 | .png 862 | .ppm 863 | .tga 864 | 865 | ```java 866 | function drawTexture() 867 | { 868 | forumBG = Render.AddTexture("ot/scripts/forumclr.png"); 869 | Render.TexturedRect( 300, 300, 100, 100, forumBG ); 870 | } 871 | Cheat.RegisterCallback("Draw", "drawTexture"); 872 | ``` 873 | 874 | 875 | [ **TEXTSIZECUSTOM** ] 876 | Syntax:Render.TextSizeCustom( string text, font ); 877 | Finds the text width size of the given string with custom font. 878 | **Returns** given text height and width. 879 | ```java 880 | function getTextSize() 881 | { 882 | font = Render.AddFont( "Comic Sans MS", 15, 400); 883 | textSize = Render.TextSizeCustom("Hello", font); 884 | Cheat.Print("Text width: " + textSize[0] + "height: " + textSize[1] + "\n"); 885 | } 886 | 887 | Cheat.RegisterCallback("Draw", "getTextSize") 888 | ``` 889 | 890 | [ **STRINGCUSTOM** ] 891 | Syntax:Render.StringCustom( int x, int y, int align, string text, [ color ], font ) 892 | Draws a string with custom font. 893 | **Returns** true on success or false on failure. 894 | ```java 895 | function comicSans() 896 | { 897 | font = Render.AddFont( "Comic Sans MS", 15, 100); 898 | Render.StringCustom( 100, 100, 0, "This is Comic Sans Text", [ 255, 255, 255, 255 ], font ); 899 | 900 | } 901 | Cheat.RegisterCallback("Draw", "comicSans") 902 | ``` 903 | [ **FINDFONT** ] 904 | Syntax:Render.FindFont( string name, int size, int weight ); 905 | Searches for custom font. 906 | **Returns** font identifier. 907 | ```java 908 | function getIdentifier() 909 | { 910 | font = Render.AddFont( "Comic Sans MS", 15, 100); 911 | identifier = Render.FindFont( "Comic Sans MS", 15, 100 ); 912 | Cheat.Print("Font identifier is: " + identifier + "\n"); 913 | 914 | } 915 | Cheat.RegisterCallback("Draw", "getIdentifier") 916 | ``` 917 | 918 | [ **ADDFONT** ] 919 | Syntax:Render.AddFont( string name, int size, int weight ); 920 | Adds a custom font. 921 | **Returns** font identifier. 922 | 923 | Argument weight defines from thickness. 924 | 100 Lightest. 925 | 200 Bolder than 100, lighter than 300. 926 | 300 Bolder than 200, lighter than 400. 927 | 400 Bolder than 300, lighter than 500. Equivalent of normal. 928 | 500 Bolder than 400, lighter than 600. 929 | 600 Bolder than 500, lighter than 700. 930 | 700 Bolder than 600, lighter than 800. Equivalent of bold. 931 | 800 Bolder than 700, lighter than 900. 932 | 900 Boldest. 933 | 934 | ```java 935 | function comicSans() 936 | { 937 | font = Render.AddFont( "Comic Sans MS", 15, 100); 938 | Render.StringCustom( 100, 100, 0, "This is Comic Sans Text", [ 255, 255, 255, 255 ], font ); 939 | 940 | } 941 | Cheat.RegisterCallback("Draw", "comicSans") 942 | ``` 943 | 944 | [ **FINDFONT** ] 945 | Syntax:Render.FindFont( string name, int size, int weight ); 946 | Searches for custom font. 947 | **Returns** font identifier. 948 | ```java 949 | function getIdentifier() 950 | { 951 | font = Render.AddFont( "Comic Sans MS", 15, 100); 952 | identifier = Render.FindFont( "Comic Sans MS", 15, 100 ); 953 | Cheat.Print("Font identifier is: " + identifier + "\n"); 954 | 955 | } 956 | Cheat.RegisterCallback("Draw", "getIdentifier") 957 | ``` 958 | 959 | 960 | [ **POLYGON** ] 961 | Syntax:Render.Polygon( [ [ x, y ], [ x1, y1 ], [ x2, y2 ] ], [ R, G, B, A ] ); 962 | Draws a polygon with shape based on arguments passed. 963 | ```java 964 | function drawPolygon() 965 | { 966 | Render.Polygon( [ [ 10.0, 200.0 ], [ 100.0, 10.0 ], [ 200.0, 160.0 ] ], [ 255, 0, 0, 255 ] ); 967 | } 968 | Cheat.RegisterCallback("Draw", "drawPolygon"); 969 | ``` 970 | 971 | [ **GRADIENTRECT** ] 972 | Syntax:Render.GradientRect( x, y, w, h, dir, [ col1 ], [ col2 ] ); 973 | Draws a gradient rectangle with the given position, size, and RGBA color. 974 | **Returns** true on success or false on failure. 975 | ```java 976 | function drawGradient() 977 | { 978 | 979 | Render.GradientRect( 100, 100, 100, 100, 0, [ 255, 0, 0, 255 ], [ 255, 255, 255, 255 ]); 980 | Render.GradientRect( 210, 100, 100, 100, 1, [ 255, 0, 0, 255 ], [ 255, 255, 255, 255 ]); 981 | } 982 | Cheat.RegisterCallback("Draw", "drawGradient") 983 | ``` 984 | 985 | [ **TEXTSIZE** ] 986 | Syntax:Render.TextSize(string, int size [optional]); 987 | Finds the text width size of the given string. 988 | **Returns** 0 - default, 1 - bold, 2 - small, 3 - small bold, 4 - large, 5 - icon, 6 - small icon, 8 to 48 regular font with specific size. 989 | ```java 990 | var text_width = Render.TextSize("Hello"); 991 | var screen_size = Global.GetScreenSize(); 992 | var screen_height = screen_size[0]; 993 | var screen_width = screen_size[1]; 994 | 995 | Render.String( screen_width - text_width[1], 100, 0, "Hello", [255, 255, 255, 255], 4 ); 996 | ``` 997 | 998 | [ **GETSCREENSIZE** ] 999 | Syntax:Render.GetScreenSize() 1000 | Returns width and height of your screen. 1001 | ```java 1002 | function getScreenSize() 1003 | { 1004 | var screen_size = Render.GetScreenSize(); 1005 | Cheat.Print( "Height of screen is: " + screen_size[0] + "\n"); 1006 | Cheat.Print( "Width of screen is: " + screen_size[1] + "\n"); 1007 | } 1008 | Cheat.RegisterCallback("Draw", "getScreenSize") 1009 | // This function will print your screen height and width in in-game console. 1010 | ``` 1011 | 1012 | [ **WORLDTOSCREEN** ] 1013 | Syntax:Render.WorldToScreen([x, y, z]) 1014 | Finds the world position for the given screen position. 1015 | Returns the value of the parameter or false. 1016 | ```java 1017 | function drawDuckAmount( ) 1018 | { 1019 | players = Entity.GetEnemies( ); 1020 | 1021 | for ( i = 0; i < players.length; i++ ) 1022 | { 1023 | if ( Entity.IsAlive( players[i] ) ) 1024 | { 1025 | world = Entity.GetRenderOrigin( players[i] ); 1026 | 1027 | screen_bot = Render.WorldToScreen( world ); 1028 | 1029 | duckamount = Entity.GetProp( players[i], "DT_BasePlayer", "m_flDuckAmount" ); 1030 | 1031 | world_top = world; 1032 | world_top[2] = world_top[2] + ( 64 * ( 1 - duckamount ) ); 1033 | 1034 | screen_top = Render.WorldToScreen( world_top ); 1035 | 1036 | if ( screen_bot[2] == 1 && screen_top[2] == 1 ) 1037 | { 1038 | Render.Line( screen_bot[0], screen_bot[1], screen_top[0], screen_top[1], [ 0, 0, 255, 255 ] ); 1039 | } 1040 | } 1041 | } 1042 | } 1043 | Cheat.RegisterCallback("Draw", "drawDuckAmount"); 1044 | // This script will draw a line on enemy players which represents their duck amount. 1045 | ``` 1046 | 1047 | 1048 | [ **CIRCLE** ] 1049 | Syntax:Render.Circle(x, y, r, color) 1050 | Draws a circle with the given position, radius, and RGBA color. 1051 | **Returns** true on success or false on failure. 1052 | ```java 1053 | function drawCircle() 1054 | { 1055 | Render.Circle( 150, 150, 50, [ 255, 255, 255, 255 ] ); 1056 | } 1057 | 1058 | Cheat.RegisterCallback("Draw", "drawCircle") 1059 | // This function will draw a circle on screen. 1060 | ``` 1061 | 1062 | [ **FILLEDRECT** ] 1063 | Syntax:Render.FilledRect(x, y, width, height, color) 1064 | Draws a circle with the given position, radius, and RGBA color. 1065 | **Returns** true on success or false on failure. 1066 | ```java 1067 | function drawFilledRect() 1068 | { 1069 | Render.FilledRect( 100, 100, 150, 150, [ 255, 0, 0, 180 ] ); 1070 | } 1071 | 1072 | Cheat.RegisterCallback("Draw", "drawFilledRect") 1073 | // This function will draw a filled rectangle on screen. 1074 | ``` 1075 | 1076 | [ **RECT** ] 1077 | Syntax:Render.Rect(x, y, width, height, color) 1078 | Draws a rectangle with the given position, size, and RGBA color. 1079 | **Returns** true on success or false on failure. 1080 | ```java 1081 | function drawRect() 1082 | { 1083 | Render.Rect( 100, 100, 150, 150, [ 255, 0, 0, 255 ] ); 1084 | } 1085 | 1086 | Cheat.RegisterCallback("Draw", "drawRect") 1087 | // This function will draw a rectangle on screen. 1088 | ``` 1089 | 1090 | [ **LINE** ] 1091 | Syntax:Render.Line(x, y, x1, y1, color) 1092 | Draws a line with the given position RGBA color. 1093 | **Returns** true on success or false on failure. 1094 | ```java 1095 | function drawLine() 1096 | { 1097 | Render.Line( 100, 200, 300, 200, [ 255, 0, 0, 255 ] ); 1098 | } 1099 | 1100 | Cheat.RegisterCallback("Draw", "drawLine") 1101 | // This function will draw a line on your screen. 1102 | ``` 1103 | 1104 | [ **STRING** ] 1105 | Syntax:Render.String(x, y, align, message, color, int size [optional]) 1106 | Draws a string with the given position, align, RGBA color, and size. 1107 | **Returns** true on success or false on failure. 1108 | 1109 | **Size values** 1110 | 0 - default font 1111 | 1 - bold font 1112 | 2 - small font 1113 | 3 - small bold font 1114 | 4 - BIG font 1115 | 5 - icons 1116 | 6 - small icons 1117 | even numbers from 8 to 48 are regular font with a more specific size 1118 | 1119 | 1120 | ```java 1121 | function drawString() 1122 | { 1123 | Render.String( 100, 100, 0, "Hello", [ 255, 255, 255, 255 ] ); 1124 | } 1125 | 1126 | Cheat.RegisterCallback("Draw", "drawString") 1127 | // This script will draw a string Hello on your screen 1128 | ``` 1129 | 1130 | [back to Contents](#-1) 1131 | 1132 | 1133 | ## Convar 1134 | |-------------------------------| 1135 | 1136 | [ **SETSTRING** ] 1137 | Syntax:Convar.SetString("cmd", string) 1138 | Sets the string value of the given console command. 1139 | **Returns** true on success or false on failure. 1140 | ```java 1141 | Convar.SetString ("r_aspectratio", "1"); 1142 | ``` 1143 | 1144 | [ **GETSTRING** ] 1145 | Syntax:Convar.GetString("cmd") 1146 | Finds the string value of the given console command. 1147 | **Returns** the value of the parameter or false. 1148 | ```java 1149 | var name = Convar.GetString("name"); 1150 | Cheat.Print(name); 1151 | ``` 1152 | 1153 | [ **SETFLOAT** ] 1154 | Syntax:Convar.SetFloat ("cmd", value) 1155 | Sets the float value of the given console command. 1156 | **Returns** true on success or false on failure. 1157 | ```java 1158 | Convar.SetFloat("cl_ragdoll_gravity", 100.00); 1159 | ``` 1160 | 1161 | [ **GETFLOAT** ] 1162 | Syntax:Convar.GetFloat("cmd") 1163 | Finds the float value of the given console command. 1164 | **Returns** the value of the parameter or false. 1165 | ```java 1166 | var sv_gravity_value = Convar.GetFloat("cl_ragdoll_gravity"); 1167 | Cheat.Print(sv_gravity_value); 1168 | ``` 1169 | 1170 | [ **SETINT** ] 1171 | Syntax:Convar.SetInt("cmd", value) 1172 | Sets the integer value of the given console command. 1173 | **Returns** true on success or false on failure. 1174 | ```java 1175 | Convar.SetInt("cl_ragdoll_gravity", 100); 1176 | ``` 1177 | 1178 | [ **GETINT** ] 1179 | Syntax:Convar.GetInt("cmd") 1180 | Finds the integer value of the given console command. 1181 | **Returns** the value of the parameter or false. 1182 | ```java 1183 | var sv_gravity_value = Convar.GetInt("cl_ragdoll_gravity"); 1184 | Cheat.Print(sv_gravity_value); 1185 | ``` 1186 | 1187 | [back to Contents](#-1) 1188 | 1189 | ## Event 1190 | |-------------------------------| 1191 | 1192 | [ **RAGEBOT_FIRE** ] 1193 | Syntax:ragebot_fire 1194 | **Returns** information on ragebot_fire event. 1195 | 1196 | Following arguments can be used with Event.GetInt for the ragebot_fire event 1197 | target_index 1198 | hitbox 1199 | hitchance 1200 | safepoint 1201 | exploit 1202 | 0 = no exploit 1203 | 1 = hide shots/1st shot from doubletap 1204 | 2 = second shot from doubletap 1205 | 1206 | ```java 1207 | function getHitboxName(index) 1208 | { 1209 | var hitboxName = ""; 1210 | switch (index) 1211 | { 1212 | case 0: 1213 | hitboxName = "Head"; 1214 | break; 1215 | case 1: 1216 | hitboxName = "Neck"; 1217 | break; 1218 | case 2: 1219 | hitboxName = "Pelvis"; 1220 | break; 1221 | case 3: 1222 | hitboxName = "Body"; 1223 | break; 1224 | case 4: 1225 | hitboxName = "Thorax"; 1226 | break; 1227 | case 5: 1228 | hitboxName = "Chest"; 1229 | break; 1230 | case 6: 1231 | hitboxName = "Upper chest"; 1232 | break; 1233 | case 7: 1234 | hitboxName = "Left thigh"; 1235 | break; 1236 | case 8: 1237 | hitboxName = "Right thigh"; 1238 | break; 1239 | case 9: 1240 | hitboxName = "Left calf"; 1241 | break; 1242 | case 10: 1243 | hitboxName = "Right calf"; 1244 | break; 1245 | case 11: 1246 | hitboxName = "Left foot"; 1247 | break; 1248 | case 12: 1249 | hitboxName = "Right foot"; 1250 | break; 1251 | case 13: 1252 | hitboxName = "Left hand"; 1253 | break; 1254 | case 14: 1255 | hitboxName = "Right hand"; 1256 | break; 1257 | case 15: 1258 | hitboxName = "Left upper arm"; 1259 | break; 1260 | case 16: 1261 | hitboxName = "Left forearm"; 1262 | break; 1263 | case 17: 1264 | hitboxName = "Right upper arm"; 1265 | break; 1266 | case 18: 1267 | hitboxName = "Right forearm"; 1268 | break; 1269 | default: 1270 | hitboxName = "Generic"; 1271 | } 1272 | 1273 | return hitboxName; 1274 | } 1275 | function ragebotLogs() 1276 | { 1277 | 1278 | ragebot_target = Event.GetInt("target_index"); 1279 | ragebot_target_hitbox = Event.GetInt("hitbox"); 1280 | ragebot_target_hitchance = Event.GetInt("hitchance"); 1281 | ragebot_target_safepoint = Event.GetInt("safepoint"); 1282 | ragebot_target_exploit = Event.GetInt("exploit"); 1283 | targetName = Entity.GetName(ragebot_target); 1284 | 1285 | Cheat.Print("[onetap] TARGET: " + targetName + " HITBOX: " + getHitboxName(ragebot_target_hitbox) + " HC: " + ragebot_target_hitchance + " SAFEPOINT: " + ragebot_target_safepoint + " EXPLOIT: " + ragebot_target_exploit + " \n"); 1286 | 1287 | } 1288 | 1289 | Cheat.RegisterCallback("ragebot_fire", "ragebotLogs"); 1290 | ``` 1291 | 1292 | [ **GETSTRING** ] 1293 | Syntax:Event.GetString(string) 1294 | Finds the string value of the given game event. 1295 | **Returns** the value of the parameter or false. 1296 | ```java 1297 | var weapon_name = Event.GetString("weaponname"); 1298 | ``` 1299 | 1300 | [ **GETFLOAT** ] 1301 | Syntax:Event.GetFloat(float) 1302 | Finds the float value of the given game event. 1303 | **Returns** the value of the parameter or false. 1304 | ```java 1305 | pos_x = Event.GetFloat("x"); 1306 | ``` 1307 | 1308 | [ **GETINT** ] 1309 | Syntax:Event.GetInt(int) 1310 | Finds the int value of the given game event. 1311 | **Returns** the value of the parameter or false. 1312 | ```java 1313 | userid = Event.GetInt("userid"); 1314 | ``` 1315 | 1316 | [back to Contents](#-1) 1317 | 1318 | ## Trace 1319 | |-------------------------------| 1320 | 1321 | [ **RAWLINE** ] 1322 | Syntax:Trace.RawLine( int skip_index, vec3 start, vec3 end, unsigned int mask, int type ) 1323 | Used for advanced line tracing. 1324 | **Returns** entity index and number fraction. 1325 | **Fraction info:** 1326 | 1.0 means it didnt hit anything, 0.5 means it hit something half way through, 0.1 is hit 1327 | **Skip index:** 1328 | skips a certain entity, can be 0 to not skip any entity. 1329 | **Mask:** 1330 | filters what should and shouldn't be taken into consideration when tracing 1331 | masks can be combined, example below: 1332 | A bullet would be 0x4600400b ( CONTENTS_SOLID + CONTENTS_WINDOW + CONTENTS_GRATE + CONTENTS_MOVEABLE + CONTENTS_MONSTER + CONTENTS_DEBRIS + CONTENTS_HITBOX ) 1333 | **Type:** 1334 | 0 = TRACE_EVERYTHING 1335 | 1 = TRACE_WORLD_ONLY 1336 | 2 = TRACE_ENTITIES_ONLY 1337 | ```java 1338 | CONTENTS_SOLID 0x1 1339 | CONTENTS_WINDOW 0x2 1340 | CONTENTS_AUX 0x4 1341 | CONTENTS_GRATE 0x8 1342 | CONTENTS_SLIME 0x10 1343 | CONTENTS_WATER 0x20 1344 | CONTENTS_BLOCKLOS 0x40 1345 | CONTENTS_OPAQUE 0x80 1346 | CONTENTS_TESTFOGVOLUME 0x100 1347 | CONTENTS_UNUSED 0x200 1348 | CONTENTS_BLOCKLIGHT 0x400 1349 | CONTENTS_TEAM1 0x800 1350 | CONTENTS_TEAM2 0x1000 1351 | CONTENTS_IGNORE_NODRAW_OPAQUE 0x2000 1352 | CONTENTS_MOVEABLE 0x4000 1353 | CONTENTS_AREAPORTAL 0x8000 1354 | CONTENTS_PLAYERCLIP 0x10000 1355 | CONTENTS_MONSTERCLIP 0x20000 1356 | CONTENTS_ORIGIN 0x1000000 1357 | CONTENTS_MONSTER 0x2000000 1358 | CONTENTS_DEBRIS 0x4000000 1359 | CONTENTS_DETAIL 0x8000000 1360 | CONTENTS_TRANSLUCENT 0x10000000 1361 | CONTENTS_LADDER 0x20000000 1362 | CONTENTS_HITBOX 0x40000000 1363 | ``` 1364 | 1365 | 1366 | **IN OT V3 CRACK NOT WORKS** [ **SMOKE** ] 1367 | Syntax:Trace.Smoke(array start, array end) 1368 | Used to check if smoke is between two points. 1369 | **Returns** 1 if there was smoke. 1370 | ```java 1371 | function isBehindSmoke(entity_index) 1372 | { 1373 | eyepos = Entity.GetEyePosition(Entity.GetLocalPlayer()); 1374 | if (Entity.IsValid(entity_index) && Entity.IsAlive(entity_index) && !Entity.IsDormant(entity_index)){ 1375 | hitbox_pos = Entity.GetHitboxPosition(entity_index, 0); 1376 | result = Trace.Smoke(eyepos, hitbox_pos); 1377 | if (result == 1) 1378 | { 1379 | return true 1380 | } 1381 | else 1382 | { 1383 | return false 1384 | } 1385 | } 1386 | } 1387 | function main() 1388 | { 1389 | enemies = Entity.GetEnemies() 1390 | for (i=0; i < enemies.length; i++) 1391 | { 1392 | if (isBehindSmoke(enemies[i])) 1393 | { 1394 | Cheat.Print("Enemy: " + Entity.GetName(enemies[i])+ " is behind smoke\n") 1395 | } 1396 | } 1397 | } 1398 | Cheat.RegisterCallback("CreateMove", "main"); 1399 | ``` 1400 | 1401 | 1402 | [ **BULLET** ] 1403 | Syntax:Trace.Bullet(int ent_index, int target, array start, array end); 1404 | Used to trace bullet between two entities. 1405 | **Returns** entity index, damage, visibility, and hitbox. 1406 | ```java 1407 | function isVisible() 1408 | { 1409 | 1410 | localPlayer_index = Entity.GetLocalPlayer(); 1411 | localPlayer_eyepos = Entity.GetEyePosition(localPlayer_index); 1412 | enemies = Entity.GetEnemies(); 1413 | for ( i = 0; i < enemies.length; i++) 1414 | { 1415 | if (Entity.IsValid(enemies[i]) == true && Entity.IsAlive(enemies[i]) && Entity.IsDormant(enemies[i]) == false) 1416 | { 1417 | hitbox_pos = Entity.GetHitboxPosition(localPlayer_index, 0); 1418 | bot_eyepos = Entity.GetEyePosition(enemies[i]) 1419 | 1420 | w2s_s = Render.WorldToScreen(bot_eyepos) 1421 | w2s_e = Render.WorldToScreen(hitbox_pos) 1422 | Render.Line(w2s_s[0], w2s_s[1], w2s_e[0], w2s_e[1], [255, 255, 255, 255]) 1423 | Render.String(w2s_s[0], w2s_s[1], 0, "START", [255, 0, 0, 255]) 1424 | Render.String(w2s_e[0], w2s_e[1], 0, "END", [255, 0, 0, 255]) 1425 | } 1426 | } 1427 | } 1428 | 1429 | function cm() 1430 | { 1431 | localPlayer_index = Entity.GetLocalPlayer(); 1432 | localPlayer_eyepos = Entity.GetEyePosition(localPlayer_index); 1433 | enemies = Entity.GetEnemies(); 1434 | for ( i = 0; i < enemies.length; i++) 1435 | { 1436 | if (Entity.IsValid(enemies[i]) == true && Entity.IsAlive(enemies[i]) && Entity.IsDormant(enemies[i]) == false) 1437 | { 1438 | hitbox_pos = Entity.GetHitboxPosition(localPlayer_index, 0); 1439 | bot_eyepos = Entity.GetEyePosition(enemies[i]) 1440 | result = Trace.Bullet(enemies[i], localPlayer_index, bot_eyepos, hitbox_pos); 1441 | Cheat.Print("Trace result:: " + Entity.GetName(enemies[i]) + " can see player: " + Entity.GetName(result[0]) + " damage:: " + result[1] + " visible:: " + result[2] + " hitbox :: " + result[3] + "\n") 1442 | } 1443 | } 1444 | 1445 | } 1446 | Cheat.RegisterCallback("Draw", "isVisible"); 1447 | Cheat.RegisterCallback("CreateMove", "cm"); 1448 | ``` 1449 | 1450 | [ **LINE** ] 1451 | Syntax:Trace.Line(int ent_index, array start, array end); 1452 | Used to trace line between point A and B. 1453 | **Returns** entity index and number fraction. 1454 | Fraction info: 1.0 means it didnt hit anything, 0.5 means it hit something half way through, 0.1 is hit 1455 | ```java 1456 | function isVisible() 1457 | { 1458 | 1459 | localPlayer_index = Entity.GetLocalPlayer(); 1460 | localPlayer_eyepos = Entity.GetEyePosition(localPlayer_index); 1461 | enemies = Entity.GetEnemies(); 1462 | for ( i = 0; i < enemies.length; i++) 1463 | { 1464 | hitbox_pos = Entity.GetHitboxPosition(enemies[i], 0); 1465 | result = Trace.Line(localPlayer_index, localPlayer_eyepos, hitbox_pos); 1466 | Cheat.Print("Entity: " + Entity.GetName(result[0]) + " fraction: " + result[1] + "\n"); 1467 | } 1468 | 1469 | } 1470 | 1471 | Cheat.RegisterCallback("Draw", "isVisible"); 1472 | // This function will trace line from localplayer eye position to enemy head hitbox position and return whether the enemy is visible or not. 1473 | ``` 1474 | 1475 | 1476 | [back to Contents](#-1) 1477 | 1478 | ## UserCMD 1479 | |-------------------------------| 1480 | 1481 | 1482 | [ **GETMOVEMENT** ] 1483 | Syntax:UserCMD.GetMovement(); 1484 | Used to obtain movement values. 1485 | **Returns** an array object with forward move, side move, and up move. 1486 | ```java 1487 | function onCreateMove() 1488 | { 1489 | var movement = UserCMD.GetMovement(); 1490 | 1491 | forward = movement[0]; 1492 | side = movement[1]; 1493 | up = movement[2]; 1494 | 1495 | Cheat.Print("Forward: " + forward + "\nSide: " + side + "\nUp: " + up + "\n"); 1496 | } 1497 | Cheat.RegisterCallback("CreateMove", "onCreateMove"); 1498 | ``` 1499 | 1500 | 1501 | **IN OT V3 CRACK NOT WORKS** [ **SETVIEWANGLES** ] 1502 | Syntax:UserCMD.SetViewAngles( [x,y,z], bool silent ); 1503 | Control user angles. 1504 | ```java 1505 | function setAngle() 1506 | { 1507 | curAngle = Local.GetViewAngles(); 1508 | UserCMD.SetViewAngles([curAngle[0], 180, curAngle[2]], true) ; 1509 | } 1510 | Cheat.RegisterCallback("CreateMove", "setAngle"); 1511 | ``` 1512 | 1513 | **IN OT V3 CRACK NOT WORKS** [ **SEND** ] 1514 | Syntax:UserCMD.Send() 1515 | Please note that this function may be overruled by internal processing related to, but not limited to, shot handling, anti-aim, and exploits. 1516 | 1517 | **IN OT V3 CRACK NOT WORKS** [ **CHOKE** ] 1518 | Syntax:UserCMD.Choke() 1519 | Please note that this function may be overruled by internal processing related to, but not limited to, shot handling, anti-aim, and exploits. 1520 | 1521 | 1522 | **IN OT V3 CRACK NOT WORKS** [ **SETBUTTONS** ] 1523 | Syntax:UUserCMD.SetButtons(); 1524 | Used to set buttons. 1525 | ```java 1526 | function forceJump() 1527 | { 1528 | var buttons = UserCMD.GetButtons(); 1529 | UserCMD.SetButtons(buttons | (1 << 1)); 1530 | 1531 | } 1532 | Cheat.RegisterCallback("CreateMove", "forceJump") 1533 | ``` 1534 | 1535 | 1536 | **IN OT V3 CRACK NOT WORKS** [ **SETBUTTONS** ] 1537 | Syntax:UserCMD.GetButtons(); 1538 | Used to set buttons. 1539 | **Returns** buttons. 1540 | ```java 1541 | function forceJump() 1542 | { 1543 | var buttons = UserCMD.GetButtons(); 1544 | UserCMD.SetButtons(buttons | (1 << 1)); 1545 | 1546 | } 1547 | Cheat.RegisterCallback("CreateMove", "forceJump") 1548 | ``` 1549 | 1550 | [ **SETMOVEMENT** ] 1551 | Syntax:UserCMD.SetMovement([forwardmove, sidemove, upmove]); 1552 | Control user movement. 1553 | ```java 1554 | function moveForward() 1555 | { 1556 | UserCMD.SetMovement( [ 450, 0, 0 ] ); 1557 | } 1558 | Cheat.RegisterCallback("CreateMove", "moveForward"); 1559 | ``` 1560 | 1561 | [back to Contents](#-1) 1562 | 1563 | ## Sound 1564 | |-------------------------------| 1565 | 1566 | [ **STOPMICROPHONE** ] 1567 | Syntax:Sound.StopMicrophone( ); 1568 | Used to stop Sound.PlayMicrophone 1569 | ```java 1570 | Sound.StopMicrophone( ); 1571 | ``` 1572 | 1573 | [ **PLAYMICROPHONE** ] 1574 | Syntax:Sound.PlayMicrophone(path) 1575 | Plays a sound on microphone. 1576 | ```java 1577 | Sound.PlayMicrophone(path); 1578 | ``` 1579 | 1580 | [ **PLAY** ] 1581 | Syntax:Sound.Play( string path ) 1582 | Plays a sound. 1583 | ```java 1584 | function playSoundOnKill() 1585 | { 1586 | localplayer_index = Entity.GetLocalPlayer(); 1587 | attacker = Event.GetInt("attacker"); 1588 | attacker_index = Entity.GetEntityFromUserID(attacker); 1589 | 1590 | if (attacker_index == localplayer_index) 1591 | { 1592 | Sound.Play("C:\\Program Files (x86)\\Steam\\steamapps\\common\\Counter-Strike Global Offensive\\ot\\scripts\\headshot.wav"); 1593 | } 1594 | 1595 | } 1596 | 1597 | Cheat.RegisterCallback("player_death", "playSoundOnKill"); 1598 | ``` 1599 | 1600 | 1601 | [back to Contents](#-1) 1602 | 1603 | ## Local 1604 | |-------------------------------| 1605 | 1606 | 1607 | [ **GETINACCURACY** ] 1608 | Syntax:Local.GetInaccuracy(); 1609 | **Returns** inaccuracy. 1610 | ```java 1611 | inaccuracy = Local.GetInaccuracy(); 1612 | Cheat.Print(inaccuracy + "\n"); 1613 | ``` 1614 | 1615 | [ **GETSPREAD** ] 1616 | Syntax:Local.GetSpread(); 1617 | **Returns** spread. 1618 | ```java 1619 | spread = Local.GetSpread(); 1620 | Cheat.Print(spread + "\n"); 1621 | ``` 1622 | 1623 | [ **GETFAKEYAW** ] 1624 | Syntax:Local.GetFakeYaw(); 1625 | **Returns** fake yaw angle. 1626 | ```java 1627 | fakeyaw = Local.GetFakeYaw(); 1628 | Cheat.Print(fakeyaw + "\n"); 1629 | ``` 1630 | 1631 | [ **GETREALYAW** ] 1632 | Syntax:Local.GetRealYaw(); 1633 | **Returns** real yaw angle. 1634 | ```java 1635 | realyaw = Local.GetRealYaw(); 1636 | Cheat.Print(realyaw + "\n"); 1637 | ``` 1638 | 1639 | [ **SETCLANTAG** ] 1640 | Syntax:Local.SetClanTag(string text); 1641 | ```java 1642 | Local.SetClanTag("onetap.su"); 1643 | ``` 1644 | 1645 | [ **SETVIEWANGLES** ] 1646 | Syntax:Local.SetViewAngles(array) 1647 | Sets user-defined view angles. 1648 | ```java 1649 | viewAngles = Local.GetViewAngles(); 1650 | Cheat.Print("PITCH: " + viewAngles[0] + " YAW: " + viewAngles[1] + " ROLL: " + viewAngles[2] + "\n"); 1651 | Local.SetViewAngles([ 89, 180, 0 ]); 1652 | newAngles = Local.GetViewAngles(); 1653 | Cheat.Print("PITCH: " + newAngles[0] + " YAW: " + newAngles[1] + " ROLL: " + newAngles[2] + "\n") 1654 | ``` 1655 | 1656 | 1657 | [ **GETVIEWANGLES** ] 1658 | Syntax:Local.GetViewAngles(); 1659 | **Returns** array object with pitch, yaw and roll of your local view. 1660 | ```java 1661 | var viewAngles = Local.GetViewAngles(); 1662 | Cheat.Print("Current view angles: " + viewAngles); 1663 | ``` 1664 | 1665 | 1666 | [ **LATENCY** ] 1667 | Syntax:Local.Latency() 1668 | **Returns** local player ping to the server. 1669 | ```java 1670 | var myPing = Local.Latency(); 1671 | Cheat.Print("Your ping is : " + myPing); 1672 | ``` 1673 | 1674 | 1675 | [back to Contents](#-1) 1676 | 1677 | 1678 | ## Cheat 1679 | |-------------------------------| 1680 | 1681 | [ **GETUSERNAME** ] 1682 | Syntax:Cheat.GetUsername() 1683 | **Returns** forum username. 1684 | ```java 1685 | username = Cheat.GetUsername(); 1686 | Cheat.Print(username + "\n"); 1687 | ``` 1688 | 1689 | [ **PRINTCHAT** ] 1690 | Syntax:Cheat.PrintChat(string text) 1691 | Prints a message in in-game chat. 1692 | ```java 1693 | Cheat.PrintChat("printing in chat :-)" + "\n"); 1694 | ``` 1695 | 1696 | [ **REGISTERCALLBACK** ] 1697 | Syntax:Cheat.RegisterCallback(callback, function) 1698 | Callback: any function/event listed below 1699 | Function: function to be invoked 1700 | 1701 | **Currently available** 1702 | "CreateMove" useful for adjusting antiaim/ragebot settings with a script before antiaim/ragebot runs 1703 | "Draw" the only place in a script u can call Render functions, is inside a "Draw" callbacks 1704 | "Unload" called when script is unloaded 1705 | "Material" called before materials are applied. Material functions (except Create and Destroy) must be called in this callback 1706 | "ragebot_fire" 1707 | FRAME_START 1708 | FRAME_RENDER_START 1709 | FRAME_RENDER_END 1710 | FRAME_NET_UPDATE_START 1711 | FRAME_NET_UPDATE_END 1712 | FRAME_NET_UPDATE_POSTDATAUPDATE_START 1713 | FRAME_NET_UPDATE_POSTDATAUPDATE_END 1714 | Other game events 1715 | list can be found HERE https://wiki.alliedmods.net/Counter-Strike:_Global_Offensive_Events 1716 | ```java 1717 | function test() 1718 | { 1719 | Cheat.Print("hi from test function\n"); 1720 | } 1721 | 1722 | Cheat.RegisterCallback("round_start", "test"); 1723 | // This function prints the text to the in-game console every time "round_start" event is called. 1724 | ``` 1725 | 1726 | 1727 | [ **EXECUTECOMMAND** ] 1728 | Syntax:Cheat.ExecuteCommand(cmd) 1729 | Prints a message in in-game chat. 1730 | ```java 1731 | Cheat.ExecuteCommand( "say hello" ); 1732 | // This function will say hello in chat when script is loaded. 1733 | ``` 1734 | 1735 | [ **PRINTCOLOR** ] 1736 | Syntax:Cheat.PrintColor([ r, g, b, a ], "Text") 1737 | Cheat.PrintColor is used for same purpose(s) as Cheat.Print, in addition you can make your console outputs in different colors. 1738 | ```java 1739 | Cheat.PrintColor( [ 255, 0, 0, 255 ], "This is red text" ); 1740 | ``` 1741 | 1742 | [ **PRINT** ] 1743 | Syntax:Cheat.Print(message) 1744 | Used to print out wide ranges of information to your console, as well as simple messages. 1745 | ```java 1746 | Cheat.Print( 'hello' ); 1747 | ``` 1748 | 1749 | [back to Contents](#-1) 1750 | 1751 | 1752 | ## Input 1753 | |-------------------------------| 1754 | 1755 | 1756 | [ **GETCURSORPOSITION** ] 1757 | Syntax:Input.GetCursorPosition() 1758 | **Returns** an array object with X, Y for cursor position. 1759 | ```java 1760 | function getCursorPosition() 1761 | { 1762 | var cursor_pos = Input.GetCursorPosition(); 1763 | Cheat.Print( "Cursor pos X is: " + cursor_pos[0] + "\n"); 1764 | Cheat.Print( "Cursor pos Y is: " + cursor_pos[1] + "\n"); 1765 | } 1766 | Cheat.RegisterCallback("Draw", "getCursorPosition") 1767 | // This function will print your cursor position x and y in in-game console. 1768 | ``` 1769 | 1770 | 1771 | [ **ISKEYPRESSED** ] 1772 | Syntax:Input.IsKeyPressed(VK_KEY) 1773 | **Returns** boolean value whether or not a key was pressed. 1774 | ```java 1775 | if (Input.IsKeyPressed(0x01)) 1776 | { 1777 | Cheat.ExecuteCommand("say hello"); 1778 | } 1779 | ``` 1780 | A full list of virtual keys can be found HERE. https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes 1781 | 1782 | [back to Contents](#-1) 1783 | 1784 | ## World 1785 | |-------------------------------| 1786 | 1787 | [ **GETCURSORPOSITION** ] 1788 | Syntax:World.GetServerString(); 1789 | **Returns** server IP. 1790 | ```java 1791 | server = World.GetServerString(); 1792 | Cheat.Print(server + '\n') 1793 | ``` 1794 | 1795 | [ **GETMAPNAME** ] 1796 | Syntax:World.GetMapName(); 1797 | **Returns** current map name. 1798 | ```java 1799 | current_map = World.GetMapName(); 1800 | ``` 1801 | 1802 | 1803 | [back to Contents](#-1) 1804 | 1805 | ## AntiAim 1806 | |-------------------------------| 1807 | 1808 | [ **SETLBYOFFSET** ] 1809 | Syntax:AntiAim.SetLBYOffset(int degree); 1810 | Sets the LBY offset of your fake angle. 1811 | ```java 1812 | // The following code-block will put your real to the left, your fake backwards, and create an LBY similar to the "opposite" option. 1813 | 1814 | AntiAim.SetOverride(1); 1815 | AntiAim.SetFakeOffset(30); 1816 | AntiAim.SetRealOffset(-30); 1817 | AntiAim.SetLBYOffset(90); // <----- This will offset your Fake LBY similar to the "opposite" setting. 1818 | ``` 1819 | 1820 | [ **SETREALOFFSET** ] 1821 | Syntax:AntiAim.SetRealOffset(int degree); 1822 | Sets the offset of your Real angle. Your Real angle is relative to your Fake. 1823 | ```java 1824 | // The following code-block will put your real to the left, your fake backwards, and create an LBY similar to the "opposite" option. 1825 | 1826 | AntiAim.SetOverride(1); 1827 | AntiAim.SetFakeOffset(30); 1828 | AntiAim.SetRealOffset(-30); // <----- This will set your real to -30 degrees (RELATIVE TO YOUR FAKE OFFSET OF 30 THAT WAS SETUP ABOVE). 1829 | AntiAim.SetLBYOffset(90); 1830 | ``` 1831 | 1832 | [ **SETFAKEOFFSET** ] 1833 | Syntax:AntiAim.SetFakeOffset(int degree); 1834 | Sets the offset of your Fake angle. Fake is the master offset of the AntiAim functions, your Real and LBY are relative to the fake offset. 1835 | ```java 1836 | // The following code-block will put your real to the left, your fake backwards, and create an LBY similar to the "opposite" option. 1837 | 1838 | AntiAim.SetOverride(1); 1839 | AntiAim.SetFakeOffset(30); // <----- This will setup your fake offset. 1840 | AntiAim.SetRealOffset(-30); 1841 | AntiAim.SetLBYOffset(90); 1842 | ``` 1843 | 1844 | [ **GETOVERRIDE** ] 1845 | Syntax:AntiAim.GetOverride(); 1846 | **Returns** the anti-aim override state. 1847 | ```java 1848 | // The following code-block will print true. 1849 | 1850 | AntiAim.SetOverride(1); 1851 | 1852 | Cheat.Print(AntiAim.GetOverride() + "\n"); 1853 | ``` 1854 | 1855 | [ **GETOVERRIDE** ] 1856 | Syntax:AntiAim.SetOverride(int state); 1857 | Enables/disables anti-aim overriding. 1858 | The values used by AA are updated AFTER each send to the server, you can edit them mid cycle, but they wont apply until the next. 1859 | It is recommended to update values in CreateMove callback. 1860 | Spamming SetOverride with alternating values is undefined behavior, just spamming it with 1 or 0 is totally fine though. 1861 | After disabling a script that uses SetOverride, it will not revert back to the original state, you need to change it before the script is disabled. 1862 | The values are offsets to your base yaw, base yaw is affected by the following settings. 1863 | Yaw offset 1864 | Jitter offset (and thus jitter) 1865 | At targets 1866 | Auto direction 1867 | Manual direction 1868 | It is therefor recommended to pay attention and handle this accordingly, disable these settings if your script takes control of it. 1869 | **Understanding Anti-Aim** 1870 | Your fake will be used as a master angle, every other setting is relative to your fake angle. 1871 | The maximum possible angle between your final fake angle and final real angle is 60°. 1872 | SetFakeOffset's default value (0) will set your head backwards, angles are based off 0° being your origin angle. 1873 | 1874 | ```java 1875 | // The following code-block will put your real to the left, your fake backwards, and create an LBY similar to the "opposite" setting. 1876 | 1877 | AntiAim.SetOverride(1); // <----- This will enable anti-aim overriding. 1878 | AntiAim.SetFakeOffset(30); 1879 | AntiAim.SetRealOffset(-30); 1880 | AntiAim.SetLBYOffset(90); 1881 | ``` 1882 | 1883 | [back to Contents](#-1) 1884 | 1885 | ## Exploit 1886 | |-------------------------------| 1887 | 1888 | 1889 | **IN OT V3 CRACK NOT WORKS** [ **OVERRIDETOLERANCE** ] 1890 | Syntax:Exploit.OverrideTolerance(int value); 1891 | Lower value results in faster double-tap. 1892 | Default value: 2 1893 | Maximum value is clamped to 8. 1894 | ```java 1895 | UI.AddSliderInt("Shift", 0, 14) 1896 | UI.AddSliderInt("Tolerance", 0, 8) 1897 | function on_createmove() 1898 | { 1899 | Exploit.OverrideShift(UI.GetValue("Script items", "Shift")) 1900 | Exploit.OverrideTolerance(UI.GetValue("Script items", "Tolerance")) 1901 | } 1902 | Cheat.RegisterCallback("CreateMove", "on_createmove") 1903 | ``` 1904 | 1905 | **IN OT V3 CRACK NOT WORKS** [ **OVERRIDESHIFT** ] 1906 | Syntax:Exploit.OverrideShift(int value); 1907 | Higher value results in faster double-tap. 1908 | Default value: 12 1909 | Maximum value is clamped to 14. 1910 | ```java 1911 | UI.AddSliderInt("Shift", 0, 14) 1912 | UI.AddSliderInt("Tolerance", 0, 8) 1913 | function on_createmove() 1914 | { 1915 | Exploit.OverrideShift(UI.GetValue("Script items", "Shift")) 1916 | Exploit.OverrideTolerance(UI.GetValue("Script items", "Tolerance")) 1917 | } 1918 | Cheat.RegisterCallback("CreateMove", "on_createmove") 1919 | ``` 1920 | 1921 | [ **ENABLERECHARGE** ] 1922 | Syntax:Exploit.EnableRecharge(); 1923 | Enable automatic recharge 1924 | ```java 1925 | function on_cm() 1926 | { 1927 | Exploit.EnableRecharge() 1928 | } 1929 | Cheat.RegisterCallback("CreateMove", "on_cm") 1930 | ``` 1931 | 1932 | [ **DISABLERECHARGE** ] 1933 | Syntax:Exploit.DisableRecharge(); 1934 | Disables automatic recharging 1935 | ```java 1936 | function on_cm() 1937 | { 1938 | Exploit.DisableRecharge() 1939 | } 1940 | Cheat.RegisterCallback("CreateMove", "on_cm") 1941 | ``` 1942 | 1943 | [ **RECHARGE** ] 1944 | Syntax:Exploit.Recharge(); 1945 | Forces a recharge. 1946 | ```java 1947 | function on_cm() 1948 | { 1949 | Exploit.Recharge() 1950 | } 1951 | Cheat.RegisterCallback("CreateMove", "on_cm") 1952 | ``` 1953 | 1954 | [ **GETCHARGE** ] 1955 | Syntax:Exploit.GetCharge(); 1956 | **Returns** a fraction (0 to 1). 1957 | ```java 1958 | function on_cm() 1959 | { 1960 | chargestate = Exploit.GetCharge() 1961 | Cheat.Print(chargestate + "\n") 1962 | } 1963 | Cheat.RegisterCallback("CreateMove", "on_cm") 1964 | ``` 1965 | 1966 | [back to Contents](#-1) 1967 | 1968 | 1969 | ## Ragebot 1970 | |-------------------------------| 1971 | 1972 | [ **IGNORETARGET** ] 1973 | Syntax:Ragebot.IgnoreTarget( entity_index ); 1974 | Ignores a target for 1 tick 1975 | 1976 | This example will force ragebot to ignore target player with name "llama" if possible. 1977 | You can change the name in code and use this as a whitelist for your friends on HVH servers. 1978 | 1979 | **Note:** ForceTarget is only active for 1 tick and must be called on CreateMove callback. 1980 | ```java 1981 | var target = 0 1982 | function cm() 1983 | { 1984 | target = Ragebot.GetTarget() 1985 | if (Entity.GetName(target) == "llama") 1986 | { 1987 | Ragebot.IgnoreTarget(target) 1988 | } 1989 | } 1990 | 1991 | Cheat.RegisterCallback("CreateMove", "cm") 1992 | ``` 1993 | 1994 | [ **FORCEHITBOXSAFETY** ] 1995 | Syntax:Ragebot.ForceHitboxSafety( hitbox_index ); 1996 | Forces safety on a specific hitbox 1997 | 1998 | **Hitboxes:** 1999 | 0 = head ( 4x damage ) 2000 | 1 = neck ( legacy in CSGO, does not actually register damage ) 2001 | 2 = pelvis ( 1.25x damage ) 2002 | 3 = body ( 1.25x damage ) 2003 | 4 = thorax 2004 | 5 = chest 2005 | 6 = upper chest 2006 | 7 = left thigh 2007 | 8 = right thigh 2008 | 9 = left calf 2009 | 10 = right calf 2010 | 11 = left foot 2011 | 12 = right foot 2012 | 2013 | This example will force ragebot to target only safe point of the hitbox if target velocity is less or equal to 90. 2014 | **Note:** ForceHitboxSafety is only active for 1 tick and must be called on CreateMove callback. 2015 | 2016 | ```java 2017 | var target = 0 2018 | function cm() 2019 | { 2020 | target = Ragebot.GetTarget() 2021 | if (GetVelocity(target) <= 90) 2022 | { 2023 | Ragebot.ForceHitboxSafety(0) 2024 | } 2025 | } 2026 | function GetVelocity(index) { 2027 | var velocity = Entity.GetProp(index, "CBasePlayer", "m_vecVelocity[0]"); 2028 | return Math.sqrt(velocity[0] * velocity[0] + velocity[1] * velocity[1]); 2029 | } 2030 | Cheat.RegisterCallback("CreateMove", "cm") 2031 | ``` 2032 | 2033 | [ **FORCETARGETMINIMUMDAMAGE** ] 2034 | Syntax:Ragebot.ForceTargetMinimumDamage(entity_index, value); 2035 | Overrides minimum damage on a specific target 2036 | This example will force ragebot's minimum damage to 80 if target velocity is less or equal to 90. 2037 | **Note:** ForceTargetMinimumDamage is only active for 1 tick and must be called on CreateMove callback. 2038 | 2039 | ```java 2040 | var target = 0 2041 | function cm() 2042 | { 2043 | target = Ragebot.GetTarget() 2044 | if (GetVelocity(target) <= 90) 2045 | { 2046 | Ragebot.ForceTargetMinimumDamage(target, 80) 2047 | } 2048 | } 2049 | function GetVelocity(index) { 2050 | var velocity = Entity.GetProp(index, "CBasePlayer", "m_vecVelocity[0]"); 2051 | return Math.sqrt(velocity[0] * velocity[0] + velocity[1] * velocity[1]); 2052 | } 2053 | Cheat.RegisterCallback("CreateMove", "cm") 2054 | ``` 2055 | 2056 | [ **FORCETARGETHITCHANCE** ] 2057 | Syntax:Ragebot.ForceTargetHitchance( entity_index, value); 2058 | Overrides hitchance on a specific target 2059 | This example will force ragebot's hitchance to 80 if target velocity is less or equal to 90. 2060 | **Note:** ForceTargetHitchance is only active for 1 tick and must be called on CreateMove callback. 2061 | 2062 | ```java 2063 | var target = 0 2064 | function cm() 2065 | { 2066 | target = Ragebot.GetTarget() 2067 | if (GetVelocity(target) <= 90) 2068 | { 2069 | Ragebot.ForceTargetHitchance(target, 80) 2070 | } 2071 | } 2072 | function GetVelocity(index) { 2073 | var velocity = Entity.GetProp(index, "CBasePlayer", "m_vecVelocity[0]"); 2074 | return Math.sqrt(velocity[0] * velocity[0] + velocity[1] * velocity[1]); 2075 | } 2076 | Cheat.RegisterCallback("CreateMove", "cm") 2077 | ``` 2078 | 2079 | [ **FORCETARGETSAFETY** ] 2080 | Syntax:Ragebot.ForceTargetSafety(entity_index); 2081 | Forces safety on a specific target. 2082 | This example will force ragebot safety on target if the target's name is "edeen". 2083 | **Note:** ForceTargetSafety is only active for 1 tick and must be called on CreateMove callback. 2084 | 2085 | ```java 2086 | var target = 0 2087 | function cm() 2088 | { 2089 | target = Ragebot.GetTarget() 2090 | if (Entity.GetName(target) == "edeen") 2091 | { 2092 | Ragebot.ForceTargetSafety(target) 2093 | } 2094 | } 2095 | Cheat.RegisterCallback("CreateMove", "cm") 2096 | ``` 2097 | 2098 | [ **FORCETARGET** ] 2099 | Syntax:Ragebot.ForceTarget(entity_index); 2100 | Forces the rage-bot to target a specific entity. 2101 | This example will force ragebot to target player with name "edeen" if possible. 2102 | **Note:** ForceTarget is only active for 1 tick and must be called on CreateMove callback. 2103 | 2104 | 2105 | ```java 2106 | var target = 0 2107 | function cm() 2108 | { 2109 | target = Ragebot.GetTarget() 2110 | if (Entity.GetName(target) == "edeen") 2111 | { 2112 | Ragebot.ForceTargetSafety(target) 2113 | } 2114 | } 2115 | Cheat.RegisterCallback("CreateMove", "cm") 2116 | ``` 2117 | 2118 | [ **GETTARGET** ] 2119 | Syntax:Ragebot.GetTarget(); 2120 | Used to get ragebot target. 2121 | 2122 | 2123 | ```java 2124 | var target = 0 2125 | function onCM(){ 2126 | target = Ragebot.GetTarget() 2127 | } 2128 | function onDraw(){ 2129 | var pos = Entity.GetRenderBox(target) 2130 | var font = Render.AddFont("Verdana", 8, 400) 2131 | var a = pos[3] - pos[1] 2132 | a /= 2 2133 | a += pos[1] 2134 | Render.StringCustom(a,pos[2] - 30,1,"TARGET", [255,255,255,255], font) 2135 | } 2136 | Cheat.RegisterCallback("CreateMove", "onCM") 2137 | Cheat.RegisterCallback("Draw", "onDraw") 2138 | ``` 2139 | 2140 | 2141 | 2142 | 2143 | [back to Contents](#-1) 2144 | 2145 | 2146 | ## Material 2147 | |-------------------------------| 2148 | 2149 | 2150 | [ **REFRESH** ] 2151 | Syntax:Material.Refresh( material_index ); 2152 | Used to apply new set key values. 2153 | **Returns** if the operation succeeded. 2154 | Note: This function can only be used in functions with Material callback. 2155 | More keys and values can be found below: 2156 | https://developer.valvesoftware.com/wiki/Category:List_of_Shader_Parameters 2157 | https://developer.valvesoftware.com/wiki/VertexLitGeneric 2158 | ```java 2159 | Material.Create("testmaterial"); 2160 | function updateMaterials() 2161 | { 2162 | mat_index = Material.Get("testmaterial"); 2163 | if (mat_index > 0) 2164 | { 2165 | Material.SetKeyValue(mat_index, "$baseTexture", "vgui/white"); 2166 | Material.SetKeyValue(mat_index, "$envmap", "models/effects/cube_white"); 2167 | Material.SetKeyValue(mat_index, "$envmapfresnel", "1"); 2168 | Material.SetKeyValue(mat_index, "$envmapfresnelminmaxexp", "[0 1 2]"); 2169 | Material.SetKeyValue(mat_index, "$color", "[1.0 1.0 1.0]"); 2170 | Material.SetKeyValue(mat_index, "$envmaptint", "[1.0 1.0 1.0]"); 2171 | Material.Refresh(mat_index); 2172 | } 2173 | } 2174 | Cheat.RegisterCallback("Material", "updateMaterials") 2175 | ``` 2176 | 2177 | [ **SETKEYVALUE** ] 2178 | Syntax:Material.SetKeyValue( material_index, key, value ); 2179 | Used to set key values. 2180 | **Returns** if the operation succeeded. 2181 | Note: This function can only be used in functions with Material callback. 2182 | More keys and values can be found below: 2183 | https://developer.valvesoftware.com/wiki/Category:List_of_Shader_Parameters 2184 | https://developer.valvesoftware.com/wiki/VertexLitGeneric 2185 | ```java 2186 | Material.Create("testmaterial"); 2187 | function updateMaterials() 2188 | { 2189 | mat_index = Material.Get("testmaterial"); 2190 | if (mat_index > 0) 2191 | { 2192 | Material.SetKeyValue(mat_index, "$baseTexture", "vgui/white"); 2193 | Material.SetKeyValue(mat_index, "$envmap", "models/effects/cube_white"); 2194 | Material.SetKeyValue(mat_index, "$envmapfresnel", "1"); 2195 | Material.SetKeyValue(mat_index, "$envmapfresnelminmaxexp", "[0 1 2]"); 2196 | Material.SetKeyValue(mat_index, "$color", "[1.0 1.0 1.0]"); 2197 | Material.SetKeyValue(mat_index, "$envmaptint", "[1.0 1.0 1.0]"); 2198 | Material.Refresh(mat_index); 2199 | } 2200 | } 2201 | Cheat.RegisterCallback("Material", "updateMaterials") 2202 | ``` 2203 | 2204 | [ **GET** ] 2205 | Syntax:Material.Get( name ); 2206 | Used to get material index. 2207 | **Returns** 0 if material doesn't exist. 2208 | **Note:** This function can only be used in functions with Material callback. 2209 | ```java 2210 | Material.Create("testmaterial"); 2211 | function updateMaterials() 2212 | { 2213 | mat_index = Material.Get("testmaterial"); 2214 | if (mat_index > 0) 2215 | { 2216 | Material.SetKeyValue(mat_index, "$baseTexture", "vgui/white"); 2217 | Material.SetKeyValue(mat_index, "$envmap", "models/effects/cube_white"); 2218 | Material.SetKeyValue(mat_index, "$envmapfresnel", "1"); 2219 | Material.SetKeyValue(mat_index, "$envmapfresnelminmaxexp", "[0 1 2]"); 2220 | Material.SetKeyValue(mat_index, "$color", "[1.0 1.0 1.0]"); 2221 | Material.SetKeyValue(mat_index, "$envmaptint", "[1.0 1.0 1.0]"); 2222 | Material.Refresh(mat_index); 2223 | } 2224 | } 2225 | Cheat.RegisterCallback("Material", "updateMaterials") 2226 | ``` 2227 | 2228 | [ **DESTROY** ] 2229 | Syntax:Material.Destroy( name ); 2230 | **Returns** true if material was destroyed successfully. 2231 | ```java 2232 | Material.Destroy("cool material") 2233 | ``` 2234 | 2235 | [ **CREATE** ] 2236 | Syntax:Material.Create( name ); 2237 | **Returns** true if material was created successfully or false otherwise. 2238 | ```java 2239 | Material.Create("cool material") 2240 | ``` 2241 | 2242 | 2243 | 2244 | [back to Contents](#-1) 2245 | 2246 | --------------------------------------------------------------------------------