Raised This Month: $32 Target: $400
 8% 

knife only speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SolidSSnake
BANNED
Join Date: Sep 2006
Old 09-14-2006 , 00:38   knife only speed
Reply With Quote #1

im making a simple mod, when u choose a person u get extra speed with knife only, this code doesnt work. got any suggestions?

Code:
        
 new weapon = get_user_attacker(id,weapon)
    
 if(weapon == CSW_KNIFE)
 {
 set_user_maxspeed(id, 450)
 }
SolidSSnake is offline
Locks
Senior Member
Join Date: Sep 2005
Old 09-14-2006 , 01:15   Re: knife only speed
Reply With Quote #2

Code:
#include <amxmodx> #include <fun> public plugin_init() {     register_plugin("Knife Speed", "1.0", "Default")     register_event("CurWeapon", "knifespeed", "be", "1=1")     register_event("ResetHUD", "newround", "b") } public newround(id) {     if ( is_user_connected(id) )         set_task(0.1, "knifespeed", id) } public knifespeed(id) {     if ( !is_user_alive(id) )         return PLUGIN_HANDLED     new weaponid = read_data(2)     new Float:KnifeSpeed = 450.0     if ( weaponid != CSW_KNIFE )         return PLUGIN_HANDLED     set_user_maxspeed(id, Float:KnifeSpeed)     return PLUGIN_HANDLED }

Before installing that, make sure you have set your server maxspeed to 450 or above in your server.cfg
Locks is offline
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 09-14-2006 , 01:35   Re: knife only speed
Reply With Quote #3

public newround(id)
{
if ( is_user_connected(id) )
set_task(0.1, "knifespeed", id)
}
he could be connected but not alive
k007 is offline
Send a message via MSN to k007
VEN
Veteran Member
Join Date: Jan 2005
Old 09-14-2006 , 04:18   Re: knife only speed
Reply With Quote #4

Quote:
if ( is_user_connected(id) )
set_task(0.1, "knifespeed", id)
}

public knifespeed(id)
{
if ( !is_user_alive(id) )
return PLUGIN_HANDLED
VEN is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 09-14-2006 , 22:41   Re: knife only speed
Reply With Quote #5

And you will probably want to set the speed on current weapon.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Reply


Thread Tools
Display Modes

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 21:30.


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