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

Gun Xp Mod (Last Updated : 10-02-2011)


Post New Thread Reply   
 
Thread Tools Display Modes
Unknown Guy
Member
Join Date: Dec 2014
Location: Munich, Germany
Old 04-26-2015 , 13:17   Re: Gun Xp Mod (Last Updated : 10-02-2011)
Reply With Quote #851

[Tutorial]
How to create unlocks in GunXP mod?

1-
First you need a sma of example. I am using this code:

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

new PLUGIN_NAME[]     = "Template of unlock"
new PLUGIN_AUTHOR[]     = "xBatista [Jezza for templete]"
new PLUGIN_VERSION[]     = "1.0"

new const WEAPON_V_MDL[] = "add your model here";
#define WEAPON_CSW CSW_ADD YOUR CSW like AK47
new const weapon_n[] = "weapon_Add your weapon like ak47";

const 
m_pPlayer    41;
const 
m_flPrimaryAttack 46;

#define IsPlayer(%1)  ( 1 <= %1 <= g_maxplayers )

new g_hasZoom[33];

new 
damage_weaponpCvarRofweapon_recoil;
new 
g_maxplayers;    
new 
bool:g_Weapon[33]; 
new 
Float:cl_pushangle[33][3];
new 
szClipszAmmo;

public 
plugin_init() 
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_gxm_item("Unlock Name""Description"add number of xp that how much it will cost for unlock like 100)

    
damage_weapon register_cvar("gxm_damage_ak","1.5"); // damage multiplier
    
pCvarRof register_cvar"ak_rof""0.090" ); // weapon rof
    
weapon_recoil register_cvar"ak_recoil""0.8" ); // weapon recoil

    
register_event("CurWeapon""Event_CurWeapon""be""1=1");
    
    
RegisterHamHam_Weapon_PrimaryAttackweapon_n"Fwd_AttackSpeedPost" );
    
RegisterHam(Ham_Weapon_PrimaryAttackweapon_n"Fwd_AttackSpeedPre");

        
RegisterHamHam_Item_Deploy weapon_n"Fwd_AttackSpeedPost");

    
RegisterHam(Ham_TakeDamage"player""Ham_DamageWeapon");

    
register_forwardFM_CmdStart"Fwd_CmdStart" );

    
g_maxplayers get_maxplayers();
}
public 
gxm_item_enabled(id
{
    
g_Weapon[id] = true;
}
public 
client_connect(id
{
    
g_Weapon[id] = false;
}
public 
plugin_precache()  
{
    
engfunc(EngFunc_PrecacheModelWEAPON_V_MDL);
}

public 
Fwd_AttackSpeedPre(Ent)
{
    new 
id pev(Ent,pev_owner);
    
entity_get_vectoridEV_VEC_punchanglecl_pushangle[id]);
}
public 
Fwd_AttackSpeedPost( const Entity )
{
    static 
id id get_pdata_cbase(Entitym_pPlayer4)
    if (
g_Weapon[id] && IsPlayer(id) )
    {
        
set_pdata_floatEntitym_flPrimaryAttackget_pcvar_floatpCvarRof ), );

        new 
Float:push[3];
        
entity_get_vectoridEV_VEC_punchanglecl_pushangle[id]);
        
xs_vec_subpushcl_pushangle[id], push);
        
xs_vec_mul_scalarpushget_pcvar_floatweapon_recoil ), push);
        
xs_vec_addpushcl_pushangle[id], push);
        
entity_set_vectoridEV_VEC_punchanglepush);
    }
}

public 
Ham_DamageWeapon(idinflictorattackerFloat:damagedamagebits
{
    if ( !
IsPlayer(attacker) || !g_Weapon[attacker] )
            return 
HAM_IGNORED

    new 
weapon2 get_user_weapon(attacker__);
    if( 
weapon2 == WEAPON_CSW)
    {
        
SetHamParamFloat(4damage get_pcvar_float(damage_weapon));
        return 
HAM_HANDLED;
    }

    return 
HAM_IGNORED;
}
public 
Event_CurWeapon(id
{
    if ( !
g_Weapon[id] || !is_user_alive(id) )
    return 
PLUGIN_CONTINUE;

    new 
Gun read_data(2

    if( 
Gun == WEAPON_CSW)
    {
        
entity_set_string(idEV_SZ_viewmodelWEAPON_V_MDL)
    }

    return 
PLUGIN_CONTINUE;
}

public 
Fwd_CmdStartiduc_handleseed )
{
    if( !
is_user_aliveid ) || !g_Weapon[id] ) 
        return 
FMRES_IGNORED;

    if( ( 
get_ucuc_handleUC_Buttons ) & IN_ATTACK2 ) && !( pevidpev_oldbuttons ) & IN_ATTACK2 ) )
    {
        new 
szWeapID get_user_weaponidszClipszAmmo )

        if( 
szWeapID == WEAPON_CSW && !g_hasZoomid ])
        {
            
g_hasZoomid ] = true
            cs_set_user_zoom
idCS_SET_AUGSG552_ZOOM)
        }

        else 
        {    if( 
g_hasZoomid ] )
            {
                
g_hasZoomid ] = false
                cs_set_user_zoom
id,  CS_RESET_ZOOM)
            }
        }

        return 
FMRES_HANDLED;
    }

    return 
FMRES_IGNORED;

2- Complete the blanks, and add model ;)

P.S: You can try the unlock_scout below in attachments ;) also find your own model
Attached Files
File Type: sma Get Plugin or Get Source (unlock_scout.sma - 647 views - 3.5 KB)
Unknown Guy is offline
Agression Terrpr
Member
Join Date: Jun 2015
Location: Lithuania
Old 06-08-2015 , 23:03   Re: Gun Xp Mod (Last Updated : 10-02-2011)
Reply With Quote #852

Gunxp mods Pls update mods
Agression Terrpr is offline
Send a message via Skype™ to Agression Terrpr
Qumsieh
Senior Member
Join Date: Jun 2015
Old 06-30-2015 , 16:05   Re: Gun Xp Mod (Last Updated : 10-02-2011)
Reply With Quote #853

the download can't open fix them
Qumsieh is offline
Agression Terrpr
Member
Join Date: Jun 2015
Location: Lithuania
Old 07-03-2015 , 18:13   Re: Gun Xp Mod (Last Updated : 10-02-2011)
Reply With Quote #854

The well-known old GunXP modifications improved version, accompanied by prestige, remove bug'ai related to preservation / uploads, added a few necessary functions

Pls LINK downolad
Agression Terrpr is offline
Send a message via Skype™ to Agression Terrpr
musab
New Member
Join Date: Jan 2015
Old 07-15-2015 , 19:40   Re: Gun Xp Mod (Last Updated : 10-02-2011)
Reply With Quote #855

I need unlock mac 10
musab is offline
Dr Zayd
Senior Member
Join Date: Jun 2014
Location: forums.alliedmods.net
Old 07-17-2015 , 20:56   Re: Gun Xp Mod (Last Updated : 10-02-2011)
Reply With Quote #856

Quote:
Originally Posted by Qumsieh View Post
the download can't open fix them
https://forums.alliedmods.net/attach...2&d=1421250037
__________________
Invisible System | 100%
ـــــــــــــــــــــــــــــ
Anti setinfo check | Ez Plugin and lite
ـــــــــــــــــــــــــــــ
[ZP] Free VIP Menu | Free VIP menu | ZP-Mod |
Dr Zayd is offline
Einan
Junior Member
Join Date: Aug 2015
Old 08-03-2015 , 16:07   Re: Gun Xp Mod (Last Updated : 10-02-2011)
Reply With Quote #857

hi guys

i need /power

for Gun XP
Einan is offline
Einan
Junior Member
Join Date: Aug 2015
Old 08-07-2015 , 02:25   Re: Gun Xp Mod (Last Updated : 10-02-2011)
Reply With Quote #858

i Need All Unlocked Pls Send Me pls
Einan is offline
Einan
Junior Member
Join Date: Aug 2015
Old 08-09-2015 , 14:17   Re: Gun Xp Mod (Last Updated : 10-02-2011)
Reply With Quote #859

UP
__________________
Einan is offline
alencore
Senior Member
Join Date: Oct 2011
Old 08-29-2015 , 01:18   Re: Gun Xp Mod (Last Updated : 10-02-2011)
Reply With Quote #860

is there a CSS version of this awesome plugin already?
alencore 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 18:53.


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