PDA

View Full Version : Kills


zombieplague
06-24-2010, 10:40
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.

5c0r-|3i0
06-24-2010, 11:01
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 :D

zombieplague
06-24-2010, 11:08
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 :D

Can you show me the full codes ?

5c0r-|3i0
06-24-2010, 11:30
Fine..I just want you to code by yourself :D


#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 , 0 , 33)
client_print(0,print_center,"[testing]...")
}
1) Not tested
2) I just made it quick , gotta sleep 4now :d .

zombieplague
06-24-2010, 11:41
Fine..I just want you to code by yourself :D


#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 , 0 , 33)
client_print(0,print_center,"[testing]...")
}
1) Not tested
2) I just made it quick , gotta sleep 4now :d .

alot of error.

GXLZPGX
06-24-2010, 11:41
Fine..I just want you to code by yourself :D


#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 , 0 , 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.

grimvh2
06-24-2010, 14:55
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?


#include <amxmodx>
#include <hamsandwich>

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

new Kills[33]

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

RegisterHam(Ham_Killed, "player", "FwdPlayerKilled")
RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawn", 1)
}


public FwdPlayerKilled(victim, attacker)
{
if(is_user_alive(attacker) && victim != attacker)
{
Kills[attacker]++

if(Kills[attacker] == 3)
{
client_print(attacker, print_chat, "You have killed 3 guys in a row.")
}
}
}

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

zombieplague
07-02-2010, 10:39
1# ive seen worse
2# what if he just wants an example?


#include <amxmodx>
#include <hamsandwich>

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

new Kills[33]

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

RegisterHam(Ham_Killed, "player", "FwdPlayerKilled")
RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawn", 1)
}


public FwdPlayerKilled(victim, attacker)
{
if(is_user_alive(attacker) && victim != attacker)
{
Kills[attacker]++

if(Kills[attacker] == 3)
{
client_print(attacker, print_chat, "You have killed 3 guys in a row.")
}
}
}

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


it didn't work

zombieplague
07-02-2010, 10:41
1# ive seen worse
2# what if he just wants an example?


#include <amxmodx>
#include <hamsandwich>

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

new Kills[33]

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

RegisterHam(Ham_Killed, "player", "FwdPlayerKilled")
RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawn", 1)
}


public FwdPlayerKilled(victim, attacker)
{
if(is_user_alive(attacker) && victim != attacker)
{
Kills[attacker]++

if(Kills[attacker] == 3)
{
client_print(attacker, print_chat, "You have killed 3 guys in a row.")
}
}
}

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


It didn't work

RedRobster
07-02-2010, 11:49
1# ive seen worse
2# what if he just wants an example?

Lolz. I guess not.

zombieplague
07-02-2010, 12:03
Lolz. I guess not.

Somone please help me :(

5c0r-|3i0
07-02-2010, 12:10
No . We won't help you . Because you're not helping yourself to understand the code and write it by yourself . So NO again =)) . LoL

wrecked_
07-02-2010, 12:13
https://forums.alliedmods.net/showthread.php?t=130616

#2

zombieplague
07-03-2010, 03:28
https://forums.alliedmods.net/showthread.php?t=130616

#2

Thanks, i have 1 prolem...


if ( g_iCount[ killer ] == 2 )
{
set_user_gravity( killer, 0.7 )
}

else if ( g_iCount[ killer ] == 5 )
{
set_user_gravity( killer, 0.3 )
}


this is when player kills reach 5 it will set his gravity to 0.3

but how to make it like this ?

when a player kills is 2, he have to kill 5 more to get gravity 0.3

DarkGod
07-03-2010, 05:57
Thanks, i have 1 prolem...


if ( g_iCount[ killer ] == 2 )
{
set_user_gravity( killer, 0.7 )
}

else if ( g_iCount[ killer ] == 5 )
{
set_user_gravity( killer, 0.3 )
}


this is when player kills reach 5 it will set his gravity to 0.3

but how to make it like this ?

when a player kills is 2, he have to kill 5 more to get gravity 0.3

2 + 5 = 7 ...?