Forum

My Healpad isn´t working.

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

My Healpad isn´t working.

Postby Quake123 » Fri Aug 29, 2008 10:17 pm

Hi here is my code


Code: Select all
void() func_healpad_touch =
{


   if (other.classname != "player")
      return;
self.health =  100;



};


void() func_healpad =
{   
   self.movetype = MOVETYPE_PUSH;
   self.solid = SOLID_BSP;
   setsize (self, self.mins , self.maxs);
   setorigin (self, self.origin);
   setmodel (self, self.model);
   self.classname = "func_healpad";
      self.touch = func_healpad_touch;
};


I added the func_healpad on my map if i go on it, it doesn´t heal me
Quake123
 
Posts: 3
Joined: Fri Aug 29, 2008 10:13 pm

Postby Chris » Fri Aug 29, 2008 10:46 pm

why are you assigning the health to the healpad?

shouldn't it be other.health = 100; ?

You take the time to check if other isn't a player, you'd think you'd catch yourself on the only other piece of logic in that function :P
Chris
 
Posts: 79
Joined: Sat Aug 05, 2006 5:31 am

Postby Quake123 » Fri Aug 29, 2008 11:20 pm

Thanks it´s working!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Quake123
 
Posts: 3
Joined: Fri Aug 29, 2008 10:13 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest