Jump to content
  • 0

Item Kicker Script


Yonko

Question


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

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!

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  50
  • Reputation:   4
  • Joined:  06/23/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

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!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

how to add more than one item?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

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

For example:
	setarray .item_id[0], 2199, 1599;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

thanks Brian

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