Untitled

mail@pastecode.io avatar
unknown
plain_text
8 days ago
792 B
1
Indexable
Never
#namespace zm_subtitles;

REGISTER_SYSTEM( "zm_subtitles", &__init__, undefined )

function __init__()
{
    util::registerClientSys( "subtitleMessage" );
    callback::on_connect(&on_player_connect);
}

function on_player_connect(){
    self util::setClientSysState( "subtitleMessage", "" );
}

function subtitle_display(alias, player)
{
	iprintlnbold("reached sub gsc");
    if(isdefined(player) && IsPlayer(player) && player.sessionstate == "playing")
    {
		iprintlnbold("reached inside sub gsc");
        player util::setClientSysState( "subtitleMessage", alias, player );
    }
    else
		{
		iprintlnbold("reached else sub gsc");
        foreach(player_e in GetPlayers())
        {
            player_e util::setClientSysState( "subtitleMessage", alias, player_e ); 
        }
    }
}
Leave a Comment