Thread: [Solved] Zeus with clip size 10, how?
View Single Post
oqyh
Senior Member
Join Date: May 2019
Location: United Arab Emirates
Old 05-31-2023 , 11:05   Re: Zeus with clip size 10, how?
Reply With Quote #2

Quote:
Originally Posted by Austin View Post
Can someone show me how in a plugin to modify the Zeus so it has a clip/mag size of 10?
I want to have ten shots but still force reloading after every single shot.
Thanks.
you cant change 1/0 reserve ammo

but you can change clip ammo plugin way or server-side


========
server-side
========
csgo\scripts\items\items_game.txt
Code:
"weapon_taser_prefab"
		{
			"prefab"		"equipment"
			"item_class"		"weapon_taser"
			"item_name"		"#SFUI_WPNHUD_Taser"
			"item_description"		"#CSGO_Item_Desc_Taser"
			"image_inventory"		"econ/weapons/base_weapons/weapon_taser"
			"icon_default_image"		"materials/icons/inventory_icon_weapon_taser.vtf"
			"model_player"		"models/weapons/v_eq_taser.mdl"
			"model_world"		"models/weapons/w_eq_taser.mdl"
			"model_dropped"		"models/weapons/w_eq_taser.mdl"
			"item_gear_slot"		"melee"
			"item_gear_slot_position"		"1"
			"inv_group_equipment"		"taser"
			"used_by_classes"
			{
				"terrorists"		"1"
				"counter-terrorists"		"1"
			}
			"attributes"
			{
				"inaccuracy jump initial"		"96.620003"
				"inaccuracy jump"		"92.959999"
				"inaccuracy jump alt"		"92.959999"
				"heat per shot"		"0.000000"
				"tracer frequency"		"1"
				"max player speed"		"220"
				"in game price"		"200"
				"kill award"		"0"
				"armor ratio"		"2"
				"crosshair min distance"		"8"
				"penetration"		"0"
				"damage"		"500"
				"range"		"190"
				"range modifier"		"0.004900"
				"flinch velocity modifier large"		"0.500000"
				"flinch velocity modifier small"		"0.650000"
				"spread"		"2.000000"
				"inaccuracy crouch"		"1.000000"
				"inaccuracy stand"		"1.000000"
				"inaccuracy land"		"0.175000"
				"inaccuracy ladder"		"119.500000"
				"inaccuracy fire"		"22.120001"
				"inaccuracy move"		"1.000000"
				"recovery time crouch"		"0.287823"
				"recovery time stand"		"0.345388"
				"recoil seed"		"687"
				"primary clip size"		"1"
				"primary default clip size"		"1"
				"secondary default clip size"		"1"
				"weapon weight"		"5"
				"itemflag exhaustible"		"1"
				"rumble effect"		"1"
				"inaccuracy crouch alt"		"1.000000"
				"inaccuracy fire alt"		"22.120001"
				"inaccuracy ladder alt"		"119.500000"
				"inaccuracy land alt"		"0.175000"
				"inaccuracy move alt"		"1.000000"
				"inaccuracy stand alt"		"1.000000"
				"max player speed alt"		"220"
				"recovery time crouch final"		"0.287823"
				"recovery time stand final"		"0.345388"
				"spread alt"		"2.000000"
			}
restart server after save
---------------------------------------------


plugin idk you have alot of options

cooldown
PHP Code:

bool block
[MAXPLAYERS+1];

public 
void OnPluginStart()
{
    
HookEvent("weapon_fire"Event_WeaponFireEventHookMode_Post); //hook client on fire
    
HookEvent("player_death"Event_PlayerDeath); //hook client death
}

public 
void OnClientDisconnect(int client)
{
    
block[client] = false//reset on client Disconnect
}

public 
void Event_PlayerDeath(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    
    if(
IsClientValid(client))
    {
        
block[client] = false//reset on client death
    
}
}

public 
void Event_WeaponFire(Event event, const char[] sEventNamebool bDontBroadcast)

    
int client GetClientOfUserId(GetEventInt(event"userid")); 
    
    if(
IsClientValid(client))
    {
        
int weapon GetEntPropEnt(clientProp_Send"m_hActiveWeapon"); //Get active weapon
        
if(weapon != INVALID_ENT_REFERENCE)
        {
            
char szClassName[32];
            
GetEntityClassname(weaponszClassNamesizeof(szClassName));
            
            
int clip GetEntProp(weaponProp_Send"m_iClip1"); //get client clip
            
            
if(StrEqual(szClassName"weapon_taser")) //if has weapon taser then...
            
{
                
CreateTimer(5.0,BLOCKER_TIMER,client); //do timer  5 sec cooldown to client
                
                
block[client] = true//bool blocker to fire again
                
                
if(clip == 1//if his clip at 1 then...
                
{
                    
SetEntProp(weaponProp_Send"m_iClip1"10); //give him 10 clips
                
}
            }
        }
    }


public 
Action BLOCKER_TIMER(Handle timerany client//bool + timer to let him fire again
{
    if(
IsClientValid(client))
    {
        
block[client] = false//after 5 sec let him fire again
    
}
    return 
Plugin_Continue;
}

public 
Action OnPlayerRunCmd(int clientint &buttons)
{
    if(
IsClientValid(client))
    {
        
int weapon GetEntPropEnt(clientProp_Send"m_hActiveWeapon"); //Get active weapon
        
if(weapon != INVALID_ENT_REFERENCE)
        {
            
char szClassName[32];
            
GetEntityClassname(weaponszClassNamesizeof(szClassName));
            
            if(
StrEqual(szClassName"weapon_taser")) //if has weapon taser then...
            
{
                if ((
buttons IN_ATTACK) && block[client] == true//if he attacking + on cooldown then..
                
{
                    
buttons &= ~IN_ATTACK//dont let him fire
                    
PrintToChat(client"cooldown");
                }
            }
        }
    }
    return 
Plugin_Continue;
}

stock bool IsClientValid(int client)
{
    if(
client && client <= MaxClients && IsClientInGame(client))
        return 
true;
    return 
false;


or you can FakeClientCommand(client, "use weapon_knife") ->> force switch from any to knife then FakeClientCommand(client, "use weapon_taser") do like cooldown or block timer

it depend your goal
__________________
.:[ >> My Plugins << ]:.

My discord : oqyh
oqyh is offline