Jump to content
  • 0

Item Kicker Script


Question

Posted

hi there rathenians can i request a item kicker script

Here's the mechanics

Example : Apple

when player stored in inventory even in storage automatically kick out the server (@kick + strcharinfo) thanks!

6 answers to this question

Recommended Posts

Posted

Set the item_id(s) in the array on line 3.

http://rathena.kpaste.net/eb47?raw

-	script	kick_if_have_item	-1,{
OnInit:
	setarray .item_id[0], 55555;
	// check non-character places
	for (set .@i,0; .@i<getarraysize(.item_id); set .@i,.@i+1) {
		set .@count, query_sql("SELECT nameid FROM `auction` WHERE nameid="+.item_id[.@i], .@nameid);
		if (.@count > 0) debugmes "item_id "+.item_id[.@i]+" found in `auction` table. Count: " + .@count;
		set .@count, query_sql("SELECT nameid FROM `guild_storage` WHERE nameid="+.item_id[.@i], .@nameid);
		if (.@count > 0) debugmes "item_id "+.item_id[.@i]+" found in `guild_storage` table. Count: " + .@count;
		set .@count, query_sql("SELECT nameid FROM `mail` WHERE nameid="+.item_id[.@i], .@nameid);
		if (.@count > 0) debugmes "item_id "+.item_id[.@i]+" found in `mail` table. Count: " + .@count;
	}
	end;
	
OnPCLoginEvent:
	for (set .@i,0; .@i<getarraysize(.item_id); set .@i,.@i+1) {
		if (countitem(.item_id[.@i]) > 0) {
			set .@where$, "inventory";      goto S_KickChar;
		} else if (query_sql("SELECT nameid FROM `cart_inventory` WHERE nameid="+.item_id[.@i], .@nameid) > 0) {
			set .@where$, "cart_inventory"; goto S_KickChar;
		} else if (query_sql("SELECT nameid FROM `storage` WHERE nameid="+.item_id[.@i], .@nameid) > 0) {
			set .@where$, "storage";        goto S_KickChar;
		}
	}
	end;
S_KickChar:
	debugmes "item_id "+.item_id[.@i]+" found in "+strcharinfo(0)+"'s "+.@where$+". Kicking...";
	sleep2 100;
	atcommand "@kick "+strcharinfo(0);
	end;
}
  • Upvote 1
Posted

Hi  wiideliva,

 

Do you mind if i ask for what purpose are you going to do with the script? and may i know what specific item do you want to have that @kick or something like restriction. I might be able to help you with that  /ok

Posted

Set the item_id(s) in the array on line 3.

http://rathena.kpaste.net/eb47?raw

-	script	kick_if_have_item	-1,{
OnInit:
	setarray .item_id[0], 55555;
	// check non-character places
	for (set .@i,0; .@i<getarraysize(.item_id); set .@i,.@i+1) {
		set .@count, query_sql("SELECT nameid FROM `auction` WHERE nameid="+.item_id[.@i], .@nameid);
		if (.@count > 0) debugmes "item_id "+.item_id[.@i]+" found in `auction` table. Count: " + .@count;
		set .@count, query_sql("SELECT nameid FROM `guild_storage` WHERE nameid="+.item_id[.@i], .@nameid);
		if (.@count > 0) debugmes "item_id "+.item_id[.@i]+" found in `guild_storage` table. Count: " + .@count;
		set .@count, query_sql("SELECT nameid FROM `mail` WHERE nameid="+.item_id[.@i], .@nameid);
		if (.@count > 0) debugmes "item_id "+.item_id[.@i]+" found in `mail` table. Count: " + .@count;
	}
	end;
	
OnPCLoginEvent:
	for (set .@i,0; .@i<getarraysize(.item_id); set .@i,.@i+1) {
		if (countitem(.item_id[.@i]) > 0) {
			set .@where$, "inventory";      goto S_KickChar;
		} else if (query_sql("SELECT nameid FROM `cart_inventory` WHERE nameid="+.item_id[.@i], .@nameid) > 0) {
			set .@where$, "cart_inventory"; goto S_KickChar;
		} else if (query_sql("SELECT nameid FROM `storage` WHERE nameid="+.item_id[.@i], .@nameid) > 0) {
			set .@where$, "storage";        goto S_KickChar;
		}
	}
	end;
S_KickChar:
	debugmes "item_id "+.item_id[.@i]+" found in "+strcharinfo(0)+"'s "+.@where". Kicking...";
	sleep2 100;
	atcommand "@kick "+strcharinfo(0);
	end;
}

Thank you sir Brian!

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