How to make a checkpoint that doesn't show on the map??
#1

can anyone help me with this..

i have a checkpoint and everything i just need to know how to make it only appear if you are near it.
Reply
#2

use streamer plugin by Incognito

https://sampforum.blast.hk/showthread.php?tid=102865
Reply
#3

Can you give me an example code?
Reply
#4

pawn Код:
enum CP_INFO {
    bool:set = false,
    Float:x,
    Float:y,
    Float:z,
    Float:size
};

#define CHECKPOINT_STREAMER_DISTANCE 200.0

new Checkpoints [ 500 ] [ CP_INFO ];

stock AddCheckpoint ( Float:cord_x, Float:cord_y, Float:cord_z, Float:cp_size ) {
    for ( new i; i < sizeof ( Checkpoints ); i++ ) {
        if ( Checkpoints [ i ] [ set ] == true && i == ( sizeof ( Checkpoints ) - 1 ) ) return 0;
        if ( Checkpoints [ i ] [ set ] == true ) continue;
       
        Checkpoints [ i ] [ x ] = cord_x;
        Checkpoints [ i ] [ y ] = cord_y;
        Checkpoints [ i ] [ z ] = cord_z;
        Checkpoints [ i ] [ size ] = cp_size;
    }
    return 1;
}
// AddCheckpoint
// return -->
// 1 -> successfully
// 0 -> problem

public OnPlayerUpdate ( playerid ) {
    for ( new i; i < sizeof ( Checkpoints ); i++ ) {
        if ( Checkpoints [ i ] [ set ] == false ) continue;
       
        if ( IsPlayerInRangeOfPoint ( playerid, CHECKPOINT_STREAMER_DISTANCE, Checkpoints [ i ] [ x ], Checkpoints [ i ] [ y ], Checkpoints [ i ] [ z ] ) ) {
            DisablePlayerCheckpoint ( playerid );
            SetPlayerCheckpoint ( playerid, Checkpoints [ i ] [ x ], Checkpoints [ i ] [ y ], Checkpoints [ i ] [ z ], Checkpoints [ i ] [ size ] );
        } else DisablePlayerCheckpoint ( playerid );
    }
    return 1;
}
i don't know if will work, test.
but you can use one checkpoint at CHECKPOINT_STREAMER_DISTANCE (range)
Reply
#5

When i got near the checkpoint it disappeared
Reply
#6

and it also was showing on the map..
Reply
#7

Quote:
Originally Posted by TheKnown
Посмотреть сообщение
and it also was showing on the map..
you say as the effect is inverse?
Reply
#8

1. Don't use OnPlayerUpdate for something like that...
2. The code will get bugged for more than 1 checkpoint
3. Using streamer in pawn isn't efficient
Quote:
Originally Posted by Quickie
Посмотреть сообщение
Quote:
Originally Posted by Incognito
Посмотреть сообщение
pawn Код:
native CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
native DestroyDynamicCP(checkpointid);
native IsValidDynamicCP(checkpointid);
native TogglePlayerDynamicCP(playerid, checkpointid, toggle);
native TogglePlayerAllDynamicCPs(playerid, toggle);
native IsPlayerInDynamicCP(playerid, checkpointid);
native GetPlayerVisibleDynamicCP(playerid);
pawn Код:
forward OnPlayerEnterDynamicCP(playerid, checkpointid);
forward OnPlayerLeaveDynamicCP(playerid, checkpointid);
Reply
#9

I don't know if I understand what you want,

I understand as, you want checkpoints on all map, and ex, when you going in range of LSPD, to set a checkpoint, and when you leave LSPD range, the checkpoint will disappear.

Nero 3D

Код:
2. The code will get bugged for more than 1 checkpoint
Not! I said 1 checkpoint at CHECKPOINT_STREAMER_DISTANCE, and the script automatically will disable others checkpoints.
Reply
#10

use pickup instead like this one...



this pickup does not show in minimap and it has a checkpoint like texture
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)