Receiving exceptions on changing interior?
#1

Hi guys,
I made a system that when u buy a house it shows a textdraw with arrow's to switch from interior to interior so u can pick one for ur house. However when it reaches interior number 6 (just the variable number the real int ID is 10) it starts giving exceptions.
BUT when i do /ahouseint (houseid) (intid) and i set a house interior to 10 and enter it its all fine. Could it be from being too fast changing from int to int and it doesnt load objects properly? Is there anything i can do?

I would apreciate if u guys could help me
cumpz,
Vasco
Reply
#2

Guys? can u help me plz? the exception is:
Warning(s007): Exception 0xC0000005 at 0x593C6F
Reply
#3

Pre-loading is not really possible, however you should set the player back to interior 0 for a few hundred ms and then to the next interior. You could black out the screen during the process.

Also check which interior(s) produces this, there are some that are buggy. Especially burglary houses and originally unused interiors.
Reply
#4

the interiors that produce this are interiors number 8 9 2 and 5. Also other interesting thing is if i use /ahouseint (houseid) (intid) and enter the house i changed then if i buy a house and start picking an interior it doesnt show the exception. But funny thing is its only with 4 of the 11 ints im using. Its weird as hell
Reply
#5

Quote:
Originally Posted by GunZsmd
Посмотреть сообщение
the interiors that produce this are interiors number 8 9 2 and 5. Also other interesting thing is if i use /ahouseint (houseid) (intid) and enter the house i changed then if i buy a house and start picking an interior it doesnt show the exception. But funny thing is its only with 4 of the 11 ints im using. Its weird as hell
Yea.. Some use procedural objects (for burglary etc) and those seem to be not loading correctly if you're getting there from somewhere else than interior 0. Also some other things probably..
Try it with a delay and interior 0 in between, worked for my house system.
Reply
#6

I tried. It still bugs. Imma leave the code here:

Buying house command:
PHP код:
if(strcmp(cmd"/comprarcasa"true) == 0)
        {
            if(
IsPlayerConnected(playerid))
            {
                new 
Float:oldposxFloat:oldposyFloat:oldposz;
                new 
playername[MAX_PLAYER_NAME];
                
GetPlayerName(playeridplayernamesizeof(playername));
                
GetPlayerPos(playeridoldposxoldposyoldposz);
                for(new 
0sizeof(Houses); h++)
                {
                    if(
PlayerToPoint(2.0playeridHouses[h][EnterX], Houses[h][EnterY], Houses[h][EnterZ]) && Houses[h][Owned] == 0)
                    {
                        if(
Houses[h][HousePrice] == 0)
                        {
                            
SendClientMessage(playeridCOLOR_RED,"[ERRO:] O preco da casa nao foi escolhido, poder nao ser para uso.");
                            return 
1;
                        }
                        if(
PlayerInfo[playerid][pHouseKey] != 255 && strcmp(playernameHouses[PlayerInfo[playerid][pHouseKey]][Owner], true) == 0)
                        {
                            
SendClientMessage(playeridCOLOR_RED,"[ERRO:] Apenas poderas ter uma casa, para compares uma nova, teras que vernder a tua acutal primeiro.");
                            return 
1;
                        }
                        if(
Houses[h][Owned] == 1)
                        {
                            
SendClientMessage(playeridCOLOR_RED,"[ERRO:] Casa Jб tem Dono.");
                            return 
1;
                        }
                        if(
GetPlayerEuros(playerid) >= Houses[h][HousePrice])
                        {
                            if(
PlayerInfo[playerid][pescritura] == 1)
                            {
                                
PlayerInfo[playerid][pescritura] = 0;
                                  
PlayerInfo[playerid][pHouseKey] = h;
                                  
PlayerInfo[playerid][pAluguer] = 0;
                                
Houses[h][Owned] = 1;
                                
Houses[h][Money] = 0;
                                
strmid(Houses[h][Owner], playername0strlen(playername), 255);
                                
GivePlayerEuros(playerid,-Houses[h][HousePrice]);
                                
SetPlayerInterior(playerid,Houses[h][ExitInterior]);
                                
SetPlayerVirtualWorld(playerid,h);
                                
SetPlayerPos(playerid,Houses[h][ExitX],Houses[h][ExitY],Houses[h][ExitZ]);
                                
SendClientMessage(playeridCOLOR_WHITE,"[INFO:] Compraste com sucesso a tua casa!");
                                   
PlayerActionMessage(playerid,15.0,"entrega uma mala cheia de dinheiro б agencia imobliaria, que dao em troca a chave da casa.");
                                
ChangeStreamPickupModel(Houses[h][PickupID],1239);
                                
                                
SaveHouses();
                                
UpdateHouses(h);
                                
OnPlayerDataSave(playerid);
                                
ChooseHouseInt(hplayerid);
                                return 
1;
                            }
                            else
                            {
                                
SendClientMessage(playeridCOLOR_WHITE,"[INFO:] Tens de tratar da papelada na camara municipal!");
                                return 
1;
                            }
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_RED,"[ERRO:] Nao tens dinheiro suficiente!");
                            return 
1;
                        }
                    }
                }
            }
            return 
1;
        } 
PHP код:
public:ChooseHouseInt(hplayerid)
{
    
SendClientMessage(playeridCOLOR_GREEN"Info: Podes escolher o tipo de interior que queres para a tua casa aqui! Usa /selecionar para teres acesso ao mouse.");
    
TextDrawShowForPlayer(playeridhouseint0);
    
TextDrawShowForPlayer(playeridhouseint1);
    
TextDrawShowForPlayer(playeridhouseint2);
    
TextDrawShowForPlayer(playeridhouseint3);
    
TextDrawShowForPlayer(playeridhouseint4);
    
currenthouseint[playerid] = 1;
    
TextDrawSetString(houseint4"1");
    
SetPlayerPos(playerid295.1389771474.4699711080.519897);
    
SetPlayerInterior(playerid15);
    
SetPlayerVirtualWorld(playeridh);
    
    

PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
clickedid == houseint2)
    {
        if(
currenthouseint[playerid] == 1)
        {
            
currenthouseint[playerid] = 2;
               
SetPlayerInterior(playerid0);
               
SetTimerEx("int15"200false"i"playerid);
            
TextDrawSetString(houseint4"2");
        }
        else if(
currenthouseint[playerid] == 2)
        {
            
currenthouseint[playerid] = 3;
            
SetPlayerInterior(playerid0);
            
SetTimerEx("int4"200false"i"playerid);
            
TextDrawSetString(houseint4"3");
        }
        else if(
currenthouseint[playerid] == 3)
        {
            
currenthouseint[playerid] = 4;
            
SetPlayerInterior(playerid0);
            
SetTimerEx("int42"200false"i"playerid);
            
TextDrawSetString(houseint4"4");
        }
        else if(
currenthouseint[playerid] == 4)
        {
            
currenthouseint[playerid] = 5;
            
SetPlayerInterior(playerid6);
            
SetTimerEx("int6"200false"i"playerid);
            
SetPlayerPos(playerid, -68.2940981353.4699711080.279907);
            
TextDrawSetString(houseint4"5");
        }
          else if(
currenthouseint[playerid] == 5)
        {
            
currenthouseint[playerid] = 6;
            
SetPlayerInterior(playerid8);
            
SetTimerEx("int8"200false"i"playerid);
            
SetPlayerPos(playerid, -42.5819971408.1099851084.449951);
            
TextDrawSetString(houseint4"6");
        }
        else if(
currenthouseint[playerid] == 6)
        {
            
currenthouseint[playerid] = 7;
            
SetPlayerInterior(playerid9);
            
SetTimerEx("int9"200false"i"playerid);
            
SetPlayerPos(playerid260.9419861238.5098881084.259888);
            
TextDrawSetString(houseint4"7");
        }
        else if(
currenthouseint[playerid] == 7)
        {
            
currenthouseint[playerid] = 8;
            
SetPlayerInterior(playerid2);
            
SetTimerEx("int2"200false"i"playerid);
            
SetPlayerPos(playerid447.7349851400.4399411084.339966);
            
TextDrawSetString(houseint4"8");
        }
        else if(
currenthouseint[playerid] == 8)
        {
            
currenthouseint[playerid] = 9;
            
SetPlayerInterior(playerid5);
            
SetTimerEx("int5"200false"i"playerid);
            
SetPlayerPos(playerid22.7782991404.9599611084.449951);
            
TextDrawSetString(houseint4"9");
        }
        else if(
currenthouseint[playerid] == 9)
        {
            
currenthouseint[playerid] = 10;
            
SetPlayerInterior(playerid2);
            
SetTimerEx("int22"200false"i"playerid);
            
SetPlayerPos(playerid2464.109863, -1698.6599121013.509949);
            
TextDrawSetString(houseint4"10");
        }
        else if(
currenthouseint[playerid] == 10)
        {
            
currenthouseint[playerid] = 11;
            
SetPlayerInterior(playerid5);
            
SetTimerEx("int52"200false"i"playerid);
            
SetPlayerPos(playerid318.5649721118.2099611083.979980);
            
TextDrawSetString(houseint4"11");
        }
        else if(
currenthouseint[playerid] == 11)
        {
            
SendClientMessage(playeridCOLOR_RED"[ERRO] Nгo se encontram disponiveis mais ints!");
            return 
1;
        }
    }
    if(
clickedid == houseint0)
    {
        if(
currenthouseint[playerid] == 11)
        {
            
currenthouseint[playerid] = 10;
            
SetPlayerInterior(playerid2);
            
SetPlayerPos(playerid2464.109863, -1698.6599121013.509949);
            
TextDrawSetString(houseint4"10");
        }
        else if(
currenthouseint[playerid] == 10)
        {
            
currenthouseint[playerid] = 9;
            
SetPlayerInterior(playerid5);
            
SetPlayerPos(playerid22.7782991404.9599611084.449951);
            
TextDrawSetString(houseint4"9");
        }
        else if(
currenthouseint[playerid] == 9)
        {
            
currenthouseint[playerid] = 8;
            
SetPlayerInterior(playerid2);
            
SetPlayerPos(playerid447.7349851400.4399411084.339966);
            
TextDrawSetString(houseint4"8");
        }
        else if(
currenthouseint[playerid] == 8)
        {
            
currenthouseint[playerid] = 7;
            
SetPlayerInterior(playerid9);
            
SetPlayerPos(playerid260.9419861238.5098881084.259888);
            
TextDrawSetString(houseint4"7");
        }
        else if(
currenthouseint[playerid] == 7)
        {
            
currenthouseint[playerid] = 6;
            
SetPlayerInterior(playerid8);
            
SetPlayerPos(playerid, -42.5819971408.1099851084.449951);
            
TextDrawSetString(houseint4"6");
        }
        else if(
currenthouseint[playerid] == 6)
        {
            
currenthouseint[playerid] = 5;
            
SetPlayerInterior(playerid6);
            
SetPlayerPos(playerid, -68.2940981353.4699711080.279907);
            
TextDrawSetString(houseint4"5");
        }
        else if(
currenthouseint[playerid] == 5)
        {
            
currenthouseint[playerid] = 4;
            
SetPlayerInterior(playerid4);
            
SetPlayerPos(playerid221.6669921143.3898931082.679932);
            
TextDrawSetString(houseint4"4");
        }
        else if(
currenthouseint[playerid] == 4)
        {
            
currenthouseint[playerid] = 3;
            
SetPlayerInterior(playerid4);
            
SetPlayerPos(playerid260.9839781286.5499271080.299927);
            
TextDrawSetString(houseint4"3");
        }
        else if(
currenthouseint[playerid] == 3)
        {
            
currenthouseint[playerid] = 2;
            
SetPlayerInterior(playerid15);
            
SetPlayerPos(playerid328.4939881480.5899661084.449951);
            
TextDrawSetString(houseint4"2");
        }
        else if(
currenthouseint[playerid] == 2)
        {
            
TextDrawSetString(houseint4"1");
            
SetPlayerInterior(playerid15);
            
SetPlayerPos(playerid295.1389771474.4699711080.519897);
            
currenthouseint[playerid] = 1;
        }
        else if(
currenthouseint[playerid] == 1)
        {
              
SendClientMessage(playeridCOLOR_RED"[ERRO] Nгo se encontram disponiveis mais ints!");
              return 
1;
        }
    }

PHP код:
forward int15(playerid);
public 
int15(playerid)
{
    if(
currenthouseint[playerid] == 2)
    {
    
SetPlayerInterior(playerid15);
    
SetPlayerPos(playerid328.4939881480.5899661084.449951);
    }
}
forward int4(playerid);
public 
int4(playerid)
{
    
SetPlayerInterior(playerid4);
    
SetPlayerPos(playerid260.9839781286.5499271080.299927);
}
forward int42(playerid);
public 
int42(playerid)
{
    
SetPlayerInterior(playerid4);
    
SetPlayerPos(playerid221.6669921143.3898931082.679932);
}
forward int6(playerid);
public 
int6(playerid)
{
    
SetPlayerInterior(playerid6);
    
SetPlayerPos(playerid, -68.2940981353.4699711080.279907);
}
forward int8(playerid);
public 
int8(playerid)
{
    
SetPlayerInterior(playerid8);
    
SetPlayerPos(playerid, -42.5819971408.1099851084.449951);
}
forward int9(playerid);
public 
int9(playerid)
{
    
SetPlayerInterior(playerid9);
    
SetPlayerPos(playerid260.9419861238.5098881084.259888);
}
forward int2(playerid);
public 
int2(playerid)
{
    
SetPlayerInterior(playerid2);
    
SetPlayerPos(playerid447.7349851400.4399411084.339966);
}
forward int5(playerid);
public 
int5(playerid)
{
    
SetPlayerInterior(playerid5);
    
SetPlayerPos(playerid22.7782991404.9599611084.449951);
}
forward int22(playerid);
public 
int22(playerid)
{
    
SetPlayerInterior(playerid2);
    
SetPlayerPos(playerid2464.109863, -1698.6599121013.509949);
}
forward int52(playerid);
public 
int52(playerid)
{
    
SetPlayerInterior(playerid2);
    
SetPlayerPos(playerid318.5649721118.2099611083.979980);


Please if u find any errors that can be causing this lemme know please i just cant fix it
Reply
#7

plz help me D:
Reply
#8

Try a longer interval for the timer, in my script I have set it to 700ms. I also set the player's position before the interior, not sure if that helps.

Oh and set the player away from the interior when you set the int to 0 (anywhere below 400m should do).
Reply
#9

Still causing exceptions :S why is it doing that and why it only happens on those ints?
Reply
#10

Quote:
Originally Posted by GunZsmd
Посмотреть сообщение
Still causing exceptions :S why is it doing that and why it only happens on those ints?
Do you use any RemoveBuildingForPlayer for any objects inside interiors? I don't know what else it could be. Except some interiors are just buggy.
And restart your client before testing changes (in case you didn't).

As long as your client doesn't crash or malfunction it's not a big deal, but annoying of course.

Oh and the exception you stated above* is also throwing for Object Limit and sometimes invalid Tuning Parts (which shouldnt apply here).
I guess it could be object limit. Were there any objects spawned when you tested it (many)?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)