House exit interior
#1

PHP код:
housesTryEnterExit(playerid) {
    for(new 
i=0;i<sizeof(Houses);i++) {
        if(
IsPlayerInRangeOfPoint(playerid1.5Houses[i][EHouseX],Houses[i][EHouseY],Houses[i][EHouseZ])) {
            if(
IsHouseLocked(i)) {
                
GameTextForPlayer(playerid"~r~Locked"20001);
                return 
1;
            }
            if(
Houses[i][EHouseLights] == 1) {
                
TextDrawShowForPlayer(playeridHouseLightsText);
            }
            if(
Houses[i][EHouseRadioIndex] != -1) {
                new 
url[128];
                
getRadioURL(Houses[i][EHouseRadioIndex], urlsizeof(url));
                
PlayAudioStreamForPlayer(playeridurl);
            }
            
SetPlayerPos(playerid,  Houses[i][EHouseExitX],Houses[i][EHouseExitY],Houses[i][EHouseExitZ]);
            
SetPlayerInterior(playeridHouses[i][EHouseInterior]);
            
SetPlayerVirtualWorld(playeridhouseGetVirtualWorld(i));
        } else if(
IsPlayerInRangeOfPoint(playerid5.0Houses[i][EHouseExitX],Houses[i][EHouseExitY],Houses[i][EHouseExitZ])) {
            if(
GetPlayerVirtualWorld(playerid) == houseGetVirtualWorld(i)) {
                if(
Houses[i][EHouseLights] == 1) {
                    
TextDrawHideForPlayer(playeridHouseLightsText);
                }
                if(
Houses[i][EHouseRadioIndex] != -1) {
                    
StopAudioStreamForPlayer(playerid);
                }
                
SetPlayerPos(playeridHouses[i][EHouseX],Houses[i][EHouseY],Houses[i][EHouseZ]);
                
//SetPlayerInterior(playerid, 0);
                
SetPlayerVirtualWorld(playerid0);
            }
        }
    }
    return 
1;

Hey right now if I create a house in an interior e.g Interior ID is 18.. and when I create a house in interior ID 18, I go inside the house it works and all.. and that house interior id is 5.. but when I exit it doesn't change my Interior ID back to 18.. is it possible to do that?
Reply
#2

PHP код:
housesTryEnterExit(playerid) { 
    for(new 
i=0;i<sizeof(Houses);i++) { 
        if(
IsPlayerInRangeOfPoint(playerid1.5Houses[i][EHouseX],Houses[i][EHouseY],Houses[i][EHouseZ])) { 
            if(
IsHouseLocked(i)) { 
                
GameTextForPlayer(playerid"~r~Locked"20001); 
                return 
1
            } 
            if(
Houses[i][EHouseLights] == 1) { 
                
TextDrawShowForPlayer(playeridHouseLightsText); 
            } 
            if(
Houses[i][EHouseRadioIndex] != -1) { 
                new 
url[128]; 
                
getRadioURL(Houses[i][EHouseRadioIndex], urlsizeof(url)); 
                
PlayAudioStreamForPlayer(playeridurl); 
            } 
            
SetPlayerPos(playerid,  Houses[i][EHouseExitX],Houses[i][EHouseExitY],Houses[i][EHouseExitZ]); 
            
SetPlayerInterior(playeridHouses[i][EHouseInterior]); 
            
SetPlayerVirtualWorld(playeridhouseGetVirtualWorld(i));
            
SetPVarInt(playerid"Interior"GetPlayerInterior(playerid));
        } else if(
IsPlayerInRangeOfPoint(playerid5.0Houses[i][EHouseExitX],Houses[i][EHouseExitY],Houses[i][EHouseExitZ])) { 
            if(
GetPlayerVirtualWorld(playerid) == houseGetVirtualWorld(i)) { 
                if(
Houses[i][EHouseLights] == 1) { 
                    
TextDrawHideForPlayer(playeridHouseLightsText); 
                } 
                if(
Houses[i][EHouseRadioIndex] != -1) { 
                    
StopAudioStreamForPlayer(playerid); 
                } 
                
SetPlayerPos(playeridHouses[i][EHouseX],Houses[i][EHouseY],Houses[i][EHouseZ]); 
                
SetPlayerInterior(playeridGetPVarInt(playerid"Interior"));
                
SetPlayerVirtualWorld(playerid0); 
            } 
        } 
    } 
    return 
1

Reply
#3

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
PHP код:

                SetPlayerInterior
(playeridGetPVarInt(playerid"Interior"));
                
SetPlayerVirtualWorld(playerid0); 
            } 
        } 
    } 
    return 
1

Thanks man, that fixed the interior problem but I am now having problem with Virtual World.. is itpossible to do that for VW aswell?
Reply
#4

PHP код:
housesTryEnterExit(playerid) {
    for(new 
i=0;i<sizeof(Houses);i++) {
        if(
IsPlayerInRangeOfPoint(playerid1.5Houses[i][EHouseX],Houses[i][EHouseY],Houses[i][EHouseZ])) {
            if(
IsHouseLocked(i)) {
                
GameTextForPlayer(playerid"~r~Locked"20001);
                return 
1;
            }
            if(
Houses[i][EHouseLights] == 1) {
                
TextDrawShowForPlayer(playeridHouseLightsText);
            }
            if(
Houses[i][EHouseRadioIndex] != -1) {
                new 
url[128];
                
getRadioURL(Houses[i][EHouseRadioIndex], urlsizeof(url));
                
PlayAudioStreamForPlayer(playeridurl);
            }
            
SetPlayerPos(playerid,  Houses[i][EHouseExitX],Houses[i][EHouseExitY],Houses[i][EHouseExitZ]);
            
SetPlayerInterior(playeridHouses[i][EHouseInterior]);
            
SetPlayerVirtualWorld(playeridhouseGetVirtualWorld(i));
            
SetPVarInt(playerid"Interior"GetPlayerInterior(playerid));
            
SetPVarInt(playerid"VirtualW"GetPlayerVirtualWorld(playerid));
        } else if(
IsPlayerInRangeOfPoint(playerid5.0Houses[i][EHouseExitX],Houses[i][EHouseExitY],Houses[i][EHouseExitZ])) {
            if(
GetPlayerVirtualWorld(playerid) == houseGetVirtualWorld(i)) {
                if(
Houses[i][EHouseLights] == 1) {
                    
TextDrawHideForPlayer(playeridHouseLightsText);
                }
                if(
Houses[i][EHouseRadioIndex] != -1) {
                    
StopAudioStreamForPlayer(playerid);
                }
                
SetPlayerPos(playeridHouses[i][EHouseX],Houses[i][EHouseY],Houses[i][EHouseZ]);
                
SetPlayerInterior(playeridGetPVarInt(playerid"Interior"));
                
SetPlayerVirtualWorld(playeridGetPVarInt(playerid"VirtualW"));
            }
        }
    }
    return 
1;

Reply
#5

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
PHP код:

                SetPlayerVirtualWorld
(playeridGetPVarInt(playerid"VirtualW")); 

Didn't work for some reason.. it sets my VW same as house VW.. and not that int VW
Reply
#6

Quote:
Originally Posted by Puff
Посмотреть сообщение
Didn't work for some reason.. it sets my VW same as house VW.. and not that int VW
It'll set your VW to the one in which you were before entering the house
Reply
#7

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
It'll set your VW to the one in which you were before entering the house
yes it should do that but it isnt doing that.. so.
Reply
#8

PHP код:
housesTryEnterExit(playerid) {
    for(new 
i=0;i<sizeof(Houses);i++) {
        if(
IsPlayerInRangeOfPoint(playerid1.5Houses[i][EHouseX],Houses[i][EHouseY],Houses[i][EHouseZ])) {
            if(
IsHouseLocked(i)) {
                
GameTextForPlayer(playerid"~r~Locked"20001);
                return 
1;
            }
            if(
Houses[i][EHouseLights] == 1) {
                
TextDrawShowForPlayer(playeridHouseLightsText);
            }
            if(
Houses[i][EHouseRadioIndex] != -1) {
                new 
url[128];
                
getRadioURL(Houses[i][EHouseRadioIndex], urlsizeof(url));
                
PlayAudioStreamForPlayer(playeridurl);
            }
            
SetPVarInt(playerid"Interior"GetPlayerInterior(playerid));
            
SetPVarInt(playerid"VirtualW"GetPlayerVirtualWorld(playerid));
            
SetPlayerPos(playerid,  Houses[i][EHouseExitX],Houses[i][EHouseExitY],Houses[i][EHouseExitZ]);
            
SetPlayerInterior(playeridHouses[i][EHouseInterior]);
            
SetPlayerVirtualWorld(playeridhouseGetVirtualWorld(i));
        } else if(
IsPlayerInRangeOfPoint(playerid5.0Houses[i][EHouseExitX],Houses[i][EHouseExitY],Houses[i][EHouseExitZ])) {
            if(
GetPlayerVirtualWorld(playerid) == houseGetVirtualWorld(i)) {
                if(
Houses[i][EHouseLights] == 1) {
                    
TextDrawHideForPlayer(playeridHouseLightsText);
                }
                if(
Houses[i][EHouseRadioIndex] != -1) {
                    
StopAudioStreamForPlayer(playerid);
                }
                
SetPlayerPos(playeridHouses[i][EHouseX],Houses[i][EHouseY],Houses[i][EHouseZ]);
                
SetPlayerInterior(playeridGetPVarInt(playerid"Interior"));
                
SetPlayerVirtualWorld(playeridGetPVarInt(playerid"VirtualW"));
            }
        }
    }
    return 
1;

It should work now, all that was wrong that interior was getting set to house interior before getting saved.
It will work perfectly now.
Reply
#9

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
PHP код:
housesTryEnterExit(playerid) {
    for(new 
i=0;i<sizeof(Houses);i++) {
        if(
IsPlayerInRangeOfPoint(playerid1.5Houses[i][EHouseX],Houses[i][EHouseY],Houses[i][EHouseZ])) {
            if(
IsHouseLocked(i)) {
                
GameTextForPlayer(playerid"~r~Locked"20001);
                return 
1;
            }
            if(
Houses[i][EHouseLights] == 1) {
                
TextDrawShowForPlayer(playeridHouseLightsText);
            }
            if(
Houses[i][EHouseRadioIndex] != -1) {
                new 
url[128];
                
getRadioURL(Houses[i][EHouseRadioIndex], urlsizeof(url));
                
PlayAudioStreamForPlayer(playeridurl);
            }
            
SetPVarInt(playerid"Interior"GetPlayerInterior(playerid));
            
SetPVarInt(playerid"VirtualW"GetPlayerVirtualWorld(playerid));
            
SetPlayerPos(playerid,  Houses[i][EHouseExitX],Houses[i][EHouseExitY],Houses[i][EHouseExitZ]);
            
SetPlayerInterior(playeridHouses[i][EHouseInterior]);
            
SetPlayerVirtualWorld(playeridhouseGetVirtualWorld(i));
        } else if(
IsPlayerInRangeOfPoint(playerid5.0Houses[i][EHouseExitX],Houses[i][EHouseExitY],Houses[i][EHouseExitZ])) {
            if(
GetPlayerVirtualWorld(playerid) == houseGetVirtualWorld(i)) {
                if(
Houses[i][EHouseLights] == 1) {
                    
TextDrawHideForPlayer(playeridHouseLightsText);
                }
                if(
Houses[i][EHouseRadioIndex] != -1) {
                    
StopAudioStreamForPlayer(playerid);
                }
                
SetPlayerPos(playeridHouses[i][EHouseX],Houses[i][EHouseY],Houses[i][EHouseZ]);
                
SetPlayerInterior(playeridGetPVarInt(playerid"Interior"));
                
SetPlayerVirtualWorld(playeridGetPVarInt(playerid"VirtualW"));
            }
        }
    }
    return 
1;

It should work now, all that was wrong that interior was getting set to house interior before getting saved.
It will work perfectly now.
Worked Thanks +REP
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)