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

Solved Zeus with clip size 10, how?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Austin
Senior Member
Join Date: Oct 2005
Old 05-28-2023 , 18:06   Zeus with clip size 10, how?
Reply With Quote #1

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.

Last edited by Austin; 06-19-2023 at 15:29.
Austin is offline
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
BeepIsla
Member
Join Date: Mar 2020
Location: Germany
Old 05-31-2023 , 16:49   Re: Zeus with clip size 10, how?
Reply With Quote #3

Just count how many times a client has fired the taser and remove the weapon once the limit is reached. For the cooldown just use the built in "mp_taser_recharge_time".
BeepIsla is offline
Austin
Senior Member
Join Date: Oct 2005
Old 06-10-2023 , 02:46   Re: Zeus with clip size 10, how?
Reply With Quote #4

Thanks for all the great info everyone.

I used this method to modify the clip size and range and it adds a nice extra feature to my bot server.

"range" "50"
"primary clip size" "10"
"primary default clip size" "10"
"secondary default clip size" "10"

I turns out everyone likes the rapid fire so no need to do the reload,
but I noticed this items_game.txt seems to be updated about every csgo update and I don't want the hassle of always updating it. (on a server at gameservers.com and no way to use a bat file for updates)

I would perfer a plugin.
How would I modify the zeus clip size and range in a sm plugin?

Is it best to hook the item spawn event and look for a zeus and then modfy all of them there?
and how exactly to modify clip and range?

tx
Attached Thumbnails
Click image for larger version

Name:	z.jpg
Views:	45
Size:	65.6 KB
ID:	200878  
Austin is offline
bklol
Member
Join Date: May 2019
Location: on my chair
Old 06-10-2023 , 19:53   Re: Zeus with clip size 10, how?
Reply With Quote #5

need PTaH Extension
choose your os sig and complie
PHP Code:
#pragma semicolon 1 
#include <PTaH> 
#include <sdktools> 

#define addr_range                            268
#define addr_primary_clip_size                20
#define addr_primary_default_clip_size        28
#define addr_secondary_default_clip_size    32


Handle hGetCCSWeaponData;
char sig[] = "\x85\xC9\x75\x2A\x33\xC0\xC3\x8B\x01"//win
//char sig[] = "\x55\x89\xE5\x53\x83\xEC\x04\x8B\x45\x08\x85\xC0\x74\x4A\x8B\x15"; //linux

public void OnPluginStart()  
{
    
StartPrepSDKCall(SDKCall_Raw);
    
PrepSDKCall_SetSignature(SDKLibrary_Serversigsizeof(sig) - 1);
    
PrepSDKCall_SetReturnInfo(SDKType_PlainOldDataSDKPass_Plain);
    
hGetCCSWeaponData EndPrepSDKCall();
    if(!
hGetCCSWeaponDataSetFailState("Could not initialize call to GetCCSWeaponDataFromDef");
}

public 
void OnMapStart()  
{
    
CEconItemDefinition ItemDef;
    
Address CCSWeaponData;
    
ItemDef PTaH_GetItemDefinitionByName("weapon_taser");
    if(
ItemDef && (CCSWeaponData SDKCall(hGetCCSWeaponDataItemDef)))
    {
        
StoreToAddress(CCSWeaponData view_as<Address>(addr_range), 50NumberType_Int32);
        
StoreToAddress(CCSWeaponData view_as<Address>(addr_primary_clip_size), 10NumberType_Int32);
        
StoreToAddress(CCSWeaponData view_as<Address>(addr_primary_default_clip_size), 10NumberType_Int32);
        
StoreToAddress(CCSWeaponData view_as<Address>(addr_secondary_default_clip_size), 10NumberType_Int32);
    }

bklol is offline
Austin
Senior Member
Join Date: Oct 2005
Old 06-16-2023 , 16:23   Re: Zeus with clip size 10, how?
Reply With Quote #6

Quote:
Originally Posted by bklol View Post
need PTaH Extension
choose your os sig and complie
Thanks for this.

I built the plugin and I am using this ext.dll
https://github.com/komashchenko/PTaH/releases

This modifies the mag size and the distance but it doesn't do any damage!
I know weird but I tested it 2x times and this plugin definitely

1) modifies the clip (mag) size
2) modifies the distance
3) modifies the zeus to do no damage!

Why?

NOTE:
I had a typo in my original post. THe distance I am setting is 500 not 50.

Last edited by Austin; 06-16-2023 at 19:41.
Austin is offline
bklol
Member
Join Date: May 2019
Location: on my chair
Old 06-18-2023 , 08:18   Re: Zeus with clip size 10, how?
Reply With Quote #7

sorry the m_range is stored float in memory
so it should be
PHP Code:
StoreToAddress(CCSWeaponData view_as<Address>(addr_range), view_as<int>(500.0), NumberType_Int32); 
bklol is offline
Austin
Senior Member
Join Date: Oct 2005
Old 06-19-2023 , 15:29   Re: Zeus with clip size 10, how?
Reply With Quote #8

Quote:
Originally Posted by bklol View Post
sorry the m_range is stored float in memory
so it should be
PHP Code:
StoreToAddress(CCSWeaponData view_as<Address>(addr_range), view_as<int>(500.0), NumberType_Int32); 
It works.
Excellent Thanks!

I also added these server settings.
mp_taser_recharge_time 1 // The time in seconds until the taser can shoot again after its shot.
mp_weapons_allow_zeus 10 // how many zeus purchases per round allowed

These give some nice features.

At the start the taser has 10 shots showing and they are rapid fire shots.
After this it shows 1 in the clip (mag)
And this is not rapid fire but takes mp_taser_recharge_time to shoot again and this one shot never expires.

You can purchase another taser to get a new 10 rapid firs shots.

Perfect!
Austin is offline
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 09:13.


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