AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] TIME (https://forums.alliedmods.net/showthread.php?t=294805)

DarthMan 03-08-2017 06:37

[Help] TIME
 
I need a little bit of help here, when i say rtv I want the plugin to display a emssage if 15 minutes were not elapsed since the map started, telling the client id how many mintues he must wait before saying rtv. If 100% fo the active players are saying rtv, it should ignore the timecheck and directly return the client emssage Time elapsed. Thanks!

Code:

#include <amxmodx>

new g_iHours, g_iMinutes, g_iSeconds;
new szMapName[ 32 ];

public plugin_init( )
{
    register_plugin("Map Voter", "1.0", "DarthMan")       
    register_clcmd( "say currentmap" , "current_map" )
    register_clcmd( "say_team currentmap" , "current_map" )
    register_clcmd( "say timeleft" , "timeleft" )
    register_clcmd( "say_team timeleft" , "timeleft" )
}

public current_map( id )
{
    new iGetGameTime = floatround( get_gametime( ) );
    g_iHours = iGetGameTime / 3600;   
    g_iMinutes = iGetGameTime / 60;
    g_iSeconds = iGetGameTime % 60;
    get_mapname( szMapName, charsmax( szMapName ) );
    client_print( id , print_chat, "Current map is %s and has been on for %d hours, %d minutes, and %d seconds.",szMapName, g_iHours, g_iMinutes, g_iSeconds );
    return PLUGIN_HANDLED; 
}

public timeleft( id )
{
    new iGetTimeLeft = get_timeleft( );
    g_iHours = iGetTimeLeft / 3600;   
    g_iMinutes = iGetTimeLeft / 60;
    g_iSeconds = iGetTimeLeft % 60;
    if (get_cvar_num("mp_timelimit")!=0)
    client_print( id , print_chat, "Time left: %d hours, %d minutes, and %d seconds.",g_iHours, g_iMinutes, g_iSeconds );
    if (get_cvar_num("mp_timelimit")==0)
    client_print( id , print_chat, "Time left: unlimited." );
    return PLUGIN_HANDLED;
}


DarthMan 03-08-2017 07:11

Re: [Help] TIME
 
I did the infinite text string displayer myself, I just found the command to get the cvar value.

DarthMan 03-10-2017 14:26

Re: [Help] TIME
 
Please close this topic :)


All times are GMT -4. The time now is 17:46.

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