Raised This Month: $ Target: $400
 0% 

Solved Passing arguments to messagemode


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-17-2018 , 18:03   Re: Passing arguments to messagemode
Reply With Quote #1

Code:
client_cmd( id, "messagemode suspendTime ^"%s^"", szName );

I don't think you can do that. Save the name in a variable and add it to the string later.

Code:
client_cmd( id, "messagemode suspendTime" );
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-17-2018 , 18:21   Re: Passing arguments to messagemode
Reply With Quote #2

Quote:
Originally Posted by OciXCrom View Post
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_szNameHolderMAX_PLAYERS ][ MAX_NAME_LENGTH ];

public 
plugin_init( ) 

    
register_clcmd"suspendTime""OnSuspendTime" ); 


public 
OnSuspend_HandleridiMenuiItem 

    new 
szPlayerId], iAccessiItemCallback
     
    
menu_item_getinfoiMenuiItemiAccessszPlayerIdcharsmaxszPlayerId ), __iItemCallback ); 
    
menu_destroyiMenu ); 
     
    new 
iTarget str_to_numszPlayerId ); 
          
    if( ! 
is_user_connectediTarget ) ) 
    return 
PLUGIN_HANDLED
          
    new 
szName32 ]; 
    
get_user_nameiTargetszNamecharsmaxszName ) ); 
         
    
copyg_szNameHolderiTarget ], charsmaxg_szNameHolder ), szName );
    
client_cmdid"messagemode suspendTime" );
    
    return 
PLUGIN_CONTINUE
}

public 
OnSuspendTimeid 
{
    new 
szArgs192 ];
    
read_argsszArgscharsmaxszArgs ) ); 
    
remove_quotesszArgs ); 
     
    
// we got no ID to identify the person

__________________

Last edited by edon1337; 08-17-2018 at 18:31.
edon1337 is offline
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: India
Old 08-17-2018 , 22:28   Re: Passing arguments to messagemode
Reply With Quote #3

Quote:
Originally Posted by edon1337 View Post
I can't, there would be no information on who the command will be executed upon.
I think you must go with what OciXCrom said.
Check my Whatsapp plugin for more example of messagemode.
__________________
CrAzY MaN is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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