Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// You need: https://forum.mixmods.com.br/f141-gta3script-cleo/t26-indice-de-tutoriais-cleo-script-gta3script
SCRIPT_START
{
LVAR_INT scplayer isInfrared isNight totalIniWeapons weaponTypes[16] i j pBuffer disableCmd
GET_PLAYER_CHAR 0 (scplayer)
GET_LABEL_POINTER Buffer pBuffer
WAIT 500
j = 1
WHILE i < 16
STRING_FORMAT pBuffer "WeaponType%i" j
IF READ_INT_FROM_INI_FILE "CLEO/Night & Thermal Vision Scope.ini" "Settings" $pBuffer (weaponTypes[i])
i++
totalIniWeapons++
ELSE
BREAK
ENDIF
j++
ENDWHILE
IF totalIniWeapons = 0
TERMINATE_THIS_CUSTOM_SCRIPT
ENDIF
WHILE TRUE
WAIT 0
IF IS_PLAYER_CONTROL_ON 0
AND NOT IS_CHAR_IN_ANY_CAR scplayer
IF GOSUB IsScopeAiming
IF GOSUB IsHoldingValidWeapon
isInfrared = OFF
isNight = OFF
disableCmd = OFF
WHILE GOSUB IsScopeAiming
WAIT 0
IF disableCmd = TRUE
IF NOT IS_BUTTON_PRESSED PAD1 8
AND NOT IS_BUTTON_PRESSED PAD1 9
disableCmd = FALSE
ELSE
CONTINUE
ENDIF
ENDIF
IF IS_BUTTON_PRESSED PAD1 8
IF isNight = ON
isNight = OFF
SET_NIGHT_VISION isNight
ENDIF
IF isInfrared = ON
isInfrared = OFF
ELSE
isInfrared = ON
ENDIF
SET_INFRARED_VISION isInfrared
disableCmd = TRUE
ENDIF
IF IS_BUTTON_PRESSED PAD1 9
IF isInfrared = ON
isInfrared = OFF
SET_INFRARED_VISION isInfrared
ENDIF
IF isNight = ON
isNight = OFF
ELSE
isNight = ON
ENDIF
SET_NIGHT_VISION isNight
disableCmd = TRUE
ENDIF
ENDWHILE
IF isInfrared = ON
isInfrared = OFF
SET_INFRARED_VISION isInfrared
ENDIF
IF isNight = ON
isNight = OFF
SET_NIGHT_VISION isNight
ENDIF
ENDIF
ENDIF
ENDIF
ENDWHILE
IsHoldingValidWeapon:
i = 0
WHILE i < totalIniWeapons
IF IS_CURRENT_CHAR_WEAPON scplayer weaponTypes[i]
RETURN_TRUE
RETURN
ENDIF
i++
ENDWHILE
RETURN_FALSE
RETURN
CONST_INT MODE_NONE 0
CONST_INT MODE_TOPDOWN 1
CONST_INT MODE_GTACLASSIC 2
CONST_INT MODE_BEHINDCAR 3
CONST_INT MODE_FOLLOWPED 4
CONST_INT MODE_AIMING 5
CONST_INT MODE_DEBUG 6
CONST_INT MODE_SNIPER 7
CONST_INT MODE_ROCKETLAUNCHER 8
CONST_INT MODE_MODELVIEW 9
CONST_INT MODE_BILL 10
CONST_INT MODE_SYPHON 11
CONST_INT MODE_CIRCLE 12
CONST_INT MODE_CHEESYZOOM 13
CONST_INT MODE_WHEELCAM 14
CONST_INT MODE_FIXED 15
CONST_INT MODE_1STPERSON 16
CONST_INT MODE_FLYBY 17
CONST_INT MODE_CAM_ON_A_STRING 18
CONST_INT MODE_REACTION 19
CONST_INT MODE_FOLLOW_PED_WITH_BIND 20
CONST_INT MODE_CHRIS 21
CONST_INT MODE_BEHINDBOAT 22
CONST_INT MODE_PLAYER_FALLEN_WATER 23
CONST_INT MODE_CAM_ON_TRAIN_ROOF 24
CONST_INT MODE_CAM_RUNNING_SIDE_TRAIN 25
CONST_INT MODE_BLOOD_ON_THE_TRACKS 26
CONST_INT MODE_IM_THE_PASSENGER_WOOWOO 27
CONST_INT MODE_SYPHON_CRIM_IN_FRONT 28
CONST_INT MODE_PED_DEAD_BABY 29
CONST_INT MODE_PILLOWS_PAPS 30
CONST_INT MODE_LOOK_AT_CARS 31
CONST_INT MODE_ARRESTCAM_ONE 32
CONST_INT MODE_ARRESTCAM_TWO 33
CONST_INT MODE_M16_1STPERSON 34
CONST_INT MODE_SPECIAL_FIXED_FOR_SYPHON 35
CONST_INT MODE_FIGHT_CAM 36
CONST_INT MODE_TOP_DOWN_PED 37
CONST_INT MODE_LIGHTHOUSE 38
CONST_INT MODE_SNIPER_RUNABOUT 39
CONST_INT MODE_ROCKETLAUNCHER_RUNABOUT 40
CONST_INT MODE_1STPERSON_RUNABOUT 41
CONST_INT MODE_M16_1STPERSON_RUNABOUT 42
CONST_INT MODE_FIGHT_CAM_RUNABOUT 43
CONST_INT MODE_EDITOR 44
CONST_INT MODE_HELICANNON_1STPERSON 45
CONST_INT MODE_CAMERA 46
CONST_INT MODE_ATTACHCAM 47
CONST_INT MODE_TWOPLAYER 48
CONST_INT MODE_TWOPLAYER_IN_CAR_AND_SHOOTING 49
CONST_INT MODE_TWOPLAYER_SEPARATE_CARS 50
CONST_INT MODE_ROCKETLAUNCHER_HS 51
CONST_INT MODE_ROCKETLAUNCHER_RUNABOUT_HS 52
CONST_INT MODE_AIMWEAPON 53
CONST_INT MODE_TWOPLAYER_SEPARATE_CARS_TOPDOWN 54
CONST_INT MODE_AIMWEAPON_FROMCAR 55
CONST_INT MODE_DW_HELI_CHASE 56
CONST_INT MODE_DW_CAM_MAN 57
CONST_INT MODE_DW_BIRDY 58
CONST_INT MODE_DW_PLANE_SPOTTER 59
CONST_INT MODE_DW_DOG_FIGHT 60
CONST_INT MODE_DW_FISH 61
CONST_INT MODE_DW_PLANECAM1 62
CONST_INT MODE_DW_PLANECAM2 63
CONST_INT MODE_DW_PLANECAM3 64
CONST_INT MODE_AIMWEAPON_ATTACHED 65
LVAR_INT camMode
IsScopeAiming:
READ_MEMORY 0x00B6F1A8 2 FALSE (camMode)
IF camMode = MODE_SNIPER
OR camMode = MODE_ROCKETLAUNCHER
OR camMode = MODE_CAMERA
OR camMode = MODE_ROCKETLAUNCHER_HS
RETURN_TRUE
RETURN
ENDIF
RETURN_FALSE
RETURN
Buffer:
DUMP
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ENDDUMP
}
SCRIPT_END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.