kangfredy Posted March 5, 2013 Posted March 5, 2013 guys can i request this is npc can check IP address if same IP in login database..player cannot take this item. newbiereward.txt Quote
DJFUNK Posted March 5, 2013 Posted March 5, 2013 Use my Newbie Rewarder sir.. you can modify by yourself. It support refined equipment and IP check. // Reward Array <Item Id>, <Qty>, <Refine> // Set refine option to 0 if non-refinable. setarray .@rwd[0],1208,1,0,2424,1,6,2528,1,6; that means: get Main Gauche[4], Tidal Shoes +6, and Wool Scarf +6. if unrefineable items, just set to: 0 empiremain,108,62,3 script Newbie Gift 90,{ // Reward Array <Item Id>, <Qty>, <Refine> // Set refine option to 0 if non-refinable. setarray .@rwd[0],20009,1,0,2424,1,6,2528,1,6; query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) + "", .@lip$); if ( getd("$" + .@lip$ + "_NG") > 0 || #NewbieGift > 0) { mes "[Newbie Gift]"; mes "Sorry, You've get one.^^"; close; } mes "[Newbie Gift]"; mes "Welocme to xxx RO."; mes "This is your reward for Newbie:"; // List all the items. for ( set .@i, 0; .@i < getarraysize(.@rwd); set .@i, .@i + 3 ) // Check if refined option is not 0. if(.@rwd[.@i+2] != 0) { mes .@rwd[.@i+1] + " x +" + .@rwd[.@i+2] + " " + getitemname(.@rwd[.@i]); }else{ mes .@rwd[.@i+1] + " x " + getitemname(.@rwd[.@i]); } close2; // Get Items for ( set .@i, 0; .@i < getarraysize(.@rwd); set .@i, .@i + 3 ) // Check if refined option is not 0. if(.@rwd[.@i+2] != 0) { // getitem2 <id>, <qty>, <identify>, <refine>, <attribute>, <card1>, <card2>, <card3>, <card4> getitem2 .@rwd[.@i], .@rwd[.@i+1], 1, .@rwd[.@i+2], 0, 0, 0, 0, 0; }else{ getitem .@rwd[.@i], .@rwd[.@i+1]; } // Set variable to make sure player can't get items again. set #NewbieGift, 1; setd "$" + .@lip$ + "_NG", getd("$" + .@lip$ + "_NG") + 1; end; OnInit: waitingroom "Newbie Gift!",0; end; } Newbie_Rewarder.txt Quote
kangfredy Posted March 5, 2013 Author Posted March 5, 2013 (edited) sory i have been change.........tq for inspiring me. im using from your script just this. query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) + "", .@lip$);if ( getd("$" + .@lip$ + "_NG") > 0 || #NewbieGift > 0){ mes "[Newbie Gift]"; mes "Sorry, You've get one.^^"; close;} mes"this is it"; getitem blablabla; getitem blablabla: set zeny...:next; mes"tq for playing"; close; set #NewbieGift, 1;setd "$" + .@lip$ + "_NG", getd("$" + .@lip$ + "_NG") + 1; Edited March 5, 2013 by kangfredy Quote
Capuche Posted March 5, 2013 Posted March 5, 2013 guys can i request this is npc can check IP address if same IP in login database..player cannot take this item. newbiereward.txt or that new_1-1,60,113,6 script Newbiereward 823,{ if( #redemgive1 ) { L_dont: mes "I already give your items."; close; } // Check if already give in other account query_sql "SELECT `last_ip` FROM `login` WHERE `account_id` = "+ getcharid(3), .@last_ip$; query_sql "SELECT CAST(`value` AS UNSIGNED) " + "FROM global_reg_value " + "LEFT JOIN `login` ON global_reg_value.account_id=`login`.account_id " + "WHERE global_reg_value.`str`='#redemgive1' " + "AND `login`.`last_ip` LIKE '"+ escape_sql( .@last_ip$ ) +"' " + "ORDER BY CAST(`value` AS UNSIGNED) DESC LIMIT 10", .@reward; for( .@i = 0; .@i < getarraysize( .@reward ); .@i++ ) if( .@reward[ .@i ] ) goto L_dont; mes "this is your rewards"; getitem 7179, 20; getitem 616, 3; getitem 12623, 1; set zeny,zeny + 1000000; set #redemgive1, 1; close; } This one avoid $variables Quote
kangfredy Posted March 5, 2013 Author Posted March 5, 2013 guys can i request this is npc can check IP address if same IP in login database..player cannot take this item. newbiereward.txt or that new_1-1,60,113,6 script Newbiereward 823,{ if( #redemgive1 ) { L_dont: mes "I already give your items."; close; } // Check if already give in other account query_sql "SELECT `last_ip` FROM `login` WHERE `account_id` = "+ getcharid(3), .@last_ip$; query_sql "SELECT CAST(`value` AS UNSIGNED) " + "FROM global_reg_value " + "LEFT JOIN `login` ON global_reg_value.account_id=`login`.account_id " + "WHERE global_reg_value.`str`='#redemgive1' " + "AND `login`.`last_ip` LIKE '"+ escape_sql( .@last_ip$ ) +"' " + "ORDER BY CAST(`value` AS UNSIGNED) DESC LIMIT 10", .@reward; for( .@i = 0; .@i < getarraysize( .@reward ); .@i++ ) if( .@reward[ .@i ] ) goto L_dont; mes "this is your rewards"; getitem 7179, 20; getitem 616, 3; getitem 12623, 1; set zeny,zeny + 1000000; set #redemgive1, 1; close; } This one avoid $variables but capuche..can you explain me your script work?it's different from my script? in post nummber 3 http://rathena.org/board/topic/79683-request-modify-my-reward-newbie/?p=184595 ??? Quote
Capuche Posted March 5, 2013 Posted March 5, 2013 (edited) My script does the same as your (I guess) But mine avoid $variables setd "$" + .@lip$ + "_NG", getd("$" + .@lip$ + "_NG") + 1; Yours create $variables for each IP, not mine. It's better to avoid $variable if you can otherwise, one day, if you abuse of this variable your server will lag. Just to prevent this just in case Edited March 5, 2013 by Capuche Quote
Question
kangfredy
guys can i request this is npc can check IP address if same IP in login database..player cannot take this item.
newbiereward.txt
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.