SA-MP Forums Archive
Interior problem - 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: Interior problem (/showthread.php?tid=622090)



Interior problem - Micko123 - 18.11.2016

This command should put me on pos and int
PHP код:
CMD:enter(playerid)
{
    new 
org;
    if(
IsPlayerInRangeOfPoint(playerid2.0OrgInfo[org][oExitX], OrgInfo[org][oExitY], OrgInfo[org][oExitZ]))
    {
        
SPP(playeridOrgInfo[org][oIntX], OrgInfo[org][oIntY], OrgInfo[org][oIntZ]);
        
SetPlayerInterior(playeridOrgInfo[org][oInt]);
        
SetPlayerVirtualWorld(playeridOrgInfo[org][oVW]);
        return 
1;
    }
    return 
1;

Position is working.. But my int is still 0. Int is saved in DB and everything is loaded but it won't set my int.. Any ideas?


Re: Interior problem - Micko123 - 18.11.2016

I made command to set interior but sometimes it will sometimes it won't set it..


Re: Interior problem - TwinkiDaBoss - 18.11.2016

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 2.0, OrgInfo[org][oExitX], OrgInfo[org][oExitY], OrgInfo[org][oExitZ]))
What is the [org]? How & where is it defined?

Please also show us the enumerator that you use for OrgInfo


Re: Interior problem - Micko123 - 18.11.2016

Rly man?? I am saying about interior.. SOmetimes it won't set my int sometimes it will..


Re: Interior problem - TwinkiDaBoss - 18.11.2016

Quote:
Originally Posted by Micko123
Посмотреть сообщение
Rly man?? I am saying about interior.. SOmetimes it won't set my int sometimes it will..
Sorry I didnt see the new on top.

The problem is quite simple (atleast I think thats the problem)

When you type "/enter" it should teleport you inside a organization that you are near? Like standing on an icon and such.

When you do
pawn Код:
new org;
    if(IsPlayerInRangeOfPoint(playerid, 2.0, OrgInfo[org][oExitX], OrgInfo[org][oExitY], OrgInfo[org][oExitZ]))
org will be 0 by default and it will not really detect the organization you are attempting to enter, more like it will inherit the interior ID of the ID:0 organization. Therefore as I said above, post more of your code, we need to see how you actually create those organizations and how do you put them together. We cannot just judge based on "IsPlayerInRangeOfPoint".

Also what is SPP?


Re: Interior problem - Micko123 - 18.11.2016

Okay so..
SPP - setplayerpos
Org is stored in MySQL DB and ID starts from 1 not from 0 so that is fixed.. Problem is INTERIOR
I made command /int [ID] and it should set my interior. But when I type /int 15 my int is still 0. It is not changing. But sometimes it does.. I am confuseeeeeed


Re: Interior problem - TwinkiDaBoss - 18.11.2016

Add this into your command and go around try to enter few interios and post the results and tell us if they are correct or not

pawn Код:
printf("Entering Organization: %i", org);
printf("Entering interior: %i",OrgInfo[org][oInt]);
print("___________________");



Re: Interior problem - Micko123 - 18.11.2016

I also added to give player interior in debug. Here is the result
PHP код:
[19:33:23Entering Organization1
[19:33:23Entering interior1
[19:33:23Player interior0
[19:33:23___________________ 
And I also changed command
PHP код:
CMD:enter(playerid)
{
    new 
org;
    if(
IsPlayerInRangeOfPoint(playerid2.0OrgInfo[org][oExitX], OrgInfo[org][oExitY], OrgInfo[org][oExitZ]))
    {
        
GetPlayerInterior(playerid);
        
SetPlayerInterior(playerid1);
        
GetPlayerVirtualWorld(playerid);
        
SetPlayerVirtualWorld(playeridOrgInfo[org][oVW]);
        
SPP(playeridOrgInfo[org][oIntX], OrgInfo[org][oIntY], OrgInfo[org][oIntZ]);
        
printf("Entering Organization: %i"OrgInfo[org][oID]);
        
printf("Entering interior: %i",OrgInfo[org][oInt]);
        
printf("Player interior: %d"GetPlayerInterior(playerid));
        print(
"___________________");
    }
    return 
1;

I put SetPlayerInterior(playerid, 1);
But it is still 0..


Re: Interior problem - Micko123 - 18.11.2016

-FIXED!-
Problem vas ******. When I turn on ****** it won't set my int properly..