Jump to content
  • 0

Help on script: Kicking a player with a certain item in his inventory


alkhaleej

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   5
  • Joined:  09/21/12
  • Last Seen:  

Can anyone please help me on this script:

 

I want to kick a certain player that is online if he has a certain item in his inventory and will delete that entry from `inventory` table afterwards. I have a script below but it is not doing anything except for the delete part.

 

 

query_sql "SELECT `char_id` FROM `inventory` WHERE `nameid` = '1599'",.@IHLD;
query_sql "SELECT `name` FROM `char` WHERE `char_id` = '.@IHLD'",.@IHLDNAME$;
atcommand "@kick "+.@IHLDNAME$;
query_sql "DELETE FROM `inventory` WHERE `nameid` = '1599'";
Edited by alkhaleej
Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

This?

-    script    Sample    -1,{
    OnPCLoginEvent:
        if ( countitem(1599) ) {
            delitem 1599, countitem(1599);
            atcommand "@kick " +strcharinfo(0);
        }
        end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   5
  • Joined:  09/21/12
  • Last Seen:  

Thanks sir but can I use it without the ONPCLoginEvent? I will use this under a case switch?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Depends upon your idea on how to deal with it

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   5
  • Joined:  09/21/12
  • Last Seen:  

Thanks sir but can I use it without the ONPCLoginEvent? I will use this under a case switch?

 

Double post. I'll try it sir.

Edited by alkhaleej
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

You want an npc ig ?

prontera,150,150,5	script	boum	456,{
	if ( getgmlevel() < 60 ) end;
	input .item_id;
	if ( getiteminfo( .item_id,1 ) == -1 ) {
		message "wrong item id";
		end;
	}
	addrid 0;
	if ( getgmlevel() >= 60 ) end;
	.@amount = countitem( .item_id );
	if ( .@amount ) {
		delitem .item_id, .@amount;
		atcommand "@kick "+ strcharinfo(0);
	}
	end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   5
  • Joined:  09/21/12
  • Last Seen:  

thank u very much for your replies. what I actually want is for this to be a part of another function that has a case

 

function a

switch

case

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

It's too vague for me... I don't get what you want sorry.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Yeah maybe you can elaborate more on what the function do.

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