Raised This Month: $ Target: $400
 0% 

velocity_by_aim


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
maakera
Member
Join Date: Jul 2009
Old 05-31-2010 , 07:23   velocity_by_aim
Reply With Quote #1

i want it to add boost every time i press mouse 2 when holding a knife.
doesnt work :S
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <vector>
#include <engine>

#define PLUGIN "Knife Boost"
#define VERSION "1.0"
#define AUTHOR "Zibit"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("+attack2","Boost",ADMIN_KICK,"Allows boost if pressed mouse2")
    
// Add your code here...
}

public 
Boost(id)
{
new 
ClipAmmoWeapon get_user_weapon(idClipAmmo)
if ( 
Weapon == CSW_KNIFE ) {   
new 
Float:vRetValue[3]
velocity_by_aim id500vRetValue )
}

__________________

maakera is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-31-2010 , 08:20   Re: velocity_by_aim
Reply With Quote #2

You can't hook +attack2 and other original half-life + and - commands. There is a way to hook it through fakemeta though. Try to search a little.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 05-31-2010 , 10:29   Re: velocity_by_aim
Reply With Quote #3

With this you can hook secondary attack of knife
Code:
public plugin_init ( )
{
     ...

     RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_knife", "Boost", 1 )
}
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
maakera
Member
Join Date: Jul 2009
Old 06-01-2010 , 16:09   Re: velocity_by_aim
Reply With Quote #4

hmm like this ?
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <vector>
#include <engine>
#include <hamsandwich>
#define PLUGIN "Knife Boost"
#define VERSION "1.0"
#define AUTHOR "Zibit"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam Ham_Weapon_SecondaryAttack"weapon_knife""Boost")
}

public 
Boost(id)
{
new 
ClipAmmoWeapon get_user_weapon(idClipAmmo
if ( 
Weapon == CSW_KNIFE ) {   
new 
Float:vRetValue[3]
velocity_by_aim id500vRetValue )
console_print id"Boost Used!" )
}

__________________

maakera is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-02-2010 , 02:12   Re: velocity_by_aim
Reply With Quote #5

No

Replace Boost( id ) with Boost( iKnife ), where iKnife is the entity index of the knife, then use private offset m_pPlayer to retrieve player id, and add velocity to him (you may also check if it's the first push of attack2)

This may help you : http://cs-sdk.googlecode.com/svn/trunk/wpn_knife.cpp

Also, you shoule make some research on hamsandwich, fakemeta, on how to use ham hooks and pdatas, before you start anything, else you will make lots of errors and you gonna loose lot of time.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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:24.


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