Raised This Month: $12 Target: $400
 3% 

Knife It UP v3.0.7


Post New Thread Reply   
 
Thread Tools Display Modes
shehzad1234
BANNED
Join Date: Jan 2016
Location: https://t.me/pump_upp
Old 04-18-2018 , 16:44   Re: Knife It UP v3.0.4
Reply With Quote #11

Good Job.
shehzad1234 is offline
Send a message via ICQ to shehzad1234 Send a message via AIM to shehzad1234 Send a message via Yahoo to shehzad1234
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 04-18-2018 , 17:01   Re: Knife It UP v3.0.4
Reply With Quote #12

Quote:
Originally Posted by shehzad1234 View Post
Good Job.
shehzad1234 is back. jeez
__________________
Relaxing is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 04-18-2018 , 18:16   Re: Knife It UP v3.0.4
Reply With Quote #13

i'll be using this, thanks
tarsisd2 is offline
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: India
Old 05-05-2018 , 13:14   Re: Knife It UP v3.0.4
Reply With Quote #14

I checked it on my server.
This plugin too has a speed bug.

Random player at random time has higher speed.
__________________
CrAzY MaN is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-05-2018 , 22:53   Re: Knife It UP v3.0.4
Reply With Quote #15

Here's some advices & optimization.

Dont use curweapon event use ham item deploy post or ham_cs_getweapon_maxspeed.

Var szWeapon in deathmsg set its size to 6 cells its rather than 32 cells

PHP Code:
set_user_health(idget_user_healthid ) + get_pcvar_num(csi_kkb_hp) )
        if(
get_user_health(id) > 100set_user_health(id100
Ever heard of clamp?
PHP Code:
set_user_health(idclamp(get_user_healthid ) + get_pcvar_num(csi_kkb_hp),100,1) ) 
Use switch instead of if and else if , if its possible.

I see you are retrieving the cvars values alot in one function, save the cvar values in variables inside the function.

Checking user is connected is useless because get_players already does that(inside the colorchat stock)
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 05-05-2018 , 23:40   Re: Knife It UP v3.0.4
Reply With Quote #16

Actually i was planning for update.. but not getting time as hud message is redundant i will be using sync from now, and will add sound switch in better way and was also aware abt that retrieving cvar value but not aware of curweapon will add everything soon . Thanks natsheh and crazy there are no bugs i guess many people using this and no one srill reported thing like that, you must be using another plugin or just keep it above than that other in plugins.ini
instinctpt1 is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 05-11-2018 , 14:20   Re: Knife It UP v3.0.4
Reply With Quote #17

@Natsheh i see why u said to use hamItemMaxSpeed as its accurate and fast but due to its accuracy it makes player stop if player choose other weapon while having speed

I did this :
PHP Code:
 RegisterHam(Ham_CS_Item_GetMaxSpeed"weapon_knife""handleKnifeSpeed"0); 

// Func : 
public handleKnifeSpeed() {
    new 
id read_data(1);
    if(
get_pcvar_float(csi_kkb_speed) > 250.0 && g_bHasSpeed[id])
        
set_user_maxspeed(idget_pcvar_float(csi_kkb_speed));

So to fulfill my purpose i guess curweapon is good then :/ ?
( As i want player to have speed regardless of weapon in hand until speedTime goes off )

Last edited by instinctpt1; 05-11-2018 at 14:20. Reason: 1
instinctpt1 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-11-2018 , 16:54   Re: Knife It UP v3.0.4
Reply With Quote #18

Quote:
Originally Posted by instinctpt1 View Post
@Natsheh i see why u said to use hamItemMaxSpeed as its accurate and fast but due to its accuracy it makes player stop if player choose other weapon while having speed

I did this :
PHP Code:
 RegisterHam(Ham_CS_Item_GetMaxSpeed"weapon_knife""handleKnifeSpeed"0); 

// Func : 
public handleKnifeSpeed() {
    new 
id read_data(1);
    if(
get_pcvar_float(csi_kkb_speed) > 250.0 && g_bHasSpeed[id])
        
set_user_maxspeed(idget_pcvar_float(csi_kkb_speed));

So to fulfill my purpose i guess curweapon is good then :/ ?
( As i want player to have speed regardless of weapon in hand until speedTime goes off )
Its not about accuracy its about efficiency. If you want it for all weapons then hook it for all weapons using a loop.

Thats not how you change the speed as you can see in the api the return type is the speed(float).p

PHP Code:
/**
     * Description:        Gets the maximum speed for whenever a player has the item deployed.
     * Forward params:    function(this);
     * Return type:        Float (byref'd in ExecuteHam).
     * Execute params:    ExecuteHam(Ham_CS_Item_GetMaxSpeed, this, Float:output);
     */
    
Ham_CS_Item_GetMaxSpeed 
You change the return type using SetHamReturnFloat native. And then block the return.

Also you are retrieving the player index incorrectly. 1st param is the weapon ent index.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-22-2018 at 09:29.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 03:22.


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