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

Goten in shmod 1.2.0.14


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MuzzMikkel
Member
Join Date: Aug 2010
Location: Denmark
Old 06-06-2011 , 02:27   Goten in shmod 1.2.0.14
Reply With Quote #1

Could anybody be nice to code Goten in shmod version 1.2?
MuzzMikkel is offline
Send a message via MSN to MuzzMikkel
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 06-06-2011 , 06:52   Re: Goten in shmod 1.2.0.14
Reply With Quote #2

Use my tutorial to do it.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
MuzzMikkel
Member
Join Date: Aug 2010
Location: Denmark
Old 06-06-2011 , 08:03   Re: Goten in shmod 1.2.0.14
Reply With Quote #3

Quote:
Originally Posted by Jelle View Post
Use my tutorial to do it.
I have tried makeing Goten with your tutorial, but i really sucks at it..
Here's my attempt at codeing Goten, but i'm still getting some errors ;(

PHP Code:
#include <superheromod>

new gHeroID
new bool:gHasGotenPower[SH_MAXSLOTS+1]
new 
bool:gBlockKeyup[SH_MAXSLOTS+1]
new 
gLastWeapon[SH_MAXSLOTS+1]
new 
BeamExplosionSmoke
static const burn_decal[3] = {282930}
static const 
burn_decal_big[3] = {464748}

new 
pcvarHealthpcvarArmorpcvarCoolpcvarDmgpcvarRadiuspcvarBurnDecals

public plugin_init()
{
    
register_plugin("SUPERHERO Goten""1.3""MuzzMikkel")
    
    new 
pcvarLevel register_cvar("goten_level""6")
    
pcvarHealth register_cvar("goten_health""400")
    
pcvarArmor register_cvar("goten_armor""100")
    
pcvarCool register_cvar("goten_cooldown""30")
    
pcvarDmg register_cvar("goten_damage""75")
    
pcvarRadius register_cvar("goten_radius""100")
    
pcvarBurnDecals register_cvar("goten_burn_decals""1")
    
    
gHeroID sh_create_hero("Goten"pcvarLevel)
    
sh_set_hero_info(gHeroID"Kamekameha!""Fire Goten's Kamehameha Wave on Keydown.")
    
    
sh_set_hero_bind(gHeroID)
}

public 
plugin_precache()
{
    
Beam precache_model("sprites/shmod/test_trail.spr")
    
Explosion precache_model("sprites/shmod/test_exp.spr")
    
Smoke precache_model("sprites/wall_puff4.spr")
}

public 
sh_hero_init(idheroIDmode)
{
    if ( 
gHeroID != heroID ) return
    
    switch(
mode)
    {
        case 
SH_HERO_ADD:
        {
            
gHasGotenPower[id] = true
        
}
        
        case 
SH_HERO_DROP:
        {
            
gHasGotenPower[id] = false
        
}
    }
}

public 
sh_hero_key(idheroIDkey)  
{  
    
    if (
gHeroID != heroID || gPlayerInCooldown[id] || !is_user_alive(id)) return  
    
    switch(
key)
    {
        case 
SH_KEYDOWN:
        {
            if ( !
hasRoundStarted() ) return
                        
            if ( !
is_user_alive(id) || !gHasGotenPower[id] ) return
            
            if ( 
gPlayerUltimateUsed[id] ) {
                
playSoundDenySelect(id)
                
gBlockKeyup[id] = true
                
return
            }
            
            
gBlockKeyup[id] = false
            
            
new clipammoweaponID get_user_weapon(idclipammo)
            
gLastWeapon[id] = weaponID
            
            engclient_cmd
(id"weapon_knife")
        {
            
fire_attack(id)
            
            if (
get_cvar_float("goten_cooldown") > 0.0ultimateTimer(idget_cvar_float("goten_cooldown"))
        }
        
        case 
SH_KEYUP:{
            if ( !
hasRoundStarted() ) return
        {            
            if ( !
is_user_alive(id) || !gHasGotenPower[id] || gBlockKeyup[id] ) return
        {    
            if (
gLastWeapon[id] != CSW_KNIFEshSwitchWeaponID(idgLastWeapon[id])
        }
    }
}
}
}
}

public 
fire_attack(id)  
{   
new 
tidtbodydamage  

damage 
get_pcvar_num(pCvarDmg)   

get_user_aiming(idtidtbody)

new 
aimvec[3]
new 
FFOn get_cvar_num("mp_friendlyfire")

new 
Float:dRatiodamagedistanceBetween
new damradius get_cvar_num("goten_radius")
new 
maxdamage get_cvar_num("goten_maxdamage")

if( !
is_user_alive(id) ) return

get_user_origin(idaimvec3)
beam_effects(idaimvecdamradius)

for(new 
vic 1vic <= SH_MAXSLOTSvic++)
{
    if ( 
is_user_alive(vic) && ( get_user_team(id) != get_user_team(vic) || FFOn || vic == id ) ) {
    
    new 
origin[3]
    
get_user_origin(vicorigin)
    
distanceBetween get_distance(aimvecorigin)
    
    if ( 
distanceBetween damradius 
    {
        
dRatio float(distanceBetween) / float(damradius)
        
damage maxdamage floatround(maxdamage dRatio)
        
        if (
vic == iddamage floatround(damage 2.0)
        
        
shExtraDamage(viciddamage"Kamehameha")    
        
        
attack_effects(id)
        
        
        if ( 
is_user_alive(tid) && (cs_get_user_team(id) != cs_get_user_team(tid) || sh_friendlyfire_on()) )  
        {  
            
sh_extra_damage(tididdamage"Goten")  
        }
    }
}
}
}

public 
attack_effects(idaimvec[3], damradius)
{
    new 
aimvec[3]  
    
get_user_origin(idaimvec3

    new 
origin[3]
    
get_user_origin(idorigin1)

    new 
decal_idbeamWidth

    
new blastSize floatround(damradius 12.0)

    if (
blastSize <= 18) {
    
decal_id burn_decal[random_num(02)]
    
beamWidth 50
}
else if {
    
decal_id burn_decal_big[random_num(02)]
    
beamWidth 75
}

// Beam effect between two points
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
write_byte(TE_BEAMPOINTS)    // 0
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2])
write_coord(aimvec[0])
write_coord(aimvec[1])
write_coord(aimvec[2])
write_short(Beam)
write_byte(1)        // framestart
write_byte(5)        // framerate
write_byte(2)        // life
write_byte(40)        // width
write_byte(0)        // noise
write_byte(255)        // r, g, b
write_byte(250)        // r, g, b
write_byte(250)        // r, g, b
write_byte(200)        // brightness
write_byte(200)        // speed
message_end()

//Glow Sprite (explosion)
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
write_byte(TE_GLOWSPRITE)    //23
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()

if ( 
get_pcvar_num(pCvarBurnDecals) )
{
    
// decal and ricochet sound
    
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)        // I have no idea what thats supposed to be
    
write_byte(decal_id)    //decal
    
message_end()

}

Code:
<87> : error 014: invaild statement; not in switch
<87> : warning 215: expression has no effect
<87> : error 001: expected token: ";" but found ":"
<87> : error 029: invaild expression, assumed zero
Line 87 is the SH_KEYUP:

PHP Code:
case SH_KEYUP:{
            if ( !
hasRoundStarted() ) return
        {            
            if ( !
is_user_alive(id) || !gHasGotenPower[id] || gBlockKeyup[id] ) return
        {    
            if (
gLastWeapon[id] != CSW_KNIFEshSwitchWeaponID(idgLastWeapon[id])
        }
    }
}
}
}


Last edited by MuzzMikkel; 06-06-2011 at 08:21.
MuzzMikkel is offline
Send a message via MSN to MuzzMikkel
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 06-06-2011 , 10:10   Re: Goten in shmod 1.2.0.14
Reply With Quote #4

1. INDENTATION FFS
2. Make it the same way in SH_KEYUP as in SH_KEYDOWN, indentation-wise.
3. Indent your code properly, else it is very difficult to see if you are missing an opening or closing brace. INDENT, INDENT, INDENT. Always make proper indentation.

Now, next time you post a code without proper indentation I wont even look at it. For me it is totally impossible to read.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 06-06-2011 , 11:01   Re: Goten in shmod 1.2.0.14
Reply With Quote #5

lol, he didn't close SH_KEYDOWN before SH_KEYUP
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
MuzzMikkel
Member
Join Date: Aug 2010
Location: Denmark
Old 06-06-2011 , 12:41   Re: Goten in shmod 1.2.0.14
Reply With Quote #6

Quote:
Originally Posted by DarkGod View Post
lol, he didn't close SH_KEYDOWN before SH_KEYUP
Quote:
Originally Posted by Jelle View Post
1. INDENTATION FFS
2. Make it the same way in SH_KEYUP as in SH_KEYDOWN, indentation-wise.
3. Indent your code properly, else it is very difficult to see if you are missing an opening or closing brace. INDENT, INDENT, INDENT. Always make proper indentation.

Now, next time you post a code without proper indentation I wont even look at it. For me it is totally impossible to read.
I used the Identation button under = tools > identer
It is still not working..

Please one of you fix the code im really really really confused ;(

NEED HELP!

Last edited by MuzzMikkel; 06-06-2011 at 14:27.
MuzzMikkel is offline
Send a message via MSN to MuzzMikkel
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 06-06-2011 , 14:35   Re: Goten in shmod 1.2.0.14
Reply With Quote #7

PHP Code:
//GOTEN! - from Dragonball Z/GT. 2nd son of Gohan, he mispronounces Kamehameha as Kamekameha.

/* CVARS - copy and paste to shconfig.cfg

//Goten
goten_level 6
goten_health 400            //Default HP 400
goten_armor 100            //Default AP 100
goten_cooldown 30            //Cooldown timer between shots in seconds
goten_maxdamage 75            //Max Damage from blast
goten_radius 100            //Radius of blast
goten_blast_decals 1         //Show the burn decals on the walls

*/

/*
* v1.4 - Random1 - 6/6/11
*      - Converted to 1.2.0+ superhero api
*
* v1.3 - vittu - 6/19/05
*      - Minor code clean up.
*      - Renamed extra sprites for future use in other heroes.
*
* v1.2 - vittu - 3/5/05
*      - removed 2 lines of unused code, left over from testing
*      - fixed bug that caused weapon change on key up when in
*         cooldown if different weapon in hand then one during power use
*
* v1.1 - vittu - 2/23/05
*      - removed unused and useless code, and an overall clean up
*      - made user switch to knife so they cannot shoot while using power
*      - changed damage radius calculation to get proper damage
*      - changed damage taken by self to be reduced to half the ammout
*      - overall improvement to effects, new sprites added
*      - added other small checks
*
*   Extra sprites used from Earth's Special Forces a HL mod - http://www.esforces.com/
*/

#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();
    }
}
//---------------------------------------------------------------------------------------------- 
__________________
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 06-06-2011 , 15:19   Re: Goten in shmod 1.2.0.14
Reply With Quote #8

Quote:
Originally Posted by MuzzMikkel View Post
I used the Identation button under = tools > identer
It is still not working..

Please one of you fix the code im really really really confused ;(

NEED HELP!
The auto indenter does not always work. You need to indent your code WHILE writing it.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
MuzzMikkel
Member
Join Date: Aug 2010
Location: Denmark
Old 06-06-2011 , 16:17   Re: Goten in shmod 1.2.0.14
Reply With Quote #9

Thank you G-Dog ;)

--------------------------------------------------------------------------------------

So i added Goten (with other sprites), in a massive hero ;)
but the keydown is not working like my last hero.
it dosen't show the keydown, like it does here:



Sma code here:

PHP Code:
#include <superheromod> 

new gHeroID 
new gHasAwpLover[SH_MAXSLOTS+1
new 
bool:gBlockKeyup[SH_MAXSLOTS+1]; 
new 
gLastWeapon[SH_MAXSLOTS+1]; 
new const 
gAwpLoverAwp[] = "models/shmod/AwpLover_awp.mdl" 
new const gAwpLoverDeagle[] = "models/shmod/AwpLover_deagle.mdl"  
new const gAwpLoverPlayer[] = "models/player/AwpLover/AwpLover.mdl" 
new const gAwpLoverNade[] = "models/shmod/AwpLover_hegrenade.mdl"

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

new 
BeamExplosionSmoke
new 
g_cvar_trg_cvar_heg_trail
new gSpriteWhite
new pcvarRadiuspcvarRadius2pcvarBrightpcvarCoolDownpcvarMaxDmgpcvarBurnDecals;

public 
plugin_init() 

    
register_plugin("SUPERHERO AwpLover""1.1""MuzzMikkel"
    
    new 
pcvarLevel register_cvar("AwpLover_level""4"
    new 
pcvarHealth register_cvar("AwpLover_health""350"
    new 
pcvarArmor register_cvar("AwpLover_armor""800"
    new 
pcvarSpeed register_cvar("AwpLover_speed""320"
    new 
pcvarGrav register_cvar("AwpLover_grav""0.7"
    new 
pcvarAwpMult register_cvar("AwpLover_awpmult""40.0"
    new 
pcvarDeagleMult register_cvar("AwpLover_deaglemult""10.0")
    new 
pcvarNadeMult register_cvar("AwpLover_hegrenademult""50.0")
    
pcvarCoolDown register_cvar("AwpLover_cooldown""0.5"); 
    
pcvarMaxDmg register_cvar("AwpLover_maxdamage""250"); 
    
pcvarRadius register_cvar("AwpLover_radius""300"); 
    
pcvarBurnDecals register_cvar("AwpLover_blast_decals""1"); 
    
pcvarRadius2 register_cvar("AwpLover_radius2""500")
    
pcvarBright register_cvar("AwpLover_bright""192")
    
g_cvar_tr register_cvar("AwpLover_grenade_tr""2")
    
g_cvar_he register_cvar("AwpLover_grenade_he""3413934")
    
    
gHeroID sh_create_hero("AwpLover"pcvarLevel
    
sh_set_hero_info(gHeroID"Awp Lover!""Get's a powerfull Awp & deagle & Grenade & Super attack on +power key"
    
    
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
    
    
register_event("CurWeapon""weapon_change""be""1=1")
    
    
// ESP Rings Task
    
set_task(2.0"awplover_esploop"___"b")
}

public 
sh_hero_init(idheroIDmode

    if ( 
gHeroID != heroID ) return 
    
    switch(
mode
    { 
        case 
SH_HERO_ADD
        { 
            
gHasAwpLover[id] = true 
            AwpLover_weapons
(id
            
switch_model(id
            
AwpLover_morph(id
            
        } 
        
        case 
SH_HERO_DROP
        { 
            
gHasAwpLover[id] = false 
            AwpLover_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
                return; 
            } 
             
            
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 ( !
gBlockKeyup[id] ) 
            { 
                if (
gLastWeapon[id] != CSW_KNIFEsh_switch_weapon(idgLastWeapon[id]) 
            }  
        } 
    } 


public 
sh_client_spawn(id

    if (
gHasAwpLover[id]) 
    { 
        
AwpLover_weapons(id
        
AwpLover_morph(id
        
sh_end_cooldown(id);
    } 


public 
weapon_change(id

    
    if ( !
sh_is_active() || !gHasAwpLover[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(gAwpLoverAwp)
    
precache_model(gAwpLoverDeagle)
    
precache_model(gAwpLoverNade)
    
precache_model(gAwpLoverPlayer)
    
g_trail precache_model("sprites/laserbeam.spr")
    
gSpriteWhite precache_model("sprites/white.spr")
    
Beam precache_model("sprites/shmod/AwpLover_trail.spr"); 
    
Explosion precache_model("sprites/shmod/AwpLover_exp.spr"); 
    
Smoke precache_model("sprites/wall_puff4.spr"); 


AwpLover_weapons(id

if (
sh_is_active() && is_user_alive(id) && gHasAwpLover[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) || !gHasAwpLover[id] ) return  


if ( 
get_user_weapon(id) == CSW_AWP)  

    
set_pev(idpev_viewmodel2gAwpLoverAwp)  


else if ( 
get_user_weapon(id) == CSW_DEAGLE

    
set_pev(idpev_viewmodel2gAwpLoverDeagle)  
}

else if ( 
get_user_weapon(id) == CSW_HEGRENADE

    
set_pev(idpev_viewmodel2gAwpLoverNade)  
    }
}

AwpLover_morph(id

cs_set_user_model(id"AwpLover!"


AwpLover_unmorph(id

cs_reset_user_model(id
}  

public 
grenade_throw(idgidwid)
{
    if ( !
gHasAwpLover[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 
awplover_esploop()
{
    if ( !
sh_is_active() ) return

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

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

    
get_players(playersplayerCount"ah")

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

        if ( !
gHasAwpLover[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()
        }
    }
}

fire_wave(id

    new 
aimvec[3]; 
    new 
Float:dRatiodamagedistanceBetween
    new 
damradius get_pcvar_num(pcvarRadius2); 
    new 
maxdamage get_pcvar_num(pcvarMaxDmg); 

    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();         
    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); 

                if (
vic == iddamage /= 2
                 
                
sh_extra_damage(viciddamage"Kamehameha"); 
            } 
        } 
    } 


beam_effects(idaimvec[3], damradius

    new 
decal_idbeamWidth

    new 
blastSize floatround(damradius 12.0); 

    
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(pcvarBurnDecals) )  
    { 
        
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(); 
    } 


Last edited by MuzzMikkel; 06-06-2011 at 17:03.
MuzzMikkel is offline
Send a message via MSN to MuzzMikkel
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 06-06-2011 , 18:14   Re: Goten in shmod 1.2.0.14
Reply With Quote #10

PHP Code:
sh_set_hero_bind(gHeroID); 
__________________
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
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 11:40.


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