Raised This Month: $51 Target: $400
 12% 

Command Arg without quotes


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
aequabit
Junior Member
Join Date: Aug 2016
Old 08-11-2016 , 02:19   Command Arg without quotes
Reply With Quote #1

Hello,

I created a command which takes one argument and prints this argument to the chat.

PHP Code:
public Action:chatCommand(clientargs) {
    if(
args 1) {
        
PrintToConsole(client"usage: chatmessage <message>");
        return 
Plugin_Handled;
    }

    new 
String:Arg1[256];

    
GetCmdArg(1Arg1sizeof(Arg1));

    
PrintToChatAll("Admin: %s"Arg1);
    return 
Plugin_Handled;

If I use the command like
PHP Code:
chatmessage "this is my message" 
it prints the whole message.

But if I do
PHP Code:
chatmessage this is my message 
it splits at the first space and only prints "Admin: this".

Is there any way to fix this? Thank you very much for your help!
aequabit is offline
 



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 15:40.


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