Skip to content

Instantly share code, notes, and snippets.

@JuniorDjjr
Last active January 5, 2024 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JuniorDjjr/6437053cafef2cb389b97d851e025974 to your computer and use it in GitHub Desktop.
Save JuniorDjjr/6437053cafef2cb389b97d851e025974 to your computer and use it in GitHub Desktop.
// 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 char fire fires pchar pfire random pedtype progress proofs[5]
LVAR_FLOAT x y z char_x char_y char_z
NOP
WHILE TRUE
WAIT 500
progress = 0
WHILE GET_ANY_CHAR_NO_SAVE_RECURSIVE progress (progress char)
GOSUB Apply
ENDWHILE
ENDWHILE
Apply:
IF IS_CHAR_SCRIPT_CONTROLLED char
RETURN
ENDIF
GET_PED_TYPE char (pedtype)
IF pedtype = PEDTYPE_FIRE
GET_CHAR_PROOFS char proofs[0] proofs[1] proofs[2] proofs[3] proofs[4]
proofs[1] = TRUE //fire
SET_CHAR_PROOFS char proofs[0] proofs[1] proofs[2] proofs[3] proofs[4]
RETURN
ENDIF
IF IS_CHAR_IN_ANY_CAR char
OR IS_CHAR_DEAD char
RETURN
ENDIF
GET_CHAR_COORDINATES char (char_x char_y char_z)
GET_NUMBER_OF_FIRES_IN_RANGE char_x char_y char_z 1.0 (fires)
IF fires > 0
GET_PED_POINTER char pchar
pchar += 0x730
READ_MEMORY pchar 4 FALSE (pfire)
IF NOT pfire > 0
STREAM_CUSTOM_SCRIPT_FROM_LABEL ScriptForChar (char)
ENDIF
ENDIF
RETURN
}
SCRIPT_END
{
LVAR_INT char //In
LVAR_INT fire random
ScriptForChar:
IF DOES_CHAR_EXIST char
START_CHAR_FIRE char (fire)
GENERATE_RANDOM_INT_IN_RANGE 2000 5000 (random)
timera = 0
WHILE DOES_CHAR_EXIST char
AND DOES_SCRIPT_FIRE_EXIST fire
AND timera < random
WAIT 0
ENDWHILE
REMOVE_SCRIPT_FIRE fire
ENDIF
TERMINATE_THIS_CUSTOM_SCRIPT
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment