Potrzebuję aby ktoś napisał lub przerobił mi jeden plugin./>
Mianowicie plugin ma zamieniać po X rundach wpisanych w cfg lub w sma wyniki drużyn, Z TT do CT i odwrotnie.
Prosił bym także aby plugin nie koligował z: mp_winround i mp_maxrounds
Przykładowo gramy do 13tej wygranej rundy, TT przed przenoszeniem wygrało 8:4 po przeniesieniu jak wygra jeszcze 5x mapa się zmieni.
Chodzi o to by wygrane nie były tylko wyświetlane ale i działały z całym hlds'em
Znalazłem takie coś:
#include #include #include #include new g_pGameRules; #define set_mp_pdata(%1,%2) ( OrpheuMemorySetAtAddress( g_pGameRules, %1, 1, %2 ) ) #define get_mp_pdata(%1) ( OrpheuMemoryGetAtAddress( g_pGameRules, %1 ) ) public plugin_precache() { OrpheuRegisterHook( OrpheuGetFunction( "InstallGameRules" ), "OnInstallGameRules", OrpheuHookPost ); } public OnInstallGameRules() { g_pGameRules = OrpheuGetReturn(); } public plugin_init () { register_plugin( "Set Team Score", "1.0.0", "Arkshine" ); register_concmd( "amx_tscore", "ClientCommand_SetTeamScore", ADMIN_RCON, "- " ); } public ClientCommand_SetTeamScore ( const player, const level, const cid ) { if ( !cmd_access( player, level, cid, 3 ) ) { return PLUGIN_HANDLED; } new team [ 2 ]; new score[ 6 ]; read_argv( 1, team , charsmax( team ) ); read_argv( 2, score, charsmax( score ) ); new signedShort = 32768; new scoreToGive = clamp( str_to_num( score ), -signedShort, signedShort ); switch ( team[ 0 ] ) { case 'C', 'c' : { set_mp_pdata( "m_iNumCTWins", scoreToGive ); } case 'T', 't' : { set_mp_pdata( "m_iNumTerroristWins", scoreToGive ); } case '@' : { set_mp_pdata( "m_iNumCTWins", scoreToGive ); set_mp_pdata( "m_iNumTerroristWins", scoreToGive ); } default : { return PLUGIN_HANDLED; } } UpdateTeamScores( .notifyAllPlugins = true ); return PLUGIN_HANDLED; } UpdateTeamScores ( const bool:notifyAllPlugins = false ) { static OrpheuFunction:handleFuncUpdateTeamScores; if ( !handleFuncUpdateTeamScores ) { handleFuncUpdateTeamScores = OrpheuGetFunction( "UpdateTeamScores", "CHalfLifeMultiplay" ) } ( notifyAllPlugins ) ? OrpheuCallSuper( handleFuncUpdateTeamScores, g_pGameRules ) : OrpheuCall( handleFuncUpdateTeamScores, g_pGameRules ); }
i takie coś
/* Plugin generated by AMXX-Studio */ #include #include #include #include #include #define SCORE_T 0 #define SCORE_CT 1 #define set_mp_pdata(%1,%2) ( OrpheuMemorySetAtAddress( g_pGameRules, %1, 1, %2 ) ) #define get_mp_pdata(%1) ( OrpheuMemoryGetAtAddress( g_pGameRules, %1 ) ) new g_pGameRules; new g_TeamScore[2]; new pCvarResult, lic; public plugin_init() { register_plugin("New Plug-In", "1.0", "author") register_event("TeamScore", "teamScore", "a") pCvarResult = register_cvar("change_team_result","12"); } public teamScore(){ new sTeam[2]; read_data(1, sTeam, 1); if( sTeam[0] == 'T' ) g_TeamScore[SCORE_T] = read_data(2); else g_TeamScore[SCORE_CT] = read_data(2); if(g_TeamScore[SCORE_CT]+ g_TeamScore[SCORE_T] >= get_pcvar_num(pCvarResult)) changeTeams(); } public changeTeams(){ lic++; if(lic > 1) return PLUGIN_HANDLED; for(new i = 1 ; i < 33; i++ ){ if(!is_user_connected(i) || cs_get_user_team(i) == CS_TEAM_SPECTATOR || cs_get_user_team(i) == CS_TEAM_UNASSIGNED ) continue; cs_set_user_team(i,cs_get_user_team(i) == CS_TEAM_CT ? CS_TEAM_T : CS_TEAM_CT,cs_get_user_team(i) == CS_TEAM_CT ? CS_T_LEET : CS_CT_GIGN); } set_mp_pdata( "m_iNumCTWins", g_TeamScore[SCORE_T] ); set_mp_pdata( "m_iNumTerroristWins", g_TeamScore[SCORE_CT] ); UpdateTeamScores( .notifyAllPlugins = true ); } UpdateTeamScores ( const bool:notifyAllPlugins = false ) { static OrpheuFunction:handleFuncUpdateTeamScores; if ( !handleFuncUpdateTeamScores ) { handleFuncUpdateTeamScores = OrpheuGetFunction( "UpdateTeamScores", "CHalfLifeMultiplay" ) } ( notifyAllPlugins ) ? OrpheuCallSuper( handleFuncUpdateTeamScores, g_pGameRules ) : OrpheuCall( handleFuncUpdateTeamScores, g_pGameRules ); } public plugin_precache() { OrpheuRegisterHook( OrpheuGetFunction( "InstallGameRules" ), "OnInstallGameRules", OrpheuHookPost ); } public OnInstallGameRules() { g_pGameRules = OrpheuGetReturn(); }Jeżeli ktoś zrobi mi z tego takie coś jestem w stanie zapłacić :Plugin wykonuje te 3 lub 4 opcje w podanej kolejności:
1. Zamiana teamów TT do CT, CT do TT
2. Nadanie każdemu graczowi standardowej kasy 800$
3. Zrobienie restartu rundy lub wczytanie po prosty 3rr.cfg (jak to się uda zrobić 2 punkt pomijamy)
4. Przywrócenie Poprzedniego wyniku TT i CT oczywiście po przeciwnych stronach ( TT prowadziło 6:5, po restarcie CT prowadzi 6:5)
Z góry dzięki za pomoc