Skip to content

Instantly share code, notes, and snippets.

@JuniorDjjr
Last active January 5, 2024 17:24
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/74abeda99982046898b1a0ad5c75c033 to your computer and use it in GitHub Desktop.
Save JuniorDjjr/74abeda99982046898b1a0ad5c75c033 to your computer and use it in GitHub Desktop.
// You need: https://forum.mixmods.com.br/f141-gta3script-cleo/t5206-como-criar-scripts-com-cleoplus
SCRIPT_START
{
LVAR_INT scplayer pPlayer pPlayerData pCurPro pLastPro hLastPro i iProMoney iStartPlayerMoney
GET_PLAYER_CHAR 0 (scplayer)
GET_PED_POINTER scplayer (pPlayer)
READ_STRUCT_OFFSET pPlayer 0x480 4 (pPlayerData)
WHILE TRUE
WAIT 0
IF IS_CHAR_IN_ANY_CAR scplayer
GOSUB ReadPro
IF pLastPro > 0x0
IF pCurPro = pLastPro
STORE_SCORE 0 iStartPlayerMoney
WHILE TRUE
WAIT 0
IF NOT IS_CHAR_SITTING_IN_ANY_CAR scplayer
BREAK
ENDIF
GOSUB ReadPro
IF pCurPro = 0x0
AND pLastPro > 0x0
GET_PED_REF pLastPro (hLastPro)
IF DOES_CHAR_EXIST hLastPro
STORE_SCORE 0 i
READ_STRUCT_OFFSET pLastPro 0x756 2 (iProMoney)
IF IS_CHEAT_ACTIVE 0x5A //ProstitutesPayYou
IF i <= iStartPlayerMoney // something is wrong
BREAK
ENDIF
iProMoney -= 40
IF iProMoney < 0
iProMoney = 0
ENDIF
ELSE
IF i >= iStartPlayerMoney // something is wrong
BREAK
ENDIF
iProMoney += 40
ENDIF
SET_CHAR_MONEY hLastPro iProMoney
BREAK
ENDIF
ENDIF
ENDWHILE
ENDIF
ENDIF
ENDIF
ENDWHILE
ReadPro:
READ_STRUCT_OFFSET pPlayerData 0xA4 4 (pCurPro)
READ_STRUCT_OFFSET pPlayerData 0xA8 4 (pLastPro)
//PRINT_FORMATTED_NOW "%x %x" 1000 pCurPro pLastPro
RETURN
}
SCRIPT_END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment