Jump to content
  • 0

give item/cash in offline characters


LatSo

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  296
  • Reputation:   2
  • Joined:  04/11/13
  • Last Seen:  

Can I please request a script code that can give a character an item/cash points whether he/she is online or OFFLINE.

 

thanks!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

prontera,206,188,5	script	GiveItem	100,{
	if(getgmlevel()<10) end;
	mes .npc$;
	mes "Hi, I can give items out";
	mes "even if the person isn't online O_O"; next;
	mes .npc$;
	mes "Please input the persons name.";
	input(.@a$); next;
	if(query_sql("SELECT `char_id`,`account_id` FROM `char` WHERE `name` = '"+.@a$+"'",.@char_id,.@account_id)) {
		if(!isloggedin(.@account_id)) {
			mes .npc$;
			mes "I've found ("+.@a$+")!";
			mes "What would you like to give them?";
			mes "(Input an Itemid)"; next;
			while(getiteminfo(.@a,2)<0) {
				input(.@a); dispbottom "Please enter a valid ID!";
			}
			mes .npc$;
			mes "Now the amount you'd like to send.";
			input(.@; next;
			mes .npc$;
			query_sql("INSERT INTO `inventory` (`char_id`, `nameid`, `amount`, `equip`, `identify`) VALUES ("+.@char_id+", "+.@a+", "+.@b+", 0, 1)");
			mes "Item sent!";
		} else {
			mes .npc$;
			mes "This person seems to be";
			mes "online right now.";
			mes "Would you like me to";
			mes "Send the item anyways?"; next;
			if(select("Yes:No")&2) { mes .npc$; mes "Alright maybe next time"; close; }
			mes .npc$;
			mes "Ok input id of the desired item.";
			while(getiteminfo(.@a,2)<0) {
				input(.@a); dispbottom "Please enter a valid ID!";
			}
			mes "Now the amount you'd like to send.";
			input(.@; next;
			mes .npc$;
			getitem(.@a,.@b,.@account_id);
			mes "Item sent!";
		}
	} else {
		mes .npc$;
		mes "I can't seem to find that person check your spelling.";
	}
	close;
	
	OnInit:
		set .npc$, "[GiveItem]";
}

Primitive.... but it's what you want... You could also use @mail or something...

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  296
  • Reputation:   2
  • Joined:  04/11/13
  • Last Seen:  

will test it later! Thanks for the help sir! no.1!

Link to comment
Share on other sites

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.

×
×
  • Create New...