SA-MP Forums Archive
Checkpoint visible to all players - 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: Checkpoint visible to all players (/showthread.php?tid=414293)



Checkpoint visible to all players - Noles2197 - 08.02.2013

When I'm playing with friends, the only person that can use the checkpoint is player ID 0.
How can I make it to where all players can see and use checkpoints?

pawn Код:
new house;

public OnGameModeInit()
{
    house = CreateDynamicCP(-1968.6255,109.9457,27.6875,1,0,0,-1,3);
    return 1;
}

public OnPlayerEnterDynamicCP(playerid,checkpointid)
{
    if(checkpointid == house)
    {
        SendClientMessage(playerid,COLOR_RED,"Door step of house");
       
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid,x,y,z);
        SetPlayerPos(playerid,365.7158,-9.8873,1001.8516);
        SetPlayerVirtualWorld(playerid,1);
        SetPlayerInterior(playerid,9);
    }
    return 1;
}



Re: Checkpoint visible to all players - Jefff - 08.02.2013

nwm.


Re: Checkpoint visible to all players - Flake. - 08.02.2013

use it like this.

pawn Код:
CreateDynamicCP(Float, Float:y, Float:z, Floatize, worldid = -1, interiorid = -1, playerid = -1, Floattreamdistance = 100.0);



Re: Checkpoint visible to all players - Noles2197 - 08.02.2013

Quote:
Originally Posted by (*|Flake|*)
Посмотреть сообщение
use it like this.

pawn Код:
CreateDynamicCP(Float, Float:y, Float:z, Floatize, worldid = -1, interiorid = -1, playerid = -1, Floattreamdistance = 100.0);
Can you explain to me how that will help at all? I know how to use CreateDynamicCP.


Re: Checkpoint visible to all players - RajatPawar - 09.02.2013

Replace player id as -1 instead of 0 in the createdynamiccp thing..


Re: Checkpoint visible to all players - Threshold - 09.02.2013

He's not understanding it properly and seems to still be struggling so we might as well just give him the code.
pawn Код:
public OnGameModeInit()
{
    house = CreateDynamicCP(-1968.6255,109.9457,27.6875,2.0,-1, -1, ,-1, 5.0);
    return 1;
}



Re: Checkpoint visible to all players - RajatPawar - 09.02.2013

Alright. If you view the [REL] Streamer thread, Incognito has said that:
If you replace any of the optional parameters, i.e. Virtual world, player id, world id, with -1, the checkpoint/object/pickup will be streamed across every such world, and for all players.
pawn Код:
CreateDynamicCP(-1968.6255,109.9457,27.6875,2.0,-1, -1, ,-1, 5.0);
//Since, virtual world, playerid, and world id are -1 here, it will be streamed across every virtual word, and for every player.