Jump to content
  • 0

give item/cash in offline characters


Question

2 answers to this question

Recommended Posts

Posted
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

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