AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Damage Type (https://forums.alliedmods.net/showthread.php?t=184107)

Menethil 05-01-2012 03:25

Damage Type
 
What is the difference between

DAMAGE_AIM and DAMAGE_YES ,
the 3'rd paramter from set_pev(index,pev_takedamage, DAMAGE_)

I've searched in all constants , all inc's, wiki, nothing found.

fysiks 05-01-2012 04:03

Re: Damage Type
 
Google found this for Quake. Many things from quake carried over but I don't know for sure on this one.

http://www.inside3d.com/showtutorial.php?id=192
Quote:

The difference between DAMAGE_YES and DAMAGE_AIM is, if an entity takedamage is DAMAGE_AIM, a grenade will explode when touching it, if the entity takedamage is DAMAGE_YES, a grenade won't explode when touching it, it just bounces off.
I also found them in HLSDK but I was unable to interpret what they actually do in there. I also see it used a lot for God Mode (if you search the forums . . .).

Menethil 05-01-2012 04:58

Re: Damage Type
 
I saw the use of these, but i was unable too to understund what is the difference between them

so if you set DAMAGE_NO, the reverse , and normal would be DAMAGE_YES , right?

Exolent[jNr] 05-01-2012 09:25

Re: Damage Type
 
Make a test plugin that outputs your current damage type, and go test to see what your damage type is.
Then you will know what is default for players, and probably the rest of the entities that take damage.

claudiuhks 05-01-2012 09:27

Re: Damage Type
 
Set 2.0 value for default.
Set 0.0 value for disable damage from being taken.

Is DAMAGE_AIM defined as 2.0? I think so.

Here's fun.cpp

PHP Code:

 static cell AMX_NATIVE_CALL set_user_godmode(AMX *amxcell *params// set_user_godmode(index, godmode = 0); = 2 params
{
    
/* Sets player godmode. If you want to disable godmode set only first parameter. */
     // params[1] = index
      // params[2] = godmode = 0
   
       // Check index.
       
CHECK_PLAYER(params[1]);
   
       
// Get player pointer.
       
edict_t *pPlayer MF_GetPlayerEdict(params[1]);
    
       if (
params[2] == 1) {
           
// Enable godmode
           
pPlayer->v.takedamage 0.0;    // 0.0, the player doesn't seem to be able to get hurt.
       
}
        else {
           
// Disable godmode
            
pPlayer->v.takedamage 2.0;    // 2.0 seems to be standard value?
        
}
    
       return 
1;
    } 



All times are GMT -4. The time now is 07:53.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.