Skip to content

Instantly share code, notes, and snippets.

@JuniorDjjr
Created July 26, 2017 08:48
Show Gist options
  • Save JuniorDjjr/5799616f9db6ea82e8f80cd7392be7fc to your computer and use it in GitHub Desktop.
Save JuniorDjjr/5799616f9db6ea82e8f80cd7392be7fc to your computer and use it in GitHub Desktop.
SCRIPT_START
{
LVAR_INT scplayer
LVAR_INT char n pedtype
GET_PLAYER_CHAR 0 (scplayer)
main_loop:
WAIT 0
IF IS_BUTTON_PRESSED PAD1 DPADLEFT // Negative response
IF GET_CHAR_PLAYER_IS_TARGETING 0 char
TASK_SAY scplayer 110
TASK_LOOK_AT_CHAR scplayer char 2000
TASK_LOOK_AT_CHAR char scplayer 2000
IF GOSUB IsAimingWeapon
ELSE
GENERATE_RANDOM_INT_IN_RANGE 0 6 (n)
SWITCH (n)
CASE 0
REQUEST_ANIMATION TAUNT
LOAD_ALL_MODELS_NOW
TASK_PLAY_ANIM_SECONDARY scplayer (TAUNT1 TAUNT) (4.0 0 0 0 0) -1
REMOVE_ANIMATION TAUNT
BREAK
CASE 1
REQUEST_ANIMATION TAUNT
LOAD_ALL_MODELS_NOW
TASK_PLAY_ANIM_SECONDARY scplayer (TAUNT2 TAUNT) (4.0 0 0 0 0) -1
REMOVE_ANIMATION TAUNT
BREAK
CASE 2
REQUEST_ANIMATION GHANDS
LOAD_ALL_MODELS_NOW
TASK_PLAY_ANIM_SECONDARY scplayer (GSIGN1LH GHANDS) (4.0 0 0 0 0) -1
REMOVE_ANIMATION GHANDS
BREAK
CASE 3
REQUEST_ANIMATION GHANDS
LOAD_ALL_MODELS_NOW
TASK_PLAY_ANIM_SECONDARY scplayer (GSIGN2LH GHANDS) (4.0 0 0 0 0) -1
REMOVE_ANIMATION GHANDS
BREAK
CASE 4
REQUEST_ANIMATION GHANDS
LOAD_ALL_MODELS_NOW
TASK_PLAY_ANIM_SECONDARY scplayer (GSIGN3LH GHANDS) (4.0 0 0 0 0) -1
REMOVE_ANIMATION GHANDS
BREAK
CASE 5
REQUEST_ANIMATION GHANDS
LOAD_ALL_MODELS_NOW
TASK_PLAY_ANIM_SECONDARY scplayer (GSIGN5LH GHANDS) (4.0 0 0 0 0) -1
REMOVE_ANIMATION GHANDS
BREAK
ENDSWITCH
ENDIF
GET_PED_TYPE char (pedtype)
IF pedtype >= 7 // Is gang (+ dealer)
AND pedtype <= 17
IF pedtype = 8 // Is Families
n = 30
ELSE // Other gangs
n = 2
ENDIF
ELSE // Not gang
IF pedtype = 6 // Is cop
n = 2
ELSE // Not cop
IF pedtype = 20 // Is prostitute
OR pedtype = 22 // Is criminal
n = 5
ELSE // Default
n = 10
ENDIF
ENDIF
ENDIF
IF GOSUB IsAimingWeapon
IF NOT pedtype = 6 // Not cop
n *= 4 // Much harder
ENDIF
ENDIF
WAIT 1500 // Time to speak
IF DOES_CHAR_EXIST char // Does char exist yet?
AND NOT IS_CHAR_DEAD char
GENERATE_RANDOM_INT_IN_RANGE 0 n (n)
IF n = 1
IF pedtype = 6 // Is cop
ALTER_WANTED_LEVEL_NO_DROP 0 1
ELSE // Not cop
TASK_KILL_CHAR_ON_FOOT char scplayer
ENDIF
ENDIF
ENDIF
WAIT 7000 // Time limit to CJ speak again (game limit...)
ENDIF
ENDIF
GOTO main_loop
IsAimingWeapon:
READ_MEMORY 0xB6F1A8 2 FALSE (n)
IS_THING_EQUAL_TO_THING n 53
RETURN
}
SCRIPT_END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment