how to make /me with dmcd
#2

Use zcmd. It's a lot easier to use, and it's more efficient.

pawn Код:
CMD:me(playerid, params[]) { // Creating the command.
    if(isnull(params)) { // Checking if the player added anything after '/me'
        // They didn't. We'll show them the usage of the command
        SendClientMessage(playerid, 0xFF0000FF, "Usage: /me [action]"); // Sending them the usage as a message
    }
    else { // They did the opposite here. They did type something.
        new
            _playerNameSz[MAX_PLAYER_NAME], // Creating a variable to get the players name
            _msgSz[128]; // 128 is the maximum limit of text per line

        GetPlayerName(playerid, _playerNameSz, MAX_PLAYER_NAME); // Get the players name
        format(_msgSz, sizeof(_msgSz), "* %s %s", _playerNameSz, _msgSz); // Format the message
        SendClientMessageToAll(0xFF0000FF, _msgSz); // Send the /me message to everyone
    }
   
    return 1; // Return 1 so zcmd acknowledges that the command worked
}
Excuse the name for strings and whatnot, it's the coding style I use, but zcmd is pretty simple to use. That's literally all you have to add for your /me command, other than '#include <zcmd>' at the top of your script.
Reply


Messages In This Thread
[UNSOLVED]how to make /me with dmcd - by [WSF]ThA_Devil - 26.10.2010, 06:39
Re: how to make /me with dmcd - by Calgon - 26.10.2010, 06:46
Re: how to make /me with dmcd - by [WSF]ThA_Devil - 26.10.2010, 06:47
Re: how to make /me with dmcd - by [WSF]ThA_Devil - 26.10.2010, 06:51
Re: how to make /me with dmcd - by Calgon - 26.10.2010, 06:53
Re: how to make /me with dmcd - by [WSF]ThA_Devil - 26.10.2010, 06:54
Re: how to make /me with dmcd - by [WSF]ThA_Devil - 26.10.2010, 06:59
Re: how to make /me with dmcd - by Calgon - 26.10.2010, 07:01
Re: how to make /me with dmcd - by [WSF]ThA_Devil - 26.10.2010, 07:02

Forum Jump:


Users browsing this thread: 1 Guest(s)