Page 1 of 1

Sustabdytas žaidimas ir žinutė

Posted: 2015 Apr 12 18:51
by Froza
Sveiki,
Man reikėtu plugino kuris sustabdytu žaidimą ir būtu juodas ekranas, o per vidurį rašytų tam tikrą žinute.

Re: Sustabdytas žaidimas ir žinutė

Posted: 2015 Apr 14 18:24
by xFrostas
Bandykis, tik nesustabdo roundtimer'io.

Code: Select all

#include < amxmodx >#include < hamsandwich >#include < fakemeta > #define VERSION "1.0" #define TASKID_SHOWTEXT 81234 new bool:g_bStopped; new g_iMsgid_ScreenFade; public plugin_init( ){    register_plugin( "Stop The Game", VERSION, " " );     register_clcmd( "amx_stg", "Clcmd_STG", ADMIN_CVAR );     RegisterHam( Ham_Spawn, "player", "Ham_Spawn_Post", 1 );     g_iMsgid_ScreenFade = get_user_msgid( "ScreenFade" );} public Clcmd_STG( iPlayer ){    g_bStopped = g_bStopped ? false : true;     new iPlayers[ 32 ], iNum;    get_players( iPlayers, iNum, "a" );     for( new i = 0; i < iNum; i++ )        fnStopTheGame( iPlayers[ i ] );     // client_cmd( iPlayer, "amx_pause %i", g_bStopped ? 0 : 1 );     return PLUGIN_HANDLED;} public Ham_Spawn_Post( iPlayer ){    if( is_user_alive( iPlayer ) && g_bStopped )    {        fnStopTheGame( iPlayer );    }} public fnStopTheGame( iPlayer ){    message_begin( MSG_ONE_UNRELIABLE, g_iMsgid_ScreenFade, _, iPlayer );    write_short( 1<<1 );    write_short( 1<<1 );    write_short( 0x0004 );    write_byte( 0 );    write_byte( 0 );    write_byte( 0 );    write_byte( g_bStopped ? 255 : 0 );    message_end( );     if( g_bStopped )    {        set_pev( iPlayer, pev_flags, pev( iPlayer, pev_flags) | FL_FROZEN );        set_task( 0.2, "Task_ShowText", iPlayer + TASKID_SHOWTEXT );    }    else    {        remove_task( iPlayer + TASKID_SHOWTEXT );        set_pev( iPlayer, pev_flags, pev( iPlayer, pev_flags ) & ~FL_FROZEN );    }} public Task_ShowText( iPlayer ){    iPlayer -= TASKID_SHOWTEXT;     // client_print( iPlayer, print_center, "Tekstas" );     set_hudmessage( 255, 0, 0, -1.0, 0.42, 0, 0.01, 1.1, 0.01, 0.01, -1 );    show_hudmessage( iPlayer, "Tekstas" );     set_task( 1.0, "Task_ShowText", iPlayer + TASKID_SHOWTEXT );}