CLEO Help Checkpoint to Checkpoint cleo

CLEO related
Status
Not open for further replies.
Joined
Jul 22, 2016
Messages
9
Reaction score
0
Hey guys, I would like to mark a route.
Whats the wrong ?
Code:
{$CLEO .cs}
018A: 1@ = create_checkpoint_at 2145.2520,-1752.4569,13.0180
wait 0 
if
0256:   player $PLAYER_CHAR defined 
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2145.2520,-1752.4569,13.0180 radius  7.5  7.5  7.5
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2196.1455,-1735.1791,13.0197
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2196.1455,-1735.1791,13.0197 radius  7.5  7.5  7.5
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2248.3501,-1747.1144,13.0752
if
0256:   player $PLAYER_CHAR defined 
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2248.3501,-1747.1144,13.0752 radius  7.5  7.5  7.5
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2297.0786,-1754.1709,13.0869
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2297.0786,-1754.1709,13.0869 radius  7.5  7.5  7.5
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2332.8418,-1734.9719,13.0016
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2332.8418,-1734.9719,13.0016 radius  7.5  7.5  7.5
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2346.9988,-1692.6813,13.0635
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2346.9988,-1692.6813,13.0635 radius  7.5  7.5  7.5
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2333.9949,-1667.7855,13.2578
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2333.9949,-1667.7855,13.2578 radius  7.5  7.5  7.5
Marker.Disable(1@)
Sorry I have bad english skill.
 

4changesLeft

Well-known member
Joined
Apr 10, 2015
Messages
365
Reaction score
4
I feel like that if this is all in a loop function then the checks are gonna mess up.. What you need to do is add a different check in different function. Also, when you use the if statement, use then and end. This should work.


Code:
{$CLEO .cs}
0000:

:1
wait 0
018A: 1@ = create_checkpoint_at 2145.2520,-1752.4569,13.0180
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2145.2520,-1752.4569,13.0180 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2196.1455,-1735.1791,13.0197
jump @2
end
jump @1

:2
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2196.1455,-1735.1791,13.0197 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2248.3501,-1747.1144,13.0752
jump @3
end
jump @2

:3
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2248.3501,-1747.1144,13.0752 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2297.0786,-1754.1709,13.0869
jump @4
end
jump @3

:4
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2297.0786,-1754.1709,13.0869 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2332.8418,-1734.9719,13.0016
jump @5
end
jump @4

:5
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2332.8418,-1734.9719,13.0016 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2346.9988,-1692.6813,13.0635
jump @6
end
jump @5

:6
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2346.9988,-1692.6813,13.0635 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2333.9949,-1667.7855,13.2578
jump @7
end
jump @6

:7
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2333.9949,-1667.7855,13.2578 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
//use jump @1 here if you want to start over.
end
jump @7
 
Joined
Jul 22, 2016
Messages
9
Reaction score
0
Thank you. Only one I want to ask something. How to do push button show checkpoints. Then, when I press again disappear. Again, sorry i have bad english skill :(


Not enough actual parameters. Expected 4 params.
 
Joined
Jul 22, 2016
Messages
9
Reaction score
0
Code:
{$CLEO .cs}

:1
wait 0
018A: 1@ = create_checkpoint_at 2145.2520,-1752.4569,13.0180
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2145.2520,-1752.4569,13.0180 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2196.1455,-1735.1791,13.0197
jump @2
end
jump @1

:2
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2196.1455,-1735.1791,13.0197 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2248.3501,-1747.1144,13.0752
jump @3
end
jump @2

:3
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2248.3501,-1747.1144,13.0752 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2297.0786,-1754.1709,13.0869
jump @4
end
jump @3

:4
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2297.0786,-1754.1709,13.0869 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2332.8418,-1734.9719,13.0016
jump @5
end
jump @4

:5
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2332.8418,-1734.9719,13.0016 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2346.9988,-1692.6813,13.0635
jump @6
end
jump @5

:6
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2346.9988,-1692.6813,13.0635 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2333.9949,-1667.7855,13.2578
jump @7
end
jump @6

:7
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2333.9949,-1667.7855,13.2578 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2283.5229,-1655.8923,14.6032
jump @7
end
jump @8

:8
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2283.5229,-1655.8923,14.6032 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2145.5396,-1622.5638,13.0986
jump @8
end
jump @9

:9
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2145.5396,-1622.5638,13.0986 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2102.0000,-1631.6056,13.1655
jump @9
end
jump @10

:10
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2102.0000,-1631.6056,13.1655 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2073.8562,-1665.7150,13.0906
jump @10
end
jump @11

:11
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2073.8562,-1665.7150,13.0906 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2041.6117,-1696.6344,13.1758
jump @11
end
jump @12

:12
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2041.6117,-1696.6344,13.1758 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 2007.2842,-1749.8719,13.0077
jump @12
end
jump @13

:13
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2007.2842,-1749.8719,13.0077 radius  7.5  7.5  7.5
then
Marker.Disable(1@)                                               
018A: 1@ = create_checkpoint_at 1969.1406,-1762.8218,13.1709
jump @13
end
jump @14

:14
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1969.1406,-1762.8218,13.1709 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1933.8361,-1789.2572,13.0077
jump @14
end
jump @15

:15
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1933.8361,-1789.2572,13.0077 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1842.7979,-1792.9495,13.1718
jump @15
end
jump @16

:16
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1842.7979,-1792.9495,13.1718 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1803.7512,-1812.1051,13.1863
jump @16
end
jump @17

:17
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1803.7512,-1812.1051,13.1863 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1740.0304,-1804.7679,13.1860
jump @17
end
jump @18

:18
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1740.0304,-1804.7679,13.1860 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1749.7148,-1688.2815,13.0077
jump @18
end
jump @19

:19
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1749.7148,-1688.2815,13.0077 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1706.8181,-1591.5750,12.9923
jump @19
end
jump @20

:20
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1706.8181,-1591.5750,12.9923 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1665.0724,-1580.0955,13.1718
jump @20
end
jump @21

:21
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1665.0724,-1580.0955,13.1718 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1646.5353,-1547.6360,13.1804
jump @21
end
jump @22

:22
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1646.5353,-1547.6360,13.1804 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1618.6820,-1518.8267,13.2220
jump @22
end
jump @23

:23
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1618.6820,-1518.8267,13.2220 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1579.3810,-1513.3158,13.1862
jump @23
end
jump @24

:24
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1579.3810,-1513.3158,13.1862 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1557.8679,-1505.8762,13.1827
jump @24
end
jump @25

:25
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1557.8679,-1505.8762,13.1827 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1496.9615,-1491.6722,13.1797
jump @25
end
jump @26

:26
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1496.9615,-1491.6722,13.1797 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1456.9824,-1504.6290,13.1717
jump @26
end
jump @27

:27
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1456.9824,-1504.6290,13.1717 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1430.0386,-1548.1810,12.9919
jump @27
end
jump @28

:28
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1430.0386,-1548.1810,12.9919 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1399.2898,-1588.3707,12.9778       
jump @28
end
jump @29

:29
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1399.2898,-1588.3707,12.9778 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1358.4457,-1567.9817,13.1714
jump @29
end
jump @30

:30
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1358.4457,-1567.9817,13.1714 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1388.9126,-1455.8258,13.1707
jump @30
end
jump @31

:31
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1388.9126,-1455.8258,13.1707 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1378.9421,-1400.7224,13.0115
jump @31
end
jump @32

:32
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1378.9421,-1400.7224,13.0115 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1209.8542,-1398.6012,12.8897
jump @32
end
jump @33

:33
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1209.8542,-1398.6012,12.8897 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 1056.2566,-1397.3927,13.0763
jump @33
end
jump @34

:34
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1056.2566,-1397.3927,13.0763 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 958.2410,-1421.0770,13.1728
jump @34
end
jump @35

:35
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 958.2410,-1421.0770,13.1728 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 956.0930,-1505.4851,13.1736
jump @35
end
jump @36

:36
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 956.0930,-1505.4851,13.1736 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 981.7474,-1542.9796,13.2248
jump @36
end
jump @37

:37
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 981.7474,-1542.9796,13.2248 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
018A: 1@ = create_checkpoint_at 978.1204,-1526.2933,13.1862
jump @37
end
jump @38

:38
wait 0
if
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 978.1204,-1526.2933,13.1862 radius  7.5  7.5  7.5
then
Marker.Disable(1@)
end
jump @38

Something wrong because i got this message: Not enough actual parameters. Expected 4 params.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
that's because there are "," between coordinates instead of space. You could use a function to get the coordinates per specified checkpoint, this way the code will be more flexible

Code:
{$CLEO .cs}
0000:

//counter
0@ = 0
9@ = 0 //9@ will be always 0@ + 1, to set checkpoint pointing position

//maximum number of checkpoints (if 0@ reaches this number then the final checkpoint will be shown
11@ = 6 // keep in mind that the first checkpoint index is 0 not 1, so there will be actually 7 checkpoints

//checkpoint coords
1@ = 0.0
2@ = 0.0
3@ = 0.0

//next checkpoint coords
4@ = 0.0
5@ = 0.0
6@ = 0.0

//bool to avoid creating checkpoint in a loop and do it only once
7@ = false

/*
:activate
wait 0
if 0ADC:   test_cheat "race"
then 
jump @main
end
jump @activate
*/

:main
wait 0

if 7@ == false
then
0085: 9@ = 0@ // (int)
9@++
0AB1: @get_checkpoint_coords 1 cpIndex 0@ _x 1@ _y 2@ _z 3@ 
0AB1: @get_checkpoint_coords 1 cpIndex 9@ _x 4@ _y 5@ _z 6@ //next checkpoint (just to set the poiting position)
    if  003B:   0@ == 11@  // if it's the last checkpoint then change it's type
    then
    06D5: 8@ = create_racing_checkpoint_at 1@ 2@ 3@ point_to 4@ 5@ 6@ type 1 radius 6.0
    else
    06D5: 8@ = create_racing_checkpoint_at 1@ 2@ 3@ point_to 4@ 5@ 6@ type 0 radius 6.0
    end    
0167: 10@ = create_marker_at 1@ 2@ 3@ color 0 flag 2
0168: set_marker 10@ size 3
0165: set_marker 10@ color_to 0x7F0000FF
7@ = true
end

if and
7@ == true
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1@ 2@ 3@ radius  7.5  7.5  7.5
then
06D6: disable_racing_checkpoint 8@
0164: disable_marker 10@
0@++
7@ = false
    if 001D:   0@ > 11@  //if the race is finished
    then
    jump @idleLoop
    end
end
jump @main

:idleLoop
wait 5000
jump @idleLoop






//0AB1: @get_checkpoint_coords 1 cpIndex 0@ _x 1@ _y 2@ _z 3@
:get_checkpoint_coords  
if 0@ == 0
then
0AB2: ret 3 2145.2520 -1752.4569 13.0180
end

if 0@ == 1
then
0AB2: ret 3 2196.1455 -1735.1791 13.0197
end

if 0@ == 2
then
0AB2: ret 3 2248.3501 -1747.1144 13.0752
end

if 0@ == 3
then
0AB2: ret 3 2297.0786 -1754.1709 13.0869
end

if 0@ == 4
then
0AB2: ret 3 2332.8418 -1734.9719 13.0016 
end

if 0@ == 5
then
0AB2: ret 3 2346.9988 -1692.6813 13.0635
end

if 0@ == 6
then
0AB2: ret 3 2333.9949 -1667.7855 13.2578
end

if 0@ == 7
then
0AB2: ret 3 0.0 0.0 0.0
end

0AB2: ret 3 0.0 0.0 0.0


Edit: to add more checkpoints you'd have to change 11@ = 6 into higher value and add more returns to the "get_checkpoint_coords" function like:
if 0@ == 8
then
0AB2: ret 3 XYZ_coords
end

if 0@ == 9
then
0AB2: ret 3 XYZ_coords
end

if 0@ == 10
then
0AB2: ret 3 XYZ_coords
end

0AB2: ret 3 0.0 0.0 0.0 //remember to keep this line at the end of the function ( if it's not there you may have problems if the counter exceeds 10 or whatever is the maximum number of checkpoints)
 
Status
Not open for further replies.
Top