12.10.2011, 15:29
(
Последний раз редактировалось MP2; 22.04.2012 в 17:52.
Причина: Updated to 1.2
)
IEE 1.2
by Mike
Introductionby Mike
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!");
- 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.