In Range of point
#1

So i have a problem with this system, its a bus driver system and the check points are not working, which means when i enter checkpoint it should show me

pawn Код:
GameTextForPlayer(playerid,"~y~Stanica", 6000, 3);
and when i leave it

pawn Код:
GameTextForPlayer(playerid, "~g~Nova stanica locirana", 3000, 3);
Codes:

First when u start a system it goes like this

pawn Код:
SetPlayerCheckpoint(playerid,2027.5176,-1939.9084,13.3362,5.0);//
                          VoziAutobus[playerid] = 1;
And when u enter CP

pawn Код:
if(VoziAutobus[playerid] < 104)
        {
            if(IsPlayerInRangeOfPoint(playerid,8.0,BusLinijaCp[VoziAutobus[playerid]-1][0],BusLinijaCp[VoziAutobus[playerid]-1][1],BusLinijaCp[VoziAutobus[playerid]-1][2]))
            {
              if(VoziloBuser(GetPlayerVehicleID(playerid)))
              {
                   new currentState = GetPlayerState(playerid);
                   if (currentState == PLAYER_STATE_PASSENGER)
                   {
                           DisablePlayerCheckpoint(playerid);
                           SetPVarInt(playerid, "Busruta_Var", 0);
                           TogglePlayerControllable(playerid, 0);
                           GameTextForPlayer(playerid,"~r~Moras biti vozac!", 5000, 1);
                   }
                   if(BusKretanje[playerid] >= sekundaigre) return 1;
                   else if(BusKretanje[playerid] == 0)
                   {
                      BusKretanje[playerid] += 5;
                      GameTextForPlayer(playerid,"~y~Stanica", 6000, 3);
                      return 1;
                   }
                }
            }
And when u leave cp


pawn Код:
public OnPlayerLeaveCheckpoint(playerid)
{
    if(VoziAutobus[playerid] > 0 && BusKretanje[playerid] > 0)
    {
        if(VoziAutobus[playerid] < 104)
        {
            if(IsPlayerInRangeOfPoint(playerid,15.0,BusLinijaCp[VoziAutobus[playerid]-1][0],BusLinijaCp[VoziAutobus[playerid]-1][1],BusLinijaCp[VoziAutobus[playerid]-1][2]))
            {
                  if(VoziloBuser(GetPlayerVehicleID(playerid)))
                  {
                       if(BusKretanje[playerid] >= sekundaigre) return 1;
                       SetPlayerCheckpoint(playerid,BusLinijaCp[VoziAutobus[playerid]][0],BusLinijaCp[VoziAutobus[playerid]][1],BusLinijaCp[VoziAutobus[playerid]][2], 8.0);//
                       VoziAutobus[playerid]++;
                       new currentState = GetPlayerState(playerid);
                       if (currentState == PLAYER_STATE_PASSENGER)
                       {
                               DisablePlayerCheckpoint(playerid);
                               VoziAutobus[playerid] = 0;
                               TogglePlayerControllable(playerid, 0);
                               GameTextForPlayer(playerid,"~r~Moras biti vozac!", 5000, 1);
                       }
                       GameTextForPlayer(playerid, "~g~Nova stanica locirana", 3000, 3);
                       BusKretanje[playerid] = 0;
                  }
            }
        }
    }
    return 1;
}
Other:

pawn Код:
new Float:BusLinijaCp[104][3] = {
    {2027.5176,-1939.9084,13.3362}, // Linija 1 Prva
    {2311.2935,-1933.3092,13.3489},
};
Reply
#2

Use streamer instead, it's dynamic, limited-controlled and it is vastly easier to use.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)