12.11.2012, 18:16
Hello, today I will show you how to make a simple Out Of Character command.
Let's start with the first step:
Defines / Includes.
The color that we will use.
Now we are done. Let's use our zcmd to make the command.
Okay this part is easy just goin to add the string that we will use. Which will be string [128] just like this
See? easy.. Let's go now for the Syntax part in case someone just wrote /o without the text. He gets ERROR: /o <text>
Okay. Your doing great. Last part is the message that will be sent to the whole server when u use this command.
Finally we do
So here's the whole code.
I hope you like my tutorial because it's the first tutorial I make on sa-mp forums.
Let's start with the first step:
Defines / Includes.
Код:
#include <zcmd> #include <sscanf2>
Код:
#define COLOR_GRAY 0xAFAFAFAA
Код:
CMD:ooc(playerid, params[]) {
Код:
new string[128];
Код:
if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAY, "ERROR: /ooc <text>");
Код:
format(string, sizeof(string), "[OOC-Chat] %s: (( %s ))", GetPlayerNameEx(playerid), params); SendClientMessageToAll(COLOR_GRAY, string);
Код:
return 1; }
Код:
CMD:ooc(playerid, params[]) { new string[128]; if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAY, "ERROR: /ooc <text>"); format(string, sizeof(string), "[OOC-Chat] %s: (( %s ))", GetPlayerNameEx(playerid), params); SendClientMessageToAll(COLOR_GRAY, string); return 1; }