Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SCRIPT_START
{
LVAR_INT scplayer ped pedtype player_group weaponid createdby
LVAR_FLOAT x y z
GET_PLAYER_CHAR 0 scplayer
main_loop:
WAIT 1000
IF IS_PLAYER_PLAYING 0
IF IS_CURRENT_CHAR_WEAPON scplayer WEAPONTYPE_CHAINSAW
IF IS_CHAR_PLAYING_ANIM scplayer CSAW_1
OR IS_CHAR_PLAYING_ANIM scplayer CSAW_2
OR IS_CHAR_PLAYING_ANIM scplayer CSAW_3
OR IS_CHAR_PLAYING_ANIM scplayer CSAW_G
OR IS_CHAR_PLAYING_ANIM scplayer CSAW_PART
GET_CHAR_COORDINATES scplayer x y z
IF GET_RANDOM_CHAR_IN_SPHERE_NO_SAVE_RECURSIVE (x y z 30.0) FALSE FALSE (ped)
GOSUB panic_ped
WHILE GET_RANDOM_CHAR_IN_SPHERE_NO_SAVE_RECURSIVE (x y z 30.0) TRUE FALSE (ped)
GOSUB panic_ped
ENDWHILE
ENDIF
ENDIF
ENDIF
ENDIF
GOTO main_loop
panic_ped:
TASK_LOOK_AT_CHAR ped scplayer 5000
IF NOT IS_CHAR_SITTING_IN_ANY_CAR ped
IF LOCATE_CHAR_ANY_MEANS_CHAR_3D ped scplayer 10.0 10.0 5.0 FALSE
GET_PED_POINTER ped (createdby)
createdby += 0x484
READ_MEMORY createdby 1 FALSE (createdby)
IF createdby = 1
GET_PED_TYPE ped pedtype
IF pedtype = 6 // COP
ALTER_WANTED_LEVEL_NO_DROP 0 1
ELSE
GET_PLAYER_GROUP 0 player_group
IF NOT IS_GROUP_MEMBER ped player_group
IF pedtype = 8 //GANG2
IF LOCATE_CHAR_ANY_MEANS_CHAR_3D ped scplayer 5.0 5.0 5.0 FALSE
TASK_SMART_FLEE_CHAR ped scplayer 25.0 5000
ENDIF
RETURN
ELSE
IF GOSUB check_weapon
TASK_KILL_CHAR_ON_FOOT_TIMED ped scplayer 10000
RETURN
ENDIF
TASK_SMART_FLEE_CHAR ped scplayer 40.0 5000
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
RETURN
check_weapon:
GET_CURRENT_CHAR_WEAPON ped (weaponid)
IF weaponid >= 16
AND weaponid <= 39
IS_PC_VERSION
RETURN
ENDIF
IF weaponid = 9 //chainsaw
OR weaponid >= 70 //any added
IS_PC_VERSION
RETURN
ENDIF
IS_AUSTRALIAN_GAME
RETURN
}
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.