Raised This Month: $ Target: $400
 0% 

[CSS] ES->SM "Knife Gaining" request


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rome64
Junior Member
Join Date: Jul 2011
Old 08-21-2011 , 15:27   [CSS] ES->SM "Knife Gaining" request
Reply With Quote #1

Hey
I had this plugin on my server, but when i have es on server, then get lagggss..
I would really grateful If someone can convert this plugin to sourcemod.
Thanks in advance.

Link to plugin
http://addons.eventscripts.com/addon.../knife_gaining


Quote:
block load
{
es_setinfo knife_health_gaining 50 // default 75
es_setinfo knife_speed_gaining 1.4 // default 1.4
knife_gaining_sounds 0
knife_gaining_soundfile "quake/nfsknifeee.mp3"
}

event player_death
{
if (event_var(weapon) equalto knife) do
{
es playerset healthadd event_var(attacker) server_var(knife_health_gaining)
es playerset speed event_var(attacker) server_var(knife_speed_gaining)
}
}
}
Rome64 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 08-21-2011 , 16:00   Re: [CSS] ES->SM "Knife Gaining" request
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?p=517717

I dont think you can change the speed of a person now but im not sure.
Mitchell is offline
Rome64
Junior Member
Join Date: Jul 2011
Old 08-21-2011 , 19:44   Re: [CSS] ES->SM "Knife Gaining" request
Reply With Quote #3

no, I have to get speed too 'couse its great on DM server.
Rome64 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-22-2011 , 01:54   Re: [CSS] ES->SM "Knife Gaining" request
Reply With Quote #4

> Compiler
PHP Code:
new Handle:knife_health_gaining INVALID_HANDLE;
new 
Handle:knife_speed_gaining INVALID_HANDLE;
new 
g_ihealth;
new 
Float:g_fspeed;

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""50""Add this much health every knife kill"FCVAR_NONEtrue0.0);
    
g_ihealth GetConVarInt(knife_health_gaining);
    
HookConVarChange(knife_health_gainingcvar_changed);

    
knife_speed_gaining CreateConVar("knife_speed_gaining""1.4""Set this much speed when knife kill"FCVAR_NONEtrue0.0);
    
g_fspeed GetConVarFloat(knife_speed_gaining);
    
HookConVarChange(knife_speed_gainingcvar_changed);

    
HookEvent("player_death"death);
}

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

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 client;
        
client GetClientOfUserId(GetEventInt(event"attacker"));

        
g_ihealth != SetEntityHealth(clientGetClientHealth(client) + g_ihealth):0;
        
g_fspeed != 1.0 SetEntPropFloat(clientProp_Send"m_flLaggedMovementValue"g_fspeed):0;
    }

cvars
knife_health_gaining = Add health every knife kill
knife_speed_gaining = Set speed when knife kill
__________________
Do not Private Message @me
Bacardi is offline
Rome64
Junior Member
Join Date: Jul 2011
Old 08-22-2011 , 07:13   Re: [CSS] ES->SM "Knife Gaining" request
Reply With Quote #5

Work like a charm.
Thank You for this!
Rome64 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 03:41.


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