Jump to content
  • 0

"@" variable problem. Please help


Question

Posted

Hi everyone. I am doing a custom Instance but I am having a problem with this one.

 

"@"      - A temporary variable attached to the character. 
           They disappear when the character logs out.
 
 
Is there a way to remove this variable to a specific character when he/she go inside a map?
let say for exaample "prontera", instead of logging out to remove this variable can it be possible to remove this when they go to a specific map?

8 answers to this question

Recommended Posts

  • 1
Posted
4 hours ago, neXus said:

let say for exaample "prontera", instead of logging out to remove this variable can it be possible to remove this when they go to a specific map?

I just wanted to add on Akky's answer a little. I don't necessarily recommend either of these options because if your server has lots of players it can create stress. You should always remove the variable from the script that originally assigned it after it's done being used. With that said here are two ways of removing a variable/array when players enter a specific map.

Method one OnPCLoadMapEvent:

-	script	delete_var_123	-1,{
OnPCLoadMapEvent:
	if( strcharinfo(3) == "prontera" ) {
		deletearray player_array; // You can remove arrays with this command.
		player_variable = 0; // As Akky said remove variables by setting them to zero.
	}
}
prontera	mapflag	loadevent

 

Method two OnTouch:

prontera,1,1,1	script	delete_var_111	111,1111,1111,{
OnTouch:
		deletearray player_array; // You can remove arrays with this command.
		player_variable = 0; // As Akky said remove variables by setting them to zero.
}

 

  • Upvote 1
  • 0
Posted

@Skorm

15 hours ago, Skorm said:

I just wanted to add on Akky's answer a little. I don't necessarily recommend either of these options because if your server has lots of players it can create stress. You should always remove the variable from the script that originally assigned it after it's done being used. With that said here are two ways of removing a variable/array when players enter a specific map.

Method one OnPCLoadMapEvent:


-	script	delete_var_123	-1,{
OnPCLoadMapEvent:
	if( strcharinfo(3) == "prontera" ) {
		deletearray player_array; // You can remove arrays with this command.
		player_variable = 0; // As Akky said remove variables by setting them to zero.
	}
}
prontera	mapflag	loadevent

 

Method two OnTouch:


prontera,1,1,1	script	delete_var_111	111,1111,1111,{
OnTouch:
		deletearray player_array; // You can remove arrays with this command.
		player_variable = 0; // As Akky said remove variables by setting them to zero.
}

 

Is it going to be per character? I dont want this variable remove to each character everytime someone goes in to this map.

  • 0
Posted
14 hours ago, Akkarin said:

As they both say "prontera", I think it's safe to assume they run on the Prontera map.

 

is it going to be per instance map or the whole map itself? (copied or original map)

Cause this will be an instance.

  • 0
Posted

It's the "prontera" map.

If you want to remove a variable for specific members leaving an instance, use the OnInstanceDestroy: label in your instance script instead.

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...