02.05.2016, 19:56
Pues la soluciуn 2 mas o menos es esto:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SECONDARY_ATTACK)
{
for(new i=0; i < MAX_CASAS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, CasaInfo[i][cPosX], CasaInfo[i][cPosY], CasaInfo[i][cPosZ]))
{
if(CasaInfo[i][cPuerta])
return SendClientMessage(playerid, COLOR_BLANCO, "No se puede entrar en una casa cerrada con llave.");
SetPlayerInterior(playerid, CasaInfo[i][cInterior]);
SetPlayerVirtualWorld(playerid, CasaInfo[i][cInteriorVW]);
SetPlayerPos(playerid, CasaInfo[i][cIntX], CasaInfo[i][cIntY], CasaInfo[i][cIntZ]);
SetPlayerFacingAngle(playerid, CasaInfo[i][cIntA]);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, CasaInfo[i][cIntX], CasaInfo[i][cIntY], CasaInfo[i][cIntZ]))
{
if(GetPlayerVirtualWorld(playerid) == CasaInfo[i][cInteriorVW])
{
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, CasaInfo[i][cPosX], CasaInfo[i][cPosY], CasaInfo[i][cPosZ]);
return 1;
}
}
}
}
}