AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_godmode or block fall dmg? (https://forums.alliedmods.net/showthread.php?t=120312)

One 03-03-2010 07:32

set_godmode or block fall dmg?
 
hi :D

http://forums.alliedmods.net/showthread.php?t=120286

definded 2 teams ( catchers & fleers )
the fleers have only 30 sec. to hide. after 30 sec. i changed the maxspeed = 0.1 & user gravity on *10.0

problem : when a user is @ jumping and the countdown is over, he get *10.0 of standard gravity and he falls down and he is dead.
when i set godmode on user for example for 1 sec., player can jump out of map & try to hide under map.
when i block fall dmg it's the same.

do you have any ideas what i can do to block it? :(

Dr.G 03-03-2010 07:52

Re: set_godmode or block fall dmg?
 
Ham_TakeDamage... If(dmgBits & DMG_FALL) return HAM_SUPERCEDE

One 03-03-2010 08:10

Re: set_godmode or block fall dmg?
 
but imaging you fall out of the map.
you know for sure as_oilrig. whats when you fall out of the map? the damage which you get from falling, will be ignored :(

Dr.G 03-03-2010 08:29

Re: set_godmode or block fall dmg?
 
then you gotta findout how far he is above ground and if greater then X dont block fall damage maybe...

One 03-03-2010 08:34

Re: set_godmode or block fall dmg?
 
oh goo0o0o0o0o0o0o0ood idea :P

i'll try it :P

xPaw 03-03-2010 08:38

Re: set_godmode or block fall dmg?
 
Maybe kill-zones in out of map zones?

fezh 03-03-2010 08:39

Re: set_godmode or block fall dmg?
 
What about DMG_GENERIC ?

Dr.G 03-03-2010 08:51

Re: set_godmode or block fall dmg?
 
Or check if he is crushed maybe ( DMG_CRUSH ) ...

If((dmgBits & DMG_FALL) && !(dmgBits & DMG_CRUSH)) return HAM_SUPERCEDE

Should be fast to test...

gladius 03-03-2010 12:21

Re: set_godmode or block fall dmg?
 
you can use FL_FROZEN

try this ( This code I think it has everything you need :) )

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new MaxplayersScreenfade
new bool:FreezePlayer
new Counter

public plugin_init() {
    
register_plugin("A""B""C")
    
    
register_event"HLTV""NewRound""a""1=0""2=0" );
    
    
//by Connor
    
const Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame
    RegisterHam
(Ham_Player_ResetMaxSpeed"player""FwResetMaxSpeed"1)
    
    
Maxplayers get_maxplayers()
    
Screenfade get_user_msgid("ScreenFade")
    
    
Counter 30
}

public 
NewRound() {
    
FreezePlayer true
    
for(new i<= Maxplayersi++) {
        switch(
get_user_team(i)) {
            case 
1// Fleers TT
                
client_print(iprint_chat"Run!... you have 30 seconds to hide")
            case 
2: {
                
client_print(iprint_chat"You must wait 30 seconds")
                
Freeze(i)
                
CatchersFade(i)
                
set_task(1.0"CatcherCounter"i)
            }    
        }        
    }
    
set_task(30.0"FunctionHide")
}

public 
CatcherCounter(index) {
    --
Counter
    
    
if(is_user_alive(index))
    {
        if(
Counter >= 1) {
            
client_print(indexprint_center"%d Seconds Remaining"Counter)
            
set_task(1.0"CatcherCounter"index)
        }
        else
            
client_print(indexprint_center"Go Go Go")
    }
}

public 
FunctionHide() {
    for(new 
i<= Maxplayersi++) {
        switch(
get_user_team(i)) {
            case 
1: {
                
client_print(iprint_chat"I hope you are hiding, because you dont move more")
                
Freeze(i)
            }
            case 
2: {
                
client_print(iprint_chat"Now you have to find to the Fleers... Go Go!")
                
Unfreeze(i)
            }    
        }
    }
    
FreezePlayer false
}

public 
Player_ResetMaxSpeed_Post(index) {
    if( 
is_user_alive(index)) {
        new 
Float:flMaxSpeed
        pev
(indexpev_maxspeedflMaxSpeed)
        if( 
flMaxSpeed == 1.0 ) {
            
// Freezetime
        
}
        
        else {
            if(
FreezePlayer && get_user_team(index) == && is_user_alive(index))
                
Freeze(index)
            
            else if(!
FreezePlayer && get_user_team(index) == && is_user_alive(index)) {
                
Unfreeze(index)
                
set_pev(indexpev_maxspeed400.0)
            }
        }
    }
    else 
// user is dead/spectator
        
return HAM_HANDLED
    
    
return HAM_HANDLED
}

Freeze(index) {
    
set_pev(indexpev_velocity0.0)        
    
set_pev(indexpev_flagspev(indexpev_flags) | FL_FROZEN);
}

Unfreeze(index) {
    
set_pev(indexpev_flagspev(indexpev_flags) & ~FL_FROZEN);
}

CatchersFade(i) {
    static 
RedGreenBlue
    Red 
0
    Green 
50
    Blue 
255
    
    message_begin
(MSG_ONEScreenfade_i);
    
write_short(~0); // duration
    
write_short(~0); // hold time
    
write_short(0x0004); // flags: FFADE_STAYOUT
    
write_byte(Red);        // r
    
write_byte(Green);        // g
    
write_byte(Blue);
    
write_byte(200); // alpha
    
message_end();



Doc-Holiday 03-03-2010 14:42

Re: set_godmode or block fall dmg?
 
Quote:

Originally Posted by gladius (Post 1106476)
you can use FL_FROZEN

try this ( This code I think it has everything you need :) )


Da fuck?

Hes talking about fall damage not freezing unfreezing.


All times are GMT -4. The time now is 08:41.

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