View previous topic :: View next topic |
Author |
Message |
Stealth Kill
Joined: 29 Dec 2006 Posts: 83
|
Posted: Tue Aug 05, 2008 9:57 pm Post subject: Check ground?!?! |
|
|
I need heeeeelp
If the player is on the entity "func_bomb_target" you should be able to plant the bomb.
in W_Attack i changed W_FireBomb (); with CheckGround ();
and this is the checkground function.
Code: | void() CheckGround =
{
if (other.classname == "func_bomb_target")
{
W_FireC4 ();
}
else
{
centerprint (self, "You can not plant bomb here\n"); }
}; |
i i try to plant a a bomb it centerprints always You can not plant bomb here. If i´m on func_bomb_target too. |
|
Back to top |
|
 |
Entar

Joined: 05 Nov 2004 Posts: 422 Location: At my computer
|
Posted: Wed Aug 06, 2008 12:42 am Post subject: |
|
|
I'm not real good at QC, but my guess is that you need to put your check in the player's .touch function, and set a .variable for the player (or flag or something) in there if other.classname == "func_bomb_target" - then, when the player tries to use C4, check that variable. _________________ woh... feelin woozy... too much cider...
http://entar.quakedev.com
games fascination - My Game Development Blog/Journal
 |
|
Back to top |
|
 |
Electro
Joined: 29 Dec 2004 Posts: 241 Location: Brisbane, Australia
|
Posted: Wed Aug 06, 2008 5:33 am Post subject: |
|
|
It's because 'other' is 'world' every time when you're calling that code.
why not make a touch function for the func_bomb_target
then in that you can do stuff like
Code: |
void() Func_BombTarget_Touch =
{
local entity oself;
if (other.classname != "player")
return; // only allow players to register touchs
if (!other.hasbomb)
return; // make sure they have the bomb
if (!other.flags & FL_ONGROUND)
return; // don't plant bomb midair
other.hasbomb = FALSE; // take the bomb off them
// spawn the bomb in the world here etc...
oself = self;
self = other;
W_FireBomb ();
self = oself;
}; |
...well you get the idea.. or at least some ideas, hopefully.[/code] _________________ Unit reporting!
http://www.bendarling.net/ |
|
Back to top |
|
 |
Stealth Kill
Joined: 29 Dec 2006 Posts: 83
|
Posted: Wed Aug 06, 2008 9:32 am Post subject: |
|
|
Thanks i try that  |
|
Back to top |
|
 |
|