Jump to content
  • 0

Question

Posted

I want to request a rewarder script that goes like this:

 

this rewarder give players who comes to a map for the 1st time.

-Checks IP.

-Also gives Exp

-One per account

 

thanks :)

8 answers to this question

Recommended Posts

Posted


- script welcome_on_my_map -1,{

OnPCLoadMapEvent:

.@map$ = strcharinfo(3);

while( .@i < .size_specialmap && .@map$ != .special_map$[.@i] ) .@i++;

if ( .@i == .size_specialmap || #variable_firstmap & ( 1 << .@i ) ) end;

query_sql "select max(`value`) from global_reg_value where `str` = '#variable_firstmap' and `account_id` in ( select `account_id` from `login` where `last_ip` = ( select `last_ip` from `login` where `account_id` = "+ getcharid(3) +" ) )", .@tmp;// null convert to 0 by serv

if ( .@tmp & ( 1 << .@i ) == 0 ) {

#variable_firstmap = #variable_firstmap | ( 1 << .@i );

query_sql "insert into global_reg_value (`char_id`, `str`, `value`, `type`, `account_id`) select 0, '#variable_firstmap', '"+ #variable_firstmap +"', 2, `account_id` from `login` where `account_id` in ( select `account_id` from `login` where `last_ip` = ( select `last_ip` from `login` where `account_id` = "+ getcharid(3) +" ) ) on duplicate key update value = '"+ #variable_firstmap +"'";

getexp .base_exp_gained[.@i], .job_exp_gained[.@i];// base exp, job exp gained

dispbottom "You got "+ .base_exp_gained[.@i] +" base exp and "+ .job_exp_gained[.@i] +" job exp.";

}

end;

Oninit:// setting

setarray .special_map$, "payon","geffen";// your map exp reward

setarray .base_exp_gained, 100, 100;// base exp given by map (payon, geffen..)

setarray .job_exp_gained, 100, 100;// job exp given by map (payon, geffen..)

// others

.size_specialmap = getarraysize( .special_map$ );

while( .@i < .size_specialmap ) {

setmapflag .special_map$[.@i], mf_loadevent;

.@i++;

}

}

Posted
-	script	welcome_on_my_map	-1,{
OnPCLoadMapEvent:
	.@map$ = strcharinfo(3);
	while( .@i < .size_specialmap && .@map$ != .special_map$[.@i] ) .@i++;
	if ( .@i == .size_specialmap || #variable_firstmap & ( 1 << .@i ) ) end;
	query_sql "select max(`value`) from global_reg_value where `str` = '#variable_firstmap' and `account_id` in ( select `account_id` from `login` where `last_ip` = ( select `last_ip` from `login` where `account_id` = "+ getcharid(3) +" ) )", .@tmp;// null convert to 0 by serv
	if ( .@tmp & ( 1 << .@i ) == 0 ) {
getitem 607,100;
		#variable_firstmap = #variable_firstmap | ( 1 << .@i );
		query_sql "insert into global_reg_value (`char_id`, `str`, `value`, `type`, `account_id`) select 0, '#variable_firstmap', '"+ #variable_firstmap +"', 2, `account_id` from `login` where `account_id` in ( select `account_id` from `login` where `last_ip` = ( select `last_ip` from `login` where `account_id` = "+ getcharid(3) +" ) ) on duplicate key update value = '"+ #variable_firstmap +"'";
		getexp .base_exp_gained[.@i], .job_exp_gained[.@i];// base exp, job exp gained
		dispbottom "You got "+ .base_exp_gained[.@i] +" base exp and "+ .job_exp_gained[.@i] +" job exp.";
	}
	end;
Oninit:// setting
	setarray .special_map$, "payon","geffen";// your map exp reward
	setarray .base_exp_gained, 100, 100;// base exp given by map (payon, geffen..)
	setarray .job_exp_gained, 100, 100;// job exp given by map (payon, geffen..)

// others
	.size_specialmap = getarraysize( .special_map$ );
	while( .@i < .size_specialmap ) {
		setmapflag .special_map$[.@i], mf_loadevent;
		.@i++;
	}
}

 

 

did i do this right?

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