[Help] ZCMD
#1

How to make a command in ZCMD new format to be like the following:


/eat 1
SendClientMessage: You have eaten sandwitch

/eat 2
SendClientMessage: You have eaten pizza
Reply
#2

CMD:eat(playerid, params[])
{
SendClientMessage(playerid,[COLOR], You've Eaten A Sandwitch");
return 1;
}

??
Reply
#3

That's /eat, not /eat 1 nor /eat 2.
And I don't want /eat1 nor /eat2.

??
Reply
#4

use strcmp
Reply
#5

Seriously, if you can't do it then just close the thread.
I've got my own reasons to ask for it in the ZCMD format...
Reply
#6

use sscanf
Reply
#7

pawn Код:
CMD:eat(playerid, params[])
{
    new food;
    if(sscanf(params, "i", food)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE: /eat [food ID]");
    switch(food)
    {
        case 1:
        case 2://etc
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by bigcomfycouch
Посмотреть сообщение
pawn Код:
CMD:eat(playerid, params[])
{
    new food;
    if(sscanf(params, "i", food)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE: /eat [food ID]");
    switch(food)
    {
        case 1:
        case 2://etc
    }
    return 1;
}
I don't really know what to say, you're an OG'
Is there a way to use /eat pizza instead of /eat 1?
Reply
#9

pawn Код:
CMD:eat(playerid, params[])
{
    new food[32];
    if(sscanf(params, "s", food)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE: /eat [food ID]");
    if(!strcmp(food, "pizza", true, 5))
    {
    }
    else if(!strcmp(food, "burger", true, 6))
    {
    }
    return 1;
}
Reply
#10

This works, thanks man
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)