Skip to content

Instantly share code, notes, and snippets.

@UmGeek
Created July 2, 2018 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UmGeek/7dd16679bffb036e6677ca7f4d1b9267 to your computer and use it in GitHub Desktop.
Save UmGeek/7dd16679bffb036e6677ca7f4d1b9267 to your computer and use it in GitHub Desktop.
// Um Geek
SCRIPT_START
{
NOP
LVAR_INT hPed hCar teleport
LVAR_FLOAT max min x y z
IF NOT READ_INT_FROM_INI_FILE "cleo\Sa-In-Sphere (Um-Geek).ini" "Settings" "Disable Mod" teleport
teleport = 0
WRITE_INT_TO_INI_FILE teleport "cleo\Sa-In-Sphere (Um-Geek).ini" "Settings" "Disable Mod"
ENDIF
IF NOT (teleport = 1)
IF NOT READ_FLOAT_FROM_INI_FILE "cleo\Sa-In-Sphere (Um-Geek).ini" "Settings" "Map Size" max
max = 4000.0
WRITE_FLOAT_TO_INI_FILE max "cleo\Sa-In-Sphere (Um-Geek).ini" "Settings" "Map Size"
ENDIF
min = max * -1.
GET_PLAYER_CHAR 0 hPed
Sphere:
IF IS_PLAYER_PLAYING 0
GET_CHAR_COORDINATES hPed x y z
IF (x > max)
x = min + 10.
teleport = 1
ELSE
IF (x < min)
x = max - 10.
teleport = 1
ENDIF
ENDIF
IF (y > max)
y = min + 10.
teleport = 1
ELSE
IF (y < min)
y = max - 10.
teleport = 1
ENDIF
ENDIF
IF (teleport = 1)
z += 1.0
IF IS_CHAR_IN_ANY_CAR hPed
GET_CAR_CHAR_IS_USING hPed hCar
CLEO_CALL SET_POS_SIMPLE 0 () hCar 0 x y z
ELSE
CLEO_CALL SET_POS_SIMPLE 0 () hPed 1 x y z
ENDIF
teleport = 0
ENDIF
ENDIF
WAIT 0
GOTO Sphere
ENDIF
TERMINATE_THIS_CUSTOM_SCRIPT
}
{
LVAR_INT handle mode // in
LVAR_FLOAT x,y,z // in
LVAR_INT pcoords
SET_POS_SIMPLE:
IF (mode = 1)
GET_PED_POINTER handle pcoords
ELSE
GET_VEHICLE_POINTER handle pcoords
ENDIF
pcoords += 0x14
READ_MEMORY pcoords 4 0 pcoords
pcoords += 0x30
WRITE_MEMORY pcoords 4 x FALSE
pcoords += 0x4
WRITE_MEMORY pcoords 4 y FALSE
pcoords += 0x4
WRITE_MEMORY pcoords 4 z FALSE
CLEO_RETURN 0
}
SCRIPT_END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment