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

Batgirl (sharky)


Post New Thread Reply   
 
Thread Tools Display Modes
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 04-08-2010 , 17:10   Re: Batgirl (sharky)
Reply With Quote #61

Update your amxx since you probably used the auto installer for SH mod.

Heroes you download here can no longer be used with that version. You need to update your server manually. Also check if you have amxx 1.8.1, if not, update the whole thing.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
guro1214
Junior Member
Join Date: Apr 2010
Old 04-08-2010 , 17:18   Re: Batgirl (sharky)
Reply With Quote #62

So give me a link to the version of amxx and SH need. Thank you
guro1214 is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 04-08-2010 , 17:26   Re: Batgirl (sharky)
Reply With Quote #63

www.amxmodx.org
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
rodrigo
Senior Member
Join Date: Jul 2010
Location: Brasil
Old 02-12-2011 , 19:51   Re: Batgirl (sharky)
Reply With Quote #64

If anyone want, I edited the hero to hook don't work when the player have the bomb in his hand, very useful to who don't like bomb's out of bomber zone.
Attached Files
File Type: sma Get Plugin or Get Source (sh_batgirl.sma - 398 views - 11.9 KB)
__________________
rodrigo is offline
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 02-12-2011 , 20:05   Re: Batgirl (sharky)
Reply With Quote #65

I made the hero not work at all, incase people don't want people to use the hero but they still want to have the hero in the serv.. - oh wait.

Anyways, here it is.

PHP Code:
//Batgirl - Based off of Spiderman

/* CVARS - copy and paste to shconfig.cfg

//Batgirl
batgirl_level 9
batgirl_moveacc 650        //How quickly she can move while on the zipline
batgirl_reelspeed 1000        //How fast hook line reels in
batgirl_hookstyle 3        //1=spacedude, 2=spacedude auto reel (spiderman), 3=cheap kids real    (batgirl)
batgirl_hooksky 0        //0=no sky hooking 1=sky hooking allowed
batgirl_teamcolored 1        //1=teamcolored zip lines 0=white zip lines
batgirl_maxhooks -1        //Max ammout of hooks allowed (-1 is an unlimited ammount)

*/

#include <amxmodx>
#include <fakemeta>
#include <superheromod>

// GLOBAL VARIABLES
#define HOOKBEAMLIFE  100
#define HOOK_DELTA_T  0.1  // units per second

new gHeroName[]="Batgirl"
new bool:gHasBatgirl[SH_MAXSLOTS+1]
new 
gHookLocation[SH_MAXSLOTS+1][3]
new 
gHookLength[SH_MAXSLOTS+1]
new 
bool:gHooked[SH_MAXSLOTS+1]
new 
Float:gHookCreated[SH_MAXSLOTS+1]
new 
gHooksLeft[SH_MAXSLOTS+1]
new 
gSpriteHookLine
new const gSoundHook[] = "weapons/xbow_hit2.wav"
new gPcvarMoveAccgPcvarReelSpeedgPcvarHookStylegPcvarHookSky
new gPcvarTeamColoredgPcvarMaxHooksgPcvarSvGravity
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    
// Plugin Info
    
register_plugin("SUPERHERO Batgirl""1.2""sharky/JTP10181")

    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    
register_cvar("batgirl_level""9")
    
gPcvarMoveAcc register_cvar("batgirl_moveacc""650")
    
gPcvarReelSpeed register_cvar("batgirl_reelspeed""1000")
    
gPcvarHookStyle register_cvar("batgirl_hookstyle""3")
    
gPcvarHookSky register_cvar("batgirl_hooksky""0")
    
gPcvarTeamColored register_cvar("batgirl_teamcolored""1")
    
gPcvarMaxHooks register_cvar("batgirl_maxhooks""-1")

    
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
    
shCreateHero(gHeroName"Bat-Grappling Hook""Grappling Hook - You now have the Bat-Grapple Hook. Shoot your Hook and automatically be ziplined to the target"true"batgirl_level")

    
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
    // INIT
    
register_srvcmd("batgirl_init""batgirl_init")
    
shRegHeroInit(gHeroName"batgirl_init")

    
// KEY UP
    
register_srvcmd("batgirl_ku""batgirl_ku")
    
shRegKeyUp(gHeroName"batgirl_ku")

    
// KEY DOWN
    
register_srvcmd("batgirl_kd""batgirl_kd")

    
// DEATH
    
register_event("DeathMsg""batgirl_death""a")  // Re-uses KeyUp!

    // Reset the HookCounts every round (regardless of batgirlpower)
    
register_event("ResetHUD""new_spawn""b")

    
gPcvarSvGravity get_cvar_pointer("sv_gravity")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
    
precache_sound(gSoundHook)
    
gSpriteHookLine precache_model("sprites/zbeam4.spr")
}
//----------------------------------------------------------------------------------------------
public batgirl_init()
{
    new 
temp[6]
    
// First Argument is an id
    
read_argv(1temp5)
    new 
id str_to_num(temp)

    
// 2nd Argument is 0 or 1 depending on whether the id has the hero
    
read_argv(2temp5)
    new 
hasPowers str_to_num(temp)

    
gHasBatgirl[id] = (hasPowers != 0)
    if ( 
gHooked[id] ) batgirl_hook_off(id)
}
//----------------------------------------------------------------------------------------------
public new_spawn(id)
{
    
gHooksLeft[id] = get_pcvar_num(gPcvarMaxHooks)

    if ( 
gHooked[id] ) batgirl_hook_off(id)
}
//----------------------------------------------------------------------------------------------
public batgirl_kd()
{
    new 
temp[6]
    
read_argv(1temp5)
    new 
id str_to_num(temp)

    if ( 
gHooked[id] || !is_user_alive(id) || gHasBatgirl[id] || !hasRoundStarted() ) return

    if ( 
pass_aim_test(id) )
    {
        new 
hooksleft gHooksLeft[id]

        if ( 
hooksleft == ) {
            
playSoundDenySelect(id)
            return
        }

        if ( 
hooksleft gHooksLeft[id] = --hooksleft

        
if ( -hooksleft ) {
            
client_print(idprint_center"You have %d bat-grapple hook%s left"hookslefthooksleft == "" "s")
        }

        
gHooked[id] = true

        set_user_info
(id"ROPE""1")

        new 
parm[2], user_origin[3]
        
parm[0] = id

        get_user_origin
(iduser_origin)
        
get_user_origin(idgHookLocation[id], 3)

        
gHookLength[id] = get_distance(gHookLocation[id], user_origin)

        
set_user_gravity(id0.001)

        
beamentpoint(id)

        
emit_sound(idCHAN_STATICgSoundHookVOL_NORMATTN_NORM0PITCH_NORM)

        
parm[1] = get_pcvar_num(gPcvarHookStyle)

        
set_task(HOOK_DELTA_T"batgirl_check_web"idparm2"b")
    }
}
//----------------------------------------------------------------------------------------------
bool:pass_aim_test(id)
{
    if ( 
gHasBatgirl ) return
    
// Can hook sky ignore test
    
if ( get_pcvar_num(gPcvarHookSky) ) return true

    
new origin[3], Float:Orig[3]
    
get_user_origin(idorigin3)
    
IVecFVec(originOrig)

    if ( 
engfunc(EngFunc_PointContentsOrig) == CONTENTS_SKY )
    {
        
client_print(idprint_chat"[SH](%s) You cannot hook to the sky"gHeroName)
        return 
false
    
}

    return 
true
}
//----------------------------------------------------------------------------------------------
public batgirl_ku()
{
    new 
temp[6]
    
read_argv(1temp5)
    new 
id str_to_num(temp)

    if ( 
gHooked[id] ) batgirl_hook_off(id)
}
//----------------------------------------------------------------------------------------------
public batgirl_check_web(parm[])
{
    new 
id parm[0]

    
// hookstyle = parm[1]
    
switch(parm[1])
    {
        case 
1batgirl_physics(idfalse)
        case 
2batgirl_physics(idtrue)
        default: 
batgirl_cheap_reel(id)
    }
}
//----------------------------------------------------------------------------------------------
batgirl_physics(idbool:autoReel)
{
    if ( 
gHasBatgirl ) return
    if ( !
gHooked[id]  ) return

    if ( !
is_user_alive(id) ) {
        
batgirl_hook_off(id)
        return
    }

    
// Refresh the beam effect
    
if ( gHookCreated[id] + HOOKBEAMLIFE/10 <= get_gametime() ) {
        
beamentpoint(id)
    }

    new 
user_origin[3], null[3], A[3], D[3], buttonadjust[3], buttonpress
    
new Float:vTowards_AFloat:DvTowards_AFloat:velocity[3]

    
get_user_origin(iduser_origin)

    
pev(idpev_velocityvelocity)

    
buttonpress pev(idpev_button)

    if ( 
buttonpress IN_FORWARD ) ++buttonadjust[0]
    if ( 
buttonpress IN_BACK ) --buttonadjust[0]

    if ( 
buttonpress IN_MOVERIGHT ) ++buttonadjust[1]
    if ( 
buttonpress IN_MOVELEFT ) --buttonadjust[1]

    if ( 
buttonpress IN_JUMP ) ++buttonadjust[2]
    if ( 
buttonpress IN_DUCK ) --buttonadjust[2]

    if ( 
buttonadjust[0] || buttonadjust[1] ) {
        new 
user_look[3], move_direction[3]
        
get_user_origin(iduser_look2)
        
user_look[0] -= user_origin[0]
        
user_look[1] -= user_origin[1]

        
move_direction[0] = buttonadjust[0]*user_look[0] + user_look[1]*buttonadjust[1]
        
move_direction[1] = buttonadjust[0]*user_look[1] - user_look[0]*buttonadjust[1]
        
move_direction[2] = 0

        
new move_dist get_distance(nullmove_direction)
        new 
Float:accel get_pcvar_float(gPcvarMoveAcc) * HOOK_DELTA_T

        velocity
[0] += move_direction[0] * accel move_dist
        velocity
[1] += move_direction[1] * accel move_dist
    
}

    if ( 
buttonadjust[2] < || (buttonadjust[2] && gHookLength[id] >= 60) ) {
        
gHookLength[id] -= floatround(buttonadjust[2] * get_pcvar_float(gPcvarReelSpeed) * HOOK_DELTA_T)
    }
    else if ( 
autoReel && !(buttonpress&IN_DUCK) && gHookLength[id] >= 200 ) {
        ++
buttonadjust[2]
        
gHookLength[id] -= floatround(buttonadjust[2] * get_pcvar_float(gPcvarReelSpeed) * HOOK_DELTA_T)
    }

    
A[0] = gHookLocation[id][0] - user_origin[0]
    
A[1] = gHookLocation[id][1] - user_origin[1]
    
A[2] = gHookLocation[id][2] - user_origin[2]

    new 
distA get_distance(nullA)
    
distA = (distA distA 1)    // Avoid dividing by 0

    
vTowards_A = (velocity[0] * A[0] + velocity[1] * A[1] + velocity[2] * A[2]) / distA
    DvTowards_A 
float((get_distance(user_origingHookLocation[id]) - gHookLength[id]) * 4)

    
D[0] = A[0]*A[2] / distA
    D
[1] = A[1]*A[2] / distA
    D
[2] = -(A[1]*A[1] + A[0]*A[0]) / distA

    
new distD get_distance(nullD)
    if ( 
distD 10 ) {
        new 
Float:acceleration = ((-get_pcvar_num(gPcvarSvGravity)) * D[2] / distD) * HOOK_DELTA_T
        velocity
[0] += (acceleration D[0]) / distD
        velocity
[1] += (acceleration D[1]) / distD
        velocity
[2] += (acceleration D[2]) / distD
    
}

    new 
Float:difference DvTowards_A vTowards_A

    velocity
[0] += (difference A[0]) / distA
    velocity
[1] += (difference A[1]) / distA
    velocity
[2] += (difference A[2]) / distA

    set_pev
(idpev_velocityvelocity)
}
//----------------------------------------------------------------------------------------------
batgirl_cheap_reel(id)
{
    if ( 
gHasBatgirl ) return
    
// Cheat Web - just drags you where you shoot it...
    
if ( !gHooked[id] ) return

    if ( !
is_user_alive(id) )
    {
        
batgirl_hook_off(id)
        return
    }

    new 
user_origin[3]
    new 
Float:velocity[3]

    
get_user_origin(iduser_origin)

    new 
distance get_distance(gHookLocation[id], user_origin)

    if ( 
distance 60 )
    {
        new 
Float:inverseTime get_pcvar_float(gPcvarReelSpeed) / distance
        velocity
[0] = (gHookLocation[id][0] - user_origin[0]) * inverseTime
        velocity
[1] = (gHookLocation[id][1] - user_origin[1]) * inverseTime
        velocity
[2] = (gHookLocation[id][2] - user_origin[2]) * inverseTime
    
}

    
set_pev(idpev_velocityvelocity)
}
//----------------------------------------------------------------------------------------------
batgirl_hook_off(id)
{
    
gHooked[id] = false

    set_user_info
(id"ROPE""0")

    
killbeam(id)

    if ( 
is_user_connected(id) ) shSetGravityPower(id)

    
remove_task(id)
}
//----------------------------------------------------------------------------------------------
beamentpoint(id)
{
    if ( 
gHasBatgirl ) return
    if ( !
is_user_connected(id) ) return

    new 
rgb[3] = {250250250}

    if ( 
get_pcvar_num(gPcvarTeamColored) )
    {
        switch(
cs_get_user_team(id))
        {
            case 
CS_TEAM_Trgb = {25500}
            case 
CS_TEAM_CTrgb = {00255}
        }
    }

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMENTPOINT)
    
write_short(id)
    
write_coord(gHookLocation[id][0])
    
write_coord(gHookLocation[id][1])
    
write_coord(gHookLocation[id][2])
    
write_short(gSpriteHookLine)    // sprite index
    
write_byte(0)        // start frame
    
write_byte(0)        // framerate
    
write_byte(HOOKBEAMLIFE)// life
    
write_byte(10)        // width
    
write_byte(0)        // noise
    
write_byte(rgb[0])       // r, g, b
    
write_byte(rgb[1])       // r, g, b
    
write_byte(rgb[2])       // r, g, b
    
write_byte(150)        // brightness
    
write_byte(0)          // speed
    
message_end()

    
gHookCreated[id] = get_gametime()
}
//----------------------------------------------------------------------------------------------
killbeam(id)
{
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_KILLBEAM)
    
write_short(id)
    
message_end()
}
//----------------------------------------------------------------------------------------------
public batgirl_death()
{
    new 
id read_data(2)

    if ( 
id <= || id SH_MAXSLOTS ) return

    if ( 
gHooked[id] ) batgirl_hook_off(id)
}
//----------------------------------------------------------------------------------------------
public client_disconnect(id)
{
    
// stupid check but lets see
    
if ( id <= || id SH_MAXSLOTS ) return

    
// Yeah don't want any left over residuals
    
remove_task(id)
}
//---------------------------------------------------------------------------------------------- 
You are all very welcome.
__________________
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 02-12-2011 , 21:51   Re: Batgirl (sharky)
Reply With Quote #66

Code:
bool:pass_aim_test(id) {
    if ( gHasBatgirl ) return
    // Can hook sky ignore test     if ( get_pcvar_num(gPcvarHookSky) ) return true     new origin[3], Float:Orig[3]     get_user_origin(id, origin, 3)     IVecFVec(origin, Orig)     if ( engfunc(EngFunc_PointContents, Orig) == CONTENTS_SKY )     {         client_print(id, print_chat, "[SH](%s) You cannot hook to the sky", gHeroName)         return false     }     return true }

wut?
__________________
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 02-12-2011 , 21:54   Re: Batgirl (sharky)
Reply With Quote #67

Indexes are for losers. And people who actually want their stuff to work.
__________________
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 02-12-2011 , 22:07   Re: Batgirl (sharky)
Reply With Quote #68

Oh, I see how that works. Pretty awesome.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
rodrigo
Senior Member
Join Date: Jul 2010
Location: Brasil
Old 02-13-2011 , 02:47   Re: Batgirl (sharky)
Reply With Quote #69

Lol, Jelle, the code you post, it's I edited ?
I'm lost, o.o
__________________
rodrigo is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 02-13-2011 , 08:34   Re: Batgirl (sharky)
Reply With Quote #70

Quote:
Originally Posted by rodrigo View Post
Lol, Jelle, the code you post, it's I edited ?
I'm lost, o.o
Look at the highlighted line. He didn't index the array which means it wont compile.
__________________
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 11:33.


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