"USAGE:" For commands
#1

Hey guys, I'm making some commands for my server. I was wondering how you can add a "USAGE:" When someone does the command in the wrong way! For example. If someone just does /me, it should say "USAGE: /me <text>. I hope you can help me!
Reply
#2

https://sampwiki.blast.hk/wiki/Fast_Commands No problem.
Reply
#3

You need sscanf to do this or isnull() from ZCMD
anyways i made a quick one for ya
pawn Код:
CMD:me(playerid,params[])
{
    new Message[128];
    if(isnull(params)) return SendClientMessage(playerid,white,"USAGE:/me <text>");
    if(sscanf(params,"s[128",Message)) return SendClientMessage(playerid,white,"USAGE:/me <text>");
    return 1;
}
Reply
#4

Quote:
Originally Posted by Goldino
Посмотреть сообщение
Hey guys, I'm making some commands for my server. I was wondering how you can add a "USAGE:" When someone does the command in the wrong way! For example. If someone just does /me, it should say "USAGE: /me <text>. I hope you can help me!
easy, if you are using ****** sscanf plugin then you can simply put a line like this
pawn Код:
new text[128]
if(sscanf(params,"s[128]",text)) return SendClientMessage(playerid,0xE6E61AC8,"Usage /me <atext>");
you can read here for more info https://sampforum.blast.hk/showthread.php?tid=120356

or you can do
pawn Код:
if(isnull(params)) return SendClientMessage(playerid,0xE6E61AC8,"Usage /me <atext>");
Reply
#5

with strcmp:
pawn Код:
if(!strcmp(cmdtext, "/hi", true)) {
    if(!strlen(cmdtext[4])) return SendClientMessage(playerid, -1, #USAGE: ...);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)