Raised This Month: $ Target: $400
 0% 

Kills


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zombieplague
Veteran Member
Join Date: Apr 2009
Old 06-24-2010 , 10:40   Kills
Reply With Quote #1

how do i make a plugin that detect a player killed 3 players ?? is like when a player kill 3 player a message will apear. then if the new round it restart again.
zombieplague is offline
5c0r-|3i0
Veteran Member
Join Date: Nov 2008
Location: Việt Nam
Old 06-24-2010 , 11:01   Re: Kills
Reply With Quote #2

1) g_killstreak[33] ...I don't know how to describe this :-s
2) register_event DeathMsg
3) victim = read_data(1) , attacker = read_data(2) ,g_killstreak[attacker]++ , g_killstreak[victim] = 0 .
Hope you get the idea
5c0r-|3i0 is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 06-24-2010 , 11:08   Re: Kills
Reply With Quote #3

Quote:
Originally Posted by 5c0r-|3i0 View Post
1) g_killstreak[33] ...I don't know how to describe this :-s
2) register_event DeathMsg
3) victim = read_data(1) , attacker = read_data(2) ,g_killstreak[attacker]++ , g_killstreak[victim] = 0 .
Hope you get the idea
Can you show me the full codes ?
zombieplague is offline
5c0r-|3i0
Veteran Member
Join Date: Nov 2008
Location: Việt Nam
Old 06-24-2010 , 11:30   Re: Kills
Reply With Quote #4

Fine..I just want you to code by yourself
PHP Code:

#include <amxmodx>
#include <amxmisc>

new g_killstreak[33]

public 
plugin_init()
{
register_plugin("Your name","your version" ,"not me")
register_event("DeathMsg","player_killed","b","1>0")
register_event("HLTV""event_newround""a""1=0""2=0")
}

public 
player_killed() {

new 
victim read_data(1)
new 
attacker read_data(2)

if(
g_killstreak[attacker] < 3)
{
g_killstreak[attacker]++

client_print(attacker,print_chat,"[Test] Current killstreak is %d",g_killstreak[attacker])
}
else
{
// do something :d then reset g_kilstreak[attacker] to 0 if u want :D
}
g_killstreak[victim] = 0

}

public 
event_newround()
{
arrayset g_killstreak 33)
client_print(0,print_center,"[testing]...")

1) Not tested
2) I just made it quick , gotta sleep 4now :d .

Last edited by 5c0r-|3i0; 06-24-2010 at 11:36.
5c0r-|3i0 is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 06-24-2010 , 11:41   Re: Kills
Reply With Quote #5

Quote:
Originally Posted by 5c0r-|3i0 View Post
Fine..I just want you to code by yourself
PHP Code:
 
#include <amxmodx>
#include <amxmisc>
 
new g_killstreak[33]
 
public 
plugin_init()
{
register_plugin("Your name","your version" ,"not me")
register_event("DeathMsg","player_killed","b","1>0")
register_event("HLTV""event_newround""a""1=0""2=0")
}
 
public 
player_killed() {
 
new 
victim read_data(1)
new 
attacker read_data(2)
 
if(
g_killstreak[attacker] < 3)
{
g_killstreak[attacker]++
 
client_print(attacker,print_chat,"[Test] Current killstreak is %d",g_killstreak[attacker])
}
else
{
// do something :d then reset g_kilstreak[attacker] to 0 if u want :D
}
g_killstreak[victim] = 0
 
}
 
public 
event_newround()
{
arrayset g_killstreak 33)
client_print(0,print_center,"[testing]...")

1) Not tested
2) I just made it quick , gotta sleep 4now :d .
alot of error.
zombieplague is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-24-2010 , 11:41   Re: Kills
Reply With Quote #6

Quote:
Originally Posted by 5c0r-|3i0 View Post
Fine..I just want you to code by yourself
PHP Code:

#include <amxmodx>
#include <amxmisc>

new g_killstreak[33]

public 
plugin_init()
{
register_plugin("Your name","your version" ,"not me")
register_event("DeathMsg","player_killed","b","1>0")
register_event("HLTV""event_newround""a""1=0""2=0")
}

public 
player_killed() {

new 
victim read_data(1)
new 
attacker read_data(2)

if(
g_killstreak[attacker] < 3)
{
g_killstreak[attacker]++

client_print(attacker,print_chat,"[Test] Current killstreak is %d",g_killstreak[attacker])
}
else
{
// do something :d then reset g_kilstreak[attacker] to 0 if u want :D
}
g_killstreak[victim] = 0

}

public 
event_newround()
{
arrayset g_killstreak 33)
client_print(0,print_center,"[testing]...")

1) Not tested
2) I just made it quick , gotta sleep 4now :d .
Honestly:

#1: His english completely fails, just like everyone else that posts in the scripting help forum.
#2: This is scripting help, he doesn't need help scripting, he's searching for someone to code this for him. He probably doesn't even know how to use includes.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 06-24-2010 , 14:55   Re: Kills
Reply With Quote #7

Quote:
Originally Posted by GXLZPGX View Post
Honestly:

#1: His english completely fails, just like everyone else that posts in the scripting help forum.
#2: This is scripting help, he doesn't need help scripting, he's searching for someone to code this for him. He probably doesn't even know how to use includes.
1# ive seen worse
2# what if he just wants an example?

PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Grim"

new Kills[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Killed"player""FwdPlayerKilled")
    
RegisterHam(Ham_Spawn"player""FwdPlayerSpawn"1)
}


public 
FwdPlayerKilled(victimattacker)
{
    if(
is_user_alive(attacker) && victim != attacker)
    {
        
Kills[attacker]++
        
        if(
Kills[attacker] == 3)
        {
            
client_print(attackerprint_chat"You have killed 3 guys in a row.")
        }
    }
}

public 
FwdPlayerSpawn(id)
{
    
Kills[id]=0

__________________
I am out of order!
grimvh2 is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 07-02-2010 , 10:39   Re: Kills
Reply With Quote #8

Quote:
Originally Posted by grimvh2 View Post
1# ive seen worse
2# what if he just wants an example?

PHP Code:
#include <amxmodx>
#include <hamsandwich>
 
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Grim"
 
new Kills[33]
 
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
 
    
RegisterHam(Ham_Killed"player""FwdPlayerKilled")
    
RegisterHam(Ham_Spawn"player""FwdPlayerSpawn"1)
}
 
 
public 
FwdPlayerKilled(victimattacker)
{
    if(
is_user_alive(attacker) && victim != attacker)
    {
        
Kills[attacker]++
 
        if(
Kills[attacker] == 3)
        {
            
client_print(attackerprint_chat"You have killed 3 guys in a row.")
        }
    }
}
 
public 
FwdPlayerSpawn(id)
{
    
Kills[id]=0

it didn't work
zombieplague is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 07-02-2010 , 10:41   Re: Kills
Reply With Quote #9

Quote:
Originally Posted by grimvh2 View Post
1# ive seen worse
2# what if he just wants an example?

PHP Code:
#include <amxmodx>
#include <hamsandwich>
 
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Grim"
 
new Kills[33]
 
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
 
    
RegisterHam(Ham_Killed"player""FwdPlayerKilled")
    
RegisterHam(Ham_Spawn"player""FwdPlayerSpawn"1)
}
 
 
public 
FwdPlayerKilled(victimattacker)
{
    if(
is_user_alive(attacker) && victim != attacker)
    {
        
Kills[attacker]++
 
        if(
Kills[attacker] == 3)
        {
            
client_print(attackerprint_chat"You have killed 3 guys in a row.")
        }
    }
}
 
public 
FwdPlayerSpawn(id)
{
    
Kills[id]=0

It didn't work
zombieplague is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 07-02-2010 , 11:49   Re: Kills
Reply With Quote #10

Quote:
Originally Posted by grimvh2 View Post
1# ive seen worse
2# what if he just wants an example?
Lolz. I guess not.
RedRobster 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 04:14.


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