AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Ballistic knife new* (https://forums.alliedmods.net/showthread.php?t=255808)

Argon Svng 01-20-2015 17:28

Ballistic knife new*
 
3 Attachment(s)
-===<| Ballistic knife |>===-
http://im54.gulfup.com/YuX9BQ.png
Cmd : Say /Ballistic

http://im88.gulfup.com/p4b5YX.png
PHP Code:

#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <colorchat>
#include <hamsandwich>
#include <fakemeta_util>

const Hex_Value 0x21

new bool:g_Ballistic[Hex_Value], bool:has_rest[Hex_Value], bool:g_Remplace[Hex_Value]
new 
Ammo[Hex_Value], g_Block[Hex_Value]
new 
Cvar_stock[3// damage = 0 | ammo = 1 | rest = 2
new beamSpr

new Model_Ballistic[] = "models/v_Ballistic_knife.mdl"
new Model_Remplace[] = "models/v_knife_remplace.mdl"

public plugin_precache()
{
    
precache_model(Model_Ballistic)    
    
precache_model(Model_Remplace)
    
beamSpr precache_model("sprites/dot.spr")
}

public 
plugin_init()
{
    
register_plugin("Ballistic knife (fixed)","1.0.3","Medox* / Spawner")
    
    
register_clcmd("say /Ballistic","Ballistic_knife")
    
    
register_event("CurWeapon""CurrentWeapon""be""1=1")
    
register_forward(FM_CmdStart"CmdStart")
    
RegisterHam(Ham_Spawn"player""fw_spawn"1)
    
    
Cvar_stock[0] = register_cvar("ballistic_damage""100")
    
Cvar_stock[1] = register_cvar("ballistic_ammo""5")
    
Cvar_stock[2] = register_cvar("ballistic_rest""0.1")
}

public 
client_connect(id)     
    
Bool_off(id)

public 
fw_spawn(id)
{
    
Bool_off(id)    
    
strip_user_weapons(id)
    
give_item(id"weapon_knife")    
}

public 
Ballistic_knife(id)
{
    
g_Remplace[id] = false
    g_Ballistic
[id] = true
    g_Block
[id] = true
    Ammo
[id] = get_pcvar_num(Cvar_stock[1])
    
    
ColorChat(idGREEN"^4[Knife] ^1You are get Ballistic knife^4 5 ^1Ammo for shoter ^4!")    
}

public 
CmdStart(iduc_handleseed)
{    
    if(
is_user_alive(id))
    {
        static 
CurButton
        CurButton 
get_uc(uc_handleUC_Buttons)
        new 
Float:flNextAttack get_pdata_float(id835)
        
        if(
CurButton IN_ATTACK2
        { 
            if(
has_rest[id]) return PLUGIN_HANDLED
            
if(g_Block[id]) 
            {                
                
cmd_shote(id)
                
set_task(get_pcvar_float(Cvar_stock[2]), "reset_cmd"id)
                
has_rest[id] = true                    
                
                
if(Ammo[id] > 0  && flNextAttack <= 0.0)
                {            
                    
set_hudmessage(01272550.010.8506.01.0)
                    
show_hudmessage(id"Remaining Ammo: %d "Ammo[id])
                }        
                else
                {    
                    
g_Ballistic[id] = false
                    strip_user_weapons
(id)
                    
give_item(id"weapon_knife")
                    
g_Block[id] = false
                    g_Remplace
[id] = true
                    ColorChat
(idGREEN"^4[Knife] ^1You are not Ammo. you get Remplace Ballistic knife ^4!")
                }    
                
Ammo[id] -= 1
                
                CurButton 
&= ~IN_ATTACK2
                set_uc
(uc_handleUC_ButtonsCurButton)                
            }                    
        }
    }    
    else if(
is_user_alive (id) && !g_Block[id])
        return 
PLUGIN_CONTINUE
    
    
return PLUGIN_CONTINUE
}


// Cmd Shote ---- >
public cmd_shote(id
{
    static 
VictimBodyEndOrigin[3], BeamOrigin[3]
    
get_user_origin(idBeamOrigin3)
    
get_user_origin(idEndOrigin3)
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    
write_byte(TE_BEAMENTPOINT)
    
write_short(id 0x1000)
    
write_coord(BeamOrigin[0])    // Start X
    
write_coord(BeamOrigin[1])    // Start Y
    
write_coord(BeamOrigin[2])    // Start Z
    
write_short(beamSpr)             // Sprite
    
write_byte(1)              // Start frame                
    
write_byte(1)             // Frame rate                    
    
write_byte(1)            // Life
    
write_byte(25)           // Line width        
    
write_byte(0)            // Noise
    
write_byte(190)         // Red
    
write_byte(190)                 // Green
    
write_byte(190)                 // Blue
    
write_byte(150)            // Brightness                    
    
write_byte(25)              // Scroll speed                    
    
message_end()        
    
    
get_user_aiming(idVictimBody999999)
    if(
is_user_connected(Victim)) 
    {
        new 
Float:Damage floatget_damage_body(Bodyget_pcvar_float(Cvar_stock[0])) )
        
        new 
Float:VictimOrigin[3];
        
VictimOrigin[0] = float(EndOrigin[0])
        
VictimOrigin[1] = float(EndOrigin[1])
        
VictimOrigin[2] = float(EndOrigin[2])
        
        (
get_pcvar_float(Cvar_stock[0]) > 1) ? ExecuteHam(Ham_TakeDamageVictimididDamageDMG_NERVEGAS) : death_message(idVictim1"weapon_knife")    
    }
    else 
    {
        static 
ClassName[32]
        
pev(Victimpev_classnameClassNamecharsmax(ClassName))
        if(
equal(ClassName"func_breakable")) 
        {        
            if(
entity_get_float(VictimEV_FL_health) <= get_pcvar_num(Cvar_stock[0])) 
            {
                
force_use(idVictim)
            }
        }
    }
}

public 
reset_cmd(id)
    
has_rest[id] = false
// Cmd Shote ---- <

// Stock ---- >
stock death_message(KillerVictimScoreBoard, const Weapon[]) 
{
    
// Block death msg
    
set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET)
    
ExecuteHamB(Ham_KilledVictimKiller2)
    
set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT)
    
    
// Death
    
make_deathmsg(KillerVictim0Weapon)
    
cs_set_user_money(Killercs_get_user_money(Killer) + 3000)
    
    
// Update score board
    
if(ScoreBoard
    {
        
message_begin(MSG_BROADCASTget_user_msgid("ScoreInfo"))
        
write_byte(Killer// id
        
write_short(pev(Killerpev_frags)) // frags
        
write_short(cs_get_user_deaths(Killer)) // deaths
        
write_short(0// class?
        
write_short(get_user_team(Killer)) // team
        
message_end()
        
        
message_begin(MSG_BROADCASTget_user_msgid("ScoreInfo"))
        
write_byte(Victim// id
        
write_short(pev(Victimpev_frags)) // frags
        
write_short(cs_get_user_deaths(Victim)) // deaths
        
write_short(0// class?
        
write_short(get_user_team(Victim)) // team
        
message_end()
    }
}

stock get_damage_body(bodyFloat:damage
{
    switch(
body
    {
        case 
HIT_HEADdamage *= 4.0
        
case HIT_STOMACHdamage *= 1.1
        
case HIT_CHESTdamage *= 1.5
        
case HIT_LEFTARMdamage *= 0.77
        
case HIT_RIGHTARMdamage *= 0.77
        
case HIT_LEFTLEGdamage *= 0.75
        
case HIT_RIGHTLEGdamage *= 0.75
        
default: damage *= 1.0
    
}
    return 
floatround(damage)
}

stock Bool_off(index)
{
    
g_Ballistic[index] = false
    Ammo
[index] = false
    g_Block
[index] = false
    g_Remplace
[index] = false
}
// Stock ---- <

// CurWeapon ---- >
public CurrentWeapon(id)
{
    if(
get_user_weapon(id) == CSW_KNIFE && g_Ballistic[id])
    {
        
set_pev(idpev_viewmodel2Model_Ballistic)    
    }
    
    if(
get_user_weapon(id) == CSW_KNIFE && g_Remplace[id])
    {
        
set_pev(idpev_viewmodel2Model_Remplace)    
    }    
}
// CurWeapon ---- < 

http://im54.gulfup.com/U4a92H.png
Medox* = Argon #Svng
FB: Mohamed Chafi

Blizzard_87 01-20-2015 18:31

Re: [Plugin] Ballistic knife new*
 
Purpose of stripping all weapons each round even when you don't die?

Argon Svng 01-20-2015 18:40

Re: [Plugin] Ballistic knife new*
 
Blizzard_87 Im Fixed les bug

Blizzard_87 01-21-2015 02:05

Re: [Plugin] Ballistic knife new*
 
Quote:

Originally Posted by Argon Svng (Post 2251717)
Blizzard_87 Im Fixed les bug

what bug? because atm when anyone uses this plugin. they loose ANY weapon they bought regardless of them surviving the round... next round they loose all weapons... doesnt seem fair since this is NOT a game play mod and just a small plugin...

Argon Svng 01-21-2015 06:37

Re: [Plugin] Ballistic knife new*
 
Blizzard_87

This Plugin For knife Mod

ReD MaN 01-21-2015 12:12

Re: [Plugin] Ballistic knife new*
 
Nice Bro :) You are Best :)

Simo Hajji xD

Blizzard_87 01-22-2015 04:43

Re: [Plugin] Ballistic knife new*
 
Quote:

Originally Posted by Argon Svng (Post 2251881)
Blizzard_87

This Plugin For knife Mod

I'm fully aware of this... seems like you dont understand what I'm saying?

your plugin is only for knife yet it completely strips ALL weapons from player upon spawning regardless if they didnt die last round meaning they lose all there weapons.

ZiZox 01-22-2015 06:48

Re: [Plugin] Ballistic knife new*
 
gj , btw nice plugin ^^

Jhob94 01-22-2015 10:54

Re: [Plugin] Ballistic knife new*
 
Another copy/paste plugin probably. It's obvious that you don't know what you are doing since cmd_start doesnt seems badly done (you should credit the author of it, don't believe you did it on your own ->) but you are using curweapon for set the skins (really poor method)

Blizzard_87 01-22-2015 20:53

Re: [Plugin] Ballistic knife new*
 
Quote:

Originally Posted by Jhob94 (Post 2252359)
Another copy/paste plugin probably. It's obvious that you don't know what you are doing since cmd_start doesnt seems badly done (you should credit the author of it, don't believe you did it on your own ->) but you are using curweapon for set the skins (really poor method)

Adding to what Jhob94 said. You can use hamsandwich instead of using cpu intensive forwards.

Ham_Item_deploy for setting the model

Take a look at my knife realism plugin for ham usage.


All times are GMT -4. The time now is 15:06.

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