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;
}
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
|
Obtйn el virtualworld en que estб y compбralo con PuertaInfor[i][bVirWorldINT], eso debe funcionar, recuerda usar diferentes mundos virtuales.
|
if(GetPlayerVirtualWorld(playerid) == PuertaInfor[i][bVirWorldINT])