Raised This Month: $ Target: $400
 0% 

Make weapon fire


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Buckshot
Senior Member
Join Date: Mar 2014
Location: Sweden
Old 03-28-2014 , 06:37   Make weapon fire
Reply With Quote #1

How do i make a knife stab, slash, or a primary or secondary weapon shoot with pawn? I've searched, but i've only found ways to BLOCK the attacks, and not make the weapons fire.
__________________
PM me for private work.



Last edited by Buckshot; 03-28-2014 at 06:40.
Buckshot is offline
Send a message via Skype™ to Buckshot
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 03-28-2014 , 15:34   Re: Make weapon fire
Reply With Quote #2

It won't take into account the delay between attacks, you you'll have to simulate that if you want continuous fire. Without that small delay I'm not getting any sounds, don't know why.
That's as far as I'm willing to go without the XY-problem being cleared.
Code:
#include <amxmodx> #include <hamsandwich> #define m_pPlayer      41 // CBasePlayerItem, Linux +4 new gWeaponEntIndex[33]; public plugin_init() {     register_plugin("Test Plugin 1", "", "[ --{-@ ]");         register_clcmd("say /attack", "clcmdAttack");         RegisterHam(Ham_Item_Deploy, "weapon_m4a1", "fwdItemDeploy"); } public fwdItemDeploy(index)     gWeaponEntIndex[get_pdata_cbase(index, m_pPlayer, 4)] = index; public clcmdAttack(id)     set_task(0.1, "delayAttack", id); public delayAttack(id)     ExecuteHam(Ham_Weapon_PrimaryAttack, gWeaponEntIndex[id]);
__________________
Black Rose 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 05:55.


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