Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More example scripts. #249

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions examples/Mission_Trigger.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// CLEO5 example script
// Sanny Builder 4
// mode: GTA SA (v1.0 - SBL)

{$CLEO .cs}
{$USE CLEO+}

const
Mission_Icon = 34 // RadarSprite.Ryder - https://library.sannybuilder.com/#/sa/script/enums/RadarSprite
Mission_Pos_X = 2468.5
Mission_Pos_Y = -1688.0
Mission_Pos_Z = 13.5
Mission_File = "my_ryder_mission" // my_ryder_mission.cm
end

script_name 'mis_trg'

CleoBlip blipHandle = -1
int markerActive = false
while true
wait 0

if or
is_on_mission // any mission is in progress
not is_player_playing $player1 // wasted or busted
then
if
blipHandle <> -1
then
remove_cleo_blip blipHandle
blipHandle = -1
end

markerActive = true // in case any mission ends in this mission trigger
wait {time} 1000 // on mission
continue
else
if
blipHandle == -1
then
blipHandle = add_cleo_blip {RadarSprite} Mission_Icon {pos} Mission_Pos_X Mission_Pos_Y {short} true {rgba} 255 255 255 255
end

if
locate_char_any_means_3d $scplayer {pos} Mission_Pos_X Mission_Pos_Y Mission_Pos_Z {radius} 50.0 50.0 50.0 {drawSphere} false // in proximity?
then
if
//locate_stopped_char_any_means_3d $scplayer {pos} Mission_Pos_X Mission_Pos_Y Mission_Pos_Z {radius} 2.0 2.0 2.0 {drawSphere} true
locate_stopped_char_on_foot_3d $scplayer {pos} Mission_Pos_X Mission_Pos_Y Mission_Pos_Z {radius} 2.0 2.0 2.0 {drawSphere} true
//locate_stopped_char_in_car_3d $scplayer {pos} Mission_Pos_X Mission_Pos_Y Mission_Pos_Z {radius} 2.0 2.0 2.0 {drawSphere} true
then
if and
markerActive == false
can_player_start_mission $player1
then
markerActive = true
load_and_launch_custom_mission Mission_File
continue
end
else
markerActive = false
end
else
wait {time} 1000 // away from trigger
continue
end
end
end

terminate_this_custom_script // not needed, but good to have
Loading