SA-MP Forums Archive
/me - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /me (/showthread.php?tid=247989)



/me - misho1 - 11.04.2011

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


Re: /me - xir - 11.04.2011

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


Re: /me - Jeffry - 11.04.2011

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!


Re: /me - Alby Fire - 11.04.2011

EDIT: cmd already done by Jeffry


Re: /me - xir - 11.04.2011

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

2nd. cmd could be zcmd aswell


Re: /me - misho1 - 11.04.2011

THNX


Re: /me - Jeffry - 11.04.2011

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.