Raised This Month: $63 Target: $400
 15% 

Client_GiveWeaponAndAmmo Not Working?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PreetyAnonym
Junior Member
Join Date: Feb 2019
Old 02-11-2019 , 09:33   Client_GiveWeaponAndAmmo Not Working?
Reply With Quote #1

Hey, I'm trying to make a plugin with /deagle that give you an empty deagle.
I'm using this code
PHP Code:
        for (int i 1<= MaxClientsi++)
        if (
IsClientInGame(i) && GetClientTeam(i) == CS_TEAM_T && IsPlayerAlive(i))
        {
                
Client_RemoveAllWeapons(i"weapon_knife"true);
                
Client_GiveWeaponAndAmmo(i"weapon_deagle"true0000); 
        }
    } 
And I'm getting deagle with full ammo, Please help?
PreetyAnonym is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 02-11-2019 , 10:34   Re: Client_GiveWeaponAndAmmo Not Working?
Reply With Quote #2

int weap = GivePlayerItem(client, "weapon_deagle");
SetEntProp(weap, Prop_Send, "m_iClip1", 0);
SetEntProp(weap, Prop_Send, "m_iPrimaryReserveAmmoCount", 0);
Indarello is offline
Rowdy4E
Junior Member
Join Date: Nov 2018
Old 02-11-2019 , 10:52   Re: Client_GiveWeaponAndAmmo Not Working?
Reply With Quote #3

Quote:
And I'm getting deagle with full ammo, Please help?
You need to remove the default secondary gun (OnPlayerSpawn => CTs = USPs, Ts = Glocks) before you will set new gun with modified ammo.
Rowdy4E is offline
PreetyAnonym
Junior Member
Join Date: Feb 2019
Old 02-11-2019 , 13:47   Re: Client_GiveWeaponAndAmmo Not Working?
Reply With Quote #4

Quote:
Originally Posted by Indarello View Post
int weap = GivePlayerItem(client, "weapon_deagle");
SetEntProp(weap, Prop_Send, "m_iClip1", 0);
SetEntProp(weap, Prop_Send, "m_iPrimaryReserveAmmoCount", 0);
Thank you! That Solved My Problem!
PreetyAnonym is offline
Reply


Thread Tools
Display Modes

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 16:52.


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