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

help me to edited plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 02-08-2020 , 02:01   help me to edited plugin
Reply With Quote #1

Someone can add the list because it is a plugin???

models/new/w_model.mdl
weapon_sound (new/ak47-1.wav)
weapon_sound (new/ak47-2.wav)
weapon_sound (new/ak47-boltpull.wav)
weapon_sound (new/ak47-clipin.wav)
weapon_sound (new/ak47-clipout.wav)

And capacity Ammo (105)
And if he were alive in the new round, he would have a weapon

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <amxmisc>
#include <xs>
#include <engine>

#define PLUGIN "Ak-47"
#define VERSION "1.0"
#define AUTHOR "AlferD"

#define CLIP 30

#define is_valid_player(%1) (1 <= %1 <= 32)

#define Get_BitVar(%1,%2) (%1 & (1 << (%2 & 31)))
#define Set_BitVar(%1,%2) %1 |= (1 << (%2 & 31))
#define UnSet_BitVar(%1,%2) %1 &= ~(1 << (%2 & 31))

new const CSW_NEWPN CSW_AK47
new const weapon_newpn[] = "weapon_ak47"

new V_MODEL[64] = "models/new/v_ak47.mdl"
new P_MODEL[64] = "models/new/p_ak47.mdl"

/* Pcvars */
new cvar_dmgmultipliercvar_goldbullets,  cvar_custommodelcvar_costg_has_weapon

new Fload:g_clip[33]

new 
bullets33 ]

new 
bool:g_HasG[33]

new 
msg_CurWeapon

// Sprite
new m_spriteTexture

const Wep_g = ((1<<CSW_AK47))

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
/* CVARS */
    
cvar_dmgmultiplier register_cvar("Ak_dmg_multiplier""6")
    
cvar_custommodel register_cvar("Ak_custom_model""1")
    
cvar_goldbullets register_cvar("Ak_gold_bullets""0")
    
cvar_cost register_cvar("Ak_cost""2500")
    
    
RegisterHam(Ham_Item_PostFrameweapon_newpn"Fw_Item_PostFrame");
    
RegisterHam(Ham_Weapon_Reloadweapon_newpn"Fw_Weapon_Reload");
    
RegisterHam(Ham_Weapon_Reloadweapon_newpn"Fw_Weapon_Reload_Post"1);
         
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
     
    
// Register The Buy Cmd
    
register_clcmd"weapons_ak47""Buy");
    
// Death Msg
    
register_event("DeathMsg""Death""a")
    
// Weapon Pick Up
    
register_event("WeapPickup","checkModel","b","1=19")
    
// Current Weapon Event
    
register_event("CurWeapon","checkWeapon","be","1=1")
    
register_event("CurWeapon""make_tracer""be""1=1""3>0")
    
// Ham TakeDamage
    
register_forwardFM_CmdStart"fw_CmdStart" )
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1)
    
msg_CurWeapon get_user_msgid("CurWeapon");
}

public 
Do_RegisterHam(id)
{
    
RegisterHamFromEntity(Ham_TraceAttackid"Fw_TraceAttack_Player");
}

public 
client_connect(id)
{
    
g_HasG[id] = false
}

public 
client_disconnect(id)
{
    
g_HasG[id] = false
}

public 
Death()
{
    
g_HasG[read_data(2)] = false
}

public 
fwHamPlayerSpawnPost(id)
{
    
g_HasG[id] = false
}

public 
plugin_precache()
{
    
precache_model(V_MODEL)
    
precache_model(P_MODEL)
    
m_spriteTexture precache_model("sprites/dot.spr")
}

public 
Buy(id)
{

    if ( !
is_user_alive(id) )
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
money cs_get_user_money(id)
    
    if (
money >= get_pcvar_num(cvar_cost))
    {
        
Set_BitVar(g_has_weaponid)
        new 
weapon give_item(idweapon_newpn)
        
cs_set_user_money(idmoney get_pcvar_num(cvar_cost))
        
cs_set_weapon_ammo(weaponCLIP)
        
g_HasG[id] = true
                
        engfunc
(EngFunc_MessageBeginMSG_ONE_UNRELIABLEmsg_CurWeapon, {000}, id)
        
write_byte(1)
        
write_byte(CSW_NEWPN)
        
write_byte(CLIP)
        
message_end()
    }
    
    else
    {
        
client_print(idprint_center"you have insufficient funds!")
    }
    return 
PLUGIN_HANDLED
}

public 
checkModel(id)
{
    if ( !
g_HasG[id] )
        return 
PLUGIN_HANDLED
    
    
new szWeapID read_data(2)
    
    if ( 
szWeapID == CSW_NEWPN && g_HasG[id] == true && get_pcvar_num(cvar_custommodel) )
    {
        
set_pev(idpev_viewmodel2V_MODEL)
        
set_pev(idpev_weaponmodel2P_MODEL)
    }
    return 
PLUGIN_HANDLED
}

public 
checkWeapon(id)
{
    new 
plrAmmo
    
new plrWeapId
    
    plrWeapId 
get_user_weapon(idplrAmmo)
    
    if (
plrWeapId == CSW_NEWPN && g_HasG[id])
    {
        
checkModel(id)
    }
    else 
    {
        return 
PLUGIN_CONTINUE
    
}
    
    return 
PLUGIN_HANDLED
}



public 
fw_TakeDamage(victiminflictorattackerFloat:damage)
{
    if ( 
is_valid_playerattacker ) && get_user_weapon(attacker) == CSW_NEWPN && g_HasG[attacker] )
    {
        
SetHamParamFloat(4damage get_pcvar_floatcvar_dmgmultiplier ) )
    }
}

public 
fw_CmdStartiduc_handleseed )
{
    if( !
is_user_aliveid ) ) 
        return 
PLUGIN_HANDLED
    
    
if( ( get_ucuc_handleUC_Buttons ) & IN_ATTACK2 ) && !( pevidpev_oldbuttons ) & IN_ATTACK2 ) )
    {
        new 
szClipszAmmo
        
new szWeapID get_user_weaponidszClipszAmmo )
    }
    return 
PLUGIN_HANDLED
}


public 
make_tracer(id)
{
    if (
get_pcvar_num(cvar_goldbullets))
    {
        new 
clip,ammo
        
new wpnid get_user_weapon(id,clip,ammo)
        new 
pteam[16]
        
        
get_user_team(idpteam15)
        
        if ((
bullets[id] > clip) && (wpnid == CSW_NEWPN) && g_HasG[id]) 
        {
            new 
vec1[3], vec2[3]
            
get_user_origin(idvec11// origin; your camera point.
            
get_user_origin(idvec24// termina; where your bullet goes (4 is cs-only)
            
            
            //BEAMENTPOINTS
            
message_beginMSG_BROADCAST,SVC_TEMPENTITY)
            
write_byte (0)     //TE_BEAMENTPOINTS 0
            
write_coord(vec1[0])
            
write_coord(vec1[1])
            
write_coord(vec1[2])
            
write_coord(vec2[0])
            
write_coord(vec2[1])
            
write_coord(vec2[2])
            
write_shortm_spriteTexture )
            
write_byte(1// framestart
            
write_byte(5// framerate
            
write_byte(2// life
            
write_byte(10// width
            
write_byte(0// noise
            
write_byte255 )     // r, g, b
            
write_byte215 )       // r, g, b
            
write_byte)       // r, g, b
            
write_byte(200// brightness
            
write_byte(150// speed
            
message_end()
        }
        
        
bullets[id] = clip
    
}
    
}

stock drop_prim(id
{
    new 
weapons[32], num
    get_user_weapons
(idweaponsnum)
    for (new 
0numi++) {
        if (
Wep_g & (1<<weapons[i])) 
        {
            static 
wname[32]
            
get_weaponname(weapons[i], wnamesizeof wname 1)
            
engclient_cmd(id"drop"wname)
        }
    }
}

public 
Fw_Item_PostFrame(weapon)
{
    if(!
pev_valid(weapon))
        return 
HAM_IGNORED
    
    
static id
    id 
pev(weaponpev_owner)
    
    if(
is_user_alive(id) && Get_BitVar(g_has_weaponid))
    {    
        static 
Float:flNextAttackflNextAttack get_pdata_float(id835);
        static 
bpammobpammo cs_get_user_bpammo(idCSW_NEWPN);
        static 
i_clipi_clip get_pdata_int(weapon514);
        static 
fInReloadfInReload get_pdata_int(weapon544);
        
        if(
fInReload && flNextAttack <= 0.0)
        {
            static 
temp1temp1 min(CLIP i_clipbpammo);

            
set_pdata_int(weapon51i_clip temp14);
            
cs_set_user_bpammo(idCSW_NEWPNbpammo temp1);
            
            
set_pdata_int(weapon5404);
            
            
fInReload 0
        
}        
    }
    
    return 
HAM_IGNORED    
}

public 
Fw_Weapon_Reload(weapon)
{
    static 
idid pev(weaponpev_owner);
    
    if(!
is_user_alive(id))
        return 
HAM_IGNORED
        
    
if(!Get_BitVar(g_has_weaponid))
        return 
HAM_IGNORED
    
    g_clip
[id] = -1;
    
    static 
bpammobpammo cs_get_user_bpammo(idCSW_NEWPN);
    static 
i_clipi_clip get_pdata_int(weapon514);
    
    if(
bpammo <= 0)
        return 
HAM_SUPERCEDE
    
    
if(i_clip >= CLIP)
        return 
HAM_SUPERCEDE        
        
    g_clip
[id] = i_clip;

    return 
HAM_HANDLED
}

public 
Fw_Weapon_Reload_Post(weapon)
{
    static 
id;
    
id pev(weaponpev_owner);
    
    if(!
is_user_alive(id))
        return 
HAM_IGNORED
    
    
if(!Get_BitVar(g_has_weaponid))
        return 
HAM_IGNORED

    
if (g_clip[id] == -1)
        return 
HAM_IGNORED
    
    set_pdata_int
(weapon51g_clip[id], 4);
    
set_pdata_int(weapon5414);

    return 
HAM_HANDLED

Please help me if you can...

Last edited by alferd; 02-10-2020 at 10:04.
alferd 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 03:11.


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