[Include] [INC] S:Interior 2.0 (0.2 Compatible)
#1

SInterior 2.0
By Sacky
Download 2.0

What is it:

Basically a database of almost interior in SA:MP including the interior ID's, the maximum and minimum x,y,z values, the spawn x,y,z and angle values, and the names. This allows new function's and it also allows every interior that is documented to have its own unique id.

The new function's include:

GetPlayerInteriorEx(playerid)
Returns the interior number of the player

IsPlayerInInterior(playerid,interiorid)
Returns 1 if the player is in the interior and 0 if they aren't

IsPlayerInAnyInterior(playerid)
Returns 1 if the player is in any interior and 0 if they aren't

GetPlayerInteriorID(playerid)
Returns the interiorid of the player (the internal one used in the script)

IsPlayerInInteriorID(playerid,interiorid)
Returns 1 if the player is in the interiorid and 0 if they aren't

GetInteriorName(interiorid)
Returns the interiorid name

SetPlayerInteriorID(playerid,interiorid)
Sets the player in the interiorid of choice, which will spawn them at an appropriate place

*Note: When I refer to interiors i am talking about the interiors the SA uses, when i am talking about about interiorid's I am talking about the one's used internally in the script

To Include this in your script put this at the top:
pawn Code:
#include <sinterior.pwn>
and make sure the sinterior.pwn is located in the include file

Credits:
Spectre for his hidden interior's script
Reply
#2

Hehe, all i can say is...thank you, it work! Tested in a few buildings in LV. I can now save my positions correctly , nice work.

PS : I've only tested GetPlayerInterior, will test others soon But i don't really understand GetPlayerInteriorId, what is the difference?
Reply
#3

OK its like this

In GTA:SA 2 or more interiors could have the same interior number, it just points to what the player can see, sort of changes the GTA:SA universe, so the interior number only refers to what you can see and interact with.
However the interiorid system i have made lets each interior have a unique ID, instead of the above method to which multiple interiors have the same interior number.
Reply
#4

Ok

Oh, i've found a bug When i save a pos in the Pizza near the Zip shop at LV, it save interior 7, when in reality its interior 5. So when i load it im in the wrong interior. But in your script there is no interior 7 in "Fast Food". Any ideas?

Code:
Cpos002=pizza 
Xpos002=372.351989
Ypos002=-131.651000
Zpos002=1001.492187
Apos002=359.899993
Ipos002=7
I don't understand what happend...

Anyway it's really cool to have do this script.
Reply
#5

yom could you please use GetInteriorName for that interior and tell me the name of the interior it gets confused with?
Reply
#6

OK, as i can't use GetInteriorName (it return me strange things, like AA, FF etc ), i 've used this command:

pawn Code:
if(strcmp(cmdtext,"/name",true) == 0)
{
  SendClientMessage(playerid,C2,intval[GetPlayerInteriorID(playerid)][intname]);
  return 1;
}
So...here is position for starting my test, this is near the Binco in LV :
X 2107.50
Y 2257.50
Z 11.00

Then i've do the few shop aroud this batiment.

My results:
Code:
+---------------+----------------+
|  REAL NAME  |  GIVED NAME  |
+---------------+----------------+
|   BINCO   |   BINCO   |
+---------------+----------------+
| CLUCKIN BELL |  AMMUNATION  |
+---------------+----------------+
|   24/7   |    24/7   |
+---------------+----------------+
|   ZIP    |    ZIP   |
+---------------+----------------+
|   PIZZA   |  AMMUNATION  |
+---------------+----------------+
As you can see, error with the pizza vendor and the cluckin bell

Hope you can resolve it
Reply
#7

Well i'm not sure how its confusing Well-Stacked Pizza Co. With Ammunation

Ammunation (minz,maxz):267.7444,318.3778

Well Stacked Pizza (minz,maxz): 361.2697,382.0142

So even the first area check wouldn't bug according to this can anyone provide some insight to why this is happening
Reply
#8

Very great work! I think SA-MP 0.2 will come out not soon yet, so this should be very useful!
Reply
#9

Very nice, thnx for sharing .

Oh btw, for interior mix-up problem, this might be causing it:

pawn Code:
&& x < intval[i][maxz] &&
In GetPlayerInterior().
Reply
#10

Quote:
Originally Posted by PsYcHoGoD
Oh btw, for interior mix-up problem, this might be causing it:

pawn Code:
&& x < intval[i][maxz] &&
In GetPlayerInterior().
And in GetPlayerInteriorID() !
That's very big bug, should be fixed immediately!
I was so bothered when in casino's both functions returned 0.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)