[SNIPPET] SA-MP Checkpoints

Checks if there's any checkpoint active, use as condition(if)
//call @is_cp_active 0
Code:
:is_cp_active
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x212A94
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x24
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

Checks if there's any race checkpoint active, use as condition(if)
//call @is_racecp_active 0
Code:
:is_racecp_active
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x212A94
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x49
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

Gets checkpoint position(XYZ)
//call @get_cp_pos 0 X 1@ Y 2@ Z 3@
Code:
:get_cp_pos
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x212A94
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0xC
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@

Gets racecheckpoint position(XYZ)
//call @get_racecp_pos 0 X 1@ Y 2@ Z 3@
Code:
:get_racecp_pos
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x212A94
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x2C
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@
 

Fu$10N

Expert
Joined
Mar 5, 2014
Messages
1,101
Reaction score
9
Re: SA-MP Checkpoints

So with this snippets can I make a race checkpoint teleporter ? :surprised:

If so  :urtheman: [member=111]springfield[/member] .
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,690
Reaction score
103
Re: SA-MP Checkpoints

could i make a checkpoint auto driver with this so i can do bus missions on roleplay
 

Fu$10N

Expert
Joined
Mar 5, 2014
Messages
1,101
Reaction score
9
Re: SA-MP Checkpoints

zin link said:
could i make a checkpoint auto driver with this so i can do bus missions on roleplay

Probably  :imoverit:
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,690
Reaction score
103
Re: SA-MP Checkpoints

is there a way i can check if i have reached the checkpoint?
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
226
Location
( ͡° ͜ʖ ͡°)
Re: SA-MP Checkpoints

zin link said:
is there a way i can check if i have reached the checkpoint?

Are you serious?

call @get_racecp_pos 0 X 1@ Y 2@ Z 3@
use:
00EC:  actor $PLAYER_ACTOR sphere 0 near_point 1812.369 -1929.922 radius 80.0 80.0
 

iToX

New member
Joined
Mar 25, 2015
Messages
2
Reaction score
0
Re: SA-MP Checkpoints

Thanks springfield now i can make a checkpoint teleporter :D  :urtheman:
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
Re: SA-MP Checkpoints

Updated for SA-MP 0.3.7 R1

For CP
Code:
call @is_cp_active 0
:is_cp_active
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x24
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

call @get_cp_pos 0 X 1@ Y 2@ Z 3@
:get_cp_pos
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0xC
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@

For Race CP
Code:
call @is_racecp_active 0
:is_racecp_active
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x49
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

call @get_racecp_pos 0 X 1@ Y 2@ Z 3@
:get_racecp_pos
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x2C
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@
 

Fu$10N

Expert
Joined
Mar 5, 2014
Messages
1,101
Reaction score
9
Re: SA-MP Checkpoints

0B36 link said:
Updated for SA-MP 0.3.7 R1

For CP
Code:
call @is_cp_active 0
:is_cp_active
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x24
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

call @get_cp_pos 0 X 1@ Y 2@ Z 3@
:get_cp_pos
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0xC
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@

For Race CP
Code:
call @is_racecp_active 0
:is_racecp_active
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x49
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

call @get_racecp_pos 0 X 1@ Y 2@ Z 3@
:get_racecp_pos
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x2C
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@

Thx again :urtheman:.
 

Gorkem

Active member
Joined
Aug 9, 2014
Messages
59
Reaction score
0
Re: SA-MP Checkpoints

0B36 link said:
Updated for SA-MP 0.3.7 R1

For CP
Code:
call @is_cp_active 0
:is_cp_active
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x24
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

call @get_cp_pos 0 X 1@ Y 2@ Z 3@
:get_cp_pos
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0xC
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@

For Race CP
Code:
call @is_racecp_active 0
:is_racecp_active
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x49
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

call @get_racecp_pos 0 X 1@ Y 2@ Z 3@
:get_racecp_pos
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x2C
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@

TY
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania
~ 0.3.7 - R1 ~

For CP
PHP:
:is_cp_active
{
    0.3.7 - R1
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN
    0A8E: 1@ = 0@ + 0x21A10C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x24
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

PHP:
:get_cp_pos
{
    0.3.7 - R1
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN
    0A8E: 1@ = 0@ + 0x21A10C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0xC
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@

For Race CP
PHP:
:is_racecp_active
{
    0.3.7 - R1
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x49
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

PHP:
:get_racecp_pos
{
    0.3.7 - R1
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x2C
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@
 
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania
~ 0.3.7 - R2 ~

For CP
PHP:
:is_cp_active
{
    0.3.7 - R2
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN
    0A8E: 1@ = 0@ + 0x21A114 // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    0A8E: 2@ = 1@ + 0x4D
    0A8D: 2@ = readMem 2@ sz 4 vp 0
    IF 2@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

PHP:
:get_cp_pos
{
    0.3.7 - R2
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN
    0A8E: 1@ = 0@ + 0x21A114 // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x35
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@

For Race CP
PHP:
:is_racecp_active
{
    0.3.7 - R2
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A114 // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x29
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

PHP:
:get_racecp_pos
{
    0.3.7 - R2
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A114 // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0xC
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@
 
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania
~ 0.3.7 - R3 ~

For CP
PHP:
:is_cp_active
{
    0.3.7 - R3
}
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x26E8F4 // SAMP_MISC_INFO
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x24
0A8D: 1@ = readMem 1@ sz 4 vp 0
IF 1@ == TRUE
THEN 0485:  return_true
ELSE 059A:  return_false
END
0AA3: freelib 0@
0AB2: ret 0

PHP:
:get_cp_pos
{
    0.3.7 - R3
}
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x26E8F4 // SAMP_MISC_INFO
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0xC
0A8D: 2@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 3@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 4@ = readMem 1@ sz 4 vp 0
0AA3: freelib 0@
0AB2: ret 3 2@ 3@ 4@

For Race CP
PHP:
:is_racecp_active
{
    0.3.7 - R3
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x26E8F4 // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x49
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

PHP:
:get_racecp_pos
{
    0.3.7 - R3
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x26E8F4 // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x2C
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@
 
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania
~ 0.3.DL ~

For CP
PHP:
:is_cp_active
{
    0.3.DL
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN
    0A8E: 1@ = 0@ + 0x2ACA3C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    0A8E: 2@ = 1@ + 0x4D
    0A8D: 2@ = readMem 2@ sz 4 vp 0
    IF 2@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

PHP:
:get_cp_pos
{
    0.3.DL
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN
    0A8E: 1@ = 0@ + 0x2ACA3C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x35
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@

For Race CP
PHP:
:is_racecp_active
{
    0.3.DL
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x2ACA3C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x29
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

PHP:
:get_racecp_pos
{
    0.3.DL
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x2ACA3C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0xC
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@
 
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania
~ 0.3.7 - R4 ~

For CP
PHP:
:is_cp_active
{
    0.3.7 - R4
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN
    0A8E: 1@ = 0@ + 0x26EA24 // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    0A8E: 2@ = 1@ + 0x4D
    0A8D: 2@ = readMem 2@ sz 4 vp 0
    IF 2@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

PHP:
:get_cp_pos
{
    0.3.7 - R4
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN
    0A8E: 1@ = 0@ + 0x26EA24 // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x35
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@

For Race CP
PHP:
:is_racecp_active
{
    0.3.7 - R4
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x26EA24 // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x29
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0

PHP:
:get_racecp_pos
{
    0.3.7 - R4
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x26EA24 // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0xC
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@
 
Last edited:

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Advanced SAMP Checkpoint Snippet that:
  • Can be used to detect the Average Base Radius and 3D Position of a specific/any SAMP Checkpoint.
    • Normal Checkpoint
    • Current Race CheckPoint
    • Next Race Checkpoint
  • Can be used as a conditional statement to detect the existence of a specific/any SAMP Checkpoint.
PHP:
:GetCheckPointPositions
{
    0.3.7 R1 by AJOM
    0AB1: @GetCheckPointPositions 1 _Mode 0@ _StoreXYZ 19@ 18@ 17@ _StoreBaseRadius 16@
        _Mode = 0 --> Normal Checkpoint
        _Mode = 1 --> Primary/Current Race Checkpoint
        _Mode = 2 --> Secondary/Next Race Checkpoint
        _Mode = 3 --> ANY Checkpoint(Priority Normal CheckPoint)
        _Mode = 4 --> ANY Checkpoint(Priority Current Race CheckPoint)
        _Mode = 5 --> ANY Checkpoint(Priority Next Race CheckPoint)
}
if 0AA2: 31@ = load_dynamic_library "samp.dll"
then
    if 0AB1: @is_cp_active 0
    then 31@ = true
    else 31@ = false
    end
    if 0AB1: @is_racecp_active 0
    then 30@ = true
    else 30@ = false
    end
    if 0@ == 0 // Normal CheckPoint Only
    then
        :passnormalcheckpoint
        if 31@ == true // Normal CheckPoint Exists Somewhere
        then
            0AB1: @GetNormalCheckpointExtent 0 _Return3DSize 29@ 28@ 27@
                 // get average 2D radius
            005B: 29@ += 28@
            29@ /= 2.0
                //
            0AB1: @get_cp_pos 0 _Return_XYZ 26@ 27@ 28@
            0485:  return_true
        else 059A:  return_false
        end
    else
        if 0@ == 1 // Current Race CheckPoint Only
        then
            :passcurrentracecheckpoint
            if 30@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
            then
                0AB1: @GetRaceCheckpointSize 0 _ReturnRadius 29@
                0AB1: @get_racecp_pos 0 _Return_XYZ 26@ 27@ 28@
                0485:  return_true
            else 059A:  return_false
            end
        else
            if 0@ == 2 // Next Race CheckPoints Only
            then
                :passnextracecheckpoint
                if 30@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    0AB1: @GetRaceCheckpointSize 0 _ReturnRadius 29@
                    0AB1: @GetNextRaceCP 0 _Return_XYZ 26@ 27@ 28@
                    0485:  return_true
                else 059A:  return_false
                end
            else // Any checkpoints is acceptable
                if or
                    31@ == true // Normal CheckPoint Exists Somewhere
                    30@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    if 0@ == 5 // priority Next Race CheckPoint
                    then
                        if 30@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                        then 0002: jump @passnextracecheckpoint
                        else 0002: jump @passnormalcheckpoint
                        end
                    else
                        if 0@ == 4 // priority Current Race CheckPoint
                        then
                            if 30@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                            then 0002: jump @passcurrentracecheckpoint
                            else 0002: jump @passnormalcheckpoint
                            end
                        else
                            if 31@ == true // Normal CheckPoint Exists Somewhere
                            then 0002: jump @passnormalcheckpoint
                            else 0002: jump @passcurrentracecheckpoint
                            end
                        end
                    end
                else 059A:  return_false
                end
            end
        end
    end
else 059A:  return_false
end
0AB2: cleo_return 4 _XYZ 26@ 27@ 28@ _Radius 29@
PHP:
:GetCheckPointPositions
{
    0.3.7 R2
    0AB1: @GetCheckPointPositions 1 _Mode 0@ _StoreXYZ 19@ 18@ 17@ _StoreXYRadius 16@
        _Mode = 0 --> Normal Checkpoint
        _Mode = 1 --> Primary/Current Race Checkpoint
        _Mode = 2 --> Secondary/Next Race Checkpoint
        _Mode = 3 --> ANY Checkpoint(Priority Normal CheckPoint)
        _Mode = 4 --> ANY Checkpoint(Priority Current Race CheckPoint)
        _Mode = 5 --> ANY Checkpoint(Priority Next Race CheckPoint)
    Credits:
          AJOM - Snippet Template
          Parazitas - Memory Pointers
}
if 0AA2: 31@ = load_dynamic_library "samp.dll"
then
    31@ += 0x21A114
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // pMiscnfo
    31@ += 0x35
    0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosX
    31@ += 0x4
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosY
    31@ += 0x4
    0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosZ
 
    31@ += 0x4
    0A8D: 15@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentX
    31@ += 0x4
    0A8D: 13@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentY
    005B: 15@ += 13@
    15@ /= 2.0

    31@ += 0x8
    0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // bCheckpointsEnabled
 
    31@ -= 0x41
    0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosX
    31@ += 0x4
    0A8D: 25@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosY
    31@ += 0x4
    0A8D: 24@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosZ
    31@ += 0x4
    0A8D: 23@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextX
    31@ += 0x4
    0A8D: 22@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextY
    31@ += 0x4
    0A8D: 21@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextZ

    31@ += 0x4
    0A8D: 14@ = read_memory 31@ size 4 virtual_protect 0 // m_fRaceCheckpointSize

    31@ += 0x5
    0A8D: 20@ = read_memory 31@ size 4 virtual_protect 0 // bRaceCheckpointsEnabled
    if 0@ == 0 // Normal CheckPoint Only
    then
        :passnormalcheckpoint
        if 27@ == true // Normal CheckPoint Exists Somewhere
        then
            0087: 19@ = 30@
            0087: 18@ = 29@
            0087: 17@ = 28@
            0087: 16@ = 15@
            0485:  return_true
        else 059A:  return_false
        end
    else
        if 0@ == 1 // Current Race CheckPoint Only
        then
            :passcurrentracecheckpoint
            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
            then
                0087: 19@ = 26@
                0087: 18@ = 25@
                0087: 17@ = 24@
                0087: 16@ = 14@
                0485:  return_true
            else 059A:  return_false
            end
        else
            if 0@ == 2 // Next Race CheckPoints Only
            then
                :passnextracecheckpoint
                if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    0087: 19@ = 23@
                    0087: 18@ = 22@
                    0087: 17@ = 21@
                    0087: 16@ = 14@
                    0485:  return_true
                else 059A:  return_false
                end
            else // Any checkpoints is acceptable
                if or
                    27@ == true // Normal CheckPoint Exists Somewhere
                    20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    if 0@ == 5 // priority Next Race CheckPoint
                    then
                        if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                        then 0002: jump @passnextracecheckpoint
                        else 0002: jump @passnormalcheckpoint
                        end
                    else
                        if 0@ == 4 // priority Current Race CheckPoint
                        then
                            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                            then 0002: jump @passcurrentracecheckpoint
                            else 0002: jump @passnormalcheckpoint
                            end
                        else
                            if 27@ == true // Normal CheckPoint Exists Somewhere
                            then 0002: jump @passnormalcheckpoint
                            else 0002: jump @passcurrentracecheckpoint
                            end
                        end
                    end
                else 059A:  return_false
                end
            end
        end
    end
else 059A:  return_false
end
0AB2: cleo_return 4 _XYZ 26@ 27@ 28@ _Radius 29@
PHP:
:GetCheckPointPositions
{
    0.3.7 R3
    0AB1: @GetCheckPointPositions 1 _Mode 0@ _StoreXYZ 19@ 18@ 17@ _StoreXYRadius 16@
        _Mode = 0 --> Normal Checkpoint
        _Mode = 1 --> Primary/Current Race Checkpoint
        _Mode = 2 --> Secondary/Next Race Checkpoint
        _Mode = 3 --> ANY Checkpoint(Priority Normal CheckPoint)
        _Mode = 4 --> ANY Checkpoint(Priority Current Race CheckPoint)
        _Mode = 5 --> ANY Checkpoint(Priority Next Race CheckPoint)
    Credits:
        AJOM - Snippet Template
        Parazitas - Memory Pointers
}
if 0AA2: 31@ = load_dynamic_library "samp.dll"
then
    31@ += 0x26E8F4
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // pMiscnfo
    31@ += 0x35
    0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosX
    31@ += 0x4
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosY
    31@ += 0x4
    0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosZ
   
    31@ += 0x4
    0A8D: 15@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentX
    31@ += 0x4
    0A8D: 13@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentY
    005B: 15@ += 13@
    15@ /= 2.0

    31@ += 0x8
    0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // bCheckpointsEnabled
   
    31@ -= 0x41
    0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosX
    31@ += 0x4
    0A8D: 25@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosY
    31@ += 0x4
    0A8D: 24@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosZ
    31@ += 0x4
    0A8D: 23@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextX
    31@ += 0x4
    0A8D: 22@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextY
    31@ += 0x4
    0A8D: 21@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextZ

    31@ += 0x4
    0A8D: 14@ = read_memory 31@ size 4 virtual_protect 0 // m_fRaceCheckpointSize

    31@ += 0x5
    0A8D: 20@ = read_memory 31@ size 4 virtual_protect 0 // bRaceCheckpointsEnabled
    if 0@ == 0 // Normal CheckPoint Only
    then
        :passnormalcheckpoint
        if 27@ == true // Normal CheckPoint Exists Somewhere
        then
            0087: 19@ = 30@
            0087: 18@ = 29@
            0087: 17@ = 28@
            0087: 16@ = 15@
            0485:  return_true
        else 059A:  return_false
        end
    else
        if 0@ == 1 // Current Race CheckPoint Only
        then
            :passcurrentracecheckpoint
            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
            then
                0087: 19@ = 26@
                0087: 18@ = 25@
                0087: 17@ = 24@
                0087: 16@ = 14@
                0485:  return_true
            else 059A:  return_false
            end
        else
            if 0@ == 2 // Next Race CheckPoints Only
            then
                :passnextracecheckpoint
                if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    0087: 19@ = 23@
                    0087: 18@ = 22@
                    0087: 17@ = 21@
                    0087: 16@ = 14@
                    0485:  return_true
                else 059A:  return_false
                end
            else // Any checkpoints is acceptable
                if or
                    27@ == true // Normal CheckPoint Exists Somewhere
                    20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    if 0@ == 5 // priority Next Race CheckPoint
                    then
                        if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                        then 0002: jump @passnextracecheckpoint
                        else 0002: jump @passnormalcheckpoint
                        end
                    else
                        if 0@ == 4 // priority Current Race CheckPoint
                        then
                            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                            then 0002: jump @passcurrentracecheckpoint
                            else 0002: jump @passnormalcheckpoint
                            end
                        else
                            if 27@ == true // Normal CheckPoint Exists Somewhere
                            then 0002: jump @passnormalcheckpoint
                            else 0002: jump @passcurrentracecheckpoint
                            end
                        end
                    end
                else 059A:  return_false
                end
            end
        end
    end
else 059A:  return_false
end  
0AB2: cleo_return 4 _XYZ 26@ 27@ 28@ _Radius 29@
PHP:
:GetCheckPointPositions
{
    0.3.7 R4
    0AB1: @GetCheckPointPositions 1 _Mode 0@ _StoreXYZ 19@ 18@ 17@ _StoreXYRadius 16@
        _Mode = 0 --> Normal Checkpoint
        _Mode = 1 --> Primary/Current Race Checkpoint
        _Mode = 2 --> Secondary/Next Race Checkpoint
        _Mode = 3 --> ANY Checkpoint(Priority Normal CheckPoint)
        _Mode = 4 --> ANY Checkpoint(Priority Current Race CheckPoint)
        _Mode = 5 --> ANY Checkpoint(Priority Next Race CheckPoint)
    Credits:
        AJOM - Snippet Template
        Parazitas - Memory Pointers
}
if 0AA2: 31@ = load_dynamic_library "samp.dll"
then
    31@ += 0x26EA24
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // pMiscnfo
    31@ += 0x35
    0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosX
    31@ += 0x4
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosY
    31@ += 0x4
    0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosZ
   
    31@ += 0x4
    0A8D: 15@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentX
    31@ += 0x4
    0A8D: 13@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentY
    005B: 15@ += 13@
    15@ /= 2.0

    31@ += 0x8
    0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // bCheckpointsEnabled
   
    31@ -= 0x41
    0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosX
    31@ += 0x4
    0A8D: 25@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosY
    31@ += 0x4
    0A8D: 24@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosZ
    31@ += 0x4
    0A8D: 23@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextX
    31@ += 0x4
    0A8D: 22@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextY
    31@ += 0x4
    0A8D: 21@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextZ

    31@ += 0x4
    0A8D: 14@ = read_memory 31@ size 4 virtual_protect 0 // m_fRaceCheckpointSize

    31@ += 0x5
    0A8D: 20@ = read_memory 31@ size 4 virtual_protect 0 // bRaceCheckpointsEnabled
    if 0@ == 0 // Normal CheckPoint Only
    then
        :passnormalcheckpoint
        if 27@ == true // Normal CheckPoint Exists Somewhere
        then
            0087: 19@ = 30@
            0087: 18@ = 29@
            0087: 17@ = 28@
            0087: 16@ = 15@
            0485:  return_true
        else 059A:  return_false
        end
    else
        if 0@ == 1 // Current Race CheckPoint Only
        then
            :passcurrentracecheckpoint
            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
            then
                0087: 19@ = 26@
                0087: 18@ = 25@
                0087: 17@ = 24@
                0087: 16@ = 14@
                0485:  return_true
            else 059A:  return_false
            end
        else
            if 0@ == 2 // Next Race CheckPoints Only
            then
                :passnextracecheckpoint
                if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    0087: 19@ = 23@
                    0087: 18@ = 22@
                    0087: 17@ = 21@
                    0087: 16@ = 14@
                    0485:  return_true
                else 059A:  return_false
                end
            else // Any checkpoints is acceptable
                if or
                    27@ == true // Normal CheckPoint Exists Somewhere
                    20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    if 0@ == 5 // priority Next Race CheckPoint
                    then
                        if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                        then 0002: jump @passnextracecheckpoint
                        else 0002: jump @passnormalcheckpoint
                        end
                    else
                        if 0@ == 4 // priority Current Race CheckPoint
                        then
                            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                            then 0002: jump @passcurrentracecheckpoint
                            else 0002: jump @passnormalcheckpoint
                            end
                        else
                            if 27@ == true // Normal CheckPoint Exists Somewhere
                            then 0002: jump @passnormalcheckpoint
                            else 0002: jump @passcurrentracecheckpoint
                            end
                        end
                    end
                else 059A:  return_false
                end
            end
        end
    end
else 059A:  return_false
end  
0AB2: cleo_return 4 _XYZ 26@ 27@ 28@ _Radius 29@
PHP:
:GetCheckPointPositions
{
    0.3.DL
    0AB1: @GetCheckPointPositions 1 _Mode 0@ _StoreXYZ 19@ 18@ 17@ _StoreXYRadius 16@
        _Mode = 0 --> Normal Checkpoint
        _Mode = 1 --> Primary/Current Race Checkpoint
        _Mode = 2 --> Secondary/Next Race Checkpoint
        _Mode = 3 --> ANY Checkpoint(Priority Normal CheckPoint)
        _Mode = 4 --> ANY Checkpoint(Priority Current Race CheckPoint)
        _Mode = 5 --> ANY Checkpoint(Priority Next Race CheckPoint)
    Credits:
        AJOM - Snippet Template
        Parazitas - Memory Pointers
}
if 0AA2: 31@ = load_dynamic_library "samp.dll"
then
    31@ += 0x2ACA3C
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // pMiscnfo
    31@ += 0x35
    0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosX
    31@ += 0x4
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosY
    31@ += 0x4
    0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosZ
   
    31@ += 0x4
    0A8D: 15@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentX
    31@ += 0x4
    0A8D: 13@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentY
    005B: 15@ += 13@
    15@ /= 2.0

    31@ += 0x8
    0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // bCheckpointsEnabled
   
    31@ -= 0x41
    0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosX
    31@ += 0x4
    0A8D: 25@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosY
    31@ += 0x4
    0A8D: 24@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosZ
    31@ += 0x4
    0A8D: 23@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextX
    31@ += 0x4
    0A8D: 22@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextY
    31@ += 0x4
    0A8D: 21@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextZ

    31@ += 0x4
    0A8D: 14@ = read_memory 31@ size 4 virtual_protect 0 // m_fRaceCheckpointSize

    31@ += 0x5
    0A8D: 20@ = read_memory 31@ size 4 virtual_protect 0 // bRaceCheckpointsEnabled
    if 0@ == 0 // Normal CheckPoint Only
    then
        :passnormalcheckpoint
        if 27@ == true // Normal CheckPoint Exists Somewhere
        then
            0087: 19@ = 30@
            0087: 18@ = 29@
            0087: 17@ = 28@
            0087: 16@ = 15@
            0485:  return_true
        else 059A:  return_false
        end
    else
        if 0@ == 1 // Current Race CheckPoint Only
        then
            :passcurrentracecheckpoint
            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
            then
                0087: 19@ = 26@
                0087: 18@ = 25@
                0087: 17@ = 24@
                0087: 16@ = 14@
                0485:  return_true
            else 059A:  return_false
            end
        else
            if 0@ == 2 // Next Race CheckPoints Only
            then
                :passnextracecheckpoint
                if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    0087: 19@ = 23@
                    0087: 18@ = 22@
                    0087: 17@ = 21@
                    0087: 16@ = 14@
                    0485:  return_true
                else 059A:  return_false
                end
            else // Any checkpoints is acceptable
                if or
                    27@ == true // Normal CheckPoint Exists Somewhere
                    20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    if 0@ == 5 // priority Next Race CheckPoint
                    then
                        if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                        then 0002: jump @passnextracecheckpoint
                        else 0002: jump @passnormalcheckpoint
                        end
                    else
                        if 0@ == 4 // priority Current Race CheckPoint
                        then
                            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                            then 0002: jump @passcurrentracecheckpoint
                            else 0002: jump @passnormalcheckpoint
                            end
                        else
                            if 27@ == true // Normal CheckPoint Exists Somewhere
                            then 0002: jump @passnormalcheckpoint
                            else 0002: jump @passcurrentracecheckpoint
                            end
                        end
                    end
                else 059A:  return_false
                end
            end
        end
    end
else 059A:  return_false
end  
0AB2: cleo_return 4 _XYZ 26@ 27@ 28@ _Radius 29@
 
Last edited:

almervanka

New member
Joined
Feb 4, 2024
Messages
1
Reaction score
0
Advanced SAMP Checkpoint Snippet that:
  • Can be used to detect the Average Base Radius and 3D Position of a specific/any SAMP Checkpoint.
    • Normal Checkpoint
    • Current Race CheckPoint
    • Next Race Checkpoint
  • Can be used as a conditional statement to detect the existence of a specific/any SAMP Checkpoint.
PHP:
:GetCheckPointPositions
{
    0.3.7 R1 by AJOM
    0AB1: @GetCheckPointPositions 1 _Mode 0@ _StoreXYZ 19@ 18@ 17@ _StoreBaseRadius 16@
        _Mode = 0 --> Normal Checkpoint
        _Mode = 1 --> Primary/Current Race Checkpoint
        _Mode = 2 --> Secondary/Next Race Checkpoint
        _Mode = 3 --> ANY Checkpoint(Priority Normal CheckPoint)
        _Mode = 4 --> ANY Checkpoint(Priority Current Race CheckPoint)
        _Mode = 5 --> ANY Checkpoint(Priority Next Race CheckPoint)
}
if 0AA2: 31@ = load_dynamic_library "samp.dll"
then
    if 0AB1: @is_cp_active 0
    then 31@ = true
    else 31@ = false
    end
    if 0AB1: @is_racecp_active 0
    then 30@ = true
    else 30@ = false
    end
    if 0@ == 0 // Normal CheckPoint Only
    then
        :passnormalcheckpoint
        if 31@ == true // Normal CheckPoint Exists Somewhere
        then
            0AB1: @GetNormalCheckpointExtent 0 _Return3DSize 29@ 28@ 27@
                 // get average 2D radius
            005B: 29@ += 28@
            29@ /= 2.0
                //
            0AB1: @get_cp_pos 0 _Return_XYZ 26@ 27@ 28@
            0485:  return_true
        else 059A:  return_false
        end
    else
        if 0@ == 1 // Current Race CheckPoint Only
        then
            :passcurrentracecheckpoint
            if 30@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
            then
                0AB1: @GetRaceCheckpointSize 0 _ReturnRadius 29@
                0AB1: @get_racecp_pos 0 _Return_XYZ 26@ 27@ 28@
                0485:  return_true
            else 059A:  return_false
            end
        else
            if 0@ == 2 // Next Race CheckPoints Only
            then
                :passnextracecheckpoint
                if 30@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    0AB1: @GetRaceCheckpointSize 0 _ReturnRadius 29@
                    0AB1: @GetNextRaceCP 0 _Return_XYZ 26@ 27@ 28@
                    0485:  return_true
                else 059A:  return_false
                end
            else // Any checkpoints is acceptable
                if or
                    31@ == true // Normal CheckPoint Exists Somewhere
                    30@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    if 0@ == 5 // priority Next Race CheckPoint
                    then
                        if 30@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                        then 0002: jump @passnextracecheckpoint
                        else 0002: jump @passnormalcheckpoint
                        end
                    else
                        if 0@ == 4 // priority Current Race CheckPoint
                        then
                            if 30@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                            then 0002: jump @passcurrentracecheckpoint
                            else 0002: jump @passnormalcheckpoint
                            end
                        else
                            if 31@ == true // Normal CheckPoint Exists Somewhere
                            then 0002: jump @passnormalcheckpoint
                            else 0002: jump @passcurrentracecheckpoint
                            end
                        end
                    end
                else 059A:  return_false
                end
            end
        end
    end
else 059A:  return_false
end
0AB2: cleo_return 4 _XYZ 26@ 27@ 28@ _Radius 29@
PHP:
:GetCheckPointPositions
{
    0.3.7 R2
    0AB1: @GetCheckPointPositions 1 _Mode 0@ _StoreXYZ 19@ 18@ 17@ _StoreXYRadius 16@
        _Mode = 0 --> Normal Checkpoint
        _Mode = 1 --> Primary/Current Race Checkpoint
        _Mode = 2 --> Secondary/Next Race Checkpoint
        _Mode = 3 --> ANY Checkpoint(Priority Normal CheckPoint)
        _Mode = 4 --> ANY Checkpoint(Priority Current Race CheckPoint)
        _Mode = 5 --> ANY Checkpoint(Priority Next Race CheckPoint)
    Credits:
          AJOM - Snippet Template
          Parazitas - Memory Pointers
}
if 0AA2: 31@ = load_dynamic_library "samp.dll"
then
    31@ += 0x21A114
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // pMiscnfo
    31@ += 0x35
    0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosX
    31@ += 0x4
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosY
    31@ += 0x4
    0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosZ
 
    31@ += 0x4
    0A8D: 15@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentX
    31@ += 0x4
    0A8D: 13@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentY
    005B: 15@ += 13@
    15@ /= 2.0

    31@ += 0x8
    0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // bCheckpointsEnabled
 
    31@ -= 0x41
    0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosX
    31@ += 0x4
    0A8D: 25@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosY
    31@ += 0x4
    0A8D: 24@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosZ
    31@ += 0x4
    0A8D: 23@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextX
    31@ += 0x4
    0A8D: 22@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextY
    31@ += 0x4
    0A8D: 21@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextZ

    31@ += 0x4
    0A8D: 14@ = read_memory 31@ size 4 virtual_protect 0 // m_fRaceCheckpointSize

    31@ += 0x5
    0A8D: 20@ = read_memory 31@ size 4 virtual_protect 0 // bRaceCheckpointsEnabled
    if 0@ == 0 // Normal CheckPoint Only
    then
        :passnormalcheckpoint
        if 27@ == true // Normal CheckPoint Exists Somewhere
        then
            0087: 19@ = 30@
            0087: 18@ = 29@
            0087: 17@ = 28@
            0087: 16@ = 15@
            0485:  return_true
        else 059A:  return_false
        end
    else
        if 0@ == 1 // Current Race CheckPoint Only
        then
            :passcurrentracecheckpoint
            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
            then
                0087: 19@ = 26@
                0087: 18@ = 25@
                0087: 17@ = 24@
                0087: 16@ = 14@
                0485:  return_true
            else 059A:  return_false
            end
        else
            if 0@ == 2 // Next Race CheckPoints Only
            then
                :passnextracecheckpoint
                if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    0087: 19@ = 23@
                    0087: 18@ = 22@
                    0087: 17@ = 21@
                    0087: 16@ = 14@
                    0485:  return_true
                else 059A:  return_false
                end
            else // Any checkpoints is acceptable
                if or
                    27@ == true // Normal CheckPoint Exists Somewhere
                    20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    if 0@ == 5 // priority Next Race CheckPoint
                    then
                        if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                        then 0002: jump @passnextracecheckpoint
                        else 0002: jump @passnormalcheckpoint
                        end
                    else
                        if 0@ == 4 // priority Current Race CheckPoint
                        then
                            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                            then 0002: jump @passcurrentracecheckpoint
                            else 0002: jump @passnormalcheckpoint
                            end
                        else
                            if 27@ == true // Normal CheckPoint Exists Somewhere
                            then 0002: jump @passnormalcheckpoint
                            else 0002: jump @passcurrentracecheckpoint
                            end
                        end
                    end
                else 059A:  return_false
                end
            end
        end
    end
else 059A:  return_false
end
0AB2: cleo_return 4 _XYZ 26@ 27@ 28@ _Radius 29@
PHP:
:GetCheckPointPositions
{
    0.3.7 R3
    0AB1: @GetCheckPointPositions 1 _Mode 0@ _StoreXYZ 19@ 18@ 17@ _StoreXYRadius 16@
        _Mode = 0 --> Normal Checkpoint
        _Mode = 1 --> Primary/Current Race Checkpoint
        _Mode = 2 --> Secondary/Next Race Checkpoint
        _Mode = 3 --> ANY Checkpoint(Priority Normal CheckPoint)
        _Mode = 4 --> ANY Checkpoint(Priority Current Race CheckPoint)
        _Mode = 5 --> ANY Checkpoint(Priority Next Race CheckPoint)
    Credits:
        AJOM - Snippet Template
        Parazitas - Memory Pointers
}
if 0AA2: 31@ = load_dynamic_library "samp.dll"
then
    31@ += 0x26E8F4
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // pMiscnfo
    31@ += 0x35
    0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosX
    31@ += 0x4
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosY
    31@ += 0x4
    0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosZ
  
    31@ += 0x4
    0A8D: 15@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentX
    31@ += 0x4
    0A8D: 13@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentY
    005B: 15@ += 13@
    15@ /= 2.0

    31@ += 0x8
    0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // bCheckpointsEnabled
  
    31@ -= 0x41
    0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosX
    31@ += 0x4
    0A8D: 25@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosY
    31@ += 0x4
    0A8D: 24@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosZ
    31@ += 0x4
    0A8D: 23@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextX
    31@ += 0x4
    0A8D: 22@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextY
    31@ += 0x4
    0A8D: 21@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextZ

    31@ += 0x4
    0A8D: 14@ = read_memory 31@ size 4 virtual_protect 0 // m_fRaceCheckpointSize

    31@ += 0x5
    0A8D: 20@ = read_memory 31@ size 4 virtual_protect 0 // bRaceCheckpointsEnabled
    if 0@ == 0 // Normal CheckPoint Only
    then
        :passnormalcheckpoint
        if 27@ == true // Normal CheckPoint Exists Somewhere
        then
            0087: 19@ = 30@
            0087: 18@ = 29@
            0087: 17@ = 28@
            0087: 16@ = 15@
            0485:  return_true
        else 059A:  return_false
        end
    else
        if 0@ == 1 // Current Race CheckPoint Only
        then
            :passcurrentracecheckpoint
            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
            then
                0087: 19@ = 26@
                0087: 18@ = 25@
                0087: 17@ = 24@
                0087: 16@ = 14@
                0485:  return_true
            else 059A:  return_false
            end
        else
            if 0@ == 2 // Next Race CheckPoints Only
            then
                :passnextracecheckpoint
                if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    0087: 19@ = 23@
                    0087: 18@ = 22@
                    0087: 17@ = 21@
                    0087: 16@ = 14@
                    0485:  return_true
                else 059A:  return_false
                end
            else // Any checkpoints is acceptable
                if or
                    27@ == true // Normal CheckPoint Exists Somewhere
                    20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    if 0@ == 5 // priority Next Race CheckPoint
                    then
                        if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                        then 0002: jump @passnextracecheckpoint
                        else 0002: jump @passnormalcheckpoint
                        end
                    else
                        if 0@ == 4 // priority Current Race CheckPoint
                        then
                            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                            then 0002: jump @passcurrentracecheckpoint
                            else 0002: jump @passnormalcheckpoint
                            end
                        else
                            if 27@ == true // Normal CheckPoint Exists Somewhere
                            then 0002: jump @passnormalcheckpoint
                            else 0002: jump @passcurrentracecheckpoint
                            end
                        end
                    end
                else 059A:  return_false
                end
            end
        end
    end
else 059A:  return_false
end 
0AB2: cleo_return 4 _XYZ 26@ 27@ 28@ _Radius 29@
PHP:
:GetCheckPointPositions
{
    0.3.7 R4
    0AB1: @GetCheckPointPositions 1 _Mode 0@ _StoreXYZ 19@ 18@ 17@ _StoreXYRadius 16@
        _Mode = 0 --> Normal Checkpoint
        _Mode = 1 --> Primary/Current Race Checkpoint
        _Mode = 2 --> Secondary/Next Race Checkpoint
        _Mode = 3 --> ANY Checkpoint(Priority Normal CheckPoint)
        _Mode = 4 --> ANY Checkpoint(Priority Current Race CheckPoint)
        _Mode = 5 --> ANY Checkpoint(Priority Next Race CheckPoint)
    Credits:
        AJOM - Snippet Template
        Parazitas - Memory Pointers
}
if 0AA2: 31@ = load_dynamic_library "samp.dll"
then
    31@ += 0x26EA24
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // pMiscnfo
    31@ += 0x35
    0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosX
    31@ += 0x4
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosY
    31@ += 0x4
    0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosZ
  
    31@ += 0x4
    0A8D: 15@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentX
    31@ += 0x4
    0A8D: 13@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentY
    005B: 15@ += 13@
    15@ /= 2.0

    31@ += 0x8
    0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // bCheckpointsEnabled
  
    31@ -= 0x41
    0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosX
    31@ += 0x4
    0A8D: 25@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosY
    31@ += 0x4
    0A8D: 24@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosZ
    31@ += 0x4
    0A8D: 23@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextX
    31@ += 0x4
    0A8D: 22@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextY
    31@ += 0x4
    0A8D: 21@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextZ

    31@ += 0x4
    0A8D: 14@ = read_memory 31@ size 4 virtual_protect 0 // m_fRaceCheckpointSize

    31@ += 0x5
    0A8D: 20@ = read_memory 31@ size 4 virtual_protect 0 // bRaceCheckpointsEnabled
    if 0@ == 0 // Normal CheckPoint Only
    then
        :passnormalcheckpoint
        if 27@ == true // Normal CheckPoint Exists Somewhere
        then
            0087: 19@ = 30@
            0087: 18@ = 29@
            0087: 17@ = 28@
            0087: 16@ = 15@
            0485:  return_true
        else 059A:  return_false
        end
    else
        if 0@ == 1 // Current Race CheckPoint Only
        then
            :passcurrentracecheckpoint
            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
            then
                0087: 19@ = 26@
                0087: 18@ = 25@
                0087: 17@ = 24@
                0087: 16@ = 14@
                0485:  return_true
            else 059A:  return_false
            end
        else
            if 0@ == 2 // Next Race CheckPoints Only
            then
                :passnextracecheckpoint
                if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    0087: 19@ = 23@
                    0087: 18@ = 22@
                    0087: 17@ = 21@
                    0087: 16@ = 14@
                    0485:  return_true
                else 059A:  return_false
                end
            else // Any checkpoints is acceptable
                if or
                    27@ == true // Normal CheckPoint Exists Somewhere
                    20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    if 0@ == 5 // priority Next Race CheckPoint
                    then
                        if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                        then 0002: jump @passnextracecheckpoint
                        else 0002: jump @passnormalcheckpoint
                        end
                    else
                        if 0@ == 4 // priority Current Race CheckPoint
                        then
                            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                            then 0002: jump @passcurrentracecheckpoint
                            else 0002: jump @passnormalcheckpoint
                            end
                        else
                            if 27@ == true // Normal CheckPoint Exists Somewhere
                            then 0002: jump @passnormalcheckpoint
                            else 0002: jump @passcurrentracecheckpoint
                            end
                        end
                    end
                else 059A:  return_false
                end
            end
        end
    end
else 059A:  return_false
end 
0AB2: cleo_return 4 _XYZ 26@ 27@ 28@ _Radius 29@
PHP:
:GetCheckPointPositions
{
    0.3.DL
    0AB1: @GetCheckPointPositions 1 _Mode 0@ _StoreXYZ 19@ 18@ 17@ _StoreXYRadius 16@
        _Mode = 0 --> Normal Checkpoint
        _Mode = 1 --> Primary/Current Race Checkpoint
        _Mode = 2 --> Secondary/Next Race Checkpoint
        _Mode = 3 --> ANY Checkpoint(Priority Normal CheckPoint)
        _Mode = 4 --> ANY Checkpoint(Priority Current Race CheckPoint)
        _Mode = 5 --> ANY Checkpoint(Priority Next Race CheckPoint)
    Credits:
        AJOM - Snippet Template
        Parazitas - Memory Pointers
}
if 0AA2: 31@ = load_dynamic_library "samp.dll"
then
    31@ += 0x2ACA3C
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // pMiscnfo
    31@ += 0x35
    0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosX
    31@ += 0x4
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosY
    31@ += 0x4
    0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointPosZ
  
    31@ += 0x4
    0A8D: 15@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentX
    31@ += 0x4
    0A8D: 13@ = read_memory 31@ size 4 virtual_protect 0 // fCheckpointExtentY
    005B: 15@ += 13@
    15@ /= 2.0

    31@ += 0x8
    0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // bCheckpointsEnabled
  
    31@ -= 0x41
    0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosX
    31@ += 0x4
    0A8D: 25@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosY
    31@ += 0x4
    0A8D: 24@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointPosZ
    31@ += 0x4
    0A8D: 23@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextX
    31@ += 0x4
    0A8D: 22@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextY
    31@ += 0x4
    0A8D: 21@ = read_memory 31@ size 4 virtual_protect 0 // fRaceCheckpointNextZ

    31@ += 0x4
    0A8D: 14@ = read_memory 31@ size 4 virtual_protect 0 // m_fRaceCheckpointSize

    31@ += 0x5
    0A8D: 20@ = read_memory 31@ size 4 virtual_protect 0 // bRaceCheckpointsEnabled
    if 0@ == 0 // Normal CheckPoint Only
    then
        :passnormalcheckpoint
        if 27@ == true // Normal CheckPoint Exists Somewhere
        then
            0087: 19@ = 30@
            0087: 18@ = 29@
            0087: 17@ = 28@
            0087: 16@ = 15@
            0485:  return_true
        else 059A:  return_false
        end
    else
        if 0@ == 1 // Current Race CheckPoint Only
        then
            :passcurrentracecheckpoint
            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
            then
                0087: 19@ = 26@
                0087: 18@ = 25@
                0087: 17@ = 24@
                0087: 16@ = 14@
                0485:  return_true
            else 059A:  return_false
            end
        else
            if 0@ == 2 // Next Race CheckPoints Only
            then
                :passnextracecheckpoint
                if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    0087: 19@ = 23@
                    0087: 18@ = 22@
                    0087: 17@ = 21@
                    0087: 16@ = 14@
                    0485:  return_true
                else 059A:  return_false
                end
            else // Any checkpoints is acceptable
                if or
                    27@ == true // Normal CheckPoint Exists Somewhere
                    20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                then
                    if 0@ == 5 // priority Next Race CheckPoint
                    then
                        if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                        then 0002: jump @passnextracecheckpoint
                        else 0002: jump @passnormalcheckpoint
                        end
                    else
                        if 0@ == 4 // priority Current Race CheckPoint
                        then
                            if 20@ == true // Primary/Secondary Race CheckPoint Exists Somewhere
                            then 0002: jump @passcurrentracecheckpoint
                            else 0002: jump @passnormalcheckpoint
                            end
                        else
                            if 27@ == true // Normal CheckPoint Exists Somewhere
                            then 0002: jump @passnormalcheckpoint
                            else 0002: jump @passcurrentracecheckpoint
                            end
                        end
                    end
                else 059A:  return_false
                end
            end
        end
    end
else 059A:  return_false
end 
0AB2: cleo_return 4 _XYZ 26@ 27@ 28@ _Radius 29@
well, it doesn't work on me. i tried to modify it but the AI don't recognize the other race checkpoints, it will go to the first one and turn around. (ex: sweeper, bus, etc.). still trying to understand how the snippets work since I'm new to this.

anyway, which part that i can modify to make the radius detector bigger? even though i don't think that's the problem.
 
Top