#1

can any one tell me how to create /me [action]
cmd plz
Reply
#2

pawn Код:
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;
}
Got it from this link

Kwarde's filterscript

https://sampforum.blast.hk/showthread.php?tid=242732
Reply
#3

With strcmp only:

pawn Код:
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;
}
Cheers!
Reply
#4

EDIT: cmd already done by Jeffry
Reply
#5

1st. It is not my code, taken from Kwarde's FS.

2nd. cmd could be zcmd aswell
Reply
#6

THNX
Reply
#7

Quote:
Originally Posted by xir
Посмотреть сообщение
1st. It is not my code, taken from Kwarde's FS.
2nd. cmd could be zcmd aswell
Yup, but many new scripters use strcmp.

Quote:
Originally Posted by misho1
Посмотреть сообщение
THNX
No problem.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)