AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   register_event and swap players (https://forums.alliedmods.net/showthread.php?t=129130)

Auronn 06-09-2010 08:08

register_event and swap players
 
Hello to all.
i'm need to make plugin for b.rush game.
If u dont know what is it:

Code:


b.rush needs 8 players, 5T and 3 CT.
Normally it would be 4on4 and a knife round would be played to decide the teams.
The Ts need to rush bomb site B and CTs need to defend it.
If Ts win the round, the 3 who got kills go CT and the CTs go T(if CT loose the round)- then restartround. if Terrorist-player make 2 frags(kill two CT's) , he goes to CT and he choose else 1 player from T.
If CTs win the round, the teams stay the same and the game continues.
If CTs win 8 or 10 rounds in a row, a new map is chosen.
 
There are a few rules:
NO flashbangs
NO sheilds
NO nade spamming from spawn (only an issue on certain maps, E.g. the 1 i made)
Ts must NOT run mid or any other route to get to B (They must use the shortest route) (E.g. de_inferno - rush banana, de_dust2 - rush tunnels)
 
Server side settings need to be:
mp_friendlyfire 0
mp_startmoney 800
mp_roundtime 1
mp_freezetime 0
sv_gravity 800

so here is my simple code but dont know whats wrong:

PHP Code:

#include <amxmodx>
#include <cstrike>
public plugin_init()
{
 
register_event"SendAudio""e_terrorist_win""a""2&%!MRAD_terwin" );
}
 
//If terrorist win all cts will be transfered to terrorist. And those terrorist whom killed someone will be transfered to ct. 
public e_terrorist_win( ) {
 
transfer()
 
 new 
players32 ], numplayeriFrags;
 
get_playersplayersnum"ea""TERRORIST" );
 
 for( new 
0numi++ ) {
  
player players];
 
  
iFrags get_user_fragsplayer );
 
  if( 
iFrags >= ) {
   
cs_set_user_teamplayerCS_TEAM_CT );
  }
 }
}
public 
transfer() {
 new 
CsTeams:teamplayers32 ], numplayeriFrags;
 
get_playersplayersnum"ea""CT" );
 
 for( new 
0numi++ ) {
  
player players];
  
cs_set_user_teamplayerCS_TEAM_T );
 }


i know, is better will using register_logevent( "Event_RoundEnd", 2, "1=Round_End" );
and check, Terrorist have frag or not from Deathmsg_event but i dont know how.
Please help me with it.

Auronn 07-27-2010 06:27

Re: register_event and swap players
 
can somebody help me please

DaxProxy 07-28-2010 08:07

Re: register_event and swap players
 
Okay, first indent code...
Then paste us the error the compiler gives you...
And then ask for help again, we can't help you if you dont provide us enough information that is vital.


All times are GMT -4. The time now is 05:19.

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