Skip to content

Instantly share code, notes, and snippets.

@JuniorDjjr
Created August 5, 2022 17:01
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/3e40a133129b1815009ad513c63e8c2b to your computer and use it in GitHub Desktop.
Save JuniorDjjr/3e40a133129b1815009ad513c63e8c2b to your computer and use it in GitHub Desktop.
// by Junior_Djjr - MixMods.com.br
// You need: https://forum.mixmods.com.br/f141-gta3script-cleo/t5206-como-criar-scripts-com-cleoplus
SCRIPT_START
{
LVAR_INT scplayer hVeh hChar iType i
LVAR_FLOAT fIntensity
WAIT 1000
GET_PLAYER_CHAR 0 (scplayer)
SET_SCRIPT_EVENT_CAR_PROCESS ON OnCarProcess hVeh
SET_SCRIPT_EVENT_CAR_WEAPON_DAMAGE ON OnCarWeaponDamage hVeh
WHILE TRUE
WAIT 0x7FFFFFFF
ENDWHILE
OnCarProcess:
IF IS_CAR_MODEL hVeh RHINO
// required to use car process event because the game forces proofs every frame for army rhinos
SET_CAR_PROOFS hVeh 1 1 0 1 1
ENDIF
RETURN_SCRIPT_EVENT
OnCarWeaponDamage:
IF IS_CAR_MODEL hVeh RHINO
SET_CAR_PROOFS hVeh 1 1 1 1 1 //default
GET_CAR_WEAPON_DAMAGE_LAST_FRAME hVeh hChar iType fIntensity
//explosion by someone
IF iType = WEAPONTYPE_EXPLOSION
AND hChar > 0
IF DOES_CHAR_EXIST hChar
// ignore damage if the char is in car and is not player (eg cars exploding)
GET_PED_TYPE hChar i
IF IS_CHAR_IN_ANY_CAR hChar
OR i <= 1 //except if player
IF NOT IS_CHAR_IN_CAR hChar hVeh //ignore damage by itself
SET_CAR_PROOFS hVeh 1 1 0 1 1
ENDIF
ENDIF
ENDIF
//PRINT_FORMATTED_NOW "%x %i %f" 1000 hChar iType fIntensity
ENDIF
ENDIF
RETURN_SCRIPT_EVENT
}
SCRIPT_END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment