Author |
Message |
Hakaku Server Help Squatter
Joined: Apr 07 2006 Posts: 299 Location: Canada Offline
|
Posted: Sat Jul 25, 2009 4:00 pm Post subject: flag question |
|
|
|
|
1. Is it possible to force/give a player a flag? If so, how could this be done?
2. In turf style flagging, is there a setting that allows the flag to be neutralized when the arena is created? (whenever I use fg_turf, the previous state of the flags, even after the arena is destroyed, seems to be remembered) |
|
Back to top |
|
|
D1st0rt Miss Directed Wannabe
Age:36 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Sat Jul 25, 2009 4:39 pm Post subject: |
|
|
|
|
1. Use the FlagInfo struct with Iflagcore's SetFlags function. You'll want state = FI_CARRIED and carrier = that player.
2. You should be able to use SetFlags again but with carrier = NULL and freq = -1 _________________
|
|
Back to top |
|
|
Hakaku Server Help Squatter
Joined: Apr 07 2006 Posts: 299 Location: Canada Offline
|
Posted: Sat Jul 25, 2009 7:04 pm Post subject: |
|
|
|
|
Thanks D1st0rt. If I did the following, would it work? What exactly does int count do?
FlagInfo fi;
flagcore->GetFlags(p->arena, 0, &fi, 1);
if (fi.state != FI_CARRIED)
{
fi.state = FI_CARRIED;
fi.carrier = p;
fi.freq = p->p_freq;
flagcore->SetFlags(p->arena, 0, &fi, 1);
}
|
As for the second one, I was hoping for just a setting, but oh well. |
|
Back to top |
|
|
Hakaku Server Help Squatter
Joined: Apr 07 2006 Posts: 299 Location: Canada Offline
|
Posted: Mon Jul 27, 2009 9:15 pm Post subject: |
|
|
|
|
Ok, well I'll answer my own question, it worked. But why is it that everytime I try to specify a flag location (fi.x/fi.y), it doesn't? The flag just warps sporadically according to the flag radius...
Edit: nevermind, I just have to not specify the flag state whatsoever, but rather I need to use the flag frequency (-1) instead to make sure that the flag is still neutral. Seems odd to me to do it this way. |
|
Back to top |
|
|
|