Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// by Junior_Djjr - MixMods.com.br
// You need: https://forum.mixmods.com.br/f141-gta3script-cleo/t26-indice-de-tutoriais-cleo-script-gta3script
SCRIPT_START
{
LVAR_INT scplayer rand tempChar pBuffer hAudio iLastVoiceId target
LVAR_FLOAT fVolume x y z
GET_PLAYER_CHAR 0 scplayer
WHILE TRUE
WAIT 0
IF NOT IS_CURRENT_CHAR_WEAPON scplayer 0
AND NOT IS_CHAR_IN_ANY_CAR scplayer
IF CLEO_CALL CharStealth 0 (scplayer)(target)
GET_PED_REF target (target)
GOSUB PlayRandomStealthVoice
ENDIF
ENDIF
ENDWHILE
PlayRandomStealthVoice:
GET_CHAR_COORDINATES scplayer x y z
IF GET_RANDOM_CHAR_IN_SPHERE_NO_SAVE_RECURSIVE x y z 7.0 FALSE TRUE (tempChar) // find first
IF GET_RANDOM_CHAR_IN_SPHERE_NO_SAVE_RECURSIVE x y z 7.0 TRUE TRUE (tempChar) // find second
// wait until stealth is completed
WHILE CLEO_CALL CharStealth 0 (scplayer)(target)
WAIT 0
ENDWHILE
RETURN // there is more than 1 ped near, keep quiet!!!
ENDIF
ENDIF
GENERATE_RANDOM_INT_IN_RANGE 1 10 (rand)
WHILE iLastVoiceId = rand
GENERATE_RANDOM_INT_IN_RANGE 1 10 (rand)
IF rand = 5 // "sorry, man"
IF NOT IS_CHAR_MALE target
rand = 7 // "goodnight, bitch"
ENDIF
ENDIF
ENDWHILE
iLastVoiceId = rand
GET_LABEL_POINTER Buffer (pBuffer)
STRING_FORMAT pBuffer "CLEO/Restore Stealth Voices/voice%d.ogg" rand
LOAD_3D_AUDIO_STREAM $pBuffer (hAudio)
SET_PLAY_3D_AUDIO_STREAM_AT_CHAR hAudio scplayer
READ_MEMORY 0xB5FCCC 4 FALSE fVolume
fVolume *= 0.6
SET_AUDIO_STREAM_VOLUME hAudio fVolume
SET_AUDIO_STREAM_STATE hAudio 1
START_CHAR_FACIAL_TALK scplayer 1500
WAIT 1500
STOP_CHAR_FACIAL_TALK scplayer
WAIT 1500
REMOVE_AUDIO_STREAM hAudio
RETURN
}
SCRIPT_END
Buffer:
DUMP
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ENDDUMP
{
LVAR_INT hChar // in
LVAR_INT p i
CharStealth:
GET_PED_POINTER hChar p
p += 0x47C //m_pIntelligence
READ_MEMORY p 4 FALSE (p)
i = p + 0x4 //m_TaskMgr.m_primaryTasks dd 5 dup
i += 12 //[3]
READ_MEMORY i 4 FALSE (i)
IF i > 0
READ_MEMORY i 4 FALSE (p)
p += 0x10 // get id
READ_MEMORY p 4 FALSE (p)
CALL_METHOD_RETURN p i 0 0 (p)
IF p = 1027 // task id
i += 12 // target
READ_MEMORY i 4 FALSE i
IF i > 0
RETURN_TRUE
CLEO_RETURN 0 i
ENDIF
ENDIF
ENDIF
RETURN_FALSE
CLEO_RETURN 0 -1
}
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.