Raised This Month: $ Target: $400
 0% 

I can't find where is errors help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
aaa131
Junior Member
Join Date: May 2011
Location: Turkey
Old 07-10-2011 , 04:32   I can't find where is errors help
Reply With Quote #1

This is source code:

Code:
/* CVARS - copy and paste to shconfig.cfg

//Kakarot Ozel
kakarott_level 1               //Kakarott LeveL
kakarott_health 250        //Kakarott Hp
kakarott_armor 200        //Kakarott Armor
kakarott_xm1014mult 3.0        //Kakarott power


*/

/*
*
*/

#include <amxmod>
#include <Vexd_Utilities>
#include <superheromod>

// GLOBAL VARIABLES
new gHeroName[]="Kakarott Power(Admin)"
new bool:gHasKakarottPower[SH_MAXSLOTS+1]
new bool:gKakarottSelected[SH_MAXSLOTS+1]
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    // Plugin Info
    register_plugin("SUPERHERO Kakarott", "1.0", "Ahmet")

    // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    register_cvar("Kakarott_level", "9")
    register_cvar("Kakarott_health", "200")
    register_cvar("Kakarott_armor", "100")
    register_cvar("Kakarott_xm1014mult", "3.0")

    // FIRE THE EVENT TO CREATE THIS SUPERHERO!
    shCreateHero(gHeroName, "Mukemmel Silah", "Ozel xm1014 pompali silahi", false, 

"Kakarott_level")

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

    // EVENTS
    register_event("ResetHUD", "newSpawn","b")
    register_event("CurWeapon", "weaponChange", "be", "1=1")
    register_event("Damage", "Kakarott_damage", "b", "2!0")

    // Let Server know about Kakarots Variable
    shSetMaxHealth(gHeroName, "Kakarott_health")
    shSetMaxArmor(gHeroName, "Kakarott_armor")
    shSetShieldRestrict(gHeroName)
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
    precache_model("models/shmod/v_kakarott_ozel_silah.mdl")
    precache_model("models/shmod/p_kakarott_ozel_silah.mdl")
}
//----------------------------------------------------------------------------------------------
public Kakarott_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)
    
    if (!is_user_connected(id)) return
   
     gHasKakarottPower[id] = (hasPowers != 0); //set have power
         gKakarottSelected[id] = gHasKakarottPower[id];

        if(gHasKakarottPower[id] && is_user_connected(id)) { 
          Kakarott_admincheck(id);
    }

    //Reset thier shield restrict status
    //Shield restrict MUST be before weapons are given out
    shResetShield(id)

    if ( is_user_alive(id) ) {
        if ( hasPowers ) {
            Kakarott_weapons(id)
            switchmodel(id)
        }
        //This gets run if they had the power but don't anymore
        else if ( !hasPowers && gHasKakarottPower[id] ) {
            engclient_cmd(id, "drop", "weapon_xm1014")
            shRemHealthPower(id)
            shRemArmorPower(id)
        }
    }
}
//----------------------------------------------------------------------------------------------

public Kakarott_admincheck(id)
{
    new accessLevel[10]="a"

    if ( gHasKakarottPower[id] &&  !(get_user_flags(id)&read_flags(accessLevel)) ) {
        client_print(id, print_chat, "[SH](%s) **Admin** Siz bu heroyu kullanamazsiniz.",gHeroName)
        gHasKakarottPower[id] = false
        client_cmd(id, "say drop %s", gHeroName)
    }
}


//----------------------------------------------------------------------------------------------
public newSpawn(id)
{
    if ( shModActive() && gHasKakarottPower[id] && is_user_alive(id) ) {
        set_task(0.1, "Kakarott_weapons", id)

        new clip, ammo, wpnid = get_user_weapon(id, clip, ammo)
        if (wpnid != CSW_XM1014 && wpnid > 0) {
            new wpn[32]
            get_weaponname(wpnid, wpn, 31)
            engclient_cmd(id, wpn)
        }
    }
}
//----------------------------------------------------------------------------------------------
public Kakarott_weapons(id)
{
    if ( shModActive() && is_user_alive(id) ) {
        shGiveWeapon(id,"weapon_xm1014")
    }
}
//----------------------------------------------------------------------------------------------
public switchmodel(id)
{
    if ( !is_user_alive(id) ) return

    new clip, ammo, wpnid = get_user_weapon(id, clip, ammo)
    if ( wpnid == CSW_XM1014 ) {
        // Weapon Model change thanks to [CCC]Taz-Devil
        Entvars_Set_String(id, EV_SZ_viewmodel, "models/shmod/v_kakarott_ozel_silah.mdl")
        Entvars_Set_String(id, EV_SZ_weaponmodel, "models/shmod/p_kakarott_ozel_silah.mdl")
    }
}
//----------------------------------------------------------------------------------------------
public weaponChange(id)
{
    if ( !gHasKakarottPower[id] || !shModActive() ) return

    new wpnid = read_data(2)
    new clip = read_data(3)

    if ( wpnid != CSW_XM1014 ) return

    switchmodel(id)

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

    new damage = read_data(2)
    new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart)
    new headshot = bodypart == 1 ? 1 : 0

    if ( attacker <= 0 || attacker > SH_MAXSLOTS ) return

    if ( gHasKakarottPower[attacker] && weapon == CSW_XM1014 && is_user_alive(id) ) {
        // do extra damage
        new extraDamage = floatround(damage * get_cvar_float("Kakarott_xm1014mult") - damage)
        if (extraDamage > 0) shExtraDamage(id, attacker, extraDamage, "xm1014", headshot)
    }
}
//----------------------------------------------------------------------------------------------
public client_connect(id)
{
    gHasKakarottPower[id] = false
}
//----------------------------------------------------------------------------------------------
And warnings:

Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase,
AMX Mod X Team
/tmp/textbVyyGG.sma(77) : warning 217: loose indentation
/tmp/textbVyyGG.sma(80) : warning 217: loose indentation
/tmp/textbVyyGG.sma(86) : warning 217: loose indentation
Header size: 1680 bytes Code size: 6496 bytes
Data size: 3324 bytes
Stack/heap size: 16384 bytes; estimated max. usage=171 cells (684 bytes)
Total requirements: 27884 bytes
3 Warnings. Done.


I cant find where is errors help me please (Sry for bad english)
aaa131 is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 07-10-2011 , 06:14   Re: I can't find where is errors help
Reply With Quote #2

There are no errors.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Kennarn
Junior Member
Join Date: Sep 2009
Old 07-10-2011 , 20:03   Re: I can't find where is errors help
Reply With Quote #3

replace
PHP Code:
    if (!is_user_connected(id)) return
   
     
gHasKakarottPower[id] = (hasPowers != 0); //set have power
         
gKakarottSelected[id] = gHasKakarottPower[id];

        if(
gHasKakarottPower[id] && is_user_connected(id)) { 
          
Kakarott_admincheck(id);
    }

    
//Reset thier shield restrict status
    //Shield restrict MUST be before weapons are given out
    
shResetShield(id
with this

PHP Code:
    if (!is_user_connected(id)) return

    
//Reset thier shield restrict status
    //Shield restrict MUST be before weapons are given out
    
shResetShield(id)
    
    
gHasKakarottPower[id] = (hasPowers != 0); //set have power
    
gKakarottSelected[id] = gHasKakarottPower[id];
    
    if(
gHasKakarottPower[id] && is_user_connected(id)) {
          
Kakarott_admincheck(id);
    } 
That sould end your warnings. Loose indentation means your lines is messed up.

Last edited by Kennarn; 07-10-2011 at 20:05.
Kennarn 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 12:43.


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