/command [something]
#1

Hello everyone! I'm new to this scripting stuff. I read tutorials and watched some ******* videos, and I learned some shit.

I am having a problem I need help with.
If you want to mock me or whatever, please don't post here.

If you wanted to help, please don't post the code without explaining anything, I don't like copy paste, I like to learn it before using it.


I am trying to make something like /command [option] [Example: /hat [color]]
I know how to add the hats and shit, but how can I make a command with options?

Thanks.
Reply
#2

Quote:
Originally Posted by Stinged
Посмотреть сообщение
Hello everyone! I'm new to this scripting stuff. I read tutorials and watched some ******* videos, and I learned some shit.

I am having a problem I need help with.
If you want to mock me or whatever, please don't post here.

If you wanted to help, please don't post the code without explaining anything, I don't like copy paste, I like to learn it before using it.


I am trying to make something like /command [option] [Example: /hat [color]]
I know how to add the hats and shit, but how can I make a command with options?

Thanks.
you can use dialogs.
Reply
#3

I can. But... Uh, I'm just learning how to use the /command [option] thing, so I asked for help.
Reply
#4

pawn Код:
#include <sscanf2>
#include <zcmd>

#define SCM SendClientMessage
#define COLOR_ERROR 0x808080FF

CMD:hat(playerid,params[])
{
new color[28];
if(sscanf(params,"s[28]",color)) return SCM(playerid,COLOR_ERROR,"Usage: /hat [color]");
if(strcmp(color, "blue", true)==0)
{
//HERE What happens if they write blue or BlUe or BLUE or bLuE etc..
}
if(strcmp(color, "red", true)==0)
{
//HERE What happens if they write red etc..
}

return 1;
}
HERE the sscanf2 https://sampforum.blast.hk/showthread.php?tid=120356

HERE the zcmd https://sampforum.blast.hk/showthread.php?tid=91354
Reply
#5

Quote:
Originally Posted by NeMoK
Посмотреть сообщение
pawn Код:
#include <sscanf2>
#include <zcmd>

#define SCM SendClientMessage
#define COLOR_ERROR 0x808080FF

CMD:hat(playerid,params[])
{
new color[28];
if(sscanf(params,"s[28]",color)) return SCM(playerid,COLOR_ERROR,"Usage: /hat [color]");
if(strcmp(color, "blue", true)==0)
{
//HERE What happens if they write blue or BlUe or BLUE or bLuE etc..
}
if(strcmp(color, "red", true)==0)
{
//HERE What happens if they write red etc..
}

return 1;
}
I will try it right now. Thank you for helping me.
Reply
#6

let me know if there is any problem.
Reply
#7

Thank you, NeMoK.
It worked perfectly.

+1 reputation.
Reply
#8

Perfect. Thanks to you.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)