Jump to content
  • 0
Tio Akima

Create instance for just one player

Question

[ Create instance for just one player ]

 

guys

 

I created an npc with several quests and that creates an instance and teleports the player to the map ...

Everything works normal if the player has a group, but if I attach the instance to the player it does not teleport.

 

IM_NONE: Attached to no one.  

IM_CHAR: Attached to a single character.  

IM_PARTY: Attached to a party (default instance mode).  

IM_GUILD: Attached to a guild.  

IM_CLAN: Attached to a clan.

 

It creates the instance, however when attaching the instance in the player (and not in the group) the script does not execute the instance_enter Is it possible to do that?

attach only one player? (without being in a group)

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 1

It's IOT_CHAR, not IM_CHAR

.@char = getcharid(CHAR_ID_CHAR);
.@account = getcharid(CHAR_ID_ACCOUNT);
.@map_name$ = "mapname"; // the map you want to instance
.@instance_name$ = sprintf("%s@%i%d", .@map_name$, .@char, gettime(GETTIME_SECOND)); // a unique name for your instance
.@instance = instance_create(.@instance_name$, .@account, IOT_CHAR); // create the instance and attach it to the char
.@instanced_map_name$ = sprintf("%s@%i", .@map_name$, .@instance); // a unique name for the instanced map
.@map$ = instance_attachmap(.@map_name$, .@instance, false, .@instanced_map_name$); // attach the instanced map to your instance
instance_timeout(600, 1, .@instance); // alive and idle timeout, in seconds

// setup is ready so init the instance and warp the player
instance_init(.@instance);
warpchar(.@map$, 20, 20, .@char); // the (x,y) starting point

Share this post


Link to post
Share on other sites
  • 0
16 hours ago, meko said:

It's IOT_CHAR, not IM_CHAR

.@char = getcharid(CHAR_ID_CHAR); .@account = getcharid(CHAR_ID_ACCOUNT); .@map_name$ = "mapname"; // the map you want to instance .@instance_name$ = sprintf("%s@%i%d", .@map_name$, .@char, gettime(GETTIME_SECOND)); // a unique name for your instance .@instance = instance_create(.@instance_name$, .@account, IOT_CHAR); // create the instance and attach it to the char .@instanced_map_name$ = sprintf("%s@%i", .@map_name$, .@instance); // a unique name for the instanced map .@map$ = instance_attachmap(.@map_name$, .@instance, false, .@instanced_map_name$); // attach the instanced map to your instance instance_timeout(600, 1, .@instance); // alive and idle timeout, in seconds // setup is ready so init the instance and warp the player instance_init(.@instance); warpchar(.@map$, 20, 20, .@char); // the (x,y) starting point


.@char = getcharid(CHAR_ID_CHAR);
.@account = getcharid(CHAR_ID_ACCOUNT);
.@map_name$ = "mapname"; // the map you want to instance
.@instance_name$ = sprintf("%s@%i%d", .@map_name$, .@char, gettime(GETTIME_SECOND)); // a unique name for your instance
.@instance = instance_create(.@instance_name$, .@account, IOT_CHAR); // create the instance and attach it to the char
.@instanced_map_name$ = sprintf("%s@%i", .@map_name$, .@instance); // a unique name for the instanced map
.@map$ = instance_attachmap(.@map_name$, .@instance, false, .@instanced_map_name$); // attach the instanced map to your instance
instance_timeout(600, 1, .@instance); // alive and idle timeout, in seconds

// setup is ready so init the instance and warp the player
instance_init(.@instance);
warpchar(.@map$, 20, 20, .@char); // the (x,y) starting point

 

oh nice!!! thanks Meko 
Solved

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.