AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved How to Code Shotgun Reload for CS (https://forums.alliedmods.net/showthread.php?t=274356)

hellmonja 11-06-2015 16:36

How to Code Shotgun Reload for CS
 
1 Attachment(s)
hello! I hope someone can help me. I've been trying for weeks to convert an extra weapon code from a magazine reload to a shotgun reload, you know how shotguns reload one shell at a time? I keep getting the animations messed up and it doesn't stop reloading to it's max capacity of 3 shells (it's a Super Shorty, so it only has 3). The code isn't mine and, I'll admit, my understanding of scripting isn't that deep so if the solution is painful obvious, I apologize. I'm just learning as I go along.

Anyways, I've attached the .sma file. It might be a bit messed as I'm trying to mash code from another shotgun but that's for ZP and it's code is way more complicated for me so I dropped the idea of converting that to my Super Shorty instead.

Hope you can help me guys. Thanks in advance...

hellmonja 11-09-2015 14:46

Re: How to Code Shotgun Reload for CS
 
I am not going to get help this time, am I?...

CrazY. 11-12-2015 06:35

Re: How to Code Shotgun Reload for CS
 
I do not quite understand your question, but try:

Code:
public plugin_init() {     RegisterHam(Ham_Weapon_Reload, "weapon_name", "fw_WeaponReload_Post", 1); } public fw_WeaponReload_Post(weapon_entity) {     new id = pev(weapon_entity, pev_owner);     if (g_has_name[id] && is_user_alive(id))     {         // code...     } }

NiHiLaNTh 11-12-2015 09:06

Re: How to Code Shotgun Reload for CS
 
ripped from HLSDK
Spoiler

CrazY. 11-12-2015 09:11

Re: How to Code Shotgun Reload for CS
 
NiHiLaNTh, do not need all the code.

Also has this option:

Code:
public plugin_init() {     register_forward(FM_CmdStart, "fw_CmdStart"); } public fw_CmdStart(id, uc_handle, seed) {     if ((pev(id, pev_button) & IN_RELOAD))     {         // code...     } }

hellmonja 11-12-2015 09:25

Re: How to Code Shotgun Reload for CS
 
ok, will try maybe tomorrow and keep you posted. thanks...

CrazY. 11-12-2015 09:35

Re: How to Code Shotgun Reload for CS
 
:fox:

HamletEagle 11-12-2015 12:11

Re: How to Code Shotgun Reload for CS
 
Quote:

Originally Posted by CrazY. (Post 2362348)
NiHiLaNTh, do not need all the code.

Also has this option:

Code:
public plugin_init() {     register_forward(FM_CmdStart, "fw_CmdStart"); } public fw_CmdStart(id, uc_handle, seed) {     if ((pev(id, pev_button) & IN_RELOAD))     {         // code...     } }

Poor way...
Do you ever heard of Ham_Weapon_Reload ? Also this is for checking if he is reloading, but he wants to redo the reload part.

CrazY. 11-12-2015 12:17

Re: How to Code Shotgun Reload for CS
 
Quote:

Originally Posted by CrazY. (Post 2362301)
I do not quite understand your question, but try:

Code:
public plugin_init() {     RegisterHam(Ham_Weapon_Reload, "weapon_name", "fw_WeaponReload_Post", 1); } public fw_WeaponReload_Post(weapon_entity) {     new id = pev(weapon_entity, pev_owner);     if (g_has_name[id] && is_user_alive(id))     {         // code...     } }

:fox:

klippy 11-14-2015 09:52

Re: How to Code Shotgun Reload for CS
 
Quote:

Originally Posted by CrazY. (Post 2362426)
:fox:

He isn't trying to detect when the player is reloading a weapon, he is trying to replicate shotgun reloading (shell by shell, not the whole clip at once) on some other weapon.


All times are GMT -4. The time now is 18:13.

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