AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Event_CurWeapon (https://forums.alliedmods.net/showthread.php?t=128942)

reinert 06-07-2010 06:12

Event_CurWeapon
 
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

Arkshine 06-07-2010 08:08

Re: Event_CurWeapon
 
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.

reinert 06-07-2010 08:24

Re: Event_CurWeapon
 
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.

Kreation 06-07-2010 16:24

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

Found that in a different thread.

reinert 06-07-2010 16:35

Re: Event_CurWeapon
 
is this going to work for me ? and is it what im lookin for ? :)

http://forums.alliedmods.net/showpost.php?p=853202&postcount=11

Kreation 06-07-2010 16:42

Re: Event_CurWeapon
 
Yes, that should do it. Not sure 100%.

Read through the thread.

reinert 06-07-2010 16:51

Re: Event_CurWeapon
 
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.

GXLZPGX 06-08-2010 08:27

Re: Event_CurWeapon
 
Quote:

Originally Posted by reinert (Post 1202597)
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

:arrow:

PHP Code:

cs_set_user_armor(idget_pcvar_num(ap)) 


Kreation 06-08-2010 14:20

Re: Event_CurWeapon
 
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.


All times are GMT -4. The time now is 05:24.

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