help in script

kerbiii

New member
Messages
342
Points
0
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)+"")+ "'";

 
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.

 
Last edited by a moderator:
Code:
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;		}	}}
 
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.

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

 
Last edited by a moderator:
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:

Code:
<header>,{    atcommand "@clearcart";    atcommand "@itemreset";    end;}
 
Last edited by a moderator:
@quesoph : that's a good point furthermore i just corrected the query_sql command issued by the topic starter.

 
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:

 
Last edited by a moderator:
Code:
if ( BaseClass == Job_Merchant && checkcart() ) {	// talk}
 
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

 
Last edited by a moderator:
You need to log out your character before you see the changes. I suggest you use @quesoph's proposal to use @clearcart command

Code:
prontera,150,150,0	script	Sample	100,{	atcommand "@clearcart";	end;}
 
Back
Top