Created
February 25, 2022 11:58
-
-
Save JuniorDjjr/8a86396a7a4d819eb421e624374c182d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// by Junior_Djjr - MixMods.com.br | |
// You need: https://forum.mixmods.com.br/f141-gta3script-cleo/t5206-como-criar-scripts-com-cleoplus | |
SCRIPT_START | |
{ | |
LVAR_INT scplayer hChar i pX pPlayer iColorMode iOverlayIntensity iOverlayBlackIntensity bOnlyFirstPerson bDisableOnCutscenes | |
LVAR_FLOAT f x y z camX camY camZ fFirstPersonDetectDist | |
CONST_INT COLOR_NONE 0 | |
CONST_INT COLOR_BLACK 1 | |
CONST_INT COLOR_GRAY 2 | |
CONST_INT COLOR_RED 3 | |
CONST_INT COLOR_GREEN 4 | |
CONST_INT COLOR_BLUE 5 | |
CONST_INT COLOR_BROWN 6 | |
WAIT 500 | |
READ_INT_FROM_INI_FILE "CLEO\Glasses Color Overlay.ini" "Settings" "OnlyFirstPerson" (bOnlyFirstPerson) | |
READ_FLOAT_FROM_INI_FILE "CLEO\Glasses Color Overlay.ini" "Settings" "FirstPersonDetectDist" (fFirstPersonDetectDist) | |
READ_INT_FROM_INI_FILE "CLEO\Glasses Color Overlay.ini" "Settings" "DisableOnCutscenes" (bDisableOnCutscenes) | |
READ_INT_FROM_INI_FILE "CLEO\Glasses Color Overlay.ini" "Settings" "OverlayIntensity" (iOverlayIntensity) | |
READ_INT_FROM_INI_FILE "CLEO\Glasses Color Overlay.ini" "Settings" "OverlayBlackIntensity" (iOverlayBlackIntensity) | |
IF bOnlyFirstPerson = TRUE | |
SET_SCRIPT_EVENT_CHAR_PROCESS ON OnCharProcess (hChar) | |
ENDIF | |
GET_PLAYER_CHAR 0 (scplayer) | |
GET_PED_POINTER scplayer (pPlayer) | |
GET_VAR_POINTER x (pX) | |
iColorMode = 0 | |
WHILE TRUE | |
IF IS_CHAR_MODEL scplayer 0 | |
/*IF TEST_CHEAT BLACK | |
GIVE_PLAYER_CLOTHES_OUTSIDE_SHOP 0 "glasses01dark" glasses01 15 | |
BUILD_PLAYER_MODEL 0 | |
ENDIF | |
IF TEST_CHEAT BROWN | |
GIVE_PLAYER_CLOTHES_OUTSIDE_SHOP 0 "glasses04" glasses04 15 | |
BUILD_PLAYER_MODEL 0 | |
ENDIF | |
IF TEST_CHEAT RED | |
GIVE_PLAYER_CLOTHES_OUTSIDE_SHOP 0 "glasses03red" glasses03 15 | |
BUILD_PLAYER_MODEL 0 | |
ENDIF | |
IF TEST_CHEAT GREEN | |
GIVE_PLAYER_CLOTHES_OUTSIDE_SHOP 0 "glasses03" glasses03 15 | |
BUILD_PLAYER_MODEL 0 | |
ENDIF | |
IF TEST_CHEAT BLUE | |
GIVE_PLAYER_CLOTHES_OUTSIDE_SHOP 0 "glasses03blue" glasses03 15 | |
BUILD_PLAYER_MODEL 0 | |
ENDIF | |
IF TEST_CHEAT GRAY | |
GIVE_PLAYER_CLOTHES_OUTSIDE_SHOP 0 "glasses01" glasses01 15 | |
BUILD_PLAYER_MODEL 0 | |
ENDIF*/ | |
iColorMode = COLOR_NONE | |
WHILE TRUE | |
IF IS_PLAYER_WEARING 0 15 "glasses01dark" | |
OR IS_PLAYER_WEARING 0 15 "glasses03dark" | |
OR IS_PLAYER_WEARING 0 15 "glasses05dark" | |
OR IS_PLAYER_WEARING 0 15 "glasses05" | |
iColorMode = COLOR_BLACK | |
BREAK | |
ENDIF | |
IF IS_PLAYER_WEARING 0 15 "glasses01" | |
iColorMode = COLOR_GRAY | |
BREAK | |
ENDIF | |
IF IS_PLAYER_WEARING 0 15 "glasses04" | |
iColorMode = COLOR_BROWN | |
BREAK | |
ENDIF | |
IF IS_PLAYER_WEARING 0 15 "glasses03" | |
iColorMode = COLOR_GREEN | |
BREAK | |
ENDIF | |
IF IS_PLAYER_WEARING 0 15 "glasses03red" | |
iColorMode = COLOR_RED | |
BREAK | |
ENDIF | |
IF IS_PLAYER_WEARING 0 15 "glasses03blue" | |
iColorMode = COLOR_BLUE | |
BREAK | |
ENDIF | |
BREAK | |
ENDWHILE | |
IF bOnlyFirstPerson = FALSE | |
GOSUB DrawColorOverlay | |
ENDIF | |
ENDIF | |
// if using first person mod, no need to process every loop frame | |
IF bOnlyFirstPerson = FALSE | |
WAIT 0 | |
ELSE | |
WAIT 555 | |
ENDIF | |
ENDWHILE | |
OnCharProcess: | |
IF hChar = scplayer | |
//__thiscall CPed::GetBonePosition(CPed *this, CVector *pPoint, int bone_id, char bDynamic) | |
CALL_METHOD 0x5E4280 pPlayer 3 0 (1 6 pX)() | |
//PRINT_FORMATTED_NOW "%f %f %f" 1000 x y z | |
//DRAW_WEAPONSHOP_CORONA x y z 0.5 CORONATYPE_MOON FLARETYPE_NONE 255 255 0 | |
GET_ACTIVE_CAMERA_COORDINATES (camX camY camZ) | |
GET_DISTANCE_BETWEEN_COORDS_3D camX camY camZ x y z (f) | |
IF f < fFirstPersonDetectDist | |
GOSUB DrawColorOverlay | |
ENDIF | |
ENDIF | |
RETURN_SCRIPT_EVENT | |
DrawColorOverlay: | |
IF NOT iColorMode = COLOR_NONE | |
IF IS_ON_CUTSCENE | |
OR IS_ON_SCRIPTED_CUTSCENE | |
IF bDisableOnCutscenes = TRUE | |
RETURN | |
ENDIF | |
ENDIF | |
SWITCH iColorMode | |
CASE COLOR_BLACK | |
DRAW_TEXTURE_PLUS 0 DRAW_EVENT_BEFORE_HUD 320.0 224.0 640.0 448.0 0.0 0.0 FALSE 0 0 (0 0 0 iOverlayBlackIntensity) | |
BREAK | |
CASE COLOR_GRAY | |
DRAW_TEXTURE_PLUS 0 DRAW_EVENT_BEFORE_HUD 320.0 224.0 640.0 448.0 0.0 0.0 FALSE 0 0 (50 50 50 iOverlayIntensity) | |
BREAK | |
CASE COLOR_BROWN | |
DRAW_TEXTURE_PLUS 0 DRAW_EVENT_BEFORE_HUD 320.0 224.0 640.0 448.0 0.0 0.0 FALSE 0 0 (100 70 30 iOverlayIntensity) | |
BREAK | |
CASE COLOR_RED | |
DRAW_TEXTURE_PLUS 0 DRAW_EVENT_BEFORE_HUD 320.0 224.0 640.0 448.0 0.0 0.0 FALSE 0 0 (100 20 20 iOverlayIntensity) | |
BREAK | |
CASE COLOR_GREEN | |
DRAW_TEXTURE_PLUS 0 DRAW_EVENT_BEFORE_HUD 320.0 224.0 640.0 448.0 0.0 0.0 FALSE 0 0 (20 100 20 iOverlayIntensity) | |
BREAK | |
CASE COLOR_BLUE | |
DRAW_TEXTURE_PLUS 0 DRAW_EVENT_BEFORE_HUD 320.0 224.0 640.0 448.0 0.0 0.0 FALSE 0 0 (20 20 100 iOverlayIntensity) | |
BREAK | |
ENDSWITCH | |
ENDIF | |
RETURN | |
} | |
SCRIPT_END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment