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

Anyone can help transform these two heroes only to ADM !!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pilat100
Member
Join Date: Sep 2009
Old 12-16-2010 , 17:41   Anyone can help transform these two heroes only to ADM !!
Reply With Quote #1

Anyone can help these two heroes transforms only for use adm ?

I tried using this code no longer worked
Code:
public phoenix_admincheck(id) { //admin check function

new accessLevel[10]

get_cvar_string("mindbender_adminflag", accessLevel, 9)

if ( gphoenixSelected[id] && !(get_user_flags(id)&read_flags(accessLevel)) ) {
client_print(id, print_chat, "[SH](%s) **So Admin** Este Heroe e exclusivo para VIP e ADM", gheroName)
gHasphoenixPower[id] = false
client_cmd(id, "say drop %s", gphoenixName)
}
Code:
#include <amxmodx>
#include <engine>
#include <cstrike>
#include <superheromod>

// GLOBAL VARIABLES
new g_heroName[]="Exodus"
new bool:g_hasExodus[SH_MAXSLOTS+1]
new bool:g_inSearch[SH_MAXSLOTS+1]
new g_grabbedID[SH_MAXSLOTS+1]
new g_grabTimer[SH_MAXSLOTS+1]
new g_grabLength[SH_MAXSLOTS+1]
new Float:g_velocityMult, g_spriteLightning
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    // Plugin Info
    register_plugin("SUPERHERO Exodus", "1.2", "Freecode / RabidEskimo")

    // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    register_cvar("exodus_level", "9")
    register_cvar("exodus_cooldown", "15")
    register_cvar("exodus_grabtime", "6")
    register_cvar("exodus_grabforce", "8.0")
    register_cvar("exodus_toggle", "1")

    // FIRE THE EVENT TO CREATE THIS SUPERHERO!
    shCreateHero(g_heroName, "Telecinese", "Controle seu adversario como se fosse um objeto.", true, "exodus_level")

    // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
    // INIT
    register_srvcmd("exodus_init", "exodus_init")
    shRegHeroInit(g_heroName, "exodus_init")

    // KEY DOWN
    register_srvcmd("exodus_kd", "exodus_kd")
    shRegKeyDown(g_heroName, "exodus_kd")

    // KEY UP
    register_srvcmd("exodus_ku", "exodus_ku")
    shRegKeyUp(g_heroName, "exodus_ku")

    // NEW SPAWN
    register_event("ResetHUD", "newSpawn", "b")

    // DEATH
    register_event("DeathMsg", "exodus_death", "a")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
    g_spriteLightning = precache_model("sprites/lgtning.spr")
}
//----------------------------------------------------------------------------------------------
public exodus_init()
{
    // First Argument is an id
    new temp[6]
    read_argv(1,temp,5)
    new id = str_to_num(temp)

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

    //Clear out any stale tasks
    remove_task(id)

    if ( !hasPowers && g_hasExodus[id] && is_user_connected(id) ) {
        if ( g_inSearch[id] ) release(id)
    }

    g_hasExodus[id] = (hasPowers != 0)
}
//----------------------------------------------------------------------------------------------
public newSpawn(id)
{
    if ( g_inSearch[id] ) release(id)

    gPlayerUltimateUsed[id] = false

    g_grabTimer[id] = -1
}
//----------------------------------------------------------------------------------------------
// RESPOND TO KEYDOWN
public exodus_kd()
{
    if ( !hasRoundStarted() ) return

    // First Argument is an id
    new temp[6]
    read_argv(1,temp,5)
    new id = str_to_num(temp)

    if ( !is_user_alive(id) || !g_hasExodus[id] ) return

    // If in toggle mode change this to a keyup event
    if ( get_cvar_num("exodus_toggle") && g_inSearch[id] ) {
        if ( !g_grabbedID[id] ) client_print(id, print_center, "Exodus - Stopped Searching")
        release(id)
        return
    }

    if ( gPlayerUltimateUsed[id] || g_grabTimer[id] >= 0 ) {
        playSoundDenySelect(id)
        return
    }

    g_velocityMult = get_cvar_float("exodus_grabforce")

    // Check to see if they set grabforce too high or too low, if they did reset it and tell them
    if ( g_velocityMult > 16.0 ) {
        debugMessage("[SH](Exodus) exodus_grabforce cvar must not be set higher then 16.0, defaulting to 16.0", 0, 0)
        g_velocityMult = 16.0
        set_cvar_float("exodus_grabforce", g_velocityMult)
    }
    else if ( g_velocityMult < 1.5 ) {
        debugMessage("[SH](Exodus) exodus_grabforce cvar must not be set lower then 1.5, defaulting to 1.5", 0, 0)
        g_velocityMult = 1.5
        set_cvar_float("exodus_grabforce", g_velocityMult)
    }

    g_inSearch[id] = true

    set_task(0.1, "grabtask", id, "", 0, "b")

    // Quick check before grabtask starts
    new targetid, body
    get_user_aiming(id, targetid, body)

    if ( is_user_alive(targetid) && cs_get_user_team(id) != cs_get_user_team(targetid) ) {
        g_grabbedID[id] = targetid
        set_grabbed(id, targetid)
    }
    else {
        client_print(id, print_center, "Exodus - Searching for a Victim")
    }
}
//----------------------------------------------------------------------------------------------
// RESPOND TO KEYUP
public exodus_ku()
{
    if ( !hasRoundStarted() ) return

    // Toggle mode - keyup doesn't do anything!
    if ( get_cvar_num("exodus_toggle") ) return

    // First Argument is an id
    new temp[6]
    read_argv(1,temp,5)
    new id = str_to_num(temp)

    if ( !is_user_alive(id) || !g_hasExodus[id] || !g_inSearch[id] ) return

    if ( !g_grabbedID[id] ) client_print(id, print_center, "Exodus - Stopped Searching")

    release(id)
}
//----------------------------------------------------------------------------------------------
public grabtask(id)
{
    if ( !g_grabbedID[id] ) {
        new targetid, body

        get_user_aiming(id, targetid, body)

        if ( is_user_alive(targetid) && cs_get_user_team(id) != cs_get_user_team(targetid) ) {
            set_grabbed(id, targetid)
        }
    }
    else {
        if ( !is_user_alive(g_grabbedID[id]) ) {
            release(id)
            return
        }

        if ( get_user_gravity(g_grabbedID[id]) != 0.00001 ) {
            set_user_gravity(g_grabbedID[id], 0.00001)
        }

        new viewOrigin[3], aimVec[3], vicOrigin[3], newVec[3], direction[3], Float:fl_Velocity[3], length

        get_user_origin(id, viewOrigin, 1)
        get_user_origin(id, aimVec, 3)
        get_user_origin(g_grabbedID[id], vicOrigin)

        direction[0] = aimVec[0]-viewOrigin[0]
        direction[1] = aimVec[1]-viewOrigin[1]
        direction[2] = aimVec[2]-viewOrigin[2]

        length = get_distance(aimVec, viewOrigin)
        if (!length) length = 1            // avoid division by 0

        newVec[0] = viewOrigin[0]+direction[0]*g_grabLength[id]/length
        newVec[1] = viewOrigin[1]+direction[1]*g_grabLength[id]/length
        newVec[2] = viewOrigin[2]+direction[2]*g_grabLength[id]/length

        fl_Velocity[0] = (newVec[0]-vicOrigin[0])*g_velocityMult
        fl_Velocity[1] = (newVec[1]-vicOrigin[1])*g_velocityMult
        fl_Velocity[2] = (newVec[2]-vicOrigin[2])*g_velocityMult

        entity_set_vector(g_grabbedID[id], EV_VEC_velocity, fl_Velocity)
    }
}
//----------------------------------------------------------------------------------------------
public set_grabbed(id, targetid)
{
    new vicName[32], idName[32]

    g_grabTimer[id] = get_cvar_num("exodus_grabtime")

    if ( g_grabTimer[id] > 0 ) exodus_timeloop(id)

    g_grabbedID[id] = targetid

    g_grabLength[id] = get_entity_distance(id, targetid) 

    set_user_gravity(targetid, 0.00001)

    lightning_effect(id, targetid)
    shGlow(targetid, 200, 187, 0)

    get_user_name(targetid, vicName, 31)
    get_user_name(id, idName, 31)

    set_hudmessage(255, 255, 0, -1.0, 0.30, 0, 1.0, 3.0, 0.0, 0.0, 6)
    show_hudmessage(targetid, "%s has telekinetically grabbed you", idName)
    show_hudmessage(id, "Telekinetically grabbed:  %s", vicName)
}
//----------------------------------------------------------------------------------------------
public exodus_timeloop(id)
{
    if ( !g_hasExodus[id] || !is_user_alive(id) ) return

    if ( g_grabTimer[id] > 0 && g_grabTimer[id] < 11 ) {
        new message[128]
        format(message, 127, "%d second%s left of Telekinetic Grab", g_grabTimer[id], g_grabTimer[id] == 1 ? "" : "s")
        set_hudmessage(255, 255, 0, -1.0, 0.32, 0, 1.0, 1.0, 0.0, 0.0, 4)
        show_hudmessage(id, message)
    }
    else if ( g_grabTimer[id] == 0 ) {
        release(id)
    }

    g_grabTimer[id]--

    if ( g_grabTimer[id] >= 0 ) set_task(1.0, "exodus_timeloop", id)
}
//----------------------------------------------------------------------------------------------
public release(id)
{
    if ( g_grabbedID[id] ) {
        if ( is_user_alive(id) ) {
            if (get_cvar_float("exodus_cooldown") > 0.0) ultimateTimer(id, get_cvar_float("exodus_cooldown"))
        }
        if ( is_user_connected(g_grabbedID[id]) ) {
            shSetGravityPower(g_grabbedID[id])
            set_user_rendering(g_grabbedID[id])
        }
        g_grabbedID[id] = 0
        g_grabTimer[id] = -1
    }    

    remove_task(id)

    g_inSearch[id] = false
}
//----------------------------------------------------------------------------------------------
public exodus_death()
{
    new id = read_data(2)

    if ( !g_hasExodus[id] || !g_inSearch[id] ) return

    release(id)
}
//----------------------------------------------------------------------------------------------
public client_disconnect(id)
{
    if ( !g_hasExodus[id] || !g_inSearch[id] ) return

    release(id)
}
//----------------------------------------------------------------------------------------------
public lightning_effect(id, targetid)
{
    // Lightning effect - Create a beam between two entities
    message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
    write_byte(8)            // TE_BEAMENTS
    write_short(id)        // start entity
    write_short(targetid)    // entity
    write_short(g_spriteLightning)    // model
    write_byte(0)        // starting frame
    write_byte(15)        // frame rate
    write_byte(6)        // life
    write_byte(80)        // line width
    write_byte(10)        // noise amplitude
    write_byte(255)    // r, g, b
    write_byte(238)    // r, g, b
    write_byte(0)        // r, g, b
    write_byte(35)        // brightness
    write_byte(0)        // scroll speed
    message_end()
}
//----------------------------------------------------------------------------------------------
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/
Code:
#include <amxmod>
#include <Vexd_Utilities>
#include <superheromod>

new g_heroName[]="Phoenix"
new bool:g_hasPhoenix[SH_MAXSLOTS+1]
new bool:g_phoenixPowerUsed[SH_MAXSLOTS+1]
new bool:g_betweenRounds
new g_userTeam[SH_MAXSLOTS+1]
new g_savedOrigin[SH_MAXSLOTS+1][3]
new g_lastPosition[SH_MAXSLOTS+1][3]
new g_spriteSmoke, g_spriteRing, g_spriteExplosion
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    // Plugin Info
    register_plugin("SUPERHERO Phoenix", "1.1", "[FTW]-S.W.A.T / vittu")

    // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    register_cvar("phoenix_level", "8")
    register_cvar("phoenix_cooldown", "120")
    register_cvar("phoenix_radius", "375")
    register_cvar("phoenix_maxdamage", "90")

    // FIRE THE EVENT TO CREATE THIS SUPERHERO!
    shCreateHero(g_heroName, "Renascimento", "Ressucite no mesmo lugar em que morreu,podendo dar dano em quem estiver em volta.", false, "phoenix_level")

    // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
    // INIT
    register_srvcmd("phoenix_init", "phoenix_init")
    shRegHeroInit(g_heroName, "phoenix_init")

    // DEATH EVENT
    register_event("DeathMsg", "phoenix_death", "a")

    // ROUND EVENTS
    register_logevent("round_start", 2, "1=Round_Start")
    register_logevent("round_end", 2, "1=Round_End")
    register_logevent("round_end", 2, "1&Restart_Round_")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
    g_spriteSmoke = precache_model("sprites/steam1.spr")
    g_spriteRing = precache_model("sprites/white.spr")
    g_spriteExplosion = precache_model("sprites/explode1.spr")
    precache_sound("ambience/port_suckin1.wav")
    precache_sound("ambience/3dmeagle.wav")
}
//----------------------------------------------------------------------------------------------
public phoenix_init()
{
    // First Argument is an id
    new temp[6]
    read_argv(1,temp,5)
    new id = str_to_num(temp)

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

    g_hasPhoenix[id] = (hasPowers != 0)
}
//----------------------------------------------------------------------------------------------
public phoenix_death()
{
    if ( !shModActive() || g_betweenRounds ) return

    new id = read_data(2)

    if ( !is_user_connected(id) || !g_hasPhoenix[id] ) return

    g_userTeam[id] = get_user_team(id)

    // Save users origin on death
    get_user_origin(id, g_savedOrigin[id])
    g_savedOrigin[id][2] += 8

    // Look for self to raise from dead
    if ( !is_user_alive(id) && !g_phoenixPowerUsed[id] ) {
        new parm[1]
        parm[0] = id
        // Respawn it faster then Zues, let this power be used before Zues's
        // never set higher then 1.9 or lower then 0.5
        set_task(0.6, "phoenix_respawn", 0, parm, 1)
    }
}
//----------------------------------------------------------------------------------------------
public phoenix_respawn(parm[])
{
    new id = parm[0]

    if ( !is_user_connected(id) || is_user_alive(id) ) return
    if ( g_phoenixPowerUsed[id] || g_betweenRounds ) return
    if ( g_userTeam[id] != get_user_team(id) ) return //prevents respawning spectators

    emit_sound(id, CHAN_STATIC, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)

    client_print(id, print_chat, "[SH](Phoenix) You used the Phoenix power to Rise Again from the Ashes!")

    // Double spawn prevents the no HUD glitch
    user_spawn(id)
    user_spawn(id)

    // Respawned by Phoenix, it's ok to set cooldown now.
    new Float:phoenixCooldown = get_cvar_float("phoenix_cooldown")
    if ( phoenixCooldown > 0.0 ) {
        set_task(phoenixCooldown, "enable_phoenix", id)
        g_phoenixPowerUsed[id] = true
    }

    emit_sound(id, CHAN_STATIC, "ambience/3dmeagle.wav", 0.6, ATTN_NORM, 0, PITCH_NORM)

    shGlow(id, 248, 20, 25)
    set_task(3.0, "phoenix_unglow", 0, parm, 1)
    set_task(1.0, "phoenix_teamcheck", 0, parm, 1)

    set_user_health(id, 75)
    phoenix_teleport(id)
}
//----------------------------------------------------------------------------------------------
public phoenix_unglow(parm[])
{
    new id = parm[0]
    shUnglow(id)
}
//----------------------------------------------------------------------------------------------
public phoenix_teamcheck(parm[])
{
    new id = parm[0]

    if ( g_userTeam[id] != get_user_team(id) ) {
        client_print(id, print_chat, "[SH](Phoenix) You changed teams and used Phoenix Respawn, now you shall die")

        user_kill(id, 1)

        // Stop Phoenix from respawning until round ends
        remove_task(id)
        g_phoenixPowerUsed[id] = false
    }
}
//----------------------------------------------------------------------------------------------
public round_start()
{
    g_betweenRounds = false
}
//----------------------------------------------------------------------------------------------
public round_end()
{
    if ( !shModActive() ) return

    g_betweenRounds = true

    // Reset the cooldown on round end, to start fresh for a new round
    for (new id = 1; id <= SH_MAXSLOTS; id++) {
        if ( g_hasPhoenix[id] ) {
            // Reset the cooldown on round end, to start fresh for a new round
            remove_task(id)
            g_phoenixPowerUsed[id] = false
        }
    }
}
//----------------------------------------------------------------------------------------------
public enable_phoenix(id)
{
    g_phoenixPowerUsed[id] = false
}
//----------------------------------------------------------------------------------------------
public phoenix_teleport(id)
{
    // Teleport the player
    set_user_origin(id, g_savedOrigin[id])

    // Teleport Effects
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
    write_byte(11)                    // TE_TELEPORT
    write_coord(g_savedOrigin[id][0])    // start position
    write_coord(g_savedOrigin[id][1])
    write_coord(g_savedOrigin[id][2])
    message_end()

    positionChangeTimer(id)

    BlowUp(id)
}
//----------------------------------------------------------------------------------------------
public positionChangeTimer(id)
{
    if ( !is_user_alive(id) ) return

    get_user_origin(id, g_lastPosition[id])

    new Float:velocity[3]
    Entvars_Get_Vector(id, EV_VEC_velocity, velocity)

    if ( velocity[0]==0.0 && velocity[1]==0.0 ) {
        // Force a Move (small jump)
        velocity[0] += 20.0
        velocity[2] += 100.0
        Entvars_Set_Vector(id, EV_VEC_velocity, velocity)
    }

    set_task(0.4, "positionChangeCheck", id+100)
}
//----------------------------------------------------------------------------------------------
public positionChangeCheck(id)
{
    id -= 100

    if ( !is_user_alive(id) ) return

    new origin[3]
    get_user_origin(id, origin)

    // Kill this player if Stuck in Wall!
    if ( g_lastPosition[id][0] == origin[0] && g_lastPosition[id][1] == origin[1] && g_lastPosition[id][2] == origin[2] && is_user_alive(id) ) {
        user_kill(id, 1)
        client_print(id, print_chat, "[SH](Phoenix) You were killed for being stuck in a wall")
    }
}
//----------------------------------------------------------------------------------------------
public BlowUp(id)
{
    new Float:dRatio, damage, distanceBetween
    new origin[3], origin1[3], name[32]
    new dmgRadius = get_cvar_num("phoenix_radius")
    new maxDamage = get_cvar_num("phoenix_maxdamage")
    new FFOn = get_cvar_num("mp_friendlyfire")

    get_user_origin(id, origin)

    get_user_name(id, name, 31)

    // blowup even if dead
    explode_effect(origin, dmgRadius)

    for (new a = 1; a <= SH_MAXSLOTS; a++) {
        if ( is_user_alive(a) && a != id && (get_user_team(id) != get_user_team(a) || FFOn) ) {

            get_user_origin(a, origin1)

            distanceBetween = get_distance(origin, origin1)

            if ( distanceBetween < dmgRadius ) {
                set_hudmessage(248, 20, 25, 0.05, 0.65, 2, 0.02, 3.0, 0.01, 0.1, 85)
                show_hudmessage(a, "%s was Re-Born using the power of the Phoenix!", name)

                dRatio = float(distanceBetween) / float(dmgRadius)
                damage = maxDamage - floatround(maxDamage * dRatio)
                shExtraDamage(a, id, damage, "Phoenix Re-Birth")
            }
        }
    }
}
//----------------------------------------------------------------------------------------------
public explode_effect(vec1[3], dmgRadius)
{
    // Ring
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY, vec1)
    write_byte(21)                // TE_BEAMCYLINDER
    write_coord(vec1[0])        // center position
    write_coord(vec1[1])
    write_coord(vec1[2] + 10)
    write_coord(vec1[0])        // axis and radius
    write_coord(vec1[1])
    write_coord(vec1[2] + floatround(dmgRadius*3.5))
    write_short(g_spriteRing)    // sprite index
    write_byte(0)        // starting frame
    write_byte(0)        // frame rate in 0.1's
    write_byte(2)        // life in 0.1's
    write_byte(20)        // line width in 0.1's
    write_byte(0)        // noise amplitude in 0.01's
    write_byte(248)    //colour
    write_byte(20)
    write_byte(25)
    write_byte(255)    // brightness
    write_byte(0)        // scroll speed in 0.1's
    message_end()

    // Explosion2
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
    write_byte(12)            // TE_EXPLOSION2
    write_coord(vec1[0])    // start position
    write_coord(vec1[1])
    write_coord(vec1[2])
    write_byte(188)    // starting color
    write_byte(10)        // num colors
    message_end()

    // Explosion
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY, vec1)
    write_byte(3)            // TE_EXPLOSION
    write_coord(vec1[0])    // start position 
    write_coord(vec1[1])
    write_coord(vec1[2])
    write_short(g_spriteExplosion)    // sprite index
    write_byte(dmgRadius/9)    // scale in 0.1's 
    write_byte(10)            // framerate
    write_byte(0)            // flags
    message_end()

    // Smoke
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY, vec1)
    write_byte(5)            // TE_SMOKE
    write_coord(vec1[0])    // start position
    write_coord(vec1[1])
    write_coord(vec1[2])
    write_short(g_spriteSmoke)    // sprite index
    write_byte(dmgRadius/14)    // scale in 0.1's
    write_byte(10)            // framerate
    message_end()
}
//----------------------------------------------------------------------------------------------
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/
Pilat100 is offline
Old 12-18-2010, 13:43
Pilat100
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Vechta
Veteran Member
Join Date: Jun 2010
Old 12-18-2010 , 14:08   Re: Anyone can help transform these two heroes only to ADM !!
Reply With Quote #2

Post in SuperHero Section
Vechta is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-19-2010 , 18:49   Re: Anyone can help transform these two heroes only to ADM !!
Reply With Quote #3

Quote:
Originally Posted by Pilat100 View Post
up
Don't bump until 2 weeks have passed since last post.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
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 16:46.


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