Bug 3068 - New command : amx_extendmap <number of minutes>
New command : amx_extendmap <number of minutes>
Status: RESOLVED FIXED
Product: AMX Mod X
Classification: Unclassified
Component: Base Plugins
trunk
PC All
: P4 minor
Assigned To: amxmodx-bugs@alliedmods.net
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-26 11:56 PDT by Vincent Herbet [:Arkshine]
Modified: 2014-02-08 23:51 PST (History)
4 users (show)

See Also:


Attachments

Description Vincent Herbet [:Arkshine] 2007-10-26 11:56:05 PDT
It's a request from some people.

That's a feature from Amx2006.3.

It allows you to extend the current map.


Some lines to add in '//admincmd.sma//' :

<code>new p_timelimit

public plugin_init()
{
    // [...]
    register_concmd( "amx_extendmap", "cmdExtendMap", ADMIN_MAP, "<number of minutes> - extends map" )
    
    // [...]
    p_timelimit = get_cvar_pointer( "p_timelimit" )
}

// [...]

public cmdExtendMap(id, level, cid)
{
    if(!cmd_access(id, level, cid, 2))
        return PLUGIN_HANDLED
    
    new arg[32]
    read_argv(1, arg, 31)
    new mns = str_to_num(arg)
    
    if(mns <= 0)
        return PLUGIN_HANDLED
    
    new mapname[32]
    get_mapname(mapname, 31)
    set_pcvar_num( p_timelimit , get_pcvar_num( p_timelimit ) + mns)
    
    new authid[32], name[32]
    
    get_user_authid(id, authid, 31)
    get_user_name(id, name, 31)
    
    show_activity_key("ADMIN_EXTEND_1", "ADMIN_EXTEND_2", name, mns)
    
    log_amx("ExtendMap: ^"%s<%d><%s><>^" extended map ^"%s^" for %d minutes.", name, get_user_userid(id), authid, mapname, mns)
    console_print(id, "%L", id, "MAP_EXTENDED", mapname, mns)
    
    return PLUGIN_HANDLED
}</code>

And 3 keys language to add :
<code>ADMIN_EXTEND_1 = ADMIN: extend map for %d minutes
ADMIN_EXTEND_2 = ADMIN %s: extend map for %d minutes
MAP_EXTENDED   = Map "%s" has been extended for %d minutes</code>


Thanks. 
Comment 1 [DeathTV] Sid 6.7 2007-11-12 15:16:36 PST
This is in AMX Super
Comment 2 Vincent Herbet [:Arkshine] 2007-11-13 02:47:17 PST
It makes non-sens installing 'Amxx super' just for one command which should be integrated by default.
Comment 3 sawce 2008-03-29 22:21:17 PDT
I would try to sneak this in 1.8.1 even though it's a new feature, but getting new language keys is a really huge hassle. :\
Comment 4 Vincent Herbet [:Arkshine] 2013-06-17 01:13:57 PDT
After 5 years, language keys are finally done. Will be added for next version.
Comment 5 Vincent Herbet [:Arkshine] 2013-06-25 07:59:42 PDT
Pushed changeset: http://hg.alliedmods.net/amxmodx-central/rev/0f878ec60a69
Changelog:
	Add new command : amx_extendmap (bug 3068, r=sawce)
Comment 6 AM Bugzilla Bot 2014-02-08 23:51:59 PST
Commit pushed to master at https://github.com/alliedmodders/amxmodx

https://github.com/alliedmodders/amxmodx/commit/6b6fe3c5d9a09807aaaa8a34d8461648c2421dbc
Add new command : amx_extendmap (bug 3068, r=sawce)


Former-commit-id: 064f10034400fe162072676f4fa362c68c8e8938

Note You need to log in before you can comment on or make changes to this bug.