02.11.2016, 17:31
Hello guys. I want to save interior id but it prints 0.. even if i use 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;
PHP код:
function OnPlayerPickupEntrance(playerid, pickupid)
{
new query[80];
if(pickupid == Entrance[0]) //Pershing Square Police Department
{
SetPlayerPos(playerid, 1554.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(playerid, 10);
SetPlayerInterior(playerid, 1);
SetPlayerFacingAngle(playerid, 265.9677);
}
if(pickupid == Entrance[1]) //Los Santos Bank
{
SetPlayerPos(playerid,1453.2229,-986.0798,996.1050);
SetPlayerVirtualWorld(playerid, 15);
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(playerid, 13);
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(playerid, 1100.4286,245.9900,528.7618);
SetPlayerVirtualWorld(playerid, 14);
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(playerid, 412.2505,-19.6863,1001.8047);
SetPlayerInterior(playerid,2);
SetPlayerVirtualWorld(playerid, 23);
}
if(pickupid == Entrance[5]) //Tattoo Shop
{
SetPlayerPos(playerid, -202.9983,-41.6730,1002.2734);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 22);
}
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(playerid, 3);
SetPlayerVirtualWorld(playerid, 23);
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(playerid, 10);
}
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(playerid, 4);
}
if(pickupid == Entrance[16]) //Cluckin Bell East Los Santos
{
SetPlayerPos(playerid,366.0440,-8.1931,1001.8516);
SetPlayerInterior(playerid, 9);
SetPlayerVirtualWorld(playerid, 3);
}
if(pickupid == Entrance[17]) //Cluckin Bell Willowfield
{
SetPlayerPos(playerid, 365.8834,-9.0922,1001.8516);
SetPlayerInterior(playerid, 9);
SetPlayerVirtualWorld(playerid, 4);
}
if(pickupid == Entrance[18]) //SWAT Department
{
SetPlayerPos(playerid, 1794.1979,-1577.9740,14.2205);
SetPlayerVirtualWorld(playerid,2);
Loading(playerid);
}
if(pickupid == Entrance[19]) //Burger Shot Mullholand
{
SetPlayerPos(playerid, 366.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(playerid, 2);
SetPlayerVirtualWorld(playerid, 3);
}
if(pickupid == Entrance[22]) //CNN
{
SetPlayerPos(playerid, 648.2988,-1356.2552,4002.5898);
Loading(playerid);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 9);
}
if(pickupid == Entrance[23]) //Grotti
{
SetPlayerPos(playerid, 545.2489,-1317.7793,1996.5759);
Loading(playerid);
SetPlayerInterior(playerid, 4);
SetPlayerVirtualWorld(playerid, 2);
}
if(pickupid == Entrance[24]) //ZIP
{
SetPlayerPos(playerid, 161.3214,-94.6451,1001.8047);
SetPlayerInterior(playerid, 18);
SetPlayerVirtualWorld(playerid, 2);
}
if(pickupid == Entrance[25]) //ds
{
SetPlayerPos(playerid, 204.3126,-164.8291,1000.5234);
SetPlayerInterior(playerid, 14);
SetPlayerVirtualWorld(playerid, 2);
}
if(pickupid == Entrance[26]) //VICTIM
{
SetPlayerPos(playerid, 223.6223,-8.1096,1002.2109);
SetPlayerInterior(playerid, 5);
SetPlayerVirtualWorld(playerid, 2);
}
if(pickupid == Entrance[27]) //swat pd elevator 1
{
SetPlayerPos(playerid, 1768.3547,-1556.9911,38.9865);
SetPlayerDefaultWorld(playerid);
}
if(pickupid == Entrance[28]) //swat pd elevator 2
{
SetPlayerPos(playerid, 1781.6351,-1545.0369,38.9608);
SetPlayerDefaultWorld(playerid);
Loading(playerid);
}
if(pickupid == Entrance[29]) //ELCORONACLUB
{
SetPlayerPos(playerid, 2900.6484,2473.3496,-43.9141);
SetPlayerVirtualWorld(playerid, 4);
SetPlayerInterior(playerid, 22);
Loading(playerid);
}
if(pickupid == Entrance[30]) //ARMY TRAINING DEPARTMENT
{
SetPlayerPos(playerid, 2753.9954,-2379.0837,13.5996);
SetPlayerVirtualWorld(playerid,1);
}
if(pickupid == Entrance[31]) //ARMY TRAINIGN DEPARTMENT FROM PARKING
{
SetPlayerPos(playerid, 2743.2524,-2353.2327,13.5349);
SetPlayerVirtualWorld(playerid,1);
}
if(pickupid == Entrance[32]) //ARMY HQ
{
SetPlayerPos(playerid, 2708.8845,-2543.1028,13.7259);
SetPlayerVirtualWorld(playerid,1);
}
if(pickupid == Entrance[33]) //SANTA MARIA BEACH CLUB
{
SetPlayerPos(playerid, 395.0353,-1796.2133,-14.7219);
SetPlayerVirtualWorld(playerid, 3);
SetPlayerInterior(playerid, 2);
Loading(playerid);
}
if(pickupid == Entrance[34]) //EAST LOS SANTOS POLICE DEPARTMENT
{
SetPlayerPos(playerid, 348.2834, 1834.5260, 2241.5850);
SetPlayerVirtualWorld(playerid, 23);
SetPlayerInterior(playerid, 1);
Loading(playerid);
}
if(pickupid == Entrance[35]) //STAPLES CENTER
{
SetPlayerPos(playerid, 1963.9578, -820.7953, 483.2979);
SetPlayerVirtualWorld(playerid, 5);
SetPlayerInterior(playerid, 2);
SetPlayerFacingAngle(playerid, 344.5761);
}
if(pickupid == Entrance[36]) //IDLEWOOD POLICE DEPARTMENT
{
SetPlayerPos(playerid, 1626.1699,1587.5110,10.8359);
SetPlayerVirtualWorld(playerid, 4);
SetPlayerInterior(playerid, 2);
Loading(playerid);
SetPlayerFacingAngle(playerid, 80.6231);
}
if(pickupid == Entrance[37]) //FORMA IDEALE
{
SetPlayerPos(playerid, 2291.0735, 953.9359, -41.7768);
SetPlayerVirtualWorld(playerid, 17);
SetPlayerInterior(playerid, 7);
SetPlayerFacingAngle(playerid, 344.9753);
Loading(playerid);
}
if(pickupid == Entrance[38]) //VERATTI CORP
{
SetPlayerPos(playerid, 1818.0580, -1230.5765, 64.0059);
SetPlayerVirtualWorld(playerid, 6);
SetPlayerFacingAngle(playerid, 12.1090);
Loading(playerid);
}
if(pickupid == Entrance[39]) //AUDI
{
SetPlayerPos(playerid, 1544.0378,-1258.0356,17.5287);
SetPlayerVirtualWorld(playerid, 10);
SetPlayerInterior(playerid, 0);
Loading(playerid);
SetPlayerFacingAngle(playerid, 359.5505);
}
if(pickupid == Entrance[40]) //BUS BASE 1
{
SetPlayerPos(playerid, 1114.8076,-1279.6515,-33.97300);
SetPlayerVirtualWorld(playerid, 9);
SetPlayerInterior(playerid, 2);
Loading(playerid);
SetPlayerFacingAngle(playerid, 175.9736);
}
if(pickupid == Entrance[41]) //BUS BASE 2
{
SetPlayerPos(playerid, -74.3904,1351.7479,-21.0804);
SetPlayerVirtualWorld(playerid, 23);
SetPlayerInterior(playerid, 1);
Loading(playerid);
SetPlayerFacingAngle(playerid, 167.4162);
}
if(pickupid == Entrance[42]) //TAXIBEAT
{
SetPlayerPos(playerid, 2790.2810,-1594.1958,-48.5485);
SetPlayerVirtualWorld(playerid, 2);
SetPlayerInterior(playerid, 3);
Loading(playerid);
SetPlayerFacingAngle(playerid, 98.5047);
}
pinfo[playerid][VirtualWorld] = GetPlayerVirtualWorld(playerid);
pinfo[playerid][Interior] = GetPlayerInterior(playerid);
mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `VirtualWorld` = %d, `Interior` = %d WHERE `ID` = %i", pinfo[playerid][VirtualWorld], pinfo[playerid][Interior], pinfo[playerid][ID]);
mysql_tquery(mysql, query, "", "");
SendFM(playerid, -1, "[V]: %d V: %d", pinfo[playerid][VirtualWorld], GetPlayerVirtualWorld(playerid));
SendFM(playerid, -1, "[I]: %d I: %d", 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;