[zcmd] - Space in commands possible?
#1

Hello,
Is it possible to have a space in a command when using 'zcmd'?

Example:
/create House
/create Business
Reply
#2

Nope its not possible
use strcmp to make a command like this

Код:
USAGE: /create [House/Business]
Reply
#3

Quote:
Originally Posted by Romel
Посмотреть сообщение
Nope its not possible
use strcmp to make a command like this

Код:
USAGE: /create [House/Business]
are you sure?
use strcmp its possible
Reply
#4

By mistake i mean i'm sure by using sscanf and strcmp with zcmd i didn't done this before so sorry if i give wrong hint
Reply
#5

Mind for an example of just the command line?
Reply
#6

Yes, you use strcmp in zcmd. Keep in mind strcmp is not a command processor, it's a string comparer.
pawn Код:
CMD:create(playerid, params[])
{
    new option[20];
    if(isnull(params)) // if they didn't type something after /create
    {
        // tell em how to use it.
        return SendClientMessage(playerid, -1, "USAGE: /create [house/business]");
    }
    if(!strcmp(option, "house", true))
    {
        // if they typed house
        // code goes here
        return 1;
    }
    if(!strcmp(option, "business", true))
    {
        // if they typed business
        // code here.
        return 1;
    }
    return 1;
}
Reply
#7

Cheers mate, Greatly appreciated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)