Receiving exceptions on changing interior?
#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


Messages In This Thread
Receiving exceptions on changing interior? - by GunZsmd - 23.04.2016, 14:20
Re: Receiving exceptions on changing interior? - by GunZsmd - 23.04.2016, 14:49
Re: Receiving exceptions on changing interior? - by NaS - 23.04.2016, 16:36
Re: Receiving exceptions on changing interior? - by GunZsmd - 23.04.2016, 16:48
Re: Receiving exceptions on changing interior? - by NaS - 23.04.2016, 16:55
Re: Receiving exceptions on changing interior? - by GunZsmd - 23.04.2016, 18:00
Re: Receiving exceptions on changing interior? - by GunZsmd - 23.04.2016, 18:02
Re: Receiving exceptions on changing interior? - by NaS - 23.04.2016, 18:07
Re: Receiving exceptions on changing interior? - by GunZsmd - 23.04.2016, 18:47
Re: Receiving exceptions on changing interior? - by NaS - 23.04.2016, 18:55

Forum Jump:


Users browsing this thread: 1 Guest(s)