summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-10-30 21:53:34 +0000
committerbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-10-30 21:53:34 +0000
commit637c78d55ec7d635c7150c308ac823290984cc15 (patch)
treee2d0f27871147446db18653805394cb489256f45 /doc
parentc0d443540c3b85a9062fbbaa619dd14c6611ee80 (diff)
downloadhercules-637c78d55ec7d635c7150c308ac823290984cc15.tar.gz
hercules-637c78d55ec7d635c7150c308ac823290984cc15.tar.bz2
hercules-637c78d55ec7d635c7150c308ac823290984cc15.tar.xz
hercules-637c78d55ec7d635c7150c308ac823290984cc15.zip
- Updated 'checkweight' example. Apple is item_id 512, not 502!
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16845 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'doc')
-rw-r--r--doc/script_commands.txt32
1 files changed, 15 insertions, 17 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 448f59b92..8a7767cf0 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -3359,32 +3359,30 @@ 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.
-This function, in addition to checking to see if the player is capable of
-holding a set amount of items, also ensures the player has room in their
+This function, in addition to checking to see if the player is capable of
+holding a set amount of items, also ensures the player has room in their
inventory for the item(s) they will be receiving.
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 amount of apples";
- close;
+ if (checkweight(512,10)) {
+ getitem 512,10;
+ } else {
+ mes "Sorry you cannot hold this amount of apples";
+ }
+ close;
Or to put this another way:
- if (checkweight("APPLE",10)) goto L_Getapples;
- mes "Sorry you cannot hold this amount of apples";
- close;
- L_Getapples:
- getitem 502,10;
- close;
+ if (checkweight("Apple",10) == 0) {
+ mes "Sorry you cannot hold this amount of apples";
+ } else {
+ getitem 512,10;
+ }
+ close;
-Both these examples have the same effect.
+Both examples have the same effect.
---------------------------------------