J16D

Call functions, disableGreenTriangles, input, padEmulation

Sep 5th, 2020 (edited)
536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //by J16D
  2. //Gta3Script by Link2012
  3. //https://gtaforums.com/topic/876530-gta3script-toolchain/
  4. //Call_functions
  5.  
  6. CONST_INT BYTE 1
  7. CONST_INT WORD 2
  8. CONST_INT DWORD 4
  9. {
  10. //CLEO_CALL disableGreenTriangles 0 ()
  11. disableGreenTriangles:
  12. LVAR_INT ptr
  13. READ_MEMORY 0x53E20E BYTE 0 (ptr)
  14. IF NOT ptr = 0x90
  15.     WRITE_MEMORY 0x53E20E 5 0x90 TRUE
  16. ELSE
  17.     READ_MEMORY 0x53E1E0 BYTE 0 (ptr)
  18.     IF NOT ptr = 0x90
  19.         WRITE_MEMORY 0x53E1E0 5 0x90 TRUE
  20.     ENDIF
  21. ENDIF
  22. CLEO_RETURN 0
  23. }
  24. {
  25. //CLEO_CALL getInputType 0 (hInput) //0=joypad; 1=mouse
  26. getInputType:
  27.     LVAR_INT hInput
  28.     READ_MEMORY 0xB6EC2E BYTE FALSE (hInput)
  29. CLEO_RETURN 0 hInput
  30. }
  31. {
  32. //CLEO_CALL padEmulation 0 /*scm key*/ 6   ///~k~~PED_LOCK_TARGET~
  33. padEmulation:
  34.     LVAR_INT scmKey //in
  35.     LVAR_INT ptr iVal
  36.     IF 4 > scmKey
  37.         iVal = 0x80 //128
  38.     ELSE
  39.         iVal = 0xFF //255
  40.     ENDIF
  41.     ptr = scmKey * 0x2
  42.     ptr += 0xB73458     // [word] Start of controls block (add 0x1AC for player 2).
  43.     WRITE_MEMORY ptr WORD iVal FALSE
  44.     //https://gtaforums.com/topic/194199-documenting-gta-sa-memory-addresses/page/36/?tab=comments#comment-1059674630
  45. CLEO_RETURN 0
  46. }
Add Comment
Please, Sign In to add comment