Raised This Month: $ Target: $400
 0% 

Plugin Not Working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
souvik2701
Junior Member
Join Date: Jul 2016
Location: IND
Old 08-23-2016 , 10:41   Plugin Not Working
Reply With Quote #1

Please anyone check this
This plugin is not working and is making my server to crash
Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <dhudmessage>
#include <hamsandwich>

#define PLUGIN "Knife It Up"
#define VERSION "2.0"
#define AUTHOR "KaLaDhan"

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)

	register_dictionary("knifeitup.txt")
	
	register_cvar("knifeitup_HP", "25")
	register_cvar("knifeitup_adminHP", "100")
	

	register_cvar("knifeitup_p_sBoost", "50")
	register_cvar("knifeitup_a_sBoost", "50")
	register_cvar("knifeitup_sBoost_Time", "2.0")

	register_cvar("knifeitup_frags", "3")
	register_cvar( "knifeitup_TAG", "['O|s|G']" )
		
	RegisterHam(Ham_Killed, "player", "Death_Knife")
	
	//ExecuteConfigs()
}
new knifesounds[4][] =
{
	"sound/oldskoolcs/osg_knifekill.wav",
	"sound/oldskoolcs/osg_knifekill2.wav",
	"sound/oldskoolcs/osg_knifekill3.wav",
	"sound/oldskoolcs/osg_knifekill4.wav"
}
public plugin_precache()
{
	if(file_exists("sound/oldskoolcs/osg_knifekill.wav"))
		precache_sound("sound/oldskoolcs/osg_knifekill.wav")
	if(file_exists("sound/oldskoolcs/osg_knifekill2.wav"))
		precache_sound("sound/oldskoolcs/osg_knifekill2.wav")
	if(file_exists("sound/oldskoolcs/osg_knifekill3.wav"))
		precache_sound("sound/oldskoolcs/osg_knifekill3.wav")
	if(file_exists("sound/oldskoolcs/osg_knifekill4.wav"))
		precache_sound("sound/oldskoolcs/osg_knifekill4.wav")
		
}

public Death_Knife ( victim, attacker, wpnindex, hitplace  )
{
	if ( !is_user_alive( attacker ) ||victim == attacker )
		return HAM_IGNORED
	
	new attacker_weapon[13]
	get_weaponname( wpnindex, attacker_weapon, charsmax(attacker_weapon) )
	
	if ( equal( attacker_weapon, "weapon_knife" ) )
	{
		new TAG[10]
		get_cvar_string( "knifeitup_TAG", TAG, charsmax(TAG) )
		
		new pHP =	get_cvar_num( "knifeitup_HP" )
		new aHP =	get_cvar_num( "knifeitup_adminHP" )
		new frags =	get_cvar_num( "knifeitup_frags" )
		new p_sBoost =	get_cvar_num( "knifeitup_p_sBoost" )
		new a_sBoost =	get_cvar_num( "knifeitup_a_sBoost" )
		new Float:sBoost_Time = get_cvar_float("knifeitup_sBoost_Time")
		
		new attacker_name[32]
		new victim_name[32]
		get_user_name( attacker, attacker_name ,charsmax( attacker_name )  )
		get_user_name( victim, victim_name ,charsmax( victim_name )  )
		
		set_dhudmessage(0, 160, 0, 0.40, 0.60, 2, 6.0, 12.0)
		show_dhudmessage( 0, "%s just knived %s", attacker_name, victim_name)
		client_cmd( 0, "spk %s", knifesounds )
		
		if( get_user_flags(attacker) & ADMIN_KICK )
		{
			set_user_health( attacker, get_user_health(attacker) + aHP )
			set_user_maxspeed( attacker, get_user_maxspeed( attacker ) + a_sBoost/100 )
			
			frags = get_user_frags( attacker ) + frags
			set_user_frags( attacker, frags )
			set_user_frags( attacker, frags )
			client_printc( 0, "!g%s !nkilled %s with !gknife", attacker_name, victim_name )
			client_print( 0, print_chat, "%s %L", TAG, LANG_PLAYER, "PLAYER_MSG", attacker_name, victim_name, aHP, frags, sBoost_Time )

		}
		else
		{
			set_user_health( attacker, get_user_health(attacker) + pHP )
			set_user_maxspeed( attacker, get_user_maxspeed( attacker ) + p_sBoost/100 )
			frags = get_user_frags( attacker ) + frags
			set_user_frags( attacker, frags )
			set_user_frags( attacker, frags )
			client_printc( 0, "!nAdmin !g%s !nkilled %s with !gknife", attacker_name, victim_name )
			client_print( 0, print_chat, "%s %L", TAG, LANG_PLAYER, "ADMIN_MSG", attacker_name, victim_name, pHP, frags, sBoost_Time )
		}
	}
}

public ExecuteConfigs()
{
	new config_dir[200]    						//Create the variable
	get_configsdir( config_dir, charsmax( config_dir ) )     	//get the configs directory (addons/amxmodx/configs/)	
	add( config_dir, charsmax( config_dir ), "/knifeitup.cfg" )	//create the file being used
	
	if( file_exists( config_dir ) )     				//if its already there just execute it
	{
		server_cmd( "exec %s", config_dir )
		server_exec()
	}
	else
	{
		make_config( config_dir );     				//if its not then create it with the information we made here
	}	
}  

make_config(const config_dir[])
{
		
	new f = fopen(config_dir, "wt")					//open the file with the flags Write and Text
	
	fputs(f, "// Your Configs Go Here^n^n^n")			//Add a comment line with 3 spaces (Note ^n means "New line")
	
	//Write the cvars for your plugin in the form used to change the cvars"
	fprintf(f, "	//HP Gain for Normal Players^n\
			knifeitup_HP %i^n", get_cvar_num( "knifeitup_HP" ))
	fprintf(f, "	//HP Gain for Admins^n\
			knifeitup_adminHP %i^n", get_cvar_num( "knifeitup_adminHP" ) )
	
	fprintf(f, "	//Extra Frags Amount ^n\
			knifeitup_frags %i^n", get_cvar_num( "knifeitup_frags" ) )
	
	fprintf(f, "	//Speed Boost for Normal Players in Percentage. Ex : 50^n\
			knifeitup_frags %i^n", get_cvar_num( "knifeitup_p_sBoost" ) )
	fprintf(f, "	//Speed Boost for Normal Players in Percentage. Ex : 50^n\
			knifeitup_frags %i^n", get_cvar_num( "knifeitup_a_sBoost" ) )
	
	fprintf(f, "	//TAG to be put before text messages printed in chat area. Ex : [KNIFE]^n\
			knifeitup_frags %i^n", get_cvar_num( "knifeitup_TAG" ) )
	
	fclose(f)							//close the file
} 

// Colour Chat
client_printc(index, const text[], any:...)
{
    new szMsg[128];
    vformat(szMsg, sizeof(szMsg) - 1, text, 3);
    
    replace_all(szMsg, sizeof(szMsg) - 1, "!g", "^x04");
    replace_all(szMsg, sizeof(szMsg) - 1, "!n", "^x01");
    replace_all(szMsg, sizeof(szMsg) - 1, "!t", "^x03");
    
    message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, index);
    write_byte(index);
    write_string(szMsg);
    message_end();
}
souvik2701 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 08-23-2016 , 11:21   Re: Plugin Not Working
Reply With Quote #2

type debug behind your plugin name and show us your error logs.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
ish12321
Veteran Member
Join Date: May 2016
Old 08-23-2016 , 13:41   Re: Plugin Not Working
Reply With Quote #3

Quote:
Originally Posted by Napoleon_be View Post
type debug behind your plugin name and show us your error logs.
Actually he's my friend
I tried to see his server
But there were no error logs generated

Last edited by ish12321; 08-24-2016 at 03:25.
ish12321 is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 08-23-2016 , 13:55   Re: Plugin Not Working
Reply With Quote #4

Quote:
Originally Posted by ish12321 View Post
Actually he's my friend
I tried to see his server
But there were no attack logs generated
ok, what's no working?
If you just say 'this plugin not working' that's not giving to much info.

Is not working at all or what?
Craxor is offline
Send a message via ICQ to Craxor
ish12321
Veteran Member
Join Date: May 2016
Old 08-23-2016 , 14:14   Re: Plugin Not Working
Reply With Quote #5

Quote:
Originally Posted by Craxor View Post
ok, what's no working?
If you just say 'this plugin not working' that's not giving to much info.

Is not working at all or what?
It's not working at all and crashing server
And yeah sound names are checked twice and they are correct
ish12321 is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 08-23-2016 , 15:04   Re: Plugin Not Working
Reply With Quote #6

Post error logs
tousif is offline
souvik2701
Junior Member
Join Date: Jul 2016
Location: IND
Old 08-24-2016 , 00:17   Re: Plugin Not Working
Reply With Quote #7

Due To Crashing of the server., error logs aren't producing
What to do ??!
souvik2701 is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 08-24-2016 , 01:47   Re: Plugin Not Working
Reply With Quote #8

Let me re-ask you.

This plugin make your server crash when you open your server or when you DO SOMETHING ?

Because it may happen from other plugin, if you say No error logs and is crashin server when you open it ,,, it may be from other plugin, try desinstall all per time and see the real problem.
Craxor is offline
Send a message via ICQ to Craxor
ish12321
Veteran Member
Join Date: May 2016
Old 08-24-2016 , 03:18   Re: Plugin Not Working
Reply With Quote #9

Quote:
Originally Posted by Craxor View Post
Let me re-ask you.

This plugin make your server crash when you open your server or when you DO SOMETHING ?

Because it may happen from other plugin, if you say No error logs and is crashin server when you open it ,,, it may be from other plugin, try desinstall all per time and see the real problem.
When we start the server ...
ish12321 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 08-24-2016 , 09:48   Re: Plugin Not Working
Reply With Quote #10

Whenever the server crashes, there should be logs at all time. It's nearly impossible to not get an error...

Post your plugins.ini

Post your full code that you "think" is crashing your server "with no logs"....

Also, show error logs file if there is one.
__________________

Last edited by Napoleon_be; 08-24-2016 at 09:50.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 05:57.


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