AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   combined kills???? (https://forums.alliedmods.net/showthread.php?t=55675)

flyeni6 05-27-2007 13:55

combined kills????
 
how can i get the combined kills of a team.

like if a team gets 50 kills the game will restart

thx

flyeni6 05-27-2007 20:16

Re: combined kills????
 
anyone know how to do this?

Cheap_Suit 05-27-2007 20:54

Re: combined kills????
 
Quote:

Originally Posted by regalis (Post 482676)
What do you think how to do this?
I think you are human, and humans are capable to think..so what do you THINK how to do that?

That's just wrong.

@ flyeni6 : something like this. It will check each teams kills everytime someone died.
PHP Code:

public plugin_init()
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
register_event("DeathMsg""event_death""a")
}
 
public 
event_death()
{
 static 
players[32], numiidtotal_kills
 
 get_players
(playersnum"e""T")
 
total_kills 0
 
 
for(0num; ++i)
 {
  
id players[i]
  
total_kills += get_user_frags(id)
 }
 
 if(
total_kills >= 50)
 {
  
client_print(0print_chat"The terrorist reached 50 kills")
  
server_cmd("sv_restart 5")
 }
 
 
get_players(playersnum"e""CT")
 
total_kills 0
 
 
for(0num; ++i)
 {
  
id players[i]
  
total_kills += get_user_frags(id)
 }
 
 if(
total_kills >= 50)
 {
  
client_print(0print_chat"The Counter-Terrorist reached 50 kills")
  
server_cmd("sv_restart 5")
 }
 



regalis 05-27-2007 21:12

Re: combined kills????
 
I wouldn't check the users frags, because you get 3 frags for bombing the bombspot or defusing the bomb...
I would save the kills in a global variable...
Btw.: ignore my last post...im a little pissed off because last time i helped you i got no response if it works and no karma for my work...i hate that :(

flyeni6 05-27-2007 21:17

Re: combined kills????
 
lol i can't give karma no more anyways lol.

but thanks you guys for your help :D

Cheap_Suit 05-27-2007 21:21

Re: combined kills????
 
Oh yea. Then all you have to do is record the players kills when he kills another player and add that instead of using get_user_frags function.

regalis 05-27-2007 21:21

Re: combined kills????
 
Quote:

Originally Posted by flyeni6 (Post 482696)
lol i can't give karma no more anyways lol.

but thanks you guys for your help :D

i can... :mrgreen:

Lee 05-27-2007 21:35

Re: combined kills????
 
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define KILL_LIMIT 50 new terrorist_kills, ct_kills public plugin_init() {     register_plugin("Restart On x Kills", "1.0", "Lee") } public client_death(killer, victim, wpnindex, hitplace, TK) {     switch(cs_get_user_team(killer))     {         case CS_TEAM_T: terrorist_kills++         case CS_TEAM_CT: ct_kills++     }         if(terrorist_kills >= KILL_LIMIT || ct_kills >= KILL_LIMIT)     {         terrorist_kills = 0         ct_kills = 0         server_cmd("sv_restart 5")     } }
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define KILL_LIMIT 50 new terrorist_kills, ct_kills public plugin_init() {     register_plugin("Restart On x Kills", "1.0", "Lee") } public client_death(killer, victim, wpnindex, hitplace, TK) {     switch(cs_get_user_team(killer))     {         case CS_TEAM_T:                         if(++terrorist_kills >= KILL_LIMIT)             {                 kill_limit_reached()                 client_print(0, print_chat, "The terrorist team have reached %d kills..", KILL_LIMIT)             }                         case CS_TEAM_CT:                         if(++ct_kills >= KILL_LIMIT)             {                 kill_limit_reached()                 client_print(0, print_chat, "Counter-Terrorists have reached %d kills..", KILL_LIMIT)             }     } } public kill_limit_reached() {     terrorist_kills = 0     ct_kills = 0     server_cmd("sv_restart 5") }

regalis 05-27-2007 21:41

Re: combined kills????
 
i went in bed... :stupid:

btw.: nice help Lee.. :shock:

flyeni6 05-28-2007 13:21

Re: combined kills????
 
nice lee

thx


All times are GMT -4. The time now is 10:32.

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