Created
October 8, 2021 01:59
-
-
Save JuniorDjjr/6de1729c5d4e755d5305f007c799052b to your computer and use it in GitHub Desktop.
This file contains hidden or 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/f141-gta3script-cleo/t5206-como-criar-scripts-com-cleo | |
SCRIPT_START | |
{ | |
LVAR_INT i pHospitalCoords pHospitalAngles iHospitalCountSize hPickup pX bCreatePickups pPickupsMemory iPickupsCount | |
LVAR_FLOAT x y z | |
CONST_INT MODEL_HEALTH 1240 | |
WAIT 1500 | |
SET_SCRIPT_EVENT_SAVE_CONFIRMATION On OnSaveConfirmation i | |
READ_MEMORY 0xA4326C 4 TRUE (iHospitalCountSize) | |
IF iHospitalCountSize > 0 | |
bCreatePickups = TRUE | |
iHospitalCountSize *= 12 // size of vector3 | |
ALLOCATE_MEMORY iHospitalCountSize (pPickupsMemory) | |
// limit adjuster adaptation | |
READ_MEMORY 0x5D379A 4 TRUE (pHospitalCoords) | |
READ_MEMORY 0x460765 4 TRUE (pHospitalAngles) | |
ENDIF | |
WHILE TRUE | |
WAIT 1111 | |
IF bCreatePickups = TRUE | |
GOSUB CreatePickups | |
bCreatePickups = FALSE | |
ENDIF | |
ENDWHILE | |
CreatePickups: | |
IF iHospitalCountSize > 0 | |
GET_VAR_POINTER x (pX) | |
i = 0 | |
iPickupsCount = 0 | |
WHILE i < iHospitalCountSize | |
READ_STRUCT_OFFSET pHospitalCoords i 4 (x) | |
i += 4 | |
READ_STRUCT_OFFSET pHospitalCoords i 4 (y) | |
i += 4 | |
READ_STRUCT_OFFSET pHospitalCoords i 4 (z) | |
i += 4 | |
GET_COORD_FROM_ANGLED_DISTANCE x y 45.0 2.2 (x y) | |
z += 1.0 | |
CREATE_PICKUP MODEL_HEALTH PICKUP_ON_STREET_SLOW x y z (hPickup) | |
WRITE_STRUCT_PARAM pPickupsMemory iPickupsCount hPickup | |
++iPickupsCount | |
ENDWHILE | |
ENDIF | |
RETURN | |
RemovePickups: | |
IF iPickupsCount > 0 | |
i = 0 | |
WHILE i < iPickupsCount | |
READ_STRUCT_PARAM pPickupsMemory i (hPickup) | |
REMOVE_PICKUP hPickup | |
++i | |
ENDWHILE | |
iPickupsCount = 0 | |
ENDIF | |
RETURN | |
OnSaveConfirmation: | |
GOSUB RemovePickups | |
bCreatePickups = TRUE | |
RETURN_SCRIPT_EVENT | |
} | |
SCRIPT_END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment