Help me to create cmd
#1

I want it to be like this:
When you type /house store it would show message like this: USAGE: /house store [guns/money] [amount]

I have this cmd:
Код:
CMD:house(playerid, params[])
{
new choice[56];
if(strcmp(choice, "store", true) == 0)
{
WHAT TO PUT HERE?
}
return 1; 
}
Reply
#2

what do you mean [guns/money]?
Reply
#3

I don't know how to make command with few options such as /house store guns 100 and /house lock
Reply
#4

If you want effective help, more details are required.
Reply
#5

I want to have few options in one cmd, it should be like this:

/house lock
/house store guns/money amount
/house packs

and so on, and I don't know how to make /house lock and /house store guns/money in the same cmd
Reply
#6

if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /house [what ever u mean]");

add that
Reply
#7

use sscanf
pawn Код:
CMD:house(playerid, params[])
{
new choice[56],amount;
if(sscanf(params,"si",choice,amount)) return SendClientMessage(playerid,-1,"USAGE: /housestore [guns/money] [amount]");
if(!strcmp(choice, "guns", true))
{
WHAT TO PUT HERE?
}
if(!strcmp(choice, "money", true))
{
WHAT TO PUT HERE?
}return 1;
}
Reply
#8

Tanush you missed up the lenght of the string. You should put s[10] or more.
Reply
#9

Hmm I don't understand what you mean.. Could you give us more information?
Reply
#10

Man , Go on Wiki and learn all the functions and about includes , Than u'll be ready for create a cmd...
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)