Raised This Month: $ Target: $400
 0% 

Weapon check


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
razermamba
Member
Join Date: Aug 2010
Old 01-27-2013 , 13:56   Weapon check
Reply With Quote #1

Hello I just need a piece of code where will be check for player that he can have just one primary and secondary weapon. I have a plugin that spawns weapon but when player get the weapon he can get like 7 primary weapons. So im very greateful if anyone could post here code for blocking this thing.

Thank you
razermamba is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 01-27-2013 , 14:18   Re: Weapon check
Reply With Quote #2

What you mean by "spawn weapons"? Do you mean, you give players a new weapon at the start of a new round or do you spawn the weapon on the ground and then the player picks it up?
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 01-27-2013 at 14:19.
wickedd is offline
razermamba
Member
Join Date: Aug 2010
Old 01-27-2013 , 14:31   Re: Weapon check
Reply With Quote #3

Weapon is spawned on the ground and player pick it up
razermamba is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 01-27-2013 , 16:07   Re: Weapon check
Reply With Quote #4

He spawn a weapon with this code
PHP Code:
enum _:Weapons {
    
Classname32 ],
    
Model32 ],
    
WeaponID,
    
AmmoAmount
};

new const 
WeaponList[ ][ Weapons ] = { 
    { 
"weapon_glock18""w_glock18.mdl"CSW_GLOCK18120 },
    { 
"weapon_usp""w_usp.mdl"CSW_USP100 },
    { 
"weapon_deagle""w_deagle.mdl"CSW_DEAGLE35 },
    { 
"weapon_ak47""w_ak47.mdl"CSW_AK4790 },
    { 
"weapon_m4a1""w_m4a1.mdl"CSW_M4A190 },
    { 
"weapon_famas""w_famas.mdl"CSW_FAMAS90 },
    { 
"weapon_galil""w_galil.mdl"CSW_GALIL90 },
    { 
"weapon_awp""w_awp.mdl"CSW_AWP30 },
    { 
"weapon_mp5navy""w_mp5.mdl"CSW_MP5NAVY120 },
    { 
"weapon_mac10""w_mac10.mdl"CSW_MAC10100 }
};

spawn_weaponweaponidoriginid )
{
    static const 
weaponbox[] = "weaponbox";
    
    static 
iWeaponBox;
    
iWeaponBox create_entityweaponbox );
    
    new 
szModel64 ];
    
    if( 
pev_validiWeaponBox ) )
    {
        
set_peviWeaponBoxpev_iuser3WPNBX_CUSTOM );
        
set_peviWeaponBoxWEAPON_IDweaponid );
        
        static 
Float:origin];
        
origin] = Float:ArrayGetCellspawn_points_Xoriginid );
        
origin] = Float:ArrayGetCellspawn_points_Yoriginid );
        
origin] = Float:ArrayGetCellspawn_points_Zoriginid );
        
        
engfuncEngFunc_SetOriginiWeaponBoxorigin );
        
        static 
Float:angles];
        
        
set_peviWeaponBoxpev_anglesangles );
        
ExecuteHamBHam_SpawniWeaponBox );
        
        static 
Float:flWpnBxVelocity];
        
flWpnBxVelocity] = random_float( -250.0250.0 );
        
flWpnBxVelocity] = random_float( -250.0250.0 );
        
        
set_peviWeaponBoxpev_velocityflWpnBxVelocity );
            
        
formatexszModelcharsmaxszModel ), "models/%s"WeaponListweaponid ][ Model ] );
        
        
entity_set_modeliWeaponBoxszModel );
        
        
engfuncEngFunc_DropToFlooriWeaponBox );
    }
    
    return 
iWeaponBox;
}

public 
weaponbox_touchenttoucher )
{
    static 
weaponid;
    
weaponid peventWEAPON_ID );
    
    
give_itemtoucherWeaponListweaponid ][ Classname ] );
    
cs_set_user_bpammotoucherWeaponListweaponid ][ WeaponID ], WeaponListweaponid ][ AmmoAmount ] );

The problem with this is that you can pickup all weapons you want... he needs to fix that.
__________________

Last edited by Neeeeeeeeeel.-; 01-27-2013 at 16:08.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
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 20:38.


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