Raised This Month: $ Target: $400
 0% 

[ZP] CSO Spas 12


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ALackOfLife
Junior Member
Join Date: Dec 2008
Old 11-20-2013 , 17:26  
Reply With Quote #1

I've been trying to recreate the CSO 's SPAS12 using the M3 as a base
Now I am using dias' weapon base and I learned AMXX quite a bit from his code, however...
In trying to create a shotgun reload I've ran into some issues
  1. I cannot seem to figure out how to get an animation to play before the shell insert loop
  2. I cannot seem to keep the clip limit from going over.

To explain #2 better, I have the clip size at 6
So it begins to reload, and as soon as it reaches 6, it quickly runs to 7 then 8 in just a few frames, as if it were the M3's clip

Code:
public fw_Ham_Reload(ent) {     if(!pev_valid(ent))         return HAM_IGNORED             new id     id = pev(ent, pev_owner)         if(!is_user_alive(id) || !g_had_spas12[id])         return HAM_IGNORED             g_spas12_clip[id] = -1         new bpammo = cs_get_user_bpammo(id, CSW_SPAS12)     if (bpammo <= 0)         return HAM_SUPERCEDE         new iClip = get_pdata_int(ent, 51, 4)     if(iClip >= get_pcvar_num(cvar_default_clip))         return HAM_SUPERCEDE                g_spas12_clip[id] = iClip     g_spas12_reload[id] = 1     return HAM_IGNORED } public fw_Ham_Reload_Post(ent) {     if(!pev_valid(ent))         return HAM_IGNORED             new id     id = pev(ent, pev_owner)         if(!is_user_alive(id) || !g_had_spas12[id])         return HAM_IGNORED             if (g_spas12_clip[id] == -1)         return HAM_IGNORED         set_pdata_int(ent, 51, g_spas12_clip[id], 4)     set_pdata_float(ent, 48, 0.534, 4)     set_pdata_float(id, 83, 0.534, 5)     set_pdata_int(ent, 55, 1, 4)         set_weapon_anim(id, ANIM_INSERT)         return HAM_IGNORED } public fw_Ham_PostFrame(ent) {     if(!pev_valid(ent))         return HAM_IGNORED             new id     id = pev(ent, pev_owner)         if(!is_user_alive(id) || !g_had_spas12[id])         return HAM_IGNORED             new Float:flNextAttack = get_pdata_float(id, 83, 5)     new bpammo = cs_get_user_bpammo(id, CSW_SPAS12)         new iClip = get_pdata_int(ent, 51, 4)     new fInReload = get_pdata_int(ent, 55, 4)         if(fInReload && flNextAttack <= 0.0)     {         set_pdata_int(ent, 51, iClip + 1, 4)         cs_set_user_bpammo(id, CSW_SPAS12, bpammo - 1)                 fInReload = 0         g_spas12_reload[id] = 0                 set_weapon_anim(id, ANIM_AFTER_RELOAD)     }               return HAM_IGNORED }

I feel as if I don't get how postframe works with special/shotgun reload

I should probably send the file instead bleh

10 days? Jeez, the only thing I've been able to do is narrow down the cause to postframe.
Attached Files
File Type: sma Get Plugin or Get Source (zp_extra_spas12.sma - 743 views - 15.7 KB)

Last edited by YamiKaitou; 12-01-2013 at 08:27.
ALackOfLife 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 00:06.


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