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

Solved Deathrun Knife mod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
luci2k
Junior Member
Join Date: Jan 2020
Old 01-17-2020 , 15:33   Deathrun Knife mod
Reply With Quote #1

I want a simple version of this plugin
https://forums.alliedmods.net/showthread.php?p=378952
When you join the server i want to habe knife 4 (butcher knife) with the specs from that plugin to be default , i dont want a /knife menu
When you join the server you only have the butcher knife with gravity and with the specs like that knife mod

Last edited by luci2k; 01-21-2020 at 13:28.
luci2k is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-19-2020 , 07:35   Re: Deathrun Knife mod
Reply With Quote #2

Try this, if u want i can adjust the gravity using a cvar. Just let me know then.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <engine>
#include <fun>

#define PLUGIN "Butcher Knife"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

new const szModels[][] =
{
    
"models/knife-mod/v_butcher.mdl",
    
"models/knife-mod/p_butcher.mdl"
};

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_event("CurWeapon""WeaponChange""be""1=1");
}

public 
plugin_precache()
{
    for(new 
isizeof(szModels); i++) 
    {
        
precache_model(szModels[i])
    }
}

public 
WeaponChange(id)
{    
    if(
get_user_weapon(id) == CSW_KNIFE)
    {
        
entity_set_string(idEV_SZ_viewmodelszModels[0]);
        
entity_set_string(idEV_SZ_weaponmodelszModels[1]);
            
        
set_user_gravity(id0.5);
    }
    else 
    {
        
set_user_gravity(id);
    }

__________________

Last edited by Napoleon_be; 01-19-2020 at 11:41.
Napoleon_be is online now
Send a message via Skype™ to Napoleon_be
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-19-2020 , 08:16   Re: Deathrun Knife mod
Reply With Quote #3

@Napoleon_be - you don't need the "bHasKnife" (players always have the knife + hamsandwich will not be needed as well) and "iWeapon" (only used once) variables.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-19-2020 , 09:32   Re: Deathrun Knife mod
Reply With Quote #4

Thanks, i'll optimize the code when i get home

EDIT: Code has been updated and optimized
__________________

Last edited by Napoleon_be; 01-19-2020 at 11:42.
Napoleon_be is online now
Send a message via Skype™ to Napoleon_be
luci2k
Junior Member
Join Date: Jan 2020
Old 01-20-2020 , 13:03   Re: Deathrun Knife mod
Reply With Quote #5

This works great, thank you for your support
luci2k 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 11:41.


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