[AYUDA] Sale siempre en el mismo sitio
#1

Tengo un problema, he creado u sistema para entrar y salir de un interior pulsando "y". El problema es cuando salgo de un interior que esta usado dos veces

Ejemplo:
Tengo dos cluckin bell uno en groove y otro en LS y los dos tienen el mismo interior en mundos virtuales diferentes pero al salir de uno de los dos locales aparezco en el ultimo cluckin bell creado
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_YES)
    {
        for(new i = 0; i < sizeof(PuertaInfor); i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 3, PuertaInfor[i][bExteriorX][0], PuertaInfor[i][bExteriorX][1], PuertaInfor[i][bExteriorX][2]))
            {
                if(GetPlayerInterior(playerid) == PuertaInfor[i][bExteriorID] && GetPlayerVirtualWorld(playerid) == 0)
                {
                    if(PuertaInfor[i][bVIP] != 1 || Informacion[playerid][pVIP] != 0)
                    {
                        if(PuertaInfor[i][bLocked] == 0)
                        {
                            //Informacion[playerid][InBuilding] = i;
                            SetPlayerInterior( playerid, PuertaInfor[i][bInteriorID]);
                            SetPlayerVirtualWorld( playerid, PuertaInfor[i][bVirWorldINT]);
                            Informacion[playerid][pVirtualWorld] = PuertaInfor[i][bVirWorldINT];
                            //LoadObjects(playerid);
                            SetPlayerPos(playerid, PuertaInfor[i][bInteriorX][0], PuertaInfor[i][bInteriorX][1], PuertaInfor[i][bInteriorX][2]);
                            if(PuertaInfor[i][buRadio] >= 1 && strlen(PuertaInfor[i][buRadioURL]))
                            {
                                StopAudioStreamForPlayer(playerid);
                                PlayAudioStreamForPlayer(playerid, PuertaInfor[i][buRadioURL]);
                            }
                        }
                        else GameTextForPlayer(playerid, "~r~El edificio esta cerrado temporalmente", 1000, 5);
                    }
                    else SendClientMessage(playerid, COL_ERROR, "ERROR: "COL_WHITE"No eres VIP");
                }
            }
            if(IsPlayerInRangeOfPoint(playerid, 3, PuertaInfor[i][bInteriorX][0], PuertaInfor[i][bInteriorX][1], PuertaInfor[i][bInteriorX][2]))
            {
                //Informacion[playerid][InBuilding] = i;
                SetPlayerInterior(playerid, 0);
                SetPlayerVirtualWorld(playerid, 0);
                format(string, sizeof(string), "%i", PuertaInfor[i][bVirWorldINT]);
                SendClientMessage(playerid, -1, string);
                SetPlayerPos(playerid, PuertaInfor[i][bExteriorX][0], PuertaInfor[i][bExteriorX][a], PuertaInfor[i][bExteriorX][2]);
            }
        }
     }
    return 1;
}
Creo que al salir el bucle reconoce la salida como la id de la ultima creada... pero vamos ni idea

Gracias
Reply
#2

Prueba setear el virtual world de la persona al entrar segun la ID de la puerta si yo entro al negocio ID 25 entonces me setee VirtualWorld 25 entonces al checkear la posicion de salida tambn checkee si el virtual world corresponde al id del negocio quizas ahi funcione , anda probando nose xD
Reply
#3

Quote:
Originally Posted by MemoX
Посмотреть сообщение
Prueba setear el virtual world de la persona al entrar segun la ID de la puerta si yo entro al negocio ID 25 entonces me setee VirtualWorld 25 entonces al checkear la posicion de salida tambn checkee si el virtual world corresponde al id del negocio quizas ahi funcione , anda probando nose xD


No se me ocurre por eso pregunto
Reply
#4

Obtйn el virtualworld en que estб y compбralo con PuertaInfor[i][bVirWorldINT], eso debe funcionar, recuerda usar diferentes mundos virtuales.
Reply
#5

Quote:
Originally Posted by Zume-Zero
Посмотреть сообщение
Obtйn el virtualworld en que estб y compбralo con PuertaInfor[i][bVirWorldINT], eso debe funcionar, recuerda usar diferentes mundos virtuales.
pawn Код:
if(GetPlayerVirtualWorld(playerid) == PuertaInfor[i][bVirWorldINT])
Joder tan facil... y yo tan ciego...

Muchas gracias te daria rep pero... ando en negativo

En serio muchas gracias Zume-Zero
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)