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

[CS1.6]Knife plugin for random kill stole from VICTIM


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
feifei
Senior Member
Join Date: Sep 2014
Location: India
Old 11-12-2014 , 17:21   [CS1.6]Knife plugin for random kill stole from VICTIM
Reply With Quote #1

I need a knife plugin which will stole random kills from VICTIM.

(like kdf it's by default stole 2 frags and also stole random money)

Suppose:-

My Score:- 21-10

that time you killed me by knife.
and you can get random kill stole. you can also stole 0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, 19,20.
it's depend on your luck.

example:- you stole 10 frags.

then my score will be:- 11-11 ( calculation-> 21-10 and you killed me 1 time so, 10+1)

And that time you will get 15HP for per kill.

I just want it will stole random kills from VICTIM.

and killer will also get +25HP for per kills. and when killer will kill to victim that time victim will see a blue effect in his screen !!

and also show color text :-
new pun_list[][] =
{
"^4%s ^3has sliced ^4%s ^3nand stole ^4%s ^3bucks!!!",
"^4%s ^3has given ^4%s ^3a taste of his cold steel!!! ^1(^3he took ^4%s ^3from him^1)",
"^4%s ^3rules! ^4%s ^3bows to his mighty skills and surrenders ^4%s ^3from his purse."
};

player maximum health can be "200"
__________________
MaTriX is my life
Visit Here ;) For ZP MODs

Last edited by feifei; 11-17-2014 at 14:18.
feifei is offline
feifei
Senior Member
Join Date: Sep 2014
Location: India
Old 11-13-2014 , 15:38   Re: [CS1.6]Knife plugin for random kill stole from VICTIM
Reply With Quote #2

ohh. didn't get any reply yet ~

btw.. can any one just tell me code ? for knife kill frags ??

inc_frag(index)
{
if(!is_user_connected(index)) return;
set_user_frags(index,get_user_frags(index)+ge t_pcvar_num(frags)); <<- it's for kill frags(default 2)
}

stealmoney(victim, killer, amount)
{
if(!is_user_connected(victim) || !is_user_connected(killer)) return;
cs_set_user_money(killer,cs_get_user_money(ki ller)+amount);
cs_set_user_money(victim,cs_get_user_money(vi ctim)-amount); <<- it's for money (but I want kill frags)
}
__________________
MaTriX is my life
Visit Here ;) For ZP MODs

Last edited by feifei; 11-17-2014 at 14:18.
feifei is offline
popeye10
Senior Member
Join Date: May 2014
Location: Navi Mumbai (India)
Old 11-14-2014 , 03:07   Re: [CS1.6]Knife plugin for random kill stole from VICTIM
Reply With Quote #3

Try This

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "Knife Frag"
#define VERSION "1.0"
#define AUTHOR "POPEYE"


public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_event"DeathMsg""hook_death""a""1>0""4=knife" );
}

public 
hook_death(id)
{
    new 
killer read_data(1);
    new 
victim read_data(2);
    new 
victimename[32], killername[32];
    
    
get_user_name(victim,victimename,31);
    
get_user_name(killer,killername,31);
        
    new 
amount random_num(1get_user_frags(victim))
    
set_user_frags(killerget_user_frags(killer) + amount)
    
set_user_frags(victimget_user_frags(victim) - amount)
    return 
PLUGIN_CONTINUE;
}

stock client_print_color(idtype, const text[], any:...)
{
 if(
type == print_chat)
 {
  new 
g_iMsgidSayText;
  
g_iMsgidSayText get_user_msgid("SayText");

  new 
szMsg[191], iPlayers[32], iCount 1;
  
vformat(szMsgcharsmax(szMsg), text3);

  
replace_all(szMsgcharsmax(szMsg), "!g","^x04");
  
replace_all(szMsgcharsmax(szMsg), "!n","^x01");
  
replace_all(szMsgcharsmax(szMsg), "!t","^x03");

  if(
id)
   
iPlayers[0] = id;
  else
   
get_players(iPlayersiCount"ch");

  for(new 
iCount i++)
  {
   if(!
is_user_connected(iPlayers[i]))
    continue;
   
   
message_begin(MSG_ONE_UNRELIABLEg_iMsgidSayText_iPlayers[i]);
   
write_byte(iPlayers[i]);
   
write_string(szMsg);
   
message_end();
  }
 }

update

& thanx Jhob94
__________________

Last edited by popeye10; 11-14-2014 at 13:52. Reason: update code
popeye10 is offline
feifei
Senior Member
Join Date: Sep 2014
Location: India
Old 11-14-2014 , 06:58   Re: [CS1.6]Knife plugin for random kill stole from VICTIM
Reply With Quote #4

Quote:
Originally Posted by popeye10 View Post
Try This

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "Knife Frag"
#define VERSION "1.0"
#define AUTHOR "POPEYE"

new gFrag;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_event"DeathMsg""hook_death""a""1>0""4=knife" );
    
gFrag register_cvar"amx_frag""2" );
}

public 
hook_death(id)
{
    new 
killer read_data(1);
    new 
victim read_data(2);
    new 
victimename[32], killername[32];
    
    
get_user_name(victim,victimename,31);
    
get_user_name(killer,killername,31);
        
    
client_print_color(idprint_chat"!n[ KNIFE ] !t%s !gjust got additional 2 frags for knifing player !t%s"killernamevictimename
    
set_user_frags(killerget_user_frags(killer) + get_pcvar_num(gFrag));
    
    return 
PLUGIN_CONTINUE;
}

stock client_print_color(idtype, const text[], any:...)
{
 if(
type == print_chat)
 {
  new 
g_iMsgidSayText;
  
g_iMsgidSayText get_user_msgid("SayText");

  new 
szMsg[191], iPlayers[32], iCount 1;
  
vformat(szMsgcharsmax(szMsg), text3);

  
replace_all(szMsgcharsmax(szMsg), "!g","^x04");
  
replace_all(szMsgcharsmax(szMsg), "!n","^x01");
  
replace_all(szMsgcharsmax(szMsg), "!t","^x03");

  if(
id)
   
iPlayers[0] = id;
  else
   
get_players(iPlayersiCount"ch");

  for(new 
iCount i++)
  {
   if(!
is_user_connected(iPlayers[i]))
    continue;
   
   
message_begin(MSG_ONE_UNRELIABLEg_iMsgidSayText_iPlayers[i]);
   
write_byte(iPlayers[i]);
   
write_string(szMsg);
   
message_end();
  }
 }

I want it will take random kills from VICTIM, not default frags 2.
and also decrease kills from VICTIM.
__________________
MaTriX is my life
Visit Here ;) For ZP MODs

Last edited by feifei; 11-14-2014 at 07:02.
feifei is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 11-14-2014 , 07:09   Re: [CS1.6]Knife plugin for random kill stole from VICTIM
Reply With Quote #5

set_user_frags(killer, get_user_frags(killer) + get_pcvar_num(gFrag))
->
new amount = random_num(1, get_user_frags(victim))
set_user_frags(killer, get_user_frags(killer) + amount)
set_user_frags(victim, get_user_frags(victim) - amount)
__________________
Jhob94 is offline
popeye10
Senior Member
Join Date: May 2014
Location: Navi Mumbai (India)
Old 11-14-2014 , 07:24   Re: [CS1.6]Knife plugin for random kill stole from VICTIM
Reply With Quote #6

thanx Jhob94

Update
__________________

Last edited by popeye10; 11-14-2014 at 07:28.
popeye10 is offline
feifei
Senior Member
Join Date: Sep 2014
Location: India
Old 11-14-2014 , 09:10   Re: [CS1.6]Knife plugin for random kill stole from VICTIM
Reply With Quote #7

Quote:
Originally Posted by Jhob94 View Post
set_user_frags(killer, get_user_frags(killer) + get_pcvar_num(gFrag))
->
new amount = random_num(1, get_user_frags(victim))
set_user_frags(killer, get_user_frags(killer) + amount)
set_user_frags(victim, get_user_frags(victim) - amount)
can you make it complete please. I don't know how to add and where I will add those lines. please.
and will it show blue effect when killer kill to VICTIM ???

And It will also show print color chat

new pun_list[][] =
{
"^4%s ^3has sliced ^4%s ^3nand stole ^4%s ^3bucks!!!",
"^4%s ^3has given ^4%s ^3a taste of his cold steel!!! ^1(^3he took ^4%s ^3from him^1)",
"^4%s ^3rules! ^4%s ^3bows to his mighty skills and surrenders ^4%s ^3from his purse."
};
__________________
MaTriX is my life
Visit Here ;) For ZP MODs

Last edited by feifei; 11-14-2014 at 09:13.
feifei is offline
GinNNy
Senior Member
Join Date: Mar 2014
Old 11-14-2014 , 15:37   Re: [CS1.6]Knife plugin for random kill stole from VICTIM
Reply With Quote #8

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "Knife Frag"
#define VERSION "1.0"
#define AUTHOR "POPEYE"

new gFrag;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_event"DeathMsg""hook_death""a""1>0""4=knife" );
    
gFrag register_cvar"amx_frag""2" );
}

public 
hook_death(id)
{
    new 
killer read_data(1);
    new 
victim read_data(2);
    new 
victimename[32], killername[32];
    
    
get_user_name(victim,victimename,31);
    
get_user_name(killer,killername,31);
        
    
client_print_color(idprint_chat"!n[ KNIFE ] !t%s !gjust got additional 2 frags for knifing player !t%s"killernamevictimename
    new 
amount random_num(1get_user_frags(victim))
    
set_user_frags(killerget_user_frags(killer) + amount)
    
set_user_frags(victimget_user_frags(victim) - amount)
    
    return 
PLUGIN_CONTINUE;
}

stock client_print_color(idtype, const text[], any:...)
{
 if(
type == print_chat)
 {
  new 
g_iMsgidSayText;
  
g_iMsgidSayText get_user_msgid("SayText");

  new 
szMsg[191], iPlayers[32], iCount 1;
  
vformat(szMsgcharsmax(szMsg), text3);

  
replace_all(szMsgcharsmax(szMsg), "!g","^x04");
  
replace_all(szMsgcharsmax(szMsg), "!n","^x01");
  
replace_all(szMsgcharsmax(szMsg), "!t","^x03");

  if(
id)
   
iPlayers[0] = id;
  else
   
get_players(iPlayersiCount"ch");

  for(new 
iCount i++)
  {
   if(!
is_user_connected(iPlayers[i]))
    continue;
   
   
message_begin(MSG_ONE_UNRELIABLEg_iMsgidSayText_iPlayers[i]);
   
write_byte(iPlayers[i]);
   
write_string(szMsg);
   
message_end();
  }
 }

GinNNy is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 11-14-2014 , 15:46   Re: [CS1.6]Knife plugin for random kill stole from VICTIM
Reply With Quote #9

GinNNy,
You forgot to change the 'frag-amount' = 2, in the chat message.
__________________
Retired.
Xalus is offline
feifei
Senior Member
Join Date: Sep 2014
Location: India
Old 11-14-2014 , 23:44   Re: [CS1.6]Knife plugin for random kill stole from VICTIM
Reply With Quote #10

Quote:
Originally Posted by GinNNy View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "Knife Frag"
#define VERSION "1.0"
#define AUTHOR "POPEYE"

new gFrag;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_event"DeathMsg""hook_death""a""1>0""4=knife" );
    
gFrag register_cvar"amx_frag""2" );
}

public 
hook_death(id)
{
    new 
killer read_data(1);
    new 
victim read_data(2);
    new 
victimename[32], killername[32];
    
    
get_user_name(victim,victimename,31);
    
get_user_name(killer,killername,31);
        
    
client_print_color(idprint_chat"!n[ KNIFE ] !t%s !gjust got additional 2 frags for knifing player !t%s"killernamevictimename
    new 
amount random_num(1get_user_frags(victim))
    
set_user_frags(killerget_user_frags(killer) + amount)
    
set_user_frags(victimget_user_frags(victim) - amount)
    
    return 
PLUGIN_CONTINUE;
}

stock client_print_color(idtype, const text[], any:...)
{
 if(
type == print_chat)
 {
  new 
g_iMsgidSayText;
  
g_iMsgidSayText get_user_msgid("SayText");

  new 
szMsg[191], iPlayers[32], iCount 1;
  
vformat(szMsgcharsmax(szMsg), text3);

  
replace_all(szMsgcharsmax(szMsg), "!g","^x04");
  
replace_all(szMsgcharsmax(szMsg), "!n","^x01");
  
replace_all(szMsgcharsmax(szMsg), "!t","^x03");

  if(
id)
   
iPlayers[0] = id;
  else
   
get_players(iPlayersiCount"ch");

  for(new 
iCount i++)
  {
   if(!
is_user_connected(iPlayers[i]))
    continue;
   
   
message_begin(MSG_ONE_UNRELIABLEg_iMsgidSayText_iPlayers[i]);
   
write_byte(iPlayers[i]);
   
write_string(szMsg);
   
message_end();
  }
 }

ginny client print color will be :-

{
"^4%s ^3has sliced ^4%s ^3nand stole ^4%s ^3bucks!!!",
"^4%s ^3has given ^4%s ^3a taste of his cold steel!!! ^1(^3he took ^4%s ^3from him^1)",
"^4%s ^3rules! ^4%s ^3bows to his mighty skills and surrenders ^4%s ^3from his purse."
};

and it will took random frags from VICTIM not 2 !! it's depend on luck that how many frags will you stole
__________________
MaTriX is my life
Visit Here ;) For ZP MODs
feifei 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:39.


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