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

Help


Post New Thread Reply   
 
Thread Tools Display Modes
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-17-2010 , 09:34   Re: Help
Reply With Quote #21

G-Dog likes the semicolons.

Anyway, try G-Dogs method. I'm sure it works.
__________________
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-17-2010 , 11:18   Re: Help
Reply With Quote #22

Now we are actually getting somewhere!



PHP Code:
#include <superheromod> 
// GLOBAL VARIABLES 
new gHeroID
new 
bool:gHasTest[SH_MAXSLOTS+1]; 
new 
pcvar_coolpcvar_dmg
//---------------------------------------------------------------------------------------------- 
public plugin_init() 

    
// Plugin Info 
    
register_plugin("SUPERHERO Test""0.1""Random1"
    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG 
    
new pcvarLevel register_cvar("test_level""0"); 
    
pcvar_cool register_cvar("test_cooldown""30.0"); 
    
pcvar_dmg register_cvar("test_pctdmg""0.1"); 
    
// FIRE THE EVENT TO CREATE THIS SUPERHERO! 
    
gHeroID sh_create_hero("Test"pcvarLevel); 
    
sh_set_hero_info(gHeroID"Leech Seed""Slowly absorb players health"); 
    
sh_set_hero_bind(gHeroID);  

//---------------------------------------------------------------------------------------------- 
public sh_hero_init(idheroidmode
    if ( 
heroid == gHeroID 
        
gHasTest[id] = mode true false
//---------------------------------------------------------------------------------------------- 
public sh_hero_key(idheroIDkey

    if ( 
gHeroID != heroID ) return; 
    if ( 
key )    //ya I know, instead of sticking with one method I went with yet another method of checking keydown just to f with yall 
    

        new 
tidtbody
        
get_user_aiming(idtidtbody); 
 
        if ( 
is_user_alive(tid) && gHasTest[id] && !gPlayerInCooldown[id] && (cs_get_user_team(id) != cs_get_user_team(tid) || sh_friendlyfire_on()) ) 
            
leech_player(tidid); 
    } 
}  
//---------------------------------------------------------------------------------------------- 
leech_player(victimattacker

    if ( 
sh_is_active() && gHasTest[attacker] && is_user_alive(victim) ) 
    { 
        
//first lets stun the player, we'll let them move a little cause stoping them all together can get cheap 
        
sh_set_stun(victim3.075.0); 
 
        new 
args[3]; args[0] = victimargs[1] = attacker;  
        
args[2] = floatround(floatclamp(get_pcvar_float(pcvar_dmg) * get_user_health(victim) / 10.01.0float(sh_get_max_hp(victim)))); 
        
set_task(0.3"drain_health"attackerargs3"a"10);        //loops our task to occur 10 times over a 3 second interval 
 
        //set our cooldown now, assuming there is one 
        
if (get_pcvar_float(pcvar_cool) > 0.0sh_set_cooldown(attackerget_pcvar_float(pcvar_cool)); 
    } 

//---------------------------------------------------------------------------------------------- 
public drain_health(args[]) 

    static 
victimattackerdamagevictim args[0]; attacker args[1]; damage args[2]; 
    if ( !
is_user_alive(victim) || !is_user_alive(attacker) ) 
    { 
        
remove_task(attacker); 
        return; 
    } 
 
    
sh_extra_damage(victimattackerdamage"leech life"); 
    
sh_add_hp(attackerdamage0); 
 
    
//and finally some kind of sprite effect, for now i'm gonna copy drac and just have the red flash    
    
sh_screen_fade(attacker0.50.25255101040);  

//---------------------------------------------------------------------------------------------- 
public client_connect(id
    
gHasTest[id] = false
//---------------------------------------------------------------------------------------------- 
I would like to add the electro sprite to it;
PHP Code:
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
 
write_byte(TE_BEAMENTS)
 
write_short(beamStartID)// start entity
 
write_short(victim// entity
 
write_short(gSpriteLightning// model
 
write_byte(0)  // starting frame
 
write_byte(15)  // frame rate
 
write_byte(10)  // life
 
write_byte(linewidth// linewidth
 
write_byte(10)  // noise amplitude
 
write_byte(105)  // r, g, b
 
write_byte(105)  // r, g, b
 
write_byte(255)  // r, g, b 125
 
write_byte(60)  // brightness 175
 
write_byte(0)  // scroll speed
 
message_end() 
and then play around with it to get a nice effect, though I need
PHP Code:
new Float:beamOrigin[3]
 
pev(beamStartIDpev_originbeamOrigin
right? And then I dont know what to change in the original code ^^
__________________

Last edited by The Art of War; 03-17-2010 at 13:04.
The Art of War is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-17-2010 , 12:34   Re: Help
Reply With Quote #23

Aww, cmon now, check my last post
__________________
The Art of War is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 03-17-2010 , 13:43   Re: Help
Reply With Quote #24

G-Dog, I think he wants a weapon to have increased damage for only a certain time period triggered by a power key.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 03-17-2010 , 13:44   Re: Help
Reply With Quote #25

do you want to play that effect each time hp is absorbed or just when the player gets leeched?
__________________
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
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-17-2010 , 13:50   Re: Help
Reply With Quote #26

Quote:
Originally Posted by vittu View Post
G-Dog, I think he wants a weapon to have increased damage for only a certain time period triggered by a power key.
Lal, not really..... G-Dog made it exactly the way I want it, though I just need to add a sprite and sound now. Im trying right now with some stuff from electro, though I fail pretty bigtime.
@G-Dog: Like the loop; The sprite is displayed all the time you leech someone; So the same amount of time you leech hp. I know it could look pretty fail, but I will probably set the cooldown to 30-60 secs and the leech % to 0.3 (30% of max hp), though I will test it some more if I get the sprite and sound on it.

This will probably just confuse you, and im sure that if G-Dog will help me, he will make it faster on his own... Still here it is, and im still not sure how to get the damn ;'s right

PHP Code:
#include <superheromod> 
#define LINE_WIDTH 100
// GLOBAL VARIABLES 
new gHeroID
new 
bool:gHasTest[SH_MAXSLOTS+1]; 
new 
pcvar_coolpcvar_dmg
//---------------------------------------------------------------------------------------------- 
public plugin_init() 

    
// Plugin Info 
    
register_plugin("SUPERHERO Test""0.1""Random1"
    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG 
    
new pcvarLevel register_cvar("test_level""0"); 
    
pcvar_cool register_cvar("test_cooldown""30.0"); 
    
pcvar_dmg register_cvar("test_pctdmg""0.1"); 
    
// FIRE THE EVENT TO CREATE THIS SUPERHERO! 
    
gHeroID sh_create_hero("Test"pcvarLevel); 
    
sh_set_hero_info(gHeroID"Leech Seed""Slowly absorb players health"); 
    
sh_set_hero_bind(gHeroID);  

//---------------------------------------------------------------------------------------------- 
public sh_hero_init(idheroidmode
    if ( 
heroid == gHeroID 
        
gHasTest[id] = mode true false
//---------------------------------------------------------------------------------------------- 
public sh_hero_key(idheroIDkey

    if ( 
gHeroID != heroID ) return; 
    if ( 
key )    //ya I know, instead of sticking with one method I went with yet another method of checking keydown just to f with yall 
    

        new 
tidtbody
        
get_user_aiming(idtidtbody); 
         
        if ( 
is_user_alive(tid) && gHasTest[id] && !gPlayerInCooldown[id] && (cs_get_user_team(id) != cs_get_user_team(tid) || sh_friendlyfire_on()) ) 
            
leech_player(tidid); 
    } 
}  
//---------------------------------------------------------------------------------------------- 
leech_player(victimattacker

    if ( 
sh_is_active() && gHasTest[attacker] && is_user_alive(victim) ) 
    { 
        
//first lets stun the player, we'll let them move a little cause stoping them all together can get cheap 
        
sh_set_stun(victim3.075.0); 
         
        new 
args[3]; args[0] = victimargs[1] = attacker;  
        
args[2] = floatround(floatclamp(get_pcvar_float(pcvar_dmg) * get_user_health(victim) / 10.01.0float(sh_get_max_hp(victim)))); 
        
set_task(0.3"drain_health"attackerargs3"a"10);        //loops our task to occur 10 times over a 3 second interval 
         
        //set our cooldown now, assuming there is one 
        
if (get_pcvar_float(pcvar_cool) > 0.0sh_set_cooldown(attackerget_pcvar_float(pcvar_cool)); 
    } 

//---------------------------------------------------------------------------------------------- 
public drain_health(args[]) 

    static 
victimattackerdamagevictim args[0]; attacker args[1]; damage args[2]; 
    if ( !
is_user_alive(victim) || !is_user_alive(attacker) ) 
    { 
        
remove_task(attacker); 
        return; 
    } 
     
    
sh_extra_damage(victimattackerdamage"leech life"); 
    
sh_add_hp(attackerdamage0); 
     
    new 
Float:beamOrigin[3];
 
pev(beamStartIDpev_originbeamOrigin);

    
//and finally some kind of sprite effect, for now i'm gonna copy drac and just have the red flash    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
 
write_byte(TE_BEAMENTS)
 
write_short(beamStartID)// start entity
 
write_short(victim// entity
 
write_short(gSpriteLightning// model
 
write_byte(0)  // starting frame
 
write_byte(15)  // frame rate
 
write_byte(10)  // life
 
write_byte(linewidth// linewidth
 
write_byte(10)  // noise amplitude
 
write_byte(150)  // r, g, b
 
write_byte(0)  // r, g, b
 
write_byte(170)  // r, g, b 125
 
write_byte(60)  // brightness 175
 
write_byte(0)  // scroll speed
 
message_end();

     new 
vicOrigin[3];
 
get_user_origin(victimvicOrigin) ;
 
// Create an elight on the target
 
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
 
write_byte(TE_ELIGHT)
 
write_short(victim// entity
 
write_coord(vicOrigin[0])  // initial position
 
write_coord(vicOrigin[1])  // initial position
 
write_coord(vicOrigin[2])  // initial position
 
write_coord(10// radius
 
write_byte(0)  // r, g, b
 
write_byte(0)  // r, g, b
 
write_byte(255)  // r, g, b
 
write_byte(10)  // life
 
write_coord(0)  // decay rate
 
message_end();
    

//---------------------------------------------------------------------------------------------- 
public client_connect(id
    
gHasTest[id] = false
//---------------------------------------------------------------------------------------------- 
Errors:
Code:
//// sh_necromonger.sma
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
necromonger.sma(73) : warning 217: loose indentation
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
necromonger.sma(73) : error 017: undefined symbol "beamStartID"
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
necromonger.sma(73) : warning 215: expression has no effect
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
necromonger.sma(73) : warning 215: expression has no effect
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
necromonger.sma(73) : error 001: expected token: ";", but found ")"
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
necromonger.sma(73) : error 029: invalid expression, assumed zero
// C:\Users\Cornerstone\Desktop\HLDS_Server\cstrike\addons\amxmodx\scripting\sh_
necromonger.sma(73) : fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 4 Errors.
// Could not locate output file compiled\sh_necromonger.amx (compile failed).
//
// Compilation Time: 0,59 sec
__________________

Last edited by The Art of War; 03-17-2010 at 13:54.
The Art of War is offline
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 03-17-2010 , 14:15   Re: Help
Reply With Quote #27

assuming you want a constant beam and not one that phases in and out this should work(at least if I'm right about the life parameter). For one that phases in and out move the effect into the loop function and change the life rate to 1
PHP Code:
#include <superheromod>

// GLOBAL VARIABLES
new gHeroID;
new 
bool:gHasTest[SH_MAXSLOTS+1];
new 
pcvar_coolpcvar_dmg;
new 
gSpriteLightning;
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    
// Plugin Info
    
register_plugin("SUPERHERO Test""0.2""Random1");

    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    
new pcvarLevel register_cvar("test_level""0");
    
pcvar_cool register_cvar("test_cooldown""30.0");
    
pcvar_dmg register_cvar("test_pctdmg""0.1");

    
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
    
gHeroID sh_create_hero("Test"pcvarLevel);
    
sh_set_hero_info(gHeroID"Leech Seed""Slowly absorb players health");
    
sh_set_hero_bind(gHeroID);
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
    
gSpriteLightning precache_model("sprites/lgtning.spr");
//----------------------------------------------------------------------------------------------
public sh_hero_init(idheroidmode)
    if ( 
heroid == gHeroID )
        
gHasTest[id] = mode true false;
//----------------------------------------------------------------------------------------------
public sh_hero_key(idheroIDkey)
{
    if ( 
gHeroID != heroID ) return;

    if ( 
key )    //ya I know, instead of sticking with one method I went with yet another method of checking keydown just to f with yall
    
{
        new 
tidtbody;
        
get_user_aiming(idtidtbody);
        
        if ( 
is_user_alive(tid) && gHasTest[id] && !gPlayerInCooldown[id] && (cs_get_user_team(id) != cs_get_user_team(tid) || sh_friendlyfire_on()) )
            
leech_player(tidid);
    }
}
//----------------------------------------------------------------------------------------------
leech_player(victimattacker)
{
    if ( 
sh_is_active() && gHasTest[attacker] && is_user_alive(victim) )
    {
        
//first lets stun the player, we'll let them move a little cause stoping them all together can get cheap
        
sh_set_stun(victim3.075.0);
        
        
//start the drain loop
        
new args[3]; args[0] = victimargs[1] = attacker
        
args[2] = floatround(floatclamp(get_pcvar_float(pcvar_dmg) * get_user_health(victim) / 10.01.0float(sh_get_max_hp(victim))));
        
set_task(0.3"drain_health"attackerargs3"a"10);        //loops our task to occur 10 times over a 3 second interval
        
        //add some effects
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
        
write_byte(TE_BEAMENTS);
        
write_short(attacker);            // start entity
        
write_short(victim);            // entity
        
write_short(gSpriteLightning);    // model
        
write_byte(0);                    // starting frame
        
write_byte(15);                    // frame rate
        
write_byte(30);                    // life in 0.1's   so 30 should = 3 seconds
        
write_byte(60);                    // line width
        
write_byte(10);                    // noise amplitude
        
write_byte(255);                // r, g, b
        
write_byte(128);                // r, g, b
        
write_byte(0);                    // r, g, b
        
write_byte(150);                // brightness
        
write_byte(0);                    // scroll speed
        
message_end();
        
        
//set our cooldown now, assuming there is one
        
if (get_pcvar_float(pcvar_cool) > 0.0sh_set_cooldown(attackerget_pcvar_float(pcvar_cool));
    }
}
//----------------------------------------------------------------------------------------------
public drain_health(args[])
{
    static 
victimattackerdamagevictim args[0]; attacker args[1]; damage args[2];
    if ( !
is_user_alive(victim) || !is_user_alive(attacker) )
    {
        
remove_task(attacker);
        return;
    }
    
    
sh_extra_damage(victimattackerdamage"leech life");
    
sh_add_hp(attackerdamage0);
    
    
//and finally some kind of sprite effect, for now i'm gonna copy drac and just have the red flash    
    
sh_screen_fade(attacker0.50.25255101040); //Red Screen Flash
}
//----------------------------------------------------------------------------------------------
public client_connect(id)
    
gHasTest[id] = false;
//---------------------------------------------------------------------------------------------- 
__________________
If at first you don't succeed, then skydiving isn't for you.

Last edited by G-Dog; 03-17-2010 at 14:18.
G-Dog is offline
Send a message via AIM to G-Dog
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-17-2010 , 14:48   Re: Help
Reply With Quote #28

Now imma post this stuff here for the people that has been following if you want it. Plz rate (Yes G-Dog made almost everything )

Necromonger: Suck the life out of those who deny you!

http://en.wikipedia.org/wiki/The_Chronicles_of_Riddick

[IMG]http://img706.**************/img706/6251/scifinecromonger.jpg[/IMG]


[IMG]http://img28.**************/img28/774/necroicon.jpg[/IMG]
Attached Files
File Type: sma Get Plugin or Get Source (sh_necromonger.sma - 470 views - 4.6 KB)
__________________

Last edited by The Art of War; 03-20-2010 at 09:26.
The Art of War is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-18-2010 , 07:18   Re: Help
Reply With Quote #29

I tried to add a max range cvar by using the old hero "Explosion", I took the distanceBetween = get_distance(origin, origin1 ) and changed to attacker, victim, and if( distanceBetween < !attacker, victim) and so on.... I know I didnt used the orígin part, I dont get it xD

Please help if anyone got time! thx
__________________
The Art of War is offline
kanatzu
Veteran Member
Join Date: Oct 2007
Location: Sweden
Old 03-18-2010 , 08:53   Re: Help
Reply With Quote #30

PHP Code:
register_plugin("SUPERHERO Necromonger""0.2""The Art of War"); 

This is what i meant before. You should also add G-Dog as author.
__________________




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
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 09:31.


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