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

Help with diablo2 compile errors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Akka3223
Member
Join Date: Oct 2016
Old 03-21-2017 , 17:41   Help with diablo2 compile errors
Reply With Quote #1

Hey..
Can any one help me with this one
i try to make skill that shoots a ball that heal


Natives:
PHP Code:
// Diablo II LoD Include File //
#if defined _diablo2LOD_included
  #endinput
#endif
#define _diablo2LOD_included

#define MAX_P_SKILLS 20

// Gets the max skills are loaded
native MAX_SKILLS_ACTIVE();
// Gets the max items are loaded
native MAX_ITEMS_ACTIVE();

// Hero class values
enum
{
    
HUNTER 0,
    
ASSASSIN,
    
WARLOCK,
    
WARRIOR,
    
ROGUE,
    
DRUID,
    
MAGE
}

// Log type values
enum
{
    
UNLOGGED 0,
    
LOGGED
}

// Display value, while selecting skill 'E' button.
enum
{
    
NOT_DISPLAY 0,
    
DISPLAY
}

// Item types
enum
{
    
TYPE_GLOVES 0,
    
TYPE_BOOTS,
    
TYPE_BELT,
    
TYPE_ARMOR,
    
TYPE_HELM,
    
TYPE_SHIELD,
    
TYPE_WEAPON,
    
TYPE_RING,
    
TYPE_AMULET,
    
TYPE_BOLTS
}

// Called when you pressed E button and selected the skill.
forward d2_skill_selected(idskill_id);

// Called when you fired a skill, bind t +skills.
forward d2_skill_fired(id);

// Called when player gets damaged, 1-st parameter is victim, 2-nd is attacker, 3-rd is Array parameter means damage done.
forward d2_takedamage(victimattackerFloat:iDamage[1]);

// Called when player gets damaged by skill, 1-st parameter is victim, 2-nd is attacker, 3-rd is Array parameter means damage done.
forward d2_skill_takedamage(victimattackerFloat:iDamage[1]);

// Called when player gets damaged by weapon with poison, 1-st parameter is victim, 2-nd is attacker, 3-rd is Array parameter means damage done.
forward d2_dagger_poisondamage(victimattackerFloat:iDamage[1]);

// Called when player gets damaged by RANGED attack, 1-st parameter is victim, 2-nd is attacker, 3-rd is Array parameter means damage done.
forward d2_ranged_takedamage(victimattackerFloat:iDamage[1]);

// Called when player successfully fires arrow, 1-st parameter is playerid, 2-nd is entityid.
forward d2_ranged_actshoot(identity);

// Called when the player is logged/unlogged.
forward d2_logged(idlog_type);

// Gets the player's current speed.
native Float:get_current_speed(id);

// if is player logged/unlogged.
native get_player_logged(id);

// Gets player's max health.
native get_p_maxhealth(id);

// Sets player's max health.
native set_p_maxhealth(idvalue);

// Sets player xp with X value.
native set_p_xp(idvalue);

// Gets player xp.
native get_p_xp(id);

// Gets player current hero.
native get_p_hero(id);

// Gets player level.
native get_p_level(id);

// Sets player current mana.
native set_p_mana(idvalue);

// Gets player current mana.
native get_p_mana(id);

// Gets player vitality.
native get_p_vitality(id);

// Sets player vitality.
native set_p_vitality(idvalue);

// Sets player gold.
native set_p_gold(idvalue);

// Sets player inventory gold.
native set_p_gold_inventory(idvalue);

// Gets player gold.
native get_p_gold(id);

// Gets player inventory gold.
native get_p_gold_inventory(id);

// Gets player skill's value.
native get_p_skill(idskill_id);

// Resets player model to custom.
native reset_p_model(id);

// Gets player's current item count.
native get_p_item_count(iditem_id);

// If is player wear item returns true.
native get_p_item_is_worn(iditem_id);

// Gets if player wears any item with specified type
native bool:get_p_item_wear_type(idtype);

// Gets if player wears any item with specified data type
native bool:get_p_item_data(iddata);

// Gets if player is in safe zone ( Near Akara, Charsi, Inventory ).
native bool:get_p_in_safezone(id);

// Gets if is player protected, if spawn protection time passed.
native bool:is_p_protected(id);

// Checks if is a freezetime.
native is_freezetime();

// Checks if is player near monster
native bool:IsPlayerNearByMonster(id);

// Damages a player, 1-st parameter is victim, 2-nd is attacker, 3-rd is damage , 4-th is weapon type string.
native dmg_kill_player(idattackerFloat:damageweaponDescription[])

// Drops coins from give id/victim with specified classname and gold value stored in entity.
native drop_coins(victimclassname[], goldvalue);

// Sets user model.
native set_user_model(id, const model[]);

stock find_itemplugin()
{
    for(new 
0get_pluginsnum(); ++i)
    {
        new 
temp[2], name[64]
        
get_plugin(iname63temp1temp1temp1temp1)
         if(
equali(name"diablo2LOD.amxx")) 
        {
             return 
i;
        }
    }

     return -
1;
}

stock find_itemindex()
{
    new 
temp[2], name[64], pluginname[64]
    
get_plugin(-1pluginname63temp1temp1temp1temp1)
    for (new 
0get_pluginsnum(); ++i)
    {
        
get_plugin(iname63temp1temp1temp1temp1)
         if(
equal(namepluginname))
        {
             return 
i
        
}
    }

     return -
1
}
stock register_d2_skill(skill_name[], skill_desc[], skill_heroskill_levelskill_display)
{
    new 
SkillId find_itemindex()
    new 
SkillPlugin find_itemplugin()
    new 
SkillRegFunc get_func_id("register_skill"SkillPlugin)

    new 
temp callfunc_begin_i(SkillRegFuncSkillPlugin)
    if(
temp == -|| temp == -2)
    {
        
log_amx("Plugin not found or function is not executable!")
        return 
PLUGIN_HANDLED;        
    }

    
callfunc_push_int(SkillId)
    
callfunc_push_str(skill_name)
    
callfunc_push_str(skill_desc)
    
callfunc_push_int(skill_hero)
    
callfunc_push_int(skill_level)
    
callfunc_push_int(skill_display)
    
    
temp callfunc_end()
    if(
temp == -|| temp == -2
    {
        return 
PLUGIN_HANDLED;
    }

    return 
temp;
}
stock client_printcolor(const id, const input[], any:...)
{
    new 
count 1players[32];

    static 
msg[191];
    
vformat(msg,190,input,3);

    
replace_all(msg,190,"/g","^4");// green txt
    
replace_all(msg,190,"/y","^1");// orange txt
    
replace_all(msg,190,"/ctr","^3");// team txt

    
if (idplayers[0] = id
    else 
get_players(players,count,"ch");

    for (new 
i=0;i<count;i++)
    {
        if (
is_user_connected(players[i]))
        {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
            
write_byte(players[i]);
            
write_string(msg);
            
message_end();
        }
    }

Script:
PHP Code:
#include <amxmodx>
#include <d2lod>
#include <fakemeta>
#include <engine>

new PLUGIN_NAME[] = "Heal Ball"
new PLUGIN_AUTHOR[] = "AkkaStyle"
new PLUGIN_VERSION[] = "1.0"

new Skill_Level 12;

new const 
SorcFireCast[] = "d2lod/firecast.wav";
new const 
OnPFireSpr[] = "sprites/xfire2.spr";
new const 
FireCast[] = "sprites/rjet1.spr";
new const 
g_SpriteExplode[] = "sprites/explosion1.spr";

new const 
SorcaManaFireBall[MAX_P_SKILLS] =  //
{
    
56789101112131414141515151516171819
};
new const 
Float:FireBallDamage[MAX_P_SKILLS] =  //
{
    
10.020.025.030.035.040.050.060.070.080.090.0100.0,     110.0120.0125.0130.0140.0150.0155.0160.0
};

new 
g_SkillId;

new 
g_iCurSkill[33];
new 
Float:g_LastPressedSkill[33];
new 
g_spriteBall;
new 
g_iMaxPlayers;

public 
plugin_init() 
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)

    
g_SkillId register_d2_skill(PLUGIN_NAME"Throws a fire flying bolt"MAGESkill_LevelDISPLAY)

    
register_forward(FM_Touch"Entity_Touched");

    
g_iMaxPlayers get_maxplayers();
}

public 
plugin_precache()
{
    
precache_soundSorcFireCast );
    
precache_modelOnPFireSpr );
    
precache_modelFireCast );
    
g_spriteBall precache_modelg_SpriteExplode );
}

public 
d2_skill_selected(idskill_id)
{
    
g_iCurSkill[id] = skill_id;
}

public 
d2_skill_fired(id)
{
    if ( 
g_iCurSkill[id] == g_SkillId )
    {
        static 
Float:cdown;
        
cdown 1.0;

        if (
get_gametime() - g_LastPressedSkill[id] <= cdown
        {
            return 
PLUGIN_HANDLED;
        }
        else if ( 
get_gametime() - g_LastPressedSkill[id] >= cdown )
        {
            
g_LastPressedSkill[id] = get_gametime()
        }

        if ( 
get_p_skillidg_SkillId ) > && get_p_mana(id) >= SorcaManaFireBallget_p_skillidg_SkillId ) - ] )
        {
            
emit_sound(idCHAN_ITEMSorcFireCast1.0ATTN_NORM0PITCH_NORM);

            
set_p_manaidget_p_mana(id) - SorcaManaFireBallget_p_skillidg_SkillId ) - ]);

            
Set_Sprite_FireBolt(idFireCast50.00.7"FireBall");

            
Set_Sprite_Task(idOnPFireSpr2.710.8"Morph");
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
Entity_Touched(entvictim)
{
    if ( !
pev_valid(ent) )
        return;
    
    new 
classname[32]
    
peventpev_classnameclassname31)

    new 
attacker entity_get_edict(entEV_ENT_owner);
    
    if(
equal(classname,"FireBall")) 
    {
        new 
FloatTorigin[3], FloatDistanceFloatDamage;
        new 
FloatTorigin[3], FloatDistanceMaxHealth;

        new 
Float:fOrigin[3], iOrigin[3];
        
entity_get_vectorentEV_VEC_originfOrigin)    
        
iOrigin[0] = floatround(fOrigin[0])
        
iOrigin[1] = floatround(fOrigin[1])
        
iOrigin[2] = floatround(fOrigin[2])    

        
message_begin(MSG_BROADCAST,SVC_TEMPENTITYiOrigin);
        
write_byte(TE_EXPLOSION);
        
engfuncEngFunc_WriteCoord,fOrigin[0]);
        
engfuncEngFunc_WriteCoord,fOrigin[1]);
        
engfuncEngFunc_WriteCoord,fOrigin[2]);
        
write_short(g_spriteBall);                                                  
        
write_byte(30); // scale
        
write_byte(30); // framerate
        
write_byte(0); // flags
        
message_end();

        for(new 
enemy 1enemy <= g_iMaxPlayersenemy++)
        {    
            if ( 
is_user_alive(enemy) )
            {
                
entity_get_vectorenemyEV_VEC_originTorigin)

                
Distance get_distance_f(fOriginTorigin);

                if ( 
Distance <= 1.0 && !IsPlayerNearByMonster(enemy) && !is_p_protected(enemy) && get_p_skillattackerg_SkillId ) > )
                {
                    
MaxHealth = (((Distance 175.0) * FireBallDamage[get_p_skillattackerg_SkillId ) - 1]) -  FireBallDamage[get_p_skillattackerg_SkillId ) - 1]) * -1.0;

                    if( 
get_user_health(enemy) + MaxHealth get_p_maxhealth(enemy))
                    {
                        
set_p_maxhealth(enemyget_p_maxhealth(enemy));
                    }
                    else
                    {
                        
set_p_maxhealth(enemyget_p_maxhealth(enemy) + MaxHealth);
                    }
                }
            }
        }      
        
        
set_peventpev_flagsFL_KILLME);
    }
}
public 
d2_takedamage(victimattackerFloat:iDamage[1])
{

}

public 
Set_Sprite_Task(id, const sprite[], Float:scaleistaskFloat:task_time, const classname[])
{
    new 
sprite_ent create_entity("env_sprite")

    
entity_set_string(sprite_entEV_SZ_classnameclassname)
    
entity_set_int(sprite_entEV_INT_movetypeMOVETYPE_FOLLOW)
    
entity_set_edict(sprite_entEV_ENT_aimentid );
    
entity_set_model(sprite_entsprite)

    
entity_set_intsprite_entEV_INT_rendermodekRenderTransAdd)
    
entity_set_floatsprite_entEV_FL_renderamt200.0 )
    
    
entity_set_floatsprite_entEV_FL_framerate22.0 )
    
entity_set_floatsprite_entEV_FL_scalescale )
    
entity_set_intsprite_entEV_INT_spawnflagsSF_SPRITE_STARTON)
    
DispatchSpawnsprite_ent )

    if ( 
istask )
    {
        
set_task(task_time"End_Sprite_Task"sprite_ent);
    }
}
public 
End_Sprite_Task(sprite_ent)
{
    if ( 
is_valid_ent(sprite_ent) )
    {
        
remove_entity(sprite_ent);
    }
}
public 
Set_Sprite_FireBolt(id, const sprite[], Float:framerateFloat:scale, const classname[])
{
    new 
sprite_ent create_entity("env_sprite")

    
entity_set_stringsprite_entEV_SZ_classnameclassname)
    
entity_set_modelsprite_entsprite);

    
entity_set_edictsprite_entEV_ENT_ownerid)

    
entity_set_sizesprite_entFloat:{-2.1, -2.1, -2.1}, Float:{2.12.12.1})

    
entity_set_intsprite_entEV_INT_rendermodekRenderTransAdd)
    
entity_set_floatsprite_entEV_FL_renderamt200.0 )
    
    
entity_set_floatsprite_entEV_FL_framerateframerate )
    
entity_set_floatsprite_entEV_FL_scalescale )

    
DispatchSpawn(sprite_ent);
    
entity_set_intsprite_entEV_INT_spawnflagsSF_SPRITE_STARTON)

    
entity_set_intsprite_entEV_INT_movetypeMOVETYPE_FLY)
    
entity_set_intsprite_entEV_INT_solidSOLID_BBOX)

    new 
Float:fAim[3],Float:fAngles[3],Float:fOrigin[3];

    
velocity_by_aim(id,64,fAim)
    
vector_to_angle(fAim,fAngles)
    
entity_get_vectoridEV_VEC_originfOrigin)
    
    
fOrigin[0] += fAim[0]
    
fOrigin[1] += fAim[1]
    
fOrigin[2] += fAim[2] + 25.0
    
    entity_set_vector
sprite_entEV_VEC_originfOrigin)
    
entity_set_vectorsprite_entEV_VEC_anglesfAngles)
    
    new 
Float:fVel[3]
    
velocity_by_aim(id500fVel)    

    
entity_set_vectorsprite_entEV_VEC_velocityfVel)

Compile
Code:
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\d.sma(101) : error 021: symbol already defined: "Torigin"
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\d.sma(120) : warning 217: loose indentation
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\d.sma(130) : warning 213: tag mismatch
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\d.sma(144) : warning 217: loose indentation
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\d.sma(145) : warning 203: symbol is never used: "Damage"
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\d.sma(145) : warning 203: symbol is never used: "Distance"
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\d.sma(145) : warning 204: symbol is assigned a value that is never used: "Torigin"

Last edited by Akka3223; 03-22-2017 at 01:06.
Akka3223 is offline
Akka3223
Member
Join Date: Oct 2016
Old 03-22-2017 , 11:50   Re: Help with diablo2 compile errors
Reply With Quote #2

cmon no one can help..
Akka3223 is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 03-22-2017 , 11:52   Re: Help with diablo2 compile errors
Reply With Quote #3

he compile but give warnings?
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
Akka3223
Member
Join Date: Oct 2016
Old 03-22-2017 , 11:57   Re: Help with diablo2 compile errors
Reply With Quote #4

Quote:
Originally Posted by D3XT3R View Post
he compile but give warnings?
Yea its gives warnings..
but error too

PHP Code:
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\d.sma(101) : error 021: symbol already defined: "Torigin"
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\d.sma(120) : warning 217: loose indentation
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\d.sma(130) : warning 213: tag mismatch
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\d.sma(144) : warning 217: loose indentation
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\d.sma(145) : warning 203: symbol is never used: "Damage"
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\d.sma(145) : warning 203: symbol is never used: "Distance"
// C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\d.sma(145) : warning 204: symbol is assigned a value that is never used: "Torigin"
//
// 1 Error.
// Could not locate output file C:\Games\Counter-Strike 1.6\cstrike\addons\amxmodx\scripting\compiled\d.amx (compile failed).
//
// Compilation Time: 1.31 sec
// ----------------------------------------

Press enter to exit ... 
Akka3223 is offline
Reply


Thread Tools
Display Modes

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 00:47.


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