Jump to content
  • 0

Check for account ID and Character


Question

Posted

I want to give some items to people with a specific account ID + at least 1 maxed char on it.

It is supposed they get it upon first login afterwards

im not good with scripting. I thought of something like

 

if variable not = 1 and accountid < 123456 and at least 1 char max level

getitem 12345

set variable 1

 

thank you

4 answers to this question

Recommended Posts

Posted
-	script	gain_reward	-1,{
OnInit:
	.max_level = getbattleconf( "max_level" );
	end;

OnPCLoginEvent:
	if( !#gain_reward ){
		query_sql( "SELECT `base_level` FROM `char` WHERE `account_id` = "+getcharid(3),.@lv );
		.@size = getarraysize( .@lv );

		for( .@i = 0; .@i < .@size; .@i++ )
			if( .@lv[.@i] >= .max_level )
				.@give_reward = 1;
		
		if( !.@give_reward )
			gain_reward = 1;
	}
	end;
}

 

I think you forgot the part where it gives them the item. :o

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...