SA-MP Forums Archive
How to make a checkpoint that doesn't show on the map?? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to make a checkpoint that doesn't show on the map?? (/showthread.php?tid=542451)



How to make a checkpoint that doesn't show on the map?? - TheKnown - 19.10.2014

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.


Re: How to make a checkpoint that doesn't show on the map?? - Quickie - 19.10.2014

use streamer plugin by Incognito

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


Re: How to make a checkpoint that doesn't show on the map?? - TheKnown - 19.10.2014

Can you give me an example code?


Re: How to make a checkpoint that doesn't show on the map?? - 0x41726d79 - 19.10.2014

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)


Re: How to make a checkpoint that doesn't show on the map?? - TheKnown - 19.10.2014

When i got near the checkpoint it disappeared


Re: How to make a checkpoint that doesn't show on the map?? - TheKnown - 19.10.2014

and it also was showing on the map..


Re: How to make a checkpoint that doesn't show on the map?? - 0x41726d79 - 19.10.2014

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


AW: How to make a checkpoint that doesn't show on the map?? - Nero_3D - 19.10.2014

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);



Re: How to make a checkpoint that doesn't show on the map?? - 0x41726d79 - 19.10.2014

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.


Re: How to make a checkpoint that doesn't show on the map?? - Quickie - 19.10.2014

use pickup instead like this one...



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