Last active
January 5, 2024 17:54
-
-
Save JuniorDjjr/86f74658f9bcce1082ad028e6cdd7417 to your computer and use it in GitHub Desktop.
This file contains 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/f16-utilidades/t179-gta3script-while-true-return_true-e-return_false | |
SCRIPT_START | |
{ | |
LVAR_INT scplayer p task char taskCop key1 key2 gamepad | |
LVAR_FLOAT x y z | |
GET_PLAYER_CHAR 0 scplayer | |
IF READ_INT_FROM_INI_FILE "CLEO\Surrender.ini" "Settings" "Key1" (key1) | |
AND READ_INT_FROM_INI_FILE "CLEO\Surrender.ini" "Settings" "Key2" (key2) | |
AND READ_INT_FROM_INI_FILE "CLEO\Surrender.ini" "Settings" "GamepadMode" (gamepad) | |
ELSE | |
timera = 0 | |
WHILE timera < 4000 | |
WAIT 0 | |
PRINT_STRING_NOW "Fail to read 'CLEO\Surrender.ini'" 1000 | |
ENDWHILE | |
TERMINATE_THIS_CUSTOM_SCRIPT | |
ENDIF | |
WHILE TRUE | |
WAIT 0 | |
IF IS_WANTED_LEVEL_GREATER 0 0 | |
IF NOT IS_CHAR_SITTING_IN_ANY_CAR scplayer | |
AND IS_PLAYER_CONTROL_ON 0 | |
AND IS_PLAYER_PLAYING 0 | |
IF GOSUB Enable | |
SET_CURRENT_CHAR_WEAPON scplayer WEAPONTYPE_UNARMED | |
SET_PLAYER_CYCLE_WEAPON_BUTTON 0 OFF | |
REQUEST_ANIMATION HOSTAGE | |
LOAD_ALL_MODELS_NOW | |
OPEN_SEQUENCE_TASK task | |
TASK_PLAY_ANIM_NON_INTERRUPTABLE -1 (otage_start, HOSTAGE) 4.0 0 0 0 0 -1 | |
TASK_PLAY_ANIM_NON_INTERRUPTABLE -1 (otage_idle, HOSTAGE) 4.0 1 0 0 0 -1 | |
CLOSE_SEQUENCE_TASK task | |
PERFORM_SEQUENCE_TASK scplayer task | |
WAIT 800 | |
GET_PED_POINTER scplayer p | |
p += 0x530 // PedState | |
WRITE_MEMORY p 4 63 FALSE | |
OPEN_SEQUENCE_TASK taskCop | |
TASK_TURN_CHAR_TO_FACE_CHAR -1 scplayer | |
TASK_PLAY_ANIM_NON_INTERRUPTABLE -1 (ARRESTgun, PED) 4.0 0 0 0 1 -1 | |
CLOSE_SEQUENCE_TASK taskCop | |
GET_CHAR_COORDINATES scplayer x y z | |
IF GET_RANDOM_CHAR_IN_SPHERE_NO_SAVE_RECURSIVE x y z 200.0 FALSE TRUE (char) | |
GOSUB CopAim | |
WHILE GET_RANDOM_CHAR_IN_SPHERE_NO_SAVE_RECURSIVE x y z 200.0 TRUE TRUE (char) | |
GOSUB CopAim | |
ENDWHILE | |
ENDIF | |
SET_POLICE_IGNORE_PLAYER 0 ON | |
SET_EVERYONE_IGNORE_PLAYER 0 ON | |
timera = 0 | |
WHILE IS_PLAYER_PLAYING 0 | |
WAIT 0 | |
IF IS_CHAR_DEAD scplayer | |
TASK_PLAY_ANIM_NON_INTERRUPTABLE scplayer (otage_dead, HOSTAGE) 4.0 1 0 0 0 -1 | |
BREAK | |
ENDIF | |
SET_CURRENT_CHAR_WEAPON scplayer WEAPONTYPE_UNARMED | |
SET_PLAYER_CYCLE_WEAPON_BUTTON 0 OFF | |
IF timera > 5000 | |
BREAK //something wrong | |
ENDIF | |
ENDWHILE | |
SET_POLICE_IGNORE_PLAYER 0 OFF | |
SET_EVERYONE_IGNORE_PLAYER 0 OFF | |
CLEAR_SEQUENCE_TASK task | |
CLEAR_SEQUENCE_TASK taskCop | |
SET_PLAYER_CYCLE_WEAPON_BUTTON 0 ON | |
ENDIF | |
ENDIF | |
ENDIF | |
ENDWHILE | |
Enable: | |
IF gamepad = TRUE | |
IF IS_BUTTON_PRESSED PAD1 key1 | |
AND IS_BUTTON_PRESSED PAD1 key2 | |
RETURN_TRUE | |
ELSE | |
RETURN_FALSE | |
ENDIF | |
ELSE | |
IF IS_KEY_PRESSED key1 | |
AND IS_KEY_PRESSED key2 | |
RETURN_TRUE | |
ELSE | |
RETURN_FALSE | |
ENDIF | |
ENDIF | |
RETURN | |
CopAim: | |
GET_PED_TYPE char (p) | |
IF p = 6 //COP | |
GET_CURRENT_CHAR_WEAPON char p | |
IF NOT p = 3 | |
AND NOT p = 0 | |
PERFORM_SEQUENCE_TASK char taskCop | |
ELSE | |
TASK_GOTO_CHAR char scplayer 3000 1.0 | |
ENDIF | |
ENDIF | |
RETURN | |
} | |
SCRIPT_END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment