Raised This Month: $ Target: $400
 0% 

Could someone recode this .sma file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pnoibestylin
Member
Join Date: Nov 2006
Old 09-05-2007 , 16:46   Could someone recode this .sma file
Reply With Quote #1

/********************************************* ***
One Hit Knife Kills
Author: Rabid Baboon
Version: 1.3
Mod: Counter-Strike
Requires: AMX mod X v1.01
Required Modules: cstrike, fakemeta engine and csx
Description:
Kills a player in one hit from the knife.

Special Thanks:
FireStorm - For the sucide message block function.

Changelog:
v1.3
Fixed getting knife kills when another player takes fall damage.
v1.2
Blocked sucide message from knife kills.
v1.1
Self-kill from fall damage while knife is out fixed.
********************************************* ***/
#include <amxmodx>
#include <cstrike>
#include <csx>
#include <fakemeta>
#include <engine>
#include <engine_stocks>
#include <fun>
/********************************************* ***
Global Variables
********************************************* ***/
new knifekill = 0
/********************************************* ***
Main Functions
********************************************* ***/
/********************************************* ***
plugin_modules()
Required modules listed here. Plugin will not work if they are not loaded.
********************************************* ***/
public plugin_modules()
{
require_module("cstrike");
require_module("csx");
require_module("fakemeta");
require_module("engine");
}
/********************************************* ***
plugin_init()
Initializes the plugin.
********************************************* ***/
public plugin_init()
{
register_plugin("One Hit Knife Kills", "1.3", "Rabid Baboon")
register_forward(FM_AlertMessage,"blocksuicid e")

return PLUGIN_HANDLED
}
/********************************************* ***
client_damage(attacker, victim, damage, wpnindex, hitplace, TA)
Kills a player if he was damaged by a knife.
Called when a player takes damage
********************************************* ***/
public client_damage(attacker, victim, damage, wpnindex, hitplace, TA)
{
if(is_user_alive(victim))
{
if((attacker != victim)) //prevents killing self with knife from fall damage.
{
if(wpnindex == CSW_KNIFE && TA != 1)
{
if(damage != DMG_FALL)
{
knifekill = 1
if(hitplace == HIT_HEAD)
{
make_deathmsg(attacker, victim, 1, "knife")
}
else
{
make_deathmsg(attacker, victim, 0, "knife")
}
user_silentkill(victim)
set_user_frags(attacker, get_user_frags(attacker)+1)
}
}
}
}

return PLUGIN_HANDLED
}
/********************************************* ***
blocksuicide(at_type, message[])
Blocks the sucide message caused user_silentkill
********************************************* ***/
public blocksuicide(at_type, message[])
{
if(containi(message,"suicide") > -1 && containi(message,"world") > -1 && knifekill == 1)
{
knifekill = 0
return FMRES_SUPERCEDE
}
return PLUGIN_CONTINUE
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/

















could someone recode that for admin only?
Pnoibestylin is offline
vl@d
Senior Member
Join Date: Dec 2006
Location: Romania
Old 09-05-2007 , 17:28   Re: Could someone recode this .sma file
Reply With Quote #2

you know if you take them from behind they will be dead. 193 dmg
__________________


I hate Spammers....
vl@d is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-05-2007 , 17:39   Re: Could someone recode this .sma file
Reply With Quote #3

Try this :

Code:
    #include <amxmodx>     #include <fakemeta>     #define ADMIN_LEVEL ADMIN_IMMUNITY         new knifekill = 0;     public plugin_init()     {         register_plugin( "One Hit Knife Kills", "1.3", "Rabid Baboon" );         register_forward( FM_AlertMessage, "blocksuicide" );     }     public client_damage( attacker, victim, damage, wpnindex, hitplace, TA )     {         if( is_user_alive( victim ) )             return;                     if( attacker == victim )             return;         if( !( get_user_flags( attacker ) & ADMIN_LEVEL ) )             return;                     if( wpnindex == CSW_KNIFE && TA != 1)         {             if( damage != DMG_FALL )             {                 knifekill = 1;                                         if( hitplace == HIT_HEAD )                     make_deathmsg( attacker, victim, 1, "knife" );                 else                     make_deathmsg( attacker, victim, 0, "knife" );                                         user_silentkill( victim );                 set_pev( attacker, pev( attacker, pev_frags ) + 1 );             }         }     }     public blocksuicide( at_type, message[] )     {         if( containi( message ,"suicide" ) > -1 && containi( message, "world" ) > -1 && knifekill == 1 )         {             knifekill = 0;             return FMRES_SUPERCEDE;         }         return FMRES_IGNORED;     }
__________________
Arkshine is offline
Pnoibestylin
Member
Join Date: Nov 2006
Old 09-06-2007 , 03:39   Re: Could someone recode this .sma file
Reply With Quote #4

Quote:
Originally Posted by arkshine View Post
Try this :

Code:
#include <amxmodx> #include <fakemeta> #define ADMIN_LEVEL ADMIN_IMMUNITY new knifekill = 0; public plugin_init() { register_plugin( "One Hit Knife Kills", "1.3", "Rabid Baboon" ); register_forward( FM_AlertMessage, "blocksuicide" ); } public client_damage( attacker, victim, damage, wpnindex, hitplace, TA ) { if( is_user_alive( victim ) ) return; if( attacker == victim ) return; if( !( get_user_flags( attacker ) & ADMIN_LEVEL ) ) return; if( wpnindex == CSW_KNIFE && TA != 1) { if( damage != DMG_FALL ) { knifekill = 1; if( hitplace == HIT_HEAD ) make_deathmsg( attacker, victim, 1, "knife" ); else make_deathmsg( attacker, victim, 0, "knife" ); user_silentkill( victim ); set_pev( attacker, pev( attacker, pev_frags ) + 1 ); } } } public blocksuicide( at_type, message[] ) { if( containi( message ,"suicide" ) > -1 && containi( message, "world" ) > -1 && knifekill == 1 ) { knifekill = 0; return FMRES_SUPERCEDE; } return FMRES_IGNORED; }
oh wow! it compiled succesfully. thank you very much.
buh ahm. how much damage does it do ?
and wat admin_level u need to have to get to use this?
Pnoibestylin is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-06-2007 , 06:51   Re: Could someone recode this .sma file
Reply With Quote #5

Quote:
could someone recode that for admin only?

#define ADMIN_LEVEL ADMIN_IMMUNITY


Change ADMIN_IMMUNITY by what you want. http://www.amxmodx.org/funcwiki.php?...=1#const_admin

Quote:
how much damage does it do ?
What? oO . This plugin doesn't deal with damage... You hit one time and the player will be kill...
__________________
Arkshine is offline
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 09-06-2007 , 09:01   Re: Could someone recode this .sma file
Reply With Quote #6

Also, if you replace:
Code:
        if( !( get_user_flags( attacker ) & ADMIN_LEVEL ) )             return;
with:
Code:
        if( !( get_user_flags( attacker ) & ADMIN_LEVEL ) )             return;         if( ( get_user_flags( victim) & ADMIN_LEVEL ) )             return;
then admins will be immune to the one hit kill.
purple_pixie is offline
Pnoibestylin
Member
Join Date: Nov 2006
Old 09-07-2007 , 17:32   Re: Could someone recode this .sma file
Reply With Quote #7

wait ahm. whats with the double kills?
everytime i kill someone with a knife.
it alwys said i killed him/her twice?
and the one knife kill doesnt work at all..
can someone recode this into a right way?
or maybe im doing somthing wrong.
and im using Purple_pixie's edited one...
Pnoibestylin is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 09-07-2007 , 17:44   Re: Could someone recode this .sma file
Reply With Quote #8

shuld work instant kill whit knife exept admins
but will be random hs on the death msg dont know how to
get hs -.-

Code:
 
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
public plugin_init() {
register_plugin("", "", "")
register_event("Damage","event_damage","be")
}
public event_damage(id)
{
new gun, attacker = get_user_attacker(id,gun)
if (is_user_alive(id) && !is_user_admin(id) && gun == CSW_KNIFE)
{
new score2 = get_user_frags(attacker)
new score = get_user_frags(id)
set_user_frags(id, score+1)
set_user_frags(attacker, score2+1)
set_user_health(id, 0)
set_msg_block(get_user_msgid("DeathMsg"),BLOCK_ONCE)
message_begin(MSG_ALL, get_user_msgid("DeathMsg"), {0,0,0}, 0)
write_byte(attacker)
write_byte(id)
write_byte(random_num(0,1))
write_string("KNIFE")
message_end()
}
return
}
__________________
If one of my plugins become broken, contact me by mail. [email protected]

Last edited by fxfighter; 09-08-2007 at 05:28.
fxfighter is offline
Send a message via MSN to fxfighter
Pnoibestylin
Member
Join Date: Nov 2006
Old 09-07-2007 , 18:06   Re: Could someone recode this .sma file
Reply With Quote #9

Your plugin failed to compile! Read the errors below:
Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/amxmodx/tmp3/textIMbPtx.sma(1 : error 017: undefined symbol "BLOC"
/home/groups/amxmodx/tmp3/textIMbPtx.sma(1 : error 017: undefined symbol "K_ONCE"

ahm. yea.
Pnoibestylin is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-07-2007 , 19:47   Re: Could someone recode this .sma file
Reply With Quote #10

@ Pnoibestylin : It doesn't work what I've done ?
__________________
Arkshine 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 16:05.


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