Jump to content
  • 0

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


Question

Posted (edited)

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

8 answers to this question

Recommended Posts

Posted

This?

-    script    Sample    -1,{
    OnPCLoginEvent:
        if ( countitem(1599) ) {
            delitem 1599, countitem(1599);
            atcommand "@kick " +strcharinfo(0);
        }
        end;
}
Posted

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;
}

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