AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   No Ammo Deagle (https://forums.alliedmods.net/showthread.php?t=314312)

PreetyAnonym 02-13-2019 02:48

No Ammo Deagle
 
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;
        }
    } 


Nexd 02-13-2019 05:34

Re: No Ammo Deagle
 
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

PreetyAnonym 02-13-2019 07:16

Re: No Ammo Deagle
 
Quote:

Originally Posted by Nexd (Post 2639440)
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 ! :)

Ilusion9 02-14-2019 07:23

Re: No Ammo Deagle
 
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);



Indarello 02-14-2019 08:03

Re: No Ammo Deagle
 
Quote:

Originally Posted by Ilusion9 (Post 2639578)
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


All times are GMT -4. The time now is 08:29.

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