Help with Checkpoints!
#1

Hello, this is the problem, i have 2 checkpoints that teleports the players to a battleground when 10 players stay in. all work great with the player id 0 but when other players connect the server the system dont work, checkpoints dont teleport all players who are in the checkpoint...

in conclusion I want when 10 players are in the checkpoint , they teleport to the battleground but dont work properly.

this is the code:

pawn Код:
new JugadoresArena1;
new gentearena1;
new gentearena2;
new JugadoresArena2;
new ronda1,jugadores; new jugando[MAX_PLAYERS];
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == checkarena1[playerid])
    {

    new strings[500];
    format(strings, 500, "%d/10 guerreros esperando para entrar en la ARENA 1...",GetOnLinePlayers());
    TextDrawSetString(players, strings);
    TextDrawShowForPlayer(playerid, players);

 if(gentearena1 == 10)
      {

    new Random = random(sizeof(RandomSpawns));
    SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
    SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
TimerConteoArena1[playerid] = SetTimerEx("ConteoArena1", 1000, true, "i", playerid);
TogglePlayerControllable(playerid,0);
ronda1= 1;
SendClientMessage(playerid, -1, "El juego comenzarб en breve, prepбrate para empezar!");
 ArenaJugador[playerid] = 1;
 barra[playerid] = CreateProgressBar(500.00, 107.00, 106.50, 19.20, -1, 100.0);

    SetProgressBarMaxValue(barra[playerid], 100.0);

    SetProgressBarValue(barra[playerid], 0);

    GivePlayerMoney(playerid,10);
    jugando[playerid] = 0;
    TextDrawShowForPlayer(playerid, Textdraw1);

                            JugadoresArena1++;
                            }
           if(ronda1 == 1)
{

    new strings3[501];
    format(strings3, 501, "Espera hasta que termine la Arena.",GetOnLinePlayers());
    TextDrawSetString(players, strings3);
    TextDrawShowForPlayer(playerid, players);

}
}

    if(checkpointid == checkarena2[playerid])
    {


 new stringss[550];
    format(stringss, 550, "%d/10 guerreros esperando para entrar en la ARENA 1...",GetOnLinePlayers());
    TextDrawSetString(players, stringss);
    TextDrawShowForPlayer(playerid, players);

if(ronda2 == 1)

{
    new stringss2[505];
    format(stringss2, 505, "Espera hasta que termine la Arena.",GetOnLinePlayers());
    TextDrawSetString(players, stringss2);
    TextDrawShowForPlayer(playerid, players);

}

if(gentearena2 == 10)
      {




   new Random3 = random(sizeof(RandomSpawns2));
    SetPlayerPos(playerid, RandomSpawns2[Random3][0], RandomSpawns2[Random3][1], RandomSpawns2[Random3][2]);
    SetPlayerFacingAngle(playerid, RandomSpawns2[Random3][3]);



TimerConteoArena2[playerid] = SetTimerEx("ConteoArena2", 1000, true, "i", playerid);

TogglePlayerControllable(playerid,0);
ronda2= 1;
SendClientMessage(playerid, -1, "El juego comenzarб en breve, prepбrate para empezar!");
 ArenaJugador[playerid] = 1;
 barra[playerid] = CreateProgressBar(500.00, 107.00, 106.50, 19.20, -1, 100.0);

    SetProgressBarMaxValue(barra[playerid], 100.0);

    SetProgressBarValue(barra[playerid], 0);

    GivePlayerMoney(playerid,10);
    jugando[playerid] = 0;
    TextDrawShowForPlayer(playerid, Textdraw1);
     JugadoresArena2++;


  }
  }
    return 1;
}
Reply
#2

Learn more Wiki samp Checkpoint
Reply
#3

If i do this thread is because i dont understand dude..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)