Other players can't enter dynamic checkpoint.
#1

This is my first time facing this problem. Me (ID: 0) can enter the checkpoint while other players (ID 1+) can't. It looks like OnPlayerEnterDynamicCP callback isn't activated. They only stand there, in the checkpoint.

I saw a couple of posts like mine, without answers and solutions.

Definition of the var:
Код:
new g_cluckingbell_enter[MAX_PLAYERS];
Under gamemode init:
Код:
g_cluckingbell_enter[0]= CreateDynamicCP(2419.9421,-1509.0177,24.0000, 1.0, -1, -1, -1, 20);
Callback:
Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid) 
{
    if(checkpointid== g_cluckingbell_enter[playerid]) 
    {
     	SetPlayerInterior(playerid, 9);
     	SetPlayerPos(playerid, 364.8975,-10.5706,1001.8516);
     	SetPlayerFacingAngle(playerid, 359.5678);

    }
  return 1;
}
I also tried replacing new streamer with old one, complied again, and nothing.
Reply
#2

Код:
new g_cluckingbell_enter;
Код:
g_cluckingbell_enter = CreateDynamicCP(2419.9421,-1509.0177,24.0000, 1.0, -1, -1, -1, 20);
Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid) 
{
    if(checkpointid == g_cluckingbell_enter) 
    {
     	SetPlayerInterior(playerid, 9);
     	SetPlayerPos(playerid, 364.8975,-10.5706,1001.8516);
     	SetPlayerFacingAngle(playerid, 359.5678);

    }
  return 1;
}
Reply
#3

Your problem is you create the checkpoint under OnGameModeInInit ONLY for ID 0. This is why only you can enter the checkpoint with ID 0.

Solution is really simple, just put this under OnPlayerConnect:

Код:
g_cluckingbell_enter[playerid]= CreateDynamicCP(2419.9421,-1509.0177,24.0000, 1.0, -1, -1, -1, 20);
You have created the var for all players, but you just create the checkpoint for ID 0, when the server starts.
Reply
#4

^ thanks.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)