[HELP NEEDED] I want to know how to make commands like /me
#1

Hello,
I'm trying to know the codes a little bit but I don't know how to make commands like:
[me=dirkblok]grabs a cigar[/me]
that it looks like
*Player grabs a cigar*

Can someone help me with this?

Thanks alot
Reply
#2

Oops I didn't saw that / me actually works on this forum, but I hope you guys know what I mean, like in roleplay servers.
Thanks alot
Reply
#3

Same here!
Also. I would like to have /do ...
it's the opposite of / me.

it's like:
/ me attempds to break the carwindow
/do Succeeded - It's broken
Reply
#4

Enter that under OnPlayerCommandText public:

Код:
if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
	{
	  if(!cmdtext[3]) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
    new string[128], name[16];
	  GetPlayerName(playerid, name, sizeof(name));
	  format(string, 128, "*** %s %s", name, cmdtext[4]);
	  SendClientMessageToAll(COLOR_LIGHTGREEN, string);
	  return 1;
And define this at top of the gamemode:

Код:
#define COLOR_LIGHTGREEN 0x00F400FF
Hope I helped and it works
Regards
Puzi
Reply
#5

Thanks alot man!
Reply
#6

Next time at least try to search on wiki before you post: https://sampwiki.blast.hk/wiki/Using_strcmp()
Reply
#7

Sorry, I tried but couldn't find on the forums
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)