AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Round end (https://forums.alliedmods.net/showthread.php?t=187944)

JRISETH 06-20-2012 06:15

Round end
 
Hello,

I'm currently doing a plugin for my public server. The idea of the plugin is that when a terrorist team wins, then all the CTs would die and vice-versa. The problem is, that when I'm alone in the server testing the plugin, it works great. When 2 or more people are in the server, then when CT defuses a bomb, all terrorists die but I've also got a message, that says 'All Terrorists have been killed' and when CT defuses a bomb, that message appears twice for some reason. When Terrorists plant a bomb and it exploads, then all players die and messages appear three or four times for some reason.

Here's my code:

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <colorchat> #include <cstrike> #include <csx> #define PLUGIN "JRISETH / Kill looser team members" #define VERSION "1.0" #define AUTHOR "JRISETH" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")     register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")   } public t_win() {         ColorChat(0, GREEN, "TERRORISTIDE^1 tiim vƵitis, kƵik ellujƤƤnud ^4COUNTER-TERRORISTID^1 tapeti.");         new         pPlayers[32],         pNum;             get_players(pPlayers, pNum, "ae", "CT");         for(new i; i < pNum; i++)         user_silentkill(pPlayers[i]);         return PLUGIN_HANDLED } public ct_win() {         ColorChat(0, GREEN, "COUNTER-TERRORISTIDE^1 tiim vƵitis, kƵik ellujƤƤnud ^4TERRORISTID^1 tapeti.");         new         pPlayers[32],         pNum;             get_players(pPlayers, pNum, "ae", "TERRORIST");         for(new i; i < pNum; i++)         user_silentkill(pPlayers[i]);         return PLUGIN_HANDLED }

Napoleon_be 06-20-2012 06:49

Re: Round end
 
You don't have to return anything at t_win and ct_win.. And further i can't see any problems at your code. Try disabling all other plugins, a plugin might be doubling your message or bugging your silentkill.

JRISETH 06-20-2012 07:00

Re: Round end
 
Quote:

Originally Posted by Napoleon_be (Post 1732289)
You don't have to return anything at t_win and ct_win.. And further i can't see any problems at your code. Try disabling all other plugins, a plugin might be doubling your message or bugging your silentkill.

I've disabled all my plugins and infact, it got worse. Also I've deleted the return statements and nothing has changed.

Napoleon_be 06-20-2012 07:06

Re: Round end
 
Also, i think you have some invalid characters in your print message. Could be the reason why it is printing twice, i'm not sure. Also, if you want to print to only 1 team, get the players of a certain team and print it to them.

JRISETH 06-20-2012 07:12

Re: Round end
 
Quote:

Originally Posted by Napoleon_be (Post 1732302)
Also, i think you have some invalid characters in your print message. Could be the reason why it is printing twice, i'm not sure. Also, if you want to print to only 1 team, get the players of a certain team and print it to them.

I've now removed the part from my code, where there is a loop between all the players and now the messages appear perfectly fine.

Napoleon_be 06-20-2012 07:15

Re: Round end
 
Give me your current code.

JRISETH 06-20-2012 07:21

Re: Round end
 
Quote:

Originally Posted by Napoleon_be (Post 1732306)
Give me your current code.

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <colorchat> #include <cstrike> #include <csx> #define PLUGIN "JRISETH / Kill looser team members" #define VERSION "1.0" #define AUTHOR "JRISETH" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")     register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")   } public t_win() {         ColorChat(0, GREEN, "TERRORISTIDE^1 tiim vƵitis, kƵik ellujƤƤnud ^4COUNTER-TERRORISTID^1 tapeti.");         /*new         pPlayers[32],         pNum;             get_players(pPlayers, pNum, "ae", "CT");         for(new i; i < pNum; i++)         user_silentkill(pPlayers[i]);*/     } public ct_win() {         ColorChat(0, GREEN, "COUNTER-TERRORISTIDE^1 tiim vƵitis, kƵik ellujƤƤnud ^4TERRORISTID^1 tapeti.");         /*new         pPlayers[32],         pNum;             get_players(pPlayers, pNum, "ae", "TERRORIST");         for(new i; i < pNum; i++)         user_silentkill(pPlayers[i]);*/     }

Napoleon_be 06-20-2012 07:32

Re: Round end
 
I'd rather use bomb_explode and bomb_defused using csx include.

Exolent[jNr] 06-20-2012 09:43

Re: Round end
 
Your code is fine.

Quote:

Originally Posted by Napoleon_be (Post 1732320)
I'd rather use bomb_explode and bomb_defused using csx include.

Bomb isn't the only game mode in CS.

Napoleon_be 06-20-2012 09:48

Re: Round end
 
But the only one which can keep the loosing team players alive tho? Except for the round end then.


All times are GMT -4. The time now is 06:14.

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