Raised This Month: $ Target: $400
 0% 

Solved How to Code Shotgun Reload for CS


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hellmonja
Senior Member
Join Date: Oct 2015
Old 11-06-2015 , 16:36   How to Code Shotgun Reload for CS
Reply With Quote #1

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...
Attached Files
File Type: sma Get Plugin or Get Source (ap-supershorty2.sma - 737 views - 17.9 KB)

Last edited by hellmonja; 06-25-2017 at 04:26. Reason: Solved...
hellmonja is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 11-09-2015 , 14:46   Re: How to Code Shotgun Reload for CS
Reply With Quote #2

I am not going to get help this time, am I?...
hellmonja is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 11-12-2015 , 06:35   Re: How to Code Shotgun Reload for CS
Reply With Quote #3

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...     } }
__________________








CrazY. is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 11-12-2015 , 09:06   Re: How to Code Shotgun Reload for CS
Reply With Quote #4

ripped from HLSDK
Spoiler
__________________


Last edited by NiHiLaNTh; 11-12-2015 at 09:06.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 11-12-2015 , 09:11   Re: How to Code Shotgun Reload for CS
Reply With Quote #5

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...     } }
__________________








CrazY. is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 11-12-2015 , 09:25   Re: How to Code Shotgun Reload for CS
Reply With Quote #6

ok, will try maybe tomorrow and keep you posted. thanks...
hellmonja is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 11-12-2015 , 09:35   Re: How to Code Shotgun Reload for CS
Reply With Quote #7

__________________








CrazY. is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-12-2015 , 12:11   Re: How to Code Shotgun Reload for CS
Reply With Quote #8

Quote:
Originally Posted by CrazY. View Post
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.
__________________

Last edited by HamletEagle; 11-12-2015 at 12:12.
HamletEagle is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 11-12-2015 , 12:17   Re: How to Code Shotgun Reload for CS
Reply With Quote #9

Quote:
Originally Posted by CrazY. View Post
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...     } }
__________________









Last edited by CrazY.; 11-12-2015 at 12:17.
CrazY. is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 11-14-2015 , 09:52   Re: How to Code Shotgun Reload for CS
Reply With Quote #10

Quote:
Originally Posted by CrazY. View Post
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.
klippy 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 22:27.


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