11.04.2011, 16:52
can any one tell me how to create /me [action]
cmd plz
cmd plz
CMD:me(playerid, params[])
{
new pName[25], str[128];
if(!strlen(params[0])) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]");
GetPlayerName(playerid, pName, 25);
format(str, 128, "%s %s", pName, str);
SendClientMessageToAll(COLOR_YELLOW, str);
return 1;
}
if(!strcmp(cmdtext, "/me", true, 3) && cmdtext[3] == ' ')
{
if(strlen(cmdtext) == 4)
{
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
return 1;
}
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
SendClientMessageToAll(GetPlayerColor(playerid), str);
return 1;
}