how to make /me with dmcd
#1

please help! how to make /me with dcmd!
im not so pro scripter..... so plz help me....
Reply
#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
#3

ok thx! i ll try to learn zcmd!
Reply
#4

wtf?
pawn Код:
warning 203: symbol is never used: "me"
Reply
#5

Quote:
Originally Posted by [WSF]ThA_Devil
Посмотреть сообщение
wtf?
pawn Код:
warning 203: symbol is never used: "me"
Have you included zcmd? You don't need to enclose the code in any other functions.
Reply
#6

oh

no xD xD
Reply
#7

when i do /me cmd it just shows my username and thats all!
Reply
#8

Sorry, replace:

pawn Код:
format(_msgSz, sizeof(_msgSz), "* %s %s", _playerNameSz, _msgSz);
with

pawn Код:
format(_msgSz, sizeof(_msgSz), "* %s %s", _playerNameSz, params);
Reply
#9

oh... params xD
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)