Raised This Month: $32 Target: $400
 8% 

No Ammo Deagle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PreetyAnonym
BANNED
Join Date: Feb 2019
Old 02-13-2019 , 02:48   No Ammo Deagle
Reply With Quote #1

I tried make a plugin that give a player deagle with no ammo and I used this code but the client keep getting deagle with full ammo
PHP Code:
    if (IsClientInGame(client) && GetClientTeam(client) == CS_TEAM_CT || IsClientInGame(client) && GetClientTeam(client) == CS_TEAM_T && CheckCommandAccess(client"sm_admin"ADMFLAG_GENERIC))
    {
        
PrintToChatAll("%s All the terrorist got empty deagle!"PREFIX);
        for (
int i 1<= MaxClientsi++)
        if (
IsClientInGame(i) && GetClientTeam(i) == CS_TEAM_T && IsPlayerAlive(i))
        {
            
Client_RemoveAllWeapons(i);
            
Client_GiveWeaponAndAmmo(i"weapon_deagle"true0000);
            return 
Plugin_Handled;
        }
    } 

Last edited by PreetyAnonym; 02-13-2019 at 02:49.
PreetyAnonym is offline
Nexd
BANNED
Join Date: Dec 2013
Location: Hungary
Old 02-13-2019 , 05:34   Re: No Ammo Deagle
Reply With Quote #2

PHP Code:
#include <cstrike>

Client_GiveWeaponAndAmmo(i"weapon_deagle"true0000);
cs_set_user_bpammo(iget_weaponid(weapon_deagle), 0); 
Im sorry if its not work, i’m on mobile rn

Last edited by Nexd; 02-13-2019 at 06:55.
Nexd is offline
PreetyAnonym
BANNED
Join Date: Feb 2019
Old 02-13-2019 , 07:16   Re: No Ammo Deagle
Reply With Quote #3

Quote:
Originally Posted by Nexd View Post
PHP Code:
#include <cstrike>

Client_GiveWeaponAndAmmo(i"weapon_deagle"true0000);
cs_set_user_bpammo(iget_weaponid(weapon_deagle), 0); 
Im sorry if its not work, i’m on mobile rn
Didn't try it
But
PHP Code:
int iWeapon GivePlayerItem(i"weapon_deagle");
            
SetEntProp(iWeaponProp_Send"m_iClip1"0);
            
SetEntProp(iWeaponProp_Send"m_iPrimaryReserveAmmoCount"0); 
Is working perfect !
PreetyAnonym is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 02-14-2019 , 07:23   Re: No Ammo Deagle
Reply With Quote #4

PHP Code:
int ent GetPlayerWeaponSlot(clientCS_SLOT_SECONDARY);
if (
ent != -1)
{
    
SDKHooks_DropWeapon(clientent);
    
RemoveEntity(ent);
}

ent GivePlayerItem(client"weapon_deagle");
if (
ent != -1)
{
    
SetEntProp(entProp_Send"m_iClip1"0);
    
SetEntProp(entProp_Send"m_iPrimaryReserveAmmoCount"0);
    
EquipPlayerWeapon(clientent);

__________________
Ilusion9 is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 02-14-2019 , 08:03   Re: No Ammo Deagle
Reply With Quote #5

Quote:
Originally Posted by Ilusion9 View Post
PHP Code:
int ent GetPlayerWeaponSlot(clientCS_SLOT_SECONDARY);
if (
ent != -1)
{
    
SDKHooks_DropWeapon(clientent);
    
RemoveEntity(ent);
}

ent GivePlayerItem(client"weapon_deagle");
if (
ent != -1)
{
    
SetEntProp(entProp_Send"m_iClip1"0);
    
SetEntProp(entProp_Send"m_iPrimaryReserveAmmoCount"0);
    
EquipPlayerWeapon(clientent);

Never use equipplayerweapon for weapon that player can pick up in giveplayeritem
I dont know about other games but in csgo you will create freeze on round start
https://forums.alliedmods.net/showthread.php?t=313102

Last edited by Indarello; 02-14-2019 at 08:05.
Indarello 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 12:54.


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