Raised This Month: $32 Target: $400
 8% 

Goten in shmod 1.2.0.14


Post New Thread Reply   
 
Thread Tools Display Modes
MuzzMikkel
Member
Join Date: Aug 2010
Location: Denmark
Old 06-09-2011 , 11:58   Re: Goten in shmod 1.2.0.14
Reply With Quote #11

I really wanted the Goten to be like, super saiyan gohan.. so its being controled.
and with progress bar, could anybody make that for me?

PHP Code:
#include <superheromod> 

//superhero vars 
new gHeroID
new 
bool:gBlockKeyup[SH_MAXSLOTS+1]; 
new 
gLastWeapon[SH_MAXSLOTS+1]; 
//sprite junk 
new BeamExplosionSmoke
static const 
burn_decal[3] = {282930
static const 
burn_decal_big[3] = {464748
//pcvars 
new pCoolDownpMaxDmgpRadiuspDecals
//---------------------------------------------------------------------------------------------- 
public plugin_init() 

    
// Plugin Info 
    
register_plugin("SUPERHERO Goten""1.4""buttface / vittu"); 

    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG 
    
new pLevel register_cvar("goten_level""6"); 
    new 
pHealth register_cvar("goten_health""400"); 
    new 
pArmor register_cvar("goten_armor""100"); 
    
pCoolDown register_cvar("goten_cooldown""30"); 
    
pMaxDmg register_cvar("goten_maxdamage""75"); 
    
pRadius register_cvar("goten_radius""100"); 
    
pDecals register_cvar("goten_blast_decals""1"); 
     
    
// FIRE THE EVENT TO CREATE THIS SUPERHERO! 
    
gHeroID sh_create_hero("Goten"pLevel); 
    
sh_set_hero_info(gHeroID"Kamekameha!""Fire Goten's Kamehameha Wave on Keydown."); 
    
sh_set_hero_bind(gHeroID); 
     
    
// Let Server know about Goten's Variables 
    
sh_set_hero_hpap(gHeroIDpHealthpArmor); 

//---------------------------------------------------------------------------------------------- 
public plugin_precache() 

    
Beam precache_model("sprites/shmod/esf_trail_blue.spr"); 
    
Explosion precache_model("sprites/shmod/esf_exp_blue.spr"); 
    
Smoke precache_model("sprites/wall_puff4.spr"); 

//---------------------------------------------------------------------------------------------- 
public sh_client_spawn(id
    
sh_end_cooldown(id); 
//---------------------------------------------------------------------------------------------- 
public sh_hero_key(idheroIDkey

    if ( 
gHeroID != heroID ) return; 

    if ( 
sh_is_freezetime() || !is_user_alive(id) ) return; 
     
    switch(
key
    { 
        case 
SH_KEYDOWN:  
        { 
            if ( 
gPlayerInCooldown[id] )  
            { 
                
sh_sound_deny(id); 
                
gBlockKeyup[id] = true
                return; 
            } 
             
            
gBlockKeyup[id] = false
             
            
// Remember this weapon... 
            
gLastWeapon[id] = get_user_weapon(id); 
         
            
// switch to knife 
            
engclient_cmd(id"weapon_knife"); 
         
            
fire_wave(id); 
             
            new 
Float:cooldown get_pcvar_float(pCoolDown); 
            if (
cooldown 0.0sh_set_cooldown(idcooldown); 
        } 
        case 
SH_KEYUP:  
        { 
            if ( !
gBlockKeyup[id] ) 
            { 
                
// Switch back to previous weapon... 
                
if (gLastWeapon[id] != CSW_KNIFEsh_switch_weapon(idgLastWeapon[id]) 
            }  
        } 
    } 

//---------------------------------------------------------------------------------------------- 
fire_wave(id

    new 
aimvec[3]; 
    new 
Float:dRatiodamagedistanceBetween
    new 
damradius get_pcvar_num(pRadius); 
    new 
maxdamage get_pcvar_num(pMaxDmg); 

    if( !
is_user_alive(id) ) return; 

    
get_user_origin(idaimvec3); 
    
beam_effects(idaimvecdamradius); 
     
    new 
players[32], pnumvicorigin[3]; 
    
get_players(playerspnum"a"); 
    new 
userteam get_user_team(id); 
    new 
FFon sh_friendlyfire_on();    //since we are checking ff each iteration of the loop we'll store to a var here to cut on cpu usage 
     
    
for (new ipnumi++)  
    { 
        
vic players[i]; 
        if ( 
FFon || userteam != get_user_team(vic) || vic == id 
        { 
            
get_user_origin(vicorigin); 
            
distanceBetween get_distance(aimvecorigin); 

            if ( 
distanceBetween damradius )  
            { 
                
dRatio float(distanceBetween) / float(damradius); 
                
damage maxdamage floatround(maxdamage dRatio); 

                
// Lessen damage taken by self 
                
if (vic == iddamage /= 2
                 
                
sh_extra_damage(viciddamage"Kamehameha"); 
            } 
        } 
    } 

//---------------------------------------------------------------------------------------------- 
beam_effects(idaimvec[3], damradius

    new 
decal_idbeamWidth

    
//Change sprite size according to blast radius 
    
new blastSize floatround(damradius 12.0); 

    
//Change burn decal and beam width size according to blast size 
    
decal_id = (blastSize <= 18) ? burn_decal[random_num(02)] : burn_decal_big[random_num(02)]; 
    
beamWidth = (blastSize <= 18) ? 50 75

    
//Beam 
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY); 
    
write_byte(1);                //TE_BEAMENTPOINTS 
    
write_short(id);            //ent 
    
write_coord(aimvec[0]);        //position 
    
write_coord(aimvec[1]); 
    
write_coord(aimvec[2]); 
    
write_short(Beam);            // sprite index 
    
write_byte(0);                // start frame 
    
write_byte(35);                // framerate 
    
write_byte(4);                // life 
    
write_byte(beamWidth);        // width 
    
write_byte(0);                // noise 
    
write_byte(255);            // red (rgb color) 
    
write_byte(255);            // green (rgb color) 
    
write_byte(255);            // blue (rgb color) 
    
write_byte(255);            // brightness 
    
write_byte(20);                // speed 
    
message_end(); 

    
//Glow Sprite (explosion) 
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY); 
    
write_byte(23);                //TE_GLOWSPRITE 
    
write_coord(aimvec[0]);        //position 
    
write_coord(aimvec[1]); 
    
write_coord(aimvec[2]); 
    
write_short(Explosion);        // model 
    
write_byte(001);            // life 0.x sec (01 min limit?) 
    
write_byte(blastSize);        // size 
    
write_byte(255);            // brightness 
    
message_end() 

    
//Explosion (smoke, sound/effects) 
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY); 
    
write_byte(3);                //TE_EXPLOSION 
    
write_coord(aimvec[0]);        //pos 
    
write_coord(aimvec[1]); 
    
write_coord(aimvec[2]); 
    
write_short(Smoke);            // model 
    
write_byte(blastSize+5);    // scale in 0.1's 
    
write_byte(20);                // framerate 
    
write_byte(10);                // flags 
    
message_end(); 

    
//Burn Decals 
    
if( get_pcvar_num(pDecals) )  
    { 
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY); 
        
write_byte(109);        //TE_GUNSHOTDECAL 
        
write_coord(aimvec[0]);    //pos 
        
write_coord(aimvec[1]); 
        
write_coord(aimvec[2]); 
        
write_short(0);            //? 
        
write_byte(decal_id);    //decal 
        
message_end(); 
    } 

//---------------------------------------------------------------------------------------------- 
MuzzMikkel is offline
Send a message via MSN to MuzzMikkel
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 06-09-2011 , 17:49   Re: Goten in shmod 1.2.0.14
Reply With Quote #12

Quote:
Originally Posted by MuzzMikkel View Post
Just because i want to know more about scripting, it dosen't mean im noob
Jelle that was just my words would you like to help me?
Actually in your case, it does. If you would just follow some common sence, not make 12 threads, make one instead.

...

Rip (again..) SSJ Gohan, remove the ent creating forward, everything there, replace it with the code that you now have.
__________________
The Art of War is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 06-09-2011 , 18:02   Re: Goten in shmod 1.2.0.14
Reply With Quote #13

Quote:
Originally Posted by MuzzMikkel View Post
I really wanted the Goten to be like, super saiyan gohan.. so its being controled.
Then just take gohan and rename it.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 06-10-2011 , 02:52   Re: Goten in shmod 1.2.0.14
Reply With Quote #14

Quote:
Originally Posted by vittu View Post
Then just take gohan and rename it.
Forgot this? :p



Quote:
Originally Posted by MuzzMikkel View Post
and with progress bar, could anybody make that for me?
__________________
The Art of War is offline
MuzzMikkel
Member
Join Date: Aug 2010
Location: Denmark
Old 06-10-2011 , 14:25   Re: Goten in shmod 1.2.0.14
Reply With Quote #15

So i tried to make the hero, i renamed my hero from AwpLover to Isyz..
i really tried make the hero possible.

Please take a look at the hero and help me make it possible

PHP Code:
#include <superheromod> 

new gHeroID 
new gHasIsyz[SH_MAXSLOTS+1
new 
bool:gBlockKeyup[SH_MAXSLOTS+1]; 
new 
bool:gUsingPower[SH_MAXSLOTS+1];
new 
bool:gChargeOver[SH_MAXSLOTS+1];
new 
bool:gPowerKeyUsed[SH_MAXSLOTS+1];
new 
gLastWeapon[SH_MAXSLOTS+1];
new 
gPowerID[SH_MAXSLOTS+1];
new const 
gIsyzAwp[] = "models/shmod/Isyz_awp.mdl" 
new const gIsyzDeagle[] = "models/shmod/Isyz_deagle.mdl"  
new const gIsyzPlayer[] = "models/player/Isyz/Isyz.mdl" 
new const gIsyzNade[] = "models/shmod/Isyz_hegrenade.mdl"
new const gPowerClass[] = "Isyz_kamehameha"
new const gSoundCharge[] = "shmod/Isyz_kamehame.wav"
new const gSoundRelease[] = "shmod/Isyz_ha.wav"
new const gSoundBeam[] = "shmod/esf_beamhead.wav"
new const gModelKamehameha[] = "sprites/shmod/Isyz_kamehameha_purple.spr"

static const burn_decal[3] = {282930
static const 
burn_decal_big[3] = {464748

new 
gMsgBarTimegMaxPlayers
new TrailExplosionSmoke
new 
g_cvar_trg_cvar_heg_trail
new gSpriteWhite
new pcvarESPRadiuspcvarBeamRadiuspcvarBrightpcvarCoolDownpcvarMaxDmgpcvarBurnDecals;

public 
plugin_init() 

    
register_plugin("SUPERHERO Isyz""1.1""MuzzMikkel"
    
    new 
pcvarLevel register_cvar("Isyz_level""4");
    new 
pcvarHealth register_cvar("Isyz_health""350"); 
    new 
pcvarArmor register_cvar("Isyz_armor""800");
    new 
pcvarSpeed register_cvar("Isyz_speed""320"); 
    new 
pcvarGrav register_cvar("Isyz_grav""0.7");
    new 
pcvarAwpMult register_cvar("Isyz_awpmult""40.0");
    new 
pcvarDeagleMult register_cvar("Isyz_deaglemult""10.0");
    new 
pcvarNadeMult register_cvar("Isyz_hegrenademult""50.0");
    
pcvarCoolDown register_cvar("Isyz_cooldown""0.5"); 
    
pcvarMaxDmg register_cvar("Isyz_maxdamage""250"); 
    
pcvarESPRadius register_cvar("Isyz_esp_radius""300"); 
    
pcvarBurnDecals register_cvar("Isyz_blast_decals""1"); 
    
pcvarBeamRadius register_cvar("Isyz_beam_radius""500");
    
pcvarBright register_cvar("Isyz_bright""192");
    
pcvarSpeed register_cvar("Isyz_powerspeed""1000");
    
g_cvar_tr register_cvar("Isyz_grenade_tr""2");
    
g_cvar_he register_cvar("Isyz_grenade_he""3413934");
    
    
gHeroID sh_create_hero("Isyz"pcvarLevel
    
sh_set_hero_info(gHeroID"Awp Lover!""Get's a powerfull Awp & deagle & Grenade & Super attack on +power key")

    
sh_set_hero_bind(gHeroID); 
    
    
sh_set_hero_dmgmult(gHeroIDpcvarAwpMultCSW_AWP
    
sh_set_hero_dmgmult(gHeroIDpcvarDeagleMultCSW_DEAGLE
    
sh_set_hero_dmgmult(gHeroIDpcvarNadeMultCSW_HEGRENADE)
    
sh_set_hero_hpap(gHeroIDpcvarHealthpcvarArmor
    
sh_set_hero_speed(gHeroIDpcvarSpeed
    
sh_set_hero_grav(gHeroIDpcvarGrav
        
    
// EVENTS
    
register_event("CurWeapon""weapon_change""be""1=1")
    
register_forward(FM_Think"fm_Think")
    
register_forward(FM_Touch"fm_Touch")

    
gMsgBarTime get_user_msgid("BarTime")
    
gMaxPlayers get_maxplayers()
    
    
// ESP Rings Task
    
set_task(2.0"Isyz_esploop"___"b")
}

public 
sh_hero_init(idheroIDmode

    if ( 
gHeroID != heroID ) return

    
gHasIsyz[id] = mode true false

    
if ( gPowerID[id] > ) {
        
remove_power(idgPowerID[id]) 
        
    switch(
mode
    { 
        case 
SH_HERO_ADD
        { 
            
gHasIsyz[id] = true 
            Isyz_weapons
(id
            
switch_model(id
            
Isyz_morph(id
            
        } 
        
        case 
SH_HERO_DROP
        { 
            
gHasIsyz[id] = false 
            Isyz_unmorph
(id
            if (
is_user_alive(id)) 
            { 
                
sh_drop_weapon(idCSW_AWPtrue
                
sh_drop_weapon(idCSW_DEAGLEtrue
                
            } 
        } 
    } 


public 
sh_hero_key(idheroIDkey

    if ( 
gHeroID != heroID ) return; 

    if ( 
sh_is_freezetime() || !is_user_alive(id) ) return; 
     
    switch(
key
    { 
        case 
SH_KEYDOWN:  
        { 
            if ( 
gPlayerInCooldown[id] )  
            { 
                
sh_sound_deny(id); 
                
gBlockKeyup[id] = true
                    
sh_chat_message(idgHeroID"Not enough KI, you must wait longer")
            return;
        }

        if ( 
gPowerID[id] ) {
            
sh_sound_deny(id)
            
sh_chat_message(idgHeroID"Already using Kamehameha Attack")
            return;
        }

        
gLastWeapon[id] = get_user_weapon(id)

        
engclient_cmd(id"weapon_knife")

        
gUsingPower[id] = true
        gPowerKeyUsed
[id] = true
        gChargeOver
[id] = false

        emit_sound
(idCHAN_STATICgSoundChargeVOL_NORMATTN_NORM0PITCH_NORM)

        
progressBar(id4)
        
set_task(4.0"powerCharged"id)
            } 
             
            
gBlockKeyup[id] = false
             
            
gLastWeapon[id] = get_user_weapon(id); 
         
            
engclient_cmd(id"weapon_knife"); 
         
            
fire_wave(id); 
             
            new 
Float:cooldown get_pcvar_float(pcvarCoolDown); 
            if (
cooldown 0.0sh_set_cooldown(idcooldown); 
        } 
        case 
SH_KEYUP:  
    if ( !
gChargeOver[id] )
    
remove_task(id)

    
emit_sound(idCHAN_STATICgSoundChargeVOL_NORMATTN_NORMSND_STOPPITCH_NORM)

    
progressBar(id0)

    if ( 
gLastWeapon[id] != CSW_KNIFE sh_switch_weapon(idgLastWeapon[id])

            
gUsingPower[id] = false
            gPowerKeyUsed
[id] = false
            
return;
        }
        
        if ( !
is_user_alive(id) || !gHasIsyz[id] || !gPowerKeyUsed[id] ) return

        
emit_sound(idCHAN_STATICgSoundChargeVOL_NORMATTN_NORMSND_STOPPITCH_NORM)

        
emit_sound(idCHAN_STATICgSoundReleaseVOL_NORMATTN_NORM0PITCH_NORM)

        
progressBar(id0)

        
set_user_maxspeed(id1.0)

        
create_power(id)

        
gPowerKeyUsed[id] = false
        

            if ( !
gBlockKeyup[id] ) 
            { 
                if (
gLastWeapon[id] != CSW_KNIFEsh_switch_weapon(idgLastWeapon[id]) 
            }  
        } 
    } 

public 
sh_client_spawn(id

    if (
gHasIsyz[id]) 
    { 
        
Isyz_weapons(id
        
Isyz_morph(id
        
sh_end_cooldown(id);
        
gUsingPower[id] = false
        gPowerKeyUsed
[id] = false
    



public 
weapon_change(id

    
    if ( !
sh_is_active() || !gHasIsyz[id] ) return   
    
    if(
read_data(2) == CSW_AWP || read_data(2) == CSW_DEAGLE || read_data(2) == CSW_HEGRENADE)
    {
        
switch_model(id
            
        if (
read_data(3) == 0
        { 
            
sh_reload_ammo(id1
        } 
    } 
}

public 
plugin_precache() 

    
precache_model(gIsyzAwp)
    
precache_model(gIsyzDeagle)
    
precache_model(gIsyzNade)
    
precache_model(gIsyzPlayer)
    
precache_sound(gSoundCharge)
    
precache_sound(gSoundRelease)
    
precache_sound(gSoundBeam)
    
precache_model(gModelKamehameha)
    
g_trail precache_model("sprites/laserbeam.spr");
    
Trail precache_model("sprites/shmod/Isyz_trail.spr"); 
    
Explosion precache_model("sprites/shmod/Isyz_exp.spr"); 
    
Smoke precache_model("sprites/wall_puff4.spr"); 


Isyz_weapons(id

if (
sh_is_active() && is_user_alive(id) && gHasIsyz[id] ) 

    
sh_give_weapon(idCSW_AWP
    
sh_give_weapon(idCSW_DEAGLE)
    
sh_give_weapon(idCSW_HEGRENADE)



switch_model(id
{
if (!
sh_is_active() || !is_user_alive(id) || !gHasIsyz[id] ) return  


if ( 
get_user_weapon(id) == CSW_AWP)  

    
set_pev(idpev_viewmodel2gIsyzAwp)  


else if ( 
get_user_weapon(id) == CSW_DEAGLE

    
set_pev(idpev_viewmodel2gIsyzDeagle)  
}

else if ( 
get_user_weapon(id) == CSW_HEGRENADE

    
set_pev(idpev_viewmodel2gIsyzNade)  
    }
}

Isyz_morph(id

cs_set_user_model(id"Isyz!"


Isyz_unmorph(id

cs_reset_user_model(id
}  

public 
grenade_throw(idgidwid)
{
    if ( !
gHasIsyz[id] ) return  
    
    new 
gtm get_pcvar_num(g_cvar_tr)
    if(!
gtm) return
    new 
rgb
    
switch(gtm)
    {
        case 
1:
        {
            
random(34)
            
random(139)
            
random(34)
        }
        case 
2:
        {
            new 
nadecolor[10]
            switch(
wid)
            {
                case 
CSW_HEGRENADE:    nade g_cvar_he
            
}
            
get_pcvar_string(nadecolor9)
            new 
str_to_num(color)
            
1000000
            c 
%= 1000000 
            g 
1000
            b 
1000
        
}
        case 
3:
        {
            switch(
get_user_team(id))
            {
                case 
1255
                
case 2255
            
}
        }
    }
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW)
    
write_short(gid)
    
write_short(g_trail)
    
write_byte(10)
    
write_byte(5)
    
write_byte(r)
    
write_byte(g)
    
write_byte(b)
    
write_byte(192)
    
message_end()
}

public 
Isyz_esploop()
{
    if ( !
sh_is_active() ) return

    static 
players[SH_MAXSLOTS], playerCountplayer
    
static idRingringOrigin[3], ij

    
static radiusbrightness
    radius 
get_pcvar_num(pcvarESPRadius)
    
brightness get_pcvar_num(pcvarBright)

    
get_players(playersplayerCount"ah")

    for ( 
0playerCounti++ ) {
        
player players[i]

        if ( !
gHasIsyz[player] ) continue

        for ( 
0playerCountj++ ) {
            
idRing players[j]

            if ( 
idRing == player ) continue

            if ( !
get_user_origin(idRingringOrigin) ) continue

            
message_begin(MSG_ONE_UNRELIABLESVC_TEMPENTITYringOriginplayer)
            
write_byte(TE_BEAMCYLINDER)    // 21
            
write_coord(ringOrigin[0])
            
write_coord(ringOrigin[1])
            
write_coord(ringOrigin[2] + 16)
            
write_coord(ringOrigin[0])
            
write_coord(ringOrigin[1])
            
write_coord(ringOrigin[2] + radius)
            
write_short(gSpriteWhite)
            
write_byte(0)        // startframe
            
write_byte(1)        // framerate
            
write_byte(6)        // life
            
write_byte(8)        // width
            
write_byte(1)        // noise
            
write_byte(25)        // r
            
write_byte(25)        // g
            
write_byte(112)        // b
            
write_byte(brightness)    // brightness
            
write_byte(0)        // speed
            
message_end()
        }
    }
}

public 
powerCharged(id)
{
    
gChargeOver[id] = true
}

progressBar(idseconds)
{
    
message_begin(MSG_ONE_UNRELIABLEgMsgBarTime_id)
    
write_byte(seconds)
    
write_byte(0)
    
message_end()
}

create_power(id)
{
    new 
newEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
    if ( !
newEnt ) {
        
sh_chat_message(idgHeroID"Power Creation Failure")
        return
    }

    
gPowerID[id] = newEnt

    set_pev
(newEntpev_classnamegPowerClass)
    
engfunc(EngFunc_SetModelnewEntgModelKamehameha)
    
engfunc(EngFunc_SetSizenewEnt, {-2.0, -2.0, -2.0}, {2.02.02.0})

    new 
Float:fl_Origin[3], Float:fl_Angles[3], Float:fl_vAngle[3]
    
pev(idpev_originfl_Origin)
    
pev(idpev_anglesfl_Angles)
    
pev(idpev_v_anglefl_vAngle)

    
fl_Origin[2] += 6.0

    engfunc
(EngFunc_SetOriginnewEntfl_Origin)
    
set_pev(newEntpev_anglesfl_Angles)
    
set_pev(newEntpev_v_anglefl_vAngle)

    
set_pev(newEntpev_solidSOLID_BBOX)
    
set_pev(newEntpev_movetypeMOVETYPE_FLY)
    
set_pev(newEntpev_rendermodekRenderTransAdd)
    
set_pev(newEntpev_renderamt255.0)
    
set_pev(newEntpev_scale1.20)
    
set_pev(newEntpev_ownerid)

    new 
Float:fl_Velocity[3], AimVec[3], Float:fl_EndOrigin[3]

    
get_user_origin(idAimVec3)
    
IVecFVec(AimVecfl_EndOrigin)

    
sh_get_velocity(fl_Originfl_EndOriginget_pcvar_float(gPcvarSpeed), fl_Velocity)

    
set_pev(newEntpev_velocityfl_Velocity)

    
emit_sound(newEntCHAN_STATICgSoundBeamVOL_NORMATTN_NORM0PITCH_NORM)

    
// Trail on enity. It's flawed by not being removable, so make it last long.
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW)
    
write_short(newEnt)        // entity:attachment to follow
    
write_short(gSpriteTrail)    // sprite index
    
write_byte(100)            // life in 0.1's
    
write_byte(8)            // line width in 0.1's
    
write_byte(255)            // r,g,b
    
write_byte(255)
    
write_byte(255)
    
write_byte(255)            // brightness
    
message_end()

    new 
Float:gametime
    global_get
(glb_timegametime)
    
set_pev(newEntpev_nextthinkgametime 0.1)
}

public 
fm_Think(ent)
{
    if ( !
pev_valid(ent) ) return FMRES_IGNORED

    
static classname[32]
    
classname[0] = '^0'
    
pev(entpev_classnameclassname31)

    if ( !
equal(classnamegPowerClass) ) return FMRES_IGNORED

    
new id pev(entpev_owner)

    if ( !
is_user_connected(id) ) {
        
fm_Touch(ent0)
        return 
FMRES_IGNORED
    
}

    new 
Float:fl_Origin[3], AimVec[3], Float:fl_EndOrigin[3], Float:fl_Velocity[3], Float:fl_OldVelocity[3]
    new 
avgFactor
    
new Float:speed get_pcvar_float(gPcvarSpeed)

    
get_user_origin(idAimVec3)
    
IVecFVec(AimVecfl_EndOrigin)
    
pev(entpev_originfl_Origin)

    if ( 
speed 1000.0 )
        
avgFactor 6
    
else if ( speed 1500.0 )
        
avgFactor 4
    
else
        
avgFactor 2

    sh_get_velocity
(fl_Originfl_EndOriginspeedfl_Velocity)

    
pev(entpev_velocityfl_OldVelocity)

    new 
oneless avgFactor-1
    fl_Velocity
[0] += fl_OldVelocity[0] * oneless
    fl_Velocity
[1] += fl_OldVelocity[1] * oneless
    fl_Velocity
[2] += fl_OldVelocity[2] * oneless

    fl_Velocity
[0] /= avgFactor
    fl_Velocity
[1] /= avgFactor
    fl_Velocity
[2] /= avgFactor

    set_pev
(entpev_velocityfl_Velocity)

    new 
Float:gametime
    global_get
(glb_timegametime)
    
set_pev(entpev_nextthinkgametime 0.1)

    return 
FMRES_IGNORED
}

public 
fm_Touch(ptrptd)
{
    if ( !
sh_is_active() ) return FMRES_IGNORED
    
if ( !pev_valid(ptr) ) return FMRES_IGNORED

    
static classname[32]
    
classname[0] = '^0'
    
pev(ptrpev_classnameclassname31)

    if ( 
equal(classnamegPowerClass) ) {
        new 
id pev(ptrpev_owner)

        new 
Float:dRatioFloat:distanceBetweendamage
        
new Float:dmgRadius get_pcvar_float(gPcvarRadius)
        new 
maxDamage get_pcvar_num(gPcvarMaxDamage)
        new 
CsTeams:idTeam cs_get_user_team(id)
        new 
FFOn sh_friendlyfire_on()
        new 
Float:vicOrigin[3]
        new 
Float:fl_vExplodeAt[3]

        
pev(ptrpev_originfl_vExplodeAt)

        for ( new 
victim 1victim <= gMaxPlayersvictim++ )
        {
            if ( !
is_user_alive(victim) ) continue
            if ( 
idTeam == cs_get_user_team(victim) && !FFOn && id != victim ) continue

            
pev(victimpev_originvicOrigin)
            
distanceBetween vector_distance(fl_vExplodeAtvicOrigin)

            if ( 
distanceBetween <= dmgRadius )
            {
                
dRatio distanceBetween dmgRadius
                damage 
maxDamage floatround(maxDamage dRatio)

                if (
victim == iddamage floatround(damage 2.0)

                if ( !
damage damage 1    // Incase damage cvar is really low cause something if within the radius 
                
sh_extra_damage(victimiddamage"Kamehameha"_SH_DMG_NORMtrue_fl_vExplodeAt)

                new 
Float:fl_vicVelocity[3]
                
fl_vicVelocity[0] = ((vicOrigin[0] - fl_vExplodeAt[0]) / distanceBetween) * 300.0
                fl_vicVelocity
[1] = ((vicOrigin[1] - fl_vExplodeAt[1]) / distanceBetween) * 300.0
                fl_vicVelocity
[2] = 150.0

                set_pev
(victimpev_velocityfl_vicVelocity)
                
sh_screen_shake(victim1.21.21.2)
            }
        }


        
// Make some Effects
        
new blastSize floatround(dmgRadius 12.0)

        
// Explosion Sprite
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_GLOWSPRITE)    //23
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[0])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[2])
        
write_short(gSpriteExplosion)    // model
        
write_byte(01)            // life 0.x sec
        
write_byte(blastSize)        // size
        
write_byte(255)            // brightness
        
message_end()

        
// Explosion (smoke, sound/effects)
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_EXPLOSION)    //3
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[0])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[2])
        
write_short(gSpriteSmoke)    // model
        
write_byte(blastSize+5)        // scale in 0.1's
        
write_byte(20)            // framerate
        
write_byte(10)            // flags
        
message_end()

        if ( 
get_pcvar_num(gPcvarDecals) ) {
            new 
decal random_num(0,2)
            if (
blastSize 18) {
                
decal += 3
            
}

            
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
            
write_byte(TE_GUNSHOTDECAL)    //109
            
engfunc(EngFunc_WriteCoordfl_vExplodeAt[0])
            
engfunc(EngFunc_WriteCoordfl_vExplodeAt[1])
            
engfunc(EngFunc_WriteCoordfl_vExplodeAt[2])
            
write_short(0)            //?
            
write_byte(gBurnDecal[decal])        //decal
            
message_end()
        }

        
emit_sound(ptrCHAN_STATICgSoundBeamVOL_NORMATTN_NORMSND_STOPPITCH_NORM)
        
emit_sound(idCHAN_STATICgSoundReleaseVOL_NORMATTN_NORMSND_STOPPITCH_NORM)

        
engfunc(EngFunc_RemoveEntityptr)

        new 
Float:cooldown get_pcvar_float(gPcvarCooldown)
        if ( 
cooldown 0.0 sh_set_cooldown(idcooldown)

        
gPowerID[id] = 0
        gUsingPower
[id] = false

        
if ( gLastWeapon[id] != CSW_KNIFE sh_switch_weapon(idgLastWeapon[id])
        else 
sh_reset_max_speed(id)
    }

    return 
FMRES_IGNORED
}

public 
remove_power(idpowerID)
{
    new 
Float:fl_vOrigin[3]

    
pev(powerIDpev_originfl_vOrigin)

    
// Create an effect of kamehameha being removed
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_IMPLOSION)    //14
    
engfunc(EngFunc_WriteCoordfl_vOrigin[0])
    
engfunc(EngFunc_WriteCoordfl_vOrigin[1])
    
engfunc(EngFunc_WriteCoordfl_vOrigin[2])
    
write_byte(120)            // radius
    
write_byte(40)            // count
    
write_byte(45)            // life in 0.1's
    
message_end()

    
gPowerID[id] = 0
    gUsingPower
[id] = false

    emit_sound
(powerIDCHAN_STATICgSoundBeamVOL_NORMATTN_NORMSND_STOPPITCH_NORM)
    
emit_sound(idCHAN_STATICgSoundReleaseVOL_NORMATTN_NORMSND_STOPPITCH_NORM)

    
engfunc(EngFunc_RemoveEntitypowerID)

    if ( 
is_user_connected(id) ) {
        if ( 
gLastWeapon[id] != CSW_KNIFE sh_switch_weapon(idgLastWeapon[id])
        else 
sh_reset_max_speed(id)
    }
}

public 
sh_round_end()
{
    for ( new 
id 1id <= gMaxPlayersid++ ) {
        if ( 
gHasIsyz[id] && gPowerID[id] > ) {
            
remove_power(idgPowerID[id])
        }
    }
}

public 
client_disconnect(id)
{
    if( 
gHasIsyz[id] && gPowerID[id] > 0) {
        
remove_power(idgPowerID[id])
    }

MuzzMikkel is offline
Send a message via MSN to MuzzMikkel
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 06-10-2011 , 14:44   Re: Goten in shmod 1.2.0.14
Reply With Quote #16

What is the problem.....


And well, I wont even look at it then, why are you combining like

1. A player model

2. A weapon viewmodel for AWP

3. Another weapon viewmodel for Deagle, all with stuff???!

4. A keydown attack?!

Total: Two weapons, a player model, and a keydown, all in the same hero. Man you need to get real, that thing will just be totally overpowered..
__________________
The Art of War is offline
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 06-10-2011 , 15:14   Re: Goten in shmod 1.2.0.14
Reply With Quote #17

Quote:
Originally Posted by The Art of War View Post
Man you need to get real, that thing will just be totally overpowered..
agree with you art. the reason why i think theese are noob heroes is beacuse there to overpowerd and there not a good way to script heroes... its basiclly rips and borrowed code and not much to learn from unless you understand what the code actually does and what you can learn from it....
i promise you no one like theese kind of heroes cause there not balanced at all.

i recommend you stop making theese kind of heroes and actually try to learn something usefull..... if you really want to learn scripting read tutorials approved plugins and help threads for good explanations.

now imma go get my self a lemonade who's coming with meh?

Last edited by RollerBlades; 06-10-2011 at 15:17.
RollerBlades is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 06-10-2011 , 19:30   Re: Goten in shmod 1.2.0.14
Reply With Quote #18

Lending code is a good way to shorten down the time to create a large and complex hero. However this wasnt complex at all untill he made it complex....

The point of having different heroes is for people to have to choose more than 1 hero for 4 things so they cant choose every damn good hero in a server, unless you've set max level to 3 I guess...

But yes, if you want to actually learn something, its good to completely code something from scratch, may it be an extremely simple HP/AP/DMG code. Its good training for everyone.
__________________
The Art of War is offline
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 06-11-2011 , 05:10   Re: Goten in shmod 1.2.0.14
Reply With Quote #19

i think he should forget about HP/AP/DMG mult heroes cause there not much to learn from....... i think that rest of the code like adding an progress bar to kamehameha would be something good though heroes with HP/AP/DMG/SPEED/GRAV can be easily generated by Jelle's tutorial and that tut i usefull enough to manually generate a simple hero and there's not much to learn from making them over and over again and just making the hero more complex and the code too long... so yea he can combine them but it should be added at the end... first you fix the progress bar and then put the Health,Armor or whatever as a finish.. cause it just makes the code to long... and its bothersome to read useless code while trying to find the problem

Last edited by RollerBlades; 06-11-2011 at 05:18.
RollerBlades is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 06-11-2011 , 08:36   Re: Goten in shmod 1.2.0.14
Reply With Quote #20

Quote:
Originally Posted by RollerBlades View Post
i think he should forget about HP/AP/DMG mult heroes cause there not much to learn from....... i think that rest of the code like adding an progress bar to kamehameha would be something good though heroes with HP/AP/DMG/SPEED/GRAV can be easily generated by Jelle's tutorial and that tut i usefull enough to manually generate a simple hero and there's not much to learn from making them over and over again and just making the hero more complex and the code too long... so yea he can combine them but it should be added at the end... first you fix the progress bar and then put the Health,Armor or whatever as a finish.. cause it just makes the code to long... and its bothersome to read useless code while trying to find the problem
1. Heroes like that are abominations, in my opinion they must be split, but yeh, its his hero, but he cant really expect any help from me now.

2. Well, he obviously doesnt know how to add a progress bar... He should learn the basics first, and a great way of doing that is looking at Jelle's tutorial and actually make working heroes on his own.

This one is great, I myself have been told to read it, yes it looks boring but if you read it and actually understand atleast some of it, it all becomes very clear.

http://wiki.alliedmods.net/Pawn_Tutorial
__________________
The Art of War is offline
Reply


Thread Tools
Display Modes

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 04:17.


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