Raised This Month: $51 Target: $400
 12% 

Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-08-2010 , 12:16   Help
Reply With Quote #1

Is it possible to "channel" damage so that you make a specific amount of damage during a specific time set by cvars? For keydown powers?
__________________
The Art of War is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-10-2010 , 02:00   Re: Help
Reply With Quote #2

Nvm about that, set_task...
But if i want a beam to damage and the sprite to be seen for 3 seconds, how do I fix it? cuz ive looked at daredevil and cylops, but no success: set_task(3.0 ,__blabla) ?
__________________
The Art of War is offline
kanatzu
Veteran Member
Join Date: Oct 2007
Location: Sweden
Old 03-10-2010 , 02:11   Re: Help
Reply With Quote #3

Quote:
Originally Posted by The Art of War View Post
the sprite to be seen for 3 seconds

It's all about the bytes
__________________




Quote:
Originally Posted by wrecked_ View Post
Stop saying words before I sodomize you with a cucumber.
kanatzu is offline
Send a message via MSN to kanatzu
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-10-2010 , 02:25   Re: Help
Reply With Quote #4

Yeah, but the most important is that the power will channel the damage over 3 seconds
__________________
The Art of War is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-15-2010 , 15:40   Re: Help
Reply With Quote #5

PHP Code:
public sh_hero_key(idheroIDkey)
{
    if ( 
gHeroID != heroID || sh_is_freezetime() ) return
    if ( !
is_user_alive(id) || !gHasAquaman[id] ) return

    if ( 
key == SH_KEYDOWN ) {
        if ( 
pev(idpev_waterlevel) != ) {
            
sh_chat_message(idgHeroID"You must be underwater to use the Bubble Attack")
            
sh_sound_deny(id)
            return
        }

        new 
armorCost get_pcvar_num(gPcvarArmorCost)

        
// Does it cost to use Bubble Attack?
        
if ( armorCost ) {
            new 
CsArmorType:armorType
            
new userArmor cs_get_user_armor(idarmorType)

            if ( 
userArmor armorCost ) {
                
sh_chat_message(idgHeroID"Bubble Attacks cost %d armor point%s each"armorCostarmorCost == "" "s")
                
sh_sound_deny(id)
                return
            }

            
cs_set_user_armor(id, (userArmor armorCost), armorType)
        } 
Taken from aquaman. Apparently I was wrong (WTF?!?!) regarding how to register if the key is up or down.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-15-2010 , 15:55   Re: Help
Reply With Quote #6

Aww, yeah you told me before that it was switch(key), but nvm, though I ripped it from cyclops..

Here it is:

PHP Code:
public sh_client_spawn(id)
{
 
remove_task(id)
 
gPlayerInCooldown[id] = false
}
//-------------------------------------------
public sh_hero_key(idheroIDkey)
{
 if ( 
gHeroID != heroID ) || sh_is_freezetime() || !is_user_alive(id) ) || key != SH_KEYDOWN || !gHasDracula[id] ) return
 
 {
  if ( 
key == SH_KEYDOWN ) {
 
                         if ( 
gPlayerInCooldown[id] ) {
    
sh_sound_deny(id)
    return
                         }
         new 
Float:seconds get_pcvar_float(gPcvarCooldown)
         if ( 
seconds 0.0 sh_set_cooldown(idseconds)
         new 
maxDamage get_pcvar_num(gPcvarMaxDamage)
         } 
Errors are:

PHP Code:
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
the_dracula.sma(54) : error 029invalid expressionassumed zero
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
the_dracula.sma(54) : error 001expected token";"but found ")"
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
the_dracula.sma(54) : error 029invalid expressionassumed zero
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
the_dracula.sma(54) : fatal error 107too many error messages on one line 
EDIT: Fixed that stuff public sh_hero_key I believe, line 54 is
PHP Code:
if ( gHeroID != heroID ) || sh_is_freezetime() || !is_user_alive(id) ) || key != SH_KEYDOWN || !gHasDracula[id] ) return 
__________________

Last edited by The Art of War; 03-15-2010 at 16:10.
The Art of War is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-15-2010 , 17:42   Re: Help
Reply With Quote #7

grrr you didn't fix the indentation as I told you to!

I rewrote it from scratch since what you have written didn't make so much sense to me.

PHP Code:
public sh_hero_key(idheroIDkey)
{
    if ( 
gHeroID != heroID ) || sh_is_freezetime() || !is_user_alive(id) || !gHasDracula[id] ) return
    
    if ( 
key == SH_KEYDOWN )
    {
        if ( 
gPlayerInCooldown[id] )
        {
            
sh_sound_deny(id)
            return
        }
        
        new 
Float:seconds get_pcvar_float(gPcvarCooldown)
        
        if (
seconds 0.0 sh_set_cooldown(idseconds)
        
        new 
maxDamage get_pcvar_num(gPcvarMaxDamage)
    }

Anyway. I do not know what you need the new maxDamage to?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 03-15-2010 , 21:28   Re: Help
Reply With Quote #8

I'm lost on what exactly it is you want. Do you basically want to cause a certain amount of damage in small increments over a set time such as the way human torch, aquaman, or even poison ivy(with slight modifications) does? Or are you just asking how to cause damage based on a cvar?

p.s. both methods of getting keydown are valid, read up a little more on differences between if and switch statements
__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-15-2010 , 21:46   Re: Help
Reply With Quote #9

I have red it multiple times. I still don't really get the difference between switch and if conditions.

Only that on if conditions you can add like get_user_name etc. and you can only have what is in the forward in the switch. But since you could use both methods here, what is the best?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-16-2010 , 02:59   Re: Help
Reply With Quote #10

@G-Dog:
What I want to do when its finished is to channel damage/life steal over 3 seconds with a nice sprite, and steal a specific percent of the victims maxhealth specified by cvar and damage (pCvarMaxDamage) during 3 seconds(set by "set_task"?). I also want to stun the victim during these 3 seconds. So ill guess ill have to make something in the dracula_bloodsuck that stuns it and "set_task(saomething, __, "dracula_bloodsuck)"? Any chance you could give me a hint how to set a cvar for the damage that will work if I loop it so you make for example 10 damage for 3 seconds (1 second, loop 3)?

@Jelle: Thx, I will try it when I get home to the dear code... xD
Now I will test it in my failed test server and see what happens. Then its time to add a sprite and byte messages for it, and the loop.

Anyone know what is best for a "stun" effect? Is there a way to make the user unable to use weapons and keydown powers with having them dropping all weapons/switching to knife and drop all powers? Thx for your help. AM pwns

EDIT: Aww lol. Failed to compile

PHP Code:
//// sh_the_dracula.sma
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
the_dracula.sma(54) : error 029invalid expressionassumed zero
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
the_dracula.sma(54) : error 001expected token";"but found ")"
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
the_dracula.sma(54) : error 029invalid expressionassumed zero
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
the_dracula.sma(54) : fatal error 107too many error messages on one line
//
// Compilation aborted.
// 4 Errors.
// Could not locate output file compiled\sh_the_dracula.amx (compile failed). 
PHP Code:
public sh_hero_key(idheroIDkey)
{
    if ( 
gHeroID != heroID ) || sh_is_freezetime() || !is_user_alive(id) || !gHasDracula[id] ) return
    
    if ( 
key == SH_KEYDOWN )
    {
        if ( 
gPlayerInCooldown[id] )
        {
            
sh_sound_deny(id)
            return
        }
        
        new 
Float:seconds get_pcvar_float(gPcvarCooldown)
        
        if (
seconds 0.0 sh_set_cooldown(idseconds)
        
        new 
maxDamage get_pcvar_num(gPcvarMaxDamage)
    }

Line 54 =
PHP Code:
if ( gHeroID != heroID ) || sh_is_freezetime() || !is_user_alive(id) || !gHasDracula[id] ) return 
__________________

Last edited by The Art of War; 03-16-2010 at 11:00.
The Art of War is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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