04.11.2017, 11:49
PHP код:
housesTryEnterExit(playerid) {
for(new i=0;i<sizeof(Houses);i++) {
if(IsPlayerInRangeOfPoint(playerid, 1.5, Houses[i][EHouseX],Houses[i][EHouseY],Houses[i][EHouseZ])) {
if(IsHouseLocked(i)) {
GameTextForPlayer(playerid, "~r~Locked", 2000, 1);
return 1;
}
if(Houses[i][EHouseLights] == 1) {
TextDrawShowForPlayer(playerid, HouseLightsText);
}
if(Houses[i][EHouseRadioIndex] != -1) {
new url[128];
getRadioURL(Houses[i][EHouseRadioIndex], url, sizeof(url));
PlayAudioStreamForPlayer(playerid, url);
}
SetPlayerPos(playerid, Houses[i][EHouseExitX],Houses[i][EHouseExitY],Houses[i][EHouseExitZ]);
SetPlayerInterior(playerid, Houses[i][EHouseInterior]);
SetPlayerVirtualWorld(playerid, houseGetVirtualWorld(i));
SetPVarInt(playerid, "Interior", GetPlayerInterior(playerid));
} else if(IsPlayerInRangeOfPoint(playerid, 5.0, Houses[i][EHouseExitX],Houses[i][EHouseExitY],Houses[i][EHouseExitZ])) {
if(GetPlayerVirtualWorld(playerid) == houseGetVirtualWorld(i)) {
if(Houses[i][EHouseLights] == 1) {
TextDrawHideForPlayer(playerid, HouseLightsText);
}
if(Houses[i][EHouseRadioIndex] != -1) {
StopAudioStreamForPlayer(playerid);
}
SetPlayerPos(playerid, Houses[i][EHouseX],Houses[i][EHouseY],Houses[i][EHouseZ]);
SetPlayerInterior(playerid, GetPVarInt(playerid, "Interior"));
SetPlayerVirtualWorld(playerid, 0);
}
}
}
return 1;
}