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

Even more questions/issues...


Post New Thread Reply   
 
Thread Tools Display Modes
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-21-2010 , 09:08   Re: Even more questions/issues...
Reply With Quote #491

I still thought it.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 10-21-2010 , 09:22   Re: Even more questions/issues...
Reply With Quote #492

I have the version with only missiles, and I like that one, as a maxlevel hero.
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 10-27-2010 , 11:03   Re: Even more questions/issues...
Reply With Quote #493

Quote:
Originally Posted by Exploited View Post
So, suddenly Jelles version of Grim Reaper (wich have worked flawlessly for 2 months or so) starts to disfunction. I tried to recompile it and readd but it didn't solve it. I decided to create a new version myself but that didn't work either. I am not sure if the gravity or invisiblity disfunctions, but the dmgmult does.

Heres the code for Jelles (comments are because he made this one to teach me)

PHP Code:
/* Plugin generated by AMXX-Studio */

//lets start from the top. This includes SH mod, so we can use sh mod functions.
#include <superheromod>
//This is an old include file and should never be used, however, I use it anyway in client_prethink. Read down there
#include <Vexd_Utilities>

//Now we make some global variables which we are going to use
new gHeroID //This is the unique ID which SH mod gives to our hero
new bool:gHasGrimPower[SH_MAXSLOTS+1//This we add as a boolean so we can check if the user has the power or not
/*A boolean: A boolean is a variable which can ONLY be true or false I explain the rest in the hero init. */
new gHeroName [] = "Grim Reaper" //This global variable holds the name for the hero, so when I need the name, I just use "gHeroName" instead of the name making it easier for myself

//I place cvars here to make it easier to find
//I make it global since I need to use it outside plugin_init
new pcvarAlpha

//When the server starts, or right after a map change, this forward runs, so here we make the cvars and all the other events we want to run later on
public plugin_init()
{
    
//First we register the plugin with amx mod x. This just holds basic information. You probably know what it is.
    
register_plugin("SUPERHERO Grim Reaper""2.0""SniperX/Jelle")
    
    
//Now a make a new variable to hold the level cvar for the hero
    
new pcvarLevel register_cvar("grimreaper_level""0")
    
//And now I assign pcvarAlpha to a cvar, so it then holds that cvar inside it
    
pcvarAlpha register_cvar("grimreaper_alpha""60")
    
//Now I make the damage multiplier cvar. I can make it in here since I just need it in plugin_init and not somewhere else
    
new pcvarMult register_cvar("grimreaper_knifemult""10")
    
//Now I make the gravity cvar. I can also make this one in here since I only need it in here
    
new pcvarGrav register_cvar("grimreaper_grav""0.25")
    
    
//Now I assign gHeroID to this native, so first now the gHeroID has the ID of the hero.
    
gHeroID sh_create_hero(gHeroNamepcvarLevel)
    
//Now I set information about the hero. To do that, I need the unique hero id which SH assigned my hero. It is placed in gHeroID as explained before
    
sh_set_hero_info(gHeroID"Invisibility/Scythe/Float/Silent""Invisibility/Knife=1 Hit KO/Low Gravity/Silent Walking")
    
    
//Now I set the damage multiplier. Here I also need to use the heroID, but that is still stored in gHeroID
    
sh_set_hero_dmgmult(gHeroIDpcvarMultCSW_KNIFE)
    
//Now I set the gravity
    
sh_set_hero_grav(gHeroIDpcvarGrav)
}

//Now here is the hero init this is called each time an event in SH mod happens
public sh_hero_init(idheroIDmode)
{
    
//Now we check if the heroID which we assigned using sh_create_hero is the same as the id in the init if it is not then it is another hero, and we just return
    //return means for short "Just do nothing and end forward now"
    
if ( gHeroID != heroID ) return
    
    
//This is a switch. Each time something happens with "mode", this runs
    
switch(mode)
    {
        
//If mode is that they added this hero to their inventory, then this runs
        
case SH_HERO_ADD:
        {
            
//And now we set the global boolean to true, so it now knows that the guy has the hero
            
gHasGrimPower[id] = true
            
//we also go and make him invisible right away when the client adds this hero, so we make our own forward to do that in
            
invisible(id)
        }
        
        
//If mode is that they dropped this hero from their inventory, then this runs
        
case SH_HERO_DROP:
        {
            
//And then we let the global boolean know that this hero has been dropped
            
gHasGrimPower[id] = false
            
//You can drop heroes while alive on some heroes, so if the client drops this hero, we do not want him to stay invisible anymore
            //Therefor we run the forward visible, to make him visible again
            
visible(id)
        }
    }
}
//And remember to close the hero init properly

//In the old grim reaper he used client_preThink. I believe this runs each frame the server runs, but I am not entirely sure
//We do not need to register it, as it is build into amx mod x that it just runs automatically each frame
public client_PreThink(id)
{
    
//First we check if the guy has the hero. We do this by using the boolean. We have already set it to true or false depending on if he has the hero or not
    
if ( gHasGrimPower[id] )
    {
        
//I believe this does so you don't have footsteps. This is using an old include file
        //which is very bad to use. I do not know any other method of doing this, so I have to stick with the old code
        //If anyone knows a better way please do tell me.
        
Entvars_Set_Int(idEV_INT_flTimeStepSound999)
    }
}

//Now we use the forward sh_client_spawn. This is build into SH mod itself, so again, there is no need to register to, we just use it.
public sh_client_spawn(id)
{
    
//Before we do anything we need to check if the guy has the hero or not
    
if ( gHasGrimPower[id] )
    {
        
//So, if he does have the power, we just go to our own forward we created meaning, now we want to run the forward invisible
        
invisible(id)
    }
}

//Here is our own forward. We told SH mod to run this each time the hero is added, or when the client with the hero spawns
invisible(id)
{
    
//so, in here we first make a check if the guy actually has the hero
    
if ( gHasGrimPower[id] )
    {
        
//If he does, then we go and make him invisible
        
set_user_rendering(idkRenderFxGlowShell888kRenderTransAlphaget_pcvar_num(pcvarAlpha))
    }
}

//Not sure why, but in the old code it also made the guy visible if he dies, so I just do that too, just to be on the safe side
//This forward is also build into SH mod itself. This runs each time someone dies. It is already registered, so we just go ahead and use it.
public sh_client_death(id)
{
    
//I only want to know who the victim who dies are. If I want to get the attacker, if it is a headshot or what weapon, I can do that as well
    //I should probably explain that I called the victim id instead, since I already called the forward visible(id). There is a huge explanation to this, and I don't know how to get it out, sorry.
    //That is build into SH mod too. You can look in superheromod.inc file to see any forward which is already registered and is ready to use, and how to use it.
    //Well, first we check if the victim (the guy who dies) has the hero
    
if ( gHasGrimPower[id] )
    {
        
//if he does, run the forward visible to make him visible again
        
visible(id)
    }
}

//Now we make the forward visible
visible(id)
{
    
//And now we just make him visible again
    
set_user_rendering(id)
}

//Remember to close all forward properly!
//Done, and it compiles too! 
</span></span>

And heres the code for mine:

PHP Code:
//Grim Reaper - new version

#include <superheromod>

//Global variables
new gHeroID
new gHeroName[] = "Grim Reaper"
new bool:gHasGrim[SH_MAXSLOTS+1]

//Global cvars
new pcvarAlpha
//---------------------------------------------------------------------
public plugin_init()
{
    
register_plugin("SUPERHERO Grim Reaper""3.0""SniperX/Exploited")
    
    new 
pcvarLevel register_cvar("grimreaper_level""8")
    new 
pcvarMult register_cvar("grimreaper_knifemult""3.5")
    new 
pcvarGrav register_cvar("grimreaper_grav""0.25")
    
pcvarAlpha register_cvar("grimreaper_alpha""60")
    
    
gHeroID sh_create_hero(gHeroNamepcvarLevel)
    
sh_set_hero_info(gHeroID"Invisibility/Scythe/Float/Silent""Invisibility/Knife=1 Hit KO/Low Gravity/Silent Walking")
    
sh_set_hero_dmgmult(gHeroIDpcvarMultCSW_KNIFE)
    
sh_set_hero_grav(gHeroIDpcvarGrav)
    
    
register_forward(FM_PlayerPreThink"grimreaper_prethink")
}
//---------------------------------------------------------------------    
public sh_hero_init(idheroIDmode)
{
    if ( 
gHeroID != heroID ) return
    
    switch(
mode)
    {
        case 
SH_HERO_ADD:
        {            
            
gHasGrim[id] = true
            invisible
(id)
        }
        
        case 
SH_HERO_DROP:
        {
            
gHasGrim[id] = false
            visible
(id)
        }
    }
}
//---------------------------------------------------------------------
public sh_client_spawn(id)
{
    if ( 
gHasGrim[id] )
    {
        
invisible(id)
    }
}
//---------------------------------------------------------------------
invisible(id)
{
    if ( 
gHasGrim[id] )
    {
        
set_user_rendering(idkRenderFxGlowShell888kRenderTransAlphaget_pcvar_num(pcvarAlpha))
    }
}
//---------------------------------------------------------------------
public sh_client_death(id)
{
    if ( 
gHasGrim[id] )
    {
        
visible(id)
    }
}
//---------------------------------------------------------------------
visible(id)
{
    
set_user_rendering(id)
}
//---------------------------------------------------------------------
public grimreaper_prethink(id)
{
    if ( 
sh_is_active() && is_user_alive(id) && gHasGrim[id] ) {
        
set_pev(idpev_flTimeStepSound999)
    }
}
//--------------------------------------------------------------------- 
Both compiles without any warnings. Any ideas?
Bump.
It still doesn't work, neither of the versions. Should be noted that on ONE round it said "Most damage Exploited - 4 hits, 4000 damage" but on all the others it gives me much less damage per hit. That was on knife_zone so it was only knife.
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-27-2010 , 12:22   Re: Even more questions/issues...
Reply With Quote #494

Is it only the damage which is not working? If so, make a new hero, make it ONLY do the weapon mult. Name it Grim Reaper like the old one, and delete the old one from the server, so you have grim reaper with only damage multiplier. Does that work?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
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 00:27.


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