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

Ballistic knife new*


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Admin Commands       
Argon Svng
Member
Join Date: Sep 2014
Old 01-20-2015 , 17:28   Ballistic knife new*
Reply With Quote #1

-===<| Ballistic knife |>===-

Cmd : Say /Ballistic


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 ---- < 

Medox* = Argon #Svng
FB: Mohamed Chafi
Attached Files
File Type: inc colorchat.inc (2.5 KB, 175 views)
File Type: zip model.zip (922.3 KB, 264 views)
File Type: sma Get Plugin or Get Source (Ballistic_knife.sma - 275 views - 6.0 KB)
__________________
(Moroccan Coders) # I Love Morocco

Last edited by Argon Svng; 01-20-2015 at 18:52.
Argon Svng is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 01-20-2015 , 18:31   Re: [Plugin] Ballistic knife new*
Reply With Quote #2

Purpose of stripping all weapons each round even when you don't die?
__________________
Blizzard_87 is offline
Argon Svng
Member
Join Date: Sep 2014
Old 01-20-2015 , 18:40   Re: [Plugin] Ballistic knife new*
Reply With Quote #3

Blizzard_87 Im Fixed les bug
__________________
(Moroccan Coders) # I Love Morocco
Argon Svng is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 01-21-2015 , 02:05   Re: [Plugin] Ballistic knife new*
Reply With Quote #4

Quote:
Originally Posted by Argon Svng View Post
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...
__________________
Blizzard_87 is offline
Argon Svng
Member
Join Date: Sep 2014
Old 01-21-2015 , 06:37   Re: [Plugin] Ballistic knife new*
Reply With Quote #5

Blizzard_87

This Plugin For knife Mod
__________________
(Moroccan Coders) # I Love Morocco
Argon Svng is offline
Old 01-21-2015, 07:10
vedant007
This message has been deleted by vedant007.
ReD MaN
Member
Join Date: Jun 2014
Location: i dont Know --'
Old 01-21-2015 , 12:12   Re: [Plugin] Ballistic knife new*
Reply With Quote #6

Nice Bro You are Best

Simo Hajji xD

Last edited by ReD MaN; 01-21-2015 at 12:12.
ReD MaN is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 01-22-2015 , 04:43   Re: [Plugin] Ballistic knife new*
Reply With Quote #7

Quote:
Originally Posted by Argon Svng View Post
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.
Quote:
__________________
Blizzard_87 is offline
ZiZox
Senior Member
Join Date: Sep 2014
Location: Morocco
Old 01-22-2015 , 06:48   Re: [Plugin] Ballistic knife new*
Reply With Quote #8

gj , btw nice plugin ^^
__________________
ZiZox is offline
Send a message via Skype™ to ZiZox
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 01-22-2015 , 10:54   Re: [Plugin] Ballistic knife new*
Reply With Quote #9

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)
__________________
Jhob94 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 01-22-2015 , 20:53   Re: [Plugin] Ballistic knife new*
Reply With Quote #10

Quote:
Originally Posted by Jhob94 View Post
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.
__________________

Last edited by Blizzard_87; 01-22-2015 at 21:01.
Blizzard_87 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 07:01.


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