Search the Commands

Home  All  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x  y  z 

Details for command checkweight:
 
* checkweight "Item name",<amount>;
 
This function will compute and return 1 if the total weight of a specified
number of specific items does not exceed the invoking character's carrying
capacity, and 0 otherwise. It is important to see if a player can carry the
items you expect to give them, failing to do that may open your script up to
abuse or create some very unfair errors.

Like 'getitem', this function will also accept an 'english name' from the
database as an argument.

checkweight(502,10) // 10 apples

if (checkweight(502,10) == 0 ) goto L_OverWeight;
getitem 502,10;
close;
L_OverWeight:
mes "Sorry you cannot hold this ammount of apples";
close;

Or to put this another way:

if (checkweight("APPLE",10)) goto L_Getapples;
mes "Sorry you cannot hold this ammount of apples";
close;
L_Getapples:
getitem 502,10;
close;

Both these examples have the same effect.

Valid XHTML 1.0 Strict Valid CSS!