/me command
#1

anyone have a clue how can i make like a /me command or something?like this




_______________________
[GDZ]leader
Reply
#2

Check out released Roleplay scripts, there are many /me commands found in there.
Reply
#3

Here you go:

pawn Код:
if(!strcmp(cmdtext, "/me", true, 3))
    {
    if(cmdtext[3] == 0)
    {
    SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
    return 1;
    }
    new str[128], Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    format(str, sizeof(str), "* %s %s", Name, cmdtext[4]);
    SendClientMessageToAll(GetPlayerColor(playerid), str);
    return 1;
    }
Reply
#4

dw i'll do it..

pawn Код:
CMD:me(playerid, params[])
{
        if(isnull(params)) return SendClientMessage(playerid, 0xFFFFFFFF, "/me [text]");
        new string[128],pName[20 char];
        GetPlayerName(playerid, pName, sizeof(pName));
        format(string, sizeof(string), "* %s %s *", pName, params);
        return SendClientMessageToAll(0xFFFFFFFF, string);
}
[edit]wow jeffery beat me amg
Reply
#5

It's a basic command with parameters.

Learn how to make commands first.

https://sampwiki.blast.hk/wiki/Fast_Commands
Reply
#6

thx jeffry
Reply
#7

Well I've been a bit confused about jeffry's thingy, you might try this:

pawn Код:
if(!strcmp(cmdtext, "/me", true))
    {
    if(cmdtext[4] == ' ') return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
    new str[128], Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    format(str, sizeof(str), "* %s %s", Name, cmdtext[4]);
    SendClientMessageToAll(GetPlayerColor(playerid), str);
    return 1;
    }
Edit from Jeffry's
Reply
#8

@Hiddos: Iґm using this in my server, and it works.

@FireCat: Have fun.
Reply
#9

I agree with MadeMan here is a scripting help not script requesting! :P Um I think there is a forum in this forum on script requests use that, or either LEARN to code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)