Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ Mprog ifcheck, check act flags
Mprog ifcheck, check act flags
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Tue 29 Mar 2005 12:44 AM (UTC) |
Message
| Is there a way for a prog ifcheck to check if a act flag is set on a player? Like I'd like it to be done like this:
if is_set($n) == boughtpet
This would save me a lot of time adding an ifcheck for each different flag. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Greven
Canada (835 posts) Bio
|
Date
| Reply #1 on Tue 29 Mar 2005 05:19 AM (UTC) |
Message
| There's not one that I know of, but its a fairly straight forward process to make it, loop through the names, str_cmp, stop at the right one, check that number against set flags. |
Nobody ever expects the spanish inquisition!
darkwarriors.net:4848
http://darkwarriors.net | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #2 on Tue 29 Mar 2005 03:28 PM (UTC) |
Message
| Well I have the basic concept down, but what do you mean loop through the names? Act flags are EXT_BV, so you can't strcmp a BV. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Nick Cash
USA (626 posts) Bio
|
Date
| Reply #3 on Tue 29 Mar 2005 07:14 PM (UTC) |
Message
| I think he meant the name of the flag, which is then used to look up the BV. Anyways, I have one (an is_set mprog function) and it wasn't hard to make. |
~Nick Cash
http://www.nick-cash.com | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #4 on Mon 20 Jun 2005 09:41 PM (UTC) Amended on Mon 20 Jun 2005 10:06 PM (UTC) by Zeno
|
Message
| Finally got to doing it.
if ( !str_cmp(chck, "issetact") )
{
int value = IS_NPC( chkchar ) ? get_actflag( rval ) : get_plrflag( rval );
if ( value < 0 || value > MAX_BITS )
{
progbug("Unknown act flag being checked", mob);
return BERR;
}
return xIS_SET(chkchar->act, value) ? TRUE : FALSE;
}
Feel free to use it or let me know if anything should be changed. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
13,096 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top