引用 | 編輯
ccw111
2012-06-30 17:22 |
2樓
▲ ▼ |
register_logevent( "Event_RouneEnd" , 2 , "1=RouneEnd" )
等我一會再寫 ( 要測試 ) x1 |
引用 | 編輯
ccw111
2012-06-30 18:52 |
6樓
▲ ▼ |
#include < amxmodx >
#include < cstrike > public plugin_init( ) { register_logevent( "Event_RoundEnd" , 2 , "1=Round_End" ); } public Event_RoundEnd( ) { new iPlayer[ 32 ] , iCount; get_players( iPlayer , iCount ); new iSelected , iRanNum; new TempID; while( !iSelected ) { iRanNum = random( iCount ); TempID = iPlayer[ iRanNum ]; if( cs_get_user_team( TempID ) != CS_TEAM_T ) { cs_set_user_team( TempID , CS_TEAM_T ) iSelected ++; return PLUGIN_HANDLED_MAIN; } } return PLUGIN_HANDLED_MAIN; } 類似這樣就是了,但我未測試過 不過要加在不同插件的話,應該要作一些修改 x1 |
引用 | 編輯
ccw111
2012-06-30 19:51 |
12樓
▲ ▼ |
#include < amxmodx >
#include < cstrike > public plugin_init( ) { register_logevent( "Event_RoundEnd" , 2 , "1=RountEnd" ); } public Event_RoundEnd( ) { new iPlayer[ 32 ] , iCount; get_players( iPlayer , iCount ); new iSelected , iRanNum; new TempID; while( iSelected < 2 ) { iRanNum = random( iCount ); TempID = iPlayer[ iRanNum ]; if( cs_get_user_team( TempID ) != CS_TEAM_T ) { cs_set_user_team( TempID , CS_TEAM_T ) iSelected ++; return PLUGIN_HANDLED_MAIN; } } return PLUGIN_HANDLED_MAIN; } 我改了的地方是while 另外不用給我花了 x0 |
引用 | 編輯
ccw111
2012-06-30 20:37 |
15樓
▲ ▼ |
下面是引用 96066289 於 2012-06-30 20:13 發表的 :if( maxplayer >= 1 ) else if(maxplayer >= 8 ) else if(maxplayer >= 16 ) 我可以告訴你,這3個中只有第一個case能執行 為什麼? maxplayer >= 8 基本上和 maxplayer >= 1 一樣 maxplayer >= 16也是一樣的情況 下面的兩個CASE自然就不會執行(因為第一個已經符合了) 因此你使需要這樣做 if( maxplayer >= 1 && maxplayer < 8 ) else if( maxplayer >= 8 && maxplayer < 16 ) x0 |