superblackcat Posted June 22, 2012 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 1 Reputation: 0 Joined: 06/22/12 Last Seen: June 22, 2012 Share Posted June 22, 2012 hello guy..can someone help make the script npc that give point to player that invite other player the person that have been invite need to put the name of person that invite them..can someone help me please..thank you Quote Link to comment Share on other sites More sharing options...
0 Skorm Posted August 17, 2022 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: April 11 Share Posted August 17, 2022 @superblackcat So two ways I might do it... One where both players need to be online and the referrer needs to claim the referral. prontera,100,100,5 script refer a friend 100,{ switch(select("Add Referral:Claim Referral")) { case 1: if(referrer$ != "") { mes "You've already set a referrer."; close; } mes "Input the character name of the person who referred you. (This cannot be changed so make sure it's correct!)"; next; input .@player_name$; mes "Is this correct?"; mes .@player_name$; next; if(select("Yes:No") == 1) { referrer$ = .@player_name$; mes "Congratulations the referrer has been set!"; } break; case 2: mes "Enter the name of the person you referred."; next; input .@player_name$; .@cid = convertpcinfo(.@player_name$, CPC_CHAR); if(.@cid <= 0) { mes "Make sure you've entered that persons name correctly and that they are online."; close; } .@referrer$ = getvar(referrer$, .@cid); .@ref_claimed = getvar(ref_claimed$, .@cid); if(.@referrer$ == strcharinfo(0) && !.@ref_claimed) { getvar(ref_claimed$, .@cid) = True; getitem 501, 1; mes "That's great!"; } else { mes "Hmm... It doesn't seem like you referred that person."; } break; } close; } Another where only the referral needs to submit the referrer and the referrer gets a mailed reward. prontera,100,100,5 script refer a friend 100,{ if(referrer$ != "") { mes "You've already set a referrer."; close; } mes "Input the character name of the person who referred you. (This cannot be changed so make sure it's correct!)"; next; input .@player_name$; mes "Is this correct?"; mes .@player_name$; next; if(select("Yes:No") == 1) { .@len = query_sql("SELECT `char_id` FROM `char` WHERE `name` = '"+escape_sql(.@player_name$)+"';", .@cid); if(.@len > 0) { referrer$ = .@player_name$; .@charid = .@cid; .@sender$ = strcharinfo(0); .@title$ = "Referral Reward!"; .@body$ = "Thanks for being awesome!"; .@zeny = 10000; mail .@charid, .@sender$, .@title$, .@body$, .@zeny; mes "Congratulations the referrer has been set!"; } else { mes "They don't seem to exist."; } } close; } Quote Link to comment Share on other sites More sharing options...
Question
superblackcat
hello guy..can someone help make the script npc that give point to player that invite other player
the person that have been invite need to put the name of person that invite them..can someone help me please..thank you
Link to comment
Share on other sites
1 answer 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.