SA-MP Forums Archive
Wrong Interior Printing. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Wrong Interior Printing. (/showthread.php?tid=620743)



Wrong Interior Printing. - vassilis - 02.11.2016

Hello guys. I want to save interior id but it prints 0.. even if i use GetPlayerInterior(playerid);
PHP код:
function OnPlayerPickupEntrance(playeridpickupid)
{
    new 
query[80];
                    if(
pickupid == Entrance[0]) //Pershing Square Police Department 
                    
{
                        
SetPlayerPos(playerid1554.9330,-1674.5698,2113.0349); 
                        
SendClientMessage(playerid,-1,""COL_LIGHTBLUE"PSPD"COL_WHITE": Welcome to Pershing Square Police Department. Only "COL_BLUE"officers"COL_WHITE" can pass doors.");
                        
Loading(playerid);
                        
SetPlayerVirtualWorld(playerid10);
                        
SetPlayerInterior(playerid1);
                        
SetPlayerFacingAngle(playerid265.9677);
                    }
                    if(
pickupid == Entrance[1]) //Los Santos Bank
                    
{
                            
SetPlayerPos(playerid,1453.2229,-986.0798,996.1050);
                            
SetPlayerVirtualWorld(playerid15);
                            
SendClientMessage(playerid, -1""COL_GREEN"CCNR BANK"COL_WHITE": Welcome to Los Santos City Bank. You can withdraw,deposit and send money to other players!");
                            
Loading(playerid);
                    }
                    
                    if(
pickupid == Entrance[2]) //Well Stacked Pizza
                    
{
                            
SetPlayerInterior(playerid,5);
                            
SetPlayerVirtualWorld(playerid13);
                            
SetPlayerPos(playerid,372.0254,-130.0807,1001.4922);
                            
SendClientMessage(playerid,-1,""COL_GREEN"Well Stacked Pizza"COL_WHITE": Welcome to Well Stacked Pizza. You can eat here to gain health!");
                    
                    }
                    
                    if(
pickupid == Entrance[3]) //Los Santos Alhambra Club
                    
{
                            
SetPlayerInterior(playerid,17);
                            
SetPlayerPos(playerid1100.4286,245.9900,528.7618);
                            
SetPlayerVirtualWorld(playerid14);
                            
SendClientMessage(playerid,-1,""COL_GREEN"CCNR CLUB"COL_WHITE": Welcome to Los Santos City Alhambra Club. You can dance, drink, chat with other people here.");
                            
Loading(playerid);
                    }
                    if(
pickupid == Entrance[4]) //Barber Shop
                    
{
                            
SetPlayerPos(playerid412.2505,-19.6863,1001.8047);
                            
SetPlayerInterior(playerid,2);
                            
SetPlayerVirtualWorld(playerid23);
                    }
                    if(
pickupid == Entrance[5]) //Tattoo Shop
                    
{
                            
SetPlayerPos(playerid, -202.9983,-41.6730,1002.2734);
                            
SetPlayerInterior(playerid3);
                            
SetPlayerVirtualWorld(playerid22);
                    }
                    
                    if(
pickupid == Entrance[6]) //Cia HQ
                    
{
                        
SetPlayerPos(playerid,1281.0238,-997.3157,6645.7319);
                        
SetPlayerInterior(playerid,5);
                        
SetPlayerVirtualWorld(playerid,12);
                        
Loading(playerid);
                        
                    }
                    
                    if(
pickupid == Entrance[7]) //Hospital Market
                    
{
                        
SetPlayerPos(playerid, -204.4226,-1739.8254,675.7687);
                        
SetPlayerInterior(playerid3);
                        
SetPlayerVirtualWorld(playerid23);
                        
Loading(playerid);
                    }
                    
                    if(
pickupid == Entrance[8]) //Ammunation Market
                    
{
                        
SetPlayerPos(playerid,315.2803,-164.6459,999.5938);
                        
SetPlayerInterior(playerid,6);
                        
SetPlayerVirtualWorld(playerid,9);
                    }
                    
                    if(
pickupid == Entrance[9]) //Binco
                    
{
                        
SetPlayerPos(playerid,207.8831,-107.0380,1005.1328);
                        
SetPlayerInterior(playerid,15);
                        
SetPlayerVirtualWorld(playerid,13);
                    }
                    
                    if(
pickupid == Entrance[10]) //Barber Shop Marina
                    
{
                        
SetPlayerPos(playerid,411.9343,-50.3636,1001.8984);
                        
SetPlayerInterior(playerid,12);
                        
SetPlayerVirtualWorld(playerid,4);
                    }
                    
                    if(
pickupid == Entrance[11]) //Burger Shot Marina
                    
{
                        
SetPlayerPos(playerid,366.3389,-72.8186,1001.5078);
                        
SetPlayerInterior(playerid,10);
                        
SetPlayerVirtualWorld(playerid10);
                    }
                    
                    if(
pickupid ==Entrance[12]) //CCNR Corp
                    
{
                        
SetPlayerPos(playerid,1406.9817,1316.0133,1501.0840);
                        
Loading(playerid);
                        
SetPlayerInterior(playerid,5);
                        
SetPlayerVirtualWorld(playerid,5);
                    }
                    
                    if(
pickupid == Entrance[13]) //Cluckin Bell Market
                    
{    
                        
SetPlayerPos(playerid,366.3753,-7.3678,1001.8516);
                        
SetPlayerInterior(playerid,9);
                        
SetPlayerVirtualWorld(playerid,2);
                    }
                    
                    if(
pickupid == Entrance[14]) //Pro Laps
                    
{
                        
SetPlayerPos(playerid,206.4738,-136.9131,1002.8744);
                        
SetPlayerInterior(playerid,3);
                        
SetPlayerVirtualWorld(playerid,2);
                    }
                    
                    if(
pickupid == Entrance[15]) //SubUrban Jefferson
                    
{
                        
SetPlayerPos(playerid,204.3879,-47.0266,1001.8047);
                        
SetPlayerInterior(playerid,1);
                        
SetPlayerVirtualWorld(playerid4);
                    }
                    
                    if(
pickupid == Entrance[16]) //Cluckin Bell East Los Santos
                    
{
                        
SetPlayerPos(playerid,366.0440,-8.1931,1001.8516);
                        
SetPlayerInterior(playerid9);
                        
SetPlayerVirtualWorld(playerid3);
                    }
                    
                    if(
pickupid == Entrance[17]) //Cluckin Bell Willowfield
                    
{
                        
SetPlayerPos(playerid365.8834,-9.0922,1001.8516);
                        
SetPlayerInterior(playerid9);
                        
SetPlayerVirtualWorld(playerid4);
                    }
                    
                    if(
pickupid == Entrance[18]) //SWAT Department
                    
{
                        
SetPlayerPos(playerid1794.1979,-1577.9740,14.2205);
                        
SetPlayerVirtualWorld(playerid,2);
                        
Loading(playerid);
                    }
                    
                    if(
pickupid == Entrance[19]) //Burger Shot Mullholand
                    
{
                        
SetPlayerPos(playerid366.3389,-72.8186,1001.5078);
                        
SetPlayerInterior(playerid,10);
                        
SetPlayerVirtualWorld(playerid,2);
                    }
                    
                    if(
pickupid == Entrance[20]) //24-7 Unity Station
                    
{
                        
SetPlayerPos(playerid, -26.9099,-54.9210,1003.5469);
                        
SetPlayerInterior(playerid,6);
                        
SetPlayerVirtualWorld(playerid,9);
                    }
                    
                    if(
pickupid == Entrance[21]) //Binco Custom Clothes Shop
                    
{
                        
SetPlayerPos(playerid,1038.0410,-1.7967,1022.4749);
                        
Loading(playerid);
                        
SetPlayerInterior(playerid2);
                        
SetPlayerVirtualWorld(playerid3);
                    }
                    
                    if(
pickupid == Entrance[22]) //CNN 
                    
{
                        
SetPlayerPos(playerid648.2988,-1356.2552,4002.5898);
                        
Loading(playerid);
                        
SetPlayerInterior(playerid3);
                        
SetPlayerVirtualWorld(playerid9);
                    }
                    
                    if(
pickupid == Entrance[23]) //Grotti
                    
{
                        
SetPlayerPos(playerid545.2489,-1317.7793,1996.5759);
                        
Loading(playerid);
                        
SetPlayerInterior(playerid4);
                        
SetPlayerVirtualWorld(playerid2);
                    }    
                    
                    if(
pickupid == Entrance[24]) //ZIP
                    
{
                        
SetPlayerPos(playerid161.3214,-94.6451,1001.8047);
                        
SetPlayerInterior(playerid18);
                        
SetPlayerVirtualWorld(playerid2);
                    }    
                    
                    if(
pickupid == Entrance[25]) //ds
                    
{
                        
SetPlayerPos(playerid204.3126,-164.8291,1000.5234);
                        
SetPlayerInterior(playerid14);
                        
SetPlayerVirtualWorld(playerid2);
                    }    
                    
                    if(
pickupid == Entrance[26]) //VICTIM
                    
{
                        
SetPlayerPos(playerid223.6223,-8.1096,1002.2109);
                        
SetPlayerInterior(playerid5);
                        
SetPlayerVirtualWorld(playerid2);
                    }    
                    
                    if(
pickupid == Entrance[27]) //swat pd elevator 1
                    
{
                        
SetPlayerPos(playerid1768.3547,-1556.9911,38.9865);
                        
SetPlayerDefaultWorld(playerid);
                    }    
                    
                    if(
pickupid == Entrance[28]) //swat pd elevator 2
                    
{
                        
SetPlayerPos(playerid1781.6351,-1545.0369,38.9608);
                        
SetPlayerDefaultWorld(playerid);
                        
Loading(playerid);
                    }
                    
                    if(
pickupid == Entrance[29]) //ELCORONACLUB
                    
{
                        
SetPlayerPos(playerid2900.6484,2473.3496,-43.9141);
                        
SetPlayerVirtualWorld(playerid4);
                        
SetPlayerInterior(playerid22);
                        
Loading(playerid);
                    }
                    
                    if(
pickupid == Entrance[30]) //ARMY TRAINING DEPARTMENT
                    
{
                        
SetPlayerPos(playerid2753.9954,-2379.0837,13.5996);
                        
SetPlayerVirtualWorld(playerid,1);
                    }
                    
                    if(
pickupid == Entrance[31]) //ARMY TRAINIGN DEPARTMENT FROM PARKING
                    
{
                        
SetPlayerPos(playerid2743.2524,-2353.2327,13.5349);
                        
SetPlayerVirtualWorld(playerid,1);
                    }
                    
                    if(
pickupid == Entrance[32]) //ARMY HQ
                    
{
                        
SetPlayerPos(playerid2708.8845,-2543.1028,13.7259);
                        
SetPlayerVirtualWorld(playerid,1);
                    }    
                    
                    if(
pickupid == Entrance[33]) //SANTA MARIA BEACH CLUB
                    
{
                        
SetPlayerPos(playerid395.0353,-1796.2133,-14.7219);
                        
SetPlayerVirtualWorld(playerid3);
                        
SetPlayerInterior(playerid2);
                        
Loading(playerid);
                    }        
                    
                    if(
pickupid == Entrance[34]) //EAST LOS SANTOS POLICE DEPARTMENT
                    
{
                        
SetPlayerPos(playerid348.28341834.52602241.5850);
                        
SetPlayerVirtualWorld(playerid23);
                        
SetPlayerInterior(playerid1);
                        
Loading(playerid);
                    }    
                    
                    if(
pickupid == Entrance[35]) //STAPLES CENTER 
                    
{
                        
SetPlayerPos(playerid1963.9578, -820.7953483.2979);
                        
SetPlayerVirtualWorld(playerid5);
                        
SetPlayerInterior(playerid2);
                        
SetPlayerFacingAngle(playerid344.5761);
                    }    
                    
                    if(
pickupid == Entrance[36]) //IDLEWOOD POLICE DEPARTMENT 
                    
{
                        
SetPlayerPos(playerid1626.1699,1587.5110,10.8359);
                        
SetPlayerVirtualWorld(playerid4);
                        
SetPlayerInterior(playerid2);
                        
Loading(playerid);
                        
SetPlayerFacingAngle(playerid80.6231);
                    }    
                    
                    if(
pickupid == Entrance[37]) //FORMA IDEALE
                    
{
                        
SetPlayerPos(playerid2291.0735953.9359, -41.7768);
                        
SetPlayerVirtualWorld(playerid17);
                        
SetPlayerInterior(playerid7);
                        
SetPlayerFacingAngle(playerid344.9753);
                        
Loading(playerid);
                    }    
                    
                    if(
pickupid == Entrance[38]) //VERATTI CORP
                    
{
                        
SetPlayerPos(playerid1818.0580, -1230.576564.0059);
                        
SetPlayerVirtualWorld(playerid6);
                        
SetPlayerFacingAngle(playerid12.1090);
                        
Loading(playerid);
                    }    
                    
                    if(
pickupid == Entrance[39]) //AUDI
                    
{
                        
SetPlayerPos(playerid1544.0378,-1258.0356,17.5287);
                        
SetPlayerVirtualWorld(playerid10);
                        
SetPlayerInterior(playerid0);
                        
Loading(playerid);
                        
SetPlayerFacingAngle(playerid359.5505);
                    }    
                    
                    if(
pickupid == Entrance[40]) //BUS BASE 1
                    
{
                        
SetPlayerPos(playerid1114.8076,-1279.6515,-33.97300);
                        
SetPlayerVirtualWorld(playerid9);
                        
SetPlayerInterior(playerid2);
                        
Loading(playerid);
                        
SetPlayerFacingAngle(playerid175.9736);
                    }    
                    
                    if(
pickupid == Entrance[41]) //BUS BASE 2
                    
{
                        
SetPlayerPos(playerid, -74.3904,1351.7479,-21.0804);
                        
SetPlayerVirtualWorld(playerid23);
                        
SetPlayerInterior(playerid1);
                        
Loading(playerid);
                        
SetPlayerFacingAngle(playerid167.4162);
                    }    
                    
                    if(
pickupid == Entrance[42]) //TAXIBEAT
                    
{
                        
SetPlayerPos(playerid2790.2810,-1594.1958,-48.5485);
                        
SetPlayerVirtualWorld(playerid2);
                        
SetPlayerInterior(playerid3);
                        
Loading(playerid);
                        
SetPlayerFacingAngle(playerid98.5047);
                    }
                    
                        
pinfo[playerid][VirtualWorld] = GetPlayerVirtualWorld(playerid);
                        
pinfo[playerid][Interior] = GetPlayerInterior(playerid);
                        
mysql_format(mysqlquerysizeof(query), "UPDATE `players` SET `VirtualWorld` = %d, `Interior` = %d WHERE `ID` = %i"pinfo[playerid][VirtualWorld], pinfo[playerid][Interior], pinfo[playerid][ID]);
                        
mysql_tquery(mysqlquery"""");
                        
SendFM(playerid, -1"[V]: %d V: %d"pinfo[playerid][VirtualWorld], GetPlayerVirtualWorld(playerid));
                        
SendFM(playerid, -1"[I]: %d I: %d"pinfo[playerid][Interior], GetPlayerInterior(playerid)); 
I even tried in each if statement and done pinfo[playerid][Interior] = GetPlayerInterior(playerid);
But still it prints interior id 0.
EDIT: A temporary fix is to set to each if statement - pinfo[playerid][Interior] = InteriorIDhere;


Re: Wrong Interior Printing. - NeXoR - 02.11.2016

Seems like a SAMP bug to me, I don't know any reason for this to happen
Try out Bug Reports