-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
* Added returned values for buying store. * Made returned values as bitmask. &1 - Vending, &2 - Autotrading, &4 - Buyingstore Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3567,24 +3567,35 @@ warg and 0 if they don't. | |
--------------------------------------- | ||
|
||
*checkvending({"<Player Name>"}) | ||
*checkchatting({"<Player Name>"}) | ||
|
||
Checks if the player is vending or in a chatroom. | ||
Checks if the player is vending or has buyingstore. | ||
This comment has been minimized.
Sorry, something went wrong. |
||
Name is optional, and defaults to the attached player if omitted. | ||
|
||
Return values for 'checkvending' are | ||
0 = not vending | ||
The returned values are bitmask of. | ||
This comment has been minimized.
Sorry, something went wrong. |
||
0 = not vending, doesn't have buyingstore, & not autotrading | ||
This comment has been minimized.
Sorry, something went wrong.
Lemongrass3110
Member
|
||
1 = normal vending | ||
2 = vending using @autotrade | ||
|
||
'checkchatting' returns 1 if they are in a chat room, 0 if they are not. | ||
2 = using @autotrade | ||
4 = has buyingstore | ||
|
||
Examples: | ||
//This will check if Aaron is vending, and if so, put a message in front | ||
//of the attached player saying Aaron is vending. | ||
if (checkvending("Aaron")) | ||
//This will check if Aaron's state | ||
This comment has been minimized.
Sorry, something went wrong. |
||
.@state = checkvending("Aaron"); | ||
if (.@state&1) | ||
mes "Aaron is currently vending!"; | ||
if (.@state&2) | ||
mes "Aaron is autotrading!"; | ||
if (.@state&4) | ||
mes "Aaron has buying store!"; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
--------------------------------------- | ||
|
||
*checkchatting({"<Player Name>"}) | ||
|
||
Checks if the player is in a chatroom. | ||
Name is optional, and defaults to the attached player if omitted. | ||
Returns 1 if they are in a chat room, 0 if they are not. | ||
|
||
Examples: | ||
//This will check if the attached player in a chat room or not. | ||
if (checkchatting()) | ||
mes "You are currently in a chat room!"; | ||
|
2 comments
on commit bbe733e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you summoned me here:
Please create some entries in const.txt for the bitmask values. I think an enum is no really needed but it would also increase readability.
Also it might be a good idea to switch 2<>4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has a buyingstore. Additionally it gives you the information whether the player uses autotrade or not.