Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// You need: https://forum.mixmods.com.br/f16-utilidades/t179-gta3script-while-true-return_true-e-return_false
SCRIPT_START
{
LVAR_INT i j playerId mode ignoredLastFrame[2] noWantedLastFrame maxWantedBackup playerWithUniform[2] numPlayersUsing dontEnableFor2players
IF NOT READ_INT_FROM_INI_FILE "CLEO/Cop Outfit.ini" "Settings" "Mode" (mode)
OR mode < 1
OR mode > 3
TERMINATE_THIS_CUSTOM_SCRIPT
ENDIF
maxWantedBackup = 6
WHILE TRUE
WAIT 300
dontEnableFor2players = FALSE
IF IS_PLAYER_WEARING 0 17 POLICETR
playerWithUniform[0] = TRUE
numPlayersUsing++
ENDIF
IF IS_2PLAYER_GAME_GOING_ON
IF IS_PLAYER_WEARING 1 17 POLICETR
playerWithUniform[1] = TRUE
numPlayersUsing++
ELSE
dontEnableFor2players = TRUE
ENDIF
ENDIF
IF numPlayersUsing > 0
IF mode < 3
GOSUB ApplySCMfixes
ENDIF
IF mode > 1
playerId = 0
GOSUB ApplyIgnore
playerId = 1
GOSUB ApplyIgnore
ENDIF
IF mode = 3
IF dontEnableFor2players = FALSE
GET_MAX_WANTED_LEVEL (i)
IF noWantedLastFrame = FALSE
AND i > 0
maxWantedBackup = i
noWantedLastFrame = TRUE
ENDIF
SET_MAX_WANTED_LEVEL 0
ELSE
IF noWantedLastFrame = TRUE
SET_MAX_WANTED_LEVEL maxWantedBackup
noWantedLastFrame = FALSE
ENDIF
ENDIF
ENDIF
ELSE
IF mode = 3
IF noWantedLastFrame = TRUE
SET_MAX_WANTED_LEVEL maxWantedBackup
noWantedLastFrame = FALSE
ENDIF
ENDIF
ENDIF
ENDWHILE
ApplySCMfixes:
GET_SCRIPT_STRUCT_NAMED INTMAN (i)
IF i > 0
i += 0x14 //ip
READ_MEMORY i 4 FALSE (i)
i += 3010
READ_MEMORY i 1 TRUE (j)
IF j = 0
OR j = 2
IF dontEnableFor2players = FALSE
WRITE_MEMORY i 1 (0) TRUE
ELSE
WRITE_MEMORY i 1 (2) TRUE
ENDIF
ENDIF
ENDIF
RETURN
ApplyIgnore:
IF playerWithUniform[playerId] = TRUE
SET_POLICE_IGNORE_PLAYER playerId (TRUE)
ignoredLastFrame[playerId] = TRUE
ELSE
IF ignoredLastFrame[playerId] = TRUE // Avoid disabling the ignore every time, for better compatibility
ignoredLastFrame[playerId] = FALSE
SET_POLICE_IGNORE_PLAYER playerId (FALSE)
ENDIF
ENDIF
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.