R> Delete MvP Card When Login

Takumirai

New member
Messages
60
Points
0
- i want to request if a player is login inventory will be check/cart/storage for MvP list item and  automatically delete the mvp cards if a player have 1 of those mvp card. also when player put it in a sloted equips the item will be deleted or if possible only card will be deleted. thanks in advance.

 
Last edited by a moderator:
if you want to delete something, just run those queries in your phpmyadmin:

DELETE FROM `auction`,`cart_inventory`,`guild_storage`,`inventory`,`mail`,`storage` WHERE nameid = 4430;DELETE FROM `inventory` WHERE nameid = 4430; UPDATE `inventory` SET card0=0 WHERE card0 = 4430;UPDATE `inventory` SET card1=0 WHERE card1 = 4430;UPDATE `inventory` SET card2=0 WHERE card2 = 4430;UPDATE `inventory` SET card3=0 WHERE card3 = 4430; 

just change 4430 to the desired id

PS: do it with the server offline.
 
Last edited by a moderator:
Load this in once to delete cards from the .@card_id array from the server. Note that all players to be affected should be offline. Add card constants or IDs to the .@card_id array as needed. Be sure to unload this script once the task is completed.

Code:
-	script	del_cards	-1,{		OnInit:		setarray .@table_name$[0],			"inventory",			"cart_inventory",			"storage",			"guild_storage",			"mail",			"auction";					// Card constants or IDs to delete		setarray .@card_id[0],			Golden_Bug_Card,			Ifrit_Card,			Ghostring_Card,			Drake_Card;					// Loop through all tables to clear		for (.@i = 0; .@i < getarraysize(.@table_name$); .@i++) {				// Loop through all cards to delete			for (.@j = 0; .@j < getarraysize(.@card_id); .@j++) {				// Delete card from table				query_sql "DELETE FROM `"+ .@table_name$[.@i] +"` WHERE `nameid` = '"+ .@card_id[.@j] +"'";								// Remove compounded cards				query_sql "UPDATE `"+ .@table_name$[.@i] +"` SET `card0` = '0' WHERE `card0` = '"+ .@card_id[.@j] +"'";				query_sql "UPDATE `"+ .@table_name$[.@i] +"` SET `card1` = '0' WHERE `card1` = '"+ .@card_id[.@j] +"'";				query_sql "UPDATE `"+ .@table_name$[.@i] +"` SET `card2` = '0' WHERE `card2` = '"+ .@card_id[.@j] +"'";				query_sql "UPDATE `"+ .@table_name$[.@i] +"` SET `card3` = '0' WHERE `card3` = '"+ .@card_id[.@j] +"'";			}		}				// Confirm completion		announce "Restricted cards have been removed from the server.", bc_all;		end;}
 
Last edited by a moderator:
FIXED. sorry I just forgot to put ; in the array
 
Last edited by a moderator:
Back
Top