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

trash


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cssnik
Member
Join Date: Apr 2011
Location: Russia
Old 08-24-2011 , 06:33   trash
Reply With Quote #1

delete

Last edited by cssnik; 12-13-2011 at 19:30. Reason: delete
cssnik is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-24-2011 , 09:03   Re: Increase speed for kill with a knife...
Reply With Quote #2

Should it increase once or everytime when kill knife ??

You could look this and remove "health gaining" by set cvar to 0
[CSS] ES->SM "Knife Gaining" request
__________________
Do not Private Message @me
Bacardi is offline
cssnik
Member
Join Date: Apr 2011
Location: Russia
Old 08-24-2011 , 17:47   Re: Increase speed for kill with a knife...
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
Should it increase once or everytime when kill knife?
One current round

And if you done two kills with a knife in a row, increasing the speed will be doubled?

Example: one kill — 1.3 speed, two kills — 1.6 speed, three1.9 speed etc.
__________________

Last edited by cssnik; 08-24-2011 at 18:39.
cssnik is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-25-2011 , 07:25   Re: Increase speed for kill with a knife...
Reply With Quote #4

Quote:
Originally Posted by cssnik View Post
One current round

And if you done two kills with a knife in a row, increasing the speed will be doubled?

Example:
one kill — 1.3 speed, two kills — 1.6 speed, three1.9 speed etc.
If you mean that plugin what I posted, no.
It set speed when get first knife kill in that round.
__________________
Do not Private Message @me
Bacardi is offline
cssnik
Member
Join Date: Apr 2011
Location: Russia
Old 08-25-2011 , 18:13   Re: Increase speed for kill with a knife...
Reply With Quote #5

You can do that speed for one kill was 1.3, for two kills in one round in a row - 1.6, for three kills in a row - 1.9, etc.
__________________
cssnik is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-26-2011 , 09:05   Re: Increase speed for kill with a knife...
Reply With Quote #6

Quote:
Originally Posted by cssnik View Post
You can do that speed for one kill was 1.3, for two kills in one round in a row - 1.6, for three kills in a row - 1.9, etc.
Here
added new cvar
knife_speed_increase_percent "30"
and change two other cvar by default
knife_health_gaining "0"
knife_speed_gaining "1.3"



PHP Code:
new Handle:knife_health_gaining INVALID_HANDLE;
new 
Handle:knife_speed_gaining INVALID_HANDLE;
new 
Handle:knife_speed_increase_percent INVALID_HANDLE;
new 
g_ihealth;
new 
Float:g_fspeed 0.0;
new 
Float:g_fspeed_increase 0.0;

new 
knife_kills[MAXPLAYERS];

public 
Plugin:myinfo 
{
    
name "knife gaining",
    
description "its when you knife a victim you get speed and health"
}

public 
OnPluginStart()
{
    
knife_health_gaining CreateConVar("knife_health_gaining""0""Add this much health every knife kill"FCVAR_NONEtrue0.0);
    
g_ihealth GetConVarInt(knife_health_gaining);
    
HookConVarChange(knife_health_gainingcvar_changed);

    
// Some reason when you ser float value to cvar (1.3),  GetConVarFloat() convert to 0.1 less (1.29) !!!
    
knife_speed_gaining CreateConVar("knife_speed_gaining""1.30""Set this much speed when knife kill"FCVAR_NONEtrue0.0);
    
g_fspeed GetConVarFloat(knife_speed_gaining);
    
HookConVarChange(knife_speed_gainingcvar_changed);

    
knife_speed_increase_percent CreateConVar("knife_speed_increase_percent""30""Percent to increase speed every knife kill"FCVAR_NONEtrue0.0);
    
g_fspeed_increase GetConVarFloat(knife_speed_increase_percent);
    
HookConVarChange(knife_speed_increase_percentcvar_changed);

    
HookEvent("player_death"death);
    
HookEvent("round_start"startEventHookMode_PostNoCopy);
}

public 
cvar_changed(Handle:cvar, const String:oldvalue[], const String:newvalue[])
{
    
g_ihealth GetConVarInt(knife_health_gaining);
    
g_fspeed GetConVarFloat(knife_speed_gaining);
    
g_fspeed_increase GetConVarFloat(knife_speed_increase_percent);
}

public 
death(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(
g_ihealth == && g_fspeed == 1.0// Not gain health and speed
    
{
        return;
    }

    
decl String:weapon[30];
    
weapon[0] = '\0';

    
GetEventString(event"weapon"weaponsizeof(weapon));

    if(
StrEqual(weapon"knife"))
    {
        
decl clientvictim;
        
client GetClientOfUserId(GetEventInt(event"attacker"));
        
victim GetClientOfUserId(GetEventInt(event"userid"));

        if(
GetClientTeam(client) == GetClientTeam(victim)) // Team Kills not include
        
{
            return;
        }


        
knife_kills[client]++;

        
g_ihealth != SetEntityHealth(clientGetClientHealth(client) + g_ihealth):0;

        if(
g_fspeed != 1.0)
        {
            
decl Float:ftemp;
            
ftemp g_fspeed + ((knife_kills[client]*g_fspeed_increase)/100.0);

            
SetEntPropFloat(clientProp_Send"m_flLaggedMovementValue"ftemp);

            if(
g_fspeed_increase == 0.0 && knife_kills[client] == || g_fspeed_increase != 0.0)
            {
                
PrintToChat(client"[SM] Your speed increased by %0.0f\%", (ftemp 1.0)*100.0);
            }
        }
    }
}

public 
start(Handle:event, const String:name[], bool:dontBroadcast)
{
    for(new 
1<= MaxClientsi++)
    {
        if(
IsClientConnected(i))
        {
            
knife_kills[i] = -1;
        }
    }
}

// Maybe unnecessary
public OnClientDisconnect(client)
{
    
knife_kills[client] = -1;

__________________
Do not Private Message @me

Last edited by Bacardi; 08-26-2011 at 13:44.
Bacardi is offline
cssnik
Member
Join Date: Apr 2011
Location: Russia
Old 08-26-2011 , 11:26   Re: Increase speed for kill with a knife...
Reply With Quote #7

Thank you very much.

All works fine, but the speed increases even if to kill a teammate =)

Please also add the output to the chat messages:
one kill - [SM] Your speed increased by 30%
two kills - [SM] Your speed increased by 60%
three kills - [SM] Your speed is increased by 90%
etc.
__________________
cssnik is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-26-2011 , 13:48   Re: Increase speed for kill with a knife...
Reply With Quote #8

updated.
it will show firsts lower speed percent from chat less... example player get speed 30% but show it 29%
but when percent value get bigger it show right
__________________
Do not Private Message @me
Bacardi is offline
cssnik
Member
Join Date: Apr 2011
Location: Russia
Old 08-29-2011 , 06:00   Re: Increase speed for kill with a knife...
Reply With Quote #9

You can change a little — in the first kill with a knife - increase speed by 30%, and for each subsequent kills increase speed by +10%, i.e.:
one kill - [SM] Your speed increased by 30%
two kills - [SM] Your speed increased by 40%
three kills - [SM] Your speed is increased by 50%
etc.
__________________
cssnik is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-29-2011 , 06:02   Re: Increase speed for kill with a knife...
Reply With Quote #10

Try
knife_speed_increase_percent "10"
__________________
Do not Private Message @me
Bacardi 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 22:46.


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