kerbiii 5 Posted November 4, 2013 script that will make your skillpoints and statpoints = 0 and how to apply this script query_sql "DELETE * FROM `cart_inventory` WHERE `char_id` = '" +getcharid(0,""+strcharinfo(0)+"")+ "'"; Quote Share this post Link to post Share on other sites
0 Nameless2you 97 Posted November 4, 2013 (edited) Read up on: http://herc.ws/wiki/Query_sql even if it's an alternative way of doing it. If I remember the script engine correctly this should work: query_sql "DELETE * FROM `cart_inventory` WHERE `char_id` = "+getcharid(0); But your question was how to apply it. You can easily do so by placing it into any normal NPC and then talk to it. Example: prontera,150,150,0<tab>script<tab>stupidname<tab>85,{query_sql "DELETE * FROM `cart_inventory` WHERE `char_id` = '"+getcharid(0);end;} However, be careful since it'll obviously delete all your inventory items. The strcharinfo part is quite redundant, only useful if you want to get a different characters id. Read up on: http://herc.ws/wiki/Getcharid for that part. Edited November 4, 2013 by Nameless2you According to what Patskie said Quote Share this post Link to post Share on other sites
0 kerbiii 5 Posted November 4, 2013 here's the sample script where to put it?map script sample 100,{ for ( .@i = 1; .@i < 15; .@i++ ) { if ( getequipid(.@i) == -1 ) { getinventorylist; for ( set .@a, 0; .@a < @inventorylist_count; .@a++ ) { delitem @inventorylist_id[.@a], @inventorylist_amount[.@a]; } clearitem; end; } }} Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted November 4, 2013 (edited) script that will make your skillpoints and statpoints = 0 StatusPoint = 0;SkillPoint = 0; @kerbiii : No need to use getinventorylist and a loop to delete all items as the clearitem command will do the job. *clearitem;This command will destroy all items the invoking character has in theirinventory (including equipped items). It will not affect anything else,like storage or cart. for ( .@i = 1; .@i < 15; .@i++ ) { if ( getequipid(.@i) == -1 ) { query_sql "DELETE FROM `cart_inventory` WHERE `char_id` = '" +getcharid(0)+ "'"; clearitem; end; }} @Nameless2you : Syntax error. Should be : query_sql "DELETE FROM `cart_inventory` WHERE `char_id` = '"+getcharid(0); And besides sprite 150 on your script will result to an error. List of npc sprites : Link : http://nn.nachtwolke.com/dev/npclist/?qq=1 Edited November 4, 2013 by Patskie Quote Share this post Link to post Share on other sites
0 quesoph 105 Posted November 4, 2013 (edited) query_sql "DELETE * FROM `cart_inventory` WHERE `char_id` = '" +getcharid(0,""+strcharinfo(0)+"")+ "'"; This is meant to delete items from a player's cart? why not use: <header>,{ atcommand "@clearcart"; atcommand "@itemreset"; end;} Edited November 4, 2013 by quesoph Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted November 4, 2013 @quesoph : that's a good point furthermore i just corrected the query_sql command issued by the topic starter. Quote Share this post Link to post Share on other sites
0 kerbiii 5 Posted November 4, 2013 (edited) query_sql "DELETE * FROM `cart_inventory` WHERE `char_id` = '" +getcharid(0,""+strcharinfo(0)+"")+ "'"; This is meant to delete items from a player's cart? why not use: <header>,{ atcommand "@clearcart"; atcommand "@itemreset"; end;} this can work, only if your cart is on, can you give make me a script something like this if ( BaseJob == Merchant ) No cart = ignore with cart = talk ah but i still need the sql cart deletion, to put it in OnPCLogoutEvent: Edited November 4, 2013 by kerbiii Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted November 4, 2013 if ( BaseClass == Job_Merchant && checkcart() ) { // talk} 1 kerbiii reacted to this Quote Share this post Link to post Share on other sites
0 kerbiii 5 Posted November 4, 2013 (edited) if ( BaseClass == Job_Merchant && checkcart() ) { // talk} thnx, one last thing the query sql cart deletion dont wipe the cart if the cart is turn off or removed, is there a way to delete even if the cart is Off or removed?? or maybe disable cart removal on specific map done i solved it thnx for the help guys Edited November 4, 2013 by kerbiii Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted November 4, 2013 You need to log out your character before you see the changes. I suggest you use @quesoph's proposal to use @clearcart command prontera,150,150,0 script Sample 100,{ atcommand "@clearcart"; end;} Quote Share this post Link to post Share on other sites
script that will make your skillpoints and statpoints = 0
and how to apply this script
query_sql "DELETE * FROM `cart_inventory` WHERE `char_id` = '" +getcharid(0,""+strcharinfo(0)+"")+ "'";
Share this post
Link to post
Share on other sites