Quote:
Originally Posted by OciXCrom
Save the name in a variable and add it to the string later.
|
I can't, there would be no information on who the command will be executed upon.
PHP Code:
#define MAX_PLAYERS 32
#define MAX_NAME_LENGTH 31
new g_szNameHolder[ MAX_PLAYERS + 1 ][ MAX_NAME_LENGTH + 1 ];
public plugin_init( )
{
register_clcmd( "suspendTime", "OnSuspendTime" );
}
public OnSuspend_Handler( id, iMenu, iItem )
{
new szPlayerId[ 2 ], iAccess, iItemCallback;
menu_item_getinfo( iMenu, iItem, iAccess, szPlayerId, charsmax( szPlayerId ), _, _, iItemCallback );
menu_destroy( iMenu );
new iTarget = str_to_num( szPlayerId );
if( ! is_user_connected( iTarget ) )
return PLUGIN_HANDLED;
new szName[ 32 ];
get_user_name( iTarget, szName, charsmax( szName ) );
copy( g_szNameHolder[ iTarget ], charsmax( g_szNameHolder ), szName );
client_cmd( id, "messagemode suspendTime" );
return PLUGIN_CONTINUE;
}
public OnSuspendTime( id )
{
new szArgs[ 192 ];
read_args( szArgs, charsmax( szArgs ) );
remove_quotes( szArgs );
// we got no ID to identify the person
}
__________________