Refill Clip On Kill
Hi.
There is already a nice plugin for that made by Root_, but unfortunately it doesn't do what i exactly want. His plugin obtains the clip's value of a gun from a file. What i want is a plugin which obtains it directly from CS:S/CS:GO. I want that because i want the clip to be refilled to its default by the game value. As we all know, in recent CS:GO updates VALVe changed the clip's value of some guns. In my opinion it's uncomfortable every time VALVe does that, i have to change the values in the file. I have wrote some code so far, but i'm not really sure if it correct. Code:
#pragma semicolon 1 |
Re: Refill Clip On Kill
Valve doesn't change clip size very often.
If you want to read from the server configs you need to read clip sizes from csgo/scripts/weapon_<classname>.txt You could also store clip sizes on weapon spawn into a trie to avoid reading the script files like you code appears to be doing |
Re: Refill Clip On Kill
Quote:
SetEntProp(primaryWeapon, Prop_Send, "m_iClip1", primaryWeaponClip); SetEntProp(secondaryWeapon, Prop_Send, "m_iClip1", secondaryWeaponClip); new activeWeapon = GetEntPropEnt(attackerID, Prop_Data, "m_hActiveWeapon"); returns slot id new CurrentWeaponAttacker = GetPlayerWeaponSlot(attackerID, activeWeapon); 0 primary 1 secondary 2 melee If I m correct |
Re: Refill Clip On Kill
Quote:
Btw, is the item_pickup event what i need to hook? Or do i need to hook something else? |
Re: Refill Clip On Kill
@ Michalplyoutube
Doesn't GetEntPropEnt(attackerID, Prop_Data, "m_hActiveWeapon"); return the entity index of a gun? Does it really return the id of a slot? |
Re: Refill Clip On Kill
It returns the entity index for the weapon the player has in their hands.
|
All times are GMT -4. The time now is 23:59. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.