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

Need help with some scripting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rizu
Junior Member
Join Date: Aug 2010
Location: Norway
Old 09-07-2010 , 19:17   Need help with some scripting
Reply With Quote #1

Yeah i know.. Its a long code o.O
Error's posted below.
sma:
PHP Code:
//Sinutte! - Jeanette\'s Godlike powers

/* CVARS - copy and paste to shconfig.cfg

//Sinutte 
Sinutte_level 1 
Sinutte_health 700    //Default 100 (no extra health)
Sinutte_armor 500        //Default 150
Sinutte_gravity 2.0    //Default 1.0 = no extra gravity (0.50 is 50% normal gravity, ect.)
Sinutte_speed 1600        //Default -1 = no extra speed, this cvar is for all weapons (for faster then normal speed set to 261 or higher)
Sinutte_deaglemult 100.0        //Damage multiplyer for his deagle 
*/

#include <amxmodx>
#include <superheromod>
#include <fakemeta> 
new HeroName[] = "Sinutte"
new bool:HasHero[SH_MAXSLOTS+1]
new 
bool:HeroModelSet[SH_MAXSLOTS+1
new 
CvardeagleDmgMult 
public plugin_init()
{
    
// Plugin Info
    
register_plugin("SUPERHERO Sinutte","1.0","Pzyco*Angel")
    
    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    
register_cvar("Sinutte_level""1")
    
register_cvar("Sinutte_health""700")
    
register_cvar("Sinutte_armor""500")
    
register_cvar("Sinutte_gravity""2.0")
    
register_cvar("Sinutte_speed""1600")
    
CvardeagleDmgMult register_cvar("Sinutte_deaglemult""100.0"

    
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
    
shCreateHero(HeroName"Jeanette\'s Godlike powers""Jeanette\'s Godlike powers"false"Sinutte_level")
    
    
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
    // INIT
    
register_srvcmd("Sinutte_init""Sinutte_init")
    
shRegHeroInit(HeroName"Sinutte_init")
        
    
// EVENTS
    
register_event("ResetHUD""new_spawn""b")
    
register_event("DeathMsg""Sinutte_death""a"
    
register_event("CurWeapon""weapon_change""be""1=1")
    
register_event("Damage""Sinutte_damage""b""2!0"
    
// Let Server know about the hero's variables
    
shSetShieldRestrict(HeroName)
    
shSetMaxHealth(HeroName"Sinutte_health")
    
shSetMaxArmor(HeroName"Sinutte_armor")
    
shSetMinGravity(HeroName"Sinutte_gravity")
    
shSetMaxSpeed(HeroName"Sinutte_speed""[0]")
}
public 
plugin_precache()

    
precache_model("models/shmod/Sinutte_v_deagle.vmt")
    
precache_model("models/shmod/Sinutte_p_deagle.vtf")
    
precache_model("models/player/Sinutte/Sinutte.vtf")        

public 
Sinutte_init()
{
    
// First Argument is an id
    
new temp[6]
    
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
    
    
// Reset their shield restrict status
    // Shield restrict MUST be before weapons are given out
    
shResetShield(id)

    switch(
hasPowers)
    {
         
        case 
true:
        {
            
HasHero[id] = true

            
if ( is_user_alive(id) )
            { 
                
Sinutte_weapons(id)
                
switch_model(id)
            }
        } 
        case 
false:
        { 
            
// Check is needed since this gets run on clearpowers even if user didn't have this hero
    
if ( is_user_alive(id) && HasHero[id] )
            {
                
// This gets run if they had the power but don't anymore
                
engclient_cmd(id"drop""weapon_deagle"
                
Sinutte_unmorph(id
                
shRemHealthPower(id)
                
shRemArmorPower(id)
                
shRemGravityPower(id)
                
shRemSpeedPower(id)
            }
    
HasHero[id] = false 

            
}
    } 
}

public 
new_spawn(id)
{
    if ( 
shModActive() && is_user_alive(id) && HasHero[id] )
    {
        
set_task(0.1"Sinutte_weapons"id)

        
Sinutte_tasks(id)
    }
}
Sinutte_tasks(id)
{
    
set_task(1.0"Sinutte_morph"id)



public 
Sinutte_weapons(id)
{
    if ( !
shModActive() || !is_user_alive(id) || !HasHero[id] )
        return

    
shGiveWeapon(id"weapon_deagle")
}
switch_model(id)
{
    if ( !
shModActive() || !is_user_alive(id) || !HasHero[id] )
        return

    new 
clipammowpnid get_user_weapon(idclipammo)

    if ( 
wpnid == CSW_DEAGLE )
    {
        
set_pev(idpev_viewmodel2"models/shmod/Sinutte_v_deagle.vmt")
        
set_pev(idpev_weaponmodel2"models/shmod/Sinutte_p_deagle.vtf")
    }
}
public 
weapon_change(id)
{
    if ( !
shModActive() || !HasHero[id] )
        return

    new 
wpnid read_data(2)

    if ( 
wpnid != CSW_DEAGLE )
        return

    
switch_model(id)

    new 
clip read_data(3)

    
// Never Run Out of Ammo!
    
if ( clip == )
        
shReloadAmmo(id)
}
public 
Sinutte_damage(id)
{
    if ( !
shModActive() || !is_user_alive(id) )
        return

    new 
weaponbodypartattacker get_user_attacker(idweaponbodypart)

    if ( 
attacker <= || attacker SH_MAXSLOTS )
        return

    if ( 
HasHero[attacker] && weapon == CSW_DEAGLE && is_user_alive(id) )
    {
        new 
damage read_data(2)
        new 
headshot bodypart == 0

        
// do extra damage
        
new extraDamage floatround(damage get_pcvar_float(CvardeagleDmgMult) - damage)
        if ( 
extraDamage )
            
shExtraDamage(idattackerextraDamage"deagle"headshot)
    }

public 
Sinutte_morph(id)
{
    if ( 
HeroModelSet[id] || !is_user_alive(id) || !HasHero[id] )
        return

    
cs_set_user_model(id"Hero")

    
HeroModelSet[id] = true
}
Sinutte_unmorph(id)
{
    if ( 
HeroModelSet[id] && is_user_connected(id) )
     {
        
cs_reset_user_model(id)

        
HeroModelSet[id] = false

    
}
}
public 
Sinutte_death()
{
    new 
id read_data(2)

    if ( !
HasHero[id] )
    return

    
Sinutte_unmorph(id)
}
public 
client_connect(id)
{
    
HasHero[id] = false
    HeroModelSet
[id] = false
}


//----------------------------------------------------------------------------------------------
public sinutte_admincheck(id)
{

new 
accessLevel[10]


get_cvar_string("sinutte_adminflag"accessLevel9)


if ( 
gSinutteSelected[id] && !(get_user_flags(id)&read_flags(accessLevel)) ) {

client_print(idprint_chat"[SH](%s) **Admin Only** You are not

authorized to use this hero"
gHeroName)

gHasHEROPower[id] = false

client_cmd
(id"say drop %s"gHeroName)
}
}
//---------------------------------------------------------------------------------------------- 
Here are the errors
I know i have to define "gSinutteSelected" But, the problem is idk how.
Quote:

error 017: undefined symbol "gSinutteSelected"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Trying to make it admin only.

(Since this is a hero made by pizza's generator, i wont post it on the site )

Last edited by Rizu; 09-08-2010 at 00:02.
Rizu is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 09-08-2010 , 05:33   Re: Need help with some scripting
Reply With Quote #2

Fak of with admin powers and old amxx

new bool:gHasSinutte[SH_MAXSLOTS+1]
__________________
The Art of War is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 09-08-2010 , 11:39   Re: Need help with some scripting
Reply With Quote #3

Quote:
Originally Posted by The Art of War View Post
Fak of with admin powers and old amxx

new bool:gHasSinutte[SH_MAXSLOTS+1]
Nope. Look at it again. He never uses gHasSinutte, so making a new boolean for it would be redundant.

He fail at copy pasting, badly. If he would read what is written, he wouldn't be having any problems.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Rizu
Junior Member
Join Date: Aug 2010
Location: Norway
Old 09-08-2010 , 13:12   Re: Need help with some scripting
Reply With Quote #4

Quote:
Originally Posted by Jelle View Post
Nope. Look at it again. He never uses gHasSinutte, so making a new boolean for it would be redundant.

He fail at copy pasting, badly. If he would read what is written, he wouldn't be having any problems.
True, i suck at it.. But everyone got to start somewhere.
Nothing is learned overnight.. And iv'e showed before i'm a slow learner.. lol
but ill get it working somehow.

As for "ghasSinutte"
It just got me more problems. "Hashero" missing now.
Tried to fix it, but i failed bad. but ill get it to work somehow!

Ok, So here's the new one.. Complied fine and all, but it wont show in herolist.. so i wonder if i missed anything?
PHP Code:
#include <amxmodx>
#include <superheromod>
#include <fakemeta> 

new HeroName[] = "Sinutte"
new bool:HasHero[SH_MAXSLOTS+1]

new const 
deagle_p[] = "models/shmod/Sinutte_p_deagle.mdl";
new const 
deagle_v[] = "models/shmod/Sinutte_v_deagle.mdl";
 
new 
CvardeagleDmgMult 
//---------------------------------------------------------------------------------------
public plugin_init()
{
    
// Plugin Info
    
register_plugin("SUPERHERO Sinutte""1.0""Sinutte")
    
    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    
register_cvar("Sinutte_level""1")
    
register_cvar("Sinutte_health""500")
    
register_cvar("Sinutte_armor""500")
    
register_cvar("Sinutte_gravity""0.8")
    
register_cvar("Sinutte_speed""320")
    
CvardeagleDmgMult register_cvar("Sinutte_deaglemult""5.4"

    
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
    
shCreateHero(HeroName"High dmg. Weapon/Hp/Ap/Speed/Gravity""High dmg. Weapon/Hp/Ap/Speed/Gravity"false"Sinutte_level")
    
    
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
    // INIT
    
register_srvcmd("Sinutte_init""Sinutte_init")
    
shRegHeroInit(HeroName"Sinutte_init")
        
    
// EVENTS
 
    
register_event("CurWeapon""weapon_change""be""1=1")
    
register_event("Damage""Sinutte_damage""b""2!0"
    
// Let Server know about the hero's variables
    
shSetShieldRestrict(HeroName)
    
shSetMaxHealth(HeroName"Sinutte_health")
    
shSetMaxArmor(HeroName"Sinutte_armor")
    
shSetMinGravity(HeroName"Sinutte_gravity")
    
shSetMaxSpeed(HeroName"Sinutte_speed""[0]")
}
//---------------------------------------------------------------------------------------
public plugin_precache()

    
precache_model(deagle_v)
    
precache_model(deagle_p)
}
//---------------------------------------------------------------------------------------
public Sinutte_init()
{
    
// First Argument is an id
    
new temp[6]
    
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
    
    
// Reset their shield restrict status
    // Shield restrict MUST be before weapons are given out
    
shResetShield(id)

    switch(
hasPowers)
    {
        case 
true:
        {
            
HasHero[id] = true

            
if ( is_user_alive(id) )
            { 
                
Sinutte_weapons(id)
                
switch_model(id)
            }
            
Sinutte_admincheck(id);
        } 
        case 
false:
        { 
            
// Check is needed since this gets run on clearpowers even if user didn't have this hero
            
if ( is_user_alive(id) && HasHero[id] )
            {
                
// This gets run if they had the power but don't anymore
                
engclient_cmd(id"drop""weapon_deagle"
                 
                
shRemHealthPower(id)
                
shRemArmorPower(id)
                
shRemGravityPower(id)
                
shRemSpeedPower(id)
            }
            
HasHero[id] = false 
        
}
    } 

//---------------------------------------------------------------------------------------
public weapon_change(id)
{
    if ( !
shModActive() || !HasHero[id] )
        return

    new 
wpnid read_data(2)

    if ( 
wpnid != CSW_DEAGLE )
        return

    
switch_model(id)

    new 
clip read_data(3)

    
// Never Run Out of Ammo!
    
if ( clip == )
        
shReloadAmmo(id)
}
//---------------------------------------------------------------------------------------
public Sinutte_damage(id)
{
    if ( !
shModActive() || !is_user_alive(id) )
        return

    new 
weaponbodypartattacker get_user_attacker(idweaponbodypart)

    if ( 
attacker <= || attacker SH_MAXSLOTS )
        return

    if ( 
HasHero[attacker] && weapon == CSW_DEAGLE )
    {
        new 
damage read_data(2)
        new 
headshot bodypart == 0

        
// do extra damage
        
new extraDamage floatround(damage get_pcvar_float(CvardeagleDmgMult) - damage)
        if ( 
extraDamage )
            
shExtraDamage(idattackerextraDamage"deagle"headshot)
    }

//---------------------------------------------------------------------------------------
switch_model(id)
{
    if ( !
shModActive() || !is_user_alive(id) || !HasHero[id] )
        return

    new 
clipammowpnid get_user_weapon(idclipammo)

    if ( 
wpnid == CSW_DEAGLE )
    {
        
set_pev(idpev_viewmodel2deagle_v)
        
set_pev(idpev_weaponmodel2deagle_p)
    }
}
//--------------------------------------------------------------------------------------- 
Sinutte_weapons(id)
{
    if ( !
shModActive() || !is_user_alive(id) || !HasHero[id] )
        return

    
shGiveWeapon(id"weapon_deagle")
}
//---------------------------------------------------------------------------------------
Sinutte_admincheck(id) { //admin check function
    
static const accessLevel[] = "w" //set you admin check level to what you want
    /* or make it a cvar:
    new accessLevel[10]
    get_cvar_string("Sinutte_adminflag", accessLevel, 9)
    */
 
    
if ( HasHero[id] &&  !(get_user_flags(id) & read_flags(accessLevel)) ) {
          
client_print(idprint_chat"[SH](%s) **Jeanette ONLY** You are not authorized to use this hero"HeroName)
          
HasHero[id] = false
          client_cmd
(id"say drop %s"HeroName)
    }


Last edited by Rizu; 09-08-2010 at 14:31.
Rizu is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 09-08-2010 , 16:42   Re: Need help with some scripting
Reply With Quote #5

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

#include <superheromod>

new gHeroID
new const gHeroName[] = "Sinutte"
new bool:gHasSinPower[SH_MAXSLOTS+1]

// Model stuff
new const deagle_p[] = "models/shmod/Sinutte_p_deagle.mdl"
new const deagle_v[] = "models/shmod/Sinutte_v_deagle.mdl"

// Admin cvar
new pcvarAdminFlag

public plugin_init()
{
    
register_plugin("SUPERHERO Sinutte""1.2""Jelle")
    
    
// Register cvars
    
new pcvarLevel register_cvar("sinutte_level""10")
    new 
pcvarHealth register_cvar("sinutte_health""100")
    new 
pcvarArmor register_cvar("sinutte_armor""100")
    new 
pcvarGrav register_cvar("sinutte_grav""0.8")
    new 
pcvarSpeed register_cvar("sinutte_speed""300")
    new 
pcvarMult register_cvar("sinutte_deaglemult""5.4")
    
pcvarAdminFlag register_cvar("sinutte_adminflag""w")
    
    
// Create hero stuff to register with SH mod and give unique hero ID
    
gHeroID sh_create_hero(gHeroNamepcvarLevel)
    
sh_set_hero_info(gHeroID"Various simple stuff""High dmg. Weapon/Hp/Ap/Speed/Gravity")
    
    
// Set hero powers
    
sh_set_hero_hpap(gHeroIDpcvarHealthpcvarArmor)
    
sh_set_hero_grav(gHeroIDpcvarGrav)
    
sh_set_hero_speed(gHeroIDpcvarSpeed)
    
sh_set_hero_dmgmult(gHeroIDpcvarMultCSW_DEAGLE)
    
sh_set_hero_shield(gHeroIDtrue)
    
    
// Register weapon change and weapon fire event
    
register_event("CurWeapon""weapon_change""be""1=1")
}

// Precache (download) the needed model
public plugin_precache()
{
    
precache_model(deagle_p)
    
precache_model(deagle_v)
}

public 
sh_hero_init(idheroIDmode)
{
    
// If the unique ID given by sh_create_hero is not the same as provided by sh_hero_init do nothing
    
if ( gHeroID != heroID ) return
    
    
// Runs each time the hero is added or dropped
    
switch(mode)
    {
        
// If the hero is added
        
case SH_HERO_ADD:
        {
            
gHasSinPower[id] = true
            
            
// Check if the client is an admin
            
sinutte_admincheck(id)
            
            
// If the guy is alive, give him weapon and model
            
if ( is_user_alive(id) )
            {
                
sinutte_weapon(id)
                
switch_model(id)
            }
        }
        
        
// If hero is dropped
        
case SH_HERO_DROP:
        {
            
gHasSinPower[id] = false
            
            
// If client is alive drop weapon
            
if ( is_user_alive(id) )
            {
                
sh_drop_weapon(idCSW_DEAGLE)
            }
        }
    }
}

// Runs each time client spawns
public sh_client_spawn(id)
{
    
// If client has hero and is alive give gun and model
    
if ( gHasSinPower[id] && is_user_alive(id) )
    {
        
switch_model(id)
        
sinutte_weapon(id)
    }
}

// Give client the gun!
sinutte_weapon(id)
{
    
sh_give_weapon(idCSW_DEAGLE)
}

public 
weapon_change(id)
{
    
// If client doesnt have power or sh is off do nothing
    
if ( !gHasSinPower[id] && !sh_is_active() ) return
    
    
// If weapon is not deagle do nothing
    
if ( read_data(2) != CSW_DEAGLE ) return
    
    
// Go set model on the gun
    
switch_model(id)
    
    
// If clip is 0 then reload the clients ammo
    
if ( read_data(3) == )
    {
        
sh_reload_ammo(id1)
    }
}

// Set the models
switch_model(id)
{
    if ( 
get_user_weapon(id) == CSW_DEAGLE )
    {
        
set_pev(idpev_viewmodel2deagle_v)
        
set_pev(idpev_weaponmodel2deagle_p)
    }
}

// Check if client is an admin or not
sinutte_admincheck(id)
{
    
//Make new array with 10 cells to store the admin cvar in
    
new accessLevel[10]
    
    
//Get what the admin cvar is and out the data inside the new array just created
    
get_pcvar_string(pcvarAdminFlagaccessLevel9)
    
    
// If client has hero but doesn't have the admin flag then drop hero and warn the client
    
if ( gHasSinPower[id] && !(get_user_flags(id) & read_flags(accessLevel) ) )
    {
        
client_print(idprint_chat"[SH](%s) **Jeanette ONLY** You are not authorized to use this hero"gHeroName)
        
gHasSinPower[id] = false
        client_cmd
(id"say drop %s"gHeroName)
    }

Now stop using that fucking retarded generator. (No fence JTPizzalover) Use this instead:

https://forums.alliedmods.net/showthread.php?t=120051
__________________
No idea what to write here...

Last edited by Jelle; 09-08-2010 at 16:50.
Jelle is offline
Send a message via MSN to Jelle
Rizu
Junior Member
Join Date: Aug 2010
Location: Norway
Old 09-09-2010 , 13:58   Re: Need help with some scripting
Reply With Quote #6

Quote:
Originally Posted by Jelle View Post
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <superheromod>

new gHeroID
new const gHeroName[] = "Sinutte"
new bool:gHasSinPower[SH_MAXSLOTS+1]

// Model stuff
new const deagle_p[] = "models/shmod/Sinutte_p_deagle.mdl"
new const deagle_v[] = "models/shmod/Sinutte_v_deagle.mdl"

// Admin cvar
new pcvarAdminFlag

public plugin_init()
{
    
register_plugin("SUPERHERO Sinutte""1.2""Jelle")
    
    
// Register cvars
    
new pcvarLevel register_cvar("sinutte_level""10")
    new 
pcvarHealth register_cvar("sinutte_health""100")
    new 
pcvarArmor register_cvar("sinutte_armor""100")
    new 
pcvarGrav register_cvar("sinutte_grav""0.8")
    new 
pcvarSpeed register_cvar("sinutte_speed""300")
    new 
pcvarMult register_cvar("sinutte_deaglemult""5.4")
    
pcvarAdminFlag register_cvar("sinutte_adminflag""w")
    
    
// Create hero stuff to register with SH mod and give unique hero ID
    
gHeroID sh_create_hero(gHeroNamepcvarLevel)
    
sh_set_hero_info(gHeroID"Various simple stuff""High dmg. Weapon/Hp/Ap/Speed/Gravity")
    
    
// Set hero powers
    
sh_set_hero_hpap(gHeroIDpcvarHealthpcvarArmor)
    
sh_set_hero_grav(gHeroIDpcvarGrav)
    
sh_set_hero_speed(gHeroIDpcvarSpeed)
    
sh_set_hero_dmgmult(gHeroIDpcvarMultCSW_DEAGLE)
    
sh_set_hero_shield(gHeroIDtrue)
    
    
// Register weapon change and weapon fire event
    
register_event("CurWeapon""weapon_change""be""1=1")
}

// Precache (download) the needed model
public plugin_precache()
{
    
precache_model(deagle_p)
    
precache_model(deagle_v)
}

public 
sh_hero_init(idheroIDmode)
{
    
// If the unique ID given by sh_create_hero is not the same as provided by sh_hero_init do nothing
    
if ( gHeroID != heroID ) return
    
    
// Runs each time the hero is added or dropped
    
switch(mode)
    {
        
// If the hero is added
        
case SH_HERO_ADD:
        {
            
gHasSinPower[id] = true
            
            
// Check if the client is an admin
            
sinutte_admincheck(id)
            
            
// If the guy is alive, give him weapon and model
            
if ( is_user_alive(id) )
            {
                
sinutte_weapon(id)
                
switch_model(id)
            }
        }
        
        
// If hero is dropped
        
case SH_HERO_DROP:
        {
            
gHasSinPower[id] = false
            
            
// If client is alive drop weapon
            
if ( is_user_alive(id) )
            {
                
sh_drop_weapon(idCSW_DEAGLE)
            }
        }
    }
}

// Runs each time client spawns
public sh_client_spawn(id)
{
    
// If client has hero and is alive give gun and model
    
if ( gHasSinPower[id] && is_user_alive(id) )
    {
        
switch_model(id)
        
sinutte_weapon(id)
    }
}

// Give client the gun!
sinutte_weapon(id)
{
    
sh_give_weapon(idCSW_DEAGLE)
}

public 
weapon_change(id)
{
    
// If client doesnt have power or sh is off do nothing
    
if ( !gHasSinPower[id] && !sh_is_active() ) return
    
    
// If weapon is not deagle do nothing
    
if ( read_data(2) != CSW_DEAGLE ) return
    
    
// Go set model on the gun
    
switch_model(id)
    
    
// If clip is 0 then reload the clients ammo
    
if ( read_data(3) == )
    {
        
sh_reload_ammo(id1)
    }
}

// Set the models
switch_model(id)
{
    if ( 
get_user_weapon(id) == CSW_DEAGLE )
    {
        
set_pev(idpev_viewmodel2deagle_v)
        
set_pev(idpev_weaponmodel2deagle_p)
    }
}

// Check if client is an admin or not
sinutte_admincheck(id)
{
    
//Make new array with 10 cells to store the admin cvar in
    
new accessLevel[10]
    
    
//Get what the admin cvar is and out the data inside the new array just created
    
get_pcvar_string(pcvarAdminFlagaccessLevel9)
    
    
// If client has hero but doesn't have the admin flag then drop hero and warn the client
    
if ( gHasSinPower[id] && !(get_user_flags(id) & read_flags(accessLevel) ) )
    {
        
client_print(idprint_chat"[SH](%s) **Jeanette ONLY** You are not authorized to use this hero"gHeroName)
        
gHasSinPower[id] = false
        client_cmd
(id"say drop %s"gHeroName)
    }

Now stop using that fucking retarded generator. (No fence JTPizzalover) Use this instead:

https://forums.alliedmods.net/showthread.php?t=120051
i will in the future.. but theres one problem with that hero.
/home/groups/amxmodx/tmp3/phpnqYnPy.sma(35) : error 017: undefined symbol "sh_set_hero_dmgmult"
/home/groups/amxmodx/tmp3/phpnqYnPy.sma(40) : warning 204: symbol is assigned a value that is never used: "pcvarMult"
Rizu is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 09-09-2010 , 14:25   Re: Need help with some scripting
Reply With Quote #7

Update your include files. You have 1.2.0.10 include files. the native sh_set_hero_dmgmult was not added before 1.2.0.14.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Rizu
Junior Member
Join Date: Aug 2010
Location: Norway
Old 09-09-2010 , 16:28   Re: Need help with some scripting
Reply With Quote #8

New issue.. If an non admin spam it, he can still pick it without being admin?
f:ex click'n 5-10 times.. and they get the hero?

Last edited by Rizu; 09-09-2010 at 17:09.
Rizu is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 09-09-2010 , 17:59   Re: Need help with some scripting
Reply With Quote #9

Turn off antiflood, or make it so antiflood returns PLUGIN_HANDLED_MAIN (this is smarter).
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Rizu
Junior Member
Join Date: Aug 2010
Location: Norway
Old 09-09-2010 , 18:16   Re: Need help with some scripting
Reply With Quote #10

And how do i do that?

Edit:
Fix'd.. i just deleted the antiflood.amxx. :p

Edit:
But then a new problem..
Now it can't be picked at all.

So, i'll try the _main part.
Seemly i can't compile it while adding _MAIN
"undified symbol"

Last edited by Rizu; 09-09-2010 at 20:30.
Rizu 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:48.


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