Jump to content
  • 0

Who can


Help-Help

Question


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   2
  • Joined:  03/16/13
  • Last Seen:  

NPc only for admin that can delete item for all account

Example I want to delete gold coins if my players have that just type in NPc the Id of item enter and the item will disappear

Link to comment
Share on other sites

18 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:  

Try : 

 

prontera,150,150,0    script    Delete    100,{
        set .@GMLevel,99;
        set .@npc$,strnpcinfo(1);
        if (getgmlevel() < .@GMLevel) close;
        mes .@npc$;
        mes "Input the item id";
        next;
        input .@id;
        next;
        if (getitemname(.@id) == "") {
            mes .@npc$;
            mes "Invalid id number";
            close;
        }
        mes .@npc$;
        mes "So,  you want to delete " +getitemname(.@id)+ "?";
        next;
        if (select("- Yes:- No") - 1) close;
        mes .@npc$;
        mes "Processssinnggg...";
        next;
        query_sql("DELETE FROM `auction` WHERE `nameid` = '" +.@id+ "'");
        query_sql("DELETE FROM `cart_inventory` WHERE `nameid` = '" +.@id+ "'");
        query_sql("DELETE FROM `guild_storage` WHERE `nameid` = '" +.@id+ "'");
        query_sql("DELETE FROM `inventory` WHERE `nameid` = '" +.@id+ "'");
        query_sql("DELETE FROM `mail` WHERE `nameid` = '" +.@id+ "'");
        query_sql("DELETE FROM `storage` WHERE `nameid` = '" +.@id+ "'");
        mes .@npc$;
        mes "Done!";
        close;
}
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   2
  • Joined:  03/16/13
  • Last Seen:  

Error can click NPc idk why

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:  

Error can click NPc idk why

Show your error

 

Edited the previous post.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   2
  • Joined:  03/16/13
  • Last Seen:  

You try this at your server and working?

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:  

You try this at your server and working?

Yeap tried and working.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   2
  • Joined:  03/16/13
  • Last Seen:  

Ty Ty done done my problem is I didn't reloadscript hehehe

Question if my players have 102 Yggdrasil will be deleted all?

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:  

Ty Ty done done my problem is I didn't reloadscript hehehe

Question if my players have 102 Yggdrasil will be deleted all?

Yes

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   2
  • Joined:  03/16/13
  • Last Seen:  

ty ty



look



not working

post-15842-0-13889600-1367162778_thumb.jpg

post-15842-0-82832200-1367162779_thumb.jpg

post-15842-0-46451400-1367162781_thumb.jpg

post-15842-0-05620600-1367162783_thumb.jpg

post-15842-0-69436200-1367162784_thumb.jpg

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:  

ty ty

look

not working

Check if there's an error. eAthena? Any error?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   2
  • Joined:  03/16/13
  • Last Seen:  

rathena

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 can't delete an item in the inventory of player online by sql

prontera,150,145,0	script	Delete	100,{
	set .@GMLevel,99;
	set .@npc$,strnpcinfo(1);
	if (getgmlevel() < .@GMLevel) close;
	mes .@npc$;
	mes "Input the item id";
	next;
	input .@id;
	next;
	if (getitemname(.@id) == "") {
		mes .@npc$;
		mes "Invalid id number";
		close;
	}
	mes .@npc$;
	mes "So,  you want to delete " +getitemname(.@id)+ "?";
	next;
	if (select("- Yes:- No") - 1) close;
	mes .@npc$;
	mes "Processssinnggg...";
	next;
	.@self = getcharid(3);
	query_sql("DELETE FROM `auction` WHERE `nameid` = '" +.@id+ "'");
	query_sql("DELETE FROM `cart_inventory` WHERE `nameid` = '" +.@id+ "'");
	query_sql("DELETE FROM `guild_storage` WHERE `nameid` = '" +.@id+ "'");
	query_sql("DELETE i FROM `inventory` i left join `char` c on c.`char_id` = i.`char_id` WHERE i.`nameid` = '501' and c.`online` = '0'");
	query_sql("DELETE FROM `mail` WHERE `nameid` = '" +.@id+ "'");
	query_sql("DELETE FROM `storage` WHERE `nameid` = '" +.@id+ "'");
	do {
		.@size = query_sql( "select `account_id` from `char` where `online` = '1' order by `account_id` desc limit "+ .@loop +", 128", .@account_id );
		.@loop += 128;
		for ( .@i = 0; .@i < .@size; .@i += 1 ) {
			attachrid .@account_id[.@i];
			delitem .@id, countitem( .@id );
		}
	}
	while( .@size > 0 );
	attachrid .@self;
	mes .@npc$;
	mes "Done!";
	close;
}

Storage etc.. will be update after the player log out log in

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:  

Ya forgot to say you need to log out before this it took effect :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

how about kick everyone from the server who has the items you are deleting first before proceeding to deletion process

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:  

how about kick everyone from the server who has the items you are deleting first before proceeding to deletion process

Off topic.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

how about kick everyone from the server who has the items you are deleting first before proceeding to deletion process

Off topic.

lol how did that became off topic?

 

what i mean is = check first the players and kick them before you go the deleting process of item in the script posted by capuche which is 14px-U%2B2193.svg.png

since as capuche said: You can't delete an item in the inventory of player online by sql

You can't delete an item in the inventory of player online by sql

prontera,150,145,0	script	Delete	100,{
	set .@GMLevel,99;
	set .@npc$,strnpcinfo(1);
	if (getgmlevel() < .@GMLevel) close;
	mes .@npc$;
	mes "Input the item id";
	next;
	input .@id;
	next;
	if (getitemname(.@id) == "") {
		mes .@npc$;
		mes "Invalid id number";
		close;
	}
	mes .@npc$;
	mes "So,  you want to delete " +getitemname(.@id)+ "?";
	next;
	if (select("- Yes:- No") - 1) close;
	mes .@npc$;
	mes "Processssinnggg...";
	next;
	.@self = getcharid(3);
	query_sql("DELETE FROM `auction` WHERE `nameid` = '" +.@id+ "'");
	query_sql("DELETE FROM `cart_inventory` WHERE `nameid` = '" +.@id+ "'");
	query_sql("DELETE FROM `guild_storage` WHERE `nameid` = '" +.@id+ "'");
	query_sql("DELETE i FROM `inventory` i left join `char` c on c.`char_id` = i.`char_id` WHERE i.`nameid` = '501' and c.`online` = '0'");
	query_sql("DELETE FROM `mail` WHERE `nameid` = '" +.@id+ "'");
	query_sql("DELETE FROM `storage` WHERE `nameid` = '" +.@id+ "'");
	do {
		.@size = query_sql( "select `account_id` from `char` where `online` = '1' order by `account_id` desc limit "+ .@loop +", 128", .@account_id );
		.@loop += 128;
		for ( .@i = 0; .@i < .@size; .@i += 1 ) {
			attachrid .@account_id[.@i];
			delitem .@id, countitem( .@id );
		}
	}
	while( .@size > 0 );
	attachrid .@self;
	mes .@npc$;
	mes "Done!";
	close;
}

Storage etc.. will be update after the player log out log in

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   2
  • Joined:  03/16/13
  • Last Seen:  

So no effect NPc hahahaha ha I want no need log out etc

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:  

I already made the change to delete items in the inventory of online players in the previous post (forgot to tell this)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   2
  • Joined:  03/16/13
  • Last Seen:  

can you make this eathena version too?

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