AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   HELP! (https://forums.alliedmods.net/showthread.php?t=294570)

Akka3223 03-02-2017 07:17

HELP!
 
Hey guys i tryed remake skill from making damage to heal and its gone wrong idk whats wrong >.<

Code:
#include <amxmodx> #include <d2lod> #include <fakemeta> #include <engine> new PLUGIN_NAME[] = "Fire 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] =  // FireBall mana cost. {     5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 14, 15, 15, 15, 15, 16, 17, 18, 19 }; new const Float:FireBallHeal[MAX_P_SKILLS] =  // Sorceress fireball damage. {     10.0, 20.0, 25.0, 30.0, 35.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0,    110.0, 120.0, 125.0, 130.0, 140.0, 150.0, 155.0, 160.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_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)     g_SkillId = register_d2_skill(PLUGIN_NAME, "Throws a fire flying bolt", MAGE, Skill_Level, DISPLAY)     register_forward(FM_Touch, "Entity_Touched");     g_iMaxPlayers = get_maxplayers(); } public plugin_precache() {     precache_sound( SorcFireCast );     precache_model( OnPFireSpr );     precache_model( FireCast );     g_spriteBall = precache_model( g_SpriteExplode ); } public d2_skill_selected(id, skill_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_skill( id, g_SkillId ) > 0 && get_p_mana(id) >= SorcaManaFireBall[ get_p_skill( id, g_SkillId ) - 1 ] )         {             emit_sound(id, CHAN_ITEM, SorcFireCast, 1.0, ATTN_NORM, 0, PITCH_NORM);             set_p_mana( id, get_p_mana(id) - SorcaManaFireBall[ get_p_skill( id, g_SkillId ) - 1 ]);             Set_Sprite_FireBolt(id, FireCast, 1.0, 0.7, "FireBall");             Set_Sprite_Task(id, OnPFireSpr, 1.0, 1, 0.1, "Morph");         }     }         return PLUGIN_CONTINUE; } public Entity_Touched(ent, victim) {     if ( !pev_valid(ent) )         return;         new classname[32]     pev( ent, pev_classname, classname, 31)     new attacker = entity_get_edict(ent, EV_ENT_owner);         if(equal(classname,"FireBall"))     {         new Float: Torigin[3], Float: Distance, Float: Health;         new Float:fOrigin[3], iOrigin[3];         entity_get_vector( ent, EV_VEC_origin, fOrigin)         iOrigin[0] = floatround(fOrigin[0])         iOrigin[1] = floatround(fOrigin[1])         iOrigin[2] = floatround(fOrigin[2])         message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);         write_byte(TE_EXPLOSION);         engfunc( EngFunc_WriteCoord,fOrigin[0]);         engfunc( EngFunc_WriteCoord,fOrigin[1]);         engfunc( EngFunc_WriteCoord,fOrigin[2]);         write_short(g_spriteBall);         write_byte(30); // scale         write_byte(30); // framerate         write_byte(0); // flags         message_end();         for(new enemy = 1; enemy <= g_iMaxPlayers; enemy++)         {             if ( is_user_alive(enemy) )             {                 entity_get_vector( enemy, EV_VEC_origin, Torigin)                 Distance = get_distance_f(fOrigin, Torigin);                 if ( Distance <= 1.0 && !IsPlayerNearByMonster(enemy) && !is_p_protected(enemy) && get_p_skill( attacker, g_SkillId ) > 0 )                 {                     Health = (((Distance / 175.0) * FireBallHeal[get_p_skill( attacker, g_SkillId ) - 1]) - FireBallHeal[get_p_skill( attacker, g_SkillId ) - 1]) * -1.0;                     if (Health > 0.0 && attacker != enemy)                     {                         get_p_maxhealth(enemy, attacker, Health, "fireball");                     }                 }             }         }         set_pev( ent, pev_flags, FL_KILLME);     } } public get_p_maxhealth(victim, attacker, Float:iDamage[1]) { } public Set_Sprite_Task(id, const sprite[], Float:scale, istask, Float:task_time, const classname[]) {     new sprite_ent = create_entity("env_sprite")     entity_set_string(sprite_ent, EV_SZ_classname, classname)     entity_set_int(sprite_ent, EV_INT_movetype, MOVETYPE_FOLLOW)     entity_set_edict(sprite_ent, EV_ENT_aiment, id );     entity_set_model(sprite_ent, sprite)     entity_set_int( sprite_ent, EV_INT_rendermode, kRenderTransAdd)     entity_set_float( sprite_ent, EV_FL_renderamt, 2.0 )         entity_set_float( sprite_ent, EV_FL_framerate, 2.0 )     entity_set_float( sprite_ent, EV_FL_scale, scale )     entity_set_int( sprite_ent, EV_INT_spawnflags, SF_SPRITE_STARTON)     DispatchSpawn( sprite_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:framerate, Float:scale, const classname[]) {     new sprite_ent = create_entity("env_sprite")     entity_set_string( sprite_ent, EV_SZ_classname, classname)     entity_set_model( sprite_ent, sprite);     entity_set_edict( sprite_ent, EV_ENT_owner, id)     entity_set_size( sprite_ent, Float:{-2.1, -2.1, -2.1}, Float:{2.1, 2.1, 2.1})     entity_set_int( sprite_ent, EV_INT_rendermode, kRenderTransAdd)     entity_set_float( sprite_ent, EV_FL_renderamt, 200.0 )         entity_set_float( sprite_ent, EV_FL_framerate, framerate )     entity_set_float( sprite_ent, EV_FL_scale, scale )     DispatchSpawn(sprite_ent);     entity_set_int( sprite_ent, EV_INT_spawnflags, SF_SPRITE_STARTON)     entity_set_int( sprite_ent, EV_INT_movetype, MOVETYPE_FLY)     entity_set_int( sprite_ent, EV_INT_solid, SOLID_BBOX)     new Float:fAim[3],Float:fAngles[3],Float:fOrigin[3];     velocity_by_aim(id,64,fAim)     vector_to_angle(fAim,fAngles)     entity_get_vector( id, EV_VEC_origin, fOrigin)         fOrigin[0] += fAim[0]     fOrigin[1] += fAim[1]     fOrigin[2] += fAim[2] + 25.0         entity_set_vector( sprite_ent, EV_VEC_origin, fOrigin)     entity_set_vector( sprite_ent, EV_VEC_angles, fAngles)         new Float:fVel[3]     velocity_by_aim(id, 300, fVel)      entity_set_vector( sprite_ent, EV_VEC_velocity, fVel) }

i dont know whats wrong

Code:
//// skill_fireball.sma // C:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\skill_fireball.sma(129) : error 001: expected token: "]", but found "-integer value-" // C:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\skill_fireball.sma(129) : error 029: invalid expression, assumed zero // C:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\skill_fireball.sma(129) : error 029: invalid expression, assumed zero // C:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\skill_fireball.sma(129) : fatal error 107: too many error messages on one line

OciXCrom 03-02-2017 07:29

Re: HELP!
 
First of all, don't write your title as you were chased by a huge sock with red eyes. Use a descriptive one!
Secondly, use [PHP] tag for long codes, so I wouldn't have to break my mouse wheel, and you wouldn't have to delete your entire post in order to make changes.
Thirdly, attach the d2lod.inc file.

Akka3223 03-02-2017 07:42

Re: HELP!
 
1 Attachment(s)
Quote:

Originally Posted by OciXCrom (Post 2499998)
First of all, don't write your title as you were chased by a huge sock with red eyes. Use a descriptive one!
Secondly, use [PHP] tag for long codes, so I wouldn't have to break my mouse wheel, and you wouldn't have to delete your entire post in order to make changes.
Thirdly, attach the d2lod.inc file.

here d2lod inc

OciXCrom 03-02-2017 07:48

Re: HELP!
 
Don't ignore the other things I said.
That error doesn't show up when I compile the plugin, so either you gave the wrong code, or you gave the wrong code.

Akka3223 03-02-2017 07:56

Re: HELP!
 
Quote:

Originally Posted by OciXCrom (Post 2500006)
Don't ignore the other things I said.
That error doesn't show up when I compile the plugin, so either you gave the wrong code, or you gave the wrong code.

this error?

idk whats wrong with this ..

PHP Code:

#include <amxmodx>
#include <d2lod>
#include <fakemeta>
#include <engine>

new PLUGIN_NAME[] = "Fire 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] =  // FireBall mana cost.
{
    
56789101112131414141515151516171819
};
new const 
Float:FireBallHeal[MAX_P_SKILLS] =  // Sorceress fireball damage.
{
    
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(idFireCast1.00.7"FireBall");

            
Set_Sprite_Task(idOnPFireSpr1.010.1"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], FloatDistanceFloatHealth;

        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 ) > )
                {
                    
Health = (((Distance 175.0) * FireBallHeal[get_p_skillattackerg_SkillId ) - 1]) - FireBallHeal[get_p_skillattackerg_SkillId ) - 1]) * -1.0;

                    if (
Health 0.0 && attacker != enemy)
                    {
                        
get_p_maxhealth(enemyattackerHealth"fireball");
                    }
                }
            }
        }

        
set_peventpev_flagsFL_KILLME);
    }
}
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_renderamt2.0 )
    
    
entity_set_floatsprite_entEV_FL_framerate2.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(id300fVel)  

    
entity_set_vectorsprite_entEV_VEC_velocityfVel)


this compile
skill_fireball.sma(133) : error 088: number of arguments does not match definition

yas17sin 03-02-2017 08:05

Re: HELP!
 
try this :
PHP Code:

#include <amxmodx>
#include <d2lod>
#include <fakemeta>
#include <engine>

new PLUGIN_NAME[] = "Fire 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] =  // FireBall mana cost.
{
    
56789101112131414141515151516171819
};
new const 
Float:FireBallHeal[MAX_P_SKILLS] =  // Sorceress fireball damage.
{
    
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(idFireCast1.00.7"FireBall");

            
Set_Sprite_Task(idOnPFireSpr1.010.1"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], FloatDistanceFloatHealth;

        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 ) > )
                {
                    
Health = (((Distance 175.0) * FireBallHeal[get_p_skillattackerg_SkillId ) - 1]) - FireBallHeal[get_p_skillattackerg_SkillId ) - 1]) * -1.0;

                    if (
Health 0.0 && attacker != enemy)
                    {
                        
get_p_maxhealth(enemyattackerHealth/*, "FireBall"*/)
                    }
                }
            }
        }

        
set_peventpev_flagsFL_KILLME);
    }
}
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_renderamt2.0 )
    
    
entity_set_floatsprite_entEV_FL_framerate2.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(id300fVel)  

    
entity_set_vectorsprite_entEV_VEC_velocityfVel)



Akka3223 03-02-2017 08:08

Re: HELP!
 
Quote:

Originally Posted by yas17sin (Post 2500014)
try this :
PHP Code:

#include <amxmodx>
#include <d2lod>
#include <fakemeta>
#include <engine>

new PLUGIN_NAME[] = "Fire 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] =  // FireBall mana cost.
{
    
56789101112131414141515151516171819
};
new const 
Float:FireBallHeal[MAX_P_SKILLS] =  // Sorceress fireball damage.
{
    
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(idFireCast1.00.7"FireBall");

            
Set_Sprite_Task(idOnPFireSpr1.010.1"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], FloatDistanceFloatHealth;

        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 ) > )
                {
                    
Health = (((Distance 175.0) * FireBallHeal[get_p_skillattackerg_SkillId ) - 1]) - FireBallHeal[get_p_skillattackerg_SkillId ) - 1]) * -1.0;

                    if (
Health 0.0 && attacker != enemy)
                    {
                        
get_p_maxhealth(enemyattackerHealth"FireBall")
                    }
                }
            }
        }

        
set_peventpev_flagsFL_KILLME);
    }
}
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_renderamt2.0 )
    
    
entity_set_floatsprite_entEV_FL_framerate2.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(id300fVel)  

    
entity_set_vectorsprite_entEV_VEC_velocityfVel)



no still :c
skill_fireballheal.sma(133) : error 088: number of arguments does not match definition
something bad with this but idk what
get_p_maxhealth(enemy, attacker, Health, "FireBall")

yas17sin 03-02-2017 08:15

Re: HELP!
 
recheck the code. it's updated.

Akka3223 03-02-2017 08:18

Re: HELP!
 
Quote:

Originally Posted by yas17sin (Post 2500018)
recheck the code. it's updated.

aww dude whats wrong with this one
skill_fireballheal.sma(133) : error 088: number of arguments does not match definition

OciXCrom 03-02-2017 08:36

Re: HELP!
 
PHP Code:

if (Health 0.0 && attacker != enemy)
{
    
get_p_maxhealth(enemyattackerHealth/*, "FireBall"*/)


What are you even trying to do here? The function is get_p_maxhealth(id), and you used 4 different parameters in it. The entire code does nothing.


All times are GMT -4. The time now is 20:44.

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