[Include] IEE (InteriorEnterExits)
#1

IEE 1.2
by Mike
Introduction

This simple include allows you to easily and quickly create pickups to teleport players to interiors.

The default pickup looks like this:



However, the pickup model can be changed within the CreateEnterExit function.

Here's a short video of the system in action. The code for the pickups featured in the video can be found below.

[ame]http://www.youtube.com/watch?v=dtyfhI67agA[/ame]

Changelog

1.2 (22nd of April 2012):
- No longer using y_hooks include
- Added 'OnPlayerEnterExitInterior' callback (OnPlayerEnterExitInterior(playerid, enterexitid, oldinterior, newinterior, Float:x, Float:y, Float:z))
- returning 0 in OnPlayerEnterExitInterior will disable the teleport.

1.1 (21st Jan 2012):
- Now using y_hooks to hook callbacks
- Fixed an issue with using your own pickups alongside this include
- 'world2' parameter in CreateEnterExit now set to -1 by default.
This will prevent the player's world being changed on teleport

1.0 (12th October 2011):
- Initial release

Usage

There are 4 functions in this include:

CreateEnterExit(ieeworld, Float:ieex, Float:ieey, Float:ieez, Float:ieex2, Float:ieey2, Float:ieez2, Float:ieea, ieeinterior, ieeworld2 = -1, ieemsg[] = "", ieemodel=19198 );
- ieeworld: The virtual world to create the pickup in. Use -1 for all worlds.
- ieex, ieey, ieez: The coordinates at which to CREATE the pickup
- ieex2, ieey2, ieez2: The coordinates to teleport players to when they enter the pickup
- ieea: The angle to set for the player when they enter the pickup
- ieeinterior: The interior to set when players enter the teleport
- ieeworld2: The virtual world to set when players enter the teleport. Set to -1 to prevent world being changed
- ieemsg: A message to display to players that enter the pickup (leaving the string empty ( "" ) will show no message, it is empty by default)
- ieemodel: The model to use for the pickup (default is 19198)
Returns: The ID of the 'slot' in which the pickup is in (NOT the actual pickup's ID)

Example as seen in video:

pawn Код:
CreateEnterExit(0, -1605.5649, 711.5371, 13.8672, 246.1845,110.3962, 1003.2257, 2.6308, 10, 0, "Welcome to the {0000FF}San Fierro Police Department{FFFFFF}.");
CreateEnterExit(0, 245.69, 108, 1003.2188, -1605.4934, 714.4520, 12.8833, 0.0, 0, 0, "Left the {0000FF}San Fierro Police Department{FFFFFF}.");
   
CreateEnterExit(0, 1038.1981, -1339.9258, 13.7353, 377.0789, -191.3619, 1000.6328, 0, 17, 0, "Welcome to {8b4513}Jim's Ring{FFFFFF}!");
CreateEnterExit(0, 377.0221, -193.3325,1000.6328, 1038.1012, -1337, 13.7266, 0, 0, 0, "Left {8b4513}Jim's Ring{FFFFFF}. Come again soon!");
DeleteEnterExit(iee_id);
- iee_id - The ID of the enter/exit pickup to delete (returned by CreateEnterExit)
Returns: 1 if the pickup was successfully deleted, 0 on failure

IsEnterExitCreated(iee_id);
- iee_id: The ID to check for exsitance
Returns: 1 if it exists, 0 if not

iee_close();
- No parameters. This function deletes all the pickups and resets the variables. It is not needed in a gamemode. Only use under OnFilterScriptExit (if you use this in a filterscript).
Returns: 1 - always.

Callback
1.2 brings a new callback, OnPlayerEnterExitInterior. This will be called before the teleport, which means you can return 0 in this callback to disable a teleport.

playerid, enterexitid, oldinterior, newinterior, Float:x, Float:y, Float:z
playerid - The ID of the player that entered an IEE
enterexitid - The ID of the enter/exit they entered
oldinterior - Self-explanatory
newinterior - Self-explanatory
x, y, z - The position they will be teleported to

Installation

• Download the .inc file below
• Place it in C:\Program Files\Rockstar Games\GTA San Andreas\pawno\include (or where ever your include folder is)
• Add " #include <iee> " at the top of your gamemode under "#include <a_samp>"
• If you require more than 100 pickups, change the value of MAX_IEE in the .inc file.

NOTE: I have not tested this in a filterscript and gamemode at the same time. Problems may arise. I suggest you only use this include in your gamemode. Not sure why you'd have it in a FS really.

Download

http://pastebin.com/UK2KVqzU
www.movieserv.net/files/iee.inc
http://www.mediafire.com/?i5xzczuoww17pqn

No mirrors please. If the links happen to go down PM me and I'll get another one up.

Thank you!

Please leave a comment below, maybe with a suggestion! Don't forget to report any bugs also please.

Thank you.
Reply
#2

Nice Work.
Reply
#3

wowoww aawweessoommee,, ggood job rep+
Reply
#4

Le bump.
Reply
#5

Version 1.1 released. Few fixes.
Reply
#6

nice
Reply
#7

Nice Work
Reply
#8

Quote:
Originally Posted by Rehasher
Посмотреть сообщение
Seriously? You could at least criticise it properly.
Lol same goes to you.
OT: Very useful and nice include!
Reply
#9

I liked, congratulations.
Reply
#10

At first I was like. WTF is this?! Then I looked into it more. Excellent! This is sick. Making interiors couldn't be easier because of this.
Reply
#11

That was the aim! Thanks for the comment.


Added pastebin link.
Reply
#12

nice work. this is like from server Crazybob too. the pickup
Reply
#13

Quote:
Originally Posted by mature1990
View Post
nice work. this is like from server Crazybob too. the pickup
Well, the model is the same yes.
Reply
#14

very nice, with this include is awesome
https://sampforum.blast.hk/showthread.php?tid=124091.
Reply
#15

Quote:
Originally Posted by juansrc
View Post
very nice, with this include is awesome
https://sampforum.blast.hk/showthread.php?tid=124091.
Thanks, and yeah that's cool, but it's still laggy. Server-sided fading is not pretty.
Reply
#16

What do I type ingame to create enter and exit points?
Reply
#17

Use /save. The coordinates are saved to savedpositions.txt in My Documents\GTA San Andreas User Files\SAMP.

You need to save 4 coordinates. The two pickups, and the two teleport locations. You also need to type /interior prior to /save'ing the inside teleport position and note it in /save (anything you put after '/save ' will be commented in savedpositions.txt.

So, stand at the OUTSIDE door and type
/save outside_pickup

then stand where players should appear when EXITING the interior and type
/save outside_tele

Then do the same for inside, but type /interior first then say it's 5 type
/save int_pickup (interior 5)

In the file you will find AddPlayerClass(skin,x,y,z,angle, other stuff);

You only need x, y, z and angle, and the interior.

Let me know if you need more help.

I might actually make a script to place pickups.
Reply
#18

Well actually I was thinking about using this because I was stuck on this: https://sampforum.blast.hk/showthread.php?tid=330624 :/
Reply
#19

Yeah I saw that thread earlier and was going to reply saying 'Use my include it will be easier' but I decided not to as I thought you explicitly wanted an /enter and /exit command.
Reply
#20

WHere I need to put the CreateEnterExit ? At OnGameModeInt?? Or where ? Please help me
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)