I can't see why this code wont work.

Grab your favourite IDE and tinker with the innards of game engines

I can't see why this code wont work.

Postby fishshapedfish on Sat Feb 18, 2012 1:51 pm

In my mod i made a weapon called the pulser which is basically an ar2 clone with the secondary toggling the flashlight. Then i added this code to make the flashlight turn off when you change weapon:
bool CWeaponPulser::Holster( CBaseCombatWeapon *pSwitchingTo )
{
if ( BaseClass::Holster( pSwitchingTo ) == false )
return false;
CBasePlayer *pPlayer = ToBasePlayer ( GetOwner() );
if ( pPlayer == NULL )
return false;
pPlayer->RemoveEffects( EF_DIMLIGHT );
return true;
}
For some reason it doesn't work. Any Idea why :?:
Check Out the Team's Latest Mod!
WIP Screenshots
Recruiting/Our Goals
User avatar
fishshapedfish
Regular
Regular
 
Joined: Fri Aug 05, 2011 5:44 pm

Re: I can't see why this code wont work.

Postby hitmen047 on Sat Feb 18, 2012 3:20 pm

You can find solutionhere

Yes, it's russian website, but this tutorial is very simple.
hitmen047
Just Joined
Just Joined
 
Joined: Sat Mar 06, 2010 1:36 pm

Re: I can't see why this code wont work.

Postby fishshapedfish on Sat Feb 18, 2012 3:33 pm

Thank you! Good website too.
Check Out the Team's Latest Mod!
WIP Screenshots
Recruiting/Our Goals
User avatar
fishshapedfish
Regular
Regular
 
Joined: Fri Aug 05, 2011 5:44 pm

Return to Programming

Who is online

Users browsing this forum: No registered users