Raised This Month: $ Target: $400
 0% 

Event_CurWeapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 06-07-2010 , 06:12   Event_CurWeapon
Reply With Quote #1

Hey, I need some help with my script, I hooked event_curweapon event and changed cs_set_user_maxspeed to get_user_maxspeed + 30.0. but when I'm shooting and runnin I'm getting even faster and maxspeed increases to like 400+... how can I fix this problem ?


PHP Code:
public Event_CurWeapon(id){
    if(
get_user_flags(id) & ADMIN_LEVEL_H)
        
set_user_maxspeed(id get_user_maxspeed(id) + get_pcvar_float(bspeed));

cvar bspeed is set to 30.0
reinert is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-07-2010 , 08:08   Re: Event_CurWeapon
Reply With Quote #2

CurWeapon is called each time you shoot. You change the speed by a custom speed you add from the current speed... Normal behaviour. Explain what you want to do.
__________________
Arkshine is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 06-07-2010 , 08:24   Re: Event_CurWeapon
Reply With Quote #3

I wan't to do that, if player has ADMIN_LEVEL_H he will be faster, I tried to put this code into hamspawn event but when I changed my weapon speed resetted to normal.
reinert is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 06-07-2010 , 16:24   Re: Event_CurWeapon
Reply With Quote #4

http://forums.alliedmods.net/showthr...=resetmaxspeed

Found that in a different thread.
__________________
Hi.
Kreation is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 06-07-2010 , 16:35   Re: Event_CurWeapon
Reply With Quote #5

is this going to work for me ? and is it what im lookin for ?

http://forums.alliedmods.net/showpost.php?p=853202&postcount=11
reinert is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 06-07-2010 , 16:42   Re: Event_CurWeapon
Reply With Quote #6

Yes, that should do it. Not sure 100%.

Read through the thread.
__________________
Hi.
Kreation is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 06-07-2010 , 16:51   Re: Event_CurWeapon
Reply With Quote #7

Now

PHP Code:
set_user_health(id get_pcvar_num(hp))
    
cs_set_user_armor(idget_pcvar_num(ap), CS_ARMOR_VESTHELM
Won't work.
reinert is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-08-2010 , 08:27   Re: Event_CurWeapon
Reply With Quote #8

Quote:
Originally Posted by reinert View Post
Now

PHP Code:
set_user_health(id get_pcvar_num(hp))
    
cs_set_user_armor(idget_pcvar_num(ap), CS_ARMOR_VESTHELM
Won't work.
PHP Code:
cs_set_user_armor(idget_pcvar_num(ap), CS_ARMOR_VESTHELM
I dont believe this is needed:

CS_ARMOR_VESTHELM



PHP Code:
cs_set_user_armor(idget_pcvar_num(ap)) 
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 06-08-2010 , 14:20   Re: Event_CurWeapon
Reply With Quote #9

http://www.amxmodx.org/funcwiki.php?...rmor&go=search

I think it is needed. I was unsure about that at first too, but then I checked.
__________________
Hi.
Kreation 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